dungeon_crawler

annotate prototype/src/tile.cc @ 3:31e53fd79c2d

lalala
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 10 Aug 2012 04:45:38 +0300
parents 96de911d05d4
children 158de53b4e18
rev   line source
nuclear@1 1 #include <stdio.h>
nuclear@1 2 #include "opengl.h"
nuclear@1 3 #include "tile.h"
nuclear@1 4
nuclear@1 5 bool Tile::load(const char *fname)
nuclear@1 6 {
nuclear@3 7 unsigned int proc_flags = aiProcess_JoinIdenticalVertices |
nuclear@3 8 aiProcess_PreTransformVertices | aiProcess_Triangulate |
nuclear@3 9 aiProcess_GenNormals | aiProcess_SortByPType | aiProcess_FlipUVs;
nuclear@3 10 const aiScene *scn = aiImportFile(fname, proc_flags);
nuclear@3 11 if(!scn) {
nuclear@3 12 fprintf(stderr, "failed to load tile: %s\n", fname);
nuclear@3 13 return -1;
nuclear@3 14 }
nuclear@3 15
nuclear@3 16 load_lights(scn);
nuclear@3 17
nuclear@3 18 load_meshes(scn);
nuclear@3 19
nuclear@3 20 printf("loaded tile %s: %d meshes, %d lights\n", fname, scn->mNumMeshes, scn->mNumLights);
nuclear@1 21 return true;
nuclear@1 22 }
nuclear@1 23
nuclear@3 24 void Tile::draw(unsigned int drawmask) const
nuclear@1 25 {
nuclear@1 26
nuclear@1 27 }