From 1bb1eb7b8790d52fea2296b06c1d46730946fc53 Mon Sep 17 00:00:00 2001 From: Zaba999 Date: Tue, 11 Sep 2012 23:11:34 +0200 Subject: half of task compile. --- src/object/task/taskrecover.cpp | 74 ++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'src/object/task/taskrecover.cpp') diff --git a/src/object/task/taskrecover.cpp b/src/object/task/taskrecover.cpp index 02cefb8..4c8ead8 100644 --- a/src/object/task/taskrecover.cpp +++ b/src/object/task/taskrecover.cpp @@ -23,7 +23,7 @@ #include "math/geometry.h" #include "common/iman.h" -#include "old/particule.h" +#include "graphics/engine/particle.h" #include "physics/physics.h" #include "ui/displaytext.h" @@ -58,13 +58,13 @@ bool CTaskRecover::EventProcess(const Event &event) Math::Point dim; float a, g, cirSpeed, angle, energy, dist, linSpeed; - if ( m_engine->RetPause() ) return true; - if ( event.event != EVENT_FRAME ) return true; + if ( m_engine->GetPause() ) return true; + if ( event.type != EVENT_FRAME ) return true; if ( m_bError ) return false; if ( m_phase == TRP_TURN ) // preliminary rotation? { - a = m_object->RetAngleY(0); + a = m_object->GetAngleY(0); g = m_angle; cirSpeed = Math::Direction(a, g)*1.0f; if ( cirSpeed > 1.0f ) cirSpeed = 1.0f; @@ -90,7 +90,7 @@ bool CTaskRecover::EventProcess(const Event &event) if ( m_phase == TRP_MOVE ) // preliminary forward/backward? { - dist = Math::Distance(m_object->RetPosition(0), m_ruin->RetPosition(0)); + dist = Math::Distance(m_object->GetPosition(0), m_ruin->GetPosition(0)); linSpeed = 0.0f; if ( dist > RECOVER_DIST ) linSpeed = 1.0f; if ( dist < RECOVER_DIST ) linSpeed = -1.0f; @@ -100,10 +100,10 @@ bool CTaskRecover::EventProcess(const Event &event) if ( m_phase == TRP_OPER ) { - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power != 0 ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); power->SetEnergy(energy-ENERGY_RECOVER*event.rTime*m_speed); } @@ -122,9 +122,9 @@ bool CTaskRecover::EventProcess(const Event &event) m_metal->SetZoom(0, (m_progress-0.5f)/0.3f); } - if ( m_lastParticule+m_engine->ParticuleAdapt(0.02f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.02f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; pos = m_recoverPos; pos.x += (Math::Rand()-0.5f)*8.0f*(1.0f-m_progress); @@ -135,7 +135,7 @@ bool CTaskRecover::EventProcess(const Event &event) speed.y = Math::Rand()*15.0f; dim.x = Math::Rand()*2.0f+1.5f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIRECOVER, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIRECOVER, 1.0f, 0.0f, 0.0f); } } @@ -149,9 +149,9 @@ bool CTaskRecover::EventProcess(const Event &event) m_object->SetAngleZ(3, angle); m_object->SetAngleZ(5, angle); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.02f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.02f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; pos = m_recoverPos; pos.y -= 4.0f; @@ -160,7 +160,7 @@ bool CTaskRecover::EventProcess(const Event &event) speed.y = Math::Rand()*15.0f; dim.x = Math::Rand()*2.0f+1.5f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIRECOVER, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIRECOVER, 1.0f, 0.0f, 0.0f); } } @@ -180,17 +180,17 @@ Error CTaskRecover::Start() ObjectType type; m_bError = true; // operation impossible - if ( !m_physics->RetLand() ) return ERR_RECOVER_VEH; + if ( !m_physics->GetLand() ) return ERR_RECOVER_VEH; - type = m_object->RetType(); + type = m_object->GetType(); if ( type != OBJECT_MOBILErr ) return ERR_RECOVER_VEH; - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power == 0 ) return ERR_RECOVER_ENERGY; - energy = power->RetEnergy(); - if ( energy < ENERGY_RECOVER/power->RetCapacity()+0.05f ) return ERR_RECOVER_ENERGY; + energy = power->GetEnergy(); + if ( energy < ENERGY_RECOVER/power->GetCapacity()+0.05f ) return ERR_RECOVER_ENERGY; - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); pos = Math::Vector(RECOVER_DIST, 3.3f, 0.0f); pos = Transform(*mat, pos); // position in front m_recoverPos = pos; @@ -199,8 +199,8 @@ Error CTaskRecover::Start() if ( m_ruin == 0 ) return ERR_RECOVER_NULL; m_ruin->SetLock(true); // ruin no longer usable - iPos = m_object->RetPosition(0); - oPos = m_ruin->RetPosition(0); + iPos = m_object->GetPosition(0); + oPos = m_ruin->GetPosition(0); m_angle = Math::RotateAngle(oPos.x-iPos.x, iPos.z-oPos.z); // CW ! m_metal = 0; @@ -209,7 +209,7 @@ Error CTaskRecover::Start() m_progress = 0.0f; m_speed = 1.0f/1.0f; m_time = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_bError = false; // ok @@ -227,27 +227,27 @@ Error CTaskRecover::IsEnded() float angle, dist, time; int i; - if ( m_engine->RetPause() ) return ERR_CONTINUE; + if ( m_engine->GetPause() ) return ERR_CONTINUE; if ( m_bError ) return ERR_STOP; if ( m_phase == TRP_TURN ) // preliminary rotation? { - angle = m_object->RetAngleY(0); + angle = m_object->GetAngleY(0); angle = Math::NormAngle(angle); // 0..2*Math::PI if ( Math::TestAngle(angle, m_angle-Math::PI*0.01f, m_angle+Math::PI*0.01f) ) { m_physics->SetMotorSpeedZ(0.0f); - dist = Math::Distance(m_object->RetPosition(0), m_ruin->RetPosition(0)); + dist = Math::Distance(m_object->GetPosition(0), m_ruin->GetPosition(0)); if ( dist > RECOVER_DIST ) { - time = m_physics->RetLinTimeLength(dist-RECOVER_DIST, 1.0f); + time = m_physics->GetLinTimeLength(dist-RECOVER_DIST, 1.0f); m_speed = 1.0f/time; } else { - time = m_physics->RetLinTimeLength(RECOVER_DIST-dist, -1.0f); + time = m_physics->GetLinTimeLength(RECOVER_DIST-dist, -1.0f); m_speed = 1.0f/time; } m_phase = TRP_MOVE; @@ -258,19 +258,19 @@ Error CTaskRecover::IsEnded() if ( m_phase == TRP_MOVE ) // preliminary advance? { - dist = Math::Distance(m_object->RetPosition(0), m_ruin->RetPosition(0)); + dist = Math::Distance(m_object->GetPosition(0), m_ruin->GetPosition(0)); if ( dist >= RECOVER_DIST-1.0f && dist <= RECOVER_DIST+1.0f ) { m_physics->SetMotorSpeedX(0.0f); - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); pos = Math::Vector(RECOVER_DIST, 3.3f, 0.0f); pos = Transform(*mat, pos); // position in front m_recoverPos = pos; - i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.9f, true); + i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.9f, true); m_sound->AddEnvelope(i, 1.0f, 1.5f, 0.3f, SOPER_CONTINUE); m_sound->AddEnvelope(i, 1.0f, 1.5f, 1.0f, SOPER_CONTINUE); m_sound->AddEnvelope(i, 0.0f, 0.9f, 0.3f, SOPER_STOP); @@ -310,15 +310,15 @@ Error CTaskRecover::IsEnded() m_metal->SetLock(true); // metal not yet usable m_metal->SetZoom(0, 0.0f); - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); pos = Math::Vector(RECOVER_DIST, 3.1f, 3.9f); pos = Transform(*mat, pos); goal = Math::Vector(RECOVER_DIST, 3.1f, -3.9f); goal = Transform(*mat, goal); - m_particule->CreateRay(pos, goal, PARTIRAY2, + m_particle->CreateRay(pos, goal, Gfx::PARTIRAY2, Math::Point(2.0f, 2.0f), 8.0f); - m_soundChannel = m_sound->Play(SOUND_RECOVER, m_ruin->RetPosition(0), 0.0f, 1.0f, true); + m_soundChannel = m_sound->Play(SOUND_RECOVER, m_ruin->GetPosition(0), 0.0f, 1.0f, true); m_sound->AddEnvelope(m_soundChannel, 0.6f, 1.0f, 2.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.6f, 1.0f, 4.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.7f, 2.0f, SOPER_STOP); @@ -338,7 +338,7 @@ Error CTaskRecover::IsEnded() m_soundChannel = -1; - i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.9f, true); + i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.9f, true); m_sound->AddEnvelope(i, 1.0f, 1.5f, 0.3f, SOPER_CONTINUE); m_sound->AddEnvelope(i, 1.0f, 1.5f, 1.0f, SOPER_CONTINUE); m_sound->AddEnvelope(i, 0.0f, 0.9f, 0.3f, SOPER_STOP); @@ -389,10 +389,10 @@ CObject* CTaskRecover::SearchRuin() min = 100000.0f; for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type == OBJECT_RUINmobilew1 || type == OBJECT_RUINmobilew2 || type == OBJECT_RUINmobilet1 || @@ -400,7 +400,7 @@ CObject* CTaskRecover::SearchRuin() type == OBJECT_RUINmobiler1 || type == OBJECT_RUINmobiler2 ) // vehicle in ruin? { - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, m_recoverPos); if ( dist > 40.0f ) continue; -- cgit v1.2.3-1-g7c22