Skip to content

Commit

Permalink
Added 4th wall to training map
Browse files Browse the repository at this point in the history
  • Loading branch information
iWas-Coder committed Apr 26, 2024
1 parent 0f40b80 commit 3a01747
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/sk_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ typedef struct {
Model wall1;
Model wall2;
Model wall3;
Model wall4;
} sk_map;

sk_map sk_map_create(sk_map_kind kind);
Expand Down
7 changes: 7 additions & 0 deletions src/sk_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void sk_map_destroy(sk_map *m) {
UnloadModel(m->wall1);
UnloadModel(m->wall2);
UnloadModel(m->wall3);
UnloadModel(m->wall4);
UnloadShader(m->pbr_shader);
}

Expand Down Expand Up @@ -66,13 +67,19 @@ void sk_map_load(sk_map *m) {
assert(m->wall3.materialCount == 1);
// m->wall3.materials[0].shader = m->pbr_shader;
sk_texture_set(SK_TEXTURE_STONE1, &m->wall3.materials[0]);
m->wall4 = LoadModelFromMesh(GenMeshCube(32, 5, 1));
assert(m->wall4.meshCount == 1);
assert(m->wall4.materialCount == 1);
// m->wall4.materials[0].shader = m->pbr_shader;
sk_texture_set(SK_TEXTURE_STONE1, &m->wall4.materials[0]);
}

void sk_map_draw(sk_map *m) {
DrawModel(m->floor, (Vector3) { 0, 0, 0 }, 1, WHITE);
DrawModel(m->wall1, (Vector3) { -16, 2.5f, 0 }, 1, WHITE);
DrawModel(m->wall2, (Vector3) { 16, 2.5f, 0 }, 1, WHITE);
DrawModel(m->wall3, (Vector3) { 0, 2.5f, 16 }, 1, WHITE);
DrawModel(m->wall4, (Vector3) { 0, 2.5f, -16 }, 1, WHITE);
}

sk_map_kind sk_map_get_rand(void) {
Expand Down

0 comments on commit 3a01747

Please sign in to comment.