// // Created by bruno on 4/24/25. // #ifndef FACTORYGAME_TILE_H #define FACTORYGAME_TILE_H #include "belt.h" #include "../items/item.h" #include "../util/util.h" #define MAP_WIDTH 600 #define MAP_HEIGHT 340 #define DISPLAY_MAP_WIDTH 30 #define DISPLAY_MAP_HEIGHT 16 #define TILE_SIZE 32 #define DISPLAY_WIDTH DISPLAY_MAP_WIDTH * TILE_SIZE #define DISPLAY_HEIGHT DISPLAY_MAP_HEIGHT * TILE_SIZE typedef struct { uint16_t type; char name[20]; SDL_Texture *textures[ORIENT_DIRECTION_COUNT]; uint16_t breakTime; } TileType; #define TILEREGISTRY_SIZE 512 extern TileType TileRegistry[TILEREGISTRY_SIZE]; #define TYPE_AIR 0 #define TYPE_BELT 1 typedef struct { OrientDirection direction; uint16_t type; int frameOffset; ItemOnBelt items[2][2]; int x; int y; } Tile; extern Tile tileMap[MAP_HEIGHT][MAP_WIDTH]; void generateTestMap(); void loadTiles(SDL_Renderer *renderer); extern uint16_t tileTypeIndex; #endif //FACTORYGAME_TILE_H