summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-04 00:56:47 +0100
committeraura <nw@moneybot.cc>2026-03-04 00:56:47 +0100
commitfc12cd41c56bc123f01bc073b703fb151dfde814 (patch)
tree470b2d7b1b55b53e25df72fb8594fc9d6fb1b48e /src
parent890bea19359649695df1b618a41ce580cf3dfbda (diff)
uhhh mvoe stuff around
Diffstat (limited to 'src')
-rw-r--r--src/editor/editor.h72
-rw-r--r--src/editor/gui.cpp71
2 files changed, 72 insertions, 71 deletions
diff --git a/src/editor/editor.h b/src/editor/editor.h
index ad43705..b000816 100644
--- a/src/editor/editor.h
+++ b/src/editor/editor.h
@@ -41,6 +41,34 @@ enum EditorUndoType_t {
EDITOR_UNDO_CREATE_POLY = 2
};
+enum EditorInfoBoxType_t {
+ EDITOR_INFOBOX_ASSETS = 1,
+ EDITOR_INFOBOX_STATUS = 2
+};
+
+enum EditorViewMode_t {
+ EDITOR_VIEWMODE_2D = 0,
+ EDITOR_VIEWMODE_3D = 1,
+ EDITOR_VIEWMODE_SIM = 2
+};
+
+enum Editor2DViewType_t {
+ EDITOR_2DVIEW_TOP_DOWN = 0,
+ EDITOR_2DVIEW_SIDE_ELEVATION = 1,
+ EDITOR_2DVIEW_FRONT_ELEVATION = 2
+};
+
+enum EditorToolbarHit_t {
+ EDITOR_TOOLBAR_HIT_NONE = -1,
+ EDITOR_TOOLBAR_HIT_FILE = 0,
+ EDITOR_TOOLBAR_HIT_EDIT = 1,
+ EDITOR_TOOLBAR_HIT_VIEW = 2,
+ EDITOR_TOOLBAR_HIT_TOOLS = 3,
+ EDITOR_TOOLBAR_HIT_SAVE = 4,
+ EDITOR_TOOLBAR_HIT_UNDO = 5,
+ EDITOR_TOOLBAR_HIT_REDO = 6
+};
+
struct GAME_EDITOR;
typedef void( *EDITOR_GRID_DEP_CALLBACK )( GAME_EDITOR* e );
@@ -122,6 +150,33 @@ struct GAME_EDITOR {
LIST<EDITOR_UNDO_ACTION> redo_actions{};
};
+struct EDITOR_LAYOUT {
+ I32 left_x;
+ I32 left_w;
+ I32 right_x;
+ I32 right_w;
+ I32 top_y;
+ I32 props_y;
+ I32 props_h;
+ I32 assets_y;
+ I32 assets_h;
+ I32 view_y;
+ I32 view_h;
+ I32 tool_y;
+ I32 tool_h;
+ I32 tool_btn_x;
+ I32 tool_btn_y;
+ I32 tool_btn_w;
+ I32 tool_btn_step;
+ I32 tool_panel_x;
+ I32 tool_panel_w;
+ I32 tool_panel_h;
+ I32 status_x;
+ I32 status_y;
+ I32 status_w;
+ I32 status_h;
+};
+
extern GAME_EDITOR* editor_create( struct GAME_DATA* game );
extern void editor_destroy( GAME_EDITOR* editor );
extern STAT editor_load_map( GAME_EDITOR* e, const char* mapname );
@@ -214,6 +269,23 @@ struct GUI_EDITOR_TEXTUREPICKER : GUI_WINDOW {
GUI_CALLBACK cb;
};
+
+struct GUI_EDITOR_INFOBOX : GUI_VIEW {
+ U8 type{};
+};
+
+struct GUI_EDITOR_VIEWTYPE_SEGMENT : GUI_BASE {
+ U8 held{};
+ I32 held_seg{-1};
+};
+
+struct GUI_EDITOR_TOOLBAR : GUI_BASE {
+ U8 held{};
+ I32 held_item{-1};
+ U8 file_open{};
+ U8 edit_open{};
+};
+
extern GUI_EDITORWINDOW* gui_editorwindow( I32 w, I32 h );
extern GUI_EDITOR_2DVIEW* gui_editor_2dview( I32 x, I32 y, I32 w, I32 h );
extern GUI_EDITOR_3DVIEW* gui_editor_3dview( I32 x, I32 y, I32 w, I32 h );
diff --git a/src/editor/gui.cpp b/src/editor/gui.cpp
index ea03e8f..088421d 100644
--- a/src/editor/gui.cpp
+++ b/src/editor/gui.cpp
@@ -28,55 +28,11 @@ const I32 EDITOR_LAYOUT_ASSETS_MIN_H = 120;
const I32 EDITOR_LAYOUT_VIEW_MIN_H = 140;
const I32 EDITOR_LAYOUT_RIGHT_MIN_W = 260;
-enum EditorInfoBoxType_t {
- EDITOR_INFOBOX_ASSETS = 1,
- EDITOR_INFOBOX_STATUS = 2
-};
-
-struct GUI_EDITOR_INFOBOX : GUI_VIEW {
- U8 type{};
-};
-
-struct GUI_EDITOR_VIEWTYPE_SEGMENT : GUI_BASE {
- U8 held{};
- I32 held_seg{-1};
-};
-
-struct GUI_EDITOR_TOOLBAR : GUI_BASE {
- U8 held{};
- I32 held_item{-1};
- U8 file_open{};
- U8 edit_open{};
-};
-
-enum EditorViewMode_t {
- EDITOR_VIEWMODE_2D = 0,
- EDITOR_VIEWMODE_3D = 1,
- EDITOR_VIEWMODE_SIM = 2
-};
-
-enum Editor2DViewType_t {
- EDITOR_2DVIEW_TOP_DOWN = 0,
- EDITOR_2DVIEW_SIDE_ELEVATION = 1,
- EDITOR_2DVIEW_FRONT_ELEVATION = 2
-};
-
static void editor_layout_map_view( GAME_EDITOR* e );
static U8 editor_menu_hover_mask_active = 0;
static I32 editor_menu_hover_real_x = 0;
static I32 editor_menu_hover_real_y = 0;
-enum EditorToolbarHit_t {
- EDITOR_TOOLBAR_HIT_NONE = -1,
- EDITOR_TOOLBAR_HIT_FILE = 0,
- EDITOR_TOOLBAR_HIT_EDIT = 1,
- EDITOR_TOOLBAR_HIT_VIEW = 2,
- EDITOR_TOOLBAR_HIT_TOOLS = 3,
- EDITOR_TOOLBAR_HIT_SAVE = 4,
- EDITOR_TOOLBAR_HIT_UNDO = 5,
- EDITOR_TOOLBAR_HIT_REDO = 6
-};
-
static void editor_toolbar_set_open( GUI_EDITOR_TOOLBAR* bar, U8 file_open, U8 edit_open );
static void editor_toolbar_close_menu() {
@@ -485,33 +441,6 @@ static void editor_raise_header_toolbar( GAME_EDITOR* e ) {
parent->children.push( bar );
}
-struct EDITOR_LAYOUT {
- I32 left_x;
- I32 left_w;
- I32 right_x;
- I32 right_w;
- I32 top_y;
- I32 props_y;
- I32 props_h;
- I32 assets_y;
- I32 assets_h;
- I32 view_y;
- I32 view_h;
- I32 tool_y;
- I32 tool_h;
- I32 tool_btn_x;
- I32 tool_btn_y;
- I32 tool_btn_w;
- I32 tool_btn_step;
- I32 tool_panel_x;
- I32 tool_panel_w;
- I32 tool_panel_h;
- I32 status_x;
- I32 status_y;
- I32 status_w;
- I32 status_h;
-};
-
static void editor_set_bounds( GUI_BASE* node, I32 x, I32 y, I32 w, I32 h ) {
if( !node )
return;