aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities/johnsStore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities/johnsStore.c')
-rw-r--r--src/entities/johnsStore.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/entities/johnsStore.c b/src/entities/johnsStore.c
index 3a96afc..5a38bd7 100644
--- a/src/entities/johnsStore.c
+++ b/src/entities/johnsStore.c
@@ -2,31 +2,36 @@
void initJohnsStore(Entity* entity)
{
- /* bool cubemap[8][8] = { */
- /* {true, true, true, true, true, true, true, true}, */
- /* {true, false, false, false, false, false, false, true}, */
- /* {true, false, false, false, false, false, false, true}, */
- /* {true, false, false, false, false, false, false, true}, */
- /* {true, false, false, false, false, false, false, true}, */
- /* {true, false, false, false, false, false, false, true}, */
- /* {true, false, false, false, false, false, false, true}, */
- /* {true, true, true, false, false, true, true, true} */
- /* }; */
+ Color colors[] = {
+ WHITE, WHITE, WHITE, WHITE, WHITE, WHITE,
+ WHITE, BLACK, BLACK, BLACK, BLACK, WHITE,
+ WHITE, BLACK, BLACK, BLACK, BLACK, WHITE,
+ WHITE, BLACK, BLACK, BLACK, BLACK, WHITE,
+ WHITE, BLACK, BLACK, BLACK, BLACK, WHITE,
+ WHITE, WHITE, BLACK, BLACK, WHITE, WHITE
+ };
- /* Image heightmap = generateCubemapImage((const bool**)cubemap, 8, 8); */
- /* entity->data = (void*)createEntityBuilding(heightmap); */
- /* UnloadImage(heightmap); */
+ int width = 6;
+ int height = 6;
- entity->box = (BoundingBox){
- .min = (Vector3){-1.0, -1.0, -1.0},
- .max = (Vector3){1.0, 1.0, 1.0}
+ Image cubemap = (Image){
+ .data = colors,
+ .width = width,
+ .height = height,
+ .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
+ .mipmaps = 1
};
+
+ entity->data = (void*)createEntityBuilding(cubemap);
+ EntityBuilding* building = (EntityBuilding*)entity->data;
+ entity->box = GetModelBoundingBox(building->model);
}
void updateJohnsStore(Entity* entity, Game* game)
{
EntityBuilding* building = (EntityBuilding*)entity->data;
DrawModel(building->model, entity->position, 1.0, WHITE);
+ DrawBoundingBox(entity->box, RED);
}
void closeJohnsStore(Entity* entity)