Remove redundant e usage. Energy is already multiplied into exported light. Fixes potential bug (e used uninitialised, reported by Campbell Barton on IRC).

This commit is contained in:
Nathan Letwory
2011-06-20 10:22:39 +00:00
parent 78ea4561a4
commit bb851003b5

View File

@@ -67,7 +67,7 @@ void LightsExporter::operator()(Object *ob)
std::string la_id(get_light_id(ob));
std::string la_name(id_name(la));
COLLADASW::Color col(la->r * la->energy, la->g * la->energy, la->b * la->energy);
float e, d, constatt, linatt, quadatt;
float d, constatt, linatt, quadatt;
d = la->dist;
@@ -84,7 +84,7 @@ void LightsExporter::operator()(Object *ob)
// sun
if (la->type == LA_SUN) {
COLLADASW::DirectionalLight cla(mSW, la_id, la_name, e);
COLLADASW::DirectionalLight cla(mSW, la_id, la_name);
cla.setColor(col);
cla.setConstantAttenuation(constatt);
exportBlenderProfile(cla, la);
@@ -92,7 +92,7 @@ void LightsExporter::operator()(Object *ob)
}
// hemi
else if (la->type == LA_HEMI) {
COLLADASW::AmbientLight cla(mSW, la_id, la_name, e);
COLLADASW::AmbientLight cla(mSW, la_id, la_name);
cla.setColor(col);
cla.setConstantAttenuation(constatt);
exportBlenderProfile(cla, la);
@@ -100,7 +100,7 @@ void LightsExporter::operator()(Object *ob)
}
// spot
else if (la->type == LA_SPOT) {
COLLADASW::SpotLight cla(mSW, la_id, la_name, e);
COLLADASW::SpotLight cla(mSW, la_id, la_name);
cla.setColor(col);
cla.setFallOffAngle(la->spotsize);
cla.setFallOffExponent(la->spotblend);
@@ -112,7 +112,7 @@ void LightsExporter::operator()(Object *ob)
}
// lamp
else if (la->type == LA_LOCAL) {
COLLADASW::PointLight cla(mSW, la_id, la_name, e);
COLLADASW::PointLight cla(mSW, la_id, la_name);
cla.setColor(col);
cla.setConstantAttenuation(constatt);
cla.setLinearAttenuation(linatt);
@@ -123,7 +123,7 @@ void LightsExporter::operator()(Object *ob)
// area lamp is not supported
// it will be exported as a local lamp
else {
COLLADASW::PointLight cla(mSW, la_id, la_name, e);
COLLADASW::PointLight cla(mSW, la_id, la_name);
cla.setColor(col);
cla.setConstantAttenuation(constatt);
cla.setLinearAttenuation(linatt);