Start atlas

This commit is contained in:
2025-06-01 22:13:02 +02:00
parent 96a9a45c20
commit 84805b92cb
64 changed files with 954 additions and 243 deletions

View File

@@ -5,23 +5,46 @@
#include <SDL2/SDL.h>
#include "../util/util.h"
#include "../tiles/belt.h"
#include "../tiles/tile.h"
#ifndef FACTORYGAME_ITEM_H
#define FACTORYGAME_ITEM_H
#define ITEMREGISTRY_SIZE 20
#define ITEMREGISTRY_SIZE 128
typedef struct {
typedef enum ItemType {
TYPE_AIR = 0,
TYPE_BLOCK,
TYPE_BELT,
TYPE_FURNACE,
IRON_ORE = ITEMREGISTRY_SIZE / 2,
SILVER_ORE,
GOLD_ORE,
PLATINUM_ORE,
IRON_INGOT,
SILVER_INGOT,
GOLD_INGOT,
PLATINUM_INGOT,
LOG
} ItemType;
typedef struct ItemOnBelt {
float offset;
int tileX, tileY;
uint16_t type;
ItemType type;
} ItemOnBelt;
typedef struct {
uint16_t type;
typedef struct Item {
bool isTile;
ItemType type;
char name[20];
uint16_t miscVal;
SDL_Texture * texture[ORIENT_DIRECTION_COUNT];
SDL_Texture * textureOnBelt[ORIENT_DIRECTION_COUNT];
SDL_Rect atlasRects[ORIENT_DIRECTION_COUNT];
SDL_Rect atlasRectsOnBelt[ORIENT_DIRECTION_COUNT];
} Item;
@@ -39,5 +62,5 @@ extern uint8_t laneTarget;
extern double speed;
void putItem(int x, int y, uint16_t itemType, uint8_t lane);
void putItem(int x, int y, ItemType itemType, uint8_t lane);
#endif //FACTORYGAME_ITEM_H