Remove unused light distance property

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14884 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2014-01-02 01:27:15 +00:00
parent c25e1c2472
commit ea7231170a
8 changed files with 23 additions and 15 deletions

View File

@ -2036,6 +2036,8 @@ video::ITexture* IrrDriver::RTTProvider::renderToTexture(float angle,
return m_render_target_texture;
}
// ----------------------------------------------------------------------------
void IrrDriver::applyObjectPassShader(scene::ISceneNode * const node, bool rimlit)
{
if (!m_glsl)
@ -2102,6 +2104,8 @@ void IrrDriver::applyObjectPassShader(scene::ISceneNode * const node, bool rimli
}
}
// ----------------------------------------------------------------------------
void IrrDriver::applyObjectPassShader()
{
if (!m_glsl)
@ -2110,15 +2114,17 @@ void IrrDriver::applyObjectPassShader()
applyObjectPassShader(m_scene_manager->getRootSceneNode());
}
scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float radius,
float energy, float r, float g, float b, bool sun, scene::ISceneNode* parent)
// ----------------------------------------------------------------------------
scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy,
float r, float g, float b, bool sun, scene::ISceneNode* parent)
{
if (m_glsl)
{
LightNode *light = NULL;
if (!sun)
light = new LightNode(m_scene_manager, parent, radius, energy, r, g, b);
light = new LightNode(m_scene_manager, parent, energy, r, g, b);
else
light = new SunNode(m_scene_manager, parent, r, g, b);
@ -2148,10 +2154,12 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float radius,
}
else
{
return m_scene_manager->addLightSceneNode(NULL, pos, video::SColorf(r, g, b), radius);
return NULL;
}
}
// ----------------------------------------------------------------------------
void IrrDriver::clearLights()
{
u32 i;

View File

@ -456,7 +456,7 @@ public:
void applyObjectPassShader();
void applyObjectPassShader(scene::ISceneNode * const node, bool rimlit = false);
// ------------------------------------------------------------------------
scene::ISceneNode *addLight(const core::vector3df &pos, float radius = 1.0f, float energy = 1., float r = 1.0f,
scene::ISceneNode *addLight(const core::vector3df &pos, float energy = 1., float r = 1.0f,
float g = 1.0f, float b = 1.0f, bool sun = false, scene::ISceneNode* parent = NULL);
// ------------------------------------------------------------------------
void clearLights();

View File

@ -34,7 +34,7 @@ using namespace core;
aabbox3df LightNode::box;
LightNode::LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float radius, float e, float r, float g, float b):
LightNode::LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float e, float r, float g, float b):
ISceneNode(parent == NULL ? mgr->getRootSceneNode() : parent, mgr, -1)
{
m_energy = e;

View File

@ -34,7 +34,7 @@ namespace irr
class LightNode: public scene::ISceneNode
{
public:
LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float radius, float energy, float r, float g, float b);
LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float energy, float r, float g, float b);
virtual ~LightNode();
virtual void render() OVERRIDE;
@ -50,7 +50,7 @@ public:
virtual u32 getMaterialCount() const OVERRIDE { return 1; }
virtual bool isPointLight() { return true; }
float getRadius() const { return m_radius; }
//float getRadius() const { return m_radius; }
float getEnergy() const { return m_energy; }
float getEffectiveEnergy() const { return m_energy_multiplier * m_energy; }
core::vector3df getColor() const { return core::vector3df(m_color[0], m_color[1], m_color[2]); }
@ -63,7 +63,7 @@ protected:
class ScreenQuad *sq;
float m_radius;
//float m_radius;
float m_color[3];
float m_energy;

View File

@ -35,7 +35,7 @@ using namespace scene;
using namespace core;
SunNode::SunNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float r, float g, float b):
LightNode(mgr, parent, 10000, 0., r, g, b)
LightNode(mgr, parent, 0., r, g, b)
{
sq = new ScreenQuad(irr_driver->getVideoDriver());

View File

@ -1628,7 +1628,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
}
const video::SColorf tmpf(m_sun_diffuse_color);
m_sun = irr_driver->addLight(m_sun_position, 10000.0f, 0., tmpf.r, tmpf.g, tmpf.b, true);
m_sun = irr_driver->addLight(m_sun_position, 0., tmpf.r, tmpf.g, tmpf.b, true);
if (!irr_driver->isGLSL())
{

View File

@ -587,15 +587,15 @@ TrackObjectPresentationLight::TrackObjectPresentationLight(const XMLNode& xml_no
xml_node.get("color", &m_color);
const video::SColorf colorf(m_color);
m_distance = 25.0f;
xml_node.get("distance", &m_distance);
//m_distance = 25.0f;
//xml_node.get("distance", &m_distance);
m_energy = 1.0f;
xml_node.get("energy", &m_energy);
if (irr_driver->isGLSL())
{
m_node = irr_driver->addLight(m_init_xyz, m_distance, m_energy, colorf.r, colorf.g, colorf.b, false, parent);
m_node = irr_driver->addLight(m_init_xyz, m_energy, colorf.r, colorf.g, colorf.b, false, parent);
}
else
{

View File

@ -274,7 +274,7 @@ class TrackObjectPresentationLight : public TrackObjectPresentationSceneNode
{
private:
video::SColor m_color;
float m_distance;
//float m_distance;
float m_energy;
public: