summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorCarl Olsson <carl.olsson@gmail.com>2015-02-11 21:11:14 +1000
committerCarl Olsson <carl.olsson@gmail.com>2015-02-11 21:11:14 +1000
commit9171f71ff55def0f661a3d76e4ebcfc945092ad3 (patch)
treec59827484e69443e4f726e9780c676cb4e318116 /scene
parentafa13bf868239191bf2ef95ff3b039729f4bd2e1 (diff)
Revert variant arg length to 5 and add 5 arg wrapper function for TileMap set_cell.
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/tile_map.cpp5
-rw-r--r--scene/2d/tile_map.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 0b123bfa1c..77558bd7b4 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -439,6 +439,10 @@ void TileMap::set_cell(int p_x,int p_y,int p_tile,bool p_flip_x,bool p_flip_y,bo
}
+void TileMap::_set_cell(Point2 pos,int p_tile,bool p_flip_x,bool p_flip_y,bool p_transpose) {
+ set_cell(floor(pos.x), floor(pos.y), p_tile, p_flip_x, p_flip_y, p_transpose);
+}
+
int TileMap::get_cell(int p_x,int p_y) const {
PosKey pk(p_x,p_y);
@@ -830,6 +834,7 @@ void TileMap::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_collision_bounce"),&TileMap::get_collision_bounce);
ObjectTypeDB::bind_method(_MD("set_cell","x","y","tile","flip_x","flip_y","transpose"),&TileMap::set_cell,DEFVAL(false),DEFVAL(false),DEFVAL(false));
+ ObjectTypeDB::bind_method(_MD("_set_cell","pos","tile","flip_x","flip_y","transpose"),&TileMap::_set_cell,DEFVAL(false),DEFVAL(false),DEFVAL(false));
ObjectTypeDB::bind_method(_MD("get_cell","x","y"),&TileMap::get_cell);
ObjectTypeDB::bind_method(_MD("is_cell_x_flipped","x","y"),&TileMap::is_cell_x_flipped);
ObjectTypeDB::bind_method(_MD("is_cell_y_flipped","x","y"),&TileMap::is_cell_y_flipped);
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index 2809cdb378..fb366ab7e8 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -169,6 +169,7 @@ public:
bool get_center_y() const;
void set_cell(int p_x,int p_y,int p_tile,bool p_flip_x=false,bool p_flip_y=false,bool p_transpose=false);
+ void _set_cell(Point2 pos,int p_tile,bool p_flip_x=false,bool p_flip_y=false,bool p_transpose=false);
int get_cell(int p_x,int p_y) const;
bool is_cell_x_flipped(int p_x,int p_y) const;
bool is_cell_y_flipped(int p_x,int p_y) const;