Most texure work

This commit is contained in:
2025-06-10 21:59:51 +02:00
parent a17e3abbff
commit 39c31f0042
103 changed files with 666 additions and 246 deletions

View File

@@ -7,6 +7,7 @@
#include "../util/util.h"
#include "../items/item.h"
#include "tilecallbacks.h"
#define MAP_WIDTH 500
#define MAP_HEIGHT 500
@@ -83,6 +84,8 @@ typedef enum BackgroundType {
#define MAX_BASE_NAMES 512
#define MAX_ANIMATION_FRAMES 32
typedef void (*UpdateTileCallback)(struct Tile *tile);
typedef struct TileTypeReg {
ItemType type;
char name[20];
@@ -92,9 +95,10 @@ typedef struct TileTypeReg {
bool allowedInItems[ItemSlotCount][ITEMREGISTRY_SIZE];
bool outputLane[ItemSlotCount];
bool needsTicks;
char startFrame;
bool walkable;
bool allDir;
uint16_t maxHealth;
UpdateTileCallback updateTileCallback;
} TileTypeReg;
bool isWalkable(MiniRect tileCoords);
@@ -141,7 +145,7 @@ typedef struct Tile {
int neededUpdateIndex;
char fixedFrame;
PathFindDat pathFind;
uint16_t health;
int16_t health;
} Tile;
@@ -151,6 +155,8 @@ extern BackgroundTile backgroundMap[MAP_HEIGHT][MAP_WIDTH];
void setupTiles();
void preSetupTiles();
void generateTestMap();
void loadBackgroundTiles(SDL_Renderer *renderer);