summaryrefslogtreecommitdiff
path: root/scene/2d/tile_map.cpp
diff options
context:
space:
mode:
authorGilles Roudière <gilles.roudiere@gmail.com>2021-05-24 17:30:37 +0200
committerGilles Roudière <gilles.roudiere@gmail.com>2021-05-24 17:41:29 +0200
commitf4e8c68e00b6de8f49b9d86513b451d5152186c5 (patch)
tree735d04f1ef32eae82685795b8eebc0f8b57bf825 /scene/2d/tile_map.cpp
parent635d0c9b449e34267b52a237f7ce21838d90b6ce (diff)
Fixes deprecated=no compilation option
Diffstat (limited to 'scene/2d/tile_map.cpp')
-rw-r--r--scene/2d/tile_map.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 188f8d300d..8666361e88 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -777,6 +777,11 @@ void TileMap::_set_tile_data(const Vector<int> &p_data) {
int offset = (format >= FORMAT_2) ? 3 : 2;
clear();
+
+#ifdef DISABLE_DEPRECATED
+ ERR_FAIL_COND_MSG(format != FORMAT_3, vformat("Cannot handle deprecated TileMap data format version %d. This Godot version was compiled with no support for deprecated data.", format));
+#endif
+
for (int i = 0; i < c; i += offset) {
const uint8_t *ptr = (const uint8_t *)&r[i];
uint8_t local[12];
@@ -806,6 +811,7 @@ void TileMap::_set_tile_data(const Vector<int> &p_data) {
uint16_t alternative_tile = decode_uint16(&local[10]);
set_cell(Vector2i(x, y), source_id, Vector2i(atlas_coords_x, atlas_coords_y), alternative_tile);
} else {
+#ifndef DISABLE_DEPRECATED
uint32_t v = decode_uint32(&local[4]);
v &= (1 << 29) - 1;
@@ -828,6 +834,7 @@ void TileMap::_set_tile_data(const Vector<int> &p_data) {
}
set_cell(Vector2i(x, y), v, Vector2i(coord_x, coord_y), compatibility_alternative_tile);
+#endif
}
}
}