From 0a5506c2c178fc9b842bc6c9026633e171d1beb3 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 26 Jan 2025 21:39:53 +0500 Subject: upd: ignore camera interaction if mouse is doing something in toolkit --- src/editor.h | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'src/editor.h') diff --git a/src/editor.h b/src/editor.h index 5e51682..0c32cdf 100644 --- a/src/editor.h +++ b/src/editor.h @@ -5,44 +5,49 @@ #include "xd.h" +#define EDITOR_TOOLKIT_WIDTH 400.0f +#define EDITOR_TOOLKIT_HEIGHT GetScreenHeight() +#define EDITOR_TOOLKIT_X GetScreenWidth() - EDITOR_TOOLKIT_WIDTH +#define EDITOR_TOOLKIT_Y 0.0f + #define TEXTURE_WIDTH 16.0f #define TEXTURE_HEIGHT 16.0f typedef struct { - bool isFloor, isWall; - char *upFilePath, *sideFilePath, *cornerFilePath; - Texture2D upTexture, sideTexture, cornerTexture; + bool isFloor, isWall; + char *upFilePath, *sideFilePath, *cornerFilePath; + Texture2D upTexture, sideTexture, cornerTexture; } EditorCreateBlockState; typedef struct { - XdTileData data; - Texture2D texture; + XdTileData data; + Texture2D texture; } EditorTileData; typedef struct { - EditorTileData *tile; - Vector2 position; + EditorTileData *tile; + Vector2 position; } EditorTile; typedef struct { - int tileDataSize; - int tilesCount; - EditorTileData *tileData[200]; - EditorTile *tiles[]; + int tileDataSize; + int tilesCount; + EditorTileData *tileData[200]; + EditorTile *tiles[]; } EditorCache; typedef struct { - int currentLevel, currentLayer, activeMainTab; - EditorCreateBlockState *createBlockState; - Rectangle panelView; - Vector2 panelScroll; - EditorTileData *selectedTile; - EditorCache cache; + int currentLevel, currentLayer, activeMainTab; + EditorCreateBlockState *createBlockState; + Rectangle panelView; + Vector2 panelScroll; + EditorTileData *selectedTile; + EditorCache cache; } EditorState; typedef struct { - XdData *data; - EditorState state; + XdData *data; + EditorState state; } Editor; void SE_DrawEditor(Editor *editor, Camera2D *camera); -- cgit v1.2.3