summaryrefslogtreecommitdiffhomepage
path: root/src/chunk-scenery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chunk-scenery.cpp')
-rw-r--r--src/chunk-scenery.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp
index b89baeb9..7852088f 100644
--- a/src/chunk-scenery.cpp
+++ b/src/chunk-scenery.cpp
@@ -71,7 +71,7 @@ static void topological_sort(Array<chunk::entity_draw_order>& array, size_t size
fm_assert(output == (size_t)-1);
}
-auto chunk::make_topo_sort_data(const entity& e) -> topo_sort_data
+auto chunk::make_topo_sort_data(entity& e) -> topo_sort_data
{
const auto& a = *e.atlas;
const auto& f = a.frame(e.r, e.frame);
@@ -100,10 +100,12 @@ auto chunk::make_topo_sort_data(const entity& e) -> topo_sort_data
const auto bb_min = tile_shader::project(Vector3(Vector2(bb_min_[0], bb_max_[1]), 0));
const auto bb_max = tile_shader::project(Vector3(Vector2(bb_max_[0], bb_min_[1]), 0));
const auto bb_len = bb_max[0] - bb_min[0];
- if (bb_len >= 1 && a.info().pixel_size.x() > iTILE_SIZE[0])
+ if (bb_len >= 1 && f.size[0] > iTILE_SIZE[0])
{
data.slope = (bb_max[1]-bb_min[1])/bb_len;
data.mode = topo_sort_data::mode_static;
+ data.bb_min = Vector2s(bb_min);
+ data.bb_max = Vector2s(bb_max);
}
break;
}