diff options
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/render.cpp b/src/render.cpp index bcd28e1..57c1185 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -180,7 +180,7 @@ void state_t::render_tile(world::world_t *world, v2f_t tx, world::tile_t *tile) stats.tiles++; } -static rectf_t window_bounds(sf::RenderWindow *window) +rectf_t window_bounds(sf::RenderWindow *window) { const v2f_t margin(1.5f, 1.5f); @@ -197,18 +197,10 @@ static rectf_t window_bounds(sf::RenderWindow *window) bounds[0][1] = std::min({A[1], B[1], C[1], D[1]}); bounds[1][0] = std::max({A[0], B[0], C[0], D[0]}); bounds[1][1] = std::max({A[1], B[1], C[1], D[1]}); - bounds[0] -= margin; - bounds[1] += margin; return bounds; } -// NOTE: this includes the margin -rectf_t state_t::window_in_world_space(void) -{ - return window_bounds(window); -} - bool rendering_order(const world::entity_t *x, const world::entity_t *y) { return x->render_bounds[1][1] < y->render_bounds[1][1]; @@ -269,11 +261,14 @@ void state_t::render_layer(world::world_t *world, rect_t<world::coord_t, 2> &sec void state_t::render(world::world_t *world) { + const v2f_t margin = {1.5f, 1.5f}; rectf_t bounds; std::list<world::entity_t*> ents; rect_t<world::coord_t, 2> sectors; bounds = window_bounds(window); + bounds[0] -= margin; + bounds[1] += margin; sectors[0] = world::sector_index_at(bounds[0]); sectors[1] = world::sector_index_at(bounds[1]); |