This commit is contained in:
2025-06-11 15:42:06 +02:00
parent 39c31f0042
commit 78bccd6c6f
30 changed files with 67 additions and 21 deletions

View File

@@ -5,8 +5,8 @@
#ifndef FACTORYGAME_ATLAS_H
#define FACTORYGAME_ATLAS_H
#define ATLAS_SIZE 1024
#define MAX_RECTS 2048
#define ATLAS_SIZE 2048
#define MAX_RECTS 4096
#define TILE_SIZE 32
#define QUADRANT_SIZE 16
#define ATLAS_TILES_PER_ROW (ATLAS_SIZE / TILE_SIZE)

View File

@@ -90,8 +90,9 @@ void updateMachine(Tile *tile,
in1->type = TYPE_AIR;
if (in2->type != TYPE_AIR) in2->type = TYPE_AIR;
out->type = result;
out->tileX = tile->rect.x;
out->tileY = tile->rect.y;
out->prevTile = out->tile;
out->tile.x = tile->rect.x;
out->tile.y = tile->rect.y;
out->offset = -0.5f;
}
}

View File

@@ -13,6 +13,8 @@
SDL_Window *window = NULL;
volatile bool running = true;
WaveInfo waveInfo;
const char OrientStrings[ORIENT_DIRECTION_COUNT][10] = {
"LEFT_DOWN",
"LEFT",

View File

@@ -44,6 +44,19 @@ typedef struct Animation {
} Animation;
typedef struct MiniRect {
int x;
int y;
} MiniRect;
typedef struct WaveInfo {
int waveCounter;
int waveTimer;
} WaveInfo;
extern WaveInfo waveInfo;
typedef struct OrientedAnimation {
SDL_Rect atlasRects[ORIENT_DIRECTION_COUNT][TILE_SIZE * 2];
unsigned char frameCount;