diff options
| author | ilotterytea <iltsu@alright.party> | 2025-01-31 00:33:53 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-01-31 00:33:53 +0500 |
| commit | a15f24294d5113fec767fb9007d906f534dc0485 (patch) | |
| tree | 20c869d1444a91256a10d4dfe0376f2f72ab4021 /src/editor.h | |
| parent | 2ca545f754acc9c8a00b5ce8c0b3ca1175c74a3a (diff) | |
upd: moved some editor logic to tileset and floor files
Diffstat (limited to 'src/editor.h')
| -rw-r--r-- | src/editor.h | 39 |
1 files changed, 6 insertions, 33 deletions
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 <raylib.h> #include <stdbool.h> -#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 |
