Removed unused object effect lights
parent
7b286d77b5
commit
63c7b83d82
|
@ -113,7 +113,6 @@ COldObject::COldObject(int id)
|
||||||
m_name = "";
|
m_name = "";
|
||||||
m_shadowLight = -1;
|
m_shadowLight = -1;
|
||||||
m_shadowHeight = 0.0f;
|
m_shadowHeight = 0.0f;
|
||||||
m_effectLight = -1;
|
|
||||||
m_effectHeight = 0.0f;
|
m_effectHeight = 0.0f;
|
||||||
m_linVibration = Math::Vector(0.0f, 0.0f, 0.0f);
|
m_linVibration = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||||
m_cirVibration = Math::Vector(0.0f, 0.0f, 0.0f);
|
m_cirVibration = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||||
|
@ -245,12 +244,6 @@ void COldObject::DeleteObject(bool bAll)
|
||||||
m_shadowLight = -1;
|
m_shadowLight = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_effectLight != -1 )
|
|
||||||
{
|
|
||||||
m_lightMan->DeleteLight(m_effectLight);
|
|
||||||
m_effectLight = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_physics != nullptr )
|
if ( m_physics != nullptr )
|
||||||
{
|
{
|
||||||
m_physics->DeleteObject(bAll);
|
m_physics->DeleteObject(bAll);
|
||||||
|
@ -1349,13 +1342,6 @@ void COldObject::SetPartPosition(int part, const Math::Vector &pos)
|
||||||
lightPos.y += m_shadowHeight;
|
lightPos.y += m_shadowHeight;
|
||||||
m_lightMan->SetLightPos(m_shadowLight, lightPos);
|
m_lightMan->SetLightPos(m_shadowLight, lightPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_effectLight != -1 )
|
|
||||||
{
|
|
||||||
Math::Vector lightPos = pos;
|
|
||||||
lightPos.y += m_effectHeight;
|
|
||||||
m_lightMan->SetLightPos(m_effectLight, lightPos);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1683,33 +1669,9 @@ bool COldObject::CreateEffectLight(float height, Gfx::Color color)
|
||||||
|
|
||||||
m_effectHeight = height;
|
m_effectHeight = height;
|
||||||
|
|
||||||
Gfx::Light light;
|
|
||||||
light.type = Gfx::LIGHT_SPOT;
|
|
||||||
light.diffuse = color;
|
|
||||||
light.position = Math::Vector(0.0f, height, 0.0f);
|
|
||||||
light.direction = Math::Vector(0.0f, -1.0f, 0.0f); // against the bottom
|
|
||||||
light.spotIntensity = 0.0f;
|
|
||||||
light.attenuation0 = 1.0f;
|
|
||||||
light.attenuation1 = 0.0f;
|
|
||||||
light.attenuation2 = 0.0f;
|
|
||||||
light.spotAngle = 90.0f*Math::PI/180.0f;
|
|
||||||
|
|
||||||
m_effectLight = m_lightMan->CreateLight();
|
|
||||||
if ( m_effectLight == -1 ) return false;
|
|
||||||
|
|
||||||
m_lightMan->SetLight(m_effectLight, light);
|
|
||||||
m_lightMan->SetLightIntensity(m_effectLight, 0.0f);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the number of light effects.
|
|
||||||
|
|
||||||
int COldObject::GetEffectLight()
|
|
||||||
{
|
|
||||||
return m_effectLight;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Creates the circular shadow underneath a vehicle.
|
// Creates the circular shadow underneath a vehicle.
|
||||||
|
|
||||||
bool COldObject::CreateShadowCircle(float radius, float intensity,
|
bool COldObject::CreateShadowCircle(float radius, float intensity,
|
||||||
|
|
|
@ -130,7 +130,6 @@ public:
|
||||||
void SetDrawFront(bool bDraw) override;
|
void SetDrawFront(bool bDraw) override;
|
||||||
|
|
||||||
int GetShadowLight();
|
int GetShadowLight();
|
||||||
int GetEffectLight();
|
|
||||||
|
|
||||||
void SetFloorHeight(float height);
|
void SetFloorHeight(float height);
|
||||||
void FloorAdjust() override;
|
void FloorAdjust() override;
|
||||||
|
|
|
@ -2870,17 +2870,10 @@ int CPhysics::ExploHimself(ObjectType iType, ObjectType oType, float force)
|
||||||
|
|
||||||
void CPhysics::FrameParticle(float aTime, float rTime)
|
void CPhysics::FrameParticle(float aTime, float rTime)
|
||||||
{
|
{
|
||||||
Math::Vector pos;
|
|
||||||
/*float intensity;*/
|
|
||||||
int effectLight;
|
|
||||||
//bool bFlash;
|
|
||||||
|
|
||||||
m_restBreakParticle -= rTime;
|
m_restBreakParticle -= rTime;
|
||||||
if ( aTime-m_lastPowerParticle < m_engine->ParticleAdapt(0.05f) ) return;
|
if ( aTime-m_lastPowerParticle < m_engine->ParticleAdapt(0.05f) ) return;
|
||||||
m_lastPowerParticle = aTime;
|
m_lastPowerParticle = aTime;
|
||||||
|
|
||||||
//bFlash = false;
|
|
||||||
|
|
||||||
float energy = GetObjectEnergyLevel(m_object);
|
float energy = GetObjectEnergyLevel(m_object);
|
||||||
|
|
||||||
if ( energy != m_lastEnergy ) // change the energy level?
|
if ( energy != m_lastEnergy ) // change the energy level?
|
||||||
|
@ -2888,7 +2881,6 @@ void CPhysics::FrameParticle(float aTime, float rTime)
|
||||||
if ( energy > m_lastEnergy ) // recharge?
|
if ( energy > m_lastEnergy ) // recharge?
|
||||||
{
|
{
|
||||||
PowerParticle(1.0f, false);
|
PowerParticle(1.0f, false);
|
||||||
//bFlash = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( energy == 0.0f || m_lastEnergy == 0.0f )
|
if ( energy == 0.0f || m_lastEnergy == 0.0f )
|
||||||
|
@ -2902,28 +2894,6 @@ void CPhysics::FrameParticle(float aTime, float rTime)
|
||||||
if ( m_restBreakParticle > 0.0f )
|
if ( m_restBreakParticle > 0.0f )
|
||||||
{
|
{
|
||||||
PowerParticle(m_restBreakParticle/2.5f, (energy == 0));
|
PowerParticle(m_restBreakParticle/2.5f, (energy == 0));
|
||||||
//bFlash = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
effectLight = m_object->GetEffectLight();
|
|
||||||
if ( effectLight != -1 )
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* TODO: this is supposed to flash lights of robot without power,
|
|
||||||
* but doesn't work correctly (e.g. beginning of scene201).
|
|
||||||
* Commenting out for the time being.
|
|
||||||
*/
|
|
||||||
/*if ( bFlash )
|
|
||||||
{
|
|
||||||
intensity = 0.0f;
|
|
||||||
if ( Math::Rand() < 0.5f ) intensity = 1.0f;
|
|
||||||
m_lightMan->SetLightIntensity(effectLight, intensity);
|
|
||||||
m_lightMan->SetLightIntensitySpeed(effectLight, 10000.0f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{*/
|
|
||||||
m_lightMan->SetLightIntensity(effectLight, 0.0f);
|
|
||||||
/*}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue