mirror of
https://github.com/Relintai/tile_map_backport.git
synced 2024-11-09 03:12:09 +01:00
Fixed the remaining methodbind issues.
This commit is contained in:
parent
34ae407df1
commit
96ddaa1201
@ -2444,8 +2444,8 @@ Map<Vector2i, RTileMapQuadrant> *RTileMap::get_quadrant_map(int p_layer) {
|
|||||||
return &layers[p_layer].quadrant_map;
|
return &layers[p_layer].quadrant_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2i RTileMap::get_coords_for_body_rid(RID p_physics_body) {
|
Vector2 RTileMap::get_coords_for_body_rid(RID p_physics_body) {
|
||||||
ERR_FAIL_COND_V_MSG(!bodies_coords.has(p_physics_body), Vector2i(), vformat("No tiles for the given body RID %d.", p_physics_body));
|
ERR_FAIL_COND_V_MSG(!bodies_coords.has(p_physics_body), Vector2(), vformat("No tiles for the given body RID %d.", p_physics_body));
|
||||||
return bodies_coords[p_physics_body];
|
return bodies_coords[p_physics_body];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2771,7 +2771,7 @@ void RTileMap::_get_property_list(List<PropertyInfo> *p_list) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 RTileMap::map_to_world(const Vector2i &p_pos) const {
|
Vector2 RTileMap::map_to_world(const Vector2 &p_pos) const {
|
||||||
// SHOULD RETURN THE CENTER OF THE TILE
|
// SHOULD RETURN THE CENTER OF THE TILE
|
||||||
ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2());
|
ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2());
|
||||||
|
|
||||||
@ -2848,7 +2848,7 @@ Vector2 RTileMap::map_to_world(const Vector2i &p_pos) const {
|
|||||||
return (ret + Vector2(0.5, 0.5)) * tile_set->get_tile_size();
|
return (ret + Vector2(0.5, 0.5)) * tile_set->get_tile_size();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2i RTileMap::world_to_map(const Vector2 &p_pos) const {
|
Vector2 RTileMap::world_to_map(const Vector2 &p_pos) const {
|
||||||
ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2i());
|
ERR_FAIL_COND_V(!tile_set.is_valid(), Vector2i());
|
||||||
|
|
||||||
Vector2 ret = p_pos;
|
Vector2 ret = p_pos;
|
||||||
@ -3057,7 +3057,9 @@ bool RTileMap::is_existing_neighbor(RTileSet::CellNeighbor p_cell_neighbor) cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2i RTileMap::get_neighbor_cell(const Vector2i &p_coords, RTileSet::CellNeighbor p_cell_neighbor) const {
|
Vector2 RTileMap::get_neighbor_cell(const Vector2 &p_coordsv, RTileSet::CellNeighbor p_cell_neighbor) const {
|
||||||
|
Vector2i p_coords = p_coordsv;
|
||||||
|
|
||||||
ERR_FAIL_COND_V(!tile_set.is_valid(), p_coords);
|
ERR_FAIL_COND_V(!tile_set.is_valid(), p_coords);
|
||||||
|
|
||||||
RTileSet::TileShape shape = tile_set->get_tile_shape();
|
RTileSet::TileShape shape = tile_set->get_tile_shape();
|
||||||
|
@ -349,11 +349,11 @@ public:
|
|||||||
virtual bool is_y_sort_enabled() const;
|
virtual bool is_y_sort_enabled() const;
|
||||||
virtual void set_y_sort_enabled(bool p_enable);
|
virtual void set_y_sort_enabled(bool p_enable);
|
||||||
|
|
||||||
Vector2 map_to_world(const Vector2i &p_pos) const;
|
Vector2 map_to_world(const Vector2 &p_pos) const;
|
||||||
Vector2i world_to_map(const Vector2 &p_pos) const;
|
Vector2 world_to_map(const Vector2 &p_pos) const;
|
||||||
|
|
||||||
bool is_existing_neighbor(RTileSet::CellNeighbor p_cell_neighbor) const;
|
bool is_existing_neighbor(RTileSet::CellNeighbor p_cell_neighbor) const;
|
||||||
Vector2i get_neighbor_cell(const Vector2i &p_coords, RTileSet::CellNeighbor p_cell_neighbor) const;
|
Vector2 get_neighbor_cell(const Vector2 &p_coords, RTileSet::CellNeighbor p_cell_neighbor) const;
|
||||||
|
|
||||||
Vector<Vector2> get_used_cells(int p_layer) const;
|
Vector<Vector2> get_used_cells(int p_layer) const;
|
||||||
Rect2 get_used_rect(); // Not const because of cache
|
Rect2 get_used_rect(); // Not const because of cache
|
||||||
@ -366,7 +366,7 @@ public:
|
|||||||
//virtual void set_texture_repeat(CanvasItem::TextureRepeat p_texture_repeat) override;
|
//virtual void set_texture_repeat(CanvasItem::TextureRepeat p_texture_repeat) override;
|
||||||
|
|
||||||
// For finding tiles from collision.
|
// For finding tiles from collision.
|
||||||
Vector2i get_coords_for_body_rid(RID p_physics_body);
|
Vector2 get_coords_for_body_rid(RID p_physics_body);
|
||||||
|
|
||||||
// Fixing a nclearing methods.
|
// Fixing a nclearing methods.
|
||||||
void fix_invalid_tiles();
|
void fix_invalid_tiles();
|
||||||
|
Loading…
Reference in New Issue
Block a user