#include <assimp/vector3.h>
#include <assimp/matrix4x4.h>
#include <assimp/quaternion.h>
+#include "app.h"
#include "scene.h"
#include "objmesh.h"
#include "datamap.h"
/*static const char *mprop_semantic(int x);
static int count_textures(const aiMaterial *aimat);*/
static int assimp_textype(aiTextureType type);
-static const char *assimp_textypestr(aiTextureType type);
+//static const char *assimp_textypestr(aiTextureType type);
static Mat4 assimp_matrix(const aiMatrix4x4 &aim);
*dptr++ = *sptr == '\\' ? '/' : *sptr;
} while(*sptr++);
+ if(!fname || !*fname) continue;
+
int textype = assimp_textype(aitype);
- info_log("loading %s texture: %s\n", assimp_textypestr(aitype), fname);
- Texture *tex = scn->texset->get_texture(fname, TEX_2D, &scn->datamap);
+ Texture *tex = texman.get_texture(fname, TEX_2D, &scn->datamap);
assert(tex);
mat->textures.push_back(tex);
return MTL_TEX_UNKNOWN;
}
-static const char *assimp_textypestr(aiTextureType type)
+/*static const char *assimp_textypestr(aiTextureType type)
{
switch(type) {
case aiTextureType_DIFFUSE:
break;
}
return "unknown";
-}
+}*/
static Mat4 assimp_matrix(const aiMatrix4x4 &aim)
{
bool SceneSet::load_scene(Scene *scn, const char *fname)
{
+ scn->clear();
return scn->load(fname, SCNLOAD_FLIPTEX | SCNLOAD_STAGE_IO);
}