summaryrefslogtreecommitdiffstats
path: root/src/object/auto/autorepair.cpp
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/auto/autorepair.cpp
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/auto/autorepair.cpp')
-rw-r--r--src/object/auto/autorepair.cpp33
1 files changed, 16 insertions, 17 deletions
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;
}