|
From: julien r. <jul...@us...> - 2004-11-01 17:57:10
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13098 Modified Files: base.h meshmanager.cc meshmanager.h Log Message: chargement des meshes Index: meshmanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/meshmanager.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** meshmanager.cc 21 Oct 2004 21:21:00 -0000 1.1 --- meshmanager.cc 1 Nov 2004 17:57:01 -0000 1.2 *************** *** 17,30 **** } ! MD5Instance* MeshManager::Load (const std::string& name) { MeshesList::iterator i = mMeshes.begin (); ! if((i=mMeshes.find(name)) == mMeshes.end()) //on doit charger le mesh { MD5Mesh10* m = new MD5Mesh10 (); ! if (m->LoadMesh((char*)name.data())) mMeshes[name] = m; else mMeshes[name] = mMeshes["nomesh"]; } --- 17,54 ---- } ! void MeshManager::Load (const std::string& name, const std::string& path) { MeshesList::iterator i = mMeshes.begin (); ! if ((i=mMeshes.find(name)) == mMeshes.end()) { MD5Mesh10* m = new MD5Mesh10 (); ! if (m->LoadMesh((char*)path.data())) mMeshes[name] = m; else mMeshes[name] = mMeshes["nomesh"]; + } + } + + void MeshManager::LoadAnim (const std::string& name, const std::string& path) + { + MeshesList::iterator i = mMeshes.begin (); + if ((i=mMeshes.find(name)) != mMeshes.end()) //si le mesh a été chargé + { + MD5Mesh10* m = mMeshes[name]; + m->LoadAnim((char*)path.data()); + } + } + + MD5Instance* MeshManager::LoadInstance (const std::string& name) + { + MeshesList::iterator i = mMeshes.begin (); + if((i=mMeshes.find(name)) == mMeshes.end()) //mesh non chargé + { + mMeshes[name] = mMeshes["nomesh"]; + /*MD5Mesh10* m = new MD5Mesh10 (); + if (m->LoadMesh((char*)name.data())) + mMeshes[name] = m; + else + mMeshes[name] = mMeshes["nomesh"];*/ } Index: meshmanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/meshmanager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** meshmanager.h 21 Oct 2004 21:21:00 -0000 1.1 --- meshmanager.h 1 Nov 2004 17:57:01 -0000 1.2 *************** *** 12,16 **** MeshManager (); ~MeshManager (); ! MD5Instance* Load (const std::string& name); protected: typedef std::map<std::string, MD5Mesh10*> MeshesList; --- 12,19 ---- MeshManager (); ~MeshManager (); ! void Load (const std::string& name, const std::string& path); ! void LoadAnim (const std::string& name, const std::string& path); ! ! MD5Instance* LoadInstance (const std::string& name); protected: typedef std::map<std::string, MD5Mesh10*> MeshesList; Index: base.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/base.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** base.h 21 Oct 2004 21:18:28 -0000 1.2 --- base.h 1 Nov 2004 17:57:00 -0000 1.3 *************** *** 3,7 **** #include <iostream> ! #include <stdarg.h> //vsnprintf & cie namespace tg --- 3,7 ---- #include <iostream> ! #include <stdarg.h> //vsnprintf et compagnie namespace tg |