summaryrefslogtreecommitdiff
path: root/src/floor.h
blob: ad3b2da310e2e3f2bd1c66d46c23d31d6130ea46 (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
37
38
#ifndef __FLOOR_H_
#define __FLOOR_H_

#include "editor.h"
#include "raylib.h"
#include "tileset.h"

typedef struct {
  int id;
  Vector2 position;
  float rotation;
  TilesetTile *tilesetTile;
} Tile;

typedef struct {
  int index;
  int tileCount;
  Tile *tiles[];
} TileLayer;

typedef struct {
  int width, height;
  int layerCount;
  TileLayer *layers[];
} TileFloor;

Tile *SE_CreateTile(TileLayer *layer, TilesetTile *tilesetTile);
void SE_RemoveTile(TileLayer *layer, Tile *tile);
Tile *SE_FindTileAtPosition(TileLayer *layer, Vector2 position);

TileLayer *SE_CreateTileLayer(TileFloor *floor);

TileFloor *SE_CreateTileFloor(int width, int height);
void SE_UpdateTileFloor(EditorState *state, TileFloor *floor, Camera2D *camera);
void SE_DrawTileFloor(TileFloor *floor, EditorState *state, Camera2D *camera);
void SE_UnloadTileFloor(TileFloor *floor);

#endif