something
This commit is contained in:
35
items/item.h
Normal file
35
items/item.h
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// 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;
|
||||
} ItemOnBelt;
|
||||
|
||||
void updateItems();
|
||||
|
||||
void loadItems(SDL_Renderer *renderer);
|
||||
|
||||
void renderItem(ItemOnBelt item, SDL_Renderer *renderer);
|
||||
|
||||
void putItem(int x, int y, uint16_t itemType);
|
||||
#endif //FACTORYGAME_ITEM_H
|
Reference in New Issue
Block a user