Implement TileMap patterns palette
This commit is contained in:
parent
4387f9645b
commit
1a95f893c4
18 changed files with 1163 additions and 400 deletions
|
|
@ -53,6 +53,7 @@ private:
|
|||
Control *tilemap_toolbar;
|
||||
TileMapEditor *tilemap_editor;
|
||||
|
||||
Control *tileset_toolbar;
|
||||
TileSetEditor *tileset_editor;
|
||||
|
||||
void _update_switch_button();
|
||||
|
|
@ -63,6 +64,23 @@ private:
|
|||
float atlas_view_zoom = 1.0;
|
||||
Vector2 atlas_view_scroll = Vector2();
|
||||
|
||||
// Patterns preview generation.
|
||||
struct QueueItem {
|
||||
Ref<TileSet> tile_set;
|
||||
Ref<TileMapPattern> pattern;
|
||||
Callable callback;
|
||||
};
|
||||
List<QueueItem> pattern_preview_queue;
|
||||
Mutex pattern_preview_mutex;
|
||||
Semaphore pattern_preview_sem;
|
||||
Thread pattern_preview_thread;
|
||||
SafeFlag pattern_thread_exit;
|
||||
SafeFlag pattern_thread_exited;
|
||||
mutable SafeFlag pattern_preview_done;
|
||||
void _pattern_preview_done(const Variant &p_udata);
|
||||
static void _thread_func(void *ud);
|
||||
void _thread();
|
||||
|
||||
void _tile_map_changed();
|
||||
|
||||
protected:
|
||||
|
|
@ -82,6 +100,9 @@ public:
|
|||
void set_atlas_view_transform(float p_zoom, Vector2 p_scroll);
|
||||
void synchronize_atlas_view(Object *p_current);
|
||||
|
||||
// Pattern preview API.
|
||||
void queue_pattern_preview(Ref<TileSet> p_tile_set, Ref<TileMapPattern> p_pattern, Callable p_callback);
|
||||
|
||||
void edit(Object *p_object);
|
||||
|
||||
TilesEditor(EditorNode *p_editor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue