diff options
| author | nathan <nathansmith@disroot.org> | 2025-12-27 23:00:54 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-12-27 23:00:54 +0000 |
| commit | 8f2d85aa019f089b6946f3b9e0355ce59b12b67a (patch) | |
| tree | ac26c36f4c41f21641cf2786d740567413cd6ac5 /src/entities/johnsStore.c | |
| parent | c6096a028d57da1026aa86ac215ea2f07461cd96 (diff) | |
| download | FindThings-8f2d85aa019f089b6946f3b9e0355ce59b12b67a.tar.gz FindThings-8f2d85aa019f089b6946f3b9e0355ce59b12b67a.tar.bz2 FindThings-8f2d85aa019f089b6946f3b9e0355ce59b12b67a.zip | |
Buildings going well
Diffstat (limited to 'src/entities/johnsStore.c')
| -rw-r--r-- | src/entities/johnsStore.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/entities/johnsStore.c b/src/entities/johnsStore.c index 5a38bd7..e3f4908 100644 --- a/src/entities/johnsStore.c +++ b/src/entities/johnsStore.c @@ -2,6 +2,9 @@ void initJohnsStore(Entity* entity) { + int width = 6; + int height = 6; + Color colors[] = { WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, WHITE, BLACK, BLACK, BLACK, BLACK, WHITE, @@ -10,19 +13,9 @@ void initJohnsStore(Entity* entity) WHITE, BLACK, BLACK, BLACK, BLACK, WHITE, WHITE, WHITE, BLACK, BLACK, WHITE, WHITE }; - - int width = 6; - int height = 6; - - Image cubemap = (Image){ - .data = colors, - .width = width, - .height = height, - .format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, - .mipmaps = 1 - }; - entity->data = (void*)createEntityBuilding(cubemap); + entity->data = (void*)createEntityBuilding( + colorsToImage(colors, width, height)); EntityBuilding* building = (EntityBuilding*)entity->data; entity->box = GetModelBoundingBox(building->model); } @@ -30,7 +23,11 @@ void initJohnsStore(Entity* entity) void updateJohnsStore(Entity* entity, Game* game) { EntityBuilding* building = (EntityBuilding*)entity->data; + + building->model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = + game->assets.textures[JOHNS_SHOP_TEXTURE]; DrawModel(building->model, entity->position, 1.0, WHITE); + DrawBoundingBox(entity->box, RED); } |
