40 lines
714 B
C
40 lines
714 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 offset;
|
|
int tileX, tileY;
|
|
bool active;
|
|
uint16_t type;
|
|
} ItemOnBelt;
|
|
|
|
void updateItems();
|
|
|
|
void loadItems(SDL_Renderer *renderer);
|
|
|
|
void renderItem(ItemOnBelt item, SDL_Renderer *renderer, int lane);
|
|
|
|
extern uint8_t laneTarget;
|
|
extern float speed;
|
|
|
|
|
|
void putItem(int x, int y, uint16_t itemType, uint8_t lane, uint8_t itemIndex);
|
|
#endif //FACTORYGAME_ITEM_H
|