|
From: Josh A. <axl...@us...> - 2005-12-23 21:36:50
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14904/src Modified Files: MercuryModel.cpp MercuryModel.h Log Message: Can render materials with Sphere Mapping Index: MercuryModel.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryModel.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** MercuryModel.h 18 Dec 2005 07:56:18 -0000 1.26 --- MercuryModel.h 23 Dec 2005 21:36:40 -0000 1.27 *************** *** 74,77 **** --- 74,78 ---- bool BubbleIntercept( MercuryPoint start, MercuryPoint direction, float radius, MercuryPoint & bounce, float &t, MercuryPoint BubbleScale = MercuryPoint(1,1,1) ); + vector<MercuryMaterial*> m_materials; protected: *************** *** 89,93 **** Meshes contain an unsigned int value of which material is theirs. */ ! vector<MercuryMaterial*> m_materials; }; --- 90,94 ---- Meshes contain an unsigned int value of which material is theirs. */ ! // vector<MercuryMaterial*> m_materials; }; Index: MercuryModel.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryModel.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** MercuryModel.cpp 18 Dec 2005 07:56:18 -0000 1.33 --- MercuryModel.cpp 23 Dec 2005 21:36:40 -0000 1.34 *************** *** 47,51 **** --- 47,59 ---- if (m_meshes[i]->GetMaterial() >= 0) + { + + //Maybe mterials should be responsible for drawing themselves + //since some display values have to be set for them. + if (m_materials[m_meshes[i]->GetMaterial()]->m_diffuse_texture.IsSphereMap()) + DISPLAY->SetSphereMapping(true); + DISPLAY->SetMaterial(m_materials[m_meshes[i]->GetMaterial()]); + } else LOG.Warn(" No Materials set."); *************** *** 55,58 **** --- 63,69 ---- m_meshes[i]->Draw(); DISPLAY->EndDrawing(); + + if (m_materials[m_meshes[i]->GetMaterial()]->m_diffuse_texture.IsSphereMap()) + DISPLAY->SetSphereMapping(false); } } |