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