More progress on audio and rendering

This commit is contained in:
2025-06-02 18:04:15 +02:00
parent 84805b92cb
commit 0c3e2aa730
14 changed files with 569 additions and 264 deletions

View File

@@ -7,10 +7,9 @@
#include "../util/util.h"
#include "../items/item.h"
//#include "../items/item.h"
#define MAP_WIDTH 100
#define MAP_HEIGHT 100
#define MAP_WIDTH 1000
#define MAP_HEIGHT 1000
#define DISPLAY_MAP_WIDTH 60
#define DISPLAY_MAP_HEIGHT 31
@@ -20,6 +19,25 @@
#define DISPLAY_WIDTH DISPLAY_MAP_WIDTH * TILE_SIZE
#define DISPLAY_HEIGHT DISPLAY_MAP_HEIGHT * TILE_SIZE
typedef struct MiniRect {
int x;
int y;
} MiniRect;
#define MAX_TILES MAP_WIDTH * MAP_HEIGHT
typedef struct {
MiniRect tiles[MAX_TILES];
int activeCount;
} TileArray;
extern TileArray neededUpdates;
void remove_tile(TileArray *arr, int index);
int add_tile(TileArray *arr, MiniRect t);
extern SDL_Texture *tilesTexture;
extern SDL_Texture *itemsTexture;
extern SDL_Texture *backgroundTexture;
@@ -77,6 +95,7 @@ typedef struct TileTypeReg {
bool itemMoves;
bool allowedInItems[ItemSlotCount][ITEMREGISTRY_SIZE];
bool outputLane[ItemSlotCount];
bool needsTicks;
} TileTypeReg;
typedef struct BackgroundTileType {
@@ -106,8 +125,8 @@ typedef struct Tile {
int miscVal;
ItemOnBelt items[ItemSlotCount];
uint16_t audioCh;
int x;
int y;
MiniRect rect;
int neededUpdateIndex;
} Tile;