Implemented persistence of lighting information through XML files

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4034
This commit is contained in:
kearwood
2012-04-12 01:27:30 +00:00
parent 4215bf8b22
commit d4b80212cc
10 changed files with 90 additions and 1 deletions

View File

@@ -31,6 +31,18 @@ tinyxml2::XMLElement *KRLight::saveXML( tinyxml2::XMLNode *parent)
return e;
}
void KRLight::loadXML(tinyxml2::XMLElement *e) {
KRNode::loadXML(e);
float x,y,z;
e->QueryFloatAttribute("color_r", &x);
e->QueryFloatAttribute("color_g", &y);
e->QueryFloatAttribute("color_b", &z);
m_color = KRVector3(x,y,z);
e->QueryFloatAttribute("intensity", &m_intensity);
e->QueryFloatAttribute("decay_start", &m_decayStart);
}
void KRLight::setIntensity(float intensity) {
m_intensity = intensity;
}