From 94e0df832c83bc7b9ead0824cfbc41f166869c68 Mon Sep 17 00:00:00 2001 From: kasull Date: Thu, 26 Feb 2026 04:31:08 -0500 Subject: 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 --- src/editor/editor.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/editor/editor.h') 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 { -- cgit v1.2.3