diff --git a/modules/paint/actions/brighten_action.cpp b/modules/paint/actions/brighten_action.cpp index cc72c48fd..db8bb5b84 100644 --- a/modules/paint/actions/brighten_action.cpp +++ b/modules/paint/actions/brighten_action.cpp @@ -35,8 +35,8 @@ void BrightenAction::set_brighten_color(const float val) { brighten_color = val; } -void BrightenAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void BrightenAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); PoolVector2iArray pixels = PaintUtilities::get_pixels_in_line(data[0], data[1]); diff --git a/modules/paint/actions/brighten_action.h b/modules/paint/actions/brighten_action.h index 156517c8e..e4249caf1 100644 --- a/modules/paint/actions/brighten_action.h +++ b/modules/paint/actions/brighten_action.h @@ -36,7 +36,7 @@ public: float get_brighten_color(); void set_brighten_color(const float val); - void do_action(PaintCanvasOld *canvas, const Array &data); + void do_action_old(PaintCanvasOld *canvas, const Array &data); BrightenAction(); ~BrightenAction(); diff --git a/modules/paint/actions/brush_action.cpp b/modules/paint/actions/brush_action.cpp index 7f664856e..b4bbc551d 100644 --- a/modules/paint/actions/brush_action.cpp +++ b/modules/paint/actions/brush_action.cpp @@ -29,8 +29,8 @@ SOFTWARE. #include "../deprecated/paint_canvas_layer.h" #include "../paint_utilities.h" -void BrushAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void BrushAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); PoolVector2iArray pixels = PaintUtilities::get_pixels_in_line(data[0], data[1]); int brush_type = data[3]; diff --git a/modules/paint/actions/brush_action.h b/modules/paint/actions/brush_action.h index a4614f3da..170af366c 100644 --- a/modules/paint/actions/brush_action.h +++ b/modules/paint/actions/brush_action.h @@ -33,7 +33,7 @@ class BrushAction : public PaintAction { GDCLASS(BrushAction, PaintAction); public: - void do_action(PaintCanvasOld *canvas, const Array &data); + void do_action_old(PaintCanvasOld *canvas, const Array &data); BrushAction(); ~BrushAction(); diff --git a/modules/paint/actions/bucket_action.cpp b/modules/paint/actions/bucket_action.cpp index beaf35954..0334fdb60 100644 --- a/modules/paint/actions/bucket_action.cpp +++ b/modules/paint/actions/bucket_action.cpp @@ -28,8 +28,8 @@ SOFTWARE. #include "../deprecated/paint_canvas_layer.h" #include "../paint_utilities.h" -void BucketAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void BucketAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); Vector2i pos = data[0]; diff --git a/modules/paint/actions/bucket_action.h b/modules/paint/actions/bucket_action.h index 32b8f4cdb..111640443 100644 --- a/modules/paint/actions/bucket_action.h +++ b/modules/paint/actions/bucket_action.h @@ -33,7 +33,7 @@ class BucketAction : public PaintAction { GDCLASS(BucketAction, PaintAction); public: - void do_action(PaintCanvasOld *canvas, const Array &data); + void do_action_old(PaintCanvasOld *canvas, const Array &data); BucketAction(); ~BucketAction(); diff --git a/modules/paint/actions/cut_action.cpp b/modules/paint/actions/cut_action.cpp index c26ec60f2..8b86d9117 100644 --- a/modules/paint/actions/cut_action.cpp +++ b/modules/paint/actions/cut_action.cpp @@ -60,8 +60,8 @@ bool CutAction::can_commit() { return false; //ugly way of handling a cut } -void CutAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void CutAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); if (!mouse_start_pos_set) { mouse_start_pos = data[0]; @@ -91,7 +91,7 @@ void CutAction::do_action(PaintCanvasOld *canvas, const Array &data) { } } -void CutAction::commit_action(PaintCanvasOld *canvas) { +void CutAction::commit_action_old(PaintCanvasOld *canvas) { canvas->clear_preview_layer(); Vector2i p = mouse_start_pos; Vector2i s = mouse_end_pos - mouse_start_pos; diff --git a/modules/paint/actions/cut_action.h b/modules/paint/actions/cut_action.h index 389c7bec5..eaa4c5a05 100644 --- a/modules/paint/actions/cut_action.h +++ b/modules/paint/actions/cut_action.h @@ -47,8 +47,8 @@ public: bool can_commit(); - void do_action(PaintCanvasOld *canvas, const Array &data); - void commit_action(PaintCanvasOld *canvas); + void do_action_old(PaintCanvasOld *canvas, const Array &data); + void commit_action_old(PaintCanvasOld *canvas); CutAction(); ~CutAction(); diff --git a/modules/paint/actions/darken_action.cpp b/modules/paint/actions/darken_action.cpp index 2dfdd493e..9086fd622 100644 --- a/modules/paint/actions/darken_action.cpp +++ b/modules/paint/actions/darken_action.cpp @@ -35,8 +35,8 @@ void DarkenAction::set_dark_factor(const float val) { dark_factor = val; } -void DarkenAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void DarkenAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); PoolVector2iArray pixels = PaintUtilities::get_pixels_in_line(data[0], data[1]); diff --git a/modules/paint/actions/darken_action.h b/modules/paint/actions/darken_action.h index b8eda4ae8..f7a9e7335 100644 --- a/modules/paint/actions/darken_action.h +++ b/modules/paint/actions/darken_action.h @@ -36,7 +36,7 @@ public: float get_dark_factor(); void set_dark_factor(const float val); - void do_action(PaintCanvasOld *canvas, const Array &data); + void do_action_old(PaintCanvasOld *canvas, const Array &data); DarkenAction(); ~DarkenAction(); diff --git a/modules/paint/actions/line_action.cpp b/modules/paint/actions/line_action.cpp index d234b45a7..9a529bee5 100644 --- a/modules/paint/actions/line_action.cpp +++ b/modules/paint/actions/line_action.cpp @@ -42,8 +42,8 @@ void LineAction::set_mouse_start_pos_set(const bool val) { mouse_start_pos_set = val; } -void LineAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void LineAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); if (!mouse_start_pos_set) { mouse_start_pos = data[0]; @@ -74,7 +74,7 @@ void LineAction::do_action(PaintCanvasOld *canvas, const Array &data) { } } -void LineAction::commit_action(PaintCanvasOld *canvas) { +void LineAction::commit_action_old(PaintCanvasOld *canvas) { canvas->clear_preview_layer(); for (int i = 0; i < preview_cells.size(); ++i) { diff --git a/modules/paint/actions/line_action.h b/modules/paint/actions/line_action.h index d6aea5a88..e12ddafef 100644 --- a/modules/paint/actions/line_action.h +++ b/modules/paint/actions/line_action.h @@ -39,8 +39,8 @@ public: bool get_mouse_start_pos_set(); void set_mouse_start_pos_set(const bool val); - void do_action(PaintCanvasOld *canvas, const Array &data); - void commit_action(PaintCanvasOld *canvas); + void do_action_old(PaintCanvasOld *canvas, const Array &data); + void commit_action_old(PaintCanvasOld *canvas); bool can_commit(); LineAction(); diff --git a/modules/paint/actions/multiline_action.cpp b/modules/paint/actions/multiline_action.cpp index 69356c82f..df009ce99 100644 --- a/modules/paint/actions/multiline_action.cpp +++ b/modules/paint/actions/multiline_action.cpp @@ -32,8 +32,8 @@ bool MultiLineAction::can_commit() { return false; } -void MultiLineAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void MultiLineAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); PoolVector2iArray pixels = PaintUtilities::get_pixels_in_line(data[0], data[1]); diff --git a/modules/paint/actions/multiline_action.h b/modules/paint/actions/multiline_action.h index 28032b8bc..4e5c41def 100644 --- a/modules/paint/actions/multiline_action.h +++ b/modules/paint/actions/multiline_action.h @@ -35,8 +35,8 @@ class MultiLineAction : public PaintAction { public: bool can_commit(); - void do_action(PaintCanvasOld *canvas, const Array &data); - //void commit_action(PaintCanvasOld *canvas); + void do_action_old(PaintCanvasOld *canvas, const Array &data); + //void commit_action_old(PaintCanvasOld *canvas); MultiLineAction(); ~MultiLineAction(); diff --git a/modules/paint/actions/paint_action.cpp b/modules/paint/actions/paint_action.cpp index e2860bf47..5624a4cdb 100644 --- a/modules/paint/actions/paint_action.cpp +++ b/modules/paint/actions/paint_action.cpp @@ -105,18 +105,18 @@ void PaintAction::set_action_data(const Dictionary &val) { action_data = val; } -void PaintAction::do_action(PaintCanvasOld *canvas, const Array &data) { +void PaintAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { layer = canvas->get_active_layer(); } -void PaintAction::commit_action(PaintCanvasOld *canvas) { +void PaintAction::commit_action_old(PaintCanvasOld *canvas) { } -void PaintAction::undo_action(PaintCanvasOld *canvas) { +void PaintAction::undo_action_old(PaintCanvasOld *canvas) { for (int idx = 0; idx < undo_cells.size(); ++idx) { canvas->_set_pixel_v(layer, undo_cells[idx], undo_colors[idx]); } } -void PaintAction::redo_action(PaintCanvasOld *canvas) { +void PaintAction::redo_action_old(PaintCanvasOld *canvas) { for (int idx = 0; idx < redo_cells.size(); ++idx) { canvas->_set_pixel_v(layer, redo_cells[idx], redo_colors[idx]); } diff --git a/modules/paint/actions/paint_action.h b/modules/paint/actions/paint_action.h index 833c691cd..ef6aa8934 100644 --- a/modules/paint/actions/paint_action.h +++ b/modules/paint/actions/paint_action.h @@ -73,11 +73,12 @@ public: Dictionary get_action_data(); void set_action_data(const Dictionary &val); - virtual void do_action(PaintCanvasOld *canvas, const Array &data); - virtual void commit_action(PaintCanvasOld *canvas); + virtual void do_action_old(PaintCanvasOld *canvas, const Array &data); + virtual void commit_action_old(PaintCanvasOld *canvas); + + virtual void undo_action_old(PaintCanvasOld *canvas); + virtual void redo_action_old(PaintCanvasOld *canvas); - virtual void undo_action(PaintCanvasOld *canvas); - virtual void redo_action(PaintCanvasOld *canvas); virtual bool can_commit(); virtual PoolVector2iArray get_x_sym_points(const int canvas_width, const Vector2i &pixel); diff --git a/modules/paint/actions/paste_cut_action.cpp b/modules/paint/actions/paste_cut_action.cpp index 49f4bb10a..78bccb8ef 100644 --- a/modules/paint/actions/paste_cut_action.cpp +++ b/modules/paint/actions/paste_cut_action.cpp @@ -34,8 +34,8 @@ SOFTWARE. //arr.append(_selection_colors); //arr.append(_cut_pos); //arr.append(_cut_size); -void PasteCutAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void PasteCutAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); PoolVector2iArray pixels = PaintUtilities::get_pixels_in_line(data[0], data[1]); Vector2i cut_pos = data[4]; diff --git a/modules/paint/actions/paste_cut_action.h b/modules/paint/actions/paste_cut_action.h index da7c61c9a..8bb5bd100 100644 --- a/modules/paint/actions/paste_cut_action.h +++ b/modules/paint/actions/paste_cut_action.h @@ -33,7 +33,7 @@ class PasteCutAction : public PaintAction { GDCLASS(PasteCutAction, PaintAction); public: - void do_action(PaintCanvasOld *canvas, const Array &data); + void do_action_old(PaintCanvasOld *canvas, const Array &data); PasteCutAction(); ~PasteCutAction(); diff --git a/modules/paint/actions/pencil_action.cpp b/modules/paint/actions/pencil_action.cpp index e42a99e5d..ed0eab808 100644 --- a/modules/paint/actions/pencil_action.cpp +++ b/modules/paint/actions/pencil_action.cpp @@ -29,8 +29,8 @@ SOFTWARE. #include "../paint_utilities.h" #include "core/string/print_string.h" -void PencilAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void PencilAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); Color c = data[2]; diff --git a/modules/paint/actions/pencil_action.h b/modules/paint/actions/pencil_action.h index e32cf4fcd..b86a4c609 100644 --- a/modules/paint/actions/pencil_action.h +++ b/modules/paint/actions/pencil_action.h @@ -33,7 +33,7 @@ class PencilAction : public PaintAction { GDCLASS(PencilAction, PaintAction); public: - void do_action(PaintCanvasOld *canvas, const Array &data); + void do_action_old(PaintCanvasOld *canvas, const Array &data); void _set_pixel(PaintCanvasOld *canvas, Vector2i pixel, Color color); diff --git a/modules/paint/actions/rainbow_action.cpp b/modules/paint/actions/rainbow_action.cpp index d70ec34af..2b94f3d76 100644 --- a/modules/paint/actions/rainbow_action.cpp +++ b/modules/paint/actions/rainbow_action.cpp @@ -28,8 +28,8 @@ SOFTWARE. #include "../deprecated/paint_canvas_layer.h" #include "../paint_utilities.h" -void RainbowAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void RainbowAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); PoolVector2iArray pixels = PaintUtilities::get_pixels_in_line(data[0], data[1]); diff --git a/modules/paint/actions/rainbow_action.h b/modules/paint/actions/rainbow_action.h index 956bbd202..9eda39b2e 100644 --- a/modules/paint/actions/rainbow_action.h +++ b/modules/paint/actions/rainbow_action.h @@ -33,7 +33,7 @@ class RainbowAction : public PaintAction { GDCLASS(RainbowAction, PaintAction); public: - void do_action(PaintCanvasOld *canvas, const Array &data); + void do_action_old(PaintCanvasOld *canvas, const Array &data); RainbowAction(); ~RainbowAction(); diff --git a/modules/paint/actions/rect_action.cpp b/modules/paint/actions/rect_action.cpp index 568244d34..148dc45aa 100644 --- a/modules/paint/actions/rect_action.cpp +++ b/modules/paint/actions/rect_action.cpp @@ -42,8 +42,8 @@ void RectAction::set_mouse_start_pos_set(const bool val) { mouse_start_pos_set = val; } -void RectAction::do_action(PaintCanvasOld *canvas, const Array &data) { - PaintAction::do_action(canvas, data); +void RectAction::do_action_old(PaintCanvasOld *canvas, const Array &data) { + PaintAction::do_action_old(canvas, data); if (!mouse_start_pos_set) { mouse_start_pos = data[0]; @@ -89,7 +89,7 @@ void RectAction::do_action(PaintCanvasOld *canvas, const Array &data) { preview_colors.append(tc); } } -void RectAction::commit_action(PaintCanvasOld *canvas) { +void RectAction::commit_action_old(PaintCanvasOld *canvas) { canvas->clear_preview_layer(); for (int idx = 0; idx < preview_cells.size(); ++idx) { diff --git a/modules/paint/actions/rect_action.h b/modules/paint/actions/rect_action.h index ac28daf9b..cc14c7f99 100644 --- a/modules/paint/actions/rect_action.h +++ b/modules/paint/actions/rect_action.h @@ -39,8 +39,8 @@ public: bool get_mouse_start_pos_set(); void set_mouse_start_pos_set(const bool val); - void do_action(PaintCanvasOld *canvas, const Array &data); - void commit_action(PaintCanvasOld *canvas); + void do_action_old(PaintCanvasOld *canvas, const Array &data); + void commit_action_old(PaintCanvasOld *canvas); bool can_commit(); RectAction(); diff --git a/modules/paint/deprecated/paint_window.cpp b/modules/paint/deprecated/paint_window.cpp index 79b9c2620..d33670cb1 100644 --- a/modules/paint/deprecated/paint_window.cpp +++ b/modules/paint/deprecated/paint_window.cpp @@ -256,7 +256,7 @@ void PaintWindow::_input(const Ref &event) { if (brush_mode == Tools::CUT) { if (iemb->get_button_index() == BUTTON_LEFT && !iemb->is_pressed()) { - commit_action(); + commit_action_old(); } } @@ -273,7 +273,7 @@ void PaintWindow::_input(const Ref &event) { arr.append(last_cell_mouse_position); arr.append(_selected_color); - do_action(arr); + do_action_old(arr); } } break; case Tools::COLORPICKER: { @@ -302,7 +302,7 @@ void PaintWindow::_input(const Ref &event) { } break; case Tools::PASTECUT: { if (iemb->get_button_index() == BUTTON_RIGHT && iemb->is_pressed()) { - commit_action(); + commit_action_old(); set_brush(Tools::PAINT); } } break; @@ -385,10 +385,10 @@ void PaintWindow::_process(float delta) { void PaintWindow::_handle_shortcuts(const int scancode) { switch (scancode) { case K_UNDO: - undo_action(); + undo_action_old(); break; case K_REDO: - redo_action(); + redo_action_old(); break; case K_PENCIL: set_brush(Tools::PAINT); @@ -595,7 +595,7 @@ void PaintWindow::brush_process() { arr.append(last_cell_mouse_position); arr.append(_selected_color); - do_action(arr); + do_action_old(arr); } break; case Tools::BRUSH: { Array arr; @@ -606,7 +606,7 @@ void PaintWindow::brush_process() { arr.append(selected_brush_prefab); arr.append(brush_size_slider->get_value()); - do_action(arr); + do_action_old(arr); } break; case Tools::LINE: { Array arr; @@ -615,7 +615,7 @@ void PaintWindow::brush_process() { arr.append(last_cell_mouse_position); arr.append(_selected_color); - do_action(arr); + do_action_old(arr); } break; case Tools::RECT: { Array arr; @@ -624,7 +624,7 @@ void PaintWindow::brush_process() { arr.append(last_cell_mouse_position); arr.append(_selected_color); - do_action(arr); + do_action_old(arr); } break; case Tools::DARKEN: { Array arr; @@ -633,7 +633,7 @@ void PaintWindow::brush_process() { arr.append(last_cell_mouse_position); arr.append(_selected_color); - do_action(arr); + do_action_old(arr); } break; case Tools::BRIGHTEN: { Array arr; @@ -642,7 +642,7 @@ void PaintWindow::brush_process() { arr.append(last_cell_mouse_position); arr.append(_selected_color); - do_action(arr); + do_action_old(arr); } break; case Tools::COLORPICKER: { } break; @@ -653,7 +653,7 @@ void PaintWindow::brush_process() { arr.append(last_cell_mouse_position); arr.append(_selected_color); - do_action(arr); + do_action_old(arr); } break; case Tools::PASTECUT: { Array arr; @@ -665,7 +665,7 @@ void PaintWindow::brush_process() { arr.append(_cut_pos); arr.append(_cut_size); - do_action(arr); + do_action_old(arr); } break; case Tools::RAINBOW: { Array arr; @@ -673,7 +673,7 @@ void PaintWindow::brush_process() { arr.append(cell_mouse_position); arr.append(last_cell_mouse_position); - do_action(arr); + do_action_old(arr); } break; default: { } break; @@ -696,7 +696,7 @@ void PaintWindow::brush_process() { arr.append(last_cell_mouse_position); arr.append(Color(1, 1, 1, 0)); - do_action(arr); + do_action_old(arr); } break; case Tools::BRUSH: { Array arr; @@ -707,14 +707,14 @@ void PaintWindow::brush_process() { arr.append(selected_brush_prefab); arr.append(brush_size_slider->get_value()); - do_action(arr); + do_action_old(arr); } break; default: { } break; } } else { if (_current_action.is_valid() && _current_action->can_commit()) { - commit_action(); + commit_action_old(); paint_canvas->update(); } } @@ -732,21 +732,21 @@ void PaintWindow::_on_Save_pressed() { paint_save_file_dialog->popup_centered(); } -void PaintWindow::do_action(const Array &data) { +void PaintWindow::do_action_old(const Array &data) { if (_current_action.is_null()) { //print("clear redo"); _redo_history.clear(); } - _current_action->do_action(paint_canvas, data); + _current_action->do_action_old(paint_canvas, data); } -void PaintWindow::commit_action() { +void PaintWindow::commit_action_old() { if (!_current_action.is_valid()) { return; } //print("commit action") - _current_action->commit_action(paint_canvas); + _current_action->commit_action_old(paint_canvas); //Ref action = _current_action->duplicate(true); //action->layer = _current_action->layer; @@ -773,7 +773,7 @@ void PaintWindow::commit_action() { } break; } } -void PaintWindow::redo_action() { +void PaintWindow::redo_action_old() { if (_redo_history.empty()) { //print("nothing to redo"); return; @@ -787,12 +787,12 @@ void PaintWindow::redo_action() { } _actions_history.push_back(action); - action->redo_action(paint_canvas); + action->redo_action_old(paint_canvas); paint_canvas->update(); //print("redo action"); } -void PaintWindow::undo_action() { +void PaintWindow::undo_action_old() { if (_actions_history.empty()) { return; } @@ -805,7 +805,7 @@ void PaintWindow::undo_action() { } _redo_history.push_back(action); - action->undo_action(paint_canvas); + action->undo_action_old(paint_canvas); update(); paint_canvas->update(); diff --git a/modules/paint/deprecated/paint_window.h b/modules/paint/deprecated/paint_window.h index c68c66515..721a61781 100644 --- a/modules/paint/deprecated/paint_window.h +++ b/modules/paint/deprecated/paint_window.h @@ -139,10 +139,10 @@ public: void _on_Save_pressed(); - void do_action(const Array &data); - void commit_action(); - void redo_action(); - void undo_action(); + void do_action_old(const Array &data); + void commit_action_old(); + void redo_action_old(); + void undo_action_old(); Ref get_action();