summaryrefslogtreecommitdiff
path: root/src/render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render.cpp')
-rw-r--r--src/render.cpp9
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(