diff options
author | nathan <nathansmith@disroot.org> | 2025-09-19 10:32:33 +0000 |
---|---|---|
committer | nathan <nathansmith@disroot.org> | 2025-09-19 10:32:33 +0000 |
commit | f0843bcab9feeb50abef8b2f48100a6e8882c8aa (patch) | |
tree | 39c12fc2510880c13d548ae5c22c0478ce1cb388 /src | |
parent | 8efa99463c2efa772fe7af2e65e6931d7c83e9d6 (diff) | |
download | FindThings-f0843bcab9feeb50abef8b2f48100a6e8882c8aa.tar.gz FindThings-f0843bcab9feeb50abef8b2f48100a6e8882c8aa.tar.bz2 FindThings-f0843bcab9feeb50abef8b2f48100a6e8882c8aa.zip |
Texture thingy
Diffstat (limited to 'src')
-rw-r--r-- | src/assets.c | 11 | ||||
-rw-r--r-- | src/assets.h | 3 | ||||
-rw-r--r-- | src/entity.c | 6 | ||||
-rw-r--r-- | src/entity.h | 5 |
4 files changed, 18 insertions, 7 deletions
diff --git a/src/assets.c b/src/assets.c index c6efaeb..3eb0a8a 100644 --- a/src/assets.c +++ b/src/assets.c @@ -5,7 +5,8 @@ const char textureAssetPaths[TEXTURE_ASSET_COUNT][FT_NAMEMAX] = { "nickel.png", "tree.png", "bush.png", - "flower.png" + "flower.png", + "Samantha.png" }; const char imageAssetPaths[IMAGE_ASSET_COUNT][FT_NAMEMAX] = { @@ -34,6 +35,12 @@ void initShaderAssets(Shader shaders[SHADER_ASSET_COUNT]) shader.locs[SHADER_LOC_MATRIX_MVP] = GetShaderLocation(shader, "mvp"); } +void initModelAssets(Assets* assets) +{ + assets->models[SAMANTHA_MODEL].materials[0] + .maps[MATERIAL_MAP_DIFFUSE].texture = assets->textures[SAMANTHA_TEXTURE]; +} + void initAssets(Assets* assets) { // Textures. @@ -68,6 +75,8 @@ void initAssets(Assets* assets) assets->models[index] = LoadModel( TextFormat("assets/models/%s", modelAssetPaths[index])); } + + initModelAssets(assets); } void closeAssets(Assets* assets) diff --git a/src/assets.h b/src/assets.h index 8404cd2..c2906c9 100644 --- a/src/assets.h +++ b/src/assets.h @@ -3,7 +3,7 @@ #ifndef ASSETS_H #define ASSETS_H -#define TEXTURE_ASSET_COUNT 5 +#define TEXTURE_ASSET_COUNT 6 #define IMAGE_ASSET_COUNT 1 #define SHADER_ASSET_COUNT 2 #define MODEL_ASSET_COUNT 2 @@ -22,6 +22,7 @@ enum { TREE_TEXTURE, BUSH_TEXTURE, FLOWER_TEXTURE, + SAMANTHA_TEXTURE }; // Image asset ids. diff --git a/src/entity.c b/src/entity.c index 8017de0..1548968 100644 --- a/src/entity.c +++ b/src/entity.c @@ -51,8 +51,8 @@ Entity createEntity(EntityId id, Vector3 position) break; case SAMANTHA: entity.box = (BoundingBox){ - .min = (Vector3){-SAMANTHA_WIDTH, -SAMANTHA_HEIGHT, -SAMANTHA_WIDTH}, - .max = (Vector3){SAMANTHA_WIDTH, SAMANTHA_HEIGHT, SAMANTHA_WIDTH} + .min = (Vector3){-SAMANTHA_WIDTH, -SAMANTHA_HEIGHT, -SAMANTHA_THICKNESS}, + .max = (Vector3){SAMANTHA_WIDTH, SAMANTHA_HEIGHT, SAMANTHA_THICKNESS} }; break; @@ -68,7 +68,7 @@ Entity createEntity(EntityId id, Vector3 position) // TODO: Mesh instance the utility poles and make a 3d model void updateEntity(Entity* entity, Game* game) { - // DrawBoundingBox(entity->box, RED); + DrawBoundingBox(entity->box, RED); switch (entity->id) { diff --git a/src/entity.h b/src/entity.h index 3a2fd15..934efa3 100644 --- a/src/entity.h +++ b/src/entity.h @@ -17,8 +17,9 @@ #define UTILITY_POLE_HEIGHT 100.0 #define UTILITY_POLE_RADIUS 3.0 -#define SAMANTHA_WIDTH 1.0 -#define SAMANTHA_HEIGHT 1.0 +#define SAMANTHA_WIDTH 23.6414/2.0 +#define SAMANTHA_HEIGHT 28.5382/2.0 +#define SAMANTHA_THICKNESS 13.0529/2.0 typedef int8_t EntityId; |