summaryrefslogtreecommitdiff
path: root/src/editor/editor.h
diff options
context:
space:
mode:
authorkasull <qsullian@gmail.com>2026-02-26 04:31:08 -0500
committerkasull <qsullian@gmail.com>2026-02-26 04:31:08 -0500
commit94e0df832c83bc7b9ead0824cfbc41f166869c68 (patch)
treec90d78ea332d66a09020a431b5031aa42686bd9f /src/editor/editor.h
parentb384930de5044934207d1b2ceb4fa55705094f8b (diff)
add wall shape dropdown and drag-based polygon creation with height controls
fix wall Z bounds calculation and key index masking in input handling preserve 2D view/cursor stability when map bounds update
Diffstat (limited to 'src/editor/editor.h')
-rw-r--r--src/editor/editor.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/editor/editor.h b/src/editor/editor.h
index 9063f50..cd42a4e 100644
--- a/src/editor/editor.h
+++ b/src/editor/editor.h
@@ -4,6 +4,11 @@
#include "../game/world/map.h"
const F32 EDITOR_DEFAULT_SPRITE_SIZE = 32.f;
+const F32 EDITOR_DEFAULT_POLY_SIDES = 6.f;
+const F32 EDITOR_DEFAULT_WALL_HEIGHT = 80.f;
+const F32 EDITOR_DEFAULT_PLACEMENT_HEIGHT = 0.f;
+const I32 EDITOR_POLY_SIDES_MIN = 3;
+const I32 EDITOR_POLY_SIDES_MAX = 32;
enum EditorTools_t {
EDITOR_TOOL_NONE,
@@ -14,6 +19,11 @@ enum EditorTools_t {
EDITOR_TOOL_ENT
};
+enum EditorWallShape_t {
+ EDITOR_WALLSHAPE_LINE = 0,
+ EDITOR_WALLSHAPE_POLYGON = 1
+};
+
enum EditorSelectType_t {
EDITOR_SELECT_NONE,
EDITOR_SELECT_WALL,
@@ -30,7 +40,10 @@ struct GAME_EDITOR_TOOL {
U8 type;
/* shapes */
- U8 walls;
+ I32 wallshape;
+ F32 polysides;
+ F32 wallheight;
+ F32 placementheight;
GL_TEX2D* tex;
/* entity */
@@ -107,6 +120,10 @@ struct GUI_EDITOR_2DVIEW : GUI_VIEW {
void* curdrag;
U8 dragtype;
U8 dragmoved;
+
+ U8 poly_drag;
+ VEC2 poly_start;
+ VEC2 poly_end;
};
struct GUI_EDITOR_PROPVIEW : GUI_VIEW {
@@ -118,6 +135,7 @@ struct GUI_EDITOR_PROPVIEW : GUI_VIEW {
struct GUI_EDITOR_TOOLVIEW : GUI_VIEW {
GUI_VIEW* itemview;
+ U8 wallshape_dropdown_open;
};
struct GUI_EDITOR_TEXTUREPICKER : GUI_WINDOW {