From 34ae407df14653594815b10f2fb042c3ab01dbf7 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 11 Dec 2021 19:23:38 +0100 Subject: [PATCH] Fixed more errors. --- rtile_map.cpp | 16 ++++++++++++---- rtile_map.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/rtile_map.cpp b/rtile_map.cpp index 6026408..d24a5ed 100644 --- a/rtile_map.cpp +++ b/rtile_map.cpp @@ -1376,14 +1376,16 @@ void RTileMap::draw_tile(RID p_canvas_item, Vector2i p_position, const Refget_tile_animation_frames_count(p_atlas_coords); frame++) { real_t frame_duration = atlas_source->get_tile_animation_frame_duration(p_atlas_coords, frame) / speed; - VisualServer::get_singleton()->canvas_item_add_animation_slice(p_canvas_item, animation_duration, time, time + frame_duration, 0.0); + //TODO + //VisualServer::get_singleton()->canvas_item_add_animation_slice(p_canvas_item, animation_duration, time, time + frame_duration, 0.0); Rect2i source_rect = atlas_source->get_runtime_tile_texture_region(p_atlas_coords, frame); - tex->draw_rect_region(p_canvas_item, dest_rect, source_rect, modulate, transpose, p_tile_set->is_uv_clipping()); + tex->draw_rect_region(p_canvas_item, dest_rect, source_rect, modulate, transpose, Ref(), p_tile_set->is_uv_clipping()); time += frame_duration; } - VisualServer::get_singleton()->canvas_item_add_animation_slice(p_canvas_item, 1.0, 0.0, 1.0, 0.0); + //TODO + //VisualServer::get_singleton()->canvas_item_add_animation_slice(p_canvas_item, 1.0, 0.0, 1.0, 0.0); } } } @@ -1713,7 +1715,13 @@ void RTileMap::_navigation_update_dirty_quadrants(SelfList::Li tile_transform.set_origin(map_to_world(E_cell->get())); RID region = Navigation2DServer::get_singleton()->region_create(); - Navigation2DServer::get_singleton()->region_set_map(region, get_world_2d()->get_navigation_map()); + + if (_nav_map == RID()) { + _nav_map = Navigation2DServer::get_singleton()->map_create(); + } + + //Navigation2DServer::get_singleton()->region_set_map(region, get_world_2d()->get_navigation_map()); + Navigation2DServer::get_singleton()->region_set_map(region, _nav_map); Navigation2DServer::get_singleton()->region_set_transform(region, tilemap_xform * tile_transform); Navigation2DServer::get_singleton()->region_set_navpoly(region, navpoly); q.navigation_regions[E_cell->get()].write[layer_index] = region; diff --git a/rtile_map.h b/rtile_map.h index d98e9a9..c2b7a38 100644 --- a/rtile_map.h +++ b/rtile_map.h @@ -185,6 +185,7 @@ private: bool used_rect_cache_dirty = true; bool _y_sort_enabled; + RID _nav_map; // TileMap layers. struct TileMapLayer {