aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/assets.c16
-rw-r--r--src/assets.h5
-rw-r--r--src/entity.c22
-rw-r--r--src/entity.h6
4 files changed, 43 insertions, 6 deletions
diff --git a/src/assets.c b/src/assets.c
index bcdb3cb..db87d54 100644
--- a/src/assets.c
+++ b/src/assets.c
@@ -30,7 +30,8 @@ const char shaderAssetNames[SHADER_ASSET_COUNT][FT_NAMEMAX] = {
const char modelAssetPaths[MODEL_ASSET_COUNT][FT_NAMEMAX] = {
"UtilityPole.obj",
"Samantha.obj",
- "ShopKeeper.obj"
+ "ShopKeeper.obj",
+ "ShopKeeper.obj" // John and Ron ARE NOT the same person
};
void initShaderAssets(Shader shaders[SHADER_ASSET_COUNT])
@@ -47,8 +48,19 @@ void initShaderAssets(Shader shaders[SHADER_ASSET_COUNT])
void initModelAssets(Assets* assets)
{
+ // John.
+ assets->models[JOHN_MODEL].materials[0].maps[MATERIAL_MAP_DIFFUSE].texture =
+ assets->textures[JOHN_TEXTURE];
-}
+ // Ron.
+ assets->models[RON_MODEL].materials[0].maps[MATERIAL_MAP_DIFFUSE].texture =
+ assets->textures[RON_TEXTURE];
+}
+
+/*
+ there are people who pronounce Wario as War-io instead of Wah-rio
+ do they also pronounce Mario as Mor-io?
+*/
void initAssets(Assets* assets)
{
diff --git a/src/assets.h b/src/assets.h
index e0c40ea..2cd5765 100644
--- a/src/assets.h
+++ b/src/assets.h
@@ -6,7 +6,7 @@
#define TEXTURE_ASSET_COUNT 15
#define IMAGE_ASSET_COUNT 1
#define SHADER_ASSET_COUNT 2
-#define MODEL_ASSET_COUNT 3
+#define MODEL_ASSET_COUNT 4
extern const char textureAssetPaths[TEXTURE_ASSET_COUNT][FT_NAMEMAX];
extern const char imageAssetPaths[IMAGE_ASSET_COUNT][FT_NAMEMAX];
@@ -49,7 +49,8 @@ enum {
enum {
UTILITY_POLE_MODEL,
SAMANTHA_MODEL,
- SHOP_KEEPER_MODEL
+ JOHN_MODEL,
+ RON_MODEL
};
typedef struct {
diff --git a/src/entity.c b/src/entity.c
index 5515932..0c0b914 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -72,9 +72,25 @@ Entity createEntity(EntityId id, Vector3 position)
case TRASH:
entity.box = entityBoxFromScale(TRASH_SCALE, 202.0, 122.0);
break;
+
case MEDICAL_TRASH:
entity.box = entityBoxFromScale(MEDICAL_TRASH_SCALE, 200.0, 132.0);
break;
+ // TODO: do the thing
+ case JOHN:
+ entity.box = (BoundingBox){
+ .min = (Vector3){-1.0, -1.0, -1.0},
+ .max = (Vector3){1.0, 1.0, 1.0}
+ };
+
+ break;
+ case RON:
+ entity.box = (BoundingBox){
+ .min = (Vector3){-1.0, -1.0, -1.0},
+ .max = (Vector3){1.0, 1.0, 1.0}
+ };
+
+ break;
default:
break;
}
@@ -171,6 +187,12 @@ void updateEntity(Entity* entity, Game* game)
game->assets.textures[MEDICAL_TRASH_TEXTURE],
entity->position, MEDICAL_TRASH_SCALE, WHITE);
break;
+ case JOHN:
+ DrawModel(game->assets.models[JOHN_MODEL], entity->position, 1.0, WHITE);
+ break;
+ case RON:
+ DrawModel(game->assets.models[RON_MODEL], entity->position, 1.0, WHITE);
+ break;
default:
break;
}
diff --git a/src/entity.h b/src/entity.h
index 30b2fcd..a83a5d0 100644
--- a/src/entity.h
+++ b/src/entity.h
@@ -5,7 +5,7 @@
#ifndef ENTITY_H
#define ENTITY_H
-#define ENTITY_COUNT 12
+#define ENTITY_COUNT 14
#define TREE_SCALE 40.0
#define BUSH_SCALE 3.0
@@ -51,7 +51,9 @@ enum {
SAMANTHAS_SPOT,
TRASHCAN,
TRASH,
- MEDICAL_TRASH
+ MEDICAL_TRASH,
+ JOHN,
+ RON
};
typedef struct {