1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Merge pull request #7401 from Zylann/bucket_fill_preview

Bucket fill preview
This commit is contained in:
Rémi Verschelde
2017-01-02 14:47:08 +01:00
committed by GitHub
2 changed files with 89 additions and 9 deletions

View File

@@ -106,6 +106,11 @@ class TileMapEditor : public VBoxContainer {
Point2i over_tile;
bool * bucket_cache_visited;
Rect2i bucket_cache_rect;
int bucket_cache_tile;
DVector<Vector2> bucket_cache;
struct CellOp {
int idx;
bool xf;
@@ -129,7 +134,7 @@ class TileMapEditor : public VBoxContainer {
void _pick_tile(const Point2& p_pos);
DVector<Vector2> _bucket_fill(const Point2i& p_start, bool erase=false);
DVector<Vector2> _bucket_fill(const Point2i& p_start, bool erase=false, bool preview=false);
void _fill_points(const DVector<Vector2> p_points, const Dictionary& p_op);
void _erase_points(const DVector<Vector2> p_points);
@@ -137,6 +142,9 @@ class TileMapEditor : public VBoxContainer {
void _select(const Point2i& p_from, const Point2i& p_to);
void _draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Matrix32& p_xform);
void _draw_fill_preview(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Matrix32& p_xform);
void _clear_bucket_cache();
void _update_copydata();
int get_selected_tile() const;
@@ -171,6 +179,7 @@ public:
void edit(Node *p_tile_map);
TileMapEditor(EditorNode *p_editor);
~TileMapEditor();
};
class TileMapEditorPlugin : public EditorPlugin {