7 const GLuint BLOCK_EMPTY = 0x000000FF;
8 const GLuint BLOCK_WALL01 = 0xFF0000FF;
10 TGAimage* level_image = NULL;
13 const int block_count = 1;
16 blocks = realloc(blocks, sizeof(Block*) * block_count);
18 Lib3dsFile* model_file;
20 model_file = lib3ds_file_load("assets/wall01.3ds");
21 Block* wall01block = malloc(sizeof(Block));
22 (*wall01block).type = BLOCK_WALL01;
23 (*wall01block).mesh = (*model_file).meshes[0];
24 (*wall01block).materials = (*model_file).materials;
25 (*wall01block).material_count = (*model_file).nmaterials;
26 (*wall01block).obstacle = 1;
28 blocks[0] = wall01block;
31 Block* get_block_at(GLushort x, GLushort y) {
32 if (level_image == NULL) {
35 GLuint block_type = ((GLuint*) (*level_image).bytes)[x * (*level_image).header.image_width + y];
37 for (int i = 0; i < block_count; ++i) {
38 if ((*blocks[i]).type == block_type) {
45 void set_level_image(TGAimage* image) {