From a15f24294d5113fec767fb9007d906f534dc0485 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 31 Jan 2025 00:33:53 +0500 Subject: upd: moved some editor logic to tileset and floor files --- src/editor.h | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) (limited to 'src/editor.h') diff --git a/src/editor.h b/src/editor.h index 65e57e8..b0b0441 100644 --- a/src/editor.h +++ b/src/editor.h @@ -3,16 +3,13 @@ #include #include -#include "xd.h" +#include "tileset.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; @@ -20,44 +17,20 @@ typedef struct { } EditorCreateBlockState; typedef struct { - XdTileData data; - Texture2D texture; -} EditorTileData; - -typedef struct { - EditorTileData *tile; - Vector2 position; -} EditorTile; - -typedef struct { - int index, tilesCount; - EditorTile *tiles[]; -} EditorTileLayer; + int activeMainTab; + int activeTileLayerId; -typedef struct { - int tileDataSize; - int layerCount; - int selectedLayer; - EditorTileData *tileData[200]; - EditorTileLayer *layers[]; -} EditorCache; - -typedef struct { - int currentLevel, currentLayer, activeMainTab; + TilesetTile *activeTilesetTile; EditorCreateBlockState *createBlockState; Rectangle panelView; Vector2 panelScroll; - EditorTileData *selectedTile; - EditorCache cache; } EditorState; typedef struct { - XdData *data; EditorState state; } Editor; void SE_UpdateEditor(Editor *editor); -void SE_DrawEditor(Editor *editor, Camera2D *camera); -void SE_DrawEditorToolkit(Editor *editor); -void SE_RebuildEditorCache(Editor *editor); +void SE_DrawEditor(Editor *editor, Tileset *tileset); + #endif -- cgit v1.2.3