diff options
Diffstat (limited to 'src/object')
66 files changed, 2254 insertions, 2209 deletions
diff --git a/src/object/auto/auto.cpp b/src/object/auto/auto.cpp index d112721..509904c 100644 --- a/src/object/auto/auto.cpp +++ b/src/object/auto/auto.cpp @@ -37,22 +37,22 @@ CAuto::CAuto(CInstanceManager* iMan, CObject* object) m_iMan->AddInstance(CLASS_AUTO, this, 100); m_object = object; - m_event = (CEvent*)m_iMan->SearchInstance(CLASS_EVENT); - m_engine = (CD3DEngine*)m_iMan->SearchInstance(CLASS_ENGINE); - m_particule = (CParticule*)m_iMan->SearchInstance(CLASS_PARTICULE); - m_light = (CLight*)m_iMan->SearchInstance(CLASS_LIGHT); - m_terrain = (CTerrain*)m_iMan->SearchInstance(CLASS_TERRAIN); - m_water = (CWater*)m_iMan->SearchInstance(CLASS_WATER); - m_cloud = (CCloud*)m_iMan->SearchInstance(CLASS_CLOUD); - m_planet = (CPlanet*)m_iMan->SearchInstance(CLASS_PLANET); - m_blitz = (CBlitz*)m_iMan->SearchInstance(CLASS_BLITZ); - m_camera = (CCamera*)m_iMan->SearchInstance(CLASS_CAMERA); - m_interface = (CInterface*)m_iMan->SearchInstance(CLASS_INTERFACE); - m_main = (CRobotMain*)m_iMan->SearchInstance(CLASS_MAIN); - m_displayText = (CDisplayText*)m_iMan->SearchInstance(CLASS_DISPLAYTEXT); - m_sound = (CSound*)m_iMan->SearchInstance(CLASS_SOUND); - - m_type = m_object->RetType(); + m_event = static_cast< CEventQueue* >(m_iMan->SearchInstance(CLASS_EVENT)); + m_engine = static_cast< Gfx::CEngine* >(m_iMan->SearchInstance(CLASS_ENGINE)); + m_particle = static_cast< Gfx::CParticle* >(m_iMan->SearchInstance(CLASS_PARTICULE)); + m_lightMan = static_cast< Gfx::CLightManager* >(m_iMan->SearchInstance(CLASS_LIGHT)); + m_terrain = static_cast< Gfx::CTerrain* >(m_iMan->SearchInstance(CLASS_TERRAIN)); + m_water = static_cast< Gfx::CWater* >(m_iMan->SearchInstance(CLASS_WATER)); + m_cloud = static_cast< Gfx::CCloud* >(m_iMan->SearchInstance(CLASS_CLOUD)); + m_planet = static_cast< Gfx::CPlanet* >(m_iMan->SearchInstance(CLASS_PLANET)); + m_lightning = static_cast< Gfx::CLightning* >(m_iMan->SearchInstance(CLASS_BLITZ)); + m_camera = static_cast< Gfx::CCamera* >(m_iMan->SearchInstance(CLASS_CAMERA)); + m_interface = static_cast< Ui::CInterface* >(m_iMan->SearchInstance(CLASS_INTERFACE)); + m_main = static_cast< CRobotMain* >(m_iMan->SearchInstance(CLASS_MAIN)); + m_displayText = static_cast< Ui::CDisplayText* >(m_iMan->SearchInstance(CLASS_DISPLAYTEXT)); + m_sound = static_cast< CSoundInterface* >(m_iMan->SearchInstance(CLASS_SOUND)); + + m_type = m_object->GetType(); m_time = 0.0f; m_lastUpdateTime = 0.0f; m_bMotor = false; @@ -117,14 +117,14 @@ bool CAuto::SetString(char *string) bool CAuto::EventProcess(const Event &event) { - if ( event.event == EVENT_FRAME && - !m_engine->RetPause() ) + if ( event.type == EVENT_FRAME && + !m_engine->GetPause() ) { m_time += event.rTime; UpdateInterface(event.rTime); } - if ( !m_object->RetSelect() ) // robot not selected? + if ( !m_object->GetSelect() ) // robot not selected? { return true; } @@ -151,13 +151,13 @@ bool CAuto::Abort() bool CAuto::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, dim, ddim; float ox, oy, sx, sy; char name[100]; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw != 0 ) + pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw != nullptr ) { pw->Flush(); // destroys the window buttons m_interface->DeleteControl(EVENT_WINDOW0); // destroys the window @@ -171,7 +171,7 @@ bool CAuto::CreateInterface(bool bSelect) //? dim.y = 70.0f/480.0f; dim.y = 86.0f/480.0f; m_interface->CreateWindows(pos, dim, 3, EVENT_WINDOW0); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; m_object->GetTooltipName(name); @@ -214,7 +214,7 @@ bool CAuto::CreateInterface(bool bSelect) pos.y = oy+sy*0; pw->CreateButton(pos, dim, 19, EVENT_OBJECT_HELP); - if ( m_main->RetSceneSoluce() ) + if ( m_main->GetSceneSoluce() ) { pos.x = ox+sx*13.4f; pos.y = oy+sy*1; @@ -263,62 +263,62 @@ bool CAuto::CreateInterface(bool bSelect) // Change the state of a button interface. -void CAuto::CheckInterface(CWindow *pw, EventMsg event, bool bState) +void CAuto::CheckInterface(Ui::CWindow *pw, EventType event, bool bState) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); - if ( control == 0 ) return; + if ( control == nullptr ) return; - control->SetState(STATE_CHECK, bState); + control->SetState(Ui::STATE_CHECK, bState); } // Change the state of a button interface. -void CAuto::EnableInterface(CWindow *pw, EventMsg event, bool bState) +void CAuto::EnableInterface(Ui::CWindow *pw, EventType event, bool bState) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); - if ( control == 0 ) return; + if ( control == nullptr ) return; - control->SetState(STATE_ENABLE, bState); + control->SetState(Ui::STATE_ENABLE, bState); } // Change the state of a button interface. -void CAuto::VisibleInterface(CWindow *pw, EventMsg event, bool bState) +void CAuto::VisibleInterface(Ui::CWindow *pw, EventType event, bool bState) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); - if ( control == 0 ) return; + if ( control == nullptr ) return; - control->SetState(STATE_VISIBLE, bState); + control->SetState(Ui::STATE_VISIBLE, bState); } // Change the state of a button interface. -void CAuto::DeadInterface(CWindow *pw, EventMsg event, bool bState) +void CAuto::DeadInterface(Ui::CWindow *pw, EventType event, bool bState) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); - if ( control == 0 ) return; + if ( control == nullptr ) return; - control->SetState(STATE_DEAD, !bState); + control->SetState(Ui::STATE_DEAD, !bState); } // Change the state of a button interface. void CAuto::UpdateInterface() { - CWindow* pw; + Ui::CWindow* pw; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw == 0 ) return; + pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw == nullptr ) return; VisibleInterface(pw, EVENT_OBJECT_GPROGRESS, m_bBusy); } @@ -328,34 +328,34 @@ void CAuto::UpdateInterface() void CAuto::UpdateInterface(float rTime) { - CWindow* pw; - CGauge* pg; + Ui::CWindow* pw; + Ui::CGauge* pg; if ( m_time < m_lastUpdateTime+0.1f ) return; m_lastUpdateTime = m_time; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw == 0 ) return; + pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw == nullptr ) return; - pg = (CGauge*)pw->SearchControl(EVENT_OBJECT_GSHIELD); - if ( pg != 0 ) + pg = static_cast<Ui::CGauge*>(pw->SearchControl(EVENT_OBJECT_GSHIELD)); + if ( pg != nullptr ) { - pg->SetLevel(m_object->RetShield()); + pg->SetLevel(m_object->GetShield()); } - pg = (CGauge*)pw->SearchControl(EVENT_OBJECT_GPROGRESS); - if ( pg != 0 ) + pg = static_cast<Ui::CGauge*>(pw->SearchControl(EVENT_OBJECT_GPROGRESS)); + if ( pg != nullptr ) { pg->SetLevel(m_progressTime); } } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAuto::RetError() +Error CAuto::GetError() { return ERR_OK; } @@ -363,7 +363,7 @@ Error CAuto::RetError() // Management of the occupation. -bool CAuto::RetBusy() +bool CAuto::GetBusy() { return m_bBusy; } @@ -387,7 +387,7 @@ void CAuto::EventProgress(float rTime) // Engine management. -bool CAuto::RetMotor() +bool CAuto::GetMotor() { return m_bMotor; } @@ -422,11 +422,11 @@ bool CAuto::Write(char *line) return false; } -// Return all settings to the controller. +// Geturn all settings to the controller. bool CAuto::Read(char *line) { - m_type = (ObjectType)OpInt(line, "aType", OBJECT_NULL); + m_type = static_cast<ObjectType>(OpInt(line, "aType", OBJECT_NULL)); m_bBusy = OpInt(line, "aBusy", 0); m_time = OpFloat(line, "aTime", 0.0f); m_progressTime = OpFloat(line, "aProgressTime", 0.0f); diff --git a/src/object/auto/auto.h b/src/object/auto/auto.h index 09efdd9..be7e66b 100644 --- a/src/object/auto/auto.h +++ b/src/object/auto/auto.h @@ -24,22 +24,27 @@ class CInstanceManager; -class CD3DEngine; -class CParticule; -class CLight; -class CTerrain; -class CWater; -class CCloud; -class CPlanet; -class CBlitz; -class CCamera; -class CInterface; class CRobotMain; +class CSoundInterface; + +namespace Ui { class CDisplayText; +class CInterface; class CWindow; -class CSound; +} /* Ui */ +namespace Gfx { +class CEngine; +class CParticle; +class CLightManager; +class CTarrain; +class CWater; +class CCloud; +class CCamera; +class CPlanet; +class CLightning; +} /* Gfx */ class CAuto @@ -61,44 +66,44 @@ public: virtual bool SetString(char *string); virtual bool CreateInterface(bool bSelect); - virtual Error RetError(); + virtual Error GetError(); - virtual bool RetBusy(); + virtual bool GetBusy(); virtual void SetBusy(bool bBuse); virtual void InitProgressTotal(float total); virtual void EventProgress(float rTime); - virtual bool RetMotor(); + virtual bool GetMotor(); virtual void SetMotor(bool bMotor); virtual bool Write(char *line); virtual bool Read(char *line); protected: - void CheckInterface(CWindow *pw, EventMsg event, bool bState); - void EnableInterface(CWindow *pw, EventMsg event, bool bState); - void VisibleInterface(CWindow *pw, EventMsg event, bool bState); - void DeadInterface(CWindow *pw, EventMsg event, bool bState); + void CheckInterface(Ui::CWindow *pw, EventType event, bool bState); + void EnableInterface(Ui::CWindow *pw, EventType event, bool bState); + void VisibleInterface(Ui::CWindow *pw, EventType event, bool bState); + void DeadInterface(Ui::CWindow *pw, EventType event, bool bState); void UpdateInterface(); void UpdateInterface(float rTime); protected: - CInstanceManager* m_iMan; - CEvent* m_event; - CD3DEngine* m_engine; - CParticule* m_particule; - CLight* m_light; - CTerrain* m_terrain; - CWater* m_water; - CCloud * m_cloud; - CPlanet * m_planet; - CBlitz* m_blitz; - CCamera* m_camera; - CInterface* m_interface; - CRobotMain* m_main; - CDisplayText* m_displayText; - CObject* m_object; - CSound* m_sound; + CInstanceManager* m_iMan; + CEventQueue* m_event; + Gfx::CEngine* m_engine; + Gfx::CParticle* m_particle; + Gfx::CLightManager* m_lightMan; + Gfx::CTerrain* m_terrain; + Gfx::CWater* m_water; + Gfx::CCloud * m_cloud; + Gfx::CPlanet * m_planet; + Gfx::CLightning* m_lightning; + Gfx::CCamera* m_camera; + Ui::CInterface* m_interface; + Ui::CDisplayText* m_displayText; + CRobotMain* m_main; + CObject* m_object; + CSoundInterface* m_sound; ObjectType m_type; bool m_bBusy; diff --git a/src/object/auto/autobase.cpp b/src/object/auto/autobase.cpp index 19382b7..d5e8608 100644 --- a/src/object/auto/autobase.cpp +++ b/src/object/auto/autobase.cpp @@ -20,10 +20,10 @@ #include "object/auto/autobase.h" #include "common/iman.h" -#include "old/terrain.h" -#include "old/cloud.h" -#include "old/planet.h" -#include "old/blitz.h" +#include "graphics/engine/terrain.h" +#include "graphics/engine/cloud.h" +#include "graphics/engine/planet.h" +#include "graphics/engine/lightning.h" #include "math/geometry.h" #include "object/robotmain.h" #include "physics/physics.h" @@ -50,8 +50,8 @@ const float BASE_TRANSIT_TIME = 15.0f; // transit duration CAutoBase::CAutoBase(CInstanceManager* iMan, CObject* object) : CAuto(iMan, object) { - m_fogStart = m_engine->RetFogStart(); - m_deepView = m_engine->RetDeepView(); + m_fogStart = m_engine->GetFogStart(); + m_deepView = m_engine->GetDeepView(); Init(); m_phase = ABP_WAIT; m_soundChannel = -1; @@ -85,10 +85,10 @@ void CAutoBase::Init() { m_bOpen = false; m_time = 0.0f; - m_lastParticule = 0.0f; - m_lastMotorParticule = 0.0f; + m_lastParticle = 0.0f; + m_lastMotorParticle = 0.0f; - m_pos = m_object->RetPosition(0); + m_pos = m_object->GetPosition(0); m_lastPos = m_pos; m_phase = ABP_WAIT; @@ -124,10 +124,10 @@ bool CAutoBase::EventProcess(const Event &event) CAuto::EventProcess(event); - if ( m_engine->RetPause() ) return true; + if ( m_engine->GetPause() ) return true; begin: - iPos = m_object->RetPosition(0); + iPos = m_object->GetPosition(0); if ( m_phase == ABP_START ) { @@ -152,17 +152,17 @@ begin: m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f)); } - pObj = m_main->RetSelectObject(); + pObj = m_main->GetSelectObject(); m_main->SelectObject(pObj); m_camera->SetObject(pObj); if ( pObj == 0 ) { - m_camera->SetType(CAMERA_BACK); + m_camera->SetType(Gfx::CAM_TYPE_BACK); } else { - m_camera->SetType(pObj->RetCameraType()); - m_camera->SetDist(pObj->RetCameraDist()); + m_camera->SetType(pObj->GetCameraType()); + m_camera->SetDist(pObj->GetCameraDist()); } m_main->StartMusic(); @@ -193,7 +193,7 @@ begin: m_main->SetMovieLock(true); // blocks everything until the end of the landing m_bMotor = true; // lights the jet engine - m_camera->SetType(CAMERA_SCRIPT); + m_camera->SetType(Gfx::CAM_TYPE_SCRIPT); pos = m_pos; pos.x -= 150.0f; @@ -202,7 +202,7 @@ begin: m_camera->SetScriptEye(pos); m_posSound = pos; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 300.0f+50.0f; m_camera->SetScriptLookat(pos); @@ -223,7 +223,7 @@ begin: if ( m_param == PARAM_PORTICO ) // gate on the porch? { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); m_finalPos = pos; pos.z += BASE_PORTICO_TIME_MOVE*5.0f; // back pos.y += 10.0f; // rises (the gate) @@ -246,7 +246,7 @@ begin: m_speed = 1.0f/BASE_TRANSIT_TIME; m_object->SetAngleZ(0, -Math::PI/2.0f); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 10000.0f; // in space m_finalPos = pos; m_object->SetPosition(0, pos); @@ -254,7 +254,7 @@ begin: m_main->SetMovieLock(true); // blocks everything until the end of the landing m_bMotor = true; // lights the jet engine - m_camera->SetType(CAMERA_SCRIPT); + m_camera->SetType(Gfx::CAM_TYPE_SCRIPT); pos.x += 1000.0f; pos.z -= 60.0f; pos.y += 80.0f; @@ -265,34 +265,34 @@ begin: BeginTransit(); - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 10.0f; dim.y = dim.x; pos = Math::Vector(42.0f, -2.0f, 17.0f); pos = Transform(*mat, pos); - m_partiChannel[0] = m_particule->CreateParticule(pos, speed, dim, PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); + m_partiChannel[0] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); pos = Math::Vector(17.0f, -2.0f, 42.0f); pos = Transform(*mat, pos); - m_partiChannel[1] = m_particule->CreateParticule(pos, speed, dim, PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); + m_partiChannel[1] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); pos = Math::Vector(42.0f, -2.0f, -17.0f); pos = Transform(*mat, pos); - m_partiChannel[2] = m_particule->CreateParticule(pos, speed, dim, PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); + m_partiChannel[2] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); pos = Math::Vector(17.0f, -2.0f, -42.0f); pos = Transform(*mat, pos); - m_partiChannel[3] = m_particule->CreateParticule(pos, speed, dim, PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); + m_partiChannel[3] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); pos = Math::Vector(-42.0f, -2.0f, 17.0f); pos = Transform(*mat, pos); - m_partiChannel[4] = m_particule->CreateParticule(pos, speed, dim, PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); + m_partiChannel[4] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); pos = Math::Vector(-17.0f, -2.0f, 42.0f); pos = Transform(*mat, pos); - m_partiChannel[5] = m_particule->CreateParticule(pos, speed, dim, PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); + m_partiChannel[5] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); pos = Math::Vector(-42.0f, -2.0f, -17.0f); pos = Transform(*mat, pos); - m_partiChannel[6] = m_particule->CreateParticule(pos, speed, dim, PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); + m_partiChannel[6] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); pos = Math::Vector(-17.0f, -2.0f, -42.0f); pos = Transform(*mat, pos); - m_partiChannel[7] = m_particule->CreateParticule(pos, speed, dim, PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); + m_partiChannel[7] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f); if ( m_soundChannel == -1 ) { @@ -303,12 +303,12 @@ begin: } } - if ( event.event == EVENT_UPDINTERFACE ) + if ( event.type == EVENT_UPDINTERFACE ) { - if ( m_object->RetSelect() ) CreateInterface(true); + if ( m_object->GetSelect() ) CreateInterface(true); } - if ( event.event == EVENT_OBJECT_BTAKEOFF ) + if ( event.type == EVENT_OBJECT_BTAKEOFF ) { err = CheckCloseDoor(); if ( err != ERR_OK ) @@ -328,10 +328,10 @@ begin: m_main->SetMovieLock(true); // blocks everything until the end m_main->DeselectAll(); - m_event->MakeEvent(newEvent, EVENT_UPDINTERFACE); + newEvent.type = EVENT_UPDINTERFACE; m_event->AddEvent(newEvent); - m_camera->SetType(CAMERA_SCRIPT); + m_camera->SetType(Gfx::CAM_TYPE_SCRIPT); pos = m_pos; pos.x -= 110.0f; @@ -340,7 +340,7 @@ begin: m_camera->SetScriptEye(pos); m_posSound = pos; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 50.0f; m_camera->SetScriptLookat(pos); @@ -356,7 +356,7 @@ begin: return true; } - if ( event.event != EVENT_FRAME ) return true; + if ( event.type != EVENT_FRAME ) return true; if ( m_phase == ABP_WAIT ) return true; m_progress += event.rTime*m_speed; @@ -386,15 +386,15 @@ begin: pos.y += 10.0f; m_camera->SetScriptEye(pos); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 50.0f; m_camera->SetScriptLookat(pos); m_engine->SetFocus(1.0f+(1.0f-m_progress)); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.10f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.10f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; // Dust thrown to the ground. pos = m_pos; @@ -410,19 +410,19 @@ begin: dim.y = dim.x; if ( dim.x >= 1.0f ) { - m_particule->CreateParticule(pos, speed, dim, PARTICRASH, 2.0f, 0.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f, 0.0f, 2.0f); } // Particles are ejected from the jet engine. - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 6.0f; - h = m_terrain->RetFloorHeight(pos)/300.0f; + h = m_terrain->GetFloorHeight(pos)/300.0f; speed.x = (Math::Rand()-0.5f)*(80.0f-50.0f*h); speed.z = (Math::Rand()-0.5f)*(80.0f-50.0f*h); speed.y = -(Math::Rand()*(h+1.0f)*40.0f+(h+1.0f)*40.0f); dim.x = Math::Rand()*2.0f+2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 2.0f, 10.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 2.0f, 10.0f, 2.0f); // Black smoke from the jet engine. if ( m_progress > 0.8f ) @@ -436,7 +436,7 @@ begin: speed.y = 0.0f; dim.x = Math::Rand()*4.0f+4.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISMOKE3, 4.0f, 0.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE3, 4.0f, 0.0f, 2.0f); } } } @@ -449,7 +449,7 @@ begin: MoveCargo(); // all cargo moves // Impact with the ground. - max = (int)(50.0f*m_engine->RetParticuleDensity()); + max = static_cast<int>(50.0f*m_engine->GetParticleDensity()); for ( i=0 ; i<max ; i++ ) { angle = Math::Rand()*(Math::PI*2.0f); @@ -461,11 +461,11 @@ begin: dim.x = Math::Rand()*10.0f+10.0f; dim.y = dim.x; time = Math::Rand()*2.0f+1.5f; - m_particule->CreateParticule(pos, speed, dim, PARTICRASH, time, 0.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, time, 0.0f, 2.0f); } //? m_camera->StartEffect(CE_CRASH, m_pos, 1.0f); - m_camera->StartEffect(CE_EXPLO, m_pos, 2.0f); + m_camera->StartEffect(Gfx::CAM_EFFECT_EXPLO, m_pos, 2.0f); m_engine->SetFocus(1.0f); m_sound->Play(SOUND_BOUM, m_posSound, 0.6f, 0.5f); @@ -479,9 +479,9 @@ begin: { if ( m_progress < 1.0f ) { - if ( m_lastParticule+m_engine->ParticuleAdapt(0.10f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.10f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; // Black smoke from the reactor. pos = m_pos; @@ -493,7 +493,7 @@ begin: speed.y = 0.0f; dim.x = Math::Rand()*4.0f+4.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISMOKE3, 4.0f, 0.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE3, 4.0f, 0.0f, 2.0f); } } else @@ -542,7 +542,7 @@ begin: } // Clash the doors with the ground. - max = (int)(20.0f*m_engine->RetParticuleDensity()); + max = static_cast<int>(20.0f*m_engine->GetParticleDensity()); for ( i=0 ; i<max ; i++ ) { angle = Math::Rand()*(20.0f*Math::PI/180.0f)-(10.0f*Math::PI/180.0f); @@ -555,7 +555,7 @@ begin: dim.x = Math::Rand()*8.0f+8.0f; dim.y = dim.x; time = Math::Rand()*2.0f+1.5f; - m_particule->CreateParticule(pos, speed, dim, PARTICRASH, time, 0.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, time, 0.0f, 2.0f); } m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.3f, 1.5f, true); @@ -622,19 +622,19 @@ begin: { m_main->SetMovieLock(false); // you can play! - pObj = m_main->RetSelectObject(); + pObj = m_main->GetSelectObject(); m_main->SelectObject(pObj); m_camera->SetObject(pObj); if ( pObj == 0 ) { - m_camera->SetType(CAMERA_BACK); + m_camera->SetType(Gfx::CAM_TYPE_BACK); } else { - m_camera->SetType(pObj->RetCameraType()); - m_camera->SetDist(pObj->RetCameraDist()); + m_camera->SetType(pObj->GetCameraType()); + m_camera->SetDist(pObj->GetCameraDist()); } - m_sound->Play(SOUND_BOUM, m_object->RetPosition(0)); + m_sound->Play(SOUND_BOUM, m_object->GetPosition(0)); m_soundChannel = -1; m_engine->SetFogStart(m_fogStart); @@ -700,7 +700,7 @@ begin: m_bMotor = true; // lights the jet engine // Shock of the closing doors. - max = (int)(20.0f*m_engine->RetParticuleDensity()); + max = static_cast<int>(20.0f*m_engine->GetParticleDensity()); for ( i=0 ; i<max ; i++ ) { angle = Math::Rand()*Math::PI*2.0f; @@ -713,9 +713,9 @@ begin: dim.x = Math::Rand()*3.0f+3.0f; dim.y = dim.x; time = Math::Rand()*1.0f+1.0f; - m_particule->CreateParticule(pos, speed, dim, PARTICRASH, time); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, time); } - m_sound->Play(SOUND_BOUM, m_object->RetPosition(0)); + m_sound->Play(SOUND_BOUM, m_object->GetPosition(0)); m_soundChannel = -1; m_bOpen = false; @@ -742,19 +742,19 @@ begin: vibCir *= m_progress*1.0f; m_object->SetCirVibration(vibCir); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; // Particles are ejected from the reactor. - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 6.0f; speed.x = (Math::Rand()-0.5f)*160.0f; speed.z = (Math::Rand()-0.5f)*160.0f; speed.y = -(Math::Rand()*10.0f+10.0f); dim.x = Math::Rand()*2.0f+2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 2.0f, 10.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 2.0f, 10.0f, 2.0f); } m_engine->SetFogStart(m_fogStart+(0.9f-m_fogStart)*m_progress); @@ -789,15 +789,15 @@ begin: pos.y += 10.0f; m_camera->SetScriptEye(pos); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 50.0f; m_camera->SetScriptLookat(pos); m_engine->SetFocus(1.0f+m_progress); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.10f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.10f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; // Dust thrown to the ground. pos = m_pos; @@ -813,11 +813,11 @@ begin: dim.y = dim.x; if ( dim.x >= 1.0f ) { - m_particule->CreateParticule(pos, speed, dim, PARTICRASH, 2.0f, 0.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f, 0.0f, 2.0f); } // Particles are ejected from the reactor. - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 6.0f; speed.x = (Math::Rand()-0.5f)*40.0f; speed.z = (Math::Rand()-0.5f)*40.0f; @@ -826,23 +826,23 @@ begin: time = 2.0f+m_progress*12.0f; dim.x = Math::Rand()*time+time; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 2.0f, 10.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 2.0f, 10.0f, 2.0f); // Black smoke from the reactor. - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 3.0f; speed.x = (Math::Rand()-0.5f)*10.0f*(4.0f-m_progress*3.0f); speed.z = (Math::Rand()-0.5f)*10.0f*(4.0f-m_progress*3.0f); speed.y = 0.0f; dim.x = Math::Rand()*20.0f+20.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISMOKE3, 10.0f, 0.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE3, 10.0f, 0.0f, 2.0f); } } else { m_soundChannel = -1; - m_event->MakeEvent(newEvent, EVENT_WIN); + newEvent.type = EVENT_WIN; m_event->AddEvent(newEvent); m_phase = ABP_WAIT; @@ -855,7 +855,7 @@ begin: { if ( m_progress < 1.0f ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.z -= event.rTime*5.0f; m_object->SetPosition(0, pos); MoveCargo(); // all cargo moves @@ -882,7 +882,7 @@ begin: { if ( m_progress < 1.0f ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y -= event.rTime*(10.0f/BASE_PORTICO_TIME_DOWN); m_object->SetPosition(0, pos); MoveCargo(); // all cargo moves @@ -890,7 +890,7 @@ begin: else { // Impact with the ground. - max = (int)(50.0f*m_engine->RetParticuleDensity()); + max = static_cast<int>(50.0f*m_engine->GetParticleDensity()); for ( i=0 ; i<max ; i++ ) { angle = Math::Rand()*(Math::PI*2.0f); @@ -902,7 +902,7 @@ begin: dim.x = Math::Rand()*10.0f+10.0f; dim.y = dim.x; time = Math::Rand()*2.0f+1.5f; - m_particule->CreateParticule(pos, speed, dim, PARTICRASH, time, 0.0f, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, time, 0.0f, 2.0f); } m_phase = ABP_PORTICO_WAIT2; @@ -938,7 +938,7 @@ begin: { if ( m_progress < 1.0f ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += event.rTime*(2000.0f/BASE_TRANSIT_TIME); m_object->SetPosition(0, pos); pos.x += 60.0f; @@ -967,11 +967,11 @@ begin: if ( m_bMotor ) { - if ( m_lastMotorParticule+m_engine->ParticuleAdapt(0.02f) <= m_time ) + if ( m_lastMotorParticle+m_engine->ParticleAdapt(0.02f) <= m_time ) { - m_lastMotorParticule = m_time; + m_lastMotorParticle = m_time; - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); if ( event.rTime == 0.0f ) { @@ -979,7 +979,7 @@ begin: } else { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); if ( m_phase == ABP_TRANSIT_MOVE ) { vSpeed = (pos.x-iPos.x)/event.rTime; @@ -1003,7 +1003,7 @@ begin: dim.x = 4.0f+Math::Rand()*4.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBASE, 3.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBASE, 3.0f, 0.0f, 0.0f); if ( m_phase == ABP_TRANSIT_MOVE ) { @@ -1013,7 +1013,7 @@ begin: pos = Math::Vector(0.0f, 7.0f, 0.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 1.0f, 0.0f, 0.0f); speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 4.0f; @@ -1021,67 +1021,67 @@ begin: pos = Math::Vector(42.0f, 0.0f, 17.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f); pos = Math::Vector(17.0f, 0.0f, 42.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f); pos = Math::Vector(42.0f, 0.0f, -17.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f); pos = Math::Vector(17.0f, 0.0f, -42.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f); pos = Math::Vector(-42.0f, 0.0f, 17.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f); pos = Math::Vector(-17.0f, 0.0f, 42.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f); pos = Math::Vector(-42.0f, 0.0f, -17.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f); pos = Math::Vector(-17.0f, 0.0f, -42.0f); pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; pos = Transform(*mat, pos); - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f); pos = Math::Vector(42.0f, -2.0f, 17.0f); pos = Transform(*mat, pos); - m_particule->SetPosition(m_partiChannel[0], pos); + m_particle->SetPosition(m_partiChannel[0], pos); pos = Math::Vector(17.0f, -2.0f, 42.0f); pos = Transform(*mat, pos); - m_particule->SetPosition(m_partiChannel[1], pos); + m_particle->SetPosition(m_partiChannel[1], pos); pos = Math::Vector(42.0f, -2.0f, -17.0f); pos = Transform(*mat, pos); - m_particule->SetPosition(m_partiChannel[2], pos); + m_particle->SetPosition(m_partiChannel[2], pos); pos = Math::Vector(17.0f, -2.0f, -42.0f); pos = Transform(*mat, pos); - m_particule->SetPosition(m_partiChannel[3], pos); + m_particle->SetPosition(m_partiChannel[3], pos); pos = Math::Vector(-42.0f, -2.0f, 17.0f); pos = Transform(*mat, pos); - m_particule->SetPosition(m_partiChannel[4], pos); + m_particle->SetPosition(m_partiChannel[4], pos); pos = Math::Vector(-17.0f, -2.0f, 42.0f); pos = Transform(*mat, pos); - m_particule->SetPosition(m_partiChannel[5], pos); + m_particle->SetPosition(m_partiChannel[5], pos); pos = Math::Vector(-42.0f, -2.0f, -17.0f); pos = Transform(*mat, pos); - m_particule->SetPosition(m_partiChannel[6], pos); + m_particle->SetPosition(m_partiChannel[6], pos); pos = Math::Vector(-17.0f, -2.0f, -42.0f); pos = Transform(*mat, pos); - m_particule->SetPosition(m_partiChannel[7], pos); + m_particle->SetPosition(m_partiChannel[7], pos); } } } if ( m_soundChannel != -1 ) { - pos = m_engine->RetEyePt(); + pos = m_engine->GetEyePt(); m_sound->Position(m_soundChannel, pos); } @@ -1154,17 +1154,17 @@ bool CAutoBase::Abort() m_main->SetMovieLock(false); // you can play! - pObj = m_main->RetSelectObject(); + pObj = m_main->GetSelectObject(); m_main->SelectObject(pObj); m_camera->SetObject(pObj); if ( pObj == 0 ) { - m_camera->SetType(CAMERA_BACK); + m_camera->SetType(Gfx::CAM_TYPE_BACK); } else { - m_camera->SetType(pObj->RetCameraType()); - m_camera->SetDist(pObj->RetCameraDist()); + m_camera->SetType(pObj->GetCameraType()); + m_camera->SetDist(pObj->GetCameraDist()); } m_engine->SetFogStart(m_fogStart); @@ -1175,7 +1175,7 @@ bool CAutoBase::Abort() m_phase == ABP_TOWAIT || m_phase == ABP_TAKEOFF ) // off? { - m_event->MakeEvent(newEvent, EVENT_WIN); + newEvent.type = EVENT_WIN; m_event->AddEvent(newEvent); } } @@ -1198,9 +1198,9 @@ bool CAutoBase::Abort() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoBase::RetError() +Error CAutoBase::GetError() { return ERR_OK; } @@ -1210,7 +1210,7 @@ Error CAutoBase::RetError() bool CAutoBase::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, dim, ddim; float ox, oy, sx, sy; float sleep, delay, magnetic, progress; @@ -1219,8 +1219,8 @@ bool CAutoBase::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw == 0 ) return false; + pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw == nullptr ) return false; dim.x = 33.0f/640.0f; dim.y = 33.0f/480.0f; @@ -1240,7 +1240,7 @@ bool CAutoBase::CreateInterface(bool bSelect) pos.y = oy+sy*0.25f; pw->CreateButton(pos, ddim, 28, EVENT_OBJECT_BTAKEOFF); - if ( m_blitz->GetStatus(sleep, delay, magnetic, progress) ) + if ( m_lightning->GetStatus(sleep, delay, magnetic, progress) ) { pos.x = ox+sx*10.2f; pos.y = oy+sy*0.5f; @@ -1264,13 +1264,13 @@ bool CAutoBase::CreateInterface(bool bSelect) void CAutoBase::UpdateInterface() { - CWindow* pw; +// Ui::CWindow* pw; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; CAuto::UpdateInterface(); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); +// pw = static_cast< Ui::CWindow* >( m_interface->SearchControl(EVENT_WINDOW0)); } @@ -1286,15 +1286,15 @@ void CAutoBase::FreezeCargo(bool bFreeze) for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast<CObject*>(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; pObj->SetCargo(false); if ( pObj == m_object ) continue; // yourself? - if ( pObj->RetTruck() != 0 ) continue; // transport object? + if ( pObj->GetTruck() != 0 ) continue; // transport object? - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::DistanceProjected(m_pos, oPos); if ( dist < 32.0f ) { @@ -1303,7 +1303,7 @@ void CAutoBase::FreezeCargo(bool bFreeze) pObj->SetCargo(true); } - physics = pObj->RetPhysics(); + physics = pObj->GetPhysics(); if ( physics != 0 ) { physics->SetFreeze(bFreeze); @@ -1320,18 +1320,18 @@ void CAutoBase::MoveCargo() Math::Vector oPos, sPos; int i; - sPos = m_object->RetPosition(0); + sPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast < CObject* > (m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - if ( !pObj->RetCargo() ) continue; + if ( !pObj->GetCargo() ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); oPos.y = sPos.y+30.0f; - oPos.y += pObj->RetCharacter()->height; + oPos.y += pObj->GetCharacter()->height; oPos.x += sPos.x-m_lastPos.x; oPos.z += sPos.z-m_lastPos.z; pObj->SetPosition(0, oPos); @@ -1353,13 +1353,13 @@ Error CAutoBase::CheckCloseDoor() for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* > (m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; if ( pObj == m_object ) continue; // yourself? - if ( !pObj->RetActif() ) continue; // inactive? + if ( !pObj->GetActif() ) continue; // inactive? - type = pObj->RetType(); + type = pObj->GetType(); if ( type == OBJECT_PORTICO ) continue; j = 0; @@ -1391,18 +1391,18 @@ void CAutoBase::BeginTransit() if ( m_param == PARAM_TRANSIT2 ) { - strcpy(m_bgBack, "back01.tga"); // clouds orange / blue + m_bgBack = "back01.tga"; // clouds orange / blue } else if ( m_param == PARAM_TRANSIT3 ) { - strcpy(m_bgBack, "back22.tga"); // blueberries clouds + m_bgBack = "back22.tga"; // blueberries clouds } else { #if _DEMO - strcpy(m_bgBack, "back46b.tga"); // paintings + m_bgBack = "back46b.tga"; // paintings #else - strcpy(m_bgBack, "back46.tga"); // paintings + m_bgBack = "back46.tga"; // paintings #endif } @@ -1410,8 +1410,8 @@ void CAutoBase::BeginTransit() m_engine->SetDeepView(2000.0f); // we see very far m_engine->ApplyChange(); - m_engine->RetBackground(m_bgName, m_bgUp, m_bgDown, m_bgCloudUp, m_bgCloudDown, bFull, bQuarter); - m_engine->FreeTexture(m_bgName); + m_engine->GetBackground(m_bgName, m_bgUp, m_bgDown, m_bgCloudUp, m_bgCloudDown, bFull, bQuarter); + m_engine->DeleteTexture(m_bgName); m_engine->SetBackground(m_bgBack, 0x00000000, 0x00000000, 0x00000000, 0x00000000); m_engine->LoadTexture(m_bgBack); @@ -1428,7 +1428,7 @@ void CAutoBase::EndTransit() m_engine->SetDeepView(m_deepView); // gives initial depth m_engine->ApplyChange(); - m_engine->FreeTexture(m_bgBack); + m_engine->DeleteTexture(m_bgBack); m_engine->SetBackground(m_bgName, m_bgUp, m_bgDown, m_bgCloudUp, m_bgCloudDown); m_engine->LoadTexture(m_bgName); diff --git a/src/object/auto/autobase.h b/src/object/auto/autobase.h index eb47a93..439d414 100644 --- a/src/object/auto/autobase.h +++ b/src/object/auto/autobase.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -73,7 +74,7 @@ public: void Start(int param); bool EventProcess(const Event &event); bool Abort(); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -90,23 +91,23 @@ protected: bool m_bOpen; float m_progress; float m_speed; - float m_lastParticule; - float m_lastMotorParticule; + float m_lastParticle; + float m_lastMotorParticle; float m_fogStart; float m_deepView; - Math::Vector m_pos; - Math::Vector m_posSound; - Math::Vector m_finalPos; - Math::Vector m_lastPos; + Math::Vector m_pos; + Math::Vector m_posSound; + Math::Vector m_finalPos; + Math::Vector m_lastPos; int m_param; int m_soundChannel; int m_partiChannel[8]; - char m_bgBack[100]; - char m_bgName[100]; - D3DCOLOR m_bgUp; - D3DCOLOR m_bgDown; - D3DCOLOR m_bgCloudUp; - D3DCOLOR m_bgCloudDown; + std::string m_bgBack; + std::string m_bgName; + Gfx::Color m_bgUp; + Gfx::Color m_bgDown; + Gfx::Color m_bgCloudUp; + Gfx::Color m_bgCloudDown; }; diff --git a/src/object/auto/autoconvert.cpp b/src/object/auto/autoconvert.cpp index b5ad43a..14fa4cf 100644 --- a/src/object/auto/autoconvert.cpp +++ b/src/object/auto/autoconvert.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -83,7 +84,7 @@ void CAutoConvert::Init() m_speed = 1.0f/2.0f; m_time = 0.0f; m_timeVirus = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; CAuto::Init(); } @@ -100,13 +101,13 @@ bool CAutoConvert::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -146,7 +147,7 @@ bool CAutoConvert::EventProcess(const Event &event) InitProgressTotal(3.0f+10.0f+1.5f); UpdateInterface(); - m_sound->Play(SOUND_OPEN, m_object->RetPosition(0), 1.0f, 1.0f); + m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.0f); m_bSoundClose = false; m_phase = ACP_CLOSE; @@ -163,7 +164,7 @@ bool CAutoConvert::EventProcess(const Event &event) if ( m_progress >= 0.8f && !m_bSoundClose ) { m_bSoundClose = true; - m_sound->Play(SOUND_CLOSE, m_object->RetPosition(0), 1.0f, 0.8f); + m_sound->Play(SOUND_CLOSE, m_object->GetPosition(0), 1.0f, 0.8f); } angle = -Math::PI*0.35f*(1.0f-Math::Bounce(m_progress, 0.85f, 0.05f)); m_object->SetAngleX(2, angle); @@ -174,7 +175,7 @@ bool CAutoConvert::EventProcess(const Event &event) m_object->SetAngleX(2, 0.0f); m_object->SetAngleX(3, 0.0f); - m_soundChannel = m_sound->Play(SOUND_CONVERT, m_object->RetPosition(0), 0.0f, 0.25f, true); + m_soundChannel = m_sound->Play(SOUND_CONVERT, m_object->GetPosition(0), 0.0f, 0.25f, true); m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.25f, 0.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.00f, 4.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.25f, 4.5f, SOPER_CONTINUE); @@ -202,11 +203,11 @@ bool CAutoConvert::EventProcess(const Event &event) m_object->SetAngleY(2, angle); m_object->SetAngleY(3, angle+Math::PI); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); c.x = pos.x; c.y = pos.z; p.x = c.x; @@ -218,7 +219,7 @@ bool CAutoConvert::EventProcess(const Event &event) speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = Math::Rand()*2.0f+1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGAS, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 1.0f, 0.0f, 0.0f); } } else @@ -230,13 +231,13 @@ bool CAutoConvert::EventProcess(const Event &event) fret = SearchStone(OBJECT_STONE); if ( fret != 0 ) { - m_bResetDelete = ( fret->RetResetCap() != RESET_NONE ); + m_bResetDelete = ( fret->GetResetCap() != RESET_NONE ); fret->DeleteObject(); // destroy the stone delete fret; } CreateMetal(); // Create the metal - m_sound->Play(SOUND_OPEN, m_object->RetPosition(0), 1.0f, 1.5f); + m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.5f); m_phase = ACP_OPEN; m_progress = 0.0f; @@ -253,18 +254,18 @@ bool CAutoConvert::EventProcess(const Event &event) m_object->SetAngleX(3, angle); if ( m_progress < 0.9f && - m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += (Math::Rand()-0.5f)*6.0f; pos.z += (Math::Rand()-0.5f)*6.0f; pos.y += Math::Rand()*4.0f; speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = Math::Rand()*4.0f+3.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBLUE, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLUE, 1.0f, 0.0f, 0.0f); } } else @@ -285,11 +286,11 @@ bool CAutoConvert::EventProcess(const Event &event) return true; } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoConvert::RetError() +Error CAutoConvert::GetError() { - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } @@ -330,7 +331,7 @@ bool CAutoConvert::Abort() bool CAutoConvert::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -338,8 +339,8 @@ bool CAutoConvert::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw == 0 ) return false; + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw == nullptr ) return false; ox = 3.0f/640.0f; oy = 3.0f/480.0f; @@ -390,11 +391,11 @@ bool CAutoConvert::Read(char *line) CAuto::Read(line); - m_phase = (AutoConvertPhase)OpInt(line, "aPhase", ACP_WAIT); + m_phase = static_cast< AutoConvertPhase >(OpInt(line, "aPhase", ACP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } @@ -410,18 +411,18 @@ CObject* CAutoConvert::SearchStone(ObjectType type) float dist; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - oType = pObj->RetType(); + oType = pObj->GetType(); if ( oType != type ) continue; - if ( pObj->RetTruck() != 0 ) continue; + if ( pObj->GetTruck() != 0 ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, cPos); if ( dist <= 5.0f ) return pObj; @@ -440,14 +441,14 @@ bool CAutoConvert::SearchVehicle() float oRadius, dist; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_HUMAN && type != OBJECT_MOBILEfa && type != OBJECT_MOBILEta && @@ -506,8 +507,8 @@ void CAutoConvert::CreateMetal() float angle; CObject* fret; - pos = m_object->RetPosition(0); - angle = m_object->RetAngleY(0); + pos = m_object->GetPosition(0); + angle = m_object->GetAngleY(0); fret = new CObject(m_iMan); if ( !fret->CreateResource(pos, angle, OBJECT_METAL) ) diff --git a/src/object/auto/autoconvert.h b/src/object/auto/autoconvert.h index c2042cf..b21690f 100644 --- a/src/object/auto/autoconvert.h +++ b/src/object/auto/autoconvert.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool Abort(); bool CreateInterface(bool bSelect); @@ -62,7 +63,7 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; bool m_bResetDelete; bool m_bSoundClose; int m_soundChannel; diff --git a/src/object/auto/autoderrick.cpp b/src/object/auto/autoderrick.cpp index 3f1cda5..a560bc8 100644 --- a/src/object/auto/autoderrick.cpp +++ b/src/object/auto/autoderrick.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ #include "object/auto/autoderrick.h" #include "common/iman.h" -#include "old/terrain.h" +#include "graphics/engine/terrain.h" #include "math/geometry.h" #include "script/cmdtoken.h" #include "ui/interface.h" @@ -62,7 +63,7 @@ void CAutoDerrick::DeleteObject(bool bAll) if ( !bAll ) { fret = SearchFret(); - if ( fret != 0 && fret->RetLock() ) + if ( fret != 0 && fret->GetLock() ) { fret->DeleteObject(); delete fret; @@ -86,25 +87,25 @@ void CAutoDerrick::Init() { Math::Matrix* mat; Math::Vector pos; - TerrainRes res; + Gfx::TerrainRes res; - pos = m_object->RetPosition(0); - res = m_terrain->RetResource(pos); + pos = m_object->GetPosition(0); + res = m_terrain->GetResource(pos); - if ( res == TR_STONE || - res == TR_URANIUM || - res == TR_KEYa || - res == TR_KEYb || - res == TR_KEYc || - res == TR_KEYd ) + if ( res == Gfx::TR_STONE || + res == Gfx::TR_URANIUM || + res == Gfx::TR_KEY_A || + res == Gfx::TR_KEY_B || + res == Gfx::TR_KEY_C || + res == Gfx::TR_KEY_D ) { m_type = OBJECT_FRET; - if ( res == TR_STONE ) m_type = OBJECT_STONE; - if ( res == TR_URANIUM ) m_type = OBJECT_URANIUM; - if ( res == TR_KEYa ) m_type = OBJECT_KEYa; - if ( res == TR_KEYb ) m_type = OBJECT_KEYb; - if ( res == TR_KEYc ) m_type = OBJECT_KEYc; - if ( res == TR_KEYd ) m_type = OBJECT_KEYd; + if ( res == Gfx::TR_STONE ) m_type = OBJECT_STONE; + if ( res == Gfx::TR_URANIUM ) m_type = OBJECT_URANIUM; + if ( res == Gfx::TR_KEY_A ) m_type = OBJECT_KEYa; + if ( res == Gfx::TR_KEY_B ) m_type = OBJECT_KEYb; + if ( res == Gfx::TR_KEY_C ) m_type = OBJECT_KEYc; + if ( res == Gfx::TR_KEY_D ) m_type = OBJECT_KEYd; m_phase = ADP_EXCAVATE; m_progress = 0.0f; @@ -119,11 +120,11 @@ void CAutoDerrick::Init() m_time = 0.0f; m_timeVirus = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_lastTrack = 0.0f; pos = Math::Vector(7.0f, 0.0f, 0.0f); - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); pos = Math::Transform(*mat, pos); m_terrain->MoveOnFloor(pos); m_fretPos = pos; @@ -141,14 +142,14 @@ bool CAutoDerrick::EventProcess(const Event &event) CAuto::EventProcess(event); - 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_phase == ADP_WAIT ) return true; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -176,7 +177,7 @@ bool CAutoDerrick::EventProcess(const Event &event) { factor = 1.0f; } - m_soundChannel = m_sound->Play(SOUND_DERRICK, m_object->RetPosition(0), 1.0f, 0.5f, true); + m_soundChannel = m_sound->Play(SOUND_DERRICK, m_object->GetPosition(0), 1.0f, 0.5f, true); m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.5f, 4.0f*factor, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.3f, 6.0f*factor, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.5f, 1.0f, SOPER_CONTINUE); @@ -184,25 +185,25 @@ bool CAutoDerrick::EventProcess(const Event &event) } if ( m_progress >= 6.0f/16.0f && // penetrates into the ground? - m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); speed.x = (Math::Rand()-0.5f)*10.0f; speed.z = (Math::Rand()-0.5f)*10.0f; speed.y = Math::Rand()*5.0f; dim.x = Math::Rand()*3.0f+2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTICRASH, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f); } if ( m_progress >= 6.0f/16.0f && // penetrates into the ground? - m_lastTrack+m_engine->ParticuleAdapt(0.5f) <= m_time ) + m_lastTrack+m_engine->ParticleAdapt(0.5f) <= m_time ) { m_lastTrack = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); speed.x = (Math::Rand()-0.5f)*12.0f; speed.z = (Math::Rand()-0.5f)*12.0f; speed.y = Math::Rand()*10.0f+10.0f; @@ -210,7 +211,7 @@ bool CAutoDerrick::EventProcess(const Event &event) dim.y = dim.x; pos.y += dim.y; duration = Math::Rand()*2.0f+2.0f; - m_particule->CreateTrack(pos, speed, dim, PARTITRACK5, + m_particle->CreateTrack(pos, speed, dim, Gfx::PARTITRACK5, duration, Math::Rand()*10.0f+15.0f, duration*0.2f, 1.0f); } @@ -222,7 +223,7 @@ bool CAutoDerrick::EventProcess(const Event &event) pos.y = -m_progress*16.0f; m_object->SetPosition(1, pos); // down the drill - angle = m_object->RetAngleY(1); + angle = m_object->GetAngleY(1); angle += event.rTime*8.0f; m_object->SetAngleY(1, angle); // rotates the drill } @@ -237,25 +238,25 @@ bool CAutoDerrick::EventProcess(const Event &event) if ( m_phase == ADP_ASCEND ) { if ( m_progress <= 7.0f/16.0f && - m_lastParticule+m_engine->ParticuleAdapt(0.1f) <= m_time ) + m_lastParticle+m_engine->ParticleAdapt(0.1f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); speed.x = (Math::Rand()-0.5f)*10.0f; speed.z = (Math::Rand()-0.5f)*10.0f; speed.y = Math::Rand()*5.0f; dim.x = Math::Rand()*3.0f+2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTICRASH, 2.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f); } if ( m_progress <= 4.0f/16.0f && - m_lastTrack+m_engine->ParticuleAdapt(1.0f) <= m_time ) + m_lastTrack+m_engine->ParticleAdapt(1.0f) <= m_time ) { m_lastTrack = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); speed.x = (Math::Rand()-0.5f)*12.0f; speed.z = (Math::Rand()-0.5f)*12.0f; speed.y = Math::Rand()*10.0f+10.0f; @@ -263,7 +264,7 @@ bool CAutoDerrick::EventProcess(const Event &event) dim.y = dim.x; pos.y += dim.y; duration = Math::Rand()*2.0f+2.0f; - m_particule->CreateTrack(pos, speed, dim, PARTITRACK5, + m_particle->CreateTrack(pos, speed, dim, Gfx::PARTITRACK5, duration, Math::Rand()*10.0f+15.0f, duration*0.2f, 1.0f); } @@ -275,7 +276,7 @@ bool CAutoDerrick::EventProcess(const Event &event) pos.y = -(1.0f-m_progress)*16.0f; m_object->SetPosition(1, pos); // back the drill - angle = m_object->RetAngleY(1); + angle = m_object->GetAngleY(1); angle -= event.rTime*2.0f; m_object->SetAngleY(1, angle); // rotates the drill } @@ -308,7 +309,7 @@ bool CAutoDerrick::EventProcess(const Event &event) { if ( SearchFree(m_fretPos) ) { - angle = m_object->RetAngleY(0); + angle = m_object->GetAngleY(0); CreateFret(m_fretPos, angle, m_type, 16.0f); } else @@ -324,31 +325,31 @@ bool CAutoDerrick::EventProcess(const Event &event) if ( fret != 0 && m_progress <= 0.5f && - m_lastParticule+m_engine->ParticuleAdapt(0.1f) <= m_time ) + m_lastParticle+m_engine->ParticleAdapt(0.1f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; if ( m_progress < 0.3f ) { - pos = fret->RetPosition(0); + pos = fret->GetPosition(0); pos.x += (Math::Rand()-0.5f)*5.0f; pos.z += (Math::Rand()-0.5f)*5.0f; pos.y += (Math::Rand()-0.5f)*5.0f; speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 3.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIFIRE, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFIRE, 1.0f, 0.0f, 0.0f); } else { - pos = fret->RetPosition(0); + pos = fret->GetPosition(0); pos.x += (Math::Rand()-0.5f)*5.0f; pos.z += (Math::Rand()-0.5f)*5.0f; pos.y += Math::Rand()*2.5f; speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGLINT, 2.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 2.0f, 0.0f, 0.0f); } } @@ -356,7 +357,7 @@ bool CAutoDerrick::EventProcess(const Event &event) { if ( fret != 0 ) { - pos = fret->RetPosition(0); + pos = fret->GetPosition(0); pos.y -= event.rTime*20.0f; // grave if ( !m_bSoundFall && pos.y < m_fretPos.y ) { @@ -396,7 +397,7 @@ bool CAutoDerrick::EventProcess(const Event &event) bool CAutoDerrick::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -404,7 +405,7 @@ bool CAutoDerrick::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -455,11 +456,11 @@ bool CAutoDerrick::Read(char *line) CAuto::Read(line); - m_phase = (AutoDerrickPhase)OpInt(line, "aPhase", ADP_WAIT); + m_phase = static_cast< AutoDerrickPhase >(OpInt(line, "aPhase", ADP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } @@ -476,13 +477,13 @@ CObject* CAutoDerrick::SearchFret() for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type == OBJECT_DERRICK ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); if ( oPos.x == m_fretPos.x && oPos.z == m_fretPos.z ) return pObj; @@ -503,10 +504,10 @@ bool CAutoDerrick::SearchFree(Math::Vector pos) for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type == OBJECT_DERRICK ) continue; j = 0; @@ -537,12 +538,12 @@ void CAutoDerrick::CreateFret(Math::Vector pos, float angle, ObjectType type, } fret->SetLock(true); // object not yet usable - if ( m_object->RetResetCap() == RESET_MOVE ) + if ( m_object->GetResetCap() == RESET_MOVE ) { fret->SetResetCap(RESET_DELETE); } - pos = fret->RetPosition(0); + pos = fret->GetPosition(0); pos.y += height; fret->SetPosition(0, pos); } @@ -562,10 +563,10 @@ bool CAutoDerrick::ExistKey() for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type == m_type ) return true; } @@ -573,11 +574,11 @@ bool CAutoDerrick::ExistKey() } -// Returns an error due the state of the automaton. +// returns an error due the state of the automaton. -Error CAutoDerrick::RetError() +Error CAutoDerrick::GetError() { - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } diff --git a/src/object/auto/autoderrick.h b/src/object/auto/autoderrick.h index 61a1ff1..b52f93b 100644 --- a/src/object/auto/autoderrick.h +++ b/src/object/auto/autoderrick.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -62,7 +63,7 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; float m_lastTrack; Math::Vector m_fretPos; int m_soundChannel; diff --git a/src/object/auto/autodestroyer.cpp b/src/object/auto/autodestroyer.cpp index b40c374..d91af29 100644 --- a/src/object/auto/autodestroyer.cpp +++ b/src/object/auto/autodestroyer.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -61,7 +62,7 @@ void CAutoDestroyer::Init() m_time = 0.0f; m_timeVirus = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; CAuto::Init(); } @@ -72,19 +73,19 @@ void CAutoDestroyer::Init() bool CAutoDestroyer::EventProcess(const Event &event) { CObject* scrap; - CPyro* pyro; + Gfx::CPyro* pyro; Math::Vector pos, speed; Math::Point dim; CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -117,7 +118,7 @@ bool CAutoDestroyer::EventProcess(const Event &event) } else { - m_sound->Play(SOUND_PSHHH2, m_object->RetPosition(0), 1.0f, 1.0f); + m_sound->Play(SOUND_PSHHH2, m_object->GetPosition(0), 1.0f, 1.0f); m_phase = ADEP_DOWN; m_progress = 0.0f; @@ -133,10 +134,10 @@ bool CAutoDestroyer::EventProcess(const Event &event) if ( m_progress >= 0.3f-0.05f && !m_bExplo ) { scrap = SearchPlastic(); - if ( scrap != 0 ) + if ( scrap != nullptr ) { - pyro = new CPyro(m_iMan); - pyro->Create(PT_FRAGT, scrap); + pyro = new Gfx::CPyro(m_iMan); + pyro->Create(Gfx::PT_FRAGT, scrap); } m_bExplo = true; } @@ -150,7 +151,7 @@ bool CAutoDestroyer::EventProcess(const Event &event) else { m_object->SetPosition(1, Math::Vector(0.0f, -10.0f, 0.0f)); - m_sound->Play(SOUND_REPAIR, m_object->RetPosition(0)); + m_sound->Play(SOUND_REPAIR, m_object->GetPosition(0)); m_phase = ADEP_REPAIR; m_progress = 0.0f; @@ -165,7 +166,7 @@ bool CAutoDestroyer::EventProcess(const Event &event) } else { - m_sound->Play(SOUND_OPEN, m_object->RetPosition(0), 1.0f, 0.8f); + m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 0.8f); m_phase = ADEP_UP; m_progress = 0.0f; @@ -199,7 +200,7 @@ bool CAutoDestroyer::EventProcess(const Event &event) bool CAutoDestroyer::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -207,8 +208,8 @@ bool CAutoDestroyer::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw == 0 ) return false; + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw == nullptr ) return false; ox = 3.0f/640.0f; oy = 3.0f/480.0f; @@ -235,23 +236,23 @@ CObject* CAutoDestroyer::SearchPlastic() float dist; int i; - sPos = m_object->RetPosition(0); + sPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); - if ( pObj == 0 ) break; + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); + if ( pObj == nullptr ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_SCRAP4 && type != OBJECT_SCRAP5 ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, sPos); if ( dist <= 5.0f ) return pObj; } - return 0; + return nullptr; } // Seeks if one vehicle is too close. @@ -264,14 +265,14 @@ bool CAutoDestroyer::SearchVehicle() float oRadius, dist; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); - if ( pObj == 0 ) break; + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); + if ( pObj == nullptr ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_HUMAN && type != OBJECT_MOBILEfa && type != OBJECT_MOBILEta && @@ -316,11 +317,11 @@ bool CAutoDestroyer::SearchVehicle() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoDestroyer::RetError() +Error CAutoDestroyer::GetError() { - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } @@ -362,11 +363,11 @@ bool CAutoDestroyer::Read(char *line) CAuto::Read(line); - m_phase = (AutoDestroyerPhase)OpInt(line, "aPhase", ADEP_WAIT); + m_phase = static_cast< AutoDestroyerPhase >(OpInt(line, "aPhase", ADEP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autodestroyer.h b/src/object/auto/autodestroyer.h index 88c93ea..50858d3 100644 --- a/src/object/auto/autodestroyer.h +++ b/src/object/auto/autodestroyer.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -43,7 +44,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -59,7 +60,7 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; bool m_bExplo; }; diff --git a/src/object/auto/autoegg.cpp b/src/object/auto/autoegg.cpp index 4b999a9..04d03f9 100644 --- a/src/object/auto/autoegg.cpp +++ b/src/object/auto/autoegg.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -61,8 +62,8 @@ void CAutoEgg::DeleteObject(bool bAll) if ( alien != 0 ) { // Probably the intended action - // Original code: ( alien->RetZoom(0) == 1.0f ) - if ( alien->RetZoomY(0) == 1.0f ) + // Original code: ( alien->GetZoom(0) == 1.0f ) + if ( alien->GetZoomY(0) == 1.0f ) { alien->SetLock(false); alien->SetActivity(true); // the insect is active @@ -98,7 +99,7 @@ void CAutoEgg::Init() m_speed = 1.0f/5.0f; m_time = 0.0f; - m_type = alien->RetType(); + m_type = alien->GetType(); if ( m_type == OBJECT_ANT || m_type == OBJECT_SPIDER || @@ -164,9 +165,9 @@ bool CAutoEgg::EventProcess(const Event &event) CAuto::EventProcess(event); - if ( m_engine->RetPause() ) return true; + if ( m_engine->GetPause() ) return true; - if ( event.event != EVENT_FRAME ) return true; + if ( event.type != EVENT_FRAME ) return true; if ( m_phase == AEP_NULL ) return true; if ( m_phase == AEP_DELAY ) @@ -175,7 +176,7 @@ bool CAutoEgg::EventProcess(const Event &event) if ( m_progress < 1.0f ) return true; alien = new CObject(m_iMan); - if ( !alien->CreateInsect(m_object->RetPosition(0), m_object->RetAngleY(0), m_type) ) + if ( !alien->CreateInsect(m_object->GetPosition(0), m_object->GetAngleY(0), m_type) ) { delete alien; m_phase = AEP_DELAY; @@ -213,7 +214,7 @@ bool CAutoEgg::EventProcess(const Event &event) Error CAutoEgg::IsEnded() { CObject* alien; - CPyro* pyro; + Gfx::CPyro* pyro; if ( m_phase == AEP_DELAY ) { @@ -236,8 +237,8 @@ Error CAutoEgg::IsEnded() { if ( m_progress < 1.0f ) return ERR_CONTINUE; - pyro = new CPyro(m_iMan); - pyro->Create(PT_EGG, m_object); // exploding egg + pyro = new Gfx::CPyro(m_iMan); + pyro->Create(Gfx::PT_EGG, m_object); // exploding egg alien->SetZoom(0, 1.0f); // this is a big boy now @@ -258,9 +259,9 @@ Error CAutoEgg::IsEnded() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoEgg::RetError() +Error CAutoEgg::GetError() { return ERR_OK; } @@ -277,23 +278,23 @@ CObject* CAutoEgg::SearchAlien() float dist, min; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); min = 100000.0f; pBest = 0; for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - if ( pObj->RetTruck() != 0 ) continue; + if ( pObj->GetTruck() != 0 ) continue; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_ANT && type != OBJECT_BEE && type != OBJECT_SPIDER && type != OBJECT_WORM ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::DistanceProjected(oPos, cPos); if ( dist < 8.0f && dist < min ) { @@ -347,7 +348,7 @@ bool CAutoEgg::Read(char *line) CAuto::Read(line); - m_phase = (AutoEggPhase)OpInt(line, "aPhase", AEP_NULL); + m_phase = static_cast< AutoEggPhase >(OpInt(line, "aPhase", AEP_NULL)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); m_type = OpTypeObject(line, "aParamType", OBJECT_NULL); diff --git a/src/object/auto/autoegg.h b/src/object/auto/autoegg.h index 443dff6..fec07a6 100644 --- a/src/object/auto/autoegg.h +++ b/src/object/auto/autoegg.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -45,7 +46,7 @@ public: void Start(int param); bool EventProcess(const Event &event); Error IsEnded(); - Error RetError(); + Error GetError(); bool SetType(ObjectType type); bool SetValue(int rank, float value); diff --git a/src/object/auto/autoenergy.cpp b/src/object/auto/autoenergy.cpp index 409e282..d0117ab 100644 --- a/src/object/auto/autoenergy.cpp +++ b/src/object/auto/autoenergy.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ #include "object/auto/autoenergy.h" #include "common/iman.h" -#include "old/terrain.h" +#include "graphics/engine/terrain.h" #include "math/geometry.h" #include "script/cmdtoken.h" #include "ui/interface.h" @@ -60,7 +61,7 @@ void CAutoEnergy::DeleteObject(bool bAll) if ( m_partiSphere != -1 ) { - m_particule->DeleteParticule(m_partiSphere); + m_particle->DeleteParticle(m_partiSphere); m_partiSphere = -1; } @@ -92,7 +93,7 @@ void CAutoEnergy::Init() m_time = 0.0f; m_timeVirus = 0.0f; m_lastUpdateTime = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_phase = AENP_WAIT; // waiting ... m_progress = 0.0f; @@ -109,35 +110,35 @@ bool CAutoEnergy::EventProcess(const Event &event) CObject* fret; Math::Vector pos, ppos, speed; Math::Point dim, c, p; - TerrainRes res; + Gfx::TerrainRes res; float big; bool bGO; CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { m_timeVirus = 0.1f+Math::Rand()*0.3f; - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; - pos = m_object->RetPosition(0); + m_lastParticle = m_time; + pos = m_object->GetPosition(0); pos.y += 10.0f; speed.x = (Math::Rand()-0.5f)*10.0f; speed.z = (Math::Rand()-0.5f)*10.0f; speed.y = -7.0f; dim.x = Math::Rand()*0.5f+0.5f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIFIREZ, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFIREZ, 1.0f, 0.0f, 0.0f); } } return true; @@ -146,10 +147,10 @@ bool CAutoEnergy::EventProcess(const Event &event) UpdateInterface(event.rTime); EventProgress(event.rTime); - big = m_object->RetEnergy(); + big = m_object->GetEnergy(); - res = m_terrain->RetResource(m_object->RetPosition(0)); - if ( res == TR_POWER ) + res = m_terrain->GetResource(m_object->GetPosition(0)); + if ( res == Gfx::TR_POWER ) { big += event.rTime*0.01f; // recharges the big pile } @@ -162,7 +163,7 @@ bool CAutoEnergy::EventProcess(const Event &event) fret = SearchMetal(); // transform metal? if ( fret != 0 ) { - if ( fret->RetType() == OBJECT_METAL ) + if ( fret->GetType() == OBJECT_METAL ) { if ( big > ENERGY_POWER ) bGO = true; } @@ -174,7 +175,7 @@ bool CAutoEnergy::EventProcess(const Event &event) if ( bGO ) { - if ( fret->RetType() == OBJECT_METAL ) + if ( fret->GetType() == OBJECT_METAL ) { fret->SetLock(true); // usable metal CreatePower(); // creates the battery @@ -184,12 +185,12 @@ bool CAutoEnergy::EventProcess(const Event &event) InitProgressTotal(ENERGY_DELAY); CAuto::UpdateInterface(); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 4.0f; speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 3.0f; dim.y = dim.x; - m_partiSphere = m_particule->CreateParticule(pos, speed, dim, PARTISPHERE1, ENERGY_DELAY, 0.0f, 0.0f); + m_partiSphere = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISPHERE1, ENERGY_DELAY, 0.0f, 0.0f); m_phase = AENP_CREATE; m_progress = 0.0f; @@ -217,17 +218,17 @@ bool CAutoEnergy::EventProcess(const Event &event) { if ( m_progress < 1.0f && big > 0.01f ) { - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; - pos = m_object->RetPosition(0); + m_lastParticle = m_time; + pos = m_object->GetPosition(0); pos.y += 10.0f; speed.x = (Math::Rand()-0.5f)*1.0f; speed.z = (Math::Rand()-0.5f)*1.0f; speed.y = -7.0f; dim.x = Math::Rand()*0.5f+0.5f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIFIREZ, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFIREZ, 1.0f, 0.0f, 0.0f); } } else @@ -245,7 +246,7 @@ bool CAutoEnergy::EventProcess(const Event &event) fret = SearchMetal(); if ( fret != 0 ) { - if ( fret->RetType() == OBJECT_METAL ) + if ( fret->GetType() == OBJECT_METAL ) { big -= event.rTime/ENERGY_DELAY*ENERGY_POWER; } @@ -262,11 +263,11 @@ bool CAutoEnergy::EventProcess(const Event &event) fret->SetZoom(0, m_progress); } - if ( m_lastParticule+m_engine->ParticuleAdapt(0.10f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.10f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); c.x = pos.x; c.y = pos.z; p.x = c.x; @@ -278,27 +279,27 @@ bool CAutoEnergy::EventProcess(const Event &event) speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = Math::Rand()*2.0f+1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGLINT, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 1.0f, 0.0f, 0.0f); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 3.0f; speed.x = (Math::Rand()-0.5f)*30.0f; speed.z = (Math::Rand()-0.5f)*30.0f; speed.y = Math::Rand()*20.0f+10.0f; dim.x = Math::Rand()*0.4f+0.4f; dim.y = dim.x; - m_particule->CreateTrack(pos, speed, dim, PARTITRACK2, 2.0f, 50.0f, 1.2f, 1.2f); + m_particle->CreateTrack(pos, speed, dim, Gfx::PARTITRACK2, 2.0f, 50.0f, 1.2f, 1.2f); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 10.0f; speed.x = (Math::Rand()-0.5f)*1.5f; speed.z = (Math::Rand()-0.5f)*1.5f; speed.y = -6.0f; dim.x = Math::Rand()*1.0f+1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIFIREZ, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFIREZ, 1.0f, 0.0f, 0.0f); - m_sound->Play(SOUND_ENERGY, m_object->RetPosition(0), + m_sound->Play(SOUND_ENERGY, m_object->GetPosition(0), 1.0f, 1.0f+Math::Rand()*1.5f); } } @@ -337,11 +338,11 @@ bool CAutoEnergy::EventProcess(const Event &event) { if ( m_progress < 1.0f ) { - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 17.0f; pos.x += (Math::Rand()-0.5f)*3.0f; pos.z += (Math::Rand()-0.5f)*3.0f; @@ -350,7 +351,7 @@ bool CAutoEnergy::EventProcess(const Event &event) speed.y = 6.0f+Math::Rand()*6.0f; dim.x = Math::Rand()*1.5f+1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISMOKE3, 4.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE3, 4.0f); } } else @@ -376,10 +377,10 @@ CObject* CAutoEnergy::SearchMetal() CObject* pObj; ObjectType type; - pObj = m_object->RetPower(); + pObj = m_object->GetPower(); if ( pObj == 0 ) return 0; - type = pObj->RetType(); + type = pObj->GetType(); if ( type == OBJECT_METAL || type == OBJECT_SCRAP1 || type == OBJECT_SCRAP2 || @@ -398,14 +399,14 @@ bool CAutoEnergy::SearchVehicle() float oRadius, dist; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_HUMAN && type != OBJECT_MOBILEfa && type != OBJECT_MOBILEta && @@ -457,8 +458,8 @@ void CAutoEnergy::CreatePower() Math::Vector pos; float angle; - pos = m_object->RetPosition(0); - angle = m_object->RetAngleY(0); + pos = m_object->GetPosition(0); + angle = m_object->GetAngleY(0); power = new CObject(m_iMan); if ( !power->CreateResource(pos, angle, OBJECT_POWER) ) @@ -469,7 +470,7 @@ void CAutoEnergy::CreatePower() } power->SetLock(true); // battery not yet usable - pos = power->RetPosition(0); + pos = power->GetPosition(0); pos.y += 3.0f; power->SetPosition(0, pos); } @@ -483,19 +484,19 @@ CObject* CAutoEnergy::SearchPower() ObjectType type; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - if ( !pObj->RetLock() ) continue; + if ( !pObj->GetLock() ) continue; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_POWER ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); if ( oPos.x == cPos.x && oPos.z == cPos.z ) { @@ -507,15 +508,15 @@ CObject* CAutoEnergy::SearchPower() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoEnergy::RetError() +Error CAutoEnergy::GetError() { CObject* pObj; ObjectType type; - TerrainRes res; + Gfx::TerrainRes res; - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } @@ -523,14 +524,14 @@ Error CAutoEnergy::RetError() if ( m_phase != AENP_WAIT && m_phase != AENP_BLITZ ) return ERR_OK; - res = m_terrain->RetResource(m_object->RetPosition(0)); - if ( res != TR_POWER ) return ERR_ENERGY_NULL; + res = m_terrain->GetResource(m_object->GetPosition(0)); + if ( res != Gfx::TR_POWER ) return ERR_ENERGY_NULL; - if ( m_object->RetEnergy() < ENERGY_POWER ) return ERR_ENERGY_LOW; + if ( m_object->GetEnergy() < ENERGY_POWER ) return ERR_ENERGY_LOW; - pObj = m_object->RetPower(); + pObj = m_object->GetPower(); if ( pObj == 0 ) return ERR_ENERGY_EMPTY; - type = pObj->RetType(); + type = pObj->GetType(); if ( type == OBJECT_POWER ) return ERR_OK; if ( type != OBJECT_METAL && type != OBJECT_SCRAP1 && @@ -545,7 +546,7 @@ Error CAutoEnergy::RetError() bool CAutoEnergy::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -553,7 +554,7 @@ bool CAutoEnergy::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -581,23 +582,23 @@ bool CAutoEnergy::CreateInterface(bool bSelect) void CAutoEnergy::UpdateInterface(float rTime) { - CWindow* pw; - CGauge* pg; + Ui::CWindow* pw; + Ui::CGauge* pg; CAuto::UpdateInterface(rTime); if ( m_time < m_lastUpdateTime+0.1f ) return; m_lastUpdateTime = m_time; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return; - pg = (CGauge*)pw->SearchControl(EVENT_OBJECT_GENERGY); + pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GENERGY)); if ( pg != 0 ) { - pg->SetLevel(m_object->RetEnergy()); + pg->SetLevel(m_object->GetEnergy()); } } @@ -636,12 +637,12 @@ bool CAutoEnergy::Read(char *line) CAuto::Read(line); - m_phase = (AutoEnergyPhase)OpInt(line, "aPhase", AENP_WAIT); + m_phase = static_cast< AutoEnergyPhase >(OpInt(line, "aPhase", AENP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); m_lastUpdateTime = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autoenergy.h b/src/object/auto/autoenergy.h index 727f2c3..53d47b6 100644 --- a/src/object/auto/autoenergy.h +++ b/src/object/auto/autoenergy.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -65,7 +66,7 @@ protected: float m_speed; float m_timeVirus; float m_lastUpdateTime; - float m_lastParticule; + float m_lastParticle; int m_partiSphere; }; diff --git a/src/object/auto/autofactory.cpp b/src/object/auto/autofactory.cpp index f02195c..8e7d480 100644 --- a/src/object/auto/autofactory.cpp +++ b/src/object/auto/autofactory.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -95,9 +96,9 @@ void CAutoFactory::Init() m_speed = 1.0f/2.0f; m_time = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; - m_fretPos = m_object->RetPosition(0); + m_fretPos = m_object->GetPosition(0); CAuto::Init(); } @@ -119,37 +120,37 @@ bool CAutoFactory::EventProcess(const Event &event) CAuto::EventProcess(event); - if ( m_engine->RetPause() ) return true; + if ( m_engine->GetPause() ) return true; - if ( m_object->RetSelect() ) // factory selected? + if ( m_object->GetSelect() ) // factory selected? { - if ( event.event == EVENT_UPDINTERFACE ) + if ( event.type == EVENT_UPDINTERFACE ) { CreateInterface(true); } type = OBJECT_NULL; - if ( event.event == EVENT_OBJECT_FACTORYwa ) type = OBJECT_MOBILEwa; - if ( event.event == EVENT_OBJECT_FACTORYta ) type = OBJECT_MOBILEta; - if ( event.event == EVENT_OBJECT_FACTORYfa ) type = OBJECT_MOBILEfa; - if ( event.event == EVENT_OBJECT_FACTORYia ) type = OBJECT_MOBILEia; - if ( event.event == EVENT_OBJECT_FACTORYws ) type = OBJECT_MOBILEws; - if ( event.event == EVENT_OBJECT_FACTORYts ) type = OBJECT_MOBILEts; - if ( event.event == EVENT_OBJECT_FACTORYfs ) type = OBJECT_MOBILEfs; - if ( event.event == EVENT_OBJECT_FACTORYis ) type = OBJECT_MOBILEis; - if ( event.event == EVENT_OBJECT_FACTORYwc ) type = OBJECT_MOBILEwc; - if ( event.event == EVENT_OBJECT_FACTORYtc ) type = OBJECT_MOBILEtc; - if ( event.event == EVENT_OBJECT_FACTORYfc ) type = OBJECT_MOBILEfc; - if ( event.event == EVENT_OBJECT_FACTORYic ) type = OBJECT_MOBILEic; - if ( event.event == EVENT_OBJECT_FACTORYwi ) type = OBJECT_MOBILEwi; - if ( event.event == EVENT_OBJECT_FACTORYti ) type = OBJECT_MOBILEti; - if ( event.event == EVENT_OBJECT_FACTORYfi ) type = OBJECT_MOBILEfi; - if ( event.event == EVENT_OBJECT_FACTORYii ) type = OBJECT_MOBILEii; - if ( event.event == EVENT_OBJECT_FACTORYrt ) type = OBJECT_MOBILErt; - if ( event.event == EVENT_OBJECT_FACTORYrc ) type = OBJECT_MOBILErc; - if ( event.event == EVENT_OBJECT_FACTORYrr ) type = OBJECT_MOBILErr; - if ( event.event == EVENT_OBJECT_FACTORYrs ) type = OBJECT_MOBILErs; - if ( event.event == EVENT_OBJECT_FACTORYsa ) type = OBJECT_MOBILEsa; + if ( event.type == EVENT_OBJECT_FACTORYwa ) type = OBJECT_MOBILEwa; + if ( event.type == EVENT_OBJECT_FACTORYta ) type = OBJECT_MOBILEta; + if ( event.type == EVENT_OBJECT_FACTORYfa ) type = OBJECT_MOBILEfa; + if ( event.type == EVENT_OBJECT_FACTORYia ) type = OBJECT_MOBILEia; + if ( event.type == EVENT_OBJECT_FACTORYws ) type = OBJECT_MOBILEws; + if ( event.type == EVENT_OBJECT_FACTORYts ) type = OBJECT_MOBILEts; + if ( event.type == EVENT_OBJECT_FACTORYfs ) type = OBJECT_MOBILEfs; + if ( event.type == EVENT_OBJECT_FACTORYis ) type = OBJECT_MOBILEis; + if ( event.type == EVENT_OBJECT_FACTORYwc ) type = OBJECT_MOBILEwc; + if ( event.type == EVENT_OBJECT_FACTORYtc ) type = OBJECT_MOBILEtc; + if ( event.type == EVENT_OBJECT_FACTORYfc ) type = OBJECT_MOBILEfc; + if ( event.type == EVENT_OBJECT_FACTORYic ) type = OBJECT_MOBILEic; + if ( event.type == EVENT_OBJECT_FACTORYwi ) type = OBJECT_MOBILEwi; + if ( event.type == EVENT_OBJECT_FACTORYti ) type = OBJECT_MOBILEti; + if ( event.type == EVENT_OBJECT_FACTORYfi ) type = OBJECT_MOBILEfi; + if ( event.type == EVENT_OBJECT_FACTORYii ) type = OBJECT_MOBILEii; + if ( event.type == EVENT_OBJECT_FACTORYrt ) type = OBJECT_MOBILErt; + if ( event.type == EVENT_OBJECT_FACTORYrc ) type = OBJECT_MOBILErc; + if ( event.type == EVENT_OBJECT_FACTORYrr ) type = OBJECT_MOBILErr; + if ( event.type == EVENT_OBJECT_FACTORYrs ) type = OBJECT_MOBILErs; + if ( event.type == EVENT_OBJECT_FACTORYsa ) type = OBJECT_MOBILEsa; if ( type != OBJECT_NULL ) { @@ -186,7 +187,7 @@ bool CAutoFactory::EventProcess(const Event &event) } } - if ( event.event != EVENT_FRAME ) return true; + if ( event.type != EVENT_FRAME ) return true; m_progress += event.rTime*m_speed; EventProgress(event.rTime); @@ -249,7 +250,7 @@ bool CAutoFactory::EventProcess(const Event &event) m_object->SetAngleZ(10+i, 0.0f); } - m_channelSound = m_sound->Play(SOUND_FACTORY, m_object->RetPosition(0), 0.0f, 1.0f, true); + m_channelSound = m_sound->Play(SOUND_FACTORY, m_object->GetPosition(0), 0.0f, 1.0f, true); m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, 2.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, 11.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_channelSound, 0.0f, 1.0f, 2.0f, SOPER_STOP); @@ -300,7 +301,7 @@ bool CAutoFactory::EventProcess(const Event &event) { prog = 1.0f-m_progress; } - angle = powf(prog*10.0f, 2.0f)+m_object->RetAngleY(0); + angle = powf(prog*10.0f, 2.0f)+m_object->GetAngleY(0); vehicle = SearchVehicle(); if ( vehicle != 0 ) @@ -315,9 +316,9 @@ bool CAutoFactory::EventProcess(const Event &event) fret->SetZoom(0, 1.0f-m_progress); } - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; #if 0 pos = m_fretPos; @@ -329,9 +330,9 @@ bool CAutoFactory::EventProcess(const Event &event) speed.y = Math::Rand()*12.0f; dim.x = Math::Rand()*12.0f+10.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBLUE, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, PARTIBLUE, 1.0f, 0.0f, 0.0f); #else - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); pos = Math::Vector(-12.0f, 20.0f, -4.0f); // position of chimney pos = Math::Transform(*mat, pos); pos.y += 2.0f; @@ -342,7 +343,7 @@ bool CAutoFactory::EventProcess(const Event &event) speed.y = 6.0f+Math::Rand()*6.0f; dim.x = Math::Rand()*1.5f+1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISMOKE3, 4.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE3, 4.0f); #endif } } @@ -361,15 +362,15 @@ bool CAutoFactory::EventProcess(const Event &event) vehicle = SearchVehicle(); if ( vehicle != 0 ) { - physics = vehicle->RetPhysics(); + physics = vehicle->GetPhysics(); if ( physics != 0 ) { physics->SetFreeze(false); // can move } vehicle->SetLock(false); // vehicle useable -//? vehicle->RetPhysics()->RetBrain()->StartTaskAdvance(16.0f); - vehicle->SetAngleY(0, m_object->RetAngleY(0)+Math::PI); +//? vehicle->GetPhysics()->GetBrain()->StartTaskAdvance(16.0f); + vehicle->SetAngleY(0, m_object->GetAngleY(0)+Math::PI); vehicle->SetZoom(0, 1.0f); } @@ -392,9 +393,9 @@ bool CAutoFactory::EventProcess(const Event &event) m_object->SetAngleZ(10+i, -angle); } - if ( m_lastParticule+m_engine->ParticuleAdapt(0.1f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.1f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; pos = m_fretPos; pos.x += (Math::Rand()-0.5f)*10.0f; @@ -403,7 +404,7 @@ bool CAutoFactory::EventProcess(const Event &event) speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGLINT, 2.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 2.0f, 0.0f, 0.0f); } } else @@ -435,9 +436,9 @@ bool CAutoFactory::EventProcess(const Event &event) m_object->SetZoomZ(10+i, zoom); } - if ( m_lastParticule+m_engine->ParticuleAdapt(0.1f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.1f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; pos = m_fretPos; pos.x += (Math::Rand()-0.5f)*10.0f; @@ -446,7 +447,7 @@ bool CAutoFactory::EventProcess(const Event &event) speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGLINT, 2.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 2.0f, 0.0f, 0.0f); } } else @@ -503,12 +504,12 @@ bool CAutoFactory::Read(char *line) CAuto::Read(line); - m_phase = (AutoFactoryPhase)OpInt(line, "aPhase", AFP_WAIT); + m_phase = static_cast< AutoFactoryPhase >(OpInt(line, "aPhase", AFP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; - m_fretPos = m_object->RetPosition(0); + m_lastParticle = 0.0f; + m_fretPos = m_object->GetPosition(0); return true; } @@ -526,14 +527,14 @@ CObject* CAutoFactory::SearchFret() for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_METAL ) continue; - if ( pObj->RetTruck() != 0 ) continue; + if ( pObj->GetTruck() != 0 ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, m_fretPos); if ( dist < 8.0f ) return pObj; @@ -552,14 +553,14 @@ bool CAutoFactory::NearestVehicle() float oRadius, dist; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_HUMAN && type != OBJECT_MOBILEfa && type != OBJECT_MOBILEta && @@ -616,9 +617,9 @@ bool CAutoFactory::CreateVehicle() char* name; int i; - angle = m_object->RetAngleY(0); + angle = m_object->GetAngleY(0); - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); if ( m_type == OBJECT_MOBILErt || m_type == OBJECT_MOBILErc || m_type == OBJECT_MOBILErr || @@ -643,7 +644,7 @@ bool CAutoFactory::CreateVehicle() vehicle->SetLock(true); // not usable vehicle->SetRange(30.0f); - physics = vehicle->RetPhysics(); + physics = vehicle->GetPhysics(); if ( physics != 0 ) { physics->SetFreeze(true); // it doesn't move @@ -651,7 +652,7 @@ bool CAutoFactory::CreateVehicle() for ( i=0 ; i<10 ; i++ ) { - name = m_main->RetNewScriptName(m_type, i); + name = m_main->GetNewScriptName(m_type, i); if ( name == 0 ) break; vehicle->ReadProgram(i, name); } @@ -671,16 +672,16 @@ CObject* CAutoFactory::SearchVehicle() for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - if ( !pObj->RetLock() ) continue; + if ( !pObj->GetLock() ) continue; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != m_type ) continue; - if ( pObj->RetTruck() != 0 ) continue; + if ( pObj->GetTruck() != 0 ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, m_fretPos); if ( dist < 8.0f ) return pObj; @@ -694,7 +695,7 @@ CObject* CAutoFactory::SearchVehicle() bool CAutoFactory::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, dim, ddim; float ox, oy, sx, sy; @@ -702,8 +703,8 @@ bool CAutoFactory::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw == 0 ) return false; + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw == nullptr ) return false; dim.x = 33.0f/640.0f; dim.y = 33.0f/480.0f; @@ -786,13 +787,13 @@ bool CAutoFactory::CreateInterface(bool bSelect) void CAutoFactory::UpdateInterface() { - CWindow* pw; + Ui::CWindow* pw; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; CAuto::UpdateInterface(); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); UpdateButton(pw, EVENT_OBJECT_FACTORYwa, m_bBusy); UpdateButton(pw, EVENT_OBJECT_FACTORYta, m_bBusy); @@ -819,7 +820,7 @@ void CAutoFactory::UpdateInterface() // Updates the status of one interface button. -void CAutoFactory::UpdateButton(CWindow *pw, EventMsg event, bool bBusy) +void CAutoFactory::UpdateButton(Ui::CWindow *pw, EventType event, bool bBusy) { bool bEnable = true; @@ -933,7 +934,7 @@ void CAutoFactory::SoundManip(float time, float amplitude, float frequency) { int i; - i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.3f*frequency, true); + i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f*frequency, true); m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, 0.1f, SOPER_CONTINUE); m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, time-0.1f, SOPER_CONTINUE); m_sound->AddEnvelope(i, 0.0f, 0.3f*frequency, 0.1f, SOPER_STOP); diff --git a/src/object/auto/autofactory.h b/src/object/auto/autofactory.h index acbdf40..f62080d 100644 --- a/src/object/auto/autofactory.h +++ b/src/object/auto/autofactory.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -54,7 +55,7 @@ public: protected: void UpdateInterface(); - void UpdateButton(CWindow *pw, EventMsg event, bool bBusy); + void UpdateButton(Ui::CWindow *pw, EventType event, bool bBusy); CObject* SearchFret(); bool NearestVehicle(); @@ -67,7 +68,7 @@ protected: AutoFactoryPhase m_phase; float m_progress; float m_speed; - float m_lastParticule; + float m_lastParticle; Math::Vector m_fretPos; int m_channelSound; }; diff --git a/src/object/auto/autoflag.cpp b/src/object/auto/autoflag.cpp index ea74b17..acab2d0 100644 --- a/src/object/auto/autoflag.cpp +++ b/src/object/auto/autoflag.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ #include "object/auto/autoflag.h" #include "math/geometry.h" -#include "old/terrain.h" +#include "graphics/engine/terrain.h" @@ -68,7 +69,7 @@ void CAutoFlag::Init() m_param = 0; m_progress = 0.0f; - wind = m_terrain->RetWind(); + wind = m_terrain->GetWind(); angle = Math::RotateAngle(wind.x, -wind.z); m_object->SetAngleY(0, angle); // directs the flag in the wind @@ -98,7 +99,7 @@ bool CAutoFlag::EventProcess(const Event &event) CAuto::EventProcess(event); #if ADJUST_ANGLE - if ( event.event == EVENT_KEYDOWN ) + if ( event.type == EVENT_KEYDOWN ) { if ( event.param == 'E' ) g_flag1 += 0.1f; if ( event.param == 'D' ) g_flag1 -= 0.1f; @@ -109,8 +110,8 @@ bool CAutoFlag::EventProcess(const Event &event) } #endif - 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_param == 1 ) // shakes? { @@ -152,9 +153,9 @@ bool CAutoFlag::EventProcess(const Event &event) } -// Returns an error due the state of the automation +// Geturns an error due the state of the automation -Error CAutoFlag::RetError() +Error CAutoFlag::GetError() { return ERR_OK; } diff --git a/src/object/auto/autoflag.h b/src/object/auto/autoflag.h index fdec682..3c6cf99 100644 --- a/src/object/auto/autoflag.h +++ b/src/object/auto/autoflag.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -34,7 +35,7 @@ public: void Init(); void Start(int param); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); protected: diff --git a/src/object/auto/autohuston.cpp b/src/object/auto/autohuston.cpp index a96bcb8..1dd92f0 100644 --- a/src/object/auto/autohuston.cpp +++ b/src/object/auto/autohuston.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -38,11 +39,11 @@ CAutoHuston::CAutoHuston(CInstanceManager* iMan, CObject* object) m_lens[i].parti = -1; } - pos = m_object->RetPosition(0); - m_lens[0].type = PARTISELR; - m_lens[1].type = PARTISELR; - m_lens[2].type = PARTISELR; - m_lens[3].type = PARTISELR; + pos = m_object->GetPosition(0); + m_lens[0].type = Gfx::PARTISELR; + m_lens[1].type = Gfx::PARTISELR; + m_lens[2].type = Gfx::PARTISELR; + m_lens[3].type = Gfx::PARTISELR; m_lens[0].pos = pos+Math::Vector(0.0f+13.0f, 34.0f, 30.0f ); m_lens[1].pos = pos+Math::Vector(0.0f-13.0f, 34.0f, 30.0f ); m_lens[2].pos = pos+Math::Vector(0.0f , 34.0f, 30.0f+13.0f); @@ -62,46 +63,46 @@ CAutoHuston::CAutoHuston(CInstanceManager* iMan, CObject* object) // Part under the radar. i = 4; - m_lens[i].type = PARTISELR; + m_lens[i].type = Gfx::PARTISELR; m_lens[i].pos = pos+Math::Vector(-7.0f, 9.9f, 40.1f); m_lens[i].dim = 1.8f; m_lens[i].total = 0.4f; m_lens[i].off = 0.2f; i ++; - m_lens[i].type = PARTISELY; + m_lens[i].type = Gfx::PARTISELY; m_lens[i].pos = pos+Math::Vector(-7.0f, 7.2f, 34.8f); m_lens[i].dim = 0.4f; m_lens[i].total = 0.7f; m_lens[i].off = 0.3f; i ++; - m_lens[i].type = PARTISELY; + m_lens[i].type = Gfx::PARTISELY; m_lens[i].pos = pos+Math::Vector(-7.0f, 6.5f, 34.3f); m_lens[i].dim = 0.4f; m_lens[i].total = 0.7f; m_lens[i].off = 0.3f; i ++; - m_lens[i].type = PARTISELR; + m_lens[i].type = Gfx::PARTISELR; m_lens[i].pos = pos+Math::Vector(-7.0f, 6.5f, 33.4f); m_lens[i].dim = 0.4f; m_lens[i].total = 0.0f; m_lens[i].off = 0.0f; i ++; - m_lens[i].type = PARTISELR; + m_lens[i].type = Gfx::PARTISELR; m_lens[i].pos = pos+Math::Vector(-7.0f, 6.5f, 33.0f); m_lens[i].dim = 0.4f; m_lens[i].total = 1.0f; m_lens[i].off = 0.5f; i ++; - m_lens[i].type = PARTISELY; + m_lens[i].type = Gfx::PARTISELY; m_lens[i].pos = pos+Math::Vector(-7.0f, 8.5f, 14.0f); m_lens[i].dim = 1.2f; m_lens[i].total = 0.8f; m_lens[i].off = 0.2f; i ++; - m_lens[i].type = PARTISELR; + m_lens[i].type = Gfx::PARTISELR; m_lens[i].pos = pos+Math::Vector(4.0f, 6.0f, 8.6f); m_lens[i].dim = 1.0f; m_lens[i].total = 0.9f; @@ -109,53 +110,53 @@ CAutoHuston::CAutoHuston(CInstanceManager* iMan, CObject* object) i ++; // Part with three windows. - m_lens[i].type = PARTISELR; + m_lens[i].type = Gfx::PARTISELR; m_lens[i].pos = pos+Math::Vector(-7.0f, 9.9f, -19.9f); m_lens[i].dim = 1.0f; m_lens[i].total = 0.6f; m_lens[i].off = 0.3f; i ++; - m_lens[i].type = PARTISELY; + m_lens[i].type = Gfx::PARTISELY; m_lens[i].pos = pos+Math::Vector(-7.0f, 7.2f, 34.8f-60.0f); m_lens[i].dim = 0.4f; m_lens[i].total = 0.7f; m_lens[i].off = 0.3f; i ++; - m_lens[i].type = PARTISELY; + m_lens[i].type = Gfx::PARTISELY; m_lens[i].pos = pos+Math::Vector(-7.0f, 6.5f, 34.3f-60.0f); m_lens[i].dim = 0.4f; m_lens[i].total = 0.0f; m_lens[i].off = 0.0f; i ++; - m_lens[i].type = PARTISELR; + m_lens[i].type = Gfx::PARTISELR; m_lens[i].pos = pos+Math::Vector(-7.0f, 6.5f, 33.4f-60.0f); m_lens[i].dim = 0.4f; m_lens[i].total = 0.6f; m_lens[i].off = 0.4f; i ++; - m_lens[i].type = PARTISELR; + m_lens[i].type = Gfx::PARTISELR; m_lens[i].pos = pos+Math::Vector(-7.0f, 6.5f, 33.0f-60.0f); m_lens[i].dim = 0.4f; m_lens[i].total = 0.8f; m_lens[i].off = 0.2f; i ++; - m_lens[i].type = PARTISELY; + m_lens[i].type = Gfx::PARTISELY; m_lens[i].pos = pos+Math::Vector(-6.5f, 13.5f, -37.0f); m_lens[i].dim = 1.0f; m_lens[i].total = 0.0f; m_lens[i].off = 0.0f; i ++; - m_lens[i].type = PARTISELY; + m_lens[i].type = Gfx::PARTISELY; m_lens[i].pos = pos+Math::Vector(-7.0f, 12.2f, -39.8f); m_lens[i].dim = 1.8f; m_lens[i].total = 1.5f; m_lens[i].off = 0.5f; i ++; - m_lens[i].type = PARTISELY; + m_lens[i].type = Gfx::PARTISELY; m_lens[i].pos = pos+Math::Vector(-7.0f, 8.5f, -47.0f); m_lens[i].dim = 0.6f; m_lens[i].total = 0.7f; @@ -211,14 +212,14 @@ bool CAutoHuston::EventProcess(const Event &event) CAuto::EventProcess(event); - if ( m_engine->RetPause() ) return true; + if ( m_engine->GetPause() ) return true; angle = -m_time*1.0f; m_object->SetAngleY(1, angle); // rotates the radar angle = sinf(m_time*4.0f)*0.3f; m_object->SetAngleX(2, angle); - if ( event.event != EVENT_FRAME ) return true; + if ( event.type != EVENT_FRAME ) return true; m_progress += event.rTime*m_speed; @@ -231,7 +232,7 @@ bool CAutoHuston::EventProcess(const Event &event) { if ( m_lens[i].parti != -1 ) { - m_particule->DeleteParticule(m_lens[i].parti); + m_particle->DeleteParticle(m_lens[i].parti); m_lens[i].parti = -1; } } @@ -241,7 +242,7 @@ bool CAutoHuston::EventProcess(const Event &event) { dim.x = m_lens[i].dim; dim.y = dim.x; - m_lens[i].parti = m_particule->CreateParticule(m_lens[i].pos, speed, dim, m_lens[i].type, 1.0f, 0.0f, 0.0f); + m_lens[i].parti = m_particle->CreateParticle(m_lens[i].pos, speed, dim, m_lens[i].type, 1.0f, 0.0f, 0.0f); } } } @@ -261,7 +262,7 @@ bool CAutoHuston::Abort() bool CAutoHuston::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -269,8 +270,8 @@ bool CAutoHuston::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw == 0 ) return false; + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw == nullptr ) return false; ox = 3.0f/640.0f; oy = 3.0f/480.0f; @@ -287,9 +288,9 @@ bool CAutoHuston::CreateInterface(bool bSelect) } -// Returns an error due to state of the automation. +// Geturns an error due to state of the automation. -Error CAutoHuston::RetError() +Error CAutoHuston::GetError() { return ERR_OK; } diff --git a/src/object/auto/autohuston.h b/src/object/auto/autohuston.h index a59f8f2..27b016b 100644 --- a/src/object/auto/autohuston.h +++ b/src/object/auto/autohuston.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -20,18 +21,18 @@ #include "object/auto/auto.h" -#include "old/particule.h" +#include "graphics/engine/particle.h" struct HustonLens { - int parti; - ParticuleType type; + int parti; + Gfx::ParticleType type; Math::Vector pos; - float dim; - float total; - float off; + float dim; + float total; + float off; }; @@ -50,7 +51,7 @@ public: void Start(int param); bool EventProcess(const Event &event); bool Abort(); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); diff --git a/src/object/auto/autoinfo.cpp b/src/object/auto/autoinfo.cpp index 56fd8c7..1edd5e0 100644 --- a/src/object/auto/autoinfo.cpp +++ b/src/object/auto/autoinfo.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -90,8 +91,8 @@ void CAutoInfo::Start(int param) m_speed = 1.0f/2.0f; } - m_lastParticule = 0; - m_goal = m_object->RetPosition(0); + m_lastParticle = 0; + m_goal = m_object->GetPosition(0); if ( m_phase == AIP_EMETTE ) { @@ -100,7 +101,7 @@ void CAutoInfo::Start(int param) speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 30.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISPHERE4, 1.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISPHERE4, 1.5f, 0.0f, 0.0f); m_sound->Play(SOUND_LABO, pos, 1.0f, 2.0f); } @@ -111,7 +112,7 @@ void CAutoInfo::Start(int param) speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 50.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISPHERE6, 1.5f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISPHERE6, 1.5f, 0.0f, 0.0f); m_sound->Play(SOUND_LABO, pos, 1.0f, 2.0f); } @@ -133,18 +134,18 @@ bool CAutoInfo::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { m_timeVirus = 0.1f+Math::Rand()*0.3f; - angle = m_object->RetAngleY(1); + angle = m_object->GetAngleY(1); angle += Math::Rand()*0.3f; m_object->SetAngleY(1, angle); @@ -170,7 +171,7 @@ bool CAutoInfo::EventProcess(const Event &event) } else { - if ( m_object->RetInfoUpdate() ) + if ( m_object->GetInfoUpdate() ) { UpdateList(); // updates the list } @@ -184,9 +185,9 @@ bool CAutoInfo::EventProcess(const Event &event) if ( m_phase == AIP_EMETTE ) // instruction "receive" ? { if ( m_progress < 0.5f && - m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; for ( i=0 ; i<4 ; i++ ) { @@ -199,7 +200,7 @@ bool CAutoInfo::EventProcess(const Event &event) dim.x = 0.6f; dim.y = dim.x; duration = Math::Rand()*0.5f+0.5f; - m_particule->CreateTrack(pos, speed, dim, PARTITRACK6, + m_particle->CreateTrack(pos, speed, dim, Gfx::PARTITRACK6, duration, 0.0f, duration*0.9f, 0.7f); } @@ -230,9 +231,9 @@ bool CAutoInfo::EventProcess(const Event &event) if ( m_phase == AIP_RECEIVE ) // instruction "send" ? { if ( m_progress < 0.5f && - m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; for ( i=0 ; i<4 ; i++ ) { @@ -247,7 +248,7 @@ bool CAutoInfo::EventProcess(const Event &event) dim.x = 0.6f; dim.y = dim.x; duration = Math::Rand()*0.5f+0.5f; - m_particule->CreateTrack(pos, speed, dim, PARTITRACK6, + m_particle->CreateTrack(pos, speed, dim, Gfx::PARTITRACK6, duration, 0.0f, duration*0.9f, 0.7f); } @@ -278,9 +279,9 @@ bool CAutoInfo::EventProcess(const Event &event) if ( m_phase == AIP_ERROR ) { if ( m_progress < 0.5f && - m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; pos = m_goal; speed.x = (Math::Rand()-0.5f)*5.0f; @@ -289,7 +290,7 @@ bool CAutoInfo::EventProcess(const Event &event) dim.x = 5.0f+Math::Rand()*5.0f; dim.y = dim.x; duration = Math::Rand()*0.5f+0.5f; - m_particule->CreateParticule(pos, speed, dim, PARTISMOKE1, 4.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE1, 4.0f); } if ( m_progress < 1.0f ) @@ -327,7 +328,7 @@ bool CAutoInfo::EventProcess(const Event &event) } } - angle = m_object->RetAngleY(1); + angle = m_object->GetAngleY(1); angle += rTime*0.5f; m_object->SetAngleY(1, angle); @@ -339,11 +340,11 @@ bool CAutoInfo::EventProcess(const Event &event) } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoInfo::RetError() +Error CAutoInfo::GetError() { - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } @@ -356,8 +357,8 @@ Error CAutoInfo::RetError() bool CAutoInfo::CreateInterface(bool bSelect) { - CWindow* pw; - CList* pl; + Ui::CWindow* pw; + Ui::CList* pl; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -365,7 +366,7 @@ bool CAutoInfo::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -403,31 +404,31 @@ void CAutoInfo::UpdateInterface(float rTime) void CAutoInfo::UpdateList() { - CWindow* pw; - CList* pl; + Ui::CWindow* pw; + Ui::CList* pl; Info info; int total, i; char text[100]; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); - if ( pw == 0 ) return; + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); + if ( pw == nullptr ) return; - pl = (CList*)pw->SearchControl(EVENT_OBJECT_GINFO); - if ( pl == 0 ) return; + pl = static_cast< Ui::CList* >(pw->SearchControl(EVENT_OBJECT_GINFO)); + if ( pl == nullptr ) return; pl->Flush(); - total = m_object->RetInfoTotal(); + total = m_object->GetInfoTotal(); if ( total == 0 ) { - pl->ClearState(STATE_ENABLE); + pl->ClearState(Ui::STATE_ENABLE); } else { - pl->SetState(STATE_ENABLE); + pl->SetState(Ui::STATE_ENABLE); for ( i=0 ; i<total ; i++ ) { - info = m_object->RetInfo(i); + info = m_object->GetInfo(i); sprintf(text, "%s = %.2f", info.name, info.value); pl->SetName(i, text); } @@ -440,28 +441,28 @@ void CAutoInfo::UpdateList() void CAutoInfo::UpdateListVirus() { - CWindow* pw; - CList* pl; + Ui::CWindow* pw; + Ui::CList* pl; int i, j, max; char text[100]; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return; - pl = (CList*)pw->SearchControl(EVENT_OBJECT_GINFO); + pl = static_cast< Ui::CList* >(pw->SearchControl(EVENT_OBJECT_GINFO)); if ( pl == 0 ) return; - pl->SetState(STATE_ENABLE); + pl->SetState(Ui::STATE_ENABLE); pl->Flush(); for ( i=0 ; i<4 ; i++ ) { - max = (int)(2.0f+Math::Rand()*10.0f); + max = static_cast< int >(2.0f+Math::Rand()*10.0f); for ( j=0 ; j<max ; j++ ) { do { - text[j] = ' '+(int)(Math::Rand()*94.0f); + text[j] = ' '+static_cast< int >(Math::Rand()*94.0f); } while ( text[j] == '\\' ); } @@ -505,11 +506,11 @@ bool CAutoInfo::Read(char *line) CAuto::Read(line); - m_phase = (AutoInfoPhase)OpInt(line, "aPhase", AIP_WAIT); + m_phase = static_cast< AutoInfoPhase > (OpInt(line, "aPhase", AIP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autoinfo.h b/src/object/auto/autoinfo.h index cfe3c1b..30481bb 100644 --- a/src/object/auto/autoinfo.h +++ b/src/object/auto/autoinfo.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); void Start(int param); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -61,7 +62,7 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; Math::Vector m_goal; bool m_bLastVirus; }; diff --git a/src/object/auto/autojostle.cpp b/src/object/auto/autojostle.cpp index 3944297..68fe6d1 100644 --- a/src/object/auto/autojostle.cpp +++ b/src/object/auto/autojostle.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -71,7 +72,7 @@ void CAutoJostle::Start(int param, float force) m_time = 0.0f; m_error = ERR_CONTINUE; - type = m_object->RetType(); + type = m_object->GetType(); if ( type >= OBJECT_PLANT5 && type <= OBJECT_PLANT7 ) // clover? { @@ -89,8 +90,8 @@ bool CAutoJostle::EventProcess(const Event &event) CAuto::EventProcess(event); - 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_progress < 1.0f ) { diff --git a/src/object/auto/autojostle.h b/src/object/auto/autojostle.h index 70bb5e6..c156893 100644 --- a/src/object/auto/autojostle.h +++ b/src/object/auto/autojostle.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012 Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -42,7 +43,7 @@ protected: float m_force; float m_progress; float m_speed; - float m_lastParticule; + float m_lastParticle; Error m_error; }; diff --git a/src/object/auto/autokid.cpp b/src/object/auto/autokid.cpp index e5987cc..0ffbd7f 100644 --- a/src/object/auto/autokid.cpp +++ b/src/object/auto/autokid.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -19,8 +20,8 @@ #include "object/auto/autokid.h" -#include "old/particule.h" -#include "old/water.h" +#include "graphics/engine/particle.h" +#include "graphics/engine/water.h" @@ -62,18 +63,18 @@ void CAutoKid::Init() m_speed = 1.0f/1.0f; m_progress = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; if ( m_type == OBJECT_TEEN36 ) // trunk ? { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); m_speed = 1.0f/(1.0f+(Math::Mod(pos.x/10.0f-0.5f, 1.0f)*0.2f)); m_progress = Math::Mod(pos.x/10.0f, 1.0f); } if ( m_type == OBJECT_TEEN37 ) // boat? { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); m_speed = 1.0f/(1.0f+(Math::Mod(pos.x/10.0f-0.5f, 1.0f)*0.2f))*2.5f; m_progress = Math::Mod(pos.x/10.0f, 1.0f); } @@ -82,7 +83,7 @@ void CAutoKid::Init() { if ( m_soundChannel == -1 ) { -//? m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 1.0f, 0.5f, true); +//? m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 1.0f, 0.5f, true); m_bSilent = false; } } @@ -100,7 +101,7 @@ bool CAutoKid::EventProcess(const Event &event) if ( m_soundChannel != -1 ) { - if ( m_engine->RetPause() ) + if ( m_engine->GetPause() ) { if ( !m_bSilent ) { @@ -118,8 +119,8 @@ bool CAutoKid::EventProcess(const Event &event) } } - 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; m_progress += event.rTime*m_speed; @@ -135,12 +136,12 @@ bool CAutoKid::EventProcess(const Event &event) vib.z = sinf(m_progress*0.5f)*0.05f; m_object->SetCirVibration(vib); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.15f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.15f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); - pos.y = m_water->RetLevel()+1.0f; + pos = m_object->GetPosition(0); + pos.y = m_water->GetLevel()+1.0f; pos.x += (Math::Rand()-0.5f)*50.0f; pos.z += (Math::Rand()-0.5f)*50.0f; speed.y = 0.0f; @@ -148,7 +149,7 @@ bool CAutoKid::EventProcess(const Event &event) speed.z = 0.0f; dim.x = 50.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIFLIC, 3.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFLIC, 3.0f, 0.0f, 0.0f); } } @@ -164,12 +165,12 @@ bool CAutoKid::EventProcess(const Event &event) vib.z = sinf(m_progress*0.5f)*0.15f; m_object->SetCirVibration(vib); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.15f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.15f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); - pos.y = m_water->RetLevel()+1.0f; + pos = m_object->GetPosition(0); + pos.y = m_water->GetLevel()+1.0f; pos.x += (Math::Rand()-0.5f)*20.0f; pos.z += (Math::Rand()-0.5f)*20.0f; speed.y = 0.0f; @@ -177,7 +178,7 @@ bool CAutoKid::EventProcess(const Event &event) speed.z = 0.0f; dim.x = 20.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIFLIC, 3.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFLIC, 3.0f, 0.0f, 0.0f); } } @@ -191,9 +192,9 @@ bool CAutoKid::EventProcess(const Event &event) } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoKid::RetError() +Error CAutoKid::GetError() { return ERR_OK; } diff --git a/src/object/auto/autokid.h b/src/object/auto/autokid.h index 6d4258f..3e2fba7 100644 --- a/src/object/auto/autokid.h +++ b/src/object/auto/autokid.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -33,14 +34,14 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); protected: protected: float m_speed; float m_progress; - float m_lastParticule; + float m_lastParticle; int m_soundChannel; bool m_bSilent; }; diff --git a/src/object/auto/autolabo.cpp b/src/object/auto/autolabo.cpp index 270ec09..c5e4c82 100644 --- a/src/object/auto/autolabo.cpp +++ b/src/object/auto/autolabo.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -69,14 +70,14 @@ void CAutoLabo::DeleteObject(bool bAll) { if ( m_partiRank[i] != -1 ) { - m_particule->DeleteParticule(m_partiRank[i]); + m_particle->DeleteParticle(m_partiRank[i]); m_partiRank[i] = -1; } } if ( m_partiSphere != -1 ) { - m_particule->DeleteParticule(m_partiSphere); + m_particle->DeleteParticle(m_partiSphere); m_partiSphere = -1; } @@ -97,7 +98,7 @@ void CAutoLabo::Init() { m_time = 0.0f; m_timeVirus = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_phase = ALAP_WAIT; // waiting ... m_progress = 0.0f; @@ -119,23 +120,23 @@ bool CAutoLabo::EventProcess(const Event &event) CAuto::EventProcess(event); - if ( m_engine->RetPause() ) return true; + if ( m_engine->GetPause() ) return true; - if ( event.event == EVENT_UPDINTERFACE ) + if ( event.type == EVENT_UPDINTERFACE ) { - if ( m_object->RetSelect() ) CreateInterface(true); + if ( m_object->GetSelect() ) CreateInterface(true); } - if ( m_object->RetSelect() && // center selected? - (event.event == EVENT_OBJECT_RiPAW || - event.event == EVENT_OBJECT_RiGUN) ) + if ( m_object->GetSelect() && // center selected? + (event.type == EVENT_OBJECT_RiPAW || + event.type == EVENT_OBJECT_RiGUN) ) { if ( m_phase != ALAP_WAIT ) { return false; } - m_research = event.event; + m_research = event.type; if ( TestResearch(m_research) ) { @@ -143,13 +144,13 @@ bool CAutoLabo::EventProcess(const Event &event) return false; } - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power == 0 ) { m_displayText->DisplayError(ERR_LABO_NULL, m_object); return false; } - if ( power->RetType() != OBJECT_BULLET ) + if ( power->GetType() != OBJECT_BULLET ) { m_displayText->DisplayError(ERR_LABO_BAD, m_object); return false; @@ -168,12 +169,12 @@ bool CAutoLabo::EventProcess(const Event &event) return true; } - if ( event.event != EVENT_FRAME ) return true; + if ( event.type != EVENT_FRAME ) return true; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -247,31 +248,32 @@ bool CAutoLabo::EventProcess(const Event &event) { m_object->SetAngleZ(1, 0.0f); - goal = m_object->RetPosition(0); + goal = m_object->GetPosition(0); goal.y += 3.0f; pos = goal; pos.x -= 4.0f; pos.y += 4.0f; for ( i=0 ; i<3 ; i++ ) { - m_partiRank[i] = m_particule->CreateRay(pos, goal, - PARTIRAY2, + m_partiRank[i] = m_particle->CreateRay(pos, goal, + Gfx::PARTIRAY2, Math::Point(2.9f, 2.9f), LABO_DELAY); } - m_soundChannel = m_sound->Play(SOUND_LABO, m_object->RetPosition(0), 0.0f, 0.25f, true); + m_soundChannel = m_sound->Play(SOUND_LABO, m_object->GetPosition(0), 0.0f, 0.25f, true); m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.60f, 2.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 1.0f, 2.00f, 8.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.60f, 8.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.25f, 2.0f, SOPER_STOP); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 4.0f; speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 4.0f; dim.y = dim.x; - m_partiSphere = m_particule->CreateParticule(pos, speed, dim, PARTISPHERE2, LABO_DELAY, 0.0f, 0.0f); + m_partiSphere = m_particle->CreateParticle(pos, speed, + dim, Gfx::PARTISPHERE2, LABO_DELAY, 0.0f, 0.0f); m_phase = ALAP_ANALYSE; m_progress = 0.0f; @@ -283,13 +285,13 @@ bool CAutoLabo::EventProcess(const Event &event) { if ( m_progress < 1.0f ) { - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power != 0 ) { power->SetZoom(0, 1.0f-m_progress); } - angle = m_object->RetAngleY(2); + angle = m_object->GetAngleY(2); if ( m_progress < 0.5f ) { angle -= event.rTime*m_progress*20.0f; @@ -300,27 +302,27 @@ bool CAutoLabo::EventProcess(const Event &event) } m_object->SetAngleY(2, angle); // rotates the analyzer - angle += m_object->RetAngleY(0); + angle += m_object->GetAngleY(0); for ( i=0 ; i<3 ; i++ ) { rot = Math::RotatePoint(-angle, -4.0f); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += rot.x; pos.z += rot.y; pos.y += 3.0f+4.0f;; - m_particule->SetPosition(m_partiRank[i], pos); // adjusts ray + m_particle->SetPosition(m_partiRank[i], pos); // adjusts ray angle += Math::PI*2.0f/3.0f; } - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; if ( m_progress > 0.25f && m_progress < 0.80f ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 3.0f; pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f; @@ -329,7 +331,7 @@ bool CAutoLabo::EventProcess(const Event &event) speed.z = (Math::Rand()-0.5f)*10.0f; dim.x = Math::Rand()*0.4f*m_progress+1.0f; dim.y = dim.x; - m_particule->CreateTrack(pos, speed, dim, PARTITRACK2, + m_particle->CreateTrack(pos, speed, dim, Gfx::PARTITRACK2, 2.0f+2.0f*m_progress, 10.0f, 1.5f, 1.4f); } } @@ -338,7 +340,7 @@ bool CAutoLabo::EventProcess(const Event &event) { SetResearch(m_research); // research done - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power != 0 ) { m_object->SetPower(0); @@ -421,21 +423,21 @@ bool CAutoLabo::EventProcess(const Event &event) } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoLabo::RetError() +Error CAutoLabo::GetError() { CObject* pObj; ObjectType type; - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } - pObj = m_object->RetPower(); + pObj = m_object->GetPower(); if ( pObj == 0 ) return ERR_LABO_NULL; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_BULLET ) return ERR_LABO_BAD; return ERR_OK; @@ -446,7 +448,7 @@ Error CAutoLabo::RetError() bool CAutoLabo::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, dim, ddim; float ox, oy, sx, sy; @@ -454,7 +456,7 @@ bool CAutoLabo::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; dim.x = 33.0f/640.0f; @@ -487,13 +489,13 @@ bool CAutoLabo::CreateInterface(bool bSelect) void CAutoLabo::UpdateInterface() { - CWindow* pw; + Ui::CWindow* pw; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; CAuto::UpdateInterface(); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return; DeadInterface(pw, EVENT_OBJECT_RiPAW, g_researchEnable&RESEARCH_iPAW); @@ -508,20 +510,20 @@ void CAutoLabo::UpdateInterface() // Indicates the research conducted for a button. -void CAutoLabo::OkayButton(CWindow *pw, EventMsg event) +void CAutoLabo::OkayButton(Ui::CWindow *pw, EventType event) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); if ( control == 0 ) return; - control->SetState(STATE_OKAY, TestResearch(event)); + control->SetState(Ui::STATE_OKAY, TestResearch(event)); } // Test whether a search has already been done. -bool CAutoLabo::TestResearch(EventMsg event) +bool CAutoLabo::TestResearch(EventType event) { if ( event == EVENT_OBJECT_RiPAW ) return (g_researchDone & RESEARCH_iPAW); if ( event == EVENT_OBJECT_RiGUN ) return (g_researchDone & RESEARCH_iGUN); @@ -531,16 +533,17 @@ bool CAutoLabo::TestResearch(EventMsg event) // Indicates a search as made. -void CAutoLabo::SetResearch(EventMsg event) +void CAutoLabo::SetResearch(EventType event) { - Event newEvent; + if ( event == EVENT_OBJECT_RiPAW ) g_researchDone |= RESEARCH_iPAW; if ( event == EVENT_OBJECT_RiGUN ) g_researchDone |= RESEARCH_iGUN; m_main->WriteFreeParam(); - m_event->MakeEvent(newEvent, EVENT_UPDINTERFACE); + Event newEvent(EVENT_UPDINTERFACE); +// m_event->MakeEvent(newEvent, EVENT_UPDINTERFACE); m_event->AddEvent(newEvent); UpdateInterface(); } @@ -551,7 +554,7 @@ void CAutoLabo::SoundManip(float time, float amplitude, float frequency) { int i; - i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.3f*frequency, true); + i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f*frequency, true); m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, 0.1f, SOPER_CONTINUE); m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, time-0.1f, SOPER_CONTINUE); m_sound->AddEnvelope(i, 0.0f, 0.3f*frequency, 0.1f, SOPER_STOP); @@ -597,12 +600,12 @@ bool CAutoLabo::Read(char *line) CAuto::Read(line); - m_phase = (AutoLaboPhase)OpInt(line, "aPhase", ALAP_WAIT); + m_phase = static_cast< AutoLaboPhase >(OpInt(line, "aPhase", ALAP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_research = (EventMsg)OpInt(line, "aResearch", 0); + m_research = static_cast< EventType >(OpInt(line, "aResearch", 0)); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autolabo.h b/src/object/auto/autolabo.h index 244e633..8225462 100644 --- a/src/object/auto/autolabo.h +++ b/src/object/auto/autolabo.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -47,7 +48,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -56,9 +57,9 @@ public: protected: void UpdateInterface(); - void OkayButton(CWindow *pw, EventMsg event); - bool TestResearch(EventMsg event); - void SetResearch(EventMsg event); + void OkayButton(Ui::CWindow *pw, EventType event); + bool TestResearch(EventType event); + void SetResearch(EventType event); void SoundManip(float time, float amplitude, float frequency); protected: @@ -66,8 +67,8 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; - EventMsg m_research; + float m_lastParticle; + EventType m_research; int m_partiRank[3]; int m_partiSphere; int m_soundChannel; diff --git a/src/object/auto/automush.cpp b/src/object/auto/automush.cpp index c3eaaaf..0b1608b 100644 --- a/src/object/auto/automush.cpp +++ b/src/object/auto/automush.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -57,7 +58,7 @@ void CAutoMush::Init() m_speed = 1.0f/4.0f; m_time = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; } @@ -72,8 +73,8 @@ bool CAutoMush::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; @@ -122,7 +123,7 @@ bool CAutoMush::EventProcess(const Event &event) } else { - m_sound->Play(SOUND_MUSHROOM, m_object->RetPosition(0)); + m_sound->Play(SOUND_MUSHROOM, m_object->GetPosition(0)); m_phase = AMP_FIRE; m_progress = 0.0f; @@ -137,21 +138,21 @@ bool CAutoMush::EventProcess(const Event &event) factor = 1.0f-m_progress; size = 1.0f+(1.0f-m_progress)*0.3f; - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; for ( i=0 ; i<10 ; i++ ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 5.0f; speed.x = (Math::Rand()-0.5f)*200.0f; speed.z = (Math::Rand()-0.5f)*200.0f; speed.y = -(20.0f+Math::Rand()*20.0f); dim.x = 1.0f; dim.y = dim.x; - channel = m_particule->CreateParticule(pos, speed, dim, PARTIGUN2, 2.0f, 100.0f, 0.0f); - m_particule->SetObjectFather(channel, m_object); + channel = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGUN2, 2.0f, 100.0f, 0.0f); + m_particle->SetObjectFather(channel, m_object); } } } @@ -167,18 +168,18 @@ bool CAutoMush::EventProcess(const Event &event) { if ( m_progress < 1.0f ) { - if ( m_lastParticule+m_engine->ParticuleAdapt(0.10f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.10f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 5.0f; speed.x = (Math::Rand()-0.5f)*4.0f; speed.z = (Math::Rand()-0.5f)*4.0f; speed.y = -(0.5f+Math::Rand()*0.5f); dim.x = Math::Rand()*2.5f+2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISMOKE3, 4.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE3, 4.0f, 0.0f, 0.0f); } } else @@ -226,16 +227,16 @@ bool CAutoMush::SearchTarget() float dist; int i; - iPos = m_object->RetPosition(0); + iPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - if ( pObj->RetLock() ) continue; + if ( pObj->GetLock() ) continue; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_MOBILEfa && type != OBJECT_MOBILEta && type != OBJECT_MOBILEwa && @@ -279,7 +280,7 @@ bool CAutoMush::SearchTarget() type != OBJECT_PARA && type != OBJECT_HUMAN ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, iPos); if ( dist < 50.0f ) return true; } @@ -288,9 +289,9 @@ bool CAutoMush::SearchTarget() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoMush::RetError() +Error CAutoMush::GetError() { return ERR_OK; } @@ -332,11 +333,11 @@ bool CAutoMush::Read(char *line) CAuto::Read(line); - m_phase = (AutoMushPhase)OpInt(line, "aPhase", AMP_WAIT); + m_phase = static_cast< AutoMushPhase >(OpInt(line, "aPhase", AMP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/automush.h b/src/object/auto/automush.h index 113d22f..245393a 100644 --- a/src/object/auto/automush.h +++ b/src/object/auto/automush.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool Write(char *line); bool Read(char *line); @@ -56,6 +57,6 @@ protected: AutoMushPhase m_phase; float m_progress; float m_speed; - float m_lastParticule; + float m_lastParticle; }; diff --git a/src/object/auto/autonest.cpp b/src/object/auto/autonest.cpp index f3c70fb..9658e23 100644 --- a/src/object/auto/autonest.cpp +++ b/src/object/auto/autonest.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ #include "object/auto/autonest.h" #include "common/iman.h" -#include "old/terrain.h" +#include "graphics/engine/terrain.h" #include "script/cmdtoken.h" @@ -72,9 +73,9 @@ void CAutoNest::Init() m_speed = 1.0f/4.0f; m_time = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); m_terrain->MoveOnFloor(pos); m_fretPos = pos; } @@ -88,8 +89,8 @@ bool CAutoNest::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; @@ -154,10 +155,10 @@ bool CAutoNest::SearchFree(Math::Vector pos) for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type == OBJECT_NEST ) continue; j = 0; @@ -199,15 +200,15 @@ CObject* CAutoNest::SearchFret() for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - if ( !pObj->RetLock() ) continue; + if ( !pObj->GetLock() ) continue; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_BULLET ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); if ( oPos.x == m_fretPos.x && oPos.z == m_fretPos.z ) { @@ -219,9 +220,9 @@ CObject* CAutoNest::SearchFret() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoNest::RetError() +Error CAutoNest::GetError() { return ERR_OK; } @@ -263,11 +264,11 @@ bool CAutoNest::Read(char *line) CAuto::Read(line); - m_phase = (AutoNestPhase)OpInt(line, "aPhase", ANP_WAIT); + m_phase = static_cast< AutoNestPhase >(OpInt(line, "aPhase", ANP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autonest.h b/src/object/auto/autonest.h index 612551d..1009457 100644 --- a/src/object/auto/autonest.h +++ b/src/object/auto/autonest.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -41,7 +42,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool Write(char *line); bool Read(char *line); @@ -55,7 +56,7 @@ protected: AutoNestPhase m_phase; float m_progress; float m_speed; - float m_lastParticule; - Math::Vector m_fretPos; + float m_lastParticle; + Math::Vector m_fretPos; }; diff --git a/src/object/auto/autonuclear.cpp b/src/object/auto/autonuclear.cpp index 05f0b29..d8a3bdf 100644 --- a/src/object/auto/autonuclear.cpp +++ b/src/object/auto/autonuclear.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -84,9 +85,9 @@ void CAutoNuclear::Init() m_time = 0.0f; m_timeVirus = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); m_pos = Math::Transform(*mat, Math::Vector(22.0f, 4.0f, 0.0f)); m_phase = ANUP_WAIT; // waiting ... @@ -110,13 +111,13 @@ bool CAutoNuclear::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -146,7 +147,7 @@ bool CAutoNuclear::EventProcess(const Event &event) InitProgressTotal(1.5f+NUCLEAR_DELAY+1.5f); UpdateInterface(); - m_sound->Play(SOUND_OPEN, m_object->RetPosition(0), 1.0f, 1.4f); + m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.4f); m_phase = ANUP_CLOSE; m_progress = 0.0f; @@ -166,8 +167,8 @@ bool CAutoNuclear::EventProcess(const Event &event) { m_object->SetAngleZ(1, 0.0f); - mat = m_object->RetWorldMatrix(0); - max = (int)(10.0f*m_engine->RetParticuleDensity()); + mat = m_object->GetWorldMatrix(0); + max = static_cast< int >(10.0f*m_engine->GetParticleDensity()); for ( i=0 ; i<max ; i++ ) { pos.x = 27.0f; @@ -179,12 +180,12 @@ bool CAutoNuclear::EventProcess(const Event &event) speed.z = 0.0f; dim.x = Math::Rand()*1.0f+1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTICRASH); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH); } - m_sound->Play(SOUND_CLOSE, m_object->RetPosition(0), 1.0f, 1.0f); + m_sound->Play(SOUND_CLOSE, m_object->GetPosition(0), 1.0f, 1.0f); - m_channelSound = m_sound->Play(SOUND_NUCLEAR, m_object->RetPosition(0), 1.0f, 0.1f, true); + m_channelSound = m_sound->Play(SOUND_NUCLEAR, m_object->GetPosition(0), 1.0f, 0.1f, true); m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, NUCLEAR_DELAY-1.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_channelSound, 0.0f, 1.0f, 2.0f, SOPER_STOP); @@ -198,11 +199,11 @@ bool CAutoNuclear::EventProcess(const Event &event) { if ( m_progress < 1.0f ) { - if ( m_lastParticule+m_engine->ParticuleAdapt(0.10f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.10f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 30.0f; pos.x += (Math::Rand()-0.5f)*6.0f; pos.z += (Math::Rand()-0.5f)*6.0f; @@ -211,7 +212,7 @@ bool CAutoNuclear::EventProcess(const Event &event) speed.z = 0.0f; dim.x = Math::Rand()*8.0f+8.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTICRASH); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH); pos = m_pos; speed.x = (Math::Rand()-0.5f)*20.0f; @@ -219,7 +220,7 @@ bool CAutoNuclear::EventProcess(const Event &event) speed.z = (Math::Rand()-0.5f)*20.0f; dim.x = 2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBLITZ, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLITZ, 1.0f, 0.0f, 0.0f); } } else @@ -234,7 +235,7 @@ bool CAutoNuclear::EventProcess(const Event &event) CreatePower(); // creates the atomic cell - max = (int)(20.0f*m_engine->RetParticuleDensity()); + max = static_cast< int >(20.0f*m_engine->GetParticleDensity()); for ( i=0 ; i<max ; i++ ) { pos = m_pos; @@ -246,10 +247,10 @@ bool CAutoNuclear::EventProcess(const Event &event) speed.z = 0.0f; dim.x = Math::Rand()*2.0f+2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBLUE, Math::Rand()*5.0f+5.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLUE, Math::Rand()*5.0f+5.0f, 0.0f, 0.0f); } - m_sound->Play(SOUND_OPEN, m_object->RetPosition(0), 1.0f, 1.4f); + m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.4f); m_phase = ANUP_OPEN; m_progress = 0.0f; @@ -287,7 +288,7 @@ bool CAutoNuclear::EventProcess(const Event &event) bool CAutoNuclear::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -295,7 +296,7 @@ bool CAutoNuclear::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -319,9 +320,9 @@ CObject* CAutoNuclear::SearchUranium() { CObject* pObj; - pObj = m_object->RetPower(); + pObj = m_object->GetPower(); if ( pObj == 0 ) return 0; - if ( pObj->RetType() == OBJECT_URANIUM ) return pObj; + if ( pObj->GetType() == OBJECT_URANIUM ) return pObj; return 0; } @@ -337,10 +338,10 @@ bool CAutoNuclear::SearchVehicle() for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_HUMAN && type != OBJECT_MOBILEfa && type != OBJECT_MOBILEta && @@ -392,8 +393,8 @@ void CAutoNuclear::CreatePower() Math::Vector pos; float angle; - pos = m_object->RetPosition(0); - angle = m_object->RetAngleY(0); + pos = m_object->GetPosition(0); + angle = m_object->GetAngleY(0); power = new CObject(m_iMan); if ( !power->CreateResource(pos, angle, OBJECT_ATOMIC) ) @@ -409,28 +410,28 @@ void CAutoNuclear::CreatePower() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoNuclear::RetError() +Error CAutoNuclear::GetError() { CObject* pObj; ObjectType type; //? TerrainRes res; - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } -//? res = m_terrain->RetResource(m_object->RetPosition(0)); +//? res = m_terrain->GetResource(m_object->GetPosition(0)); //? if ( res != TR_POWER ) return ERR_NUCLEAR_NULL; -//? if ( m_object->RetEnergy() < ENERGY_POWER ) return ERR_NUCLEAR_LOW; +//? if ( m_object->GetEnergy() < ENERGY_POWER ) return ERR_NUCLEAR_LOW; - pObj = m_object->RetPower(); + pObj = m_object->GetPower(); if ( pObj == 0 ) return ERR_NUCLEAR_EMPTY; - if ( pObj->RetLock() ) return ERR_OK; - type = pObj->RetType(); + if ( pObj->GetLock() ) return ERR_OK; + type = pObj->GetType(); if ( type == OBJECT_ATOMIC ) return ERR_OK; if ( type != OBJECT_URANIUM ) return ERR_NUCLEAR_BAD; @@ -472,11 +473,11 @@ bool CAutoNuclear::Read(char *line) CAuto::Read(line); - m_phase = (AutoNuclearPhase)OpInt(line, "aPhase", ANUP_WAIT); + m_phase = static_cast< AutoNuclearPhase >(OpInt(line, "aPhase", ANUP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autonuclear.h b/src/object/auto/autonuclear.h index 8a4b0da..06a99af 100644 --- a/src/object/auto/autonuclear.h +++ b/src/object/auto/autonuclear.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -61,7 +62,7 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; Math::Vector m_pos; int m_channelSound; }; diff --git a/src/object/auto/autopara.cpp b/src/object/auto/autopara.cpp index 80ce90a..973a847 100644 --- a/src/object/auto/autopara.cpp +++ b/src/object/auto/autopara.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -68,9 +69,9 @@ void CAutoPara::Init() m_time = 0.0f; m_timeVirus = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); m_pos = Math::Transform(*mat, Math::Vector(22.0f, 4.0f, 0.0f)); m_phase = APAP_WAIT; // waiting ... @@ -83,9 +84,9 @@ void CAutoPara::Init() // Reception of lightning. -void CAutoPara::StartBlitz() +void CAutoPara::StartLightning() { - m_phase = APAP_BLITZ; + m_phase = APAP_LIGHTNING; m_progress = 0.0f; m_speed = 1.0f/2.0f; } @@ -101,13 +102,13 @@ bool CAutoPara::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -118,17 +119,17 @@ bool CAutoPara::EventProcess(const Event &event) EventProgress(event.rTime); - if ( m_phase == APAP_BLITZ ) + if ( m_phase == APAP_LIGHTNING ) { if ( m_progress < 1.0f ) { - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; for ( i=0 ; i<10 ; i++ ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += (Math::Rand()-0.5f)*m_progress*40.0f; pos.z += (Math::Rand()-0.5f)*m_progress*40.0f; pos.y += 50.0f-m_progress*50.0f; @@ -137,7 +138,7 @@ bool CAutoPara::EventProcess(const Event &event) speed.y = 5.0f+Math::Rand()*5.0f; dim.x = 2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBLITZ, 1.0f, 20.0f, 0.5f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLITZ, 1.0f, 20.0f, 0.5f); } } } @@ -153,20 +154,20 @@ bool CAutoPara::EventProcess(const Event &event) { if ( m_progress < 1.0f ) { - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; for ( i=0 ; i<2 ; i++ ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 16.0f; speed.x = (Math::Rand()-0.5f)*10.0f; speed.z = (Math::Rand()-0.5f)*10.0f; speed.y = -Math::Rand()*30.0f; dim.x = 1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBLITZ, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLITZ, 1.0f, 0.0f, 0.0f); } } @@ -188,7 +189,7 @@ bool CAutoPara::EventProcess(const Event &event) bool CAutoPara::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -196,7 +197,7 @@ bool CAutoPara::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -220,11 +221,11 @@ bool CAutoPara::CreateInterface(bool bSelect) } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoPara::RetError() +Error CAutoPara::GetError() { - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } @@ -242,38 +243,38 @@ void CAutoPara::ChargeObject(float rTime) float dist, energy; int i; - sPos = m_object->RetPosition(0); + sPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, sPos); if ( dist > 20.0f ) continue; - if ( pObj->RetTruck() == 0 && pObj->RetType() == OBJECT_POWER ) + if ( pObj->GetTruck() == 0 && pObj->GetType() == OBJECT_POWER ) { - energy = pObj->RetEnergy(); + energy = pObj->GetEnergy(); energy += rTime/2.0f; if ( energy > 1.0f ) energy = 1.0f; pObj->SetEnergy(energy); } - power = pObj->RetPower(); - if ( power != 0 && power->RetType() == OBJECT_POWER ) + power = pObj->GetPower(); + if ( power != 0 && power->GetType() == OBJECT_POWER ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); energy += rTime/2.0f; if ( energy > 1.0f ) energy = 1.0f; power->SetEnergy(energy); } - power = pObj->RetFret(); - if ( power != 0 && power->RetType() == OBJECT_POWER ) + power = pObj->GetFret(); + if ( power != 0 && power->GetType() == OBJECT_POWER ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); energy += rTime/2.0f; if ( energy > 1.0f ) energy = 1.0f; power->SetEnergy(energy); @@ -315,11 +316,11 @@ bool CAutoPara::Read(char *line) CAuto::Read(line); - m_phase = (AutoParaPhase)OpInt(line, "aPhase", APAP_WAIT); + m_phase = static_cast< AutoParaPhase >(OpInt(line, "aPhase", APAP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autopara.h b/src/object/auto/autopara.h index b230fd2..10a33a8 100644 --- a/src/object/auto/autopara.h +++ b/src/object/auto/autopara.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -26,7 +27,7 @@ enum AutoParaPhase { APAP_WAIT = 1, - APAP_BLITZ = 2, + APAP_LIGHTNING = 2, APAP_CHARGE = 3, }; @@ -42,8 +43,8 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); - void StartBlitz(); + Error GetError(); + void StartLightning(); bool CreateInterface(bool bSelect); @@ -58,7 +59,7 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; Math::Vector m_pos; int m_channelSound; }; diff --git a/src/object/auto/autoportico.cpp b/src/object/auto/autoportico.cpp index 5665556..3d93411 100644 --- a/src/object/auto/autoportico.cpp +++ b/src/object/auto/autoportico.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -90,7 +91,7 @@ void CAutoPortico::DeleteObject(bool bAll) void CAutoPortico::Init() { m_time = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_posTrack = 0.0f; m_phase = APOP_WAIT; @@ -108,7 +109,7 @@ void CAutoPortico::Start(int param) { Math::Vector pos; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); m_finalPos = pos; pos.z += PORTICO_TIME_MOVE*5.0f; // back to start m_object->SetPosition(0, pos); @@ -140,15 +141,15 @@ bool CAutoPortico::EventProcess(const Event &event) CAuto::EventProcess(event); - if ( m_engine->RetPause() ) return true; + if ( m_engine->GetPause() ) return true; if ( m_phase == APOP_START ) { if ( m_param == PARAM_DEPOSE ) // deposits the ship? { - m_startPos = m_object->RetPosition(0); + m_startPos = m_object->GetPosition(0); - m_soundChannel = m_sound->Play(SOUND_MOTORr, m_object->RetPosition(0), 0.0f, 0.3f, true); + m_soundChannel = m_sound->Play(SOUND_MOTORr, m_object->GetPosition(0), 0.0f, 0.3f, true); m_sound->AddEnvelope(m_soundChannel, 0.5f, 0.6f, 0.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.5f, 0.6f, PORTICO_TIME_MOVE-0.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.3f, 0.5f, SOPER_STOP); @@ -159,7 +160,7 @@ bool CAutoPortico::EventProcess(const Event &event) m_main->SetMovieLock(true); // blocks everything until the end of the landing - m_camera->SetType(CAMERA_SCRIPT); + m_camera->SetType(Gfx::CAM_TYPE_SCRIPT); pos = m_startPos; pos.x += -100.0f; @@ -167,7 +168,7 @@ bool CAutoPortico::EventProcess(const Event &event) pos.z += -200.0f; m_camera->SetScriptEye(pos); - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += 0.0f; pos.y += 10.0f; pos.z += -40.0f; @@ -187,7 +188,7 @@ bool CAutoPortico::EventProcess(const Event &event) angle = sinf(m_time*4.0f)*0.3f; m_object->SetAngleX(11, angle); - if ( event.event != EVENT_FRAME ) return true; + if ( event.type != EVENT_FRAME ) return true; if ( m_phase == APOP_WAIT ) return true; m_progress += event.rTime*m_speed; @@ -197,7 +198,7 @@ bool CAutoPortico::EventProcess(const Event &event) { if ( m_progress < 1.0f ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.z -= event.rTime*5.0f; // advance m_object->SetPosition(0, pos); @@ -216,7 +217,7 @@ bool CAutoPortico::EventProcess(const Event &event) { if ( m_progress >= 1.0f ) { - m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.3f, true); + m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f, true); m_sound->AddEnvelope(m_soundChannel, 0.3f, 0.5f, 1.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.3f, 0.6f, PORTICO_TIME_DOWN-1.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.3f, 1.0f, SOPER_STOP); @@ -253,12 +254,12 @@ bool CAutoPortico::EventProcess(const Event &event) { if ( m_progress >= 1.0f ) { - m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.5f, true); + m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.5f, true); m_sound->AddEnvelope(m_soundChannel, 0.5f, 1.0f, 0.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.5f, 1.0f, PORTICO_TIME_OPEN/2.0f-0.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 0.5f, SOPER_STOP); - m_soundChannel = m_sound->Play(SOUND_MOTORr, m_object->RetPosition(0), 0.0f, 0.3f, true); + m_soundChannel = m_sound->Play(SOUND_MOTORr, m_object->GetPosition(0), 0.0f, 0.3f, true); m_sound->AddEnvelope(m_soundChannel, 0.5f, 0.6f, 0.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.5f, 0.6f, PORTICO_TIME_OPEN-0.5f, SOPER_CONTINUE); m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.3f, 0.5f, SOPER_STOP); @@ -273,7 +274,7 @@ bool CAutoPortico::EventProcess(const Event &event) { if ( m_progress < 1.0f ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.z += event.rTime*5.3f; // back m_object->SetPosition(0, pos); @@ -309,7 +310,7 @@ bool CAutoPortico::EventProcess(const Event &event) pObj = m_main->SearchHuman(); m_main->SelectObject(pObj); m_camera->SetObject(pObj); - m_camera->SetType(CAMERA_BACK); + m_camera->SetType(Gfx::CAM_TYPE_BACK); m_phase = APOP_WAIT; m_progress = 0.0f; @@ -319,8 +320,8 @@ bool CAutoPortico::EventProcess(const Event &event) if ( m_soundChannel != -1 ) { -//? m_sound->Position(m_soundChannel, m_object->RetPosition(0)); - pos = m_engine->RetEyePt(); +//? m_sound->Position(m_soundChannel, m_object->GetPosition(0)); + pos = m_engine->GetEyePt(); m_sound->Position(m_soundChannel, pos); } @@ -338,7 +339,7 @@ bool CAutoPortico::EventProcess(const Event &event) m_camera->SetScriptEye(pos); } - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += 0.0f; pos.y += 10.0f; pos.z += -40.0f; @@ -368,7 +369,7 @@ bool CAutoPortico::Abort() pObj = m_main->SearchHuman(); m_main->SelectObject(pObj); m_camera->SetObject(pObj); - m_camera->SetType(CAMERA_BACK); + m_camera->SetType(Gfx::CAM_TYPE_BACK); if ( m_soundChannel != -1 ) { @@ -385,9 +386,9 @@ bool CAutoPortico::Abort() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoPortico::RetError() +Error CAutoPortico::GetError() { return ERR_OK; } @@ -397,11 +398,11 @@ Error CAutoPortico::RetError() void CAutoPortico::UpdateTrackMapping(float left, float right) { - D3DMATERIAL7 mat; + Gfx::Material mat; float limit[2]; int rank; - ZeroMemory( &mat, sizeof(D3DMATERIAL7) ); + memset( &mat, 0, sizeof(Gfx::Material)); mat.diffuse.r = 1.0f; mat.diffuse.g = 1.0f; mat.diffuse.b = 1.0f; // blank @@ -409,17 +410,17 @@ void CAutoPortico::UpdateTrackMapping(float left, float right) mat.ambient.g = 0.5f; mat.ambient.b = 0.5f; - rank = m_object->RetObjectRank(0); + rank = m_object->GetObjectRank(0); limit[0] = 0.0f; limit[1] = 1000000.0f; - m_engine->TrackTextureMapping(rank, mat, D3DSTATEPART1, "lemt.tga", "", - limit[0], limit[1], D3DMAPPINGX, + m_engine->TrackTextureMapping(rank, mat, Gfx::ENG_RSTATE_PART1, "lemt.tga", "", + limit[0], limit[1], Gfx::ENG_TEX_MAPPING_X, right, 8.0f, 8.0f, 192.0f, 256.0f); - m_engine->TrackTextureMapping(rank, mat, D3DSTATEPART2, "lemt.tga", "", - limit[0], limit[1], D3DMAPPINGX, + m_engine->TrackTextureMapping(rank, mat, Gfx::ENG_RSTATE_PART2, "lemt.tga", "", + limit[0], limit[1], Gfx::ENG_TEX_MAPPING_X, left, 8.0f, 8.0f, 192.0f, 256.0f); } diff --git a/src/object/auto/autoportico.h b/src/object/auto/autoportico.h index f2cd6d1..c211d37 100644 --- a/src/object/auto/autoportico.h +++ b/src/object/auto/autoportico.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -48,7 +49,7 @@ public: void Start(int param); bool EventProcess(const Event &event); bool Abort(); - Error RetError(); + Error GetError(); protected: void UpdateTrackMapping(float left, float right); @@ -59,7 +60,7 @@ protected: float m_speed; float m_cameraProgress; float m_cameraSpeed; - float m_lastParticule; + float m_lastParticle; Math::Vector m_finalPos; Math::Vector m_startPos; float m_posTrack; diff --git a/src/object/auto/autoradar.cpp b/src/object/auto/autoradar.cpp index 1cb20d6..224246c 100644 --- a/src/object/auto/autoradar.cpp +++ b/src/object/auto/autoradar.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -74,31 +75,31 @@ bool CAutoRadar::EventProcess(const Event &event) CAuto::EventProcess(event); - 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_phase == ARAP_WAIT ) return true; m_progress += event.rTime*m_speed; m_aTime += event.rTime; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { m_timeVirus = 0.1f+Math::Rand()*0.3f; - angle = m_object->RetAngleY(1); + angle = m_object->GetAngleY(1); angle += (Math::Rand()-0.2f)*0.5f; m_object->SetAngleY(1, angle); - angle = m_object->RetAngleY(2); + angle = m_object->GetAngleY(2); angle += (Math::Rand()-0.8f)*1.0f; m_object->SetAngleY(2, angle); m_object->SetAngleX(3, (Math::Rand()-0.5f)*0.3f); - m_totalDetect = (int)(Math::Rand()*10.0f); + m_totalDetect = static_cast< int >(Math::Rand()*10.0f); UpdateInterface(); } return true; @@ -109,7 +110,7 @@ bool CAutoRadar::EventProcess(const Event &event) if ( m_progress < 1.0f ) { speed = Math::Min(10.0f, m_progress*50.0f); - angle = m_object->RetAngleY(1); + angle = m_object->GetAngleY(1); angle += event.rTime*speed; m_object->SetAngleY(1, angle); } @@ -123,11 +124,11 @@ bool CAutoRadar::EventProcess(const Event &event) } else { - pos = m_object->RetPosition(0); - m_start = m_object->RetAngleY(1); + pos = m_object->GetPosition(0); + m_start = m_object->GetAngleY(1); m_angle = m_start-Math::NormAngle(m_start)+Math::PI*2.0f; m_angle += Math::RotateAngle(pos.x-ePos.x, ePos.z-pos.z); - m_angle += Math::PI-m_object->RetAngleY(0); + m_angle += Math::PI-m_object->GetAngleY(0); m_phase = ARAP_SHOW; m_progress = 0.0f; @@ -145,7 +146,7 @@ bool CAutoRadar::EventProcess(const Event &event) } else { - m_sound->Play(SOUND_RADAR, m_object->RetPosition(0)); + m_sound->Play(SOUND_RADAR, m_object->GetPosition(0)); m_phase = ARAP_SINUS; m_progress = 0.0f; @@ -182,11 +183,11 @@ bool CAutoRadar::EventProcess(const Event &event) } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoRadar::RetError() +Error CAutoRadar::GetError() { - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } @@ -199,7 +200,7 @@ Error CAutoRadar::RetError() bool CAutoRadar::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, dim, ddim; float ox, oy, sx, sy; @@ -207,7 +208,7 @@ bool CAutoRadar::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -235,21 +236,21 @@ bool CAutoRadar::CreateInterface(bool bSelect) void CAutoRadar::UpdateInterface() { - CWindow* pw; - CGauge* pg; + Ui::CWindow* pw; + Ui::CGauge* pg; float level; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; CAuto::UpdateInterface(); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return; - pg = (CGauge*)pw->SearchControl(EVENT_OBJECT_GRADAR); + pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GRADAR)); if ( pg != 0 ) { - level = (float)m_totalDetect*(1.0f/8.0f); + level = static_cast< float >(m_totalDetect*(1.0f/8.0f)); if ( level > 1.0f ) level = 1.0f; pg->SetLevel(level); } @@ -267,18 +268,18 @@ bool CAutoRadar::SearchEnemy(Math::Vector &pos) float distance, min; int i; - iPos = m_object->RetPosition(0); + iPos = m_object->GetPosition(0); min = 1000000.0f; m_totalDetect = 0; for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - if ( !pObj->RetActif() ) continue; + if ( !pObj->GetActif() ) continue; - oType = pObj->RetType(); + oType = pObj->GetType(); if ( oType != OBJECT_ANT && oType != OBJECT_SPIDER && oType != OBJECT_BEE && @@ -287,7 +288,7 @@ bool CAutoRadar::SearchEnemy(Math::Vector &pos) m_totalDetect ++; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); distance = Math::Distance(oPos, iPos); if ( distance < min ) { @@ -299,7 +300,7 @@ bool CAutoRadar::SearchEnemy(Math::Vector &pos) UpdateInterface(); if ( pBest == 0 ) return false; - pos = pBest->RetPosition(0); + pos = pBest->GetPosition(0); return true; } diff --git a/src/object/auto/autoradar.h b/src/object/auto/autoradar.h index 8b38ff9..e2c9df5 100644 --- a/src/object/auto/autoradar.h +++ b/src/object/auto/autoradar.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); bool EventProcess(const Event &event); bool CreateInterface(bool bSelect); - Error RetError(); + Error GetError(); protected: void UpdateInterface(); @@ -56,7 +57,7 @@ protected: float m_speed; float m_aTime; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; float m_angle; float m_start; int m_totalDetect; diff --git a/src/object/auto/autorepair.cpp b/src/object/auto/autorepair.cpp index ad5deee..2f679fa 100644 --- a/src/object/auto/autorepair.cpp +++ b/src/object/auto/autorepair.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -60,7 +61,7 @@ void CAutoRepair::Init() m_time = 0.0f; m_timeVirus = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; CAuto::Init(); } @@ -77,13 +78,13 @@ bool CAutoRepair::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -104,7 +105,7 @@ bool CAutoRepair::EventProcess(const Event &event) } else { - m_sound->Play(SOUND_OPEN, m_object->RetPosition(0), 1.0f, 0.8f); + m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 0.8f); m_phase = ARP_DOWN; m_progress = 0.0f; @@ -123,7 +124,7 @@ bool CAutoRepair::EventProcess(const Event &event) else { m_object->SetAngleZ(1, 0.0f); - m_sound->Play(SOUND_REPAIR, m_object->RetPosition(0)); + m_sound->Play(SOUND_REPAIR, m_object->GetPosition(0)); m_phase = ARP_REPAIR; m_progress = 0.0f; @@ -135,21 +136,21 @@ bool CAutoRepair::EventProcess(const Event &event) { vehicule = SearchVehicle(); if ( m_progress < 1.0f || - (vehicule != 0 && vehicule->RetShield() < 1.0f) ) + (vehicule != 0 && vehicule->GetShield() < 1.0f) ) { if ( vehicule != 0 ) { - shield = vehicule->RetShield(); + shield = vehicule->GetShield(); shield += event.rTime*0.2f; if ( shield > 1.0f ) shield = 1.0f; vehicule->SetShield(shield); } - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += (Math::Rand()-0.5f)*5.0f; pos.z += (Math::Rand()-0.5f)*5.0f; pos.y += 1.0f; @@ -158,12 +159,12 @@ bool CAutoRepair::EventProcess(const Event &event) speed.y = Math::Rand()*15.0f; dim.x = Math::Rand()*6.0f+4.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBLUE, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLUE, 1.0f, 0.0f, 0.0f); } } else { - m_sound->Play(SOUND_OPEN, m_object->RetPosition(0), 1.0f, 0.8f); + m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 0.8f); m_phase = ARP_UP; m_progress = 0.0f; @@ -196,7 +197,7 @@ bool CAutoRepair::EventProcess(const Event &event) bool CAutoRepair::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -204,7 +205,7 @@ bool CAutoRepair::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -233,14 +234,14 @@ CObject* CAutoRepair::SearchVehicle() float dist; int i; - sPos = m_object->RetPosition(0); + sPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_MOBILEfa && type != OBJECT_MOBILEta && type != OBJECT_MOBILEwa && @@ -269,10 +270,10 @@ CObject* CAutoRepair::SearchVehicle() type != OBJECT_MOBILEit && type != OBJECT_MOBILEdr ) continue; - physics = pObj->RetPhysics(); - if ( physics != 0 && !physics->RetLand() ) continue; // in flight? + physics = pObj->GetPhysics(); + if ( physics != 0 && !physics->GetLand() ) continue; // in flight? - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, sPos); if ( dist <= 5.0f ) return pObj; } @@ -281,11 +282,11 @@ CObject* CAutoRepair::SearchVehicle() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoRepair::RetError() +Error CAutoRepair::GetError() { - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } @@ -327,11 +328,11 @@ bool CAutoRepair::Read(char *line) CAuto::Read(line); - m_phase = (AutoRepairPhase)OpInt(line, "aPhase", ARP_WAIT); + m_phase = static_cast< AutoRepairPhase >(OpInt(line, "aPhase", ARP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autorepair.h b/src/object/auto/autorepair.h index 1279ba3..e8bb0b1 100644 --- a/src/object/auto/autorepair.h +++ b/src/object/auto/autorepair.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -59,7 +60,7 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; }; diff --git a/src/object/auto/autoresearch.cpp b/src/object/auto/autoresearch.cpp index 410e6ac..c2395e8 100644 --- a/src/object/auto/autoresearch.cpp +++ b/src/object/auto/autoresearch.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -84,7 +85,7 @@ void CAutoResearch::Init() m_time = 0.0f; m_timeVirus = 0.0f; m_lastUpdateTime = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; } @@ -100,29 +101,29 @@ bool CAutoResearch::EventProcess(const Event &event) CAuto::EventProcess(event); - if ( m_engine->RetPause() ) return true; + if ( m_engine->GetPause() ) return true; - if ( event.event == EVENT_UPDINTERFACE ) + if ( event.type == EVENT_UPDINTERFACE ) { - if ( m_object->RetSelect() ) CreateInterface(true); + if ( m_object->GetSelect() ) CreateInterface(true); } - if ( m_object->RetSelect() && // center selected? - (event.event == EVENT_OBJECT_RTANK || - event.event == EVENT_OBJECT_RFLY || - event.event == EVENT_OBJECT_RTHUMP || - event.event == EVENT_OBJECT_RCANON || - event.event == EVENT_OBJECT_RTOWER || - event.event == EVENT_OBJECT_RPHAZER || - event.event == EVENT_OBJECT_RSHIELD || - event.event == EVENT_OBJECT_RATOMIC ) ) + if ( m_object->GetSelect() && // center selected? + (event.type == EVENT_OBJECT_RTANK || + event.type == EVENT_OBJECT_RFLY || + event.type == EVENT_OBJECT_RTHUMP || + event.type == EVENT_OBJECT_RCANON || + event.type == EVENT_OBJECT_RTOWER || + event.type == EVENT_OBJECT_RPHAZER || + event.type == EVENT_OBJECT_RSHIELD || + event.type == EVENT_OBJECT_RATOMIC ) ) { if ( m_phase != ALP_WAIT ) { return false; } - m_research = event.event; + m_research = event.type; if ( TestResearch(m_research) ) { @@ -130,33 +131,33 @@ bool CAutoResearch::EventProcess(const Event &event) return false; } - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power == 0 ) { m_displayText->DisplayError(ERR_RESEARCH_POWER, m_object); return false; } - if ( power->RetCapacity() > 1.0f ) + if ( power->GetCapacity() > 1.0f ) { m_displayText->DisplayError(ERR_RESEARCH_TYPE, m_object); return false; } - if ( power->RetEnergy() < 1.0f ) + if ( power->GetEnergy() < 1.0f ) { m_displayText->DisplayError(ERR_RESEARCH_ENERGY, m_object); return false; } time = SEARCH_TIME; - if ( event.event == EVENT_OBJECT_RTANK ) time *= 0.3f; - if ( event.event == EVENT_OBJECT_RFLY ) time *= 0.3f; - if ( event.event == EVENT_OBJECT_RATOMIC ) time *= 2.0f; + if ( event.type == EVENT_OBJECT_RTANK ) time *= 0.3f; + if ( event.type == EVENT_OBJECT_RFLY ) time *= 0.3f; + if ( event.type == EVENT_OBJECT_RATOMIC ) time *= 2.0f; SetBusy(true); InitProgressTotal(time); UpdateInterface(); - m_channelSound = m_sound->Play(SOUND_RESEARCH, m_object->RetPosition(0), 0.0f, 1.0f, true); + m_channelSound = m_sound->Play(SOUND_RESEARCH, m_object->GetPosition(0), 0.0f, 1.0f, true); m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, 2.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, time-4.0f, SOPER_CONTINUE); m_sound->AddEnvelope(m_channelSound, 0.0f, 1.0f, 2.0f, SOPER_STOP); @@ -167,12 +168,12 @@ bool CAutoResearch::EventProcess(const Event &event) return true; } - if ( event.event != EVENT_FRAME ) return true; + if ( event.type != EVENT_FRAME ) return true; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -201,7 +202,7 @@ bool CAutoResearch::EventProcess(const Event &event) FireStopUpdate(m_progress, true); // flashes if ( m_progress < 1.0f ) { - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power == 0 ) // more battery? { SetBusy(false); @@ -214,11 +215,11 @@ bool CAutoResearch::EventProcess(const Event &event) } power->SetEnergy(1.0f-m_progress); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += (Math::Rand()-0.5f)*6.0f; pos.z += (Math::Rand()-0.5f)*6.0f; pos.y += 11.0f; @@ -227,7 +228,7 @@ bool CAutoResearch::EventProcess(const Event &event) speed.y = Math::Rand()*20.0f; dim.x = Math::Rand()*1.0f+1.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIVAPOR); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIVAPOR); } } else @@ -262,9 +263,9 @@ bool CAutoResearch::EventProcess(const Event &event) } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoResearch::RetError() +Error CAutoResearch::GetError() { CObject* power; @@ -273,21 +274,21 @@ Error CAutoResearch::RetError() return ERR_OK; } - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power == 0 ) { return ERR_RESEARCH_POWER; } - if ( power != 0 && power->RetCapacity() > 1.0f ) + if ( power != 0 && power->GetCapacity() > 1.0f ) { return ERR_RESEARCH_TYPE; } - if ( power != 0 && power->RetEnergy() < 1.0f ) + if ( power != 0 && power->GetEnergy() < 1.0f ) { return ERR_RESEARCH_ENERGY; } @@ -300,7 +301,7 @@ Error CAutoResearch::RetError() bool CAutoResearch::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, dim, ddim; float ox, oy, sx, sy; @@ -308,7 +309,7 @@ bool CAutoResearch::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; dim.x = 33.0f/640.0f; @@ -371,13 +372,13 @@ bool CAutoResearch::CreateInterface(bool bSelect) void CAutoResearch::UpdateInterface() { - CWindow* pw; + Ui::CWindow* pw; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; CAuto::UpdateInterface(); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return; DeadInterface(pw, EVENT_OBJECT_RTANK, g_researchEnable&RESEARCH_TANK); @@ -413,8 +414,8 @@ void CAutoResearch::UpdateInterface() void CAutoResearch::UpdateInterface(float rTime) { - CWindow* pw; - CGauge* pg; + Ui::CWindow* pw; + Ui::CGauge* pg; CObject* power; float energy; @@ -423,19 +424,19 @@ void CAutoResearch::UpdateInterface(float rTime) if ( m_time < m_lastUpdateTime+0.1f ) return; m_lastUpdateTime = m_time; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return; - pg = (CGauge*)pw->SearchControl(EVENT_OBJECT_GENERGY); + pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GENERGY)); if ( pg != 0 ) { energy = 0.0f; - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power != 0 ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); } pg->SetLevel(energy); } @@ -443,20 +444,20 @@ void CAutoResearch::UpdateInterface(float rTime) // Research shows already performed button. -void CAutoResearch::OkayButton(CWindow *pw, EventMsg event) +void CAutoResearch::OkayButton(Ui::CWindow *pw, EventType event) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); if ( control == 0 ) return; - control->SetState(STATE_OKAY, TestResearch(event)); + control->SetState(Ui::STATE_OKAY, TestResearch(event)); } // Test whether a search has already been done. -bool CAutoResearch::TestResearch(EventMsg event) +bool CAutoResearch::TestResearch(EventType event) { if ( event == EVENT_OBJECT_RTANK ) return (g_researchDone & RESEARCH_TANK ); if ( event == EVENT_OBJECT_RFLY ) return (g_researchDone & RESEARCH_FLY ); @@ -472,9 +473,8 @@ bool CAutoResearch::TestResearch(EventMsg event) // Indicates a search as made. -void CAutoResearch::SetResearch(EventMsg event) +void CAutoResearch::SetResearch(EventType event) { - Event newEvent; if ( event == EVENT_OBJECT_RTANK ) g_researchDone |= RESEARCH_TANK; if ( event == EVENT_OBJECT_RFLY ) g_researchDone |= RESEARCH_FLY; @@ -487,7 +487,7 @@ void CAutoResearch::SetResearch(EventMsg event) m_main->WriteFreeParam(); - m_event->MakeEvent(newEvent, EVENT_UPDINTERFACE); + Event newEvent(EVENT_UPDINTERFACE); m_event->AddEvent(newEvent); UpdateInterface(); } @@ -518,14 +518,14 @@ void CAutoResearch::FireStopUpdate(float progress, bool bLightOn) { if ( m_partiStop[i] != -1 ) { - m_particule->DeleteParticule(m_partiStop[i]); + m_particle->DeleteParticle(m_partiStop[i]); m_partiStop[i] = -1; } } return; } - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 2.0f; @@ -537,7 +537,7 @@ void CAutoResearch::FireStopUpdate(float progress, bool bLightOn) { if ( m_partiStop[i] != -1 ) { - m_particule->DeleteParticule(m_partiStop[i]); + m_particle->DeleteParticle(m_partiStop[i]); m_partiStop[i] = -1; } } @@ -549,8 +549,8 @@ void CAutoResearch::FireStopUpdate(float progress, bool bLightOn) pos.y = 11.5f; pos.z = listpos[i*2+1]; pos = Math::Transform(*mat, pos); - m_partiStop[i] = m_particule->CreateParticule(pos, speed, - dim, PARTISELY, + m_partiStop[i] = m_particle->CreateParticle(pos, speed, + dim, Gfx::PARTISELY, 1.0f, 0.0f, 0.0f); } } @@ -594,13 +594,13 @@ bool CAutoResearch::Read(char *line) CAuto::Read(line); - m_phase = (AutoResearchPhase)OpInt(line, "aPhase", ALP_WAIT); + m_phase = static_cast< AutoResearchPhase >(OpInt(line, "aPhase", ALP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_research = (EventMsg)OpInt(line, "aResearch", 0); + m_research = static_cast< EventType >(OpInt(line, "aResearch", 0)); m_lastUpdateTime = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } diff --git a/src/object/auto/autoresearch.h b/src/object/auto/autoresearch.h index b60f4bd..a838e64 100644 --- a/src/object/auto/autoresearch.h +++ b/src/object/auto/autoresearch.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -41,7 +42,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -51,9 +52,9 @@ public: protected: void UpdateInterface(); void UpdateInterface(float rTime); - void OkayButton(CWindow *pw, EventMsg event); - bool TestResearch(EventMsg event); - void SetResearch(EventMsg event); + void OkayButton(Ui::CWindow *pw, EventType event); + bool TestResearch(EventType event); + void SetResearch(EventType event); void FireStopUpdate(float progress, bool bLightOn); protected: @@ -62,8 +63,8 @@ protected: float m_speed; float m_timeVirus; float m_lastUpdateTime; - float m_lastParticule; - EventMsg m_research; + float m_lastParticle; + EventType m_research; int m_partiStop[6]; int m_channelSound; }; diff --git a/src/object/auto/autoroot.cpp b/src/object/auto/autoroot.cpp index 9282a01..b43f40b 100644 --- a/src/object/auto/autoroot.cpp +++ b/src/object/auto/autoroot.cpp @@ -19,8 +19,8 @@ #include "object/auto/autoroot.h" -#include "old/particule.h" -#include "old/terrain.h" +#include "graphics/engine/particle.h" +#include "graphics/engine/terrain.h" #include "math/geometry.h" @@ -58,9 +58,9 @@ void CAutoRoot::Init() Math::Point dim; m_time = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); pos = Math::Vector(-5.0f, 28.0f, -4.0f); // peak position pos = Math::Transform(*mat, pos); m_center = pos; @@ -68,7 +68,7 @@ void CAutoRoot::Init() speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 100.0f; dim.y = dim.x; - m_particule->CreateParticule(m_center, speed, dim, PARTISPHERE5, 0.5f, 0.0f, 0.0f); + m_particle->CreateParticle(m_center, speed, dim, Gfx::PARTISPHERE5, 0.5f, 0.0f, 0.0f); m_terrain->AddFlyingLimit(pos, 100.0f, 80.0f, pos.y-60.0f); } @@ -83,16 +83,16 @@ bool CAutoRoot::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_object->SetZoomX(1, 1.0f+sinf(m_time*2.0f)*0.2f); m_object->SetZoomY(1, 1.0f+sinf(m_time*2.3f)*0.2f); m_object->SetZoomZ(1, 1.0f+sinf(m_time*2.7f)*0.2f); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.10f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.10f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; pos = m_center; pos.x += (Math::Rand()-0.5f)*8.0f; @@ -103,16 +103,16 @@ bool CAutoRoot::EventProcess(const Event &event) speed.y = Math::Rand()*12.0f; dim.x = Math::Rand()*6.0f+4.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIROOT, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIROOT, 1.0f, 0.0f, 0.0f); } return true; } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoRoot::RetError() +Error CAutoRoot::GetError() { return ERR_OK; } diff --git a/src/object/auto/autoroot.h b/src/object/auto/autoroot.h index 1ecd5ba..d80abe8 100644 --- a/src/object/auto/autoroot.h +++ b/src/object/auto/autoroot.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -33,12 +34,12 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); protected: protected: - float m_lastParticule; + float m_lastParticle; Math::Vector m_center; }; diff --git a/src/object/auto/autosafe.cpp b/src/object/auto/autosafe.cpp index 11aac18..144f36e 100644 --- a/src/object/auto/autosafe.cpp +++ b/src/object/auto/autosafe.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ CAutoSafe::CAutoSafe(CInstanceManager* iMan, CObject* object) } m_bLock = false; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_channelSound = -1; Init(); } @@ -86,7 +87,7 @@ void CAutoSafe::Init() { m_time = 0.0f; m_timeVirus = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_countKeys = 0; m_actualAngle = 0.0f; @@ -111,13 +112,13 @@ bool CAutoSafe::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_progress += event.rTime*m_speed; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { @@ -158,7 +159,7 @@ bool CAutoSafe::EventProcess(const Event &event) { LockKeys(); - m_channelSound = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 1.0f, 0.25f, true); + m_channelSound = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 1.0f, 0.25f, true); m_sound->AddEnvelope(m_channelSound, 1.0f, 2.00f, OPEN_DELAY, SOPER_STOP); m_phase = ASAP_OPEN; @@ -168,7 +169,7 @@ bool CAutoSafe::EventProcess(const Event &event) } else { - m_channelSound = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 1.0f, 0.25f, true); + m_channelSound = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 1.0f, 0.25f, true); m_sound->AddEnvelope(m_channelSound, 1.0f, 0.35f, 0.5f, SOPER_STOP); } } @@ -185,13 +186,13 @@ bool CAutoSafe::EventProcess(const Event &event) { DownKeys(m_progress); - if ( m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; for ( i=0 ; i<10 ; i++ ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += (Math::Rand()-0.5f)*10.0f; pos.z += (Math::Rand()-0.5f)*10.0f; speed.x = (Math::Rand()-0.5f)*4.0f; @@ -199,10 +200,10 @@ bool CAutoSafe::EventProcess(const Event &event) speed.y = Math::Rand()*15.0f; dim.x = Math::Rand()*6.0f+4.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIBLUE, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLUE, 1.0f, 0.0f, 0.0f); } - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.x += (Math::Rand()-0.5f)*10.0f; pos.z += (Math::Rand()-0.5f)*10.0f; speed.x = (Math::Rand()-0.5f)*4.0f; @@ -210,7 +211,7 @@ bool CAutoSafe::EventProcess(const Event &event) speed.y = Math::Rand()*10.0f; dim.x = Math::Rand()*3.0f+2.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGLINT, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 1.0f, 0.0f, 0.0f); for ( i=0 ; i<4 ; i++ ) { @@ -220,7 +221,7 @@ bool CAutoSafe::EventProcess(const Event &event) speed.y = 1.0f+Math::Rand()*1.0f; dim.x = Math::Rand()*1.5f+1.5f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISMOKE3, 4.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE3, 4.0f, 0.0f, 0.0f); } } } @@ -238,7 +239,7 @@ bool CAutoSafe::EventProcess(const Event &event) m_object->FlushCrashShere(); m_object->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 0.0f); - m_sound->Play(SOUND_FINDING, m_object->RetPosition(0)); + m_sound->Play(SOUND_FINDING, m_object->GetPosition(0)); m_phase = ASAP_FINISH; m_progress = 0.0f; @@ -283,7 +284,7 @@ bool CAutoSafe::EventProcess(const Event &event) { if ( m_keyParti[i] != -1 ) { - m_particule->DeleteParticule(m_keyParti[i]); + m_particle->DeleteParticle(m_keyParti[i]); m_keyParti[i] = -1; } } @@ -293,7 +294,7 @@ bool CAutoSafe::EventProcess(const Event &event) { pos = m_keyPos[i]; pos.y += 2.2f; - m_keyParti[i] = m_particule->CreateParticule(pos, speed, dim, PARTISELY, 1.0f, 0.0f, 0.0f); + m_keyParti[i] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISELY, 1.0f, 0.0f, 0.0f); } } } @@ -306,7 +307,7 @@ bool CAutoSafe::EventProcess(const Event &event) bool CAutoSafe::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -314,7 +315,7 @@ bool CAutoSafe::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -332,11 +333,11 @@ bool CAutoSafe::CreateInterface(bool bSelect) } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoSafe::RetError() +Error CAutoSafe::GetError() { - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } @@ -377,11 +378,11 @@ bool CAutoSafe::Read(char *line) CAuto::Read(line); - m_phase = (AutoSafePhase)OpInt(line, "aPhase", ASAP_WAIT); + m_phase = static_cast< AutoSafePhase >(OpInt(line, "aPhase", ASAP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; return true; } @@ -398,8 +399,8 @@ int CAutoSafe::CountKeys() float dist, angle, limit, cAngle, oAngle; int i, index; - cPos = m_object->RetPosition(0); - cAngle = m_object->RetAngleY(0); + cPos = m_object->GetPosition(0); + cAngle = m_object->GetAngleY(0); for ( index=0 ; index<4 ; index++ ) { @@ -409,18 +410,18 @@ int CAutoSafe::CountKeys() for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - oType = pObj->RetType(); - if ( pObj->RetTruck() != 0 ) continue; + oType = pObj->GetType(); + if ( pObj->GetTruck() != 0 ) continue; if ( oType != OBJECT_KEYa && oType != OBJECT_KEYb && oType != OBJECT_KEYc && oType != OBJECT_KEYd ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::DistanceProjected(oPos, cPos); if ( dist > 20.0f ) continue; @@ -482,22 +483,22 @@ void CAutoSafe::LockKeys() float dist; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - oType = pObj->RetType(); - if ( pObj->RetTruck() != 0 ) continue; + oType = pObj->GetType(); + if ( pObj->GetTruck() != 0 ) continue; if ( oType != OBJECT_KEYa && oType != OBJECT_KEYb && oType != OBJECT_KEYc && oType != OBJECT_KEYd ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::DistanceProjected(oPos, cPos); if ( dist > 20.0f ) continue; @@ -515,22 +516,22 @@ void CAutoSafe::DownKeys(float progress) float dist; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - oType = pObj->RetType(); - if ( pObj->RetTruck() != 0 ) continue; + oType = pObj->GetType(); + if ( pObj->GetTruck() != 0 ) continue; if ( oType != OBJECT_KEYa && oType != OBJECT_KEYb && oType != OBJECT_KEYc && oType != OBJECT_KEYd ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::DistanceProjected(oPos, cPos); if ( dist > 20.0f ) continue; @@ -550,25 +551,25 @@ void CAutoSafe::DeleteKeys() int i; bool bDelete; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); do { bDelete = false; for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - oType = pObj->RetType(); - if ( pObj->RetTruck() != 0 ) continue; + oType = pObj->GetType(); + if ( pObj->GetTruck() != 0 ) continue; if ( oType != OBJECT_KEYa && oType != OBJECT_KEYb && oType != OBJECT_KEYc && oType != OBJECT_KEYd ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::DistanceProjected(oPos, cPos); if ( dist > 20.0f ) continue; @@ -590,18 +591,18 @@ CObject* CAutoSafe::SearchVehicle() float dist; int i; - cPos = m_object->RetPosition(0); + cPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - oType = pObj->RetType(); + oType = pObj->GetType(); if ( pObj == m_object ) continue; - if ( pObj->RetTruck() != 0 ) continue; + if ( pObj->GetTruck() != 0 ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::DistanceProjected(oPos, cPos); if ( dist <= 4.0f ) return pObj; } diff --git a/src/object/auto/autosafe.h b/src/object/auto/autosafe.h index d17435b..3c0bcce 100644 --- a/src/object/auto/autosafe.h +++ b/src/object/auto/autosafe.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -42,7 +43,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -61,7 +62,7 @@ protected: float m_progress; float m_speed; float m_timeVirus; - float m_lastParticule; + float m_lastParticle; int m_channelSound; bool m_bLock; int m_countKeys; diff --git a/src/object/auto/autostation.cpp b/src/object/auto/autostation.cpp index dba4ed8..3771c0f 100644 --- a/src/object/auto/autostation.cpp +++ b/src/object/auto/autostation.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -20,8 +21,8 @@ #include "object/auto/autostation.h" #include "common/iman.h" -#include "old/particule.h" -#include "old/terrain.h" +#include "graphics/engine/particle.h" +#include "graphics/engine/terrain.h" #include "math/geometry.h" #include "ui/interface.h" #include "ui/gauge.h" @@ -66,7 +67,7 @@ void CAutoStation::Init() m_time = 0.0f; m_timeVirus = 0.0f; m_lastUpdateTime = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_soundChannel = -1; m_bLastVirus = false; @@ -83,22 +84,22 @@ bool CAutoStation::EventProcess(const Event &event) Math::Point dim; CObject* vehicule; CObject* power; - TerrainRes res; + Gfx::TerrainRes res; float big, energy, used, add, freq; CAuto::EventProcess(event); - 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; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( !m_bLastVirus ) { m_bLastVirus = true; - m_energyVirus = m_object->RetEnergy(); + m_energyVirus = m_object->GetEnergy(); } if ( m_timeVirus <= 0.0f ) @@ -120,10 +121,10 @@ bool CAutoStation::EventProcess(const Event &event) UpdateInterface(event.rTime); - big = m_object->RetEnergy(); + big = m_object->GetEnergy(); - res = m_terrain->RetResource(m_object->RetPosition(0)); - if ( res == TR_POWER ) + res = m_terrain->GetResource(m_object->GetPosition(0)); + if ( res == Gfx::TR_POWER ) { big += event.rTime*0.01f; // recharges the large battery } @@ -135,10 +136,10 @@ bool CAutoStation::EventProcess(const Event &event) vehicule = SearchVehicle(); if ( vehicule != 0 ) { - power = vehicule->RetPower(); - if ( power != 0 && power->RetCapacity() == 1.0f ) + power = vehicule->GetPower(); + if ( power != 0 && power->GetCapacity() == 1.0f ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); add = event.rTime*0.2f; if ( add > big*4.0f ) add = big*4.0f; if ( add > 1.0f-energy ) add = 1.0f-energy; @@ -148,10 +149,10 @@ bool CAutoStation::EventProcess(const Event &event) big -= add/4.0f; // discharge the large battery } - power = vehicule->RetFret(); - if ( power != 0 && power->RetType() == OBJECT_POWER ) + power = vehicule->GetFret(); + if ( power != 0 && power->GetType() == OBJECT_POWER ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); add = event.rTime*0.2f; if ( add > big*4.0f ) add = big*4.0f; if ( add > 1.0f-energy ) add = 1.0f-energy; @@ -169,7 +170,7 @@ bool CAutoStation::EventProcess(const Event &event) freq = 1.0f+3.0f*freq; if ( m_soundChannel == -1 ) { - m_soundChannel = m_sound->Play(SOUND_STATION, m_object->RetPosition(0), + m_soundChannel = m_sound->Play(SOUND_STATION, m_object->GetPosition(0), 0.3f, freq, true); } m_sound->Frequency(m_soundChannel, freq); @@ -184,11 +185,11 @@ bool CAutoStation::EventProcess(const Event &event) } if ( used != 0.0f && - m_lastParticule+m_engine->ParticuleAdapt(0.05f) <= m_time ) + m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { - m_lastParticule = m_time; + m_lastParticle = m_time; - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); pos = Math::Vector(-15.0f, 7.0f, 0.0f); // battery position pos = Math::Transform(*mat, pos); speed.x = (Math::Rand()-0.5f)*20.0f; @@ -199,7 +200,7 @@ bool CAutoStation::EventProcess(const Event &event) ppos.z = pos.z; dim.x = 1.5f; dim.y = 1.5f; - m_particule->CreateParticule(ppos, speed, dim, PARTIBLITZ, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(ppos, speed, dim, Gfx::PARTIBLITZ, 1.0f, 0.0f, 0.0f); #if 0 ppos = pos; @@ -211,7 +212,7 @@ bool CAutoStation::EventProcess(const Event &event) speed.y = 2.5f+Math::Rand()*6.0f; dim.x = Math::Rand()*1.5f+1.0f; dim.y = dim.x; - m_particule->CreateParticule(ppos, speed, dim, PARTISMOKE3, 4.0f); + m_particle->CreateParticle(ppos, speed, dim, Gfx::PARTISMOKE3, 4.0f); #else ppos = pos; ppos.y += 1.0f; @@ -222,7 +223,7 @@ bool CAutoStation::EventProcess(const Event &event) speed.y = 2.5f+Math::Rand()*5.0f; dim.x = Math::Rand()*1.0f+0.6f; dim.y = dim.x; - m_particule->CreateParticule(ppos, speed, dim, PARTIVAPOR, 3.0f); + m_particle->CreateParticle(ppos, speed, dim, Gfx::PARTIVAPOR, 3.0f); #endif } @@ -244,14 +245,14 @@ CObject* CAutoStation::SearchVehicle() float dist; int i; - sPos = m_object->RetPosition(0); + sPos = m_object->GetPosition(0); for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - type = pObj->RetType(); + type = pObj->GetType(); if ( type != OBJECT_HUMAN && type != OBJECT_MOBILEfa && type != OBJECT_MOBILEta && @@ -280,7 +281,7 @@ CObject* CAutoStation::SearchVehicle() type != OBJECT_MOBILEit && type != OBJECT_MOBILEdr ) continue; - oPos = pObj->RetPosition(0); + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, sPos); if ( dist <= 5.0f ) return pObj; } @@ -289,19 +290,19 @@ CObject* CAutoStation::SearchVehicle() } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoStation::RetError() +Error CAutoStation::GetError() { - TerrainRes res; + Gfx::TerrainRes res; - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } - res = m_terrain->RetResource(m_object->RetPosition(0)); - if ( res != TR_POWER ) return ERR_STATION_NULL; + res = m_terrain->GetResource(m_object->GetPosition(0)); + if ( res != Gfx::TR_POWER ) return ERR_STATION_NULL; return ERR_OK; } @@ -311,7 +312,7 @@ Error CAutoStation::RetError() bool CAutoStation::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -319,7 +320,7 @@ bool CAutoStation::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -347,23 +348,23 @@ bool CAutoStation::CreateInterface(bool bSelect) void CAutoStation::UpdateInterface(float rTime) { - CWindow* pw; - CGauge* pg; + Ui::CWindow* pw; + Ui::CGauge* pg; CAuto::UpdateInterface(rTime); if ( m_time < m_lastUpdateTime+0.1f ) return; m_lastUpdateTime = m_time; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return; - pg = (CGauge*)pw->SearchControl(EVENT_OBJECT_GENERGY); + pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GENERGY)); if ( pg != 0 ) { - pg->SetLevel(m_object->RetEnergy()); + pg->SetLevel(m_object->GetEnergy()); } } diff --git a/src/object/auto/autostation.h b/src/object/auto/autostation.h index 5bf2b72..cb8be2b 100644 --- a/src/object/auto/autostation.h +++ b/src/object/auto/autostation.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -33,7 +34,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -47,7 +48,7 @@ protected: float m_speed; float m_timeVirus; float m_lastUpdateTime; - float m_lastParticule; + float m_lastParticle; int m_soundChannel; Math::Vector m_fretPos; bool m_bLastVirus; diff --git a/src/object/auto/autotower.cpp b/src/object/auto/autotower.cpp index 5f185fe..8410086 100644 --- a/src/object/auto/autotower.cpp +++ b/src/object/auto/autotower.cpp @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -78,7 +79,7 @@ void CAutoTower::Init() m_time = 0.0f; m_timeVirus = 0.0f; m_lastUpdateTime = 0.0f; - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; } @@ -93,18 +94,18 @@ bool CAutoTower::EventProcess(const Event &event) CAuto::EventProcess(event); - 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; m_timeVirus -= event.rTime; - if ( m_object->RetVirusMode() ) // contaminated by a virus? + if ( m_object->GetVirusMode() ) // contaminated by a virus? { if ( m_timeVirus <= 0.0f ) { m_timeVirus = 0.1f+Math::Rand()*0.3f; - angle = m_object->RetAngleY(1); + angle = m_object->GetAngleY(1); angle += Math::Rand()*0.5f; m_object->SetAngleY(1, angle); @@ -125,10 +126,10 @@ bool CAutoTower::EventProcess(const Event &event) if ( m_progress < 1.0f ) { energy = 0.0f; - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power != 0 ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); } if ( energy >= ENERGY_FIRE ) { @@ -153,11 +154,11 @@ bool CAutoTower::EventProcess(const Event &event) quick = 1.0f; //? if ( g_researchDone & RESEARCH_QUICK ) quick = 3.0f; - angle = m_object->RetAngleY(1); + angle = m_object->GetAngleY(1); angle -= event.rTime*quick*2.0f; m_object->SetAngleY(1, angle); - angle = m_object->RetAngleZ(2); + angle = m_object->GetAngleZ(2); angle += event.rTime*quick*0.5f; if ( angle > 0.0f ) angle = 0.0f; m_object->SetAngleZ(2, angle); @@ -165,10 +166,10 @@ bool CAutoTower::EventProcess(const Event &event) else { energy = 0.0f; - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power != 0 ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); } target = SearchTarget(m_targetPos); @@ -184,16 +185,16 @@ bool CAutoTower::EventProcess(const Event &event) } else { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 24.5f; m_angleYfinal = Math::RotateAngle(m_targetPos.x-pos.x, pos.z-m_targetPos.z); // CW ! m_angleYfinal += Math::PI*2.0f; - m_angleYfinal -= m_object->RetAngleY(0); - m_angleYactual = Math::NormAngle(m_object->RetAngleY(1)); + m_angleYfinal -= m_object->GetAngleY(0); + m_angleYactual = Math::NormAngle(m_object->GetAngleY(1)); m_angleZfinal = -Math::PI/2.0f; m_angleZfinal -= Math::RotateAngle(Math::DistanceProjected(m_targetPos, pos), pos.y-m_targetPos.y); // CW ! - m_angleZactual = m_object->RetAngleZ(2); + m_angleZactual = m_object->GetAngleZ(2); m_phase = ATP_TURN; m_progress = 0.0f; @@ -218,15 +219,15 @@ bool CAutoTower::EventProcess(const Event &event) m_object->SetAngleY(1, m_angleYfinal); m_object->SetAngleZ(2, m_angleZfinal); - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power != 0 ) { - energy = power->RetEnergy(); - energy -= ENERGY_FIRE/power->RetCapacity(); + energy = power->GetEnergy(); + energy -= ENERGY_FIRE/power->GetCapacity(); power->SetEnergy(energy); } - m_sound->Play(SOUND_GGG, m_object->RetPosition(0)); + m_sound->Play(SOUND_GGG, m_object->GetPosition(0)); m_phase = ATP_FIRE; m_progress = 0.0f; @@ -238,9 +239,9 @@ bool CAutoTower::EventProcess(const Event &event) { if ( m_progress == 0.0f ) { - pos = m_object->RetPosition(0); + pos = m_object->GetPosition(0); pos.y += 24.5f; - m_particule->CreateRay(pos, m_targetPos, PARTIRAY1, + m_particle->CreateRay(pos, m_targetPos, Gfx::PARTIRAY1, Math::Point(5.0f, 5.0f), 1.5f); } if ( m_progress >= 1.0f ) @@ -267,30 +268,30 @@ CObject* CAutoTower::SearchTarget(Math::Vector &impact) float distance, min, radius, speed; int i; - iPos = m_object->RetPosition(0); + iPos = m_object->GetPosition(0); min = 1000000.0f; for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast< CObject* >(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; - oType = pObj->RetType(); + oType = pObj->GetType(); if ( oType != OBJECT_MOTHER && oType != OBJECT_ANT && oType != OBJECT_SPIDER && oType != OBJECT_BEE && oType != OBJECT_WORM ) continue; - if ( !pObj->RetActif() ) continue; // inactive? + if ( !pObj->GetActif() ) continue; // inactive? //? if ( g_researchDone & RESEARCH_QUICK ) if ( false ) { - physics = pObj->RetPhysics(); + physics = pObj->GetPhysics(); if ( physics != 0 ) { - speed = fabs(physics->RetLinMotionX(MO_REASPEED)); + speed = fabs(physics->GetLinMotionX(MO_REASPEED)); if ( speed > 20.0f ) continue; // moving too fast? } } @@ -306,30 +307,30 @@ CObject* CAutoTower::SearchTarget(Math::Vector &impact) } if ( pBest == 0 ) return 0; - impact = pBest->RetPosition(0); + impact = pBest->GetPosition(0); return pBest; } -// Returns an error due the state of the automation. +// Geturns an error due the state of the automation. -Error CAutoTower::RetError() +Error CAutoTower::GetError() { CObject* power; - if ( m_object->RetVirusMode() ) + if ( m_object->GetVirusMode() ) { return ERR_BAT_VIRUS; } - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power == 0 ) { return ERR_TOWER_POWER; // no battery } else { - if ( power->RetEnergy() < ENERGY_FIRE ) + if ( power->GetEnergy() < ENERGY_FIRE ) { return ERR_TOWER_ENERGY; // not enough energy } @@ -361,14 +362,14 @@ void CAutoTower::FireStopUpdate(float progress, bool bLightOn) { if ( m_partiStop[i] != -1 ) { - m_particule->DeleteParticule(m_partiStop[i]); + m_particle->DeleteParticle(m_partiStop[i]); m_partiStop[i] = -1; } } return; } - mat = m_object->RetWorldMatrix(0); + mat = m_object->GetWorldMatrix(0); speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 2.0f; @@ -380,7 +381,7 @@ void CAutoTower::FireStopUpdate(float progress, bool bLightOn) { if ( m_partiStop[i] != -1 ) { - m_particule->DeleteParticule(m_partiStop[i]); + m_particle->DeleteParticle(m_partiStop[i]); m_partiStop[i] = -1; } } @@ -392,8 +393,9 @@ void CAutoTower::FireStopUpdate(float progress, bool bLightOn) pos.y = 18.0f; pos.z = listpos[i*2+1]; pos = Transform(*mat, pos); - m_partiStop[i] = m_particule->CreateParticule(pos, speed, - dim, PARTISELR, + + m_partiStop[i] = m_particle->CreateParticle(pos, speed, + dim, Gfx::PARTISELR, 1.0f, 0.0f, 0.0f); } } @@ -405,7 +407,7 @@ void CAutoTower::FireStopUpdate(float progress, bool bLightOn) bool CAutoTower::CreateInterface(bool bSelect) { - CWindow* pw; + Ui::CWindow* pw; Math::Point pos, ddim; float ox, oy, sx, sy; @@ -413,7 +415,7 @@ bool CAutoTower::CreateInterface(bool bSelect) if ( !bSelect ) return true; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return false; ox = 3.0f/640.0f; @@ -447,8 +449,8 @@ bool CAutoTower::CreateInterface(bool bSelect) void CAutoTower::UpdateInterface(float rTime) { - CWindow* pw; - CGauge* pg; + Ui::CWindow* pw; + Ui::CGauge* pg; CObject* power; float energy; @@ -457,19 +459,19 @@ void CAutoTower::UpdateInterface(float rTime) if ( m_time < m_lastUpdateTime+0.1f ) return; m_lastUpdateTime = m_time; - if ( !m_object->RetSelect() ) return; + if ( !m_object->GetSelect() ) return; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = static_cast< Ui::CWindow* >(m_interface->SearchControl(EVENT_WINDOW0)); if ( pw == 0 ) return; - pg = (CGauge*)pw->SearchControl(EVENT_OBJECT_GENERGY); + pg = static_cast< Ui::CGauge* >(pw->SearchControl(EVENT_OBJECT_GENERGY)); if ( pg != 0 ) { energy = 0.0f; - power = m_object->RetPower(); + power = m_object->GetPower(); if ( power != 0 ) { - energy = power->RetEnergy(); + energy = power->GetEnergy(); } pg->SetLevel(energy); } @@ -524,7 +526,7 @@ bool CAutoTower::Read(char *line) CAuto::Read(line); - m_phase = (AutoTowerPhase)OpInt(line, "aPhase", ATP_WAIT); + m_phase = static_cast< AutoTowerPhase >(OpInt(line, "aPhase", ATP_WAIT)); m_progress = OpFloat(line, "aProgress", 0.0f); m_speed = OpFloat(line, "aSpeed", 1.0f); m_targetPos = OpDir(line, "aTargetPos"); diff --git a/src/object/auto/autotower.h b/src/object/auto/autotower.h index c9393ff..b29ba85 100644 --- a/src/object/auto/autotower.h +++ b/src/object/auto/autotower.h @@ -1,5 +1,6 @@ // * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * Copyright (C) 2012, Polish Portal of Colobot (PPC) // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by @@ -44,7 +45,7 @@ public: void Init(); bool EventProcess(const Event &event); - Error RetError(); + Error GetError(); bool CreateInterface(bool bSelect); @@ -63,7 +64,7 @@ protected: float m_speed; float m_timeVirus; float m_lastUpdateTime; - float m_lastParticule; + float m_lastParticle; Math::Vector m_targetPos; float m_angleYactual; float m_angleZactual; diff --git a/src/object/brain.cpp b/src/object/brain.cpp index ef55e73..e322a3d 100644 --- a/src/object/brain.cpp +++ b/src/object/brain.cpp @@ -15,55 +15,55 @@ // * along with this program. If not, see http://www.gnu.org/licenses/. -#include <stdio.h> - +// #include <stdio.h> +// #include "object/brain.h" - -#include "CBot/CBotDll.h" -#include "common/struct.h" -#include "math/geometry.h" -#include "math/const.h" -#include "old/d3dengine.h" -#include "old/d3dmath.h" -#include "common/language.h" -#include "common/global.h" -#include "common/event.h" +// +// #include "CBot/CBotDll.h" +// #include "common/struct.h" +// #include "math/geometry.h" +// #include "math/const.h" +// #include "old/d3dengine.h" +// #include "old/d3dmath.h" +// #include "common/language.h" +// #include "common/global.h" +// #include "common/event.h" #include "common/misc.h" #include "common/iman.h" -#include "common/restext.h" -#include "old/math3d.h" -#include "object/robotmain.h" -#include "old/terrain.h" -#include "old/water.h" -#include "old/camera.h" -#include "object/object.h" -#include "physics/physics.h" -#include "object/motion/motion.h" -#include "object/motion/motionspider.h" -#include "old/pyro.h" +// #include "common/restext.h" +// #include "old/math3d.h" +// #include "object/robotmain.h" +// #include "old/terrain.h" +// #include "old/water.h" +// #include "old/camera.h" +// #include "object/object.h" +// #include "physics/physics.h" +// #include "object/motion/motion.h" +// #include "object/motion/motionspider.h" +// #include "old/pyro.h" #include "object/task/taskmanager.h" -#include "object/task/task.h" -#include "object/task/taskmanip.h" -#include "object/task/taskflag.h" -#include "object/task/taskshield.h" +// #include "object/task/task.h" +// #include "object/task/taskmanip.h" +// #include "object/task/taskflag.h" +// #include "object/task/taskshield.h" #include "script/script.h" -#include "ui/studio.h" -#include "ui/interface.h" -#include "ui/button.h" -#include "ui/color.h" -#include "ui/edit.h" -#include "ui/list.h" -#include "ui/label.h" -#include "ui/group.h" -#include "ui/gauge.h" +// #include "ui/studio.h" +// #include "ui/interface.h" +// #include "ui/button.h" +// #include "ui/color.h" +// #include "ui/edit.h" +// #include "ui/list.h" +// #include "ui/label.h" +// #include "ui/group.h" +// #include "ui/gauge.h" #include "ui/slider.h" -#include "ui/compass.h" -#include "ui/target.h" +// #include "ui/compass.h" +// #include "ui/target.h" #include "ui/window.h" -#include "ui/displaytext.h" -#include "old/text.h" -#include "old/sound.h" -#include "old/particule.h" +// #include "ui/displaytext.h" +// #include "old/text.h" +#include "sound/sound.h" +// #include "old/particule.h" #include "script/cmdtoken.h" @@ -82,20 +82,21 @@ CBrain::CBrain(CInstanceManager* iMan, CObject* object) m_iMan->AddInstance(CLASS_BRAIN, this, 100); m_object = object; - m_engine = (CD3DEngine*)m_iMan->SearchInstance(CLASS_ENGINE); - m_terrain = (CTerrain*)m_iMan->SearchInstance(CLASS_TERRAIN); - m_water = (CWater*)m_iMan->SearchInstance(CLASS_WATER); - m_camera = (CCamera*)m_iMan->SearchInstance(CLASS_CAMERA); - m_interface = (CInterface*)m_iMan->SearchInstance(CLASS_INTERFACE); - m_displayText = (CDisplayText*)m_iMan->SearchInstance(CLASS_DISPLAYTEXT); - m_main = (CRobotMain*)m_iMan->SearchInstance(CLASS_MAIN); - m_sound = (CSound*)m_iMan->SearchInstance(CLASS_SOUND); - m_particule = (CParticule*)m_iMan->SearchInstance(CLASS_PARTICULE); + m_engine = static_cast<Gfx::CEngine*>(m_iMan->SearchInstance(CLASS_ENGINE)); + m_terrain = static_cast<Gfx::CTerrain*>(m_iMan->SearchInstance(CLASS_TERRAIN)); + m_water = static_cast<Gfx::CWater*>(m_iMan->SearchInstance(CLASS_WATER)); + m_camera = static_cast<Gfx::CCamera*>(m_iMan->SearchInstance(CLASS_CAMERA)); + m_interface = static_cast<CInterface*>(m_iMan->SearchInstance(CLASS_INTERFACE)); + m_displayText = static_cast<CDisplayText*>(m_iMan->SearchInstance(CLASS_DISPLAYTEXT)); + m_main = static_cast<CRobotMain*>(m_iMan->SearchInstance(CLASS_MAIN)); + m_sound = static_cast<CSoundInterface*>(m_iMan->SearchInstance(CLASS_SOUND)); + m_particle = static_cast<CParticle*>(m_iMan->SearchInstance(CLASS_PARTICULE)); m_physics = 0; m_motion = 0; m_primaryTask = 0; m_secondaryTask = 0; - m_studio = 0; + // TODO uncoment when ui/studio will be implemented. + // m_studio = 0; m_program = -1; m_bActivity = true; @@ -142,7 +143,8 @@ CBrain::~CBrain() delete m_primaryTask; delete m_secondaryTask; - delete m_studio; + // TODO uncoment when ui/studio will be implemented. + // delete m_studio; delete m_traceRecordBuffer; m_iMan->DeleteInstance(CLASS_BRAIN, this); } @@ -169,7 +171,8 @@ void CBrain::DeleteObject(bool bAll) } } - if ( m_studio != 0 ) // current edition? + // TODO uncoment when ui/studio will be implemented. + // if ( m_studio != 0 ) // current edition? { StopEditScript(true); } @@ -213,13 +216,13 @@ bool CBrain::Read(char *line) bool CBrain::EventProcess(const Event &event) { - CWindow* pw; - CControl* pc; - CSlider* ps; - EventMsg action; - ObjectType type; - Error err; - float axeX, axeY, axeZ, factor; + Ui::CWindow* pw; + Ui::CControl* pc; + Ui::CSlider* ps; + Event action; + ObjectType type; + Error err; + float axeX, axeY, axeZ, factor; type = m_object->RetType(); @@ -240,7 +243,7 @@ bool CBrain::EventProcess(const Event &event) event.param == m_engine->RetKey(KEYRANK_ACTION, 1) ) && !m_main->RetEditLock() ) { - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw != 0 ) { pc = pw->SearchControl(m_defaultEnter); @@ -270,10 +273,11 @@ bool CBrain::EventProcess(const Event &event) EventFrame(event); } + // TODO uncoment when ui/studio will be implemented. if ( m_object->RetSelect() && // robot selected? - m_studio != 0 ) // current issue? + /* m_studio != 0 */ ) // current issue? { - m_studio->EventProcess(event); + // m_studio->EventProcess(event); if ( action == EVENT_OBJECT_PROGRUN ) { @@ -591,10 +595,10 @@ bool CBrain::EventProcess(const Event &event) if ( action == EVENT_OBJECT_DIMSHIELD ) { - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw != 0 ) { - ps = (CSlider*)pw->SearchControl(EVENT_OBJECT_DIMSHIELD); + ps = (Ui::CSlider*)pw->SearchControl(EVENT_OBJECT_DIMSHIELD); if ( ps != 0 ) { m_object->SetParam((ps->RetVisibleValue()-(RADIUS_SHIELD_MIN/g_unit))/((RADIUS_SHIELD_MAX-RADIUS_SHIELD_MIN)/g_unit)); @@ -687,7 +691,7 @@ bool CBrain::EventProcess(const Event &event) TraceRecordStart(); } UpdateInterface(); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw != 0 ) { UpdateScript(pw); @@ -701,7 +705,7 @@ bool CBrain::EventProcess(const Event &event) TraceRecordStop(); } UpdateInterface(); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw != 0 ) { UpdateScript(pw); @@ -765,10 +769,11 @@ bool CBrain::EventFrame(const Event &event) m_sound->Position(m_soundChannelAlarm, m_object->RetPosition(0)); } - if ( m_studio != 0 ) // �urrent edition? - { - m_studio->EventProcess(event); - } + // TODO uncoment when ui/studio will be implemented. + // if ( m_studio != 0 ) // current edition? + // { + // m_studio->EventProcess(event); + // } UpdateInterface(event.rTime); @@ -891,8 +896,9 @@ void CBrain::StartEditScript(int rank, char* name) m_script[rank] = new CScript(m_iMan, m_object, &m_secondaryTask); } - m_studio = new CStudio(m_iMan); - m_studio->StartEditScript(m_script[rank], name, rank); + // TODO uncoment when ui/studio will be implemented. + // m_studio = new CStudio(m_iMan); + // m_studio->StartEditScript(m_script[rank], name, rank); } // End of editing a program. @@ -901,10 +907,11 @@ void CBrain::StopEditScript(bool bCancel) { if ( !bCancel ) SetActiveVirus(false); - if ( !m_studio->StopEditScript(bCancel) ) return; + // TODO uncoment when ui/studio will be implemented. + // if ( !m_studio->StopEditScript(bCancel) ) return; - delete m_studio; - m_studio = 0; + // delete m_studio; + // m_studio = 0; CreateInterface(true); // puts the control buttons } @@ -1209,7 +1216,7 @@ void CBrain::GroundFlat() speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 40.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTIGFLAT, 1.0f); + m_particle->CreateParticle(pos, speed, dim, PARTIGFLAT, 1.0f); } @@ -1227,17 +1234,17 @@ void CBrain::ColorFlag(int color) bool CBrain::CreateInterface(bool bSelect) { ObjectType type; - CWindow* pw; + Ui::CWindow* pw; CButton* pb; CColor* pc; - CSlider* ps; + Ui::CSlider* ps; CTarget* pt; CLabel* pl; Math::Point pos, dim, ddim; float ox, oy, sx, sy; char name[100]; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw != 0 ) { pw->Flush(); // destroys the window buttons @@ -1253,7 +1260,7 @@ bool CBrain::CreateInterface(bool bSelect) if ( !m_main->RetShowMap() ) dim.x = 640.0f/640.0f; dim.y = 86.0f/480.0f; m_interface->CreateWindows(pos, dim, 3, EVENT_WINDOW0); - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw == 0 ) return false; m_object->GetTooltipName(name); @@ -1926,7 +1933,7 @@ bool CBrain::CreateInterface(bool bSelect) void CBrain::UpdateInterface(float rTime) { - CWindow* pw; + Ui::CWindow* pw; #if _TEEN CButton* pb; #endif @@ -1956,7 +1963,7 @@ void CBrain::UpdateInterface(float rTime) return; } - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw == 0 ) return; pg = (CGauge*)pw->SearchControl(EVENT_OBJECT_GENERGY); @@ -2130,9 +2137,9 @@ void CBrain::UpdateInterface(float rTime) void CBrain::UpdateInterface() { ObjectType type; - CWindow* pw; + Ui::CWindow* pw; CButton* pb; - CSlider* ps; + Ui::CSlider* ps; #if _TEEN CColor* pc; int color; @@ -2142,7 +2149,7 @@ void CBrain::UpdateInterface() if ( !m_object->RetSelect() ) return; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw == 0 ) return; type = m_object->RetType(); @@ -2235,7 +2242,7 @@ void CBrain::UpdateInterface() DefaultEnter (pw, EVENT_OBJECT_ENDSHIELD, false); } - ps = (CSlider*)pw->SearchControl(EVENT_OBJECT_DIMSHIELD); + ps = (Ui::CSlider*)pw->SearchControl(EVENT_OBJECT_DIMSHIELD); if ( ps != 0 ) { ps->SetVisibleValue((RADIUS_SHIELD_MIN/g_unit)+m_object->RetParam()*((RADIUS_SHIELD_MAX-RADIUS_SHIELD_MIN)/g_unit)); @@ -2438,7 +2445,7 @@ void CBrain::UpdateInterface() // Updates the list of programs. -void CBrain::UpdateScript(CWindow *pw) +void CBrain::UpdateScript(Ui::CWindow *pw) { CList* pl; char name[100]; @@ -2488,10 +2495,10 @@ void CBrain::UpdateScript(CWindow *pw) int CBrain::RetSelScript() { - CWindow* pw; + Ui::CWindow* pw; CList* pl; - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw == 0 ) return -1; pl = (CList*)pw->SearchControl(EVENT_OBJECT_PROGLIST); @@ -2504,12 +2511,12 @@ int CBrain::RetSelScript() void CBrain::BlinkScript(bool bEnable) { - CWindow* pw; + Ui::CWindow* pw; CList* pl; if ( !m_object->RetSelect() ) return; // robot not selected? - pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0); + pw = (Ui::CWindow*)m_interface->SearchControl(EVENT_WINDOW0); if ( pw == 0 ) return; pl = (CList*)pw->SearchControl(EVENT_OBJECT_PROGLIST); @@ -2520,9 +2527,9 @@ void CBrain::BlinkScript(bool bEnable) // Check the status of a button interface. -void CBrain::CheckInterface(CWindow *pw, EventMsg event, bool bState) +void CBrain::CheckInterface(Ui::CWindow *pw, EventMsg event, bool bState) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); if ( control == 0 ) return; @@ -2532,9 +2539,9 @@ void CBrain::CheckInterface(CWindow *pw, EventMsg event, bool bState) // Changes the state of a button interface. -void CBrain::EnableInterface(CWindow *pw, EventMsg event, bool bState) +void CBrain::EnableInterface(Ui::CWindow *pw, EventMsg event, bool bState) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); if ( control == 0 ) return; @@ -2544,9 +2551,9 @@ void CBrain::EnableInterface(CWindow *pw, EventMsg event, bool bState) // Changes the state of a button on the interface. -void CBrain::DeadInterface(CWindow *pw, EventMsg event, bool bState) +void CBrain::DeadInterface(Ui::CWindow *pw, EventMsg event, bool bState) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); if ( control == 0 ) return; @@ -2556,9 +2563,9 @@ void CBrain::DeadInterface(CWindow *pw, EventMsg event, bool bState) // Change the default input state of a button interface. -void CBrain::DefaultEnter(CWindow *pw, EventMsg event, bool bState) +void CBrain::DefaultEnter(Ui::CWindow *pw, EventMsg event, bool bState) { - CControl* control; + Ui::CControl* control; control = pw->SearchControl(event); if ( control == 0 ) return; @@ -2708,7 +2715,7 @@ bool CBrain::ReadSoluce(char* filename) // Load a script with a text file. -bool CBrain::ReadProgram(int rank, char* filename) +bool CBrain::ReadProgram(int rank, const char* filename) { if ( m_script[rank] == 0 ) { diff --git a/src/object/brain.h b/src/object/brain.h index 0220ffc..b1ef9bc 100644 --- a/src/object/brain.h +++ b/src/object/brain.h @@ -19,7 +19,7 @@ #pragma once -#include <stdio.h> +// #include <stdio.h> #include "common/misc.h" #include "common/event.h" @@ -30,10 +30,6 @@ class CInstanceManager; -class CD3DEngine; -class CTerrain; -class CWater; -class CCamera; class CObject; class CPhysics; class CMotion; @@ -44,8 +40,18 @@ class CDisplayText; class CScript; class CRobotMain; class CStudio; -class CSound; -class CParticule; +class CSoundInterface; +class CParticle; + +namespace Gfx +{ + +class CEngine; +class CTerrain; +class CWater; +class CCamera; + +} /* Gfx */ const int BRAINMAXSCRIPT = 10; @@ -88,29 +94,29 @@ public: bool IsBusy(); void SetActivity(bool bMode); - bool RetActivity(); + bool GetActivity(); bool IsProgram(); bool ProgramExist(int rank); void RunProgram(int rank); int FreeProgram(); - int RetProgram(); + int GetProgram(); void StopProgram(); void StopTask(); bool IntroduceVirus(); void SetActiveVirus(bool bActive); - bool RetActiveVirus(); + bool GetActiveVirus(); void SetScriptRun(int rank); - int RetScriptRun(); + int GetScriptRun(); void SetScriptName(int rank, char *name); - char* RetScriptName(int rank); + char* GetScriptName(int rank); void SetSoluceName(char *name); - char* RetSoluceName(); + char* GetSoluceName(); bool ReadSoluce(char* filename); - bool ReadProgram(int rank, char* filename); - bool RetCompile(int rank); + bool ReadProgram(int rank, const char* filename); + bool GetCompile(int rank); bool WriteProgram(int rank, char* filename); bool ReadStack(FILE *file); bool WriteStack(FILE *file); @@ -144,13 +150,13 @@ protected: void ColorFlag(int color); void UpdateScript(CWindow *pw); - int RetSelScript(); + int GetSelScript(); void BlinkScript(bool bEnable); - void CheckInterface(CWindow *pw, EventMsg event, bool bState); - void EnableInterface(CWindow *pw, EventMsg event, bool bState); - void DeadInterface(CWindow *pw, EventMsg event, bool bState); - void DefaultEnter(CWindow *pw, EventMsg event, bool bState=true); + void CheckInterface(CWindow *pw, EventType event, bool bState); + void EnableInterface(CWindow *pw, EventType event, bool bState); + void DeadInterface(CWindow *pw, EventType event, bool bState); + void DefaultEnter(CWindow *pw, EventType event, bool bState=true); void TraceRecordStart(); void TraceRecordFrame(); @@ -159,60 +165,60 @@ protected: bool TraceRecordPut(char *buffer, int max, TraceOper oper, float param); protected: - CInstanceManager* m_iMan; - CD3DEngine* m_engine; - CTerrain* m_terrain; - CWater* m_water; - CCamera* m_camera; - CObject* m_object; - CPhysics* m_physics; - CMotion* m_motion; - CInterface* m_interface; - CDisplayText* m_displayText; - CRobotMain* m_main; - CStudio* m_studio; - CSound* m_sound; - CParticule* m_particule; - CTaskManager* m_primaryTask; - CTaskManager* m_secondaryTask; - - CScript* m_script[BRAINMAXSCRIPT]; - int m_selScript; // rank of the selected script - int m_program; // rank of the executed program / ​​-1 - bool m_bActivity; - bool m_bBurn; - bool m_bActiveVirus; - - int m_scriptRun; - char m_scriptName[BRAINMAXSCRIPT][50]; - char m_soluceName[50]; - - EventMsg m_buttonAxe; - EventMsg m_manipStyle; - EventMsg m_defaultEnter; - EventMsg m_interfaceEvent[100]; - - CObject* m_antTarget; - CObject* m_beeBullet; - float m_beeBulletSpeed; - Math::Vector m_startPos; - float m_time; - float m_burnTime; - float m_lastUpdateTime; - float m_lastHumanTime; - float m_lastSpiderTime; - float m_lastWormTime; - float m_lastBulletTime; - float m_lastAlarmTime; - int m_soundChannelAlarm; - int m_flagColor; - - bool m_bTraceRecord; - TraceOper m_traceOper; - Math::Vector m_tracePos; - float m_traceAngle; - int m_traceColor; - int m_traceRecordIndex; - TraceRecord* m_traceRecordBuffer; + CInstanceManager* m_iMan; + Gfx::CEngine* m_engine; + Gfx::CTerrain* m_terrain; + Gfx::CWater* m_water; + Gfx::CCamera* m_camera; + CObject* m_object; + CPhysics* m_physics; + CMotion* m_motion; + CInterface* m_interface; + CDisplayText* m_displayText; + CRobotMain* m_main; + CStudio* m_studio; + CSoundInterface* m_sound; + CParticle* m_particle; + CTaskManager* m_primaryTask; + CTaskManager* m_secondaryTask; + + CScript* m_script[BRAINMAXSCRIPT]; + int m_selScript; // rank of the selected script + int m_program; // rank of the executed program / ​​-1 + bool m_bActivity; + bool m_bBurn; + bool m_bActiveVirus; + + int m_scriptRun; + char m_scriptName[BRAINMAXSCRIPT][50]; + char m_soluceName[50]; + + EventType m_buttonAxe; + EventType m_manipStyle; + EventType m_defaultEnter; + EventType m_interfaceEvent[100]; + + CObject* m_antTarget; + CObject* m_beeBullet; + float m_beeBulletSpeed; + Math::Vector m_startPos; + float m_time; + float m_burnTime; + float m_lastUpdateTime; + float m_lastHumanTime; + float m_lastSpiderTime; + float m_lastWormTime; + float m_lastBulletTime; + float m_lastAlarmTime; + int m_soundChannelAlarm; + int m_flagColor; + + bool m_bTraceRecord; + TraceOper m_traceOper; + Math::Vector m_tracePos; + float m_traceAngle; + int m_traceColor; + int m_traceRecordIndex; + TraceRecord* m_traceRecordBuffer; }; diff --git a/src/object/mainmovie.h b/src/object/mainmovie.h index 23721fb..0c8d51c 100644 --- a/src/object/mainmovie.h +++ b/src/object/mainmovie.h @@ -25,13 +25,15 @@ class CInstanceManager; class CEvent; -class CD3DEngine; class CInterface; class CRobotMain; class CCamera; -class CSound; - +class CSoundInterface; +namespace Gfx +{ + class CEngine; +} /* Gfx */ enum MainMovieType @@ -61,17 +63,17 @@ protected: protected: CInstanceManager* m_iMan; - CEvent* m_event; - CD3DEngine* m_engine; - CInterface* m_interface; - CRobotMain* m_main; - CCamera* m_camera; - CSound* m_sound; - - MainMovieType m_type; - MainMovieType m_stopType; - float m_speed; - float m_progress; + CEvent* m_event; + Gfx::CEngine* m_engine; + CInterface* m_interface; + CRobotMain* m_main; + CCamera* m_camera; + CSoundInterface* m_sound; + + MainMovieType m_type; + MainMovieType m_stopType; + float m_speed; + float m_progress; Math::Vector m_initialEye; Math::Vector m_initialLookat; Math::Vector m_finalEye[2]; diff --git a/src/object/motion/motion.cpp b/src/object/motion/motion.cpp index 6278627..6b22471 100644 --- a/src/object/motion/motion.cpp +++ b/src/object/motion/motion.cpp @@ -95,16 +95,16 @@ bool CMotion::EventProcess(const Event &event) Math::Vector pos, dir; float time; - if ( m_object->RetType() != OBJECT_TOTO && - m_engine->RetPause() ) return true; + if ( m_object->GetType() != OBJECT_TOTO && + m_engine->GetPause() ) return true; if ( event.event != EVENT_FRAME ) return true; m_progress += event.rTime*m_actionTime; if ( m_progress > 1.0f ) m_progress = 1.0f; // (*) - pos = m_object->RetPosition(0); - if ( pos.y < m_water->RetLevel(m_object) ) // underwater? + pos = m_object->GetPosition(0); + if ( pos.y < m_water->GetLevel(m_object) ) // underwater? { time = event.rTime*3.0f; // everything is slower } @@ -113,19 +113,19 @@ bool CMotion::EventProcess(const Event &event) time = event.rTime*10.0f; } - dir = m_object->RetLinVibration(); + dir = m_object->GetLinVibration(); dir.x = Math::Smooth(dir.x, m_linVibration.x, time); dir.y = Math::Smooth(dir.y, m_linVibration.y, time); dir.z = Math::Smooth(dir.z, m_linVibration.z, time); m_object->SetLinVibration(dir); - dir = m_object->RetCirVibration(); + dir = m_object->GetCirVibration(); dir.x = Math::Smooth(dir.x, m_cirVibration.x, time); dir.y = Math::Smooth(dir.y, m_cirVibration.y, time); dir.z = Math::Smooth(dir.z, m_cirVibration.z, time); m_object->SetCirVibration(dir); - dir = m_object->RetInclinaison(); + dir = m_object->GetInclinaison(); dir.x = Math::Smooth(dir.x, m_inclinaison.x, time); dir.y = Math::Smooth(dir.y, m_inclinaison.y, time); dir.z = Math::Smooth(dir.z, m_inclinaison.z, time); @@ -148,9 +148,9 @@ Error CMotion::SetAction(int action, float time) return ERR_OK; } -// Returns the current action. +// Geturns the current action. -int CMotion::RetAction() +int CMotion::GetAction() { return m_actionType; } @@ -163,7 +163,7 @@ bool CMotion::SetParam(int rank, float value) return false; } -float CMotion::RetParam(int rank) +float CMotion::GetParam(int rank) { return 0.0f; } @@ -208,7 +208,7 @@ void CMotion::SetLinVibration(Math::Vector dir) m_linVibration = dir; } -Math::Vector CMotion::RetLinVibration() +Math::Vector CMotion::GetLinVibration() { return m_linVibration; } @@ -220,7 +220,7 @@ void CMotion::SetCirVibration(Math::Vector dir) m_cirVibration = dir; } -Math::Vector CMotion::RetCirVibration() +Math::Vector CMotion::GetCirVibration() { return m_cirVibration; } @@ -232,7 +232,7 @@ void CMotion::SetInclinaison(Math::Vector dir) m_inclinaison = dir; } -Math::Vector CMotion::RetInclinaison() +Math::Vector CMotion::GetInclinaison() { return m_inclinaison; } diff --git a/src/object/motion/motion.h b/src/object/motion/motion.h index 9828283..2ec5c5d 100644 --- a/src/object/motion/motion.h +++ b/src/object/motion/motion.h @@ -51,20 +51,20 @@ public: virtual bool Create(Math::Vector pos, float angle, ObjectType type, float power); virtual bool EventProcess(const Event &event); virtual Error SetAction(int action, float time=0.2f); - virtual int RetAction(); + virtual int GetAction(); virtual bool SetParam(int rank, float value); - virtual float RetParam(int rank); + virtual float GetParam(int rank); virtual bool Write(char *line); virtual bool Read(char *line); virtual void SetLinVibration(Math::Vector dir); - virtual Math::Vector RetLinVibration(); + virtual Math::Vector GetLinVibration(); virtual void SetCirVibration(Math::Vector dir); - virtual Math::Vector RetCirVibration(); + virtual Math::Vector GetCirVibration(); virtual void SetInclinaison(Math::Vector dir); - virtual Math::Vector RetInclinaison(); + virtual Math::Vector GetInclinaison(); protected: diff --git a/src/object/motion/motionvehicle.h b/src/object/motion/motionvehicle.h index 5ca97cd..ca60c1e 100644 --- a/src/object/motion/motionvehicle.h +++ b/src/object/motion/motionvehicle.h @@ -33,11 +33,11 @@ public: bool Create(Math::Vector pos, float angle, ObjectType type, float power); bool EventProcess(const Event &event); - bool RetTraceDown(); + bool GetTraceDown(); void SetTraceDown(bool bDown); - int RetTraceColor(); + int GetTraceColor(); void SetTraceColor(int color); - float RetTraceWidth(); + float GetTraceWidth(); void SetTraceWidth(float width); protected: diff --git a/src/object/object.cpp b/src/object/object.cpp index e2e52e5..c29e59b 100644 --- a/src/object/object.cpp +++ b/src/object/object.cpp @@ -17,76 +17,74 @@ // object.cpp -#include <windows.h> -#include <stdio.h> -#include <d3d.h> - +//---------CBot #include "CBot/CBotDll.h" -#include "common/struct.h" -#include "math/const.h" -#include "math/geometry.h" -#include "old/d3dengine.h" -#include "old/d3dmath.h" -#include "old/d3dutil.h" + +//---------Common #include "common/global.h" -#include "common/event.h" -#include "common/misc.h" #include "common/iman.h" #include "common/restext.h" -#include "old/math3d.h" -#include "object/mainmovie.h" -#include "object/robotmain.h" -#include "old/light.h" -#include "old/terrain.h" -#include "old/water.h" -#include "old/blitz.h" -#include "old/camera.h" -#include "old/particule.h" -#include "physics/physics.h" -#include "object/brain.h" -#include "object/motion/motion.h" -#include "object/motion/motionhuman.h" -#include "object/motion/motiontoto.h" -#include "object/motion/motionvehicle.h" -#include "object/motion/motionmother.h" -#include "object/motion/motionant.h" -#include "object/motion/motionspider.h" -#include "object/motion/motionbee.h" -#include "object/motion/motionworm.h" -#include "old/modfile.h" + +//---------Graphic +#include "graphics/engine/lightman.h" +#include "graphics/engine/lightning.h" +#include "graphics/engine/modelfile.h" +#include "graphics/engine/particle.h" +#include "graphics/engine/pyro.h" +#include "graphics/engine/terrain.h" + +//---------Math +#include "math/geometry.h" + +//---------Object #include "object/auto/auto.h" #include "object/auto/autobase.h" -#include "object/auto/autoportico.h" +#include "object/auto/autoconvert.h" #include "object/auto/autoderrick.h" -#include "object/auto/autofactory.h" -#include "object/auto/autorepair.h" #include "object/auto/autodestroyer.h" -#include "object/auto/autostation.h" -#include "object/auto/autoenergy.h" -#include "object/auto/autoconvert.h" -#include "object/auto/autotower.h" -#include "object/auto/autoresearch.h" -#include "object/auto/autolabo.h" -#include "object/auto/autonuclear.h" -#include "object/auto/autoradar.h" #include "object/auto/autoegg.h" -#include "object/auto/autonest.h" -#include "object/auto/autoroot.h" +#include "object/auto/autoenergy.h" +#include "object/auto/autofactory.h" #include "object/auto/autoflag.h" +#include "object/auto/autohuston.h" #include "object/auto/autoinfo.h" #include "object/auto/autojostle.h" +#include "object/auto/autokid.h" +#include "object/auto/autolabo.h" +#include "object/auto/automush.h" +#include "object/auto/autonest.h" +#include "object/auto/autonuclear.h" #include "object/auto/autopara.h" +#include "object/auto/autoportico.h" +#include "object/auto/autoradar.h" +#include "object/auto/autorepair.h" +#include "object/auto/autoresearch.h" +#include "object/auto/autoroot.h" #include "object/auto/autosafe.h" -#include "object/auto/autohuston.h" -#include "object/auto/automush.h" -#include "object/auto/autokid.h" -#include "object/task/task.h" -#include "old/pyro.h" -#include "ui/displaytext.h" -#include "script/cmdtoken.h" -#include "script/cbottoken.h" -#include "old/sound.h" +#include "object/auto/autostation.h" +#include "object/auto/autotower.h" +#include "object/brain.h" +#include "object/motion/motion.h" +#include "object/motion/motionant.h" +#include "object/motion/motionbee.h" +#include "object/motion/motionhuman.h" +#include "object/motion/motionmother.h" +#include "object/motion/motionspider.h" +#include "object/motion/motiontoto.h" +#include "object/motion/motionvehicle.h" +#include "object/motion/motionworm.h" #include "object/object.h" +#include "object/robotmain.h" + +//---------Physics +#include "physics/physics.h" + +//---------Script +#include "script/cbottoken.h" +#include "script/cmdtoken.h" + +//---------Ui +#include "ui/displaytext.h" @@ -116,7 +114,7 @@ static float debug_arm3 = 0.0f; void uObject(CBotVar* botThis, void* user) { - CObject* object = (CObject*)user; + CObject* object = static_cast<CObject*>(user); CObject* power; CObject* fret; CPhysics* physics; @@ -128,19 +126,19 @@ void uObject(CBotVar* botThis, void* user) if ( object == 0 ) return; - physics = object->RetPhysics(); + physics = object->GetPhysics(); // Updates the object's type. pVar = botThis->GetItemList(); // "category" - type = object->RetType(); - pVar->SetValInt(type, object->RetName()); + type = object->GetType(); + pVar->SetValInt(type, object->GetName()); // Updates the position of the object. pVar = pVar->GetNext(); // "position" - if ( object->RetTruck() == 0 ) + if ( object->GetTruck() == 0 ) { - pos = object->RetPosition(0); - pos.y -= object->RetWaterLevel(); // relative to sea level! + pos = object->GetPosition(0); + pos.y -= object->GetWaterLevel(); // relative to sea level! pSub = pVar->GetItemList(); // "x" pSub->SetValFloat(pos.x/g_unit); pSub = pSub->GetNext(); // "y" @@ -159,8 +157,8 @@ void uObject(CBotVar* botThis, void* user) } // Updates the angle. - pos = object->RetAngle(0); - pos += object->RetInclinaison(); + pos = object->GetAngle(0); + pos += object->GetInclinaison(); pVar = pVar->GetNext(); // "orientation" pVar->SetValFloat(360.0f-Math::Mod(pos.y*180.0f/Math::PI, 360.0f)); pVar = pVar->GetNext(); // "pitch" @@ -170,47 +168,47 @@ void uObject(CBotVar* botThis, void* user) // Updates the energy level of the object. pVar = pVar->GetNext(); // "energyLevel" - value = object->RetEnergy(); + value = object->GetEnergy(); pVar->SetValFloat(value); // Updates the shield level of the object. pVar = pVar->GetNext(); // "shieldLevel" - value = object->RetShield(); + value = object->GetShield(); pVar->SetValFloat(value); // Updates the temperature of the reactor. pVar = pVar->GetNext(); // "temperature" if ( physics == 0 ) value = 0.0f; - else value = 1.0f-physics->RetReactorRange(); + else value = 1.0f-physics->GetReactorRange(); pVar->SetValFloat(value); // Updates the height above the ground. pVar = pVar->GetNext(); // "altitude" if ( physics == 0 ) value = 0.0f; - else value = physics->RetFloorHeight(); + else value = physics->GetFloorHeight(); pVar->SetValFloat(value/g_unit); // Updates the lifetime of the object. pVar = pVar->GetNext(); // "lifeTime" - value = object->RetAbsTime(); + value = object->GetAbsTime(); pVar->SetValFloat(value); // Updates the material of the object. pVar = pVar->GetNext(); // "material" - iValue = object->RetMaterial(); + iValue = object->GetMaterial(); pVar->SetValInt(iValue); // Updates the type of battery. pVar = pVar->GetNext(); // "energyCell" - power = object->RetPower(); + power = object->GetPower(); if ( power == 0 ) pVar->SetPointer(0); - else pVar->SetPointer(power->RetBotVar()); + else pVar->SetPointer(power->GetBotVar()); // Updates the transported object's type. pVar = pVar->GetNext(); // "load" - fret = object->RetFret(); + fret = object->GetFret(); if ( fret == 0 ) pVar->SetPointer(0); - else pVar->SetPointer(fret->RetBotVar()); + else pVar->SetPointer(fret->GetBotVar()); } @@ -225,15 +223,15 @@ CObject::CObject(CInstanceManager* iMan) m_iMan = iMan; m_iMan->AddInstance(CLASS_OBJECT, this, 500); - m_engine = (CD3DEngine*)m_iMan->SearchInstance(CLASS_ENGINE); - m_light = (CLight*)m_iMan->SearchInstance(CLASS_LIGHT); - m_terrain = (CTerrain*)m_iMan->SearchInstance(CLASS_TERRAIN); - m_water = (CWater*)m_iMan->SearchInstance(CLASS_WATER); - m_particule = (CParticule*)m_iMan->SearchInstance(CLASS_PARTICULE); - m_camera = (CCamera*)m_iMan->SearchInstance(CLASS_CAMERA); - m_displayText = (CDisplayText*)m_iMan->SearchInstance(CLASS_DISPLAYTEXT); - m_main = (CRobotMain*)m_iMan->SearchInstance(CLASS_MAIN); - m_sound = (CSound*)m_iMan->SearchInstance(CLASS_SOUND); + m_engine = static_cast<Gfx::CEngine*>(m_iMan->SearchInstance(CLASS_ENGINE)); + m_lightMan = static_cast<Gfx::CLightManager*>(m_iMan->SearchInstance(CLASS_LIGHT)); + m_terrain = static_cast<Gfx::CTerrain*>(m_iMan->SearchInstance(CLASS_TERRAIN)); + m_water = static_cast<Gfx::CWater*>(m_iMan->SearchInstance(CLASS_WATER)); + m_particle = static_cast<Gfx::CParticle*>(m_iMan->SearchInstance(CLASS_PARTICULE)); + m_camera = static_cast<Gfx::CCamera*>(m_iMan->SearchInstance(CLASS_CAMERA)); + m_displayText = static_cast<Ui::CDisplayText*>(m_iMan->SearchInstance(CLASS_DISPLAYTEXT)); + m_main = static_cast<CRobotMain*>(m_iMan->SearchInstance(CLASS_MAIN)); + m_sound = static_cast<CSoundInterface*>(m_iMan->SearchInstance(CLASS_SOUND)); m_physics = 0; m_brain = 0; m_motion = 0; @@ -250,7 +248,7 @@ CObject::CObject(CInstanceManager* iMan) m_linVibration = Math::Vector(0.0f, 0.0f, 0.0f); m_cirVibration = Math::Vector(0.0f, 0.0f, 0.0f); m_inclinaison = Math::Vector(0.0f, 0.0f, 0.0f); - m_lastParticule = 0.0f; + m_lastParticle = 0.0f; m_power = 0; m_fret = 0; @@ -281,7 +279,7 @@ CObject::CObject(CInstanceManager* iMan) m_shotTime = 0.0f; m_bVirusMode = false; m_virusTime = 0.0f; - m_lastVirusParticule = 0.0f; + m_lastVirusParticle = 0.0f; m_totalDesectList = 0; m_bLock = false; m_bExplo = false; @@ -297,7 +295,7 @@ CObject::CObject(CInstanceManager* iMan) m_proxyDistance = 60.0f; m_param = 0.0f; - ZeroMemory(&m_character, sizeof(Character)); + memset(&m_character, 0, sizeof(m_character)); m_character.wheelFront = 1.0f; m_character.wheelBack = 1.0f; m_character.wheelLeft = 1.0f; @@ -309,7 +307,7 @@ CObject::CObject(CInstanceManager* iMan) m_resetAngle = Math::Vector(0.0f, 0.0f, 0.0f); m_resetRun = -1; - m_cameraType = CAMERA_BACK; + m_cameraType = Gfx::CAM_TYPE_BACK; m_cameraDist = 50.0f; m_bCameraLock = false; @@ -376,7 +374,7 @@ CObject::~CObject() void CObject::DeleteObject(bool bAll) { CObject* pObj; - CPyro* pPyro; + Gfx::CPyro* pPyro; int i; if ( m_botVar != 0 ) @@ -384,14 +382,14 @@ void CObject::DeleteObject(bool bAll) m_botVar->SetUserPtr(OBJECTDELETED); } - if ( m_camera->RetObject() == this ) + if ( m_camera->GetObject() == this ) { m_camera->SetObject(0); } for ( i=0 ; i<1000000 ; i++ ) { - pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); + pObj = static_cast<CObject*>(m_iMan->SearchInstance(CLASS_OBJECT, i)); if ( pObj == 0 ) break; pObj->DeleteDeselList(this); @@ -400,29 +398,29 @@ void CObject::DeleteObject(bool bAll) if ( !bAll ) { #if 0 - type = m_camera->RetType(); - if ( (type == CAMERA_BACK || - type == CAMERA_FIX || - type == CAMERA_EXPLO || - type == CAMERA_ONBOARD) && - m_camera->RetObject() == this ) + type = m_camera->GetType(); + if ( (type == Gfx::CAM_TYPE_BACK || + type == Gfx::CAM_TYPE_FIX || + type == Gfx::CAM_TYPE_EXPLO || + type == Gfx::CAM_TYPE_ONBOARD) && + m_camera->GetObject() == this ) { - pObj = m_main->SearchNearest(RetPosition(0), this); + pObj = m_main->SearchNearest(GetPosition(0), this); if ( pObj == 0 ) { m_camera->SetObject(0); - m_camera->SetType(CAMERA_FREE); + m_camera->SetType(Gfx::CAM_TYPE_FREE); } else { m_camera->SetObject(pObj); - m_camera->SetType(CAMERA_BACK); + m_camera->SetType(Gfx::CAM_TYPE_BACK); } } #endif for ( i=0 ; i<1000000 ; i++ ) { - pPyro = (CPyro*)m_iMan->SearchInstance(CLASS_PYRO, i); + pPyro = static_cast<Gfx::CPyro*>(m_iMan->SearchInstance(CLASS_PYRO, i)); if ( pPyro == 0 ) break; pPyro->CutObjectLink(this); // the object no longer exists @@ -453,7 +451,7 @@ void CObject::DeleteObject(bool bAll) m_type == OBJECT_START || m_type == OBJECT_END ) // building? { - m_terrain->DeleteBuildingLevel(RetPosition(0)); // flattens the field + m_terrain->DeleteBuildingLevel(GetPosition(0)); // flattens the field } } @@ -461,19 +459,19 @@ void CObject::DeleteObject(bool bAll) if ( m_partiReactor != -1 ) { - m_particule->DeleteParticule(m_partiReactor); + m_particle->DeleteParticle(m_partiReactor); m_partiReactor = -1; } if ( m_shadowLight != -1 ) { - m_light->DeleteLight(m_shadowLight); + m_lightMan->DeleteLight(m_shadowLight); m_shadowLight = -1; } if ( m_effectLight != -1 ) { - m_light->DeleteLight(m_effectLight); + m_lightMan->DeleteLight(m_effectLight); m_effectLight = -1; } @@ -506,7 +504,7 @@ void CObject::DeleteObject(bool bAll) if ( m_objectPart[i].masterParti != -1 ) { - m_particule->DeleteParticule(m_objectPart[i].masterParti); + m_particle->DeleteParticle(m_objectPart[i].masterParti); m_objectPart[i].masterParti = -1; } } @@ -569,8 +567,8 @@ void CObject::Simplify() bool CObject::ExploObject(ExploType type, float force, float decay) { - PyroType pyroType; - CPyro* pyro; + Gfx::PyroType pyroType; + Gfx::CPyro* pyro; float loss, shield; if ( type == EXPLO_BURN ) @@ -627,7 +625,7 @@ bool CObject::ExploObject(ExploType type, float force, float decay) loss *= decay; // Decreases the power of the shield. - shield = RetShield(); + shield = GetShield(); shield -= loss; if ( shield < 0.0f ) shield = 0.0f; SetShield(shield); @@ -638,26 +636,26 @@ bool CObject::ExploObject(ExploType type, float force, float decay) { if ( m_type == OBJECT_HUMAN ) { - pyroType = PT_SHOTH; + pyroType = Gfx::PT_SHOTH; } else { - pyroType = PT_SHOTW; + pyroType = Gfx::PT_SHOTW; } } else { if ( m_type == OBJECT_HUMAN ) { - pyroType = PT_SHOTH; + pyroType = Gfx::PT_SHOTH; } else if ( m_type == OBJECT_MOTHER ) { - pyroType = PT_SHOTM; + pyroType = Gfx::PT_SHOTM; } else { - pyroType = PT_SHOTT; + pyroType = Gfx::PT_SHOTT; } } } @@ -672,16 +670,16 @@ bool CObject::ExploObject(ExploType type, float force, float decay) m_type == OBJECT_WORM || m_type == OBJECT_BULLET ) { - pyroType = PT_BURNO; + pyroType = Gfx::PT_BURNO; SetBurn(true); } else if ( m_type == OBJECT_HUMAN ) { - pyroType = PT_DEADG; + pyroType = Gfx::PT_DEADG; } else { - pyroType = PT_BURNT; + pyroType = Gfx::PT_BURNT; SetBurn(true); } SetVirusMode(false); @@ -690,11 +688,11 @@ bool CObject::ExploObject(ExploType type, float force, float decay) { if ( m_type == OBJECT_HUMAN ) { - pyroType = PT_DEADW; + pyroType = Gfx::PT_DEADW; } else { - pyroType = PT_FRAGW; + pyroType = Gfx::PT_FRAGW; } } else // explosion? @@ -704,17 +702,17 @@ bool CObject::ExploObject(ExploType type, float force, float decay) m_type == OBJECT_BEE || m_type == OBJECT_WORM ) { - pyroType = PT_EXPLOO; + pyroType = Gfx::PT_EXPLOO; } else if ( m_type == OBJECT_MOTHER || m_type == OBJECT_NEST || m_type == OBJECT_BULLET ) { - pyroType = PT_FRAGO; + pyroType = Gfx::PT_FRAGO; } else if ( m_type == OBJECT_HUMAN ) { - pyroType = PT_DEADG; + pyroType = Gfx::PT_DEADG; } else if ( m_type == OBJECT_BASE || m_type == OBJECT_DERRICK || @@ -737,24 +735,24 @@ bool CObject::ExploObject(ExploType type, float force, float decay) m_type == OBJECT_START || m_type == OBJECT_END ) // building? { - pyroType = PT_FRAGT; + pyroType = Gfx::PT_FRAGT; } else if ( m_type == OBJECT_MOBILEtg || m_type == OBJECT_TEEN28 || // cylinder? m_type == OBJECT_TEEN31 ) // basket? { - pyroType = PT_FRAGT; + pyroType = Gfx::PT_FRAGT; } else { - pyroType = PT_EXPLOT; + pyroType = Gfx::PT_EXPLOT; } } loss = 1.0f; } - pyro = new CPyro(m_iMan); + pyro = new Gfx::CPyro(m_iMan); pyro->Create(pyroType, this, loss); if ( shield == 0.0f ) // dead? @@ -768,10 +766,10 @@ bool CObject::ExploObject(ExploType type, float force, float decay) if ( shield > 0.0f ) return false; // not dead yet - if ( RetSelect() ) + if ( GetSelect() ) { SetSelect(false); // deselects the object - m_camera->SetType(CAMERA_EXPLO); + m_camera->SetType(Gfx::CAM_TYPE_EXPLO); m_main->DeselectAll(); } DeleteDeselList(this); @@ -830,7 +828,7 @@ void CObject::InitPart(int part) } // Creates a new part, and returns its number. -// Returns -1 on error. +// Geturns -1 on error. int CObject::CreatePart() { @@ -855,7 +853,7 @@ void CObject::DeletePart(int part) if ( m_objectPart[part].masterParti != -1 ) { - m_particule->DeleteParticule(m_objectPart[part].masterParti); + m_particle->DeleteParticle(m_objectPart[part].masterParti); m_objectPart[part].masterParti = -1; } @@ -891,9 +889,9 @@ void CObject::SetObjectRank(int part, int objRank) m_objectPart[part].object = objRank; } -// Returns the number of part. +// Geturns the number of part. -int CObject::RetObjectRank(int part) +int CObject::GetObjectRank(int part) { if ( !m_objectPart[part].bUsed ) return -1; return m_objectPart[part].object; @@ -914,7 +912,7 @@ void CObject::SetObjectParent(int part, int parent) void CObject::SetType(ObjectType type) { m_type = type; - strcpy(m_name, RetObjectName(m_type)); + strcpy(m_name, GetObjectName(m_type)); if ( m_type == OBJECT_MOBILErs ) { @@ -940,16 +938,16 @@ void CObject::SetType(ObjectType type) m_type == OBJECT_MOBILEii || m_type == OBJECT_MOBILErc ) // cannon vehicle? { - m_cameraType = CAMERA_ONBOARD; + m_cameraType = Gfx::CAM_TYPE_ONBOARD; } } -ObjectType CObject::RetType() +ObjectType CObject::GetType() { return m_type; } -char* CObject::RetName() +char* CObject::GetName() { return m_name; } @@ -962,7 +960,7 @@ void CObject::SetOption(int option) m_option = option; } -int CObject::RetOption() +int CObject::GetOption() { return m_option; } @@ -980,7 +978,7 @@ void CObject::SetID(int id) } } -int CObject::RetID() +int CObject::GetID() { return m_id; } @@ -996,115 +994,115 @@ bool CObject::Write(char *line) float value; int i; - sprintf(name, " camera=%s", GetCamera(RetCameraType())); + sprintf(name, " camera=%s", GetCamera(GetCameraType())); strcat(line, name); - if ( RetCameraLock() != 0 ) + if ( GetCameraLock() != 0 ) { - sprintf(name, " cameraLock=%d", RetCameraLock()); + sprintf(name, " cameraLock=%d", GetCameraLock()); strcat(line, name); } - if ( RetEnergy() != 0.0f ) + if ( GetEnergy() != 0.0f ) { - sprintf(name, " energy=%.2f", RetEnergy()); + sprintf(name, " energy=%.2f", GetEnergy()); strcat(line, name); } - if ( RetCapacity() != 1.0f ) + if ( GetCapacity() != 1.0f ) { - sprintf(name, " capacity=%.2f", RetCapacity()); + sprintf(name, " capacity=%.2f", GetCapacity()); strcat(line, name); } - if ( RetShield() != 1.0f ) + if ( GetShield() != 1.0f ) { - sprintf(name, " shield=%.2f", RetShield()); + sprintf(name, " shield=%.2f", GetShield()); strcat(line, name); } - if ( RetRange() != 1.0f ) + if ( GetRange() != 1.0f ) { - sprintf(name, " range=%.2f", RetRange()); + sprintf(name, " range=%.2f", GetRange()); strcat(line, name); } - if ( RetSelectable() != 1 ) + if ( GetSelectable() != 1 ) { - sprintf(name, " selectable=%d", RetSelectable()); + sprintf(name, " selectable=%d", GetSelectable()); strcat(line, name); } - if ( RetEnable() != 1 ) + if ( GetEnable() != 1 ) { - sprintf(name, " enable=%d", RetEnable()); + sprintf(name, " enable=%d", GetEnable()); strcat(line, name); } - if ( RetFixed() != 0 ) + if ( GetFixed() != 0 ) { - sprintf(name, " fixed=%d", RetFixed()); + sprintf(name, " fixed=%d", GetFixed()); strcat(line, name); } - if ( RetClip() != 1 ) + if ( GetClip() != 1 ) { - sprintf(name, " clip=%d", RetClip()); + sprintf(name, " clip=%d", GetClip()); strcat(line, name); } - if ( RetLock() != 0 ) + if ( GetLock() != 0 ) { - sprintf(name, " lock=%d", RetLock()); + sprintf(name, " lock=%d", GetLock()); strcat(line, name); } - if ( RetProxyActivate() != 0 ) + if ( GetProxyActivate() != 0 ) { - sprintf(name, " proxyActivate=%d", RetProxyActivate()); + sprintf(name, " proxyActivate=%d", GetProxyActivate()); strcat(line, name); - sprintf(name, " proxyDistance=%.2f", RetProxyDistance()/g_unit); + sprintf(name, " proxyDistance=%.2f", GetProxyDistance()/g_unit); strcat(line, name); } - if ( RetMagnifyDamage() != 1.0f ) + if ( GetMagnifyDamage() != 1.0f ) { - sprintf(name, " magnifyDamage=%.2f", RetMagnifyDamage()); + sprintf(name, " magnifyDamage=%.2f", GetMagnifyDamage()); strcat(line, name); } - if ( RetGunGoalV() != 0.0f ) + if ( GetGunGoalV() != 0.0f ) { - sprintf(name, " aimV=%.2f", RetGunGoalV()); + sprintf(name, " aimV=%.2f", GetGunGoalV()); strcat(line, name); } - if ( RetGunGoalH() != 0.0f ) + if ( GetGunGoalH() != 0.0f ) { - sprintf(name, " aimH=%.2f", RetGunGoalH()); + sprintf(name, " aimH=%.2f", GetGunGoalH()); strcat(line, name); } - if ( RetParam() != 0.0f ) + if ( GetParam() != 0.0f ) { - sprintf(name, " param=%.2f", RetParam()); + sprintf(name, " param=%.2f", GetParam()); strcat(line, name); } - if ( RetResetCap() != 0 ) + if ( GetResetCap() != 0 ) { - sprintf(name, " resetCap=%d", RetResetCap()); + sprintf(name, " resetCap=%d", GetResetCap()); strcat(line, name); - pos = RetResetPosition()/g_unit; + pos = GetResetPosition()/g_unit; sprintf(name, " resetPos=%.2f;%.2f;%.2f", pos.x, pos.y, pos.z); strcat(line, name); - pos = RetResetAngle()/(Math::PI/180.0f); + pos = GetResetAngle()/(Math::PI/180.0f); sprintf(name, " resetAngle=%.2f;%.2f;%.2f", pos.x, pos.y, pos.z); strcat(line, name); - sprintf(name, " resetRun=%d", RetResetRun()); + sprintf(name, " resetRun=%d", GetResetRun()); strcat(line, name); } @@ -1123,7 +1121,7 @@ bool CObject::Write(char *line) // Puts information in terminal (OBJECT_INFO). for ( i=0 ; i<m_infoTotal ; i++ ) { - info = RetInfo(i); + info = GetInfo(i); if ( info.name[0] == 0 ) break; sprintf(name, " info%d=\"%s=%.2f\"", i+1, info.name, info.value); @@ -1133,7 +1131,7 @@ bool CObject::Write(char *line) // Sets the parameters of the command line. for ( i=0 ; i<OBJECTMAXCMDLINE ; i++ ) { - value = RetCmdLine(i); + value = GetCmdLine(i); if ( value == NAN ) break; if ( i == 0 ) sprintf(name, " cmdline=%.2f", value); @@ -1164,21 +1162,21 @@ bool CObject::Write(char *line) return true; } -// Returns all parameters of the object. +// Geturns all parameters of the object. bool CObject::Read(char *line) { Math::Vector pos, dir; - Info info; - CameraType cType; - char op[20]; - char text[100]; - char* p; - float value; - int i; + Info info; + Gfx::CameraType cType; + char op[20]; + char text[100]; + char* p; + float value; + int i; cType = OpCamera(line, "camera"); - if ( cType != CAMERA_NULL ) + if ( cType != Gfx::CAM_TYPE_NULL ) { SetCameraType(cType); } @@ -1200,7 +1198,7 @@ bool CObject::Read(char *line) SetGunGoalV(OpFloat(line, "aimV", 0.0f)); SetGunGoalH(OpFloat(line, "aimH", 0.0f)); SetParam(OpFloat(line, "param", 0.0f)); - SetResetCap((ResetCap)OpInt(line, "resetCap", 0)); + SetResetCap(static_cast<ResetCap>(OpInt(line, "resetCap", 0))); SetResetPosition(OpDir(line, "resetPos")*g_unit); SetResetAngle(OpDir(line, "resetAngle")*(Math::PI/180.0f)); SetResetRun(OpInt(line, "resetRun", 0)); @@ -1291,7 +1289,7 @@ int CObject::CreateCrashSphere(Math::Vector pos, float radius, Sound sound, if ( m_crashSphereUsed >= MAXCRASHSPHERE ) return -1; - zoom = RetZoomX(0); + zoom = GetZoomX(0); m_crashSpherePos[m_crashSphereUsed] = pos; m_crashSphereRadius[m_crashSphereUsed] = radius*zoom; m_crashSphereHardness[m_crashSphereUsed] = hardness; @@ -1299,14 +1297,14 @@ int CObject::CreateCrashSphere(Math::Vector pos, float radius, Sound sound, return m_crashSphereUsed++; } -// Returns the number of spheres. +// Geturns the number of spheres. -int CObject::RetCrashSphereTotal() +int CObject::GetCrashSphereTotal() { return m_crashSphereUsed; } -// Returns a sphere for collisions. +// Geturns a sphere for collisions. // The position is absolute in the world. bool CObject::GetCrashSphere(int rank, Math::Vector &pos, float &radius) @@ -1318,7 +1316,7 @@ bool CObject::GetCrashSphere(int rank, Math::Vector &pos, float &radius) return false; } - // Returns to the sphere collisions, + // Geturns to the sphere collisions, // which ignores the inclination of the vehicle. // This is necessary to collisions with vehicles, // so as not to reflect SetInclinaison, for example. @@ -1342,16 +1340,16 @@ bool CObject::GetCrashSphere(int rank, Math::Vector &pos, float &radius) return true; } -// Returns the hardness of a sphere. +// Geturns the hardness of a sphere. -Sound CObject::RetCrashSphereSound(int rank) +Sound CObject::GetCrashSphereSound(int rank) { return m_crashSphereSound[rank]; } -// Returns the hardness of a sphere. +// Geturns the hardness of a sphere. -float CObject::RetCrashSphereHardness(int rank) +float CObject::GetCrashSphereHardness(int rank) { return m_crashSphereHardness[rank]; } @@ -1378,12 +1376,12 @@ void CObject::SetGlobalSphere(Math::Vector pos, float radius) { float zoom; - zoom = RetZoomX(0); + zoom = GetZoomX(0); m_globalSpherePos = pos; m_globalSphereRadius = radius*zoom; } -// Returns the global sphere, in the world. +// Geturns the global sphere, in the world. void CObject::GetGlobalSphere(Math::Vector &pos, float &radius) { @@ -1416,9 +1414,9 @@ void CObject::SetShieldRadius(float radius) m_shieldRadius = radius; } -// Returns the radius of the shield. +// Geturns the radius of the shield. -float CObject::RetShieldRadius() +float CObject::GetShieldRadius() { return m_shieldRadius; } @@ -1431,7 +1429,7 @@ void CObject::SetFloorHeight(float height) Math::Vector pos; pos = m_objectPart[0].position; - m_terrain->MoveOnFloor(pos); + m_terrain->AdjustToFloor(pos); if ( m_physics != 0 ) { @@ -1451,7 +1449,7 @@ void CObject::FloorAdjust() Math::Point nn; float a; - pos = RetPosition(0); + pos = GetPosition(0); if ( m_terrain->GetNormal(n, pos) ) { #if 0 @@ -1459,7 +1457,7 @@ void CObject::FloorAdjust() SetAngleZ(0, -sinf(n.x)); SetAngleY(0, 0.0f); #else - a = RetAngleY(0); + a = GetAngleY(0); nn = Math::RotatePoint(-a, Math::Point(n.z, n.x)); SetAngleX(0, sinf(nn.x)); SetAngleZ(0, -sinf(nn.y)); @@ -1481,7 +1479,7 @@ void CObject::SetLinVibration(Math::Vector dir) } } -Math::Vector CObject::RetLinVibration() +Math::Vector CObject::GetLinVibration() { return m_linVibration; } @@ -1499,7 +1497,7 @@ void CObject::SetCirVibration(Math::Vector dir) } } -Math::Vector CObject::RetCirVibration() +Math::Vector CObject::GetCirVibration() { return m_cirVibration; } @@ -1517,7 +1515,7 @@ void CObject::SetInclinaison(Math::Vector dir) } } -Math::Vector CObject::RetInclinaison() +Math::Vector CObject::GetInclinaison() { return m_inclinaison; } @@ -1539,10 +1537,10 @@ void CObject::SetPosition(int part, const Math::Vector &pos) rank = m_objectPart[0].object; shPos = pos; - m_terrain->MoveOnFloor(shPos, true); + m_terrain->AdjustToFloor(shPos, true); m_engine->SetObjectShadowPos(rank, shPos); - if ( m_physics != 0 && m_physics->RetType() == TYPE_FLYING ) + if ( m_physics != 0 && m_physics->GetType() == TYPE_FLYING ) { height = pos.y-shPos.y; } @@ -1554,7 +1552,7 @@ void CObject::SetPosition(int part, const Math::Vector &pos) // Calculating the normal to the ground in nine strategic locations, // then perform a weighted average (the dots in the center are more important). - radius = m_engine->RetObjectShadowRadius(rank); + radius = m_engine->GetObjectShadowRadius(rank); i = 0; m_terrain->GetNormal(norm, pos); @@ -1619,7 +1617,7 @@ void CObject::SetPosition(int part, const Math::Vector &pos) { norm += n[j]; } - norm /= (float)i; // average vector + norm /= static_cast<float>(i); // average vector m_engine->SetObjectShadowNormal(rank, norm); @@ -1627,14 +1625,14 @@ void CObject::SetPosition(int part, const Math::Vector &pos) { shPos = pos; shPos.y += m_shadowHeight; - m_light->SetLightPos(m_shadowLight, shPos); + m_lightMan->SetLightPos(m_shadowLight, shPos); } if ( m_effectLight != -1 ) { shPos = pos; shPos.y += m_effectHeight; - m_light->SetLightPos(m_effectLight, shPos); + m_lightMan->SetLightPos(m_effectLight, shPos); } if ( m_bShowLimit ) @@ -1644,7 +1642,7 @@ void CObject::SetPosition(int part, const Math::Vector &pos) } } -Math::Vector CObject::RetPosition(int part) +Math::Vector CObject::GetPosition(int part) { return m_objectPart[part].position; } @@ -1662,7 +1660,7 @@ void CObject::SetAngle(int part, const Math::Vector &angle) } } -Math::Vector CObject::RetAngle(int part) +Math::Vector CObject::GetAngle(int part) { return m_objectPart[part].angle; } @@ -1696,17 +1694,17 @@ void CObject::SetAngleZ(int part, float angle) m_objectPart[part].bRotate = true; //it will recalculate the matrices } -float CObject::RetAngleY(int part) +float CObject::GetAngleY(int part) { return m_objectPart[part].angle.y; } -float CObject::RetAngleX(int part) +float CObject::GetAngleX(int part) { return m_objectPart[part].angle.x; } -float CObject::RetAngleZ(int part) +float CObject::GetAngleZ(int part) { return m_objectPart[part].angle.z; } @@ -1736,7 +1734,7 @@ void CObject::SetZoom(int part, Math::Vector zoom) m_objectPart[part].zoom.z != 1.0f ); } -Math::Vector CObject::RetZoom(int part) +Math::Vector CObject::GetZoom(int part) { return m_objectPart[part].zoom; } @@ -1771,27 +1769,27 @@ void CObject::SetZoomZ(int part, float zoom) m_objectPart[part].zoom.z != 1.0f ); } -float CObject::RetZoomX(int part) +float CObject::GetZoomX(int part) { return m_objectPart[part].zoom.x; } -float CObject::RetZoomY(int part) +float CObject::GetZoomY(int part) { return m_objectPart[part].zoom.y; } -float CObject::RetZoomZ(int part) +float CObject::GetZoomZ(int part) { return m_objectPart[part].zoom.z; } -// Returns the water level. +// Geturns the water level. -float CObject::RetWaterLevel() +float CObject::GetWaterLevel() { - return m_water->RetLevel(); + return m_water->GetLevel(); } @@ -1801,11 +1799,11 @@ void CObject::SetTrainer(bool bEnable) if ( m_bTrainer ) // training? { - m_cameraType = CAMERA_FIX; + m_cameraType = Gfx::CAM_TYPE_FIX; } } -bool CObject::RetTrainer() +bool CObject::GetTrainer() { return m_bTrainer; } @@ -1815,7 +1813,7 @@ void CObject::SetToy(bool bEnable) m_bToy = bEnable; } -bool CObject::RetToy() +bool CObject::GetToy() { return m_bToy; } @@ -1825,7 +1823,7 @@ void CObject::SetManual(bool bManual) m_bManual = bManual; } -bool CObject::RetManual() +bool CObject::GetManual() { return m_bManual; } @@ -1835,7 +1833,7 @@ void CObject::SetResetCap(ResetCap cap) m_resetCap = cap; } -ResetCap CObject::RetResetCap() +ResetCap CObject::GetResetCap() { return m_resetCap; } @@ -1845,7 +1843,7 @@ void CObject::SetResetBusy(bool bBusy) m_bResetBusy = bBusy; } -bool CObject::RetResetBusy() +bool CObject::GetResetBusy() { return m_bResetBusy; } @@ -1855,7 +1853,7 @@ void CObject::SetResetPosition(const Math::Vector &pos) m_resetPosition = pos; } -Math::Vector CObject::RetResetPosition() +Math::Vector CObject::GetResetPosition() { return m_resetPosition; } @@ -1865,12 +1863,12 @@ void CObject::SetResetAngle(const Math::Vector &angle) m_resetAngle = angle; } -Math::Vector CObject::RetResetAngle() +Math::Vector CObject::GetResetAngle() { return m_resetAngle; } -int CObject::RetResetRun() +int CObject::GetResetRun() { return m_resetRun; } @@ -1883,12 +1881,12 @@ void CObject::SetResetRun(int run) // Management of the particle master. -void CObject::SetMasterParticule(int part, int parti) +void CObject::SetMasterParticle(int part, int parti) { m_objectPart[part].masterParti = parti; } -int CObject::RetMasterParticule(int part) +int CObject::GetMasterParticle(int part) { return m_objectPart[part].masterParti; } @@ -1901,7 +1899,7 @@ void CObject::SetPower(CObject* power) m_power = power; } -CObject* CObject::RetPower() +CObject* CObject::GetPower() { return m_power; } @@ -1913,7 +1911,7 @@ void CObject::SetFret(CObject* fret) m_fret = fret; } -CObject* CObject::RetFret() +CObject* CObject::GetFret() { return m_fret; } @@ -1928,7 +1926,7 @@ void CObject::SetTruck(CObject* truck) m_engine->SetObjectShadowHide(m_objectPart[0].object, (m_truck != 0)); } -CObject* CObject::RetTruck() +CObject* CObject::GetTruck() { return m_truck; } @@ -1940,7 +1938,7 @@ void CObject::SetTruckPart(int part) m_truckLink = part; } -int CObject::RetTruckPart() +int CObject::GetTruckPart() { return m_truckLink; } @@ -1977,13 +1975,13 @@ void CObject::SetInfo(int rank, Info info) m_bInfoUpdate = true; } -Info CObject::RetInfo(int rank) +Info CObject::GetInfo(int rank) { if ( rank < 0 || rank >= OBJECTMAXINFO ) rank = 0; return m_info[rank]; } -int CObject::RetInfoTotal() +int CObject::GetInfoTotal() { return m_infoTotal; } @@ -1993,7 +1991,7 @@ void CObject::SetInfoReturn(float value) m_infoReturn = value; } -float CObject::RetInfoReturn() +float CObject::GetInfoReturn() { return m_infoReturn; } @@ -2003,7 +2001,7 @@ void CObject::SetInfoUpdate(bool bUpdate) m_bInfoUpdate = bUpdate; } -bool CObject::RetInfoUpdate() +bool CObject::GetInfoUpdate() { return m_bInfoUpdate; } @@ -2016,31 +2014,31 @@ bool CObject::SetCmdLine(int rank, float value) return true; } -float CObject::RetCmdLine(int rank) +float CObject::GetCmdLine(int rank) { if ( rank < 0 || rank >= OBJECTMAXCMDLINE ) return 0.0f; return m_cmdLine[rank]; } -// Returns matrices of an object portion. +// Geturns matrices of an object portion. -Math::Matrix* CObject::RetRotateMatrix(int part) +Math::Matrix* CObject::GetRotateMatrix(int part) { return &m_objectPart[part].matRotate; } -Math::Matrix* CObject::RetTranslateMatrix(int part) +Math::Matrix* CObject::GetTranslateMatrix(int part) { return &m_objectPart[part].matTranslate; } -Math::Matrix* CObject::RetTransformMatrix(int part) +Math::Matrix* CObject::GetTransformMatrix(int part) { return &m_objectPart[part].matTransform; } -Math::Matrix* CObject::RetWorldMatrix(int part) +Math::Matrix* CObject::GetWorldMatrix(int part) { if ( m_objectPart[0].bTranslate || m_objectPart[0].bRotate ) @@ -2062,7 +2060,7 @@ void CObject::SetDrawWorld(bool bDraw) { if ( m_objectPart[i].bUsed ) { - m_engine->SetDrawWorld(m_objectPart[i].object, bDraw); + m_engine->SetObjectDrawWorld(m_objectPart[i].object, bDraw); } } } @@ -2077,7 +2075,7 @@ void CObject::SetDrawFront(bool bDraw) { if ( m_objectPart[i].bUsed ) { - m_engine->SetDrawFront(m_objectPart[i].object, bDraw); + m_engine->SetObjectDrawFront(m_objectPart[i].object, bDraw); } } } @@ -2242,94 +2240,93 @@ bool CObject::CreateInsect(Math::Vector pos, float angle, ObjectType type) // Creates shade under a vehicle as a negative light. -bool CObject::CreateShadowLight(float height, D3DCOLORVALUE color) +bool CObject::CreateShadowLight(float height, Gfx::Color color) { - D3DLIGHT7 light; + Gfx::Light light; Math::Vector pos; - if ( !m_engine->RetLightMode() ) return true; + if ( !m_engine->GetLightMode() ) return true; - pos = RetPosition(0); + pos = GetPosition(0); m_shadowHeight = height; - ZeroMemory( &light, sizeof(light) ); - light.dltType = D3DLIGHT_SPOT; - light.dcvDiffuse.r = color.r; - light.dcvDiffuse.g = color.g; - light.dcvDiffuse.b = color.b; - light.dvPosition.x = pos.x; - light.dvPosition.y = pos.y+height; - light.dvPosition.z = pos.z; - light.dvDirection.x = 0.0f; - light.dvDirection.y = -1.0f; // against the bottom - light.dvDirection.z = 0.0f; - light.dvRange = D3DLIGHT_RANGE_MAX; - light.dvFalloff = 1.0f; - light.dvAttenuation0 = 1.0f; - light.dvAttenuation1 = 0.0f; - light.dvAttenuation2 = 0.0f; - light.dvTheta = 0.0f; - light.dvPhi = Math::PI/4.0f; - - m_shadowLight = m_light->CreateLight(); + light.type = Gfx::LIGHT_SPOT; + light.diffuse.r = color.r; + light.diffuse.g = color.g; + light.diffuse.b = color.b; + light.position.x = pos.x; + light.position.y = pos.y+height; + light.position.z = pos.z; + light.direction.x = 0.0f; + light.direction.y = -1.0f; // against the bottom + light.direction.z = 0.0f; + //TODO Is this value correct + light.spotIntensity = 128; + light.attenuation0 = 1.0f; + light.attenuation1 = 0.0f; + light.attenuation2 = 0.0f; + //TODO Is this value correct + light.spotAngle = 90; + + m_shadowLight = m_lightMan->CreateLight(); if ( m_shadowLight == -1 ) return false; - m_light->SetLight(m_shadowLight, light); + m_lightMan->SetLight(m_shadowLight, light); // Only illuminates the objects on the ground. - m_light->SetLightIncluType(m_shadowLight, TYPETERRAIN); + m_lightMan->SetLightIncludeType(m_shadowLight, Gfx::ENG_OBJTYPE_TERRAIN); return true; } -// Returns the number of negative light shade. +// Geturns the number of negative light shade. -int CObject::RetShadowLight() +int CObject::GetShadowLight() { return m_shadowLight; } // Creates light for the effects of a vehicle. -bool CObject::CreateEffectLight(float height, D3DCOLORVALUE color) +bool CObject::CreateEffectLight(float height, Gfx::Color color) { - D3DLIGHT7 light; + Gfx::Light light; - if ( !m_engine->RetLightMode() ) return true; + if ( !m_engine->GetLightMode() ) return true; m_effectHeight = height; - ZeroMemory( &light, sizeof(light) ); - light.dltType = D3DLIGHT_SPOT; - light.dcvDiffuse.r = color.r; - light.dcvDiffuse.g = color.g; - light.dcvDiffuse.b = color.b; - light.dvPosition.x = 0.0f; - light.dvPosition.y = 0.0f+height; - light.dvPosition.z = 0.0f; - light.dvDirection.x = 0.0f; - light.dvDirection.y = -1.0f; // against the bottom - light.dvDirection.z = 0.0f; - light.dvRange = D3DLIGHT_RANGE_MAX; - light.dvFalloff = 1.0f; - light.dvAttenuation0 = 1.0f; - light.dvAttenuation1 = 0.0f; - light.dvAttenuation2 = 0.0f; - light.dvTheta = 0.0f; - light.dvPhi = Math::PI/4.0f; - - m_effectLight = m_light->CreateLight(); + memset( &light, 0, sizeof(light) ); + light.type = Gfx::LIGHT_SPOT; + light.diffuse.r = color.r; + light.diffuse.g = color.g; + light.diffuse.b = color.b; + light.position.x = 0.0f; + light.position.y = 0.0f+height; + light.position.z = 0.0f; + light.direction.x = 0.0f; + light.direction.y = -1.0f; // against the bottom + light.direction.z = 0.0f; + //TODO Is this value correct + light.spotIntensity = 1.0f; + light.attenuation0 = 1.0f; + light.attenuation1 = 0.0f; + light.attenuation2 = 0.0f; + //TODO Is this value correct + light.spotAngle = 90; + + m_effectLight = m_lightMan->CreateLight(); if ( m_effectLight == -1 ) return false; - m_light->SetLight(m_effectLight, light); - m_light->SetLightIntensity(m_effectLight, 0.0f); + m_lightMan->SetLight(m_effectLight, light); + m_lightMan->SetLightIntensity(m_effectLight, 0.0f); return true; } -// Returns the number of light effects. +// Geturns the number of light effects. -int CObject::RetEffectLight() +int CObject::GetEffectLight() { return m_effectLight; } @@ -2337,15 +2334,15 @@ int CObject::RetEffectLight() // Creates the circular shadow underneath a vehicle. bool CObject::CreateShadowCircle(float radius, float intensity, - D3DShadowType type) + Gfx::EngineShadowType type) { float zoom; if ( intensity == 0.0f ) return true; - zoom = RetZoomX(0); + zoom = GetZoomX(0); - m_engine->ShadowCreate(m_objectPart[0].object); + m_engine->CreateShadow(m_objectPart[0].object); m_engine->SetObjectShadowRadius(m_objectPart[0].object, radius*zoom); m_engine->SetObjectShadowIntensity(m_objectPart[0].object, intensity); @@ -2361,18 +2358,16 @@ bool CObject::CreateShadowCircle(float radius, float intensity, bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, ObjectType type, float power) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; Math::Point p; int rank, i; - if ( m_engine->RetRestCreate() < 20 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); // it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); // it is a stationary object SetObjectRank(0, rank); if ( m_type == OBJECT_PORTICO ) @@ -2384,7 +2379,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\portico2.mod"); @@ -2392,7 +2387,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetPosition(1, Math::Vector(0.0f, 67.0f, 0.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 1); pModFile->ReadModel("objects\\portico3.mod"); @@ -2401,7 +2396,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleY(2, 45.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(3, rank); SetObjectParent(3, 2); pModFile->ReadModel("objects\\portico4.mod"); @@ -2410,7 +2405,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleY(3, -60.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(4, rank); SetObjectParent(4, 3); pModFile->ReadModel("objects\\portico5.mod"); @@ -2419,7 +2414,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleY(4, -55.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(5, rank); SetObjectParent(5, 1); pModFile->ReadModel("objects\\portico3.mod"); @@ -2428,7 +2423,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleY(5, -45.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(6, rank); SetObjectParent(6, 5); pModFile->ReadModel("objects\\portico4.mod"); @@ -2437,7 +2432,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleY(6, 60.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(7, rank); SetObjectParent(7, 6); pModFile->ReadModel("objects\\portico5.mod"); @@ -2446,7 +2441,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleY(7, 55.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(8, rank); SetObjectParent(8, 0); pModFile->ReadModel("objects\\portico6.mod"); @@ -2456,7 +2451,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetZoom(8, 2.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(9, rank); SetObjectParent(9, 8); pModFile->ReadModel("objects\\portico7.mod"); @@ -2464,7 +2459,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetPosition(9, Math::Vector(0.0f, 4.5f, 1.9f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(10, rank); SetObjectParent(10, 0); pModFile->ReadModel("objects\\portico6.mod"); @@ -2474,7 +2469,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetZoom(10, 2.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(11, rank); SetObjectParent(11, 10); pModFile->ReadModel("objects\\portico7.mod"); @@ -2508,7 +2503,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, for ( i=0 ; i<8 ; i++ ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1+i, rank); SetObjectParent(1+i, 0); pModFile->ReadModel("objects\\base2.mod"); @@ -2519,7 +2514,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleZ(1+i, Math::PI/2.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(10+i, rank); SetObjectParent(10+i, 1+i); pModFile->ReadModel("objects\\base4.mod"); @@ -2527,7 +2522,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetPosition(10+i, Math::Vector(23.5f, 0.0f, 7.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(18+i, rank); SetObjectParent(18+i, 1+i); pModFile->ReadModel("objects\\base4.mod"); @@ -2537,7 +2532,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, } rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(9, rank); SetObjectParent(9, 0); pModFile->ReadModel("objects\\base3.mod"); // central pillar @@ -2578,7 +2573,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\derrick2.mod"); @@ -2603,7 +2598,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\search2.mod"); @@ -2611,7 +2606,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetPosition(1, Math::Vector(0.0f, 13.0f, 0.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 1); pModFile->ReadModel("objects\\search3.mod"); @@ -2638,7 +2633,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\radar2.mod"); @@ -2646,7 +2641,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetPosition(1, Math::Vector(0.0f, 5.0f, 0.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 0); pModFile->ReadModel("objects\\radar3.mod"); @@ -2655,7 +2650,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleY(2, -Math::PI/2.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(3, rank); SetObjectParent(3, 2); pModFile->ReadModel("objects\\radar4.mod"); @@ -2678,7 +2673,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\info2.mod"); @@ -2688,7 +2683,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, for ( i=0 ; i<3 ; i++ ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2+i*2, rank); SetObjectParent(2+i*2, 1); pModFile->ReadModel("objects\\info3.mod"); @@ -2696,7 +2691,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetPosition(2+i*2, Math::Vector(0.0f, 4.5f, 0.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(3+i*2, rank); SetObjectParent(3+i*2, 2+i*2); pModFile->ReadModel("objects\\radar4.mod"); @@ -2741,7 +2736,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\labo2.mod"); @@ -2750,7 +2745,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleZ(1, Math::PI/2.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 1); pModFile->ReadModel("objects\\labo3.mod"); @@ -2758,7 +2753,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetPosition(2, Math::Vector(9.0f, -1.0f, 0.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(3, rank); SetObjectParent(3, 2); pModFile->ReadModel("objects\\labo4.mod"); @@ -2767,7 +2762,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleZ(3, 80.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(4, rank); SetObjectParent(4, 2); pModFile->ReadModel("objects\\labo4.mod"); @@ -2777,7 +2772,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleY(4, Math::PI*2.0f/3.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(5, rank); SetObjectParent(5, 2); pModFile->ReadModel("objects\\labo4.mod"); @@ -2809,7 +2804,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, for ( i=0 ; i<9 ; i++ ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1+i, rank); SetObjectParent(1+i, 0); pModFile->ReadModel("objects\\factory2.mod"); @@ -2819,7 +2814,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetZoomZ(1+i, 0.30f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(10+i, rank); SetObjectParent(10+i, 0); pModFile->ReadModel("objects\\factory2.mod"); @@ -2832,7 +2827,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, for ( i=0 ; i<2 ; i++ ) { - float s = (float)(i*2-1); + float s = static_cast<float>(i*2-1); CreateCrashSphere(Math::Vector(-10.0f, 2.0f, 11.0f*s), 4.0f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector( -3.0f, 2.0f, 11.0f*s), 4.0f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector( 3.0f, 2.0f, 11.0f*s), 4.0f, SOUND_BOUMm, 0.45f); @@ -2867,7 +2862,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\repair2.mod"); @@ -2893,7 +2888,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\destroy2.mod"); @@ -2936,7 +2931,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\convert2.mod"); @@ -2944,7 +2939,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetPosition(1, Math::Vector(0.0f, 14.0f, 0.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 0); pModFile->ReadModel("objects\\convert3.mod"); @@ -2953,7 +2948,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleX(2, -Math::PI*0.35f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(3, rank); SetObjectParent(3, 0); pModFile->ReadModel("objects\\convert3.mod"); @@ -2980,7 +2975,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\roller2c.mod"); @@ -2989,7 +2984,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetAngleZ(1, Math::PI/2.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 1); pModFile->ReadModel("objects\\roller3c.mod"); @@ -3006,7 +3001,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, m_character.posPower = Math::Vector(5.0f, 3.0f, 0.0f); CreateShadowCircle(6.0f, 1.0f); - m_showLimitRadius = BLITZPARA; + m_showLimitRadius = Gfx::BLITZPARA; } if ( m_type == OBJECT_NUCLEAR ) @@ -3018,7 +3013,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\nuclear2.mod"); @@ -3059,7 +3054,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetGlobalSphere(Math::Vector(0.0f, 10.0f, 0.0f), 20.0f); CreateShadowCircle(21.0f, 1.0f); - m_showLimitRadius = BLITZPARA; + m_showLimitRadius = Gfx::BLITZPARA; } if ( m_type == OBJECT_SAFE ) @@ -3071,7 +3066,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\safe2.mod"); @@ -3079,7 +3074,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetZoom(1, 1.05f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 0); pModFile->ReadModel("objects\\safe3.mod"); @@ -3103,7 +3098,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\huston2.mod"); @@ -3113,7 +3108,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, SetZoom(1, 3.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 1); pModFile->ReadModel("objects\\huston3.mod"); @@ -3223,14 +3218,14 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, pPower->SetType(power<=1.0f?OBJECT_POWER:OBJECT_ATOMIC); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); pPower->SetObjectRank(0, rank); if ( power <= 1.0f ) pModFile->ReadModel("objects\\power.mod"); else pModFile->ReadModel("objects\\atomic.mod"); pModFile->CreateEngineObject(rank); - pPower->SetPosition(0, RetCharacter()->posPower); + pPower->SetPosition(0, GetCharacter()->posPower); pPower->CreateCrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f); pPower->SetGlobalSphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.5f); @@ -3242,12 +3237,12 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, } #endif - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); // to display the shadows immediately CreateOtherObject(type); - m_engine->LoadAllTexture(); + m_engine->LoadAllTextures(); delete pModFile; return true; @@ -3258,22 +3253,17 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height, bool CObject::CreateResource(Math::Vector pos, float angle, ObjectType type, float power) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; char name[50]; int rank; float radius, height; - if ( type != OBJECT_SHOW ) - { - if ( m_engine->RetRestCreate() < 1 ) return false; - } - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); // it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); // it is a stationary object SetObjectRank(0, rank); SetEnergy(power); @@ -3363,10 +3353,10 @@ bool CObject::CreateResource(Math::Vector pos, float angle, ObjectType type, SetFloorHeight(0.0f); CreateOtherObject(type); - m_engine->LoadAllTexture(); + m_engine->LoadAllTextures(); FloorAdjust(); - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); // to display the shadows immediately @@ -3378,13 +3368,11 @@ bool CObject::CreateResource(Math::Vector pos, float angle, ObjectType type, bool CObject::CreateFlag(Math::Vector pos, float angle, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; char name[50]; int rank, i; - if ( m_engine->RetRestCreate() < 1+4 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); @@ -3396,7 +3384,7 @@ bool CObject::CreateFlag(Math::Vector pos, float angle, ObjectType type) if ( type == OBJECT_FLAGv ) strcpy(name, "objects\\flag1v.mod"); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); // it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); // it is a stationary object SetObjectRank(0, rank); pModFile->ReadModel(name); pModFile->CreateEngineObject(rank); @@ -3413,7 +3401,7 @@ bool CObject::CreateFlag(Math::Vector pos, float angle, ObjectType type) for ( i=0 ; i<4 ; i++ ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1+i, rank); SetObjectParent(1+i, i); pModFile->ReadModel(name); @@ -3427,10 +3415,10 @@ bool CObject::CreateFlag(Math::Vector pos, float angle, ObjectType type) SetFloorHeight(0.0f); CreateOtherObject(type); - m_engine->LoadAllTexture(); + m_engine->LoadAllTextures(); FloorAdjust(); - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately delete pModFile; @@ -3442,19 +3430,17 @@ bool CObject::CreateFlag(Math::Vector pos, float angle, ObjectType type) bool CObject::CreateBarrier(Math::Vector pos, float angle, float height, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; int rank; - if ( m_engine->RetRestCreate() < 1 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); if ( type == OBJECT_BARRIER0 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\barrier0.mod"); pModFile->CreateEngineObject(rank); @@ -3465,13 +3451,13 @@ bool CObject::CreateBarrier(Math::Vector pos, float angle, float height, CreateCrashSphere(Math::Vector( 0.0f, 3.0f, 0.0f), 0.7f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector(-3.5f, 3.0f, 0.0f), 0.7f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(6.0f, 0.5f, D3DSHADOWWORM); + CreateShadowCircle(6.0f, 0.5f, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_BARRIER1 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\barrier1.mod"); pModFile->CreateEngineObject(rank); @@ -3484,13 +3470,13 @@ bool CObject::CreateBarrier(Math::Vector pos, float angle, float height, CreateCrashSphere(Math::Vector(-3.5f, 3.0f, 0.0f), 0.7f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector(-8.5f, 3.0f, 0.0f), 0.7f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(12.0f, 0.5f, D3DSHADOWWORM); + CreateShadowCircle(12.0f, 0.5f, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_BARRIER2 ) // cardboard? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\barrier2.mod"); pModFile->CreateEngineObject(rank); @@ -3503,13 +3489,13 @@ bool CObject::CreateBarrier(Math::Vector pos, float angle, float height, CreateCrashSphere(Math::Vector(-3.5f, 3.0f, 0.0f), 0.7f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector(-8.5f, 3.0f, 0.0f), 0.7f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(12.0f, 0.8f, D3DSHADOWWORM); + CreateShadowCircle(12.0f, 0.8f, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_BARRIER3 ) // match + straw? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\barrier3.mod"); pModFile->CreateEngineObject(rank); @@ -3522,17 +3508,17 @@ bool CObject::CreateBarrier(Math::Vector pos, float angle, float height, CreateCrashSphere(Math::Vector(-3.5f, 3.0f, 0.0f), 0.7f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector(-8.5f, 3.0f, 0.0f), 0.7f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(10.0f, 0.5f, D3DSHADOWWORM); + CreateShadowCircle(10.0f, 0.5f, Gfx::ENG_SHADOW_WORM); } - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately SetFloorHeight(0.0f); CreateOtherObject(type); FloorAdjust(); - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); @@ -3545,12 +3531,10 @@ bool CObject::CreateBarrier(Math::Vector pos, float angle, float height, bool CObject::CreatePlant(Math::Vector pos, float angle, float height, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; int rank; - if ( m_engine->RetRestCreate() < 1 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); @@ -3561,7 +3545,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, type == OBJECT_PLANT4 ) // standard? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); if ( type == OBJECT_PLANT0 ) pModFile->ReadModel("objects\\plant0.mod"); if ( type == OBJECT_PLANT1 ) pModFile->ReadModel("objects\\plant1.mod"); @@ -3586,7 +3570,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, type == OBJECT_PLANT7 ) // clover? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); if ( type == OBJECT_PLANT5 ) pModFile->ReadModel("objects\\plant5.mod"); if ( type == OBJECT_PLANT6 ) pModFile->ReadModel("objects\\plant6.mod"); @@ -3605,7 +3589,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, type == OBJECT_PLANT9 ) // squash? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); if ( type == OBJECT_PLANT8 ) pModFile->ReadModel("objects\\plant8.mod"); if ( type == OBJECT_PLANT9 ) pModFile->ReadModel("objects\\plant9.mod"); @@ -3626,7 +3610,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, type == OBJECT_PLANT14 ) // succulent? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); if ( type == OBJECT_PLANT10 ) pModFile->ReadModel("objects\\plant10.mod"); if ( type == OBJECT_PLANT11 ) pModFile->ReadModel("objects\\plant11.mod"); @@ -3651,7 +3635,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, type == OBJECT_PLANT19 ) // fern? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); if ( type == OBJECT_PLANT15 ) pModFile->ReadModel("objects\\plant15.mod"); if ( type == OBJECT_PLANT16 ) pModFile->ReadModel("objects\\plant16.mod"); @@ -3675,7 +3659,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, if ( type == OBJECT_TREE0 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\tree0.mod"); pModFile->CreateEngineObject(rank); @@ -3693,7 +3677,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, if ( type == OBJECT_TREE1 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\tree1.mod"); pModFile->CreateEngineObject(rank); @@ -3712,7 +3696,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, if ( type == OBJECT_TREE2 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\tree2.mod"); pModFile->CreateEngineObject(rank); @@ -3731,7 +3715,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, if ( type == OBJECT_TREE3 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\tree3.mod"); pModFile->CreateEngineObject(rank); @@ -3749,7 +3733,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, if ( type == OBJECT_TREE4 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\tree4.mod"); pModFile->CreateEngineObject(rank); @@ -3766,7 +3750,7 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, if ( type == OBJECT_TREE5 ) // giant tree (for the world "teen") { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\tree5.mod"); pModFile->CreateEngineObject(rank); @@ -3780,13 +3764,13 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, CreateShadowCircle(50.0f, 0.5f); } - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately SetFloorHeight(0.0f); CreateOtherObject(type); - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); @@ -3799,19 +3783,17 @@ bool CObject::CreatePlant(Math::Vector pos, float angle, float height, bool CObject::CreateMushroom(Math::Vector pos, float angle, float height, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; int rank; - if ( m_engine->RetRestCreate() < 1 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); if ( type == OBJECT_MUSHROOM1 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\mush1.mod"); pModFile->CreateEngineObject(rank); @@ -3828,7 +3810,7 @@ bool CObject::CreateMushroom(Math::Vector pos, float angle, float height, if ( type == OBJECT_MUSHROOM2 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\mush2.mod"); pModFile->CreateEngineObject(rank); @@ -3842,13 +3824,13 @@ bool CObject::CreateMushroom(Math::Vector pos, float angle, float height, CreateShadowCircle(5.0f, 0.5f); } - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately SetFloorHeight(0.0f); CreateOtherObject(type); - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); @@ -3861,16 +3843,14 @@ bool CObject::CreateMushroom(Math::Vector pos, float angle, float height, bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; Math::Matrix* mat; - D3DCOLORVALUE color; - int rank; - float fShadow; - bool bFloorAdjust = true; - - if ( m_engine->RetRestCreate() < 1 ) return false; + Gfx::Color color; + int rank; + float fShadow; + bool bFloorAdjust = true; - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); @@ -3879,7 +3859,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN0 ) // orange pencil lg=10 { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen0.mod"); pModFile->CreateEngineObject(rank); @@ -3893,13 +3873,13 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height CreateCrashSphere(Math::Vector(-2.5f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector(-5.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(5.0f, 0.8f*fShadow, D3DSHADOWWORM); + CreateShadowCircle(5.0f, 0.8f*fShadow, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_TEEN1 ) // blue pencil lg=14 { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen1.mod"); pModFile->CreateEngineObject(rank); @@ -3915,13 +3895,13 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height CreateCrashSphere(Math::Vector(-4.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector(-6.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(6.0f, 0.8f*fShadow, D3DSHADOWWORM); + CreateShadowCircle(6.0f, 0.8f*fShadow, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_TEEN2 ) // red pencil lg=16 { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen2.mod"); pModFile->CreateEngineObject(rank); @@ -3937,14 +3917,14 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height CreateCrashSphere(Math::Vector(-4.7f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector(-7.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(6.0f, 0.8f*fShadow, D3DSHADOWWORM); + CreateShadowCircle(6.0f, 0.8f*fShadow, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_TEEN3 ) // jar with pencils { rank = m_engine->CreateObject(); -//? m_engine->SetObjectType(rank, TYPEFIX); - m_engine->SetObjectType(rank, TYPEMETAL); +//? m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_METAL); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen3.mod"); pModFile->CreateEngineObject(rank); @@ -3960,7 +3940,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN4 ) // scissors { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen4.mod"); pModFile->CreateEngineObject(rank); @@ -3976,13 +3956,13 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height CreateCrashSphere(Math::Vector( 8.0f, 1.0f, 2.2f), 2.3f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector( 9.4f, 1.0f,-2.0f), 2.0f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(10.0f, 0.5f*fShadow, D3DSHADOWWORM); + CreateShadowCircle(10.0f, 0.5f*fShadow, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_TEEN5 ) // CD { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen5.mod"); pModFile->CreateEngineObject(rank); @@ -3999,7 +3979,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN6 ) // book 1 { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen6.mod"); pModFile->CreateEngineObject(rank); @@ -4020,7 +4000,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN7 ) // book 2 { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen7.mod"); pModFile->CreateEngineObject(rank); @@ -4041,7 +4021,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN8 ) // a stack of books 1 { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen8.mod"); pModFile->CreateEngineObject(rank); @@ -4063,7 +4043,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN9 ) // a stack of books 2 { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen9.mod"); pModFile->CreateEngineObject(rank); @@ -4085,7 +4065,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN10 ) // bookcase { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen10.mod"); pModFile->CreateEngineObject(rank); @@ -4111,7 +4091,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN11 ) // lamp { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen11.mod"); pModFile->CreateEngineObject(rank); @@ -4120,9 +4100,9 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height SetFloorHeight(0.0f); SetZoom(0, zoom); - mat = RetWorldMatrix(0); + mat = GetWorldMatrix(0); pos = Math::Transform(*mat, Math::Vector(-56.0f, 22.0f, 0.0f)); - m_particule->CreateParticule(pos, Math::Vector(0.0f, 0.0f, 0.0f), Math::Point(20.0f, 20.0f), PARTISELY, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, Math::Vector(0.0f, 0.0f, 0.0f), Math::Point(20.0f, 20.0f), Gfx::PARTISELY, 1.0f, 0.0f, 0.0f); pos = Math::Transform(*mat, Math::Vector(-65.0f, 40.0f, 0.0f)); color.r = 4.0f; @@ -4135,8 +4115,8 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN12 ) // coke { rank = m_engine->CreateObject(); -//? m_engine->SetObjectType(rank, TYPEFIX); - m_engine->SetObjectType(rank, TYPEMETAL); +//? m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_METAL); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen12.mod"); pModFile->CreateEngineObject(rank); @@ -4152,7 +4132,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN13 ) // cardboard farm { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen13.mod"); pModFile->CreateEngineObject(rank); @@ -4177,7 +4157,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN14 ) // open box { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen14.mod"); pModFile->CreateEngineObject(rank); @@ -4202,7 +4182,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN15 ) // stack of cartons { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen15.mod"); pModFile->CreateEngineObject(rank); @@ -4227,7 +4207,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN16 ) // watering can { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen16.mod"); pModFile->CreateEngineObject(rank); @@ -4245,7 +4225,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN17 ) // wheel | { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen17.mod"); pModFile->CreateEngineObject(rank); @@ -4261,7 +4241,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN18 ) // wheel / { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen18.mod"); pModFile->CreateEngineObject(rank); @@ -4277,7 +4257,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN19 ) // wheel = { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen19.mod"); pModFile->CreateEngineObject(rank); @@ -4293,7 +4273,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN20 ) // wall with shelf { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen20.mod"); pModFile->CreateEngineObject(rank); @@ -4314,7 +4294,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN21 ) // wall with window { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen21.mod"); pModFile->CreateEngineObject(rank); @@ -4326,7 +4306,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN22 ) // wall with door and shelf { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen22.mod"); pModFile->CreateEngineObject(rank); @@ -4343,7 +4323,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN23 ) // skateboard on wheels { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen23.mod"); pModFile->CreateEngineObject(rank); @@ -4364,13 +4344,13 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height CreateCrashSphere(Math::Vector( 23.0f, 2.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f); CreateCrashSphere(Math::Vector( 23.0f, 2.0f,-7.0f), 3.0f, SOUND_BOUMm, 0.45f); - CreateShadowCircle(35.0f, 0.8f*fShadow, D3DSHADOWWORM); + CreateShadowCircle(35.0f, 0.8f*fShadow, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_TEEN24 ) // skate / { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen24.mod"); pModFile->CreateEngineObject(rank); @@ -4386,7 +4366,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN25 ) // skate / { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen25.mod"); pModFile->CreateEngineObject(rank); @@ -4402,7 +4382,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN26 ) // ceiling lamp { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen26.mod"); pModFile->CreateEngineObject(rank); @@ -4411,9 +4391,9 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height SetZoom(0, zoom); SetFloorHeight(0.0f); - mat = RetWorldMatrix(0); + mat = GetWorldMatrix(0); pos = Math::Transform(*mat, Math::Vector(0.0f, 50.0f, 0.0f)); - m_particule->CreateParticule(pos, Math::Vector(0.0f, 0.0f, 0.0f), Math::Point(100.0f, 100.0f), PARTISELY, 1.0f, 0.0f, 0.0f); + m_particle->CreateParticle(pos, Math::Vector(0.0f, 0.0f, 0.0f), Math::Point(100.0f, 100.0f), Gfx::PARTISELY, 1.0f, 0.0f, 0.0f); pos = Math::Transform(*mat, Math::Vector(0.0f, 50.0f, 0.0f)); color.r = 4.0f; @@ -4426,7 +4406,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN27 ) // large plant? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen27.mod"); pModFile->CreateEngineObject(rank); @@ -4441,8 +4421,8 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN28 ) // bottle? { rank = m_engine->CreateObject(); -//? m_engine->SetObjectType(rank, TYPEFIX); - m_engine->SetObjectType(rank, TYPEMETAL); +//? m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_METAL); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen28.mod"); pModFile->CreateEngineObject(rank); @@ -4457,7 +4437,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN29 ) // bridge? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen29.mod"); pModFile->CreateEngineObject(rank); @@ -4470,7 +4450,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN30 ) // jump? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen30.mod"); pModFile->CreateEngineObject(rank); @@ -4486,7 +4466,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN31 ) // basket? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen31.mod"); pModFile->CreateEngineObject(rank); @@ -4505,7 +4485,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN32 ) // chair? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen32.mod"); pModFile->CreateEngineObject(rank); @@ -4524,7 +4504,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN33 ) // panel? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen33.mod"); pModFile->CreateEngineObject(rank); @@ -4539,7 +4519,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN34 ) // stone? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen34.mod"); pModFile->CreateEngineObject(rank); @@ -4554,7 +4534,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN35 ) // pipe? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen35.mod"); pModFile->CreateEngineObject(rank); @@ -4567,13 +4547,13 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height CreateCrashSphere(Math::Vector( 0.0f, 5.0f, 0.0f), 10.0f, SOUND_BOUM, 0.10f); CreateCrashSphere(Math::Vector( 20.0f, 5.0f, 0.0f), 10.0f, SOUND_BOUM, 0.10f); CreateCrashSphere(Math::Vector( 40.0f, 5.0f, 0.0f), 10.0f, SOUND_BOUM, 0.10f); - CreateShadowCircle(40.0f, 0.8f*fShadow, D3DSHADOWWORM); + CreateShadowCircle(40.0f, 0.8f*fShadow, Gfx::ENG_SHADOW_WORM); } if ( type == OBJECT_TEEN36 ) // trunk? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen36.mod"); pModFile->CreateEngineObject(rank); @@ -4586,7 +4566,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN37 ) // boat? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen37.mod"); pModFile->CreateEngineObject(rank); @@ -4599,7 +4579,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN38 ) // fan? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen38a.mod"); pModFile->CreateEngineObject(rank); @@ -4608,7 +4588,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height SetZoom(0, zoom); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\teen38b.mod"); // engine @@ -4616,7 +4596,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height SetPosition(1, Math::Vector(0.0f, 30.0f, 0.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 1); pModFile->ReadModel("objects\\teen38c.mod"); // propeller @@ -4631,7 +4611,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN39 ) // potted plant? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen39.mod"); pModFile->CreateEngineObject(rank); @@ -4647,7 +4627,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN40 ) // balloon? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen40.mod"); pModFile->CreateEngineObject(rank); @@ -4663,7 +4643,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN41 ) // fence? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen41.mod"); pModFile->CreateEngineObject(rank); @@ -4675,7 +4655,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN42 ) // clover? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen42.mod"); pModFile->CreateEngineObject(rank); @@ -4690,7 +4670,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN43 ) // clover? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen43.mod"); pModFile->CreateEngineObject(rank); @@ -4705,7 +4685,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height if ( type == OBJECT_TEEN44 ) // car? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\teen44.mod"); pModFile->CreateEngineObject(rank); @@ -4718,7 +4698,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height CreateShadowCircle(55.0f, 1.0f*fShadow); } - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately if ( bFloorAdjust ) @@ -4729,7 +4709,7 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height CreateOtherObject(type); - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); @@ -4742,20 +4722,18 @@ bool CObject::CreateTeen(Math::Vector pos, float angle, float zoom, float height bool CObject::CreateQuartz(Math::Vector pos, float angle, float height, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; float radius; int rank; - if ( m_engine->RetRestCreate() < 1 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); if ( type == OBJECT_QUARTZ0 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEQUARTZ); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_QUARTZ); SetObjectRank(0, rank); pModFile->ReadModel("objects\\quartz0.mod"); pModFile->CreateEngineObject(rank); @@ -4770,7 +4748,7 @@ bool CObject::CreateQuartz(Math::Vector pos, float angle, float height, if ( type == OBJECT_QUARTZ1 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEQUARTZ); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_QUARTZ); SetObjectRank(0, rank); pModFile->ReadModel("objects\\quartz1.mod"); pModFile->CreateEngineObject(rank); @@ -4785,7 +4763,7 @@ bool CObject::CreateQuartz(Math::Vector pos, float angle, float height, if ( type == OBJECT_QUARTZ2 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEQUARTZ); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_QUARTZ); SetObjectRank(0, rank); pModFile->ReadModel("objects\\quartz2.mod"); pModFile->CreateEngineObject(rank); @@ -4800,7 +4778,7 @@ bool CObject::CreateQuartz(Math::Vector pos, float angle, float height, if ( type == OBJECT_QUARTZ3 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEQUARTZ); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_QUARTZ); SetObjectRank(0, rank); pModFile->ReadModel("objects\\quartz3.mod"); pModFile->CreateEngineObject(rank); @@ -4813,13 +4791,13 @@ bool CObject::CreateQuartz(Math::Vector pos, float angle, float height, CreateShadowCircle(10.0f, 0.5f); } - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately SetFloorHeight(0.0f); CreateOtherObject(type); - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); @@ -4843,8 +4821,8 @@ bool CObject::CreateQuartz(Math::Vector pos, float angle, float height, pos.y += 16.0f; radius = 8.0f; } - m_particule->CreateParticule(pos, pos, Math::Point(2.0f, 2.0f), PARTIQUARTZ, 0.7f+Math::Rand()*0.7f, radius, 0.0f); - m_particule->CreateParticule(pos, pos, Math::Point(2.0f, 2.0f), PARTIQUARTZ, 0.7f+Math::Rand()*0.7f, radius, 0.0f); + m_particle->CreateParticle(pos, pos, Math::Point(2.0f, 2.0f), Gfx::PARTIQUARTZ, 0.7f+Math::Rand()*0.7f, radius, 0.0f); + m_particle->CreateParticle(pos, pos, Math::Point(2.0f, 2.0f), Gfx::PARTIQUARTZ, 0.7f+Math::Rand()*0.7f, radius, 0.0f); delete pModFile; return true; @@ -4855,19 +4833,17 @@ bool CObject::CreateQuartz(Math::Vector pos, float angle, float height, bool CObject::CreateRoot(Math::Vector pos, float angle, float height, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; int rank; - if ( m_engine->RetRestCreate() < 1 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); if ( type == OBJECT_ROOT0 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\root0.mod"); pModFile->CreateEngineObject(rank); @@ -4889,7 +4865,7 @@ bool CObject::CreateRoot(Math::Vector pos, float angle, float height, if ( type == OBJECT_ROOT1 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\root1.mod"); pModFile->CreateEngineObject(rank); @@ -4911,7 +4887,7 @@ bool CObject::CreateRoot(Math::Vector pos, float angle, float height, if ( type == OBJECT_ROOT2 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\root2.mod"); pModFile->CreateEngineObject(rank); @@ -4932,7 +4908,7 @@ bool CObject::CreateRoot(Math::Vector pos, float angle, float height, if ( type == OBJECT_ROOT3 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\root3.mod"); pModFile->CreateEngineObject(rank); @@ -4955,7 +4931,7 @@ bool CObject::CreateRoot(Math::Vector pos, float angle, float height, if ( type == OBJECT_ROOT4 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\root4.mod"); pModFile->CreateEngineObject(rank); @@ -4980,7 +4956,7 @@ bool CObject::CreateRoot(Math::Vector pos, float angle, float height, if ( type == OBJECT_ROOT5 ) // gravity root ? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\root4.mod"); pModFile->CreateEngineObject(rank); @@ -4989,7 +4965,7 @@ bool CObject::CreateRoot(Math::Vector pos, float angle, float height, SetZoom(0, 2.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\root5.mod"); @@ -5013,13 +4989,13 @@ bool CObject::CreateRoot(Math::Vector pos, float angle, float height, CreateShadowCircle(30.0f, 0.5f); } - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately SetFloorHeight(0.0f); CreateOtherObject(type); - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); @@ -5032,19 +5008,17 @@ bool CObject::CreateRoot(Math::Vector pos, float angle, float height, bool CObject::CreateHome(Math::Vector pos, float angle, float height, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; int rank; - if ( m_engine->RetRestCreate() < 1 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); if ( type == OBJECT_HOME1 ) { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); SetObjectRank(0, rank); pModFile->ReadModel("objects\\home1.mod"); pModFile->CreateEngineObject(rank); @@ -5057,13 +5031,13 @@ bool CObject::CreateHome(Math::Vector pos, float angle, float height, CreateShadowCircle(16.0f, 0.5f); } - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately SetFloorHeight(0.0f); CreateOtherObject(type); - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); @@ -5076,18 +5050,16 @@ bool CObject::CreateHome(Math::Vector pos, float angle, float height, bool CObject::CreateRuin(Math::Vector pos, float angle, float height, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; char name[50]; int rank; - if ( m_engine->RetRestCreate() < 1+4 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); // it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); // it is a stationary object SetObjectRank(0, rank); name[0] = 0; @@ -5115,7 +5087,7 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, { // Creates the right-back wheel. rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(6, rank); SetObjectParent(6, 0); @@ -5127,7 +5099,7 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, // Creates the left-back wheel. rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(7, rank); SetObjectParent(7, 0); @@ -5140,7 +5112,7 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, // Creates the right-front wheel. rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(8, rank); SetObjectParent(8, 0); @@ -5152,7 +5124,7 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, // Creates the left-front wheel. rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(9, rank); SetObjectParent(9, 0); @@ -5173,7 +5145,7 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, { // Creates the left-back wheel. rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(7, rank); SetObjectParent(7, 0); @@ -5186,7 +5158,7 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, // Creates the left-front wheel. rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(9, rank); SetObjectParent(9, 0); @@ -5207,7 +5179,7 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, { // Creates the cannon. rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); @@ -5339,7 +5311,7 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, CreateShadowCircle(30.0f, 1.0f); } - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); //to display the shadows immediately SetFloorHeight(0.0f); @@ -5352,145 +5324,145 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, FloorAdjust(); } - pos = RetPosition(0); + pos = GetPosition(0); pos.y += height; SetPosition(0, pos); //to display the shadows immediately if ( type == OBJECT_RUINmobilew1 ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y -= 0.5f; SetPosition(0, pos); - angle = RetAngleX(0)-0.1f; + angle = GetAngleX(0)-0.1f; SetAngleX(0, angle); } if ( type == OBJECT_RUINmobilew2 ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y -= 1.5f; SetPosition(0, pos); - angle = RetAngleX(0)-0.9f; + angle = GetAngleX(0)-0.9f; SetAngleX(0, angle); - angle = RetAngleZ(0)-0.1f; + angle = GetAngleZ(0)-0.1f; SetAngleZ(0, angle); } if ( type == OBJECT_RUINmobilet1 ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y -= 0.9f; SetPosition(0, pos); - angle = RetAngleX(0)-0.3f; + angle = GetAngleX(0)-0.3f; SetAngleX(0, angle); } if ( type == OBJECT_RUINmobilet2 ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y -= 1.5f; SetPosition(0, pos); - angle = RetAngleX(0)-0.3f; + angle = GetAngleX(0)-0.3f; SetAngleX(0, angle); - angle = RetAngleZ(0)+0.8f; + angle = GetAngleZ(0)+0.8f; SetAngleZ(0, angle); } if ( type == OBJECT_RUINmobiler1 ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y += 4.0f; SetPosition(0, pos); - angle = RetAngleX(0)-Math::PI*0.6f; + angle = GetAngleX(0)-Math::PI*0.6f; SetAngleX(0, angle); - angle = RetAngleZ(0)-0.2f; + angle = GetAngleZ(0)-0.2f; SetAngleZ(0, angle); } if ( type == OBJECT_RUINmobiler2 ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y += 2.0f; SetPosition(0, pos); - angle = RetAngleX(0)-0.1f; + angle = GetAngleX(0)-0.1f; SetAngleX(0, angle); - angle = RetAngleZ(0)-0.3f; + angle = GetAngleZ(0)-0.3f; SetAngleZ(0, angle); } if ( type == OBJECT_RUINdoor ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y -= 0.5f; SetPosition(0, pos); - angle = RetAngleZ(0)-0.1f; + angle = GetAngleZ(0)-0.1f; SetAngleZ(0, angle); } if ( type == OBJECT_RUINsupport ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y += 0.5f; SetPosition(0, pos); -//? angle = RetAngleY(0)+0.1f; +//? angle = GetAngleY(0)+0.1f; //? SetAngleY(0, angle); - angle = RetAngleX(0)+0.1f; + angle = GetAngleX(0)+0.1f; SetAngleX(0, angle); - angle = RetAngleZ(0)+0.1f; + angle = GetAngleZ(0)+0.1f; SetAngleZ(0, angle); } if ( type == OBJECT_RUINradar ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y -= 0.5f; SetPosition(0, pos); - angle = RetAngleX(0)+0.15f; + angle = GetAngleX(0)+0.15f; SetAngleX(0, angle); - angle = RetAngleZ(0)+0.1f; + angle = GetAngleZ(0)+0.1f; SetAngleZ(0, angle); } if ( type == OBJECT_RUINconvert ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y -= 1.0f; SetPosition(0, pos); } if ( type == OBJECT_RUINbase ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y -= 1.0f; SetPosition(0, pos); - angle = RetAngleX(0)+0.15f; + angle = GetAngleX(0)+0.15f; SetAngleX(0, angle); } if ( type == OBJECT_RUINhead ) { - pos = RetPosition(0); + pos = GetPosition(0); pos.y += 8.0f; SetPosition(0, pos); - angle = RetAngleX(0)+Math::PI*0.4f; + angle = GetAngleX(0)+Math::PI*0.4f; SetAngleX(0, angle); } @@ -5502,19 +5474,17 @@ bool CObject::CreateRuin(Math::Vector pos, float angle, float height, bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) { - CModFile* pModFile; + Gfx::CModelFile* pModFile; int rank, i; - if ( m_engine->RetRestCreate() < 6 ) return false; - - pModFile = new CModFile(m_iMan); + pModFile = new Gfx::CModelFile(m_iMan); SetType(type); if ( type == OBJECT_APOLLO1 ) // LEM ? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); // it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); // it is a stationary object SetObjectRank(0, rank); pModFile->ReadModel("objects\\apollol1.mod"); pModFile->CreateEngineObject(rank); @@ -5526,7 +5496,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) for ( i=0 ; i<4 ; i++ ) // creates feet { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(i+1, rank); SetObjectParent(i+1, 0); pModFile->ReadModel("objects\\apollol2.mod"); @@ -5535,7 +5505,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) } rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(5, rank); SetObjectParent(5, 0); pModFile->ReadModel("objects\\apollol3.mod"); // ladder @@ -5557,7 +5527,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) if ( type == OBJECT_APOLLO2 ) // jeep { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); //it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); //it is a stationary object SetObjectRank(0, rank); pModFile->ReadModel("objects\\apolloj1.mod"); pModFile->CreateEngineObject(rank); @@ -5567,7 +5537,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) // Wheels. rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\apolloj4.mod"); // wheel @@ -5575,7 +5545,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) SetPosition(1, Math::Vector(-5.75f, 1.65f, -5.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(2, rank); SetObjectParent(2, 0); pModFile->ReadModel("objects\\apolloj4.mod"); // wheel @@ -5583,7 +5553,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) SetPosition(2, Math::Vector(-5.75f, 1.65f, 5.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(3, rank); SetObjectParent(3, 0); pModFile->ReadModel("objects\\apolloj4.mod"); // wheel @@ -5591,7 +5561,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) SetPosition(3, Math::Vector(5.75f, 1.65f, -5.0f)); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(4, rank); SetObjectParent(4, 0); pModFile->ReadModel("objects\\apolloj4.mod"); // wheel @@ -5600,7 +5570,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) // Accessories: rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(5, rank); SetObjectParent(5, 0); pModFile->ReadModel("objects\\apolloj2.mod"); // antenna @@ -5610,7 +5580,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) SetAngleZ(5, 45.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(6, rank); SetObjectParent(6, 0); pModFile->ReadModel("objects\\apolloj3.mod"); // camera @@ -5630,7 +5600,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) if ( type == OBJECT_APOLLO3 ) // flag? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); // it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); // it is a stationary object SetObjectRank(0, rank); pModFile->ReadModel("objects\\apollof.mod"); pModFile->CreateEngineObject(rank); @@ -5645,7 +5615,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) if ( type == OBJECT_APOLLO4 ) // module? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); // it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); // it is a stationary object SetObjectRank(0, rank); pModFile->ReadModel("objects\\apollom.mod"); pModFile->CreateEngineObject(rank); @@ -5662,7 +5632,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) if ( type == OBJECT_APOLLO5 ) // antenna? { rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEFIX); // it is a stationary object + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_FIX); // it is a stationary object SetObjectRank(0, rank); pModFile->ReadModel("objects\\apolloa.mod"); pModFile->CreateEngineObject(rank); @@ -5671,7 +5641,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) SetFloorHeight(0.0f); rank = m_engine->CreateObject(); - m_engine->SetObjectType(rank, TYPEDESCENDANT); + m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); SetObjectRank(1, rank); SetObjectParent(1, 0); pModFile->ReadModel("objects\\apolloj2.mod"); // antenna @@ -5686,7 +5656,7 @@ bool CObject::CreateApollo(Math::Vector pos, float angle, ObjectType type) CreateOtherObject(type); - pos = RetPosition(0); + pos = GetPosition(0); SetPosition(0, pos); // to display the shadows immediately delete pModFile; @@ -5804,7 +5774,7 @@ void CObject::CreateOtherObject(ObjectType type) // Reads a program. -bool CObject::ReadProgram(int rank, char* filename) +bool CObject::ReadProgram(int rank, const char* filename) { if ( m_brain != 0 ) { @@ -5845,7 +5815,7 @@ bool CObject::RunProgram(int rank) // Calculates the matrix for transforming the object. -// Returns true if the matrix has changed. +// Geturns true if the matrix has changed. // The rotations occur in the order Y, Z and X. bool CObject::UpdateTransformObject(int part, bool bForceUpdate) @@ -5916,7 +5886,7 @@ bool CObject::UpdateTransformObject(int part, bool bForceUpdate) if ( part == 0 && m_truck != 0 ) // transported by a truck? { Math::Matrix* matWorldTruck; - matWorldTruck = m_truck->RetWorldMatrix(m_truckLink); + matWorldTruck = m_truck->GetWorldMatrix(m_truckLink); m_objectPart[part].matWorld = Math::MultiplyMatrices(*matWorldTruck, m_objectPart[part].matTransform); } @@ -6043,7 +6013,7 @@ void CObject::FlatParent() void CObject::UpdateEnergyMapping() { - D3DMATERIAL7 mat; + Gfx::Material mat; float a, b, i, s, au, bu; float limit[6]; int j; @@ -6051,7 +6021,7 @@ void CObject::UpdateEnergyMapping() if ( fabs(m_energy-m_lastEnergy) < 0.01f ) return; m_lastEnergy = m_energy; - ZeroMemory( &mat, sizeof(D3DMATERIAL7) ); + memset(&mat, 0, sizeof(mat)); mat.diffuse.r = 1.0f; mat.diffuse.g = 1.0f; mat.diffuse.b = 1.0f; // white @@ -6083,17 +6053,17 @@ void CObject::UpdateEnergyMapping() bu = s-b*(s-i)/(b-a); limit[0] = 0.0f; - limit[1] = m_engine->RetLimitLOD(0); + limit[1] = m_engine->GetLimitLOD(0); limit[2] = limit[1]; - limit[3] = m_engine->RetLimitLOD(1); + limit[3] = m_engine->GetLimitLOD(1); limit[4] = limit[3]; limit[5] = 1000000.0f; for ( j=0 ; j<3 ; j++ ) { m_engine->ChangeTextureMapping(m_objectPart[0].object, - mat, D3DSTATEPART3, "lemt.tga", "", - limit[j*2+0], limit[j*2+1], D3DMAPPING1Y, + mat, Gfx::ENG_RSTATE_PART3, "lemt.tga", "", + limit[j*2+0], limit[j*2+1], Gfx::ENG_TEX_MAPPING_1Y, au, bu, 1.0f, 0.0f); } } @@ -6103,7 +6073,7 @@ void CObject::UpdateEnergyMapping() bool CObject::EventProcess(const Event &event) { - if ( event.event == EVENT_KEYDOWN ) + if ( event.type == EVENT_KEY_DOWN ) { #if ADJUST_ONBOARD if ( m_bSelect ) @@ -6147,12 +6117,12 @@ bool CObject::EventProcess(const Event &event) { if ( !m_physics->EventProcess(event) ) // object destroyed? { - if ( RetSelect() && + if ( GetSelect() && m_type != OBJECT_ANT && m_type != OBJECT_SPIDER && m_type != OBJECT_BEE ) { - if ( !m_bDead ) m_camera->SetType(CAMERA_EXPLO); + if ( !m_bDead ) m_camera->SetType(Gfx::CAM_TYPE_EXPLO); m_main->DeselectAll(); } return false; @@ -6163,7 +6133,7 @@ bool CObject::EventProcess(const Event &event) { m_auto->EventProcess(event); - if ( event.event == EVENT_FRAME && + if ( event.type == EVENT_FRAME && m_auto->IsEnded() != ERR_CONTINUE ) { m_auto->DeleteObject(); @@ -6177,7 +6147,7 @@ bool CObject::EventProcess(const Event &event) m_motion->EventProcess(event); } - if ( event.event == EVENT_FRAME ) + if ( event.type == EVENT_FRAME ) { return EventFrame(event); } @@ -6190,13 +6160,13 @@ bool CObject::EventProcess(const Event &event) bool CObject::EventFrame(const Event &event) { - if ( m_type == OBJECT_HUMAN && m_main->RetMainMovie() == MM_SATCOMopen ) + if ( m_type == OBJECT_HUMAN && m_main->GetMainMovie() == MM_SATCOMopen ) { UpdateTransformObject(); return true; } - if ( m_type != OBJECT_SHOW && m_engine->RetPause() ) return true; + if ( m_type != OBJECT_SHOW && m_engine->GetPause() ) return true; m_aTime += event.rTime; m_shotTime += event.rTime; @@ -6206,23 +6176,23 @@ bool CObject::EventFrame(const Event &event) UpdateMapping(); UpdateTransformObject(); - UpdateSelectParticule(); + UpdateSelectParticle(); if ( m_bProxyActivate ) // active if it is near? { - CPyro* pyro; + Gfx::CPyro* pyro; Math::Vector eye; float dist; - eye = m_engine->RetLookatPt(); - dist = Math::Distance(eye, RetPosition(0)); + eye = m_engine->GetLookatPt(); + dist = Math::Distance(eye, GetPosition(0)); if ( dist < m_proxyDistance ) { m_bProxyActivate = false; m_main->CreateShortcuts(); m_sound->Play(SOUND_FINDING); - pyro = new CPyro(m_iMan); - pyro->Create(PT_FINDING, this, 0.0f); + pyro = new Gfx::CPyro(m_iMan); + pyro->Create(Gfx::PT_FINDING, this, 0.0f); m_displayText->DisplayError(INFO_FINDING, this); } } @@ -6248,10 +6218,10 @@ void CObject::UpdateMapping() void CObject::VirusFrame(float rTime) { - ParticuleType type; + Gfx::ParticleType type; Math::Vector pos, speed; Math::Point dim; - int r; + int r; if ( !m_bVirusMode ) return; // healthy object? @@ -6261,23 +6231,23 @@ void CObject::VirusFrame(float rTime) m_bVirusMode = false; // the virus is no longer active } - if ( m_lastVirusParticule+m_engine->ParticuleAdapt(0.2f) <= m_aTime ) + if ( m_lastVirusParticle+m_engine->ParticleAdapt(0.2f) <= m_aTime ) { - m_lastVirusParticule = m_aTime; + m_lastVirusParticle = m_aTime; r = rand()%10; - if ( r == 0 ) type = PARTIVIRUS1; - if ( r == 1 ) type = PARTIVIRUS2; - if ( r == 2 ) type = PARTIVIRUS3; - if ( r == 3 ) type = PARTIVIRUS4; - if ( r == 4 ) type = PARTIVIRUS5; - if ( r == 5 ) type = PARTIVIRUS6; - if ( r == 6 ) type = PARTIVIRUS7; - if ( r == 7 ) type = PARTIVIRUS8; - if ( r == 8 ) type = PARTIVIRUS9; - if ( r == 9 ) type = PARTIVIRUS10; - - pos = RetPosition(0); + if ( r == 0 ) type = Gfx::PARTIVIRUS1; + if ( r == 1 ) type = Gfx::PARTIVIRUS2; + if ( r == 2 ) type = Gfx::PARTIVIRUS3; + if ( r == 3 ) type = Gfx::PARTIVIRUS4; + if ( r == 4 ) type = Gfx::PARTIVIRUS5; + if ( r == 5 ) type = Gfx::PARTIVIRUS6; + if ( r == 6 ) type = Gfx::PARTIVIRUS7; + if ( r == 7 ) type = Gfx::PARTIVIRUS8; + if ( r == 8 ) type = Gfx::PARTIVIRUS9; + if ( r == 9 ) type = Gfx::PARTIVIRUS10; + + pos = GetPosition(0); pos.x += (Math::Rand()-0.5f)*10.0f; pos.z += (Math::Rand()-0.5f)*10.0f; speed.x = (Math::Rand()-0.5f)*2.0f; @@ -6286,7 +6256,7 @@ void CObject::VirusFrame(float rTime) dim.x = Math::Rand()*0.3f+0.3f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, type, 3.0f); + m_particle->CreateParticle(pos, speed, dim, type, 3.0f); } } @@ -6304,7 +6274,7 @@ void CObject::PartiFrame(float rTime) channel = m_objectPart[i].masterParti; if ( channel == -1 ) continue; - if ( !m_particule->GetPosition(channel, pos) ) + if ( !m_particle->GetPosition(channel, pos) ) { m_objectPart[i].masterParti = -1; // particle no longer exists! continue; @@ -6322,7 +6292,7 @@ void CObject::PartiFrame(float rTime) case 4: factor = Math::Vector( 0.4f, 0.1f,-0.7f); break; } - angle = RetAngle(i); + angle = GetAngle(i); angle += rTime*Math::PI*factor; SetAngle(i, angle); } @@ -6334,7 +6304,7 @@ void CObject::PartiFrame(float rTime) void CObject::SetViewFromHere(Math::Vector &eye, float &dirH, float &dirV, Math::Vector &lookat, Math::Vector &upVec, - CameraType type) + Gfx::CameraType type) { float speed; int part; @@ -6429,7 +6399,7 @@ void CObject::SetViewFromHere(Math::Vector &eye, float &dirH, float &dirV, m_engine->SetInfoText(4, s); #endif - if ( type == CAMERA_BACK ) + if ( type == Gfx::CAM_TYPE_BACK ) { eye.x -= 20.0f; eye.y += 1.0f; @@ -6446,20 +6416,20 @@ void CObject::SetViewFromHere(Math::Vector &eye, float &dirH, float &dirV, upVec = Math::Vector(0.0f, 1.0f, 0.0f); if ( m_physics != 0 ) { - if ( m_physics->RetLand() ) // on ground? + if ( m_physics->GetLand() ) // on ground? { - speed = m_physics->RetLinMotionX(MO_REASPEED); + speed = m_physics->GetLinMotionX(MO_REASPEED); lookat.y -= speed*0.002f; - speed = m_physics->RetCirMotionY(MO_REASPEED); + speed = m_physics->GetCirMotionY(MO_REASPEED); upVec.z -= speed*0.04f; } else // in flight? { - speed = m_physics->RetLinMotionX(MO_REASPEED); + speed = m_physics->GetLinMotionX(MO_REASPEED); lookat.y += speed*0.002f; - speed = m_physics->RetCirMotionY(MO_REASPEED); + speed = m_physics->GetCirMotionY(MO_REASPEED); upVec.z += speed*0.08f; } } @@ -6475,23 +6445,23 @@ void CObject::SetViewFromHere(Math::Vector &eye, float &dirH, float &dirV, void CObject::SetCharacter(Character* character) { - CopyMemory(&m_character, character, sizeof(Character)); + memcpy(&m_character, character, sizeof(m_character)); } void CObject::GetCharacter(Character* character) { - CopyMemory(character, &m_character, sizeof(Character)); + memcpy(character, &m_character, sizeof(character)); } -Character* CObject::RetCharacter() +Character* CObject::GetCharacter() { return &m_character; } -// Returns the absolute time. +// Geturns the absolute time. -float CObject::RetAbsTime() +float CObject::GetAbsTime() { return m_aTime; } @@ -6507,7 +6477,7 @@ void CObject::SetEnergy(float level) m_energy = level; } -float CObject::RetEnergy() +float CObject::GetEnergy() { if ( m_type != OBJECT_POWER && m_type != OBJECT_ATOMIC && @@ -6526,7 +6496,7 @@ void CObject::SetCapacity(float capacity) m_capacity = capacity; } -float CObject::RetCapacity() +float CObject::GetCapacity() { return m_capacity; } @@ -6539,7 +6509,7 @@ void CObject::SetShield(float level) m_shield = level; } -float CObject::RetShield() +float CObject::GetShield() { if ( m_type == OBJECT_FRET || m_type == OBJECT_STONE || @@ -6582,7 +6552,7 @@ void CObject::SetRange(float delay) m_range = delay; } -float CObject::RetRange() +float CObject::GetRange() { return m_range; } @@ -6610,7 +6580,7 @@ void CObject::SetTransparency(float value) } } -float CObject::RetTransparency() +float CObject::GetTransparency() { return m_transparency; } @@ -6618,7 +6588,7 @@ float CObject::RetTransparency() // Management of the object matter. -ObjectMaterial CObject::RetMaterial() +ObjectMaterial CObject::GetMaterial() { if ( m_type == OBJECT_HUMAN ) { @@ -6642,7 +6612,7 @@ void CObject::SetGadget(bool bMode) m_bGadget = bMode; } -bool CObject::RetGadget() +bool CObject::GetGadget() { return m_bGadget; } @@ -6655,7 +6625,7 @@ void CObject::SetFixed(bool bFixed) m_bFixed = bFixed; } -bool CObject::RetFixed() +bool CObject::GetFixed() { return m_bFixed; } @@ -6668,7 +6638,7 @@ void CObject::SetClip(bool bClip) m_bClip = bClip; } -bool CObject::RetClip() +bool CObject::GetClip() { return m_bClip; } @@ -6696,7 +6666,7 @@ bool CObject::JostleObject(float force) if ( m_auto != 0 ) return false; m_auto = new CAutoJostle(m_iMan, this); - pa = (CAutoJostle*)m_auto; + pa = static_cast<CAutoJostle*>(m_auto); pa->Start(0, force); } @@ -6712,7 +6682,7 @@ void CObject::StartDetectEffect(CObject *target, bool bFound) Math::Vector pos, goal; Math::Point dim; - mat = RetWorldMatrix(0); + mat = GetWorldMatrix(0); pos = Math::Transform(*mat, Math::Vector(2.0f, 3.0f, 0.0f)); if ( target == 0 ) @@ -6721,24 +6691,24 @@ void CObject::StartDetectEffect(CObject *target, bool bFound) } else { - goal = target->RetPosition(0); + goal = target->GetPosition(0); goal.y += 3.0f; goal = Math::SegmentPoint(pos, goal, Math::Distance(pos, goal)-3.0f); } dim.x = 3.0f; dim.y = dim.x; - m_particule->CreateRay(pos, goal, PARTIRAY2, dim, 0.2f); + m_particle->CreateRay(pos, goal, Gfx::PARTIRAY2, dim, 0.2f); if ( target != 0 ) { - goal = target->RetPosition(0); + goal = target->GetPosition(0); goal.y += 3.0f; goal = Math::SegmentPoint(pos, goal, Math::Distance(pos, goal)-1.0f); dim.x = 6.0f; dim.y = dim.x; - m_particule->CreateParticule(goal, Math::Vector(0.0f, 0.0f, 0.0f), dim, - bFound?PARTIGLINT:PARTIGLINTr, 0.5f); + m_particle->CreateParticle(goal, Math::Vector(0.0f, 0.0f, 0.0f), dim, + bFound?Gfx::PARTIGLINT:Gfx::PARTIGLINTr, 0.5f); } m_sound->Play(bFound?SOUND_BUILD:SOUND_RECOVER); @@ -6761,12 +6731,12 @@ void CObject::SetVirusMode(bool bEnable) } } -bool CObject::RetVirusMode() +bool CObject::GetVirusMode() { return m_bVirusMode; } -float CObject::RetVirusTime() +float CObject::GetVirusTime() { return m_virusTime; } @@ -6774,12 +6744,12 @@ float CObject::RetVirusTime() // Management mode of the camera. -void CObject::SetCameraType(CameraType type) +void CObject::SetCameraType(Gfx::CameraType type) { m_cameraType = type; } -CameraType CObject::RetCameraType() +Gfx::CameraType CObject::GetCameraType() { return m_cameraType; } @@ -6789,7 +6759,7 @@ void CObject::SetCameraDist(float dist) m_cameraDist = dist; } -float CObject::RetCameraDist() +float CObject::GetCameraDist() { return m_cameraDist; } @@ -6799,7 +6769,7 @@ void CObject::SetCameraLock(bool bLock) m_bCameraLock = bLock; } -bool CObject::RetCameraLock() +bool CObject::GetCameraLock() { return m_bCameraLock; } @@ -6827,11 +6797,11 @@ void CObject::SetHilite(bool bMode) } list[j] = -1; // terminate - m_engine->SetHiliteRank(list); // gives the list of selected parts + m_engine->SetHighlightRank(list); // gives the list of selected parts } } -bool CObject::RetHilite() +bool CObject::GetHilite() { return m_bHilite; } @@ -6855,7 +6825,7 @@ void CObject::SetSelect(bool bMode, bool bDisplayError) m_auto->CreateInterface(m_bSelect); } - CreateSelectParticule(); // creates / removes particles + CreateSelectParticle(); // creates / removes particles if ( !m_bSelect ) { @@ -6866,11 +6836,11 @@ void CObject::SetSelect(bool bMode, bool bDisplayError) err = ERR_OK; if ( m_physics != 0 ) { - err = m_physics->RetError(); + err = m_physics->GetError(); } if ( m_auto != 0 ) { - err = m_auto->RetError(); + err = m_auto->GetError(); } if ( err != ERR_OK && bDisplayError ) { @@ -6880,9 +6850,9 @@ void CObject::SetSelect(bool bMode, bool bDisplayError) // Indicates whether the object is selected or not. -bool CObject::RetSelect(bool bReal) +bool CObject::GetSelect(bool bReal) { - if ( !bReal && m_main->RetFixScene() ) return false; + if ( !bReal && m_main->GetFixScene() ) return false; return m_bSelect; } @@ -6896,7 +6866,7 @@ void CObject::SetSelectable(bool bMode) // Indicates whether the object is selecionnable or not. -bool CObject::RetSelectable() +bool CObject::GetSelectable() { return m_bSelectable; } @@ -6912,11 +6882,11 @@ void CObject::SetActivity(bool bMode) } } -bool CObject::RetActivity() +bool CObject::GetActivity() { if ( m_brain != 0 ) { - return m_brain->RetActivity(); + return m_brain->GetActivity(); } return false; } @@ -6931,7 +6901,7 @@ void CObject::SetCheckToken(bool bMode) // Indicates if necessary to check the tokens of the object. -bool CObject::RetCheckToken() +bool CObject::GetCheckToken() { return m_bCheckToken; } @@ -6946,7 +6916,7 @@ void CObject::SetVisible(bool bVisible) m_bVisible = bVisible; } -bool CObject::RetVisible() +bool CObject::GetVisible() { return m_bVisible; } @@ -6962,7 +6932,7 @@ void CObject::SetEnable(bool bEnable) m_bEnable = bEnable; } -bool CObject::RetEnable() +bool CObject::GetEnable() { return m_bEnable; } @@ -6975,7 +6945,7 @@ void CObject::SetProxyActivate(bool bActivate) m_bProxyActivate = bActivate; } -bool CObject::RetProxyActivate() +bool CObject::GetProxyActivate() { return m_bProxyActivate; } @@ -6985,7 +6955,7 @@ void CObject::SetProxyDistance(float distance) m_proxyDistance = distance; } -float CObject::RetProxyDistance() +float CObject::GetProxyDistance() { return m_proxyDistance; } @@ -6998,7 +6968,7 @@ void CObject::SetMagnifyDamage(float factor) m_magnifyDamage = factor; } -float CObject::RetMagnifyDamage() +float CObject::GetMagnifyDamage() { return m_magnifyDamage; } @@ -7011,7 +6981,7 @@ void CObject::SetParam(float value) m_param = value; } -float CObject::RetParam() +float CObject::GetParam() { return m_param; } @@ -7026,7 +6996,7 @@ void CObject::SetLock(bool bLock) m_bLock = bLock; } -bool CObject::RetLock() +bool CObject::GetLock() { return m_bLock; } @@ -7039,7 +7009,7 @@ void CObject::SetExplo(bool bExplo) m_bExplo = bExplo; } -bool CObject::RetExplo() +bool CObject::GetExplo() { return m_bExplo; } @@ -7052,7 +7022,7 @@ void CObject::SetCargo(bool bCargo) m_bCargo = bCargo; } -bool CObject::RetCargo() +bool CObject::GetCargo() { return m_bCargo; } @@ -7071,7 +7041,7 @@ void CObject::SetBurn(bool bBurn) //? } } -bool CObject::RetBurn() +bool CObject::GetBurn() { return m_bBurn; } @@ -7092,17 +7062,17 @@ void CObject::SetDead(bool bDead) //? } } -bool CObject::RetDead() +bool CObject::GetDead() { return m_bDead; } -bool CObject::RetRuin() +bool CObject::GetRuin() { return m_bBurn|m_bFlat; } -bool CObject::RetActif() +bool CObject::GetActif() { return !m_bLock && !m_bBurn && !m_bFlat && m_bVisible && m_bEnable; } @@ -7178,12 +7148,12 @@ void CObject::SetGunGoalH(float gunGoal) m_gunGoalH = gunGoal; } -float CObject::RetGunGoalV() +float CObject::GetGunGoalV() { return m_gunGoalV; } -float CObject::RetGunGoalH() +float CObject::GetGunGoalH() { return m_gunGoalH; } @@ -7196,7 +7166,7 @@ bool CObject::StartShowLimit() { if ( m_showLimitRadius == 0.0f ) return false; - m_main->SetShowLimit(0, PARTILIMIT1, this, RetPosition(0), m_showLimitRadius); + m_main->SetShowLimit(0, Gfx::PARTILIMIT1, this, GetPosition(0), m_showLimitRadius); m_bShowLimit = true; return true; } @@ -7219,7 +7189,7 @@ bool CObject::IsProgram() // Creates or removes particles associated to the object. -void CObject::CreateSelectParticule() +void CObject::CreateSelectParticle() { Math::Vector pos, speed; Math::Point dim; @@ -7230,7 +7200,7 @@ void CObject::CreateSelectParticule() { if ( m_partiSel[i] != -1 ) { - m_particule->DeleteParticule(m_partiSel[i]); + m_particle->DeleteParticle(m_partiSel[i]); m_partiSel[i] = -1; } } @@ -7270,18 +7240,18 @@ void CObject::CreateSelectParticule() speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 0.0f; dim.y = 0.0f; - m_partiSel[0] = m_particule->CreateParticule(pos, speed, dim, PARTISELY, 1.0f, 0.0f, 0.0f); - m_partiSel[1] = m_particule->CreateParticule(pos, speed, dim, PARTISELY, 1.0f, 0.0f, 0.0f); - m_partiSel[2] = m_particule->CreateParticule(pos, speed, dim, PARTISELR, 1.0f, 0.0f, 0.0f); - m_partiSel[3] = m_particule->CreateParticule(pos, speed, dim, PARTISELR, 1.0f, 0.0f, 0.0f); - UpdateSelectParticule(); + m_partiSel[0] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISELY, 1.0f, 0.0f, 0.0f); + m_partiSel[1] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISELY, 1.0f, 0.0f, 0.0f); + m_partiSel[2] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISELR, 1.0f, 0.0f, 0.0f); + m_partiSel[3] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISELR, 1.0f, 0.0f, 0.0f); + UpdateSelectParticle(); } } } // Updates the particles associated to the object. -void CObject::UpdateSelectParticule() +void CObject::UpdateSelectParticle() { Math::Vector pos[4]; Math::Point dim[4]; @@ -7405,7 +7375,7 @@ void CObject::UpdateSelectParticule() pos[3] = Math::Vector(-5.3f, 2.7f, -1.8f); } - angle = RetAngleY(0)/Math::PI; + angle = GetAngleY(0)/Math::PI; zoom[0] = 1.0f; zoom[1] = 1.0f; @@ -7426,7 +7396,7 @@ void CObject::UpdateSelectParticule() { pos[i] = Math::Transform(m_objectPart[0].matWorld, pos[i]); dim[i].y = dim[i].x; - m_particule->SetParam(m_partiSel[i], pos[i], dim[i], zoom[i], angle, 1.0f); + m_particle->SetParam(m_partiSel[i], pos[i], dim[i], zoom[i], angle, 1.0f); } } @@ -7438,42 +7408,42 @@ void CObject::SetRunScript(CScript* script) m_runScript = script; } -CScript* CObject::RetRunScript() +CScript* CObject::GetRunScript() { return m_runScript; } -// Returns the variables of "this" for CBOT. +// Geturns the variables of "this" for CBOT. -CBotVar* CObject::RetBotVar() +CBotVar* CObject::GetBotVar() { return m_botVar; } -// Returns the physics associated to the object. +// Geturns the physics associated to the object. -CPhysics* CObject::RetPhysics() +CPhysics* CObject::GetPhysics() { return m_physics; } -// Returns the brain associated to the object. +// Geturns the brain associated to the object. -CBrain* CObject::RetBrain() +CBrain* CObject::GetBrain() { return m_brain; } -// Returns the movement associated to the object. +// Geturns the movement associated to the object. -CMotion* CObject::RetMotion() +CMotion* CObject::GetMotion() { return m_motion; } -// Returns the controller associated to the object. +// Geturns the controller associated to the object. -CAuto* CObject::RetAuto() +CAuto* CObject::GetAuto() { return m_auto; } @@ -7492,7 +7462,7 @@ void CObject::SetDefRank(int rank) m_defRank = rank; } -int CObject::RetDefRank() +int CObject::GetDefRank() { return m_defRank; } @@ -7555,51 +7525,51 @@ void CObject::DeleteDeselList(CObject* pObj) // Management of the state of the pencil drawing robot. -bool CObject::RetTraceDown() +bool CObject::GetTraceDown() { CMotionVehicle* mv; if ( m_motion == 0 ) return false; - mv = (CMotionVehicle*)m_motion; - return mv->RetTraceDown(); + mv = dynamic_cast<CMotionVehicle*>(m_motion); + return mv->GetTraceDown(); } void CObject::SetTraceDown(bool bDown) { CMotionVehicle* mv; if ( m_motion == 0 ) return; - mv = (CMotionVehicle*)m_motion; + mv = dynamic_cast<CMotionVehicle*>(m_motion); mv->SetTraceDown(bDown); } -int CObject::RetTraceColor() +int CObject::GetTraceColor() { CMotionVehicle* mv; if ( m_motion == 0 ) return 0; - mv = (CMotionVehicle*)m_motion; - return mv->RetTraceColor(); + mv = dynamic_cast<CMotionVehicle*>(m_motion); + return mv->GetTraceColor(); } void CObject::SetTraceColor(int color) { CMotionVehicle* mv; if ( m_motion == 0 ) return; - mv = (CMotionVehicle*)m_motion; + mv = dynamic_cast<CMotionVehicle*>(m_motion); mv->SetTraceColor(color); } -float CObject::RetTraceWidth() +float CObject::GetTraceWidth() { CMotionVehicle* mv; if ( m_motion == 0 ) return 0.0f; - mv = (CMotionVehicle*)m_motion; - return mv->RetTraceWidth(); + mv = dynamic_cast<CMotionVehicle*>(m_motion); + return mv->GetTraceWidth(); } void CObject::SetTraceWidth(float width) { CMotionVehicle* mv; if ( m_motion == 0 ) return; - mv = (CMotionVehicle*)m_motion; + mv = dynamic_cast<CMotionVehicle*>(m_motion); mv->SetTraceWidth(width); } diff --git a/src/object/object.h b/src/object/object.h index 88ae486..1301768 100644 --- a/src/object/object.h +++ b/src/object/object.h @@ -35,7 +35,10 @@ class CRobotMain; class CBotVar; class CScript; - +namespace Ui +{ +class CDisplayText; +} // The father of all parts must always be the part number zero! @@ -46,69 +49,70 @@ const int OBJECTMAXDESELLIST = 10; const int OBJECTMAXINFO = 10; const int OBJECTMAXCMDLINE = 20; + enum ObjectMaterial { - OM_METAL = 0, // metal - OM_PLASTIC = 1, // plastic - OM_HUMAN = 2, // cosmonaut - OM_ANIMAL = 3, // insect - OM_VEGETAL = 4, // plant - OM_MINERAL = 5, // stone + OM_METAL = 0, // metal + OM_PLASTIC = 1, // plastic + OM_HUMAN = 2, // cosmonaut + OM_ANIMAL = 3, // insect + OM_VEGETAL = 4, // plant + OM_MINERAL = 5, // stone }; struct ObjectPart { - char bUsed; - int object; // number of the object in CEngine - int parentPart; // number of father part - int masterParti; // master canal of the particle - Math::Vector position; - Math::Vector angle; - Math::Vector zoom; - char bTranslate; - char bRotate; - char bZoom; - Math::Matrix matTranslate; - Math::Matrix matRotate; - Math::Matrix matTransform; - Math::Matrix matWorld; + char bUsed; + int object; // number of the object in CEngine + int parentPart; // number of father part + int masterParti; // master canal of the particle + Math::Vector position; + Math::Vector angle; + Math::Vector zoom; + char bTranslate; + char bRotate; + char bZoom; + Math::Matrix matTranslate; + Math::Matrix matRotate; + Math::Matrix matTransform; + Math::Matrix matWorld; }; struct Character { - float wheelFront; // position X of the front wheels - float wheelBack; // position X of the back wheels - float wheelLeft; // position Z of the left wheels - float wheelRight; // position Z of the right wheels - float height; // normal height on top of ground - Math::Vector posPower; // position of the battery + float wheelFront; // position X of the front wheels + float wheelBack; // position X of the back wheels + float wheelLeft; // position Z of the left wheels + float wheelRight; // position Z of the right wheels + float height; // normal height on top of ground + Math::Vector posPower; // position of the battery }; struct Info { - char name[20]; // name of the information - float value; // value of the information + char name[20]; // name of the information + float value; // value of the information }; enum ExploType { - EXPLO_BOUM = 1, - EXPLO_BURN = 2, - EXPLO_WATER = 3, + EXPLO_BOUM = 1, + EXPLO_BURN = 2, + EXPLO_WATER = 3, }; enum ResetCap { - RESET_NONE = 0, - RESET_MOVE = 1, - RESET_DELETE = 2, + RESET_NONE = 0, + RESET_MOVE = 1, + RESET_DELETE = 2, }; enum RadarFilter { - FILTER_NONE = 0, - FILTER_ONLYLANDING = 1, - FILTER_ONLYFLYING = 2, + FILTER_NONE = 0, + FILTER_ONLYLANDING = 1, + FILTER_ONLYFLYING = 2, }; @@ -162,7 +166,7 @@ public: bool CreateRuin(Math::Vector pos, float angle, float height, ObjectType type); bool CreateApollo(Math::Vector pos, float angle, ObjectType type); - bool ReadProgram(int rank, char* filename); + bool ReadProgram(int rank, const char* filename); bool WriteProgram(int rank, char* filename); bool RunProgram(int rank); @@ -235,8 +239,8 @@ public: void SetResetRun(int run); int GetResetRun(); - void SetMasterParticule(int part, int parti); - int GetMasterParticule(int part); + void SetMasterParticle(int part, int parti); + int GetMasterParticle(int part); void SetPower(CObject* power); CObject* GetPower(); @@ -252,8 +256,8 @@ public: void SetInfo(int rank, Info info); Info GetInfo(int rank); int GetInfoTotal(); - void SetInfoGeturn(float value); - float GetInfoGeturn(); + void SetInfoReturn(float value); + float GetInfoReturn(); void SetInfoUpdate(bool bUpdate); bool GetInfoUpdate(); @@ -370,7 +374,7 @@ public: void StopShowLimit(); bool IsProgram(); - void CreateSelectParticule(); + void CreateSelectParticle(); void SetRunScript(CScript* script); CScript* GetRunScript(); @@ -414,25 +418,25 @@ protected: void UpdateEnergyMapping(); bool UpdateTransformObject(int part, bool bForceUpdate); bool UpdateTransformObject(); - void UpdateSelectParticule(); + void UpdateSelectParticle(); protected: - CInstanceManager* m_iMan; - Gfx::CEngine* m_engine; - Gfx::CLightManager* m_lightMan; - Gfx::CTerrain* m_terrain; - Gfx::CWater* m_water; - Gfx::CCamera* m_camera; - Gfx::CParticle* m_particle; - CPhysics* m_physics; - CBrain* m_brain; - CMotion* m_motion; - CAuto* m_auto; - CDisplayText* m_displayText; - CRobotMain* m_main; - CSoundInterface* m_sound; - CBotVar* m_botVar; - CScript* m_runScript; + CInstanceManager* m_iMan; + Gfx::CEngine* m_engine; + Gfx::CLightManager* m_lightMan; + Gfx::CTerrain* m_terrain; + Gfx::CWater* m_water; + Gfx::CCamera* m_camera; + Gfx::CParticle* m_particle; + CPhysics* m_physics; + CBrain* m_brain; + CMotion* m_motion; + CAuto* m_auto; + Ui::CDisplayText* m_displayText; + CRobotMain* m_main; + CSoundInterface* m_sound; + CBotVar* m_botVar; + CScript* m_runScript; ObjectType m_type; // OBJECT_* int m_id; // unique identifier @@ -462,8 +466,8 @@ protected: float m_shotTime; // time since last shot bool m_bVirusMode; // virus activated/triggered float m_virusTime; // lifetime of the virus - float m_lastVirusParticule; - float m_lastParticule; + float m_lastVirusParticle; + float m_lastParticle; bool m_bHilite; bool m_bSelect; // object selected bool m_bSelectable; // selectable object @@ -522,7 +526,7 @@ protected: int m_infoTotal; Info m_info[OBJECTMAXINFO]; - float m_infoGeturn; + float m_infoReturn; bool m_bInfoUpdate; float m_cmdLine[OBJECTMAXCMDLINE]; diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 0213401..8178ab4 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -615,7 +615,7 @@ CRobotMain::CRobotMain(CInstanceManager* iMan) m_event = (CEvent*)m_iMan->SearchInstance(CLASS_EVENT); m_engine = (CD3DEngine*)m_iMan->SearchInstance(CLASS_ENGINE); m_light = (CLight*)m_iMan->SearchInstance(CLASS_LIGHT); - m_particule = (CParticule*)m_iMan->SearchInstance(CLASS_PARTICULE); + m_particle = (CParticle*)m_iMan->SearchInstance(CLASS_PARTICULE); m_water = (CWater*)m_iMan->SearchInstance(CLASS_WATER); m_cloud = (CCloud*)m_iMan->SearchInstance(CLASS_CLOUD); m_blitz = (CBlitz*)m_iMan->SearchInstance(CLASS_BLITZ); @@ -740,7 +740,7 @@ CRobotMain::CRobotMain(CInstanceManager* iMan) for ( i=0 ; i<OBJECT_MAX ; i++ ) { type = (ObjectType)i; - token = RetObjectName(type); + token = GetObjectName(type); if ( token[0] != 0 ) { CBotProgram::DefineNum(token, type); @@ -913,7 +913,7 @@ void CRobotMain::ChangePhase(Phase phase) m_terrain->FlushBuildingLevel(); m_terrain->FlushFlyingLimit(); m_light->FlushLight(); - m_particule->FlushParticule(); + m_particle->FlushParticule(); m_water->Flush(); m_cloud->Flush(); m_blitz->Flush(); @@ -1323,7 +1323,7 @@ bool CRobotMain::EventProcess(const Event &event) HighlightClear(); if ( event.param == VK_F11 ) { - m_particule->WriteWheelTrace("Savegame\\t.bmp", 256, 256, Math::Vector(16.0f, 0.0f, -368.0f), Math::Vector(140.0f, 0.0f, -248.0f)); + m_particle->WriteWheelTrace("Savegame\\t.bmp", 256, 256, Math::Vector(16.0f, 0.0f, -368.0f), Math::Vector(140.0f, 0.0f, -248.0f)); return false; } if ( m_bEditLock ) // current edition? @@ -2374,7 +2374,7 @@ void CRobotMain::StartDisplayVisit(EventMsg event) m_visitTime = 0.0; m_visitParticule = 0.0f; - m_particule->DeleteParticule(PARTISHOW); + m_particle->DeleteParticule(PARTISHOW); m_camera->StartVisit(m_displayText->GetVisitGoal(event), m_displayText->GetVisitDist(event)); @@ -2412,7 +2412,7 @@ void CRobotMain::FrameVisit(float rTime) speed = Math::Vector(0.0f, 0.0f, 0.0f); dim.x = 30.0f; dim.y = dim.x; - m_particule->CreateParticule(pos, speed, dim, PARTISHOW, 2.0f); + m_particle->CreateParticle(pos, speed, dim, PARTISHOW, 2.0f); } } @@ -2434,7 +2434,7 @@ void CRobotMain::StopDisplayVisit() } // Removes particles "arrows". - m_particule->DeleteParticule(PARTISHOW); + m_particle->DeleteParticule(PARTISHOW); m_camera->StopVisit(); m_displayText->ClearVisit(); @@ -3932,7 +3932,7 @@ void CRobotMain::ScenePerso() m_terrain->FlushBuildingLevel(); m_terrain->FlushFlyingLimit(); m_light->FlushLight(); - m_particule->FlushParticule(); + m_particle->FlushParticule(); m_iMan->Flush(CLASS_OBJECT); m_iMan->Flush(CLASS_PHYSICS); m_iMan->Flush(CLASS_BRAIN); @@ -4615,7 +4615,7 @@ void CRobotMain::CreateScene(bool bSoluce, bool bFixScene, bool bResetObject) pos.y += height; dim.x = ddim; dim.y = dim.x; - m_particule->CreateParticule(pos, Math::Vector(0.0f, 0.0f, 0.0f), dim, type, delay, 0.0f, 0.0f); + m_particle->CreateParticle(pos, Math::Vector(0.0f, 0.0f, 0.0f), dim, type, delay, 0.0f, 0.0f); } if ( Cmd(line, "CreateLight") && !bResetObject ) @@ -5767,7 +5767,7 @@ void CRobotMain::FlushShowLimit(int i) { if ( m_showLimit[i].parti[j] == 0 ) continue; - m_particule->DeleteParticule(m_showLimit[i].parti[j]); + m_particle->DeleteParticule(m_showLimit[i].parti[j]); m_showLimit[i].parti[j] = 0; } @@ -5811,7 +5811,7 @@ void CRobotMain::SetShowLimit(int i, ParticuleType parti, CObject *pObj, for ( j=0 ; j<m_showLimit[i].total ; j++ ) { - m_showLimit[i].parti[j] = m_particule->CreateParticule(pos, Math::Vector(0.0f, 0.0f, 0.0f), dim, parti, duration); + m_showLimit[i].parti[j] = m_particle->CreateParticle(pos, Math::Vector(0.0f, 0.0f, 0.0f), dim, parti, duration); } } @@ -5890,8 +5890,8 @@ void CRobotMain::FrameShowLimit(float rTime) m_terrain->MoveOnFloor(pos, true); if ( m_showLimit[i].radius <= 50.0f ) pos.y += 0.5f; else pos.y += 2.0f; - m_particule->SetPosition(m_showLimit[i].parti[j], pos); -//? m_particule->SetAngle(m_showLimit[i].parti[j], angle-Math::PI/2.0f); + m_particle->SetPosition(m_showLimit[i].parti[j], pos); +//? m_particle->SetAngle(m_showLimit[i].parti[j], angle-Math::PI/2.0f); angle += (2.0f*Math::PI)/m_showLimit[i].total; } @@ -6787,10 +6787,10 @@ void CRobotMain::ResetObject() } // Removes all bullets in progress. - m_particule->DeleteParticule(PARTIGUN1); - m_particule->DeleteParticule(PARTIGUN2); - m_particule->DeleteParticule(PARTIGUN3); - m_particule->DeleteParticule(PARTIGUN4); + m_particle->DeleteParticule(PARTIGUN1); + m_particle->DeleteParticule(PARTIGUN2); + m_particle->DeleteParticule(PARTIGUN3); + m_particle->DeleteParticule(PARTIGUN4); for ( i=0 ; i<1000000 ; i++ ) { @@ -6869,15 +6869,15 @@ void CRobotMain::ResetCreate() SaveAllScript(); // Removes all bullets in progress. - m_particule->DeleteParticule(PARTIGUN1); - m_particule->DeleteParticule(PARTIGUN2); - m_particule->DeleteParticule(PARTIGUN3); - m_particule->DeleteParticule(PARTIGUN4); + m_particle->DeleteParticule(PARTIGUN1); + m_particle->DeleteParticule(PARTIGUN2); + m_particle->DeleteParticule(PARTIGUN3); + m_particle->DeleteParticule(PARTIGUN4); DeselectAll(); // removes the control buttons DeleteAllObjects(); // removes all the current 3D Scene - m_particule->FlushParticule(); + m_particle->FlushParticule(); m_terrain->FlushBuildingLevel(); m_iMan->Flush(CLASS_OBJECT); m_iMan->Flush(CLASS_PHYSICS); @@ -7028,7 +7028,7 @@ Error CRobotMain::CheckEndMission(bool bFrame) // Checks if the mission is finished after displaying a message. -void CRobotMain::CheckEndMessage(char *message) +void CRobotMain::CheckEndMessage(const char *message) { int t; @@ -7062,7 +7062,7 @@ char* CRobotMain::GetObligatoryToken(int i) // Checks if an instruction is part of the obligatory list. -int CRobotMain::IsObligatoryToken(char *token) +int CRobotMain::IsObligatoryToken(const char *token) { int i; @@ -7078,7 +7078,7 @@ int CRobotMain::IsObligatoryToken(char *token) // Checks if an instruction is not part of the banned list. -bool CRobotMain::IsProhibitedToken(char *token) +bool CRobotMain::IsProhibitedToken(const char *token) { int i; diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 684672f..c649aab 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -22,13 +22,10 @@ #include <stdio.h> #include "common/misc.h" -//#include "old/d3dengine.h" #include "graphics/engine/engine.h" #include "object/object.h" #include "object/mainmovie.h" -//#include "old/camera.h" #include "graphics/engine/camera.h" -//#include "old/particule.h" #include "graphics/engine/particle.h" enum Phase @@ -88,7 +85,7 @@ class CWindow; class CControl; class CDisplayText; class CDisplayInfo; -class CSound; +class CSoundInterface; struct EndTake @@ -189,11 +186,11 @@ public: void ResetObject(); void ResetCreate(); Error CheckEndMission(bool bFrame); - void CheckEndMessage(char *message); + void CheckEndMessage(const char *message); int GetObligatoryToken(); char* GetObligatoryToken(int i); - int IsObligatoryToken(char *token); - bool IsProhibitedToken(char *token); + int IsObligatoryToken(const char *token); + bool IsProhibitedToken(const char *token); void UpdateMap(); bool GetShowMap(); @@ -335,7 +332,7 @@ protected: CMainMap* m_map; CEvent* m_event; CD3DEngine* m_engine; - Gfx::CParticle* m_particule; + Gfx::CParticle* m_particle; CWater* m_water; CCloud* m_cloud; CBlitz* m_blitz; diff --git a/src/object/task/task.cpp b/src/object/task/task.cpp index f910ea2..b310fd5 100644 --- a/src/object/task/task.cpp +++ b/src/object/task/task.cpp @@ -17,7 +17,7 @@ // task.cpp -#include <stdio.h> +// #include <stdio.h> #include "object/task/task.h" @@ -32,20 +32,20 @@ CTask::CTask(CInstanceManager* iMan, CObject* object) { m_iMan = iMan; - m_engine = (CD3DEngine*)m_iMan->SearchInstance(CLASS_ENGINE); - m_light = (CLight*)m_iMan->SearchInstance(CLASS_LIGHT); - m_particule = (CParticule*)m_iMan->SearchInstance(CLASS_PARTICULE); - m_terrain = (CTerrain*)m_iMan->SearchInstance(CLASS_TERRAIN); - m_water = (CWater*)m_iMan->SearchInstance(CLASS_WATER); - m_camera = (CCamera*)m_iMan->SearchInstance(CLASS_CAMERA); - m_main = (CRobotMain*)m_iMan->SearchInstance(CLASS_MAIN); - m_displayText = (CDisplayText*)m_iMan->SearchInstance(CLASS_DISPLAYTEXT); - m_sound = (CSound*)m_iMan->SearchInstance(CLASS_SOUND); + m_engine = static_cast<Gfx::CEngine*>(m_iMan->SearchInstance(CLASS_ENGINE)); + m_lightMan = static_cast<Gfx::CLightManager*>(m_iMan->SearchInstance(CLASS_LIGHT)); + m_terrain = static_cast<Gfx::CTerrain*>(m_iMan->SearchInstance(CLASS_TERRAIN)); + m_water = static_cast<Gfx::CWater*>(m_iMan->SearchInstance(CLASS_WATER)); + m_particle = static_cast<Gfx::CParticle*>(m_iMan->SearchInstance(CLASS_PARTICULE)); + m_camera = static_cast<Gfx::CCamera*>(m_iMan->SearchInstance(CLASS_CAMERA)); + m_displayText = static_cast<Ui::CDisplayText*>(m_iMan->SearchInstance(CLASS_DISPLAYTEXT)); + m_main = static_cast<CRobotMain*>(m_iMan->SearchInstance(CLASS_MAIN)); + m_sound = static_cast<CSoundInterface*>(m_iMan->SearchInstance(CLASS_SOUND)); m_object = object; - m_physics = m_object->RetPhysics(); - m_brain = m_object->RetBrain(); - m_motion = m_object->RetMotion(); + m_physics = m_object->GetPhysics(); + m_brain = m_object->GetBrain(); + m_motion = m_object->GetMotion(); } // Object's destructor. diff --git a/src/object/task/task.h b/src/object/task/task.h index a3ec62c..a0da9d2 100644 --- a/src/object/task/task.h +++ b/src/object/task/task.h @@ -24,19 +24,25 @@ class CInstanceManager; -class CD3DEngine; -class CLight; -class CParticule; -class CTerrain; -class CWater; -class CCamera; class CBrain; class CPhysics; class CMotion; class CObject; class CRobotMain; +class CSoundInterface; + +namespace Ui { class CDisplayText; -class CSound; +} /* Ui */ + +namespace Gfx { +class CEngine; +class CLightManager; +class CParticle; +class CTerrain; +class CWater; +class CCamera; +} /* Gfx */ const float TAKE_DIST = 6.0f; // distance to an object to pick it @@ -66,21 +72,19 @@ public: virtual bool Abort(); protected: - -protected: - CInstanceManager* m_iMan; - CD3DEngine* m_engine; - CLight* m_light; - CParticule* m_particule; - CTerrain* m_terrain; - CWater* m_water; - CCamera* m_camera; - CMotion* m_motion; - CBrain* m_brain; - CPhysics* m_physics; - CObject* m_object; - CRobotMain* m_main; - CDisplayText* m_displayText; - CSound* m_sound; + CInstanceManager* m_iMan; + Gfx::CEngine* m_engine; + Gfx::CLightManager* m_lightMan; + Gfx::CParticle* m_particle; + Gfx::CTerrain* m_terrain; + Gfx::CWater* m_water; + Gfx::CCamera* m_camera; + CMotion* m_motion; + CBrain* m_brain; + CPhysics* m_physics; + CObject* m_object; + CRobotMain* m_main; + Ui::CDisplayText* m_displayText; + CSoundInterface* m_sound; }; diff --git a/src/object/task/taskmanager.cpp b/src/object/task/taskmanager.cpp index d81fb5b..171be1d 100644 --- a/src/object/task/taskmanager.cpp +++ b/src/object/task/taskmanager.cpp @@ -136,7 +136,7 @@ Error CTaskManager::StartTaskSearch() // Reads an information terminal. -Error CTaskManager::StartTaskInfo(char *name, float value, float power, bool bSend) +Error CTaskManager::StartTaskInfo(const char *name, float value, float power, bool bSend) { m_task = new CTaskInfo(m_iMan, m_object); return ((CTaskInfo*)m_task)->Start(name, value, power, bSend); diff --git a/src/object/task/taskmanager.h b/src/object/task/taskmanager.h index 14fc276..6ce023a 100644 --- a/src/object/task/taskmanager.h +++ b/src/object/task/taskmanager.h @@ -43,7 +43,7 @@ public: Error StartTaskFlag(TaskFlagOrder order, int rank); Error StartTaskBuild(ObjectType type); Error StartTaskSearch(); - Error StartTaskInfo(char *name, float value, float power, bool bSend); + Error StartTaskInfo(const char *name, float value, float power, bool bSend); Error StartTaskTerraform(); Error StartTaskPen(bool bDown, int color); Error StartTaskRecover(); |