diff options
| author | nathan <nathansmith@disroot.org> | 2025-12-26 14:14:54 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-12-26 14:14:54 +0000 |
| commit | c9ae1941816183553c8c4313eac27cc831cbefba (patch) | |
| tree | 053ab2ca0819f3c9021574bcce9a24fc69cadc95 /src/entity.h | |
| parent | a5443e22bfce9ac00fdc6e746e17eb4aa68565f2 (diff) | |
| download | FindThings-c9ae1941816183553c8c4313eac27cc831cbefba.tar.gz FindThings-c9ae1941816183553c8c4313eac27cc831cbefba.tar.bz2 FindThings-c9ae1941816183553c8c4313eac27cc831cbefba.zip | |
Working on buildings
Diffstat (limited to 'src/entity.h')
| -rw-r--r-- | src/entity.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/entity.h b/src/entity.h index 2391762..66e1973 100644 --- a/src/entity.h +++ b/src/entity.h @@ -5,7 +5,7 @@ #ifndef ENTITY_H #define ENTITY_H -#define ENTITY_COUNT 14 +#define ENTITY_COUNT 15 #define ENTITY_NAME_MAX 16 @@ -13,6 +13,8 @@ #define INTERACTION_LABEL_MAX 32 #define INTERACTION_CHAT_MAX 256 +#define ENTITY_BUILDING_CUBE_SIZE (Vector3){2.0, 2.0, 2.0} + typedef int8_t EntityId; typedef enum InteractionCommand InteractionCommand; typedef enum Selection Selection; @@ -40,6 +42,7 @@ enum { TRASH, MEDICAL_TRASH, JOHN, + JOHNS_STORE, RON }; @@ -66,6 +69,12 @@ struct Entity { void* data; }; +// Cubemap based building. +typedef struct { + Model model; + Color* pixelMap; +} EntityBuilding; + typedef struct { char name[ENTITY_NAME_MAX]; InitEntityCallback initCallback; @@ -73,6 +82,7 @@ typedef struct { CloseEntityCallback closeCallback; InteractionCallback interactionCallback; bool isPlace; + bool isBuilding; bool canBeSelected; } EntityEntry; @@ -90,6 +100,7 @@ void setEntityPosition(Entity* entity, Vector3 position); void placeEntityOnGround(Entity* entity, const World* world); bool entityIsPlace(EntityId id); +bool entityIsBuilding(EntityId id); bool entityCanBeSelected(EntityId id); float getEntityDistance(Entity entity, Vector3 position); @@ -100,4 +111,7 @@ int getInteractionMenuIndex(Selection selection); BoundingBox entityBoxFromScale(float scale, float width, float height); +EntityBuilding* createEntityBuilding(Image heightmap); +void freeEntityBuilding(EntityBuilding* entityBuilding); + #endif |
