37 lines
710 B
C
37 lines
710 B
C
//
|
||
// Created by bruno on 4/24/25.
|
||
//
|
||
|
||
#include <SDL2/SDL.h>
|
||
|
||
#ifndef FACTORYGAME_ITEM_H
|
||
#define FACTORYGAME_ITEM_H
|
||
|
||
typedef struct {
|
||
uint16_t type;
|
||
char name[20];
|
||
SDL_Texture * texture;
|
||
SDL_Texture * textureOnBelt;
|
||
} Item;
|
||
|
||
#define ITEMREGISTRY_SIZE 512
|
||
|
||
extern Item ItemRegistry[ITEMREGISTRY_SIZE];
|
||
|
||
typedef struct {
|
||
float x, y; // local position in tile (0.0–1.0)
|
||
int tileX, tileY;
|
||
bool active;
|
||
uint16_t type;
|
||
uint8_t place;
|
||
} ItemOnBelt;
|
||
|
||
void updateItems();
|
||
|
||
void loadItems(SDL_Renderer *renderer);
|
||
|
||
void renderItem(ItemOnBelt item, SDL_Renderer *renderer);
|
||
|
||
void putItem(int x, int y, uint16_t itemType, uint8_t lane, uint8_t itemIndex);
|
||
#endif //FACTORYGAME_ITEM_H
|