Skip to content

Commit

Permalink
Revert back to simple black and white for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumbub committed Mar 20, 2022
1 parent cea4098 commit 34755bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/graphics/renderBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
#include "../logic/board.h"
#include "renderBoard.h"

constexpr uint32_t COLOR_DEAD = 0x10dd0000;
constexpr uint32_t COLOR_ALIVE = 0xffffffff - COLOR_DEAD;
constexpr uint64_t BLACK = 0xff000000;
constexpr uint64_t WHITE_TRANSPARENT = 0x00ffffff;

void renderBoard(Board& board, sf::RenderWindow& window, sf::Sprite& sprite, sf::Texture& texture, sf::Uint32* pixels) {
const uint limitI = board.rawWidth * board.rawHeight - board.rawWidth;
for (uint i = board.rawWidth; i < limitI; i++) {
pixels[i] = COLOR_DEAD + COLOR_ALIVE * board.output[i];
pixels[i] = BLACK + WHITE_TRANSPARENT * board.output[i];
}

texture.update(reinterpret_cast<sf::Uint8*>(pixels));
Expand Down

0 comments on commit 34755bb

Please sign in to comment.