This commit is contained in:
2025-06-07 00:57:00 +02:00
parent d4665c4e9b
commit 64cac7578d
100 changed files with 464 additions and 169 deletions

View File

@@ -49,20 +49,14 @@ extern unsigned long beltFrames;
#define ItemSlotCount 4
typedef enum BackgroundType {
BGType_WATER0,
BGType_WATER1,
BGType_GRASS0,
BGType_GRASS1,
BGType_GRASS2,
BGType_GRASS3,
BGType_GRASS4,
BGType_GRASS5,
BGType_GRASS6,
BGType_GRASS7,
BGType_WATER_SHALLOW,
BGType_WATER_DEEP,
BGType_GRASS_FLOWER0,
BGType_GRASS_FLOWER1,
BGType_GRASS_FLOWER2,
BGType_GRASS_FLOWER3,
BGType_GRASS0,
BGType_GRASS1,
BGType_GRASS2,
BGType_SAND0,
BGType_SAND1,
BGType_SAND2,
@@ -86,23 +80,25 @@ typedef enum BackgroundType {
BGType_END
} BackgroundType;
#define MAX_BASE_NAMES 512
#define MAX_ANIMATION_FRAMES 32
typedef struct TileTypeReg {
ItemType type;
char name[20];
SDL_Texture *textures[ORIENT_DIRECTION_COUNT];
SDL_Rect atlasRects[ORIENT_DIRECTION_COUNT];
OrientedAnimation animation;
uint16_t breakTime;
bool itemMoves;
bool allowedInItems[ItemSlotCount][ITEMREGISTRY_SIZE];
bool outputLane[ItemSlotCount];
bool needsTicks;
char startFrame;
} TileTypeReg;
typedef struct BackgroundTileType {
ItemType type;
char name[20];
SDL_Texture *texture;
SDL_Rect atlasRect;
Animation animation;
} BackgroundTileType;
typedef struct BackgroundTile {
@@ -127,6 +123,7 @@ typedef struct Tile {
uint16_t audioCh;
MiniRect rect;
int neededUpdateIndex;
char fixedFrame;
} Tile;
@@ -138,6 +135,8 @@ void setupTiles();
void generateTestMap();
void loadBackgroundTiles(SDL_Renderer *renderer);
void loadTiles(SDL_Renderer *renderer);
extern uint16_t tileTypeIndex;