dungeon_crawler

diff prototype/src/tile.cc @ 31:ddb68dc4ba07

OBJ hack
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 27 Aug 2012 04:14:04 +0300
parents fa8f89d06f6f
children d0e93b4d9ec9
line diff
     1.1 --- a/prototype/src/tile.cc	Mon Aug 27 04:03:22 2012 +0300
     1.2 +++ b/prototype/src/tile.cc	Mon Aug 27 04:14:04 2012 +0300
     1.3 @@ -12,6 +12,8 @@
     1.4  static void build_nodemap(map<aiMesh*, aiNode*> *nmap, const aiScene *scn, aiNode *node);
     1.5  static PointLight *mesh_to_light(Mesh *m);
     1.6  
     1.7 +bool ass_obj_hack;
     1.8 +
     1.9  Tile::Tile(TileSet *tileset)
    1.10  {
    1.11  	tset = tileset;
    1.12 @@ -40,6 +42,12 @@
    1.13  	map<aiMesh*, aiNode*> nodemap;
    1.14  	build_nodemap(&nodemap, scn, scn->mRootNode);
    1.15  
    1.16 +	if(strstr(fname, ".obj") == fname + strlen(fname) - 4) {
    1.17 +		ass_obj_hack = true;
    1.18 +	} else {
    1.19 +		ass_obj_hack = false;
    1.20 +	}
    1.21 +
    1.22  	//load_lights(scn);
    1.23  	load_meshes(scn, nodemap);
    1.24