something
This commit is contained in:
49
tiles/tile.h
Normal file
49
tiles/tile.h
Normal file
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// 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];
|
||||
} TileType;
|
||||
|
||||
#define TILEREGISTRY_SIZE 512
|
||||
|
||||
extern TileType TileRegistry[TILEREGISTRY_SIZE];
|
||||
|
||||
#define TYPE_BELT 0
|
||||
|
||||
typedef struct {
|
||||
OrientDirection direction;
|
||||
uint16_t type;
|
||||
int frameOffset;
|
||||
ItemOnBelt item;
|
||||
int x;
|
||||
int y;
|
||||
} Tile;
|
||||
|
||||
extern Tile tileMap[MAP_HEIGHT][MAP_WIDTH];
|
||||
|
||||
void generateTestMap();
|
||||
void loadTiles(SDL_Renderer *renderer);
|
||||
|
||||
#endif //FACTORYGAME_TILE_H
|
Reference in New Issue
Block a user