From d7d65fa2f2b51d03f7bdfcbceedca99188ce979c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 19 Feb 2014 11:57:14 -0300 Subject: -improved physics ccd -html5 exporter works again -disable repeat on image loader by default -can change shape offset en tileset, texture offset was broken --- scene/2d/tile_map.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scene/2d/tile_map.cpp') diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 26efa99a88..b9e44d5053 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -181,7 +181,7 @@ void TileMap::_update_dirty_quadrants() { if (!tile_set->has_tile(c.id)) continue; Ref tex = tile_set->tile_get_texture(c.id); - Vector2 tile_ofs = tile_set->tile_get_offset(c.id); + Vector2 tile_ofs = tile_set->tile_get_texture_offset(c.id); Vector2 offset = Point2( E->key().x, E->key().y )*cell_size - q.pos; @@ -215,6 +215,7 @@ void TileMap::_update_dirty_quadrants() { rect.size.y=-rect.size.y; + rect.pos+=tile_ofs; if (r==Rect2()) { tex->draw_rect(q.canvas_item,rect); @@ -231,8 +232,9 @@ void TileMap::_update_dirty_quadrants() { Ref shape = shapes[i]; if (shape.is_valid()) { + Vector2 shape_ofs = tile_set->tile_get_shape_offset(c.id); Matrix32 xform; - xform.set_origin(offset.floor()); + xform.set_origin(offset.floor()+shape_ofs); if (c.flip_h) { xform.elements[0]=-xform.elements[0]; xform.elements[2].x+=s.x; @@ -242,6 +244,7 @@ void TileMap::_update_dirty_quadrants() { xform.elements[2].y+=s.y; } + ps->body_add_shape(q.static_body,shape->get_rid(),xform); } } -- cgit v1.2.3