summaryrefslogtreecommitdiff
path: root/scene/2d/tile_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/tile_map.h')
-rw-r--r--scene/2d/tile_map.h61
1 files changed, 30 insertions, 31 deletions
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index b1e54aafae..cfed4c0743 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -70,22 +70,22 @@ private:
};
Ref<TileSet> tile_set;
- Size2i cell_size;
- int quadrant_size;
- Mode mode;
- Transform2D custom_transform;
- HalfOffset half_offset;
- bool use_parent;
- CollisionObject2D *collision_parent;
- bool use_kinematic;
- Navigation2D *navigation;
+ Size2i cell_size = Size2(64, 64);
+ int quadrant_size = 16;
+ Mode mode = MODE_SQUARE;
+ Transform2D custom_transform = Transform2D(64, 0, 0, 64, 0, 0);
+ HalfOffset half_offset = HALF_OFFSET_DISABLED;
+ bool use_parent = false;
+ CollisionObject2D *collision_parent = nullptr;
+ bool use_kinematic = false;
+ Navigation2D *navigation = nullptr;
union PosKey {
struct {
int16_t x;
int16_t y;
};
- uint32_t key;
+ uint32_t key = 0;
//using a more precise comparison so the regions can be sorted later
bool operator<(const PosKey &p_k) const { return (y == p_k.y) ? x < p_k.x : y < p_k.y; }
@@ -119,8 +119,7 @@ private:
int16_t autotile_coord_y : 16;
};
- uint64_t _u64t;
- Cell() { _u64t = 0; }
+ uint64_t _u64t = 0;
};
Map<PosKey, Cell> tile_map;
@@ -130,7 +129,7 @@ private:
Vector2 pos;
List<RID> canvas_items;
RID body;
- uint32_t shape_owner_id;
+ uint32_t shape_owner_id = 0;
SelfList<Quadrant> dirty_list;
@@ -176,27 +175,27 @@ private:
SelfList<Quadrant>::List dirty_quadrant_list;
- bool pending_update;
+ bool pending_update = false;
Rect2 rect_cache;
- bool rect_cache_dirty;
+ bool rect_cache_dirty = true;
Rect2 used_size_cache;
- bool used_size_cache_dirty;
- bool quadrant_order_dirty;
- bool use_y_sort;
- bool compatibility_mode;
- bool centered_textures;
- bool clip_uv;
- float fp_adjust;
- float friction;
- float bounce;
- uint32_t collision_layer;
- uint32_t collision_mask;
- mutable DataFormat format;
-
- TileOrigin tile_origin;
-
- int occluder_light_mask;
+ bool used_size_cache_dirty = true;
+ bool quadrant_order_dirty = false;
+ bool use_y_sort = false;
+ bool compatibility_mode = false;
+ bool centered_textures = false;
+ bool clip_uv = false;
+ float fp_adjust = 0.00001;
+ float friction = 1.0;
+ float bounce = 0.0;
+ uint32_t collision_layer = 1;
+ uint32_t collision_mask = 1;
+ mutable DataFormat format = FORMAT_1; // Assume lowest possible format if none is present
+
+ TileOrigin tile_origin = TILE_ORIGIN_TOP_LEFT;
+
+ int occluder_light_mask = 1;
void _fix_cell_transform(Transform2D &xform, const Cell &p_cell, const Vector2 &p_offset, const Size2 &p_sc);