Files
factorygame/items/item.h
2025-04-24 20:04:41 +02:00

36 lines
658 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// 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