diff --git a/src/object/old_object.cpp b/src/object/old_object.cpp index 55343e64..e55818f2 100644 --- a/src/object/old_object.cpp +++ b/src/object/old_object.cpp @@ -113,7 +113,6 @@ COldObject::COldObject(int id) m_name = ""; m_shadowLight = -1; m_shadowHeight = 0.0f; - m_effectLight = -1; m_effectHeight = 0.0f; m_linVibration = 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; } - if ( m_effectLight != -1 ) - { - m_lightMan->DeleteLight(m_effectLight); - m_effectLight = -1; - } - if ( m_physics != nullptr ) { m_physics->DeleteObject(bAll); @@ -1349,13 +1342,6 @@ void COldObject::SetPartPosition(int part, const Math::Vector &pos) lightPos.y += m_shadowHeight; 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; - 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; } -// Returns the number of light effects. - -int COldObject::GetEffectLight() -{ - return m_effectLight; -} - // Creates the circular shadow underneath a vehicle. bool COldObject::CreateShadowCircle(float radius, float intensity, diff --git a/src/object/old_object.h b/src/object/old_object.h index e2c924be..c72326f2 100644 --- a/src/object/old_object.h +++ b/src/object/old_object.h @@ -130,7 +130,6 @@ public: void SetDrawFront(bool bDraw) override; int GetShadowLight(); - int GetEffectLight(); void SetFloorHeight(float height); void FloorAdjust() override; diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp index aec572b1..e4013bb9 100644 --- a/src/physics/physics.cpp +++ b/src/physics/physics.cpp @@ -2870,17 +2870,10 @@ int CPhysics::ExploHimself(ObjectType iType, ObjectType oType, float force) void CPhysics::FrameParticle(float aTime, float rTime) { - Math::Vector pos; - /*float intensity;*/ - int effectLight; - //bool bFlash; - m_restBreakParticle -= rTime; if ( aTime-m_lastPowerParticle < m_engine->ParticleAdapt(0.05f) ) return; m_lastPowerParticle = aTime; - //bFlash = false; - float energy = GetObjectEnergyLevel(m_object); if ( energy != m_lastEnergy ) // change the energy level? @@ -2888,7 +2881,6 @@ void CPhysics::FrameParticle(float aTime, float rTime) if ( energy > m_lastEnergy ) // recharge? { PowerParticle(1.0f, false); - //bFlash = true; } if ( energy == 0.0f || m_lastEnergy == 0.0f ) @@ -2902,28 +2894,6 @@ void CPhysics::FrameParticle(float aTime, float rTime) if ( m_restBreakParticle > 0.0f ) { 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); - /*}*/ } }