nuclear@1: #include nuclear@1: #include "opengl.h" nuclear@1: #include "tile.h" nuclear@1: nuclear@1: bool Tile::load(const char *fname) nuclear@1: { nuclear@3: unsigned int proc_flags = aiProcess_JoinIdenticalVertices | nuclear@3: aiProcess_PreTransformVertices | aiProcess_Triangulate | nuclear@3: aiProcess_GenNormals | aiProcess_SortByPType | aiProcess_FlipUVs; nuclear@3: const aiScene *scn = aiImportFile(fname, proc_flags); nuclear@3: if(!scn) { nuclear@3: fprintf(stderr, "failed to load tile: %s\n", fname); nuclear@3: return -1; nuclear@3: } nuclear@3: nuclear@3: load_lights(scn); nuclear@3: nuclear@3: load_meshes(scn); nuclear@3: nuclear@3: printf("loaded tile %s: %d meshes, %d lights\n", fname, scn->mNumMeshes, scn->mNumLights); nuclear@1: return true; nuclear@1: } nuclear@1: nuclear@3: void Tile::draw(unsigned int drawmask) const nuclear@1: { nuclear@1: nuclear@1: }