summaryrefslogtreecommitdiff
path: root/src/editor/editor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/editor/editor.h')
-rw-r--r--src/editor/editor.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/editor/editor.h b/src/editor/editor.h
index 0fee667..2067df5 100644
--- a/src/editor/editor.h
+++ b/src/editor/editor.h
@@ -35,6 +35,12 @@ enum EditorSelectType_t {
EDITOR_SELECT_SURFPROPS
};
+enum EditorUndoType_t {
+ EDITOR_UNDO_NONE = 0,
+ EDITOR_UNDO_CREATE_WALLS = 1,
+ EDITOR_UNDO_CREATE_POLY = 2
+};
+
struct GAME_EDITOR;
typedef void( *EDITOR_GRID_DEP_CALLBACK )( GAME_EDITOR* e );
@@ -81,9 +87,9 @@ struct GAME_EDITOR {
I32 view_mode{};
I32 view2d_type{};
+ GUI_BASE* header_toolbar{};
GUI_LABEL* header_viewtype_label{};
GUI_BUTTON* header_back{};
- GUI_BUTTON* header_save{};
GUI_BUTTON* header_mode_2d{};
GUI_BUTTON* header_mode_3d{};
GUI_BUTTON* header_mode_sim{};
@@ -105,6 +111,15 @@ struct GAME_EDITOR {
LIST<GRID_DEPENDENCY> grid_dependencies{};
LIST<GUI_LIST_ENTRY> map_list{};
+
+ struct EDITOR_UNDO_ACTION {
+ U8 type{};
+ I32 start_idx{};
+ LIST<MAP_WALL> walls{};
+ LIST<MAP_POLYGON> polys{};
+ };
+ LIST<EDITOR_UNDO_ACTION> undo_actions{};
+ LIST<EDITOR_UNDO_ACTION> redo_actions{};
};
extern GAME_EDITOR* editor_create( struct GAME_DATA* game );
@@ -124,6 +139,11 @@ extern void editor_new_map_cb( void* );
extern void editor_create_map_view( GAME_EDITOR* e );
extern void editor_update_properties_column( GAME_EDITOR* e );
+extern void editor_undo_clear( GAME_EDITOR* e );
+extern void editor_undo_record_create_walls( GAME_EDITOR* e, I32 start_idx, I32 count );
+extern void editor_undo_record_create_poly( GAME_EDITOR* e, I32 start_idx );
+extern U8 editor_undo( GAME_EDITOR* e );
+extern U8 editor_redo( GAME_EDITOR* e );
struct GUI_EDITORWINDOW : GUI_WINDOW {};
struct GUI_EDITOR_3DVIEW : GUI_VIEW {
@@ -153,6 +173,8 @@ struct GUI_EDITOR_2DVIEW : GUI_VIEW {
U8 poly_drag;
VEC2 poly_start;
VEC2 poly_end;
+
+ I32 pending_wall_undo_idx;
};
struct GUI_EDITOR_PROPVIEW : GUI_VIEW {