something

This commit is contained in:
2025-04-24 20:04:41 +02:00
parent 8fd5f1cf1e
commit 451e80f750
23 changed files with 565 additions and 161 deletions

35
items/item.h Normal file
View 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.01.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