summaryrefslogtreecommitdiff
path: root/src/editor.h
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-01-26 21:39:53 +0500
committerilotterytea <iltsu@alright.party>2025-01-26 21:39:53 +0500
commit0a5506c2c178fc9b842bc6c9026633e171d1beb3 (patch)
tree9b38cd245cceabebf3e50ed48495a22ddd74dfbe /src/editor.h
parent8103af34f70cbb7747c232875fbbcfe3b0a8dc9f (diff)
upd: ignore camera interaction if mouse is doing something in toolkit
Diffstat (limited to 'src/editor.h')
-rw-r--r--src/editor.h43
1 files changed, 24 insertions, 19 deletions
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);