]> git.lizzy.rs Git - shadowclad.git/blob - level.c
Reorder, move and rename things
[shadowclad.git] / level.c
1 #include <GL/gl.h>
2 #include <assimp/cimport.h>
3 #include <stdio.h> // TODO remove
4
5 #include "level.h"
6
7 const AiScene* levelScene = NULL;
8
9 static const Block BLOCK_EMPTY = 0;
10 static const Block BLOCK_WALL01 = 0xFF0000FF; // red
11
12 static const AiScene* blockWall01 = NULL;
13
14 static TgaImage* levelImage = NULL;
15
16 void initLevel() {
17         blockWall01 = importScene("out/assets/wall01.3ds");
18         levelScene = blockWall01;
19 }
20
21 void setImage(TgaImage* image) {
22         levelImage = image;
23 }
24
25 const AiScene* importScene(const char* path) {
26         const AiScene* scene = aiImportFile(path, 0u);
27         if (scene == NULL) {
28                 fprintf(stderr, "Asset import failed at file %s\n", path); // TODO factor logging the heck outta here
29         }
30         return scene;
31         // TODO aiReleaseImport(scene);
32 }