diff options
| author | nathan <nathansmith@disroot.org> | 2025-12-27 20:23:04 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-12-27 20:23:04 +0000 |
| commit | c6096a028d57da1026aa86ac215ea2f07461cd96 (patch) | |
| tree | 46341ba8ac0697a696feb6890010212393331036 /src/entities | |
| parent | 525b9023b83014c46a4a21ec9a729b559d6be0b3 (diff) | |
| download | FindThings-c6096a028d57da1026aa86ac215ea2f07461cd96.tar.gz FindThings-c6096a028d57da1026aa86ac215ea2f07461cd96.tar.bz2 FindThings-c6096a028d57da1026aa86ac215ea2f07461cd96.zip | |
cubemap thingy working
Diffstat (limited to 'src/entities')
| -rw-r--r-- | src/entities/johnsStore.c | 37 |
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) |
