Added support for lightmaps, but this is completely untested atm.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4549 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-01-28 04:37:56 +00:00
parent d680a7e792
commit e0e1d760fa
2 changed files with 8 additions and 2 deletions

View File

@ -49,6 +49,7 @@ Material::Material(const XMLNode *node, int index)
b=false; b=false;
node->get("clampV", &b); if(b) m_clamp_tex +=VCLAMP; node->get("clampV", &b); if(b) m_clamp_tex +=VCLAMP;
node->get("transparency", &m_transparency ); node->get("transparency", &m_transparency );
node->get("lightmap", &m_lightmap );
node->get("alpha", &m_alpha_blending ); node->get("alpha", &m_alpha_blending );
node->get("light", &m_lighting ); node->get("light", &m_lighting );
node->get("sphere", &m_sphere_map ); node->get("sphere", &m_sphere_map );
@ -97,6 +98,7 @@ void Material::init(unsigned int index)
m_index = index; m_index = index;
m_clamp_tex = 0; m_clamp_tex = 0;
m_transparency = false; m_transparency = false;
m_lightmap = false;
m_alpha_blending = false; m_alpha_blending = false;
m_lighting = true; m_lighting = true;
m_sphere_map = false; m_sphere_map = false;
@ -135,8 +137,10 @@ void Material::setMaterialProperties(video::SMaterial *m) const
else if (m_alpha_blending) else if (m_alpha_blending)
m->MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; m->MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
if (m_sphere_map) else if (m_sphere_map)
m->MaterialType = video::EMT_SPHERE_MAP; m->MaterialType = video::EMT_SPHERE_MAP;
else if (m_lightmap)
m->MaterialType = video::EMT_LIGHTMAP;
if (!m_lighting) if (!m_lighting)
{ {

View File

@ -45,6 +45,8 @@ private:
bool m_sphere_map; bool m_sphere_map;
bool m_transparency; bool m_transparency;
bool m_alpha_blending; bool m_alpha_blending;
/** True if lightmapping is enabled for this material. */
bool m_lightmap;
float m_friction; float m_friction;
/** How much the top speed is reduced per second. */ /** How much the top speed is reduced per second. */
float m_slowdown; float m_slowdown;