From 60e13fb891ce4cb534d90a9d6f11db36856ab72c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 23 May 2018 22:46:35 -0400 Subject: renamed dark tile to wall --- src/main.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 1b7d198..7be82d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,7 +40,6 @@ using renderer_ptr = std::unique_ptr; enum class Tile { Floor, Wall, - Dark, Dust, Lamp }; @@ -104,7 +103,6 @@ void render( } case Tile::Wall: - case Tile::Dark: { SDL_SetRenderDrawColor(ren, 100, 100, 100, 255); break; @@ -135,7 +133,7 @@ void render( SDL_RenderPresent(ren); } -void incrementIfSet(Map& map, int& count, int x, int y, int w, int h, Tile val = Tile::Dark) +void incrementIfSet(Map& map, int& count, int x, int y, int w, int h, Tile val = Tile::Wall) { if ((x >= 0) && (x < w) && (y >= 0) && (y < h) && (map.tiles[x+w*y] == val)) { @@ -170,7 +168,7 @@ void tick(Map& map, int x1 = 0, int y1 = 0, int x2 = VIEW_WIDTH, int y2 = VIEW_H if (count >= 5) { - temp[x+VIEW_WIDTH*y] = Tile::Dark; + temp[x+VIEW_WIDTH*y] = Tile::Wall; } else { temp[x+VIEW_WIDTH*y] = Tile::Floor; } @@ -216,7 +214,7 @@ void recalculateLighting(Map& map, fov_settings_type* fov) x < VIEW_WIDTH && y >= 0 && y < VIEW_HEIGHT && - static_cast(map)->tiles.at(x+VIEW_WIDTH*y) == Tile::Dark; + static_cast(map)->tiles.at(x+VIEW_WIDTH*y) == Tile::Wall; }); fov_settings_set_apply_lighting_function( @@ -317,7 +315,7 @@ int main(int, char**) { if (std::bernoulli_distribution(0.5)(rng)) { - map.tiles[x+y*VIEW_WIDTH] = Tile::Dark; + map.tiles[x+y*VIEW_WIDTH] = Tile::Wall; } } } @@ -388,7 +386,7 @@ int main(int, char**) x < VIEW_WIDTH && y >= 0 && y < VIEW_HEIGHT && - static_cast(map)->tiles.at(x+VIEW_WIDTH*y) == Tile::Dark; + static_cast(map)->tiles.at(x+VIEW_WIDTH*y) == Tile::Wall; }); fov_settings_set_apply_lighting_function( -- cgit 1.4.1