summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/button.cpp34
-rw-r--r--src/ui/button.h18
-rw-r--r--src/ui/check.cpp12
-rw-r--r--src/ui/check.h4
-rw-r--r--src/ui/color.cpp20
-rw-r--r--src/ui/color.h10
-rw-r--r--src/ui/compass.cpp10
-rw-r--r--src/ui/compass.h4
-rw-r--r--src/ui/control.cpp68
-rw-r--r--src/ui/control.h32
-rw-r--r--src/ui/displayinfo.cpp96
-rw-r--r--src/ui/displayinfo.h16
-rw-r--r--src/ui/displaytext.cpp46
-rw-r--r--src/ui/displaytext.h16
-rw-r--r--src/ui/edit.cpp382
-rw-r--r--src/ui/edit.h100
-rw-r--r--src/ui/editvalue.cpp36
-rw-r--r--src/ui/editvalue.h6
-rw-r--r--src/ui/gauge.cpp10
-rw-r--r--src/ui/gauge.h4
-rw-r--r--src/ui/group.cpp8
-rw-r--r--src/ui/group.h4
-rw-r--r--src/ui/image.cpp8
-rw-r--r--src/ui/image.h4
-rw-r--r--src/ui/interface.cpp18
-rw-r--r--src/ui/interface.h6
-rw-r--r--src/ui/key.cpp26
-rw-r--r--src/ui/key.h8
-rw-r--r--src/ui/label.cpp8
-rw-r--r--src/ui/label.h4
-rw-r--r--src/ui/list.cpp60
-rw-r--r--src/ui/list.h34
-rw-r--r--src/ui/maindialog.cpp444
-rw-r--r--src/ui/maindialog.h86
-rw-r--r--src/ui/mainmap.cpp20
-rw-r--r--src/ui/mainmap.h16
-rw-r--r--src/ui/mainshort.cpp16
-rw-r--r--src/ui/mainshort.h8
-rw-r--r--src/ui/map.cpp102
-rw-r--r--src/ui/map.h28
-rw-r--r--src/ui/scroll.cpp28
-rw-r--r--src/ui/scroll.h12
-rw-r--r--src/ui/shortcut.cpp10
-rw-r--r--src/ui/shortcut.h4
-rw-r--r--src/ui/slider.cpp32
-rw-r--r--src/ui/slider.h14
-rw-r--r--src/ui/studio.cpp226
-rw-r--r--src/ui/studio.h26
-rw-r--r--src/ui/target.cpp42
-rw-r--r--src/ui/target.h6
-rw-r--r--src/ui/window.cpp94
-rw-r--r--src/ui/window.h52
52 files changed, 1188 insertions, 1190 deletions
diff --git a/src/ui/button.cpp b/src/ui/button.cpp
index e03331a..697122c 100644
--- a/src/ui/button.cpp
+++ b/src/ui/button.cpp
@@ -42,9 +42,9 @@
CButton::CButton(CInstanceManager* iMan) : CControl(iMan)
{
- m_bCapture = FALSE;
- m_bImmediat = FALSE;
- m_bRepeat = FALSE;
+ m_bCapture = false;
+ m_bImmediat = false;
+ m_bRepeat = false;
m_repeat = 0.0f;
}
@@ -57,7 +57,7 @@ CButton::~CButton()
// Creates a new button.
-BOOL CButton::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CButton::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -74,16 +74,16 @@ BOOL CButton::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
SetName(name);
}
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CButton::EventProcess(const Event &event)
+bool CButton::EventProcess(const Event &event)
{
- if ( (m_state & STATE_VISIBLE) == 0 ) return TRUE;
- if ( m_state & STATE_DEAD ) return TRUE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return true;
+ if ( m_state & STATE_DEAD ) return true;
CControl::EventProcess(event);
@@ -99,7 +99,7 @@ BOOL CButton::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
}
@@ -110,7 +110,7 @@ BOOL CButton::EventProcess(const Event &event)
{
if ( CControl::Detect(event.pos) )
{
- m_bCapture = TRUE;
+ m_bCapture = true;
m_repeat = DELAY1;
if ( m_bImmediat || m_bRepeat )
@@ -119,7 +119,7 @@ BOOL CButton::EventProcess(const Event &event)
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
}
- return FALSE;
+ return false;
}
}
@@ -139,11 +139,11 @@ BOOL CButton::EventProcess(const Event &event)
}
}
- m_bCapture = FALSE;
+ m_bCapture = false;
m_repeat = 0.0f;
}
- return TRUE;
+ return true;
}
@@ -222,12 +222,12 @@ void CButton::Draw()
// Management of immediate mode, which sends the event "press"
// before the mouse button is released.
-void CButton::SetImmediat(BOOL bImmediat)
+void CButton::SetImmediat(bool bImmediat)
{
m_bImmediat = bImmediat;
}
-BOOL CButton::RetImmediat()
+bool CButton::RetImmediat()
{
return m_bImmediat;
}
@@ -236,12 +236,12 @@ BOOL CButton::RetImmediat()
// Mode management "autorepeat", when the button
// mouse is held down.
-void CButton::SetRepeat(BOOL bRepeat)
+void CButton::SetRepeat(bool bRepeat)
{
m_bRepeat = bRepeat;
}
-BOOL CButton::RetRepeat()
+bool CButton::RetRepeat()
{
return m_bRepeat;
}
diff --git a/src/ui/button.h b/src/ui/button.h
index 9056ae2..cc34997 100644
--- a/src/ui/button.h
+++ b/src/ui/button.h
@@ -32,24 +32,24 @@ public:
CButton(CInstanceManager* iMan);
virtual ~CButton();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
- void SetImmediat(BOOL bRepeat);
- BOOL RetImmediat();
+ void SetImmediat(bool bRepeat);
+ bool RetImmediat();
- void SetRepeat(BOOL bRepeat);
- BOOL RetRepeat();
+ void SetRepeat(bool bRepeat);
+ bool RetRepeat();
protected:
protected:
- BOOL m_bCapture;
- BOOL m_bImmediat;
- BOOL m_bRepeat;
+ bool m_bCapture;
+ bool m_bImmediat;
+ bool m_bRepeat;
float m_repeat;
};
diff --git a/src/ui/check.cpp b/src/ui/check.cpp
index f005790..b4b944e 100644
--- a/src/ui/check.cpp
+++ b/src/ui/check.cpp
@@ -49,7 +49,7 @@ CCheck::~CCheck()
// Creates a new button.
-BOOL CCheck::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CCheck::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
char name[100];
char* p;
@@ -63,15 +63,15 @@ BOOL CCheck::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
if ( p != 0 ) *p = 0;
SetName(name);
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CCheck::EventProcess(const Event &event)
+bool CCheck::EventProcess(const Event &event)
{
- if ( m_state & STATE_DEAD ) return TRUE;
+ if ( m_state & STATE_DEAD ) return true;
CControl::EventProcess(event);
@@ -84,11 +84,11 @@ BOOL CCheck::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
diff --git a/src/ui/check.h b/src/ui/check.h
index c0f11cf..8bb2c9c 100644
--- a/src/ui/check.h
+++ b/src/ui/check.h
@@ -32,9 +32,9 @@ public:
CCheck(CInstanceManager* iMan);
virtual ~CCheck();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
diff --git a/src/ui/color.cpp b/src/ui/color.cpp
index c4e5694..8876d27 100644
--- a/src/ui/color.cpp
+++ b/src/ui/color.cpp
@@ -42,7 +42,7 @@
CColor::CColor(CInstanceManager* iMan) : CControl(iMan)
{
- m_bRepeat = FALSE;
+ m_bRepeat = false;
m_repeat = 0.0f;
m_color.r = 0.0f;
@@ -60,7 +60,7 @@ CColor::~CColor()
// Creates a new button.
-BOOL CColor::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CColor::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -77,15 +77,15 @@ BOOL CColor::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
SetName(name);
}
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CColor::EventProcess(const Event &event)
+bool CColor::EventProcess(const Event &event)
{
- if ( m_state & STATE_DEAD ) return TRUE;
+ if ( m_state & STATE_DEAD ) return true;
CControl::EventProcess(event);
@@ -101,7 +101,7 @@ BOOL CColor::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
}
@@ -117,7 +117,7 @@ BOOL CColor::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
@@ -126,7 +126,7 @@ BOOL CColor::EventProcess(const Event &event)
m_repeat = 0.0f;
}
- return TRUE;
+ return true;
}
@@ -202,12 +202,12 @@ void CColor::Draw()
}
-void CColor::SetRepeat(BOOL bRepeat)
+void CColor::SetRepeat(bool bRepeat)
{
m_bRepeat = bRepeat;
}
-BOOL CColor::RetRepeat()
+bool CColor::RetRepeat()
{
return m_bRepeat;
}
diff --git a/src/ui/color.h b/src/ui/color.h
index 6c4d7ad..86d9434 100644
--- a/src/ui/color.h
+++ b/src/ui/color.h
@@ -33,14 +33,14 @@ public:
CColor(CInstanceManager* iMan);
virtual ~CColor();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
- void SetRepeat(BOOL bRepeat);
- BOOL RetRepeat();
+ void SetRepeat(bool bRepeat);
+ bool RetRepeat();
void SetColor(D3DCOLORVALUE color);
D3DCOLORVALUE RetColor();
@@ -48,7 +48,7 @@ public:
protected:
protected:
- BOOL m_bRepeat;
+ bool m_bRepeat;
float m_repeat;
D3DCOLORVALUE m_color;
};
diff --git a/src/ui/compass.cpp b/src/ui/compass.cpp
index c2733eb..d856e19 100644
--- a/src/ui/compass.cpp
+++ b/src/ui/compass.cpp
@@ -48,18 +48,18 @@ CCompass::~CCompass()
// Creates a new button.
-BOOL CCompass::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CCompass::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CCompass::EventProcess(const Event &event)
+bool CCompass::EventProcess(const Event &event)
{
CControl::EventProcess(event);
@@ -70,11 +70,11 @@ BOOL CCompass::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
diff --git a/src/ui/compass.h b/src/ui/compass.h
index cc17c36..113623b 100644
--- a/src/ui/compass.h
+++ b/src/ui/compass.h
@@ -32,9 +32,9 @@ public:
CCompass(CInstanceManager* iMan);
virtual ~CCompass();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
diff --git a/src/ui/control.cpp b/src/ui/control.cpp
index 3fa7f79..63ac8ca 100644
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@ -58,10 +58,10 @@ CControl::CControl(CInstanceManager* iMan)
m_justif = 0;
m_name[0] = 0;
m_tooltip[0] = 0;
- m_bFocus = FALSE;
- m_bCapture = FALSE;
+ m_bFocus = false;
+ m_bCapture = false;
- m_bGlint = FALSE;
+ m_bGlint = false;
m_glintCorner1 = FPOINT(0.0f, 0.0f);
m_glintCorner2 = FPOINT(0.0f, 0.0f);
m_glintProgress = 999.0f;
@@ -78,7 +78,7 @@ CControl::~CControl()
// Creates a new button.
// pos: [0..1]
-BOOL CControl::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CControl::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
char text[100];
char* p;
@@ -108,7 +108,7 @@ BOOL CControl::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
strcpy(m_tooltip, p+1); // text after "\\"
}
- return TRUE;
+ return true;
}
@@ -145,34 +145,34 @@ FPOINT CControl::RetDim()
// Modify an attribute of state.
-BOOL CControl::SetState(int state, BOOL bState)
+bool CControl::SetState(int state, bool bState)
{
if ( bState ) m_state |= state;
else m_state &= ~state;
- return TRUE;
+ return true;
}
// Sets an attribute of state.
-BOOL CControl::SetState(int state)
+bool CControl::SetState(int state)
{
m_state |= state;
- return TRUE;
+ return true;
}
// Removes an attribute of state.
-BOOL CControl::ClearState(int state)
+bool CControl::ClearState(int state)
{
m_state &= ~state;
- return TRUE;
+ return true;
}
// Tests an attribute of state.
-BOOL CControl::TestState(int state)
+bool CControl::TestState(int state)
{
- return (m_state & state) ? TRUE:FALSE;
+ return (m_state & state) ? true:false;
}
// Returns all attributes of state.
@@ -198,7 +198,7 @@ int CControl::RetIcon()
// Management of the button name.
-void CControl::SetName(char* name, BOOL bTooltip)
+void CControl::SetName(char* name, bool bTooltip)
{
char* p;
@@ -292,33 +292,33 @@ FontType CControl::RetFontType()
// Specifies the tooltip.
-BOOL CControl::SetTooltip(char* name)
+bool CControl::SetTooltip(char* name)
{
strcpy(m_tooltip, name);
- return TRUE;
+ return true;
}
-BOOL CControl::GetTooltip(FPOINT pos, char* name)
+bool CControl::GetTooltip(FPOINT pos, char* name)
{
- if ( m_tooltip[0] == 0 ) return FALSE;
- if ( (m_state & STATE_VISIBLE) == 0 ) return FALSE;
- if ( (m_state & STATE_ENABLE) == 0 ) return FALSE;
- if ( m_state & STATE_DEAD ) return FALSE;
- if ( !Detect(pos) ) return FALSE;
+ if ( m_tooltip[0] == 0 ) return false;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return false;
+ if ( (m_state & STATE_ENABLE) == 0 ) return false;
+ if ( m_state & STATE_DEAD ) return false;
+ if ( !Detect(pos) ) return false;
strcpy(name, m_tooltip);
- return TRUE;
+ return true;
}
// Management of the focus.
-void CControl::SetFocus(BOOL bFocus)
+void CControl::SetFocus(bool bFocus)
{
m_bFocus = bFocus;
}
-BOOL CControl::RetFocus()
+bool CControl::RetFocus()
{
return m_bFocus;
}
@@ -334,9 +334,9 @@ EventMsg CControl::RetEventMsg()
// Management of an event.
-BOOL CControl::EventProcess(const Event &event)
+bool CControl::EventProcess(const Event &event)
{
- if ( m_state & STATE_DEAD ) return TRUE;
+ if ( m_state & STATE_DEAD ) return true;
if ( event.event == EVENT_FRAME && m_bGlint )
{
@@ -366,7 +366,7 @@ BOOL CControl::EventProcess(const Event &event)
{
if ( Detect(event.pos) )
{
- m_bCapture = TRUE;
+ m_bCapture = true;
SetState(STATE_PRESS);
}
}
@@ -385,11 +385,11 @@ BOOL CControl::EventProcess(const Event &event)
if ( event.event == EVENT_LBUTTONUP && m_bCapture )
{
- m_bCapture = FALSE;
+ m_bCapture = false;
ClearState(STATE_PRESS);
}
- return TRUE;
+ return true;
}
@@ -397,12 +397,12 @@ BOOL CControl::EventProcess(const Event &event)
void CControl::GlintDelete()
{
- m_bGlint = FALSE;
+ m_bGlint = false;
}
// Creates a reflection for that button.
-void CControl::GlintCreate(FPOINT ref, BOOL bLeft, BOOL bUp)
+void CControl::GlintCreate(FPOINT ref, bool bLeft, bool bUp)
{
float offset;
@@ -434,7 +434,7 @@ void CControl::GlintCreate(FPOINT ref, BOOL bLeft, BOOL bUp)
m_glintCorner2.y = ref.y+offset;
}
- m_bGlint = TRUE;
+ m_bGlint = true;
}
// Management of reflection.
@@ -865,7 +865,7 @@ void CControl::DrawShadow(FPOINT pos, FPOINT dim, float deep)
// Detects whether a position is in the button.
-BOOL CControl::Detect(FPOINT pos)
+bool CControl::Detect(FPOINT pos)
{
return ( pos.x >= m_pos.x &&
pos.x <= m_pos.x+m_dim.x &&
diff --git a/src/ui/control.h b/src/ui/control.h
index 9e0fceb..f36e7ba 100644
--- a/src/ui/control.h
+++ b/src/ui/control.h
@@ -58,22 +58,22 @@ public:
CControl(CInstanceManager* iMan);
virtual ~CControl();
- virtual BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ virtual bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- virtual BOOL EventProcess(const Event &event);
+ virtual bool EventProcess(const Event &event);
virtual void SetPos(FPOINT pos);
virtual FPOINT RetPos();
virtual void SetDim(FPOINT dim);
virtual FPOINT RetDim();
- virtual BOOL SetState(int state, BOOL bState);
- virtual BOOL SetState(int state);
- virtual BOOL ClearState(int state);
- virtual BOOL TestState(int state);
+ virtual bool SetState(int state, bool bState);
+ virtual bool SetState(int state);
+ virtual bool ClearState(int state);
+ virtual bool TestState(int state);
virtual int RetState();
virtual void SetIcon(int icon);
virtual int RetIcon();
- virtual void SetName(char* name, BOOL bTooltip=TRUE);
+ virtual void SetName(char* name, bool bTooltip=true);
virtual char* RetName();
virtual void SetJustif(int mode);
virtual int RetJustif();
@@ -83,10 +83,10 @@ public:
virtual float RetFontStretch();
virtual void SetFontType(FontType font);
virtual FontType RetFontType();
- virtual BOOL SetTooltip(char* name);
- virtual BOOL GetTooltip(FPOINT pos, char* name);
- virtual void SetFocus(BOOL bFocus);
- virtual BOOL RetFocus();
+ virtual bool SetTooltip(char* name);
+ virtual bool GetTooltip(FPOINT pos, char* name);
+ virtual void SetFocus(bool bFocus);
+ virtual bool RetFocus();
virtual EventMsg RetEventMsg();
@@ -94,14 +94,14 @@ public:
protected:
void GlintDelete();
- void GlintCreate(FPOINT ref, BOOL bLeft=TRUE, BOOL bUp=TRUE);
+ void GlintCreate(FPOINT ref, bool bLeft=true, bool bUp=true);
void GlintFrame(const Event &event);
void DrawPart(int icon, float zoom, float ex);
void DrawIcon(FPOINT pos, FPOINT dim, FPOINT uv1, FPOINT uv2, float ex=0.0f);
void DrawIcon(FPOINT pos, FPOINT dim, FPOINT uv1, FPOINT uv2, FPOINT corner, float ex);
void DrawWarning(FPOINT pos, FPOINT dim);
void DrawShadow(FPOINT pos, FPOINT dim, float deep=1.0f);
- virtual BOOL Detect(FPOINT pos);
+ virtual bool Detect(FPOINT pos);
protected:
CInstanceManager* m_iMan;
@@ -122,10 +122,10 @@ protected:
int m_justif; // type of justification (-1,0,1)
char m_name[100]; // name of the button
char m_tooltip[100]; // name of tooltip
- BOOL m_bFocus;
- BOOL m_bCapture;
+ bool m_bFocus;
+ bool m_bCapture;
- BOOL m_bGlint;
+ bool m_bGlint;
FPOINT m_glintCorner1;
FPOINT m_glintCorner2;
float m_glintProgress;
diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp
index 534a2ac..b30aeb1 100644
--- a/src/ui/displayinfo.cpp
+++ b/src/ui/displayinfo.cpp
@@ -67,8 +67,8 @@ CDisplayInfo::CDisplayInfo(CInstanceManager* iMan)
m_particule = (CParticule*)m_iMan->SearchInstance(CLASS_PARTICULE);
m_light = (CLight*)m_iMan->SearchInstance(CLASS_LIGHT);
- m_bInfoMaximized = TRUE;
- m_bInfoMinimized = FALSE;
+ m_bInfoMaximized = true;
+ m_bInfoMinimized = false;
m_infoFinalPos = m_infoActualPos = m_infoNormalPos = FPOINT(0.00f, 0.00f);
m_infoFinalDim = m_infoActualPos = m_infoNormalDim = FPOINT(1.00f, 1.00f);
@@ -87,7 +87,7 @@ CDisplayInfo::~CDisplayInfo()
// Management of an event.
-BOOL CDisplayInfo::EventProcess(const Event &event)
+bool CDisplayInfo::EventProcess(const Event &event)
{
CWindow* pw;
CEdit* edit;
@@ -191,7 +191,7 @@ BOOL CDisplayInfo::EventProcess(const Event &event)
if ( event.event == EVENT_STUDIO_SIZE ) // size?
{
slider = (CSlider*)pw->SearchControl(EVENT_STUDIO_SIZE);
- if ( slider == 0 ) return FALSE;
+ if ( slider == 0 ) return false;
m_main->SetFontSize(9.0f+slider->RetVisibleValue()*6.0f);
ViewDisplayInfo();
}
@@ -223,8 +223,8 @@ BOOL CDisplayInfo::EventProcess(const Event &event)
{
m_infoFinalPos = m_infoNormalPos;
m_infoFinalDim = m_infoNormalDim;
- m_bInfoMinimized = FALSE;
- m_bInfoMaximized = FALSE;
+ m_bInfoMinimized = false;
+ m_bInfoMaximized = false;
}
else
{
@@ -232,8 +232,8 @@ BOOL CDisplayInfo::EventProcess(const Event &event)
m_infoFinalPos.y = -0.34f;
m_infoFinalDim.x = 1.00f;
m_infoFinalDim.y = 0.40f;
- m_bInfoMinimized = TRUE;
- m_bInfoMaximized = FALSE;
+ m_bInfoMinimized = true;
+ m_bInfoMaximized = false;
}
//? m_main->SetEditFull(m_bInfoMaximized);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW4);
@@ -249,8 +249,8 @@ BOOL CDisplayInfo::EventProcess(const Event &event)
{
m_infoFinalPos = m_infoNormalPos;
m_infoFinalDim = m_infoNormalDim;
- m_bInfoMinimized = FALSE;
- m_bInfoMaximized = FALSE;
+ m_bInfoMinimized = false;
+ m_bInfoMaximized = false;
}
else
{
@@ -258,8 +258,8 @@ BOOL CDisplayInfo::EventProcess(const Event &event)
m_infoFinalPos.y = 0.00f;
m_infoFinalDim.x = 1.00f;
m_infoFinalDim.y = 1.00f;
- m_bInfoMinimized = FALSE;
- m_bInfoMaximized = TRUE;
+ m_bInfoMinimized = false;
+ m_bInfoMaximized = true;
}
//? m_main->SetEditFull(m_bInfoMaximized);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW4);
@@ -270,13 +270,13 @@ BOOL CDisplayInfo::EventProcess(const Event &event)
}
}
}
- return TRUE;
+ return true;
}
// The brain is changing by time.
-BOOL CDisplayInfo::EventFrame(const Event &event)
+bool CDisplayInfo::EventFrame(const Event &event)
{
float time;
@@ -293,7 +293,7 @@ BOOL CDisplayInfo::EventFrame(const Event &event)
AdjustDisplayInfo(m_infoActualPos, m_infoActualDim);
}
- return TRUE;
+ return true;
}
@@ -304,7 +304,7 @@ void CDisplayInfo::HyperUpdate()
CWindow* pw;
CEdit* edit;
CButton* button;
- BOOL bEnable;
+ bool bEnable;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW4);
if ( pw == 0 ) return;
@@ -336,7 +336,7 @@ void CDisplayInfo::HyperUpdate()
// Beginning of the display of information.
-void CDisplayInfo::StartDisplayInfo(char *filename, int index, BOOL bSoluce)
+void CDisplayInfo::StartDisplayInfo(char *filename, int index, bool bSoluce)
{
D3DLIGHT7 light;
FPOINT pos, dim;
@@ -361,10 +361,10 @@ void CDisplayInfo::StartDisplayInfo(char *filename, int index, BOOL bSoluce)
}
}
- m_main->SetEditLock(TRUE, FALSE);
- m_main->SetEditFull(FALSE);
+ m_main->SetEditLock(true, false);
+ m_main->SetEditFull(false);
m_bInitPause = m_engine->RetPause();
- m_engine->SetPause(TRUE);
+ m_engine->SetPause(true);
m_infoCamera = m_camera->RetType();
m_camera->SetType(CAMERA_INFO);
@@ -372,7 +372,7 @@ void CDisplayInfo::StartDisplayInfo(char *filename, int index, BOOL bSoluce)
dim = m_infoActualDim = m_infoFinalDim;
pw = m_interface->CreateWindows(pos, dim, 4, EVENT_WINDOW4);
if ( pw == 0 ) return;
-//? pw->SetClosable(TRUE);
+//? pw->SetClosable(true);
//? GetResource(RES_TEXT, RT_DISINFO_TITLE, res);
//? pw->SetName(res);
//? pw->SetMinDim(FPOINT(0.56f, 0.40f));
@@ -383,15 +383,15 @@ void CDisplayInfo::StartDisplayInfo(char *filename, int index, BOOL bSoluce)
edit = pw->CreateEdit(pos, dim, 0, EVENT_EDIT1);
if ( edit == 0 ) return;
edit->SetState(STATE_SHADOW);
- edit->SetMultiFont(TRUE);
+ edit->SetMultiFont(true);
edit->SetMaxChar(10000);
edit->SetFontType(FONT_COLOBOT);
edit->SetSoluceMode(bSoluce);
edit->ReadText(filename);
edit->HyperHome(filename);
- edit->SetEditCap(FALSE); // just to see!
- edit->SetHiliteCap(FALSE);
- edit->SetFocus(TRUE);
+ edit->SetEditCap(false); // just to see!
+ edit->SetHiliteCap(false);
+ edit->SetFocus(true);
ViewDisplayInfo();
@@ -447,14 +447,14 @@ void CDisplayInfo::StartDisplayInfo(char *filename, int index, BOOL bSoluce)
AdjustDisplayInfo(m_infoActualPos, m_infoActualDim);
UpdateIndexButton();
- m_engine->SetDrawWorld(FALSE); // doesn't draw anything in the interface
- m_engine->SetDrawFront(TRUE); // toto draws on the interface
- m_particule->SetFrameUpdate(SH_WORLD, FALSE); // particles break into world
+ m_engine->SetDrawWorld(false); // doesn't draw anything in the interface
+ m_engine->SetDrawFront(true); // toto draws on the interface
+ m_particule->SetFrameUpdate(SH_WORLD, false); // particles break into world
m_toto = SearchToto();
if ( m_toto != 0 )
{
- m_toto->SetDrawFront(TRUE);
+ m_toto->SetDrawFront(true);
toto = (CMotionToto*)m_toto->RetMotion();
if ( toto != 0 )
@@ -795,7 +795,7 @@ void CDisplayInfo::UpdateIndexButton()
if ( edit != 0 )
{
//? edit->SetHiliteCap(m_index==SATCOM_LOADING);
- edit->SetHiliteCap(TRUE);
+ edit->SetHiliteCap(true);
}
UpdateCopyButton();
@@ -848,14 +848,14 @@ void CDisplayInfo::StopDisplayInfo()
}
else
{
- if ( !m_bInitPause ) m_engine->SetPause(FALSE);
- m_main->SetEditLock(FALSE, FALSE);
+ if ( !m_bInitPause ) m_engine->SetPause(false);
+ m_main->SetEditLock(false, false);
}
m_camera->SetType(m_infoCamera);
- m_engine->SetDrawWorld(TRUE); // draws all on the interface
- m_engine->SetDrawFront(FALSE); // draws nothing on the interface
- m_particule->SetFrameUpdate(SH_WORLD, TRUE);
+ m_engine->SetDrawWorld(true); // draws all on the interface
+ m_engine->SetDrawFront(false); // draws nothing on the interface
+ m_particule->SetFrameUpdate(SH_WORLD, true);
m_particule->FlushParticule(SH_FRONT);
m_particule->FlushParticule(SH_INTERFACE);
@@ -1017,13 +1017,13 @@ void CDisplayInfo::CreateObjectsFile()
ObjectList list[200];
char line[100];
int i;
- BOOL bRadar, bAtLeast;
+ bool bRadar, bAtLeast;
file = fopen("help\\objects.txt", "w");
if ( file == 0 ) return;
list[0].total = 0; // empty list
- bRadar = FALSE;
+ bRadar = false;
for ( i=0 ; i<1000000 ; i++ )
{
pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i);
@@ -1039,14 +1039,14 @@ void CDisplayInfo::CreateObjectsFile()
ObjectAdd(list, type);
- if ( type == OBJECT_RADAR ) bRadar = TRUE;
+ if ( type == OBJECT_RADAR ) bRadar = true;
}
if ( bRadar )
{
GetResource(RES_TEXT, RT_SATCOM_LIST, line);
fputs(line, file);
- bAtLeast = FALSE;
+ bAtLeast = false;
for ( i=0 ; i<200 ; i++ )
{
if ( list[i].total == 0 ) break; // end of the list?
@@ -1055,7 +1055,7 @@ void CDisplayInfo::CreateObjectsFile()
list[i].type == OBJECT_HUMAN )
{
ObjectWrite(file, list, i);
- bAtLeast = TRUE;
+ bAtLeast = true;
}
}
if ( !bAtLeast )
@@ -1068,7 +1068,7 @@ void CDisplayInfo::CreateObjectsFile()
fputs(line, file);
GetResource(RES_TEXT, RT_SATCOM_BOT, line);
fputs(line, file);
- bAtLeast = FALSE;
+ bAtLeast = false;
for ( i=0 ; i<200 ; i++ )
{
if ( list[i].total == 0 ) break; // end of the list?
@@ -1102,7 +1102,7 @@ void CDisplayInfo::CreateObjectsFile()
list[i].type == OBJECT_MOBILEdr )
{
ObjectWrite(file, list, i);
- bAtLeast = TRUE;
+ bAtLeast = true;
}
}
if ( !bAtLeast )
@@ -1115,7 +1115,7 @@ void CDisplayInfo::CreateObjectsFile()
fputs(line, file);
GetResource(RES_TEXT, RT_SATCOM_BUILDING, line);
fputs(line, file);
- bAtLeast = FALSE;
+ bAtLeast = false;
for ( i=0 ; i<200 ; i++ )
{
if ( list[i].total == 0 ) break; // end of the list?
@@ -1143,7 +1143,7 @@ void CDisplayInfo::CreateObjectsFile()
list[i].type == OBJECT_HUSTON )
{
ObjectWrite(file, list, i);
- bAtLeast = TRUE;
+ bAtLeast = true;
}
}
if ( !bAtLeast )
@@ -1156,7 +1156,7 @@ void CDisplayInfo::CreateObjectsFile()
fputs(line, file);
GetResource(RES_TEXT, RT_SATCOM_FRET, line);
fputs(line, file);
- bAtLeast = FALSE;
+ bAtLeast = false;
for ( i=0 ; i<200 ; i++ )
{
if ( list[i].total == 0 ) break; // end of the list?
@@ -1171,7 +1171,7 @@ void CDisplayInfo::CreateObjectsFile()
list[i].type == OBJECT_TNT )
{
ObjectWrite(file, list, i);
- bAtLeast = TRUE;
+ bAtLeast = true;
}
}
if ( !bAtLeast )
@@ -1184,7 +1184,7 @@ void CDisplayInfo::CreateObjectsFile()
fputs(line, file);
GetResource(RES_TEXT, RT_SATCOM_ALIEN, line);
fputs(line, file);
- bAtLeast = FALSE;
+ bAtLeast = false;
for ( i=0 ; i<200 ; i++ )
{
if ( list[i].total == 0 ) break; // end of the list?
@@ -1196,7 +1196,7 @@ void CDisplayInfo::CreateObjectsFile()
list[i].type == OBJECT_SPIDER )
{
ObjectWrite(file, list, i);
- bAtLeast = TRUE;
+ bAtLeast = true;
}
}
if ( !bAtLeast )
diff --git a/src/ui/displayinfo.h b/src/ui/displayinfo.h
index bbe6a72..2a40535 100644
--- a/src/ui/displayinfo.h
+++ b/src/ui/displayinfo.h
@@ -40,16 +40,16 @@ public:
CDisplayInfo(CInstanceManager* iMan);
~CDisplayInfo();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
- void StartDisplayInfo(char *filename, int index, BOOL bSoluce);
+ void StartDisplayInfo(char *filename, int index, bool bSoluce);
void StopDisplayInfo();
void SetPosition(int pos);
int RetPosition();
protected:
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
void HyperUpdate();
void AdjustDisplayInfo(FPOINT wpos, FPOINT wdim);
void ChangeIndexButton(int index);
@@ -69,8 +69,8 @@ protected:
CParticule* m_particule;
CLight* m_light;
- BOOL m_bInfoMaximized;
- BOOL m_bInfoMinimized;
+ bool m_bInfoMaximized;
+ bool m_bInfoMinimized;
int m_index;
CameraType m_infoCamera;
@@ -81,9 +81,9 @@ protected:
FPOINT m_infoFinalPos;
FPOINT m_infoFinalDim;
int m_lightSuppl;
- BOOL m_bEditLock;
- BOOL m_bInitPause;
- BOOL m_bSoluce;
+ bool m_bEditLock;
+ bool m_bInitPause;
+ bool m_bSoluce;
CObject* m_toto;
};
diff --git a/src/ui/displaytext.cpp b/src/ui/displaytext.cpp
index f4c16f4..eb5cbeb 100644
--- a/src/ui/displaytext.cpp
+++ b/src/ui/displaytext.cpp
@@ -62,15 +62,15 @@ CDisplayText::CDisplayText(CInstanceManager* iMan)
for ( i=0 ; i<MAXDTLINE ; i++ )
{
- m_bExist[i] = FALSE;
+ m_bExist[i] = false;
m_visitGoal[i] = D3DVECTOR(0.0f, 0.0f, 0.0f);
m_visitDist[i] = 0.0f;
m_visitHeight[i] = 0.0f;
m_time[i] = 0.0f; // nothing displayed
}
- m_bHide = FALSE;
- m_bEnable = TRUE;
+ m_bHide = false;
+ m_bEnable = true;
m_delayFactor = 1.0f;
}
@@ -92,11 +92,11 @@ void CDisplayText::DeleteObject()
// Management of an event.
-BOOL CDisplayText::EventProcess(const Event &event)
+bool CDisplayText::EventProcess(const Event &event)
{
int i;
- if ( m_engine->RetPause() ) return TRUE;
+ if ( m_engine->RetPause() ) return true;
if ( event.event == EVENT_FRAME )
{
@@ -105,7 +105,7 @@ BOOL CDisplayText::EventProcess(const Event &event)
if ( !m_bExist[i] ) break;
m_time[i] -= event.rTime;
}
- while ( TRUE )
+ while ( true )
{
if ( !m_bExist[0] ||
m_time[0] > 0.0f ) break;
@@ -113,7 +113,7 @@ BOOL CDisplayText::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -251,7 +251,7 @@ void CDisplayText::DisplayText(char *text, D3DVECTOR goal, float height,
if ( type == TT_MESSAGE ) icon = 11; // yellow
pw->CreateGroup(pos, dim, icon, EventMsg(EVENT_DT_GROUP0+nLine));
- pw->SetTrashEvent(FALSE);
+ pw->SetTrashEvent(false);
ppos = pos;
ppos.y -= hLine/2.0f;
@@ -272,7 +272,7 @@ void CDisplayText::DisplayText(char *text, D3DVECTOR goal, float height,
button->ClearState(STATE_ENABLE);
}
- m_bExist[nLine] = TRUE;
+ m_bExist[nLine] = true;
m_visitGoal[nLine] = goal;
m_visitDist[nLine] = dist;
m_visitHeight[nLine] = height;
@@ -339,7 +339,7 @@ void CDisplayText::ClearText()
pw->DeleteControl(EventMsg(EVENT_DT_LABEL0+i));
pw->DeleteControl(EventMsg(EVENT_DT_VISIT0+i));
}
- m_bExist[i] = FALSE;
+ m_bExist[i] = false;
m_visitGoal[i] = D3DVECTOR(0.0f, 0.0f, 0.0f);
m_visitDist[i] = 0.0f;
m_visitHeight[i] = 0.0f;
@@ -349,7 +349,7 @@ void CDisplayText::ClearText()
// Hides or shows all texts.
-void CDisplayText::HideText(BOOL bHide)
+void CDisplayText::HideText(bool bHide)
{
CWindow* pw;
CGroup* pg;
@@ -386,7 +386,7 @@ void CDisplayText::HideText(BOOL bHide)
// Removes the last text (top of the list).
-BOOL CDisplayText::ClearLastText()
+bool CDisplayText::ClearLastText()
{
CWindow *pw;
CButton *pb1, *pb2;
@@ -395,14 +395,14 @@ BOOL CDisplayText::ClearLastText()
int i;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW2);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
pb2 = (CButton*)pw->SearchControl(EVENT_DT_VISIT0);
- if ( pb2 == 0 ) return FALSE; // same not of first-line
+ if ( pb2 == 0 ) return false; // same not of first-line
pg2 = (CGroup*)pw->SearchControl(EVENT_DT_GROUP0);
- if ( pg2 == 0 ) return FALSE;
+ if ( pg2 == 0 ) return false;
pl2 = (CLabel*)pw->SearchControl(EVENT_DT_LABEL0);
- if ( pl2 == 0 ) return FALSE;
+ if ( pl2 == 0 ) return false;
for ( i=0 ; i<MAXDTLINE-1 ; i++ )
{
@@ -432,8 +432,8 @@ BOOL CDisplayText::ClearLastText()
pw->DeleteControl(EventMsg(EVENT_DT_VISIT0+i));
pw->DeleteControl(EventMsg(EVENT_DT_GROUP0+i));
pw->DeleteControl(EventMsg(EVENT_DT_LABEL0+i));
- m_bExist[i] = FALSE;
- return TRUE;
+ m_bExist[i] = false;
+ return true;
}
@@ -447,7 +447,7 @@ void CDisplayText::SetDelay(float factor)
// Enables the display of text.
-void CDisplayText::SetEnable(BOOL bEnable)
+void CDisplayText::SetEnable(bool bEnable)
{
m_bEnable = bEnable;
}
@@ -574,19 +574,19 @@ void CDisplayText::SetVisit(EventMsg event)
// Indicates whether a button is set to "visit".
-BOOL CDisplayText::IsVisit(EventMsg event)
+bool CDisplayText::IsVisit(EventMsg event)
{
CWindow* pw;
CButton* pb;
int i;
i = event-EVENT_DT_VISIT0;
- if ( i < 0 || i >= MAXDTLINE ) return FALSE;
+ if ( i < 0 || i >= MAXDTLINE ) return false;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW2);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
pb = (CButton*)pw->SearchControl(EventMsg(EVENT_DT_VISIT0+i));
- if ( pb == 0 ) return FALSE;
+ if ( pb == 0 ) return false;
return (pb->RetIcon() == 48); // > ?
}
diff --git a/src/ui/displaytext.h b/src/ui/displaytext.h
index 67d9c77..934fc50 100644
--- a/src/ui/displaytext.h
+++ b/src/ui/displaytext.h
@@ -48,17 +48,17 @@ public:
void DeleteObject();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void DisplayError(Error err, CObject* pObj, float time=10.0f);
void DisplayError(Error err, D3DVECTOR goal, float height=15.0f, float dist=60.0f, float time=10.0f);
void DisplayText(char *text, CObject* pObj, float time=10.0f, TextType type=TT_INFO);
void DisplayText(char *text, D3DVECTOR goal, float height=15.0f, float dist=60.0f, float time=10.0f, TextType type=TT_INFO);
- void HideText(BOOL bHide);
+ void HideText(bool bHide);
void ClearText();
- BOOL ClearLastText();
+ bool ClearLastText();
void SetDelay(float factor);
- void SetEnable(BOOL bEnable);
+ void SetEnable(bool bEnable);
D3DVECTOR RetVisitGoal(EventMsg event);
float RetVisitDist(EventMsg event);
@@ -69,7 +69,7 @@ public:
void ClearVisit();
void SetVisit(EventMsg event);
- BOOL IsVisit(EventMsg event);
+ bool IsVisit(EventMsg event);
protected:
CObject* SearchToto();
@@ -80,14 +80,14 @@ protected:
CInterface* m_interface;
CSound* m_sound;
- BOOL m_bExist[MAXDTLINE];
+ bool m_bExist[MAXDTLINE];
float m_time[MAXDTLINE];
D3DVECTOR m_visitGoal[MAXDTLINE];
float m_visitDist[MAXDTLINE];
float m_visitHeight[MAXDTLINE];
- BOOL m_bHide;
- BOOL m_bEnable;
+ bool m_bHide;
+ bool m_bEnable;
float m_delayFactor;
};
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp
index 42aaf0b..72c1137 100644
--- a/src/ui/edit.cpp
+++ b/src/ui/edit.cpp
@@ -51,7 +51,7 @@
// Indicates whether a character is a space.
-BOOL IsSpace(int character)
+bool IsSpace(int character)
{
return ( character == ' ' ||
character == '\t' ||
@@ -60,7 +60,7 @@ BOOL IsSpace(int character)
// Indicates whether a character is part of a word.
-BOOL IsWord(int character)
+bool IsWord(int character)
{
char c;
@@ -73,9 +73,9 @@ BOOL IsWord(int character)
// Indicates whether a character is a word separator.
-BOOL IsSep(int character)
+bool IsSep(int character)
{
- if ( IsSpace(character) ) return FALSE;
+ if ( IsSpace(character) ) return false;
return !IsWord(character);
}
@@ -95,14 +95,14 @@ CEdit::CEdit(CInstanceManager* iMan) : CControl(iMan)
m_fontType = FONT_COURIER;
m_scroll = 0;
- m_bEdit = TRUE;
- m_bHilite = TRUE;
- m_bInsideScroll = TRUE;
- m_bCapture = FALSE;
- m_bDisplaySpec = FALSE;
- m_bSoluce = FALSE;
- m_bGeneric = FALSE;
- m_bAutoIndent = FALSE;
+ m_bEdit = true;
+ m_bHilite = true;
+ m_bInsideScroll = true;
+ m_bCapture = false;
+ m_bDisplaySpec = false;
+ m_bSoluce = false;
+ m_bGeneric = false;
+ m_bAutoIndent = false;
m_cursor1 = 0;
m_cursor2 = 0;
m_column = 0;
@@ -114,7 +114,7 @@ CEdit::CEdit(CInstanceManager* iMan) : CControl(iMan)
{
m_undo[i].text = 0;
}
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
m_undoOper = OPERUNDO_SPEC;
}
@@ -139,7 +139,7 @@ CEdit::~CEdit()
// Creates a new editable line.
-BOOL CEdit::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CEdit::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
CScroll* pc;
FPOINT start, end;
@@ -154,15 +154,15 @@ BOOL CEdit::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
m_timeLastClick = 0.0f;
m_timeLastScroll = 0.0f;
- m_bMulti = FALSE;
+ m_bMulti = false;
MoveAdjust();
if ( m_lineVisible <= 1 )
{
- m_bMulti = FALSE;
+ m_bMulti = false;
}
else
{
- m_bMulti = TRUE;
+ m_bMulti = true;
MoveAdjust(); // readjusts multi-line mode
m_scroll = new CScroll(m_iMan);
pc = (CScroll*)m_scroll;
@@ -170,7 +170,7 @@ BOOL CEdit::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
MoveAdjust();
}
- return TRUE;
+ return true;
}
@@ -228,31 +228,31 @@ void CEdit::MoveAdjust()
pos.x = m_pos.x+m_dim.x-(m_bMulti?SCROLL_WIDTH:0.0f);
pos.y = m_pos.y;
- GlintCreate(pos, FALSE, FALSE);
+ GlintCreate(pos, false, false);
}
// Management of an event.
-BOOL CEdit::EventProcess(const Event &event)
+bool CEdit::EventProcess(const Event &event)
{
- BOOL bShift, bControl;
+ bool bShift, bControl;
- if ( (m_state & STATE_VISIBLE) == 0 ) return TRUE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return true;
if ( event.event == EVENT_KEYDOWN &&
event.param == VK_WHEELUP &&
Detect(event.pos) )
{
- Scroll(m_lineFirst-3, TRUE);
- return TRUE;
+ Scroll(m_lineFirst-3, true);
+ return true;
}
if ( event.event == EVENT_KEYDOWN &&
event.param == VK_WHEELDOWN &&
Detect(event.pos) )
{
- Scroll(m_lineFirst+3, TRUE);
- return TRUE;
+ Scroll(m_lineFirst+3, true);
+ return true;
}
CControl::EventProcess(event);
@@ -293,7 +293,7 @@ BOOL CEdit::EventProcess(const Event &event)
if ( event.event == m_scroll->RetEventMsg() )
{
Scroll();
- return TRUE;
+ return true;
}
}
@@ -306,25 +306,25 @@ BOOL CEdit::EventProcess(const Event &event)
(event.param == VK_DELETE && bShift && !bControl) )
{
Cut();
- return TRUE;
+ return true;
}
if ( (event.param == 'C' && !bShift && bControl) ||
(event.param == VK_INSERT && !bShift && bControl) )
{
Copy();
- return TRUE;
+ return true;
}
if ( (event.param == 'V' && !bShift && bControl) ||
(event.param == VK_INSERT && bShift && !bControl) )
{
Paste();
- return TRUE;
+ return true;
}
if ( event.param == 'A' && !bShift && bControl )
{
SetCursor(999999, 0);
- return TRUE;
+ return true;
}
if ( event.param == 'O' && !bShift && bControl )
@@ -343,25 +343,25 @@ BOOL CEdit::EventProcess(const Event &event)
if ( event.param == 'Z' && !bShift && bControl )
{
Undo();
- return TRUE;
+ return true;
}
if ( event.param == 'U' && !bShift && bControl )
{
- if ( MinMaj(FALSE) ) return TRUE;
+ if ( MinMaj(false) ) return true;
}
if ( event.param == 'U' && bShift && bControl )
{
- if ( MinMaj(TRUE) ) return TRUE;
+ if ( MinMaj(true) ) return true;
}
if ( event.param == VK_TAB && !bShift && !bControl && !m_bAutoIndent )
{
- if ( Shift(FALSE) ) return TRUE;
+ if ( Shift(false) ) return true;
}
if ( event.param == VK_TAB && bShift && !bControl && !m_bAutoIndent )
{
- if ( Shift(TRUE) ) return TRUE;
+ if ( Shift(true) ) return true;
}
if ( m_bEdit )
@@ -369,33 +369,33 @@ BOOL CEdit::EventProcess(const Event &event)
if ( event.param == VK_LEFT )
{
MoveChar(-1, bControl, bShift);
- return TRUE;
+ return true;
}
if ( event.param == VK_RIGHT )
{
MoveChar(1, bControl, bShift);
- return TRUE;
+ return true;
}
if ( event.param == VK_UP )
{
MoveLine(-1, bControl, bShift);
- return TRUE;
+ return true;
}
if ( event.param == VK_DOWN )
{
MoveLine(1, bControl, bShift);
- return TRUE;
+ return true;
}
if ( event.param == VK_PRIOR ) // PageUp ?
{
MoveLine(-(m_lineVisible-1), bControl, bShift);
- return TRUE;
+ return true;
}
if ( event.param == VK_NEXT ) // PageDown ?
{
MoveLine(m_lineVisible-1, bControl, bShift);
- return TRUE;
+ return true;
}
}
else
@@ -403,63 +403,63 @@ BOOL CEdit::EventProcess(const Event &event)
if ( event.param == VK_LEFT ||
event.param == VK_UP )
{
- Scroll(m_lineFirst-1, TRUE);
- return TRUE;
+ Scroll(m_lineFirst-1, true);
+ return true;
}
if ( event.param == VK_RIGHT ||
event.param == VK_DOWN )
{
- Scroll(m_lineFirst+1, TRUE);
- return TRUE;
+ Scroll(m_lineFirst+1, true);
+ return true;
}
if ( event.param == VK_PRIOR ) // PageUp ?
{
- Scroll(m_lineFirst-(m_lineVisible-1), TRUE);
- return TRUE;
+ Scroll(m_lineFirst-(m_lineVisible-1), true);
+ return true;
}
if ( event.param == VK_NEXT ) // PageDown ?
{
- Scroll(m_lineFirst+(m_lineVisible-1), TRUE);
- return TRUE;
+ Scroll(m_lineFirst+(m_lineVisible-1), true);
+ return true;
}
}
if ( event.param == VK_HOME )
{
MoveHome(bControl, bShift);
- return TRUE;
+ return true;
}
if ( event.param == VK_END )
{
MoveEnd(bControl, bShift);
- return TRUE;
+ return true;
}
if ( event.param == VK_BACK ) // backspace ( <- ) ?
{
Delete(-1);
SendModifEvent();
- return TRUE;
+ return true;
}
if ( event.param == VK_DELETE )
{
Delete(1);
SendModifEvent();
- return TRUE;
+ return true;
}
if ( event.param == VK_RETURN )
{
Insert('\n');
SendModifEvent();
- return TRUE;
+ return true;
}
if ( event.param == VK_TAB )
{
Insert('\t');
SendModifEvent();
- return TRUE;
+ return true;
}
}
@@ -469,7 +469,7 @@ BOOL CEdit::EventProcess(const Event &event)
{
Insert((char)event.param);
SendModifEvent();
- return TRUE;
+ return true;
}
}
@@ -477,11 +477,11 @@ BOOL CEdit::EventProcess(const Event &event)
{
if ( event.param == m_eventMsg )
{
- m_bFocus = TRUE;
+ m_bFocus = true;
}
else
{
- m_bFocus = FALSE;
+ m_bFocus = false;
}
}
@@ -494,13 +494,13 @@ BOOL CEdit::EventProcess(const Event &event)
if ( event.pos.x < m_pos.x+m_dim.x-(m_bMulti?MARGX+SCROLL_WIDTH:0.0f) )
{
MouseClick(event.pos);
- if ( m_bEdit || m_bHilite ) m_bCapture = TRUE;
+ if ( m_bEdit || m_bHilite ) m_bCapture = true;
}
- m_bFocus = TRUE;
+ m_bFocus = true;
}
else
{
- m_bFocus = FALSE;
+ m_bFocus = false;
}
}
@@ -531,11 +531,11 @@ BOOL CEdit::EventProcess(const Event &event)
MouseDoubleClick(event.pos);
}
m_timeLastClick = m_time;
- m_bCapture = FALSE;
+ m_bCapture = false;
}
}
- return TRUE;
+ return true;
}
@@ -552,18 +552,18 @@ void CEdit::SendModifEvent()
// Detects whether the mouse is over a hyperlink character.
-BOOL CEdit::IsLinkPos(FPOINT pos)
+bool CEdit::IsLinkPos(FPOINT pos)
{
int i;
- if ( m_format == 0 ) return FALSE;
+ if ( m_format == 0 ) return false;
i = MouseDetect(pos);
- if ( i == -1 ) return FALSE;
- if ( i >= m_len ) return FALSE;
+ if ( i == -1 ) return false;
+ if ( i >= m_len ) return false;
- if ( (m_format[i]&COLOR_MASK) == COLOR_LINK ) return TRUE;
- return FALSE;
+ if ( (m_format[i]&COLOR_MASK) == COLOR_LINK ) return true;
+ return false;
}
@@ -600,7 +600,7 @@ void CEdit::MouseDoubleClick(FPOINT mouse)
m_cursor1 = m_len; // selects all
}
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
Justif();
ColumnFix();
@@ -619,7 +619,7 @@ void CEdit::MouseClick(FPOINT mouse)
{
m_cursor1 = i;
m_cursor2 = i;
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
m_timeBlink = 0.0f; // lights the cursor immediately
ColumnFix();
}
@@ -664,12 +664,12 @@ void CEdit::MouseMove(FPOINT mouse)
{
if ( mouse.y > m_pos.y+m_dim.y ) // above?
{
- Scroll(m_lineFirst-1, FALSE);
+ Scroll(m_lineFirst-1, false);
mouse.y = m_pos.y+m_dim.y-MARGY-m_lineHeight/2.0f;
}
if ( mouse.y < m_pos.y ) // lower?
{
- Scroll(m_lineFirst+1, FALSE);
+ Scroll(m_lineFirst+1, false);
mouse.y = m_pos.y+m_dim.y-MARGY-m_lineVisible*m_lineHeight+m_lineHeight/2.0f;
}
m_timeLastScroll = m_time;
@@ -679,7 +679,7 @@ void CEdit::MouseMove(FPOINT mouse)
if ( i != -1 )
{
m_cursor1 = i;
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
m_timeBlink = 0.0f; // lights the cursor immediately
ColumnFix();
}
@@ -692,7 +692,7 @@ int CEdit::MouseDetect(FPOINT mouse)
FPOINT pos;
float indentLength, offset, size;
int i, len, c;
- BOOL bTitle;
+ bool bTitle;
if ( m_bAutoIndent )
{
@@ -815,21 +815,21 @@ void CEdit::HyperJump(char *name, char *marker)
// Adds text to the history of visited.
-BOOL CEdit::HyperAdd(char *filename, int firstLine)
+bool CEdit::HyperAdd(char *filename, int firstLine)
{
- if ( m_historyCurrent >= EDITHISTORYMAX-1 ) return FALSE;
+ if ( m_historyCurrent >= EDITHISTORYMAX-1 ) return false;
m_historyCurrent ++;
strcpy(m_history[m_historyCurrent].filename, filename);
m_history[m_historyCurrent].firstLine = firstLine;
m_historyTotal = m_historyCurrent+1;
- return TRUE;
+ return true;
}
// Indicates whether a button EVENT_HYPER_ * is active or not.
-BOOL CEdit::HyperTest(EventMsg event)
+bool CEdit::HyperTest(EventMsg event)
{
if ( event == EVENT_HYPER_HOME )
{
@@ -846,14 +846,14 @@ BOOL CEdit::HyperTest(EventMsg event)
return ( m_historyCurrent < m_historyTotal-1 );
}
- return FALSE;
+ return false;
}
// Performs the action corresponding to a button EVENT_HYPER_ *.
-BOOL CEdit::HyperGo(EventMsg event)
+bool CEdit::HyperGo(EventMsg event)
{
- if ( !HyperTest(event) ) return FALSE;
+ if ( !HyperTest(event) ) return false;
m_history[m_historyCurrent].firstLine = m_lineFirst;
@@ -875,7 +875,7 @@ BOOL CEdit::HyperGo(EventMsg event)
ReadText(m_history[m_historyCurrent].filename);
Justif();
SetFirstLine(m_history[m_historyCurrent].firstLine);
- return TRUE;
+ return true;
}
@@ -1233,10 +1233,10 @@ void CEdit::DrawPart(FPOINT pos, FPOINT dim, int icon)
// Give the text to edit.
-void CEdit::SetText(char *text, BOOL bNew)
+void CEdit::SetText(char *text, bool bNew)
{
int i, j, font;
- BOOL bBOL;
+ bool bBOL;
if ( !bNew ) UndoMemorize(OPERUNDO_SPEC);
@@ -1248,7 +1248,7 @@ void CEdit::SetText(char *text, BOOL bNew)
if ( m_bAutoIndent )
{
j = 0;
- bBOL = TRUE;
+ bBOL = true;
for ( i=0 ; i<m_len ; i++ )
{
if ( text[i] == '\t' )
@@ -1271,7 +1271,7 @@ void CEdit::SetText(char *text, BOOL bNew)
{
font = m_fontType;
j = 0;
- bBOL = TRUE;
+ bBOL = true;
for ( i=0 ; i<m_len ; i++ )
{
if ( m_bAutoIndent )
@@ -1443,7 +1443,7 @@ void CEdit::LoadImage(char *name)
// Read from a text file.
-BOOL CEdit::ReadText(char *filename, int addSize)
+bool CEdit::ReadText(char *filename, int addSize)
{
FILE *file = NULL;
char *buffer;
@@ -1452,11 +1452,11 @@ BOOL CEdit::ReadText(char *filename, int addSize)
char text[50];
float iWidth;
KeyRank key;
- BOOL bInSoluce, bBOL;
+ bool bInSoluce, bBOL;
- if ( filename[0] == 0 ) return FALSE;
+ if ( filename[0] == 0 ) return false;
file = fopen(filename, "rb");
- if ( file == NULL ) return FALSE;
+ if ( file == NULL ) return false;
fseek(file, 0, SEEK_END);
len = ftell(file);
@@ -1481,14 +1481,14 @@ BOOL CEdit::ReadText(char *filename, int addSize)
fclose(file);
- bInSoluce = FALSE;
+ bInSoluce = false;
font = m_fontType;
iIndex = 0;
iLink = 0;
m_imageTotal = 0;
m_markerTotal = 0;
i = j = 0;
- bBOL = TRUE;
+ bBOL = true;
while ( i < m_len )
{
if ( m_bAutoIndent )
@@ -1754,7 +1754,7 @@ BOOL CEdit::ReadText(char *filename, int addSize)
buffer[i+2] == 's' &&
buffer[i+3] == ';' )
{
- bInSoluce = TRUE;
+ bInSoluce = true;
i += 4;
}
else if ( m_format != 0 &&
@@ -1763,7 +1763,7 @@ BOOL CEdit::ReadText(char *filename, int addSize)
buffer[i+2] == 's' &&
buffer[i+3] == ';' )
{
- bInSoluce = FALSE;
+ bInSoluce = false;
i += 4;
}
else if ( m_format != 0 &&
@@ -1857,21 +1857,21 @@ BOOL CEdit::ReadText(char *filename, int addSize)
Justif();
ColumnFix();
- return TRUE;
+ return true;
}
// Writes all the text in a file.
-BOOL CEdit::WriteText(char *filename)
+bool CEdit::WriteText(char *filename)
{
FILE* file;
char buffer[1000+20];
int i, j, k, n;
float iDim;
- if ( filename[0] == 0 ) return FALSE;
+ if ( filename[0] == 0 ) return false;
file = fopen(filename, "wb");
- if ( file == NULL ) return FALSE;
+ if ( file == NULL ) return false;
if ( m_bAutoIndent )
{
@@ -1921,7 +1921,7 @@ BOOL CEdit::WriteText(char *filename)
Justif();
}
- return TRUE;
+ return true;
}
@@ -1955,60 +1955,60 @@ int CEdit::RetMaxChar()
// Mode management "editable".
-void CEdit::SetEditCap(BOOL bMode)
+void CEdit::SetEditCap(bool bMode)
{
m_bEdit = bMode;
}
-BOOL CEdit::RetEditCap()
+bool CEdit::RetEditCap()
{
return m_bEdit;
}
// Mode management "hilitable" (that's the franch).
-void CEdit::SetHiliteCap(BOOL bEnable)
+void CEdit::SetHiliteCap(bool bEnable)
{
m_bHilite = bEnable;
}
-BOOL CEdit::RetHiliteCap()
+bool CEdit::RetHiliteCap()
{
return m_bHilite;
}
// Lift in / out connection.
-void CEdit::SetInsideScroll(BOOL bInside)
+void CEdit::SetInsideScroll(bool bInside)
{
m_bInsideScroll = bInside;
}
-BOOL CEdit::RetInsideScroll()
+bool CEdit::RetInsideScroll()
{
return m_bInsideScroll;
}
// Specifies whether to display the links showing the solution.
-void CEdit::SetSoluceMode(BOOL bSoluce)
+void CEdit::SetSoluceMode(bool bSoluce)
{
m_bSoluce = bSoluce;
}
-BOOL CEdit::RetSoluceMode()
+bool CEdit::RetSoluceMode()
{
return m_bSoluce;
}
// Indicates whether the text is a defile that generic.
-void CEdit::SetGenericMode(BOOL bGeneric)
+void CEdit::SetGenericMode(bool bGeneric)
{
m_bGeneric = bGeneric;
}
-BOOL CEdit::RetGenericMode()
+bool CEdit::RetGenericMode()
{
return m_bGeneric;
}
@@ -2016,12 +2016,12 @@ BOOL CEdit::RetGenericMode()
// Management of automatic indentation mode with {}.
-void CEdit::SetAutoIndent(BOOL bMode)
+void CEdit::SetAutoIndent(bool bMode)
{
m_bAutoIndent = bMode;
}
-BOOL CEdit::RetAutoIndent()
+bool CEdit::RetAutoIndent()
{
return m_bAutoIndent;
}
@@ -2037,7 +2037,7 @@ void CEdit::SetCursor(int cursor1, int cursor2)
m_cursor1 = cursor1;
m_cursor2 = cursor2;
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
ColumnFix();
}
@@ -2054,7 +2054,7 @@ void CEdit::GetCursor(int &cursor1, int &cursor2)
void CEdit::SetFirstLine(int rank)
{
- Scroll(rank, TRUE);
+ Scroll(rank, true);
}
// Returns the first displayed line.
@@ -2098,25 +2098,25 @@ void CEdit::ShowSelect()
{
line -= m_lineVisible-1;
if ( line < 0 ) line = 0;
- Scroll(line, FALSE);
+ Scroll(line, false);
}
line = RetCursorLine(cursor1);
if ( line < m_lineFirst )
{
- Scroll(line, FALSE);
+ Scroll(line, false);
}
}
// Management of the display mode of special characters.
-void CEdit::SetDisplaySpec(BOOL bDisplay)
+void CEdit::SetDisplaySpec(bool bDisplay)
{
m_bDisplaySpec = bDisplay;
}
-BOOL CEdit::RetDisplaySpec()
+bool CEdit::RetDisplaySpec()
{
return m_bDisplaySpec;
}
@@ -2124,7 +2124,7 @@ BOOL CEdit::RetDisplaySpec()
// Multi-fonts mode management.
-void CEdit::SetMultiFont(BOOL bMulti)
+void CEdit::SetMultiFont(bool bMulti)
{
if ( bMulti )
{
@@ -2139,7 +2139,7 @@ void CEdit::SetMultiFont(BOOL bMulti)
}
}
-BOOL CEdit::RetMultiFont()
+bool CEdit::RetMultiFont()
{
return ( m_format != 0 );
}
@@ -2165,13 +2165,13 @@ void CEdit::Scroll()
{
value = m_scroll->RetVisibleValue();
value *= m_lineTotal-m_lineVisible;
- Scroll((int)(value+0.5f), TRUE);
+ Scroll((int)(value+0.5f), true);
}
}
// Moves according to the visible lift.
-void CEdit::Scroll(int pos, BOOL bAdjustCursor)
+void CEdit::Scroll(int pos, bool bAdjustCursor)
{
int max, line;
@@ -2190,14 +2190,14 @@ void CEdit::Scroll(int pos, BOOL bAdjustCursor)
// Cursor too high?
if ( line < m_lineFirst )
{
- MoveLine(m_lineFirst-line, FALSE, FALSE);
+ MoveLine(m_lineFirst-line, false, false);
return;
}
// Cursor too low?
if ( line >= m_lineFirst+m_lineVisible )
{
- MoveLine(m_lineFirst+m_lineVisible-line-1, FALSE, FALSE);
+ MoveLine(m_lineFirst+m_lineVisible-line-1, false, false);
return;
}
}
@@ -2207,7 +2207,7 @@ void CEdit::Scroll(int pos, BOOL bAdjustCursor)
// Moves the cursor to the beginning of the line.
-void CEdit::MoveHome(BOOL bWord, BOOL bSelect)
+void CEdit::MoveHome(bool bWord, bool bSelect)
{
int begin, tab;
@@ -2240,14 +2240,14 @@ void CEdit::MoveHome(BOOL bWord, BOOL bSelect)
}
if ( !bSelect ) m_cursor2 = m_cursor1;
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
Justif();
ColumnFix();
}
// Moves the cursor to the end of the line.
-void CEdit::MoveEnd(BOOL bWord, BOOL bSelect)
+void CEdit::MoveEnd(bool bWord, bool bSelect)
{
if ( bWord )
{
@@ -2262,14 +2262,14 @@ void CEdit::MoveEnd(BOOL bWord, BOOL bSelect)
}
if ( !bSelect ) m_cursor2 = m_cursor1;
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
Justif();
ColumnFix();
}
// Moves the cursor through characters.
-void CEdit::MoveChar(int move, BOOL bWord, BOOL bSelect)
+void CEdit::MoveChar(int move, bool bWord, bool bSelect)
{
int character;
@@ -2375,14 +2375,14 @@ void CEdit::MoveChar(int move, BOOL bWord, BOOL bSelect)
if ( !bSelect ) m_cursor2 = m_cursor1;
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
Justif();
ColumnFix();
}
// Moves the cursor lines.
-void CEdit::MoveLine(int move, BOOL bWord, BOOL bSelect)
+void CEdit::MoveLine(int move, bool bWord, bool bSelect)
{
float column, indentLength;
int i, line, c;
@@ -2448,7 +2448,7 @@ void CEdit::MoveLine(int move, BOOL bWord, BOOL bSelect)
m_cursor1 = m_lineOffset[line]+c;
if ( !bSelect ) m_cursor2 = m_cursor1;
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
Justif();
}
@@ -2492,14 +2492,14 @@ void CEdit::ColumnFix()
// Cut the selected characters or entire line.
-BOOL CEdit::Cut()
+bool CEdit::Cut()
{
HGLOBAL hg;
char* text;
char c;
int c1, c2, start, len, i, j;
- if ( !m_bEdit ) return FALSE;
+ if ( !m_bEdit ) return false;
c1 = m_cursor1;
c2 = m_cursor2;
@@ -2519,19 +2519,19 @@ BOOL CEdit::Cut()
}
}
- if ( c1 == c2 ) return FALSE;
+ if ( c1 == c2 ) return false;
start = c1;
len = c2-c1;
if ( !(hg = GlobalAlloc(GMEM_DDESHARE, len*2+1)) )
{
- return FALSE;
+ return false;
}
if ( !(text = (char*)GlobalLock(hg)) )
{
GlobalFree(hg);
- return FALSE;
+ return false;
}
j = 0;
@@ -2547,17 +2547,17 @@ BOOL CEdit::Cut()
if ( !OpenClipboard(NULL) )
{
GlobalFree(hg);
- return FALSE;
+ return false;
}
if ( !EmptyClipboard() )
{
GlobalFree(hg);
- return FALSE;
+ return false;
}
if ( !SetClipboardData(CF_TEXT, hg) )
{
GlobalFree(hg);
- return FALSE;
+ return false;
}
CloseClipboard();
@@ -2568,12 +2568,12 @@ BOOL CEdit::Cut()
Justif();
ColumnFix();
SendModifEvent();
- return TRUE;
+ return true;
}
// Copy the selected characters or entire line.
-BOOL CEdit::Copy()
+bool CEdit::Copy()
{
HGLOBAL hg;
char* text;
@@ -2598,19 +2598,19 @@ BOOL CEdit::Copy()
}
}
- if ( c1 == c2 ) return FALSE;
+ if ( c1 == c2 ) return false;
start = c1;
len = c2-c1;
if ( !(hg = GlobalAlloc(GMEM_DDESHARE, len*2+1)) )
{
- return FALSE;
+ return false;
}
if ( !(text = (char*)GlobalLock(hg)) )
{
GlobalFree(hg);
- return FALSE;
+ return false;
}
j = 0;
@@ -2626,48 +2626,48 @@ BOOL CEdit::Copy()
if ( !OpenClipboard(NULL) )
{
GlobalFree(hg);
- return FALSE;
+ return false;
}
if ( !EmptyClipboard() )
{
GlobalFree(hg);
- return FALSE;
+ return false;
}
if ( !SetClipboardData(CF_TEXT, hg) )
{
GlobalFree(hg);
- return FALSE;
+ return false;
}
CloseClipboard();
- return TRUE;
+ return true;
}
// Paste the contents of the notebook.
-BOOL CEdit::Paste()
+bool CEdit::Paste()
{
HANDLE h;
char c;
char* p;
- if ( !m_bEdit ) return FALSE;
+ if ( !m_bEdit ) return false;
if ( !OpenClipboard(NULL) )
{
- return FALSE;
+ return false;
}
if ( !(h = GetClipboardData(CF_TEXT)) )
{
CloseClipboard();
- return FALSE;
+ return false;
}
if ( !(p = (char*)GlobalLock(h)) )
{
CloseClipboard();
- return FALSE;
+ return false;
}
UndoMemorize(OPERUNDO_SPEC);
@@ -2686,15 +2686,15 @@ BOOL CEdit::Paste()
Justif();
ColumnFix();
SendModifEvent();
- return TRUE;
+ return true;
}
// Cancels the last action.
-BOOL CEdit::Undo()
+bool CEdit::Undo()
{
- if ( !m_bEdit ) return FALSE;
+ if ( !m_bEdit ) return false;
return UndoRecall();
}
@@ -2760,21 +2760,21 @@ void CEdit::Insert(char character)
InsertOne('\n');
InsertOne('\n');
InsertOne('}');
- MoveChar(-1, FALSE, FALSE);
- MoveChar(-1, FALSE, FALSE);
+ MoveChar(-1, false, false);
+ MoveChar(-1, false, false);
}
#if 0
else if ( character == '(' )
{
InsertOne(character);
InsertOne(')');
- MoveChar(-1, FALSE, FALSE);
+ MoveChar(-1, false, false);
}
else if ( character == '[' )
{
InsertOne(character);
InsertOne(']');
- MoveChar(-1, FALSE, FALSE);
+ MoveChar(-1, false, false);
}
#endif
else if ( character == '\t' )
@@ -2947,12 +2947,12 @@ void CEdit::IndentTabAdjust(int number)
// Indent the left or right the entire selection.
-BOOL CEdit::Shift(BOOL bLeft)
+bool CEdit::Shift(bool bLeft)
{
- BOOL bInvert = FALSE;
+ bool bInvert = false;
int c1, c2, i;
- if ( m_cursor1 == m_cursor2 ) return FALSE;
+ if ( m_cursor1 == m_cursor2 ) return false;
UndoMemorize(OPERUNDO_SPEC);
@@ -2961,16 +2961,16 @@ BOOL CEdit::Shift(BOOL bLeft)
if ( c1 > c2 )
{
Swap(c1, c2); // always c1 <= c2
- bInvert = TRUE;
+ bInvert = true;
}
if ( c1 > 0 )
{
- if ( m_text[c1-1] != '\n' ) return FALSE;
+ if ( m_text[c1-1] != '\n' ) return false;
}
if ( c2 < m_len )
{
- if ( m_text[c2-1] != '\n' ) return FALSE;
+ if ( m_text[c2-1] != '\n' ) return false;
}
if ( bLeft ) // shifts left?
@@ -3007,16 +3007,16 @@ BOOL CEdit::Shift(BOOL bLeft)
Justif();
ColumnFix();
SendModifEvent();
- return TRUE;
+ return true;
}
// Min conversion <-> shift the selection.
-BOOL CEdit::MinMaj(BOOL bMaj)
+bool CEdit::MinMaj(bool bMaj)
{
int c1, c2, i, character;
- if ( m_cursor1 == m_cursor2 ) return FALSE;
+ if ( m_cursor1 == m_cursor2 ) return false;
UndoMemorize(OPERUNDO_SPEC);
@@ -3035,7 +3035,7 @@ BOOL CEdit::MinMaj(BOOL bMaj)
Justif();
ColumnFix();
SendModifEvent();
- return TRUE;
+ return true;
}
@@ -3045,7 +3045,7 @@ void CEdit::Justif()
{
float width, value, size, indentLength;
int i, j, line, indent;
- BOOL bDual, bString, bRem;
+ bool bDual, bString, bRem;
indent = 0;
m_lineTotal = 0;
@@ -3059,11 +3059,11 @@ void CEdit::Justif()
* m_engine->RetEditIndentValue();
}
- bString = bRem = FALSE;
+ bString = bRem = false;
i = 0;
- while ( TRUE )
+ while ( true )
{
- bDual = FALSE;
+ bDual = false;
width = m_dim.x-(10.0f/640.0f)*2.0f-(m_bMulti?MARGX*2.0f+SCROLL_WIDTH:0.0f);
if ( m_bAutoIndent )
@@ -3084,7 +3084,7 @@ void CEdit::Justif()
if ( (m_format[i]&TITLE_MASK) == TITLE_BIG ) // headline?
{
size *= BIG_FONT;
- bDual = TRUE;
+ bDual = true;
}
if ( (m_format[i]&IMAGE_MASK) != 0 ) // image part?
@@ -3108,8 +3108,8 @@ void CEdit::Justif()
if ( !bRem && m_text[j] == '\"' ) bString = !bString;
if ( !bString &&
m_text[j] == '/' &&
- m_text[j+1] == '/' ) bRem = TRUE;
- if ( m_text[j] == '\n' ) bString = bRem = FALSE;
+ m_text[j+1] == '/' ) bRem = true;
+ if ( m_text[j] == '\n' ) bString = bRem = false;
if ( m_text[j] == '{' && !bString && !bRem ) indent ++;
if ( m_text[j] == '}' && !bString && !bRem ) indent --;
}
@@ -3221,7 +3221,7 @@ void CEdit::UndoFlush()
m_undo[i].text = 0;
}
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
m_undoOper = OPERUNDO_SPEC;
}
@@ -3236,7 +3236,7 @@ void CEdit::UndoMemorize(OperUndo oper)
m_undoOper != OPERUNDO_SPEC &&
oper == m_undoOper ) return;
- m_bUndoForce = FALSE;
+ m_bUndoForce = false;
m_undoOper = oper;
delete m_undo[EDITUNDOMAX-1].text;
@@ -3259,11 +3259,11 @@ void CEdit::UndoMemorize(OperUndo oper)
// Back to previous state.
-BOOL CEdit::UndoRecall()
+bool CEdit::UndoRecall()
{
int i;
- if ( m_undo[0].text == 0 ) return FALSE;
+ if ( m_undo[0].text == 0 ) return false;
m_len = m_undo[0].len;
memcpy(m_text, m_undo[0].text, m_len);
@@ -3278,41 +3278,41 @@ BOOL CEdit::UndoRecall()
}
m_undo[EDITUNDOMAX-1].text = 0;
- m_bUndoForce = TRUE;
+ m_bUndoForce = true;
Justif();
ColumnFix();
SendModifEvent();
- return TRUE;
+ return true;
}
// Clears the format of all characters.
-BOOL CEdit::ClearFormat()
+bool CEdit::ClearFormat()
{
if ( m_format == 0 )
{
- SetMultiFont(TRUE);
+ SetMultiFont(true);
}
memset(m_format, m_fontType, m_len);
- return TRUE;
+ return true;
}
// Changes the format of a sequence of characters.
-BOOL CEdit::SetFormat(int cursor1, int cursor2, int format)
+bool CEdit::SetFormat(int cursor1, int cursor2, int format)
{
int i;
- if ( m_format == 0 ) return FALSE;
+ if ( m_format == 0 ) return false;
for ( i=cursor1 ; i<cursor2 ; i++ )
{
m_format[i] |= format;
}
- return TRUE;
+ return true;
}
diff --git a/src/ui/edit.h b/src/ui/edit.h
index eccc67e..fb6d7ae 100644
--- a/src/ui/edit.h
+++ b/src/ui/edit.h
@@ -93,42 +93,42 @@ public:
CEdit(CInstanceManager* iMan);
virtual ~CEdit();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
void SetPos(FPOINT pos);
void SetDim(FPOINT dim);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
- void SetText(char *text, BOOL bNew=TRUE);
+ void SetText(char *text, bool bNew=true);
void GetText(char *buffer, int max);
char* RetText();
int RetTextLength();
- BOOL ReadText(char *filename, int addSize=0);
- BOOL WriteText(char *filename);
+ bool ReadText(char *filename, int addSize=0);
+ bool WriteText(char *filename);
void SetMaxChar(int max);
int RetMaxChar();
- void SetEditCap(BOOL bMode);
- BOOL RetEditCap();
+ void SetEditCap(bool bMode);
+ bool RetEditCap();
- void SetHiliteCap(BOOL bEnable);
- BOOL RetHiliteCap();
+ void SetHiliteCap(bool bEnable);
+ bool RetHiliteCap();
- void SetInsideScroll(BOOL bInside);
- BOOL RetInsideScroll();
+ void SetInsideScroll(bool bInside);
+ bool RetInsideScroll();
- void SetSoluceMode(BOOL bSoluce);
- BOOL RetSoluceMode();
+ void SetSoluceMode(bool bSoluce);
+ bool RetSoluceMode();
- void SetGenericMode(BOOL bGeneric);
- BOOL RetGenericMode();
+ void SetGenericMode(bool bGeneric);
+ bool RetGenericMode();
- void SetAutoIndent(BOOL bMode);
- BOOL RetAutoIndent();
+ void SetAutoIndent(bool bMode);
+ bool RetAutoIndent();
void SetCursor(int cursor1, int cursor2);
void GetCursor(int &cursor1, int &cursor2);
@@ -137,30 +137,30 @@ public:
int RetFirstLine();
void ShowSelect();
- void SetDisplaySpec(BOOL bDisplay);
- BOOL RetDisplaySpec();
+ void SetDisplaySpec(bool bDisplay);
+ bool RetDisplaySpec();
- void SetMultiFont(BOOL bMulti);
- BOOL RetMultiFont();
+ void SetMultiFont(bool bMulti);
+ bool RetMultiFont();
- BOOL Cut();
- BOOL Copy();
- BOOL Paste();
- BOOL Undo();
+ bool Cut();
+ bool Copy();
+ bool Paste();
+ bool Undo();
void HyperFlush();
void HyperHome(char *filename);
- BOOL HyperTest(EventMsg event);
- BOOL HyperGo(EventMsg event);
+ bool HyperTest(EventMsg event);
+ bool HyperGo(EventMsg event);
void SetFontSize(float size);
- BOOL ClearFormat();
- BOOL SetFormat(int cursor1, int cursor2, int format);
+ bool ClearFormat();
+ bool SetFormat(int cursor1, int cursor2, int format);
protected:
void SendModifEvent();
- BOOL IsLinkPos(FPOINT pos);
+ bool IsLinkPos(FPOINT pos);
void MouseDoubleClick(FPOINT mouse);
void MouseClick(FPOINT mouse);
void MouseMove(FPOINT mouse);
@@ -169,7 +169,7 @@ protected:
void MoveAdjust();
void HyperJump(char *name, char *marker);
- BOOL HyperAdd(char *filename, int firstLine);
+ bool HyperAdd(char *filename, int firstLine);
void DrawImage(FPOINT pos, char *name, float width, float offset, float height, int nbLine);
void DrawBack(FPOINT pos, FPOINT dim);
@@ -177,12 +177,12 @@ protected:
void FreeImage();
void LoadImage(char *name);
- void Scroll(int pos, BOOL bAdjustCursor);
+ void Scroll(int pos, bool bAdjustCursor);
void Scroll();
- void MoveChar(int move, BOOL bWord, BOOL bSelect);
- void MoveLine(int move, BOOL bWord, BOOL bSelect);
- void MoveHome(BOOL bWord, BOOL bSelect);
- void MoveEnd(BOOL bWord, BOOL bSelect);
+ void MoveChar(int move, bool bWord, bool bSelect);
+ void MoveLine(int move, bool bWord, bool bSelect);
+ void MoveHome(bool bWord, bool bSelect);
+ void MoveEnd(bool bWord, bool bSelect);
void ColumnFix();
void Insert(char character);
void InsertOne(char character);
@@ -191,14 +191,14 @@ protected:
int IndentCompute();
int IndentTabCount();
void IndentTabAdjust(int number);
- BOOL Shift(BOOL bLeft);
- BOOL MinMaj(BOOL bMaj);
+ bool Shift(bool bLeft);
+ bool MinMaj(bool bMaj);
void Justif();
int RetCursorLine(int cursor);
void UndoFlush();
void UndoMemorize(OperUndo oper);
- BOOL UndoRecall();
+ bool UndoRecall();
protected:
CScroll* m_scroll; // vertical scrollbar on the right
@@ -210,15 +210,15 @@ protected:
int m_cursor1; // offset cursor
int m_cursor2; // offset cursor
- BOOL m_bMulti; // TRUE -> multi-line
- BOOL m_bEdit; // TRUE -> editable
- BOOL m_bHilite; // TRUE -> hilitable
- BOOL m_bInsideScroll; // TRUE -> lift as part
- BOOL m_bDisplaySpec; // TRUE -> displays the special characters
- BOOL m_bMultiFont; // TRUE -> more fonts possible
- BOOL m_bSoluce; // TRUE -> shows the links-solution
- BOOL m_bGeneric; // TRUE -> generic that defile
- BOOL m_bAutoIndent; // TRUE -> automatic indentation
+ bool m_bMulti; // true -> multi-line
+ bool m_bEdit; // true -> editable
+ bool m_bHilite; // true -> hilitable
+ bool m_bInsideScroll; // true -> lift as part
+ bool m_bDisplaySpec; // true -> displays the special characters
+ bool m_bMultiFont; // true -> more fonts possible
+ bool m_bSoluce; // true -> shows the links-solution
+ bool m_bGeneric; // true -> generic that defile
+ bool m_bAutoIndent; // true -> automatic indentation
float m_lineHeight; // height of a row
float m_lineAscent; // height above the baseline
float m_lineDescent; // height below the baseline
@@ -243,9 +243,9 @@ protected:
FPOINT m_mouseLastPos;
float m_column;
- BOOL m_bCapture;
+ bool m_bCapture;
- BOOL m_bUndoForce;
+ bool m_bUndoForce;
OperUndo m_undoOper;
EditUndo m_undo[EDITUNDOMAX];
};
diff --git a/src/ui/editvalue.cpp b/src/ui/editvalue.cpp
index 39e5b29..dfbd65a 100644
--- a/src/ui/editvalue.cpp
+++ b/src/ui/editvalue.cpp
@@ -62,7 +62,7 @@ CEditValue::~CEditValue()
// Creates a new button.
-BOOL CEditValue::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CEditValue::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
CEdit* pe;
CButton* pc;
@@ -80,15 +80,15 @@ BOOL CEditValue::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
m_buttonUp = new CButton(m_iMan);
pc = (CButton*)m_buttonUp;
pc->Create(pos, dim, 49, EVENT_NULL); // ^
- pc->SetRepeat(TRUE);
+ pc->SetRepeat(true);
m_buttonDown = new CButton(m_iMan);
pc = (CButton*)m_buttonDown;
pc->Create(pos, dim, 50, EVENT_NULL); // v
- pc->SetRepeat(TRUE);
+ pc->SetRepeat(true);
MoveAdjust();
- return TRUE;
+ return true;
}
@@ -142,14 +142,14 @@ void CEditValue::MoveAdjust()
// Management of an event.
-BOOL CEditValue::EventProcess(const Event &event)
+bool CEditValue::EventProcess(const Event &event)
{
float value;
CControl::EventProcess(event);
- if ( (m_state & STATE_VISIBLE) == 0 ) return TRUE;
- if ( (m_state & STATE_ENABLE) == 0 ) return TRUE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return true;
+ if ( (m_state & STATE_ENABLE) == 0 ) return true;
if ( m_edit != 0 )
{
@@ -160,10 +160,10 @@ BOOL CEditValue::EventProcess(const Event &event)
value = RetValue();
if ( value > m_maxValue ) value = m_maxValue;
if ( value < m_minValue ) value = m_minValue;
- SetValue(value, TRUE);
+ SetValue(value, true);
HiliteValue(event);
}
- if ( !m_edit->EventProcess(event) ) return FALSE;
+ if ( !m_edit->EventProcess(event) ) return false;
if ( event.event == m_edit->RetEventMsg() )
{
@@ -179,10 +179,10 @@ BOOL CEditValue::EventProcess(const Event &event)
{
value = RetValue()+m_stepValue;
if ( value > m_maxValue ) value = m_maxValue;
- SetValue(value, TRUE);
+ SetValue(value, true);
HiliteValue(event);
}
- if ( !m_buttonUp->EventProcess(event) ) return FALSE;
+ if ( !m_buttonUp->EventProcess(event) ) return false;
}
if ( m_buttonDown != 0 )
@@ -191,10 +191,10 @@ BOOL CEditValue::EventProcess(const Event &event)
{
value = RetValue()-m_stepValue;
if ( value < m_minValue ) value = m_minValue;
- SetValue(value, TRUE);
+ SetValue(value, true);
HiliteValue(event);
}
- if ( !m_buttonDown->EventProcess(event) ) return FALSE;
+ if ( !m_buttonDown->EventProcess(event) ) return false;
}
if ( event.event == EVENT_KEYDOWN &&
@@ -203,7 +203,7 @@ BOOL CEditValue::EventProcess(const Event &event)
{
value = RetValue()+m_stepValue;
if ( value > m_maxValue ) value = m_maxValue;
- SetValue(value, TRUE);
+ SetValue(value, true);
HiliteValue(event);
}
if ( event.event == EVENT_KEYDOWN &&
@@ -212,11 +212,11 @@ BOOL CEditValue::EventProcess(const Event &event)
{
value = RetValue()-m_stepValue;
if ( value < m_minValue ) value = m_minValue;
- SetValue(value, TRUE);
+ SetValue(value, true);
HiliteValue(event);
}
- return TRUE;
+ return true;
}
@@ -235,7 +235,7 @@ void CEditValue::HiliteValue(const Event &event)
}
m_edit->SetCursor(pos, 0);
- m_edit->SetFocus(TRUE);
+ m_edit->SetFocus(true);
Event newEvent = event;
newEvent.event = EVENT_FOCUS;
@@ -285,7 +285,7 @@ EditValueType CEditValue::RetType()
// Changes the value.
-void CEditValue::SetValue(float value, BOOL bSendMessage)
+void CEditValue::SetValue(float value, bool bSendMessage)
{
char text[100];
diff --git a/src/ui/editvalue.h b/src/ui/editvalue.h
index e6c16f9..a05224f 100644
--- a/src/ui/editvalue.h
+++ b/src/ui/editvalue.h
@@ -42,18 +42,18 @@ public:
CEditValue(CInstanceManager* iMan);
virtual ~CEditValue();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
void SetPos(FPOINT pos);
void SetDim(FPOINT dim);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
void SetType(EditValueType type);
EditValueType RetType();
- void SetValue(float value, BOOL bSendMessage=FALSE);
+ void SetValue(float value, bool bSendMessage=false);
float RetValue();
void SetStepValue(float value);
diff --git a/src/ui/gauge.cpp b/src/ui/gauge.cpp
index b01230c..b7a1b1a 100644
--- a/src/ui/gauge.cpp
+++ b/src/ui/gauge.cpp
@@ -50,18 +50,18 @@ CGauge::~CGauge()
// Creates a new button.
-BOOL CGauge::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CGauge::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CGauge::EventProcess(const Event &event)
+bool CGauge::EventProcess(const Event &event)
{
CControl::EventProcess(event);
@@ -72,11 +72,11 @@ BOOL CGauge::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
diff --git a/src/ui/gauge.h b/src/ui/gauge.h
index e4ec692..2fef15b 100644
--- a/src/ui/gauge.h
+++ b/src/ui/gauge.h
@@ -32,9 +32,9 @@ public:
CGauge(CInstanceManager* iMan);
virtual ~CGauge();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
diff --git a/src/ui/group.cpp b/src/ui/group.cpp
index 73f8b36..a19e39b 100644
--- a/src/ui/group.cpp
+++ b/src/ui/group.cpp
@@ -50,7 +50,7 @@ CGroup::~CGroup()
// Creates a new button.
-BOOL CGroup::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CGroup::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -67,15 +67,15 @@ BOOL CGroup::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
SetName(name);
}
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CGroup::EventProcess(const Event &event)
+bool CGroup::EventProcess(const Event &event)
{
- return TRUE;
+ return true;
}
diff --git a/src/ui/group.h b/src/ui/group.h
index 9cefeed..264ae54 100644
--- a/src/ui/group.h
+++ b/src/ui/group.h
@@ -32,9 +32,9 @@ public:
CGroup(CInstanceManager* iMan);
virtual ~CGroup();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
diff --git a/src/ui/image.cpp b/src/ui/image.cpp
index 39ff867..f229585 100644
--- a/src/ui/image.cpp
+++ b/src/ui/image.cpp
@@ -55,7 +55,7 @@ CImage::~CImage()
// Creates a new button.
-BOOL CImage::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CImage::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -72,7 +72,7 @@ BOOL CImage::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
SetName(name);
}
- return TRUE;
+ return true;
}
@@ -96,9 +96,9 @@ char* CImage::RetFilenameImage()
// Management of an event.
-BOOL CImage::EventProcess(const Event &event)
+bool CImage::EventProcess(const Event &event)
{
- return TRUE;
+ return true;
}
diff --git a/src/ui/image.h b/src/ui/image.h
index b1f9bdc..9d2aa29 100644
--- a/src/ui/image.h
+++ b/src/ui/image.h
@@ -32,9 +32,9 @@ public:
CImage(CInstanceManager* iMan);
virtual ~CImage();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 75afd27..99b4755 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -489,7 +489,7 @@ CMap* CInterface::CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
// Removes a control.
-BOOL CInterface::DeleteControl(EventMsg eventMsg)
+bool CInterface::DeleteControl(EventMsg eventMsg)
{
int i;
@@ -501,11 +501,11 @@ BOOL CInterface::DeleteControl(EventMsg eventMsg)
{
delete m_table[i];
m_table[i] = 0;
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
// Gives a control.
@@ -529,7 +529,7 @@ CControl* CInterface::SearchControl(EventMsg eventMsg)
// Management of an event.
-BOOL CInterface::EventProcess(const Event &event)
+bool CInterface::EventProcess(const Event &event)
{
int i;
@@ -549,18 +549,18 @@ BOOL CInterface::EventProcess(const Event &event)
{
if ( !m_table[i]->EventProcess(event) )
{
- return FALSE;
+ return false;
}
}
}
- return TRUE;
+ return true;
}
// Gives the tooltip binding to the window.
-BOOL CInterface::GetTooltip(FPOINT pos, char* name)
+bool CInterface::GetTooltip(FPOINT pos, char* name)
{
int i;
@@ -570,11 +570,11 @@ BOOL CInterface::GetTooltip(FPOINT pos, char* name)
{
if ( m_table[i]->GetTooltip(pos, name) )
{
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
diff --git a/src/ui/interface.h b/src/ui/interface.h
index 6ef4c56..45435c0 100644
--- a/src/ui/interface.h
+++ b/src/ui/interface.h
@@ -52,8 +52,8 @@ public:
CInterface(CInstanceManager* iMan);
~CInterface();
- BOOL EventProcess(const Event &event);
- BOOL GetTooltip(FPOINT pos, char* name);
+ bool EventProcess(const Event &event);
+ bool GetTooltip(FPOINT pos, char* name);
void Flush();
CWindow* CreateWindows(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
@@ -73,7 +73,7 @@ public:
CCompass* CreateCompass(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
CTarget* CreateTarget(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
CMap* CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL DeleteControl(EventMsg eventMsg);
+ bool DeleteControl(EventMsg eventMsg);
CControl* SearchControl(EventMsg eventMsg);
void Draw();
diff --git a/src/ui/key.cpp b/src/ui/key.cpp
index 8a68439..d996244 100644
--- a/src/ui/key.cpp
+++ b/src/ui/key.cpp
@@ -66,7 +66,7 @@ CKey::CKey(CInstanceManager* iMan) : CControl(iMan)
{
m_key[0] = 0;
m_key[1] = 0;
- m_bCatch = FALSE;
+ m_bCatch = false;
}
// Object's destructor.
@@ -78,7 +78,7 @@ CKey::~CKey()
// Creates a new button.
-BOOL CKey::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CKey::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
char name[100];
char* p;
@@ -92,15 +92,15 @@ BOOL CKey::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
if ( p != 0 ) *p = 0;
SetName(name);
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CKey::EventProcess(const Event &event)
+bool CKey::EventProcess(const Event &event)
{
- if ( m_state & STATE_DEAD ) return TRUE;
+ if ( m_state & STATE_DEAD ) return true;
CControl::EventProcess(event);
@@ -108,17 +108,17 @@ BOOL CKey::EventProcess(const Event &event)
{
if ( Detect(event.pos) )
{
- m_bCatch = TRUE;
+ m_bCatch = true;
}
else
{
- m_bCatch = FALSE;
+ m_bCatch = false;
}
}
if ( event.event == EVENT_KEYDOWN && m_bCatch )
{
- m_bCatch = FALSE;
+ m_bCatch = false;
if ( TestKey(event.param) ) // impossible ?
{
@@ -143,21 +143,21 @@ BOOL CKey::EventProcess(const Event &event)
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
}
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// Seeks when a key is already used.
-BOOL CKey::TestKey(int key)
+bool CKey::TestKey(int key)
{
int i, j;
if ( key == VK_PAUSE ||
- key == VK_SNAPSHOT ) return TRUE; // blocked key
+ key == VK_SNAPSHOT ) return true; // blocked key
for ( i=0 ; i<20 ; i++ )
{
@@ -176,7 +176,7 @@ BOOL CKey::TestKey(int key)
}
}
- return FALSE; // not used
+ return false; // not used
}
diff --git a/src/ui/key.h b/src/ui/key.h
index bda1a3d..c3f46fd 100644
--- a/src/ui/key.h
+++ b/src/ui/key.h
@@ -32,9 +32,9 @@ public:
CKey(CInstanceManager* iMan);
virtual ~CKey();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
@@ -42,11 +42,11 @@ public:
int RetKey(int option);
protected:
- BOOL TestKey(int key);
+ bool TestKey(int key);
protected:
int m_key[2];
- BOOL m_bCatch;
+ bool m_bCatch;
};
diff --git a/src/ui/label.cpp b/src/ui/label.cpp
index 977c7f3..288631c 100644
--- a/src/ui/label.cpp
+++ b/src/ui/label.cpp
@@ -50,21 +50,21 @@ CLabel::~CLabel()
// Creates a new button.
-BOOL CLabel::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CLabel::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CLabel::EventProcess(const Event &event)
+bool CLabel::EventProcess(const Event &event)
{
//? CControl::EventProcess(event);
- return TRUE;
+ return true;
}
diff --git a/src/ui/label.h b/src/ui/label.h
index 5ad4eb1..1594deb 100644
--- a/src/ui/label.h
+++ b/src/ui/label.h
@@ -32,9 +32,9 @@ public:
CLabel(CInstanceManager* iMan);
virtual ~CLabel();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
diff --git a/src/ui/list.cpp b/src/ui/list.cpp
index 4950cf1..c23aef9 100644
--- a/src/ui/list.cpp
+++ b/src/ui/list.cpp
@@ -55,8 +55,8 @@ CList::CList(CInstanceManager* iMan) : CControl(iMan)
for ( i=0 ; i<LISTMAXTOTAL ; i++ )
{
m_text[i][0] = 0;
- m_check[i] = FALSE;
- m_enable[i] = TRUE;
+ m_check[i] = false;
+ m_enable[i] = true;
}
for ( i=0 ; i<10 ; i++ )
@@ -69,8 +69,8 @@ CList::CList(CInstanceManager* iMan) : CControl(iMan)
m_displayLine = 0;
m_selectLine = -1;
m_firstLine = 0;
- m_bBlink = FALSE;
- m_bSelectCap = TRUE;
+ m_bBlink = false;
+ m_bSelectCap = true;
m_blinkTime = 0.0f;
}
@@ -90,7 +90,7 @@ CList::~CList()
// Creates a new list.
-BOOL CList::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
+bool CList::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
float expand)
{
m_expand = expand;
@@ -107,7 +107,7 @@ BOOL CList::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
// Adjusted after a change of dimensions.
-BOOL CList::MoveAdjust()
+bool CList::MoveAdjust()
{
FPOINT ipos, idim, ppos, ddim;
float marging, h;
@@ -130,7 +130,7 @@ BOOL CList::MoveAdjust()
h = m_engine->RetText()->RetHeight(m_fontSize, m_fontType)*m_expand;
m_displayLine = (int)(idim.y/h);
- if ( m_displayLine == 0 ) return FALSE;
+ if ( m_displayLine == 0 ) return false;
if ( m_displayLine > LISTMAXDISPLAY ) m_displayLine = LISTMAXDISPLAY;
idim.y = h*m_displayLine;
m_dim.y = idim.y+marging*2.0f/480.f;
@@ -164,7 +164,7 @@ BOOL CList::MoveAdjust()
UpdateScroll();
UpdateButton();
- return TRUE;
+ return true;
}
@@ -199,7 +199,7 @@ void CList::SetDim(FPOINT dim)
}
-BOOL CList::SetState(int state, BOOL bState)
+bool CList::SetState(int state, bool bState)
{
int i;
@@ -215,7 +215,7 @@ BOOL CList::SetState(int state, BOOL bState)
return CControl::SetState(state, bState);
}
-BOOL CList::SetState(int state)
+bool CList::SetState(int state)
{
int i;
@@ -231,7 +231,7 @@ BOOL CList::SetState(int state)
return CControl::SetState(state);
}
-BOOL CList::ClearState(int state)
+bool CList::ClearState(int state)
{
int i;
@@ -250,7 +250,7 @@ BOOL CList::ClearState(int state)
// Management of an event.
-BOOL CList::EventProcess(const Event &event)
+bool CList::EventProcess(const Event &event)
{
int i;
@@ -276,8 +276,8 @@ BOOL CList::EventProcess(const Event &event)
}
}
- if ( (m_state & STATE_VISIBLE) == 0 ) return TRUE;
- if ( (m_state & STATE_ENABLE) == 0 ) return TRUE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return true;
+ if ( (m_state & STATE_ENABLE) == 0 ) return true;
if ( event.event == EVENT_KEYDOWN &&
event.param == VK_WHEELUP &&
@@ -286,7 +286,7 @@ BOOL CList::EventProcess(const Event &event)
if ( m_firstLine > 0 ) m_firstLine --;
UpdateScroll();
UpdateButton();
- return TRUE;
+ return true;
}
if ( event.event == EVENT_KEYDOWN &&
event.param == VK_WHEELDOWN &&
@@ -295,7 +295,7 @@ BOOL CList::EventProcess(const Event &event)
if ( m_firstLine < m_totalLine-m_displayLine ) m_firstLine ++;
UpdateScroll();
UpdateButton();
- return TRUE;
+ return true;
}
CControl::EventProcess(event);
@@ -320,7 +320,7 @@ BOOL CList::EventProcess(const Event &event)
if ( i+m_firstLine >= m_totalLine ) break;
if ( m_button[i] != 0 )
{
- if ( !m_button[i]->EventProcess(event) ) return FALSE;
+ if ( !m_button[i]->EventProcess(event) ) return false;
if ( event.event == m_eventButton[i] )
{
@@ -336,7 +336,7 @@ BOOL CList::EventProcess(const Event &event)
if ( m_scroll != 0 )
{
- if ( !m_scroll->EventProcess(event) ) return FALSE;
+ if ( !m_scroll->EventProcess(event) ) return false;
if ( event.event == m_eventScroll )
{
@@ -345,7 +345,7 @@ BOOL CList::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -635,12 +635,12 @@ int CList::RetSelect()
// Management of capability has a select box.
-void CList::SetSelectCap(BOOL bEnable)
+void CList::SetSelectCap(bool bEnable)
{
m_bSelectCap = bEnable;
}
-BOOL CList::RetSelectCap()
+bool CList::RetSelectCap()
{
return m_bSelectCap;
}
@@ -648,7 +648,7 @@ BOOL CList::RetSelectCap()
// Blink a line.
-void CList::SetBlink(BOOL bEnable)
+void CList::SetBlink(bool bEnable)
{
int i;
@@ -668,7 +668,7 @@ void CList::SetBlink(BOOL bEnable)
}
}
-BOOL CList::RetBlink()
+bool CList::RetBlink()
{
return m_bBlink;
}
@@ -709,7 +709,7 @@ char* CList::RetName(int i)
// Specifies the bit "check" for a box.
-void CList::SetCheck(int i, BOOL bMode)
+void CList::SetCheck(int i, bool bMode)
{
if ( i < 0 || i >= m_totalLine ) return;
@@ -718,9 +718,9 @@ void CList::SetCheck(int i, BOOL bMode)
// Returns the bit "check" for a box.
-BOOL CList::RetCheck(int i)
+bool CList::RetCheck(int i)
{
- if ( i < 0 || i >= m_totalLine ) return FALSE;
+ if ( i < 0 || i >= m_totalLine ) return false;
return m_check[i];
}
@@ -728,7 +728,7 @@ BOOL CList::RetCheck(int i)
// Specifies the bit "enable" for a box.
-void CList::SetEnable(int i, BOOL bMode)
+void CList::SetEnable(int i, bool bMode)
{
if ( i < 0 || i >= m_totalLine ) return;
@@ -737,9 +737,9 @@ void CList::SetEnable(int i, BOOL bMode)
// Returns the bit "enable" for a box.
-BOOL CList::RetEnable(int i)
+bool CList::RetEnable(int i)
{
- if ( i < 0 || i >= m_totalLine ) return FALSE;
+ if ( i < 0 || i >= m_totalLine ) return false;
return m_enable[i];
}
@@ -763,7 +763,7 @@ float CList::RetTabs(int i)
// Moves the lift to see the list of the selected line.
-void CList::ShowSelect(BOOL bFixed)
+void CList::ShowSelect(bool bFixed)
{
int sel;
diff --git a/src/ui/list.h b/src/ui/list.h
index 0a648a3..82fd470 100644
--- a/src/ui/list.h
+++ b/src/ui/list.h
@@ -39,16 +39,16 @@ public:
CList(CInstanceManager* iMan);
~CList();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, float expand);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, float expand);
void SetPos(FPOINT pos);
void SetDim(FPOINT dim);
- BOOL SetState(int state, BOOL bState);
- BOOL SetState(int state);
- BOOL ClearState(int state);
+ bool SetState(int state, bool bState);
+ bool SetState(int state);
+ bool ClearState(int state);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
void Flush();
@@ -59,31 +59,31 @@ public:
void SetSelect(int i);
int RetSelect();
- void SetSelectCap(BOOL bEnable);
- BOOL RetSelectCap();
+ void SetSelectCap(bool bEnable);
+ bool RetSelectCap();
- void SetBlink(BOOL bEnable);
- BOOL RetBlink();
+ void SetBlink(bool bEnable);
+ bool RetBlink();
void SetName(int i, char* name);
char* RetName(int i);
- void SetCheck(int i, BOOL bMode);
- BOOL RetCheck(int i);
+ void SetCheck(int i, bool bMode);
+ bool RetCheck(int i);
- void SetEnable(int i, BOOL bEnable);
- BOOL RetEnable(int i);
+ void SetEnable(int i, bool bEnable);
+ bool RetEnable(int i);
void SetTabs(int i, float pos, int justif=1);
float RetTabs(int i);
- void ShowSelect(BOOL bFixed);
+ void ShowSelect(bool bFixed);
EventMsg RetEventMsgButton(int i);
EventMsg RetEventMsgScroll();
protected:
- BOOL MoveAdjust();
+ bool MoveAdjust();
void UpdateButton();
void UpdateScroll();
void MoveScroll();
@@ -101,8 +101,8 @@ protected:
int m_displayLine; // number of visible lines
int m_selectLine; // selected line
int m_firstLine; // first visible line
- BOOL m_bBlink;
- BOOL m_bSelectCap;
+ bool m_bBlink;
+ bool m_bSelectCap;
float m_blinkTime;
float m_tabs[10];
int m_justifs[10];
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index eb5640e..40ac4c9 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -114,7 +114,7 @@ static int perso_color[3*10*3] =
#if _NET
// Check if the key "school" is present in the registry.
-BOOL SchoolCheck()
+bool SchoolCheck()
{
HKEY key;
char buffer[100];
@@ -128,16 +128,16 @@ BOOL SchoolCheck()
"Software\\Epsitec\\Colobot\\Setup",
#endif
0, KEY_READ, &key);
- if ( i != ERROR_SUCCESS ) return FALSE;
+ if ( i != ERROR_SUCCESS ) return false;
type = REG_SZ;
len = sizeof(buffer);
i = RegQueryValueEx(key, "School", NULL, &type, (LPBYTE)buffer, &len);
- if ( i != ERROR_SUCCESS || type != REG_SZ ) return FALSE;
+ if ( i != ERROR_SUCCESS || type != REG_SZ ) return false;
- if ( strcmp(buffer, "ToBoLoC") != 0 ) return FALSE;
+ if ( strcmp(buffer, "ToBoLoC") != 0 ) return false;
- return TRUE;
+ return true;
}
#endif
@@ -166,18 +166,18 @@ CMainDialog::CMainDialog(CInstanceManager* iMan)
m_stackRead[0] = 0;
m_sceneName[0] = 0;
m_sceneRank = 0;
- m_bSceneSoluce = FALSE;
- m_bSimulSetup = FALSE;
+ m_bSceneSoluce = false;
+ m_bSimulSetup = false;
#if _NET
m_accessEnable = SchoolCheck();
- m_accessMission= FALSE;
- m_accessUser = FALSE;
+ m_accessMission= false;
+ m_accessUser = false;
#else
- m_accessEnable = TRUE;
- m_accessMission= TRUE;
- m_accessUser = TRUE;
+ m_accessEnable = true;
+ m_accessMission= true;
+ m_accessUser = true;
#endif
- m_bDeleteGamer = TRUE;
+ m_bDeleteGamer = true;
for ( i=0 ; i<10 ; i++ )
{
@@ -190,21 +190,21 @@ CMainDialog::CMainDialog(CInstanceManager* iMan)
ZeroMemory(&m_perso, sizeof(GamerPerso));
DefPerso();
- m_bTooltip = TRUE;
- m_bGlint = TRUE;
- m_bRain = TRUE;
- m_bSoluce4 = TRUE;
- m_bMovies = TRUE;
- m_bNiceReset = TRUE;
- m_bHimselfDamage = TRUE;
+ m_bTooltip = true;
+ m_bGlint = true;
+ m_bRain = true;
+ m_bSoluce4 = true;
+ m_bMovies = true;
+ m_bNiceReset = true;
+ m_bHimselfDamage = true;
#if _TEEN
- m_bCameraScroll = FALSE;
+ m_bCameraScroll = false;
#else
- m_bCameraScroll = TRUE;
+ m_bCameraScroll = true;
#endif
- m_bCameraInvertX = FALSE;
- m_bCameraInvertY = FALSE;
- m_bEffect = TRUE;
+ m_bCameraInvertX = false;
+ m_bCameraInvertY = false;
+ m_bEffect = true;
m_shotDelay = 0;
m_glintMouse = FPOINT(0.0f, 0.0f);
@@ -222,7 +222,7 @@ CMainDialog::CMainDialog(CInstanceManager* iMan)
strcpy(m_userDir, "user");
strcpy(m_filesDir, "files");
- m_bDialog = FALSE;
+ m_bDialog = false;
}
// Destructor of robot application.
@@ -255,7 +255,7 @@ void CMainDialog::ChangePhase(Phase phase)
int res, i, j;
m_camera->SetType(CAMERA_DIALOG);
- m_engine->SetOverFront(FALSE);
+ m_engine->SetOverFront(false);
m_engine->SetOverColor(RetColor(0.0f), D3DSTATETCb);
if ( phase == PHASE_TERM )
@@ -434,8 +434,8 @@ void CMainDialog::ChangePhase(Phase phase)
pl->SetFontType(FONT_COURIER);
pl->SetFontSize(8.0f);
- m_engine->SetBackground("inter01.tga", 0,0, 0,0, TRUE, TRUE);
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackground("inter01.tga", 0,0, 0,0, true, true);
+ m_engine->SetBackForce(true);
}
if ( m_phase == PHASE_NAME )
@@ -504,7 +504,7 @@ void CMainDialog::ChangePhase(Phase phase)
}
pe->SetText(name);
pe->SetCursor(strlen(name), 0);
- pe->SetFocus(TRUE);
+ pe->SetFocus(true);
pos.x = 380.0f/640.0f;
pos.y = 320.0f/480.0f;
@@ -551,8 +551,8 @@ void CMainDialog::ChangePhase(Phase phase)
UpdateNameControl();
UpdateNameFace();
- m_engine->SetBackground("inter01.tga", 0,0, 0,0, TRUE, TRUE);
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackground("inter01.tga", 0,0, 0,0, true, true);
+ m_engine->SetBackForce(true);
}
if ( m_phase == PHASE_PERSO )
@@ -747,7 +747,7 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.y = 20.0f/480.0f;
pb = pw->CreateButton(pos, ddim, 55, EVENT_INTERFACE_PLROT); // <
pb->SetState(STATE_SHADOW);
- pb->SetRepeat(TRUE);
+ pb->SetRepeat(true);
pos.x = 290.0f/640.0f;
pos.y = 113.0f/480.0f;
@@ -755,7 +755,7 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.y = 20.0f/480.0f;
pb = pw->CreateButton(pos, ddim, 48, EVENT_INTERFACE_PRROT); // >
pb->SetState(STATE_SHADOW);
- pb->SetRepeat(TRUE);
+ pb->SetRepeat(true);
pos.x = 100.0f/640.0f;
pos.y = 70.0f/480.0f;
@@ -824,7 +824,7 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.x = 0.80f;
ddim.y = 0.80f;
pw = m_interface->CreateWindows(pos, ddim, 12, EVENT_WINDOW5);
- pw->SetClosable(TRUE);
+ pw->SetClosable(true);
if ( m_phase == PHASE_TRAINER ) res = RT_TITLE_TRAINER;
if ( m_phase == PHASE_DEFI ) res = RT_TITLE_DEFI;
if ( m_phase == PHASE_MISSION ) res = RT_TITLE_MISSION;
@@ -935,8 +935,8 @@ void CMainDialog::ChangePhase(Phase phase)
pe = pw->CreateEdit(pos, ddim, 0, EVENT_INTERFACE_RESUME);
pe->SetState(STATE_SHADOW);
pe->SetMaxChar(500);
- pe->SetEditCap(FALSE); // just to see
- pe->SetHiliteCap(FALSE);
+ pe->SetEditCap(false); // just to see
+ pe->SetHiliteCap(false);
// Button displays the "soluce":
if ( m_phase != PHASE_TRAINER &&
@@ -951,7 +951,7 @@ void CMainDialog::ChangePhase(Phase phase)
pc->SetState(STATE_SHADOW);
pc->ClearState(STATE_CHECK);
}
- m_bSceneSoluce = FALSE;
+ m_bSceneSoluce = false;
UpdateSceneResume((m_chap[m_index]+1)*100+(m_sel[m_index]+1));
@@ -998,8 +998,8 @@ void CMainDialog::ChangePhase(Phase phase)
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_BACK);
pb->SetState(STATE_SHADOW);
- m_engine->SetBackground("inter01.tga", 0,0, 0,0, TRUE, TRUE);
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackground("inter01.tga", 0,0, 0,0, true, true);
+ m_engine->SetBackForce(true);
}
if ( m_phase == PHASE_SETUPd ||
@@ -1016,32 +1016,32 @@ void CMainDialog::ChangePhase(Phase phase)
if ( m_phase == PHASE_SETUPds )
{
m_phaseSetup = PHASE_SETUPd;
- m_bSimulSetup = TRUE;
+ m_bSimulSetup = true;
}
else if ( m_phase == PHASE_SETUPgs )
{
m_phaseSetup = PHASE_SETUPg;
- m_bSimulSetup = TRUE;
+ m_bSimulSetup = true;
}
else if ( m_phase == PHASE_SETUPps )
{
m_phaseSetup = PHASE_SETUPp;
- m_bSimulSetup = TRUE;
+ m_bSimulSetup = true;
}
else if ( m_phase == PHASE_SETUPcs )
{
m_phaseSetup = PHASE_SETUPc;
- m_bSimulSetup = TRUE;
+ m_bSimulSetup = true;
}
else if ( m_phase == PHASE_SETUPss )
{
m_phaseSetup = PHASE_SETUPs;
- m_bSimulSetup = TRUE;
+ m_bSimulSetup = true;
}
else
{
m_phaseSetup = m_phase;
- m_bSimulSetup = FALSE;
+ m_bSimulSetup = false;
}
pos.x = 0.10f;
@@ -1049,7 +1049,7 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.x = 0.80f;
ddim.y = 0.80f;
pw = m_interface->CreateWindows(pos, ddim, 12, EVENT_WINDOW5);
- pw->SetClosable(TRUE);
+ pw->SetClosable(true);
GetResource(RES_TEXT, RT_TITLE_SETUP, name);
pw->SetName(name);
@@ -1192,8 +1192,8 @@ void CMainDialog::ChangePhase(Phase phase)
if ( !m_bSimulSetup )
{
- m_engine->SetBackground("inter01.tga", 0,0, 0,0, TRUE, TRUE);
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackground("inter01.tga", 0,0, 0,0, true, true);
+ m_engine->SetBackForce(true);
}
}
@@ -1576,7 +1576,7 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.x = 0.80f;
ddim.y = 0.80f;
pw = m_interface->CreateWindows(pos, ddim, 13, EVENT_WINDOW5);
- pw->SetClosable(TRUE);
+ pw->SetClosable(true);
GetResource(RES_TEXT, RT_TITLE_WRITE, name);
pw->SetName(name);
@@ -1660,7 +1660,7 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.x = 0.80f;
ddim.y = 0.80f;
pw = m_interface->CreateWindows(pos, ddim, 14, EVENT_WINDOW5);
- pw->SetClosable(TRUE);
+ pw->SetClosable(true);
GetResource(RES_TEXT, RT_TITLE_READ, name);
pw->SetName(name);
@@ -1727,8 +1727,8 @@ void CMainDialog::ChangePhase(Phase phase)
if ( m_phase == PHASE_READ )
{
- m_engine->SetBackground("inter01.tga", 0,0, 0,0, TRUE, TRUE);
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackground("inter01.tga", 0,0, 0,0, true, true);
+ m_engine->SetBackForce(true);
}
}
@@ -1772,8 +1772,8 @@ void CMainDialog::ChangePhase(Phase phase)
pl->SetFontSize(12.0f);
pl->SetJustif(0);
- m_engine->SetBackground("inter01.tga", 0,0, 0,0, TRUE, TRUE);
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackground("inter01.tga", 0,0, 0,0, true, true);
+ m_engine->SetBackForce(true);
m_loadingCounter = 1; // enough time to display!
}
@@ -1781,7 +1781,7 @@ void CMainDialog::ChangePhase(Phase phase)
if ( m_phase == PHASE_WELCOME1 )
{
m_sound->StopMusic();
- m_sound->PlayMusic(11, FALSE);
+ m_sound->PlayMusic(11, false);
pos.x = 0.0f;
pos.y = 0.0f;
@@ -1790,28 +1790,28 @@ void CMainDialog::ChangePhase(Phase phase)
pw = m_interface->CreateWindows(pos, ddim, -1, EVENT_WINDOW5);
m_engine->SetOverColor(RetColor(1.0f), D3DSTATETCb);
- m_engine->SetOverFront(TRUE);
+ m_engine->SetOverFront(true);
#if _FRENCH
- m_engine->SetBackground("alsyd.tga", 0,0, 0,0, TRUE, FALSE);
+ m_engine->SetBackground("alsyd.tga", 0,0, 0,0, true, false);
#endif
#if _POLISH
- m_engine->SetBackground("manta.tga", 0,0, 0,0, TRUE, FALSE);
+ m_engine->SetBackground("manta.tga", 0,0, 0,0, true, false);
#endif
#if _WG
- m_engine->SetBackground("wg.tga", 0,0, 0,0, TRUE, FALSE);
+ m_engine->SetBackground("wg.tga", 0,0, 0,0, true, false);
#endif
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackForce(true);
}
if ( m_phase == PHASE_WELCOME2 )
{
#if _ENGLISH
m_sound->StopMusic();
- m_sound->PlayMusic(11, FALSE);
+ m_sound->PlayMusic(11, false);
#endif
#if _POLISH
m_sound->StopMusic();
- m_sound->PlayMusic(11, FALSE);
+ m_sound->PlayMusic(11, false);
#endif
pos.x = 0.0f;
@@ -1821,10 +1821,10 @@ void CMainDialog::ChangePhase(Phase phase)
pw = m_interface->CreateWindows(pos, ddim, -1, EVENT_WINDOW5);
m_engine->SetOverColor(RetColor(1.0f), D3DSTATETCb);
- m_engine->SetOverFront(TRUE);
+ m_engine->SetOverFront(true);
- m_engine->SetBackground("colobot.tga", 0,0, 0,0, TRUE, FALSE);
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackground("colobot.tga", 0,0, 0,0, true, false);
+ m_engine->SetBackForce(true);
}
if ( m_phase == PHASE_WELCOME3 )
{
@@ -1835,21 +1835,21 @@ void CMainDialog::ChangePhase(Phase phase)
pw = m_interface->CreateWindows(pos, ddim, -1, EVENT_WINDOW5);
m_engine->SetOverColor(RetColor(0.0f), D3DSTATETCw);
- m_engine->SetOverFront(TRUE);
+ m_engine->SetOverFront(true);
#if _FRENCH
- m_engine->SetBackground("epsitecf.tga", 0,0, 0,0, TRUE, FALSE);
+ m_engine->SetBackground("epsitecf.tga", 0,0, 0,0, true, false);
#endif
#if _ENGLISH
- m_engine->SetBackground("epsitece.tga", 0,0, 0,0, TRUE, FALSE);
+ m_engine->SetBackground("epsitece.tga", 0,0, 0,0, true, false);
#endif
#if _GERMAN | _WG
- m_engine->SetBackground("epsitecd.tga", 0,0, 0,0, TRUE, FALSE);
+ m_engine->SetBackground("epsitecd.tga", 0,0, 0,0, true, false);
#endif
#if _POLISH
- m_engine->SetBackground("epsitecp.tga", 0,0, 0,0, TRUE, FALSE);
+ m_engine->SetBackground("epsitecp.tga", 0,0, 0,0, true, false);
#endif
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackForce(true);
}
if ( m_phase == PHASE_GENERIC )
@@ -1866,9 +1866,9 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.x = 490.0f/640.0f;
ddim.y = 110.0f/480.0f;
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
- pe->SetGenericMode(TRUE);
- pe->SetEditCap(FALSE);
- pe->SetHiliteCap(FALSE);
+ pe->SetGenericMode(true);
+ pe->SetEditCap(false);
+ pe->SetHiliteCap(false);
pe->SetFontType(FONT_COURIER);
pe->SetFontSize(8.0f);
pe->ReadText("help\\authors.txt");
@@ -1878,9 +1878,9 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.x = 490.0f/640.0f;
ddim.y = 100.0f/480.0f;
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT2);
- pe->SetGenericMode(TRUE);
- pe->SetEditCap(FALSE);
- pe->SetHiliteCap(FALSE);
+ pe->SetGenericMode(true);
+ pe->SetEditCap(false);
+ pe->SetHiliteCap(false);
pe->SetFontType(FONT_COURIER);
pe->SetFontSize(6.5f);
pe->ReadText("help\\licences.txt");
@@ -1898,9 +1898,9 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.y = 150.0f/480.0f;
#endif
pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
- pe->SetGenericMode(TRUE);
- pe->SetEditCap(FALSE);
- pe->SetHiliteCap(FALSE);
+ pe->SetGenericMode(true);
+ pe->SetEditCap(false);
+ pe->SetHiliteCap(false);
pe->SetFontType(FONT_COURIER);
pe->SetFontSize(8.0f);
pe->ReadText("help\\authors.txt");
@@ -1911,9 +1911,9 @@ void CMainDialog::ChangePhase(Phase phase)
//? ddim.x = 490.0f/640.0f;
//? ddim.y = 110.0f/480.0f;
//? pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
-//? pe->SetGenericMode(TRUE);
-//? pe->SetEditCap(FALSE);
-//? pe->SetHiliteCap(FALSE);
+//? pe->SetGenericMode(true);
+//? pe->SetEditCap(false);
+//? pe->SetHiliteCap(false);
//? pe->SetFontType(FONT_COURIER);
//? pe->SetFontSize(8.0f);
//? pe->ReadText("help\\demo.txt");
@@ -1923,9 +1923,9 @@ void CMainDialog::ChangePhase(Phase phase)
//? ddim.x = 490.0f/640.0f;
//? ddim.y = 100.0f/480.0f;
//? pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT2);
-//? pe->SetGenericMode(TRUE);
-//? pe->SetEditCap(FALSE);
-//? pe->SetHiliteCap(FALSE);
+//? pe->SetGenericMode(true);
+//? pe->SetEditCap(false);
+//? pe->SetHiliteCap(false);
//? pe->SetFontType(FONT_COURIER);
//? pe->SetFontSize(8.0f);
//? pe->ReadText("help\\authors.txt");
@@ -1982,51 +1982,51 @@ void CMainDialog::ChangePhase(Phase phase)
#if _NEWLOOK
#if _CEEBOTDEMO
#if _TEEN
- m_engine->SetBackground("genedt.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genedt.tga", 0,0, 0,0, true, true);
#else
- m_engine->SetBackground("geneda.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("geneda.tga", 0,0, 0,0, true, true);
#endif
#else
- m_engine->SetBackground("genern.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genern.tga", 0,0, 0,0, true, true);
#endif
#else
#if _FRENCH
#if _DEMO
- m_engine->SetBackground("genedf.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genedf.tga", 0,0, 0,0, true, true);
#else
- m_engine->SetBackground("generf.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("generf.tga", 0,0, 0,0, true, true);
#endif
#endif
#if _ENGLISH
#if _DEMO
- m_engine->SetBackground("genede.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genede.tga", 0,0, 0,0, true, true);
#else
- m_engine->SetBackground("genere.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genere.tga", 0,0, 0,0, true, true);
#endif
#endif
#if _GERMAN
#if _DEMO
- m_engine->SetBackground("genedd.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genedd.tga", 0,0, 0,0, true, true);
#else
- m_engine->SetBackground("genere.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genere.tga", 0,0, 0,0, true, true);
#endif
#endif
#if _WG
#if _DEMO
- m_engine->SetBackground("genedd.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genedd.tga", 0,0, 0,0, true, true);
#else
- m_engine->SetBackground("generd.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("generd.tga", 0,0, 0,0, true, true);
#endif
#endif
#if _POLISH
#if _DEMO
- m_engine->SetBackground("genedp.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("genedp.tga", 0,0, 0,0, true, true);
#else
- m_engine->SetBackground("generp.tga", 0,0, 0,0, TRUE, TRUE);
+ m_engine->SetBackground("generp.tga", 0,0, 0,0, true, true);
#endif
#endif
#endif
- m_engine->SetBackForce(TRUE);
+ m_engine->SetBackForce(true);
}
if ( m_phase == PHASE_INIT ||
@@ -2075,9 +2075,9 @@ void CMainDialog::ChangePhase(Phase phase)
// Processing an event.
-// Returns FALSE if the event has been processed completely.
+// Returns false if the event has been processed completely.
-BOOL CMainDialog::EventProcess(const Event &event)
+bool CMainDialog::EventProcess(const Event &event)
{
CWindow* pw;
CList* pl;
@@ -2129,17 +2129,17 @@ BOOL CMainDialog::EventProcess(const Event &event)
if ( m_phase == PHASE_WELCOME1 && m_phaseTime >= welcomeLength )
{
ChangePhase(PHASE_WELCOME2);
- return TRUE;
+ return true;
}
if ( m_phase == PHASE_WELCOME2 && m_phaseTime >= welcomeLength )
{
ChangePhase(PHASE_WELCOME3);
- return TRUE;
+ return true;
}
if ( m_phase == PHASE_WELCOME3 && m_phaseTime >= welcomeLength )
{
ChangePhase(PHASE_NAME);
- return TRUE;
+ return true;
}
if ( m_shotDelay > 0 && !m_bDialog ) // screenshot done?
@@ -2159,7 +2159,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
m_main->ChangePhase(PHASE_SIMUL);
}
m_loadingCounter --;
- return FALSE;
+ return false;
}
m_glintTime += event.rTime;
@@ -2172,7 +2172,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
FrameDialog(event.rTime);
}
- return TRUE;
+ return true;
}
if ( event.event == EVENT_MOUSEMOVE )
@@ -2244,13 +2244,13 @@ BOOL CMainDialog::EventProcess(const Event &event)
ChangePhase(PHASE_READs);
}
- return FALSE;
+ return false;
}
if ( !m_engine->RetMouseHide() &&
!m_interface->EventProcess(event) )
{
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_INIT )
@@ -2308,7 +2308,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
m_main->ChangePhase(PHASE_NAME);
break;
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_NAME )
@@ -2498,14 +2498,14 @@ BOOL CMainDialog::EventProcess(const Event &event)
m_phase == PHASE_PROTO )
{
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
if ( event.event == pw->RetEventMsgClose() ||
event.event == EVENT_INTERFACE_BACK ||
(event.event == EVENT_KEYDOWN && event.param == VK_ESCAPE) )
{
m_main->ChangePhase(PHASE_INIT);
- return FALSE;
+ return false;
}
}
@@ -2557,7 +2557,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
m_main->ChangePhase(PHASE_READ);
break;
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_SETUPd ||
@@ -2567,7 +2567,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
m_phase == PHASE_SETUPs )
{
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
if ( event.event == pw->RetEventMsgClose() ||
event.event == EVENT_INTERFACE_BACK ||
@@ -2576,7 +2576,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
SetupMemorize();
m_engine->ApplyChange();
m_main->ChangePhase(PHASE_INIT);
- return FALSE;
+ return false;
}
switch( event.event )
@@ -2610,7 +2610,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
m_phase == PHASE_SETUPss )
{
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
if ( event.event == pw->RetEventMsgClose() ||
event.event == EVENT_INTERFACE_BACK ||
@@ -2621,7 +2621,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
m_interface->DeleteControl(EVENT_WINDOW5);
ChangePhase(PHASE_SIMUL);
StopSuspend();
- return FALSE;
+ return false;
}
switch( event.event )
@@ -2689,7 +2689,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
UpdateApply();
break;
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_SETUPg || // setup/graphic ?
@@ -2767,7 +2767,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
UpdateSetupButtons();
break;
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_SETUPp || // setup/game ?
@@ -2876,7 +2876,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
UpdateSetupButtons();
break;
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_SETUPc || // setup/commands ?
@@ -2924,7 +2924,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
UpdateSetupButtons();
break;
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_SETUPs || // setup/sound ?
@@ -2954,13 +2954,13 @@ BOOL CMainDialog::EventProcess(const Event &event)
UpdateSetupButtons();
break;
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_READ )
{
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
if ( event.event == pw->RetEventMsgClose() ||
event.event == EVENT_INTERFACE_BACK ||
@@ -2986,14 +2986,14 @@ BOOL CMainDialog::EventProcess(const Event &event)
}
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_WRITEs ||
m_phase == PHASE_READs )
{
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
if ( event.event == pw->RetEventMsgClose() ||
event.event == EVENT_INTERFACE_BACK ||
@@ -3031,7 +3031,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
}
}
- return FALSE;
+ return false;
}
if ( m_phase == PHASE_WELCOME1 )
@@ -3041,7 +3041,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
event.event == EVENT_RBUTTONDOWN )
{
ChangePhase(PHASE_WELCOME2);
- return TRUE;
+ return true;
}
}
if ( m_phase == PHASE_WELCOME2 )
@@ -3051,7 +3051,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
event.event == EVENT_RBUTTONDOWN )
{
ChangePhase(PHASE_WELCOME3);
- return TRUE;
+ return true;
}
}
if ( m_phase == PHASE_WELCOME3 )
@@ -3061,7 +3061,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
event.event == EVENT_RBUTTONDOWN )
{
ChangePhase(PHASE_NAME);
- return TRUE;
+ return true;
}
}
@@ -3093,7 +3093,7 @@ BOOL CMainDialog::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -3570,7 +3570,7 @@ void CMainDialog::FrameParticule(float rTime)
// Some nice particles following the mouse.
-void CMainDialog::NiceParticule(FPOINT mouse, BOOL bPress)
+void CMainDialog::NiceParticule(FPOINT mouse, bool bPress)
{
D3DVECTOR pos, speed;
FPOINT dim;
@@ -3624,11 +3624,11 @@ void CMainDialog::SetUserDir(char *base, int rank)
if ( strcmp(base, "user") == 0 && rank >= 100 )
{
sprintf(dir, "%s\\%s", m_userDir, m_userList[rank/100-1]);
- UserDir(TRUE, dir);
+ UserDir(true, dir);
}
else
{
- UserDir(FALSE, "");
+ UserDir(false, "");
}
}
@@ -3669,7 +3669,7 @@ void CMainDialog::ReadNameList()
CList* pl;
long hFile;
struct _finddata_t fBuffer;
- BOOL bDo;
+ bool bDo;
char dir[_MAX_FNAME];
char temp[_MAX_FNAME];
char filenames[_MAX_FNAME][100];
@@ -3697,7 +3697,7 @@ void CMainDialog::ReadNameList()
}
do // sorts all names:
{
- bDo = FALSE;
+ bDo = false;
for ( i=0 ; i<nbFilenames-1 ; i++ )
{
if ( strcmp(filenames[i], filenames[i+1]) > 0 )
@@ -3705,7 +3705,7 @@ void CMainDialog::ReadNameList()
strcpy(temp, filenames[i]);
strcpy(filenames[i], filenames[i+1]);
strcpy(filenames[i+1], temp);
- bDo = TRUE;
+ bDo = true;
}
}
}
@@ -3792,7 +3792,7 @@ void CMainDialog::UpdateNameList()
if ( stricmp(name, pl->RetName(i)) == 0 )
{
pl->SetSelect(i);
- pl->ShowSelect(FALSE);
+ pl->ShowSelect(false);
return;
}
}
@@ -3944,7 +3944,7 @@ void CMainDialog::NameCreate()
m_sound->Play(SOUND_TZOING);
pe->SetText(name);
pe->SetCursor(strlen(name), 0);
- pe->SetFocus(TRUE);
+ pe->SetFocus(true);
return;
}
@@ -3956,7 +3956,7 @@ void CMainDialog::NameCreate()
// Deletes a folder and all its offspring.
-BOOL RemoveDir(char *dirname)
+bool RemoveDir(char *dirname)
{
long hFile;
struct _finddata_t fBuffer;
@@ -3987,9 +3987,9 @@ BOOL RemoveDir(char *dirname)
if ( _rmdir(dirname) != 0 )
{
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// Removes a player.
@@ -4035,7 +4035,7 @@ void CMainDialog::NameDelete()
// ests whether two colors are equal or nearly are.
-BOOL EqColor(const D3DCOLORVALUE &c1, const D3DCOLORVALUE &c2)
+bool EqColor(const D3DCOLORVALUE &c1, const D3DCOLORVALUE &c2)
{
return (Abs(c1.r-c2.r) < 0.01f &&
Abs(c1.g-c2.g) < 0.01f &&
@@ -4325,16 +4325,16 @@ void CMainDialog::DefPerso()
// Indicates if there is at least one backup.
-BOOL CMainDialog::IsIOReadScene()
+bool CMainDialog::IsIOReadScene()
{
FILE* file;
char filename[100];
sprintf(filename, "%s\\%s\\save%c%.3d\\data.sav", m_savegameDir, m_main->RetGamerName(), m_sceneName[0], 0);
file = fopen(filename, "r");
- if ( file == NULL ) return FALSE;
+ if ( file == NULL ) return false;
fclose(file);
- return TRUE;
+ return true;
}
// Builds the file name by default.
@@ -4389,7 +4389,7 @@ void CMainDialog::IOReadName()
sprintf(name, "%s %d - %s", resume, m_sel[m_index]+1, line);
pe->SetText(name);
pe->SetCursor(strlen(name), 0);
- pe->SetFocus(TRUE);
+ pe->SetFocus(true);
}
// Updates the list of games recorded on disk.
@@ -4450,7 +4450,7 @@ void CMainDialog::IOReadList()
}
pl->SetSelect(j-1);
- pl->ShowSelect(FALSE); // shows the selected columns
+ pl->ShowSelect(false); // shows the selected columns
}
// Updates the buttons according to the selected part in the list.
@@ -4560,7 +4560,7 @@ void CMainDialog::IODeleteScene()
// Writes the scene.
-BOOL CMainDialog::IOWriteScene()
+bool CMainDialog::IOWriteScene()
{
CWindow* pw;
CList* pl;
@@ -4571,14 +4571,14 @@ BOOL CMainDialog::IOWriteScene()
int sel;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
pl = (CList*)pw->SearchControl(EVENT_INTERFACE_IOLIST);
- if ( pl == 0 ) return FALSE;
+ if ( pl == 0 ) return false;
pe = (CEdit*)pw->SearchControl(EVENT_INTERFACE_IONAME);
- if ( pe == 0 ) return FALSE;
+ if ( pe == 0 ) return false;
sel = pl->RetSelect();
- if ( sel == -1 ) return FALSE;
+ if ( sel == -1 ) return false;
_mkdir("Savegame"); // if doesn't exist yet!
sprintf(filename, "%s\\%s", m_savegameDir, m_main->RetGamerName());
@@ -4594,12 +4594,12 @@ BOOL CMainDialog::IOWriteScene()
m_shotDelay = 3;
sprintf(m_shotName, "%s\\%s\\save%c%.3d\\screen.bmp", m_savegameDir, m_main->RetGamerName(), m_sceneName[0], sel);
- return TRUE;
+ return true;
}
// Reads the scene.
-BOOL CMainDialog::IOReadScene()
+bool CMainDialog::IOReadScene()
{
FILE* file;
CWindow* pw;
@@ -4611,18 +4611,18 @@ BOOL CMainDialog::IOReadScene()
int sel, i;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
pl = (CList*)pw->SearchControl(EVENT_INTERFACE_IOLIST);
- if ( pl == 0 ) return FALSE;
+ if ( pl == 0 ) return false;
sel = pl->RetSelect();
- if ( sel == -1 ) return FALSE;
+ if ( sel == -1 ) return false;
sprintf(filename, "%s\\%s\\save%c%.3d\\data.sav", m_savegameDir, m_main->RetGamerName(), m_sceneName[0], sel);
sprintf(filecbot, "%s\\%s\\save%c%.3d\\cbot.run", m_savegameDir, m_main->RetGamerName(), m_sceneName[0], sel);
file = fopen(filename, "r");
- if ( file == NULL ) return FALSE;
+ if ( file == NULL ) return false;
while ( fgets(line, 500, file) != NULL )
{
@@ -4656,7 +4656,7 @@ BOOL CMainDialog::IOReadScene()
if ( m_sceneRank/100 == 0 )
{
fclose(file);
- return FALSE;
+ return false;
}
}
}
@@ -4668,7 +4668,7 @@ BOOL CMainDialog::IOReadScene()
strcpy(m_sceneRead, filename);
strcpy(m_stackRead, filecbot);
- return TRUE;
+ return true;
}
@@ -4721,7 +4721,7 @@ void CMainDialog::UpdateSceneChap(int &chap)
char line[500];
char name[100];
int i, j;
- BOOL bPassed, bDo;
+ bool bPassed, bDo;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
if ( pw == 0 ) return;
@@ -4750,7 +4750,7 @@ void CMainDialog::UpdateSceneChap(int &chap)
do // sorts all names:
{
- bDo = FALSE;
+ bDo = false;
for ( i=0 ; i<m_userTotal-1 ; i++ )
{
if ( strcmp(m_userList[i], m_userList[i+1]) > 0 )
@@ -4758,7 +4758,7 @@ void CMainDialog::UpdateSceneChap(int &chap)
strcpy(name, m_userList[i]);
strcpy(m_userList[i], m_userList[i+1]);
strcpy(m_userList[i+1], name);
- bDo = TRUE;
+ bDo = true;
}
}
}
@@ -4798,7 +4798,7 @@ void CMainDialog::UpdateSceneChap(int &chap)
}
pl->SetName(j, name);
- pl->SetEnable(j, TRUE);
+ pl->SetEnable(j, true);
}
}
else
@@ -4846,7 +4846,7 @@ void CMainDialog::UpdateSceneChap(int &chap)
sprintf(line, "%d: %s", j+1, name);
pl->SetName(j, line);
pl->SetCheck(j, bPassed);
- pl->SetEnable(j, TRUE);
+ pl->SetEnable(j, true);
if ( m_phase == PHASE_MISSION && !m_main->RetShowAll() && !bPassed )
{
@@ -4873,7 +4873,7 @@ void CMainDialog::UpdateSceneChap(int &chap)
if ( chap > j-1 ) chap = j-1;
pl->SetSelect(chap);
- pl->ShowSelect(FALSE); // shows the selected columns
+ pl->ShowSelect(false); // shows the selected columns
}
// Updates the list of exercises or missions.
@@ -4888,7 +4888,7 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
char line[500];
char name[100];
int i, j;
- BOOL bPassed;
+ bool bPassed;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
if ( pw == 0 ) return;
@@ -4944,7 +4944,7 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
sprintf(line, "%d: %s", j+1, name);
pl->SetName(j, line);
pl->SetCheck(j, bPassed);
- pl->SetEnable(j, TRUE);
+ pl->SetEnable(j, true);
if ( m_phase == PHASE_MISSION && !m_main->RetShowAll() && !bPassed )
{
@@ -4976,7 +4976,7 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
if ( sel > j-1 ) sel = j-1;
pl->SetSelect(sel);
- pl->ShowSelect(FALSE); // shows the selected columns
+ pl->ShowSelect(false); // shows the selected columns
}
// Updates the button "solution" according to cheat code.
@@ -4995,7 +4995,7 @@ void CMainDialog::ShowSoluceUpdate()
m_phase == PHASE_USER ||
m_phase == PHASE_PROTO )
{
- m_bSceneSoluce = FALSE;
+ m_bSceneSoluce = false;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
if ( pw == 0 ) return;
@@ -5008,13 +5008,13 @@ void CMainDialog::ShowSoluceUpdate()
{
pc->SetState(STATE_VISIBLE);
pc->SetState(STATE_CHECK);
- m_bSceneSoluce = TRUE;
+ m_bSceneSoluce = true;
}
else
{
pc->ClearState(STATE_VISIBLE);
pc->ClearState(STATE_CHECK);
- m_bSceneSoluce = FALSE;
+ m_bSceneSoluce = false;
}
}
}
@@ -5032,7 +5032,7 @@ void CMainDialog::UpdateSceneResume(int rank)
char line[500];
char name[500];
int i, numTry;
- BOOL bPassed, bVisible;
+ bool bPassed, bVisible;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
if ( pw == 0 ) return;
@@ -5042,19 +5042,19 @@ void CMainDialog::UpdateSceneResume(int rank)
if ( pc == 0 )
{
- m_bSceneSoluce = FALSE;
+ m_bSceneSoluce = false;
}
else
{
numTry = RetGamerInfoTry(rank);
bPassed = RetGamerInfoPassed(rank);
bVisible = ( numTry > 2 || bPassed || m_main->RetShowSoluce() );
- if ( !RetSoluce4() ) bVisible = FALSE;
+ if ( !RetSoluce4() ) bVisible = false;
pc->SetState(STATE_VISIBLE, bVisible);
if ( !bVisible )
{
pc->ClearState(STATE_CHECK);
- m_bSceneSoluce = FALSE;
+ m_bSceneSoluce = false;
}
}
@@ -5117,7 +5117,7 @@ void CMainDialog::UpdateDisplayDevice()
}
pl->SetSelect(selectDevices);
- pl->ShowSelect(FALSE);
+ pl->ShowSelect(false);
m_setupSelDevice = selectDevices;
}
@@ -5152,7 +5152,7 @@ void CMainDialog::UpdateDisplayMode()
}
pl->SetSelect(selectModes);
- pl->ShowSelect(FALSE);
+ pl->ShowSelect(false);
m_setupSelMode = selectModes;
}
@@ -5166,7 +5166,7 @@ void CMainDialog::ChangeDisplay()
CCheck* pc;
char* device;
char* mode;
- BOOL bFull;
+ bool bFull;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
if ( pw == 0 ) return;
@@ -5206,7 +5206,7 @@ void CMainDialog::UpdateApply()
CList* pl;
CCheck* pc;
int sel1, sel2;
- BOOL bFull;
+ bool bFull;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
if ( pw == 0 ) return;
@@ -5891,7 +5891,7 @@ void CMainDialog::SetupRecall()
void CMainDialog::ChangeSetupQuality(int quality)
{
- BOOL bEnable;
+ bool bEnable;
float value;
int iValue;
@@ -5931,7 +5931,7 @@ void CMainDialog::ChangeSetupQuality(int quality)
if ( quality > 0 ) iValue = 2;
m_engine->SetTextureQuality(iValue);
- m_engine->FirstExecuteAdapt(FALSE);
+ m_engine->FirstExecuteAdapt(false);
}
@@ -6095,8 +6095,8 @@ void CMainDialog::StartAbort()
FPOINT pos, dim;
char name[100];
- StartDialog(FPOINT(0.3f, 0.8f), TRUE, FALSE, FALSE);
- m_bDialogDelete = FALSE;
+ StartDialog(FPOINT(0.3f, 0.8f), true, false, false);
+ m_bDialogDelete = false;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
if ( pw == 0 ) return;
@@ -6177,8 +6177,8 @@ void CMainDialog::StartDeleteObject()
FPOINT pos, dim;
char name[100];
- StartDialog(FPOINT(0.7f, 0.3f), FALSE, TRUE, TRUE);
- m_bDialogDelete = TRUE;
+ StartDialog(FPOINT(0.7f, 0.3f), false, true, true);
+ m_bDialogDelete = true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
if ( pw == 0 ) return;
@@ -6212,8 +6212,8 @@ void CMainDialog::StartDeleteGame(char *gamer)
char name[100];
char text[100];
- StartDialog(FPOINT(0.7f, 0.3f), FALSE, TRUE, TRUE);
- m_bDialogDelete = TRUE;
+ StartDialog(FPOINT(0.7f, 0.3f), false, true, true);
+ m_bDialogDelete = true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
if ( pw == 0 ) return;
@@ -6247,7 +6247,7 @@ void CMainDialog::StartQuit()
FPOINT pos, dim;
char name[100];
- StartDialog(FPOINT(0.6f, 0.3f), FALSE, TRUE, TRUE);
+ StartDialog(FPOINT(0.6f, 0.3f), false, true, true);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
if ( pw == 0 ) return;
@@ -6273,7 +6273,7 @@ void CMainDialog::StartQuit()
// Beginning of displaying a dialog.
-void CMainDialog::StartDialog(FPOINT dim, BOOL bFire, BOOL bOK, BOOL bCancel)
+void CMainDialog::StartDialog(FPOINT dim, bool bFire, bool bOK, bool bCancel)
{
CWindow* pw;
CButton* pb;
@@ -6354,7 +6354,7 @@ void CMainDialog::StartDialog(FPOINT dim, BOOL bFire, BOOL bOK, BOOL bCancel)
}
m_sound->Play(SOUND_TZOING);
- m_bDialog = TRUE;
+ m_bDialog = true;
}
// Animation of a dialog.
@@ -6503,18 +6503,18 @@ void CMainDialog::StopDialog()
StopSuspend();
m_interface->DeleteControl(EVENT_WINDOW9);
- m_bDialog = FALSE;
+ m_bDialog = false;
}
// Suspends the simulation for a dialog phase.
void CMainDialog::StartSuspend()
{
- m_sound->MuteAll(TRUE);
+ m_sound->MuteAll(true);
m_main->ClearInterface();
m_bInitPause = m_engine->RetPause();
- m_engine->SetPause(TRUE);
- m_engine->SetOverFront(FALSE); // over flat behind
+ m_engine->SetPause(true);
+ m_engine->SetOverFront(false); // over flat behind
m_main->CreateShortcuts();
m_main->StartSuspend();
m_initCamera = m_camera->RetType();
@@ -6525,10 +6525,10 @@ void CMainDialog::StartSuspend()
void CMainDialog::StopSuspend()
{
- m_sound->MuteAll(FALSE);
+ m_sound->MuteAll(false);
m_main->ClearInterface();
- if ( !m_bInitPause ) m_engine->SetPause(FALSE);
- m_engine->SetOverFront(TRUE); // over flat front
+ if ( !m_bInitPause ) m_engine->SetPause(false);
+ m_engine->SetOverFront(true); // over flat front
m_main->CreateShortcuts();
m_main->StopSuspend();
m_camera->SetType(m_initCamera);
@@ -6537,14 +6537,14 @@ void CMainDialog::StopSuspend()
// Whether to use tooltips.
-BOOL CMainDialog::RetTooltip()
+bool CMainDialog::RetTooltip()
{
return m_bTooltip;
}
// Specifies whether a dialog is displayed.
-BOOL CMainDialog::IsDialog()
+bool CMainDialog::IsDialog()
{
return m_bDialog;
}
@@ -6622,7 +6622,7 @@ char* CMainDialog::RetSceneDir()
// Whether to show the solution.
-BOOL CMainDialog::RetSceneSoluce()
+bool CMainDialog::RetSceneSoluce()
{
return m_bSceneSoluce;
}
@@ -6644,35 +6644,35 @@ char* CMainDialog::RetPublicDir()
// Indicates if there are reflections on the buttons.
-BOOL CMainDialog::RetGlint()
+bool CMainDialog::RetGlint()
{
return m_bGlint;
}
// Whether to show 4:solutions.
-BOOL CMainDialog::RetSoluce4()
+bool CMainDialog::RetSoluce4()
{
return m_bSoluce4;
}
// Whether to show the cinematics.
-BOOL CMainDialog::RetMovies()
+bool CMainDialog::RetMovies()
{
return m_bMovies;
}
// IWhether to make an animation in CTaskReset.
-BOOL CMainDialog::RetNiceReset()
+bool CMainDialog::RetNiceReset()
{
return m_bNiceReset;
}
// Indicates whether the fire causes damage to its own units.
-BOOL CMainDialog::RetHimselfDamage()
+bool CMainDialog::RetHimselfDamage()
{
return m_bHimselfDamage;
}
@@ -6781,7 +6781,7 @@ int CMainDialog::RetGamerGlasses()
return m_perso.glasses;
}
-BOOL CMainDialog::RetGamerOnlyHead()
+bool CMainDialog::RetGamerOnlyHead()
{
return (m_phase == PHASE_PERSO && m_persoTab == 0);
}
@@ -6809,7 +6809,7 @@ D3DCOLORVALUE CMainDialog::RetGamerColorBand()
// Reads the file of the player.
-BOOL CMainDialog::ReadGamerInfo()
+bool CMainDialog::ReadGamerInfo()
{
FILE* file;
char line[100];
@@ -6818,12 +6818,12 @@ BOOL CMainDialog::ReadGamerInfo()
for ( i=0 ; i<MAXSCENE ; i++ )
{
m_sceneInfo[i].numTry = 0;
- m_sceneInfo[i].bPassed = FALSE;
+ m_sceneInfo[i].bPassed = false;
}
sprintf(line, "%s\\%s\\%s.gam", m_savegameDir, m_main->RetGamerName(), m_sceneName);
file = fopen(line, "r");
- if ( file == NULL ) return FALSE;
+ if ( file == NULL ) return false;
if ( fgets(line, 100, file) != NULL )
{
@@ -6846,12 +6846,12 @@ BOOL CMainDialog::ReadGamerInfo()
}
fclose(file);
- return TRUE;
+ return true;
}
// Writes the file of the player.
-BOOL CMainDialog::WriteGamerInfo()
+bool CMainDialog::WriteGamerInfo()
{
FILE* file;
char line[100];
@@ -6859,7 +6859,7 @@ BOOL CMainDialog::WriteGamerInfo()
sprintf(line, "%s\\%s\\%s.gam", m_savegameDir, m_main->RetGamerName(), m_sceneName);
file = fopen(line, "w");
- if ( file == NULL ) return FALSE;
+ if ( file == NULL ) return false;
sprintf(line, "CurrentChapter=%d CurrentSel=%d\n",
m_chap[m_index]+1, m_sel[m_index]+1);
@@ -6875,7 +6875,7 @@ BOOL CMainDialog::WriteGamerInfo()
}
fclose(file);
- return TRUE;
+ return true;
}
void CMainDialog::SetGamerInfoTry(int rank, int numTry)
@@ -6891,17 +6891,17 @@ int CMainDialog::RetGamerInfoTry(int rank)
return m_sceneInfo[rank].numTry;
}
-void CMainDialog::SetGamerInfoPassed(int rank, BOOL bPassed)
+void CMainDialog::SetGamerInfoPassed(int rank, bool bPassed)
{
int chap, i;
- BOOL bAll;
+ bool bAll;
if ( rank < 0 || rank >= MAXSCENE ) return;
m_sceneInfo[rank].bPassed = bPassed;
if ( bPassed )
{
- bAll = TRUE;
+ bAll = true;
chap = rank/100;
for ( i=0 ; i<m_maxList ; i++ )
{
@@ -6912,16 +6912,16 @@ void CMainDialog::SetGamerInfoPassed(int rank, BOOL bPassed)
}
}
-BOOL CMainDialog::RetGamerInfoPassed(int rank)
+bool CMainDialog::RetGamerInfoPassed(int rank)
{
- if ( rank < 0 || rank >= MAXSCENE ) return FALSE;
+ if ( rank < 0 || rank >= MAXSCENE ) return false;
return m_sceneInfo[rank].bPassed;
}
// Passes to the next mission, and possibly in the next chapter.
-BOOL CMainDialog::NextMission()
+bool CMainDialog::NextMission()
{
m_sel[m_index] ++; // next mission
@@ -6931,7 +6931,7 @@ BOOL CMainDialog::NextMission()
m_sel[m_index] = 0; // first mission
}
- return TRUE;
+ return true;
}
diff --git a/src/ui/maindialog.h b/src/ui/maindialog.h
index fbc3f1e..4062c8d 100644
--- a/src/ui/maindialog.h
+++ b/src/ui/maindialog.h
@@ -62,7 +62,7 @@ public:
CMainDialog(CInstanceManager* iMan);
~CMainDialog();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void ChangePhase(Phase phase);
void SetSceneRead(char* name);
@@ -74,16 +74,16 @@ public:
char* RetSceneName();
int RetSceneRank();
char* RetSceneDir();
- BOOL RetSceneSoluce();
+ bool RetSceneSoluce();
char* RetSavegameDir();
char* RetPublicDir();
- BOOL RetTooltip();
- BOOL RetGlint();
- BOOL RetSoluce4();
- BOOL RetMovies();
- BOOL RetNiceReset();
- BOOL RetHimselfDamage();
+ bool RetTooltip();
+ bool RetGlint();
+ bool RetSoluce4();
+ bool RetMovies();
+ bool RetNiceReset();
+ bool RetHimselfDamage();
void SetUserDir(char *base, int rank);
void BuildSceneName(char *filename, char *base, int rank);
@@ -94,10 +94,10 @@ public:
void StartDeleteObject();
void StartDeleteGame(char *gamer);
void StartQuit();
- void StartDialog(FPOINT dim, BOOL bFire, BOOL bOK, BOOL bCancel);
+ void StartDialog(FPOINT dim, bool bFire, bool bOK, bool bCancel);
void FrameDialog(float rTime);
void StopDialog();
- BOOL IsDialog();
+ bool IsDialog();
void StartSuspend();
void StopSuspend();
@@ -105,13 +105,13 @@ public:
void SetupMemorize();
void SetupRecall();
- BOOL ReadGamerInfo();
- BOOL WriteGamerInfo();
+ bool ReadGamerInfo();
+ bool WriteGamerInfo();
void SetGamerInfoTry(int rank, int numTry);
int RetGamerInfoTry(int rank);
- void SetGamerInfoPassed(int rank, BOOL bPassed);
- BOOL RetGamerInfoPassed(int rank);
- BOOL NextMission();
+ void SetGamerInfoPassed(int rank, bool bPassed);
+ bool RetGamerInfoPassed(int rank);
+ bool NextMission();
void WriteGamerPerso(char *gamer);
void ReadGamerPerso(char *gamer);
@@ -119,7 +119,7 @@ public:
int RetGamerFace(char *gamer);
int RetGamerFace();
int RetGamerGlasses();
- BOOL RetGamerOnlyHead();
+ bool RetGamerOnlyHead();
float RetPersoAngle();
D3DCOLORVALUE RetGamerColorHair();
D3DCOLORVALUE RetGamerColorCombi();
@@ -131,7 +131,7 @@ public:
protected:
void GlintMove();
void FrameParticule(float rTime);
- void NiceParticule(FPOINT mouse, BOOL bPress);
+ void NiceParticule(FPOINT mouse, bool bPress);
void ReadNameList();
void UpdateNameList();
void UpdateNameEdit();
@@ -145,13 +145,13 @@ protected:
void FixPerso(int rank, int index);
void ColorPerso();
void DefPerso();
- BOOL IsIOReadScene();
+ bool IsIOReadScene();
void IOReadName();
void IOReadList();
void IOUpdateList();
void IODeleteScene();
- BOOL IOWriteScene();
- BOOL IOReadScene();
+ bool IOWriteScene();
+ bool IOReadScene();
int RetChapPassed();
void UpdateSceneChap(int &chap);
void UpdateSceneList(int chap, int &sel);
@@ -201,12 +201,12 @@ protected:
char m_stackRead[100]; // name of the scene to read
char m_sceneName[20]; // name of the scene to play
int m_sceneRank; // rank of the scene to play
- BOOL m_bSceneSoluce; // shows the solution
- BOOL m_bSimulSetup; // adjustment during the game
- BOOL m_accessEnable;
- BOOL m_accessMission;
- BOOL m_accessUser;
- BOOL m_bDeleteGamer;
+ bool m_bSceneSoluce; // shows the solution
+ bool m_bSimulSetup; // adjustment during the game
+ bool m_accessEnable;
+ bool m_accessMission;
+ bool m_accessUser;
+ bool m_bDeleteGamer;
int m_userTotal;
char m_userList[USERLISTMAX][100];
@@ -216,33 +216,33 @@ protected:
int m_setupSelDevice;
int m_setupSelMode;
- BOOL m_setupFull;
-
- BOOL m_bTooltip; // tooltips to be displayed?
- BOOL m_bGlint; // reflections on buttons?
- BOOL m_bRain; // rain in the interface?
- BOOL m_bSoluce4; // solutions in program 4?
- BOOL m_bMovies; // cinematics?
- BOOL m_bNiceReset; // for CTaskReset
- BOOL m_bHimselfDamage; // for shots
- BOOL m_bCameraScroll; // for CCamera
- BOOL m_bCameraInvertX; // for CCamera
- BOOL m_bCameraInvertY; // for CCamera
- BOOL m_bEffect; // for CCamera
+ bool m_setupFull;
+
+ bool m_bTooltip; // tooltips to be displayed?
+ bool m_bGlint; // reflections on buttons?
+ bool m_bRain; // rain in the interface?
+ bool m_bSoluce4; // solutions in program 4?
+ bool m_bMovies; // cinematics?
+ bool m_bNiceReset; // for CTaskReset
+ bool m_bHimselfDamage; // for shots
+ bool m_bCameraScroll; // for CCamera
+ bool m_bCameraInvertX; // for CCamera
+ bool m_bCameraInvertY; // for CCamera
+ bool m_bEffect; // for CCamera
FPOINT m_glintMouse;
float m_glintTime;
int m_loadingCounter;
- BOOL m_bDialog; // this dialogue?
- BOOL m_bDialogFire; // setting on fire?
- BOOL m_bDialogDelete;
+ bool m_bDialog; // this dialogue?
+ bool m_bDialogFire; // setting on fire?
+ bool m_bDialogDelete;
FPOINT m_dialogPos;
FPOINT m_dialogDim;
float m_dialogParti;
float m_dialogTime;
- BOOL m_bInitPause;
+ bool m_bInitPause;
CameraType m_initCamera;
int m_partiPhase[10];
diff --git a/src/ui/mainmap.cpp b/src/ui/mainmap.cpp
index 2366f8b..9575cbc 100644
--- a/src/ui/mainmap.cpp
+++ b/src/ui/mainmap.cpp
@@ -57,7 +57,7 @@ CMainMap::CMainMap(CInstanceManager* iMan)
m_engine = (CD3DEngine*)m_iMan->SearchInstance(CLASS_ENGINE);
m_mapMode = 1;
- m_bFixImage = FALSE;
+ m_bFixImage = false;
}
// Destructor of the application card.
@@ -108,7 +108,7 @@ void CMainMap::SetFixImage(char *filename)
if ( pm == 0 ) return;
pw->DeleteControl(EVENT_OBJECT_MAPZOOM);
- m_bFixImage = TRUE;
+ m_bFixImage = true;
pm->SetFixImage(filename);
}
@@ -133,7 +133,7 @@ void CMainMap::FloorColorMap(D3DCOLORVALUE floor, D3DCOLORVALUE water)
// Shows or hides the minimap.
-void CMainMap::ShowMap(BOOL bShow)
+void CMainMap::ShowMap(bool bShow)
{
CWindow* pw;
CMap* pm;
@@ -276,7 +276,7 @@ void CMainMap::ZoomMap()
// Enables or disables the card.
-void CMainMap::MapEnable(BOOL bEnable)
+void CMainMap::MapEnable(bool bEnable)
{
CWindow* pw;
CMap* pm;
@@ -300,7 +300,7 @@ void CMainMap::MapEnable(BOOL bEnable)
// Specifies the type of icon for the selected object.
-void CMainMap::SetToy(BOOL bToy)
+void CMainMap::SetToy(bool bToy)
{
CWindow* pw;
CMap* pm;
@@ -317,7 +317,7 @@ void CMainMap::SetToy(BOOL bToy)
// Specifies the parameters when using a still image.
void CMainMap::SetFixParam(float zoom, float ox, float oy, float angle,
- int mode, BOOL bDebug)
+ int mode, bool bDebug)
{
CWindow* pw;
CMap* pm;
@@ -354,14 +354,14 @@ void CMainMap::UpdateMap()
// Indicates if the mini-map is visible.
-BOOL CMainMap::RetShowMap()
+bool CMainMap::RetShowMap()
{
return ( m_mapMode != 0 );
}
// Indicates whether the mini-map displays a still image.
-BOOL CMainMap::RetFixImage()
+bool CMainMap::RetFixImage()
{
return m_bFixImage;
}
@@ -369,7 +369,7 @@ BOOL CMainMap::RetFixImage()
// The object is detected in the mini-map.
-CObject* CMainMap::DetectMap(FPOINT pos, BOOL &bInMap)
+CObject* CMainMap::DetectMap(FPOINT pos, bool &bInMap)
{
CWindow* pw;
CMap* pm;
@@ -377,7 +377,7 @@ CObject* CMainMap::DetectMap(FPOINT pos, BOOL &bInMap)
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW1);
if ( pw == 0 ) return 0;
- bInMap = FALSE;
+ bInMap = false;
pm = (CMap*)pw->SearchControl(EVENT_OBJECT_MAP);
if ( pm == 0 ) return 0;
return pm->DetectObject(pos, bInMap);
diff --git a/src/ui/mainmap.h b/src/ui/mainmap.h
index cd74f39..1c0e1fd 100644
--- a/src/ui/mainmap.h
+++ b/src/ui/mainmap.h
@@ -37,18 +37,18 @@ public:
void CreateMap();
void SetFixImage(char *filename);
void FloorColorMap(D3DCOLORVALUE floor, D3DCOLORVALUE water);
- void ShowMap(BOOL bShow);
+ void ShowMap(bool bShow);
void DimMap();
float RetZoomMap();
void ZoomMap(float zoom);
void ZoomMap();
- void MapEnable(BOOL bEnable);
- BOOL RetShowMap();
- BOOL RetFixImage();
- CObject* DetectMap(FPOINT pos, BOOL &bInMap);
+ void MapEnable(bool bEnable);
+ bool RetShowMap();
+ bool RetFixImage();
+ CObject* DetectMap(FPOINT pos, bool &bInMap);
void SetHilite(CObject* pObj);
- void SetToy(BOOL bToy);
- void SetFixParam(float zoom, float ox, float oy, float angle, int mode, BOOL bDebug);
+ void SetToy(bool bToy);
+ void SetFixParam(float zoom, float ox, float oy, float angle, int mode, bool bDebug);
protected:
void CenterMap();
@@ -60,7 +60,7 @@ protected:
CInterface* m_interface;
int m_mapMode;
- BOOL m_bFixImage;
+ bool m_bFixImage;
};
diff --git a/src/ui/mainshort.cpp b/src/ui/mainshort.cpp
index 7ac35af..c68f21c 100644
--- a/src/ui/mainshort.cpp
+++ b/src/ui/mainshort.cpp
@@ -61,7 +61,7 @@ CMainShort::~CMainShort()
-void CMainShort::SetMode(BOOL bBuilding)
+void CMainShort::SetMode(bool bBuilding)
{
m_bBuilding = bBuilding;
}
@@ -106,7 +106,7 @@ static EventMsg table_sc_em[20] =
// Interface creates shortcuts to the units.
-BOOL CMainShort::CreateShortcuts()
+bool CMainShort::CreateShortcuts()
{
CObject* pObj;
CControl* pc;
@@ -115,7 +115,7 @@ BOOL CMainShort::CreateShortcuts()
int i, rank, icon;
char name[100];
- if ( m_main->RetFixScene() ) return FALSE;
+ if ( m_main->RetFixScene() ) return false;
m_interface->DeleteControl(EVENT_OBJECT_MOVIELOCK);
m_interface->DeleteControl(EVENT_OBJECT_EDITLOCK);
@@ -136,14 +136,14 @@ BOOL CMainShort::CreateShortcuts()
!m_main->RetEditLock() ) // hangs during film?
{
m_interface->CreateShortcut(pos, dim, 7, EVENT_OBJECT_MOVIELOCK);
- return TRUE;
+ return true;
}
if ( !m_main->RetFreePhoto() &&
(m_main->RetEditLock() ||
m_engine->RetPause()) ) // hangs during edition?
{
m_interface->CreateShortcut(pos, dim, 6, EVENT_OBJECT_EDITLOCK);
- return TRUE;
+ return true;
}
rank = 0;
@@ -233,12 +233,12 @@ BOOL CMainShort::CreateShortcuts()
}
UpdateShortcuts();
- return TRUE;
+ return true;
}
// Updates the interface shortcuts to the units.
-BOOL CMainShort::UpdateShortcuts()
+bool CMainShort::UpdateShortcuts()
{
CControl* pc;
int i;
@@ -254,7 +254,7 @@ BOOL CMainShort::UpdateShortcuts()
pc->SetState(STATE_RUN, m_shortcuts[i]->IsProgram());
}
}
- return TRUE;
+ return true;
}
// Selects an object through a shortcut.
diff --git a/src/ui/mainshort.h b/src/ui/mainshort.h
index a4ff831..1b507d4 100644
--- a/src/ui/mainshort.h
+++ b/src/ui/mainshort.h
@@ -34,10 +34,10 @@ public:
CMainShort(CInstanceManager* iMan);
~CMainShort();
- void SetMode(BOOL bBuilding);
+ void SetMode(bool bBuilding);
void FlushShortcuts();
- BOOL CreateShortcuts();
- BOOL UpdateShortcuts();
+ bool CreateShortcuts();
+ bool UpdateShortcuts();
void SelectShortcut(EventMsg event);
void SelectNext();
CObject* DetectShort(FPOINT pos);
@@ -53,7 +53,7 @@ protected:
CRobotMain* m_main;
CObject* m_shortcuts[20];
- BOOL m_bBuilding;
+ bool m_bBuilding;
};
diff --git a/src/ui/map.cpp b/src/ui/map.cpp
index ceb663f..a4bdecb 100644
--- a/src/ui/map.cpp
+++ b/src/ui/map.cpp
@@ -43,13 +43,11 @@
CMap::CMap(CInstanceManager* iMan) : CControl(iMan)
{
- CControl::CControl(iMan);
-
m_main = (CRobotMain*)m_iMan->SearchInstance(CLASS_MAIN);
m_terrain = (CTerrain*)m_iMan->SearchInstance(CLASS_TERRAIN);
m_water = (CWater*)m_iMan->SearchInstance(CLASS_WATER);
- m_bEnable = TRUE;
+ m_bEnable = true;
m_time = 0.0f;
m_zoom = 2.0f;
m_offset.x = 0.0f;
@@ -71,8 +69,8 @@ CMap::CMap(CInstanceManager* iMan) : CControl(iMan)
m_fixImage[0] = 0;
m_mode = 0;
- m_bToy = FALSE;
- m_bDebug = FALSE;
+ m_bToy = false;
+ m_bDebug = false;
}
// Object's destructor.
@@ -84,12 +82,12 @@ CMap::~CMap()
// Creates a new button.
-BOOL CMap::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CMap::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
- return TRUE;
+ return true;
}
@@ -118,12 +116,12 @@ void CMap::SetMode(int mode)
// Specifies the type of icon for the selected object.
-void CMap::SetToy(BOOL bToy)
+void CMap::SetToy(bool bToy)
{
m_bToy = bToy;
}
-void CMap::SetDebug(BOOL bDebug)
+void CMap::SetDebug(bool bDebug)
{
m_bDebug = bDebug;
}
@@ -146,13 +144,13 @@ float CMap::RetZoom()
// Enables or disables the card.
-void CMap::SetEnable(BOOL bEnable)
+void CMap::SetEnable(bool bEnable)
{
m_bEnable = bEnable;
SetState(STATE_DEAD, !bEnable);
}
-BOOL CMap::RetEnable()
+bool CMap::RetEnable()
{
return m_bEnable;
}
@@ -182,7 +180,7 @@ void CMap::SetFixImage(char *filename)
// Whether to use a still image.
-BOOL CMap::RetFixImage()
+bool CMap::RetFixImage()
{
return (m_fixImage[0] != 0);
}
@@ -190,11 +188,11 @@ BOOL CMap::RetFixImage()
// Management of an event.
-BOOL CMap::EventProcess(const Event &event)
+bool CMap::EventProcess(const Event &event)
{
- BOOL bInMap;
+ bool bInMap;
- if ( (m_state & STATE_VISIBLE) == 0 ) return TRUE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return true;
CControl::EventProcess(event);
@@ -217,11 +215,11 @@ BOOL CMap::EventProcess(const Event &event)
if ( CControl::Detect(event.pos) )
{
SelectObject(event.pos);
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
// Adjusts the offset to not exceed the card.
@@ -263,18 +261,18 @@ void CMap::SetHilite(CObject* pObj)
// Detects an object in the map.
-CObject* CMap::DetectObject(FPOINT pos, BOOL &bInMap)
+CObject* CMap::DetectObject(FPOINT pos, bool &bInMap)
{
float dist, min;
int i, best;
- bInMap = FALSE;
+ bInMap = false;
if ( pos.x < m_pos.x ||
pos.y < m_pos.y ||
pos.x > m_pos.x+m_dim.x ||
pos.y > m_pos.y+m_dim.y ) return 0;
- bInMap = TRUE;
+ bInMap = true;
pos.x = (pos.x-m_pos.x)/m_dim.x*256.0f;
pos.y = (pos.y-m_pos.y)/m_dim.y*256.0f; // 0..256
@@ -306,7 +304,7 @@ CObject* CMap::DetectObject(FPOINT pos, BOOL &bInMap)
void CMap::SelectObject(FPOINT pos)
{
CObject *pObj;
- BOOL bInMap;
+ bool bInMap;
pObj = DetectObject(pos, bInMap);
if ( pObj != 0 )
@@ -365,25 +363,25 @@ void CMap::Draw()
for ( i=0 ; i<m_totalFix ; i++ ) // fixed objects:
{
if ( i == m_hiliteRank ) continue;
- DrawObject(m_map[i].pos, m_map[i].dir, m_map[i].type, m_map[i].color, FALSE, FALSE);
+ DrawObject(m_map[i].pos, m_map[i].dir, m_map[i].type, m_map[i].color, false, false);
}
for ( i=MAPMAXOBJECT-2 ; i>m_totalMove ; i-- ) // moving objects:
{
if ( i == m_hiliteRank ) continue;
- DrawObject(m_map[i].pos, m_map[i].dir, m_map[i].type, m_map[i].color, FALSE, FALSE);
+ DrawObject(m_map[i].pos, m_map[i].dir, m_map[i].type, m_map[i].color, false, false);
}
i = MAPMAXOBJECT-1;
if ( m_map[i].bUsed && i != m_hiliteRank ) // selection:
{
- DrawObject(m_map[i].pos, m_map[i].dir, m_map[i].type, m_map[i].color, TRUE, FALSE);
+ DrawObject(m_map[i].pos, m_map[i].dir, m_map[i].type, m_map[i].color, true, false);
}
if ( m_hiliteRank != -1 && m_map[m_hiliteRank].bUsed )
{
i = m_hiliteRank;
- DrawObject(m_map[i].pos, m_map[i].dir, m_map[i].type, m_map[i].color, FALSE, TRUE);
+ DrawObject(m_map[i].pos, m_map[i].dir, m_map[i].type, m_map[i].color, false, true);
DrawHilite(m_map[i].pos);
}
}
@@ -439,7 +437,7 @@ void CMap::DrawFocus(FPOINT pos, float dir, ObjectType type, MapColor color)
FPOINT p0, p1, p2, uv1, uv2, rel;
float aMin, aMax, aOct, focus, a;
float limit[5];
- BOOL bEnding;
+ bool bEnding;
int quart;
if ( m_bToy || m_fixImage[0] != 0 ) return; // map with still image?
@@ -489,7 +487,7 @@ void CMap::DrawFocus(FPOINT pos, float dir, ObjectType type, MapColor color)
m_engine->SetTexture("button2.tga");
m_engine->SetState(D3DSTATETTw);
- bEnding = FALSE;
+ bEnding = false;
do
{
quart ++;
@@ -498,7 +496,7 @@ void CMap::DrawFocus(FPOINT pos, float dir, ObjectType type, MapColor color)
if ( aOct >= aMax-CHOUIA )
{
aOct = aMax;
- bEnding = TRUE;
+ bEnding = true;
}
p0 = pos;
@@ -517,19 +515,19 @@ void CMap::DrawFocus(FPOINT pos, float dir, ObjectType type, MapColor color)
// Draw an object.
void CMap::DrawObject(FPOINT pos, float dir, ObjectType type, MapColor color,
- BOOL bSelect, BOOL bHilite)
+ bool bSelect, bool bHilite)
{
FPOINT p1, p2, p3, p4, p5, dim, uv1, uv2;
- BOOL bOut, bUp, bDown, bLeft, bRight;
+ bool bOut, bUp, bDown, bLeft, bRight;
pos.x = (pos.x-m_offset.x)*(m_zoom*0.5f)/m_half+0.5f;
pos.y = (pos.y-m_offset.y)*(m_zoom*0.5f)/m_half+0.5f;
- bOut = bUp = bDown = bLeft = bRight = FALSE;
- if ( pos.x < 0.06f ) { pos.x = 0.02f; bOut = bLeft = TRUE; }
- if ( pos.y < 0.06f ) { pos.y = 0.02f; bOut = bDown = TRUE; }
- if ( pos.x > 0.94f ) { pos.x = 0.98f; bOut = bRight = TRUE; }
- if ( pos.y > 0.94f ) { pos.y = 0.98f; bOut = bUp = TRUE; }
+ bOut = bUp = bDown = bLeft = bRight = false;
+ if ( pos.x < 0.06f ) { pos.x = 0.02f; bOut = bLeft = true; }
+ if ( pos.y < 0.06f ) { pos.y = 0.02f; bOut = bDown = true; }
+ if ( pos.x > 0.94f ) { pos.x = 0.98f; bOut = bRight = true; }
+ if ( pos.y > 0.94f ) { pos.y = 0.98f; bOut = bUp = true; }
pos.x = m_mapPos.x+m_mapDim.x*pos.x;
pos.y = m_mapPos.y+m_mapDim.y*pos.y;
@@ -619,13 +617,13 @@ void CMap::DrawObject(FPOINT pos, float dir, ObjectType type, MapColor color,
{
dim.x *= 3.0f;
dim.y *= 3.0f;
- bHilite = TRUE;
+ bHilite = true;
}
if ( type == OBJECT_TEEN34 ) // stone?
{
dim.x *= 2.0f;
dim.y *= 2.0f;
- bHilite = TRUE;
+ bHilite = true;
}
if ( color == MAPCOLOR_MOVE && bSelect )
@@ -729,7 +727,7 @@ void CMap::DrawObject(FPOINT pos, float dir, ObjectType type, MapColor color,
{
if ( m_bRadar )
{
- DrawObjectIcon(pos, dim, color, type, TRUE);
+ DrawObjectIcon(pos, dim, color, type, true);
}
}
@@ -788,7 +786,7 @@ void CMap::DrawObject(FPOINT pos, float dir, ObjectType type, MapColor color,
// Draws the icon of an object.
void CMap::DrawObjectIcon(FPOINT pos, FPOINT dim, MapColor color,
- ObjectType type, BOOL bHilite)
+ ObjectType type, bool bHilite)
{
FPOINT ppos, ddim, uv1, uv2;
float dp;
@@ -898,18 +896,18 @@ void CMap::DrawObjectIcon(FPOINT pos, FPOINT dim, MapColor color,
void CMap::DrawHilite(FPOINT pos)
{
FPOINT dim, uv1, uv2;
- BOOL bOut, bUp, bDown, bLeft, bRight;
+ bool bOut, bUp, bDown, bLeft, bRight;
if ( m_bToy || m_fixImage[0] != 0 ) return; // map with still image?
pos.x = (pos.x-m_offset.x)*(m_zoom*0.5f)/m_half+0.5f;
pos.y = (pos.y-m_offset.y)*(m_zoom*0.5f)/m_half+0.5f;
- bOut = bUp = bDown = bLeft = bRight = FALSE;
- if ( pos.x < 0.06f ) { pos.x = 0.02f; bOut = bLeft = TRUE; }
- if ( pos.y < 0.06f ) { pos.y = 0.02f; bOut = bDown = TRUE; }
- if ( pos.x > 0.94f ) { pos.x = 0.98f; bOut = bRight = TRUE; }
- if ( pos.y > 0.94f ) { pos.y = 0.98f; bOut = bUp = TRUE; }
+ bOut = bUp = bDown = bLeft = bRight = false;
+ if ( pos.x < 0.06f ) { pos.x = 0.02f; bOut = bLeft = true; }
+ if ( pos.y < 0.06f ) { pos.y = 0.02f; bOut = bDown = true; }
+ if ( pos.x > 0.94f ) { pos.x = 0.98f; bOut = bRight = true; }
+ if ( pos.y > 0.94f ) { pos.y = 0.98f; bOut = bUp = true; }
pos.x = m_mapPos.x+m_mapDim.x*pos.x;
pos.y = m_mapPos.y+m_mapDim.y*pos.y;
@@ -1047,7 +1045,7 @@ void CMap::UpdateTerrain()
if ( pos.x >= -m_half && pos.x <= m_half &&
pos.z >= -m_half && pos.z <= m_half )
{
- level = m_terrain->RetFloorLevel(pos, TRUE)/scale;
+ level = m_terrain->RetFloorLevel(pos, true)/scale;
}
else
{
@@ -1107,7 +1105,7 @@ void CMap::UpdateTerrain(int bx, int by, int ex, int ey)
if ( pos.x >= -m_half && pos.x <= m_half &&
pos.z >= -m_half && pos.z <= m_half )
{
- level = m_terrain->RetFloorLevel(pos, TRUE)/scale;
+ level = m_terrain->RetFloorLevel(pos, true)/scale;
}
else
{
@@ -1152,7 +1150,7 @@ void CMap::FlushObject()
for ( i=0 ; i<MAPMAXOBJECT ; i++ )
{
- m_map[i].bUsed = FALSE;
+ m_map[i].bUsed = false;
}
}
@@ -1188,7 +1186,7 @@ void CMap::UpdateObject(CObject* pObj)
if ( type == OBJECT_RADAR )
{
- m_bRadar = TRUE; // radar exists
+ m_bRadar = true; // radar exists
}
color = MAPCOLOR_NULL;
@@ -1310,7 +1308,7 @@ void CMap::UpdateObject(CObject* pObj)
m_map[MAPMAXOBJECT-1].pos.x = pos.x;
m_map[MAPMAXOBJECT-1].pos.y = pos.z;
m_map[MAPMAXOBJECT-1].dir = dir;
- m_map[MAPMAXOBJECT-1].bUsed = TRUE;
+ m_map[MAPMAXOBJECT-1].bUsed = true;
}
else
{
@@ -1323,7 +1321,7 @@ void CMap::UpdateObject(CObject* pObj)
m_map[m_totalFix].pos.x = pos.x;
m_map[m_totalFix].pos.y = pos.z;
m_map[m_totalFix].dir = dir;
- m_map[m_totalFix].bUsed = TRUE;
+ m_map[m_totalFix].bUsed = true;
m_totalFix ++;
}
else
@@ -1334,7 +1332,7 @@ void CMap::UpdateObject(CObject* pObj)
m_map[m_totalMove].pos.x = pos.x;
m_map[m_totalMove].pos.y = pos.z;
m_map[m_totalMove].dir = dir;
- m_map[m_totalMove].bUsed = TRUE;
+ m_map[m_totalMove].bUsed = true;
m_totalMove --;
}
}
diff --git a/src/ui/map.h b/src/ui/map.h
index 30e1b2b..0a10dbf 100644
--- a/src/ui/map.h
+++ b/src/ui/map.h
@@ -67,27 +67,27 @@ public:
CMap(CInstanceManager* iMan);
~CMap();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool EventProcess(const Event &event);
void Draw();
void UpdateTerrain();
void UpdateTerrain(int bx, int by, int ex, int ey);
void SetFixImage(char *filename);
- BOOL RetFixImage();
+ bool RetFixImage();
void SetOffset(float ox, float oy);
void SetAngle(float angle);
void SetMode(int mode);
- void SetToy(BOOL bToy);
- void SetDebug(BOOL bDebug);
+ void SetToy(bool bToy);
+ void SetDebug(bool bDebug);
void SetZoom(float value);
float RetZoom();
- void SetEnable(BOOL bEnable);
- BOOL RetEnable();
+ void SetEnable(bool bEnable);
+ bool RetEnable();
void SetFloorColor(D3DCOLORVALUE color);
void SetWaterColor(D3DCOLORVALUE color);
@@ -95,7 +95,7 @@ public:
void FlushObject();
void UpdateObject(CObject* pObj);
- CObject* DetectObject(FPOINT pos, BOOL &bInMap);
+ CObject* DetectObject(FPOINT pos, bool &bInMap);
void SetHilite(CObject* pObj);
protected:
@@ -103,8 +103,8 @@ protected:
void SelectObject(FPOINT pos);
FPOINT MapInter(FPOINT pos, float dir);
void DrawFocus(FPOINT pos, float dir, ObjectType type, MapColor color);
- void DrawObject(FPOINT pos, float dir, ObjectType type, MapColor color, BOOL bSelect, BOOL bHilite);
- void DrawObjectIcon(FPOINT pos, FPOINT dim, MapColor color, ObjectType type, BOOL bHilite);
+ void DrawObject(FPOINT pos, float dir, ObjectType type, MapColor color, bool bSelect, bool bHilite);
+ void DrawObjectIcon(FPOINT pos, FPOINT dim, MapColor color, ObjectType type, bool bHilite);
void DrawHilite(FPOINT pos);
void DrawTriangle(FPOINT p1, FPOINT p2, FPOINT p3, FPOINT uv1, FPOINT uv2);
void DrawPenta(FPOINT p1, FPOINT p2, FPOINT p3, FPOINT p4, FPOINT p5, FPOINT uv1, FPOINT uv2);
@@ -115,7 +115,7 @@ protected:
CWater* m_water;
CRobotMain* m_main;
- BOOL m_bEnable;
+ bool m_bEnable;
float m_time;
float m_half;
float m_zoom;
@@ -129,11 +129,11 @@ protected:
int m_hiliteRank;
FPOINT m_mapPos;
FPOINT m_mapDim;
- BOOL m_bRadar;
+ bool m_bRadar;
char m_fixImage[100];
int m_mode;
- BOOL m_bToy;
- BOOL m_bDebug;
+ bool m_bToy;
+ bool m_bDebug;
};
diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp
index eb61bd0..7cc8304 100644
--- a/src/ui/scroll.cpp
+++ b/src/ui/scroll.cpp
@@ -49,7 +49,7 @@ CScroll::CScroll(CInstanceManager* iMan) : CControl(iMan)
m_eventUp = EVENT_NULL;
m_eventDown = EVENT_NULL;
- m_bCapture = FALSE;
+ m_bCapture = false;
}
// Object's destructor.
@@ -63,13 +63,13 @@ CScroll::~CScroll()
// Creates a new button.
-BOOL CScroll::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CScroll::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
MoveAdjust();
- return TRUE;
+ return true;
}
@@ -107,7 +107,7 @@ void CScroll::MoveAdjust()
m_buttonUp = new CButton(m_iMan);
pc = (CButton*)m_buttonUp;
pc->Create(FPOINT(0.0f, 0.0f), FPOINT(0.0f, 0.0f), 49, EVENT_NULL);
- pc->SetRepeat(TRUE);
+ pc->SetRepeat(true);
m_eventUp = pc->RetEventMsg();
}
@@ -116,7 +116,7 @@ void CScroll::MoveAdjust()
m_buttonDown = new CButton(m_iMan);
pc = (CButton*)m_buttonDown;
pc->Create(FPOINT(0.0f, 0.0f), FPOINT(0.0f, 0.0f), 50, EVENT_NULL);
- pc->SetRepeat(TRUE);
+ pc->SetRepeat(true);
m_eventDown = pc->RetEventMsg();
}
}
@@ -163,7 +163,7 @@ void CScroll::AdjustGlint()
-BOOL CScroll::SetState(int state, BOOL bState)
+bool CScroll::SetState(int state, bool bState)
{
if ( state & STATE_ENABLE )
{
@@ -174,7 +174,7 @@ BOOL CScroll::SetState(int state, BOOL bState)
return CControl::SetState(state, bState);
}
-BOOL CScroll::SetState(int state)
+bool CScroll::SetState(int state)
{
if ( state & STATE_ENABLE )
{
@@ -185,7 +185,7 @@ BOOL CScroll::SetState(int state)
return CControl::SetState(state);
}
-BOOL CScroll::ClearState(int state)
+bool CScroll::ClearState(int state)
{
if ( state & STATE_ENABLE )
{
@@ -199,7 +199,7 @@ BOOL CScroll::ClearState(int state)
// Management of an event.
-BOOL CScroll::EventProcess(const Event &event)
+bool CScroll::EventProcess(const Event &event)
{
FPOINT pos, dim;
float hButton, h, value;
@@ -208,11 +208,11 @@ BOOL CScroll::EventProcess(const Event &event)
if ( m_buttonUp != 0 && !m_bCapture )
{
- if ( !m_buttonUp->EventProcess(event) ) return FALSE;
+ if ( !m_buttonUp->EventProcess(event) ) return false;
}
if ( m_buttonDown != 0 && !m_bCapture )
{
- if ( !m_buttonDown->EventProcess(event) ) return FALSE;
+ if ( !m_buttonDown->EventProcess(event) ) return false;
}
if ( event.event == m_eventUp && m_step > 0.0f )
@@ -263,7 +263,7 @@ BOOL CScroll::EventProcess(const Event &event)
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
}
- m_bCapture = TRUE;
+ m_bCapture = true;
m_pressPos = event.pos;
m_pressValue = m_visibleValue;
}
@@ -292,7 +292,7 @@ BOOL CScroll::EventProcess(const Event &event)
if ( event.event == EVENT_LBUTTONUP && m_bCapture )
{
- m_bCapture = FALSE;
+ m_bCapture = false;
}
if ( event.event == EVENT_KEYDOWN &&
@@ -314,7 +314,7 @@ BOOL CScroll::EventProcess(const Event &event)
m_event->AddEvent(newEvent);
}
- return TRUE;
+ return true;
}
diff --git a/src/ui/scroll.h b/src/ui/scroll.h
index 7975317..738581a 100644
--- a/src/ui/scroll.h
+++ b/src/ui/scroll.h
@@ -37,16 +37,16 @@ public:
CScroll(CInstanceManager* iMan);
~CScroll();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
void SetPos(FPOINT pos);
void SetDim(FPOINT dim);
- BOOL SetState(int state, BOOL bState);
- BOOL SetState(int state);
- BOOL ClearState(int state);
+ bool SetState(int state, bool bState);
+ bool SetState(int state);
+ bool ClearState(int state);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
void SetVisibleValue(float value);
@@ -71,7 +71,7 @@ protected:
float m_visibleRatio;
float m_step;
- BOOL m_bCapture;
+ bool m_bCapture;
FPOINT m_pressPos;
float m_pressValue;
diff --git a/src/ui/shortcut.cpp b/src/ui/shortcut.cpp
index adf22eb..7022bf2 100644
--- a/src/ui/shortcut.cpp
+++ b/src/ui/shortcut.cpp
@@ -50,18 +50,18 @@ CShortcut::~CShortcut()
// Creates a new button.
-BOOL CShortcut::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CShortcut::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CShortcut::EventProcess(const Event &event)
+bool CShortcut::EventProcess(const Event &event)
{
CControl::EventProcess(event);
@@ -77,11 +77,11 @@ BOOL CShortcut::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
diff --git a/src/ui/shortcut.h b/src/ui/shortcut.h
index 4535e4b..0b36c84 100644
--- a/src/ui/shortcut.h
+++ b/src/ui/shortcut.h
@@ -32,9 +32,9 @@ public:
CShortcut(CInstanceManager* iMan);
~CShortcut();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
diff --git a/src/ui/slider.cpp b/src/ui/slider.cpp
index 34bc0e3..f01cd3f 100644
--- a/src/ui/slider.cpp
+++ b/src/ui/slider.cpp
@@ -54,12 +54,12 @@ CSlider::CSlider(CInstanceManager* iMan) : CControl(iMan)
m_step = 0.0f;
m_marginButton = 0.0f;
- m_bHoriz = FALSE;
+ m_bHoriz = false;
m_eventUp = EVENT_NULL;
m_eventDown = EVENT_NULL;
- m_bCapture = FALSE;
+ m_bCapture = false;
}
// Object's destructor.
@@ -73,13 +73,13 @@ CSlider::~CSlider()
// Creates a new button.
-BOOL CSlider::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CSlider::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
MoveAdjust();
- return TRUE;
+ return true;
}
@@ -119,7 +119,7 @@ void CSlider::MoveAdjust()
{
m_buttonLeft = new CButton(m_iMan);
m_buttonLeft->Create(FPOINT(0.0f, 0.0f), FPOINT(0.0f, 0.0f), m_bHoriz?55:49, EVENT_NULL); // </^
- m_buttonLeft->SetRepeat(TRUE);
+ m_buttonLeft->SetRepeat(true);
if ( m_state & STATE_SHADOW ) m_buttonLeft->SetState(STATE_SHADOW);
m_eventUp = m_buttonLeft->RetEventMsg();
}
@@ -128,7 +128,7 @@ void CSlider::MoveAdjust()
{
m_buttonRight = new CButton(m_iMan);
m_buttonRight->Create(FPOINT(0.0f, 0.0f), FPOINT(0.0f, 0.0f), m_bHoriz?48:50, EVENT_NULL); // >/v
- m_buttonRight->SetRepeat(TRUE);
+ m_buttonRight->SetRepeat(true);
if ( m_state & STATE_SHADOW ) m_buttonRight->SetState(STATE_SHADOW);
m_eventDown = m_buttonRight->RetEventMsg();
}
@@ -206,7 +206,7 @@ void CSlider::AdjustGlint()
}
-BOOL CSlider::SetState(int state, BOOL bState)
+bool CSlider::SetState(int state, bool bState)
{
if ( (state & STATE_ENABLE) ||
(state & STATE_SHADOW) )
@@ -218,7 +218,7 @@ BOOL CSlider::SetState(int state, BOOL bState)
return CControl::SetState(state, bState);
}
-BOOL CSlider::SetState(int state)
+bool CSlider::SetState(int state)
{
if ( (state & STATE_ENABLE) ||
(state & STATE_SHADOW) )
@@ -230,7 +230,7 @@ BOOL CSlider::SetState(int state)
return CControl::SetState(state);
}
-BOOL CSlider::ClearState(int state)
+bool CSlider::ClearState(int state)
{
if ( (state & STATE_ENABLE) ||
(state & STATE_SHADOW) )
@@ -245,22 +245,22 @@ BOOL CSlider::ClearState(int state)
// Management of an event.
-BOOL CSlider::EventProcess(const Event &event)
+bool CSlider::EventProcess(const Event &event)
{
FPOINT pos, dim;
float value;
- if ( (m_state & STATE_VISIBLE) == 0 ) return TRUE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return true;
CControl::EventProcess(event);
if ( m_buttonLeft != 0 && !m_bCapture )
{
- if ( !m_buttonLeft->EventProcess(event) ) return FALSE;
+ if ( !m_buttonLeft->EventProcess(event) ) return false;
}
if ( m_buttonRight != 0 && !m_bCapture )
{
- if ( !m_buttonRight->EventProcess(event) ) return FALSE;
+ if ( !m_buttonRight->EventProcess(event) ) return false;
}
if ( event.event == m_eventUp && m_step > 0.0f )
@@ -316,7 +316,7 @@ BOOL CSlider::EventProcess(const Event &event)
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- m_bCapture = TRUE;
+ m_bCapture = true;
m_pressPos = event.pos;
m_pressValue = m_visibleValue;
}
@@ -354,7 +354,7 @@ BOOL CSlider::EventProcess(const Event &event)
if ( event.event == EVENT_LBUTTONUP && m_bCapture )
{
- m_bCapture = FALSE;
+ m_bCapture = false;
}
if ( event.event == EVENT_KEYDOWN &&
@@ -376,7 +376,7 @@ BOOL CSlider::EventProcess(const Event &event)
m_event->AddEvent(newEvent);
}
- return TRUE;
+ return true;
}
diff --git a/src/ui/slider.h b/src/ui/slider.h
index 91199ed..8d1033f 100644
--- a/src/ui/slider.h
+++ b/src/ui/slider.h
@@ -34,16 +34,16 @@ public:
CSlider(CInstanceManager* iMan);
~CSlider();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
void SetPos(FPOINT pos);
void SetDim(FPOINT dim);
- BOOL SetState(int state, BOOL bState);
- BOOL SetState(int state);
- BOOL ClearState(int state);
+ bool SetState(int state, bool bState);
+ bool SetState(int state);
+ bool ClearState(int state);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
void SetLimit(float min, float max);
@@ -68,10 +68,10 @@ protected:
float m_visibleValue;
float m_step;
- BOOL m_bHoriz;
+ bool m_bHoriz;
float m_marginButton;
- BOOL m_bCapture;
+ bool m_bCapture;
FPOINT m_pressPos;
float m_pressValue;
diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp
index d169696..1cc522b 100644
--- a/src/ui/studio.cpp
+++ b/src/ui/studio.cpp
@@ -72,12 +72,12 @@ CStudio::CStudio(CInstanceManager* iMan)
m_camera = (CCamera*)m_iMan->SearchInstance(CLASS_CAMERA);
m_sound = (CSound*)m_iMan->SearchInstance(CLASS_SOUND);
- m_bEditMaximized = FALSE;
- m_bEditMinimized = FALSE;
+ m_bEditMaximized = false;
+ m_bEditMinimized = false;
m_time = 0.0f;
- m_bRealTime = TRUE;
- m_bRunning = FALSE;
+ m_bRealTime = true;
+ m_bRunning = false;
m_fixInfoTextTime = 0.0f;
m_helpFilename[0] = 0;
m_dialog = SD_NULL;
@@ -93,7 +93,7 @@ CStudio::~CStudio()
// Management of an event.
-BOOL CStudio::EventProcess(const Event &event)
+bool CStudio::EventProcess(const Event &event)
{
CWindow* pw;
CEdit* edit;
@@ -111,10 +111,10 @@ BOOL CStudio::EventProcess(const Event &event)
}
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW3);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
edit = (CEdit*)pw->SearchControl(EVENT_STUDIO_EDIT);
- if ( edit == 0 ) return FALSE;
+ if ( edit == 0 ) return false;
if ( event.event == pw->RetEventMsgClose() )
{
@@ -167,7 +167,7 @@ BOOL CStudio::EventProcess(const Event &event)
if ( event.event == EVENT_STUDIO_SIZE ) // size?
{
slider = (CSlider*)pw->SearchControl(EVENT_STUDIO_SIZE);
- if ( slider == 0 ) return FALSE;
+ if ( slider == 0 ) return false;
m_main->SetFontSize(9.0f+slider->RetVisibleValue()*6.0f);
ViewEditScript();
}
@@ -175,12 +175,12 @@ BOOL CStudio::EventProcess(const Event &event)
if ( event.event == EVENT_STUDIO_TOOL && // instructions?
m_dialog == SD_NULL )
{
- m_main->StartDisplayInfo(SATCOM_HUSTON, FALSE);
+ m_main->StartDisplayInfo(SATCOM_HUSTON, false);
}
if ( event.event == EVENT_STUDIO_HELP && // help?
m_dialog == SD_NULL )
{
- m_main->StartDisplayInfo(SATCOM_PROG, FALSE);
+ m_main->StartDisplayInfo(SATCOM_PROG, false);
}
if ( event.event == EVENT_STUDIO_COMPILE ) // compile?
@@ -190,12 +190,12 @@ BOOL CStudio::EventProcess(const Event &event)
if ( m_script->GetScript(edit) ) // compile
{
GetResource(RES_TEXT, RT_STUDIO_COMPOK, res);
- SetInfoText(res, FALSE);
+ SetInfoText(res, false);
}
else
{
m_script->GetError(buffer);
- SetInfoText(buffer, FALSE);
+ SetInfoText(buffer, false);
}
}
@@ -211,7 +211,7 @@ BOOL CStudio::EventProcess(const Event &event)
{
if ( m_script->GetScript(edit) ) // compile
{
- SetInfoText("", FALSE);
+ SetInfoText("", false);
Event newEvent = event;
newEvent.event = EVENT_OBJECT_PROGSTART;
@@ -221,7 +221,7 @@ BOOL CStudio::EventProcess(const Event &event)
{
char buffer[100];
m_script->GetError(buffer);
- SetInfoText(buffer, FALSE);
+ SetInfoText(buffer, false);
}
}
}
@@ -265,8 +265,8 @@ BOOL CStudio::EventProcess(const Event &event)
{
m_editFinalPos = m_main->RetWindowPos();
m_editFinalDim = m_main->RetWindowDim();
- m_bEditMinimized = FALSE;
- m_bEditMaximized = FALSE;
+ m_bEditMinimized = false;
+ m_bEditMaximized = false;
}
else
{
@@ -274,8 +274,8 @@ BOOL CStudio::EventProcess(const Event &event)
m_editFinalPos.y = -0.44f;
m_editFinalDim.x = 1.00f;
m_editFinalDim.y = 0.50f;
- m_bEditMinimized = TRUE;
- m_bEditMaximized = FALSE;
+ m_bEditMinimized = true;
+ m_bEditMaximized = false;
}
m_main->SetEditFull(m_bEditMaximized);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW3);
@@ -291,8 +291,8 @@ BOOL CStudio::EventProcess(const Event &event)
{
m_editFinalPos = m_main->RetWindowPos();
m_editFinalDim = m_main->RetWindowDim();
- m_bEditMinimized = FALSE;
- m_bEditMaximized = FALSE;
+ m_bEditMinimized = false;
+ m_bEditMaximized = false;
}
else
{
@@ -300,8 +300,8 @@ BOOL CStudio::EventProcess(const Event &event)
m_editFinalPos.y = 0.00f;
m_editFinalDim.x = 1.00f;
m_editFinalDim.y = 1.00f;
- m_bEditMinimized = FALSE;
- m_bEditMaximized = TRUE;
+ m_bEditMinimized = false;
+ m_bEditMaximized = true;
}
m_main->SetEditFull(m_bEditMaximized);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW3);
@@ -312,7 +312,7 @@ BOOL CStudio::EventProcess(const Event &event)
}
}
- return TRUE;
+ return true;
}
@@ -338,7 +338,7 @@ float Evolution(float final, float actual, float time)
// Makes the studio evolve as time elapsed.
-BOOL CStudio::EventFrame(const Event &event)
+bool CStudio::EventFrame(const Event &event)
{
CWindow* pw;
CEdit* edit;
@@ -351,21 +351,21 @@ BOOL CStudio::EventFrame(const Event &event)
m_fixInfoTextTime -= event.rTime;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW3);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
edit = (CEdit*)pw->SearchControl(EVENT_STUDIO_EDIT);
- if ( edit == 0 ) return FALSE;
+ if ( edit == 0 ) return false;
list = (CList*)pw->SearchControl(EVENT_STUDIO_LIST);
- if ( list == 0 ) return FALSE;
+ if ( list == 0 ) return false;
if ( !m_script->IsRunning() && m_bRunning ) // stop?
{
- m_bRunning = FALSE;
+ m_bRunning = false;
UpdateFlux(); // stop
AdjustEditScript();
GetResource(RES_TEXT, RT_STUDIO_PROGSTOP, res);
- SetInfoText(res, FALSE);
+ SetInfoText(res, false);
Event newEvent = event;
newEvent.event = EVENT_OBJECT_PROGSTOP;
@@ -374,7 +374,7 @@ BOOL CStudio::EventFrame(const Event &event)
if ( m_script->IsRunning() && !m_bRunning ) // starting?
{
- m_bRunning = TRUE;
+ m_bRunning = true;
UpdateFlux(); // run
AdjustEditScript();
}
@@ -411,13 +411,13 @@ BOOL CStudio::EventFrame(const Event &event)
AdjustEditScript();
}
- return TRUE;
+ return true;
}
// Indicates whether a character is part of a word.
-BOOL IsToken(int character)
+bool IsToken(int character)
{
char c;
@@ -465,7 +465,7 @@ void CStudio::SearchToken(CEdit* edit)
if ( level > 0 )
{
m_helpFilename[0] = 0;
- SetInfoText("", TRUE);
+ SetInfoText("", true);
return;
}
while ( i > 0 )
@@ -513,7 +513,7 @@ void CStudio::SearchToken(CEdit* edit)
if ( strcmp(token, text) == 0 )
{
strcpy(m_helpFilename, RetHelpFilename(type));
- SetInfoText(token, TRUE);
+ SetInfoText(token, true);
return;
}
}
@@ -523,7 +523,7 @@ void CStudio::SearchToken(CEdit* edit)
if ( strcmp(token, text) == 0 )
{
strcpy(m_helpFilename, RetHelpFilename(type));
- SetInfoText(token, TRUE);
+ SetInfoText(token, true);
return;
}
}
@@ -533,11 +533,11 @@ void CStudio::SearchToken(CEdit* edit)
text = RetHelpText(token);
if ( text[0] == 0 && m_helpFilename[0] != 0 )
{
- SetInfoText(token, TRUE);
+ SetInfoText(token, true);
}
else
{
- SetInfoText(text, TRUE);
+ SetInfoText(text, true);
}
}
@@ -564,8 +564,8 @@ void CStudio::StartEditScript(CScript *script, char* name, int rank)
m_script = script;
m_rank = rank;
- m_main->SetEditLock(TRUE, TRUE);
- m_main->SetEditFull(FALSE);
+ m_main->SetEditLock(true, true);
+ m_main->SetEditFull(false);
m_bInitPause = m_engine->RetPause();
m_main->SetSpeed(1.0f);
m_editCamera = m_camera->RetType();
@@ -586,9 +586,9 @@ void CStudio::StartEditScript(CScript *script, char* name, int rank)
pw = m_interface->CreateWindows(pos, dim, 8, EVENT_WINDOW3);
if ( pw == 0 ) return;
pw->SetState(STATE_SHADOW);
- pw->SetRedim(TRUE); // before SetName!
- pw->SetMovable(TRUE);
- pw->SetClosable(TRUE);
+ pw->SetRedim(true); // before SetName!
+ pw->SetMovable(true);
+ pw->SetClosable(true);
GetResource(RES_TEXT, RT_STUDIO_TITLE, res);
pw->SetName(res);
pw->SetMinDim(FPOINT(0.49f, 0.50f));
@@ -599,12 +599,12 @@ void CStudio::StartEditScript(CScript *script, char* name, int rank)
edit = pw->CreateEdit(pos, dim, 0, EVENT_STUDIO_EDIT);
if ( edit == 0 ) return;
edit->SetState(STATE_SHADOW);
- edit->SetInsideScroll(FALSE);
-//? if ( m_bRunning ) edit->SetEdit(FALSE);
+ edit->SetInsideScroll(false);
+//? if ( m_bRunning ) edit->SetEdit(false);
edit->SetMaxChar(EDITSTUDIOMAX);
edit->SetFontType(FONT_COURIER);
edit->SetFontStretch(0.7f);
- edit->SetDisplaySpec(TRUE);
+ edit->SetDisplaySpec(true);
edit->SetAutoIndent(m_engine->RetEditIndentMode());
m_script->PutScript(edit, name);
ColorizeScript(edit);
@@ -614,7 +614,7 @@ void CStudio::StartEditScript(CScript *script, char* name, int rank)
list = pw->CreateList(pos, dim, 1, EVENT_STUDIO_LIST, 1.2f);
list->SetState(STATE_SHADOW);
list->SetFontType(FONT_COURIER);
- list->SetSelectCap(FALSE);
+ list->SetSelectCap(false);
list->SetFontSize(SMALLFONT*0.85f);
//? list->SetFontStretch(1.0f);
@@ -846,7 +846,7 @@ void CStudio::AdjustEditScript()
// Ends edition of a program.
-BOOL CStudio::StopEditScript(BOOL bCancel)
+bool CStudio::StopEditScript(bool bCancel)
{
CWindow* pw;
CEdit* edit;
@@ -854,7 +854,7 @@ BOOL CStudio::StopEditScript(BOOL bCancel)
char buffer[100];
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW3);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
if ( !bCancel && !m_script->IsRunning() )
{
@@ -864,12 +864,12 @@ BOOL CStudio::StopEditScript(BOOL bCancel)
if ( !m_script->GetScript(edit) ) // compile
{
m_script->GetError(buffer);
- SetInfoText(buffer, FALSE);
- return FALSE;
+ SetInfoText(buffer, false);
+ return false;
}
}
}
- m_script->SetStepMode(FALSE);
+ m_script->SetStepMode(false);
m_interface->DeleteControl(EVENT_WINDOW3);
@@ -879,18 +879,18 @@ BOOL CStudio::StopEditScript(BOOL bCancel)
button->SetState(STATE_VISIBLE);
}
- if ( !m_bInitPause ) m_engine->SetPause(FALSE);
- m_sound->MuteAll(FALSE);
- m_main->SetEditLock(FALSE, TRUE);
+ if ( !m_bInitPause ) m_engine->SetPause(false);
+ m_sound->MuteAll(false);
+ m_main->SetEditLock(false, true);
m_camera->SetType(m_editCamera);
- return TRUE;
+ return true;
}
// Specifies the message to display.
// The messages are not clickable 8 seconds,
// even if a message was clickable poster before.
-void CStudio::SetInfoText(char *text, BOOL bClickable)
+void CStudio::SetInfoText(char *text, bool bClickable)
{
CWindow* pw;
CList* list;
@@ -908,7 +908,7 @@ void CStudio::SetInfoText(char *text, BOOL bClickable)
list->Flush(); // just text
list->SetName(0, text);
- if ( text[0] == 0 ) bClickable = FALSE;
+ if ( text[0] == 0 ) bClickable = false;
list->SetSelectCap(bClickable);
if ( bClickable )
@@ -954,23 +954,23 @@ void CStudio::UpdateFlux()
#if 1
if ( m_bRealTime ) // run?
{
- m_engine->SetPause(FALSE);
- m_sound->MuteAll(FALSE);
+ m_engine->SetPause(false);
+ m_sound->MuteAll(false);
}
else // step by step?
{
- m_engine->SetPause(TRUE);
- m_sound->MuteAll(TRUE);
+ m_engine->SetPause(true);
+ m_sound->MuteAll(true);
}
#else
- m_engine->SetPause(FALSE);
- m_sound->MuteAll(FALSE);
+ m_engine->SetPause(false);
+ m_sound->MuteAll(false);
#endif
}
else // stop?
{
- m_engine->SetPause(TRUE);
- m_sound->MuteAll(TRUE);
+ m_engine->SetPause(true);
+ m_sound->MuteAll(true);
}
}
@@ -991,14 +991,14 @@ void CStudio::UpdateButtons()
if ( m_bRunning )
{
edit->SetIcon(1); // red background
- edit->SetEditCap(FALSE); // just to see
- edit->SetHiliteCap(TRUE);
+ edit->SetEditCap(false); // just to see
+ edit->SetHiliteCap(true);
}
else
{
edit->SetIcon(0); // standard background
- edit->SetEditCap(TRUE);
- edit->SetHiliteCap(TRUE);
+ edit->SetEditCap(true);
+ edit->SetHiliteCap(true);
}
button = (CButton*)pw->SearchControl(EVENT_STUDIO_COMPILE);
@@ -1071,8 +1071,8 @@ void CStudio::StartDialog(StudioDialog type)
//? pw = m_interface->CreateWindows(pos, dim, 8, EVENT_WINDOW9);
pw = m_interface->CreateWindows(pos, dim, m_dialog==SD_OPEN?14:13, EVENT_WINDOW9);
pw->SetState(STATE_SHADOW);
- pw->SetMovable(TRUE);
- pw->SetClosable(TRUE);
+ pw->SetMovable(true);
+ pw->SetClosable(true);
pw->SetMinDim(FPOINT(320.0f/640.0f, (121.0f+18.0f*4)/480.0f));
if ( m_dialog == SD_OPEN ) GetResource(RES_TEXT, RT_IO_OPEN, name);
if ( m_dialog == SD_SAVE ) GetResource(RES_TEXT, RT_IO_SAVE, name);
@@ -1139,10 +1139,10 @@ void CStudio::StartDialog(StudioDialog type)
UpdateDialogAction();
pe->SetCursor(999, 0); // selects all
- pe->SetFocus(TRUE);
+ pe->SetFocus(true);
}
- m_main->SetSatComLock(TRUE); // impossible to use the SatCom
+ m_main->SetSatComLock(true); // impossible to use the SatCom
}
// End of the display of a dialogue.
@@ -1182,7 +1182,7 @@ void CStudio::StopDialog()
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
m_interface->DeleteControl(EVENT_WINDOW9);
- m_main->SetSatComLock(FALSE); // possible to use the SatCom
+ m_main->SetSatComLock(false); // possible to use the SatCom
}
// Adjust all controls of dialogue after a change in geometry.
@@ -1312,13 +1312,13 @@ void CStudio::AdjustDialog()
// Management of the event of a dialogue.
-BOOL CStudio::EventDialog(const Event &event)
+bool CStudio::EventDialog(const Event &event)
{
CWindow* pw;
FPOINT wpos, wdim;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
if ( event.event == EVENT_WINDOW9 ) // window is moved?
{
@@ -1343,13 +1343,13 @@ BOOL CStudio::EventDialog(const Event &event)
if ( event.event == EVENT_DIALOG_CHECK1 ) // private?
{
- m_main->SetIOPublic(FALSE);
+ m_main->SetIOPublic(false);
UpdateDialogPublic();
UpdateDialogList();
}
if ( event.event == EVENT_DIALOG_CHECK2 ) // public?
{
- m_main->SetIOPublic(TRUE);
+ m_main->SetIOPublic(true);
UpdateDialogPublic();
UpdateDialogList();
}
@@ -1360,15 +1360,15 @@ BOOL CStudio::EventDialog(const Event &event)
{
if ( m_dialog == SD_OPEN )
{
- if ( !ReadProgram() ) return TRUE;
+ if ( !ReadProgram() ) return true;
}
if ( m_dialog == SD_SAVE )
{
- if ( !WriteProgram() ) return TRUE;
+ if ( !WriteProgram() ) return true;
}
StopDialog();
- return TRUE;
+ return true;
}
if ( event.event == EVENT_DIALOG_CANCEL ||
@@ -1376,10 +1376,10 @@ BOOL CStudio::EventDialog(const Event &event)
event.event == pw->RetEventMsgClose() )
{
StopDialog();
- return TRUE;
+ return true;
}
- return TRUE;
+ return true;
}
// Updates the name after a click in the list.
@@ -1405,7 +1405,7 @@ void CStudio::UpdateChangeList()
if ( p != 0 ) *p = 0;
pe->SetText(name);
pe->SetCursor(999, 0); // selects all
- pe->SetFocus(TRUE);
+ pe->SetFocus(true);
UpdateDialogAction();
}
@@ -1436,7 +1436,7 @@ void CStudio::UpdateDialogAction()
CButton* pb;
char name[100];
int len, i;
- BOOL bError;
+ bool bError;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
if ( pw == 0 ) return;
@@ -1449,11 +1449,11 @@ void CStudio::UpdateDialogAction()
len = strlen(name);
if ( len == 0 )
{
- bError = TRUE;
+ bError = true;
}
else
{
- bError = FALSE;
+ bError = false;
for ( i=0 ; i<len ; i++ )
{
if ( name[i] == '*' ||
@@ -1464,7 +1464,7 @@ void CStudio::UpdateDialogAction()
name[i] == '"' ||
name[i] == '|' ||
name[i] == '/' ||
- name[i] == '\\' ) bError = TRUE;
+ name[i] == '\\' ) bError = true;
}
}
@@ -1501,9 +1501,9 @@ void CStudio::UpdateDialogPublic()
if ( pl != 0 )
{
GetResource(RES_TEXT, RT_IO_LIST, name);
- SearchDirectory(dir, FALSE);
+ SearchDirectory(dir, false);
sprintf(text, name, dir);
- pl->SetName(text, FALSE);
+ pl->SetName(text, false);
}
}
@@ -1516,7 +1516,7 @@ void CStudio::UpdateDialogList()
long hFile;
struct _finddata_t fileBuffer;
struct _finddata_t* listBuffer;
- BOOL bDo;
+ bool bDo;
char dir[_MAX_FNAME];
char temp[_MAX_FNAME];
int nbFilenames, i;
@@ -1530,7 +1530,7 @@ void CStudio::UpdateDialogList()
nbFilenames = 0;
listBuffer = (_finddata_t*)malloc(sizeof(_finddata_t)*1000);
- SearchDirectory(dir, FALSE);
+ SearchDirectory(dir, false);
strcat(dir, "*"); // list all
hFile = _findfirst(dir, &fileBuffer);
if ( hFile != -1 )
@@ -1546,7 +1546,7 @@ void CStudio::UpdateDialogList()
}
do // sorts all names:
{
- bDo = FALSE;
+ bDo = false;
for ( i=0 ; i<nbFilenames-1 ; i++ )
{
if ( strcmp(listBuffer[i].name, listBuffer[i+1].name) > 0 )
@@ -1554,7 +1554,7 @@ void CStudio::UpdateDialogList()
fileBuffer = listBuffer[i]; // exchange i and i +1
listBuffer[i] = listBuffer[i+1];
listBuffer[i+1] = fileBuffer;
- bDo = TRUE;
+ bDo = true;
}
}
}
@@ -1573,7 +1573,7 @@ void CStudio::UpdateDialogList()
// Constructs the name of the folder or open/save.
// If the folder does not exist, it will be created.
-void CStudio::SearchDirectory(char *dir, BOOL bCreate)
+void CStudio::SearchDirectory(char *dir, bool bCreate)
{
if ( m_main->RetIOPublic() )
{
@@ -1592,7 +1592,7 @@ void CStudio::SearchDirectory(char *dir, BOOL bCreate)
// Reads a new program.
-BOOL CStudio::ReadProgram()
+bool CStudio::ReadProgram()
{
CWindow* pw;
CEdit* pe;
@@ -1601,36 +1601,36 @@ BOOL CStudio::ReadProgram()
char* p;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
pe = (CEdit*)pw->SearchControl(EVENT_DIALOG_EDIT);
- if ( pe == 0 ) return FALSE;
+ if ( pe == 0 ) return false;
pe->GetText(filename, 100);
- if ( filename[0] == 0 ) return FALSE;
+ if ( filename[0] == 0 ) return false;
p = strstr(filename, ".txt");
if ( p == 0 || p != filename+strlen(filename)-4 )
{
strcat(filename, ".txt");
}
- SearchDirectory(dir, TRUE);
+ SearchDirectory(dir, true);
strcat(dir, filename);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW3);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
pe = (CEdit*)pw->SearchControl(EVENT_STUDIO_EDIT);
- if ( pe == 0 ) return FALSE;
+ if ( pe == 0 ) return false;
- if ( !pe->ReadText(dir) ) return FALSE;
+ if ( !pe->ReadText(dir) ) return false;
m_script->SetFilename(filename);
ColorizeScript(pe);
- return TRUE;
+ return true;
}
// Writes the current program.
-BOOL CStudio::WriteProgram()
+bool CStudio::WriteProgram()
{
CWindow* pw;
CEdit* pe;
@@ -1639,29 +1639,29 @@ BOOL CStudio::WriteProgram()
char* p;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
pe = (CEdit*)pw->SearchControl(EVENT_DIALOG_EDIT);
- if ( pe == 0 ) return FALSE;
+ if ( pe == 0 ) return false;
pe->GetText(filename, 100);
- if ( filename[0] == 0 ) return FALSE;
+ if ( filename[0] == 0 ) return false;
p = strstr(filename, ".txt");
if ( p == 0 || p != filename+strlen(filename)-4 )
{
strcat(filename, ".txt");
}
- SearchDirectory(dir, TRUE);
+ SearchDirectory(dir, true);
strcat(dir, filename);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW3);
- if ( pw == 0 ) return FALSE;
+ if ( pw == 0 ) return false;
pe = (CEdit*)pw->SearchControl(EVENT_STUDIO_EDIT);
- if ( pe == 0 ) return FALSE;
+ if ( pe == 0 ) return false;
- if ( !pe->WriteText(dir) ) return FALSE;
+ if ( !pe->WriteText(dir) ) return false;
m_script->SetFilename(filename);
- return TRUE;
+ return true;
}
diff --git a/src/ui/studio.h b/src/ui/studio.h
index 4f88314..194ca64 100644
--- a/src/ui/studio.h
+++ b/src/ui/studio.h
@@ -53,17 +53,17 @@ public:
CStudio(CInstanceManager* iMan);
~CStudio();
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void StartEditScript(CScript *script, char* name, int rank);
- BOOL StopEditScript(BOOL bCancel);
+ bool StopEditScript(bool bCancel);
protected:
- BOOL EventFrame(const Event &event);
+ bool EventFrame(const Event &event);
void SearchToken(CEdit* edit);
void ColorizeScript(CEdit* edit);
void AdjustEditScript();
- void SetInfoText(char *text, BOOL bClickable);
+ void SetInfoText(char *text, bool bClickable);
void ViewEditScript();
void UpdateFlux();
void UpdateButtons();
@@ -71,15 +71,15 @@ protected:
void StartDialog(StudioDialog type);
void StopDialog();
void AdjustDialog();
- BOOL EventDialog(const Event &event);
+ bool EventDialog(const Event &event);
void UpdateChangeList();
void UpdateChangeEdit();
void UpdateDialogAction();
void UpdateDialogPublic();
void UpdateDialogList();
- void SearchDirectory(char *dir, BOOL bCreate);
- BOOL ReadProgram();
- BOOL WriteProgram();
+ void SearchDirectory(char *dir, bool bCreate);
+ bool ReadProgram();
+ bool WriteProgram();
protected:
CInstanceManager* m_iMan;
@@ -93,8 +93,8 @@ protected:
int m_rank;
CScript* m_script;
- BOOL m_bEditMaximized;
- BOOL m_bEditMinimized;
+ bool m_bEditMaximized;
+ bool m_bEditMinimized;
CameraType m_editCamera;
FPOINT m_editActualPos;
@@ -104,9 +104,9 @@ protected:
float m_time;
float m_fixInfoTextTime;
- BOOL m_bRunning;
- BOOL m_bRealTime;
- BOOL m_bInitPause;
+ bool m_bRunning;
+ bool m_bRealTime;
+ bool m_bInitPause;
char m_helpFilename[100];
StudioDialog m_dialog;
diff --git a/src/ui/target.cpp b/src/ui/target.cpp
index 1c138e0..4e282b9 100644
--- a/src/ui/target.cpp
+++ b/src/ui/target.cpp
@@ -52,23 +52,23 @@ CTarget::~CTarget()
// Creates a new button.
-BOOL CTarget::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CTarget::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
- return TRUE;
+ return true;
}
// Management of an event.
-BOOL CTarget::EventProcess(const Event &event)
+bool CTarget::EventProcess(const Event &event)
{
#if 0
- if ( (m_state & STATE_VISIBLE) == 0 ) return TRUE;
- if ( m_state & STATE_DEAD ) return TRUE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return true;
+ if ( m_state & STATE_DEAD ) return true;
CControl::EventProcess(event);
@@ -80,7 +80,7 @@ BOOL CTarget::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
@@ -93,22 +93,22 @@ BOOL CTarget::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = EVENT_OBJECT_FIRE;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
#else
CObject* pObj;
- if ( (m_state & STATE_VISIBLE) == 0 ) return TRUE;
- if ( m_state & STATE_DEAD ) return TRUE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return true;
+ if ( m_state & STATE_DEAD ) return true;
CControl::EventProcess(event);
if ( event.event == EVENT_MOUSEMOVE )
{
- m_main->SetFriendAim(FALSE);
+ m_main->SetFriendAim(false);
if ( CControl::Detect(event.pos) )
{
@@ -120,11 +120,11 @@ BOOL CTarget::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = m_eventMsg;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
else
{
- m_main->SetFriendAim(TRUE);
+ m_main->SetFriendAim(true);
m_engine->SetMouseType(D3DMOUSENORM);
}
}
@@ -141,12 +141,12 @@ BOOL CTarget::EventProcess(const Event &event)
Event newEvent = event;
newEvent.event = EVENT_OBJECT_FIRE;
m_event->AddEvent(newEvent);
- return FALSE;
+ return false;
}
}
}
- return TRUE;
+ return true;
#endif
}
@@ -161,20 +161,20 @@ void CTarget::Draw()
// Returns the tooltip.
-BOOL CTarget::GetTooltip(FPOINT pos, char* name)
+bool CTarget::GetTooltip(FPOINT pos, char* name)
{
#if 0
if ( (m_state&STATE_VISIBLE) && Detect(pos) ) // in the window?
{
strcpy(name, m_tooltip);
- return TRUE; // does not detect objects below!
+ return true; // does not detect objects below!
}
- return FALSE;
+ return false;
#else
//? CObject* pObj;
- if ( (m_state & STATE_VISIBLE) == 0 ) return FALSE;
+ if ( (m_state & STATE_VISIBLE) == 0 ) return false;
if ( (m_state&STATE_VISIBLE) && Detect(pos) ) // in the window?
{
@@ -183,11 +183,11 @@ BOOL CTarget::GetTooltip(FPOINT pos, char* name)
if ( !m_main->RetFriendAim() )
{
strcpy(name, m_tooltip);
- return TRUE; // does not detect objects below!
+ return true; // does not detect objects below!
}
}
- return FALSE;
+ return false;
#endif
}
diff --git a/src/ui/target.h b/src/ui/target.h
index d34a9b4..7959c9a 100644
--- a/src/ui/target.h
+++ b/src/ui/target.h
@@ -33,11 +33,11 @@ public:
CTarget(CInstanceManager* iMan);
~CTarget();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
- BOOL GetTooltip(FPOINT pos, char* name);
+ bool GetTooltip(FPOINT pos, char* name);
protected:
CObject* DetectFriendObject(FPOINT pos);
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index 21fa17b..26e0a07 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -65,10 +65,10 @@ CWindow::CWindow(CInstanceManager* iMan) : CControl(iMan)
m_table[i] = 0;
}
- m_bTrashEvent = TRUE;
- m_bMaximized = FALSE;
- m_bMinimized = FALSE;
- m_bFixed = FALSE;
+ m_bTrashEvent = true;
+ m_bMaximized = false;
+ m_bMinimized = false;
+ m_bFixed = false;
m_minDim = FPOINT(0.0f, 0.0f);
m_maxDim = FPOINT(1.0f, 1.0f);
@@ -77,10 +77,10 @@ CWindow::CWindow(CInstanceManager* iMan) : CControl(iMan)
m_buttonFull = 0;
m_buttonClose = 0;
- m_bMovable = FALSE;
- m_bRedim = FALSE;
- m_bClosable = FALSE;
- m_bCapture = FALSE;
+ m_bMovable = false;
+ m_bRedim = false;
+ m_bClosable = false;
+ m_bCapture = false;
m_fontStretch = NORMSTRETCH*1.2f;
}
@@ -130,12 +130,12 @@ void CWindow::Flush()
// Creates a new window.
-BOOL CWindow::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CWindow::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
- return TRUE;
+ return true;
}
@@ -535,7 +535,7 @@ CTarget* CWindow::CreateTarget(FPOINT pos, FPOINT dim, int icon, EventMsg eventM
// Removes a control.
-BOOL CWindow::DeleteControl(EventMsg eventMsg)
+bool CWindow::DeleteControl(EventMsg eventMsg)
{
int i;
@@ -547,11 +547,11 @@ BOOL CWindow::DeleteControl(EventMsg eventMsg)
{
delete m_table[i];
m_table[i] = 0;
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
// Gives a control.
@@ -576,7 +576,7 @@ CControl* CWindow::SearchControl(EventMsg eventMsg)
// Makes the tooltip binds to the window.
-BOOL CWindow::GetTooltip(FPOINT pos, char* name)
+bool CWindow::GetTooltip(FPOINT pos, char* name)
{
int i;
@@ -586,7 +586,7 @@ BOOL CWindow::GetTooltip(FPOINT pos, char* name)
{
if ( m_table[i]->GetTooltip(pos, name) )
{
- return TRUE;
+ return true;
}
}
}
@@ -594,26 +594,26 @@ BOOL CWindow::GetTooltip(FPOINT pos, char* name)
if ( m_buttonClose != 0 &&
m_buttonClose->GetTooltip(pos, name) )
{
- return TRUE;
+ return true;
}
if ( m_buttonFull != 0 &&
m_buttonFull->GetTooltip(pos, name) )
{
- return TRUE;
+ return true;
}
if ( m_buttonReduce != 0 &&
m_buttonReduce->GetTooltip(pos, name) )
{
- return TRUE;
+ return true;
}
if ( Detect(pos) ) // in the window?
{
strcpy(name, m_tooltip);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
@@ -622,7 +622,7 @@ BOOL CWindow::GetTooltip(FPOINT pos, char* name)
void CWindow::SetName(char* name)
{
CButton* pc;
- BOOL bAdjust;
+ bool bAdjust;
CControl::SetName(name);
@@ -644,7 +644,7 @@ void CWindow::SetName(char* name)
m_buttonClose = 0;
}
- bAdjust = FALSE;
+ bAdjust = false;
if ( m_name[0] != 0 && m_bRedim ) // title bar exists?
{
@@ -656,7 +656,7 @@ void CWindow::SetName(char* name)
pc = (CButton*)m_buttonFull;
pc->Create(m_pos, m_dim, 0, EVENT_NULL);
- bAdjust = TRUE;
+ bAdjust = true;
}
if ( m_name[0] != 0 && m_bClosable ) // title bar exists?
@@ -665,7 +665,7 @@ void CWindow::SetName(char* name)
pc = (CButton*)m_buttonClose;
pc->Create(m_pos, m_dim, 0, EVENT_NULL);
- bAdjust = TRUE;
+ bAdjust = true;
}
if ( bAdjust )
@@ -757,12 +757,12 @@ FPOINT CWindow::RetMaxDim()
// Indicates whether the window is moved.
-void CWindow::SetMovable(BOOL bMode)
+void CWindow::SetMovable(bool bMode)
{
m_bMovable = bMode;
}
-BOOL CWindow::RetMovable()
+bool CWindow::RetMovable()
{
return m_bMovable;
}
@@ -770,12 +770,12 @@ BOOL CWindow::RetMovable()
// Management of the presence of minimize/maximize buttons.
-void CWindow::SetRedim(BOOL bMode)
+void CWindow::SetRedim(bool bMode)
{
m_bRedim = bMode;
}
-BOOL CWindow::RetRedim()
+bool CWindow::RetRedim()
{
return m_bRedim;
}
@@ -783,45 +783,45 @@ BOOL CWindow::RetRedim()
// Management of the presence of the close button.
-void CWindow::SetClosable(BOOL bMode)
+void CWindow::SetClosable(bool bMode)
{
m_bClosable = bMode;
}
-BOOL CWindow::RetClosable()
+bool CWindow::RetClosable()
{
return m_bClosable;
}
-void CWindow::SetMaximized(BOOL bMaxi)
+void CWindow::SetMaximized(bool bMaxi)
{
m_bMaximized = bMaxi;
AdjustButtons();
}
-BOOL CWindow::RetMaximized()
+bool CWindow::RetMaximized()
{
return m_bMaximized;
}
-void CWindow::SetMinimized(BOOL bMini)
+void CWindow::SetMinimized(bool bMini)
{
m_bMinimized = bMini;
AdjustButtons();
}
-BOOL CWindow::RetMinimized()
+bool CWindow::RetMinimized()
{
return m_bMinimized;
}
-void CWindow::SetFixed(BOOL bFix)
+void CWindow::SetFixed(bool bFix)
{
m_bFixed = bFix;
}
-BOOL CWindow::RetFixed()
+bool CWindow::RetFixed()
{
return m_bFixed;
}
@@ -874,12 +874,12 @@ void CWindow::AdjustButtons()
}
-void CWindow::SetTrashEvent(BOOL bTrash)
+void CWindow::SetTrashEvent(bool bTrash)
{
m_bTrashEvent = bTrash;
}
-BOOL CWindow::RetTrashEvent()
+bool CWindow::RetTrashEvent()
{
return m_bTrashEvent;
}
@@ -964,7 +964,7 @@ int CWindow::BorderDetect(FPOINT pos)
// Management of an event.
-BOOL CWindow::EventProcess(const Event &event)
+bool CWindow::EventProcess(const Event &event)
{
FPOINT pos;
int i, flags;
@@ -1022,7 +1022,7 @@ BOOL CWindow::EventProcess(const Event &event)
{
if ( !m_table[i]->EventProcess(event) )
{
- return FALSE;
+ return false;
}
}
}
@@ -1050,11 +1050,11 @@ BOOL CWindow::EventProcess(const Event &event)
m_pressFlags = BorderDetect(event.pos);
if ( m_pressFlags != 0 )
{
- m_bCapture = TRUE;
+ m_bCapture = true;
m_pressPos = event.pos;
}
}
- return FALSE;
+ return false;
}
}
@@ -1113,10 +1113,10 @@ BOOL CWindow::EventProcess(const Event &event)
if ( event.event == EVENT_LBUTTONUP && m_bCapture )
{
- m_bCapture = FALSE;
+ m_bCapture = false;
}
- return TRUE;
+ return true;
}
@@ -1582,7 +1582,7 @@ void CWindow::DrawHach(FPOINT pos, FPOINT dim)
#else
FPOINT ppos, ddim, uv1, uv2;
float dp, max, ndim;
- BOOL bStop;
+ bool bStop;
dp = 0.5f/256.0f;
@@ -1601,7 +1601,7 @@ void CWindow::DrawHach(FPOINT pos, FPOINT dim)
ppos = pos;
ddim = dim;
- bStop = FALSE;
+ bStop = false;
do
{
ddim.x = max;
@@ -1610,7 +1610,7 @@ void CWindow::DrawHach(FPOINT pos, FPOINT dim)
ndim = pos.x+dim.x-ppos.x;
uv2.x = uv1.x+(uv2.x-uv1.x)*(ndim/ddim.x);
ddim.x = ndim;
- bStop = TRUE;
+ bStop = true;
}
DrawIcon(ppos, ddim, uv1, uv2);
diff --git a/src/ui/window.h b/src/ui/window.h
index d88ba33..86ae6f2 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -52,7 +52,7 @@ public:
~CWindow();
void Flush();
- BOOL Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
CButton* CreateButton(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
CColor* CreateColor(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
CCheck* CreateCheck(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
@@ -70,7 +70,7 @@ public:
CGauge* CreateGauge(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
CCompass* CreateCompass(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
CTarget* CreateTarget(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- BOOL DeleteControl(EventMsg eventMsg);
+ bool DeleteControl(EventMsg eventMsg);
CControl* SearchControl(EventMsg eventMsg);
EventMsg RetEventMsgReduce();
@@ -79,8 +79,8 @@ public:
void SetName(char* name);
- void SetTrashEvent(BOOL bTrash);
- BOOL RetTrashEvent();
+ void SetTrashEvent(bool bTrash);
+ bool RetTrashEvent();
void SetPos(FPOINT pos);
void SetDim(FPOINT dim);
@@ -90,25 +90,25 @@ public:
FPOINT RetMinDim();
FPOINT RetMaxDim();
- void SetMovable(BOOL bMode);
- BOOL RetMovable();
+ void SetMovable(bool bMode);
+ bool RetMovable();
- void SetRedim(BOOL bMode);
- BOOL RetRedim();
+ void SetRedim(bool bMode);
+ bool RetRedim();
- void SetClosable(BOOL bMode);
- BOOL RetClosable();
+ void SetClosable(bool bMode);
+ bool RetClosable();
- void SetMaximized(BOOL bMaxi);
- BOOL RetMaximized();
- void SetMinimized(BOOL bMini);
- BOOL RetMinimized();
- void SetFixed(BOOL bFix);
- BOOL RetFixed();
+ void SetMaximized(bool bMaxi);
+ bool RetMaximized();
+ void SetMinimized(bool bMini);
+ bool RetMinimized();
+ void SetFixed(bool bFix);
+ bool RetFixed();
- BOOL GetTooltip(FPOINT pos, char* name);
+ bool GetTooltip(FPOINT pos, char* name);
- BOOL EventProcess(const Event &event);
+ bool EventProcess(const Event &event);
void Draw();
@@ -122,10 +122,10 @@ protected:
protected:
CControl* m_table[MAXWINDOW];
- BOOL m_bTrashEvent;
- BOOL m_bMaximized;
- BOOL m_bMinimized;
- BOOL m_bFixed;
+ bool m_bTrashEvent;
+ bool m_bMaximized;
+ bool m_bMinimized;
+ bool m_bFixed;
FPOINT m_minDim;
FPOINT m_maxDim;
@@ -134,10 +134,10 @@ protected:
CButton* m_buttonFull;
CButton* m_buttonClose;
- BOOL m_bMovable;
- BOOL m_bRedim;
- BOOL m_bClosable;
- BOOL m_bCapture;
+ bool m_bMovable;
+ bool m_bRedim;
+ bool m_bClosable;
+ bool m_bCapture;
FPOINT m_pressPos;
int m_pressFlags;
D3DMouse m_pressMouse;