Skip to content

Commit

Permalink
Merge pull request godotengine#84004 from groud/support_y_sort_with_r…
Browse files Browse the repository at this point in the history
…untime_data

Fix Y-sort origin not working when set in TileMap runtime updates
  • Loading branch information
akien-mga committed Oct 26, 2023
2 parents c5c90fd + 3b5a288 commit 09946f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scene/2d/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,13 @@ void TileMapLayer::_rendering_quadrants_update_cell(CellData &r_cell_data, SelfL
TileSetAtlasSource *atlas_source = Object::cast_to<TileSetAtlasSource>(source);
if (atlas_source && atlas_source->has_tile(r_cell_data.cell.get_atlas_coords()) && atlas_source->has_alternative_tile(r_cell_data.cell.get_atlas_coords(), r_cell_data.cell.alternative_tile)) {
is_valid = true;
tile_y_sort_origin = atlas_source->get_tile_data(r_cell_data.cell.get_atlas_coords(), r_cell_data.cell.alternative_tile)->get_y_sort_origin();
const TileData *tile_data;
if (r_cell_data.runtime_tile_data_cache) {
tile_data = r_cell_data.runtime_tile_data_cache;
} else {
tile_data = atlas_source->get_tile_data(r_cell_data.cell.get_atlas_coords(), r_cell_data.cell.alternative_tile);
}
tile_y_sort_origin = tile_data->get_y_sort_origin();
}
}

Expand Down

0 comments on commit 09946f7

Please sign in to comment.