summaryrefslogtreecommitdiff
path: root/src/editor.h
blob: b0b0441d0aa4b8bf9445a81fdfd992906b33d0df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __EDITOR_H__
#define __EDITOR_H__
#include <raylib.h>
#include <stdbool.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

typedef struct {
  bool isFloor, isWall;
  char *upFilePath, *sideFilePath, *cornerFilePath;
  Texture2D upTexture, sideTexture, cornerTexture;
} EditorCreateBlockState;

typedef struct {
  int activeMainTab;
  int activeTileLayerId;

  TilesetTile *activeTilesetTile;
  EditorCreateBlockState *createBlockState;
  Rectangle panelView;
  Vector2 panelScroll;
} EditorState;

typedef struct {
  EditorState state;
} Editor;

void SE_UpdateEditor(Editor *editor);
void SE_DrawEditor(Editor *editor, Tileset *tileset);

#endif