summaryrefslogtreecommitdiffstats
path: root/src/object
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-06-10 15:28:12 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-06-10 15:28:12 +0200
commit697fbdabf10d956e0f13bfbc9414d3db40f0c535 (patch)
treeab80ba3119d07b11da5478009b905edb702c103f /src/object
parent680af178196217bdd255d2bc851f240983144ac1 (diff)
downloadcolobot-697fbdabf10d956e0f13bfbc9414d3db40f0c535.tar.gz
colobot-697fbdabf10d956e0f13bfbc9414d3db40f0c535.tar.bz2
colobot-697fbdabf10d956e0f13bfbc9414d3db40f0c535.zip
BOOL -> bool; additional fixes in constructors/destructors
Diffstat (limited to 'src/object')
-rw-r--r--src/object/auto/auto.cpp60
-rw-r--r--src/object/auto/auto.h40
-rw-r--r--src/object/auto/autobase.cpp99
-rw-r--r--src/object/auto/autobase.h12
-rw-r--r--src/object/auto/autoconvert.cpp61
-rw-r--r--src/object/auto/autoconvert.h18
-rw-r--r--src/object/auto/autoderrick.cpp63
-rw-r--r--src/object/auto/autoderrick.h16
-rw-r--r--src/object/auto/autodestroyer.cpp45
-rw-r--r--src/object/auto/autodestroyer.h14
-rw-r--r--src/object/auto/autoegg.cpp61
-rw-r--r--src/object/auto/autoegg.h14
-rw-r--r--src/object/auto/autoenergy.cpp57
-rw-r--r--src/object/auto/autoenergy.h12
-rw-r--r--src/object/auto/autofactory.cpp81
-rw-r--r--src/object/auto/autofactory.h16
-rw-r--r--src/object/auto/autoflag.cpp15
-rw-r--r--src/object/auto/autoflag.h4
-rw-r--r--src/object/auto/autohuston.cpp23
-rw-r--r--src/object/auto/autohuston.h8
-rw-r--r--src/object/auto/autoinfo.cpp43
-rw-r--r--src/object/auto/autoinfo.h12
-rw-r--r--src/object/auto/autojostle.cpp11
-rw-r--r--src/object/auto/autojostle.h4
-rw-r--r--src/object/auto/autokid.cpp20
-rw-r--r--src/object/auto/autokid.h6
-rw-r--r--src/object/auto/autolabo.cpp59
-rw-r--r--src/object/auto/autolabo.h12
-rw-r--r--src/object/auto/automush.cpp29
-rw-r--r--src/object/auto/automush.h10
-rw-r--r--src/object/auto/autonest.cpp33
-rw-r--r--src/object/auto/autonest.h10
-rw-r--r--src/object/auto/autonuclear.cpp47
-rw-r--r--src/object/auto/autonuclear.h12
-rw-r--r--src/object/auto/autopara.cpp33
-rw-r--r--src/object/auto/autopara.h10
-rw-r--r--src/object/auto/autoportico.cpp31
-rw-r--r--src/object/auto/autoportico.h6
-rw-r--r--src/object/auto/autoradar.cpp29
-rw-r--r--src/object/auto/autoradar.h8
-rw-r--r--src/object/auto/autorepair.cpp33
-rw-r--r--src/object/auto/autorepair.h10
-rw-r--r--src/object/auto/autoresearch.cpp71
-rw-r--r--src/object/auto/autoresearch.h14
-rw-r--r--src/object/auto/autoroot.cpp11
-rw-r--r--src/object/auto/autoroot.h4
-rw-r--r--src/object/auto/autosafe.cpp61
-rw-r--r--src/object/auto/autosafe.h14
-rw-r--r--src/object/auto/autostation.cpp29
-rw-r--r--src/object/auto/autostation.h8
-rw-r--r--src/object/auto/autotower.cpp45
-rw-r--r--src/object/auto/autotower.h12
-rw-r--r--src/object/brain.cpp266
-rw-r--r--src/object/brain.h66
-rw-r--r--src/object/motion/motion.cpp28
-rw-r--r--src/object/motion/motion.h12
-rw-r--r--src/object/motion/motionant.cpp28
-rw-r--r--src/object/motion/motionant.h10
-rw-r--r--src/object/motion/motionbee.cpp28
-rw-r--r--src/object/motion/motionbee.h10
-rw-r--r--src/object/motion/motionhuman.cpp42
-rw-r--r--src/object/motion/motionhuman.h12
-rw-r--r--src/object/motion/motionmother.cpp26
-rw-r--r--src/object/motion/motionmother.h10
-rw-r--r--src/object/motion/motionspider.cpp28
-rw-r--r--src/object/motion/motionspider.h10
-rw-r--r--src/object/motion/motiontoto.cpp52
-rw-r--r--src/object/motion/motiontoto.h14
-rw-r--r--src/object/motion/motionvehicle.cpp58
-rw-r--r--src/object/motion/motionvehicle.h22
-rw-r--r--src/object/motion/motionworm.cpp34
-rw-r--r--src/object/motion/motionworm.h12
-rw-r--r--src/object/object.cpp484
-rw-r--r--src/object/object.h228
-rw-r--r--src/object/robotmain.cpp570
-rw-r--r--src/object/robotmain.h162
-rw-r--r--src/object/task/task.cpp12
-rw-r--r--src/object/task/task.h6
-rw-r--r--src/object/task/taskadvance.cpp15
-rw-r--r--src/object/task/taskadvance.h4
-rw-r--r--src/object/task/taskbuild.cpp80
-rw-r--r--src/object/task/taskbuild.h12
-rw-r--r--src/object/task/taskfire.cpp27
-rw-r--r--src/object/task/taskfire.h10
-rw-r--r--src/object/task/taskfireant.cpp28
-rw-r--r--src/object/task/taskfireant.h8
-rw-r--r--src/object/task/taskflag.cpp19
-rw-r--r--src/object/task/taskflag.h6
-rw-r--r--src/object/task/taskgoto.cpp204
-rw-r--r--src/object/task/taskgoto.h26
-rw-r--r--src/object/task/taskgungoal.cpp15
-rw-r--r--src/object/task/taskgungoal.h4
-rw-r--r--src/object/task/taskinfo.cpp21
-rw-r--r--src/object/task/taskinfo.h8
-rw-r--r--src/object/task/taskmanager.cpp22
-rw-r--r--src/object/task/taskmanager.h14
-rw-r--r--src/object/task/taskmanip.cpp108
-rw-r--r--src/object/task/taskmanip.h24
-rw-r--r--src/object/task/taskpen.cpp23
-rw-r--r--src/object/task/taskpen.h8
-rw-r--r--src/object/task/taskrecover.cpp40
-rw-r--r--src/object/task/taskrecover.h6
-rw-r--r--src/object/task/taskreset.cpp31
-rw-r--r--src/object/task/taskreset.h6
-rw-r--r--src/object/task/tasksearch.cpp38
-rw-r--r--src/object/task/tasksearch.h8
-rw-r--r--src/object/task/taskshield.cpp36
-rw-r--r--src/object/task/taskshield.h10
-rw-r--r--src/object/task/taskspiderexplo.cpp22
-rw-r--r--src/object/task/taskspiderexplo.h6
-rw-r--r--src/object/task/tasktake.cpp58
-rw-r--r--src/object/task/tasktake.h14
-rw-r--r--src/object/task/taskterraform.cpp31
-rw-r--r--src/object/task/taskterraform.h8
-rw-r--r--src/object/task/taskturn.cpp19
-rw-r--r--src/object/task/taskturn.h6
-rw-r--r--src/object/task/taskwait.cpp11
-rw-r--r--src/object/task/taskwait.h4
118 files changed, 2336 insertions, 2390 deletions
diff --git a/src/object/auto/auto.cpp b/src/object/auto/auto.cpp
index 0600d86..94a8afa 100644
--- a/src/object/auto/auto.cpp
+++ b/src/object/auto/auto.cpp
@@ -79,7 +79,7 @@ CAuto::CAuto(CInstanceManager* iMan, CObject* object)
m_type = m_object->RetType();
m_time = 0.0f;
m_lastUpdateTime = 0.0f;
- m_bMotor = FALSE;
+ m_bMotor = false;
m_progressTime = 0.0f;
m_progressTotal = 1.0f;
@@ -96,7 +96,7 @@ CAuto::~CAuto()
// Destroys the object.
-void CAuto::DeleteObject(BOOL bAll)
+void CAuto::DeleteObject(bool bAll)
{
}
@@ -105,7 +105,7 @@ void CAuto::DeleteObject(BOOL bAll)
void CAuto::Init()
{
- m_bBusy = FALSE;
+ m_bBusy = false;
}
// Starts the object.
@@ -117,29 +117,29 @@ void CAuto::Start(int param)
// Give a type.
-BOOL CAuto::SetType(ObjectType type)
+bool CAuto::SetType(ObjectType type)
{
- return FALSE;
+ return false;
}
// Gives a value.
-BOOL CAuto::SetValue(int rank, float value)
+bool CAuto::SetValue(int rank, float value)
{
- return FALSE;
+ return false;
}
// Gives the string.
-BOOL CAuto::SetString(char *string)
+bool CAuto::SetString(char *string)
{
- return FALSE;
+ return false;
}
// Management of an event.
-BOOL CAuto::EventProcess(const Event &event)
+bool CAuto::EventProcess(const Event &event)
{
if ( event.event == EVENT_FRAME &&
!m_engine->RetPause() )
@@ -150,10 +150,10 @@ BOOL CAuto::EventProcess(const Event &event)
if ( !m_object->RetSelect() ) // robot not selected?
{
- return TRUE;
+ return true;
}
- return TRUE;
+ return true;
}
// Indicates whether the controller has finished its activity.
@@ -165,15 +165,15 @@ Error CAuto::IsEnded()
// Stops the controller
-BOOL CAuto::Abort()
+bool CAuto::Abort()
{
- return FALSE;
+ return false;
}
// Creates all the interface when the object is selected.
-BOOL CAuto::CreateInterface(BOOL bSelect)
+bool CAuto::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, dim, ddim;
@@ -187,7 +187,7 @@ BOOL CAuto::CreateInterface(BOOL bSelect)
m_interface->DeleteControl(EVENT_WINDOW0); // destroys the window
}
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pos.x = 0.0f;
pos.y = 0.0f;
@@ -196,7 +196,7 @@ BOOL CAuto::CreateInterface(BOOL bSelect)
dim.y = 86.0f/480.0f;
m_interface->CreateWindows(pos, dim, 3, EVENT_WINDOW0);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
m_object->GetTooltipName(name);
pos.x = 0.0f;
@@ -282,12 +282,12 @@ BOOL CAuto::CreateInterface(BOOL bSelect)
m_lastUpdateTime = 0.0f;
UpdateInterface(0.0f);
- return TRUE;
+ return true;
}
// Change the state of a button interface.
-void CAuto::CheckInterface(CWindow *pw, EventMsg event, BOOL bState)
+void CAuto::CheckInterface(CWindow *pw, EventMsg event, bool bState)
{
CControl* control;
@@ -299,7 +299,7 @@ void CAuto::CheckInterface(CWindow *pw, EventMsg event, BOOL bState)
// Change the state of a button interface.
-void CAuto::EnableInterface(CWindow *pw, EventMsg event, BOOL bState)
+void CAuto::EnableInterface(CWindow *pw, EventMsg event, bool bState)
{
CControl* control;
@@ -311,7 +311,7 @@ void CAuto::EnableInterface(CWindow *pw, EventMsg event, BOOL bState)
// Change the state of a button interface.
-void CAuto::VisibleInterface(CWindow *pw, EventMsg event, BOOL bState)
+void CAuto::VisibleInterface(CWindow *pw, EventMsg event, bool bState)
{
CControl* control;
@@ -323,7 +323,7 @@ void CAuto::VisibleInterface(CWindow *pw, EventMsg event, BOOL bState)
// Change the state of a button interface.
-void CAuto::DeadInterface(CWindow *pw, EventMsg event, BOOL bState)
+void CAuto::DeadInterface(CWindow *pw, EventMsg event, bool bState)
{
CControl* control;
@@ -387,12 +387,12 @@ Error CAuto::RetError()
// Management of the occupation.
-BOOL CAuto::RetBusy()
+bool CAuto::RetBusy()
{
return m_bBusy;
}
-void CAuto::SetBusy(BOOL bBusy)
+void CAuto::SetBusy(bool bBusy)
{
m_bBusy = bBusy;
}
@@ -411,12 +411,12 @@ void CAuto::EventProgress(float rTime)
// Engine management.
-BOOL CAuto::RetMotor()
+bool CAuto::RetMotor()
{
return m_bMotor;
}
-void CAuto::SetMotor(BOOL bMotor)
+void CAuto::SetMotor(bool bMotor)
{
m_bMotor = bMotor;
}
@@ -424,7 +424,7 @@ void CAuto::SetMotor(BOOL bMotor)
// Saves all parameters of the controller.
-BOOL CAuto::Write(char *line)
+bool CAuto::Write(char *line)
{
char name[100];
@@ -443,12 +443,12 @@ BOOL CAuto::Write(char *line)
sprintf(name, " aProgressTotal=%.2f", m_progressTotal);
strcat(line, name);
- return FALSE;
+ return false;
}
// Return all settings to the controller.
-BOOL CAuto::Read(char *line)
+bool CAuto::Read(char *line)
{
m_type = (ObjectType)OpInt(line, "aType", OBJECT_NULL);
m_bBusy = OpInt(line, "aBusy", 0);
@@ -456,6 +456,6 @@ BOOL CAuto::Read(char *line)
m_progressTime = OpFloat(line, "aProgressTime", 0.0f);
m_progressTotal = OpFloat(line, "aProgressTotal", 0.0f);
- return FALSE;
+ return false;
}
diff --git a/src/object/auto/auto.h b/src/object/auto/auto.h
index 96f0212..5a631ec 100644
--- a/src/object/auto/auto.h
+++ b/src/object/auto/auto.h
@@ -46,39 +46,39 @@ class CAuto
{
public:
CAuto(CInstanceManager* iMan, CObject* object);
- ~CAuto();
+ virtual ~CAuto();
- virtual void DeleteObject(BOOL bAll=FALSE);
+ virtual void DeleteObject(bool bAll=false);
virtual void Init();
virtual void Start(int param);
- virtual BOOL EventProcess(const Event &event);
+ virtual bool EventProcess(const Event &event);
virtual Error IsEnded();
- virtual BOOL Abort();
+ virtual bool Abort();
- virtual BOOL SetType(ObjectType type);
- virtual BOOL SetValue(int rank, float value);
- virtual BOOL SetString(char *string);
+ virtual bool SetType(ObjectType type);
+ virtual bool SetValue(int rank, float value);
+ virtual bool SetString(char *string);
- virtual BOOL CreateInterface(BOOL bSelect);
+ virtual bool CreateInterface(bool bSelect);
virtual Error RetError();
- virtual BOOL RetBusy();
- virtual void SetBusy(BOOL bBuse);
+ virtual bool RetBusy();
+ virtual void SetBusy(bool bBuse);
virtual void InitProgressTotal(float total);
virtual void EventProgress(float rTime);
- virtual BOOL RetMotor();
- virtual void SetMotor(BOOL bMotor);
+ virtual bool RetMotor();
+ virtual void SetMotor(bool bMotor);
- virtual BOOL Write(char *line);
- virtual BOOL Read(char *line);
+ 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(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 UpdateInterface();
void UpdateInterface(float rTime);
@@ -101,8 +101,8 @@ protected:
CSound* m_sound;
ObjectType m_type;
- BOOL m_bBusy;
- BOOL m_bMotor;
+ bool m_bBusy;
+ bool m_bMotor;
float m_time;
float m_lastUpdateTime;
float m_progressTime;
diff --git a/src/object/auto/autobase.cpp b/src/object/auto/autobase.cpp
index f7c3ca6..5c1bb2d 100644
--- a/src/object/auto/autobase.cpp
+++ b/src/object/auto/autobase.cpp
@@ -76,13 +76,12 @@ CAutoBase::CAutoBase(CInstanceManager* iMan, CObject* object)
CAutoBase::~CAutoBase()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoBase::DeleteObject(BOOL bAll)
+void CAutoBase::DeleteObject(bool bAll)
{
if ( m_soundChannel != -1 )
{
@@ -99,7 +98,7 @@ void CAutoBase::DeleteObject(BOOL bAll)
void CAutoBase::Init()
{
- m_bOpen = FALSE;
+ m_bOpen = false;
m_time = 0.0f;
m_lastParticule = 0.0f;
m_lastMotorParticule = 0.0f;
@@ -127,7 +126,7 @@ void CAutoBase::Start(int param)
// Management of an event.
-BOOL CAutoBase::EventProcess(const Event &event)
+bool CAutoBase::EventProcess(const Event &event)
{
D3DMATRIX* mat;
Event newEvent;
@@ -140,7 +139,7 @@ BOOL CAutoBase::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
begin:
iPos = m_object->RetPosition(0);
@@ -150,7 +149,7 @@ begin:
if ( m_param != PARAM_STOP && // not placed on the ground?
m_param != PARAM_FIXSCENE )
{
- FreezeCargo(TRUE); // freeze whole cargo
+ FreezeCargo(true); // freeze whole cargo
}
if ( m_param == PARAM_STOP ) // raises the ground?
@@ -206,8 +205,8 @@ begin:
m_progress = 0.0f;
m_speed = 1.0f/BASE_LAND_TIME;
- m_main->SetMovieLock(TRUE); // blocks everything until the end of the landing
- m_bMotor = TRUE; // lights the jet engine
+ m_main->SetMovieLock(true); // blocks everything until the end of the landing
+ m_bMotor = true; // lights the jet engine
m_camera->SetType(CAMERA_SCRIPT);
@@ -229,7 +228,7 @@ begin:
if ( m_soundChannel == -1 )
{
- m_soundChannel = m_sound->Play(SOUND_FLY, m_posSound, 0.3f, 2.0f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_FLY, m_posSound, 0.3f, 2.0f, true);
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.5f, BASE_LAND_TIME, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 2.0f, SOPER_STOP);
}
@@ -267,8 +266,8 @@ begin:
m_finalPos = pos;
m_object->SetPosition(0, pos);
- m_main->SetMovieLock(TRUE); // blocks everything until the end of the landing
- m_bMotor = TRUE; // lights the jet engine
+ m_main->SetMovieLock(true); // blocks everything until the end of the landing
+ m_bMotor = true; // lights the jet engine
m_camera->SetType(CAMERA_SCRIPT);
pos.x += 1000.0f;
@@ -312,7 +311,7 @@ begin:
if ( m_soundChannel == -1 )
{
- m_soundChannel = m_sound->Play(SOUND_FLY, m_posSound, 0.0f, 1.2f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_FLY, m_posSound, 0.0f, 1.2f, true);
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, BASE_TRANSIT_TIME*0.55f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.3f, 0.8f, BASE_TRANSIT_TIME*0.45f, SOPER_STOP);
}
@@ -321,7 +320,7 @@ begin:
if ( event.event == EVENT_UPDINTERFACE )
{
- if ( m_object->RetSelect() ) CreateInterface(TRUE);
+ if ( m_object->RetSelect() ) CreateInterface(true);
}
if ( event.event == EVENT_OBJECT_BTAKEOFF )
@@ -330,18 +329,18 @@ begin:
if ( err != ERR_OK )
{
m_displayText->DisplayError(err, m_object);
- return FALSE;
+ return false;
}
- err = m_main->CheckEndMission(FALSE);
+ err = m_main->CheckEndMission(false);
if ( err != ERR_OK )
{
m_displayText->DisplayError(err, m_object);
- return FALSE;
+ return false;
}
- FreezeCargo(TRUE); // freeze whole cargo
- m_main->SetMovieLock(TRUE); // blocks everything until the end
+ FreezeCargo(true); // freeze whole cargo
+ m_main->SetMovieLock(true); // blocks everything until the end
m_main->DeselectAll();
m_event->MakeEvent(newEvent, EVENT_UPDINTERFACE);
@@ -362,18 +361,18 @@ begin:
m_engine->SetFocus(1.0f);
- m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.3f, 1.5f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.3f, 1.5f, true);
m_sound->AddEnvelope(m_soundChannel, 0.3f, 1.5f, BASE_DOOR_TIME2, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 1.5f, 0.5f, SOPER_STOP);
m_phase = ABP_CLOSE2;
m_progress = 0.0f;
m_speed = 1.0f/BASE_DOOR_TIME2;
- return TRUE;
+ return true;
}
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_phase == ABP_WAIT ) return TRUE;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_phase == ABP_WAIT ) return true;
m_progress += event.rTime*m_speed;
@@ -458,7 +457,7 @@ begin:
}
else
{
- m_bMotor = FALSE; // put out the reactor
+ m_bMotor = false; // put out the reactor
m_object->SetPosition(0, m_pos); // setting down
m_object->SetCirVibration(D3DVECTOR(0.0f, 0.0f, 0.0f));
@@ -514,7 +513,7 @@ begin:
}
else
{
- m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.0f, 0.3f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.0f, 0.3f, true);
m_sound->AddEnvelope(m_soundChannel, 0.3f, 0.3f, 1.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.3f, 1.0f, BASE_DOOR_TIME-1.5f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.3f, 1.0f, SOPER_STOP);
@@ -574,7 +573,7 @@ begin:
m_particule->CreateParticule(pos, speed, dim, PARTICRASH, time, 0.0f, 2.0f);
}
- m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.3f, 1.5f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.3f, 1.5f, true);
m_sound->AddEnvelope(m_soundChannel, 0.3f, 1.5f, BASE_DOOR_TIME2, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 1.5f, 0.5f, SOPER_STOP);
@@ -632,11 +631,11 @@ begin:
{
if ( m_progress >= 1.0f )
{
- FreezeCargo(FALSE); // frees all cargo
+ FreezeCargo(false); // frees all cargo
if ( m_param != PARAM_PORTICO )
{
- m_main->SetMovieLock(FALSE); // you can play!
+ m_main->SetMovieLock(false); // you can play!
pObj = m_main->RetSelectObject();
m_main->SelectObject(pObj);
@@ -656,7 +655,7 @@ begin:
m_engine->SetFogStart(m_fogStart);
}
- m_bOpen = TRUE;
+ m_bOpen = true;
m_phase = ABP_WAIT;
m_progress = 0.0f;
m_speed = 1.0f/1.0f;
@@ -686,7 +685,7 @@ begin:
m_object->SetAngleX(18+i, 0.0f);
}
- m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.0f, 0.3f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_MANIP, m_posSound, 0.0f, 0.3f, true);
m_sound->AddEnvelope(m_soundChannel, 0.3f, 0.3f, 1.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.3f, 1.0f, BASE_DOOR_TIME-1.5f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.3f, 1.0f, SOPER_STOP);
@@ -713,7 +712,7 @@ begin:
{
m_object->SetAngleZ(1+i, PI/2.0f);
}
- m_bMotor = TRUE; // lights the jet engine
+ m_bMotor = true; // lights the jet engine
// Shock of the closing doors.
max = (int)(20.0f*m_engine->RetParticuleDensity());
@@ -734,7 +733,7 @@ begin:
m_sound->Play(SOUND_BOUM, m_object->RetPosition(0));
m_soundChannel = -1;
- m_bOpen = FALSE;
+ m_bOpen = false;
m_phase = ABP_TOWAIT;
m_progress = 0.0f;
m_speed = 1.0f/2.0f;
@@ -747,7 +746,7 @@ begin:
{
if ( m_soundChannel == -1 )
{
- m_soundChannel = m_sound->Play(SOUND_FLY, m_posSound, 0.0f, 0.5f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_FLY, m_posSound, 0.0f, 0.5f, true);
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.5f, 2.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.3f, 2.0f, BASE_TAKO_TIME, SOPER_STOP);
}
@@ -1101,12 +1100,12 @@ begin:
m_sound->Position(m_soundChannel, pos);
}
- return TRUE;
+ return true;
}
// Stops the controller.
-BOOL CAutoBase::Abort()
+bool CAutoBase::Abort()
{
Event newEvent;
CObject* pObj;
@@ -1129,7 +1128,7 @@ BOOL CAutoBase::Abort()
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.8f, 0.01f, SOPER_STOP);
m_soundChannel = -1;
}
- return TRUE;
+ return true;
}
if ( m_param == PARAM_PORTICO ) // gate on the porch?
@@ -1153,8 +1152,8 @@ BOOL CAutoBase::Abort()
m_phase == ABP_OPEN ||
m_phase == ABP_OPEN2 ) // Landing?
{
- m_bMotor = FALSE; // put out the jet engine
- m_bOpen = TRUE;
+ m_bMotor = false; // put out the jet engine
+ m_bOpen = true;
m_object->SetPosition(0, m_pos); // setting down
m_object->SetCirVibration(D3DVECTOR(0.0f, 0.0f, 0.0f));
@@ -1168,7 +1167,7 @@ BOOL CAutoBase::Abort()
m_object->SetPosition(18+i, D3DVECTOR(23.5f, 0.0f, 11.5f));
}
- m_main->SetMovieLock(FALSE); // you can play!
+ m_main->SetMovieLock(false); // you can play!
pObj = m_main->RetSelectObject();
m_main->SelectObject(pObj);
@@ -1197,7 +1196,7 @@ BOOL CAutoBase::Abort()
}
m_object->SetAngleZ(0, 0.0f);
- FreezeCargo(FALSE); // frees all cargo
+ FreezeCargo(false); // frees all cargo
if ( m_soundChannel != -1 )
{
@@ -1210,7 +1209,7 @@ BOOL CAutoBase::Abort()
m_progress = 0.0f;
m_speed = 1.0f/2.0f;
- return TRUE;
+ return true;
}
@@ -1224,7 +1223,7 @@ Error CAutoBase::RetError()
// Creates all the interface when the object is selected.
-BOOL CAutoBase::CreateInterface(BOOL bSelect)
+bool CAutoBase::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, dim, ddim;
@@ -1233,10 +1232,10 @@ BOOL CAutoBase::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
dim.x = 33.0f/640.0f;
dim.y = 33.0f/480.0f;
@@ -1273,7 +1272,7 @@ BOOL CAutoBase::CreateInterface(BOOL bSelect)
UpdateInterface();
- return TRUE;
+ return true;
}
// Updates the status of all interface buttons.
@@ -1292,7 +1291,7 @@ void CAutoBase::UpdateInterface()
// Freeze or frees all cargo.
-void CAutoBase::FreezeCargo(BOOL bFreeze)
+void CAutoBase::FreezeCargo(bool bFreeze)
{
CObject* pObj;
CPhysics* physics;
@@ -1305,7 +1304,7 @@ void CAutoBase::FreezeCargo(BOOL bFreeze)
pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i);
if ( pObj == 0 ) break;
- pObj->SetCargo(FALSE);
+ pObj->SetCargo(false);
if ( pObj == m_object ) continue; // yourself?
if ( pObj->RetTruck() != 0 ) continue; // transport object?
@@ -1316,7 +1315,7 @@ void CAutoBase::FreezeCargo(BOOL bFreeze)
{
if ( bFreeze )
{
- pObj->SetCargo(TRUE);
+ pObj->SetCargo(true);
}
physics = pObj->RetPhysics();
@@ -1403,7 +1402,7 @@ Error CAutoBase::CheckCloseDoor()
void CAutoBase::BeginTransit()
{
- BOOL bFull, bQuarter;
+ bool bFull, bQuarter;
if ( m_param == PARAM_TRANSIT2 )
{
@@ -1432,7 +1431,7 @@ void CAutoBase::BeginTransit()
m_engine->SetBackground(m_bgBack, 0x00000000, 0x00000000, 0x00000000, 0x00000000);
m_engine->LoadTexture(m_bgBack);
- m_cloud->SetEnable(FALSE); // cache clouds
+ m_cloud->SetEnable(false); // cache clouds
m_planet->SetMode(1);
}
@@ -1449,7 +1448,7 @@ void CAutoBase::EndTransit()
m_engine->SetBackground(m_bgName, m_bgUp, m_bgDown, m_bgCloudUp, m_bgCloudDown);
m_engine->LoadTexture(m_bgName);
- m_cloud->SetEnable(TRUE); // gives the clouds
+ m_cloud->SetEnable(true); // gives the clouds
m_planet->SetMode(0);
m_main->StartMusic();
diff --git a/src/object/auto/autobase.h b/src/object/auto/autobase.h
index 5610d6e..1a3623d 100644
--- a/src/object/auto/autobase.h
+++ b/src/object/auto/autobase.h
@@ -74,19 +74,19 @@ public:
CAutoBase(CInstanceManager* iMan, CObject* object);
~CAutoBase();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
void Start(int param);
- BOOL EventProcess(const Event &event);
- BOOL Abort();
+ bool EventProcess(const Event &event);
+ bool Abort();
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
protected:
void UpdateInterface();
- void FreezeCargo(BOOL bFreeze);
+ void FreezeCargo(bool bFreeze);
void MoveCargo();
Error CheckCloseDoor();
void BeginTransit();
@@ -94,7 +94,7 @@ protected:
protected:
AutoBasePhase m_phase;
- BOOL m_bOpen;
+ bool m_bOpen;
float m_progress;
float m_speed;
float m_lastParticule;
diff --git a/src/object/auto/autoconvert.cpp b/src/object/auto/autoconvert.cpp
index 54d495a..6cc94e5 100644
--- a/src/object/auto/autoconvert.cpp
+++ b/src/object/auto/autoconvert.cpp
@@ -52,7 +52,7 @@ CAutoConvert::CAutoConvert(CInstanceManager* iMan, CObject* object)
{
Init();
m_phase = ACP_STOP;
- m_bResetDelete = FALSE;
+ m_bResetDelete = false;
m_soundChannel = -1;
}
@@ -60,13 +60,12 @@ CAutoConvert::CAutoConvert(CInstanceManager* iMan, CObject* object)
CAutoConvert::~CAutoConvert()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoConvert::DeleteObject(BOOL bAll)
+void CAutoConvert::DeleteObject(bool bAll)
{
CObject* fret;
@@ -108,7 +107,7 @@ void CAutoConvert::Init()
// Management of an event.
-BOOL CAutoConvert::EventProcess(const Event &event)
+bool CAutoConvert::EventProcess(const Event &event)
{
CObject* fret;
D3DVECTOR pos, speed;
@@ -117,8 +116,8 @@ 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->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -137,12 +136,12 @@ BOOL CAutoConvert::EventProcess(const Event &event)
m_object->SetAngleX(2, -PI*0.35f*(0.8f+Rand()*0.2f));
m_object->SetAngleX(3, -PI*0.35f*(0.8f+Rand()*0.2f));
}
- return TRUE;
+ return true;
}
EventProgress(event.rTime);
- if ( m_phase == ACP_STOP ) return TRUE;
+ if ( m_phase == ACP_STOP ) return true;
if ( m_phase == ACP_WAIT )
{
@@ -157,14 +156,14 @@ BOOL CAutoConvert::EventProcess(const Event &event)
}
else
{
- fret->SetLock(TRUE); // stone usable
+ fret->SetLock(true); // stone usable
- SetBusy(TRUE);
+ SetBusy(true);
InitProgressTotal(3.0f+10.0f+1.5f);
UpdateInterface();
m_sound->Play(SOUND_OPEN, m_object->RetPosition(0), 1.0f, 1.0f);
- m_bSoundClose = FALSE;
+ m_bSoundClose = false;
m_phase = ACP_CLOSE;
m_progress = 0.0f;
@@ -179,7 +178,7 @@ BOOL CAutoConvert::EventProcess(const Event &event)
{
if ( m_progress >= 0.8f && !m_bSoundClose )
{
- m_bSoundClose = TRUE;
+ m_bSoundClose = true;
m_sound->Play(SOUND_CLOSE, m_object->RetPosition(0), 1.0f, 0.8f);
}
angle = -PI*0.35f*(1.0f-Bounce(m_progress, 0.85f, 0.05f));
@@ -191,7 +190,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->RetPosition(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);
@@ -290,7 +289,7 @@ BOOL CAutoConvert::EventProcess(const Event &event)
m_object->SetAngleX(2, -PI*0.35f);
m_object->SetAngleX(3, -PI*0.35f);
- SetBusy(FALSE);
+ SetBusy(false);
UpdateInterface();
m_phase = ACP_WAIT;
@@ -299,7 +298,7 @@ BOOL CAutoConvert::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Returns an error due the state of the automation.
@@ -317,7 +316,7 @@ Error CAutoConvert::RetError()
// Cancels the current transformation.
-BOOL CAutoConvert::Abort()
+bool CAutoConvert::Abort()
{
if ( m_soundChannel != -1 )
{
@@ -336,16 +335,16 @@ BOOL CAutoConvert::Abort()
m_progress = 0.0f;
m_speed = 1.0f/2.0f;
- SetBusy(FALSE);
+ SetBusy(false);
UpdateInterface();
- return TRUE;
+ return true;
}
// Creates all the interface when the object is selected.
-BOOL CAutoConvert::CreateInterface(BOOL bSelect)
+bool CAutoConvert::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -353,10 +352,10 @@ BOOL CAutoConvert::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -369,18 +368,18 @@ BOOL CAutoConvert::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 103, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
// Saves all parameters of the controller.
-BOOL CAutoConvert::Write(char *line)
+bool CAutoConvert::Write(char *line)
{
char name[100];
if ( m_phase == ACP_STOP ||
- m_phase == ACP_WAIT ) return FALSE;
+ m_phase == ACP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -396,14 +395,14 @@ BOOL CAutoConvert::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoConvert::Read(char *line)
+bool CAutoConvert::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -413,7 +412,7 @@ BOOL CAutoConvert::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
@@ -449,7 +448,7 @@ CObject* CAutoConvert::SearchStone(ObjectType type)
// Search if a vehicle is too close.
-BOOL CAutoConvert::SearchVehicle()
+bool CAutoConvert::SearchVehicle()
{
CObject* pObj;
D3DVECTOR cPos, oPos;
@@ -509,10 +508,10 @@ BOOL CAutoConvert::SearchVehicle()
if ( !pObj->GetCrashSphere(0, oPos, oRadius) ) continue;
dist = Length(oPos, cPos)-oRadius;
- if ( dist < 8.0f ) return TRUE;
+ if ( dist < 8.0f ) return true;
}
- return FALSE;
+ return false;
}
// Creates an object metal.
diff --git a/src/object/auto/autoconvert.h b/src/object/auto/autoconvert.h
index dbe7b26..5d610eb 100644
--- a/src/object/auto/autoconvert.h
+++ b/src/object/auto/autoconvert.h
@@ -49,21 +49,21 @@ public:
CAutoConvert(CInstanceManager* iMan, CObject* object);
~CAutoConvert();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL Abort();
+ bool Abort();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
CObject* SearchStone(ObjectType type);
- BOOL SearchVehicle();
+ bool SearchVehicle();
void CreateMetal();
protected:
@@ -72,8 +72,8 @@ protected:
float m_speed;
float m_timeVirus;
float m_lastParticule;
- BOOL m_bResetDelete;
- BOOL m_bSoundClose;
+ bool m_bResetDelete;
+ bool m_bSoundClose;
int m_soundChannel;
};
diff --git a/src/object/auto/autoderrick.cpp b/src/object/auto/autoderrick.cpp
index b28652f..8350da8 100644
--- a/src/object/auto/autoderrick.cpp
+++ b/src/object/auto/autoderrick.cpp
@@ -63,13 +63,12 @@ CAutoDerrick::CAutoDerrick(CInstanceManager* iMan, CObject* object)
CAutoDerrick::~CAutoDerrick()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoDerrick::DeleteObject(BOOL bAll)
+void CAutoDerrick::DeleteObject(bool bAll)
{
CObject* fret;
@@ -146,7 +145,7 @@ void CAutoDerrick::Init()
// Management of an event.
-BOOL CAutoDerrick::EventProcess(const Event &event)
+bool CAutoDerrick::EventProcess(const Event &event)
{
CObject* fret;
D3DVECTOR pos, speed;
@@ -155,9 +154,9 @@ BOOL CAutoDerrick::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_phase == ADP_WAIT ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_phase == ADP_WAIT ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -175,7 +174,7 @@ BOOL CAutoDerrick::EventProcess(const Event &event)
m_object->SetAngleY(1, Rand()*0.5f); // rotates the drill
}
- return TRUE;
+ return true;
}
if ( m_phase == ADP_EXCAVATE )
@@ -190,7 +189,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->RetPosition(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);
@@ -296,7 +295,7 @@ BOOL CAutoDerrick::EventProcess(const Event &event)
else
{
m_soundChannel = -1;
- m_bSoundFall = FALSE;
+ m_bSoundFall = false;
m_phase = ADP_EXPORT;
m_progress = 0.0f;
@@ -308,7 +307,7 @@ BOOL CAutoDerrick::EventProcess(const Event &event)
{
if ( m_progress >= 1.0f )
{
- m_bSoundFall = FALSE;
+ m_bSoundFall = false;
m_phase = ADP_EXPORT;
m_progress = 0.0f;
@@ -330,7 +329,7 @@ BOOL CAutoDerrick::EventProcess(const Event &event)
m_phase = ADP_ISFREE;
m_progress = 0.0f;
m_speed = 1.0f/2.0f;
- return TRUE;
+ return true;
}
}
@@ -375,12 +374,12 @@ BOOL CAutoDerrick::EventProcess(const Event &event)
if ( !m_bSoundFall && pos.y < m_fretPos.y )
{
m_sound->Play(SOUND_BOUM, m_fretPos);
- m_bSoundFall = TRUE;
+ m_bSoundFall = true;
}
if ( pos.y < m_fretPos.y )
{
pos.y = m_fretPos.y;
- fret->SetLock(FALSE); // object usable
+ fret->SetLock(false); // object usable
}
fret->SetPosition(0, pos);
}
@@ -402,13 +401,13 @@ BOOL CAutoDerrick::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Creates all the interface when the object is selected.
-BOOL CAutoDerrick::CreateInterface(BOOL bSelect)
+bool CAutoDerrick::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -416,10 +415,10 @@ BOOL CAutoDerrick::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -432,17 +431,17 @@ BOOL CAutoDerrick::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 109, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
// Saves all parameters of the controller.
-BOOL CAutoDerrick::Write(char *line)
+bool CAutoDerrick::Write(char *line)
{
char name[100];
- if ( m_phase == ADP_WAIT ) return FALSE;
+ if ( m_phase == ADP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -458,14 +457,14 @@ BOOL CAutoDerrick::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoDerrick::Read(char *line)
+bool CAutoDerrick::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -475,7 +474,7 @@ BOOL CAutoDerrick::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
@@ -507,7 +506,7 @@ CObject* CAutoDerrick::SearchFret()
// Seeks if a site is free.
-BOOL CAutoDerrick::SearchFree(D3DVECTOR pos)
+bool CAutoDerrick::SearchFree(D3DVECTOR pos)
{
CObject* pObj;
D3DVECTOR sPos;
@@ -528,11 +527,11 @@ BOOL CAutoDerrick::SearchFree(D3DVECTOR pos)
{
distance = Length(sPos, pos);
distance -= sRadius;
- if ( distance < 2.0f ) return FALSE; // location occupied
+ if ( distance < 2.0f ) return false; // location occupied
}
}
- return TRUE; // location free
+ return true; // location free
}
// Create a transportable object.
@@ -549,7 +548,7 @@ void CAutoDerrick::CreateFret(D3DVECTOR pos, float angle, ObjectType type,
m_displayText->DisplayError(ERR_TOOMANY, m_object);
return;
}
- fret->SetLock(TRUE); // object not yet usable
+ fret->SetLock(true); // object not yet usable
if ( m_object->RetResetCap() == RESET_MOVE )
{
@@ -563,7 +562,7 @@ void CAutoDerrick::CreateFret(D3DVECTOR pos, float angle, ObjectType type,
// Look if there is already a key.
-BOOL CAutoDerrick::ExistKey()
+bool CAutoDerrick::ExistKey()
{
CObject* pObj;
ObjectType type;
@@ -572,7 +571,7 @@ BOOL CAutoDerrick::ExistKey()
if ( m_type != OBJECT_KEYa &&
m_type != OBJECT_KEYb &&
m_type != OBJECT_KEYc &&
- m_type != OBJECT_KEYd ) return FALSE;
+ m_type != OBJECT_KEYd ) return false;
for ( i=0 ; i<1000000 ; i++ )
{
@@ -580,10 +579,10 @@ BOOL CAutoDerrick::ExistKey()
if ( pObj == 0 ) break;
type = pObj->RetType();
- if ( type == m_type ) return TRUE;
+ if ( type == m_type ) return true;
}
- return FALSE;
+ return false;
}
diff --git a/src/object/auto/autoderrick.h b/src/object/auto/autoderrick.h
index 841831d..9306a86 100644
--- a/src/object/auto/autoderrick.h
+++ b/src/object/auto/autoderrick.h
@@ -50,22 +50,22 @@ public:
CAutoDerrick(CInstanceManager* iMan, CObject* object);
~CAutoDerrick();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
CObject* SearchFret();
- BOOL SearchFree(D3DVECTOR pos);
+ bool SearchFree(D3DVECTOR pos);
void CreateFret(D3DVECTOR pos, float angle, ObjectType type, float height);
- BOOL ExistKey();
+ bool ExistKey();
protected:
AutoDerrickPhase m_phase;
@@ -76,6 +76,6 @@ protected:
float m_lastTrack;
D3DVECTOR m_fretPos;
int m_soundChannel;
- BOOL m_bSoundFall;
+ bool m_bSoundFall;
};
diff --git a/src/object/auto/autodestroyer.cpp b/src/object/auto/autodestroyer.cpp
index 47b18cf..2f999fc 100644
--- a/src/object/auto/autodestroyer.cpp
+++ b/src/object/auto/autodestroyer.cpp
@@ -60,13 +60,12 @@ CAutoDestroyer::CAutoDestroyer(CInstanceManager* iMan, CObject* object)
CAutoDestroyer::~CAutoDestroyer()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoDestroyer::DeleteObject(BOOL bAll)
+void CAutoDestroyer::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -90,7 +89,7 @@ void CAutoDestroyer::Init()
// Management of an event.
-BOOL CAutoDestroyer::EventProcess(const Event &event)
+bool CAutoDestroyer::EventProcess(const Event &event)
{
CObject* scrap;
CPyro* pyro;
@@ -99,8 +98,8 @@ BOOL CAutoDestroyer::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -111,7 +110,7 @@ BOOL CAutoDestroyer::EventProcess(const Event &event)
{
m_timeVirus = 0.1f+Rand()*0.3f;
}
- return TRUE;
+ return true;
}
if ( m_phase == ADEP_WAIT )
@@ -127,7 +126,7 @@ BOOL CAutoDestroyer::EventProcess(const Event &event)
}
else
{
- scrap->SetLock(TRUE); // usable waste
+ scrap->SetLock(true); // usable waste
//? scrap->SetTruck(m_object); // usable waste
if ( SearchVehicle() )
@@ -143,7 +142,7 @@ BOOL CAutoDestroyer::EventProcess(const Event &event)
m_phase = ADEP_DOWN;
m_progress = 0.0f;
m_speed = 1.0f/1.0f;
- m_bExplo = FALSE;
+ m_bExplo = false;
}
}
}
@@ -159,7 +158,7 @@ BOOL CAutoDestroyer::EventProcess(const Event &event)
pyro = new CPyro(m_iMan);
pyro->Create(PT_FRAGT, scrap);
}
- m_bExplo = TRUE;
+ m_bExplo = true;
}
if ( m_progress < 1.0f )
@@ -212,13 +211,13 @@ BOOL CAutoDestroyer::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Creates all the interface when the object is selected.
-BOOL CAutoDestroyer::CreateInterface(BOOL bSelect)
+bool CAutoDestroyer::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -226,10 +225,10 @@ BOOL CAutoDestroyer::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -242,7 +241,7 @@ BOOL CAutoDestroyer::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 106, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
@@ -277,7 +276,7 @@ CObject* CAutoDestroyer::SearchPlastic()
// Seeks if one vehicle is too close.
-BOOL CAutoDestroyer::SearchVehicle()
+bool CAutoDestroyer::SearchVehicle()
{
CObject* pObj;
D3DVECTOR cPos, oPos;
@@ -330,10 +329,10 @@ BOOL CAutoDestroyer::SearchVehicle()
if ( !pObj->GetCrashSphere(0, oPos, oRadius) ) continue;
dist = Length(oPos, cPos)-oRadius;
- if ( dist < 20.0f ) return TRUE;
+ if ( dist < 20.0f ) return true;
}
- return FALSE;
+ return false;
}
@@ -352,11 +351,11 @@ Error CAutoDestroyer::RetError()
// Saves all parameters of the controller.
-BOOL CAutoDestroyer::Write(char *line)
+bool CAutoDestroyer::Write(char *line)
{
char name[100];
- if ( m_phase == ADEP_WAIT ) return FALSE;
+ if ( m_phase == ADEP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -372,14 +371,14 @@ BOOL CAutoDestroyer::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoDestroyer::Read(char *line)
+bool CAutoDestroyer::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -389,7 +388,7 @@ BOOL CAutoDestroyer::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autodestroyer.h b/src/object/auto/autodestroyer.h
index 5fd0437..ececb32 100644
--- a/src/object/auto/autodestroyer.h
+++ b/src/object/auto/autodestroyer.h
@@ -47,20 +47,20 @@ public:
CAutoDestroyer(CInstanceManager* iMan, CObject* object);
~CAutoDestroyer();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
CObject* SearchPlastic();
- BOOL SearchVehicle();
+ bool SearchVehicle();
protected:
AutoDestroyerPhase m_phase;
@@ -68,6 +68,6 @@ protected:
float m_speed;
float m_timeVirus;
float m_lastParticule;
- BOOL m_bExplo;
+ bool m_bExplo;
};
diff --git a/src/object/auto/autoegg.cpp b/src/object/auto/autoegg.cpp
index 239e666..d8620ba 100644
--- a/src/object/auto/autoegg.cpp
+++ b/src/object/auto/autoegg.cpp
@@ -57,13 +57,12 @@ CAutoEgg::CAutoEgg(CInstanceManager* iMan, CObject* object)
CAutoEgg::~CAutoEgg()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoEgg::DeleteObject(BOOL bAll)
+void CAutoEgg::DeleteObject(bool bAll)
{
CObject* alien;
@@ -78,8 +77,8 @@ void CAutoEgg::DeleteObject(BOOL bAll)
// Original code: ( alien->RetZoom(0) == 1.0f )
if ( alien->RetZoomY(0) == 1.0f )
{
- alien->SetLock(FALSE);
- alien->SetActivity(TRUE); // the insect is active
+ alien->SetLock(false);
+ alien->SetActivity(true); // the insect is active
}
else
{
@@ -124,34 +123,34 @@ void CAutoEgg::Init()
{
alien->SetZoom(0, 0.01f); // invisible !
}
- alien->SetLock(TRUE);
- alien->SetActivity(FALSE);
+ alien->SetLock(true);
+ alien->SetActivity(false);
}
// Gives a value.
-BOOL CAutoEgg::SetType(ObjectType type)
+bool CAutoEgg::SetType(ObjectType type)
{
m_type = type;
- return TRUE;
+ return true;
}
// Gives a value.
-BOOL CAutoEgg::SetValue(int rank, float value)
+bool CAutoEgg::SetValue(int rank, float value)
{
- if ( rank != 0 ) return FALSE;
+ if ( rank != 0 ) return false;
m_value = value;
- return TRUE;
+ return true;
}
// Gives the string.
-BOOL CAutoEgg::SetString(char *string)
+bool CAutoEgg::SetString(char *string)
{
strcpy(m_string, string);
- return TRUE;
+ return true;
}
@@ -172,21 +171,21 @@ void CAutoEgg::Start(int param)
// Management of an event.
-BOOL CAutoEgg::EventProcess(const Event &event)
+bool CAutoEgg::EventProcess(const Event &event)
{
CObject* alien;
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_phase == AEP_NULL ) return TRUE;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_phase == AEP_NULL ) return true;
if ( m_phase == AEP_DELAY )
{
m_progress += event.rTime*m_speed;
- if ( m_progress < 1.0f ) return TRUE;
+ 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) )
@@ -195,17 +194,17 @@ BOOL CAutoEgg::EventProcess(const Event &event)
m_phase = AEP_DELAY;
m_progress = 0.0f;
m_speed = 1.0f/2.0f;
- return TRUE;
+ return true;
}
- alien->SetActivity(FALSE);
+ alien->SetActivity(false);
alien->ReadProgram(0, m_string);
alien->RunProgram(0);
Init();
}
alien = SearchAlien();
- if ( alien == 0 ) return TRUE;
- alien->SetActivity(FALSE);
+ if ( alien == 0 ) return true;
+ alien->SetActivity(false);
m_progress += event.rTime*m_speed;
@@ -219,7 +218,7 @@ BOOL CAutoEgg::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Indicates whether the controller has completed its activity.
@@ -264,8 +263,8 @@ Error CAutoEgg::IsEnded()
{
if ( m_progress < 1.0f ) return ERR_CONTINUE;
- alien->SetLock(FALSE);
- alien->SetActivity(TRUE); // the insect is active
+ alien->SetLock(false);
+ alien->SetActivity(true); // the insect is active
}
return ERR_STOP;
@@ -321,11 +320,11 @@ CObject* CAutoEgg::SearchAlien()
// Saves all parameters of the controller.
-BOOL CAutoEgg::Write(char *line)
+bool CAutoEgg::Write(char *line)
{
char name[100];
- if ( m_phase == AEP_NULL ) return FALSE;
+ if ( m_phase == AEP_NULL ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -350,14 +349,14 @@ BOOL CAutoEgg::Write(char *line)
sprintf(name, " aParamString=\"%s\"", m_string);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoEgg::Read(char *line)
+bool CAutoEgg::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -368,6 +367,6 @@ BOOL CAutoEgg::Read(char *line)
m_value = OpFloat(line, "aParamValue1", 0.0f);
OpString(line, "aParamString", m_string);
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autoegg.h b/src/object/auto/autoegg.h
index 6728f7d..d9a749f 100644
--- a/src/object/auto/autoegg.h
+++ b/src/object/auto/autoegg.h
@@ -50,20 +50,20 @@ public:
CAutoEgg(CInstanceManager* iMan, CObject* object);
~CAutoEgg();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
void Start(int param);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error IsEnded();
Error RetError();
- BOOL SetType(ObjectType type);
- BOOL SetValue(int rank, float value);
- BOOL SetString(char *string);
+ bool SetType(ObjectType type);
+ bool SetValue(int rank, float value);
+ bool SetString(char *string);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
CObject* SearchAlien();
diff --git a/src/object/auto/autoenergy.cpp b/src/object/auto/autoenergy.cpp
index 3f274bd..ba265e8 100644
--- a/src/object/auto/autoenergy.cpp
+++ b/src/object/auto/autoenergy.cpp
@@ -65,13 +65,12 @@ CAutoEnergy::CAutoEnergy(CInstanceManager* iMan, CObject* object)
CAutoEnergy::~CAutoEnergy()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoEnergy::DeleteObject(BOOL bAll)
+void CAutoEnergy::DeleteObject(bool bAll)
{
CObject* fret;
@@ -121,19 +120,19 @@ void CAutoEnergy::Init()
// Management of an event.
-BOOL CAutoEnergy::EventProcess(const Event &event)
+bool CAutoEnergy::EventProcess(const Event &event)
{
CObject* fret;
D3DVECTOR pos, ppos, speed;
FPOINT dim, c, p;
TerrainRes res;
float big;
- BOOL bGO;
+ bool bGO;
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -157,7 +156,7 @@ BOOL CAutoEnergy::EventProcess(const Event &event)
m_particule->CreateParticule(pos, speed, dim, PARTIFIREZ, 1.0f, 0.0f, 0.0f);
}
}
- return TRUE;
+ return true;
}
UpdateInterface(event.rTime);
@@ -175,17 +174,17 @@ BOOL CAutoEnergy::EventProcess(const Event &event)
{
if ( m_progress >= 1.0f )
{
- bGO = FALSE;
+ bGO = false;
fret = SearchMetal(); // transform metal?
if ( fret != 0 )
{
if ( fret->RetType() == OBJECT_METAL )
{
- if ( big > ENERGY_POWER ) bGO = TRUE;
+ if ( big > ENERGY_POWER ) bGO = true;
}
else
{
- if ( !SearchVehicle() ) bGO = TRUE;
+ if ( !SearchVehicle() ) bGO = true;
}
}
@@ -193,11 +192,11 @@ BOOL CAutoEnergy::EventProcess(const Event &event)
{
if ( fret->RetType() == OBJECT_METAL )
{
- fret->SetLock(TRUE); // usable metal
+ fret->SetLock(true); // usable metal
CreatePower(); // creates the battery
}
- SetBusy(TRUE);
+ SetBusy(true);
InitProgressTotal(ENERGY_DELAY);
CAuto::UpdateInterface();
@@ -333,7 +332,7 @@ BOOL CAutoEnergy::EventProcess(const Event &event)
if ( fret != 0 )
{
fret->SetZoom(0, 1.0f);
- fret->SetLock(FALSE); // usable battery
+ fret->SetLock(false); // usable battery
fret->SetTruck(m_object);
fret->SetPosition(0, D3DVECTOR(0.0f, 3.0f, 0.0f));
m_object->SetPower(fret);
@@ -341,7 +340,7 @@ BOOL CAutoEnergy::EventProcess(const Event &event)
m_displayText->DisplayError(INFO_ENERGY, m_object);
}
- SetBusy(FALSE);
+ SetBusy(false);
CAuto::UpdateInterface();
m_phase = AENP_SMOKE;
@@ -382,7 +381,7 @@ BOOL CAutoEnergy::EventProcess(const Event &event)
if ( big > 1.0f ) big = 1.0f;
m_object->SetEnergy(big); // shift the big pile
- return TRUE;
+ return true;
}
@@ -407,7 +406,7 @@ CObject* CAutoEnergy::SearchMetal()
// Search if a vehicle is too close.
-BOOL CAutoEnergy::SearchVehicle()
+bool CAutoEnergy::SearchVehicle()
{
CObject* pObj;
D3DVECTOR cPos, oPos;
@@ -460,10 +459,10 @@ BOOL CAutoEnergy::SearchVehicle()
if ( !pObj->GetCrashSphere(0, oPos, oRadius) ) continue;
dist = Length(oPos, cPos)-oRadius;
- if ( dist < 10.0f ) return TRUE;
+ if ( dist < 10.0f ) return true;
}
- return FALSE;
+ return false;
}
// Create a cell.
@@ -484,7 +483,7 @@ void CAutoEnergy::CreatePower()
m_displayText->DisplayError(ERR_TOOMANY, m_object);
return;
}
- power->SetLock(TRUE); // battery not yet usable
+ power->SetLock(true); // battery not yet usable
pos = power->RetPosition(0);
pos.y += 3.0f;
@@ -560,7 +559,7 @@ Error CAutoEnergy::RetError()
// Creates all the interface when the object is selected.
-BOOL CAutoEnergy::CreateInterface(BOOL bSelect)
+bool CAutoEnergy::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -568,10 +567,10 @@ BOOL CAutoEnergy::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -590,7 +589,7 @@ BOOL CAutoEnergy::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 108, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
// Updates the state of all buttons on the interface,
@@ -621,12 +620,12 @@ void CAutoEnergy::UpdateInterface(float rTime)
// Saves all parameters of the controller.
-BOOL CAutoEnergy::Write(char *line)
+bool CAutoEnergy::Write(char *line)
{
char name[100];
if ( m_phase == AENP_STOP ||
- m_phase == AENP_WAIT ) return FALSE;
+ m_phase == AENP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -642,14 +641,14 @@ BOOL CAutoEnergy::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoEnergy::Read(char *line)
+bool CAutoEnergy::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -660,5 +659,5 @@ BOOL CAutoEnergy::Read(char *line)
m_lastUpdateTime = 0.0f;
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autoenergy.h b/src/object/auto/autoenergy.h
index 009bf85..f9f096e 100644
--- a/src/object/auto/autoenergy.h
+++ b/src/object/auto/autoenergy.h
@@ -49,22 +49,22 @@ public:
CAutoEnergy(CInstanceManager* iMan, CObject* object);
~CAutoEnergy();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
void UpdateInterface(float rTime);
CObject* SearchMetal();
- BOOL SearchVehicle();
+ bool SearchVehicle();
void CreatePower();
CObject* SearchPower();
diff --git a/src/object/auto/autofactory.cpp b/src/object/auto/autofactory.cpp
index e81f3e8..89bc399 100644
--- a/src/object/auto/autofactory.cpp
+++ b/src/object/auto/autofactory.cpp
@@ -66,13 +66,12 @@ CAutoFactory::CAutoFactory(CInstanceManager* iMan, CObject* object)
CAutoFactory::~CAutoFactory()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoFactory::DeleteObject(BOOL bAll)
+void CAutoFactory::DeleteObject(bool bAll)
{
CObject* fret;
CObject* vehicle;
@@ -124,7 +123,7 @@ void CAutoFactory::Init()
// Management of an event.
-BOOL CAutoFactory::EventProcess(const Event &event)
+bool CAutoFactory::EventProcess(const Event &event)
{
CObject* fret;
CObject* vehicle;
@@ -138,13 +137,13 @@ BOOL CAutoFactory::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
if ( m_object->RetSelect() ) // factory selected?
{
if ( event.event == EVENT_UPDINTERFACE )
{
- CreateInterface(TRUE);
+ CreateInterface(true);
}
type = OBJECT_NULL;
@@ -176,36 +175,36 @@ BOOL CAutoFactory::EventProcess(const Event &event)
if ( m_phase != AFP_WAIT )
{
- return FALSE;
+ return false;
}
fret = SearchFret(); // transform metal?
if ( fret == 0 )
{
m_displayText->DisplayError(ERR_FACTORY_NULL, m_object);
- return FALSE;
+ return false;
}
if ( NearestVehicle() )
{
m_displayText->DisplayError(ERR_FACTORY_NEAR, m_object);
- return FALSE;
+ return false;
}
- SetBusy(TRUE);
+ SetBusy(true);
InitProgressTotal(3.0f+2.0f+15.0f+2.0f+3.0f);
UpdateInterface();
- fret->SetLock(TRUE); // usable metal
+ fret->SetLock(true); // usable metal
SoundManip(3.0f, 1.0f, 0.5f);
m_phase = AFP_CLOSE_S;
m_progress = 0.0f;
m_speed = 1.0f/3.0f;
- return TRUE;
+ return true;
}
}
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
EventProgress(event.rTime);
@@ -268,7 +267,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->RetPosition(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);
@@ -288,7 +287,7 @@ BOOL CAutoFactory::EventProcess(const Event &event)
fret = SearchFret(); // transform metal?
if ( fret != 0 )
{
- fret->SetLock(FALSE); // metal usable again
+ fret->SetLock(false); // metal usable again
}
if ( m_channelSound != -1 )
@@ -301,7 +300,7 @@ BOOL CAutoFactory::EventProcess(const Event &event)
m_phase = AFP_OPEN_T;
m_progress = 0.0f;
m_speed = 1.0f/2.0f;
- return TRUE;
+ return true;
}
}
@@ -383,10 +382,10 @@ BOOL CAutoFactory::EventProcess(const Event &event)
physics = vehicle->RetPhysics();
if ( physics != 0 )
{
- physics->SetFreeze(FALSE); // can move
+ physics->SetFreeze(false); // can move
}
- vehicle->SetLock(FALSE); // vehicle useable
+ vehicle->SetLock(false); // vehicle useable
//? vehicle->RetPhysics()->RetBrain()->StartTaskAdvance(16.0f);
vehicle->SetAngleY(0, m_object->RetAngleY(0)+PI);
vehicle->SetZoom(0, 1.0f);
@@ -476,7 +475,7 @@ BOOL CAutoFactory::EventProcess(const Event &event)
m_object->SetZoomZ(10+i, 0.30f);
}
- SetBusy(FALSE);
+ SetBusy(false);
UpdateInterface();
m_phase = AFP_WAIT;
@@ -485,17 +484,17 @@ BOOL CAutoFactory::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Saves all parameters of the controller.
-BOOL CAutoFactory::Write(char *line)
+bool CAutoFactory::Write(char *line)
{
char name[100];
- if ( m_phase == AFP_WAIT ) return FALSE;
+ if ( m_phase == AFP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -511,14 +510,14 @@ BOOL CAutoFactory::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller
-BOOL CAutoFactory::Read(char *line)
+bool CAutoFactory::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -529,7 +528,7 @@ BOOL CAutoFactory::Read(char *line)
m_lastParticule = 0.0f;
m_fretPos = m_object->RetPosition(0);
- return TRUE;
+ return true;
}
@@ -563,7 +562,7 @@ CObject* CAutoFactory::SearchFret()
// Search if a vehicle is too close.
-BOOL CAutoFactory::NearestVehicle()
+bool CAutoFactory::NearestVehicle()
{
CObject* pObj;
D3DVECTOR cPos, oPos;
@@ -616,16 +615,16 @@ BOOL CAutoFactory::NearestVehicle()
if ( !pObj->GetCrashSphere(0, oPos, oRadius) ) continue;
dist = Length(oPos, cPos)-oRadius;
- if ( dist < 10.0f ) return TRUE;
+ if ( dist < 10.0f ) return true;
}
- return FALSE;
+ return false;
}
// Creates a vehicle.
-BOOL CAutoFactory::CreateVehicle()
+bool CAutoFactory::CreateVehicle()
{
CObject* vehicle;
D3DMATRIX* mat;
@@ -652,20 +651,20 @@ BOOL CAutoFactory::CreateVehicle()
pos = Transform(*mat, pos);
vehicle = new CObject(m_iMan);
- if ( !vehicle->CreateVehicle(pos, angle, m_type, -1.0f, FALSE, FALSE) )
+ if ( !vehicle->CreateVehicle(pos, angle, m_type, -1.0f, false, false) )
{
delete vehicle;
m_displayText->DisplayError(ERR_TOOMANY, m_object);
- return FALSE;
+ return false;
}
vehicle->UpdateMapping();
- vehicle->SetLock(TRUE); // not usable
+ vehicle->SetLock(true); // not usable
vehicle->SetRange(30.0f);
physics = vehicle->RetPhysics();
if ( physics != 0 )
{
- physics->SetFreeze(TRUE); // it doesn't move
+ physics->SetFreeze(true); // it doesn't move
}
for ( i=0 ; i<10 ; i++ )
@@ -675,7 +674,7 @@ BOOL CAutoFactory::CreateVehicle()
vehicle->ReadProgram(i, name);
}
- return TRUE;
+ return true;
}
// Seeking the vehicle during manufacture.
@@ -711,7 +710,7 @@ CObject* CAutoFactory::SearchVehicle()
// Creates all the interface when the object is selected.
-BOOL CAutoFactory::CreateInterface(BOOL bSelect)
+bool CAutoFactory::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, dim, ddim;
@@ -719,10 +718,10 @@ BOOL CAutoFactory::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
dim.x = 33.0f/640.0f;
dim.y = 33.0f/480.0f;
@@ -798,7 +797,7 @@ BOOL CAutoFactory::CreateInterface(BOOL bSelect)
pw->CreateGroup(pos, ddim, 101, EVENT_OBJECT_TYPE);
UpdateInterface();
- return TRUE;
+ return true;
}
// Updates the status of all interface buttons.
@@ -838,9 +837,9 @@ void CAutoFactory::UpdateInterface()
// Updates the status of one interface button.
-void CAutoFactory::UpdateButton(CWindow *pw, EventMsg event, BOOL bBusy)
+void CAutoFactory::UpdateButton(CWindow *pw, EventMsg event, bool bBusy)
{
- BOOL bEnable = TRUE;
+ bool bEnable = true;
EnableInterface(pw, event, !bBusy);
@@ -952,7 +951,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->RetPosition(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 00e1d6b..82e2a96 100644
--- a/src/object/auto/autofactory.h
+++ b/src/object/auto/autofactory.h
@@ -50,23 +50,23 @@ public:
CAutoFactory(CInstanceManager* iMan, CObject* object);
~CAutoFactory();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
void UpdateInterface();
- void UpdateButton(CWindow *pw, EventMsg event, BOOL bBusy);
+ void UpdateButton(CWindow *pw, EventMsg event, bool bBusy);
CObject* SearchFret();
- BOOL NearestVehicle();
- BOOL CreateVehicle();
+ bool NearestVehicle();
+ bool CreateVehicle();
CObject* SearchVehicle();
void SoundManip(float time, float amplitude, float frequency);
diff --git a/src/object/auto/autoflag.cpp b/src/object/auto/autoflag.cpp
index 4e29a96..53792cb 100644
--- a/src/object/auto/autoflag.cpp
+++ b/src/object/auto/autoflag.cpp
@@ -37,7 +37,7 @@
-#define ADJUST_ANGLE FALSE // TRUE -> adjusts the angles of the members
+#define ADJUST_ANGLE false // true -> adjusts the angles of the members
#if ADJUST_ANGLE
@@ -59,13 +59,12 @@ CAutoFlag::CAutoFlag(CInstanceManager* iMan, CObject* object)
CAutoFlag::~CAutoFlag()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoFlag::DeleteObject(BOOL bAll)
+void CAutoFlag::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -104,7 +103,7 @@ void CAutoFlag::Start(int param)
// Management of an event.
-BOOL CAutoFlag::EventProcess(const Event &event)
+bool CAutoFlag::EventProcess(const Event &event)
{
float angle;
int i;
@@ -123,8 +122,8 @@ BOOL CAutoFlag::EventProcess(const Event &event)
}
#endif
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
if ( m_param == 1 ) // shakes?
{
@@ -145,7 +144,7 @@ BOOL CAutoFlag::EventProcess(const Event &event)
}
}
- if ( m_strong == 0.0f ) return TRUE; // no wind?
+ if ( m_strong == 0.0f ) return true; // no wind?
for ( i=0 ; i<4 ; i++ )
{
@@ -162,7 +161,7 @@ BOOL CAutoFlag::EventProcess(const Event &event)
sprintf(s, "a=%.2f b=%.2f c=%.2f", g_flag1, g_flag2, g_flag3);
m_engine->SetInfoText(4, s);
#endif
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autoflag.h b/src/object/auto/autoflag.h
index 654f7a2..c52a25a 100644
--- a/src/object/auto/autoflag.h
+++ b/src/object/auto/autoflag.h
@@ -38,11 +38,11 @@ public:
CAutoFlag(CInstanceManager* iMan, CObject* object);
~CAutoFlag();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
void Start(int param);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
protected:
diff --git a/src/object/auto/autohuston.cpp b/src/object/auto/autohuston.cpp
index f3b7168..6a3202b 100644
--- a/src/object/auto/autohuston.cpp
+++ b/src/object/auto/autohuston.cpp
@@ -187,13 +187,12 @@ CAutoHuston::CAutoHuston(CInstanceManager* iMan, CObject* object)
CAutoHuston::~CAutoHuston()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoHuston::DeleteObject(BOOL bAll)
+void CAutoHuston::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -219,7 +218,7 @@ void CAutoHuston::Start(int param)
// Management of an event.
-BOOL CAutoHuston::EventProcess(const Event &event)
+bool CAutoHuston::EventProcess(const Event &event)
{
D3DVECTOR speed;
FPOINT dim;
@@ -228,14 +227,14 @@ BOOL CAutoHuston::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) 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.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
@@ -263,20 +262,20 @@ BOOL CAutoHuston::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Stops the controller.
-BOOL CAutoHuston::Abort()
+bool CAutoHuston::Abort()
{
- return TRUE;
+ return true;
}
// Creates all the interface when the object is selected.
-BOOL CAutoHuston::CreateInterface(BOOL bSelect)
+bool CAutoHuston::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -284,10 +283,10 @@ BOOL CAutoHuston::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -300,7 +299,7 @@ BOOL CAutoHuston::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 115, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autohuston.h b/src/object/auto/autohuston.h
index 8e26aa1..32954f7 100644
--- a/src/object/auto/autohuston.h
+++ b/src/object/auto/autohuston.h
@@ -53,15 +53,15 @@ public:
CAutoHuston(CInstanceManager* iMan, CObject* object);
~CAutoHuston();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
void Start(int param);
- BOOL EventProcess(const Event &event);
- BOOL Abort();
+ bool EventProcess(const Event &event);
+ bool Abort();
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
protected:
diff --git a/src/object/auto/autoinfo.cpp b/src/object/auto/autoinfo.cpp
index 713b148..12dc2de 100644
--- a/src/object/auto/autoinfo.cpp
+++ b/src/object/auto/autoinfo.cpp
@@ -57,13 +57,12 @@ CAutoInfo::CAutoInfo(CInstanceManager* iMan, CObject* object)
CAutoInfo::~CAutoInfo()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoInfo::DeleteObject(BOOL bAll)
+void CAutoInfo::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -76,7 +75,7 @@ void CAutoInfo::Init()
m_phase = AIP_WAIT;
m_time = 0.0f;
m_timeVirus = 0.0f;
- m_bLastVirus = FALSE;
+ m_bLastVirus = false;
CAuto::Init();
}
@@ -142,7 +141,7 @@ void CAutoInfo::Start(int param)
// Management of an event.
-BOOL CAutoInfo::EventProcess(const Event &event)
+bool CAutoInfo::EventProcess(const Event &event)
{
D3DVECTOR pos, speed;
FPOINT dim;
@@ -151,8 +150,8 @@ 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->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_timeVirus -= event.rTime;
@@ -176,14 +175,14 @@ BOOL CAutoInfo::EventProcess(const Event &event)
UpdateListVirus();
}
- m_bLastVirus = TRUE;
- return TRUE;
+ m_bLastVirus = true;
+ return true;
}
else
{
if ( m_bLastVirus )
{
- m_bLastVirus = FALSE;
+ m_bLastVirus = false;
UpdateList(); // normally returns the list
}
else
@@ -353,7 +352,7 @@ BOOL CAutoInfo::EventProcess(const Event &event)
m_object->SetAngleX(5, sinf(m_time*6.0f+PI*2.0f/3.0f)*0.3f);
m_object->SetAngleX(7, sinf(m_time*6.0f+PI*4.0f/3.0f)*0.3f);
- return TRUE;
+ return true;
}
@@ -372,7 +371,7 @@ Error CAutoInfo::RetError()
// Creates all the interface when the object is selected.
-BOOL CAutoInfo::CreateInterface(BOOL bSelect)
+bool CAutoInfo::CreateInterface(bool bSelect)
{
CWindow* pw;
CList* pl;
@@ -381,10 +380,10 @@ BOOL CAutoInfo::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -396,7 +395,7 @@ BOOL CAutoInfo::CreateInterface(BOOL bSelect)
ddim.x = 160.0f/640.0f;
ddim.y = 66.0f/480.0f;
pl = pw->CreateList(pos, ddim, 1, EVENT_OBJECT_GINFO, 1.10f);
- pl->SetSelectCap(FALSE);
+ pl->SetSelectCap(false);
pos.x = ox+sx*0.0f;
pos.y = oy+sy*0;
@@ -405,7 +404,7 @@ BOOL CAutoInfo::CreateInterface(BOOL bSelect)
pw->CreateGroup(pos, ddim, 112, EVENT_OBJECT_TYPE);
UpdateList();
- return TRUE;
+ return true;
}
// Updates the state of all buttons on the interface,
@@ -451,7 +450,7 @@ void CAutoInfo::UpdateList()
}
}
- m_object->SetInfoUpdate(FALSE);
+ m_object->SetInfoUpdate(false);
}
// Updates the content of contaminating the list.
@@ -492,11 +491,11 @@ void CAutoInfo::UpdateListVirus()
// Saves all parameters of the controller.
-BOOL CAutoInfo::Write(char *line)
+bool CAutoInfo::Write(char *line)
{
char name[100];
- if ( m_phase == AIP_WAIT ) return FALSE;
+ if ( m_phase == AIP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -512,14 +511,14 @@ BOOL CAutoInfo::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoInfo::Read(char *line)
+bool CAutoInfo::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -529,7 +528,7 @@ BOOL CAutoInfo::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autoinfo.h b/src/object/auto/autoinfo.h
index 412a0af..7cd3002 100644
--- a/src/object/auto/autoinfo.h
+++ b/src/object/auto/autoinfo.h
@@ -48,17 +48,17 @@ public:
CAutoInfo(CInstanceManager* iMan, CObject* object);
~CAutoInfo();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
void Start(int param);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
void UpdateInterface(float rTime);
@@ -72,6 +72,6 @@ protected:
float m_timeVirus;
float m_lastParticule;
D3DVECTOR m_goal;
- BOOL m_bLastVirus;
+ bool m_bLastVirus;
};
diff --git a/src/object/auto/autojostle.cpp b/src/object/auto/autojostle.cpp
index aec152e..93bdd6b 100644
--- a/src/object/auto/autojostle.cpp
+++ b/src/object/auto/autojostle.cpp
@@ -57,13 +57,12 @@ CAutoJostle::CAutoJostle(CInstanceManager* iMan, CObject* object)
CAutoJostle::~CAutoJostle()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoJostle::DeleteObject(BOOL bAll)
+void CAutoJostle::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -106,15 +105,15 @@ void CAutoJostle::Start(int param, float force)
// Management of an event.
-BOOL CAutoJostle::EventProcess(const Event &event)
+bool CAutoJostle::EventProcess(const Event &event)
{
D3DVECTOR dir;
float factor, angle, zoom;
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
if ( m_progress < 1.0f )
{
@@ -152,7 +151,7 @@ BOOL CAutoJostle::EventProcess(const Event &event)
m_error = ERR_STOP;
}
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autojostle.h b/src/object/auto/autojostle.h
index d154ef1..c3a1bd8 100644
--- a/src/object/auto/autojostle.h
+++ b/src/object/auto/autojostle.h
@@ -38,11 +38,11 @@ public:
CAutoJostle(CInstanceManager* iMan, CObject* object);
~CAutoJostle();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
void Start(int param, float force);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error IsEnded();
protected:
diff --git a/src/object/auto/autokid.cpp b/src/object/auto/autokid.cpp
index 79a9e2d..99d4c81 100644
--- a/src/object/auto/autokid.cpp
+++ b/src/object/auto/autokid.cpp
@@ -60,14 +60,12 @@ CAutoKid::~CAutoKid()
m_sound->AddEnvelope(m_soundChannel, 0.0f, 1.0f, 1.0f, SOPER_STOP);
m_soundChannel = -1;
}
-
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoKid::DeleteObject(BOOL bAll)
+void CAutoKid::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -101,8 +99,8 @@ void CAutoKid::Init()
{
if ( m_soundChannel == -1 )
{
-//? m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 1.0f, 0.5f, TRUE);
- m_bSilent = FALSE;
+//? m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 1.0f, 0.5f, true);
+ m_bSilent = false;
}
}
}
@@ -110,7 +108,7 @@ void CAutoKid::Init()
// Management of an event.
-BOOL CAutoKid::EventProcess(const Event &event)
+bool CAutoKid::EventProcess(const Event &event)
{
D3DVECTOR vib, pos, speed;
FPOINT dim;
@@ -124,7 +122,7 @@ BOOL CAutoKid::EventProcess(const Event &event)
if ( !m_bSilent )
{
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 0.1f, SOPER_CONTINUE);
- m_bSilent = TRUE;
+ m_bSilent = true;
}
}
else
@@ -132,13 +130,13 @@ BOOL CAutoKid::EventProcess(const Event &event)
if ( m_bSilent )
{
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.5f, 0.1f, SOPER_CONTINUE);
- m_bSilent = FALSE;
+ m_bSilent = false;
}
}
}
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
@@ -206,7 +204,7 @@ BOOL CAutoKid::EventProcess(const Event &event)
m_object->SetAngleX(2, m_progress*5.0f);
}
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autokid.h b/src/object/auto/autokid.h
index 8e1c3af..677d1f0 100644
--- a/src/object/auto/autokid.h
+++ b/src/object/auto/autokid.h
@@ -38,10 +38,10 @@ public:
CAutoKid(CInstanceManager* iMan, CObject* object);
~CAutoKid();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
protected:
@@ -51,6 +51,6 @@ protected:
float m_progress;
float m_lastParticule;
int m_soundChannel;
- BOOL m_bSilent;
+ bool m_bSilent;
};
diff --git a/src/object/auto/autolabo.cpp b/src/object/auto/autolabo.cpp
index 06440a1..41b6299 100644
--- a/src/object/auto/autolabo.cpp
+++ b/src/object/auto/autolabo.cpp
@@ -73,13 +73,12 @@ CAutoLabo::CAutoLabo(CInstanceManager* iMan, CObject* object)
CAutoLabo::~CAutoLabo()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoLabo::DeleteObject(BOOL bAll)
+void CAutoLabo::DeleteObject(bool bAll)
{
int i;
@@ -127,7 +126,7 @@ void CAutoLabo::Init()
// Management of an event.
-BOOL CAutoLabo::EventProcess(const Event &event)
+bool CAutoLabo::EventProcess(const Event &event)
{
CObject* power;
D3DVECTOR pos, goal, speed;
@@ -137,11 +136,11 @@ BOOL CAutoLabo::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
if ( event.event == EVENT_UPDINTERFACE )
{
- if ( m_object->RetSelect() ) CreateInterface(TRUE);
+ if ( m_object->RetSelect() ) CreateInterface(true);
}
if ( m_object->RetSelect() && // center selected?
@@ -150,7 +149,7 @@ BOOL CAutoLabo::EventProcess(const Event &event)
{
if ( m_phase != ALAP_WAIT )
{
- return FALSE;
+ return false;
}
m_research = event.event;
@@ -158,35 +157,35 @@ BOOL CAutoLabo::EventProcess(const Event &event)
if ( TestResearch(m_research) )
{
m_displayText->DisplayError(ERR_LABO_ALREADY, m_object);
- return FALSE;
+ return false;
}
power = m_object->RetPower();
if ( power == 0 )
{
m_displayText->DisplayError(ERR_LABO_NULL, m_object);
- return FALSE;
+ return false;
}
if ( power->RetType() != OBJECT_BULLET )
{
m_displayText->DisplayError(ERR_LABO_BAD, m_object);
- return FALSE;
+ return false;
}
- SetBusy(TRUE);
+ SetBusy(true);
InitProgressTotal(1.0f+1.5f+1.5f+LABO_DELAY+1.5f+1.5f+1.0f);
UpdateInterface();
- power->SetLock(TRUE); // ball longer usable
+ power->SetLock(true); // ball longer usable
SoundManip(1.0f, 1.0f, 1.0f);
m_phase = ALAP_OPEN1;
m_progress = 0.0f;
m_speed = 1.0f/1.0f;
- return TRUE;
+ return true;
}
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -197,7 +196,7 @@ BOOL CAutoLabo::EventProcess(const Event &event)
{
m_timeVirus = 0.1f+Rand()*0.3f;
}
- return TRUE;
+ return true;
}
EventProgress(event.rTime);
@@ -278,7 +277,7 @@ BOOL CAutoLabo::EventProcess(const Event &event)
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->RetPosition(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);
@@ -426,7 +425,7 @@ BOOL CAutoLabo::EventProcess(const Event &event)
m_object->SetAngleZ(4, 80.0f*PI/180.0f);
m_object->SetAngleZ(5, 80.0f*PI/180.0f);
- SetBusy(FALSE);
+ SetBusy(false);
UpdateInterface();
m_phase = ALAP_WAIT;
@@ -435,7 +434,7 @@ BOOL CAutoLabo::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -462,7 +461,7 @@ Error CAutoLabo::RetError()
// Creates all the interface when the object is selected.
-BOOL CAutoLabo::CreateInterface(BOOL bSelect)
+bool CAutoLabo::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, dim, ddim;
@@ -470,10 +469,10 @@ BOOL CAutoLabo::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
dim.x = 33.0f/640.0f;
dim.y = 33.0f/480.0f;
@@ -498,7 +497,7 @@ BOOL CAutoLabo::CreateInterface(BOOL bSelect)
UpdateInterface();
- return TRUE;
+ return true;
}
// Updates the status of all interface buttons.
@@ -539,12 +538,12 @@ void CAutoLabo::OkayButton(CWindow *pw, EventMsg event)
// Test whether a search has already been done.
-BOOL CAutoLabo::TestResearch(EventMsg event)
+bool CAutoLabo::TestResearch(EventMsg event)
{
if ( event == EVENT_OBJECT_RiPAW ) return (g_researchDone & RESEARCH_iPAW);
if ( event == EVENT_OBJECT_RiGUN ) return (g_researchDone & RESEARCH_iGUN);
- return FALSE;
+ return false;
}
// Indicates a search as made.
@@ -569,7 +568,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->RetPosition(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);
@@ -578,12 +577,12 @@ void CAutoLabo::SoundManip(float time, float amplitude, float frequency)
// Saves all parameters of the controller.
-BOOL CAutoLabo::Write(char *line)
+bool CAutoLabo::Write(char *line)
{
D3DVECTOR pos;
char name[100];
- if ( m_phase == ALAP_WAIT ) return FALSE;
+ if ( m_phase == ALAP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -602,16 +601,16 @@ BOOL CAutoLabo::Write(char *line)
sprintf(name, " aResearch=%d", m_research);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoLabo::Read(char *line)
+bool CAutoLabo::Read(char *line)
{
D3DVECTOR pos;
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -622,7 +621,7 @@ BOOL CAutoLabo::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autolabo.h b/src/object/auto/autolabo.h
index 0b1e91b..53faa0a 100644
--- a/src/object/auto/autolabo.h
+++ b/src/object/auto/autolabo.h
@@ -52,21 +52,21 @@ public:
CAutoLabo(CInstanceManager* iMan, CObject* object);
~CAutoLabo();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
void UpdateInterface();
void OkayButton(CWindow *pw, EventMsg event);
- BOOL TestResearch(EventMsg event);
+ bool TestResearch(EventMsg event);
void SetResearch(EventMsg event);
void SoundManip(float time, float amplitude, float frequency);
diff --git a/src/object/auto/automush.cpp b/src/object/auto/automush.cpp
index 0a7ed4f..45aa019 100644
--- a/src/object/auto/automush.cpp
+++ b/src/object/auto/automush.cpp
@@ -53,13 +53,12 @@ CAutoMush::CAutoMush(CInstanceManager* iMan, CObject* object)
CAutoMush::~CAutoMush()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoMush::DeleteObject(BOOL bAll)
+void CAutoMush::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -80,7 +79,7 @@ void CAutoMush::Init()
// Management of an event.
-BOOL CAutoMush::EventProcess(const Event &event)
+bool CAutoMush::EventProcess(const Event &event)
{
D3DVECTOR pos, speed, dir;
FPOINT dim;
@@ -89,8 +88,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->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
@@ -229,13 +228,13 @@ BOOL CAutoMush::EventProcess(const Event &event)
m_object->SetZoom(0, D3DVECTOR(1.0f, 1.0f, 1.0f));
}
- return TRUE;
+ return true;
}
// Seeking a nearby target.
-BOOL CAutoMush::SearchTarget()
+bool CAutoMush::SearchTarget()
{
CObject* pObj;
D3DVECTOR iPos, oPos;
@@ -298,10 +297,10 @@ BOOL CAutoMush::SearchTarget()
oPos = pObj->RetPosition(0);
dist = Length(oPos, iPos);
- if ( dist < 50.0f ) return TRUE;
+ if ( dist < 50.0f ) return true;
}
- return FALSE;
+ return false;
}
@@ -315,12 +314,12 @@ Error CAutoMush::RetError()
// Saves all parameters of the controller.
-BOOL CAutoMush::Write(char *line)
+bool CAutoMush::Write(char *line)
{
D3DVECTOR pos;
char name[100];
- if ( m_phase == AMP_WAIT ) return FALSE;
+ if ( m_phase == AMP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -336,16 +335,16 @@ BOOL CAutoMush::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoMush::Read(char *line)
+bool CAutoMush::Read(char *line)
{
D3DVECTOR pos;
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -355,7 +354,7 @@ BOOL CAutoMush::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/automush.h b/src/object/auto/automush.h
index 5b5ea30..62bd322 100644
--- a/src/object/auto/automush.h
+++ b/src/object/auto/automush.h
@@ -49,17 +49,17 @@ public:
CAutoMush(CInstanceManager* iMan, CObject* object);
~CAutoMush();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
- BOOL SearchTarget();
+ bool SearchTarget();
protected:
AutoMushPhase m_phase;
diff --git a/src/object/auto/autonest.cpp b/src/object/auto/autonest.cpp
index 370dfe9..a9226ac 100644
--- a/src/object/auto/autonest.cpp
+++ b/src/object/auto/autonest.cpp
@@ -51,13 +51,12 @@ CAutoNest::CAutoNest(CInstanceManager* iMan, CObject* object)
CAutoNest::~CAutoNest()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoNest::DeleteObject(BOOL bAll)
+void CAutoNest::DeleteObject(bool bAll)
{
CObject* fret;
@@ -96,14 +95,14 @@ void CAutoNest::Init()
// Management of an event.
-BOOL CAutoNest::EventProcess(const Event &event)
+bool CAutoNest::EventProcess(const Event &event)
{
CObject* fret;
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
@@ -143,7 +142,7 @@ BOOL CAutoNest::EventProcess(const Event &event)
if ( fret != 0 )
{
fret->SetZoom(0, 1.0f);
- fret->SetLock(FALSE);
+ fret->SetLock(false);
}
m_phase = ANP_WAIT;
@@ -152,13 +151,13 @@ BOOL CAutoNest::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Seeks if a site is free.
-BOOL CAutoNest::SearchFree(D3DVECTOR pos)
+bool CAutoNest::SearchFree(D3DVECTOR pos)
{
CObject* pObj;
D3DVECTOR sPos;
@@ -179,11 +178,11 @@ BOOL CAutoNest::SearchFree(D3DVECTOR pos)
{
distance = Length(sPos, pos);
distance -= sRadius;
- if ( distance < 2.0f ) return FALSE; // location occupied
+ if ( distance < 2.0f ) return false; // location occupied
}
}
- return TRUE; // free location
+ return true; // free location
}
// Create a transportable object.
@@ -198,7 +197,7 @@ void CAutoNest::CreateFret(D3DVECTOR pos, float angle, ObjectType type)
delete fret;
return;
}
- fret->SetLock(TRUE); // not usable
+ fret->SetLock(true); // not usable
fret->SetZoom(0, 0.0f);
}
@@ -243,12 +242,12 @@ Error CAutoNest::RetError()
// Saves all parameters of the controller.
-BOOL CAutoNest::Write(char *line)
+bool CAutoNest::Write(char *line)
{
D3DVECTOR pos;
char name[100];
- if ( m_phase == ANP_WAIT ) return FALSE;
+ if ( m_phase == ANP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -264,16 +263,16 @@ BOOL CAutoNest::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoNest::Read(char *line)
+bool CAutoNest::Read(char *line)
{
D3DVECTOR pos;
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -283,7 +282,7 @@ BOOL CAutoNest::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autonest.h b/src/object/auto/autonest.h
index 1052462..55ee2f0 100644
--- a/src/object/auto/autonest.h
+++ b/src/object/auto/autonest.h
@@ -46,17 +46,17 @@ public:
CAutoNest(CInstanceManager* iMan, CObject* object);
~CAutoNest();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
- BOOL SearchFree(D3DVECTOR pos);
+ bool SearchFree(D3DVECTOR pos);
void CreateFret(D3DVECTOR pos, float angle, ObjectType type);
CObject* SearchFret();
diff --git a/src/object/auto/autonuclear.cpp b/src/object/auto/autonuclear.cpp
index 160787b..a6a9904 100644
--- a/src/object/auto/autonuclear.cpp
+++ b/src/object/auto/autonuclear.cpp
@@ -63,13 +63,12 @@ CAutoNuclear::CAutoNuclear(CInstanceManager* iMan, CObject* object)
CAutoNuclear::~CAutoNuclear()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoNuclear::DeleteObject(BOOL bAll)
+void CAutoNuclear::DeleteObject(bool bAll)
{
CObject* fret;
@@ -117,7 +116,7 @@ void CAutoNuclear::Init()
// Management of an event.
-BOOL CAutoNuclear::EventProcess(const Event &event)
+bool CAutoNuclear::EventProcess(const Event &event)
{
CObject* fret;
D3DMATRIX* mat;
@@ -128,8 +127,8 @@ 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->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -140,7 +139,7 @@ BOOL CAutoNuclear::EventProcess(const Event &event)
{
m_timeVirus = 0.1f+Rand()*0.3f;
}
- return TRUE;
+ return true;
}
EventProgress(event.rTime);
@@ -158,9 +157,9 @@ BOOL CAutoNuclear::EventProcess(const Event &event)
}
else
{
- fret->SetLock(TRUE); // usable uranium
+ fret->SetLock(true); // usable uranium
- SetBusy(TRUE);
+ SetBusy(true);
InitProgressTotal(1.5f+NUCLEAR_DELAY+1.5f);
UpdateInterface();
@@ -202,7 +201,7 @@ BOOL CAutoNuclear::EventProcess(const Event &event)
m_sound->Play(SOUND_CLOSE, m_object->RetPosition(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->RetPosition(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);
@@ -286,7 +285,7 @@ BOOL CAutoNuclear::EventProcess(const Event &event)
{
m_object->SetAngleZ(1, 135.0f*PI/180.0f);
- SetBusy(FALSE);
+ SetBusy(false);
UpdateInterface();
m_displayText->DisplayError(INFO_NUCLEAR, m_object);
@@ -297,13 +296,13 @@ BOOL CAutoNuclear::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Creates all the interface when the object is selected.
-BOOL CAutoNuclear::CreateInterface(BOOL bSelect)
+bool CAutoNuclear::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -311,10 +310,10 @@ BOOL CAutoNuclear::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -327,7 +326,7 @@ BOOL CAutoNuclear::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 110, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
@@ -345,7 +344,7 @@ CObject* CAutoNuclear::SearchUranium()
// Seeks if a vehicle is too close.
-BOOL CAutoNuclear::SearchVehicle()
+bool CAutoNuclear::SearchVehicle()
{
CObject* pObj;
D3DVECTOR oPos;
@@ -396,10 +395,10 @@ BOOL CAutoNuclear::SearchVehicle()
if ( !pObj->GetCrashSphere(0, oPos, oRadius) ) continue;
dist = Length(oPos, m_pos)-oRadius;
- if ( dist < 10.0f ) return TRUE;
+ if ( dist < 10.0f ) return true;
}
- return FALSE;
+ return false;
}
// Creates an object stack.
@@ -458,12 +457,12 @@ Error CAutoNuclear::RetError()
// Saves all parameters of the controller.
-BOOL CAutoNuclear::Write(char *line)
+bool CAutoNuclear::Write(char *line)
{
char name[100];
if ( m_phase == ANUP_STOP ||
- m_phase == ANUP_WAIT ) return FALSE;
+ m_phase == ANUP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -479,14 +478,14 @@ BOOL CAutoNuclear::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoNuclear::Read(char *line)
+bool CAutoNuclear::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -496,7 +495,7 @@ BOOL CAutoNuclear::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autonuclear.h b/src/object/auto/autonuclear.h
index bdb828b..36b3483 100644
--- a/src/object/auto/autonuclear.h
+++ b/src/object/auto/autonuclear.h
@@ -49,20 +49,20 @@ public:
CAutoNuclear(CInstanceManager* iMan, CObject* object);
~CAutoNuclear();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
CObject* SearchUranium();
- BOOL SearchVehicle();
+ bool SearchVehicle();
void CreatePower();
protected:
diff --git a/src/object/auto/autopara.cpp b/src/object/auto/autopara.cpp
index 464c9c2..1bc79ac 100644
--- a/src/object/auto/autopara.cpp
+++ b/src/object/auto/autopara.cpp
@@ -59,13 +59,12 @@ CAutoPara::CAutoPara(CInstanceManager* iMan, CObject* object)
CAutoPara::~CAutoPara()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoPara::DeleteObject(BOOL bAll)
+void CAutoPara::DeleteObject(bool bAll)
{
if ( m_channelSound != -1 )
{
@@ -111,7 +110,7 @@ void CAutoPara::StartBlitz()
// Management of an event.
-BOOL CAutoPara::EventProcess(const Event &event)
+bool CAutoPara::EventProcess(const Event &event)
{
D3DVECTOR pos, speed;
FPOINT dim;
@@ -119,8 +118,8 @@ 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->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -131,7 +130,7 @@ BOOL CAutoPara::EventProcess(const Event &event)
{
m_timeVirus = 0.1f+Rand()*0.3f;
}
- return TRUE;
+ return true;
}
EventProgress(event.rTime);
@@ -198,13 +197,13 @@ BOOL CAutoPara::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Creates all the interface when the object is selected.
-BOOL CAutoPara::CreateInterface(BOOL bSelect)
+bool CAutoPara::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -212,10 +211,10 @@ BOOL CAutoPara::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -234,7 +233,7 @@ BOOL CAutoPara::CreateInterface(BOOL bSelect)
ddim.y = 33.0f/480.0f;
pw->CreateButton(pos, ddim, 41, EVENT_OBJECT_LIMIT);
- return TRUE;
+ return true;
}
@@ -302,11 +301,11 @@ void CAutoPara::ChargeObject(float rTime)
// Saves all parameters of the controller.
-BOOL CAutoPara::Write(char *line)
+bool CAutoPara::Write(char *line)
{
char name[100];
- if ( m_phase == APAP_WAIT ) return FALSE;
+ if ( m_phase == APAP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -322,14 +321,14 @@ BOOL CAutoPara::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoPara::Read(char *line)
+bool CAutoPara::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -339,7 +338,7 @@ BOOL CAutoPara::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autopara.h b/src/object/auto/autopara.h
index 813d5d5..9eab4d7 100644
--- a/src/object/auto/autopara.h
+++ b/src/object/auto/autopara.h
@@ -47,17 +47,17 @@ public:
CAutoPara(CInstanceManager* iMan, CObject* object);
~CAutoPara();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
void StartBlitz();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
void ChargeObject(float rTime);
diff --git a/src/object/auto/autoportico.cpp b/src/object/auto/autoportico.cpp
index 302b8a6..97f11c5 100644
--- a/src/object/auto/autoportico.cpp
+++ b/src/object/auto/autoportico.cpp
@@ -86,13 +86,12 @@ CAutoPortico::CAutoPortico(CInstanceManager* iMan, CObject* object)
CAutoPortico::~CAutoPortico()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoPortico::DeleteObject(BOOL bAll)
+void CAutoPortico::DeleteObject(bool bAll)
{
if ( m_soundChannel != -1 )
{
@@ -152,7 +151,7 @@ void CAutoPortico::Start(int param)
// Management of an event.
-BOOL CAutoPortico::EventProcess(const Event &event)
+bool CAutoPortico::EventProcess(const Event &event)
{
CObject* pObj;
D3DVECTOR pos;
@@ -160,7 +159,7 @@ BOOL CAutoPortico::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
if ( m_phase == APOP_START )
{
@@ -168,7 +167,7 @@ BOOL CAutoPortico::EventProcess(const Event &event)
{
m_startPos = m_object->RetPosition(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->RetPosition(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);
@@ -177,7 +176,7 @@ BOOL CAutoPortico::EventProcess(const Event &event)
m_progress = 0.0f;
m_speed = 1.0f/PORTICO_TIME_MOVE;
- m_main->SetMovieLock(TRUE); // blocks everything until the end of the landing
+ m_main->SetMovieLock(true); // blocks everything until the end of the landing
m_camera->SetType(CAMERA_SCRIPT);
@@ -207,8 +206,8 @@ 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 ( m_phase == APOP_WAIT ) return TRUE;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_phase == APOP_WAIT ) return true;
m_progress += event.rTime*m_speed;
m_cameraProgress += event.rTime*m_cameraSpeed;
@@ -236,7 +235,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->RetPosition(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);
@@ -273,12 +272,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->RetPosition(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->RetPosition(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);
@@ -324,7 +323,7 @@ BOOL CAutoPortico::EventProcess(const Event &event)
}
else
{
- m_main->SetMovieLock(FALSE); // you can play!
+ m_main->SetMovieLock(false); // you can play!
pObj = m_main->SearchHuman();
m_main->SelectObject(pObj);
@@ -365,12 +364,12 @@ BOOL CAutoPortico::EventProcess(const Event &event)
m_camera->SetScriptLookat(pos);
}
- return TRUE;
+ return true;
}
// Stops the controller.
-BOOL CAutoPortico::Abort()
+bool CAutoPortico::Abort()
{
CObject* pObj;
@@ -383,7 +382,7 @@ BOOL CAutoPortico::Abort()
m_object->SetAngleY(6, -PORTICO_ANGLE2b);
m_object->SetAngleY(7, -PORTICO_ANGLE3b);
- m_main->SetMovieLock(FALSE); // you can play!
+ m_main->SetMovieLock(false); // you can play!
pObj = m_main->SearchHuman();
m_main->SelectObject(pObj);
@@ -401,7 +400,7 @@ BOOL CAutoPortico::Abort()
m_progress = 0.0f;
m_speed = 1.0f/2.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autoportico.h b/src/object/auto/autoportico.h
index 3a5e99b..196140d 100644
--- a/src/object/auto/autoportico.h
+++ b/src/object/auto/autoportico.h
@@ -51,12 +51,12 @@ public:
CAutoPortico(CInstanceManager* iMan, CObject* object);
~CAutoPortico();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
void Start(int param);
- BOOL EventProcess(const Event &event);
- BOOL Abort();
+ bool EventProcess(const Event &event);
+ bool Abort();
Error RetError();
protected:
diff --git a/src/object/auto/autoradar.cpp b/src/object/auto/autoradar.cpp
index cf33cf6..e0567fc 100644
--- a/src/object/auto/autoradar.cpp
+++ b/src/object/auto/autoradar.cpp
@@ -57,13 +57,12 @@ CAutoRadar::CAutoRadar(CInstanceManager* iMan, CObject* object)
CAutoRadar::~CAutoRadar()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoRadar::DeleteObject(BOOL bAll)
+void CAutoRadar::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -85,16 +84,16 @@ void CAutoRadar::Init()
// Management of an event.
-BOOL CAutoRadar::EventProcess(const Event &event)
+bool CAutoRadar::EventProcess(const Event &event)
{
D3DVECTOR pos, ePos;
float speed, angle, prog, freq, ampl;
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_phase == ARAP_WAIT ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_phase == ARAP_WAIT ) return true;
m_progress += event.rTime*m_speed;
m_aTime += event.rTime;
@@ -119,7 +118,7 @@ BOOL CAutoRadar::EventProcess(const Event &event)
m_totalDetect = (int)(Rand()*10.0f);
UpdateInterface();
}
- return TRUE;
+ return true;
}
if ( m_phase == ARAP_SEARCH )
@@ -196,7 +195,7 @@ BOOL CAutoRadar::EventProcess(const Event &event)
angle = sinf(m_aTime*4.0f)*0.3f;
m_object->SetAngleX(3, angle);
- return TRUE;
+ return true;
}
@@ -215,7 +214,7 @@ Error CAutoRadar::RetError()
// Creates all the interface when the object is selected.
-BOOL CAutoRadar::CreateInterface(BOOL bSelect)
+bool CAutoRadar::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, dim, ddim;
@@ -223,10 +222,10 @@ BOOL CAutoRadar::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -246,7 +245,7 @@ BOOL CAutoRadar::CreateInterface(BOOL bSelect)
pw->CreateGroup(pos, ddim, 105, EVENT_OBJECT_TYPE);
UpdateInterface();
- return TRUE;
+ return true;
}
// Updates the status of all interface buttons.
@@ -276,7 +275,7 @@ void CAutoRadar::UpdateInterface()
// Seeking the position of an enemy.
-BOOL CAutoRadar::SearchEnemy(D3DVECTOR &pos)
+bool CAutoRadar::SearchEnemy(D3DVECTOR &pos)
{
CObject* pObj;
CObject* pBest = 0;
@@ -316,9 +315,9 @@ BOOL CAutoRadar::SearchEnemy(D3DVECTOR &pos)
UpdateInterface();
- if ( pBest == 0 ) return FALSE;
+ if ( pBest == 0 ) return false;
pos = pBest->RetPosition(0);
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autoradar.h b/src/object/auto/autoradar.h
index 18ba5a8..616a6eb 100644
--- a/src/object/auto/autoradar.h
+++ b/src/object/auto/autoradar.h
@@ -48,16 +48,16 @@ public:
CAutoRadar(CInstanceManager* iMan, CObject* object);
~CAutoRadar();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
- BOOL CreateInterface(BOOL bSelect);
+ bool EventProcess(const Event &event);
+ bool CreateInterface(bool bSelect);
Error RetError();
protected:
void UpdateInterface();
- BOOL SearchEnemy(D3DVECTOR &pos);
+ bool SearchEnemy(D3DVECTOR &pos);
protected:
AutoRadarPhase m_phase;
diff --git a/src/object/auto/autorepair.cpp b/src/object/auto/autorepair.cpp
index e6a0603..05469c4 100644
--- a/src/object/auto/autorepair.cpp
+++ b/src/object/auto/autorepair.cpp
@@ -60,13 +60,12 @@ CAutoRepair::CAutoRepair(CInstanceManager* iMan, CObject* object)
CAutoRepair::~CAutoRepair()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoRepair::DeleteObject(BOOL bAll)
+void CAutoRepair::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -90,7 +89,7 @@ void CAutoRepair::Init()
// Management of an event.
-BOOL CAutoRepair::EventProcess(const Event &event)
+bool CAutoRepair::EventProcess(const Event &event)
{
CObject* vehicule;
D3DVECTOR pos, speed;
@@ -99,8 +98,8 @@ 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->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -111,7 +110,7 @@ BOOL CAutoRepair::EventProcess(const Event &event)
{
m_timeVirus = 0.1f+Rand()*0.3f;
}
- return TRUE;
+ return true;
}
if ( m_phase == ARP_WAIT )
@@ -210,13 +209,13 @@ BOOL CAutoRepair::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Creates all the interface when the object is selected.
-BOOL CAutoRepair::CreateInterface(BOOL bSelect)
+bool CAutoRepair::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -224,10 +223,10 @@ BOOL CAutoRepair::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -240,7 +239,7 @@ BOOL CAutoRepair::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 106, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
@@ -318,11 +317,11 @@ Error CAutoRepair::RetError()
// Saves all parameters of the controller.
-BOOL CAutoRepair::Write(char *line)
+bool CAutoRepair::Write(char *line)
{
char name[100];
- if ( m_phase == ARP_WAIT ) return FALSE;
+ if ( m_phase == ARP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -338,14 +337,14 @@ BOOL CAutoRepair::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoRepair::Read(char *line)
+bool CAutoRepair::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -355,7 +354,7 @@ BOOL CAutoRepair::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autorepair.h b/src/object/auto/autorepair.h
index 9f5cc5e..6d52c7a 100644
--- a/src/object/auto/autorepair.h
+++ b/src/object/auto/autorepair.h
@@ -49,16 +49,16 @@ public:
CAutoRepair(CInstanceManager* iMan, CObject* object);
~CAutoRepair();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
CObject* SearchVehicle();
diff --git a/src/object/auto/autoresearch.cpp b/src/object/auto/autoresearch.cpp
index 735d6cd..e5305b5 100644
--- a/src/object/auto/autoresearch.cpp
+++ b/src/object/auto/autoresearch.cpp
@@ -71,13 +71,12 @@ CAutoResearch::CAutoResearch(CInstanceManager* iMan, CObject* object)
CAutoResearch::~CAutoResearch()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoResearch::DeleteObject(BOOL bAll)
+void CAutoResearch::DeleteObject(bool bAll)
{
if ( m_channelSound != -1 )
{
@@ -86,7 +85,7 @@ void CAutoResearch::DeleteObject(BOOL bAll)
m_channelSound = -1;
}
- FireStopUpdate(0.0f, FALSE);
+ FireStopUpdate(0.0f, false);
CAuto::DeleteObject(bAll);
}
@@ -108,7 +107,7 @@ void CAutoResearch::Init()
// Management of an event.
-BOOL CAutoResearch::EventProcess(const Event &event)
+bool CAutoResearch::EventProcess(const Event &event)
{
CObject* power;
D3DVECTOR pos, speed;
@@ -118,11 +117,11 @@ BOOL CAutoResearch::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
if ( event.event == EVENT_UPDINTERFACE )
{
- if ( m_object->RetSelect() ) CreateInterface(TRUE);
+ if ( m_object->RetSelect() ) CreateInterface(true);
}
if ( m_object->RetSelect() && // center selected?
@@ -137,7 +136,7 @@ BOOL CAutoResearch::EventProcess(const Event &event)
{
if ( m_phase != ALP_WAIT )
{
- return FALSE;
+ return false;
}
m_research = event.event;
@@ -145,24 +144,24 @@ BOOL CAutoResearch::EventProcess(const Event &event)
if ( TestResearch(m_research) )
{
m_displayText->DisplayError(ERR_RESEARCH_ALREADY, m_object);
- return FALSE;
+ return false;
}
power = m_object->RetPower();
if ( power == 0 )
{
m_displayText->DisplayError(ERR_RESEARCH_POWER, m_object);
- return FALSE;
+ return false;
}
if ( power->RetCapacity() > 1.0f )
{
m_displayText->DisplayError(ERR_RESEARCH_TYPE, m_object);
- return FALSE;
+ return false;
}
if ( power->RetEnergy() < 1.0f )
{
m_displayText->DisplayError(ERR_RESEARCH_ENERGY, m_object);
- return FALSE;
+ return false;
}
time = SEARCH_TIME;
@@ -170,11 +169,11 @@ BOOL CAutoResearch::EventProcess(const Event &event)
if ( event.event == EVENT_OBJECT_RFLY ) time *= 0.3f;
if ( event.event == EVENT_OBJECT_RATOMIC ) time *= 2.0f;
- SetBusy(TRUE);
+ 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->RetPosition(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);
@@ -182,10 +181,10 @@ BOOL CAutoResearch::EventProcess(const Event &event)
m_phase = ALP_SEARCH;
m_progress = 0.0f;
m_speed = 1.0f/time;
- return TRUE;
+ return true;
}
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -196,7 +195,7 @@ BOOL CAutoResearch::EventProcess(const Event &event)
{
m_timeVirus = 0.1f+Rand()*0.3f;
}
- return TRUE;
+ return true;
}
UpdateInterface(event.rTime);
@@ -210,25 +209,25 @@ BOOL CAutoResearch::EventProcess(const Event &event)
if ( m_phase == ALP_WAIT )
{
- FireStopUpdate(m_progress, FALSE); // extinguished
- return TRUE;
+ FireStopUpdate(m_progress, false); // extinguished
+ return true;
}
if ( m_phase == ALP_SEARCH )
{
- FireStopUpdate(m_progress, TRUE); // flashes
+ FireStopUpdate(m_progress, true); // flashes
if ( m_progress < 1.0f )
{
power = m_object->RetPower();
if ( power == 0 ) // more battery?
{
- SetBusy(FALSE);
+ SetBusy(false);
UpdateInterface();
m_phase = ALP_WAIT;
m_progress = 0.0f;
m_speed = 1.0f/1.0f;
- return TRUE;
+ return true;
}
power->SetEnergy(1.0f-m_progress);
@@ -267,7 +266,7 @@ BOOL CAutoResearch::EventProcess(const Event &event)
m_displayText->DisplayError(message, m_object);
}
- SetBusy(FALSE);
+ SetBusy(false);
UpdateInterface();
m_phase = ALP_WAIT;
@@ -276,7 +275,7 @@ BOOL CAutoResearch::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -316,7 +315,7 @@ Error CAutoResearch::RetError()
// Creates all the interface when the object is selected.
-BOOL CAutoResearch::CreateInterface(BOOL bSelect)
+bool CAutoResearch::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, dim, ddim;
@@ -324,10 +323,10 @@ BOOL CAutoResearch::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
dim.x = 33.0f/640.0f;
dim.y = 33.0f/480.0f;
@@ -382,7 +381,7 @@ BOOL CAutoResearch::CreateInterface(BOOL bSelect)
UpdateInterface();
- return TRUE;
+ return true;
}
// Updates the status of all interface buttons.
@@ -474,7 +473,7 @@ void CAutoResearch::OkayButton(CWindow *pw, EventMsg event)
// Test whether a search has already been done.
-BOOL CAutoResearch::TestResearch(EventMsg event)
+bool CAutoResearch::TestResearch(EventMsg event)
{
if ( event == EVENT_OBJECT_RTANK ) return (g_researchDone & RESEARCH_TANK );
if ( event == EVENT_OBJECT_RFLY ) return (g_researchDone & RESEARCH_FLY );
@@ -485,7 +484,7 @@ BOOL CAutoResearch::TestResearch(EventMsg event)
if ( event == EVENT_OBJECT_RSHIELD ) return (g_researchDone & RESEARCH_SHIELD);
if ( event == EVENT_OBJECT_RATOMIC ) return (g_researchDone & RESEARCH_ATOMIC);
- return FALSE;
+ return false;
}
// Indicates a search as made.
@@ -513,7 +512,7 @@ void CAutoResearch::SetResearch(EventMsg event)
// Updates the stop lights.
-void CAutoResearch::FireStopUpdate(float progress, BOOL bLightOn)
+void CAutoResearch::FireStopUpdate(float progress, bool bLightOn)
{
D3DMATRIX* mat;
D3DVECTOR pos, speed;
@@ -578,11 +577,11 @@ void CAutoResearch::FireStopUpdate(float progress, BOOL bLightOn)
// Saves all parameters of the controller.
-BOOL CAutoResearch::Write(char *line)
+bool CAutoResearch::Write(char *line)
{
char name[100];
- if ( m_phase == ALP_WAIT ) return FALSE;
+ if ( m_phase == ALP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -601,14 +600,14 @@ BOOL CAutoResearch::Write(char *line)
sprintf(name, " aResearch=%d", m_research);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoResearch::Read(char *line)
+bool CAutoResearch::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -620,7 +619,7 @@ BOOL CAutoResearch::Read(char *line)
m_lastUpdateTime = 0.0f;
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autoresearch.h b/src/object/auto/autoresearch.h
index a8bfcb9..6a43570 100644
--- a/src/object/auto/autoresearch.h
+++ b/src/object/auto/autoresearch.h
@@ -46,24 +46,24 @@ public:
CAutoResearch(CInstanceManager* iMan, CObject* object);
~CAutoResearch();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
void UpdateInterface();
void UpdateInterface(float rTime);
void OkayButton(CWindow *pw, EventMsg event);
- BOOL TestResearch(EventMsg event);
+ bool TestResearch(EventMsg event);
void SetResearch(EventMsg event);
- void FireStopUpdate(float progress, BOOL bLightOn);
+ void FireStopUpdate(float progress, bool bLightOn);
protected:
AutoResearchPhase m_phase;
diff --git a/src/object/auto/autoroot.cpp b/src/object/auto/autoroot.cpp
index f502e54..0ab12b8 100644
--- a/src/object/auto/autoroot.cpp
+++ b/src/object/auto/autoroot.cpp
@@ -50,13 +50,12 @@ CAutoRoot::CAutoRoot(CInstanceManager* iMan, CObject* object)
CAutoRoot::~CAutoRoot()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoRoot::DeleteObject(BOOL bAll)
+void CAutoRoot::DeleteObject(bool bAll)
{
CAuto::DeleteObject(bAll);
}
@@ -89,15 +88,15 @@ void CAutoRoot::Init()
// Management of an event.
-BOOL CAutoRoot::EventProcess(const Event &event)
+bool CAutoRoot::EventProcess(const Event &event)
{
D3DVECTOR pos, speed;
FPOINT dim;
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != 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);
@@ -119,7 +118,7 @@ BOOL CAutoRoot::EventProcess(const Event &event)
m_particule->CreateParticule(pos, speed, dim, PARTIROOT, 1.0f, 0.0f, 0.0f);
}
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autoroot.h b/src/object/auto/autoroot.h
index 8b62d58..0be9b24 100644
--- a/src/object/auto/autoroot.h
+++ b/src/object/auto/autoroot.h
@@ -38,10 +38,10 @@ public:
CAutoRoot(CInstanceManager* iMan, CObject* object);
~CAutoRoot();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
protected:
diff --git a/src/object/auto/autosafe.cpp b/src/object/auto/autosafe.cpp
index fc71cd9..8104c5e 100644
--- a/src/object/auto/autosafe.cpp
+++ b/src/object/auto/autosafe.cpp
@@ -60,11 +60,11 @@ CAutoSafe::CAutoSafe(CInstanceManager* iMan, CObject* object)
for ( i=0 ; i<4 ; i++ )
{
- m_bKey[i] = FALSE;
+ m_bKey[i] = false;
m_keyParti[i] = -1;
}
- m_bLock = FALSE;
+ m_bLock = false;
m_lastParticule = 0.0f;
m_channelSound = -1;
Init();
@@ -74,13 +74,12 @@ CAutoSafe::CAutoSafe(CInstanceManager* iMan, CObject* object)
CAutoSafe::~CAutoSafe()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoSafe::DeleteObject(BOOL bAll)
+void CAutoSafe::DeleteObject(bool bAll)
{
CObject* pObj;
@@ -124,7 +123,7 @@ void CAutoSafe::Init()
// Management of an event.
-BOOL CAutoSafe::EventProcess(const Event &event)
+bool CAutoSafe::EventProcess(const Event &event)
{
CObject* pObj;
D3DVECTOR pos, speed;
@@ -133,8 +132,8 @@ 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->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
m_timeVirus -= event.rTime;
@@ -145,7 +144,7 @@ BOOL CAutoSafe::EventProcess(const Event &event)
{
m_timeVirus = 0.1f+Rand()*0.3f;
}
- return TRUE;
+ return true;
}
EventProgress(event.rTime);
@@ -155,9 +154,9 @@ BOOL CAutoSafe::EventProcess(const Event &event)
pObj = SearchVehicle();
if ( pObj != 0 )
{
- pObj->SetLock(TRUE); // object not yet usable
+ pObj->SetLock(true); // object not yet usable
m_main->CreateShortcuts();
- m_bLock = TRUE;
+ m_bLock = true;
}
}
@@ -180,17 +179,17 @@ 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->RetPosition(0), 1.0f, 0.25f, true);
m_sound->AddEnvelope(m_channelSound, 1.0f, 2.00f, OPEN_DELAY, SOPER_STOP);
m_phase = ASAP_OPEN;
m_progress = 0.0f;
m_speed = 1.0f/OPEN_DELAY;
- return TRUE;
+ return true;
}
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->RetPosition(0), 1.0f, 0.25f, true);
m_sound->AddEnvelope(m_channelSound, 1.0f, 0.35f, 0.5f, SOPER_STOP);
}
}
@@ -253,7 +252,7 @@ BOOL CAutoSafe::EventProcess(const Event &event)
pObj = SearchVehicle();
if ( pObj != 0 )
{
- pObj->SetLock(FALSE); // object usable
+ pObj->SetLock(false); // object usable
m_main->CreateShortcuts();
}
@@ -320,13 +319,13 @@ BOOL CAutoSafe::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Creates all the interface when the object is selected.
-BOOL CAutoSafe::CreateInterface(BOOL bSelect)
+bool CAutoSafe::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -334,10 +333,10 @@ BOOL CAutoSafe::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -350,7 +349,7 @@ BOOL CAutoSafe::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 114, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
@@ -368,11 +367,11 @@ Error CAutoSafe::RetError()
// Saves all parameters of the controller.
-BOOL CAutoSafe::Write(char *line)
+bool CAutoSafe::Write(char *line)
{
char name[100];
- if ( m_phase == ASAP_WAIT ) return FALSE;
+ if ( m_phase == ASAP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -388,14 +387,14 @@ BOOL CAutoSafe::Write(char *line)
sprintf(name, " aSpeed=%.2f", m_speed);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoSafe::Read(char *line)
+bool CAutoSafe::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -405,7 +404,7 @@ BOOL CAutoSafe::Read(char *line)
m_lastParticule = 0.0f;
- return TRUE;
+ return true;
}
@@ -425,7 +424,7 @@ int CAutoSafe::CountKeys()
for ( index=0 ; index<4 ; index++ )
{
- m_bKey[index] = FALSE;
+ m_bKey[index] = false;
m_keyPos[index] = cPos;
}
@@ -483,7 +482,7 @@ int CAutoSafe::CountKeys()
pObj->SetAngleY(0, oAngle+cAngle);
m_keyPos[index] = oPos;
- m_bKey[index] = TRUE;
+ m_bKey[index] = true;
}
i = 0;
@@ -523,7 +522,7 @@ void CAutoSafe::LockKeys()
dist = Length2d(oPos, cPos);
if ( dist > 20.0f ) continue;
- pObj->SetLock(TRUE);
+ pObj->SetLock(true);
}
}
@@ -570,13 +569,13 @@ void CAutoSafe::DeleteKeys()
ObjectType oType;
float dist;
int i;
- BOOL bDelete;
+ bool bDelete;
cPos = m_object->RetPosition(0);
do
{
- bDelete = FALSE;
+ bDelete = false;
for ( i=0 ; i<1000000 ; i++ )
{
pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i);
@@ -596,7 +595,7 @@ void CAutoSafe::DeleteKeys()
pObj->DeleteObject();
delete pObj;
- bDelete = TRUE;
+ bDelete = true;
}
}
while ( bDelete );
diff --git a/src/object/auto/autosafe.h b/src/object/auto/autosafe.h
index 9cfaca0..2e43359 100644
--- a/src/object/auto/autosafe.h
+++ b/src/object/auto/autosafe.h
@@ -47,16 +47,16 @@ public:
CAutoSafe(CInstanceManager* iMan, CObject* object);
~CAutoSafe();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
int CountKeys();
@@ -72,11 +72,11 @@ protected:
float m_timeVirus;
float m_lastParticule;
int m_channelSound;
- BOOL m_bLock;
+ bool m_bLock;
int m_countKeys;
float m_actualAngle;
float m_finalAngle;
- BOOL m_bKey[4];
+ bool m_bKey[4];
D3DVECTOR m_keyPos[4];
int m_keyParti[4];
};
diff --git a/src/object/auto/autostation.cpp b/src/object/auto/autostation.cpp
index 3d5f82a..ab26b6d 100644
--- a/src/object/auto/autostation.cpp
+++ b/src/object/auto/autostation.cpp
@@ -56,13 +56,12 @@ CAutoStation::CAutoStation(CInstanceManager* iMan, CObject* object)
CAutoStation::~CAutoStation()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoStation::DeleteObject(BOOL bAll)
+void CAutoStation::DeleteObject(bool bAll)
{
if ( m_soundChannel != -1 )
{
@@ -83,7 +82,7 @@ void CAutoStation::Init()
m_lastUpdateTime = 0.0f;
m_lastParticule = 0.0f;
m_soundChannel = -1;
- m_bLastVirus = FALSE;
+ m_bLastVirus = false;
CAuto::Init();
}
@@ -91,7 +90,7 @@ void CAutoStation::Init()
// Management of an event.
-BOOL CAutoStation::EventProcess(const Event &event)
+bool CAutoStation::EventProcess(const Event &event)
{
D3DMATRIX* mat;
D3DVECTOR pos, ppos, speed;
@@ -103,8 +102,8 @@ BOOL CAutoStation::EventProcess(const Event &event)
CAuto::EventProcess(event);
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_timeVirus -= event.rTime;
@@ -112,7 +111,7 @@ BOOL CAutoStation::EventProcess(const Event &event)
{
if ( !m_bLastVirus )
{
- m_bLastVirus = TRUE;
+ m_bLastVirus = true;
m_energyVirus = m_object->RetEnergy();
}
@@ -122,13 +121,13 @@ BOOL CAutoStation::EventProcess(const Event &event)
m_object->SetEnergy(Rand());
}
- return TRUE;
+ return true;
}
else
{
if ( m_bLastVirus )
{
- m_bLastVirus = FALSE;
+ m_bLastVirus = false;
m_object->SetEnergy(m_energyVirus);
}
}
@@ -185,7 +184,7 @@ BOOL CAutoStation::EventProcess(const Event &event)
if ( m_soundChannel == -1 )
{
m_soundChannel = m_sound->Play(SOUND_STATION, m_object->RetPosition(0),
- 0.3f, freq, TRUE);
+ 0.3f, freq, true);
}
m_sound->Frequency(m_soundChannel, freq);
}
@@ -245,7 +244,7 @@ BOOL CAutoStation::EventProcess(const Event &event)
if ( big > 1.0f ) big = 1.0f;
m_object->SetEnergy(big); // Shift the large battery
- return TRUE;
+ return true;
}
@@ -324,7 +323,7 @@ Error CAutoStation::RetError()
// Crée toute l'interface lorsque l'objet est sélectionné .
-BOOL CAutoStation::CreateInterface(BOOL bSelect)
+bool CAutoStation::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -332,10 +331,10 @@ BOOL CAutoStation::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -354,7 +353,7 @@ BOOL CAutoStation::CreateInterface(BOOL bSelect)
ddim.y = 66.0f/480.0f;
pw->CreateGroup(pos, ddim, 104, EVENT_OBJECT_TYPE);
- return TRUE;
+ return true;
}
// Updates the state of all buttons on the interface,
diff --git a/src/object/auto/autostation.h b/src/object/auto/autostation.h
index 40ad57b..04f6b46 100644
--- a/src/object/auto/autostation.h
+++ b/src/object/auto/autostation.h
@@ -38,13 +38,13 @@ public:
CAutoStation(CInstanceManager* iMan, CObject* object);
~CAutoStation();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
protected:
void UpdateInterface(float rTime);
@@ -59,7 +59,7 @@ protected:
float m_lastParticule;
int m_soundChannel;
D3DVECTOR m_fretPos;
- BOOL m_bLastVirus;
+ bool m_bLastVirus;
float m_energyVirus;
};
diff --git a/src/object/auto/autotower.cpp b/src/object/auto/autotower.cpp
index ea3cd54..63222b8 100644
--- a/src/object/auto/autotower.cpp
+++ b/src/object/auto/autotower.cpp
@@ -73,15 +73,14 @@ CAutoTower::CAutoTower(CInstanceManager* iMan, CObject* object)
CAutoTower::~CAutoTower()
{
- this->CAuto::~CAuto();
}
// Destroys the object.
-void CAutoTower::DeleteObject(BOOL bAll)
+void CAutoTower::DeleteObject(bool bAll)
{
- FireStopUpdate(0.0f, FALSE);
+ FireStopUpdate(0.0f, false);
CAuto::DeleteObject(bAll);
}
@@ -103,7 +102,7 @@ void CAutoTower::Init()
// Management of an event.
-BOOL CAutoTower::EventProcess(const Event &event)
+bool CAutoTower::EventProcess(const Event &event)
{
CObject* power;
CObject* target;
@@ -112,8 +111,8 @@ 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->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_timeVirus -= event.rTime;
@@ -129,18 +128,18 @@ BOOL CAutoTower::EventProcess(const Event &event)
m_object->SetAngleZ(2, Rand()*0.5f);
}
- return TRUE;
+ return true;
}
UpdateInterface(event.rTime);
- if ( m_phase == ATP_WAIT ) return TRUE;
+ if ( m_phase == ATP_WAIT ) return true;
m_progress += event.rTime*m_speed;
if ( m_phase == ATP_ZERO )
{
- FireStopUpdate(m_progress, TRUE); // blinks
+ FireStopUpdate(m_progress, true); // blinks
if ( m_progress < 1.0f )
{
energy = 0.0f;
@@ -166,7 +165,7 @@ BOOL CAutoTower::EventProcess(const Event &event)
if ( m_phase == ATP_SEARCH )
{
- FireStopUpdate(m_progress, FALSE); // extinguished
+ FireStopUpdate(m_progress, false); // extinguished
if ( m_progress < 1.0f )
{
quick = 1.0f;
@@ -270,7 +269,7 @@ BOOL CAutoTower::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -304,7 +303,7 @@ CObject* CAutoTower::SearchTarget(D3DVECTOR &impact)
if ( !pObj->RetActif() ) continue; // inactive?
//? if ( g_researchDone & RESEARCH_QUICK )
- if ( FALSE )
+ if ( false )
{
physics = pObj->RetPhysics();
if ( physics != 0 )
@@ -359,7 +358,7 @@ Error CAutoTower::RetError()
// Updates the stop lights.
-void CAutoTower::FireStopUpdate(float progress, BOOL bLightOn)
+void CAutoTower::FireStopUpdate(float progress, bool bLightOn)
{
D3DMATRIX* mat;
D3DVECTOR pos, speed;
@@ -422,7 +421,7 @@ void CAutoTower::FireStopUpdate(float progress, BOOL bLightOn)
// Creates all the interface when the object is selected.
-BOOL CAutoTower::CreateInterface(BOOL bSelect)
+bool CAutoTower::CreateInterface(bool bSelect)
{
CWindow* pw;
FPOINT pos, ddim;
@@ -430,10 +429,10 @@ BOOL CAutoTower::CreateInterface(BOOL bSelect)
CAuto::CreateInterface(bSelect);
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
ox = 3.0f/640.0f;
oy = 3.0f/480.0f;
@@ -458,7 +457,7 @@ BOOL CAutoTower::CreateInterface(BOOL bSelect)
ddim.y = 33.0f/480.0f;
pw->CreateButton(pos, ddim, 41, EVENT_OBJECT_LIMIT);
- return TRUE;
+ return true;
}
// Updates the state of all buttons on the interface,
@@ -497,11 +496,11 @@ void CAutoTower::UpdateInterface(float rTime)
// Saves all parameters of the controller.
-BOOL CAutoTower::Write(char *line)
+bool CAutoTower::Write(char *line)
{
char name[100];
- if ( m_phase == ATP_WAIT ) return FALSE;
+ if ( m_phase == ATP_WAIT ) return false;
sprintf(name, " aExist=%d", 1);
strcat(line, name);
@@ -532,14 +531,14 @@ BOOL CAutoTower::Write(char *line)
sprintf(name, " aAngleZfinal=%.2f", m_angleZfinal);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the controller.
-BOOL CAutoTower::Read(char *line)
+bool CAutoTower::Read(char *line)
{
- if ( OpInt(line, "aExist", 0) == 0 ) return FALSE;
+ if ( OpInt(line, "aExist", 0) == 0 ) return false;
CAuto::Read(line);
@@ -554,7 +553,7 @@ BOOL CAutoTower::Read(char *line)
m_lastUpdateTime = 0.0f;
- return TRUE;
+ return true;
}
diff --git a/src/object/auto/autotower.h b/src/object/auto/autotower.h
index 64448d3..cf4fc3b 100644
--- a/src/object/auto/autotower.h
+++ b/src/object/auto/autotower.h
@@ -49,22 +49,22 @@ public:
CAutoTower(CInstanceManager* iMan, CObject* object);
~CAutoTower();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Init();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error RetError();
- BOOL CreateInterface(BOOL bSelect);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
protected:
void UpdateInterface(float rTime);
CObject* SearchTarget(D3DVECTOR &impact);
- void FireStopUpdate(float progress, BOOL bLightOn);
+ void FireStopUpdate(float progress, bool bLightOn);
protected:
AutoTowerPhase m_phase;
diff --git a/src/object/brain.cpp b/src/object/brain.cpp
index 698f4d8..1bbebe4 100644
--- a/src/object/brain.cpp
+++ b/src/object/brain.cpp
@@ -99,9 +99,9 @@ CBrain::CBrain(CInstanceManager* iMan, CObject* object)
m_studio = 0;
m_program = -1;
- m_bActivity = TRUE;
- m_bBurn = FALSE;
- m_bActiveVirus = FALSE;
+ m_bActivity = true;
+ m_bBurn = false;
+ m_bActiveVirus = false;
m_time = 0.0f;
m_burnTime = 0.0f;
m_lastUpdateTime = 0.0f;
@@ -126,7 +126,7 @@ CBrain::CBrain(CInstanceManager* iMan, CObject* object)
m_soluceName[0] = 0;
m_selScript = 0;
- m_bTraceRecord = FALSE;
+ m_bTraceRecord = false;
m_traceRecordBuffer = 0;
}
@@ -151,7 +151,7 @@ CBrain::~CBrain()
// Destroys the object.
-void CBrain::DeleteObject(BOOL bAll)
+void CBrain::DeleteObject(bool bAll)
{
if ( m_soundChannelAlarm != -1 )
{
@@ -172,7 +172,7 @@ void CBrain::DeleteObject(BOOL bAll)
if ( m_studio != 0 ) // current edition?
{
- StopEditScript(TRUE);
+ StopEditScript(true);
}
}
@@ -190,29 +190,29 @@ void CBrain::SetMotion(CMotion* motion)
// Saves all parameters of the object.
-BOOL CBrain::Write(char *line)
+bool CBrain::Write(char *line)
{
char name[100];
sprintf(name, " bVirusActive=%d", m_bActiveVirus);
strcat(line, name);
- return TRUE;
+ return true;
}
// Restores all parameters of the object.
-BOOL CBrain::Read(char *line)
+bool CBrain::Read(char *line)
{
m_bActiveVirus = OpInt(line, "bVirusActive", 0);
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CBrain::EventProcess(const Event &event)
+bool CBrain::EventProcess(const Event &event)
{
CWindow* pw;
CControl* pc;
@@ -259,11 +259,11 @@ BOOL CBrain::EventProcess(const Event &event)
action = event.event;
}
- if ( action == EVENT_NULL ) return TRUE;
+ if ( action == EVENT_NULL ) return true;
if ( action == EVENT_UPDINTERFACE )
{
- if ( m_object->RetSelect() ) CreateInterface(TRUE);
+ if ( m_object->RetSelect() ) CreateInterface(true);
}
if ( action == EVENT_FRAME )
@@ -298,15 +298,15 @@ BOOL CBrain::EventProcess(const Event &event)
}
if ( action == EVENT_STUDIO_OK )
{
- StopEditScript(FALSE);
+ StopEditScript(false);
m_main->SaveOneScript(m_object);
}
if ( action == EVENT_STUDIO_CANCEL )
{
- StopEditScript(TRUE);
+ StopEditScript(true);
m_main->SaveOneScript(m_object);
}
- return TRUE;
+ return true;
}
if ( !m_object->RetSelect() && // robot pas sélectionné ?
@@ -320,7 +320,7 @@ BOOL CBrain::EventProcess(const Event &event)
{
if ( !m_bBurn ) // beginning?
{
- m_bBurn = TRUE;
+ m_bBurn = true;
m_burnTime = 0.0f;
}
@@ -345,19 +345,19 @@ BOOL CBrain::EventProcess(const Event &event)
m_physics->SetMotorSpeedX(axeY); // move forward/move back
m_physics->SetMotorSpeedY(axeZ); // up / down
m_physics->SetMotorSpeedZ(axeX); // rotate
- return TRUE;
+ return true;
}
if ( m_program != -1 &&
m_object->RetRuin() )
{
StopProgram();
- return TRUE;
+ return true;
}
if ( !m_object->RetSelect() ) // robot not selected?
{
- return TRUE;
+ return true;
}
if ( m_secondaryTask != 0 ) // current task?
@@ -378,7 +378,7 @@ BOOL CBrain::EventProcess(const Event &event)
{
StartEditScript(m_selScript, m_main->RetScriptName());
}
- if ( m_primaryTask == 0 || !m_primaryTask->IsPilot() ) return TRUE;
+ if ( m_primaryTask == 0 || !m_primaryTask->IsPilot() ) return true;
}
if ( action == EVENT_OBJECT_LEFT ||
@@ -623,55 +623,55 @@ BOOL CBrain::EventProcess(const Event &event)
if ( action == EVENT_OBJECT_PEN0 ) // up
{
- err = StartTaskPen(FALSE, m_object->RetTraceColor());
- m_object->SetTraceDown(FALSE);
+ err = StartTaskPen(false, m_object->RetTraceColor());
+ m_object->SetTraceDown(false);
}
if ( action == EVENT_OBJECT_PEN1 ) // black
{
- err = StartTaskPen(TRUE, 1);
- m_object->SetTraceDown(TRUE);
+ err = StartTaskPen(true, 1);
+ m_object->SetTraceDown(true);
m_object->SetTraceColor(1);
}
if ( action == EVENT_OBJECT_PEN2 ) // yellow
{
- err = StartTaskPen(TRUE, 8);
- m_object->SetTraceDown(TRUE);
+ err = StartTaskPen(true, 8);
+ m_object->SetTraceDown(true);
m_object->SetTraceColor(8);
}
if ( action == EVENT_OBJECT_PEN3 ) // orange
{
- err = StartTaskPen(TRUE, 7);
- m_object->SetTraceDown(TRUE);
+ err = StartTaskPen(true, 7);
+ m_object->SetTraceDown(true);
m_object->SetTraceColor(7);
}
if ( action == EVENT_OBJECT_PEN4 ) // red
{
- err = StartTaskPen(TRUE, 4);
- m_object->SetTraceDown(TRUE);
+ err = StartTaskPen(true, 4);
+ m_object->SetTraceDown(true);
m_object->SetTraceColor(4);
}
if ( action == EVENT_OBJECT_PEN5 ) // violet
{
- err = StartTaskPen(TRUE, 6);
- m_object->SetTraceDown(TRUE);
+ err = StartTaskPen(true, 6);
+ m_object->SetTraceDown(true);
m_object->SetTraceColor(6);
}
if ( action == EVENT_OBJECT_PEN6 ) // blue
{
- err = StartTaskPen(TRUE, 14);
- m_object->SetTraceDown(TRUE);
+ err = StartTaskPen(true, 14);
+ m_object->SetTraceDown(true);
m_object->SetTraceColor(14);
}
if ( action == EVENT_OBJECT_PEN7 ) // green
{
- err = StartTaskPen(TRUE, 12);
- m_object->SetTraceDown(TRUE);
+ err = StartTaskPen(true, 12);
+ m_object->SetTraceDown(true);
m_object->SetTraceColor(12);
}
if ( action == EVENT_OBJECT_PEN8 ) // brown
{
- err = StartTaskPen(TRUE, 10);
- m_object->SetTraceDown(TRUE);
+ err = StartTaskPen(true, 10);
+ m_object->SetTraceDown(true);
m_object->SetTraceColor(10);
}
@@ -679,12 +679,12 @@ BOOL CBrain::EventProcess(const Event &event)
{
if ( m_bTraceRecord )
{
- m_bTraceRecord = FALSE;
+ m_bTraceRecord = false;
TraceRecordStop();
}
else
{
- m_bTraceRecord = TRUE;
+ m_bTraceRecord = true;
TraceRecordStart();
}
UpdateInterface();
@@ -698,7 +698,7 @@ BOOL CBrain::EventProcess(const Event &event)
{
if ( m_bTraceRecord )
{
- m_bTraceRecord = FALSE;
+ m_bTraceRecord = false;
TraceRecordStop();
}
UpdateInterface();
@@ -750,13 +750,13 @@ BOOL CBrain::EventProcess(const Event &event)
m_displayText->DisplayError(err, m_object);
}
- return TRUE;
+ return true;
}
// The brain is changing by time.
-BOOL CBrain::EventFrame(const Event &event)
+bool CBrain::EventFrame(const Event &event)
{
m_time += event.rTime;
if ( m_bBurn ) m_burnTime += event.rTime;
@@ -773,9 +773,9 @@ BOOL CBrain::EventFrame(const Event &event)
UpdateInterface(event.rTime);
- if ( m_engine->RetPause() ) return TRUE;
- if ( !m_bActivity ) return TRUE; // expected if idle
- if ( EndedTask() == ERR_CONTINUE ) return TRUE; // expected if not finished ...
+ if ( m_engine->RetPause() ) return true;
+ if ( !m_bActivity ) return true; // expected if idle
+ if ( EndedTask() == ERR_CONTINUE ) return true; // expected if not finished ...
if ( m_program != -1 ) // current program?
{
@@ -790,7 +790,7 @@ BOOL CBrain::EventFrame(const Event &event)
TraceRecordFrame();
}
- return TRUE;
+ return true;
}
@@ -809,7 +809,7 @@ void CBrain::StopProgram()
m_script[m_program]->Stop();
}
- BlinkScript(FALSE); // stops flashing
+ BlinkScript(false); // stops flashing
m_program = -1;
@@ -838,9 +838,9 @@ void CBrain::StopTask()
// Introduces a virus into a program.
-// Returns TRUE if it was inserted.
+// Returns true if it was inserted.
-BOOL CBrain::IntroduceVirus()
+bool CBrain::IntroduceVirus()
{
int i, j;
@@ -851,12 +851,12 @@ BOOL CBrain::IntroduceVirus()
{
if ( m_script[j]->IntroduceVirus() ) // tries to introduce
{
- m_bActiveVirus = TRUE; // active virus
- return TRUE;
+ m_bActiveVirus = true; // active virus
+ return true;
}
}
}
- return FALSE;
+ return false;
}
// Active Virus indicates that the object is contaminated. Unlike ch'tites (??? - Programerus)
@@ -865,17 +865,17 @@ BOOL CBrain::IntroduceVirus()
// (Even if the virus is not fixed).
-void CBrain::SetActiveVirus(BOOL bActive)
+void CBrain::SetActiveVirus(bool bActive)
{
m_bActiveVirus = bActive;
if ( !m_bActiveVirus ) // virus disabled?
{
- m_object->SetVirusMode(FALSE); // chtites (??? - Programerus) letters also
+ m_object->SetVirusMode(false); // chtites (??? - Programerus) letters also
}
}
-BOOL CBrain::RetActiveVirus()
+bool CBrain::RetActiveVirus()
{
return m_bActiveVirus;
}
@@ -885,7 +885,7 @@ BOOL CBrain::RetActiveVirus()
void CBrain::StartEditScript(int rank, char* name)
{
- CreateInterface(FALSE); // removes the control buttons
+ CreateInterface(false); // removes the control buttons
if ( m_script[rank] == 0 )
{
@@ -898,16 +898,16 @@ void CBrain::StartEditScript(int rank, char* name)
// End of editing a program.
-void CBrain::StopEditScript(BOOL bCancel)
+void CBrain::StopEditScript(bool bCancel)
{
- if ( !bCancel ) SetActiveVirus(FALSE);
+ if ( !bCancel ) SetActiveVirus(false);
if ( !m_studio->StopEditScript(bCancel) ) return;
delete m_studio;
m_studio = 0;
- CreateInterface(TRUE); // puts the control buttons
+ CreateInterface(true); // puts the control buttons
}
@@ -1022,7 +1022,7 @@ Error CBrain::StartTaskTerraform()
// Change pencil.
-Error CBrain::StartTaskPen(BOOL bDown, int color)
+Error CBrain::StartTaskPen(bool bDown, int color)
{
Error err;
@@ -1225,7 +1225,7 @@ void CBrain::ColorFlag(int color)
// Creates all the interface when the object is selected.
-BOOL CBrain::CreateInterface(BOOL bSelect)
+bool CBrain::CreateInterface(bool bSelect)
{
ObjectType type;
CWindow* pw;
@@ -1246,7 +1246,7 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
}
m_defaultEnter = EVENT_NULL;
- if ( !bSelect ) return TRUE;
+ if ( !bSelect ) return true;
pos.x = 0.0f;
pos.y = 0.0f;
@@ -1255,7 +1255,7 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
dim.y = 86.0f/480.0f;
m_interface->CreateWindows(pos, dim, 3, EVENT_WINDOW0);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW0);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
m_object->GetTooltipName(name);
pos.x = 0.0f;
@@ -1332,12 +1332,12 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
pos.x = ox+sx*6.4f;
pos.y = oy+sy*0;
pb = pw->CreateButton(pos, dim, 29, EVENT_OBJECT_GASDOWN);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
pos.x = ox+sx*6.4f;
pos.y = oy+sy*1;
pb = pw->CreateButton(pos, dim, 28, EVENT_OBJECT_GASUP);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
if ( type != OBJECT_HUMAN ||
m_object->RetOption() != 2 )
@@ -1475,7 +1475,7 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
pos.x = ox+sx*5.4f;
pos.y = oy+sy*0.1f;
pw->CreateButton(pos, ddim, 128+56, EVENT_OBJECT_BXXXX);
- DeadInterface(pw, EVENT_OBJECT_BXXXX, FALSE);
+ DeadInterface(pw, EVENT_OBJECT_BXXXX, false);
if ( g_build&BUILD_GFLAT )
{
@@ -1589,7 +1589,7 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
pos.x = ox+sx*7.7f;
pos.y = oy+sy*0.5f;
pb = pw->CreateButton(pos, dim, 42, EVENT_OBJECT_FIRE);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
DefaultEnter(pw, EVENT_OBJECT_FIRE);
//? pos.x = ox+sx*10.2f;
@@ -1709,7 +1709,7 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
!m_object->RetCameraLock() )
{
//? if ( m_main->RetShowMap() )
- if ( TRUE )
+ if ( true )
{
pos.x = ox+sx*13.4f;
pos.y = oy+sy*1;
@@ -1733,36 +1733,36 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
pos.x = ox+sx*10.0f;
pos.y = oy+sy*0.66f;
pb = pw->CreateButton(pos, ddim, 55, EVENT_OBJECT_CAMERAleft);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
pos.x = ox+sx*(10.0f+0.66f*2.0f);
pos.y = oy+sy*0.66f;
pb = pw->CreateButton(pos, ddim, 48, EVENT_OBJECT_CAMERAright);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
pos.x = ox+sx*(10.0f+0.66f);
pos.y = oy+sy*(0.66f*2.0f);
pb = pw->CreateButton(pos, ddim, 49, EVENT_OBJECT_CAMERAnear);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
pos.x = ox+sx*(10.0f+0.66f);
pos.y = oy+sy*0.0f;
pb = pw->CreateButton(pos, ddim, 50, EVENT_OBJECT_CAMERAaway);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
#else
pos.x = ox+sx*9.0f;
pos.y = oy+sy*0;
pb = pw->CreateButton(pos, dim, 55, EVENT_OBJECT_CAMERAleft);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
pos.x = ox+sx*11.0f;
pos.y = oy+sy*0;
pb = pw->CreateButton(pos, dim, 48, EVENT_OBJECT_CAMERAright);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
pos.x = ox+sx*10.0f;
pos.y = oy+sy*1;
pb = pw->CreateButton(pos, dim, 49, EVENT_OBJECT_CAMERAnear);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
pos.x = ox+sx*10.0f;
pos.y = oy+sy*0;
pb = pw->CreateButton(pos, dim, 50, EVENT_OBJECT_CAMERAaway);
- pb->SetImmediat(TRUE);
+ pb->SetImmediat(true);
#endif
}
@@ -1851,7 +1851,7 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
}
#if 0
- if ( FALSE )
+ if ( false )
{
pos.x = 505.0f/640.0f;
pos.y = 3.0f/480.0f;
@@ -1919,7 +1919,7 @@ BOOL CBrain::CreateInterface(BOOL bSelect)
m_lastUpdateTime = 0.0f;
UpdateInterface(0.0f);
- return TRUE;
+ return true;
}
// Updates the state of all buttons on the interface,
@@ -1940,7 +1940,7 @@ void CBrain::UpdateInterface(float rTime)
FPOINT ppos;
float energy, limit, angle, range;
int icon;
- BOOL bOnBoard;
+ bool bOnBoard;
m_lastAlarmTime += rTime;
if ( m_time < m_lastUpdateTime+0.1f ) return;
@@ -2013,7 +2013,7 @@ void CBrain::UpdateInterface(float rTime)
}
if ( m_soundChannelAlarm == -1 )
{
- m_soundChannelAlarm = m_sound->Play(SOUND_ALARMt, m_object->RetPosition(0), 0.0f, 0.1f, TRUE);
+ m_soundChannelAlarm = m_sound->Play(SOUND_ALARMt, m_object->RetPosition(0), 0.0f, 0.1f, true);
m_sound->AddEnvelope(m_soundChannelAlarm, 1.0f, 1.0f, 1.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannelAlarm, 1.0f, 1.0f, 1.0f, SOPER_LOOP);
}
@@ -2138,7 +2138,7 @@ void CBrain::UpdateInterface()
CColor* pc;
int color;
#endif
- BOOL bEnable, bFly, bRun;
+ bool bEnable, bFly, bRun;
char title[100];
if ( !m_object->RetSelect() ) return;
@@ -2230,10 +2230,10 @@ void CBrain::UpdateInterface()
}
else
{
- EnableInterface(pw, EVENT_OBJECT_BEGSHIELD, FALSE);
- EnableInterface(pw, EVENT_OBJECT_ENDSHIELD, FALSE);
- DefaultEnter (pw, EVENT_OBJECT_BEGSHIELD, FALSE);
- DefaultEnter (pw, EVENT_OBJECT_ENDSHIELD, FALSE);
+ EnableInterface(pw, EVENT_OBJECT_BEGSHIELD, false);
+ EnableInterface(pw, EVENT_OBJECT_ENDSHIELD, false);
+ DefaultEnter (pw, EVENT_OBJECT_BEGSHIELD, false);
+ DefaultEnter (pw, EVENT_OBJECT_ENDSHIELD, false);
}
ps = (CSlider*)pw->SearchControl(EVENT_OBJECT_DIMSHIELD);
@@ -2246,14 +2246,14 @@ void CBrain::UpdateInterface()
bFly = bEnable;
if ( bFly && (type == OBJECT_HUMAN || type == OBJECT_TECH) )
{
- if ( m_object->RetFret() != 0 ) bFly = FALSE; // if holder -> not fly
+ if ( m_object->RetFret() != 0 ) bFly = false; // if holder -> not fly
}
EnableInterface(pw, EVENT_OBJECT_GASUP, bFly);
EnableInterface(pw, EVENT_OBJECT_GASDOWN, bFly);
if ( m_object->RetTrainer() ) // Training?
{
- DeadInterface(pw, EVENT_OBJECT_GASUP, FALSE);
- DeadInterface(pw, EVENT_OBJECT_GASDOWN, FALSE);
+ DeadInterface(pw, EVENT_OBJECT_GASUP, false);
+ DeadInterface(pw, EVENT_OBJECT_GASDOWN, false);
}
else
{
@@ -2296,17 +2296,17 @@ void CBrain::UpdateInterface()
type == OBJECT_BEE ||
type == OBJECT_WORM ) // vehicle?
{
- bRun = FALSE;
+ bRun = false;
if ( m_script[m_selScript] != 0 )
{
m_script[m_selScript]->GetTitle(title);
if ( title[0] != 0 )
{
- bRun = TRUE;
+ bRun = true;
}
}
- if ( !bEnable && m_program == -1 ) bRun = FALSE;
- if ( m_bTraceRecord ) bRun = FALSE;
+ if ( !bEnable && m_program == -1 ) bRun = false;
+ if ( m_bTraceRecord ) bRun = false;
EnableInterface(pw, EVENT_OBJECT_PROGRUN, bRun);
pb = (CButton*)pw->SearchControl(EVENT_OBJECT_PROGRUN);
@@ -2445,7 +2445,7 @@ void CBrain::UpdateScript(CWindow *pw)
char name[100];
char title[100];
int i;
- BOOL bSoluce;
+ bool bSoluce;
pl = (CList*)pw->SearchControl(EVENT_OBJECT_PROGLIST);
if ( pl == 0 ) return;
@@ -2453,7 +2453,7 @@ void CBrain::UpdateScript(CWindow *pw)
#if _SCHOOL
bSoluce = m_main->RetSoluce4();
#else
- bSoluce = TRUE;
+ bSoluce = true;
#endif
for ( i=0 ; i<BRAINMAXSCRIPT ; i++ )
@@ -2478,11 +2478,11 @@ void CBrain::UpdateScript(CWindow *pw)
if ( !bSoluce )
{
- pl->SetEnable(3, FALSE);
+ pl->SetEnable(3, false);
}
pl->SetSelect(m_selScript);
- pl->ShowSelect(TRUE);
+ pl->ShowSelect(true);
}
// Returns the rank of selected script.
@@ -2503,7 +2503,7 @@ int CBrain::RetSelScript()
// Blinks the running program.
-void CBrain::BlinkScript(BOOL bEnable)
+void CBrain::BlinkScript(bool bEnable)
{
CWindow* pw;
CList* pl;
@@ -2521,7 +2521,7 @@ void CBrain::BlinkScript(BOOL bEnable)
// Check the status of a button interface.
-void CBrain::CheckInterface(CWindow *pw, EventMsg event, BOOL bState)
+void CBrain::CheckInterface(CWindow *pw, EventMsg event, bool bState)
{
CControl* control;
@@ -2533,7 +2533,7 @@ 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(CWindow *pw, EventMsg event, bool bState)
{
CControl* control;
@@ -2545,7 +2545,7 @@ 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(CWindow *pw, EventMsg event, bool bState)
{
CControl* control;
@@ -2557,7 +2557,7 @@ 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(CWindow *pw, EventMsg event, bool bState)
{
CControl* control;
@@ -2578,33 +2578,33 @@ void CBrain::DefaultEnter(CWindow *pw, EventMsg event, BOOL bState)
// Indicates whether the object is busy with a task.
-BOOL CBrain::IsBusy()
+bool CBrain::IsBusy()
{
return (m_primaryTask != 0);
}
// Management of the activity of an object.
-void CBrain::SetActivity(BOOL bMode)
+void CBrain::SetActivity(bool bMode)
{
m_bActivity = bMode;
}
-BOOL CBrain::RetActivity()
+bool CBrain::RetActivity()
{
return m_bActivity;
}
// Indicates whether a program is running.
-BOOL CBrain::IsProgram()
+bool CBrain::IsProgram()
{
return ( m_program != -1 );
}
// Indicates whether a program exists.
-BOOL CBrain::ProgramExist(int rank)
+bool CBrain::ProgramExist(int rank)
{
return ( m_script[rank] != 0 );
}
@@ -2619,7 +2619,7 @@ void CBrain::RunProgram(int rank)
m_script[rank]->Run() )
{
m_program = rank; // start new program
- BlinkScript(TRUE); // blink
+ BlinkScript(true); // blink
m_object->CreateSelectParticule();
m_main->UpdateShortcuts();
}
@@ -2683,14 +2683,14 @@ char* CBrain::RetSoluceName()
// Load a script solution, in the first free script.
// If there is already an identical script, nothing is loaded.
-BOOL CBrain::ReadSoluce(char* filename)
+bool CBrain::ReadSoluce(char* filename)
{
int rank, i;
rank = FreeProgram();
- if ( rank == -1 ) return FALSE;
+ if ( rank == -1 ) return false;
- if ( !ReadProgram(rank, filename) ) return FALSE; // load solution
+ if ( !ReadProgram(rank, filename) ) return false; // load solution
for ( i=0 ; i<BRAINMAXSCRIPT ; i++ )
{
@@ -2700,59 +2700,59 @@ BOOL CBrain::ReadSoluce(char* filename)
{
delete m_script[rank];
m_script[rank] = 0;
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
// Load a script with a text file.
-BOOL CBrain::ReadProgram(int rank, char* filename)
+bool CBrain::ReadProgram(int rank, char* filename)
{
if ( m_script[rank] == 0 )
{
m_script[rank] = new CScript(m_iMan, m_object, &m_secondaryTask);
}
- if ( m_script[rank]->ReadScript(filename) ) return TRUE;
+ if ( m_script[rank]->ReadScript(filename) ) return true;
delete m_script[rank];
m_script[rank] = 0;
- return FALSE;
+ return false;
}
// Indicates whether a program is compiled correctly.
-BOOL CBrain::RetCompile(int rank)
+bool CBrain::RetCompile(int rank)
{
- if ( m_script[rank] == 0 ) return FALSE;
+ if ( m_script[rank] == 0 ) return false;
return m_script[rank]->RetCompile();
}
// Saves a script in a text file.
-BOOL CBrain::WriteProgram(int rank, char* filename)
+bool CBrain::WriteProgram(int rank, char* filename)
{
if ( m_script[rank] == 0 )
{
m_script[rank] = new CScript(m_iMan, m_object, &m_secondaryTask);
}
- if ( m_script[rank]->WriteScript(filename) ) return TRUE;
+ if ( m_script[rank]->WriteScript(filename) ) return true;
delete m_script[rank];
m_script[rank] = 0;
- return FALSE;
+ return false;
}
// Load a stack of script implementation from a file.
-BOOL CBrain::ReadStack(FILE *file)
+bool CBrain::ReadStack(FILE *file)
{
short op;
@@ -2764,22 +2764,22 @@ BOOL CBrain::ReadStack(FILE *file)
{
m_program = op; // program restarts
m_selScript = op;
- BlinkScript(TRUE); // blink
+ BlinkScript(true); // blink
if ( m_script[op] == 0 )
{
m_script[op] = new CScript(m_iMan, m_object, &m_secondaryTask);
}
- if ( !m_script[op]->ReadStack(file) ) return FALSE;
+ if ( !m_script[op]->ReadStack(file) ) return false;
}
}
- return TRUE;
+ return true;
}
// ave the script implementation stack of a file.
-BOOL CBrain::WriteStack(FILE *file)
+bool CBrain::WriteStack(FILE *file)
{
short op;
@@ -2797,7 +2797,7 @@ BOOL CBrain::WriteStack(FILE *file)
op = 0; // stop
fWrite(&op, sizeof(short), 1, file);
- return TRUE;
+ return true;
}
@@ -2938,23 +2938,23 @@ void CBrain::TraceRecordStop()
// Saves an instruction CBOT.
-BOOL CBrain::TraceRecordOper(TraceOper oper, float param)
+bool CBrain::TraceRecordOper(TraceOper oper, float param)
{
int i;
i = m_traceRecordIndex;
- if ( i >= MAXTRACERECORD ) return FALSE;
+ if ( i >= MAXTRACERECORD ) return false;
m_traceRecordBuffer[i].oper = oper;
m_traceRecordBuffer[i].param = param;
m_traceRecordIndex = i+1;
- return TRUE;
+ return true;
}
// Generates an instruction CBOT.
-BOOL CBrain::TraceRecordPut(char *buffer, int max, TraceOper oper, float param)
+bool CBrain::TraceRecordPut(char *buffer, int max, TraceOper oper, float param)
{
char line[100];
int color;
@@ -2995,6 +2995,6 @@ BOOL CBrain::TraceRecordPut(char *buffer, int max, TraceOper oper, float param)
if ( color == 10 ) strncat(buffer, "\tpendown(Brown);\n", max-1);
}
- return TRUE;
+ return true;
}
diff --git a/src/object/brain.h b/src/object/brain.h
index 348f059..11fd379 100644
--- a/src/object/brain.h
+++ b/src/object/brain.h
@@ -74,31 +74,31 @@ public:
CBrain(CInstanceManager* iMan, CObject* object);
~CBrain();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void SetPhysics(CPhysics* physics);
void SetMotion(CMotion* motion);
- BOOL EventProcess(const Event &event);
- BOOL CreateInterface(BOOL bSelect);
+ bool EventProcess(const Event &event);
+ bool CreateInterface(bool bSelect);
- BOOL Write(char *line);
- BOOL Read(char *line);
+ bool Write(char *line);
+ bool Read(char *line);
- BOOL IsBusy();
- void SetActivity(BOOL bMode);
- BOOL RetActivity();
- BOOL IsProgram();
- BOOL ProgramExist(int rank);
+ bool IsBusy();
+ void SetActivity(bool bMode);
+ bool RetActivity();
+ bool IsProgram();
+ bool ProgramExist(int rank);
void RunProgram(int rank);
int FreeProgram();
int RetProgram();
void StopProgram();
void StopTask();
- BOOL IntroduceVirus();
- void SetActiveVirus(BOOL bActive);
- BOOL RetActiveVirus();
+ bool IntroduceVirus();
+ void SetActiveVirus(bool bActive);
+ bool RetActiveVirus();
void SetScriptRun(int rank);
int RetScriptRun();
@@ -107,12 +107,12 @@ public:
void SetSoluceName(char *name);
char* RetSoluceName();
- BOOL ReadSoluce(char* filename);
- BOOL ReadProgram(int rank, char* filename);
- BOOL RetCompile(int rank);
- BOOL WriteProgram(int rank, char* filename);
- BOOL ReadStack(FILE *file);
- BOOL WriteStack(FILE *file);
+ bool ReadSoluce(char* filename);
+ bool ReadProgram(int rank, char* filename);
+ bool RetCompile(int rank);
+ bool WriteProgram(int rank, char* filename);
+ bool ReadStack(FILE *file);
+ bool WriteStack(FILE *file);
Error StartTaskTake();
Error StartTaskManip(TaskManipOrder order, TaskManipArm arm);
@@ -120,7 +120,7 @@ public:
Error StartTaskBuild(ObjectType type);
Error StartTaskSearch();
Error StartTaskTerraform();
- Error StartTaskPen(BOOL bDown, int color);
+ Error StartTaskPen(bool bDown, int color);
Error StartTaskRecover();
Error StartTaskShield(TaskShieldMode mode);
Error StartTaskFire(float delay);
@@ -132,10 +132,10 @@ public:
void UpdateInterface();
protected:
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
void StartEditScript(int rank, char* name);
- void StopEditScript(BOOL bCancel);
+ void StopEditScript(bool bCancel);
Error EndedTask();
@@ -144,18 +144,18 @@ protected:
void UpdateScript(CWindow *pw);
int RetSelScript();
- void BlinkScript(BOOL bEnable);
+ 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, 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 TraceRecordStart();
void TraceRecordFrame();
void TraceRecordStop();
- BOOL TraceRecordOper(TraceOper oper, float param);
- BOOL TraceRecordPut(char *buffer, int max, TraceOper oper, float param);
+ bool TraceRecordOper(TraceOper oper, float param);
+ bool TraceRecordPut(char *buffer, int max, TraceOper oper, float param);
protected:
CInstanceManager* m_iMan;
@@ -178,9 +178,9 @@ protected:
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;
+ bool m_bActivity;
+ bool m_bBurn;
+ bool m_bActiveVirus;
int m_scriptRun;
char m_scriptName[BRAINMAXSCRIPT][50];
@@ -206,7 +206,7 @@ protected:
int m_soundChannelAlarm;
int m_flagColor;
- BOOL m_bTraceRecord;
+ bool m_bTraceRecord;
TraceOper m_traceOper;
D3DVECTOR m_tracePos;
float m_traceAngle;
diff --git a/src/object/motion/motion.cpp b/src/object/motion/motion.cpp
index 27e5f9c..52609a9 100644
--- a/src/object/motion/motion.cpp
+++ b/src/object/motion/motion.cpp
@@ -84,7 +84,7 @@ CMotion::~CMotion()
// Deletes the object.
-void CMotion::DeleteObject(BOOL bAll)
+void CMotion::DeleteObject(bool bAll)
{
}
@@ -102,22 +102,22 @@ void CMotion::SetBrain(CBrain* brain)
// Creates.
-BOOL CMotion::Create(D3DVECTOR pos, float angle, ObjectType type, float power)
+bool CMotion::Create(D3DVECTOR pos, float angle, ObjectType type, float power)
{
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CMotion::EventProcess(const Event &event)
+bool CMotion::EventProcess(const Event &event)
{
D3DVECTOR pos, dir;
float time;
if ( m_object->RetType() != OBJECT_TOTO &&
- m_engine->RetPause() ) return TRUE;
+ m_engine->RetPause() ) return true;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_actionTime;
if ( m_progress > 1.0f ) m_progress = 1.0f; // (*)
@@ -150,7 +150,7 @@ BOOL CMotion::EventProcess(const Event &event)
dir.z = Smooth(dir.z, m_inclinaison.z, time);
m_object->SetInclinaison(dir);
- return TRUE;
+ return true;
}
// (*) Avoids the bug of ants returned by the thumper and
@@ -177,9 +177,9 @@ int CMotion::RetAction()
// Specifies a special parameter.
-BOOL CMotion::SetParam(int rank, float value)
+bool CMotion::SetParam(int rank, float value)
{
- return FALSE;
+ return false;
}
float CMotion::RetParam(int rank)
@@ -190,11 +190,11 @@ float CMotion::RetParam(int rank)
// Saves all parameters of the object.
-BOOL CMotion::Write(char *line)
+bool CMotion::Write(char *line)
{
char name[100];
- if ( m_actionType == -1 ) return FALSE;
+ if ( m_actionType == -1 ) return false;
sprintf(name, " mType=%d", m_actionType);
strcat(line, name);
@@ -205,18 +205,18 @@ BOOL CMotion::Write(char *line)
sprintf(name, " mProgress=%.2f", m_progress);
strcat(line, name);
- return FALSE;
+ return false;
}
// Restores all parameters of the object.
-BOOL CMotion::Read(char *line)
+bool CMotion::Read(char *line)
{
m_actionType = OpInt(line, "mType", -1);
m_actionTime = OpFloat(line, "mTime", 0.0f);
m_progress = OpFloat(line, "mProgress", 0.0f);
- return FALSE;
+ return false;
}
diff --git a/src/object/motion/motion.h b/src/object/motion/motion.h
index ce7b522..555fbe4 100644
--- a/src/object/motion/motion.h
+++ b/src/object/motion/motion.h
@@ -45,17 +45,17 @@ public:
void SetPhysics(CPhysics* physics);
void SetBrain(CBrain* brain);
- virtual void DeleteObject(BOOL bAll=FALSE);
- virtual BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- virtual BOOL EventProcess(const Event &event);
+ virtual void DeleteObject(bool bAll=false);
+ virtual bool Create(D3DVECTOR 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 BOOL SetParam(int rank, float value);
+ virtual bool SetParam(int rank, float value);
virtual float RetParam(int rank);
- virtual BOOL Write(char *line);
- virtual BOOL Read(char *line);
+ virtual bool Write(char *line);
+ virtual bool Read(char *line);
virtual void SetLinVibration(D3DVECTOR dir);
virtual D3DVECTOR RetLinVibration();
diff --git a/src/object/motion/motionant.cpp b/src/object/motion/motionant.cpp
index ca7505b..0f6543a 100644
--- a/src/object/motion/motionant.cpp
+++ b/src/object/motion/motionant.cpp
@@ -43,7 +43,7 @@
-#define ADJUST_ANGLE FALSE // TRUE -> adjusts the angles of the members
+#define ADJUST_ANGLE false // true -> adjusts the angles of the members
#define START_TIME 1000.0f // beginning of the relative time
@@ -61,7 +61,7 @@ CMotionAnt::CMotionAnt(CInstanceManager* iMan, CObject* object)
m_armPartIndex = 0;
m_armMemberIndex = 0;
m_armLastAction = -1;
- m_bArmStop = FALSE;
+ m_bArmStop = false;
m_lastParticule = 0.0f;
}
@@ -74,20 +74,20 @@ CMotionAnt::~CMotionAnt()
// Removes an object.
-void CMotionAnt::DeleteObject(BOOL bAll)
+void CMotionAnt::DeleteObject(bool bAll)
{
}
// Creates a vehicle poses some rolling on the floor.
-BOOL CMotionAnt::Create(D3DVECTOR pos, float angle, ObjectType type,
+bool CMotionAnt::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 3+18 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 3+18 ) return false;
pModFile = new CModFile(m_iMan);
@@ -309,7 +309,7 @@ BOOL CMotionAnt::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates the physics of the object.
@@ -430,7 +430,7 @@ void CMotionAnt::CreatePhysics()
// Management of an event.
-BOOL CMotionAnt::EventProcess(const Event &event)
+bool CMotionAnt::EventProcess(const Event &event)
{
CMotion::EventProcess(event);
@@ -469,7 +469,7 @@ BOOL CMotionAnt::EventProcess(const Event &event)
#endif
}
- return TRUE;
+ return true;
}
// Calculates a value (radians) proportional between a and b (degrees).
@@ -486,17 +486,17 @@ inline float Propf(float a, float b, float p)
// Management of an event.
-BOOL CMotionAnt::EventFrame(const Event &event)
+bool CMotionAnt::EventFrame(const Event &event)
{
D3DVECTOR dir, pos, speed;
FPOINT dim;
float s, a, prog, time;
float tSt[9], tNd[9];
int i, ii, st, nd, action;
- BOOL bStop;
+ bool bStop;
- if ( m_engine->RetPause() ) return TRUE;
- if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return true;
s = m_physics->RetLinMotionX(MO_MOTSPEED)*1.5f;
a = Abs(m_physics->RetCirMotionY(MO_MOTSPEED)*2.0f);
@@ -833,7 +833,7 @@ BOOL CMotionAnt::EventFrame(const Event &event)
if ( m_progress >= 1.0f )
{
SetAction(-1);
- m_object->SetFixed(FALSE); // moving again
+ m_object->SetFixed(false); // moving again
}
}
else
@@ -893,7 +893,7 @@ BOOL CMotionAnt::EventFrame(const Event &event)
m_object->SetAngleY(1, sinf(m_armTimeAbs*2.1f)*0.50f); // head
}
- return TRUE;
+ return true;
}
diff --git a/src/object/motion/motionant.h b/src/object/motion/motionant.h
index 4d5781a..084a9a9 100644
--- a/src/object/motion/motionant.h
+++ b/src/object/motion/motionant.h
@@ -53,13 +53,13 @@ public:
CMotionAnt(CInstanceManager* iMan, CObject* object);
~CMotionAnt();
- void DeleteObject(BOOL bAll=FALSE);
- BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- BOOL EventProcess(const Event &event);
+ void DeleteObject(bool bAll=false);
+ bool Create(D3DVECTOR pos, float angle, ObjectType type, float power);
+ bool EventProcess(const Event &event);
protected:
void CreatePhysics();
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
protected:
float m_armMember;
@@ -71,7 +71,7 @@ protected:
int m_armPartIndex;
int m_armMemberIndex;
int m_armLastAction;
- BOOL m_bArmStop;
+ bool m_bArmStop;
float m_lastParticule;
};
diff --git a/src/object/motion/motionbee.cpp b/src/object/motion/motionbee.cpp
index 21a465a..7f3da7a 100644
--- a/src/object/motion/motionbee.cpp
+++ b/src/object/motion/motionbee.cpp
@@ -43,7 +43,7 @@
-#define ADJUST_ANGLE FALSE // TRUE -> adjusts the angles of the members
+#define ADJUST_ANGLE false // true -> adjusts the angles of the members
#define START_TIME 1000.0f // beginning of the relative time
@@ -61,7 +61,7 @@ CMotionBee::CMotionBee(CInstanceManager* iMan, CObject* object)
m_armPartIndex = 0;
m_armMemberIndex = 0;
m_armLastAction = -1;
- m_bArmStop = FALSE;
+ m_bArmStop = false;
}
// Object's destructor.
@@ -73,20 +73,20 @@ CMotionBee::~CMotionBee()
// Removes an object.
-void CMotionBee::DeleteObject(BOOL bAll)
+void CMotionBee::DeleteObject(bool bAll)
{
}
// Creates a vehicle traveling any lands on the ground.
-BOOL CMotionBee::Create(D3DVECTOR pos, float angle, ObjectType type,
+bool CMotionBee::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 3+18+2 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 3+18+2 ) return false;
pModFile = new CModFile(m_iMan);
@@ -321,7 +321,7 @@ BOOL CMotionBee::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates the physical object.
@@ -407,7 +407,7 @@ void CMotionBee::CreatePhysics()
// Management of an event.
-BOOL CMotionBee::EventProcess(const Event &event)
+bool CMotionBee::EventProcess(const Event &event)
{
CMotion::EventProcess(event);
@@ -446,20 +446,20 @@ BOOL CMotionBee::EventProcess(const Event &event)
#endif
}
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CMotionBee::EventFrame(const Event &event)
+bool CMotionBee::EventFrame(const Event &event)
{
D3DVECTOR dir;
float s, a, prog;
int action, i, st, nd;
- BOOL bStop;
+ bool bStop;
- if ( m_engine->RetPause() ) return TRUE;
- if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return true;
s = m_physics->RetLinMotionX(MO_MOTSPEED)*0.30f;
a = Abs(m_physics->RetCirMotionY(MO_MOTSPEED)*2.00f);
@@ -471,7 +471,7 @@ BOOL CMotionBee::EventFrame(const Event &event)
m_armMember += (s+a)*event.rTime*0.15f;
bStop = ( a == 0.0f && s == 0.0f ); // stopped?
- if ( !m_physics->RetLand() ) bStop = TRUE;
+ if ( !m_physics->RetLand() ) bStop = true;
if ( bStop )
{
@@ -655,7 +655,7 @@ BOOL CMotionBee::EventFrame(const Event &event)
m_engine->SetObjectShadowColor(m_objectPart[0].object, color);
#endif
- return TRUE;
+ return true;
}
diff --git a/src/object/motion/motionbee.h b/src/object/motion/motionbee.h
index e73e2d3..a62f2ba 100644
--- a/src/object/motion/motionbee.h
+++ b/src/object/motion/motionbee.h
@@ -47,13 +47,13 @@ public:
CMotionBee(CInstanceManager* iMan, CObject* object);
~CMotionBee();
- void DeleteObject(BOOL bAll=FALSE);
- BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- BOOL EventProcess(const Event &event);
+ void DeleteObject(bool bAll=false);
+ bool Create(D3DVECTOR pos, float angle, ObjectType type, float power);
+ bool EventProcess(const Event &event);
protected:
void CreatePhysics();
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
protected:
float m_armMember;
@@ -65,6 +65,6 @@ protected:
int m_armPartIndex;
int m_armMemberIndex;
int m_armLastAction;
- BOOL m_bArmStop;
+ bool m_bArmStop;
};
diff --git a/src/object/motion/motionhuman.cpp b/src/object/motion/motionhuman.cpp
index c164570..02e4dd3 100644
--- a/src/object/motion/motionhuman.cpp
+++ b/src/object/motion/motionhuman.cpp
@@ -45,7 +45,7 @@
-#define ADJUST_ANGLE FALSE // TRUE -> adjusts the angles of the members
+#define ADJUST_ANGLE false // true -> adjusts the angles of the members
#define ADJUST_ACTION (3*3*3*3*MH_SPEC+3*3*3*MHS_SATCOM)
#define START_TIME 1000.0f // beginning of the relative time
@@ -66,12 +66,12 @@ CMotionHuman::CMotionHuman(CInstanceManager* iMan, CObject* object)
m_armPartIndex = 0;
m_armMemberIndex = 0;
m_armLastAction = -1;
- m_bArmStop = FALSE;
+ m_bArmStop = false;
m_lastSoundMarch = 0.0f;
m_lastSoundHhh = 0.0f;
m_time = 0.0f;
m_tired = 0.0f;
- m_bDisplayPerso = FALSE;
+ m_bDisplayPerso = false;
}
// Object's constructor.
@@ -83,7 +83,7 @@ CMotionHuman::~CMotionHuman()
// Removes an object.
-void CMotionHuman::DeleteObject(BOOL bAll)
+void CMotionHuman::DeleteObject(bool bAll)
{
if ( m_partiReactor != -1 )
{
@@ -105,14 +105,14 @@ Error CMotionHuman::SetAction(int action, float time)
// Creates cosmonaut on the ground.
-BOOL CMotionHuman::Create(D3DVECTOR pos, float angle, ObjectType type,
+bool CMotionHuman::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
char filename[100];
int rank, option, face, glasses;
- if ( m_engine->RetRestCreate() < 16 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 16 ) return false;
pModFile = new CModFile(m_iMan);
@@ -147,7 +147,7 @@ BOOL CMotionHuman::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates the main base.
@@ -371,7 +371,7 @@ BOOL CMotionHuman::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates the physical object.
@@ -664,7 +664,7 @@ void CMotionHuman::CreatePhysics(ObjectType type)
// Management of an event.
-BOOL CMotionHuman::EventProcess(const Event &event)
+bool CMotionHuman::EventProcess(const Event &event)
{
CMotion::EventProcess(event);
@@ -710,7 +710,7 @@ BOOL CMotionHuman::EventProcess(const Event &event)
#endif
}
- return TRUE;
+ return true;
}
// Calculates a value (radians) proportional between a and b (degrees).
@@ -727,7 +727,7 @@ inline float Propf(float a, float b, float p)
// Management of an event.
-BOOL CMotionHuman::EventFrame(const Event &event)
+bool CMotionHuman::EventFrame(const Event &event)
{
D3DMATRIX* mat;
D3DVECTOR dir, actual, pos, speed, pf;
@@ -737,7 +737,7 @@ BOOL CMotionHuman::EventFrame(const Event &event)
float tSt[9], tNd[9];
float aa, bb, shield, deadFactor, level;
int i, ii, st, nd, action, legAction, armAction;
- BOOL bOnBoard, bSwim, bStop;
+ bool bOnBoard, bSwim, bStop;
if ( m_engine->RetPause() )
{
@@ -747,15 +747,15 @@ BOOL CMotionHuman::EventFrame(const Event &event)
}
else
{
- return TRUE;
+ return true;
}
}
- bOnBoard = FALSE;
+ bOnBoard = false;
if ( m_object->RetSelect() &&
m_camera->RetType() == CAMERA_ONBOARD )
{
- bOnBoard = TRUE;
+ bOnBoard = true;
}
if ( m_bDisplayPerso && m_main->RetGamerOnlyHead() )
@@ -763,7 +763,7 @@ BOOL CMotionHuman::EventFrame(const Event &event)
m_time += event.rTime;
m_object->SetLinVibration(D3DVECTOR(0.0f, -0.55f, 0.0f));
m_object->SetCirVibration(D3DVECTOR(0.0f, m_main->RetPersoAngle(), 0.0f));
- return TRUE;
+ return true;
}
if ( m_bDisplayPerso )
{
@@ -1439,7 +1439,7 @@ BOOL CMotionHuman::EventFrame(const Event &event)
{
if ( m_progress >= 1.0f )
{
- m_object->SetEnable(FALSE);
+ m_object->SetEnable(false);
}
time = 100.0f;
@@ -1483,7 +1483,7 @@ BOOL CMotionHuman::EventFrame(const Event &event)
if ( prog >= 1.0f )
{
prog = 1.0f;
- if ( pos.y >= level ) m_object->SetEnable(FALSE);
+ if ( pos.y >= level ) m_object->SetEnable(false);
}
prog *= 2.0f;
@@ -1778,7 +1778,7 @@ BOOL CMotionHuman::EventFrame(const Event &event)
m_lastSoundHhh = (4.0f-m_tired*2.5f)+(4.0f-m_tired*2.5f)*Rand();
}
- return TRUE;
+ return true;
}
@@ -1786,12 +1786,12 @@ BOOL CMotionHuman::EventFrame(const Event &event)
void CMotionHuman::StartDisplayPerso()
{
- m_bDisplayPerso = TRUE;
+ m_bDisplayPerso = true;
}
void CMotionHuman::StopDisplayPerso()
{
- m_bDisplayPerso = FALSE;
+ m_bDisplayPerso = false;
}
diff --git a/src/object/motion/motionhuman.h b/src/object/motion/motionhuman.h
index 2cb685a..e563a81 100644
--- a/src/object/motion/motionhuman.h
+++ b/src/object/motion/motionhuman.h
@@ -66,9 +66,9 @@ public:
CMotionHuman(CInstanceManager* iMan, CObject* object);
~CMotionHuman();
- void DeleteObject(BOOL bAll=FALSE);
- BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- BOOL EventProcess(const Event &event);
+ void DeleteObject(bool bAll=false);
+ bool Create(D3DVECTOR pos, float angle, ObjectType type, float power);
+ bool EventProcess(const Event &event);
Error SetAction(int action, float time=0.2f);
void StartDisplayPerso();
@@ -76,7 +76,7 @@ public:
protected:
void CreatePhysics(ObjectType type);
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
protected:
int m_partiReactor;
@@ -89,11 +89,11 @@ protected:
int m_armPartIndex;
int m_armMemberIndex;
int m_armLastAction;
- BOOL m_bArmStop;
+ bool m_bArmStop;
float m_lastSoundMarch;
float m_lastSoundHhh;
float m_time;
float m_tired;
- BOOL m_bDisplayPerso;
+ bool m_bDisplayPerso;
};
diff --git a/src/object/motion/motionmother.cpp b/src/object/motion/motionmother.cpp
index 8e0073b..6db0a8b 100644
--- a/src/object/motion/motionmother.cpp
+++ b/src/object/motion/motionmother.cpp
@@ -43,7 +43,7 @@
-#define ADJUST_ANGLE FALSE // TRUE -> adjusts the angles of the members
+#define ADJUST_ANGLE false // true -> adjusts the angles of the members
#define START_TIME 1000.0f // beginning of the relative time
@@ -62,7 +62,7 @@ CMotionMother::CMotionMother(CInstanceManager* iMan, CObject* object)
m_armMemberIndex = 0;
m_armLastAction = -1;
m_specAction = -1;
- m_bArmStop = FALSE;
+ m_bArmStop = false;
}
// Object's destructor.
@@ -74,20 +74,20 @@ CMotionMother::~CMotionMother()
// Removes an object.
-void CMotionMother::DeleteObject(BOOL bAll)
+void CMotionMother::DeleteObject(bool bAll)
{
}
// Creates a vehicle traveling any lands on the ground.
-BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type,
+bool CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 2+12+6 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 2+12+6 ) return false;
pModFile = new CModFile(m_iMan);
@@ -295,7 +295,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates the physics of the object.
@@ -356,7 +356,7 @@ void CMotionMother::CreatePhysics()
// Management of an event.
-BOOL CMotionMother::EventProcess(const Event &event)
+bool CMotionMother::EventProcess(const Event &event)
{
CMotion::EventProcess(event);
@@ -395,20 +395,20 @@ BOOL CMotionMother::EventProcess(const Event &event)
#endif
}
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CMotionMother::EventFrame(const Event &event)
+bool CMotionMother::EventFrame(const Event &event)
{
D3DVECTOR dir;
float s, a, prog;
int i, st, nd;
- BOOL bStop;
+ bool bStop;
- if ( m_engine->RetPause() ) return TRUE;
- if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return true;
s = m_physics->RetLinMotionX(MO_MOTSPEED)*1.5f;
a = Abs(m_physics->RetCirMotionY(MO_MOTSPEED)*26.0f);
@@ -535,7 +535,7 @@ BOOL CMotionMother::EventFrame(const Event &event)
m_object->SetAngleY(19, sinf(m_armTimeAbs*0.9f)*0.20f); // left claw
m_object->SetAngleZ(19, -0.20f);
- return TRUE;
+ return true;
}
diff --git a/src/object/motion/motionmother.h b/src/object/motion/motionmother.h
index 3c5cb94..d3a6b2a 100644
--- a/src/object/motion/motionmother.h
+++ b/src/object/motion/motionmother.h
@@ -39,13 +39,13 @@ public:
CMotionMother(CInstanceManager* iMan, CObject* object);
~CMotionMother();
- void DeleteObject(BOOL bAll=FALSE);
- BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- BOOL EventProcess(const Event &event);
+ void DeleteObject(bool bAll=false);
+ bool Create(D3DVECTOR pos, float angle, ObjectType type, float power);
+ bool EventProcess(const Event &event);
protected:
void CreatePhysics();
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
protected:
float m_armMember;
@@ -59,6 +59,6 @@ protected:
int m_armLastAction;
int m_specAction;
float m_specTime;
- BOOL m_bArmStop;
+ bool m_bArmStop;
};
diff --git a/src/object/motion/motionspider.cpp b/src/object/motion/motionspider.cpp
index 7b51290..2671933 100644
--- a/src/object/motion/motionspider.cpp
+++ b/src/object/motion/motionspider.cpp
@@ -43,7 +43,7 @@
-#define ADJUST_ANGLE FALSE // TRUE -> adjusts the angles of the members
+#define ADJUST_ANGLE false // true -> adjusts the angles of the members
#define START_TIME 1000.0f // beginning of the relative time
@@ -61,7 +61,7 @@ CMotionSpider::CMotionSpider(CInstanceManager* iMan, CObject* object)
m_armPartIndex = 0;
m_armMemberIndex = 0;
m_armLastAction = -1;
- m_bArmStop = FALSE;
+ m_bArmStop = false;
m_lastParticule = 0.0f;
}
@@ -74,14 +74,14 @@ CMotionSpider::~CMotionSpider()
// Removes an object.
-void CMotionSpider::DeleteObject(BOOL bAll)
+void CMotionSpider::DeleteObject(bool bAll)
{
}
// Creates a vehicle traveling any lands on the ground.
-BOOL CMotionSpider::Create(D3DVECTOR pos, float angle, ObjectType type,
+bool CMotionSpider::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
@@ -112,7 +112,7 @@ BOOL CMotionSpider::Create(D3DVECTOR pos, float angle, ObjectType type,
0.0f, 0.0f, -2.0f,
};
- if ( m_engine->RetRestCreate() < 3+32+2 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 3+32+2 ) return false;
pModFile = new CModFile(m_iMan);
@@ -218,7 +218,7 @@ BOOL CMotionSpider::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates the physics of the object.
@@ -343,7 +343,7 @@ void CMotionSpider::CreatePhysics()
// Management of an event.
-BOOL CMotionSpider::EventProcess(const Event &event)
+bool CMotionSpider::EventProcess(const Event &event)
{
CMotion::EventProcess(event);
@@ -383,7 +383,7 @@ BOOL CMotionSpider::EventProcess(const Event &event)
#endif
}
- return TRUE;
+ return true;
}
// Calculates a value (radians) proportional between a and b (degrees).
@@ -400,17 +400,17 @@ inline float Propf(float a, float b, float p)
// Management of an event.
-BOOL CMotionSpider::EventFrame(const Event &event)
+bool CMotionSpider::EventFrame(const Event &event)
{
D3DVECTOR dir, pos, speed;
FPOINT dim;
float s, a, prog, time;
float tSt[12], tNd[12];
int i, ii, st, nd, action;
- BOOL bStop;
+ bool bStop;
- if ( m_engine->RetPause() ) return TRUE;
- if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return true;
s = m_physics->RetLinMotionX(MO_MOTSPEED)*1.5f;
a = Abs(m_physics->RetCirMotionY(MO_MOTSPEED)*2.0f);
@@ -738,7 +738,7 @@ BOOL CMotionSpider::EventFrame(const Event &event)
if ( m_progress >= 1.0f )
{
SetAction(-1);
- m_object->SetFixed(FALSE); // moving again
+ m_object->SetFixed(false); // moving again
}
}
else
@@ -781,7 +781,7 @@ BOOL CMotionSpider::EventFrame(const Event &event)
m_object->SetAngleY(36, -sinf(m_armTimeAbs*3.1f)*0.20f); // mandible
}
- return TRUE;
+ return true;
}
diff --git a/src/object/motion/motionspider.h b/src/object/motion/motionspider.h
index f642afe..bda769d 100644
--- a/src/object/motion/motionspider.h
+++ b/src/object/motion/motionspider.h
@@ -51,13 +51,13 @@ public:
CMotionSpider(CInstanceManager* iMan, CObject* object);
~CMotionSpider();
- void DeleteObject(BOOL bAll=FALSE);
- BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- BOOL EventProcess(const Event &event);
+ void DeleteObject(bool bAll=false);
+ bool Create(D3DVECTOR pos, float angle, ObjectType type, float power);
+ bool EventProcess(const Event &event);
protected:
void CreatePhysics();
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
protected:
float m_armMember;
@@ -69,7 +69,7 @@ protected:
int m_armPartIndex;
int m_armMemberIndex;
int m_armLastAction;
- BOOL m_bArmStop;
+ bool m_bArmStop;
float m_lastParticule;
};
diff --git a/src/object/motion/motiontoto.cpp b/src/object/motion/motiontoto.cpp
index 7ba4192..64ff021 100644
--- a/src/object/motion/motiontoto.cpp
+++ b/src/object/motion/motiontoto.cpp
@@ -54,9 +54,9 @@ CMotionToto::CMotionToto(CInstanceManager* iMan, CObject* object)
: CMotion(iMan, object)
{
m_time = 0.0f;
- m_bDisplayInfo = FALSE;
- m_bQuickPos = FALSE;
- m_bStartAction = FALSE;
+ m_bDisplayInfo = false;
+ m_bQuickPos = false;
+ m_bStartAction = false;
m_speedAction = 20.0f;
m_soundChannel = -1;
m_clownRadius = 0.0f;
@@ -78,7 +78,7 @@ CMotionToto::~CMotionToto()
// Removes an object.
-void CMotionToto::DeleteObject(BOOL bAll)
+void CMotionToto::DeleteObject(bool bAll)
{
if ( m_soundChannel != -1 )
{
@@ -90,13 +90,13 @@ void CMotionToto::DeleteObject(BOOL bAll)
// Creates a vehicle traveling any lands on the ground.
-BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
+bool CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 10 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 10 ) return false;
pModFile = new CModFile(m_iMan);
@@ -206,7 +206,7 @@ BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
@@ -216,7 +216,7 @@ void CMotionToto::StartDisplayInfo()
{
return;
//?
- m_bDisplayInfo = TRUE;
+ m_bDisplayInfo = true;
m_actionType = -1;
m_actionTime = 0.0f;
@@ -230,8 +230,8 @@ return;
void CMotionToto::StopDisplayInfo()
{
- m_bDisplayInfo = FALSE;
- m_bQuickPos = TRUE;
+ m_bDisplayInfo = false;
+ m_bQuickPos = true;
}
// Gives the position of the mouse.
@@ -244,7 +244,7 @@ void CMotionToto::SetMousePos(FPOINT pos)
// Management of an event.
-BOOL CMotionToto::EventProcess(const Event &event)
+bool CMotionToto::EventProcess(const Event &event)
{
CMotion::EventProcess(event);
@@ -253,12 +253,12 @@ BOOL CMotionToto::EventProcess(const Event &event)
return EventFrame(event);
}
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CMotionToto::EventFrame(const Event &event)
+bool CMotionToto::EventFrame(const Event &event)
{
D3DMATRIX* mat;
D3DVECTOR eye, lookat, dir, perp, nPos, aPos, pos, speed;
@@ -269,28 +269,28 @@ BOOL CMotionToto::EventFrame(const Event &event)
float progress, focus, distance, shift, verti, level, zoom;
float aAngle, nAngle, mAngle, angle, linSpeed, cirSpeed;
int sheet, i, r;
- BOOL bHidden;
+ bool bHidden;
if ( m_engine->RetPause() &&
- !m_main->RetInfoLock() ) return TRUE;
+ !m_main->RetInfoLock() ) return true;
if ( m_bDisplayInfo ) // "looks" mouse?
{
- bHidden = FALSE;
+ bHidden = false;
}
else
{
- bHidden = FALSE;
+ bHidden = false;
if ( m_main->RetMovieLock() ) // current movie?
{
- bHidden = TRUE;
+ bHidden = true;
}
if ( !m_engine->RetTotoMode() )
{
if ( !m_main->RetEditLock() ) // current edition?
{
- bHidden = TRUE;
+ bHidden = true;
}
}
}
@@ -298,10 +298,10 @@ BOOL CMotionToto::EventFrame(const Event &event)
if ( bHidden )
{
nPos = m_object->RetPosition(0);
- m_terrain->MoveOnFloor(nPos, TRUE);
+ m_terrain->MoveOnFloor(nPos, true);
nPos.y -= 100.0f; // hidden under the ground!
m_object->SetPosition(0, nPos);
- return TRUE;
+ return true;
}
m_time += event.rTime;
@@ -442,7 +442,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
if ( m_bQuickPos ) // immediately in place?
{
- m_bQuickPos = FALSE;
+ m_bQuickPos = false;
linSpeed = 0.0f;
}
else
@@ -456,7 +456,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
{
if ( m_bStartAction )
{
- m_bStartAction = FALSE;
+ m_bStartAction = false;
m_speedAction = Length(nPos, aPos)/15.0f;
if ( m_speedAction < 20.0f ) m_speedAction = 20.0f;
}
@@ -809,7 +809,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
}
//? if ( m_bDisplayInfo && m_main->RetGlint() )
- if ( FALSE )
+ if ( false )
{
pos.x = (Rand()-0.5f)*1.4f;
pos.y = (Rand()-0.5f)*1.4f+3.5f;
@@ -846,7 +846,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -858,7 +858,7 @@ Error CMotionToto::SetAction(int action, float time)
CMotion::SetAction(action, time);
- m_bStartAction = TRUE;
+ m_bStartAction = true;
sound = SOUND_CLICK;
if ( action == MT_ERROR ) sound = SOUND_ERROR;
diff --git a/src/object/motion/motiontoto.h b/src/object/motion/motiontoto.h
index 3549638..1c7f871 100644
--- a/src/object/motion/motiontoto.h
+++ b/src/object/motion/motiontoto.h
@@ -46,9 +46,9 @@ public:
CMotionToto(CInstanceManager* iMan, CObject* object);
~CMotionToto();
- void DeleteObject(BOOL bAll=FALSE);
- BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- BOOL EventProcess(const Event &event);
+ void DeleteObject(bool bAll=false);
+ bool Create(D3DVECTOR pos, float angle, ObjectType type, float power);
+ bool EventProcess(const Event &event);
Error SetAction(int action, float time=0.2f);
void SetLinkType(ObjectType type);
@@ -57,14 +57,14 @@ public:
void SetMousePos(FPOINT pos);
protected:
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
protected:
float m_time;
float m_lastMotorParticule;
- BOOL m_bDisplayInfo;
- BOOL m_bQuickPos;
- BOOL m_bStartAction;
+ bool m_bDisplayInfo;
+ bool m_bQuickPos;
+ bool m_bStartAction;
float m_speedAction;
float m_clownRadius;
float m_clownDelay;
diff --git a/src/object/motion/motionvehicle.cpp b/src/object/motion/motionvehicle.cpp
index 61b4db5..56eab8d 100644
--- a/src/object/motion/motionvehicle.cpp
+++ b/src/object/motion/motionvehicle.cpp
@@ -74,9 +74,9 @@ CMotionVehicle::CMotionVehicle(CInstanceManager* iMan, CObject* object)
m_wheelLastPos = D3DVECTOR(0.0f, 0.0f, 0.0f);
m_wheelLastAngle = D3DVECTOR(0.0f, 0.0f, 0.0f);
m_posKey = D3DVECTOR(0.0f, 0.0f, 0.0f);
- m_bFlyFix = FALSE;
+ m_bFlyFix = false;
- m_bTraceDown = FALSE;
+ m_bTraceDown = false;
m_traceColor = 1; // black
m_traceWidth = 0.5f;
}
@@ -90,7 +90,7 @@ CMotionVehicle::~CMotionVehicle()
// Removes an object.
-void CMotionVehicle::DeleteObject(BOOL bAll)
+void CMotionVehicle::DeleteObject(bool bAll)
{
if ( m_partiReactor != -1 )
{
@@ -102,7 +102,7 @@ void CMotionVehicle::DeleteObject(BOOL bAll)
// Creates a vehicle traveling any lands on the ground.
-BOOL CMotionVehicle::Create(D3DVECTOR pos, float angle, ObjectType type,
+bool CMotionVehicle::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
@@ -111,7 +111,7 @@ BOOL CMotionVehicle::Create(D3DVECTOR pos, float angle, ObjectType type,
D3DCOLORVALUE color;
char name[50];
- if ( m_engine->RetRestCreate() < 1+5+18+1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1+5+18+1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -1075,7 +1075,7 @@ BOOL CMotionVehicle::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates the physics of the object.
@@ -1364,7 +1364,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type)
// Management of an event.
-BOOL CMotionVehicle::EventProcess(const Event &event)
+bool CMotionVehicle::EventProcess(const Event &event)
{
CMotion::EventProcess(event);
@@ -1377,12 +1377,12 @@ BOOL CMotionVehicle::EventProcess(const Event &event)
{
}
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CMotionVehicle::EventFrame(const Event &event)
+bool CMotionVehicle::EventFrame(const Event &event)
{
D3DMATRIX* mat;
Character* character;
@@ -1391,8 +1391,8 @@ BOOL CMotionVehicle::EventFrame(const Event &event)
float s, a, speedBL, speedBR, speedFL, speedFR, h, a1, a2;
float back, front, dist, radius, limit[2];
- if ( m_engine->RetPause() ) return TRUE;
- if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return true;
type = m_object->RetType();
@@ -1705,12 +1705,12 @@ BOOL CMotionVehicle::EventFrame(const Event &event)
EventFrameCanoni(event);
}
- return TRUE;
+ return true;
}
// Managing an event for a flying robot.
-BOOL CMotionVehicle::EventFrameFly(const Event &event)
+bool CMotionVehicle::EventFrameFly(const Event &event)
{
D3DMATRIX* mat;
D3DVECTOR pos, angle, paw[3];
@@ -1725,7 +1725,7 @@ BOOL CMotionVehicle::EventFrameFly(const Event &event)
pos.z == m_wheelLastPos.z &&
angle.x == m_wheelLastAngle.x &&
angle.y == m_wheelLastAngle.y &&
- angle.z == m_wheelLastAngle.z ) return TRUE;
+ angle.z == m_wheelLastAngle.z ) return true;
m_wheelLastPos = pos;
m_wheelLastAngle = angle;
@@ -1753,29 +1753,29 @@ BOOL CMotionVehicle::EventFrameFly(const Event &event)
hope[2] = 0.0f; // left back
}
- m_bFlyFix = TRUE;
+ m_bFlyFix = true;
for ( i=0 ; i<3 ; i++ )
{
actual = m_object->RetAngleZ(6+i);
final = Smooth(actual, hope[i], event.rTime*5.0f);
if ( final != actual )
{
- m_bFlyFix = FALSE; // it is moving
+ m_bFlyFix = false; // it is moving
m_object->SetAngleZ(6+i, final);
}
}
- return TRUE;
+ return true;
}
// Event management for insect legs.
-BOOL CMotionVehicle::EventFrameInsect(const Event &event)
+bool CMotionVehicle::EventFrameInsect(const Event &event)
{
D3DVECTOR dir;
float s, a, prog, time;
int i, st, nd, action;
- BOOL bStop, bOnBoard;
+ bool bStop, bOnBoard;
static int table[] =
{
@@ -1797,11 +1797,11 @@ BOOL CMotionVehicle::EventFrameInsect(const Event &event)
-50,0,0, -65,0,0, -65,0,0, // s0: feet 1..4
};
- bOnBoard = FALSE;
+ bOnBoard = false;
if ( m_object->RetSelect() &&
m_camera->RetType() == CAMERA_ONBOARD )
{
- bOnBoard = TRUE;
+ bOnBoard = true;
}
s = m_physics->RetLinMotionX(MO_MOTSPEED)*1.5f;
@@ -1917,25 +1917,25 @@ BOOL CMotionVehicle::EventFrameInsect(const Event &event)
SetInclinaison(dir);
}
- return TRUE;
+ return true;
}
// Event management for a insect cannon.
-BOOL CMotionVehicle::EventFrameCanoni(const Event &event)
+bool CMotionVehicle::EventFrameCanoni(const Event &event)
{
CObject* power;
D3DVECTOR pos, speed;
FPOINT dim;
float zoom, angle, energy, factor;
- BOOL bOnBoard = FALSE;
+ bool bOnBoard = false;
m_canonTime += event.rTime;
if ( m_object->RetSelect() &&
m_camera->RetType() == CAMERA_ONBOARD )
{
- bOnBoard = TRUE;
+ bOnBoard = true;
}
power = m_object->RetPower();
@@ -1947,7 +1947,7 @@ BOOL CMotionVehicle::EventFrameCanoni(const Event &event)
{
energy = power->RetEnergy();
}
- if ( energy == 0.0f ) return TRUE;
+ if ( energy == 0.0f ) return true;
factor = 0.5f+energy*0.5f;
if ( bOnBoard ) factor *= 0.8f;
@@ -1992,7 +1992,7 @@ BOOL CMotionVehicle::EventFrameCanoni(const Event &event)
}
#endif
- return TRUE;
+ return true;
}
@@ -2056,12 +2056,12 @@ void CMotionVehicle::UpdateTrackMapping(float left, float right, ObjectType type
// State management of the pencil drawing robot.
-BOOL CMotionVehicle::RetTraceDown()
+bool CMotionVehicle::RetTraceDown()
{
return m_bTraceDown;
}
-void CMotionVehicle::SetTraceDown(BOOL bDown)
+void CMotionVehicle::SetTraceDown(bool bDown)
{
m_bTraceDown = bDown;
}
diff --git a/src/object/motion/motionvehicle.h b/src/object/motion/motionvehicle.h
index 23e6ebc..b9ac0c9 100644
--- a/src/object/motion/motionvehicle.h
+++ b/src/object/motion/motionvehicle.h
@@ -39,12 +39,12 @@ public:
CMotionVehicle(CInstanceManager* iMan, CObject* object);
~CMotionVehicle();
- void DeleteObject(BOOL bAll=FALSE);
- BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- BOOL EventProcess(const Event &event);
+ void DeleteObject(bool bAll=false);
+ bool Create(D3DVECTOR pos, float angle, ObjectType type, float power);
+ bool EventProcess(const Event &event);
- BOOL RetTraceDown();
- void SetTraceDown(BOOL bDown);
+ bool RetTraceDown();
+ void SetTraceDown(bool bDown);
int RetTraceColor();
void SetTraceColor(int color);
float RetTraceWidth();
@@ -52,10 +52,10 @@ public:
protected:
void CreatePhysics(ObjectType type);
- BOOL EventFrame(const Event &event);
- BOOL EventFrameFly(const Event &event);
- BOOL EventFrameInsect(const Event &event);
- BOOL EventFrameCanoni(const Event &event);
+ bool EventFrame(const Event &event);
+ bool EventFrameFly(const Event &event);
+ bool EventFrameInsect(const Event &event);
+ bool EventFrameCanoni(const Event &event);
void UpdateTrackMapping(float left, float right, ObjectType type);
protected:
@@ -71,8 +71,8 @@ protected:
D3DVECTOR m_wheelLastPos;
D3DVECTOR m_wheelLastAngle;
D3DVECTOR m_posKey;
- BOOL m_bFlyFix;
- BOOL m_bTraceDown;
+ bool m_bFlyFix;
+ bool m_bTraceDown;
int m_traceColor;
float m_traceWidth;
};
diff --git a/src/object/motion/motionworm.cpp b/src/object/motion/motionworm.cpp
index 03c6a12..dc33e6e 100644
--- a/src/object/motion/motionworm.cpp
+++ b/src/object/motion/motionworm.cpp
@@ -69,7 +69,7 @@ CMotionWorm::CMotionWorm(CInstanceManager* iMan, CObject* object)
m_armLastAction = -1;
m_specAction = -1;
m_lastParticule = 0.0f;
- m_bArmStop = FALSE;
+ m_bArmStop = false;
}
// Object's destructor.
@@ -81,21 +81,21 @@ CMotionWorm::~CMotionWorm()
// Removes an object.
-void CMotionWorm::DeleteObject(BOOL bAll)
+void CMotionWorm::DeleteObject(bool bAll)
{
}
// Creates a vehicle traveling any lands on the ground.
-BOOL CMotionWorm::Create(D3DVECTOR pos, float angle, ObjectType type,
+bool CMotionWorm::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
int rank, i;
float px;
- if ( m_engine->RetRestCreate() < 2+WORM_PART+1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 2+WORM_PART+1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -159,7 +159,7 @@ BOOL CMotionWorm::Create(D3DVECTOR pos, float angle, ObjectType type,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates the physics of the object.
@@ -199,21 +199,21 @@ void CMotionWorm::CreatePhysics()
// Specifies a special parameter.
-BOOL CMotionWorm::SetParam(int rank, float value)
+bool CMotionWorm::SetParam(int rank, float value)
{
if ( rank == 0 )
{
m_timeDown = value;
- return TRUE;
+ return true;
}
if ( rank == 1 )
{
m_timeUp = value;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
float CMotionWorm::RetParam(int rank)
@@ -227,7 +227,7 @@ float CMotionWorm::RetParam(int rank)
// Management of an event.
-BOOL CMotionWorm::EventProcess(const Event &event)
+bool CMotionWorm::EventProcess(const Event &event)
{
CMotion::EventProcess(event);
@@ -240,12 +240,12 @@ BOOL CMotionWorm::EventProcess(const Event &event)
{
}
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CMotionWorm::EventFrame(const Event &event)
+bool CMotionWorm::EventFrame(const Event &event)
{
D3DMATRIX* mat;
D3DVECTOR pos, p, angle, speed;
@@ -254,7 +254,7 @@ BOOL CMotionWorm::EventFrame(const Event &event)
float floor, a, s, px, curve, phase, h, zoom, radius;
int i, under;
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
s = m_physics->RetLinMotionX(MO_MOTSPEED)/m_physics->RetLinMotionX(MO_ADVSPEED);
a = m_physics->RetCirMotionY(MO_MOTSPEED)/m_physics->RetCirMotionY(MO_ADVSPEED);
@@ -297,10 +297,10 @@ BOOL CMotionWorm::EventFrame(const Event &event)
}
m_object->SetVisible(under!=WORM_PART+2);
- if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return TRUE;
+ if ( !m_engine->IsVisiblePoint(m_object->RetPosition(0)) ) return true;
pos = m_object->RetPosition(0);
- floor = m_terrain->RetFloorLevel(pos, TRUE);
+ floor = m_terrain->RetFloorLevel(pos, true);
mat = m_object->RetWorldMatrix(0);
@@ -328,7 +328,7 @@ BOOL CMotionWorm::EventFrame(const Event &event)
pos.z = pp.y;
p = Transform(*mat, pos);
- pos.y += m_terrain->RetFloorLevel(p, TRUE)-floor;
+ pos.y += m_terrain->RetFloorLevel(p, true)-floor;
m_object->SetPosition(i+1, pos);
zoom = Mod(m_armTimeAbs*0.5f+100.0f-i*0.1f, 2.0f);
@@ -372,7 +372,7 @@ BOOL CMotionWorm::EventFrame(const Event &event)
}
}
- return TRUE;
+ return true;
}
diff --git a/src/object/motion/motionworm.h b/src/object/motion/motionworm.h
index 3422e49..6dca520 100644
--- a/src/object/motion/motionworm.h
+++ b/src/object/motion/motionworm.h
@@ -39,16 +39,16 @@ public:
CMotionWorm(CInstanceManager* iMan, CObject* object);
~CMotionWorm();
- void DeleteObject(BOOL bAll=FALSE);
- BOOL Create(D3DVECTOR pos, float angle, ObjectType type, float power);
- BOOL EventProcess(const Event &event);
+ void DeleteObject(bool bAll=false);
+ bool Create(D3DVECTOR pos, float angle, ObjectType type, float power);
+ bool EventProcess(const Event &event);
- BOOL SetParam(int rank, float value);
+ bool SetParam(int rank, float value);
float RetParam(int rank);
protected:
void CreatePhysics();
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
protected:
float m_timeUp;
@@ -66,7 +66,7 @@ protected:
float m_armCirSpeed;
int m_specAction;
float m_specTime;
- BOOL m_bArmStop;
+ bool m_bArmStop;
float m_lastParticule;
};
diff --git a/src/object/object.cpp b/src/object/object.cpp
index 8e3818e..9fb7ae8 100644
--- a/src/object/object.cpp
+++ b/src/object/object.cpp
@@ -90,8 +90,8 @@
-#define ADJUST_ONBOARD FALSE // TRUE -> adjusts the camera ONBOARD
-#define ADJUST_ARM FALSE // TRUE -> adjusts the manipulator arm
+#define ADJUST_ONBOARD false // true -> adjusts the camera ONBOARD
+#define ADJUST_ARM false // true -> adjusts the manipulator arm
#define VIRUS_DELAY 60.0f // duration of virus infection
#define LOSS_SHIELD 0.24f // loss of the shield by shot
#define LOSS_SHIELD_H 0.10f // loss of the shield for humans
@@ -262,33 +262,33 @@ CObject::CObject(CInstanceManager* iMan)
m_range = 0.0f;
m_transparency = 0.0f;
m_lastEnergy = 999.9f;
- m_bHilite = FALSE;
- m_bSelect = FALSE;
- m_bSelectable = TRUE;
- m_bCheckToken = TRUE;
- m_bVisible = TRUE;
- m_bEnable = TRUE;
- m_bGadget = FALSE;
- m_bProxyActivate = FALSE;
- m_bTrainer = FALSE;
- m_bToy = FALSE;
- m_bManual = FALSE;
- m_bFixed = FALSE;
- m_bClip = TRUE;
- m_bShowLimit = FALSE;
+ m_bHilite = false;
+ m_bSelect = false;
+ m_bSelectable = true;
+ m_bCheckToken = true;
+ m_bVisible = true;
+ m_bEnable = true;
+ m_bGadget = false;
+ m_bProxyActivate = false;
+ m_bTrainer = false;
+ m_bToy = false;
+ m_bManual = false;
+ m_bFixed = false;
+ m_bClip = true;
+ m_bShowLimit = false;
m_showLimitRadius = 0.0f;
m_aTime = 0.0f;
m_shotTime = 0.0f;
- m_bVirusMode = FALSE;
+ m_bVirusMode = false;
m_virusTime = 0.0f;
m_lastVirusParticule = 0.0f;
m_totalDesectList = 0;
- m_bLock = FALSE;
- m_bExplo = FALSE;
- m_bCargo = FALSE;
- m_bBurn = FALSE;
- m_bDead = FALSE;
- m_bFlat = FALSE;
+ m_bLock = false;
+ m_bExplo = false;
+ m_bCargo = false;
+ m_bBurn = false;
+ m_bDead = false;
+ m_bFlat = false;
m_gunGoalV = 0.0f;
m_gunGoalH = 0.0f;
m_shieldRadius = 0.0f;
@@ -304,22 +304,22 @@ CObject::CObject(CInstanceManager* iMan)
m_character.wheelRight = 1.0f;
m_resetCap = RESET_NONE;
- m_bResetBusy = FALSE;
+ m_bResetBusy = false;
m_resetPosition = D3DVECTOR(0.0f, 0.0f, 0.0f);
m_resetAngle = D3DVECTOR(0.0f, 0.0f, 0.0f);
m_resetRun = -1;
m_cameraType = CAMERA_BACK;
m_cameraDist = 50.0f;
- m_bCameraLock = FALSE;
+ m_bCameraLock = false;
m_infoTotal = 0;
m_infoReturn = NAN;
- m_bInfoUpdate = FALSE;
+ m_bInfoUpdate = false;
for ( i=0 ; i<OBJECTMAXPART ; i++ )
{
- m_objectPart[i].bUsed = FALSE;
+ m_objectPart[i].bUsed = false;
}
m_totalPart = 0;
@@ -370,10 +370,10 @@ CObject::~CObject()
// Removes an object.
-// If bAll = TRUE, it does not help,
+// If bAll = true, it does not help,
// because all objects in the scene are quickly destroyed!
-void CObject::DeleteObject(BOOL bAll)
+void CObject::DeleteObject(bool bAll)
{
CObject* pObj;
CPyro* pPyro;
@@ -430,7 +430,7 @@ void CObject::DeleteObject(BOOL bAll)
if ( m_bSelect )
{
- SetSelect(FALSE);
+ SetSelect(false);
}
if ( m_type == OBJECT_BASE ||
@@ -501,7 +501,7 @@ void CObject::DeleteObject(BOOL bAll)
{
if ( m_objectPart[i].bUsed )
{
- m_objectPart[i].bUsed = FALSE;
+ m_objectPart[i].bUsed = false;
m_engine->DeleteObject(m_objectPart[i].object);
if ( m_objectPart[i].masterParti != -1 )
@@ -515,7 +515,7 @@ void CObject::DeleteObject(BOOL bAll)
if ( m_bShowLimit )
{
m_main->FlushShowLimit(0);
- m_bShowLimit = FALSE;
+ m_bShowLimit = false;
}
if ( !bAll ) m_main->CreateShortcuts();
@@ -564,10 +564,10 @@ void CObject::Simplify()
// Detonates an object, when struck by a shot.
-// If FALSE is returned, the object is still screwed.
-// If TRUE is returned, the object is destroyed.
+// If false is returned, the object is still screwed.
+// If true is returned, the object is destroyed.
-BOOL CObject::ExploObject(ExploType type, float force, float decay)
+bool CObject::ExploObject(ExploType type, float force, float decay)
{
PyroType pyroType;
CPyro* pyro;
@@ -597,11 +597,11 @@ BOOL CObject::ExploObject(ExploType type, float force, float decay)
if ( EXPLO_BOUM )
{
- if ( m_shotTime < 0.5f ) return FALSE;
+ if ( m_shotTime < 0.5f ) return false;
m_shotTime = 0.0f;
}
- if ( m_type == OBJECT_HUMAN && m_bDead ) return FALSE;
+ if ( m_type == OBJECT_HUMAN && m_bDead ) return false;
// Calculate the power lost by the explosion.
if ( force == 0.0f )
@@ -673,7 +673,7 @@ BOOL CObject::ExploObject(ExploType type, float force, float decay)
m_type == OBJECT_BULLET )
{
pyroType = PT_BURNO;
- SetBurn(TRUE);
+ SetBurn(true);
}
else if ( m_type == OBJECT_HUMAN )
{
@@ -682,9 +682,9 @@ BOOL CObject::ExploObject(ExploType type, float force, float decay)
else
{
pyroType = PT_BURNT;
- SetBurn(TRUE);
+ SetBurn(true);
}
- SetVirusMode(FALSE);
+ SetVirusMode(false);
}
else if ( type == EXPLO_WATER )
{
@@ -766,11 +766,11 @@ BOOL CObject::ExploObject(ExploType type, float force, float decay)
m_main->SaveOneScript(this);
}
- if ( shield > 0.0f ) return FALSE; // not dead yet
+ if ( shield > 0.0f ) return false; // not dead yet
if ( RetSelect() )
{
- SetSelect(FALSE); // deselects the object
+ SetSelect(false); // deselects the object
m_camera->SetType(CAMERA_EXPLO);
m_main->DeselectAll();
}
@@ -796,7 +796,7 @@ BOOL CObject::ExploObject(ExploType type, float force, float decay)
}
}
- return TRUE;
+ return true;
}
// (*) If a robot or cosmonaut dies, the subject must continue to exist,
@@ -807,7 +807,7 @@ BOOL CObject::ExploObject(ExploType type, float force, float decay)
void CObject::InitPart(int part)
{
- m_objectPart[part].bUsed = TRUE;
+ m_objectPart[part].bUsed = true;
m_objectPart[part].object = -1;
m_objectPart[part].parentPart = -1;
@@ -817,9 +817,9 @@ void CObject::InitPart(int part)
m_objectPart[part].angle.z = 0.0f;
m_objectPart[part].zoom = D3DVECTOR(1.0f, 1.0f, 1.0f);
- m_objectPart[part].bTranslate = TRUE;
- m_objectPart[part].bRotate = TRUE;
- m_objectPart[part].bZoom = FALSE;
+ m_objectPart[part].bTranslate = true;
+ m_objectPart[part].bRotate = true;
+ m_objectPart[part].bZoom = false;
D3DUtil_SetIdentityMatrix(m_objectPart[part].matTranslate);
D3DUtil_SetIdentityMatrix(m_objectPart[part].matRotate);
@@ -859,7 +859,7 @@ void CObject::DeletePart(int part)
m_objectPart[part].masterParti = -1;
}
- m_objectPart[part].bUsed = FALSE;
+ m_objectPart[part].bUsed = false;
m_engine->DeleteObject(m_objectPart[part].object);
UpdateTotalPart();
}
@@ -988,7 +988,7 @@ int CObject::RetID()
// Saves all the parameters of the object.
-BOOL CObject::Write(char *line)
+bool CObject::Write(char *line)
{
D3DVECTOR pos;
Info info;
@@ -1161,12 +1161,12 @@ BOOL CObject::Write(char *line)
m_auto->Write(line);
}
- return TRUE;
+ return true;
}
// Returns all parameters of the object.
-BOOL CObject::Read(char *line)
+bool CObject::Read(char *line)
{
D3DVECTOR pos, dir;
Info info;
@@ -1251,7 +1251,7 @@ BOOL CObject::Read(char *line)
m_auto->Read(line);
}
- return TRUE;
+ return true;
}
@@ -1309,13 +1309,13 @@ int CObject::RetCrashSphereTotal()
// Returns a sphere for collisions.
// The position is absolute in the world.
-BOOL CObject::GetCrashSphere(int rank, D3DVECTOR &pos, float &radius)
+bool CObject::GetCrashSphere(int rank, D3DVECTOR &pos, float &radius)
{
if ( rank < 0 || rank >= m_crashSphereUsed )
{
pos = m_objectPart[0].position;
radius = 0.0f;
- return FALSE;
+ return false;
}
// Returns to the sphere collisions,
@@ -1329,7 +1329,7 @@ BOOL CObject::GetCrashSphere(int rank, D3DVECTOR &pos, float &radius)
{
pos = m_objectPart[0].position + m_crashSpherePos[0];
radius = m_crashSphereRadius[0];
- return TRUE;
+ return true;
}
if ( m_objectPart[0].bTranslate ||
@@ -1339,7 +1339,7 @@ BOOL CObject::GetCrashSphere(int rank, D3DVECTOR &pos, float &radius)
}
pos = Transform(m_objectPart[0].matWorld, m_crashSpherePos[rank]);
radius = m_crashSphereRadius[rank];
- return TRUE;
+ return true;
}
// Returns the hardness of a sphere.
@@ -1440,7 +1440,7 @@ void CObject::SetFloorHeight(float height)
}
m_objectPart[0].position.y = pos.y+height+m_character.height;
- m_objectPart[0].bTranslate = TRUE; // it will recalculate the matrices
+ m_objectPart[0].bTranslate = true; // it will recalculate the matrices
}
// Adjust the inclination of an object laying on the ground.
@@ -1477,7 +1477,7 @@ void CObject::SetLinVibration(D3DVECTOR dir)
m_linVibration.z != dir.z )
{
m_linVibration = dir;
- m_objectPart[0].bTranslate = TRUE;
+ m_objectPart[0].bTranslate = true;
}
}
@@ -1495,7 +1495,7 @@ void CObject::SetCirVibration(D3DVECTOR dir)
m_cirVibration.z != dir.z )
{
m_cirVibration = dir;
- m_objectPart[0].bRotate = TRUE;
+ m_objectPart[0].bRotate = true;
}
}
@@ -1513,7 +1513,7 @@ void CObject::SetInclinaison(D3DVECTOR dir)
m_inclinaison.z != dir.z )
{
m_inclinaison = dir;
- m_objectPart[0].bRotate = TRUE;
+ m_objectPart[0].bRotate = true;
}
}
@@ -1532,14 +1532,14 @@ void CObject::SetPosition(int part, const D3DVECTOR &pos)
int rank, i, j;
m_objectPart[part].position = pos;
- m_objectPart[part].bTranslate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bTranslate = true; // it will recalculate the matrices
if ( part == 0 && !m_bFlat ) // main part?
{
rank = m_objectPart[0].object;
shPos = pos;
- m_terrain->MoveOnFloor(shPos, TRUE);
+ m_terrain->MoveOnFloor(shPos, true);
m_engine->SetObjectShadowPos(rank, shPos);
if ( m_physics != 0 && m_physics->RetType() == TYPE_FLYING )
@@ -1654,7 +1654,7 @@ D3DVECTOR CObject::RetPosition(int part)
void CObject::SetAngle(int part, const D3DVECTOR &angle)
{
m_objectPart[part].angle = angle;
- m_objectPart[part].bRotate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bRotate = true; // it will recalculate the matrices
if ( part == 0 && !m_bFlat ) // main part?
{
@@ -1672,7 +1672,7 @@ D3DVECTOR CObject::RetAngle(int part)
void CObject::SetAngleY(int part, float angle)
{
m_objectPart[part].angle.y = angle;
- m_objectPart[part].bRotate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bRotate = true; // it will recalculate the matrices
if ( part == 0 && !m_bFlat ) // main part?
{
@@ -1685,7 +1685,7 @@ void CObject::SetAngleY(int part, float angle)
void CObject::SetAngleX(int part, float angle)
{
m_objectPart[part].angle.x = angle;
- m_objectPart[part].bRotate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bRotate = true; // it will recalculate the matrices
}
// Gives the rotation about the axis Z.
@@ -1693,7 +1693,7 @@ void CObject::SetAngleX(int part, float angle)
void CObject::SetAngleZ(int part, float angle)
{
m_objectPart[part].angle.z = angle;
- m_objectPart[part].bRotate = TRUE; //it will recalculate the matrices
+ m_objectPart[part].bRotate = true; //it will recalculate the matrices
}
float CObject::RetAngleY(int part)
@@ -1716,7 +1716,7 @@ float CObject::RetAngleZ(int part)
void CObject::SetZoom(int part, float zoom)
{
- m_objectPart[part].bTranslate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bTranslate = true; // it will recalculate the matrices
m_objectPart[part].zoom.x = zoom;
m_objectPart[part].zoom.y = zoom;
m_objectPart[part].zoom.z = zoom;
@@ -1728,7 +1728,7 @@ void CObject::SetZoom(int part, float zoom)
void CObject::SetZoom(int part, D3DVECTOR zoom)
{
- m_objectPart[part].bTranslate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bTranslate = true; // it will recalculate the matrices
m_objectPart[part].zoom = zoom;
m_objectPart[part].bZoom = ( m_objectPart[part].zoom.x != 1.0f ||
@@ -1743,7 +1743,7 @@ D3DVECTOR CObject::RetZoom(int part)
void CObject::SetZoomX(int part, float zoom)
{
- m_objectPart[part].bTranslate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bTranslate = true; // it will recalculate the matrices
m_objectPart[part].zoom.x = zoom;
m_objectPart[part].bZoom = ( m_objectPart[part].zoom.x != 1.0f ||
@@ -1753,7 +1753,7 @@ void CObject::SetZoomX(int part, float zoom)
void CObject::SetZoomY(int part, float zoom)
{
- m_objectPart[part].bTranslate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bTranslate = true; // it will recalculate the matrices
m_objectPart[part].zoom.y = zoom;
m_objectPart[part].bZoom = ( m_objectPart[part].zoom.x != 1.0f ||
@@ -1763,7 +1763,7 @@ void CObject::SetZoomY(int part, float zoom)
void CObject::SetZoomZ(int part, float zoom)
{
- m_objectPart[part].bTranslate = TRUE; // it will recalculate the matrices
+ m_objectPart[part].bTranslate = true; // it will recalculate the matrices
m_objectPart[part].zoom.z = zoom;
m_objectPart[part].bZoom = ( m_objectPart[part].zoom.x != 1.0f ||
@@ -1795,7 +1795,7 @@ float CObject::RetWaterLevel()
}
-void CObject::SetTrainer(BOOL bEnable)
+void CObject::SetTrainer(bool bEnable)
{
m_bTrainer = bEnable;
@@ -1805,27 +1805,27 @@ void CObject::SetTrainer(BOOL bEnable)
}
}
-BOOL CObject::RetTrainer()
+bool CObject::RetTrainer()
{
return m_bTrainer;
}
-void CObject::SetToy(BOOL bEnable)
+void CObject::SetToy(bool bEnable)
{
m_bToy = bEnable;
}
-BOOL CObject::RetToy()
+bool CObject::RetToy()
{
return m_bToy;
}
-void CObject::SetManual(BOOL bManual)
+void CObject::SetManual(bool bManual)
{
m_bManual = bManual;
}
-BOOL CObject::RetManual()
+bool CObject::RetManual()
{
return m_bManual;
}
@@ -1840,12 +1840,12 @@ ResetCap CObject::RetResetCap()
return m_resetCap;
}
-void CObject::SetResetBusy(BOOL bBusy)
+void CObject::SetResetBusy(bool bBusy)
{
m_bResetBusy = bBusy;
}
-BOOL CObject::RetResetBusy()
+bool CObject::RetResetBusy()
{
return m_bResetBusy;
}
@@ -1951,7 +1951,7 @@ int CObject::RetTruckPart()
void CObject::InfoFlush()
{
m_infoTotal = 0;
- m_bInfoUpdate = TRUE;
+ m_bInfoUpdate = true;
}
void CObject::DeleteInfo(int rank)
@@ -1965,7 +1965,7 @@ void CObject::DeleteInfo(int rank)
m_info[i] = m_info[i+1];
}
m_infoTotal --;
- m_bInfoUpdate = TRUE;
+ m_bInfoUpdate = true;
}
void CObject::SetInfo(int rank, Info info)
@@ -1974,7 +1974,7 @@ void CObject::SetInfo(int rank, Info info)
m_info[rank] = info;
if ( rank+1 > m_infoTotal ) m_infoTotal = rank+1;
- m_bInfoUpdate = TRUE;
+ m_bInfoUpdate = true;
}
Info CObject::RetInfo(int rank)
@@ -1998,22 +1998,22 @@ float CObject::RetInfoReturn()
return m_infoReturn;
}
-void CObject::SetInfoUpdate(BOOL bUpdate)
+void CObject::SetInfoUpdate(bool bUpdate)
{
m_bInfoUpdate = bUpdate;
}
-BOOL CObject::RetInfoUpdate()
+bool CObject::RetInfoUpdate()
{
return m_bInfoUpdate;
}
-BOOL CObject::SetCmdLine(int rank, float value)
+bool CObject::SetCmdLine(int rank, float value)
{
- if ( rank < 0 || rank >= OBJECTMAXCMDLINE ) return FALSE;
+ if ( rank < 0 || rank >= OBJECTMAXCMDLINE ) return false;
m_cmdLine[rank] = value;
- return TRUE;
+ return true;
}
float CObject::RetCmdLine(int rank)
@@ -2054,7 +2054,7 @@ D3DMATRIX* CObject::RetWorldMatrix(int part)
// Indicates whether the object should be drawn below the interface.
-void CObject::SetDrawWorld(BOOL bDraw)
+void CObject::SetDrawWorld(bool bDraw)
{
int i;
@@ -2069,7 +2069,7 @@ void CObject::SetDrawWorld(BOOL bDraw)
// Indicates whether the object should be drawn over the interface.
-void CObject::SetDrawFront(BOOL bDraw)
+void CObject::SetDrawFront(bool bDraw)
{
int i;
@@ -2085,8 +2085,8 @@ void CObject::SetDrawFront(BOOL bDraw)
// Creates a vehicle traveling any pose on the floor.
-BOOL CObject::CreateVehicle(D3DVECTOR pos, float angle, ObjectType type,
- float power, BOOL bTrainer, BOOL bToy)
+bool CObject::CreateVehicle(D3DVECTOR pos, float angle, ObjectType type,
+ float power, bool bTrainer, bool bToy)
{
m_type = type;
@@ -2094,7 +2094,7 @@ BOOL CObject::CreateVehicle(D3DVECTOR pos, float angle, ObjectType type,
{
m_motion = new CMotionToto(m_iMan, this);
m_motion->Create(pos, angle, type, 1.0f);
- return TRUE;
+ return true;
}
SetTrainer(bTrainer);
@@ -2144,7 +2144,7 @@ BOOL CObject::CreateVehicle(D3DVECTOR pos, float angle, ObjectType type,
{
m_motion = new CMotionVehicle(m_iMan, this);
}
- if ( m_motion == 0 ) return FALSE;
+ if ( m_motion == 0 ) return false;
m_physics->SetMotion(m_motion);
m_brain->SetMotion(m_motion);
@@ -2170,15 +2170,15 @@ BOOL CObject::CreateVehicle(D3DVECTOR pos, float angle, ObjectType type,
delete m_motion;
m_motion = 0;
}
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// Creates an insect lands on any ground.
-BOOL CObject::CreateInsect(D3DVECTOR pos, float angle, ObjectType type)
+bool CObject::CreateInsect(D3DVECTOR pos, float angle, ObjectType type)
{
m_type = type;
@@ -2208,7 +2208,7 @@ BOOL CObject::CreateInsect(D3DVECTOR pos, float angle, ObjectType type)
{
m_motion = new CMotionWorm(m_iMan, this);
}
- if ( m_motion == 0 ) return FALSE;
+ if ( m_motion == 0 ) return false;
m_physics->SetMotion(m_motion);
m_brain->SetMotion(m_motion);
@@ -2234,20 +2234,20 @@ BOOL CObject::CreateInsect(D3DVECTOR pos, float angle, ObjectType type)
delete m_motion;
m_motion = 0;
}
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// Creates shade under a vehicle as a negative light.
-BOOL CObject::CreateShadowLight(float height, D3DCOLORVALUE color)
+bool CObject::CreateShadowLight(float height, D3DCOLORVALUE color)
{
D3DLIGHT7 light;
D3DVECTOR pos;
- if ( !m_engine->RetLightMode() ) return TRUE;
+ if ( !m_engine->RetLightMode() ) return true;
pos = RetPosition(0);
m_shadowHeight = height;
@@ -2272,14 +2272,14 @@ BOOL CObject::CreateShadowLight(float height, D3DCOLORVALUE color)
light.dvPhi = PI/4.0f;
m_shadowLight = m_light->CreateLight();
- if ( m_shadowLight == -1 ) return FALSE;
+ if ( m_shadowLight == -1 ) return false;
m_light->SetLight(m_shadowLight, light);
// Only illuminates the objects on the ground.
m_light->SetLightIncluType(m_shadowLight, TYPETERRAIN);
- return TRUE;
+ return true;
}
// Returns the number of negative light shade.
@@ -2291,11 +2291,11 @@ int CObject::RetShadowLight()
// Creates light for the effects of a vehicle.
-BOOL CObject::CreateEffectLight(float height, D3DCOLORVALUE color)
+bool CObject::CreateEffectLight(float height, D3DCOLORVALUE color)
{
D3DLIGHT7 light;
- if ( !m_engine->RetLightMode() ) return TRUE;
+ if ( !m_engine->RetLightMode() ) return true;
m_effectHeight = height;
@@ -2319,12 +2319,12 @@ BOOL CObject::CreateEffectLight(float height, D3DCOLORVALUE color)
light.dvPhi = PI/4.0f;
m_effectLight = m_light->CreateLight();
- if ( m_effectLight == -1 ) return FALSE;
+ if ( m_effectLight == -1 ) return false;
m_light->SetLight(m_effectLight, light);
m_light->SetLightIntensity(m_effectLight, 0.0f);
- return TRUE;
+ return true;
}
// Returns the number of light effects.
@@ -2336,12 +2336,12 @@ int CObject::RetEffectLight()
// Creates the circular shadow underneath a vehicle.
-BOOL CObject::CreateShadowCircle(float radius, float intensity,
+bool CObject::CreateShadowCircle(float radius, float intensity,
D3DShadowType type)
{
float zoom;
- if ( intensity == 0.0f ) return TRUE;
+ if ( intensity == 0.0f ) return true;
zoom = RetZoomX(0);
@@ -2353,19 +2353,19 @@ BOOL CObject::CreateShadowCircle(float radius, float intensity,
m_engine->SetObjectShadowAngle(m_objectPart[0].object, m_objectPart[0].angle.y);
m_engine->SetObjectShadowType(m_objectPart[0].object, type);
- return TRUE;
+ return true;
}
// Creates a building laying on the ground.
-BOOL CObject::CreateBuilding(D3DVECTOR pos, float angle, float height,
+bool CObject::CreateBuilding(D3DVECTOR pos, float angle, float height,
ObjectType type, float power)
{
CModFile* pModFile;
FPOINT p;
int rank, i;
- if ( m_engine->RetRestCreate() < 20 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 20 ) return false;
pModFile = new CModFile(m_iMan);
@@ -3250,12 +3250,12 @@ BOOL CObject::CreateBuilding(D3DVECTOR pos, float angle, float height,
m_engine->LoadAllTexture();
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a small resource set on the ground.
-BOOL CObject::CreateResource(D3DVECTOR pos, float angle, ObjectType type,
+bool CObject::CreateResource(D3DVECTOR pos, float angle, ObjectType type,
float power)
{
CModFile* pModFile;
@@ -3265,7 +3265,7 @@ BOOL CObject::CreateResource(D3DVECTOR pos, float angle, ObjectType type,
if ( type != OBJECT_SHOW )
{
- if ( m_engine->RetRestCreate() < 1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1 ) return false;
}
pModFile = new CModFile(m_iMan);
@@ -3318,7 +3318,7 @@ BOOL CObject::CreateResource(D3DVECTOR pos, float angle, ObjectType type,
if ( type == OBJECT_SHOW ) // remains in the air?
{
delete pModFile;
- return TRUE;
+ return true;
}
radius = 1.5f;
@@ -3371,18 +3371,18 @@ BOOL CObject::CreateResource(D3DVECTOR pos, float angle, ObjectType type,
SetPosition(0, pos); // to display the shadows immediately
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a flag placed on the ground.
-BOOL CObject::CreateFlag(D3DVECTOR pos, float angle, ObjectType type)
+bool CObject::CreateFlag(D3DVECTOR pos, float angle, ObjectType type)
{
CModFile* pModFile;
char name[50];
int rank, i;
- if ( m_engine->RetRestCreate() < 1+4 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1+4 ) return false;
pModFile = new CModFile(m_iMan);
@@ -3434,18 +3434,18 @@ BOOL CObject::CreateFlag(D3DVECTOR pos, float angle, ObjectType type)
SetPosition(0, pos); // to display the shadows immediately
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a barrier placed on the ground.
-BOOL CObject::CreateBarrier(D3DVECTOR pos, float angle, float height,
+bool CObject::CreateBarrier(D3DVECTOR pos, float angle, float height,
ObjectType type)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -3537,18 +3537,18 @@ BOOL CObject::CreateBarrier(D3DVECTOR pos, float angle, float height,
SetPosition(0, pos);
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a plant placed on the ground.
-BOOL CObject::CreatePlant(D3DVECTOR pos, float angle, float height,
+bool CObject::CreatePlant(D3DVECTOR pos, float angle, float height,
ObjectType type)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -3791,18 +3791,18 @@ BOOL CObject::CreatePlant(D3DVECTOR pos, float angle, float height,
SetPosition(0, pos);
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a mushroom placed on the ground.
-BOOL CObject::CreateMushroom(D3DVECTOR pos, float angle, float height,
+bool CObject::CreateMushroom(D3DVECTOR pos, float angle, float height,
ObjectType type)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -3853,12 +3853,12 @@ BOOL CObject::CreateMushroom(D3DVECTOR pos, float angle, float height,
SetPosition(0, pos);
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a toy placed on the ground.
-BOOL CObject::CreateTeen(D3DVECTOR pos, float angle, float zoom, float height,
+bool CObject::CreateTeen(D3DVECTOR pos, float angle, float zoom, float height,
ObjectType type)
{
CModFile* pModFile;
@@ -3866,9 +3866,9 @@ BOOL CObject::CreateTeen(D3DVECTOR pos, float angle, float zoom, float height,
D3DCOLORVALUE color;
int rank;
float fShadow;
- BOOL bFloorAdjust = TRUE;
+ bool bFloorAdjust = true;
- if ( m_engine->RetRestCreate() < 1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -3990,7 +3990,7 @@ BOOL CObject::CreateTeen(D3DVECTOR pos, float angle, float zoom, float height,
SetAngleY(0, angle);
SetZoom(0, zoom);
SetFloorHeight(0.0f);
- bFloorAdjust = FALSE;
+ bFloorAdjust = false;
m_terrain->AddBuildingLevel(pos, 5.9f, 6.1f, 0.2f, 0.5f);
CreateShadowCircle(8.0f, 0.2f*fShadow);
@@ -4464,7 +4464,7 @@ BOOL CObject::CreateTeen(D3DVECTOR pos, float angle, float zoom, float height,
SetPosition(0, pos);
SetAngleY(0, angle);
SetZoom(0, zoom);
- bFloorAdjust = FALSE;
+ bFloorAdjust = false;
}
if ( type == OBJECT_TEEN30 ) // jump?
@@ -4580,7 +4580,7 @@ BOOL CObject::CreateTeen(D3DVECTOR pos, float angle, float zoom, float height,
SetPosition(0, pos);
SetAngleY(0, angle);
SetZoom(0, zoom);
- bFloorAdjust = FALSE;
+ bFloorAdjust = false;
}
if ( type == OBJECT_TEEN37 ) // boat?
@@ -4593,7 +4593,7 @@ BOOL CObject::CreateTeen(D3DVECTOR pos, float angle, float zoom, float height,
SetPosition(0, pos);
SetAngleY(0, angle);
SetZoom(0, zoom);
- bFloorAdjust = FALSE;
+ bFloorAdjust = false;
}
if ( type == OBJECT_TEEN38 ) // fan?
@@ -4734,19 +4734,19 @@ BOOL CObject::CreateTeen(D3DVECTOR pos, float angle, float zoom, float height,
SetPosition(0, pos);
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a crystal placed on the ground.
-BOOL CObject::CreateQuartz(D3DVECTOR pos, float angle, float height,
+bool CObject::CreateQuartz(D3DVECTOR pos, float angle, float height,
ObjectType type)
{
CModFile* pModFile;
float radius;
int rank;
- if ( m_engine->RetRestCreate() < 1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -4847,18 +4847,18 @@ BOOL CObject::CreateQuartz(D3DVECTOR pos, float angle, float height,
m_particule->CreateParticule(pos, pos, FPOINT(2.0f, 2.0f), PARTIQUARTZ, 0.7f+Rand()*0.7f, radius, 0.0f);
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a root placed on the ground.
-BOOL CObject::CreateRoot(D3DVECTOR pos, float angle, float height,
+bool CObject::CreateRoot(D3DVECTOR pos, float angle, float height,
ObjectType type)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -5024,18 +5024,18 @@ BOOL CObject::CreateRoot(D3DVECTOR pos, float angle, float height,
SetPosition(0, pos);
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a small home.
-BOOL CObject::CreateHome(D3DVECTOR pos, float angle, float height,
+bool CObject::CreateHome(D3DVECTOR pos, float angle, float height,
ObjectType type)
{
CModFile* pModFile;
int rank;
- if ( m_engine->RetRestCreate() < 1 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1 ) return false;
pModFile = new CModFile(m_iMan);
@@ -5068,19 +5068,19 @@ BOOL CObject::CreateHome(D3DVECTOR pos, float angle, float height,
SetPosition(0, pos);
delete pModFile;
- return TRUE;
+ return true;
}
// Creates ruin placed on the ground.
-BOOL CObject::CreateRuin(D3DVECTOR pos, float angle, float height,
+bool CObject::CreateRuin(D3DVECTOR pos, float angle, float height,
ObjectType type)
{
CModFile* pModFile;
char name[50];
int rank;
- if ( m_engine->RetRestCreate() < 1+4 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 1+4 ) return false;
pModFile = new CModFile(m_iMan);
@@ -5495,17 +5495,17 @@ BOOL CObject::CreateRuin(D3DVECTOR pos, float angle, float height,
}
delete pModFile;
- return TRUE;
+ return true;
}
// Creates a gadget apollo.
-BOOL CObject::CreateApollo(D3DVECTOR pos, float angle, ObjectType type)
+bool CObject::CreateApollo(D3DVECTOR pos, float angle, ObjectType type)
{
CModFile* pModFile;
int rank, i;
- if ( m_engine->RetRestCreate() < 6 ) return FALSE;
+ if ( m_engine->RetRestCreate() < 6 ) return false;
pModFile = new CModFile(m_iMan);
@@ -5690,7 +5690,7 @@ BOOL CObject::CreateApollo(D3DVECTOR pos, float angle, ObjectType type)
SetPosition(0, pos); // to display the shadows immediately
delete pModFile;
- return TRUE;
+ return true;
}
// Creates all sub-objects for managing the object.
@@ -5804,65 +5804,65 @@ void CObject::CreateOtherObject(ObjectType type)
// Reads a program.
-BOOL CObject::ReadProgram(int rank, char* filename)
+bool CObject::ReadProgram(int rank, char* filename)
{
if ( m_brain != 0 )
{
return m_brain->ReadProgram(rank, filename);
}
- return FALSE;
+ return false;
}
// Writes a program.
-BOOL CObject::WriteProgram(int rank, char* filename)
+bool CObject::WriteProgram(int rank, char* filename)
{
if ( m_brain != 0 )
{
return m_brain->WriteProgram(rank, filename);
}
- return FALSE;
+ return false;
}
// Starts a program.
-BOOL CObject::RunProgram(int rank)
+bool CObject::RunProgram(int rank)
{
if ( m_brain != 0 )
{
m_brain->RunProgram(rank);
- return TRUE;
+ return true;
}
if ( m_auto != 0 )
{
m_auto->Start(rank);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// Calculates the matrix for transforming the object.
-// Returns TRUE if the matrix has changed.
+// Returns true if the matrix has changed.
// The rotations occur in the order Y, Z and X.
-BOOL CObject::UpdateTransformObject(int part, BOOL bForceUpdate)
+bool CObject::UpdateTransformObject(int part, bool bForceUpdate)
{
D3DVECTOR position, angle, eye;
- BOOL bModif = FALSE;
+ bool bModif = false;
int parent;
if ( m_truck != 0 ) // transported by truck?
{
- m_objectPart[part].bTranslate = TRUE;
- m_objectPart[part].bRotate = TRUE;
+ m_objectPart[part].bTranslate = true;
+ m_objectPart[part].bRotate = true;
}
if ( !bForceUpdate &&
!m_objectPart[part].bTranslate &&
- !m_objectPart[part].bRotate ) return FALSE;
+ !m_objectPart[part].bRotate ) return false;
position = m_objectPart[part].position;
angle = m_objectPart[part].angle;
@@ -5905,7 +5905,7 @@ BOOL CObject::UpdateTransformObject(int part, BOOL bForceUpdate)
m_objectPart[part].matTransform = m_objectPart[part].matRotate *
m_objectPart[part].matTranslate;
}
- bModif = TRUE;
+ bModif = true;
}
if ( bForceUpdate ||
@@ -5933,7 +5933,7 @@ BOOL CObject::UpdateTransformObject(int part, BOOL bForceUpdate)
m_objectPart[parent].matWorld;
}
}
- bModif = TRUE;
+ bModif = true;
}
if ( bModif )
@@ -5942,8 +5942,8 @@ BOOL CObject::UpdateTransformObject(int part, BOOL bForceUpdate)
m_objectPart[part].matWorld);
}
- m_objectPart[part].bTranslate = FALSE;
- m_objectPart[part].bRotate = FALSE;
+ m_objectPart[part].bTranslate = false;
+ m_objectPart[part].bRotate = false;
return bModif;
}
@@ -5952,9 +5952,9 @@ BOOL CObject::UpdateTransformObject(int part, BOOL bForceUpdate)
// Assume a maximum of 4 degrees of freedom.
// Appropriate, for example, to a body, an arm, forearm, hand and fingers.
-BOOL CObject::UpdateTransformObject()
+bool CObject::UpdateTransformObject()
{
- BOOL bUpdate1, bUpdate2, bUpdate3, bUpdate4;
+ bool bUpdate1, bUpdate2, bUpdate3, bUpdate4;
int level1, level2, level3, level4, rank;
int parent1, parent2, parent3, parent4;
@@ -5963,13 +5963,13 @@ BOOL CObject::UpdateTransformObject()
for ( level1=0 ; level1<m_totalPart ; level1++ )
{
if ( !m_objectPart[level1].bUsed ) continue;
- UpdateTransformObject(level1, FALSE);
+ UpdateTransformObject(level1, false);
}
}
else
{
parent1 = 0;
- bUpdate1 = UpdateTransformObject(parent1, FALSE);
+ bUpdate1 = UpdateTransformObject(parent1, false);
for ( level1=0 ; level1<m_totalPart ; level1++ )
{
@@ -6007,7 +6007,7 @@ BOOL CObject::UpdateTransformObject()
}
}
- return TRUE;
+ return true;
}
@@ -6035,7 +6035,7 @@ void CObject::FlatParent()
m_objectPart[i].parentPart = -1; // more parents
}
- m_bFlat = TRUE;
+ m_bFlat = true;
}
@@ -6102,7 +6102,7 @@ void CObject::UpdateEnergyMapping()
// Manual action.
-BOOL CObject::EventProcess(const Event &event)
+bool CObject::EventProcess(const Event &event)
{
if ( event.event == EVENT_KEYDOWN )
{
@@ -6156,7 +6156,7 @@ BOOL CObject::EventProcess(const Event &event)
if ( !m_bDead ) m_camera->SetType(CAMERA_EXPLO);
m_main->DeselectAll();
}
- return FALSE;
+ return false;
}
}
@@ -6183,21 +6183,21 @@ BOOL CObject::EventProcess(const Event &event)
return EventFrame(event);
}
- return TRUE;
+ return true;
}
// Animates the object.
-BOOL CObject::EventFrame(const Event &event)
+bool CObject::EventFrame(const Event &event)
{
if ( m_type == OBJECT_HUMAN && m_main->RetMainMovie() == MM_SATCOMopen )
{
UpdateTransformObject();
- return TRUE;
+ return true;
}
- if ( m_type != OBJECT_SHOW && m_engine->RetPause() ) return TRUE;
+ if ( m_type != OBJECT_SHOW && m_engine->RetPause() ) return true;
m_aTime += event.rTime;
m_shotTime += event.rTime;
@@ -6219,7 +6219,7 @@ BOOL CObject::EventFrame(const Event &event)
dist = Length(eye, RetPosition(0));
if ( dist < m_proxyDistance )
{
- m_bProxyActivate = FALSE;
+ m_bProxyActivate = false;
m_main->CreateShortcuts();
m_sound->Play(SOUND_FINDING);
pyro = new CPyro(m_iMan);
@@ -6228,7 +6228,7 @@ BOOL CObject::EventFrame(const Event &event)
}
}
- return TRUE;
+ return true;
}
// Updates the mapping of the object.
@@ -6259,7 +6259,7 @@ void CObject::VirusFrame(float rTime)
m_virusTime += rTime;
if ( m_virusTime >= VIRUS_DELAY )
{
- m_bVirusMode = FALSE; // the virus is no longer active
+ m_bVirusMode = false; // the virus is no longer active
}
if ( m_lastVirusParticule+m_engine->ParticuleAdapt(0.2f) <= m_aTime )
@@ -6638,12 +6638,12 @@ ObjectMaterial CObject::RetMaterial()
// Indicates whether the gadget is a nonessential.
-void CObject::SetGadget(BOOL bMode)
+void CObject::SetGadget(bool bMode)
{
m_bGadget = bMode;
}
-BOOL CObject::RetGadget()
+bool CObject::RetGadget()
{
return m_bGadget;
}
@@ -6651,12 +6651,12 @@ BOOL CObject::RetGadget()
// Indicates whether an object is stationary (ant on the back).
-void CObject::SetFixed(BOOL bFixed)
+void CObject::SetFixed(bool bFixed)
{
m_bFixed = bFixed;
}
-BOOL CObject::RetFixed()
+bool CObject::RetFixed()
{
return m_bFixed;
}
@@ -6664,12 +6664,12 @@ BOOL CObject::RetFixed()
// Indicates whether an object is subjected to clipping (obstacles).
-void CObject::SetClip(BOOL bClip)
+void CObject::SetClip(bool bClip)
{
m_bClip = bClip;
}
-BOOL CObject::RetClip()
+bool CObject::RetClip()
{
return m_bClip;
}
@@ -6678,7 +6678,7 @@ BOOL CObject::RetClip()
// Pushes an object.
-BOOL CObject::JostleObject(float force)
+bool CObject::JostleObject(float force)
{
CAutoJostle* pa;
@@ -6688,26 +6688,26 @@ BOOL CObject::JostleObject(float force)
m_type == OBJECT_FLAGy ||
m_type == OBJECT_FLAGv ) // flag?
{
- if ( m_auto == 0 ) return FALSE;
+ if ( m_auto == 0 ) return false;
m_auto->Start(1);
}
else
{
- if ( m_auto != 0 ) return FALSE;
+ if ( m_auto != 0 ) return false;
m_auto = new CAutoJostle(m_iMan, this);
pa = (CAutoJostle*)m_auto;
pa->Start(0, force);
}
- return TRUE;
+ return true;
}
// Beginning of the effect when the instruction "detect" is used.
-void CObject::StartDetectEffect(CObject *target, BOOL bFound)
+void CObject::StartDetectEffect(CObject *target, bool bFound)
{
D3DMATRIX* mat;
D3DVECTOR pos, goal;
@@ -6748,7 +6748,7 @@ void CObject::StartDetectEffect(CObject *target, BOOL bFound)
// Management of time from which a virus is active.
-void CObject::SetVirusMode(BOOL bEnable)
+void CObject::SetVirusMode(bool bEnable)
{
m_bVirusMode = bEnable;
m_virusTime = 0.0f;
@@ -6757,12 +6757,12 @@ void CObject::SetVirusMode(BOOL bEnable)
{
if ( !m_brain->IntroduceVirus() ) // tries to infect
{
- m_bVirusMode = FALSE; // program was not contaminated!
+ m_bVirusMode = false; // program was not contaminated!
}
}
}
-BOOL CObject::RetVirusMode()
+bool CObject::RetVirusMode()
{
return m_bVirusMode;
}
@@ -6795,12 +6795,12 @@ float CObject::RetCameraDist()
return m_cameraDist;
}
-void CObject::SetCameraLock(BOOL bLock)
+void CObject::SetCameraLock(bool bLock)
{
m_bCameraLock = bLock;
}
-BOOL CObject::RetCameraLock()
+bool CObject::RetCameraLock()
{
return m_bCameraLock;
}
@@ -6809,7 +6809,7 @@ BOOL CObject::RetCameraLock()
// Management of the demonstration of the object.
-void CObject::SetHilite(BOOL bMode)
+void CObject::SetHilite(bool bMode)
{
int list[OBJECTMAXPART+1];
int i, j;
@@ -6832,7 +6832,7 @@ void CObject::SetHilite(BOOL bMode)
}
}
-BOOL CObject::RetHilite()
+bool CObject::RetHilite()
{
return m_bHilite;
}
@@ -6840,7 +6840,7 @@ BOOL CObject::RetHilite()
// Indicates whether the object is selected or not.
-void CObject::SetSelect(BOOL bMode, BOOL bDisplayError)
+void CObject::SetSelect(bool bMode, bool bDisplayError)
{
Error err;
@@ -6881,23 +6881,23 @@ void CObject::SetSelect(BOOL bMode, BOOL bDisplayError)
// Indicates whether the object is selected or not.
-BOOL CObject::RetSelect(BOOL bReal)
+bool CObject::RetSelect(bool bReal)
{
- if ( !bReal && m_main->RetFixScene() ) return FALSE;
+ if ( !bReal && m_main->RetFixScene() ) return false;
return m_bSelect;
}
// Indicates whether the object is selectable or not.
-void CObject::SetSelectable(BOOL bMode)
+void CObject::SetSelectable(bool bMode)
{
m_bSelectable = bMode;
}
// Indicates whether the object is selecionnable or not.
-BOOL CObject::RetSelectable()
+bool CObject::RetSelectable()
{
return m_bSelectable;
}
@@ -6905,7 +6905,7 @@ BOOL CObject::RetSelectable()
// Management of the activities of an object.
-void CObject::SetActivity(BOOL bMode)
+void CObject::SetActivity(bool bMode)
{
if ( m_brain != 0 )
{
@@ -6913,26 +6913,26 @@ void CObject::SetActivity(BOOL bMode)
}
}
-BOOL CObject::RetActivity()
+bool CObject::RetActivity()
{
if ( m_brain != 0 )
{
return m_brain->RetActivity();
}
- return FALSE;
+ return false;
}
// Indicates if necessary to check the tokens of the object.
-void CObject::SetCheckToken(BOOL bMode)
+void CObject::SetCheckToken(bool bMode)
{
m_bCheckToken = bMode;
}
// Indicates if necessary to check the tokens of the object.
-BOOL CObject::RetCheckToken()
+bool CObject::RetCheckToken()
{
return m_bCheckToken;
}
@@ -6942,12 +6942,12 @@ BOOL CObject::RetCheckToken()
// The object is not hidden or visually disabled, but ignores detections!
// For example: underground worm.
-void CObject::SetVisible(BOOL bVisible)
+void CObject::SetVisible(bool bVisible)
{
m_bVisible = bVisible;
}
-BOOL CObject::RetVisible()
+bool CObject::RetVisible()
{
return m_bVisible;
}
@@ -6958,12 +6958,12 @@ BOOL CObject::RetVisible()
// This mode is used for objects "resetables"
// during training to simulate destruction.
-void CObject::SetEnable(BOOL bEnable)
+void CObject::SetEnable(bool bEnable)
{
m_bEnable = bEnable;
}
-BOOL CObject::RetEnable()
+bool CObject::RetEnable()
{
return m_bEnable;
}
@@ -6971,12 +6971,12 @@ BOOL CObject::RetEnable()
// Management mode or an object is only active when you're close.
-void CObject::SetProxyActivate(BOOL bActivate)
+void CObject::SetProxyActivate(bool bActivate)
{
m_bProxyActivate = bActivate;
}
-BOOL CObject::RetProxyActivate()
+bool CObject::RetProxyActivate()
{
return m_bProxyActivate;
}
@@ -7022,12 +7022,12 @@ float CObject::RetParam()
// For example, a cube of titanium is blocked while it is used to make something,
//or a vehicle is blocked as its construction is not finished.
-void CObject::SetLock(BOOL bLock)
+void CObject::SetLock(bool bLock)
{
m_bLock = bLock;
}
-BOOL CObject::RetLock()
+bool CObject::RetLock()
{
return m_bLock;
}
@@ -7035,12 +7035,12 @@ BOOL CObject::RetLock()
// Management of the mode "current explosion" of an object.
// An object in this mode is not saving.
-void CObject::SetExplo(BOOL bExplo)
+void CObject::SetExplo(bool bExplo)
{
m_bExplo = bExplo;
}
-BOOL CObject::RetExplo()
+bool CObject::RetExplo()
{
return m_bExplo;
}
@@ -7048,12 +7048,12 @@ BOOL CObject::RetExplo()
// Mode management "cargo ship" during movies.
-void CObject::SetCargo(BOOL bCargo)
+void CObject::SetCargo(bool bCargo)
{
m_bCargo = bCargo;
}
-BOOL CObject::RetCargo()
+bool CObject::RetCargo()
{
return m_bCargo;
}
@@ -7061,7 +7061,7 @@ BOOL CObject::RetCargo()
// Management of the HS mode of an object.
-void CObject::SetBurn(BOOL bBurn)
+void CObject::SetBurn(bool bBurn)
{
m_bBurn = bBurn;
@@ -7072,12 +7072,12 @@ void CObject::SetBurn(BOOL bBurn)
//? }
}
-BOOL CObject::RetBurn()
+bool CObject::RetBurn()
{
return m_bBurn;
}
-void CObject::SetDead(BOOL bDead)
+void CObject::SetDead(bool bDead)
{
m_bDead = bDead;
@@ -7093,17 +7093,17 @@ void CObject::SetDead(BOOL bDead)
//? }
}
-BOOL CObject::RetDead()
+bool CObject::RetDead()
{
return m_bDead;
}
-BOOL CObject::RetRuin()
+bool CObject::RetRuin()
{
return m_bBurn|m_bFlat;
}
-BOOL CObject::RetActif()
+bool CObject::RetActif()
{
return !m_bLock && !m_bBurn && !m_bFlat && m_bVisible && m_bEnable;
}
@@ -7193,27 +7193,27 @@ float CObject::RetGunGoalH()
// Shows the limits of the object.
-BOOL CObject::StartShowLimit()
+bool CObject::StartShowLimit()
{
- if ( m_showLimitRadius == 0.0f ) return FALSE;
+ if ( m_showLimitRadius == 0.0f ) return false;
m_main->SetShowLimit(0, PARTILIMIT1, this, RetPosition(0), m_showLimitRadius);
- m_bShowLimit = TRUE;
- return TRUE;
+ m_bShowLimit = true;
+ return true;
}
void CObject::StopShowLimit()
{
- m_bShowLimit = FALSE;
+ m_bShowLimit = false;
}
// Indicates whether a program is under execution.
-BOOL CObject::IsProgram()
+bool CObject::IsProgram()
{
- if ( m_brain == 0 ) return FALSE;
+ if ( m_brain == 0 ) return false;
return m_brain->IsProgram();
}
@@ -7501,7 +7501,7 @@ int CObject::RetDefRank()
// Gives the object name for the tooltip.
-BOOL CObject::GetTooltipName(char* name)
+bool CObject::GetTooltipName(char* name)
{
GetResource(RES_OBJECT, m_type, name);
return ( name[0] != 0 );
@@ -7556,15 +7556,15 @@ void CObject::DeleteDeselList(CObject* pObj)
// Management of the state of the pencil drawing robot.
-BOOL CObject::RetTraceDown()
+bool CObject::RetTraceDown()
{
CMotionVehicle* mv;
- if ( m_motion == 0 ) return FALSE;
+ if ( m_motion == 0 ) return false;
mv = (CMotionVehicle*)m_motion;
return mv->RetTraceDown();
}
-void CObject::SetTraceDown(BOOL bDown)
+void CObject::SetTraceDown(bool bDown)
{
CMotionVehicle* mv;
if ( m_motion == 0 ) return;
diff --git a/src/object/object.h b/src/object/object.h
index 08f413b..b6f993a 100644
--- a/src/object/object.h
+++ b/src/object/object.h
@@ -370,11 +370,11 @@ public:
CObject(CInstanceManager* iMan);
~CObject();
- void DeleteObject(BOOL bAll=FALSE);
+ void DeleteObject(bool bAll=false);
void Simplify();
- BOOL ExploObject(ExploType type, float force, float decay=1.0f);
+ bool ExploObject(ExploType type, float force, float decay=1.0f);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void UpdateMapping();
int CreatePart();
@@ -391,30 +391,30 @@ public:
void SetID(int id);
int RetID();
- BOOL Write(char *line);
- BOOL Read(char *line);
-
- void SetDrawWorld(BOOL bDraw);
- void SetDrawFront(BOOL bDraw);
-
- BOOL CreateVehicle(D3DVECTOR pos, float angle, ObjectType type, float power, BOOL bTrainer, BOOL bToy);
- BOOL CreateInsect(D3DVECTOR pos, float angle, ObjectType type);
- BOOL CreateBuilding(D3DVECTOR pos, float angle, float height, ObjectType type, float power=1.0f);
- BOOL CreateResource(D3DVECTOR pos, float angle, ObjectType type, float power=1.0f);
- BOOL CreateFlag(D3DVECTOR pos, float angle, ObjectType type);
- BOOL CreateBarrier(D3DVECTOR pos, float angle, float height, ObjectType type);
- BOOL CreatePlant(D3DVECTOR pos, float angle, float height, ObjectType type);
- BOOL CreateMushroom(D3DVECTOR pos, float angle, float height, ObjectType type);
- BOOL CreateTeen(D3DVECTOR pos, float angle, float zoom, float height, ObjectType type);
- BOOL CreateQuartz(D3DVECTOR pos, float angle, float height, ObjectType type);
- BOOL CreateRoot(D3DVECTOR pos, float angle, float height, ObjectType type);
- BOOL CreateHome(D3DVECTOR pos, float angle, float height, ObjectType type);
- BOOL CreateRuin(D3DVECTOR pos, float angle, float height, ObjectType type);
- BOOL CreateApollo(D3DVECTOR pos, float angle, ObjectType type);
-
- BOOL ReadProgram(int rank, char* filename);
- BOOL WriteProgram(int rank, char* filename);
- BOOL RunProgram(int rank);
+ bool Write(char *line);
+ bool Read(char *line);
+
+ void SetDrawWorld(bool bDraw);
+ void SetDrawFront(bool bDraw);
+
+ bool CreateVehicle(D3DVECTOR pos, float angle, ObjectType type, float power, bool bTrainer, bool bToy);
+ bool CreateInsect(D3DVECTOR pos, float angle, ObjectType type);
+ bool CreateBuilding(D3DVECTOR pos, float angle, float height, ObjectType type, float power=1.0f);
+ bool CreateResource(D3DVECTOR pos, float angle, ObjectType type, float power=1.0f);
+ bool CreateFlag(D3DVECTOR pos, float angle, ObjectType type);
+ bool CreateBarrier(D3DVECTOR pos, float angle, float height, ObjectType type);
+ bool CreatePlant(D3DVECTOR pos, float angle, float height, ObjectType type);
+ bool CreateMushroom(D3DVECTOR pos, float angle, float height, ObjectType type);
+ bool CreateTeen(D3DVECTOR pos, float angle, float zoom, float height, ObjectType type);
+ bool CreateQuartz(D3DVECTOR pos, float angle, float height, ObjectType type);
+ bool CreateRoot(D3DVECTOR pos, float angle, float height, ObjectType type);
+ bool CreateHome(D3DVECTOR pos, float angle, float height, ObjectType type);
+ bool CreateRuin(D3DVECTOR pos, float angle, float height, ObjectType type);
+ bool CreateApollo(D3DVECTOR pos, float angle, ObjectType type);
+
+ bool ReadProgram(int rank, char* filename);
+ bool WriteProgram(int rank, char* filename);
+ bool RunProgram(int rank);
int RetShadowLight();
int RetEffectLight();
@@ -422,7 +422,7 @@ public:
void FlushCrashShere();
int CreateCrashSphere(D3DVECTOR pos, float radius, Sound sound, float hardness=0.45f);
int RetCrashSphereTotal();
- BOOL GetCrashSphere(int rank, D3DVECTOR &pos, float &radius);
+ bool GetCrashSphere(int rank, D3DVECTOR &pos, float &radius);
float RetCrashSphereHardness(int rank);
Sound RetCrashSphereSound(int rank);
void DeleteCrashSphere(int rank);
@@ -465,19 +465,19 @@ public:
float RetWaterLevel();
- void SetTrainer(BOOL bEnable);
- BOOL RetTrainer();
+ void SetTrainer(bool bEnable);
+ bool RetTrainer();
- void SetToy(BOOL bEnable);
- BOOL RetToy();
+ void SetToy(bool bEnable);
+ bool RetToy();
- void SetManual(BOOL bManual);
- BOOL RetManual();
+ void SetManual(bool bManual);
+ bool RetManual();
void SetResetCap(ResetCap cap);
ResetCap RetResetCap();
- void SetResetBusy(BOOL bBusy);
- BOOL RetResetBusy();
+ void SetResetBusy(bool bBusy);
+ bool RetResetBusy();
void SetResetPosition(const D3DVECTOR &pos);
D3DVECTOR RetResetPosition();
void SetResetAngle(const D3DVECTOR &angle);
@@ -504,10 +504,10 @@ public:
int RetInfoTotal();
void SetInfoReturn(float value);
float RetInfoReturn();
- void SetInfoUpdate(BOOL bUpdate);
- BOOL RetInfoUpdate();
+ void SetInfoUpdate(bool bUpdate);
+ bool RetInfoUpdate();
- BOOL SetCmdLine(int rank, float value);
+ bool SetCmdLine(int rank, float value);
float RetCmdLine(int rank);
D3DMATRIX* RetRotateMatrix(int part);
@@ -540,53 +540,53 @@ public:
ObjectMaterial RetMaterial();
- void SetGadget(BOOL bMode);
- BOOL RetGadget();
+ void SetGadget(bool bMode);
+ bool RetGadget();
- void SetFixed(BOOL bFixed);
- BOOL RetFixed();
+ void SetFixed(bool bFixed);
+ bool RetFixed();
- void SetClip(BOOL bClip);
- BOOL RetClip();
+ void SetClip(bool bClip);
+ bool RetClip();
- BOOL JostleObject(float force);
+ bool JostleObject(float force);
- void StartDetectEffect(CObject *target, BOOL bFound);
+ void StartDetectEffect(CObject *target, bool bFound);
- void SetVirusMode(BOOL bEnable);
- BOOL RetVirusMode();
+ void SetVirusMode(bool bEnable);
+ bool RetVirusMode();
float RetVirusTime();
void SetCameraType(CameraType type);
CameraType RetCameraType();
void SetCameraDist(float dist);
float RetCameraDist();
- void SetCameraLock(BOOL bLock);
- BOOL RetCameraLock();
+ void SetCameraLock(bool bLock);
+ bool RetCameraLock();
- void SetHilite(BOOL bMode);
- BOOL RetHilite();
+ void SetHilite(bool bMode);
+ bool RetHilite();
- void SetSelect(BOOL bMode, BOOL bDisplayError=TRUE);
- BOOL RetSelect(BOOL bReal=FALSE);
+ void SetSelect(bool bMode, bool bDisplayError=true);
+ bool RetSelect(bool bReal=false);
- void SetSelectable(BOOL bMode);
- BOOL RetSelectable();
+ void SetSelectable(bool bMode);
+ bool RetSelectable();
- void SetActivity(BOOL bMode);
- BOOL RetActivity();
+ void SetActivity(bool bMode);
+ bool RetActivity();
- void SetVisible(BOOL bVisible);
- BOOL RetVisible();
+ void SetVisible(bool bVisible);
+ bool RetVisible();
- void SetEnable(BOOL bEnable);
- BOOL RetEnable();
+ void SetEnable(bool bEnable);
+ bool RetEnable();
- void SetCheckToken(BOOL bMode);
- BOOL RetCheckToken();
+ void SetCheckToken(bool bMode);
+ bool RetCheckToken();
- void SetProxyActivate(BOOL bActivate);
- BOOL RetProxyActivate();
+ void SetProxyActivate(bool bActivate);
+ bool RetProxyActivate();
void SetProxyDistance(float distance);
float RetProxyDistance();
@@ -596,28 +596,28 @@ public:
void SetParam(float value);
float RetParam();
- void SetExplo(BOOL bExplo);
- BOOL RetExplo();
- void SetLock(BOOL bLock);
- BOOL RetLock();
- void SetCargo(BOOL bCargo);
- BOOL RetCargo();
- void SetBurn(BOOL bBurn);
- BOOL RetBurn();
- void SetDead(BOOL bDead);
- BOOL RetDead();
- BOOL RetRuin();
- BOOL RetActif();
+ void SetExplo(bool bExplo);
+ bool RetExplo();
+ void SetLock(bool bLock);
+ bool RetLock();
+ void SetCargo(bool bCargo);
+ bool RetCargo();
+ void SetBurn(bool bBurn);
+ bool RetBurn();
+ void SetDead(bool bDead);
+ bool RetDead();
+ bool RetRuin();
+ bool RetActif();
void SetGunGoalV(float gunGoal);
void SetGunGoalH(float gunGoal);
float RetGunGoalV();
float RetGunGoalH();
- BOOL StartShowLimit();
+ bool StartShowLimit();
void StopShowLimit();
- BOOL IsProgram();
+ bool IsProgram();
void CreateSelectParticule();
void SetRunScript(CScript* script);
@@ -632,27 +632,27 @@ public:
void SetDefRank(int rank);
int RetDefRank();
- BOOL GetTooltipName(char* name);
+ bool GetTooltipName(char* name);
void AddDeselList(CObject* pObj);
CObject* SubDeselList();
void DeleteDeselList(CObject* pObj);
- BOOL CreateShadowCircle(float radius, float intensity, D3DShadowType type=D3DSHADOWNORM);
- BOOL CreateShadowLight(float height, D3DCOLORVALUE color);
- BOOL CreateEffectLight(float height, D3DCOLORVALUE color);
+ bool CreateShadowCircle(float radius, float intensity, D3DShadowType type=D3DSHADOWNORM);
+ bool CreateShadowLight(float height, D3DCOLORVALUE color);
+ bool CreateEffectLight(float height, D3DCOLORVALUE color);
void FlatParent();
- BOOL RetTraceDown();
- void SetTraceDown(BOOL bDown);
+ bool RetTraceDown();
+ void SetTraceDown(bool bDown);
int RetTraceColor();
void SetTraceColor(int color);
float RetTraceWidth();
void SetTraceWidth(float width);
protected:
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
void VirusFrame(float rTime);
void PartiFrame(float rTime);
void CreateOtherObject(ObjectType type);
@@ -660,8 +660,8 @@ protected:
void UpdateTotalPart();
int SearchDescendant(int parent, int n);
void UpdateEnergyMapping();
- BOOL UpdateTransformObject(int part, BOOL bForceUpdate);
- BOOL UpdateTransformObject();
+ bool UpdateTransformObject(int part, bool bForceUpdate);
+ bool UpdateTransformObject();
void UpdateSelectParticule();
protected:
@@ -708,36 +708,36 @@ protected:
int m_material; // matter(0..n)
float m_aTime;
float m_shotTime; // time since last shot
- BOOL m_bVirusMode; // virus activated/triggered
+ bool m_bVirusMode; // virus activated/triggered
float m_virusTime; // lifetime of the virus
float m_lastVirusParticule;
float m_lastParticule;
- BOOL m_bHilite;
- BOOL m_bSelect; // object selected
- BOOL m_bSelectable; // selectable object
- BOOL m_bCheckToken; // object with audited tokens
- BOOL m_bVisible; // object active but undetectable
- BOOL m_bEnable; // dead object
- BOOL m_bProxyActivate; // active object so close
- BOOL m_bGadget; // object nonessential
- BOOL m_bLock;
- BOOL m_bExplo;
- BOOL m_bCargo;
- BOOL m_bBurn;
- BOOL m_bDead;
- BOOL m_bFlat;
- BOOL m_bTrainer; // drive vehicle (without remote)
- BOOL m_bToy; // toy key
- BOOL m_bManual; // manual control (Scribbler)
- BOOL m_bFixed;
- BOOL m_bClip;
- BOOL m_bShowLimit;
+ bool m_bHilite;
+ bool m_bSelect; // object selected
+ bool m_bSelectable; // selectable object
+ bool m_bCheckToken; // object with audited tokens
+ bool m_bVisible; // object active but undetectable
+ bool m_bEnable; // dead object
+ bool m_bProxyActivate; // active object so close
+ bool m_bGadget; // object nonessential
+ bool m_bLock;
+ bool m_bExplo;
+ bool m_bCargo;
+ bool m_bBurn;
+ bool m_bDead;
+ bool m_bFlat;
+ bool m_bTrainer; // drive vehicle (without remote)
+ bool m_bToy; // toy key
+ bool m_bManual; // manual control (Scribbler)
+ bool m_bFixed;
+ bool m_bClip;
+ bool m_bShowLimit;
float m_showLimitRadius;
float m_gunGoalV;
float m_gunGoalH;
CameraType m_cameraType;
float m_cameraDist;
- BOOL m_bCameraLock;
+ bool m_bCameraLock;
int m_defRank;
float m_magnifyDamage;
float m_proxyDistance;
@@ -763,7 +763,7 @@ protected:
int m_partiSel[4];
ResetCap m_resetCap;
- BOOL m_bResetBusy;
+ bool m_bResetBusy;
D3DVECTOR m_resetPosition;
D3DVECTOR m_resetAngle;
int m_resetRun;
@@ -771,7 +771,7 @@ protected:
int m_infoTotal;
Info m_info[OBJECTMAXINFO];
float m_infoReturn;
- BOOL m_bInfoUpdate;
+ bool m_bInfoUpdate;
float m_cmdLine[OBJECTMAXCMDLINE];
};
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 0a55285..d072f66 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -80,7 +80,7 @@
-#define CBOT_STACK TRUE // saves the stack of programs CBOT
+#define CBOT_STACK true // saves the stack of programs CBOT
#define UNIT 4.0f
@@ -131,62 +131,62 @@ CBotTypResult cPoint(CBotVar* pThis, CBotVar* &var)
//Execution of the class "point".
-BOOL rPoint(CBotVar* pThis, CBotVar* var, CBotVar* pResult, int& Exception)
+bool rPoint(CBotVar* pThis, CBotVar* var, CBotVar* pResult, int& Exception)
{
CBotVar *pX, *pY, *pZ;
- if ( var == NULL ) return TRUE; // constructor with no parameters is ok
+ if ( var == NULL ) return true; // constructor with no parameters is ok
if ( var->GivType() > CBotTypDouble )
{
- Exception = CBotErrBadNum; return FALSE;
+ Exception = CBotErrBadNum; return false;
}
pX = pThis->GivItem("x");
if ( pX == NULL )
{
- Exception = CBotErrUndefItem; return FALSE;
+ Exception = CBotErrUndefItem; return false;
}
pX->SetValFloat( var->GivValFloat() );
var = var->GivNext();
if ( var == NULL )
{
- Exception = CBotErrLowParam; return FALSE;
+ Exception = CBotErrLowParam; return false;
}
if ( var->GivType() > CBotTypDouble )
{
- Exception = CBotErrBadNum; return FALSE;
+ Exception = CBotErrBadNum; return false;
}
pY = pThis->GivItem("y");
if ( pY == NULL )
{
- Exception = CBotErrUndefItem; return FALSE;
+ Exception = CBotErrUndefItem; return false;
}
pY->SetValFloat( var->GivValFloat() );
var = var->GivNext();
if ( var == NULL )
{
- return TRUE; // ok with only two parameters
+ return true; // ok with only two parameters
}
pZ = pThis->GivItem("z");
if ( pZ == NULL )
{
- Exception = CBotErrUndefItem; return FALSE;
+ Exception = CBotErrUndefItem; return false;
}
pZ->SetValFloat( var->GivValFloat() );
var = var->GivNext();
if ( var != NULL )
{
- Exception = CBotErrOverParam; return FALSE;
+ Exception = CBotErrOverParam; return false;
}
- return TRUE; // no interruption
+ return true; // no interruption
}
@@ -238,30 +238,30 @@ CRobotMain::CRobotMain(CInstanceManager* iMan)
m_visitObject = 0;
m_visitArrow = 0;
m_audioTrack = 0;
- m_bAudioRepeat = TRUE;
+ m_bAudioRepeat = true;
m_delayWriteMessage = 0;
m_selectObject = 0;
m_infoUsed = 0;
- m_bBeginSatCom = FALSE;
- m_bMovieLock = FALSE;
- m_bSatComLock = FALSE;
- m_bEditLock = FALSE;
- m_bEditFull = FALSE;
- m_bPause = FALSE;
- m_bHilite = FALSE;
- m_bFreePhoto = FALSE;
- m_bShowPos = FALSE;
- m_bSelectInsect = FALSE;
- m_bShowSoluce = FALSE;
- m_bShowAll = FALSE;
- m_bCheatRadar = FALSE;
- m_bFixScene = FALSE;
- m_bTrainerPilot = FALSE;
- m_bSuspend = FALSE;
- m_bFriendAim = FALSE;
- m_bResetCreate = FALSE;
- m_bShortCut = TRUE;
+ m_bBeginSatCom = false;
+ m_bMovieLock = false;
+ m_bSatComLock = false;
+ m_bEditLock = false;
+ m_bEditFull = false;
+ m_bPause = false;
+ m_bHilite = false;
+ m_bFreePhoto = false;
+ m_bShowPos = false;
+ m_bSelectInsect = false;
+ m_bShowSoluce = false;
+ m_bShowAll = false;
+ m_bCheatRadar = false;
+ m_bFixScene = false;
+ m_bTrainerPilot = false;
+ m_bSuspend = false;
+ m_bFriendAim = false;
+ m_bResetCreate = false;
+ m_bShortCut = true;
m_engine->SetMovieLock(m_bMovieLock);
@@ -274,7 +274,7 @@ CRobotMain::CRobotMain(CInstanceManager* iMan)
m_endingWinRank = 0;
m_endingLostRank = 0;
- m_bWinTerminate = FALSE;
+ m_bWinTerminate = false;
FlushDisplayInfo();
@@ -288,7 +288,7 @@ CRobotMain::CRobotMain(CInstanceManager* iMan)
if ( GetProfileFloat("Edit", "WindowDim.x", fValue) ) m_windowDim.x = fValue;
if ( GetProfileFloat("Edit", "WindowDim.y", fValue) ) m_windowDim.y = fValue;
- m_IOPublic = FALSE;
+ m_IOPublic = false;
m_IODim = FPOINT(320.0f/640.0f, (121.0f+18.0f*8)/480.0f);
m_IOPos.x = (1.0f-m_IODim.x)/2.0f; // in the middle
m_IOPos.y = (1.0f-m_IODim.y)/2.0f;
@@ -321,7 +321,7 @@ CRobotMain::CRobotMain(CInstanceManager* iMan)
for ( i=0 ; i<MAXSHOWLIMIT ; i++ )
{
- m_showLimit[i].bUsed = FALSE;
+ m_showLimit[i].bUsed = false;
m_showLimit[i].total = 0;
m_showLimit[i].link = 0;
}
@@ -381,7 +381,7 @@ CRobotMain::CRobotMain(CInstanceManager* iMan)
// Add the class Point.
CBotClass* bc;
- bc = new CBotClass("point", NULL, TRUE); // intrinsic class
+ bc = new CBotClass("point", NULL, true); // intrinsic class
bc->AddItem("x", CBotTypFloat);
bc->AddItem("y", CBotTypFloat);
bc->AddItem("z", CBotTypFloat);
@@ -447,7 +447,7 @@ void CRobotMain::ChangePhase(Phase phase)
float ox, oy, sx, sy;
char* read;
int rank, numTry;
- BOOL bLoading;
+ bool bLoading;
if ( m_phase == PHASE_SIMUL ) // ends a simulation?
{
@@ -456,7 +456,7 @@ void CRobotMain::ChangePhase(Phase phase)
m_camera->SetObject(0);
#if _SCHOOL
- if ( TRUE )
+ if ( true )
#else
if ( m_gameTime > 10.0f ) // did you play at least 10 seconds?
#endif
@@ -471,7 +471,7 @@ void CRobotMain::ChangePhase(Phase phase)
if ( phase == PHASE_WIN ) // wins a simulation?
{
rank = m_dialog->RetSceneRank();
- m_dialog->SetGamerInfoPassed(rank, TRUE);
+ m_dialog->SetGamerInfoPassed(rank, true);
m_dialog->NextMission(); // passes to the next mission
m_dialog->WriteGamerInfo();
}
@@ -481,22 +481,22 @@ void CRobotMain::ChangePhase(Phase phase)
m_phase = phase;
m_winDelay = 0.0f;
m_lostDelay = 0.0f;
- m_bBeginSatCom = FALSE;
- m_bMovieLock = FALSE;
- m_bSatComLock = FALSE;
- m_bEditLock = FALSE;
- m_bFreePhoto = FALSE;
- m_bResetCreate = FALSE;
+ m_bBeginSatCom = false;
+ m_bMovieLock = false;
+ m_bSatComLock = false;
+ m_bEditLock = false;
+ m_bFreePhoto = false;
+ m_bResetCreate = false;
m_engine->SetMovieLock(m_bMovieLock);
- ChangePause(FALSE);
+ ChangePause(false);
FlushDisplayInfo();
m_engine->SetRankView(0);
m_engine->FlushObject();
color.r = color.g = color.b = color.a = 0.0f;
m_engine->SetWaterAddColor(color);
m_engine->SetBackground("");
- m_engine->SetBackForce(FALSE);
+ m_engine->SetBackForce(false);
m_engine->SetFrontsizeName("");
m_engine->SetOverColor();
m_engine->GroundMarkDelete(0);
@@ -524,7 +524,7 @@ void CRobotMain::ChangePhase(Phase phase)
m_movieInfoIndex = -1;
m_cameraPan = 0.0f;
m_cameraZoom = 0.0f;
- m_bShortCut = TRUE;
+ m_bShortCut = true;
// Creates and hide the command console.
dim.x = 200.0f/640.0f;
@@ -534,7 +534,7 @@ void CRobotMain::ChangePhase(Phase phase)
pe = m_interface->CreateEdit(pos, dim, 0, EVENT_CMD);
if ( pe == 0 ) return;
pe->ClearState(STATE_VISIBLE);
- m_bCmdEdit = FALSE; // hidden for now
+ m_bCmdEdit = false; // hidden for now
// Creates the speedometer.
#if _TEEN
@@ -564,9 +564,9 @@ void CRobotMain::ChangePhase(Phase phase)
if ( m_phase != PHASE_PERSO )
{
- m_engine->SetDrawWorld(TRUE);
- m_engine->SetDrawFront(FALSE);
- m_bFixScene = FALSE;
+ m_engine->SetDrawWorld(true);
+ m_engine->SetDrawFront(false);
+ m_bFixScene = false;
}
if ( m_phase == PHASE_INIT )
@@ -656,7 +656,7 @@ void CRobotMain::ChangePhase(Phase phase)
bLoading = (read[0] != 0);
m_map->CreateMap();
- CreateScene(m_dialog->RetSceneSoluce(), FALSE, FALSE); // interactive scene
+ CreateScene(m_dialog->RetSceneSoluce(), false, false); // interactive scene
if ( m_bMapImage )
{
m_map->SetFixImage(m_mapFilename);
@@ -671,7 +671,7 @@ void CRobotMain::ChangePhase(Phase phase)
if ( m_bImmediatSatCom && !bLoading &&
m_infoFilename[SATCOM_HUSTON][0] != 0 )
{
- StartDisplayInfo(SATCOM_HUSTON, FALSE); // shows the instructions
+ StartDisplayInfo(SATCOM_HUSTON, false); // shows the instructions
}
m_sound->StopMusic();
@@ -694,7 +694,7 @@ void CRobotMain::ChangePhase(Phase phase)
m_dialog->SetSceneName("win");
#endif
m_dialog->SetSceneRank(m_endingWinRank);
- CreateScene(FALSE, TRUE, FALSE); // sets scene
+ CreateScene(false, true, false); // sets scene
pos.x = ox+sx*1; pos.y = oy+sy*1;
ddim.x = dim.x*2; ddim.y = dim.y*2;
@@ -707,17 +707,17 @@ void CRobotMain::ChangePhase(Phase phase)
ddim.x = dim.x*15; ddim.y = dim.y*2;
pe = m_interface->CreateEdit(pos, ddim, 0, EVENT_EDIT0);
pe->SetFontType(FONT_COLOBOT);
- pe->SetEditCap(FALSE);
- pe->SetHiliteCap(FALSE);
+ pe->SetEditCap(false);
+ pe->SetHiliteCap(false);
pe->ReadText("help\\teenw.txt");
#else
pos.x = ox+sx*3; pos.y = oy+sy*0.2f;
ddim.x = dim.x*15; ddim.y = dim.y*3.0f;
pe = m_interface->CreateEdit(pos, ddim, 0, EVENT_EDIT0);
- pe->SetGenericMode(TRUE);
+ pe->SetGenericMode(true);
pe->SetFontType(FONT_COLOBOT);
- pe->SetEditCap(FALSE);
- pe->SetHiliteCap(FALSE);
+ pe->SetEditCap(false);
+ pe->SetHiliteCap(false);
pe->ReadText("help\\win.txt");
#endif
}
@@ -738,10 +738,10 @@ void CRobotMain::ChangePhase(Phase phase)
}
else
{
- m_bWinTerminate = FALSE;
+ m_bWinTerminate = false;
m_dialog->SetSceneName("lost");
m_dialog->SetSceneRank(m_endingLostRank);
- CreateScene(FALSE, TRUE, FALSE); // sets scene
+ CreateScene(false, true, false); // sets scene
pos.x = ox+sx*1; pos.y = oy+sy*1;
ddim.x = dim.x*2; ddim.y = dim.y*2;
@@ -762,11 +762,11 @@ void CRobotMain::ChangePhase(Phase phase)
if ( m_phase == PHASE_LOADING )
{
- m_engine->SetMouseHide(TRUE);
+ m_engine->SetMouseHide(true);
}
else
{
- m_engine->SetMouseHide(FALSE);
+ m_engine->SetMouseHide(false);
}
m_engine->LoadAllTexture();
@@ -775,7 +775,7 @@ void CRobotMain::ChangePhase(Phase phase)
// Processes an event.
-BOOL CRobotMain::EventProcess(const Event &event)
+bool CRobotMain::EventProcess(const Event &event)
{
CEdit* pe;
CObject* pObj;
@@ -790,12 +790,12 @@ BOOL CRobotMain::EventProcess(const Event &event)
type = m_movie->RetStopType();
if ( type == MM_SATCOMopen )
{
- ChangePause(FALSE);
- SelectObject(m_infoObject, FALSE); // hands over the command buttons
+ ChangePause(false);
+ SelectObject(m_infoObject, false); // hands over the command buttons
m_map->ShowMap(m_bMapShow);
- m_displayText->HideText(FALSE);
+ m_displayText->HideText(false);
i = m_movieInfoIndex;
- StartDisplayInfo(m_movieInfoIndex, FALSE);
+ StartDisplayInfo(m_movieInfoIndex, false);
m_movieInfoIndex = i;
}
}
@@ -827,26 +827,26 @@ BOOL CRobotMain::EventProcess(const Event &event)
#endif
{
pe = (CEdit*)m_interface->SearchControl(EVENT_CMD);
- if ( pe == 0 ) return FALSE;
+ if ( pe == 0 ) return false;
pe->SetState(STATE_VISIBLE);
- pe->SetFocus(TRUE);
- if ( m_phase == PHASE_SIMUL ) ChangePause(TRUE);
- m_bCmdEdit = TRUE;
- return FALSE;
+ pe->SetFocus(true);
+ if ( m_phase == PHASE_SIMUL ) ChangePause(true);
+ m_bCmdEdit = true;
+ return false;
}
if ( event.event == EVENT_KEYDOWN &&
event.param == VK_RETURN && m_bCmdEdit )
{
char cmd[50];
pe = (CEdit*)m_interface->SearchControl(EVENT_CMD);
- if ( pe == 0 ) return FALSE;
+ if ( pe == 0 ) return false;
pe->GetText(cmd, 50);
pe->SetText("");
pe->ClearState(STATE_VISIBLE);
- if ( m_phase == PHASE_SIMUL ) ChangePause(FALSE);
+ if ( m_phase == PHASE_SIMUL ) ChangePause(false);
ExecuteCmd(cmd);
- m_bCmdEdit = FALSE;
- return FALSE;
+ m_bCmdEdit = false;
+ return false;
}
// Management of the speed change.
@@ -862,12 +862,12 @@ BOOL CRobotMain::EventProcess(const Event &event)
m_lastMousePos = event.pos;
HiliteObject(event.pos);
}
- return FALSE;
+ return false;
}
if ( !m_displayText->EventProcess(event) )
{
- return FALSE;
+ return false;
}
if ( event.event == EVENT_MOUSEMOVE )
@@ -895,7 +895,7 @@ BOOL CRobotMain::EventProcess(const Event &event)
{
StopDisplayInfo();
}
- return FALSE;
+ return false;
}
// Simulation phase of the game
@@ -916,21 +916,21 @@ BOOL CRobotMain::EventProcess(const Event &event)
if ( event.param == VK_F11 )
{
m_particule->WriteWheelTrace("Savegame\\t.bmp", 256, 256, D3DVECTOR(16.0f, 0.0f, -368.0f), D3DVECTOR(140.0f, 0.0f, -248.0f));
- return FALSE;
+ return false;
}
if ( m_bEditLock ) // current edition?
{
if ( event.param == m_engine->RetKey(KEYRANK_HELP, 0) ||
event.param == m_engine->RetKey(KEYRANK_HELP, 1) )
{
- StartDisplayInfo(SATCOM_HUSTON, FALSE);
- return FALSE;
+ StartDisplayInfo(SATCOM_HUSTON, false);
+ return false;
}
if ( event.param == m_engine->RetKey(KEYRANK_PROG, 0) ||
event.param == m_engine->RetKey(KEYRANK_PROG, 1) )
{
- StartDisplayInfo(SATCOM_PROG, FALSE);
- return FALSE;
+ StartDisplayInfo(SATCOM_PROG, false);
+ return false;
}
break;
}
@@ -942,7 +942,7 @@ BOOL CRobotMain::EventProcess(const Event &event)
{
AbortMovie();
}
- return FALSE;
+ return false;
}
if ( m_camera->RetType() == CAMERA_VISIT )
{
@@ -957,14 +957,14 @@ BOOL CRobotMain::EventProcess(const Event &event)
{
StopDisplayVisit();
}
- return FALSE;
+ return false;
}
if ( event.param == m_engine->RetKey(KEYRANK_QUIT, 0) ||
event.param == m_engine->RetKey(KEYRANK_QUIT, 1) )
{
if ( m_movie->IsExist() )
{
- StartDisplayInfo(SATCOM_HUSTON, FALSE);
+ StartDisplayInfo(SATCOM_HUSTON, false);
}
else if ( m_winDelay > 0.0f )
{
@@ -1017,12 +1017,12 @@ BOOL CRobotMain::EventProcess(const Event &event)
if ( event.param == m_engine->RetKey(KEYRANK_HELP, 0) ||
event.param == m_engine->RetKey(KEYRANK_HELP, 1) )
{
- StartDisplayInfo(SATCOM_HUSTON, TRUE);
+ StartDisplayInfo(SATCOM_HUSTON, true);
}
if ( event.param == m_engine->RetKey(KEYRANK_PROG, 0) ||
event.param == m_engine->RetKey(KEYRANK_PROG, 1) )
{
- StartDisplayInfo(SATCOM_PROG, TRUE);
+ StartDisplayInfo(SATCOM_PROG, true);
}
if ( event.param == m_engine->RetKey(KEYRANK_VISIT, 0) ||
event.param == m_engine->RetKey(KEYRANK_VISIT, 1) )
@@ -1068,7 +1068,7 @@ BOOL CRobotMain::EventProcess(const Event &event)
{
if ( !m_bEditLock )
{
- StartDisplayInfo(SATCOM_HUSTON, TRUE);
+ StartDisplayInfo(SATCOM_HUSTON, true);
}
}
}
@@ -1086,7 +1086,7 @@ BOOL CRobotMain::EventProcess(const Event &event)
case EVENT_BUTTON_QUIT:
if ( m_movie->IsExist() )
{
- StartDisplayInfo(SATCOM_HUSTON, FALSE);
+ StartDisplayInfo(SATCOM_HUSTON, false);
}
else if ( m_winDelay > 0.0f )
{
@@ -1139,11 +1139,11 @@ BOOL CRobotMain::EventProcess(const Event &event)
break;
case EVENT_OBJECT_BHELP:
- StartDisplayInfo(SATCOM_HUSTON, TRUE);
+ StartDisplayInfo(SATCOM_HUSTON, true);
break;
case EVENT_OBJECT_SOLUCE:
- StartDisplayInfo(SATCOM_SOLUCE, TRUE);
+ StartDisplayInfo(SATCOM_SOLUCE, true);
break;
case EVENT_OBJECT_MAPZOOM:
@@ -1199,7 +1199,7 @@ BOOL CRobotMain::EventProcess(const Event &event)
}
EventObject(event);
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_PERSO )
@@ -1263,10 +1263,10 @@ BOOL CRobotMain::EventProcess(const Event &event)
}
m_model->EventProcess(event);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
@@ -1333,12 +1333,12 @@ void CRobotMain::ExecuteCmd(char *cmd)
if ( m_bFreePhoto )
{
m_camera->SetType(CAMERA_FREE);
- ChangePause(TRUE);
+ ChangePause(true);
}
else
{
m_camera->SetType(CAMERA_BACK);
- ChangePause(FALSE);
+ ChangePause(false);
}
return;
}
@@ -1349,17 +1349,17 @@ void CRobotMain::ExecuteCmd(char *cmd)
if ( m_bFreePhoto )
{
m_camera->SetType(CAMERA_FREE);
- ChangePause(TRUE);
+ ChangePause(true);
DeselectAll(); // removes the control buttons
- m_map->ShowMap(FALSE);
- m_displayText->HideText(TRUE);
+ m_map->ShowMap(false);
+ m_displayText->HideText(true);
}
else
{
m_camera->SetType(CAMERA_BACK);
- ChangePause(FALSE);
+ ChangePause(false);
m_map->ShowMap(m_bMapShow);
- m_displayText->HideText(FALSE);
+ m_displayText->HideText(false);
}
return;
}
@@ -1371,7 +1371,7 @@ void CRobotMain::ExecuteCmd(char *cmd)
object = RetSelect();
if ( object != 0 )
{
- object->SetClip(FALSE);
+ object->SetClip(false);
}
return;
}
@@ -1383,7 +1383,7 @@ void CRobotMain::ExecuteCmd(char *cmd)
object = RetSelect();
if ( object != 0 )
{
- object->SetClip(TRUE);
+ object->SetClip(true);
}
return;
}
@@ -1607,11 +1607,11 @@ void CRobotMain::FlushDisplayInfo()
// Beginning of the displaying of instructions.
// index: SATCOM_*
-void CRobotMain::StartDisplayInfo(int index, BOOL bMovie)
+void CRobotMain::StartDisplayInfo(int index, bool bMovie)
{
CObject* pObj;
CMotion* motion;
- BOOL bHuman;
+ bool bHuman;
if ( m_bCmdEdit || m_bSatComLock ) return;
@@ -1625,10 +1625,10 @@ void CRobotMain::StartDisplayInfo(int index, BOOL bMovie)
{
m_movieInfoIndex = index;
m_movie->Start(MM_SATCOMopen, 2.5f);
- ChangePause(TRUE);
-//? m_map->ShowMap(FALSE);
+ ChangePause(true);
+//? m_map->ShowMap(false);
m_infoObject = DeselectAll(); // removes the control buttons
- m_displayText->HideText(TRUE);
+ m_displayText->HideText(true);
return;
}
}
@@ -1636,10 +1636,10 @@ void CRobotMain::StartDisplayInfo(int index, BOOL bMovie)
if ( m_movie->IsExist() )
{
m_movie->Stop();
- ChangePause(FALSE);
- SelectObject(m_infoObject, FALSE); // hands over the command buttons
+ ChangePause(false);
+ SelectObject(m_infoObject, false); // hands over the command buttons
//? m_map->ShowMap(m_bMapShow);
- m_displayText->HideText(FALSE);
+ m_displayText->HideText(false);
}
StartDisplayInfo(m_infoFilename[index], index);
@@ -1650,7 +1650,7 @@ void CRobotMain::StartDisplayInfo(int index, BOOL bMovie)
void CRobotMain::StartDisplayInfo(char *filename, int index)
{
CButton* pb;
- BOOL bSoluce;
+ bool bSoluce;
if ( m_bCmdEdit ) return;
@@ -1659,10 +1659,10 @@ void CRobotMain::StartDisplayInfo(char *filename, int index)
if ( !m_bEditLock )
{
-//? m_map->ShowMap(FALSE);
+//? m_map->ShowMap(false);
m_infoObject = DeselectAll(); // removes the control buttons
- m_displayText->HideText(TRUE);
- m_sound->MuteAll(TRUE);
+ m_displayText->HideText(true);
+ m_sound->MuteAll(true);
}
pb = (CButton*)m_interface->SearchControl(EVENT_BUTTON_QUIT);
@@ -1711,11 +1711,11 @@ void CRobotMain::StopDisplayInfo()
pb->SetState(STATE_VISIBLE);
}
- SelectObject(m_infoObject, FALSE); // gives the command buttons
+ SelectObject(m_infoObject, false); // gives the command buttons
//? m_map->ShowMap(m_bMapShow);
- m_displayText->HideText(FALSE);
+ m_displayText->HideText(false);
- m_sound->MuteAll(FALSE);
+ m_sound->MuteAll(false);
}
if ( m_infoUsed == 0 )
@@ -1753,9 +1753,9 @@ void CRobotMain::StartSuspend()
{
CButton* pb;
- m_map->ShowMap(FALSE);
+ m_map->ShowMap(false);
m_infoObject = DeselectAll(); // removes the control buttons
- m_displayText->HideText(TRUE);
+ m_displayText->HideText(true);
pb = (CButton*)m_interface->SearchControl(EVENT_BUTTON_QUIT);
if ( pb != 0 )
@@ -1763,7 +1763,7 @@ void CRobotMain::StartSuspend()
pb->ClearState(STATE_VISIBLE);
}
- m_bSuspend = TRUE;
+ m_bSuspend = true;
}
// End of dialogue during the game,
@@ -1778,11 +1778,11 @@ void CRobotMain::StopSuspend()
pb->SetState(STATE_VISIBLE);
}
- SelectObject(m_infoObject, FALSE); // gives the command buttons
+ SelectObject(m_infoObject, false); // gives the command buttons
m_map->ShowMap(m_bMapShow);
- m_displayText->HideText(FALSE);
+ m_displayText->HideText(false);
- m_bSuspend = FALSE;
+ m_bSuspend = false;
}
@@ -1837,13 +1837,13 @@ FPOINT CRobotMain::RetWindowDim()
// Managing windows open/save.
-void CRobotMain::SetIOPublic(BOOL bMode)
+void CRobotMain::SetIOPublic(bool bMode)
{
m_IOPublic = bMode;
SetProfileInt("Edit", "IOPublic", m_IOPublic);
}
-BOOL CRobotMain::RetIOPublic()
+bool CRobotMain::RetIOPublic()
{
return m_IOPublic;
}
@@ -1956,7 +1956,7 @@ void CRobotMain::StartDisplayVisit(EventMsg event)
m_visitArrow = 0;
}
goal = m_displayText->RetVisitGoal(event);
- m_visitArrow = CreateObject(goal, 0.0f, 1.0f, 10.0f, OBJECT_SHOW, FALSE, FALSE, 0);
+ m_visitArrow = CreateObject(goal, 0.0f, 1.0f, 10.0f, OBJECT_SHOW, false, false, 0);
m_visitPos = m_visitArrow->RetPosition(0);
m_visitPosArrow = m_visitPos;
@@ -1971,7 +1971,7 @@ void CRobotMain::StartDisplayVisit(EventMsg event)
m_camera->StartVisit(m_displayText->RetVisitGoal(event),
m_displayText->RetVisitDist(event));
m_displayText->SetVisit(event);
- ChangePause(TRUE);
+ ChangePause(true);
}
// Move the arrow to visit.
@@ -2030,10 +2030,10 @@ void CRobotMain::StopDisplayVisit()
m_camera->StopVisit();
m_displayText->ClearVisit();
- ChangePause(FALSE);
+ ChangePause(false);
if ( m_visitObject != 0 )
{
- SelectObject(m_visitObject, FALSE); // gives the command buttons
+ SelectObject(m_visitObject, false); // gives the command buttons
m_visitObject = 0;
}
}
@@ -2070,20 +2070,20 @@ CObject* CRobotMain::DeselectAll()
if ( pObj == 0 ) break;
if ( pObj->RetSelect() ) pPrev = pObj;
- pObj->SetSelect(FALSE);
+ pObj->SetSelect(false);
}
return pPrev;
}
// Selects an object, without attending to deselect the rest.
-void CRobotMain::SelectOneObject(CObject* pObj, BOOL bDisplayError)
+void CRobotMain::SelectOneObject(CObject* pObj, bool bDisplayError)
{
ObjectType type;
CObject* toto;
CMotionToto* mt;
- pObj->SetSelect(TRUE, bDisplayError);
+ pObj->SetSelect(true, bDisplayError);
m_camera->SetObject(pObj);
type = pObj->RetType();
@@ -2137,7 +2137,7 @@ void CRobotMain::SelectOneObject(CObject* pObj, BOOL bDisplayError)
// Selects the object aimed by the mouse.
-BOOL CRobotMain::SelectObject(CObject* pObj, BOOL bDisplayError)
+bool CRobotMain::SelectObject(CObject* pObj, bool bDisplayError)
{
CObject* pPrev;
@@ -2146,9 +2146,9 @@ BOOL CRobotMain::SelectObject(CObject* pObj, BOOL bDisplayError)
StopDisplayVisit();
}
- if ( m_bMovieLock || m_bEditLock || m_bPause ) return FALSE;
- if ( m_movie->IsExist() ) return FALSE;
- if ( pObj == 0 || !IsSelectable(pObj) ) return FALSE;
+ if ( m_bMovieLock || m_bEditLock || m_bPause ) return false;
+ if ( m_movie->IsExist() ) return false;
+ if ( pObj == 0 || !IsSelectable(pObj) ) return false;
pPrev = DeselectAll();
@@ -2159,12 +2159,12 @@ BOOL CRobotMain::SelectObject(CObject* pObj, BOOL bDisplayError)
SelectOneObject(pObj, bDisplayError);
m_short->UpdateShortcuts();
- return TRUE;
+ return true;
}
// Deselects the selected object.
-BOOL CRobotMain::DeselectObject()
+bool CRobotMain::DeselectObject()
{
CObject* pObj;
CObject* pPrev;
@@ -2194,7 +2194,7 @@ BOOL CRobotMain::DeselectObject()
}
m_short->UpdateShortcuts();
- return TRUE;
+ return true;
}
// Quickly removes all objects.
@@ -2206,7 +2206,7 @@ void CRobotMain::DeleteAllObjects()
int i;
// Removes all pyrotechnic effects in progress.
- while ( TRUE )
+ while ( true )
{
pyro = (CPyro*)m_iMan->SearchInstance(CLASS_PYRO, 0);
if ( pyro == 0 ) break;
@@ -2228,12 +2228,12 @@ void CRobotMain::DeleteAllObjects()
FlushShowLimit(i);
}
- while ( TRUE )
+ while ( true )
{
pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, 0);
if ( pObj == 0 ) break;
- pObj->DeleteObject(TRUE); // destroys rapidly
+ pObj->DeleteObject(true); // destroys rapidly
delete pObj;
}
}
@@ -2515,11 +2515,11 @@ CObject* CRobotMain::DetectObject(FPOINT pos)
// Indicates whether an object is selectable.
-BOOL CRobotMain::IsSelectable(CObject* pObj)
+bool CRobotMain::IsSelectable(CObject* pObj)
{
ObjectType type;
- if ( !pObj->RetSelectable() ) return FALSE;
+ if ( !pObj->RetSelectable() ) return false;
type = pObj->RetType();
if ( type == OBJECT_HUMAN ||
@@ -2569,7 +2569,7 @@ BOOL CRobotMain::IsSelectable(CObject* pObj)
type == OBJECT_SAFE ||
type == OBJECT_HUSTON )
{
- return TRUE;
+ return true;
}
if ( m_bSelectInsect )
@@ -2581,33 +2581,33 @@ BOOL CRobotMain::IsSelectable(CObject* pObj)
type == OBJECT_WORM ||
type == OBJECT_MOBILEtg )
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
// Deletes the selected object.
-BOOL CRobotMain::DeleteObject()
+bool CRobotMain::DeleteObject()
{
CObject* pObj;
CPyro* pyro;
pObj = RetSelect();
- if ( pObj == 0 ) return FALSE;
+ if ( pObj == 0 ) return false;
pyro = new CPyro(m_iMan);
pyro->Create(PT_FRAGT, pObj);
- pObj->SetSelect(FALSE); // deselects the object
+ pObj->SetSelect(false); // deselects the object
m_camera->SetType(CAMERA_EXPLO);
DeselectAll();
pObj->DeleteDeselList(pObj);
- return TRUE;
+ return true;
}
@@ -2631,12 +2631,12 @@ void CRobotMain::HiliteClear()
pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i);
if ( pObj == 0 ) break;
- pObj->SetHilite(FALSE);
+ pObj->SetHilite(false);
m_map->SetHilite(0);
m_short->SetHilite(0);
}
- m_bHilite = FALSE;
+ m_bHilite = false;
}
// Highlights the object with the mouse hovers over.
@@ -2645,7 +2645,7 @@ void CRobotMain::HiliteObject(FPOINT pos)
{
CObject* pObj;
char name[100];
- BOOL bInMap;
+ bool bInMap;
if ( m_bFixScene && m_phase != PHASE_PERSO ) return;
if ( m_bMovieLock ) return;
@@ -2694,10 +2694,10 @@ void CRobotMain::HiliteObject(FPOINT pos)
if ( IsSelectable(pObj) )
{
- pObj->SetHilite(TRUE);
+ pObj->SetHilite(true);
m_map->SetHilite(pObj);
m_short->SetHilite(pObj);
- m_bHilite = TRUE;
+ m_bHilite = true;
}
}
}
@@ -2760,7 +2760,7 @@ void CRobotMain::CreateTooltip(FPOINT pos, char* text)
if ( pw != 0 )
{
pw->SetState(STATE_SHADOW);
- pw->SetTrashEvent(FALSE);
+ pw->SetTrashEvent(false);
pos.y -= m_engine->RetText()->RetHeight(SMALLFONT, FONT_COLOBOT)/2.0f;
pw->CreateLabel(pos, dim, -1, EVENT_LABEL2, text);
@@ -2978,7 +2978,7 @@ void CRobotMain::AbortMovie()
}
}
- m_engine->SetMouseHide(FALSE);
+ m_engine->SetMouseHide(false);
}
@@ -3022,7 +3022,7 @@ void CRobotMain::InitEye()
// Advances the entire scene.
-BOOL CRobotMain::EventFrame(const Event &event)
+bool CRobotMain::EventFrame(const Event &event)
{
ObjectType type;
CObject *pObj, *toto;
@@ -3038,7 +3038,7 @@ BOOL CRobotMain::EventFrame(const Event &event)
m_gameTime > 0.1f && m_phase == PHASE_SIMUL )
{
m_displayText->DisplayError(INFO_BEGINSATCOM, D3DVECTOR(0.0f,0.0f,0.0f));
- m_bBeginSatCom = TRUE; // message appears
+ m_bBeginSatCom = true; // message appears
}
m_water->EventProcess(event);
@@ -3210,7 +3210,7 @@ BOOL CRobotMain::EventFrame(const Event &event)
if ( !m_bEditLock && m_checkEndTime+1.0f < m_time )
{
m_checkEndTime = m_time;
- CheckEndMission(TRUE);
+ CheckEndMission(true);
}
if ( m_winDelay > 0.0f && !m_bEditLock )
@@ -3264,14 +3264,14 @@ BOOL CRobotMain::EventFrame(const Event &event)
// Makes the event for all robots.
-BOOL CRobotMain::EventObject(const Event &event)
+bool CRobotMain::EventObject(const Event &event)
{
CObject* pObj;
int i;
if ( m_bFreePhoto ) return S_OK;
- m_bResetCreate = FALSE;
+ m_bResetCreate = false;
for ( i=0 ; i<1000000 ; i++ )
{
@@ -3532,16 +3532,16 @@ void CRobotMain::ScenePerso()
m_dialog->SetSceneName("perso");
m_dialog->SetSceneRank(0);
- CreateScene(FALSE, TRUE, FALSE); // sets scene
+ CreateScene(false, true, false); // sets scene
- m_engine->SetDrawWorld(FALSE); // does not draw anything on the interface
- m_engine->SetDrawFront(TRUE); // draws on the human interface
+ m_engine->SetDrawWorld(false); // does not draw anything on the interface
+ m_engine->SetDrawFront(true); // draws on the human interface
pObj = SearchHuman();
if ( pObj != 0 )
{
CMotionHuman* mh;
- pObj->SetDrawFront(TRUE); // draws the interface
+ pObj->SetDrawFront(true); // draws the interface
mh = (CMotionHuman*)pObj->RetMotion();
if ( mh != 0 )
@@ -3553,7 +3553,7 @@ void CRobotMain::ScenePerso()
// Creates the whole stage.
-void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
+void CRobotMain::CreateScene(bool bSoluce, bool bFixScene, bool bResetObject)
{
CObject* pObj;
CObject* pSel;
@@ -3581,7 +3581,7 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
m_bFixScene = bFixScene;
g_id = 0;
- m_bBase = FALSE;
+ m_bBase = false;
if ( !bResetObject )
{
@@ -3592,10 +3592,10 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
FlushDisplayInfo();
m_terrain->LevelFlush();
m_audioTrack = 0;
- m_bAudioRepeat = TRUE;
+ m_bAudioRepeat = true;
m_displayText->SetDelay(1.0f);
- m_displayText->SetEnable(TRUE);
- m_bImmediatSatCom = FALSE;
+ m_displayText->SetEnable(true);
+ m_bImmediatSatCom = false;
m_endingWinRank = 0;
m_endingLostRank = 0;
m_endTakeTotal = 0;
@@ -3604,8 +3604,8 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
m_endTakeLostDelay = 2.0f;
m_obligatoryTotal = 0;
m_prohibitedTotal = 0;
- m_bMapShow = TRUE;
- m_bMapImage = FALSE;
+ m_bMapShow = true;
+ m_bMapImage = false;
m_mapFilename[0] = 0;
m_colorRefBot.r = 10.0f/256.0f;
@@ -3763,8 +3763,8 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
if ( Cmd(line, "DeepView") && !bResetObject )
{
- m_engine->SetDeepView(OpFloat(line, "air", 500.0f)*UNIT, 0, TRUE);
- m_engine->SetDeepView(OpFloat(line, "water", 100.0f)*UNIT, 1, TRUE);
+ m_engine->SetDeepView(OpFloat(line, "air", 500.0f)*UNIT, 0, true);
+ m_engine->SetDeepView(OpFloat(line, "water", 100.0f)*UNIT, 1, true);
}
if ( Cmd(line, "FogStart") && !bResetObject )
@@ -3955,7 +3955,7 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
op = SearchOp(line, "id");
i = 0;
- while ( TRUE )
+ while ( true )
{
id[i] = GetInt(op, i, 0);
if ( id[i++] == 0 ) break;
@@ -3972,13 +3972,13 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
if ( Cmd(line, "TerrainCreate") && !bResetObject )
{
- m_terrain->CreateObjects(TRUE);
+ m_terrain->CreateObjects(true);
}
if ( Cmd(line, "BeginObject") )
{
InitEye();
- SetMovieLock(FALSE);
+ SetMovieLock(false);
if ( !m_bFixScene )
{
//? CreateObject(D3DVECTOR(0.0f, 0.0f, 0.0f), 0.0f, 0.0f, OBJECT_TOTO);
@@ -4057,7 +4057,7 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
{
pObj->SetDefRank(rankObj);
- if ( type == OBJECT_BASE ) m_bBase = TRUE;
+ if ( type == OBJECT_BASE ) m_bBase = true;
cType = OpCamera(line, "camera");
if ( cType != CAMERA_NULL )
@@ -4436,7 +4436,7 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
if ( !bResetObject )
{
ChangeColor(); // changes the colors of texture
- m_short->SetMode(FALSE); // vehicles?
+ m_short->SetMode(false); // vehicles?
}
CreateShortcuts();
@@ -4483,7 +4483,7 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
SelectObject(pSel);
m_camera->SetObject(pSel);
- m_bBeginSatCom = TRUE; // message already displayed
+ m_bBeginSatCom = true; // message already displayed
}
m_dialog->SetSceneRead("");
m_dialog->SetStackRead("");
@@ -4493,7 +4493,7 @@ void CRobotMain::CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject)
CObject* CRobotMain::CreateObject(D3DVECTOR pos, float angle, float zoom, float height,
ObjectType type, float power,
- BOOL bTrainer, BOOL bToy,
+ bool bTrainer, bool bToy,
int option)
{
CObject* pObject = 0;
@@ -4504,7 +4504,7 @@ CObject* CRobotMain::CreateObject(D3DVECTOR pos, float angle, float zoom, float
if ( type == OBJECT_HUMAN ||
type == OBJECT_TECH )
{
- bTrainer = FALSE; // necessarily
+ bTrainer = false; // necessarily
}
if ( type == OBJECT_PORTICO ||
@@ -5022,19 +5022,19 @@ void CRobotMain::ChangeColor()
colorNew2.g = 0.0f;
colorNew2.b = 0.0f;
- m_engine->ChangeColor("base1.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, TRUE);
- m_engine->ChangeColor("convert.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, TRUE);
- m_engine->ChangeColor("derrick.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, TRUE);
- m_engine->ChangeColor("factory.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, TRUE);
- m_engine->ChangeColor("lemt.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, TRUE);
- m_engine->ChangeColor("roller.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, TRUE);
- m_engine->ChangeColor("search.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, TRUE);
+ m_engine->ChangeColor("base1.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeColor("convert.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeColor("derrick.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeColor("factory.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeColor("lemt.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeColor("roller.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeColor("search.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
exclu[0] = FPOINT( 0.0f/256.0f, 160.0f/256.0f);
exclu[1] = FPOINT(256.0f/256.0f, 256.0f/256.0f); // pencils
exclu[2] = FPOINT(0.0f, 0.0f);
exclu[3] = FPOINT(0.0f, 0.0f); // terminator
- m_engine->ChangeColor("drawer.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, exclu, 0, TRUE);
+ m_engine->ChangeColor("drawer.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, exclu, 0, true);
exclu[0] = FPOINT(237.0f/256.0f, 176.0f/256.0f);
exclu[1] = FPOINT(256.0f/256.0f, 220.0f/256.0f); // blue canister
@@ -5042,7 +5042,7 @@ void CRobotMain::ChangeColor()
exclu[3] = FPOINT(130.0f/256.0f, 214.0f/256.0f); // safe location
exclu[4] = FPOINT(0.0f, 0.0f);
exclu[5] = FPOINT(0.0f, 0.0f); // terminator
- m_engine->ChangeColor("subm.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, exclu, 0, TRUE);
+ m_engine->ChangeColor("subm.tga", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, exclu, 0, true);
exclu[0] = FPOINT(128.0f/256.0f, 160.0f/256.0f);
exclu[1] = FPOINT(256.0f/256.0f, 256.0f/256.0f); // SatCom
@@ -5056,17 +5056,17 @@ void CRobotMain::ChangeColor()
// PARTIPLOUF0 and PARTIDROP :
ts = FPOINT(0.500f, 0.500f);
ti = FPOINT(0.875f, 0.750f);
- m_engine->ChangeColor("effect00.tga", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, TRUE);
+ m_engine->ChangeColor("effect00.tga", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, true);
// PARTIFLIC :
ts = FPOINT(0.00f, 0.75f);
ti = FPOINT(0.25f, 1.00f);
- m_engine->ChangeColor("effect02.tga", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, TRUE);
+ m_engine->ChangeColor("effect02.tga", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, true);
}
// Updates the number of unnecessary objects.
-BOOL CRobotMain::TestGadgetQuantity(int rank)
+bool CRobotMain::TestGadgetQuantity(int rank)
{
float percent;
int *table;
@@ -5082,8 +5082,8 @@ BOOL CRobotMain::TestGadgetQuantity(int rank)
static int table90[10] = {0,1,1,1,1,1,1,1,1,1};
percent = m_engine->RetGadgetQuantity();
- if ( percent == 0.0f ) return FALSE;
- if ( percent == 1.0f ) return TRUE;
+ if ( percent == 0.0f ) return false;
+ if ( percent == 1.0f ) return true;
if ( percent <= 0.15f ) table = table10;
else if ( percent <= 0.25f ) table = table20;
@@ -5158,7 +5158,7 @@ float CRobotMain::SearchNearestObject(D3DVECTOR center, CObject *exclu)
// Calculates a free space.
-BOOL CRobotMain::FreeSpace(D3DVECTOR &center, float minRadius, float maxRadius,
+bool CRobotMain::FreeSpace(D3DVECTOR &center, float minRadius, float maxRadius,
float space, CObject *exclu)
{
D3DVECTOR pos;
@@ -5178,7 +5178,7 @@ BOOL CRobotMain::FreeSpace(D3DVECTOR &center, float minRadius, float maxRadius,
pos.x = p.x;
pos.z = p.y;
pos.y = 0.0f;
- m_terrain->MoveOnFloor(pos, TRUE);
+ m_terrain->MoveOnFloor(pos, true);
dist = SearchNearestObject(pos, exclu);
if ( dist >= space )
{
@@ -5186,7 +5186,7 @@ BOOL CRobotMain::FreeSpace(D3DVECTOR &center, float minRadius, float maxRadius,
if ( flat >= dist/2.0f )
{
center = pos;
- return TRUE;
+ return true;
}
}
}
@@ -5205,7 +5205,7 @@ BOOL CRobotMain::FreeSpace(D3DVECTOR &center, float minRadius, float maxRadius,
pos.x = p.x;
pos.z = p.y;
pos.y = 0.0f;
- m_terrain->MoveOnFloor(pos, TRUE);
+ m_terrain->MoveOnFloor(pos, true);
dist = SearchNearestObject(pos, exclu);
if ( dist >= space )
{
@@ -5213,13 +5213,13 @@ BOOL CRobotMain::FreeSpace(D3DVECTOR &center, float minRadius, float maxRadius,
if ( flat >= dist/2.0f )
{
center = pos;
- return TRUE;
+ return true;
}
}
}
}
}
- return FALSE;
+ return false;
}
// Calculates the maximum radius of a free space.
@@ -5365,7 +5365,7 @@ void CRobotMain::FlushShowLimit(int i)
m_showLimit[i].total = 0;
m_showLimit[i].link = 0;
- m_showLimit[i].bUsed = FALSE;
+ m_showLimit[i].bUsed = false;
}
// Specifies the boundaries to show.
@@ -5392,7 +5392,7 @@ void CRobotMain::SetShowLimit(int i, ParticuleType parti, CObject *pObj,
dist = 10.0f;
}
- m_showLimit[i].bUsed = TRUE;
+ m_showLimit[i].bUsed = true;
m_showLimit[i].link = pObj;
m_showLimit[i].pos = pos;
m_showLimit[i].radius = radius;
@@ -5479,7 +5479,7 @@ void CRobotMain::FrameShowLimit(float rTime)
pos.x = rotate.x;
pos.z = rotate.y;
pos.y = 0.0f;
- m_terrain->MoveOnFloor(pos, TRUE);
+ 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);
@@ -5511,7 +5511,7 @@ char* SearchLastDir(char *filename)
// Compiles all scripts of robots.
-void CRobotMain::CompileScript(BOOL bSoluce)
+void CRobotMain::CompileScript(bool bSoluce)
{
CObject* pObj;
CBrain* brain;
@@ -5746,36 +5746,36 @@ void CRobotMain::SaveFileScript(CObject *pObj, char* filename, int objRank)
// Saves the stack of the program in execution of a robot.
-BOOL CRobotMain::SaveFileStack(CObject *pObj, FILE *file, int objRank)
+bool CRobotMain::SaveFileStack(CObject *pObj, FILE *file, int objRank)
{
ObjectType type;
CBrain* brain;
- if ( objRank == -1 ) return TRUE;
+ if ( objRank == -1 ) return true;
brain = pObj->RetBrain();
- if ( brain == 0 ) return TRUE;
+ if ( brain == 0 ) return true;
type = pObj->RetType();
- if ( type == OBJECT_HUMAN ) return TRUE;
+ if ( type == OBJECT_HUMAN ) return true;
return brain->WriteStack(file);
}
// Resumes the execution stack of the program in a robot.
-BOOL CRobotMain::ReadFileStack(CObject *pObj, FILE *file, int objRank)
+bool CRobotMain::ReadFileStack(CObject *pObj, FILE *file, int objRank)
{
ObjectType type;
CBrain* brain;
- if ( objRank == -1 ) return TRUE;
+ if ( objRank == -1 ) return true;
brain = pObj->RetBrain();
- if ( brain == 0 ) return TRUE;
+ if ( brain == 0 ) return true;
type = pObj->RetType();
- if ( type == OBJECT_HUMAN ) return TRUE;
+ if ( type == OBJECT_HUMAN ) return true;
return brain->ReadStack(file);
}
@@ -5783,20 +5783,20 @@ BOOL CRobotMain::ReadFileStack(CObject *pObj, FILE *file, int objRank)
// Empty the list.
-BOOL CRobotMain::FlushNewScriptName()
+bool CRobotMain::FlushNewScriptName()
{
int i;
for ( i=0 ; i<MAXNEWSCRIPTNAME ; i++ )
{
- m_newScriptName[i].bUsed = FALSE;
+ m_newScriptName[i].bUsed = false;
}
- return TRUE;
+ return true;
}
// Adds a script name.
-BOOL CRobotMain::AddNewScriptName(ObjectType type, char *name)
+bool CRobotMain::AddNewScriptName(ObjectType type, char *name)
{
int i;
@@ -5804,13 +5804,13 @@ BOOL CRobotMain::AddNewScriptName(ObjectType type, char *name)
{
if ( !m_newScriptName[i].bUsed )
{
- m_newScriptName[i].bUsed = TRUE;
+ m_newScriptName[i].bUsed = true;
m_newScriptName[i].type = type;
strcpy(m_newScriptName[i].name, name);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
// Seeks a script name for a given type.
@@ -5836,14 +5836,14 @@ char* CRobotMain::RetNewScriptName(ObjectType type, int rank)
// Seeks if an object occupies in a spot, to prevent a backup of the game.
-BOOL CRobotMain::IsBusy()
+bool CRobotMain::IsBusy()
{
CObject* pObj;
CBrain* pBrain;
//? CAuto* pAuto;
int i;
- if ( m_CompteurFileOpen > 0 ) return TRUE;
+ if ( m_CompteurFileOpen > 0 ) return true;
for ( i=0 ; i<1000000 ; i++ )
{
@@ -5853,16 +5853,16 @@ BOOL CRobotMain::IsBusy()
pBrain = pObj->RetBrain();
if ( pBrain != 0 )
{
- if ( pBrain->IsBusy() ) return TRUE;
+ if ( pBrain->IsBusy() ) return true;
}
//? pAuto = pObj->RetAuto();
//? if ( pAuto != 0 )
//? {
-//? if ( pAuto->RetBusy() ) return TRUE;
+//? if ( pAuto->RetBusy() ) return true;
//? }
}
- return FALSE;
+ return false;
}
// Writes an object into the backup file.
@@ -5962,7 +5962,7 @@ void CRobotMain::IOWriteObject(FILE *file, CObject* pObj, char *cmd)
// Saves the current game.
-BOOL CRobotMain::IOWriteScene(char *filename, char *filecbot, char *info)
+bool CRobotMain::IOWriteScene(char *filename, char *filecbot, char *info)
{
FILE* file;
char line[500];
@@ -5973,7 +5973,7 @@ BOOL CRobotMain::IOWriteScene(char *filename, char *filecbot, char *info)
long version;
file = fopen(filename, "w");
- if ( file == NULL ) return FALSE;
+ if ( file == NULL ) return false;
sprintf(line, "Title text=\"%s\"\n", info);
fputs(line, file);
@@ -6039,7 +6039,7 @@ BOOL CRobotMain::IOWriteScene(char *filename, char *filecbot, char *info)
#if CBOT_STACK
// Writes the file of stacks of execution.
file = fOpen(filecbot, "wb");
- if ( file == NULL ) return FALSE;
+ if ( file == NULL ) return false;
version = 1;
fWrite(&version, sizeof(long), 1, file); // version of COLOBOT
@@ -6065,7 +6065,7 @@ BOOL CRobotMain::IOWriteScene(char *filename, char *filecbot, char *info)
#endif
m_delayWriteMessage = 4; // displays message in 3 frames
- return TRUE;
+ return true;
}
// Resumes the game.
@@ -6127,7 +6127,7 @@ CObject* CRobotMain::IOReadObject(char *line, char* filename, int objRank)
}
}
- if ( type == OBJECT_BASE ) m_bBase = TRUE;
+ if ( type == OBJECT_BASE ) m_bBase = true;
pObj->Read(line);
@@ -6169,7 +6169,7 @@ CObject* CRobotMain::IOReadScene(char *filename, char *filecbot)
int i, objRank, nbError, lastError;
long version;
- m_bBase = FALSE;
+ m_bBase = false;
file = fopen(filename, "r");
if ( file == NULL ) return 0;
@@ -6369,7 +6369,7 @@ void CRobotMain::ResetObject()
int i;
// Removes all pyrotechnic effects in progress.
- while ( TRUE )
+ while ( true )
{
pyro = (CPyro*)m_iMan->SearchInstance(CLASS_PYRO, 0);
if ( pyro == 0 ) break;
@@ -6427,7 +6427,7 @@ void CRobotMain::ResetObject()
}
}
- pObj->SetEnable(TRUE); // active again
+ pObj->SetEnable(true); // active again
pos = pObj->RetResetPosition();
angle = pObj->RetResetAngle();
@@ -6445,7 +6445,7 @@ void CRobotMain::ResetObject()
}
}
#else
- m_bResetCreate = TRUE;
+ m_bResetCreate = true;
#endif
}
@@ -6477,7 +6477,7 @@ void CRobotMain::ResetCreate()
m_iMan->Flush(CLASS_PYRO);
m_camera->SetType(CAMERA_DIALOG);
- CreateScene(m_dialog->RetSceneSoluce(), FALSE, TRUE);
+ CreateScene(m_dialog->RetSceneSoluce(), false, true);
if ( !RetNiceReset() ) return;
@@ -6496,7 +6496,7 @@ void CRobotMain::ResetCreate()
// Checks if the mission is over.
-Error CRobotMain::CheckEndMission(BOOL bFrame)
+Error CRobotMain::CheckEndMission(bool bFrame)
{
CObject* pObj;
D3DVECTOR bPos, oPos;
@@ -6556,7 +6556,7 @@ Error CRobotMain::CheckEndMission(BOOL bFrame)
m_lostDelay = 0.1f; // lost immediately
m_winDelay = 0.0f;
}
- m_displayText->SetEnable(FALSE);
+ m_displayText->SetEnable(false);
return INFO_LOSTq;
}
else
@@ -6567,14 +6567,14 @@ Error CRobotMain::CheckEndMission(BOOL bFrame)
m_lostDelay = m_endTakeLostDelay; // lost in 6 seconds
m_winDelay = 0.0f;
}
- m_displayText->SetEnable(FALSE);
+ m_displayText->SetEnable(false);
return INFO_LOST;
}
}
if ( nb < m_endTake[t].min ||
nb > m_endTake[t].max )
{
- m_displayText->SetEnable(TRUE);
+ m_displayText->SetEnable(true);
return ERR_MISSION_NOTERM;
}
if ( m_endTake[t].bImmediat )
@@ -6584,7 +6584,7 @@ Error CRobotMain::CheckEndMission(BOOL bFrame)
m_winDelay = m_endTakeWinDelay; // wins in x seconds
m_lostDelay = 0.0f;
}
- m_displayText->SetEnable(FALSE);
+ m_displayText->SetEnable(false);
return ERR_OK; // mission ended
}
}
@@ -6593,7 +6593,7 @@ Error CRobotMain::CheckEndMission(BOOL bFrame)
{
if ( m_endTakeResearch != (m_endTakeResearch&g_researchDone) )
{
- m_displayText->SetEnable(TRUE);
+ m_displayText->SetEnable(true);
return ERR_MISSION_NOTERM;
}
}
@@ -6602,7 +6602,7 @@ Error CRobotMain::CheckEndMission(BOOL bFrame)
{
m_winDelay = 1.0f; // wins in one second
m_lostDelay = 0.0f;
- m_displayText->SetEnable(FALSE);
+ m_displayText->SetEnable(false);
return ERR_OK; // mission ended
}
@@ -6614,7 +6614,7 @@ Error CRobotMain::CheckEndMission(BOOL bFrame)
m_winDelay = m_endTakeWinDelay; // wins in two seconds
m_lostDelay = 0.0f;
}
- m_displayText->SetEnable(FALSE);
+ m_displayText->SetEnable(false);
return ERR_OK; // mission ended
}
@@ -6670,7 +6670,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(char *token)
{
int i;
@@ -6678,23 +6678,23 @@ BOOL CRobotMain::IsProhibitedToken(char *token)
{
if ( strcmp(token, m_prohibitedToken[i]) == 0 )
{
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
// Indicates whether it is possible to control a driving robot.
-BOOL CRobotMain::RetTrainerPilot()
+bool CRobotMain::RetTrainerPilot()
{
return m_bTrainerPilot;
}
// Indicates whether the scene is fixed, without interaction.
-BOOL CRobotMain::RetFixScene()
+bool CRobotMain::RetFixScene()
{
return m_bFixScene;
}
@@ -6721,48 +6721,48 @@ char* CRobotMain::RetScriptFile()
}
-BOOL CRobotMain::RetGlint()
+bool CRobotMain::RetGlint()
{
return m_dialog->RetGlint();
}
-BOOL CRobotMain::RetSoluce4()
+bool CRobotMain::RetSoluce4()
{
return m_dialog->RetSoluce4();
}
-BOOL CRobotMain::RetMovies()
+bool CRobotMain::RetMovies()
{
return m_dialog->RetMovies();
}
-BOOL CRobotMain::RetNiceReset()
+bool CRobotMain::RetNiceReset()
{
return m_dialog->RetNiceReset();
}
-BOOL CRobotMain::RetHimselfDamage()
+bool CRobotMain::RetHimselfDamage()
{
return m_dialog->RetHimselfDamage();
}
-BOOL CRobotMain::RetShowSoluce()
+bool CRobotMain::RetShowSoluce()
{
return m_bShowSoluce;
}
-BOOL CRobotMain::RetSceneSoluce()
+bool CRobotMain::RetSceneSoluce()
{
- if ( m_infoFilename[SATCOM_SOLUCE][0] == 0 ) return FALSE;
+ if ( m_infoFilename[SATCOM_SOLUCE][0] == 0 ) return false;
return m_dialog->RetSceneSoluce();
}
-BOOL CRobotMain::RetShowAll()
+bool CRobotMain::RetShowAll()
{
return m_bShowAll;
}
-BOOL CRobotMain::RetCheatRadar()
+bool CRobotMain::RetCheatRadar()
{
return m_bCheatRadar;
}
@@ -6816,7 +6816,7 @@ int CRobotMain::RetGamerGlasses()
// Returns the mode with just the head.
-BOOL CRobotMain::RetGamerOnlyHead()
+bool CRobotMain::RetGamerOnlyHead()
{
return m_dialog->RetGamerOnlyHead();
}
@@ -6831,7 +6831,7 @@ float CRobotMain::RetPersoAngle()
// Changes on the pause mode.
-void CRobotMain::ChangePause(BOOL bPause)
+void CRobotMain::ChangePause(bool bPause)
{
m_bPause = bPause;
m_engine->SetPause(m_bPause);
@@ -6875,10 +6875,10 @@ float CRobotMain::RetSpeed()
// Creates interface shortcuts to the units.
-BOOL CRobotMain::CreateShortcuts()
+bool CRobotMain::CreateShortcuts()
{
- if ( m_phase != PHASE_SIMUL ) return FALSE;
- if ( !m_bShortCut ) return FALSE;
+ if ( m_phase != PHASE_SIMUL ) return false;
+ if ( !m_bShortCut ) return false;
return m_short->CreateShortcuts();
}
@@ -6891,7 +6891,7 @@ void CRobotMain::UpdateMap()
// Indicates whether the mini-map is visible.
-BOOL CRobotMain::RetShowMap()
+bool CRobotMain::RetShowMap()
{
return m_map->RetShowMap() && m_bMapShow;
}
@@ -6899,7 +6899,7 @@ BOOL CRobotMain::RetShowMap()
// Management of the lock mode for movies.
-void CRobotMain::SetMovieLock(BOOL bLock)
+void CRobotMain::SetMovieLock(bool bLock)
{
m_bMovieLock = bLock;
m_engine->SetMovieLock(m_bMovieLock);
@@ -6910,31 +6910,31 @@ void CRobotMain::SetMovieLock(BOOL bLock)
m_engine->SetMouseHide(m_bMovieLock);
}
-BOOL CRobotMain::RetMovieLock()
+bool CRobotMain::RetMovieLock()
{
return m_bMovieLock;
}
-BOOL CRobotMain::RetInfoLock()
+bool CRobotMain::RetInfoLock()
{
return ( m_displayInfo != 0 ); // info in progress?
}
// Management of the blocking of the call of SatCom.
-void CRobotMain::SetSatComLock(BOOL bLock)
+void CRobotMain::SetSatComLock(bool bLock)
{
m_bSatComLock = bLock;
}
-BOOL CRobotMain::RetSatComLock()
+bool CRobotMain::RetSatComLock()
{
return m_bSatComLock;
}
// Management of the lock mode for the edition.
-void CRobotMain::SetEditLock(BOOL bLock, BOOL bEdit)
+void CRobotMain::SetEditLock(bool bLock, bool bEdit)
{
m_bEditLock = bLock;
@@ -6955,29 +6955,29 @@ void CRobotMain::SetEditLock(BOOL bLock, BOOL bEdit)
}
else
{
- m_bEditFull = FALSE;
+ m_bEditFull = false;
}
}
-BOOL CRobotMain::RetEditLock()
+bool CRobotMain::RetEditLock()
{
return m_bEditLock;
}
// Management of the fullscreen mode during editing.
-void CRobotMain::SetEditFull(BOOL bFull)
+void CRobotMain::SetEditFull(bool bFull)
{
m_bEditFull = bFull;
}
-BOOL CRobotMain::RetEditFull()
+bool CRobotMain::RetEditFull()
{
return m_bEditFull;
}
-BOOL CRobotMain::RetFreePhoto()
+bool CRobotMain::RetFreePhoto()
{
return m_bFreePhoto;
}
@@ -6985,12 +6985,12 @@ BOOL CRobotMain::RetFreePhoto()
// Indicates whether mouse is on an friend object, on which we should not shoot.
-void CRobotMain::SetFriendAim(BOOL bFriend)
+void CRobotMain::SetFriendAim(bool bFriend)
{
m_bFriendAim = bFriend;
}
-BOOL CRobotMain::RetFriendAim()
+bool CRobotMain::RetFriendAim()
{
return m_bFriendAim;
}
diff --git a/src/object/robotmain.h b/src/object/robotmain.h
index 6175a7d..893bd50 100644
--- a/src/object/robotmain.h
+++ b/src/object/robotmain.h
@@ -95,7 +95,7 @@ typedef struct
int min; // wins if>
int max; // wins if <
int lost; // lost if <=
- BOOL bImmediat;
+ bool bImmediat;
char message[100];
}
EndTake;
@@ -105,7 +105,7 @@ EndTake;
typedef struct
{
- BOOL bUsed;
+ bool bUsed;
ObjectType type;
char name[40];
}
@@ -118,7 +118,7 @@ NewScriptName;
typedef struct
{
- BOOL bUsed;
+ bool bUsed;
D3DVECTOR pos;
float radius;
int total;
@@ -149,28 +149,28 @@ public:
void CreateIni();
void ChangePhase(Phase phase);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
- BOOL CreateShortcuts();
+ bool CreateShortcuts();
void ScenePerso();
- void SetMovieLock(BOOL bLock);
- BOOL RetMovieLock();
- BOOL RetInfoLock();
- void SetSatComLock(BOOL bLock);
- BOOL RetSatComLock();
- void SetEditLock(BOOL bLock, BOOL bEdit);
- BOOL RetEditLock();
- void SetEditFull(BOOL bFull);
- BOOL RetEditFull();
- BOOL RetFreePhoto();
- void SetFriendAim(BOOL bFriend);
- BOOL RetFriendAim();
+ void SetMovieLock(bool bLock);
+ bool RetMovieLock();
+ bool RetInfoLock();
+ void SetSatComLock(bool bLock);
+ bool RetSatComLock();
+ void SetEditLock(bool bLock, bool bEdit);
+ bool RetEditLock();
+ void SetEditFull(bool bFull);
+ bool RetEditFull();
+ bool RetFreePhoto();
+ void SetFriendAim(bool bFriend);
+ bool RetFriendAim();
void SetTracePrecision(float factor);
float RetTracePrecision();
- void ChangePause(BOOL bPause);
+ void ChangePause(bool bPause);
void SetSpeed(float speed);
float RetSpeed();
@@ -180,26 +180,26 @@ public:
CObject* SearchHuman();
CObject* SearchToto();
CObject* SearchNearest(D3DVECTOR pos, CObject* pExclu);
- BOOL SelectObject(CObject* pObj, BOOL bDisplayError=TRUE);
+ bool SelectObject(CObject* pObj, bool bDisplayError=true);
CObject* RetSelectObject();
CObject* DeselectAll();
- BOOL DeleteObject();
+ bool DeleteObject();
void ResetObject();
void ResetCreate();
- Error CheckEndMission(BOOL bFrame);
+ Error CheckEndMission(bool bFrame);
void CheckEndMessage(char *message);
int RetObligatoryToken();
char* RetObligatoryToken(int i);
int IsObligatoryToken(char *token);
- BOOL IsProhibitedToken(char *token);
+ bool IsProhibitedToken(char *token);
void UpdateMap();
- BOOL RetShowMap();
+ bool RetShowMap();
MainMovieType RetMainMovie();
void FlushDisplayInfo();
- void StartDisplayInfo(int index, BOOL bMovie);
+ void StartDisplayInfo(int index, bool bMovie);
void StartDisplayInfo(char *filename, int index);
void StopDisplayInfo();
char* RetDisplayInfoName(int index);
@@ -218,8 +218,8 @@ public:
void SetWindowDim(FPOINT dim);
FPOINT RetWindowDim();
- void SetIOPublic(BOOL bMode);
- BOOL RetIOPublic();
+ void SetIOPublic(bool bMode);
+ bool RetIOPublic();
void SetIOPos(FPOINT pos);
FPOINT RetIOPos();
void SetIODim(FPOINT dim);
@@ -229,17 +229,17 @@ public:
char* RetResume();
char* RetScriptName();
char* RetScriptFile();
- BOOL RetTrainerPilot();
- BOOL RetFixScene();
- BOOL RetGlint();
- BOOL RetSoluce4();
- BOOL RetMovies();
- BOOL RetNiceReset();
- BOOL RetHimselfDamage();
- BOOL RetShowSoluce();
- BOOL RetSceneSoluce();
- BOOL RetShowAll();
- BOOL RetCheatRadar();
+ bool RetTrainerPilot();
+ bool RetFixScene();
+ bool RetGlint();
+ bool RetSoluce4();
+ bool RetMovies();
+ bool RetNiceReset();
+ bool RetHimselfDamage();
+ bool RetShowSoluce();
+ bool RetSceneSoluce();
+ bool RetShowAll();
+ bool RetCheatRadar();
char* RetSavegameDir();
char* RetPublicDir();
char* RetFilesDir();
@@ -248,7 +248,7 @@ public:
char* RetGamerName();
int RetGamerFace();
int RetGamerGlasses();
- BOOL RetGamerOnlyHead();
+ bool RetGamerOnlyHead();
float RetPersoAngle();
void StartMusic();
@@ -256,7 +256,7 @@ public:
void ChangeColor();
float SearchNearestObject(D3DVECTOR center, CObject *exclu);
- BOOL FreeSpace(D3DVECTOR &center, float minRadius, float maxRadius, float space, CObject *exclu);
+ bool FreeSpace(D3DVECTOR &center, float minRadius, float maxRadius, float space, CObject *exclu);
float RetFlatZoneRadius(D3DVECTOR center, float maxRadius, CObject *exclu);
void HideDropZone(CObject* metal);
void ShowDropZone(CObject* metal, CObject* truck);
@@ -266,24 +266,24 @@ public:
void StartShowLimit();
void FrameShowLimit(float rTime);
- void CompileScript(BOOL bSoluce);
+ void CompileScript(bool bSoluce);
void LoadOneScript(CObject *pObj, int &nbError);
void LoadFileScript(CObject *pObj, char* filename, int objRank, int &nbError);
void SaveAllScript();
void SaveOneScript(CObject *pObj);
void SaveFileScript(CObject *pObj, char* filename, int objRank);
- BOOL SaveFileStack(CObject *pObj, FILE *file, int objRank);
- BOOL ReadFileStack(CObject *pObj, FILE *file, int objRank);
+ bool SaveFileStack(CObject *pObj, FILE *file, int objRank);
+ bool ReadFileStack(CObject *pObj, FILE *file, int objRank);
- BOOL FlushNewScriptName();
- BOOL AddNewScriptName(ObjectType type, char *name);
+ bool FlushNewScriptName();
+ bool AddNewScriptName(ObjectType type, char *name);
char* RetNewScriptName(ObjectType type, int rank);
void WriteFreeParam();
void ReadFreeParam();
- BOOL IsBusy();
- BOOL IOWriteScene(char *filename, char *filecbot, char *info);
+ bool IsBusy();
+ bool IOWriteScene(char *filename, char *filecbot, char *info);
CObject* IOReadScene(char *filename, char *filecbot);
void IOWriteObject(FILE *file, CObject* pObj, char *cmd);
CObject* IOReadObject(char *line, char* filename, int objRank);
@@ -291,16 +291,16 @@ public:
int CreateSpot(D3DVECTOR pos, D3DCOLORVALUE color);
protected:
- BOOL EventFrame(const Event &event);
- BOOL EventObject(const Event &event);
+ bool EventFrame(const Event &event);
+ bool EventObject(const Event &event);
void InitEye();
void Convert();
- void CreateScene(BOOL bSoluce, BOOL bFixScene, BOOL bResetObject);
+ void CreateScene(bool bSoluce, bool bFixScene, bool bResetObject);
void CreateModel();
D3DVECTOR LookatPoint( D3DVECTOR eye, float angleH, float angleV, float length );
- CObject* CreateObject(D3DVECTOR pos, float angle, float zoom, float height, ObjectType type, float power=1.0f, BOOL bTrainer=FALSE, BOOL bToy=FALSE, int option=0);
+ CObject* CreateObject(D3DVECTOR pos, float angle, float zoom, float height, ObjectType type, float power=1.0f, bool bTrainer=false, bool bToy=false, int option=0);
int CreateLight(D3DVECTOR direction, D3DCOLORVALUE color);
void HiliteClear();
void HiliteObject(FPOINT pos);
@@ -312,10 +312,10 @@ protected:
void RemoteCamera(float pan, float zoom, float rTime);
void KeyCamera(EventMsg event, long param);
void AbortMovie();
- BOOL IsSelectable(CObject* pObj);
- void SelectOneObject(CObject* pObj, BOOL bDisplayError=TRUE);
+ bool IsSelectable(CObject* pObj);
+ void SelectOneObject(CObject* pObj, bool bDisplayError=true);
void HelpObject();
- BOOL DeselectObject();
+ bool DeselectObject();
void DeleteAllObjects();
void UpdateInfoText();
CObject* SearchObject(ObjectType type);
@@ -324,7 +324,7 @@ protected:
void FrameVisit(float rTime);
void StopDisplayVisit();
void ExecuteCmd(char *cmd);
- BOOL TestGadgetQuantity(int rank);
+ bool TestGadgetQuantity(int rank);
protected:
CInstanceManager* m_iMan;
@@ -353,41 +353,41 @@ protected:
float m_checkEndTime;
float m_winDelay;
float m_lostDelay;
- BOOL m_bFixScene; // scene fixed, no interraction
- BOOL m_bBase; // OBJECT_BASE exists in mission
+ bool m_bFixScene; // scene fixed, no interraction
+ bool m_bBase; // OBJECT_BASE exists in mission
FPOINT m_lastMousePos;
CObject* m_selectObject;
Phase m_phase;
int m_cameraRank;
D3DCOLORVALUE m_color;
- BOOL m_bFreePhoto;
- BOOL m_bCmdEdit;
- BOOL m_bShowPos;
- BOOL m_bSelectInsect;
- BOOL m_bShowSoluce;
- BOOL m_bShowAll;
- BOOL m_bCheatRadar;
- BOOL m_bAudioRepeat;
- BOOL m_bShortCut;
+ bool m_bFreePhoto;
+ bool m_bCmdEdit;
+ bool m_bShowPos;
+ bool m_bSelectInsect;
+ bool m_bShowSoluce;
+ bool m_bShowAll;
+ bool m_bCheatRadar;
+ bool m_bAudioRepeat;
+ bool m_bShortCut;
int m_audioTrack;
int m_delayWriteMessage;
int m_movieInfoIndex;
- BOOL m_bImmediatSatCom; // SatCom immediately?
- BOOL m_bBeginSatCom; // messages SatCom poster?
- BOOL m_bMovieLock; // movie in progress?
- BOOL m_bSatComLock; // call of SatCom is possible?
- BOOL m_bEditLock; // edition in progress?
- BOOL m_bEditFull; // edition in full screen?
- BOOL m_bPause; // simulation paused
- BOOL m_bHilite;
- BOOL m_bTrainerPilot; // remote trainer?
- BOOL m_bSuspend;
- BOOL m_bFriendAim;
- BOOL m_bResetCreate;
- BOOL m_bMapShow;
- BOOL m_bMapImage;
+ bool m_bImmediatSatCom; // SatCom immediately?
+ bool m_bBeginSatCom; // messages SatCom poster?
+ bool m_bMovieLock; // movie in progress?
+ bool m_bSatComLock; // call of SatCom is possible?
+ bool m_bEditLock; // edition in progress?
+ bool m_bEditFull; // edition in full screen?
+ bool m_bPause; // simulation paused
+ bool m_bHilite;
+ bool m_bTrainerPilot; // remote trainer?
+ bool m_bSuspend;
+ bool m_bFriendAim;
+ bool m_bResetCreate;
+ bool m_bMapShow;
+ bool m_bMapImage;
char m_mapFilename[100];
FPOINT m_tooltipPos;
@@ -406,13 +406,13 @@ protected:
char m_scriptFile[100];
int m_endingWinRank;
int m_endingLostRank;
- BOOL m_bWinTerminate;
+ bool m_bWinTerminate;
float m_fontSize;
FPOINT m_windowPos;
FPOINT m_windowDim;
- BOOL m_IOPublic;
+ bool m_IOPublic;
FPOINT m_IOPos;
FPOINT m_IODim;
diff --git a/src/object/task/task.cpp b/src/object/task/task.cpp
index ad1c848..4be6067 100644
--- a/src/object/task/task.cpp
+++ b/src/object/task/task.cpp
@@ -77,9 +77,9 @@ CTask::~CTask()
// Management of an event.
-BOOL CTask::EventProcess(const Event &event)
+bool CTask::EventProcess(const Event &event)
{
- return TRUE;
+ return true;
}
@@ -93,17 +93,17 @@ Error CTask::IsEnded()
// Indicates whether the action is pending.
-BOOL CTask::IsBusy()
+bool CTask::IsBusy()
{
- return TRUE;
+ return true;
}
// Suddenly ends the current action.
-BOOL CTask::Abort()
+bool CTask::Abort()
{
- return TRUE;
+ return true;
}
diff --git a/src/object/task/task.h b/src/object/task/task.h
index 1970f7f..b85fa32 100644
--- a/src/object/task/task.h
+++ b/src/object/task/task.h
@@ -60,10 +60,10 @@ public:
CTask(CInstanceManager* iMan, CObject* object);
virtual ~CTask();
- virtual BOOL EventProcess(const Event &event);
+ virtual bool EventProcess(const Event &event);
virtual Error IsEnded();
- virtual BOOL IsBusy();
- virtual BOOL Abort();
+ virtual bool IsBusy();
+ virtual bool Abort();
protected:
diff --git a/src/object/task/taskadvance.cpp b/src/object/task/taskadvance.cpp
index 8bbc7b3..41b1602 100644
--- a/src/object/task/taskadvance.cpp
+++ b/src/object/task/taskadvance.cpp
@@ -44,7 +44,6 @@
CTaskAdvance::CTaskAdvance(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
}
// Object's destructor.
@@ -56,10 +55,10 @@ CTaskAdvance::~CTaskAdvance()
// Management of an event.
-BOOL CTaskAdvance::EventProcess(const Event &event)
+bool CTaskAdvance::EventProcess(const Event &event)
{
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_fixTime += event.rTime;
@@ -68,12 +67,12 @@ BOOL CTaskAdvance::EventProcess(const Event &event)
{
m_physics->SetMotorSpeedX(0.0f); // stops the advance
m_physics->SetMotorSpeedZ(0.0f); // stops the rotation
- m_bError = TRUE;
- return TRUE;
+ m_bError = true;
+ return true;
}
m_timeLimit -= event.rTime;
- return TRUE;
+ return true;
}
@@ -95,7 +94,7 @@ Error CTaskAdvance::Start(float length)
m_physics->SetMotorSpeedY(0.0f);
m_physics->SetMotorSpeedZ(0.0f);
- m_bError = FALSE;
+ m_bError = false;
return ERR_OK;
}
diff --git a/src/object/task/taskadvance.h b/src/object/task/taskadvance.h
index 8717728..2b2dcef 100644
--- a/src/object/task/taskadvance.h
+++ b/src/object/task/taskadvance.h
@@ -36,7 +36,7 @@ public:
CTaskAdvance(CInstanceManager* iMan, CObject* object);
~CTaskAdvance();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(float length);
Error IsEnded();
@@ -51,6 +51,6 @@ protected:
D3DVECTOR m_startPos;
float m_lastDist;
float m_fixTime;
- BOOL m_bError;
+ bool m_bError;
};
diff --git a/src/object/task/taskbuild.cpp b/src/object/task/taskbuild.cpp
index 5992e5d..77ee14d 100644
--- a/src/object/task/taskbuild.cpp
+++ b/src/object/task/taskbuild.cpp
@@ -56,8 +56,6 @@ CTaskBuild::CTaskBuild(CInstanceManager* iMan, CObject* object)
{
int i;
- CTask::CTask(iMan, object);
-
m_type = OBJECT_DERRICK;
m_time = 0.0f;
m_soundChannel = -1;
@@ -91,17 +89,17 @@ CTaskBuild::~CTaskBuild()
// Creates a building.
-BOOL CTaskBuild::CreateBuilding(D3DVECTOR pos, float angle)
+bool CTaskBuild::CreateBuilding(D3DVECTOR pos, float angle)
{
m_building = new CObject(m_iMan);
if ( !m_building->CreateBuilding(pos, angle, 0.0f, m_type, 0.0f) )
{
delete m_building;
m_building = 0;
- return FALSE;
+ return false;
}
m_building->UpdateMapping();
- m_building->SetLock(TRUE); // not yet usable
+ m_building->SetLock(true); // not yet usable
if ( m_type == OBJECT_DERRICK ) m_buildingHeight = 35.0f;
if ( m_type == OBJECT_FACTORY ) m_buildingHeight = 28.0f;
@@ -121,7 +119,7 @@ BOOL CTaskBuild::CreateBuilding(D3DVECTOR pos, float angle)
m_buildingPos = m_building->RetPosition(0);
m_buildingPos.y -= m_buildingHeight;
m_building->SetPosition(0, m_buildingPos);
- return TRUE;
+ return true;
}
// Creates lights for the effects.
@@ -185,7 +183,7 @@ void CTaskBuild::CreateLight()
angle += (PI*2.0f)/TBMAXLIGHT;
}
- m_bBlack = FALSE;
+ m_bBlack = false;
}
// Switches the lights from black to white.
@@ -207,21 +205,21 @@ void CTaskBuild::BlackLight()
m_light->SetLightColorSpeed(m_lightRank[i], 1.0f/((1.0f/m_speed)*0.75f));
}
- m_bBlack = TRUE;
+ m_bBlack = true;
}
// Management of an event.
-BOOL CTaskBuild::EventProcess(const Event &event)
+bool CTaskBuild::EventProcess(const Event &event)
{
D3DMATRIX* mat;
D3DVECTOR pos, dir, speed;
FPOINT dim;
float a, g, cirSpeed, dist, linSpeed;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
m_time += event.rTime;
@@ -236,7 +234,7 @@ BOOL CTaskBuild::EventProcess(const Event &event)
if ( cirSpeed < -1.0f ) cirSpeed = -1.0f;
m_physics->SetMotorSpeedZ(cirSpeed); // turns left/right
- return TRUE;
+ return true;
}
if ( m_phase == TBP_MOVE ) // preliminary forward/backward?
@@ -246,48 +244,48 @@ BOOL CTaskBuild::EventProcess(const Event &event)
if ( dist > 30.0f ) linSpeed = 1.0f;
if ( dist < 30.0f ) linSpeed = -1.0f;
m_physics->SetMotorSpeedX(linSpeed); // forward/backward
- return TRUE;
+ return true;
}
if ( m_phase == TBP_RECEDE ) // terminal back?
{
m_physics->SetMotorSpeedX(-1.0f); // back
- return TRUE;
+ return true;
}
if ( m_phase == TBP_TAKE ) // takes gun?
{
- return TRUE;
+ return true;
}
if ( m_phase == TBP_PREP ) // prepares?
{
- return TRUE;
+ return true;
}
if ( m_phase == TBP_TERM ) // ends?
{
- return TRUE;
+ return true;
}
if ( !m_bBuild ) // building to build?
{
- m_bBuild = TRUE;
+ m_bBuild = true;
pos = m_metal->RetPosition(0);
a = m_object->RetAngleY(0);
if ( !CreateBuilding(pos, a+PI) )
{
- m_metal->SetLock(FALSE); // usable again
+ m_metal->SetLock(false); // usable again
m_motion->SetAction(-1);
m_object->SetObjectParent(14, 0);
m_object->SetPosition(14, D3DVECTOR(-1.5f, 0.3f, -1.35f));
m_object->SetAngleZ(14, PI);
m_camera->FlushEffect();
Abort();
- m_bError = TRUE;
+ m_bError = true;
m_displayText->DisplayError(ERR_TOOMANY, m_object->RetPosition(0));
- return FALSE;
+ return false;
}
CreateLight();
}
@@ -340,7 +338,7 @@ BOOL CTaskBuild::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -360,7 +358,7 @@ Error CTaskBuild::Start(ObjectType type)
iAngle = NormAngle(iAngle); // 0..2*PI
oAngle = iAngle;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
pos = m_object->RetPosition(0);
if ( pos.y < m_water->RetLevel() ) return ERR_BUILD_WATER;
@@ -385,7 +383,7 @@ Error CTaskBuild::Start(ObjectType type)
err = FlatFloor();
if ( err != ERR_OK ) return err;
- m_metal->SetLock(TRUE); // not usable
+ m_metal->SetLock(true); // not usable
m_camera->StartCentering(m_object, PI*0.15f, 99.9f, 0.0f, 1.0f);
m_phase = TBP_TURN; // rotation necessary preliminary
@@ -396,10 +394,10 @@ Error CTaskBuild::Start(ObjectType type)
pm = m_metal->RetPosition(0);
m_angleZ = RotateAngle(Length2d(pv, pm), Abs(pv.y-pm.y));
- m_physics->SetFreeze(TRUE); // it does not move
+ m_physics->SetFreeze(true); // it does not move
- m_bBuild = FALSE; // not yet built
- m_bError = FALSE; // ok
+ m_bBuild = false; // not yet built
+ m_bError = false; // ok
return ERR_OK;
}
@@ -456,7 +454,7 @@ Error CTaskBuild::IsEnded()
{
if ( m_progress > 1.0f ) // timeout?
{
- m_metal->SetLock(FALSE); // usable again
+ m_metal->SetLock(false); // usable again
if ( dist < 30.0f ) return ERR_BUILD_METALNEAR;
else return ERR_BUILD_METALAWAY;
}
@@ -482,7 +480,7 @@ Error CTaskBuild::IsEnded()
{
if ( m_progress < 1.0f ) return ERR_CONTINUE;
- m_soundChannel = m_sound->Play(SOUND_TREMBLE, m_object->RetPosition(0), 0.0f, 1.0f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_TREMBLE, m_object->RetPosition(0), 0.0f, 1.0f, true);
m_sound->AddEnvelope(m_soundChannel, 0.7f, 1.0f, 1.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.7f, 1.5f, 7.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 1.5f, 2.0f, SOPER_STOP);
@@ -506,7 +504,7 @@ Error CTaskBuild::IsEnded()
m_building->SetZoom(0, 1.0f);
m_building->SetCirVibration(D3DVECTOR(0.0f, 0.0f, 0.0f));
- m_building->SetLock(FALSE); // building usable
+ m_building->SetLock(false); // building usable
m_main->CreateShortcuts();
m_displayText->DisplayError(INFO_BUILD, m_buildingPos, 10.0f, 50.0f);
@@ -555,7 +553,7 @@ Error CTaskBuild::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskBuild::Abort()
+bool CTaskBuild::Abort()
{
if ( m_soundChannel != -1 )
{
@@ -565,8 +563,8 @@ BOOL CTaskBuild::Abort()
}
m_camera->StopCentering(m_object, 2.0f);
- m_physics->SetFreeze(FALSE); // is moving again
- return TRUE;
+ m_physics->SetFreeze(false); // is moving again
+ return true;
}
@@ -581,7 +579,7 @@ Error CTaskBuild::FlatFloor()
FPOINT c, p;
float radius, max, oRadius, bRadius, angle, dist;
int i, j;
- BOOL bLittleFlat, bBase;
+ bool bLittleFlat, bBase;
radius = 0.0f;
if ( m_type == OBJECT_DERRICK ) radius = 5.0f;
@@ -614,7 +612,7 @@ Error CTaskBuild::FlatFloor()
}
max = 100000.0f;
- bBase = FALSE;
+ bBase = false;
for ( i=0 ; i<1000000 ; i++ )
{
pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i);
@@ -635,7 +633,7 @@ Error CTaskBuild::FlatFloor()
max = dist;
bPos = oPos;
bRadius = oRadius;
- bBase = TRUE;
+ bBase = true;
}
}
else
@@ -649,7 +647,7 @@ Error CTaskBuild::FlatFloor()
max = dist;
bPos = oPos;
bRadius = oRadius;
- bBase = FALSE;
+ bBase = false;
}
}
}
@@ -725,7 +723,7 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
ObjectType type;
float min, iAngle, a, aa, aBest, distance, magic;
int i;
- BOOL bMetal;
+ bool bMetal;
iPos = m_object->RetPosition(0);
iAngle = m_object->RetAngleY(0);
@@ -733,7 +731,7 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
min = 1000000.0f;
pBest = 0;
- bMetal = FALSE;
+ bMetal = false;
for ( i=0 ; i<1000000 ; i++ )
{
pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i);
@@ -745,7 +743,7 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
type = pObj->RetType();
if ( type != OBJECT_METAL ) continue;
- bMetal = TRUE; // metal exists
+ bMetal = true; // metal exists
oPos = pObj->RetPosition(0);
distance = Length(oPos, iPos);
diff --git a/src/object/task/taskbuild.h b/src/object/task/taskbuild.h
index 4f045b1..337edb7 100644
--- a/src/object/task/taskbuild.h
+++ b/src/object/task/taskbuild.h
@@ -53,15 +53,15 @@ public:
CTaskBuild(CInstanceManager* iMan, CObject* object);
~CTaskBuild();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(ObjectType type);
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
Error FlatFloor();
- BOOL CreateBuilding(D3DVECTOR pos, float angle);
+ bool CreateBuilding(D3DVECTOR pos, float angle);
void CreateLight();
void BlackLight();
CObject* SearchMetalObject(float &angle, float dMin, float dMax, float aLimit, Error &err);
@@ -73,9 +73,9 @@ protected:
CObject* m_power; // the vehicle battery
CObject* m_building; // building built
TaskBuildPhase m_phase; // phase of the operation
- BOOL m_bError; // TRUE -> operation impossible
- BOOL m_bBuild; // TRUE -> building built
- BOOL m_bBlack; // TRUE -> lights black -> white
+ bool m_bError; // true -> operation impossible
+ bool m_bBuild; // true -> building built
+ bool m_bBlack; // true -> lights black -> white
float m_time; // absolute time
float m_lastParticule; // time of generation last particle
float m_progress; // progression (0..1)
diff --git a/src/object/task/taskfire.cpp b/src/object/task/taskfire.cpp
index 0944931..02c4159 100644
--- a/src/object/task/taskfire.cpp
+++ b/src/object/task/taskfire.cpp
@@ -50,7 +50,6 @@
CTaskFire::CTaskFire(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
m_soundChannel = -1;
}
@@ -69,7 +68,7 @@ CTaskFire::~CTaskFire()
// Management of an event.
-BOOL CTaskFire::EventProcess(const Event &event)
+bool CTaskFire::EventProcess(const Event &event)
{
CObject* power;
CPhysics* physics;
@@ -80,9 +79,9 @@ BOOL CTaskFire::EventProcess(const Event &event)
float energy, fire;
int i, channel;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
m_time += event.rTime;
m_lastSound -= event.rTime;
@@ -273,7 +272,7 @@ BOOL CTaskFire::EventProcess(const Event &event)
m_sound->Play(SOUND_FIREp, m_object->RetPosition(0));
}
- return TRUE;
+ return true;
}
@@ -286,7 +285,7 @@ Error CTaskFire::Start(float delay)
float energy, fire;
ObjectType type;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
type = m_object->RetType();
if ( type != OBJECT_MOBILEfc &&
@@ -307,13 +306,13 @@ Error CTaskFire::Start(float delay)
m_bRay = (type == OBJECT_MOBILErc);
- m_bOrganic = FALSE;
+ m_bOrganic = false;
if ( type == OBJECT_MOBILEfi ||
type == OBJECT_MOBILEti ||
type == OBJECT_MOBILEwi ||
type == OBJECT_MOBILEii )
{
- m_bOrganic = TRUE;
+ m_bOrganic = true;
}
if ( delay == 0.0f )
@@ -336,13 +335,13 @@ Error CTaskFire::Start(float delay)
m_time = 0.0f;
m_lastParticule = 0.0f;
m_lastSound = 0.0f;
- m_bError = FALSE; // ok
+ m_bError = false; // ok
//? m_camera->StartCentering(m_object, PI*0.15f, 99.9f, 0.0f, 1.0f);
if ( m_bOrganic )
{
- m_soundChannel = m_sound->Play(SOUND_FIREi, m_object->RetPosition(0), 1.0f, 1.0f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_FIREi, m_object->RetPosition(0), 1.0f, 1.0f, true);
if ( m_soundChannel != -1 )
{
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, m_delay, SOPER_CONTINUE);
@@ -354,7 +353,7 @@ Error CTaskFire::Start(float delay)
}
else
{
- m_soundChannel = m_sound->Play(SOUND_FIRE, m_object->RetPosition(0), 1.0f, 1.0f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_FIRE, m_object->RetPosition(0), 1.0f, 1.0f, true);
if ( m_soundChannel != -1 )
{
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, m_delay, SOPER_CONTINUE);
@@ -379,7 +378,7 @@ Error CTaskFire::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskFire::Abort()
+bool CTaskFire::Abort()
{
m_object->SetInclinaison(D3DVECTOR(0.0f, 0.0f, 0.0f));
m_object->SetCirVibration(D3DVECTOR(0.0f, 0.0f, 0.0f));
@@ -393,6 +392,6 @@ BOOL CTaskFire::Abort()
}
//? m_camera->StopCentering(m_object, 1.0f);
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskfire.h b/src/object/task/taskfire.h
index 72b5402..f3d4490 100644
--- a/src/object/task/taskfire.h
+++ b/src/object/task/taskfire.h
@@ -35,20 +35,20 @@ public:
CTaskFire(CInstanceManager* iMan, CObject* object);
~CTaskFire();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(float delay);
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
protected:
float m_delay;
float m_progress;
- BOOL m_bError;
- BOOL m_bRay;
- BOOL m_bOrganic;
+ bool m_bError;
+ bool m_bRay;
+ bool m_bOrganic;
float m_time;
float m_speed;
float m_lastParticule;
diff --git a/src/object/task/taskfireant.cpp b/src/object/task/taskfireant.cpp
index 6947c1b..6f3b9c9 100644
--- a/src/object/task/taskfireant.cpp
+++ b/src/object/task/taskfireant.cpp
@@ -47,8 +47,6 @@
CTaskFireAnt::CTaskFireAnt(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
-
m_phase = TFA_NULL;
}
@@ -61,19 +59,19 @@ CTaskFireAnt::~CTaskFireAnt()
// Management of an event.
-BOOL CTaskFireAnt::EventProcess(const Event &event)
+bool CTaskFireAnt::EventProcess(const Event &event)
{
D3DVECTOR dir, vib;
float a, g, cirSpeed;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
if ( m_object->RetFixed() ) // insect on its back?
{
- m_bError = TRUE;
- return FALSE;
+ m_bError = true;
+ return false;
}
m_time += event.rTime;
@@ -90,7 +88,7 @@ BOOL CTaskFireAnt::EventProcess(const Event &event)
m_physics->SetMotorSpeedZ(cirSpeed); // turns left/right
}
- return TRUE;
+ return true;
}
@@ -103,7 +101,7 @@ Error CTaskFireAnt::Start(D3DVECTOR impact)
m_impact = impact;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
if ( !m_physics->RetLand() ) return ERR_FIRE_VEH;
type = m_object->RetType();
@@ -122,8 +120,8 @@ Error CTaskFireAnt::Start(D3DVECTOR impact)
m_progress = 0.0f;
m_time = 0.0f;
m_lastParticule = 0.0f;
- m_bError = FALSE; // ok
- m_bFire = FALSE; // once!
+ m_bError = false; // ok
+ m_bFire = false; // once!
return ERR_OK;
}
@@ -174,7 +172,7 @@ Error CTaskFireAnt::IsEnded()
{
if ( m_progress > 0.75f && !m_bFire )
{
- m_bFire = TRUE; // once
+ m_bFire = true; // once
for ( i=0 ; i<20 ; i++ )
{
@@ -219,9 +217,9 @@ Error CTaskFireAnt::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskFireAnt::Abort()
+bool CTaskFireAnt::Abort()
{
m_motion->SetAction(-1);
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskfireant.h b/src/object/task/taskfireant.h
index 18eef90..a94d943 100644
--- a/src/object/task/taskfireant.h
+++ b/src/object/task/taskfireant.h
@@ -47,11 +47,11 @@ public:
CTaskFireAnt(CInstanceManager* iMan, CObject* object);
~CTaskFireAnt();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(D3DVECTOR impact);
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
@@ -61,8 +61,8 @@ protected:
float m_progress;
float m_speed;
float m_angle;
- BOOL m_bError;
- BOOL m_bFire;
+ bool m_bError;
+ bool m_bFire;
float m_time;
float m_lastParticule;
};
diff --git a/src/object/task/taskflag.cpp b/src/object/task/taskflag.cpp
index 6c228c4..667b179 100644
--- a/src/object/task/taskflag.cpp
+++ b/src/object/task/taskflag.cpp
@@ -52,7 +52,6 @@
CTaskFlag::CTaskFlag(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
}
// Object's destructor.
@@ -64,15 +63,15 @@ CTaskFlag::~CTaskFlag()
// Management of an event.
-BOOL CTaskFlag::EventProcess(const Event &event)
+bool CTaskFlag::EventProcess(const Event &event)
{
- if ( m_bError ) return TRUE;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_bError ) return true;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_time += event.rTime;
- return TRUE;
+ return true;
}
@@ -87,7 +86,7 @@ Error CTaskFlag::Start(TaskFlagOrder order, int rank)
m_order = order;
m_time = 0.0f;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
if ( !m_physics->RetLand() )
{
pos = m_object->RetPosition(0);
@@ -113,7 +112,7 @@ Error CTaskFlag::Start(TaskFlagOrder order, int rank)
if ( err != ERR_OK ) return err;
}
- m_bError = FALSE;
+ m_bError = false;
m_motion->SetAction(MHS_FLAG); // sets/removes flag
m_camera->StartCentering(m_object, PI*0.3f, 99.9f, 0.0f, 0.5f);
@@ -136,11 +135,11 @@ Error CTaskFlag::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskFlag::Abort()
+bool CTaskFlag::Abort()
{
m_motion->SetAction(-1);
m_camera->StopCentering(m_object, 2.0f);
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskflag.h b/src/object/task/taskflag.h
index 4c06630..31876fe 100644
--- a/src/object/task/taskflag.h
+++ b/src/object/task/taskflag.h
@@ -43,11 +43,11 @@ public:
CTaskFlag(CInstanceManager* iMan, CObject* object);
~CTaskFlag();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(TaskFlagOrder order, int rank);
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
Error CreateFlag(int rank);
@@ -58,6 +58,6 @@ protected:
protected:
TaskFlagOrder m_order;
float m_time;
- BOOL m_bError;
+ bool m_bError;
};
diff --git a/src/object/task/taskgoto.cpp b/src/object/task/taskgoto.cpp
index ec10f0a..7e4d3f1 100644
--- a/src/object/task/taskgoto.cpp
+++ b/src/object/task/taskgoto.cpp
@@ -51,8 +51,6 @@
CTaskGoto::CTaskGoto(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
-
m_bmArray = 0;
}
@@ -66,25 +64,25 @@ CTaskGoto::~CTaskGoto()
// Management of an event.
-BOOL CTaskGoto::EventProcess(const Event &event)
+bool CTaskGoto::EventProcess(const Event &event)
{
D3DVECTOR pos, goal;
FPOINT rot, repulse;
float a, g, dist, linSpeed, cirSpeed, h, hh, factor, dir;
Error ret;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
// Momentarily stationary object (ant on the back)?
if ( m_object->RetFixed() )
{
m_physics->SetMotorSpeedX(0.0f); // stops the advance
m_physics->SetMotorSpeedZ(0.0f); // stops the rotation
- return TRUE;
+ return true;
}
- if ( m_error != ERR_OK ) return FALSE;
+ if ( m_error != ERR_OK ) return false;
if ( m_bWorm )
{
@@ -129,7 +127,7 @@ BOOL CTaskGoto::EventProcess(const Event &event)
m_physics->SetMotorSpeedZ(cirSpeed); // turns left / right
m_physics->SetMotorSpeedX(linSpeed); // advance
- return TRUE;
+ return true;
}
if ( m_phase == TGP_BEAMSEARCH ) // search path?
@@ -190,27 +188,27 @@ BOOL CTaskGoto::EventProcess(const Event &event)
BitmapDebug(min, max, m_object->RetPosition(0), m_goal);
#endif
m_error = ret;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
if ( m_phase == TGP_BEAMWCOLD ) // expects cooled reactor?
{
- return TRUE;
+ return true;
}
if ( m_phase == TGP_BEAMUP ) // off?
{
m_physics->SetMotorSpeedY(1.0f); // up
- return TRUE;
+ return true;
}
if ( m_phase == TGP_BEAMGOTO ) // goto dot list? (?)
{
if ( m_physics->RetCollision() ) // collision?
{
- m_physics->SetCollision(FALSE); // there's more
+ m_physics->SetCollision(false); // there's more
}
pos = m_object->RetPosition(0);
@@ -231,7 +229,7 @@ BOOL CTaskGoto::EventProcess(const Event &event)
{
goal = m_bmPoints[m_bmIndex];
goal.y = pos.y;
- h = m_terrain->RetFloorHeight(goal, TRUE, TRUE);
+ h = m_terrain->RetFloorHeight(goal, true, true);
dist = Length2d(pos, goal);
if ( dist != 0.0f ) // anticipates?
{
@@ -241,7 +239,7 @@ BOOL CTaskGoto::EventProcess(const Event &event)
goal.z = pos.z + (goal.z-pos.z)*linSpeed*20.0f/dist;
}
goal.y = pos.y;
- hh = m_terrain->RetFloorHeight(goal, TRUE, TRUE);
+ hh = m_terrain->RetFloorHeight(goal, true, true);
h = Min(h, hh);
linSpeed = 0.0f;
if ( h < m_altitude-1.0f )
@@ -303,24 +301,24 @@ BOOL CTaskGoto::EventProcess(const Event &event)
m_physics->SetMotorSpeedX(0.0f); // stops the advance
m_physics->SetMotorSpeedZ(0.0f); // stops the rotation
BeamStart(); // we start all
- return TRUE;
+ return true;
}
m_physics->SetMotorSpeedZ(cirSpeed); // turns left / right
m_physics->SetMotorSpeedX(linSpeed); // advance
- return TRUE;
+ return true;
}
if ( m_phase == TGP_BEAMDOWN ) // landed?
{
m_physics->SetMotorSpeedY(-0.5f); // tomb
- return TRUE;
+ return true;
}
if ( m_phase == TGP_LAND ) // landed?
{
m_physics->SetMotorSpeedY(-0.5f); // tomb
- return TRUE;
+ return true;
}
if ( m_goalMode == TGG_EXPRESS )
@@ -329,9 +327,9 @@ BOOL CTaskGoto::EventProcess(const Event &event)
{
if ( m_physics->RetCollision() ) // collision?
{
- m_physics->SetCollision(FALSE); // there's more
+ m_physics->SetCollision(false); // there's more
m_error = ERR_STOP;
- return TRUE;
+ return true;
}
}
@@ -339,7 +337,7 @@ BOOL CTaskGoto::EventProcess(const Event &event)
if ( m_altitude > 0.0f )
{
- h = m_terrain->RetFloorHeight(pos, TRUE, TRUE);
+ h = m_terrain->RetFloorHeight(pos, true, true);
linSpeed = 0.0f;
if ( h < m_altitude )
{
@@ -362,7 +360,7 @@ BOOL CTaskGoto::EventProcess(const Event &event)
m_physics->SetMotorSpeedZ(cirSpeed); // turns left / right
m_physics->SetMotorSpeedX(1.0f); // advance
- return TRUE;
+ return true;
}
if ( m_phase != TGP_TURN &&
@@ -375,7 +373,7 @@ BOOL CTaskGoto::EventProcess(const Event &event)
if ( factor < 0.0f ) factor = 0.0f;
if ( factor > 1.0f ) factor = 1.0f;
- h = m_terrain->RetFloorHeight(m_object->RetPosition(0), TRUE, TRUE);
+ h = m_terrain->RetFloorHeight(m_object->RetPosition(0), true, true);
linSpeed = 0.0f;
if ( h < (m_altitude-0.5f)*factor && factor == 1.0f )
{
@@ -395,10 +393,10 @@ BOOL CTaskGoto::EventProcess(const Event &event)
{
if ( m_physics->RetCollision() ) // collision?
{
- m_physics->SetCollision(FALSE); // there's more
+ m_physics->SetCollision(false); // there's more
m_time = 0.0f;
m_phase = TGP_CRWAIT;
- return TRUE;
+ return true;
}
#if 0
@@ -487,10 +485,10 @@ BOOL CTaskGoto::EventProcess(const Event &event)
{
if ( m_physics->RetCollision() ) // collision?
{
- m_physics->SetCollision(FALSE); // there's more
+ m_physics->SetCollision(false); // there's more
m_time = 0.0f;
m_phase = TGP_CLWAIT;
- return TRUE;
+ return true;
}
m_physics->SetMotorSpeedX(0.5f); // advance mollo
}
@@ -499,10 +497,10 @@ BOOL CTaskGoto::EventProcess(const Event &event)
{
if ( m_physics->RetCollision() ) // collision?
{
- m_physics->SetCollision(FALSE); // there's more
+ m_physics->SetCollision(false); // there's more
m_time = 0.0f;
m_phase = TGP_CRWAIT;
- return TRUE;
+ return true;
}
m_physics->SetMotorSpeedX(0.5f); // advance mollo
}
@@ -513,7 +511,7 @@ BOOL CTaskGoto::EventProcess(const Event &event)
m_physics->SetMotorSpeedX(1.0f);
}
- return TRUE;
+ return true;
}
@@ -618,7 +616,7 @@ void CTaskGoto::WormFrame(float rTime)
dist = Length(pos, impact);
if ( dist <= 15.0f )
{
- pObj->SetVirusMode(TRUE); // bam, infected!
+ pObj->SetVirusMode(true); // bam, infected!
}
}
}
@@ -672,7 +670,7 @@ Error CTaskGoto::Start(D3DVECTOR goal, float altitude,
m_goalObject = goal;
m_goal = goal;
- m_bTake = FALSE;
+ m_bTake = false;
m_phase = TGP_ADVANCE;
m_error = ERR_OK;
m_try = 0;
@@ -686,14 +684,14 @@ Error CTaskGoto::Start(D3DVECTOR goal, float altitude,
m_crashMode = TGC_RIGHTLEFT;
}
- m_bWorm = FALSE;
+ m_bWorm = false;
if ( type == OBJECT_WORM )
{
- m_bWorm = TRUE;
+ m_bWorm = true;
m_wormLastTime = 0.0f;
}
- m_bApprox = FALSE;
+ m_bApprox = false;
if ( type == OBJECT_HUMAN ||
type == OBJECT_TECH ||
type == OBJECT_MOTHER ||
@@ -706,7 +704,7 @@ Error CTaskGoto::Start(D3DVECTOR goal, float altitude,
type == OBJECT_MOBILErr ||
type == OBJECT_MOBILErs )
{
- m_bApprox = TRUE;
+ m_bApprox = true;
}
if ( !m_bApprox && m_crashMode != TGC_BEAM )
@@ -721,12 +719,12 @@ Error CTaskGoto::Start(D3DVECTOR goal, float altitude,
dist = 0.0f;
AdjustTarget(target, m_goal, dist);
}
- m_bTake = TRUE; // object was taken on arrival (final rotation)
+ m_bTake = true; // object was taken on arrival (final rotation)
}
}
m_lastDistance = 1000.0f;
- m_physics->SetCollision(FALSE);
+ m_physics->SetCollision(false);
if ( m_crashMode == TGC_BEAM ) // with the algorithm of rays?
{
@@ -751,7 +749,7 @@ Error CTaskGoto::Start(D3DVECTOR goal, float altitude,
m_bmFinalMove = dist;
}
}
- m_bTake = TRUE; // object was taken on arrival (final rotation)
+ m_bTake = true; // object was taken on arrival (final rotation)
}
if ( m_physics->RetType() == TYPE_FLYING && m_altitude == 0.0f )
@@ -833,7 +831,7 @@ Error CTaskGoto::IsEnded()
{
if ( m_physics->RetType() == TYPE_FLYING && m_altitude > 0.0f )
{
- level = m_terrain->RetFloorLevel(pos, TRUE, TRUE);
+ level = m_terrain->RetFloorLevel(pos, true, true);
h = level+m_altitude-20.0f;
limit = m_terrain->RetFlyingMaxHeight();
if ( h > limit ) h = limit;
@@ -1096,9 +1094,9 @@ CObject* CTaskGoto::SearchTarget(D3DVECTOR pos, float margin)
}
// Adjusts the target as a function of the object.
-// Returns TRUE if it is cargo laying on the ground, which can be approached from any site.
+// Returns true if it is cargo laying on the ground, which can be approached from any site.
-BOOL CTaskGoto::AdjustTarget(CObject* pObj, D3DVECTOR &pos, float &distance)
+bool CTaskGoto::AdjustTarget(CObject* pObj, D3DVECTOR &pos, float &distance)
{
ObjectType type;
Character* character;
@@ -1111,7 +1109,7 @@ BOOL CTaskGoto::AdjustTarget(CObject* pObj, D3DVECTOR &pos, float &distance)
type == OBJECT_WORM )
{
pos = pObj->RetPosition(0);
- return FALSE; // single approach
+ return false; // single approach
}
type = pObj->RetType();
@@ -1146,7 +1144,7 @@ BOOL CTaskGoto::AdjustTarget(CObject* pObj, D3DVECTOR &pos, float &distance)
goal = pObj->RetPosition(0);
dist = Length(goal, pos);
pos = (pos-goal)*(TAKE_DIST+distance)/dist + goal;
- return TRUE; // approach from all sites
+ return true; // approach from all sites
}
if ( type == OBJECT_BASE )
@@ -1155,7 +1153,7 @@ BOOL CTaskGoto::AdjustTarget(CObject* pObj, D3DVECTOR &pos, float &distance)
goal = pObj->RetPosition(0);
dist = Length(goal, pos);
pos = (pos-goal)*(TAKE_DIST+distance)/dist + goal;
- return TRUE; // approach from all sites
+ return true; // approach from all sites
}
if ( type == OBJECT_MOBILEfa ||
@@ -1191,25 +1189,25 @@ BOOL CTaskGoto::AdjustTarget(CObject* pObj, D3DVECTOR &pos, float &distance)
pos.x -= TAKE_DIST+TAKE_DIST_OTHER+distance;
mat = pObj->RetWorldMatrix(0);
pos = Transform(*mat, pos);
- return FALSE; // single approach
+ return false; // single approach
}
- if ( GetHotPoint(pObj, goal, TRUE, distance, suppl) )
+ if ( GetHotPoint(pObj, goal, true, distance, suppl) )
{
pos = goal;
distance += suppl;
- return FALSE; // single approach
+ return false; // single approach
}
pos = pObj->RetPosition(0);
distance = 0.0f;
- return FALSE; // single approach
+ return false; // single approach
}
// If you are on an object produced by a building (ore produced by derrick),
// changes the position by report the building.
-BOOL CTaskGoto::AdjustBuilding(D3DVECTOR &pos, float margin, float &distance)
+bool CTaskGoto::AdjustBuilding(D3DVECTOR &pos, float margin, float &distance)
{
CObject* pObj;
D3DVECTOR oPos;
@@ -1224,22 +1222,22 @@ BOOL CTaskGoto::AdjustBuilding(D3DVECTOR &pos, float margin, float &distance)
if ( !pObj->RetActif() ) continue;
if ( pObj->RetTruck() != 0 ) continue; // object transported?
- if ( !GetHotPoint(pObj, oPos, FALSE, 0.0f, suppl) ) continue;
+ if ( !GetHotPoint(pObj, oPos, false, 0.0f, suppl) ) continue;
dist = Length2d(pos, oPos);
if ( dist <= margin )
{
- GetHotPoint(pObj, pos, TRUE, distance, suppl);
+ GetHotPoint(pObj, pos, true, distance, suppl);
distance += suppl;
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
// Returns the item or product or pose is something on a building.
-BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
- BOOL bTake, float distance, float &suppl)
+bool CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
+ bool bTake, float distance, float &suppl)
{
ObjectType type;
D3DMATRIX* mat;
@@ -1255,7 +1253,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 4.0f;
if ( bTake ) pos.x += TAKE_DIST+distance+suppl;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_CONVERT )
@@ -1265,7 +1263,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 4.0f;
if ( bTake ) pos.x += TAKE_DIST+distance+suppl;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_RESEARCH )
@@ -1275,7 +1273,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 2.5f;
if ( bTake ) pos.x += TAKE_DIST+TAKE_DIST_OTHER+distance+suppl;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_ENERGY )
@@ -1285,7 +1283,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 6.0f;
if ( bTake ) pos.x += TAKE_DIST+TAKE_DIST_OTHER+distance;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_TOWER )
@@ -1295,7 +1293,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 4.0f;
if ( bTake ) pos.x += TAKE_DIST+TAKE_DIST_OTHER+distance+suppl;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_LABO )
@@ -1305,7 +1303,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 6.0f;
if ( bTake ) pos.x += TAKE_DIST+TAKE_DIST_OTHER+distance;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_NUCLEAR )
@@ -1315,7 +1313,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 4.0f;
if ( bTake ) pos.x += TAKE_DIST+TAKE_DIST_OTHER+distance+suppl;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_FACTORY )
@@ -1325,7 +1323,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 6.0f;
if ( bTake ) pos.x += TAKE_DIST+distance+suppl;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_STATION )
@@ -1335,7 +1333,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 4.0f;
if ( bTake ) pos.x += distance;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_REPAIR )
@@ -1345,7 +1343,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 4.0f;
if ( bTake ) pos.x += distance;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_DESTROYER )
@@ -1355,7 +1353,7 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 4.0f;
if ( bTake ) pos.x += TAKE_DIST+distance+suppl;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
if ( type == OBJECT_PARA && m_physics->RetType() == TYPE_FLYING )
@@ -1364,24 +1362,24 @@ BOOL CTaskGoto::GetHotPoint(CObject *pObj, D3DVECTOR &pos,
if ( bTake && distance != 0.0f ) suppl = 20.0f;
if ( bTake ) pos.x += distance+suppl;
pos = Transform(*mat, pos);
- return TRUE;
+ return true;
}
suppl = 0.0f;
- return FALSE;
+ return false;
}
// Seeks an object too close that he must flee.
-BOOL CTaskGoto::LeakSearch(D3DVECTOR &pos, float &delay)
+bool CTaskGoto::LeakSearch(D3DVECTOR &pos, float &delay)
{
CObject *pObj, *pObstacle;
D3DVECTOR iPos, oPos, bPos;
float iRadius, oRadius, bRadius, dist, min, dir;
int i, j;
- if ( !m_physics->RetLand() ) return FALSE; // in flight?
+ if ( !m_physics->RetLand() ) return false; // in flight?
m_object->GetCrashSphere(0, iPos, iRadius);
@@ -1409,9 +1407,9 @@ BOOL CTaskGoto::LeakSearch(D3DVECTOR &pos, float &delay)
}
}
}
- if ( min > iRadius+bRadius+4.0f ) return FALSE;
+ if ( min > iRadius+bRadius+4.0f ) return false;
- m_bLeakRecede = FALSE;
+ m_bLeakRecede = false;
dist = 4.0f;
dir = 1.0f;
@@ -1419,12 +1417,12 @@ BOOL CTaskGoto::LeakSearch(D3DVECTOR &pos, float &delay)
{
dist = 16.0f;
dir = -1.0f;
- m_bLeakRecede = TRUE; // simply recoils
+ m_bLeakRecede = true; // simply recoils
}
pos = bPos;
delay = m_physics->RetLinTimeLength(dist, dir);
- return TRUE;
+ return true;
}
@@ -1484,7 +1482,7 @@ void CTaskGoto::ComputeRepulse(FPOINT &dir)
CObject *pObj;
float gDist, add, addi, fac, dist, iRadius, oRadius;
int i, j;
- BOOL bAlien;
+ bool bAlien;
dir.x = 0.0f;
dir.y = 0.0f;
@@ -1558,14 +1556,14 @@ void CTaskGoto::ComputeRepulse(FPOINT &dir)
}
}
- bAlien = FALSE;
+ bAlien = false;
if ( iType == OBJECT_MOTHER ||
iType == OBJECT_ANT ||
iType == OBJECT_SPIDER ||
iType == OBJECT_BEE ||
iType == OBJECT_WORM )
{
- bAlien = TRUE;
+ bAlien = true;
}
for ( i=0 ; i<1000000 ; i++ )
@@ -1705,7 +1703,7 @@ int CTaskGoto::BeamShortcut()
for ( i=m_bmTotal ; i>=m_bmIndex+2 ; i-- ) // tries from the last
{
- if ( BitmapTestLine(m_bmPoints[m_bmIndex], m_bmPoints[i], 0.0f, FALSE) )
+ if ( BitmapTestLine(m_bmPoints[m_bmIndex], m_bmPoints[i], 0.0f, false) )
{
return i; // bingo, found
}
@@ -1816,7 +1814,7 @@ Error CTaskGoto::BeamExplore(const D3DVECTOR &prevPos, const D3DVECTOR &curPos,
}
else
{
- if ( !BitmapTestLine(prevPos, curPos, angle/nbDiv, TRUE) ) return ERR_GOTO_IMPOSSIBLE;
+ if ( !BitmapTestLine(prevPos, curPos, angle/nbDiv, true) ) return ERR_GOTO_IMPOSSIBLE;
m_bmPoints[i] = curPos;
@@ -1830,7 +1828,7 @@ Error CTaskGoto::BeamExplore(const D3DVECTOR &prevPos, const D3DVECTOR &curPos,
{
newPos = BeamPoint(curPos, goalPos, 0, Length2d(curPos, goalPos)-goalRadius);
}
- if ( BitmapTestLine(curPos, newPos, angle/nbDiv, FALSE) )
+ if ( BitmapTestLine(curPos, newPos, angle/nbDiv, false) )
{
m_bmPoints[i+1] = newPos;
m_bmTotal = i+1;
@@ -1981,18 +1979,18 @@ void CTaskGoto::BitmapDebug(const D3DVECTOR &min, const D3DVECTOR &max,
// Tests if a path along a straight line is possible.
-BOOL CTaskGoto::BitmapTestLine(const D3DVECTOR &start, const D3DVECTOR &goal,
- float stepAngle, BOOL bSecond)
+bool CTaskGoto::BitmapTestLine(const D3DVECTOR &start, const D3DVECTOR &goal,
+ float stepAngle, bool bSecond)
{
D3DVECTOR pos, inc;
float dist, step;
float distNoB2;
int i, max, x, y;
- if ( m_bmArray == 0 ) return TRUE;
+ if ( m_bmArray == 0 ) return true;
dist = Length2d(start, goal);
- if ( dist == 0.0f ) return TRUE;
+ if ( dist == 0.0f ) return true;
step = BM_DIM_STEP*0.5f;
inc.x = (goal.x-start.x)*step/dist;
@@ -2027,7 +2025,7 @@ BOOL CTaskGoto::BitmapTestLine(const D3DVECTOR &start, const D3DVECTOR &goal,
if ( bSecond )
{
- if ( i > 2 && BitmapTestDot(1, x, y) ) return FALSE;
+ if ( i > 2 && BitmapTestDot(1, x, y) ) return false;
if ( step*(i+1) > distNoB2 && i < max-2 )
{
@@ -2035,9 +2033,9 @@ BOOL CTaskGoto::BitmapTestLine(const D3DVECTOR &start, const D3DVECTOR &goal,
}
}
- if ( BitmapTestDot(0, x, y) ) return FALSE;
+ if ( BitmapTestDot(0, x, y) ) return false;
}
- return TRUE;
+ return true;
}
// Adds the objects in the bitmap.
@@ -2063,7 +2061,7 @@ void CTaskGoto::BitmapObject()
if ( pObj == m_bmFretObject ) continue;
if ( pObj->RetTruck() != 0 ) continue;
- h = m_terrain->RetFloorLevel(pObj->RetPosition(0), FALSE);
+ h = m_terrain->RetFloorLevel(pObj->RetPosition(0), false);
if ( m_physics->RetType() == TYPE_FLYING && m_altitude > 0.0f )
{
h += m_altitude;
@@ -2110,7 +2108,7 @@ void CTaskGoto::BitmapTerrain(int minx, int miny, int maxx, int maxy)
D3DVECTOR p;
float aLimit, angle, h;
int x, y;
- BOOL bAcceptWater, bFly;
+ bool bAcceptWater, bFly;
if ( minx > maxx ) Swap(minx, maxx);
if ( miny > maxy ) Swap(miny, maxy);
@@ -2129,8 +2127,8 @@ void CTaskGoto::BitmapTerrain(int minx, int miny, int maxx, int maxy)
miny >= m_bmMinY && maxy <= m_bmMaxY ) return;
aLimit = 20.0f*PI/180.0f;
- bAcceptWater = FALSE;
- bFly = FALSE;
+ bAcceptWater = false;
+ bFly = false;
type = m_object->RetType();
@@ -2163,7 +2161,7 @@ void CTaskGoto::BitmapTerrain(int minx, int miny, int maxx, int maxy)
if ( type == OBJECT_MOBILEsa ) // submarine caterpillars?
{
aLimit = 35.0f*PI/180.0f;
- bAcceptWater = TRUE;
+ bAcceptWater = true;
}
if ( type == OBJECT_MOBILEdr ) // designer caterpillars?
@@ -2178,7 +2176,7 @@ void CTaskGoto::BitmapTerrain(int minx, int miny, int maxx, int maxy)
type == OBJECT_MOBILEft ) // flying?
{
aLimit = 15.0f*PI/180.0f;
- bFly = TRUE;
+ bFly = true;
}
if ( type == OBJECT_MOBILEia ||
@@ -2201,7 +2199,7 @@ void CTaskGoto::BitmapTerrain(int minx, int miny, int maxx, int maxy)
if ( bFly ) // flying robot?
{
- h = m_terrain->RetFloorLevel(p, TRUE);
+ h = m_terrain->RetFloorLevel(p, true);
if ( h >= m_terrain->RetFlyingMaxHeight()-5.0f )
{
BitmapSetDot(0, x, y);
@@ -2211,7 +2209,7 @@ void CTaskGoto::BitmapTerrain(int minx, int miny, int maxx, int maxy)
if ( !bAcceptWater ) // not going underwater?
{
- h = m_terrain->RetFloorLevel(p, TRUE);
+ h = m_terrain->RetFloorLevel(p, true);
if ( h < m_water->RetLevel()-2.0f ) // under water (*)?
{
//? BitmapSetDot(0, x, y);
@@ -2238,7 +2236,7 @@ void CTaskGoto::BitmapTerrain(int minx, int miny, int maxx, int maxy)
// Opens an empty bitmap.
-BOOL CTaskGoto::BitmapOpen()
+bool CTaskGoto::BitmapOpen()
{
BitmapClose();
@@ -2254,16 +2252,16 @@ BOOL CTaskGoto::BitmapOpen()
m_bmMaxX = 0;
m_bmMaxY = 0;
- return TRUE;
+ return true;
}
// Closes the bitmap.
-BOOL CTaskGoto::BitmapClose()
+bool CTaskGoto::BitmapClose()
{
free(m_bmArray);
m_bmArray = 0;
- return TRUE;
+ return true;
}
// Puts a circle in the bitmap.
@@ -2335,10 +2333,10 @@ void CTaskGoto::BitmapClearDot(int rank, int x, int y)
// Tests a point in the bitmap.
// x:y: 0..m_bmSize-1
-BOOL CTaskGoto::BitmapTestDot(int rank, int x, int y)
+bool CTaskGoto::BitmapTestDot(int rank, int x, int y)
{
if ( x < 0 || x >= m_bmSize ||
- y < 0 || y >= m_bmSize ) return FALSE;
+ y < 0 || y >= m_bmSize ) return false;
if ( x < m_bmMinX || x > m_bmMaxX ||
y < m_bmMinY || y > m_bmMaxY )
diff --git a/src/object/task/taskgoto.h b/src/object/task/taskgoto.h
index ed51d3b..acd79b6 100644
--- a/src/object/task/taskgoto.h
+++ b/src/object/task/taskgoto.h
@@ -82,7 +82,7 @@ public:
CTaskGoto(CInstanceManager* iMan, CObject* object);
~CTaskGoto();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(D3DVECTOR goal, float altitude, TaskGotoGoal goalMode, TaskGotoCrash crashMode);
Error IsEnded();
@@ -91,10 +91,10 @@ protected:
CObject* WormSearch(D3DVECTOR &impact);
void WormFrame(float rTime);
CObject* SearchTarget(D3DVECTOR pos, float margin);
- BOOL AdjustTarget(CObject* pObj, D3DVECTOR &pos, float &distance);
- BOOL AdjustBuilding(D3DVECTOR &pos, float margin, float &distance);
- BOOL GetHotPoint(CObject *pObj, D3DVECTOR &pos, BOOL bTake, float distance, float &suppl);
- BOOL LeakSearch(D3DVECTOR &pos, float &delay);
+ bool AdjustTarget(CObject* pObj, D3DVECTOR &pos, float &distance);
+ bool AdjustBuilding(D3DVECTOR &pos, float margin, float &distance);
+ bool GetHotPoint(CObject *pObj, D3DVECTOR &pos, bool bTake, float distance, float &suppl);
+ bool LeakSearch(D3DVECTOR &pos, float &delay);
void ComputeRepulse(FPOINT &dir);
void ComputeFlyingRepulse(float &dir);
@@ -106,17 +106,17 @@ protected:
D3DVECTOR BeamPoint(const D3DVECTOR &startPoint, const D3DVECTOR &goalPoint, float angle, float step);
void BitmapDebug(const D3DVECTOR &min, const D3DVECTOR &max, const D3DVECTOR &start, const D3DVECTOR &goal);
- BOOL BitmapTestLine(const D3DVECTOR &start, const D3DVECTOR &goal, float stepAngle, BOOL bSecond);
+ bool BitmapTestLine(const D3DVECTOR &start, const D3DVECTOR &goal, float stepAngle, bool bSecond);
void BitmapObject();
void BitmapTerrain(const D3DVECTOR &min, const D3DVECTOR &max);
void BitmapTerrain(int minx, int miny, int maxx, int maxy);
- BOOL BitmapOpen();
- BOOL BitmapClose();
+ bool BitmapOpen();
+ bool BitmapClose();
void BitmapSetCircle(const D3DVECTOR &pos, float radius);
void BitmapClearCircle(const D3DVECTOR &pos, float radius);
void BitmapSetDot(int rank, int x, int y);
void BitmapClearDot(int rank, int x, int y);
- BOOL BitmapTestDot(int rank, int x, int y);
+ bool BitmapTestDot(int rank, int x, int y);
protected:
D3DVECTOR m_goal;
@@ -128,12 +128,12 @@ protected:
TaskGotoPhase m_phase;
int m_try;
Error m_error;
- BOOL m_bTake;
+ bool m_bTake;
float m_stopLength; // braking distance
float m_time;
D3DVECTOR m_pos;
- BOOL m_bWorm;
- BOOL m_bApprox;
+ bool m_bWorm;
+ bool m_bApprox;
float m_wormLastTime;
float m_lastDistance;
@@ -159,6 +159,6 @@ protected:
D3DVECTOR m_leakPos; // initial position leak
float m_leakDelay;
float m_leakTime;
- BOOL m_bLeakRecede;
+ bool m_bLeakRecede;
};
diff --git a/src/object/task/taskgungoal.cpp b/src/object/task/taskgungoal.cpp
index 013c3d4..5a44ade 100644
--- a/src/object/task/taskgungoal.cpp
+++ b/src/object/task/taskgungoal.cpp
@@ -42,7 +42,6 @@
CTaskGunGoal::CTaskGunGoal(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
}
// Object's destructor.
@@ -54,12 +53,12 @@ CTaskGunGoal::~CTaskGunGoal()
// Management of an event.
-BOOL CTaskGunGoal::EventProcess(const Event &event)
+bool CTaskGunGoal::EventProcess(const Event &event)
{
float dir;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_progress += event.rTime*m_speed;
@@ -83,7 +82,7 @@ BOOL CTaskGunGoal::EventProcess(const Event &event)
}
m_object->SetGunGoalH(dir);
- return TRUE;
+ return true;
}
@@ -127,7 +126,7 @@ Error CTaskGunGoal::Start(float dirV, float dirH)
if ( m_finalDirV != m_initialDirV ||
m_finalDirH != m_initialDirH )
{
- i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.3f, 1.5f, TRUE);
+ i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.3f, 1.5f, true);
m_sound->AddEnvelope(i, 0.3f, 1.5f, 1.0f/m_speed, SOPER_STOP);
}
@@ -154,8 +153,8 @@ Error CTaskGunGoal::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskGunGoal::Abort()
+bool CTaskGunGoal::Abort()
{
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskgungoal.h b/src/object/task/taskgungoal.h
index 14e42b4..2ef8efc 100644
--- a/src/object/task/taskgungoal.h
+++ b/src/object/task/taskgungoal.h
@@ -35,11 +35,11 @@ public:
CTaskGunGoal(CInstanceManager* iMan, CObject* object);
~CTaskGunGoal();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(float dirV, float dirH);
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
diff --git a/src/object/task/taskinfo.cpp b/src/object/task/taskinfo.cpp
index ba36cec..9897c88 100644
--- a/src/object/task/taskinfo.cpp
+++ b/src/object/task/taskinfo.cpp
@@ -47,7 +47,6 @@
CTaskInfo::CTaskInfo(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
}
// Object's destructor.
@@ -59,22 +58,22 @@ CTaskInfo::~CTaskInfo()
// Management of an event.
-BOOL CTaskInfo::EventProcess(const Event &event)
+bool CTaskInfo::EventProcess(const Event &event)
{
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
m_progress += event.rTime*m_speed; // other advance
m_time += event.rTime;
- return TRUE;
+ return true;
}
// Assigns the goal was achieved.
-Error CTaskInfo::Start(char *name, float value, float power, BOOL bSend)
+Error CTaskInfo::Start(char *name, float value, float power, bool bSend)
{
CObject* pInfo;
CAutoInfo* pAuto;
@@ -82,7 +81,7 @@ Error CTaskInfo::Start(char *name, float value, float power, BOOL bSend)
Info info;
int i, total, op;
- m_bError = TRUE;
+ m_bError = true;
m_object->SetInfoReturn(NAN);
pInfo = SearchInfo(power); // seeks terminal
@@ -167,7 +166,7 @@ Error CTaskInfo::Start(char *name, float value, float power, BOOL bSend)
m_speed = 1.0f/1.0f;
m_time = 0.0f;
- m_bError = FALSE; // ok
+ m_bError = false; // ok
return ERR_OK;
}
@@ -188,9 +187,9 @@ Error CTaskInfo::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskInfo::Abort()
+bool CTaskInfo::Abort()
{
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskinfo.h b/src/object/task/taskinfo.h
index 1461c3e..5f08f01 100644
--- a/src/object/task/taskinfo.h
+++ b/src/object/task/taskinfo.h
@@ -36,11 +36,11 @@ public:
CTaskInfo(CInstanceManager* iMan, CObject* object);
~CTaskInfo();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
- Error Start(char *name, float value, float power, BOOL bSend);
+ Error Start(char *name, float value, float power, bool bSend);
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
CObject* SearchInfo(float power);
@@ -49,6 +49,6 @@ protected:
float m_progress;
float m_speed;
float m_time;
- BOOL m_bError;
+ bool m_bError;
};
diff --git a/src/object/task/taskmanager.cpp b/src/object/task/taskmanager.cpp
index 43ac2af..08ab0ce 100644
--- a/src/object/task/taskmanager.cpp
+++ b/src/object/task/taskmanager.cpp
@@ -63,7 +63,7 @@ CTaskManager::CTaskManager(CInstanceManager* iMan, CObject* object)
m_task = 0;
m_object = object;
- m_bPilot = FALSE;
+ m_bPilot = false;
}
// Object's destructor.
@@ -149,7 +149,7 @@ Error CTaskManager::StartTaskSearch()
// Reads an information terminal.
-Error CTaskManager::StartTaskInfo(char *name, float value, float power, BOOL bSend)
+Error CTaskManager::StartTaskInfo(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);
@@ -165,7 +165,7 @@ Error CTaskManager::StartTaskTerraform()
// Changes the pencil.
-Error CTaskManager::StartTaskPen(BOOL bDown, int color)
+Error CTaskManager::StartTaskPen(bool bDown, int color)
{
m_task = new CTaskPen(m_iMan, m_object);
return ((CTaskPen*)m_task)->Start(bDown, color);
@@ -203,7 +203,7 @@ Error CTaskManager::StartTaskShield(TaskShieldMode mode, float delay)
Error CTaskManager::StartTaskFire(float delay)
{
- m_bPilot = TRUE;
+ m_bPilot = true;
m_task = new CTaskFire(m_iMan, m_object);
return ((CTaskFire*)m_task)->Start(delay);
}
@@ -246,9 +246,9 @@ Error CTaskManager::StartTaskReset(D3DVECTOR goal, D3DVECTOR angle)
// Management of an event.
-BOOL CTaskManager::EventProcess(const Event &event)
+bool CTaskManager::EventProcess(const Event &event)
{
- if ( m_task == 0 ) return FALSE;
+ if ( m_task == 0 ) return false;
return m_task->EventProcess(event);
}
@@ -264,9 +264,9 @@ Error CTaskManager::IsEnded()
// Indicates whether the action is pending.
-BOOL CTaskManager::IsBusy()
+bool CTaskManager::IsBusy()
{
- if ( m_task == 0 ) return FALSE;
+ if ( m_task == 0 ) return false;
return m_task->IsBusy();
}
@@ -274,7 +274,7 @@ BOOL CTaskManager::IsBusy()
// Indicates whether it is possible to control the robot
// during the execution of the current task.
-BOOL CTaskManager::IsPilot()
+bool CTaskManager::IsPilot()
{
return m_bPilot;
}
@@ -282,9 +282,9 @@ BOOL CTaskManager::IsPilot()
// Suddenly ends the current action.
-BOOL CTaskManager::Abort()
+bool CTaskManager::Abort()
{
- if ( m_task == 0 ) return FALSE;
+ if ( m_task == 0 ) return false;
return m_task->Abort();
}
diff --git a/src/object/task/taskmanager.h b/src/object/task/taskmanager.h
index 8c7e093..476e90f 100644
--- a/src/object/task/taskmanager.h
+++ b/src/object/task/taskmanager.h
@@ -47,9 +47,9 @@ 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(char *name, float value, float power, bool bSend);
Error StartTaskTerraform();
- Error StartTaskPen(BOOL bDown, int color);
+ Error StartTaskPen(bool bDown, int color);
Error StartTaskRecover();
Error StartTaskShield(TaskShieldMode mode, float delay);
Error StartTaskFire(float delay);
@@ -58,11 +58,11 @@ public:
Error StartTaskSpiderExplo();
Error StartTaskReset(D3DVECTOR goal, D3DVECTOR angle);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error IsEnded();
- BOOL IsBusy();
- BOOL IsPilot();
- BOOL Abort();
+ bool IsBusy();
+ bool IsPilot();
+ bool Abort();
protected:
@@ -70,6 +70,6 @@ protected:
CInstanceManager* m_iMan;
CTask* m_task;
CObject* m_object;
- BOOL m_bPilot;
+ bool m_bPilot;
};
diff --git a/src/object/task/taskmanip.cpp b/src/object/task/taskmanip.cpp
index 90dc016..5df067c 100644
--- a/src/object/task/taskmanip.cpp
+++ b/src/object/task/taskmanip.cpp
@@ -59,8 +59,6 @@
CTaskManip::CTaskManip(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
-
m_arm = TMA_NEUTRAL;
m_hand = TMH_OPEN;
}
@@ -74,19 +72,19 @@ CTaskManip::~CTaskManip()
// Management of an event.
-BOOL CTaskManip::EventProcess(const Event &event)
+bool CTaskManip::EventProcess(const Event &event)
{
D3DVECTOR pos;
float angle, a, g, cirSpeed, progress;
int i;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
if ( m_bBee ) // bee?
{
- return TRUE;
+ return true;
}
if ( m_bTurn ) // preliminary rotation?
@@ -102,14 +100,14 @@ BOOL CTaskManip::EventProcess(const Event &event)
if ( cirSpeed < -1.0f ) cirSpeed = -1.0f;
m_physics->SetMotorSpeedZ(cirSpeed); // turns left / right
- return TRUE;
+ return true;
}
if ( m_move != 0 ) // preliminary advance?
{
m_timeLimit -= event.rTime;
m_physics->SetMotorSpeedX(m_move); // forward/backward
- return TRUE;
+ return true;
}
m_progress += event.rTime*m_speed; // others advance
@@ -179,7 +177,7 @@ BOOL CTaskManip::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -280,7 +278,7 @@ void CTaskManip::InitAngle()
// Tests whether an object is compatible with the operation TMA_OTHER.
-BOOL TestFriend(ObjectType oType, ObjectType fType)
+bool TestFriend(ObjectType oType, ObjectType fType)
{
if ( oType == OBJECT_ENERGY )
{
@@ -320,7 +318,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
iAngle = NormAngle(iAngle); // 0..2*PI
oAngle = iAngle;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
if ( m_arm != TMA_FFRONT &&
m_arm != TMA_FBACK &&
@@ -360,11 +358,11 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
pyro->Create(PT_FALL, other); // the ball falls
}
- m_bBee = TRUE;
- m_bError = FALSE; // ok
+ m_bBee = true;
+ m_bError = false; // ok
return ERR_OK;
}
- m_bBee = FALSE;
+ m_bBee = false;
m_bSubm = ( type == OBJECT_MOBILEsa ); // submarine?
@@ -431,8 +429,8 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
{
if ( m_arm == TMA_FFRONT )
{
- front = SearchTakeFrontObject(TRUE, fPos, fDist, fAngle);
- other = SearchOtherObject(TRUE, oPos, oDist, oAngle, oHeight);
+ front = SearchTakeFrontObject(true, fPos, fDist, fAngle);
+ other = SearchOtherObject(true, oPos, oDist, oAngle, oHeight);
if ( front != 0 && fDist < oDist )
{
@@ -457,7 +455,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
}
if ( m_arm == TMA_FBACK )
{
- if ( SearchTakeBackObject(TRUE, m_targetPos, fDist, m_angle) == 0 )
+ if ( SearchTakeBackObject(true, m_targetPos, fDist, m_angle) == 0 )
{
return ERR_MANIP_NIL;
}
@@ -474,7 +472,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
{
if ( m_arm == TMA_FFRONT )
{
- other = SearchOtherObject(TRUE, oPos, oDist, oAngle, oHeight);
+ other = SearchOtherObject(true, oPos, oDist, oAngle, oHeight);
if ( other != 0 && other->RetPower() == 0 )
{
m_targetPos = oPos;
@@ -527,12 +525,12 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
if ( iAngle == m_angle || m_energy == 0.0f )
{
- m_bTurn = FALSE; // preliminary rotation unnecessary
+ m_bTurn = false; // preliminary rotation unnecessary
SoundManip(1.0f/m_speed);
}
else
{
- m_bTurn = TRUE; // preliminary rotation necessary
+ m_bTurn = true; // preliminary rotation necessary
}
if ( m_bSubm )
@@ -540,9 +538,9 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
m_camera->StartCentering(m_object, PI*0.8f, 99.9f, 0.0f, 0.5f);
}
- m_physics->SetFreeze(TRUE); // it does not move
+ m_physics->SetFreeze(true); // it does not move
- m_bError = FALSE; // ok
+ m_bError = false; // ok
return ERR_OK;
}
@@ -570,7 +568,7 @@ Error CTaskManip::IsEnded()
if ( TestAngle(angle, m_angle-PI*0.01f, m_angle+PI*0.01f) )
{
- m_bTurn = FALSE; // rotation ended
+ m_bTurn = false; // rotation ended
m_physics->SetMotorSpeedZ(0.0f);
if ( m_move == 0.0f )
{
@@ -704,7 +702,7 @@ Error CTaskManip::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskManip::Abort()
+bool CTaskManip::Abort()
{
int i;
@@ -729,8 +727,8 @@ BOOL CTaskManip::Abort()
}
m_camera->StopCentering(m_object, 2.0f);
- m_physics->SetFreeze(FALSE); // is moving again
- return TRUE;
+ m_physics->SetFreeze(false); // is moving again
+ return true;
}
@@ -791,7 +789,7 @@ CObject* CTaskManip::SearchTakeUnderObject(D3DVECTOR &pos, float dLimit)
// Seeks the object in front to take.
-CObject* CTaskManip::SearchTakeFrontObject(BOOL bAdvance, D3DVECTOR &pos,
+CObject* CTaskManip::SearchTakeFrontObject(bool bAdvance, D3DVECTOR &pos,
float &distance, float &angle)
{
CObject *pObj, *pBest;
@@ -883,7 +881,7 @@ CObject* CTaskManip::SearchTakeFrontObject(BOOL bAdvance, D3DVECTOR &pos,
// Seeks the object back to take.
-CObject* CTaskManip::SearchTakeBackObject(BOOL bAdvance, D3DVECTOR &pos,
+CObject* CTaskManip::SearchTakeBackObject(bool bAdvance, D3DVECTOR &pos,
float &distance, float &angle)
{
CObject *pObj, *pBest;
@@ -974,7 +972,7 @@ CObject* CTaskManip::SearchTakeBackObject(BOOL bAdvance, D3DVECTOR &pos,
// Seeks the robot or building on which it wants to put a battery or or other object.
-CObject* CTaskManip::SearchOtherObject(BOOL bAdvance, D3DVECTOR &pos,
+CObject* CTaskManip::SearchOtherObject(bool bAdvance, D3DVECTOR &pos,
float &distance, float &angle,
float &height)
{
@@ -1110,7 +1108,7 @@ CObject* CTaskManip::SearchOtherObject(BOOL bAdvance, D3DVECTOR &pos,
// Takes the object placed in front.
-BOOL CTaskManip::TruckTakeObject()
+bool CTaskManip::TruckTakeObject()
{
CObject* fret;
CObject* other;
@@ -1121,7 +1119,7 @@ BOOL CTaskManip::TruckTakeObject()
if ( m_arm == TMA_GRAB ) // takes immediately?
{
fret = m_object->RetFret();
- if ( fret == 0 ) return FALSE; // nothing to take?
+ if ( fret == 0 ) return false; // nothing to take?
m_fretType = fret->RetType();
if ( m_object->RetType() == OBJECT_HUMAN ||
@@ -1163,8 +1161,8 @@ BOOL CTaskManip::TruckTakeObject()
if ( m_arm == TMA_FFRONT ) // takes on the ground in front?
{
- fret = SearchTakeFrontObject(FALSE, pos, dist, angle);
- if ( fret == 0 ) return FALSE; // nothing to take?
+ fret = SearchTakeFrontObject(false, pos, dist, angle);
+ if ( fret == 0 ) return false; // nothing to take?
m_fretType = fret->RetType();
if ( m_bSubm )
@@ -1195,8 +1193,8 @@ BOOL CTaskManip::TruckTakeObject()
if ( m_arm == TMA_FBACK ) // takes on the ground behind?
{
- fret = SearchTakeBackObject(FALSE, pos, dist, angle);
- if ( fret == 0 ) return FALSE; // nothing to take?
+ fret = SearchTakeBackObject(false, pos, dist, angle);
+ if ( fret == 0 ) return false; // nothing to take?
m_fretType = fret->RetType();
fret->SetTruck(m_object);
@@ -1214,7 +1212,7 @@ BOOL CTaskManip::TruckTakeObject()
if ( m_arm == TMA_POWER ) // takes battery in the back?
{
fret = m_object->RetPower();
- if ( fret == 0 ) return FALSE; // no battery?
+ if ( fret == 0 ) return false; // no battery?
m_fretType = fret->RetType();
pos = D3DVECTOR(4.7f, 0.0f, 0.0f); // relative to the hand (lem4)
@@ -1230,11 +1228,11 @@ BOOL CTaskManip::TruckTakeObject()
if ( m_arm == TMA_OTHER ) // battery takes from friend?
{
- other = SearchOtherObject(FALSE, pos, dist, angle, m_height);
- if ( other == 0 ) return FALSE;
+ other = SearchOtherObject(false, pos, dist, angle, m_height);
+ if ( other == 0 ) return false;
fret = other->RetPower();
- if ( fret == 0 ) return FALSE; // the other does not have a battery?
+ if ( fret == 0 ) return false; // the other does not have a battery?
m_fretType = fret->RetType();
other->SetPower(0);
@@ -1250,12 +1248,12 @@ BOOL CTaskManip::TruckTakeObject()
m_object->SetFret(fret); // takes
}
- return TRUE;
+ return true;
}
// Deposes the object taken.
-BOOL CTaskManip::TruckDeposeObject()
+bool CTaskManip::TruckDeposeObject()
{
Character* character;
CObject* fret;
@@ -1267,7 +1265,7 @@ BOOL CTaskManip::TruckDeposeObject()
if ( m_arm == TMA_FFRONT ) // deposits on the ground in front?
{
fret = m_object->RetFret();
- if ( fret == 0 ) return FALSE; // nothing transported?
+ if ( fret == 0 ) return false; // nothing transported?
m_fretType = fret->RetType();
mat = fret->RetWorldMatrix(0);
@@ -1286,7 +1284,7 @@ BOOL CTaskManip::TruckDeposeObject()
if ( m_arm == TMA_FBACK ) // deposited on the ground behind?
{
fret = m_object->RetFret();
- if ( fret == 0 ) return FALSE; // nothing transported?
+ if ( fret == 0 ) return false; // nothing transported?
m_fretType = fret->RetType();
mat = fret->RetWorldMatrix(0);
@@ -1304,10 +1302,10 @@ BOOL CTaskManip::TruckDeposeObject()
if ( m_arm == TMA_POWER ) // deposits battery in the back?
{
fret = m_object->RetFret();
- if ( fret == 0 ) return FALSE; // nothing transported?
+ if ( fret == 0 ) return false; // nothing transported?
m_fretType = fret->RetType();
- if ( m_object->RetPower() != 0 ) return FALSE;
+ if ( m_object->RetPower() != 0 ) return false;
fret->SetTruck(m_object);
fret->SetTruckPart(0); // carried by the base
@@ -1324,14 +1322,14 @@ BOOL CTaskManip::TruckDeposeObject()
if ( m_arm == TMA_OTHER ) // deposits battery on friend?
{
- other = SearchOtherObject(FALSE, pos, dist, angle, m_height);
- if ( other == 0 ) return FALSE;
+ other = SearchOtherObject(false, pos, dist, angle, m_height);
+ if ( other == 0 ) return false;
fret = other->RetPower();
- if ( fret != 0 ) return FALSE; // the other already has a battery?
+ if ( fret != 0 ) return false; // the other already has a battery?
fret = m_object->RetFret();
- if ( fret == 0 ) return FALSE;
+ if ( fret == 0 ) return false;
m_fretType = fret->RetType();
other->SetPower(fret);
@@ -1347,12 +1345,12 @@ BOOL CTaskManip::TruckDeposeObject()
m_object->SetFret(0); // deposit
}
- return TRUE;
+ return true;
}
// Seeks if a location allows to deposit an object.
-BOOL CTaskManip::IsFreeDeposeObject(D3DVECTOR pos)
+bool CTaskManip::IsFreeDeposeObject(D3DVECTOR pos)
{
CObject* pObj;
D3DMATRIX* mat;
@@ -1377,11 +1375,11 @@ BOOL CTaskManip::IsFreeDeposeObject(D3DVECTOR pos)
{
if ( Length(iPos, oPos)-(oRadius+1.0f) < 2.0f )
{
- return FALSE; // location occupied
+ return false; // location occupied
}
}
}
- return TRUE; // location free
+ return true; // location free
}
// Plays the sound of the manipulator arm.
@@ -1390,7 +1388,7 @@ void CTaskManip::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->RetPosition(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/task/taskmanip.h b/src/object/task/taskmanip.h
index db25dd3..b2c8c29 100644
--- a/src/object/task/taskmanip.h
+++ b/src/object/task/taskmanip.h
@@ -64,21 +64,21 @@ public:
CTaskManip(CInstanceManager* iMan, CObject* object);
~CTaskManip();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(TaskManipOrder order, TaskManipArm arm);
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
void InitAngle();
CObject* SearchTakeUnderObject(D3DVECTOR &pos, float dLimit);
- CObject* SearchTakeFrontObject(BOOL bAdvance, D3DVECTOR &pos, float &distance, float &angle);
- CObject* SearchTakeBackObject(BOOL bAdvance, D3DVECTOR &pos, float &distance, float &angle);
- CObject* SearchOtherObject(BOOL bAdvance, D3DVECTOR &pos, float &distance, float &angle, float &height);
- BOOL TruckTakeObject();
- BOOL TruckDeposeObject();
- BOOL IsFreeDeposeObject(D3DVECTOR pos);
+ CObject* SearchTakeFrontObject(bool bAdvance, D3DVECTOR &pos, float &distance, float &angle);
+ CObject* SearchTakeBackObject(bool bAdvance, D3DVECTOR &pos, float &distance, float &angle);
+ CObject* SearchOtherObject(bool bAdvance, D3DVECTOR &pos, float &distance, float &angle, float &height);
+ bool TruckTakeObject();
+ bool TruckDeposeObject();
+ bool IsFreeDeposeObject(D3DVECTOR pos);
void SoundManip(float time, float amplitude=1.0f, float frequency=1.0f);
protected:
@@ -93,10 +93,10 @@ protected:
float m_height;
float m_advanceLength;
float m_energy;
- BOOL m_bError;
- BOOL m_bTurn;
- BOOL m_bSubm;
- BOOL m_bBee;
+ bool m_bError;
+ bool m_bTurn;
+ bool m_bSubm;
+ bool m_bBee;
float m_angle;
float m_move;
D3DVECTOR m_targetPos;
diff --git a/src/object/task/taskpen.cpp b/src/object/task/taskpen.cpp
index 267c221..bd88b26 100644
--- a/src/object/task/taskpen.cpp
+++ b/src/object/task/taskpen.cpp
@@ -48,7 +48,6 @@
CTaskPen::CTaskPen(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
}
// Object's destructor.
@@ -60,15 +59,15 @@ CTaskPen::~CTaskPen()
// Management of an event.
-BOOL CTaskPen::EventProcess(const Event &event)
+bool CTaskPen::EventProcess(const Event &event)
{
D3DVECTOR pos, speed;
FPOINT dim;
int i;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
if ( m_delay == 0.0f )
{
@@ -140,25 +139,25 @@ BOOL CTaskPen::EventProcess(const Event &event)
m_object->SetPosition(10+i, pos);
}
- return TRUE;
+ return true;
}
// Assigns the goal has achieved.
-Error CTaskPen::Start(BOOL bDown, int color)
+Error CTaskPen::Start(bool bDown, int color)
{
D3DVECTOR pos;
D3DMATRIX* mat;
ObjectType type;
int i;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
type = m_object->RetType();
if ( type != OBJECT_MOBILEdr ) return ERR_FIRE_VEH;
- m_bError = FALSE; // ok
+ m_bError = false; // ok
m_oldAngle = m_object->RetAngleY(1);
m_newAngle = ColorToAngle(color);
@@ -247,10 +246,10 @@ Error CTaskPen::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskPen::Abort()
+bool CTaskPen::Abort()
{
//? m_camera->StopCentering(m_object, 0.5f);
- return TRUE;
+ return true;
}
@@ -260,7 +259,7 @@ void CTaskPen::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->RetPosition(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/task/taskpen.h b/src/object/task/taskpen.h
index 4beb9ac..2f1f270 100644
--- a/src/object/task/taskpen.h
+++ b/src/object/task/taskpen.h
@@ -45,11 +45,11 @@ public:
CTaskPen(CInstanceManager* iMan, CObject* object);
~CTaskPen();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
- Error Start(BOOL bDown, int color);
+ Error Start(bool bDown, int color);
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
void SoundManip(float time, float amplitude, float frequency);
@@ -58,7 +58,7 @@ protected:
int ColorToRank(int color);
protected:
- BOOL m_bError;
+ bool m_bError;
TaskPenPhase m_phase;
float m_progress;
float m_delay;
diff --git a/src/object/task/taskrecover.cpp b/src/object/task/taskrecover.cpp
index 070d429..798540b 100644
--- a/src/object/task/taskrecover.cpp
+++ b/src/object/task/taskrecover.cpp
@@ -50,8 +50,6 @@
CTaskRecover::CTaskRecover(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
-
m_ruin = 0;
m_soundChannel = -1;
}
@@ -65,16 +63,16 @@ CTaskRecover::~CTaskRecover()
// Management of an event.
-BOOL CTaskRecover::EventProcess(const Event &event)
+bool CTaskRecover::EventProcess(const Event &event)
{
CObject* power;
D3DVECTOR pos, speed;
FPOINT dim;
float a, g, cirSpeed, angle, energy, dist, linSpeed;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
if ( m_phase == TRP_TURN ) // preliminary rotation?
{
@@ -85,7 +83,7 @@ BOOL CTaskRecover::EventProcess(const Event &event)
if ( cirSpeed < -1.0f ) cirSpeed = -1.0f;
m_physics->SetMotorSpeedZ(cirSpeed); // turns left / right
- return TRUE;
+ return true;
}
m_progress += event.rTime*m_speed; // others advance
@@ -109,7 +107,7 @@ BOOL CTaskRecover::EventProcess(const Event &event)
if ( dist > RECOVER_DIST ) linSpeed = 1.0f;
if ( dist < RECOVER_DIST ) linSpeed = -1.0f;
m_physics->SetMotorSpeedX(linSpeed); // forward/backward
- return TRUE;
+ return true;
}
if ( m_phase == TRP_OPER )
@@ -178,7 +176,7 @@ BOOL CTaskRecover::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -193,7 +191,7 @@ Error CTaskRecover::Start()
ObjectType type;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
if ( !m_physics->RetLand() ) return ERR_RECOVER_VEH;
type = m_object->RetType();
@@ -211,7 +209,7 @@ Error CTaskRecover::Start()
m_ruin = SearchRuin();
if ( m_ruin == 0 ) return ERR_RECOVER_NULL;
- m_ruin->SetLock(TRUE); // ruin no longer usable
+ m_ruin->SetLock(true); // ruin no longer usable
iPos = m_object->RetPosition(0);
oPos = m_ruin->RetPosition(0);
@@ -225,7 +223,7 @@ Error CTaskRecover::Start()
m_time = 0.0f;
m_lastParticule = 0.0f;
- m_bError = FALSE; // ok
+ m_bError = false; // ok
m_camera->StartCentering(m_object, PI*0.85f, 99.9f, 10.0f, 3.0f);
return ERR_OK;
@@ -284,7 +282,7 @@ Error CTaskRecover::IsEnded()
pos = Transform(*mat, pos); // position in front
m_recoverPos = pos;
- i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.9f, TRUE);
+ i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.9f, true);
m_sound->AddEnvelope(i, 1.0f, 1.5f, 0.3f, SOPER_CONTINUE);
m_sound->AddEnvelope(i, 1.0f, 1.5f, 1.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(i, 0.0f, 0.9f, 0.3f, SOPER_STOP);
@@ -298,7 +296,7 @@ Error CTaskRecover::IsEnded()
{
if ( m_progress > 1.0f ) // timeout?
{
- m_ruin->SetLock(FALSE); // usable again
+ m_ruin->SetLock(false); // usable again
m_camera->StopCentering(m_object, 2.0f);
return ERR_RECOVER_NULL;
}
@@ -317,11 +315,11 @@ Error CTaskRecover::IsEnded()
delete m_metal;
m_metal = 0;
Abort();
- m_bError = TRUE;
+ m_bError = true;
m_displayText->DisplayError(ERR_TOOMANY, m_object);
return ERR_STOP;
}
- m_metal->SetLock(TRUE); // metal not yet usable
+ m_metal->SetLock(true); // metal not yet usable
m_metal->SetZoom(0, 0.0f);
mat = m_object->RetWorldMatrix(0);
@@ -332,7 +330,7 @@ Error CTaskRecover::IsEnded()
m_particule->CreateRay(pos, goal, PARTIRAY2,
FPOINT(2.0f, 2.0f), 8.0f);
- m_soundChannel = m_sound->Play(SOUND_RECOVER, m_ruin->RetPosition(0), 0.0f, 1.0f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_RECOVER, m_ruin->RetPosition(0), 0.0f, 1.0f, true);
m_sound->AddEnvelope(m_soundChannel, 0.6f, 1.0f, 2.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.6f, 1.0f, 4.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.7f, 2.0f, SOPER_STOP);
@@ -352,7 +350,7 @@ Error CTaskRecover::IsEnded()
m_soundChannel = -1;
- i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.9f, TRUE);
+ i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.9f, true);
m_sound->AddEnvelope(i, 1.0f, 1.5f, 0.3f, SOPER_CONTINUE);
m_sound->AddEnvelope(i, 1.0f, 1.5f, 1.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(i, 0.0f, 0.9f, 0.3f, SOPER_STOP);
@@ -362,7 +360,7 @@ Error CTaskRecover::IsEnded()
return ERR_CONTINUE;
}
- m_metal->SetLock(FALSE); // metal usable
+ m_metal->SetLock(false); // metal usable
Abort();
return ERR_STOP;
@@ -370,7 +368,7 @@ Error CTaskRecover::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskRecover::Abort()
+bool CTaskRecover::Abort()
{
m_object->SetAngleZ(2, 126.0f*PI/180.0f);
m_object->SetAngleZ(4, 126.0f*PI/180.0f);
@@ -385,7 +383,7 @@ BOOL CTaskRecover::Abort()
}
m_camera->StopCentering(m_object, 2.0f);
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskrecover.h b/src/object/task/taskrecover.h
index d8625ad..87efc07 100644
--- a/src/object/task/taskrecover.h
+++ b/src/object/task/taskrecover.h
@@ -47,11 +47,11 @@ public:
CTaskRecover(CInstanceManager* iMan, CObject* object);
~CTaskRecover();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start();
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
CObject* SearchRuin();
@@ -63,7 +63,7 @@ protected:
float m_time;
float m_angle;
float m_lastParticule;
- BOOL m_bError;
+ bool m_bError;
CObject* m_ruin;
CObject* m_metal;
D3DVECTOR m_recoverPos;
diff --git a/src/object/task/taskreset.cpp b/src/object/task/taskreset.cpp
index 5616c0c..1b7ff95 100644
--- a/src/object/task/taskreset.cpp
+++ b/src/object/task/taskreset.cpp
@@ -52,7 +52,6 @@
CTaskReset::CTaskReset(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
}
// Object's destructor.
@@ -64,15 +63,15 @@ CTaskReset::~CTaskReset()
// Management of an event.
-BOOL CTaskReset::EventProcess(const Event &event)
+bool CTaskReset::EventProcess(const Event &event)
{
D3DVECTOR pos, speed;
FPOINT dim;
float angle, duration;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
m_time += event.rTime;
m_progress += event.rTime*m_speed;
@@ -171,7 +170,7 @@ BOOL CTaskReset::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -196,7 +195,7 @@ Error CTaskReset::Start(D3DVECTOR goal, D3DVECTOR angle)
m_object->SetAngle(0, angle);
m_brain->RunProgram(m_object->RetResetRun());
- m_bError = FALSE;
+ m_bError = false;
return ERR_OK;
}
@@ -206,7 +205,7 @@ Error CTaskReset::Start(D3DVECTOR goal, D3DVECTOR angle)
if ( SearchVehicle() ) // starting location occupied?
{
- m_bError = TRUE;
+ m_bError = true;
return ERR_RESET_NEAR;
}
@@ -217,12 +216,12 @@ Error CTaskReset::Start(D3DVECTOR goal, D3DVECTOR angle)
m_progress = 0.0f;
m_lastParticule = 0.0f;
- m_object->SetResetBusy(TRUE);
+ m_object->SetResetBusy(true);
- i = m_sound->Play(SOUND_GGG, m_begin, 1.0f, 2.0f, TRUE);
+ i = m_sound->Play(SOUND_GGG, m_begin, 1.0f, 2.0f, true);
m_sound->AddEnvelope(i, 0.0f, 0.5f, RESET_DELAY_ZOOM, SOPER_STOP);
- m_bError = FALSE;
+ m_bError = false;
return ERR_OK;
}
@@ -257,7 +256,7 @@ Error CTaskReset::IsEnded()
m_object->SetPosition(0, m_goal);
m_object->SetAngle(0, m_angle);
- i = m_sound->Play(SOUND_GGG, m_goal, 1.0f, 0.5f, TRUE);
+ i = m_sound->Play(SOUND_GGG, m_goal, 1.0f, 0.5f, true);
m_sound->AddEnvelope(i, 0.0f, 2.0f, RESET_DELAY_ZOOM, SOPER_STOP);
m_phase = TRSP_ZIN;
@@ -276,14 +275,14 @@ Error CTaskReset::IsEnded()
}
m_brain->RunProgram(m_object->RetResetRun());
- m_object->SetResetBusy(FALSE);
+ m_object->SetResetBusy(false);
return ERR_STOP;
}
// Seeks if a vehicle is too close.
-BOOL CTaskReset::SearchVehicle()
+bool CTaskReset::SearchVehicle()
{
CObject* pObj;
D3DVECTOR oPos;
@@ -337,9 +336,9 @@ BOOL CTaskReset::SearchVehicle()
if ( !pObj->GetCrashSphere(0, oPos, oRadius) ) continue;
dist = Length(oPos, m_goal)-oRadius;
- if ( dist < 5.0f ) return TRUE;
+ if ( dist < 5.0f ) return true;
}
- return FALSE;
+ return false;
}
diff --git a/src/object/task/taskreset.h b/src/object/task/taskreset.h
index 6665bce..4ebc032 100644
--- a/src/object/task/taskreset.h
+++ b/src/object/task/taskreset.h
@@ -46,13 +46,13 @@ public:
CTaskReset(CInstanceManager* iMan, CObject* object);
~CTaskReset();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(D3DVECTOR goal, D3DVECTOR angle);
Error IsEnded();
protected:
- BOOL SearchVehicle();
+ bool SearchVehicle();
protected:
D3DVECTOR m_begin;
@@ -60,7 +60,7 @@ protected:
D3DVECTOR m_angle;
TaskResetPhase m_phase;
- BOOL m_bError;
+ bool m_bError;
float m_time;
float m_speed;
float m_progress;
diff --git a/src/object/task/tasksearch.cpp b/src/object/task/tasksearch.cpp
index 7007691..f182250 100644
--- a/src/object/task/tasksearch.cpp
+++ b/src/object/task/tasksearch.cpp
@@ -47,8 +47,6 @@
CTaskSearch::CTaskSearch(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
-
m_hand = TSH_UP;
}
@@ -61,7 +59,7 @@ CTaskSearch::~CTaskSearch()
// Management of an event.
-BOOL CTaskSearch::EventProcess(const Event &event)
+bool CTaskSearch::EventProcess(const Event &event)
{
D3DMATRIX* mat;
D3DVECTOR pos, speed;
@@ -69,9 +67,9 @@ BOOL CTaskSearch::EventProcess(const Event &event)
float angle;
int i;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
m_progress += event.rTime*m_speed; // others advance
m_time += event.rTime;
@@ -104,7 +102,7 @@ BOOL CTaskSearch::EventProcess(const Event &event)
m_particule->CreateParticule(pos, speed, dim, PARTIGAS);
}
- return TRUE;
+ return true;
}
@@ -142,7 +140,7 @@ Error CTaskSearch::Start()
D3DVECTOR speed;
int i;
- m_bError = TRUE;
+ m_bError = true;
if ( !m_physics->RetLand() ) return ERR_SEARCH_FLY;
speed = m_physics->RetMotorSpeed();
@@ -163,16 +161,16 @@ Error CTaskSearch::Start()
m_lastParticule = 0.0f;
InitAngle();
- m_bError = FALSE; // ok
+ m_bError = false; // ok
m_camera->StartCentering(m_object, PI*0.50f, 99.9f, 0.0f, 1.0f);
- i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.3f, TRUE);
+ i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.3f, true);
m_sound->AddEnvelope(i, 0.5f, 1.0f, 0.1f, SOPER_CONTINUE);
m_sound->AddEnvelope(i, 0.5f, 1.0f, 0.9f, SOPER_CONTINUE);
m_sound->AddEnvelope(i, 0.0f, 0.3f, 0.1f, SOPER_STOP);
- m_physics->SetFreeze(TRUE); // it does not move
+ m_physics->SetFreeze(true); // it does not move
return ERR_OK;
}
@@ -214,7 +212,7 @@ Error CTaskSearch::IsEnded()
m_hand = TSH_UP;
InitAngle();
- i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.3f, TRUE);
+ i = m_sound->Play(SOUND_MANIP, m_object->RetPosition(0), 0.0f, 0.3f, true);
m_sound->AddEnvelope(i, 0.5f, 1.0f, 0.1f, SOPER_CONTINUE);
m_sound->AddEnvelope(i, 0.5f, 1.0f, 0.9f, SOPER_CONTINUE);
m_sound->AddEnvelope(i, 0.0f, 0.3f, 0.1f, SOPER_STOP);
@@ -230,17 +228,17 @@ Error CTaskSearch::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskSearch::Abort()
+bool CTaskSearch::Abort()
{
m_camera->StopCentering(m_object, 2.0f);
- m_physics->SetFreeze(FALSE); // is moving again
- return TRUE;
+ m_physics->SetFreeze(false); // is moving again
+ return true;
}
// Creates a mark if possible.
-BOOL CTaskSearch::CreateMark()
+bool CTaskSearch::CreateMark()
{
CObject* fret;
ObjectType type;
@@ -254,7 +252,7 @@ BOOL CTaskSearch::CreateMark()
pos = Transform(*mat, pos); // sensor position
res = m_terrain->RetResource(pos);
- if ( res == TR_NULL ) return FALSE;
+ if ( res == TR_NULL ) return false;
type = OBJECT_NULL;
if ( res == TR_STONE )
@@ -292,7 +290,7 @@ BOOL CTaskSearch::CreateMark()
type = OBJECT_MARKKEYd;
info = INFO_MARKKEYd;
}
- if ( type == OBJECT_NULL ) return FALSE;
+ if ( type == OBJECT_NULL ) return false;
//? DeleteMark(type);
@@ -301,12 +299,12 @@ BOOL CTaskSearch::CreateMark()
{
delete fret;
m_displayText->DisplayError(ERR_TOOMANY, m_object);
- return FALSE;
+ return false;
}
m_displayText->DisplayError(info, pos, 5.0f, 50.0f); // displays the message
- return TRUE;
+ return true;
}
// Destroys the marks of a given type.
diff --git a/src/object/task/tasksearch.h b/src/object/task/tasksearch.h
index 18254cc..48b1a32 100644
--- a/src/object/task/tasksearch.h
+++ b/src/object/task/tasksearch.h
@@ -51,15 +51,15 @@ public:
CTaskSearch(CInstanceManager* iMan, CObject* object);
~CTaskSearch();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start();
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
void InitAngle();
- BOOL CreateMark();
+ bool CreateMark();
void DeleteMark(ObjectType type);
protected:
@@ -71,6 +71,6 @@ protected:
float m_lastParticule;
float m_initialAngle[3];
float m_finalAngle[3];
- BOOL m_bError;
+ bool m_bError;
};
diff --git a/src/object/task/taskshield.cpp b/src/object/task/taskshield.cpp
index 03cc571..818a3a7 100644
--- a/src/object/task/taskshield.cpp
+++ b/src/object/task/taskshield.cpp
@@ -50,8 +50,6 @@
CTaskShield::CTaskShield(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
-
m_rankSphere = -1;
m_soundChannel = -1;
m_effectLight = -1;
@@ -67,7 +65,7 @@ CTaskShield::~CTaskShield()
// Management of an event.
-BOOL CTaskShield::EventProcess(const Event &event)
+bool CTaskShield::EventProcess(const Event &event)
{
CObject* power;
D3DMATRIX* mat;
@@ -77,9 +75,9 @@ BOOL CTaskShield::EventProcess(const Event &event)
FPOINT dim;
float energy;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
m_progress += event.rTime*m_speed; // others advance
m_time += event.rTime;
@@ -127,7 +125,7 @@ BOOL CTaskShield::EventProcess(const Event &event)
if ( m_soundChannel == -1 )
{
- m_soundChannel = m_sound->Play(SOUND_SHIELD, m_shieldPos, 0.5f, 0.5f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_SHIELD, m_shieldPos, 0.5f, 0.5f, true);
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, 2.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, 1.0f, SOPER_LOOP);
}
@@ -232,7 +230,7 @@ BOOL CTaskShield::EventProcess(const Event &event)
m_object->SetPosition(2, pos);
}
- return TRUE;
+ return true;
}
@@ -264,7 +262,7 @@ Error CTaskShield::Start(TaskShieldMode mode, float delay)
type = m_object->RetType();
if ( type != OBJECT_MOBILErs ) return ERR_SHIELD_VEH;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
if ( !m_physics->RetLand() ) return ERR_SHIELD_VEH;
power = m_object->RetPower();
@@ -289,7 +287,7 @@ Error CTaskShield::Start(TaskShieldMode mode, float delay)
m_lastIncrease = 0.0f;
m_energyUsed = 0.0f;
- m_bError = FALSE; // ok
+ m_bError = false; // ok
if ( m_object->RetSelect() )
{
@@ -439,19 +437,19 @@ Error CTaskShield::IsEnded()
// Indicates whether the action is pending.
-BOOL CTaskShield::IsBusy()
+bool CTaskShield::IsBusy()
{
if ( m_phase == TS_SHIELD )
{
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// Suddenly ends the current action.
-BOOL CTaskShield::Abort()
+bool CTaskShield::Abort()
{
D3DVECTOR pos;
@@ -487,17 +485,17 @@ BOOL CTaskShield::Abort()
}
m_camera->StopCentering(m_object, 2.0f);
- return TRUE;
+ return true;
}
// Creates the light to accompany a pyrotechnic effect.
-BOOL CTaskShield::CreateLight(D3DVECTOR pos)
+bool CTaskShield::CreateLight(D3DVECTOR pos)
{
D3DLIGHT7 light;
- if ( !m_engine->RetLightMode() ) return TRUE;
+ if ( !m_engine->RetLightMode() ) return true;
ZeroMemory( &light, sizeof(light) );
light.dltType = D3DLIGHT_SPOT;
@@ -519,12 +517,12 @@ BOOL CTaskShield::CreateLight(D3DVECTOR pos)
light.dvPhi = PI/4.0f;
m_effectLight = m_light->CreateLight();
- if ( m_effectLight == -1 ) return FALSE;
+ if ( m_effectLight == -1 ) return false;
m_light->SetLight(m_effectLight, light);
m_light->SetLightIntensity(m_effectLight, 1.0f);
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskshield.h b/src/object/task/taskshield.h
index 6fa1540..e78466e 100644
--- a/src/object/task/taskshield.h
+++ b/src/object/task/taskshield.h
@@ -59,16 +59,16 @@ public:
CTaskShield(CInstanceManager* iMan, CObject* object);
~CTaskShield();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(TaskShieldMode mode, float delay);
Error IsEnded();
- BOOL IsBusy();
- BOOL Abort();
+ bool IsBusy();
+ bool Abort();
protected:
Error Stop();
- BOOL CreateLight(D3DVECTOR pos);
+ bool CreateLight(D3DVECTOR pos);
void IncreaseShield();
float RetRadius();
@@ -82,7 +82,7 @@ protected:
float m_lastRay;
float m_lastIncrease;
float m_energyUsed;
- BOOL m_bError;
+ bool m_bError;
D3DVECTOR m_shieldPos;
int m_rankSphere;
int m_soundChannel;
diff --git a/src/object/task/taskspiderexplo.cpp b/src/object/task/taskspiderexplo.cpp
index 2f7717c..496916c 100644
--- a/src/object/task/taskspiderexplo.cpp
+++ b/src/object/task/taskspiderexplo.cpp
@@ -45,10 +45,8 @@
CTaskSpiderExplo::CTaskSpiderExplo(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
-
m_time = 0.0f;
- m_bError = FALSE;
+ m_bError = false;
}
// Object's destructor.
@@ -60,21 +58,21 @@ CTaskSpiderExplo::~CTaskSpiderExplo()
// Management of an event.
-BOOL CTaskSpiderExplo::EventProcess(const Event &event)
+bool CTaskSpiderExplo::EventProcess(const Event &event)
{
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
// Momentarily stationary object (ant on the back)?
if ( m_object->RetFixed() )
{
- m_bError = TRUE;
- return TRUE;
+ m_bError = true;
+ return true;
}
m_time += event.rTime;
- return TRUE;
+ return true;
}
@@ -88,7 +86,7 @@ Error CTaskSpiderExplo::Start()
m_physics->SetMotorSpeedX(0.0f); // stops the advance
m_physics->SetMotorSpeedZ(0.0f); // stops the rotation
- m_bError = FALSE;
+ m_bError = false;
return ERR_OK;
}
@@ -117,8 +115,8 @@ Error CTaskSpiderExplo::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskSpiderExplo::Abort()
+bool CTaskSpiderExplo::Abort()
{
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskspiderexplo.h b/src/object/task/taskspiderexplo.h
index 3e68279..a08e9dd 100644
--- a/src/object/task/taskspiderexplo.h
+++ b/src/object/task/taskspiderexplo.h
@@ -35,16 +35,16 @@ public:
CTaskSpiderExplo(CInstanceManager* iMan, CObject* object);
~CTaskSpiderExplo();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start();
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
protected:
float m_time;
- BOOL m_bError;
+ bool m_bError;
};
diff --git a/src/object/task/tasktake.cpp b/src/object/task/tasktake.cpp
index 912033f..b09366a 100644
--- a/src/object/task/tasktake.cpp
+++ b/src/object/task/tasktake.cpp
@@ -52,8 +52,6 @@
CTaskTake::CTaskTake(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
-
m_terrain = (CTerrain*)m_iMan->SearchInstance(CLASS_TERRAIN);
m_arm = TTA_NEUTRAL;
@@ -68,13 +66,13 @@ CTaskTake::~CTaskTake()
// Management of an event.
-BOOL CTaskTake::EventProcess(const Event &event)
+bool CTaskTake::EventProcess(const Event &event)
{
float a, g, cirSpeed;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
if ( m_bTurn ) // preliminary rotation?
{
@@ -85,14 +83,14 @@ BOOL CTaskTake::EventProcess(const Event &event)
if ( cirSpeed < -1.0f ) cirSpeed = -1.0f;
m_physics->SetMotorSpeedZ(cirSpeed); // turns left / right
- return TRUE;
+ return true;
}
m_progress += event.rTime*m_speed; // others advance
m_physics->SetMotorSpeed(D3DVECTOR(0.0f, 0.0f, 0.0f)); // immobile!
- return TRUE;
+ return true;
}
@@ -113,7 +111,7 @@ Error CTaskTake::Start()
iAngle = NormAngle(iAngle); // 0..2*PI
oAngle = iAngle;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
if ( !m_physics->RetLand() )
{
pos = m_object->RetPosition(0);
@@ -195,12 +193,12 @@ Error CTaskTake::Start()
}
}
- m_bTurn = TRUE; // preliminary rotation necessary
+ m_bTurn = true; // preliminary rotation necessary
m_angle = oAngle; // angle was reached
- m_physics->SetFreeze(TRUE); // it does not move
+ m_physics->SetFreeze(true); // it does not move
- m_bError = FALSE; // ok
+ m_bError = false; // ok
return ERR_OK;
}
@@ -221,7 +219,7 @@ Error CTaskTake::IsEnded()
if ( TestAngle(angle, m_angle-PI*0.01f, m_angle+PI*0.01f) )
{
- m_bTurn = FALSE; // rotation ended
+ m_bTurn = false; // rotation ended
m_physics->SetMotorSpeedZ(0.0f);
if ( m_arm == TTA_FFRONT )
@@ -301,12 +299,12 @@ Error CTaskTake::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskTake::Abort()
+bool CTaskTake::Abort()
{
m_motion->SetAction(-1);
m_camera->StopCentering(m_object, 0.8f);
- m_physics->SetFreeze(FALSE); // is moving again
- return TRUE;
+ m_physics->SetFreeze(false); // is moving again
+ return true;
}
@@ -467,7 +465,7 @@ CObject* CTaskTake::SearchFriendObject(float &angle,
// Takes the object in front.
-BOOL CTaskTake::TruckTakeObject()
+bool CTaskTake::TruckTakeObject()
{
CObject* fret;
CObject* other;
@@ -478,7 +476,7 @@ BOOL CTaskTake::TruckTakeObject()
{
//? fret = SearchTakeObject(angle, 1.5f, PI*0.04f);
fret = SearchTakeObject(angle, 1.5f, PI*0.15f); //OK 1.9
- if ( fret == 0 ) return FALSE; // rien � prendre ?
+ if ( fret == 0 ) return false; // rien � prendre ?
m_fretType = fret->RetType();
fret->SetTruck(m_object);
@@ -496,10 +494,10 @@ BOOL CTaskTake::TruckTakeObject()
if ( m_arm == TTA_FRIEND ) // takes friend's battery?
{
other = SearchFriendObject(angle, 1.5f, PI*0.04f);
- if ( other == 0 ) return FALSE;
+ if ( other == 0 ) return false;
fret = other->RetPower();
- if ( fret == 0 ) return FALSE; // the other does not have a battery?
+ if ( fret == 0 ) return false; // the other does not have a battery?
m_fretType = fret->RetType();
other->SetPower(0);
@@ -515,12 +513,12 @@ BOOL CTaskTake::TruckTakeObject()
m_object->SetFret(fret); // takes
}
- return TRUE;
+ return true;
}
// Deposes the object taken.
-BOOL CTaskTake::TruckDeposeObject()
+bool CTaskTake::TruckDeposeObject()
{
Character* character;
CObject* fret;
@@ -532,7 +530,7 @@ BOOL CTaskTake::TruckDeposeObject()
if ( m_arm == TTA_FFRONT ) // deposes on the ground in front?
{
fret = m_object->RetFret();
- if ( fret == 0 ) return FALSE; // does nothing?
+ if ( fret == 0 ) return false; // does nothing?
m_fretType = fret->RetType();
mat = fret->RetWorldMatrix(0);
@@ -551,13 +549,13 @@ BOOL CTaskTake::TruckDeposeObject()
if ( m_arm == TTA_FRIEND ) // deposes battery on friends?
{
other = SearchFriendObject(angle, 1.5f, PI*0.04f);
- if ( other == 0 ) return FALSE;
+ if ( other == 0 ) return false;
fret = other->RetPower();
- if ( fret != 0 ) return FALSE; // the other already has a battery?
+ if ( fret != 0 ) return false; // the other already has a battery?
fret = m_object->RetFret();
- if ( fret == 0 ) return FALSE;
+ if ( fret == 0 ) return false;
m_fretType = fret->RetType();
other->SetPower(fret);
@@ -573,12 +571,12 @@ BOOL CTaskTake::TruckDeposeObject()
m_object->SetFret(0); // deposit
}
- return TRUE;
+ return true;
}
// Seeks if a location allows to deposit an object.
-BOOL CTaskTake::IsFreeDeposeObject(D3DVECTOR pos)
+bool CTaskTake::IsFreeDeposeObject(D3DVECTOR pos)
{
CObject* pObj;
D3DMATRIX* mat;
@@ -603,11 +601,11 @@ BOOL CTaskTake::IsFreeDeposeObject(D3DVECTOR pos)
{
if ( Length(iPos, oPos)-(oRadius+1.0f) < 1.0f )
{
- return FALSE; // location occupied
+ return false; // location occupied
}
}
}
- return TRUE; // location free
+ return true; // location free
}
diff --git a/src/object/task/tasktake.h b/src/object/task/tasktake.h
index 31ccfef..f94c366 100644
--- a/src/object/task/tasktake.h
+++ b/src/object/task/tasktake.h
@@ -52,18 +52,18 @@ public:
CTaskTake(CInstanceManager* iMan, CObject* object);
~CTaskTake();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start();
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
CObject* SearchTakeObject(float &angle, float dLimit, float aLimit);
CObject* SearchFriendObject(float &angle, float dLimit, float aLimit);
- BOOL TruckTakeObject();
- BOOL TruckDeposeObject();
- BOOL IsFreeDeposeObject(D3DVECTOR pos);
+ bool TruckTakeObject();
+ bool TruckDeposeObject();
+ bool IsFreeDeposeObject(D3DVECTOR pos);
protected:
CTerrain* m_terrain;
@@ -74,8 +74,8 @@ protected:
float m_speed;
float m_progress;
float m_height;
- BOOL m_bError;
- BOOL m_bTurn;
+ bool m_bError;
+ bool m_bTurn;
float m_angle;
ObjectType m_fretType;
};
diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp
index 9e07e05..a3403f0 100644
--- a/src/object/task/taskterraform.cpp
+++ b/src/object/task/taskterraform.cpp
@@ -54,7 +54,6 @@
CTaskTerraform::CTaskTerraform(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
m_lastParticule = 0.0f;
m_soundChannel = -1;
}
@@ -68,7 +67,7 @@ CTaskTerraform::~CTaskTerraform()
// Management of an event.
-BOOL CTaskTerraform::EventProcess(const Event &event)
+bool CTaskTerraform::EventProcess(const Event &event)
{
CObject* power;
D3DMATRIX* mat;
@@ -76,9 +75,9 @@ BOOL CTaskTerraform::EventProcess(const Event &event)
FPOINT dim;
float energy;
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
- if ( m_bError ) return FALSE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
+ if ( m_bError ) return false;
m_progress += event.rTime*m_speed; // others advance
m_time += event.rTime;
@@ -88,11 +87,11 @@ BOOL CTaskTerraform::EventProcess(const Event &event)
if ( m_soundChannel == -1 )
{
#if _TEEN
- m_soundChannel = m_sound->Play(SOUND_GGG, m_object->RetPosition(0), 1.0f, 0.5f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_GGG, m_object->RetPosition(0), 1.0f, 0.5f, true);
m_sound->AddEnvelope(m_soundChannel, 1.0f, 2.0f, 1.5f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 0.5f, SOPER_STOP);
#else
- m_soundChannel = m_sound->Play(SOUND_GGG, m_object->RetPosition(0), 1.0f, 0.5f, TRUE);
+ m_soundChannel = m_sound->Play(SOUND_GGG, m_object->RetPosition(0), 1.0f, 0.5f, true);
m_sound->AddEnvelope(m_soundChannel, 1.0f, 2.0f, 4.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 0.5f, SOPER_STOP);
#endif
@@ -204,7 +203,7 @@ BOOL CTaskTerraform::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -219,7 +218,7 @@ Error CTaskTerraform::Start()
ObjectType type;
- m_bError = TRUE; // operation impossible
+ m_bError = true; // operation impossible
if ( !m_physics->RetLand() ) return ERR_TERRA_VEH;
type = m_object->RetType();
@@ -248,7 +247,7 @@ Error CTaskTerraform::Start()
#endif
m_time = 0.0f;
- m_bError = FALSE; // ok
+ m_bError = false; // ok
m_camera->StartCentering(m_object, PI*0.35f, 99.9f, 20.0f, 2.0f);
return ERR_OK;
@@ -340,7 +339,7 @@ Error CTaskTerraform::IsEnded()
// Suddenly ends the current action.
-BOOL CTaskTerraform::Abort()
+bool CTaskTerraform::Abort()
{
CObject* power;
@@ -363,13 +362,13 @@ BOOL CTaskTerraform::Abort()
}
m_camera->StopCentering(m_object, 2.0f);
- return TRUE;
+ return true;
}
// Returns all the close ants and spiders.
-BOOL CTaskTerraform::Terraform()
+bool CTaskTerraform::Terraform()
{
CObject* pObj;
CBrain* brain;
@@ -412,18 +411,18 @@ BOOL CTaskTerraform::Terraform()
brain = pObj->RetBrain();
if ( brain != 0 ) brain->StopTask();
motion->SetAction(MAS_BACK1, 0.8f+Rand()*0.3f);
- pObj->SetFixed(TRUE); // not moving
+ pObj->SetFixed(true); // not moving
}
if ( type == OBJECT_SPIDER )
{
brain = pObj->RetBrain();
if ( brain != 0 ) brain->StopTask();
motion->SetAction(MSS_BACK1, 0.8f+Rand()*0.3f);
- pObj->SetFixed(TRUE); // not moving
+ pObj->SetFixed(true); // not moving
}
}
}
- return TRUE;
+ return true;
}
diff --git a/src/object/task/taskterraform.h b/src/object/task/taskterraform.h
index bc66c66..dfb3488 100644
--- a/src/object/task/taskterraform.h
+++ b/src/object/task/taskterraform.h
@@ -47,14 +47,14 @@ public:
CTaskTerraform(CInstanceManager* iMan, CObject* object);
~CTaskTerraform();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start();
Error IsEnded();
- BOOL Abort();
+ bool Abort();
protected:
- BOOL Terraform();
+ bool Terraform();
protected:
TaskTerraPhase m_phase;
@@ -63,7 +63,7 @@ protected:
float m_time;
float m_lastParticule;
int m_soundChannel;
- BOOL m_bError;
+ bool m_bError;
D3DVECTOR m_terraPos;
};
diff --git a/src/object/task/taskturn.cpp b/src/object/task/taskturn.cpp
index d75f9d1..35f1eb9 100644
--- a/src/object/task/taskturn.cpp
+++ b/src/object/task/taskturn.cpp
@@ -44,7 +44,6 @@
CTaskTurn::CTaskTurn(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
}
// Object's destructor.
@@ -56,21 +55,21 @@ CTaskTurn::~CTaskTurn()
// Management of an event.
-BOOL CTaskTurn::EventProcess(const Event &event)
+bool CTaskTurn::EventProcess(const Event &event)
{
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
// Momentarily stationary object (ant on the back)?
if ( m_object->RetFixed() )
{
m_physics->SetMotorSpeedX(0.0f); // stops the advance
m_physics->SetMotorSpeedZ(0.0f); // stops the rotation
- m_bError = TRUE;
- return TRUE;
+ m_bError = true;
+ return true;
}
- return TRUE;
+ return true;
}
@@ -86,18 +85,18 @@ Error CTaskTurn::Start(float angle)
{
m_angle = angle+m_physics->RetCirStopLength();
m_physics->SetMotorSpeedZ(-1.0f); // turns left
- m_bLeft = TRUE;
+ m_bLeft = true;
}
else
{
m_angle = angle-m_physics->RetCirStopLength();
m_physics->SetMotorSpeedZ(1.0f); // turns right
- m_bLeft = FALSE;
+ m_bLeft = false;
}
m_physics->SetMotorSpeedX(0.0f);
m_physics->SetMotorSpeedY(0.0f);
- m_bError = FALSE;
+ m_bError = false;
return ERR_OK;
}
diff --git a/src/object/task/taskturn.h b/src/object/task/taskturn.h
index 27cba98..b9a432b 100644
--- a/src/object/task/taskturn.h
+++ b/src/object/task/taskturn.h
@@ -35,7 +35,7 @@ public:
CTaskTurn(CInstanceManager* iMan, CObject* object);
~CTaskTurn();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(float angle);
Error IsEnded();
@@ -46,7 +46,7 @@ protected:
float m_angle;
float m_startAngle;
float m_finalAngle;
- BOOL m_bLeft;
- BOOL m_bError;
+ bool m_bLeft;
+ bool m_bError;
};
diff --git a/src/object/task/taskwait.cpp b/src/object/task/taskwait.cpp
index 7560e9a..64883c1 100644
--- a/src/object/task/taskwait.cpp
+++ b/src/object/task/taskwait.cpp
@@ -44,7 +44,6 @@
CTaskWait::CTaskWait(CInstanceManager* iMan, CObject* object)
: CTask(iMan, object)
{
- CTask::CTask(iMan, object);
}
// Object's destructor.
@@ -56,14 +55,14 @@ CTaskWait::~CTaskWait()
// Management of an event.
-BOOL CTaskWait::EventProcess(const Event &event)
+bool CTaskWait::EventProcess(const Event &event)
{
- if ( m_engine->RetPause() ) return TRUE;
- if ( event.event != EVENT_FRAME ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
+ if ( event.event != EVENT_FRAME ) return true;
m_passTime += event.rTime;
m_bEnded = (m_passTime >= m_waitTime);
- return TRUE;
+ return true;
}
@@ -73,7 +72,7 @@ Error CTaskWait::Start(float time)
{
m_waitTime = time; // duration to wait
m_passTime = 0.0f; // time elapsed
- m_bEnded = FALSE;
+ m_bEnded = false;
return ERR_OK;
}
diff --git a/src/object/task/taskwait.h b/src/object/task/taskwait.h
index 7a33f49..25e8e67 100644
--- a/src/object/task/taskwait.h
+++ b/src/object/task/taskwait.h
@@ -35,7 +35,7 @@ public:
CTaskWait(CInstanceManager* iMan, CObject* object);
~CTaskWait();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
Error Start(float time);
Error IsEnded();
@@ -45,6 +45,6 @@ protected:
protected:
float m_waitTime;
float m_passTime;
- BOOL m_bEnded;
+ bool m_bEnded;
};