Misc code style improvements and warning fixes

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14819 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2013-12-27 23:56:42 +00:00
parent 14655bcdb9
commit 6b4d91effa
4 changed files with 9 additions and 66 deletions

View File

@@ -544,10 +544,10 @@ public:
// Norm factor
double w = rand();
w /= RAND_MAX;
array[4 * i] = x;
array[4 * i + 1] = y;
array[4 * i + 2] = z;
array[4 * i + 3] = w;
array[4 * i] = (float)x;
array[4 * i + 1] = (float)y;
array[4 * i + 2] = (float)z;
array[4 * i + 3] = (float)w;
}
}

View File

@@ -2130,7 +2130,8 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float radius,
m_lights.push_back(light);
if (sun) {
if (sun)
{
m_sun_interposer->setPosition(pos);
m_sun_interposer->updateAbsolutePosition();
@@ -2144,7 +2145,8 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float radius,
}
return light;
} else
}
else
{
return m_scene_manager->addLightSceneNode(NULL, pos, video::SColorf(r, g, b), radius);
}

View File

@@ -710,7 +710,7 @@ void IrrDriver::renderLights(const core::aabbox3df& cambox,
continue;
}
const core::vector3df &lightpos = (m_lights[i]->getPosition() - campos);
unsigned idx = lightpos.getLength() / 10;
unsigned idx = (unsigned)(lightpos.getLength() / 10);
if(idx > 14)
continue;
BucketedLN[idx].push_back(m_lights[i]);

View File

@@ -55,71 +55,12 @@ void TrackObjectManager::add(const XMLNode &xml_node)
if (is_lod)
{
//printf("Adding lod obj to group <%s>\n", groupname.c_str());
m_lod_objects[groupname].push_back(&xml_node);
}
else
{
m_all_objects.push_back(new TrackObject(xml_node));
}
/*
std::string groupname;
xml_node.get("lod_group", &groupname);
bool is_lod = !groupname.empty();
std::string type;
xml_node.get("type", &type);
if (xml_node.getName() == "particle-emitter")
{
m_all_objects.push_back(new ThreeDAnimation(xml_node));
}
else if (type=="movable")
{
if (is_lod)
{
assert(false); // TODO
//_lod_objects[groupname].push_back(new TrackObject(xml_node));
}
else
{
m_all_objects.push_back(new TrackObject(xml_node));
}
}
else if(type=="animation")
{
if (is_lod)
{
m_lod_objects[groupname].push_back(new ThreeDAnimation(xml_node));
}
else
{
m_all_objects.push_back(new ThreeDAnimation(xml_node));
}
}
else if(type=="billboard")
{
m_all_objects.push_back(new BillboardAnimation(xml_node));
}
else if(type=="sfx-emitter")
{
m_all_objects.push_back(new ThreeDAnimation(xml_node));
}
else if(type=="cutscene_camera")
{
m_all_objects.push_back(new ThreeDAnimation(xml_node));
}
else if(type=="action-trigger")
{
m_all_objects.push_back(new TrackObject(xml_node));
}
else
{
fprintf(stderr, "Unknown track object: '%s' - ignored.\n",
type.c_str());
}
*/
}
catch (std::exception& e)
{