diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-16 16:45:46 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-16 16:45:46 +0100 |
commit | 3b9e3afd449facf5c98ffee50247c80e293f8545 (patch) | |
tree | 34dd4c8a1038ec666b6ccbf69a74d9ff09b2b86c /src/render.cpp | |
parent | b13dc31b08cddf14ecfa6b8cf496cf4e7308083c (diff) |
Start adding decorations.
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/render.cpp b/src/render.cpp index 2e8447b..9dfa12b 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -10,9 +10,6 @@ state_t::state_t(sf::RenderWindow *window_) window = window_; font.loadFromFile("assets/FanwoodText.otf"); - - prng.seed(396); - perlin.generate(&prng, 16); } // FIXME: rename @@ -95,7 +92,7 @@ static void generate_tile_verts(sf::Vertex *verts, v2f_t tx, procgen::perlin_noi } } -void state_t::render_sector(world::sector_t *sector) +void state_t::render_sector(world::world_t *world, world::sector_t *sector) { for (ssize_t y = 0; y < SECTOR_SIZE; y++) for (ssize_t x = 0; x < SECTOR_SIZE; x++) { @@ -114,7 +111,7 @@ void state_t::render_sector(world::sector_t *sector) } sf::RenderStates states(texture); - generate_tile_verts(verts, tx, &perlin); + generate_tile_verts(verts, tx, &world->perlin); window->draw(verts, 8, sf::TrianglesFan, states); if (debug_draw_tile_coords) { @@ -156,7 +153,7 @@ void state_t::render(game::state_t *game) bbox[1] += margin; for (world::sector_t *sector : game->world.get_sectors(bbox)) - render_sector(sector); + render_sector(&game->world, sector); ents = game->world.get_render_entities(bbox); ents.sort( |