summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/button.cpp6
-rw-r--r--src/ui/button.h2
-rw-r--r--src/ui/check.cpp6
-rw-r--r--src/ui/check.h2
-rw-r--r--src/ui/color.cpp6
-rw-r--r--src/ui/color.h2
-rw-r--r--src/ui/compass.cpp13
-rw-r--r--src/ui/compass.h2
-rw-r--r--src/ui/control.cpp56
-rw-r--r--src/ui/control.h34
-rw-r--r--src/ui/displayinfo.cpp16
-rw-r--r--src/ui/displayinfo.h14
-rw-r--r--src/ui/displaytext.cpp4
-rw-r--r--src/ui/displaytext.h2
-rw-r--r--src/ui/edit.cpp60
-rw-r--r--src/ui/edit.h28
-rw-r--r--src/ui/editvalue.cpp10
-rw-r--r--src/ui/editvalue.h6
-rw-r--r--src/ui/gauge.cpp6
-rw-r--r--src/ui/gauge.h2
-rw-r--r--src/ui/group.cpp18
-rw-r--r--src/ui/group.h2
-rw-r--r--src/ui/image.cpp6
-rw-r--r--src/ui/image.h2
-rw-r--r--src/ui/interface.cpp38
-rw-r--r--src/ui/interface.h40
-rw-r--r--src/ui/key.cpp6
-rw-r--r--src/ui/key.h2
-rw-r--r--src/ui/label.cpp6
-rw-r--r--src/ui/label.h2
-rw-r--r--src/ui/list.cpp16
-rw-r--r--src/ui/list.h8
-rw-r--r--src/ui/maindialog.cpp194
-rw-r--r--src/ui/maindialog.h12
-rw-r--r--src/ui/mainmap.cpp8
-rw-r--r--src/ui/mainmap.h6
-rw-r--r--src/ui/mainshort.cpp8
-rw-r--r--src/ui/mainshort.h7
-rw-r--r--src/ui/map.cpp91
-rw-r--r--src/ui/map.h33
-rw-r--r--src/ui/scroll.cpp24
-rw-r--r--src/ui/scroll.h11
-rw-r--r--src/ui/shortcut.cpp12
-rw-r--r--src/ui/shortcut.h2
-rw-r--r--src/ui/slider.cpp24
-rw-r--r--src/ui/slider.h11
-rw-r--r--src/ui/studio.cpp20
-rw-r--r--src/ui/studio.h8
-rw-r--r--src/ui/target.cpp8
-rw-r--r--src/ui/target.h6
-rw-r--r--src/ui/window.cpp76
-rw-r--r--src/ui/window.h62
52 files changed, 503 insertions, 543 deletions
diff --git a/src/ui/button.cpp b/src/ui/button.cpp
index 701971c..4f9e9cd 100644
--- a/src/ui/button.cpp
+++ b/src/ui/button.cpp
@@ -14,8 +14,6 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -57,7 +55,7 @@ CButton::~CButton()
// Creates a new button.
-bool CButton::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CButton::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -151,7 +149,7 @@ bool CButton::EventProcess(const Event &event)
void CButton::Draw()
{
- FPOINT pos, dim, uv1, uv2;
+ Math::Point pos, dim, uv1, uv2;
#if !_NEWLOOK
float dp;
#endif
diff --git a/src/ui/button.h b/src/ui/button.h
index cc34997..34c4a96 100644
--- a/src/ui/button.h
+++ b/src/ui/button.h
@@ -32,7 +32,7 @@ public:
CButton(CInstanceManager* iMan);
virtual ~CButton();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/check.cpp b/src/ui/check.cpp
index b4b944e..c1ddcc2 100644
--- a/src/ui/check.cpp
+++ b/src/ui/check.cpp
@@ -14,8 +14,6 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -49,7 +47,7 @@ CCheck::~CCheck()
// Creates a new button.
-bool CCheck::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CCheck::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
char name[100];
char* p;
@@ -96,7 +94,7 @@ bool CCheck::EventProcess(const Event &event)
void CCheck::Draw()
{
- FPOINT iDim, pos;
+ Math::Point iDim, pos;
float zoomExt, zoomInt;
int icon;
diff --git a/src/ui/check.h b/src/ui/check.h
index 8bb2c9c..9c1f442 100644
--- a/src/ui/check.h
+++ b/src/ui/check.h
@@ -32,7 +32,7 @@ public:
CCheck(CInstanceManager* iMan);
virtual ~CCheck();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/color.cpp b/src/ui/color.cpp
index bf635ff..2490b6c 100644
--- a/src/ui/color.cpp
+++ b/src/ui/color.cpp
@@ -14,8 +14,6 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -60,7 +58,7 @@ CColor::~CColor()
// Creates a new button.
-bool CColor::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CColor::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -137,7 +135,7 @@ void CColor::Draw()
LPDIRECT3DDEVICE7 device;
D3DLVERTEX vertex[4]; // 2 triangles
D3DCOLOR color;
- FPOINT p1, p2;
+ Math::Point p1, p2;
if ( (m_state & STATE_VISIBLE) == 0 ) return;
diff --git a/src/ui/color.h b/src/ui/color.h
index 86d9434..041c7d2 100644
--- a/src/ui/color.h
+++ b/src/ui/color.h
@@ -33,7 +33,7 @@ public:
CColor(CInstanceManager* iMan);
virtual ~CColor();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/compass.cpp b/src/ui/compass.cpp
index d856e19..e7e1eee 100644
--- a/src/ui/compass.cpp
+++ b/src/ui/compass.cpp
@@ -14,14 +14,13 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
#include <d3d.h>
#include "common/struct.h"
+#include "math/geometry.h"
#include "graphics/d3d/d3dengine.h"
#include "math/old/math3d.h"
#include "common/event.h"
@@ -48,7 +47,7 @@ CCompass::~CCompass()
// Creates a new button.
-bool CCompass::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CCompass::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -84,7 +83,7 @@ void CCompass::Draw()
{
LPDIRECT3DDEVICE7 device;
D3DVERTEX2 vertex[4]; // 2 triangles
- FPOINT p1, p2, p3, c, uv1, uv2;
+ Math::Point p1, p2, p3, c, uv1, uv2;
D3DVECTOR n;
float dp;
@@ -128,17 +127,17 @@ void CCompass::Draw()
{
p1.x = c.x;
p1.y = c.y+m_dim.x*0.40f;
- p1 = RotatePoint(c, m_dir, p1);
+ p1 = Math::RotatePoint(c, m_dir, p1);
p1.x = c.x+(p1.x-c.x)*(m_dim.x/m_dim.y);
p2.x = c.x+m_dim.x*0.20f;
p2.y = c.y-m_dim.x*0.40f;
- p2 = RotatePoint(c, m_dir, p2);
+ p2 = Math::RotatePoint(c, m_dir, p2);
p2.x = c.x+(p2.x-c.x)*(m_dim.x/m_dim.y);
p3.x = c.x-m_dim.x*0.20f;
p3.y = c.y-m_dim.x*0.40f;
- p3 = RotatePoint(c, m_dir, p3);
+ p3 = Math::RotatePoint(c, m_dir, p3);
p3.x = c.x+(p3.x-c.x)*(m_dim.x/m_dim.y);
uv1.x = 96.0f/256.0f;
diff --git a/src/ui/compass.h b/src/ui/compass.h
index 113623b..5cad65a 100644
--- a/src/ui/compass.h
+++ b/src/ui/compass.h
@@ -32,7 +32,7 @@ public:
CCompass(CInstanceManager* iMan);
virtual ~CCompass();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/control.cpp b/src/ui/control.cpp
index 63ac8ca..ee08e9f 100644
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@ -14,8 +14,6 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -62,10 +60,10 @@ CControl::CControl(CInstanceManager* iMan)
m_bCapture = false;
m_bGlint = false;
- m_glintCorner1 = FPOINT(0.0f, 0.0f);
- m_glintCorner2 = FPOINT(0.0f, 0.0f);
+ m_glintCorner1 = Math::Point(0.0f, 0.0f);
+ m_glintCorner2 = Math::Point(0.0f, 0.0f);
m_glintProgress = 999.0f;
- m_glintMouse = FPOINT(0.0f, 0.0f);
+ m_glintMouse = Math::Point(0.0f, 0.0f);
}
// Object's destructor.
@@ -78,7 +76,7 @@ CControl::~CControl()
// Creates a new button.
// pos: [0..1]
-bool CControl::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CControl::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
char text[100];
char* p;
@@ -112,7 +110,7 @@ bool CControl::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
}
-void CControl::SetPos(FPOINT pos)
+void CControl::SetPos(Math::Point pos)
{
m_pos = pos;
@@ -121,14 +119,14 @@ void CControl::SetPos(FPOINT pos)
GlintCreate(pos);
}
-FPOINT CControl::RetPos()
+Math::Point CControl::RetPos()
{
return m_pos;
}
-void CControl::SetDim(FPOINT dim)
+void CControl::SetDim(Math::Point dim)
{
- FPOINT pos;
+ Math::Point pos;
m_dim = dim;
@@ -137,7 +135,7 @@ void CControl::SetDim(FPOINT dim)
GlintCreate(pos);
}
-FPOINT CControl::RetDim()
+Math::Point CControl::RetDim()
{
return m_dim;
}
@@ -298,7 +296,7 @@ bool CControl::SetTooltip(char* name)
return true;
}
-bool CControl::GetTooltip(FPOINT pos, char* name)
+bool CControl::GetTooltip(Math::Point pos, char* name)
{
if ( m_tooltip[0] == 0 ) return false;
if ( (m_state & STATE_VISIBLE) == 0 ) return false;
@@ -402,7 +400,7 @@ void CControl::GlintDelete()
// Creates a reflection for that button.
-void CControl::GlintCreate(FPOINT ref, bool bLeft, bool bUp)
+void CControl::GlintCreate(Math::Point ref, bool bLeft, bool bUp)
{
float offset;
@@ -442,7 +440,7 @@ void CControl::GlintCreate(FPOINT ref, bool bLeft, bool bUp)
void CControl::GlintFrame(const Event &event)
{
D3DVECTOR pos, speed;
- FPOINT dim;
+ Math::Point dim;
if ( (m_state & STATE_GLINT ) == 0 ||
(m_state & STATE_ENABLE ) == 0 ||
@@ -454,11 +452,11 @@ void CControl::GlintFrame(const Event &event)
if ( m_glintProgress >= 2.0f && Detect(m_glintMouse) )
{
- pos.x = m_glintCorner1.x + (m_glintCorner2.x-m_glintCorner1.x)*Rand();
- pos.y = m_glintCorner1.y + (m_glintCorner2.y-m_glintCorner1.y)*Rand();
+ pos.x = m_glintCorner1.x + (m_glintCorner2.x-m_glintCorner1.x)*Math::Rand();
+ pos.y = m_glintCorner1.y + (m_glintCorner2.y-m_glintCorner1.y)*Math::Rand();
pos.z = 0.0f;
speed = D3DVECTOR(0.0f, 0.0f, 0.0f);
- dim.x = ((15.0f+Rand()*15.0f)/640.0f);
+ dim.x = ((15.0f+Math::Rand()*15.0f)/640.0f);
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim, PARTICONTROL,
1.0f, 0.0f, 0.0f, SH_INTERFACE);
@@ -472,7 +470,7 @@ void CControl::GlintFrame(const Event &event)
void CControl::Draw()
{
- FPOINT pos;
+ Math::Point pos;
float zoomExt, zoomInt;
int icon;
@@ -609,7 +607,7 @@ void CControl::Draw()
void CControl::DrawPart(int icon, float zoom, float ex)
{
- FPOINT p1, p2, c, uv1, uv2;
+ Math::Point p1, p2, c, uv1, uv2;
float dp;
p1.x = m_pos.x;
@@ -651,12 +649,12 @@ void CControl::DrawPart(int icon, float zoom, float ex)
// Draws an icon made up of a rectangular (if x = 0)
// or 3 pieces.
-void CControl::DrawIcon(FPOINT pos, FPOINT dim, FPOINT uv1, FPOINT uv2,
+void CControl::DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math::Point uv2,
float ex)
{
LPDIRECT3DDEVICE7 device;
D3DVERTEX2 vertex[8]; // 6 triangles
- FPOINT p1, p2, p3, p4;
+ Math::Point p1, p2, p3, p4;
D3DVECTOR n;
device = m_engine->RetD3DDevice();
@@ -719,12 +717,12 @@ void CControl::DrawIcon(FPOINT pos, FPOINT dim, FPOINT uv1, FPOINT uv2,
// Draws a rectangular icon made up of 9 pieces.
-void CControl::DrawIcon(FPOINT pos, FPOINT dim, FPOINT uv1, FPOINT uv2,
- FPOINT corner, float ex)
+void CControl::DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math::Point uv2,
+ Math::Point corner, float ex)
{
LPDIRECT3DDEVICE7 device;
D3DVERTEX2 vertex[8]; // 6 triangles
- FPOINT p1, p2, p3, p4;
+ Math::Point p1, p2, p3, p4;
D3DVECTOR n;
device = m_engine->RetD3DDevice();
@@ -787,9 +785,9 @@ void CControl::DrawIcon(FPOINT pos, FPOINT dim, FPOINT uv1, FPOINT uv2,
// Draw round the hatch of a button.
-void CControl::DrawWarning(FPOINT pos, FPOINT dim)
+void CControl::DrawWarning(Math::Point pos, Math::Point dim)
{
- FPOINT uv1, uv2;
+ Math::Point uv1, uv2;
float dp;
dp = 0.5f/256.0f;
@@ -831,9 +829,9 @@ void CControl::DrawWarning(FPOINT pos, FPOINT dim)
// Draw the shade under a button.
-void CControl::DrawShadow(FPOINT pos, FPOINT dim, float deep)
+void CControl::DrawShadow(Math::Point pos, Math::Point dim, float deep)
{
- FPOINT uv1, uv2, corner;
+ Math::Point uv1, uv2, corner;
float dp;
dp = 0.5f/256.0f;
@@ -865,7 +863,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(Math::Point 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 8f677c7..d6aeadc 100644
--- a/src/ui/control.h
+++ b/src/ui/control.h
@@ -61,14 +61,14 @@ public:
CControl(CInstanceManager* iMan);
virtual ~CControl();
- virtual bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ virtual bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
virtual bool EventProcess(const Event &event);
- virtual void SetPos(FPOINT pos);
- virtual FPOINT RetPos();
- virtual void SetDim(FPOINT dim);
- virtual FPOINT RetDim();
+ virtual void SetPos(Math::Point pos);
+ virtual Math::Point RetPos();
+ virtual void SetDim(Math::Point dim);
+ virtual Math::Point RetDim();
virtual bool SetState(int state, bool bState);
virtual bool SetState(int state);
virtual bool ClearState(int state);
@@ -87,7 +87,7 @@ public:
virtual void SetFontType(FontType font);
virtual FontType RetFontType();
virtual bool SetTooltip(char* name);
- virtual bool GetTooltip(FPOINT pos, char* name);
+ virtual bool GetTooltip(Math::Point pos, char* name);
virtual void SetFocus(bool bFocus);
virtual bool RetFocus();
@@ -97,14 +97,14 @@ public:
protected:
void GlintDelete();
- void GlintCreate(FPOINT ref, bool bLeft=true, bool bUp=true);
+ void GlintCreate(Math::Point 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);
+ void DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math::Point uv2, float ex=0.0f);
+ void DrawIcon(Math::Point pos, Math::Point dim, Math::Point uv1, Math::Point uv2, Math::Point corner, float ex);
+ void DrawWarning(Math::Point pos, Math::Point dim);
+ void DrawShadow(Math::Point pos, Math::Point dim, float deep=1.0f);
+ virtual bool Detect(Math::Point pos);
protected:
CInstanceManager* m_iMan;
@@ -114,8 +114,8 @@ protected:
CParticule* m_particule;
CSound* m_sound;
- FPOINT m_pos; // corner upper / left
- FPOINT m_dim; // dimensions
+ Math::Point m_pos; // corner upper / left
+ Math::Point m_dim; // dimensions
int m_icon;
EventMsg m_eventMsg; // message to send when clicking
int m_state; // states (STATE_ *)
@@ -129,10 +129,10 @@ protected:
bool m_bCapture;
bool m_bGlint;
- FPOINT m_glintCorner1;
- FPOINT m_glintCorner2;
+ Math::Point m_glintCorner1;
+ Math::Point m_glintCorner2;
float m_glintProgress;
- FPOINT m_glintMouse;
+ Math::Point m_glintMouse;
};
diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp
index a4e2131..5921453 100644
--- a/src/ui/displayinfo.cpp
+++ b/src/ui/displayinfo.cpp
@@ -16,8 +16,6 @@
// displayinfo.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -70,8 +68,8 @@ CDisplayInfo::CDisplayInfo(CInstanceManager* iMan)
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);
+ m_infoFinalPos = m_infoActualPos = m_infoNormalPos = Math::Point(0.00f, 0.00f);
+ m_infoFinalDim = m_infoActualPos = m_infoNormalDim = Math::Point(1.00f, 1.00f);
m_lightSuppl = -1;
m_toto = 0;
@@ -339,7 +337,7 @@ void CDisplayInfo::HyperUpdate()
void CDisplayInfo::StartDisplayInfo(char *filename, int index, bool bSoluce)
{
D3DLIGHT7 light;
- FPOINT pos, dim;
+ Math::Point pos, dim;
CWindow* pw;
CEdit* edit;
CButton* button;
@@ -375,7 +373,7 @@ void CDisplayInfo::StartDisplayInfo(char *filename, int index, bool bSoluce)
//? pw->SetClosable(true);
//? GetResource(RES_TEXT, RT_DISINFO_TITLE, res);
//? pw->SetName(res);
-//? pw->SetMinDim(FPOINT(0.56f, 0.40f));
+//? pw->SetMinDim(Math::Point(0.56f, 0.40f));
//? pw->SetMaximized(m_bInfoMaximized);
//? pw->SetMinimized(m_bInfoMinimized);
//? m_main->SetEditFull(m_bInfoMaximized);
@@ -476,14 +474,14 @@ void CDisplayInfo::StartDisplayInfo(char *filename, int index, bool bSoluce)
// Repositions all controls editing.
-void CDisplayInfo::AdjustDisplayInfo(FPOINT wpos, FPOINT wdim)
+void CDisplayInfo::AdjustDisplayInfo(Math::Point wpos, Math::Point wdim)
{
CWindow* pw;
CEdit* edit;
CButton* button;
CSlider* slider;
CGroup* group;
- FPOINT pos, dim;
+ Math::Point pos, dim;
wpos.x = 50.0f/640.0f;
wpos.y = 30.0f/480.0f;
@@ -696,7 +694,7 @@ void CDisplayInfo::UpdateIndexButton()
CButton* button;
CGroup* group;
CEdit* edit;
- FPOINT pos, dim;
+ Math::Point pos, dim;
char* filename;
char* loading;
diff --git a/src/ui/displayinfo.h b/src/ui/displayinfo.h
index 2a40535..ebf38b1 100644
--- a/src/ui/displayinfo.h
+++ b/src/ui/displayinfo.h
@@ -51,7 +51,7 @@ public:
protected:
bool EventFrame(const Event &event);
void HyperUpdate();
- void AdjustDisplayInfo(FPOINT wpos, FPOINT wdim);
+ void AdjustDisplayInfo(Math::Point wpos, Math::Point wdim);
void ChangeIndexButton(int index);
void UpdateIndexButton();
void UpdateCopyButton();
@@ -74,12 +74,12 @@ protected:
int m_index;
CameraType m_infoCamera;
- FPOINT m_infoNormalPos;
- FPOINT m_infoNormalDim;
- FPOINT m_infoActualPos;
- FPOINT m_infoActualDim;
- FPOINT m_infoFinalPos;
- FPOINT m_infoFinalDim;
+ Math::Point m_infoNormalPos;
+ Math::Point m_infoNormalDim;
+ Math::Point m_infoActualPos;
+ Math::Point m_infoActualDim;
+ Math::Point m_infoFinalPos;
+ Math::Point m_infoFinalDim;
int m_lightSuppl;
bool m_bEditLock;
bool m_bInitPause;
diff --git a/src/ui/displaytext.cpp b/src/ui/displaytext.cpp
index a1307a3..3fa2687 100644
--- a/src/ui/displaytext.cpp
+++ b/src/ui/displaytext.cpp
@@ -16,8 +16,6 @@
// displaytext.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -205,7 +203,7 @@ void CDisplayText::DisplayText(char *text, D3DVECTOR goal, float height,
CButton* button;
CGroup* group;
CLabel* label;
- FPOINT pos, ppos, dim;
+ Math::Point pos, ppos, dim;
Sound sound;
float hLine, hBox;
int nLine, icon, i;
diff --git a/src/ui/displaytext.h b/src/ui/displaytext.h
index 2a2a6cb..381e2f6 100644
--- a/src/ui/displaytext.h
+++ b/src/ui/displaytext.h
@@ -19,6 +19,8 @@
#pragma once
+#include "common/event.h"
+#include "common/misc.h"
#include "graphics/d3d/d3dengine.h"
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp
index 92d190d..e09ca9a 100644
--- a/src/ui/edit.cpp
+++ b/src/ui/edit.cpp
@@ -16,8 +16,6 @@
// edit.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <stdlib.h>
#include <stdio.h>
@@ -85,7 +83,7 @@ bool IsSep(int character)
CEdit::CEdit(CInstanceManager* iMan) : CControl(iMan)
{
- FPOINT pos;
+ Math::Point pos;
int i;
m_maxChar = 100;
@@ -139,10 +137,10 @@ CEdit::~CEdit()
// Creates a new editable line.
-bool CEdit::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CEdit::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CScroll* pc;
- FPOINT start, end;
+ Math::Point start, end;
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
@@ -174,13 +172,13 @@ bool CEdit::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
}
-void CEdit::SetPos(FPOINT pos)
+void CEdit::SetPos(Math::Point pos)
{
CControl::SetPos(pos);
MoveAdjust();
}
-void CEdit::SetDim(FPOINT dim)
+void CEdit::SetDim(Math::Point dim)
{
CControl::SetDim(dim);
MoveAdjust();
@@ -188,7 +186,7 @@ void CEdit::SetDim(FPOINT dim)
void CEdit::MoveAdjust()
{
- FPOINT pos, dim;
+ Math::Point pos, dim;
float height;
m_lineDescent = m_engine->RetText()->RetDescent(m_fontSize, m_fontType);
@@ -552,7 +550,7 @@ void CEdit::SendModifEvent()
// Detects whether the mouse is over a hyperlink character.
-bool CEdit::IsLinkPos(FPOINT pos)
+bool CEdit::IsLinkPos(Math::Point pos)
{
int i;
@@ -569,7 +567,7 @@ bool CEdit::IsLinkPos(FPOINT pos)
// Positions the cursor after a double click.
-void CEdit::MouseDoubleClick(FPOINT mouse)
+void CEdit::MouseDoubleClick(Math::Point mouse)
{
int i, character;
@@ -608,7 +606,7 @@ void CEdit::MouseDoubleClick(FPOINT mouse)
// Positions the cursor when clicked.
-void CEdit::MouseClick(FPOINT mouse)
+void CEdit::MouseClick(Math::Point mouse)
{
int i;
@@ -627,7 +625,7 @@ void CEdit::MouseClick(FPOINT mouse)
// Positions the cursor when clicked released.
-void CEdit::MouseRelease(FPOINT mouse)
+void CEdit::MouseRelease(Math::Point mouse)
{
int i, j, rank;
@@ -655,7 +653,7 @@ void CEdit::MouseRelease(FPOINT mouse)
// Positions the cursor after movement.
-void CEdit::MouseMove(FPOINT mouse)
+void CEdit::MouseMove(Math::Point mouse)
{
int i;
@@ -687,9 +685,9 @@ void CEdit::MouseMove(FPOINT mouse)
// Positions the cursor when clicked.
-int CEdit::MouseDetect(FPOINT mouse)
+int CEdit::MouseDetect(Math::Point mouse)
{
- FPOINT pos;
+ Math::Point pos;
float indentLength, offset, size;
int i, len, c;
bool bTitle;
@@ -883,7 +881,7 @@ bool CEdit::HyperGo(EventMsg event)
void CEdit::Draw()
{
- FPOINT pos, ppos, dim, start, end;
+ Math::Point pos, ppos, dim, start, end;
float size, indentLength;
int i, j, beg, len, c1, c2, o1, o2, eol, iIndex, line;
@@ -904,7 +902,7 @@ void CEdit::Draw()
// Displays all lines.
c1 = m_cursor1;
c2 = m_cursor2;
- if ( c1 > c2 ) Swap(c1, c2); // always c1 <= c2
+ if ( c1 > c2 ) Math::Swap(c1, c2); // always c1 <= c2
if ( m_bInsideScroll )
{
@@ -1070,7 +1068,7 @@ void CEdit::Draw()
}
// Shows the cursor.
- if ( (m_bEdit && m_bFocus && m_bHilite && Mod(m_timeBlink, 1.0f) <= 0.5f) ) // it blinks
+ if ( (m_bEdit && m_bFocus && m_bHilite && Math::Mod(m_timeBlink, 1.0f) <= 0.5f) ) // it blinks
{
pos.y = m_pos.y+m_dim.y-m_lineHeight-(m_bMulti?MARGY:MARGY1*2.0f);
for ( i=m_lineFirst ; i<m_lineTotal ; i++ )
@@ -1120,10 +1118,10 @@ void CEdit::Draw()
// Draw an image part.
-void CEdit::DrawImage(FPOINT pos, char *name, float width,
+void CEdit::DrawImage(Math::Point pos, char *name, float width,
float offset, float height, int nbLine)
{
- FPOINT uv1, uv2, dim;
+ Math::Point uv1, uv2, dim;
float dp;
char filename[100];
@@ -1152,9 +1150,9 @@ void CEdit::DrawImage(FPOINT pos, char *name, float width,
// Draw the background.
-void CEdit::DrawBack(FPOINT pos, FPOINT dim)
+void CEdit::DrawBack(Math::Point pos, Math::Point dim)
{
- FPOINT uv1,uv2, corner;
+ Math::Point uv1,uv2, corner;
float dp;
if ( m_bGeneric ) return;
@@ -1204,9 +1202,9 @@ void CEdit::DrawBack(FPOINT pos, FPOINT dim)
// Draws an icon background.
-void CEdit::DrawPart(FPOINT pos, FPOINT dim, int icon)
+void CEdit::DrawPart(Math::Point pos, Math::Point dim, int icon)
{
- FPOINT uv1, uv2;
+ Math::Point uv1, uv2;
float dp;
#if _POLISH
@@ -2503,7 +2501,7 @@ bool CEdit::Cut()
c1 = m_cursor1;
c2 = m_cursor2;
- if ( c1 > c2 ) Swap(c1, c2); // always c1 <= c2
+ if ( c1 > c2 ) Math::Swap(c1, c2); // always c1 <= c2
if ( c1 == c2 )
{
@@ -2582,7 +2580,7 @@ bool CEdit::Copy()
c1 = m_cursor1;
c2 = m_cursor2;
- if ( c1 > c2 ) Swap(c1, c2); // always c1 <= c2
+ if ( c1 > c2 ) Math::Swap(c1, c2); // always c1 <= c2
if ( c1 == c2 )
{
@@ -2872,7 +2870,7 @@ void CEdit::DeleteOne(int dir)
}
}
- if ( m_cursor1 > m_cursor2 ) Swap(m_cursor1, m_cursor2);
+ if ( m_cursor1 > m_cursor2 ) Math::Swap(m_cursor1, m_cursor2);
hole = m_cursor2-m_cursor1;
end = m_len-hole;
for ( i=m_cursor1 ; i<end ; i++ )
@@ -2960,7 +2958,7 @@ bool CEdit::Shift(bool bLeft)
c2 = m_cursor2;
if ( c1 > c2 )
{
- Swap(c1, c2); // always c1 <= c2
+ Math::Swap(c1, c2); // always c1 <= c2
bInvert = true;
}
@@ -3000,7 +2998,7 @@ bool CEdit::Shift(bool bLeft)
}
}
- if ( bInvert ) Swap(c1, c2);
+ if ( bInvert ) Math::Swap(c1, c2);
m_cursor1 = c1;
m_cursor2 = c2;
@@ -3010,7 +3008,7 @@ bool CEdit::Shift(bool bLeft)
return true;
}
-// Min conversion <-> shift the selection.
+// Math::Min conversion <-> shift the selection.
bool CEdit::MinMaj(bool bMaj)
{
@@ -3022,7 +3020,7 @@ bool CEdit::MinMaj(bool bMaj)
c1 = m_cursor1;
c2 = m_cursor2;
- if ( c1 > c2 ) Swap(c1, c2); // alwyas c1 <= c2
+ if ( c1 > c2 ) Math::Swap(c1, c2); // alwyas c1 <= c2
for ( i=c1 ; i<c2 ; i++ )
{
diff --git a/src/ui/edit.h b/src/ui/edit.h
index 7ac6c53..cd3c5b9 100644
--- a/src/ui/edit.h
+++ b/src/ui/edit.h
@@ -88,10 +88,10 @@ public:
CEdit(CInstanceManager* iMan);
virtual ~CEdit();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
- void SetPos(FPOINT pos);
- void SetDim(FPOINT dim);
+ void SetPos(Math::Point pos);
+ void SetDim(Math::Point dim);
bool EventProcess(const Event &event);
void Draw();
@@ -155,20 +155,20 @@ public:
protected:
void SendModifEvent();
- bool IsLinkPos(FPOINT pos);
- void MouseDoubleClick(FPOINT mouse);
- void MouseClick(FPOINT mouse);
- void MouseMove(FPOINT mouse);
- void MouseRelease(FPOINT mouse);
- int MouseDetect(FPOINT mouse);
+ bool IsLinkPos(Math::Point pos);
+ void MouseDoubleClick(Math::Point mouse);
+ void MouseClick(Math::Point mouse);
+ void MouseMove(Math::Point mouse);
+ void MouseRelease(Math::Point mouse);
+ int MouseDetect(Math::Point mouse);
void MoveAdjust();
void HyperJump(char *name, char *marker);
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);
- void DrawPart(FPOINT pos, FPOINT dim, int icon);
+ void DrawImage(Math::Point pos, char *name, float width, float offset, float height, int nbLine);
+ void DrawBack(Math::Point pos, Math::Point dim);
+ void DrawPart(Math::Point pos, Math::Point dim, int icon);
void FreeImage();
void LoadImage(char *name);
@@ -234,8 +234,8 @@ protected:
float m_timeBlink;
float m_timeLastClick;
float m_timeLastScroll;
- FPOINT m_mouseFirstPos;
- FPOINT m_mouseLastPos;
+ Math::Point m_mouseFirstPos;
+ Math::Point m_mouseLastPos;
float m_column;
bool m_bCapture;
diff --git a/src/ui/editvalue.cpp b/src/ui/editvalue.cpp
index dfbd65a..285094b 100644
--- a/src/ui/editvalue.cpp
+++ b/src/ui/editvalue.cpp
@@ -16,8 +16,6 @@
// editvalue.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -62,7 +60,7 @@ CEditValue::~CEditValue()
// Creates a new button.
-bool CEditValue::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CEditValue::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CEdit* pe;
CButton* pc;
@@ -92,13 +90,13 @@ bool CEditValue::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
}
-void CEditValue::SetPos(FPOINT pos)
+void CEditValue::SetPos(Math::Point pos)
{
CControl::SetPos(pos);
MoveAdjust();
}
-void CEditValue::SetDim(FPOINT dim)
+void CEditValue::SetDim(Math::Point dim)
{
CControl::SetDim(dim);
MoveAdjust();
@@ -106,7 +104,7 @@ void CEditValue::SetDim(FPOINT dim)
void CEditValue::MoveAdjust()
{
- FPOINT pos, dim;
+ Math::Point pos, dim;
if ( m_edit != 0 )
{
diff --git a/src/ui/editvalue.h b/src/ui/editvalue.h
index a05224f..1b45df9 100644
--- a/src/ui/editvalue.h
+++ b/src/ui/editvalue.h
@@ -42,10 +42,10 @@ public:
CEditValue(CInstanceManager* iMan);
virtual ~CEditValue();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
- void SetPos(FPOINT pos);
- void SetDim(FPOINT dim);
+ void SetPos(Math::Point pos);
+ void SetDim(Math::Point dim);
bool EventProcess(const Event &event);
void Draw();
diff --git a/src/ui/gauge.cpp b/src/ui/gauge.cpp
index b7a1b1a..072a923 100644
--- a/src/ui/gauge.cpp
+++ b/src/ui/gauge.cpp
@@ -16,8 +16,6 @@
// gauge.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -50,7 +48,7 @@ CGauge::~CGauge()
// Creates a new button.
-bool CGauge::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CGauge::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -84,7 +82,7 @@ bool CGauge::EventProcess(const Event &event)
void CGauge::Draw()
{
- FPOINT pos, dim, ddim, uv1, uv2, corner;
+ Math::Point pos, dim, ddim, uv1, uv2, corner;
float dp;
if ( (m_state & STATE_VISIBLE) == 0 ) return;
diff --git a/src/ui/gauge.h b/src/ui/gauge.h
index 2fef15b..70eae92 100644
--- a/src/ui/gauge.h
+++ b/src/ui/gauge.h
@@ -32,7 +32,7 @@ public:
CGauge(CInstanceManager* iMan);
virtual ~CGauge();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/group.cpp b/src/ui/group.cpp
index a19e39b..c77e131 100644
--- a/src/ui/group.cpp
+++ b/src/ui/group.cpp
@@ -16,8 +16,6 @@
// group.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -50,7 +48,7 @@ CGroup::~CGroup()
// Creates a new button.
-bool CGroup::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CGroup::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -83,7 +81,7 @@ bool CGroup::EventProcess(const Event &event)
void CGroup::Draw()
{
- FPOINT uv1,uv2, corner, pos, dim;
+ Math::Point uv1,uv2, corner, pos, dim;
float dp;
int icon;
@@ -283,13 +281,13 @@ void CGroup::Draw()
uv2.y = 255.5f/256.0f;
DrawIcon(pos, dim, uv1, uv2); // ul
pos.x += dim.x;
- Swap(uv1.x, uv2.x);
+ Math::Swap(uv1.x, uv2.x);
DrawIcon(pos, dim, uv1, uv2); // ur
pos.y -= dim.y;
- Swap(uv1.y, uv2.y);
+ Math::Swap(uv1.y, uv2.y);
DrawIcon(pos, dim, uv1, uv2); // dr
pos.x -= dim.x;
- Swap(uv1.x, uv2.x);
+ Math::Swap(uv1.x, uv2.x);
DrawIcon(pos, dim, uv1, uv2); // dl
m_engine->SetState(D3DSTATETTw);
@@ -301,13 +299,13 @@ void CGroup::Draw()
uv2.y = 255.5f/256.0f;
DrawIcon(pos, dim, uv1, uv2); // ul
pos.x += dim.x;
- Swap(uv1.x, uv2.x);
+ Math::Swap(uv1.x, uv2.x);
DrawIcon(pos, dim, uv1, uv2); // ur
pos.y -= dim.y;
- Swap(uv1.y, uv2.y);
+ Math::Swap(uv1.y, uv2.y);
DrawIcon(pos, dim, uv1, uv2); // dr
pos.x -= dim.x;
- Swap(uv1.x, uv2.x);
+ Math::Swap(uv1.x, uv2.x);
DrawIcon(pos, dim, uv1, uv2); // dl
}
if ( m_icon == 13 ) // corner upper / left?
diff --git a/src/ui/group.h b/src/ui/group.h
index 264ae54..3133b54 100644
--- a/src/ui/group.h
+++ b/src/ui/group.h
@@ -32,7 +32,7 @@ public:
CGroup(CInstanceManager* iMan);
virtual ~CGroup();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/image.cpp b/src/ui/image.cpp
index f229585..9019858 100644
--- a/src/ui/image.cpp
+++ b/src/ui/image.cpp
@@ -16,8 +16,6 @@
// image.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -55,7 +53,7 @@ CImage::~CImage()
// Creates a new button.
-bool CImage::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CImage::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -106,7 +104,7 @@ bool CImage::EventProcess(const Event &event)
void CImage::Draw()
{
- FPOINT uv1,uv2, corner, pos, dim;
+ Math::Point uv1,uv2, corner, pos, dim;
float dp;
if ( (m_state & STATE_VISIBLE) == 0 ) return;
diff --git a/src/ui/image.h b/src/ui/image.h
index 9d2aa29..d327598 100644
--- a/src/ui/image.h
+++ b/src/ui/image.h
@@ -32,7 +32,7 @@ public:
CImage(CInstanceManager* iMan);
virtual ~CImage();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 99b4755..8b8a888 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -16,8 +16,6 @@
// interface.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -98,7 +96,7 @@ void CInterface::Flush()
// Creates a new button.
-CWindow* CInterface::CreateWindows(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CWindow* CInterface::CreateWindows(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CWindow* pc;
int i;
@@ -134,7 +132,7 @@ CWindow* CInterface::CreateWindows(FPOINT pos, FPOINT dim, int icon, EventMsg ev
// Creates a new button.
-CButton* CInterface::CreateButton(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CButton* CInterface::CreateButton(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CButton* pc;
int i;
@@ -156,7 +154,7 @@ CButton* CInterface::CreateButton(FPOINT pos, FPOINT dim, int icon, EventMsg eve
// Creates a new button.
-CColor* CInterface::CreateColor(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CColor* CInterface::CreateColor(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CColor* pc;
int i;
@@ -178,7 +176,7 @@ CColor* CInterface::CreateColor(FPOINT pos, FPOINT dim, int icon, EventMsg event
// Creates a new button.
-CCheck* CInterface::CreateCheck(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CCheck* CInterface::CreateCheck(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CCheck* pc;
int i;
@@ -200,7 +198,7 @@ CCheck* CInterface::CreateCheck(FPOINT pos, FPOINT dim, int icon, EventMsg event
// Creates a new button.
-CKey* CInterface::CreateKey(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CKey* CInterface::CreateKey(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CKey* pc;
int i;
@@ -222,7 +220,7 @@ CKey* CInterface::CreateKey(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
// Creates a new button.
-CGroup* CInterface::CreateGroup(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CGroup* CInterface::CreateGroup(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CGroup* pc;
int i;
@@ -244,7 +242,7 @@ CGroup* CInterface::CreateGroup(FPOINT pos, FPOINT dim, int icon, EventMsg event
// Creates a new button.
-CImage* CInterface::CreateImage(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CImage* CInterface::CreateImage(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CImage* pc;
int i;
@@ -266,7 +264,7 @@ CImage* CInterface::CreateImage(FPOINT pos, FPOINT dim, int icon, EventMsg event
// Creates a new label.
-CLabel* CInterface::CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
+CLabel* CInterface::CreateLabel(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg,
char *name)
{
CLabel* pc;
@@ -290,7 +288,7 @@ CLabel* CInterface::CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg event
// Creates a new pave editable.
-CEdit* CInterface::CreateEdit(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CEdit* CInterface::CreateEdit(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CEdit* pc;
int i;
@@ -312,7 +310,7 @@ CEdit* CInterface::CreateEdit(FPOINT pos, FPOINT dim, int icon, EventMsg eventMs
// Creates a new pave editable.
-CEditValue* CInterface::CreateEditValue(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CEditValue* CInterface::CreateEditValue(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CEditValue* pc;
int i;
@@ -334,7 +332,7 @@ CEditValue* CInterface::CreateEditValue(FPOINT pos, FPOINT dim, int icon, EventM
// Creates a new lift.
-CScroll* CInterface::CreateScroll(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CScroll* CInterface::CreateScroll(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CScroll* pc;
int i;
@@ -356,7 +354,7 @@ CScroll* CInterface::CreateScroll(FPOINT pos, FPOINT dim, int icon, EventMsg eve
// Creates a new cursor.
-CSlider* CInterface::CreateSlider(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CSlider* CInterface::CreateSlider(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CSlider* pc;
int i;
@@ -378,7 +376,7 @@ CSlider* CInterface::CreateSlider(FPOINT pos, FPOINT dim, int icon, EventMsg eve
// Creates a new list.
-CList* CInterface::CreateList(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
+CList* CInterface::CreateList(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg,
float expand)
{
CList* pc;
@@ -401,7 +399,7 @@ CList* CInterface::CreateList(FPOINT pos, FPOINT dim, int icon, EventMsg eventMs
// Creates a new shortcut.
-CShortcut* CInterface::CreateShortcut(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CShortcut* CInterface::CreateShortcut(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CShortcut* ps;
int i;
@@ -423,7 +421,7 @@ CShortcut* CInterface::CreateShortcut(FPOINT pos, FPOINT dim, int icon, EventMsg
// Creates a new compass.
-CCompass* CInterface::CreateCompass(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CCompass* CInterface::CreateCompass(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CCompass* pc;
int i;
@@ -445,7 +443,7 @@ CCompass* CInterface::CreateCompass(FPOINT pos, FPOINT dim, int icon, EventMsg e
// Creates a new target.
-CTarget* CInterface::CreateTarget(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CTarget* CInterface::CreateTarget(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CTarget* pc;
int i;
@@ -467,7 +465,7 @@ CTarget* CInterface::CreateTarget(FPOINT pos, FPOINT dim, int icon, EventMsg eve
// Creates a new map.
-CMap* CInterface::CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CMap* CInterface::CreateMap(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CMap* pm;
int i;
@@ -560,7 +558,7 @@ bool CInterface::EventProcess(const Event &event)
// Gives the tooltip binding to the window.
-bool CInterface::GetTooltip(FPOINT pos, char* name)
+bool CInterface::GetTooltip(Math::Point pos, char* name)
{
int i;
diff --git a/src/ui/interface.h b/src/ui/interface.h
index 4c58997..0b3ba0d 100644
--- a/src/ui/interface.h
+++ b/src/ui/interface.h
@@ -19,6 +19,10 @@
#pragma once
+#include "common/event.h"
+#include "math/point.h"
+
+
class CInstanceManager;
class CD3DEngine;
class CControl;
@@ -53,26 +57,26 @@ public:
~CInterface();
bool EventProcess(const Event &event);
- bool GetTooltip(FPOINT pos, char* name);
+ bool GetTooltip(Math::Point pos, char* name);
void Flush();
- CWindow* CreateWindows(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);
- CKey* CreateKey(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CGroup* CreateGroup(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CImage* CreateImage(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CLabel* CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, char *name);
- CEdit* CreateEdit(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CEditValue* CreateEditValue(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CScroll* CreateScroll(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CSlider* CreateSlider(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CList* CreateList(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, float expand=1.2f);
- CShortcut* CreateShortcut(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);
- CMap* CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ CWindow* CreateWindows(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CButton* CreateButton(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CColor* CreateColor(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CCheck* CreateCheck(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CKey* CreateKey(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CGroup* CreateGroup(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CImage* CreateImage(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CLabel* CreateLabel(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg, char *name);
+ CEdit* CreateEdit(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CEditValue* CreateEditValue(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CScroll* CreateScroll(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CSlider* CreateSlider(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CList* CreateList(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg, float expand=1.2f);
+ CShortcut* CreateShortcut(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CCompass* CreateCompass(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CTarget* CreateTarget(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CMap* CreateMap(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool DeleteControl(EventMsg eventMsg);
CControl* SearchControl(EventMsg eventMsg);
diff --git a/src/ui/key.cpp b/src/ui/key.cpp
index d996244..1b8925d 100644
--- a/src/ui/key.cpp
+++ b/src/ui/key.cpp
@@ -16,8 +16,6 @@
// key.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -78,7 +76,7 @@ CKey::~CKey()
// Creates a new button.
-bool CKey::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CKey::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
char name[100];
char* p;
@@ -184,7 +182,7 @@ bool CKey::TestKey(int key)
void CKey::Draw()
{
- FPOINT iDim, pos;
+ Math::Point iDim, pos;
float zoomExt, zoomInt, h;
int icon;
char text[100];
diff --git a/src/ui/key.h b/src/ui/key.h
index c3f46fd..ebca010 100644
--- a/src/ui/key.h
+++ b/src/ui/key.h
@@ -32,7 +32,7 @@ public:
CKey(CInstanceManager* iMan);
virtual ~CKey();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/label.cpp b/src/ui/label.cpp
index 288631c..5458d28 100644
--- a/src/ui/label.cpp
+++ b/src/ui/label.cpp
@@ -16,8 +16,6 @@
// label.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -50,7 +48,7 @@ CLabel::~CLabel()
// Creates a new button.
-bool CLabel::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CLabel::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -72,7 +70,7 @@ bool CLabel::EventProcess(const Event &event)
void CLabel::Draw()
{
- FPOINT pos;
+ Math::Point pos;
if ( (m_state & STATE_VISIBLE) == 0 ) return;
diff --git a/src/ui/label.h b/src/ui/label.h
index 1594deb..c6199ba 100644
--- a/src/ui/label.h
+++ b/src/ui/label.h
@@ -32,7 +32,7 @@ public:
CLabel(CInstanceManager* iMan);
virtual ~CLabel();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/list.cpp b/src/ui/list.cpp
index be9dbda..f924fde 100644
--- a/src/ui/list.cpp
+++ b/src/ui/list.cpp
@@ -16,8 +16,6 @@
// list.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -90,7 +88,7 @@ CList::~CList()
// Creates a new list.
-bool CList::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
+bool CList::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg,
float expand)
{
m_expand = expand;
@@ -109,7 +107,7 @@ bool CList::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
bool CList::MoveAdjust()
{
- FPOINT ipos, idim, ppos, ddim;
+ Math::Point ipos, idim, ppos, ddim;
float marging, h;
int i;
@@ -186,12 +184,12 @@ EventMsg CList::RetEventMsgScroll()
}
-void CList::SetPos(FPOINT pos)
+void CList::SetPos(Math::Point pos)
{
CControl::SetPos(pos);
}
-void CList::SetDim(FPOINT dim)
+void CList::SetDim(Math::Point dim)
{
m_dim = dim;
MoveAdjust();
@@ -263,7 +261,7 @@ bool CList::EventProcess(const Event &event)
m_button[i] != 0 )
{
m_blinkTime += event.rTime;
- if ( Mod(m_blinkTime, 0.7f) < 0.3f )
+ if ( Math::Mod(m_blinkTime, 0.7f) < 0.3f )
{
m_button[i]->ClearState(STATE_ENABLE);
m_button[i]->ClearState(STATE_CHECK);
@@ -353,7 +351,7 @@ bool CList::EventProcess(const Event &event)
void CList::Draw()
{
- FPOINT uv1, uv2, corner, pos, dim, ppos, ddim;
+ Math::Point uv1, uv2, corner, pos, dim, ppos, ddim;
float dp;
int i, j;
char text[100];
@@ -555,7 +553,7 @@ void CList::Draw()
// Displays text in a box.
-void CList::DrawCase(char *text, FPOINT pos, float width, int justif)
+void CList::DrawCase(char *text, Math::Point pos, float width, int justif)
{
if ( justif == 1 )
{
diff --git a/src/ui/list.h b/src/ui/list.h
index ae55d35..ead058b 100644
--- a/src/ui/list.h
+++ b/src/ui/list.h
@@ -39,10 +39,10 @@ public:
CList(CInstanceManager* iMan);
~CList();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, float expand);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg, float expand);
- void SetPos(FPOINT pos);
- void SetDim(FPOINT dim);
+ void SetPos(Math::Point pos);
+ void SetDim(Math::Point dim);
bool SetState(int state, bool bState);
bool SetState(int state);
@@ -87,7 +87,7 @@ protected:
void UpdateButton();
void UpdateScroll();
void MoveScroll();
- void DrawCase(char *text, FPOINT pos, float width, int justif);
+ void DrawCase(char *text, Math::Point pos, float width, int justif);
protected:
CButton* m_button[LISTMAXDISPLAY];
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index 175474d..f57a913 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -16,8 +16,6 @@
// maindialog.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -207,7 +205,7 @@ CMainDialog::CMainDialog(CInstanceManager* iMan)
m_bEffect = true;
m_shotDelay = 0;
- m_glintMouse = FPOINT(0.0f, 0.0f);
+ m_glintMouse = Math::Point(0.0f, 0.0f);
m_glintTime = 1000.0f;
for ( i=0 ; i<10 ; i++ )
@@ -248,7 +246,7 @@ void CMainDialog::ChangePhase(Phase phase)
CColor* pco;
CGroup* pg;
CImage* pi;
- FPOINT pos, dim, ddim;
+ Math::Point pos, dim, ddim;
float ox, oy, sx, sy;
char name[100];
char* gamer;
@@ -3103,7 +3101,7 @@ void CMainDialog::GlintMove()
{
CWindow* pw;
CGroup* pg;
- FPOINT pos, dim, zoom;
+ Math::Point pos, dim, zoom;
if ( m_phase == PHASE_SIMUL ) return;
@@ -3255,7 +3253,7 @@ void CMainDialog::GlintMove()
// Returns the position for a sound.
-D3DVECTOR SoundPos(FPOINT pos)
+D3DVECTOR SoundPos(Math::Point pos)
{
D3DVECTOR s;
@@ -3272,8 +3270,8 @@ D3DVECTOR SoundRand()
{
D3DVECTOR s;
- s.x = (Rand()-0.5f)*2.0f;
- s.y = (Rand()-0.5f)*2.0f;
+ s.x = (Math::Rand()-0.5f)*2.0f;
+ s.y = (Math::Rand()-0.5f)*2.0f;
s.z = 0.0f;
return s;
@@ -3286,7 +3284,7 @@ void CMainDialog::FrameParticule(float rTime)
#if _NEWLOOK
#else
D3DVECTOR pos, speed;
- FPOINT dim;
+ Math::Point dim;
float *pParti, *pGlint;
int nParti, nGlint;
int i, r, ii;
@@ -3409,15 +3407,15 @@ void CMainDialog::FrameParticule(float rTime)
ii = rand()%nParti;
m_partiPos[i].x = pParti[ii*5+0]/640.0f;
m_partiPos[i].y = (480.0f-pParti[ii*5+1])/480.0f;
- m_partiTime[i] = pParti[ii*5+2]+Rand()*pParti[ii*5+3];
+ m_partiTime[i] = pParti[ii*5+2]+Math::Rand()*pParti[ii*5+3];
m_partiPhase[i] = (int)pParti[ii*5+4];
if ( m_partiPhase[i] == 3 )
{
- m_sound->Play(SOUND_PSHHH, SoundPos(m_partiPos[i]), 0.3f+Rand()*0.3f);
+ m_sound->Play(SOUND_PSHHH, SoundPos(m_partiPos[i]), 0.3f+Math::Rand()*0.3f);
}
else
{
- m_sound->Play(SOUND_GGG, SoundPos(m_partiPos[i]), 0.1f+Rand()*0.4f);
+ m_sound->Play(SOUND_GGG, SoundPos(m_partiPos[i]), 0.1f+Math::Rand()*0.4f);
}
}
@@ -3430,13 +3428,13 @@ void CMainDialog::FrameParticule(float rTime)
speed.x = 0.0f;
speed.y = 0.0f;
speed.z = 0.0f;
- dim.x = 0.04f+Rand()*0.04f;
+ dim.x = 0.04f+Math::Rand()*0.04f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim,
rand()%2?PARTIGLINT:PARTICONTROL,
- Rand()*0.4f+0.4f, 0.0f, 0.0f,
+ Math::Rand()*0.4f+0.4f, 0.0f, 0.0f,
SH_INTERFACE);
- m_partiTime[i] = 0.5f+Rand()*0.5f;
+ m_partiTime[i] = 0.5f+Math::Rand()*0.5f;
}
if ( r == 2 )
@@ -3444,38 +3442,38 @@ void CMainDialog::FrameParticule(float rTime)
ii = rand()%7;
if ( ii == 0 )
{
- m_sound->Play(SOUND_ENERGY, SoundRand(), 0.2f+Rand()*0.2f);
- m_partiTime[i] = 1.0f+Rand()*1.0f;
+ m_sound->Play(SOUND_ENERGY, SoundRand(), 0.2f+Math::Rand()*0.2f);
+ m_partiTime[i] = 1.0f+Math::Rand()*1.0f;
}
if ( ii == 1 )
{
- m_sound->Play(SOUND_STATION, SoundRand(), 0.2f+Rand()*0.2f);
- m_partiTime[i] = 1.0f+Rand()*2.0f;
+ m_sound->Play(SOUND_STATION, SoundRand(), 0.2f+Math::Rand()*0.2f);
+ m_partiTime[i] = 1.0f+Math::Rand()*2.0f;
}
if ( ii == 2 )
{
- m_sound->Play(SOUND_ALARM, SoundRand(), 0.1f+Rand()*0.1f);
- m_partiTime[i] = 2.0f+Rand()*4.0f;
+ m_sound->Play(SOUND_ALARM, SoundRand(), 0.1f+Math::Rand()*0.1f);
+ m_partiTime[i] = 2.0f+Math::Rand()*4.0f;
}
if ( ii == 3 )
{
- m_sound->Play(SOUND_INFO, SoundRand(), 0.1f+Rand()*0.1f);
- m_partiTime[i] = 2.0f+Rand()*4.0f;
+ m_sound->Play(SOUND_INFO, SoundRand(), 0.1f+Math::Rand()*0.1f);
+ m_partiTime[i] = 2.0f+Math::Rand()*4.0f;
}
if ( ii == 4 )
{
- m_sound->Play(SOUND_RADAR, SoundRand(), 0.2f+Rand()*0.2f);
- m_partiTime[i] = 0.5f+Rand()*1.0f;
+ m_sound->Play(SOUND_RADAR, SoundRand(), 0.2f+Math::Rand()*0.2f);
+ m_partiTime[i] = 0.5f+Math::Rand()*1.0f;
}
if ( ii == 5 )
{
- m_sound->Play(SOUND_GFLAT, SoundRand(), 0.3f+Rand()*0.3f);
- m_partiTime[i] = 2.0f+Rand()*4.0f;
+ m_sound->Play(SOUND_GFLAT, SoundRand(), 0.3f+Math::Rand()*0.3f);
+ m_partiTime[i] = 2.0f+Math::Rand()*4.0f;
}
if ( ii == 6 )
{
- m_sound->Play(SOUND_ALARMt, SoundRand(), 0.1f+Rand()*0.1f);
- m_partiTime[i] = 2.0f+Rand()*4.0f;
+ m_sound->Play(SOUND_ALARMt, SoundRand(), 0.1f+Math::Rand()*0.1f);
+ m_partiTime[i] = 2.0f+Math::Rand()*4.0f;
}
}
}
@@ -3491,27 +3489,27 @@ void CMainDialog::FrameParticule(float rTime)
pos.x = m_partiPos[i].x;
pos.y = m_partiPos[i].y;
pos.z = 0.0f;
- pos.x += (Rand()-0.5f)*0.01f;
- pos.y += (Rand()-0.5f)*0.01f;
- speed.x = (Rand()-0.5f)*0.2f;
- speed.y = (Rand()-0.5f)*0.2f;
+ pos.x += (Math::Rand()-0.5f)*0.01f;
+ pos.y += (Math::Rand()-0.5f)*0.01f;
+ speed.x = (Math::Rand()-0.5f)*0.2f;
+ speed.y = (Math::Rand()-0.5f)*0.2f;
speed.z = 0.0f;
- dim.x = 0.005f+Rand()*0.005f;
+ dim.x = 0.005f+Math::Rand()*0.005f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim, PARTIBLITZ,
- Rand()*0.2f+0.2f, 0.0f, 0.0f,
+ Math::Rand()*0.2f+0.2f, 0.0f, 0.0f,
SH_INTERFACE);
pos.x = m_partiPos[i].x;
pos.y = m_partiPos[i].y;
pos.z = 0.0f;
- speed.x = (Rand()-0.5f)*0.5f;
- speed.y = (0.3f+Rand()*0.3f);
+ speed.x = (Math::Rand()-0.5f)*0.5f;
+ speed.y = (0.3f+Math::Rand()*0.3f);
speed.z = 0.0f;
- dim.x = 0.01f+Rand()*0.01f;
+ dim.x = 0.01f+Math::Rand()*0.01f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim,
(ParticuleType)(PARTILENS1+rand()%3),
- Rand()*0.5f+0.5f, 2.0f, 0.0f,
+ Math::Rand()*0.5f+0.5f, 2.0f, 0.0f,
SH_INTERFACE);
}
if ( m_partiPhase[i] == 2 ) // sparks?
@@ -3519,26 +3517,26 @@ void CMainDialog::FrameParticule(float rTime)
pos.x = m_partiPos[i].x;
pos.y = m_partiPos[i].y;
pos.z = 0.0f;
- pos.x += (Rand()-0.5f)*0.01f;
- pos.y += (Rand()-0.5f)*0.01f;
- speed.x = (Rand()-0.5f)*0.2f;
- speed.y = (Rand()-0.5f)*0.2f;
+ pos.x += (Math::Rand()-0.5f)*0.01f;
+ pos.y += (Math::Rand()-0.5f)*0.01f;
+ speed.x = (Math::Rand()-0.5f)*0.2f;
+ speed.y = (Math::Rand()-0.5f)*0.2f;
speed.z = 0.0f;
- dim.x = 0.005f+Rand()*0.005f;
+ dim.x = 0.005f+Math::Rand()*0.005f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim, PARTIBLITZ,
- Rand()*0.2f+0.2f, 0.0f, 0.0f,
+ Math::Rand()*0.2f+0.2f, 0.0f, 0.0f,
SH_INTERFACE);
pos.x = m_partiPos[i].x;
pos.y = m_partiPos[i].y;
pos.z = 0.0f;
- speed.x = (Rand()-0.5f)*0.5f;
- speed.y = (0.3f+Rand()*0.3f);
+ speed.x = (Math::Rand()-0.5f)*0.5f;
+ speed.y = (0.3f+Math::Rand()*0.3f);
speed.z = 0.0f;
- dim.x = 0.005f+Rand()*0.005f;
+ dim.x = 0.005f+Math::Rand()*0.005f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim, PARTISCRAPS,
- Rand()*0.5f+0.5f, 2.0f, 0.0f,
+ Math::Rand()*0.5f+0.5f, 2.0f, 0.0f,
SH_INTERFACE);
}
if ( m_partiPhase[i] == 3 ) // smoke?
@@ -3546,22 +3544,22 @@ void CMainDialog::FrameParticule(float rTime)
pos.x = m_partiPos[i].x;
pos.y = m_partiPos[i].y;
pos.z = 0.0f;
- pos.x += (Rand()-0.5f)*0.03f;
- pos.y += (Rand()-0.5f)*0.03f;
- speed.x = (Rand()-0.5f)*0.2f;
- speed.y = Rand()*0.5f;
+ pos.x += (Math::Rand()-0.5f)*0.03f;
+ pos.y += (Math::Rand()-0.5f)*0.03f;
+ speed.x = (Math::Rand()-0.5f)*0.2f;
+ speed.y = Math::Rand()*0.5f;
speed.z = 0.0f;
- dim.x = 0.03f+Rand()*0.07f;
+ dim.x = 0.03f+Math::Rand()*0.07f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim, PARTICRASH,
- Rand()*0.4f+0.4f, 0.0f, 0.0f,
+ Math::Rand()*0.4f+0.4f, 0.0f, 0.0f,
SH_INTERFACE);
}
}
else
{
m_partiPhase[i] = 0;
- m_partiTime[i] = 2.0f+Rand()*4.0f;
+ m_partiTime[i] = 2.0f+Math::Rand()*4.0f;
}
}
}
@@ -3570,10 +3568,10 @@ void CMainDialog::FrameParticule(float rTime)
// Some nice particles following the mouse.
-void CMainDialog::NiceParticule(FPOINT mouse, bool bPress)
+void CMainDialog::NiceParticule(Math::Point mouse, bool bPress)
{
D3DVECTOR pos, speed;
- FPOINT dim;
+ Math::Point dim;
if ( !m_bRain ) return;
if ( (m_phase == PHASE_SIMUL ||
@@ -3587,13 +3585,13 @@ void CMainDialog::NiceParticule(FPOINT mouse, bool bPress)
pos.x = mouse.x;
pos.y = mouse.y;
pos.z = 0.0f;
- speed.x = (Rand()-0.5f)*0.5f;
- speed.y = (0.3f+Rand()*0.3f);
+ speed.x = (Math::Rand()-0.5f)*0.5f;
+ speed.y = (0.3f+Math::Rand()*0.3f);
speed.z = 0.0f;
- dim.x = 0.005f+Rand()*0.005f;
+ dim.x = 0.005f+Math::Rand()*0.005f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim, PARTISCRAPS,
- Rand()*0.5f+0.5f, 2.0f, 0.0f,
+ Math::Rand()*0.5f+0.5f, 2.0f, 0.0f,
SH_INTERFACE);
}
else
@@ -3601,14 +3599,14 @@ void CMainDialog::NiceParticule(FPOINT mouse, bool bPress)
pos.x = mouse.x;
pos.y = mouse.y;
pos.z = 0.0f;
- speed.x = (Rand()-0.5f)*0.5f;
- speed.y = (0.3f+Rand()*0.3f);
+ speed.x = (Math::Rand()-0.5f)*0.5f;
+ speed.y = (0.3f+Math::Rand()*0.3f);
speed.z = 0.0f;
- dim.x = 0.01f+Rand()*0.01f;
+ dim.x = 0.01f+Math::Rand()*0.01f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim,
(ParticuleType)(PARTILENS1+rand()%3),
- Rand()*0.5f+0.5f, 2.0f, 0.0f,
+ Math::Rand()*0.5f+0.5f, 2.0f, 0.0f,
SH_INTERFACE);
}
}
@@ -4037,9 +4035,9 @@ void CMainDialog::NameDelete()
bool EqColor(const D3DCOLORVALUE &c1, const D3DCOLORVALUE &c2)
{
- return (Abs(c1.r-c2.r) < 0.01f &&
- Abs(c1.g-c2.g) < 0.01f &&
- Abs(c1.b-c2.b) < 0.01f );
+ return (fabs(c1.r-c2.r) < 0.01f &&
+ fabs(c1.g-c2.g) < 0.01f &&
+ fabs(c1.b-c2.b) < 0.01f );
}
// Updates all the buttons for the character.
@@ -6026,7 +6024,7 @@ void CMainDialog::UpdateKey()
CWindow* pw;
CScroll* ps;
CKey* pk;
- FPOINT pos, dim;
+ Math::Point pos, dim;
int first, i;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW5);
@@ -6092,10 +6090,10 @@ void CMainDialog::StartAbort()
{
CWindow* pw;
CButton* pb;
- FPOINT pos, dim;
+ Math::Point pos, dim;
char name[100];
- StartDialog(FPOINT(0.3f, 0.8f), true, false, false);
+ StartDialog(Math::Point(0.3f, 0.8f), true, false, false);
m_bDialogDelete = false;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
@@ -6174,10 +6172,10 @@ void CMainDialog::StartDeleteObject()
{
CWindow* pw;
CButton* pb;
- FPOINT pos, dim;
+ Math::Point pos, dim;
char name[100];
- StartDialog(FPOINT(0.7f, 0.3f), false, true, true);
+ StartDialog(Math::Point(0.7f, 0.3f), false, true, true);
m_bDialogDelete = true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
@@ -6208,11 +6206,11 @@ void CMainDialog::StartDeleteGame(char *gamer)
{
CWindow* pw;
CButton* pb;
- FPOINT pos, dim;
+ Math::Point pos, dim;
char name[100];
char text[100];
- StartDialog(FPOINT(0.7f, 0.3f), false, true, true);
+ StartDialog(Math::Point(0.7f, 0.3f), false, true, true);
m_bDialogDelete = true;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
@@ -6244,10 +6242,10 @@ void CMainDialog::StartQuit()
{
CWindow* pw;
CButton* pb;
- FPOINT pos, dim;
+ Math::Point pos, dim;
char name[100];
- StartDialog(FPOINT(0.6f, 0.3f), false, true, true);
+ StartDialog(Math::Point(0.6f, 0.3f), false, true, true);
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
if ( pw == 0 ) return;
@@ -6273,11 +6271,11 @@ void CMainDialog::StartQuit()
// Beginning of displaying a dialog.
-void CMainDialog::StartDialog(FPOINT dim, bool bFire, bool bOK, bool bCancel)
+void CMainDialog::StartDialog(Math::Point dim, bool bFire, bool bOK, bool bCancel)
{
CWindow* pw;
CButton* pb;
- FPOINT pos, ddim;
+ Math::Point pos, ddim;
char name[100];
StartSuspend();
@@ -6363,7 +6361,7 @@ void CMainDialog::FrameDialog(float rTime)
{
CWindow* pw;
D3DVECTOR pos, speed;
- FPOINT dim, dpos, ddim;
+ Math::Point dim, dpos, ddim;
float zoom;
int i;
@@ -6378,7 +6376,7 @@ void CMainDialog::FrameDialog(float rTime)
{
if ( m_dialogTime < 0.50f )
{
- zoom = Bounce(m_dialogTime/0.50f);
+ zoom = Math::Bounce(m_dialogTime/0.50f);
}
else
{
@@ -6416,44 +6414,44 @@ void CMainDialog::FrameDialog(float rTime)
for ( i=0 ; i<2 ; i++ )
{
// Bottom.
- pos.x = dpos.x + ddim.x*Rand();
+ pos.x = dpos.x + ddim.x*Math::Rand();
pos.y = dpos.y;
- pos.x += (Rand()-0.5f)*(6.0f/640.0f);
- pos.y += Rand()*(16.0f/480.0f)-(10.0f/480.0f);
- dim.x = 0.01f+Rand()*0.01f;
+ pos.x += (Math::Rand()-0.5f)*(6.0f/640.0f);
+ pos.y += Math::Rand()*(16.0f/480.0f)-(10.0f/480.0f);
+ dim.x = 0.01f+Math::Rand()*0.01f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim,
(ParticuleType)(PARTILENS1+rand()%3),
1.0f, 0.0f, 0.0f, SH_INTERFACE);
// Top.
- pos.x = dpos.x + ddim.x*Rand();
+ pos.x = dpos.x + ddim.x*Math::Rand();
pos.y = dpos.y + ddim.y;
- pos.x += (Rand()-0.5f)*(6.0f/640.0f);
- pos.y -= Rand()*(16.0f/480.0f)-(10.0f/480.0f);
- dim.x = 0.01f+Rand()*0.01f;
+ pos.x += (Math::Rand()-0.5f)*(6.0f/640.0f);
+ pos.y -= Math::Rand()*(16.0f/480.0f)-(10.0f/480.0f);
+ dim.x = 0.01f+Math::Rand()*0.01f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim,
(ParticuleType)(PARTILENS1+rand()%3),
1.0f, 0.0f, 0.0f, SH_INTERFACE);
// Left.
- pos.y = dpos.y + ddim.y*Rand();
+ pos.y = dpos.y + ddim.y*Math::Rand();
pos.x = dpos.x;
- pos.x += Rand()*(16.0f/640.0f)-(10.0f/640.0f);
- pos.y += (Rand()-0.5f)*(6.0f/480.0f);
- dim.x = 0.01f+Rand()*0.01f;
+ pos.x += Math::Rand()*(16.0f/640.0f)-(10.0f/640.0f);
+ pos.y += (Math::Rand()-0.5f)*(6.0f/480.0f);
+ dim.x = 0.01f+Math::Rand()*0.01f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim,
(ParticuleType)(PARTILENS1+rand()%3),
1.0f, 0.0f, 0.0f, SH_INTERFACE);
// Right.
- pos.y = dpos.y + ddim.y*Rand();
+ pos.y = dpos.y + ddim.y*Math::Rand();
pos.x = dpos.x + ddim.x;
- pos.x -= Rand()*(16.0f/640.0f)-(10.0f/640.0f);
- pos.y += (Rand()-0.5f)*(6.0f/480.0f);
- dim.x = 0.01f+Rand()*0.01f;
+ pos.x -= Math::Rand()*(16.0f/640.0f)-(10.0f/640.0f);
+ pos.y += (Math::Rand()-0.5f)*(6.0f/480.0f);
+ dim.x = 0.01f+Math::Rand()*0.01f;
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim,
(ParticuleType)(PARTILENS1+rand()%3),
diff --git a/src/ui/maindialog.h b/src/ui/maindialog.h
index 9173dde..5819cf8 100644
--- a/src/ui/maindialog.h
+++ b/src/ui/maindialog.h
@@ -92,7 +92,7 @@ public:
void StartDeleteObject();
void StartDeleteGame(char *gamer);
void StartQuit();
- void StartDialog(FPOINT dim, bool bFire, bool bOK, bool bCancel);
+ void StartDialog(Math::Point dim, bool bFire, bool bOK, bool bCancel);
void FrameDialog(float rTime);
void StopDialog();
bool IsDialog();
@@ -129,7 +129,7 @@ public:
protected:
void GlintMove();
void FrameParticule(float rTime);
- void NiceParticule(FPOINT mouse, bool bPress);
+ void NiceParticule(Math::Point mouse, bool bPress);
void ReadNameList();
void UpdateNameList();
void UpdateNameEdit();
@@ -228,7 +228,7 @@ protected:
bool m_bCameraInvertY; // for CCamera
bool m_bEffect; // for CCamera
- FPOINT m_glintMouse;
+ Math::Point m_glintMouse;
float m_glintTime;
int m_loadingCounter;
@@ -236,8 +236,8 @@ protected:
bool m_bDialog; // this dialogue?
bool m_bDialogFire; // setting on fire?
bool m_bDialogDelete;
- FPOINT m_dialogPos;
- FPOINT m_dialogDim;
+ Math::Point m_dialogPos;
+ Math::Point m_dialogDim;
float m_dialogParti;
float m_dialogTime;
bool m_bInitPause;
@@ -245,7 +245,7 @@ protected:
int m_partiPhase[10];
float m_partiTime[10];
- FPOINT m_partiPos[10];
+ Math::Point m_partiPos[10];
SceneInfo m_sceneInfo[MAXSCENE];
};
diff --git a/src/ui/mainmap.cpp b/src/ui/mainmap.cpp
index 72452d8..2b05775 100644
--- a/src/ui/mainmap.cpp
+++ b/src/ui/mainmap.cpp
@@ -16,8 +16,6 @@
// mainmap.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -72,7 +70,7 @@ CMainMap::~CMainMap()
void CMainMap::CreateMap()
{
CWindow* pw;
- FPOINT pos, dim;
+ Math::Point pos, dim;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW1);
if ( pw == 0 )
@@ -169,7 +167,7 @@ void CMainMap::DimMap()
CWindow* pw;
CMap* pm;
CSlider* ps;
- FPOINT pos, dim;
+ Math::Point pos, dim;
float value;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW1);
@@ -369,7 +367,7 @@ bool CMainMap::RetFixImage()
// The object is detected in the mini-map.
-CObject* CMainMap::DetectMap(FPOINT pos, bool &bInMap)
+CObject* CMainMap::DetectMap(Math::Point pos, bool &bInMap)
{
CWindow* pw;
CMap* pm;
diff --git a/src/ui/mainmap.h b/src/ui/mainmap.h
index 1c0e1fd..6b10d94 100644
--- a/src/ui/mainmap.h
+++ b/src/ui/mainmap.h
@@ -19,6 +19,10 @@
#pragma once
+#include "common/struct.h"
+#include "math/point.h"
+
+
class CInstanceManager;
class CEvent;
class CD3DEngine;
@@ -45,7 +49,7 @@ public:
void MapEnable(bool bEnable);
bool RetShowMap();
bool RetFixImage();
- CObject* DetectMap(FPOINT pos, bool &bInMap);
+ CObject* DetectMap(Math::Point 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);
diff --git a/src/ui/mainshort.cpp b/src/ui/mainshort.cpp
index c68f21c..5d574e4 100644
--- a/src/ui/mainshort.cpp
+++ b/src/ui/mainshort.cpp
@@ -16,8 +16,6 @@
// mainshort.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -111,7 +109,7 @@ bool CMainShort::CreateShortcuts()
CObject* pObj;
CControl* pc;
ObjectType type;
- FPOINT pos, dim;
+ Math::Point pos, dim;
int i, rank, icon;
char name[100];
@@ -319,10 +317,10 @@ void CMainShort::SelectNext()
// The object detected by the mouse hovers over.
-CObject* CMainShort::DetectShort(FPOINT pos)
+CObject* CMainShort::DetectShort(Math::Point pos)
{
CControl* pc;
- FPOINT cpos, cdim;
+ Math::Point cpos, cdim;
int i;
for ( i=0 ; i<20 ; i++ )
diff --git a/src/ui/mainshort.h b/src/ui/mainshort.h
index 1b507d4..82b0253 100644
--- a/src/ui/mainshort.h
+++ b/src/ui/mainshort.h
@@ -19,8 +19,11 @@
#pragma once
+#include "common/event.h"
+#include "math/point.h"
+
+
class CInstanceManager;
-class CEvent;
class CD3DEngine;
class CInterface;
class CRobotMain;
@@ -40,7 +43,7 @@ public:
bool UpdateShortcuts();
void SelectShortcut(EventMsg event);
void SelectNext();
- CObject* DetectShort(FPOINT pos);
+ CObject* DetectShort(Math::Point pos);
void SetHilite(CObject* pObj);
protected:
diff --git a/src/ui/map.cpp b/src/ui/map.cpp
index a4bdecb..437ad58 100644
--- a/src/ui/map.cpp
+++ b/src/ui/map.cpp
@@ -16,14 +16,13 @@
// map.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
#include <d3d.h>
#include "common/struct.h"
+#include "math/geometry.h"
#include "graphics/d3d/d3dengine.h"
#include "common/event.h"
#include "math/old/math3d.h"
@@ -82,7 +81,7 @@ CMap::~CMap()
// Creates a new button.
-bool CMap::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CMap::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -224,7 +223,7 @@ bool CMap::EventProcess(const Event &event)
// Adjusts the offset to not exceed the card.
-FPOINT CMap::AdjustOffset(FPOINT offset)
+Math::Point CMap::AdjustOffset(Math::Point offset)
{
float limit;
@@ -261,7 +260,7 @@ void CMap::SetHilite(CObject* pObj)
// Detects an object in the map.
-CObject* CMap::DetectObject(FPOINT pos, bool &bInMap)
+CObject* CMap::DetectObject(Math::Point pos, bool &bInMap)
{
float dist, min;
int i, best;
@@ -301,7 +300,7 @@ CObject* CMap::DetectObject(FPOINT pos, bool &bInMap)
// Selects an object.
-void CMap::SelectObject(FPOINT pos)
+void CMap::SelectObject(Math::Point pos)
{
CObject *pObj;
bool bInMap;
@@ -318,7 +317,7 @@ void CMap::SelectObject(FPOINT pos)
void CMap::Draw()
{
- FPOINT uv1, uv2;
+ Math::Point uv1, uv2;
int i;
if ( (m_state & STATE_VISIBLE) == 0 ) return;
@@ -388,14 +387,14 @@ void CMap::Draw()
// Computing a point for drawFocus.
-FPOINT CMap::MapInter(FPOINT pos, float dir)
+Math::Point CMap::MapInter(Math::Point pos, float dir)
{
- FPOINT p1;
+ Math::Point p1;
float limit;
p1.x = pos.x+1.0f;
p1.y = pos.y;
- p1 = RotatePoint(pos, dir, p1);
+ p1 = Math::RotatePoint(pos, dir, p1);
p1.x -= pos.x;
p1.y -= pos.y;
@@ -432,9 +431,9 @@ FPOINT CMap::MapInter(FPOINT pos, float dir)
// Draw the field of vision of the selected object.
-void CMap::DrawFocus(FPOINT pos, float dir, ObjectType type, MapColor color)
+void CMap::DrawFocus(Math::Point pos, float dir, ObjectType type, MapColor color)
{
- FPOINT p0, p1, p2, uv1, uv2, rel;
+ Math::Point p0, p1, p2, uv1, uv2, rel;
float aMin, aMax, aOct, focus, a;
float limit[5];
bool bEnding;
@@ -456,22 +455,22 @@ void CMap::DrawFocus(FPOINT pos, float dir, ObjectType type, MapColor color)
pos.y = m_mapPos.y*0.75f+m_mapDim.y*pos.y*0.75f;
focus = m_engine->RetFocus();
- dir += PI/2.0f;
- aMin = NormAngle(dir-PI/4.0f*focus);
- aMax = NormAngle(dir+PI/4.0f*focus);
+ dir += Math::PI/2.0f;
+ aMin = Math::NormAngle(dir-Math::PI/4.0f*focus);
+ aMax = Math::NormAngle(dir+Math::PI/4.0f*focus);
if ( aMin > aMax )
{
- aMax += PI*2.0f; // aMax always after aMin
+ aMax += Math::PI*2.0f; // aMax always after aMin
}
- limit[0] = RotateAngle( 1.0f-rel.x, 1.0f-rel.y); // upper/right
- limit[1] = RotateAngle(-1.0f-rel.x, 1.0f-rel.y); // upper/left
- limit[2] = RotateAngle(-1.0f-rel.x, -1.0f-rel.y); // lower/left
- limit[3] = RotateAngle( 1.0f-rel.x, -1.0f-rel.y); // lower/right
- limit[4] = limit[0]+PI*2.0f;
+ limit[0] = Math::RotateAngle( 1.0f-rel.x, 1.0f-rel.y); // upper/right
+ limit[1] = Math::RotateAngle(-1.0f-rel.x, 1.0f-rel.y); // upper/left
+ limit[2] = Math::RotateAngle(-1.0f-rel.x, -1.0f-rel.y); // lower/left
+ limit[3] = Math::RotateAngle( 1.0f-rel.x, -1.0f-rel.y); // lower/right
+ limit[4] = limit[0]+Math::PI*2.0f;
- a = NormAngle(aMin);
+ a = Math::NormAngle(aMin);
for ( quart=0 ; quart<4 ; quart++ )
{
if ( a >= limit[quart+0] &&
@@ -492,8 +491,8 @@ void CMap::DrawFocus(FPOINT pos, float dir, ObjectType type, MapColor color)
{
quart ++;
aOct = limit[quart%4];
- if ( quart >= 4 ) aOct += PI*2.0f;
- if ( aOct >= aMax-CHOUIA )
+ if ( quart >= 4 ) aOct += Math::PI*2.0f;
+ if ( aOct >= aMax-Math::VERY_SMALL )
{
aOct = aMax;
bEnding = true;
@@ -514,10 +513,10 @@ 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,
+void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor color,
bool bSelect, bool bHilite)
{
- FPOINT p1, p2, p3, p4, p5, dim, uv1, uv2;
+ Math::Point p1, p2, p3, p4, p5, dim, uv1, uv2;
bool bOut, bUp, bDown, bLeft, bRight;
pos.x = (pos.x-m_offset.x)*(m_zoom*0.5f)/m_half+0.5f;
@@ -539,7 +538,7 @@ void CMap::DrawObject(FPOINT pos, float dir, ObjectType type, MapColor color,
if ( color == MAPCOLOR_BBOX && !m_bRadar ) return;
if ( color == MAPCOLOR_ALIEN && !m_bRadar ) return;
- if ( Mod(m_time+(pos.x+pos.y)*4.0f, 0.6f) > 0.2f )
+ if ( Math::Mod(m_time+(pos.x+pos.y)*4.0f, 0.6f) > 0.2f )
{
return; // flashes
}
@@ -632,44 +631,44 @@ void CMap::DrawObject(FPOINT pos, float dir, ObjectType type, MapColor color,
{
p1.x = pos.x;
p1.y = pos.y+dim.y*1.4f;
- p1 = RotatePoint(pos, dir, p1);
+ p1 = Math::RotatePoint(pos, dir, p1);
p1.x = pos.x+(p1.x-pos.x)*0.75f;
p2.x = pos.x+dim.x*1.2f;
p2.y = pos.y+dim.y*0.8f;
- p2 = RotatePoint(pos, dir, p2);
+ p2 = Math::RotatePoint(pos, dir, p2);
p2.x = pos.x+(p2.x-pos.x)*0.75f;
p3.x = pos.x+dim.x*1.2f;
p3.y = pos.y-dim.y*1.0f;
- p3 = RotatePoint(pos, dir, p3);
+ p3 = Math::RotatePoint(pos, dir, p3);
p3.x = pos.x+(p3.x-pos.x)*0.75f;
p4.x = pos.x-dim.x*1.2f;
p4.y = pos.y-dim.y*1.0f;
- p4 = RotatePoint(pos, dir, p4);
+ p4 = Math::RotatePoint(pos, dir, p4);
p4.x = pos.x+(p4.x-pos.x)*0.75f;
p5.x = pos.x-dim.x*1.2f;
p5.y = pos.y+dim.y*0.8f;
- p5 = RotatePoint(pos, dir, p5);
+ p5 = Math::RotatePoint(pos, dir, p5);
p5.x = pos.x+(p5.x-pos.x)*0.75f;
}
else
{
p1.x = pos.x;
p1.y = pos.y+dim.y*2.4f;
- p1 = RotatePoint(pos, dir, p1);
+ p1 = Math::RotatePoint(pos, dir, p1);
p1.x = pos.x+(p1.x-pos.x)*0.75f;
p2.x = pos.x+dim.x*1.0f;
p2.y = pos.y-dim.y*1.6f;
- p2 = RotatePoint(pos, dir, p2);
+ p2 = Math::RotatePoint(pos, dir, p2);
p2.x = pos.x+(p2.x-pos.x)*0.75f;
p3.x = pos.x-dim.x*1.0f;
p3.y = pos.y-dim.y*1.6f;
- p3 = RotatePoint(pos, dir, p3);
+ p3 = Math::RotatePoint(pos, dir, p3);
p3.x = pos.x+(p3.x-pos.x)*0.75f;
}
}
@@ -785,10 +784,10 @@ 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,
+void CMap::DrawObjectIcon(Math::Point pos, Math::Point dim, MapColor color,
ObjectType type, bool bHilite)
{
- FPOINT ppos, ddim, uv1, uv2;
+ Math::Point ppos, ddim, uv1, uv2;
float dp;
int icon;
@@ -893,9 +892,9 @@ void CMap::DrawObjectIcon(FPOINT pos, FPOINT dim, MapColor color,
// Draw the object with the mouse hovers over.
-void CMap::DrawHilite(FPOINT pos)
+void CMap::DrawHilite(Math::Point pos)
{
- FPOINT dim, uv1, uv2;
+ Math::Point dim, uv1, uv2;
bool bOut, bUp, bDown, bLeft, bRight;
if ( m_bToy || m_fixImage[0] != 0 ) return; // map with still image?
@@ -929,7 +928,7 @@ void CMap::DrawHilite(FPOINT pos)
// Draws a triangular icon.
-void CMap::DrawTriangle(FPOINT p1, FPOINT p2, FPOINT p3, FPOINT uv1, FPOINT uv2)
+void CMap::DrawTriangle(Math::Point p1, Math::Point p2, Math::Point p3, Math::Point uv1, Math::Point uv2)
{
LPDIRECT3DDEVICE7 device;
D3DVERTEX2 vertex[3]; // 1 triangle
@@ -949,7 +948,7 @@ void CMap::DrawTriangle(FPOINT p1, FPOINT p2, FPOINT p3, FPOINT uv1, FPOINT uv2)
// Draw a pentagon icon (a 5 rating, what!).
-void CMap::DrawPenta(FPOINT p1, FPOINT p2, FPOINT p3, FPOINT p4, FPOINT p5, FPOINT uv1, FPOINT uv2)
+void CMap::DrawPenta(Math::Point p1, Math::Point p2, Math::Point p3, Math::Point p4, Math::Point p5, Math::Point uv1, Math::Point uv2)
{
LPDIRECT3DDEVICE7 device;
D3DVERTEX2 vertex[5]; // 1 pentagon
@@ -979,11 +978,11 @@ void CMap::DrawPenta(FPOINT p1, FPOINT p2, FPOINT p3, FPOINT p4, FPOINT p5, FPOI
// Draw the vertex array.
-void CMap::DrawVertex(FPOINT uv1, FPOINT uv2, float zoom)
+void CMap::DrawVertex(Math::Point uv1, Math::Point uv2, float zoom)
{
LPDIRECT3DDEVICE7 device;
D3DVERTEX2 vertex[4]; // 2 triangles
- FPOINT p1, p2, c;
+ Math::Point p1, p2, c;
D3DVECTOR n;
device = m_engine->RetD3DDevice();
@@ -1161,7 +1160,7 @@ void CMap::UpdateObject(CObject* pObj)
ObjectType type;
MapColor color;
D3DVECTOR pos;
- FPOINT ppos;
+ Math::Point ppos;
float dir;
if ( !m_bEnable ) return;
@@ -1174,11 +1173,11 @@ void CMap::UpdateObject(CObject* pObj)
type = pObj->RetType();
pos = pObj->RetPosition(0);
- dir = -(pObj->RetAngleY(0)+PI/2.0f);
+ dir = -(pObj->RetAngleY(0)+Math::PI/2.0f);
if ( m_angle != 0.0f )
{
- ppos = RotatePoint(m_angle, FPOINT(pos.x, pos.z));
+ ppos = RotatePoint(m_angle, Math::Point(pos.x, pos.z));
pos.x = ppos.x;
pos.z = ppos.y;
dir += m_angle;
diff --git a/src/ui/map.h b/src/ui/map.h
index f2df265..9551d12 100644
--- a/src/ui/map.h
+++ b/src/ui/map.h
@@ -20,7 +20,6 @@
#include "ui/control.h"
-#include "common/struct.h"
#include "object/object.h"
@@ -54,7 +53,7 @@ struct MapObject
CObject* object;
MapColor color;
ObjectType type;
- FPOINT pos;
+ Math::Point pos;
float dir;
};
@@ -66,7 +65,7 @@ public:
CMap(CInstanceManager* iMan);
~CMap();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
void Draw();
@@ -94,20 +93,20 @@ public:
void FlushObject();
void UpdateObject(CObject* pObj);
- CObject* DetectObject(FPOINT pos, bool &bInMap);
+ CObject* DetectObject(Math::Point pos, bool &bInMap);
void SetHilite(CObject* pObj);
protected:
- FPOINT AdjustOffset(FPOINT offset);
- 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 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);
- void DrawVertex(FPOINT uv1, FPOINT uv2, float zoom);
+ Math::Point AdjustOffset(Math::Point offset);
+ void SelectObject(Math::Point pos);
+ Math::Point MapInter(Math::Point pos, float dir);
+ void DrawFocus(Math::Point pos, float dir, ObjectType type, MapColor color);
+ void DrawObject(Math::Point pos, float dir, ObjectType type, MapColor color, bool bSelect, bool bHilite);
+ void DrawObjectIcon(Math::Point pos, Math::Point dim, MapColor color, ObjectType type, bool bHilite);
+ void DrawHilite(Math::Point pos);
+ void DrawTriangle(Math::Point p1, Math::Point p2, Math::Point p3, Math::Point uv1, Math::Point uv2);
+ void DrawPenta(Math::Point p1, Math::Point p2, Math::Point p3, Math::Point p4, Math::Point p5, Math::Point uv1, Math::Point uv2);
+ void DrawVertex(Math::Point uv1, Math::Point uv2, float zoom);
protected:
CTerrain* m_terrain;
@@ -118,7 +117,7 @@ protected:
float m_time;
float m_half;
float m_zoom;
- FPOINT m_offset;
+ Math::Point m_offset;
float m_angle;
D3DCOLORVALUE m_floorColor;
D3DCOLORVALUE m_waterColor;
@@ -126,8 +125,8 @@ protected:
int m_totalFix;
int m_totalMove;
int m_hiliteRank;
- FPOINT m_mapPos;
- FPOINT m_mapDim;
+ Math::Point m_mapPos;
+ Math::Point m_mapDim;
bool m_bRadar;
char m_fixImage[100];
int m_mode;
diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp
index 7cc8304..40b5545 100644
--- a/src/ui/scroll.cpp
+++ b/src/ui/scroll.cpp
@@ -16,8 +16,6 @@
// scroll.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -63,7 +61,7 @@ CScroll::~CScroll()
// Creates a new button.
-bool CScroll::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CScroll::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
@@ -73,13 +71,13 @@ bool CScroll::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
}
-void CScroll::SetPos(FPOINT pos)
+void CScroll::SetPos(Math::Point pos)
{
CControl::SetPos(pos);
MoveAdjust();
}
-void CScroll::SetDim(FPOINT dim)
+void CScroll::SetDim(Math::Point dim)
{
CControl::SetDim(dim);
MoveAdjust();
@@ -90,7 +88,7 @@ void CScroll::SetDim(FPOINT dim)
void CScroll::MoveAdjust()
{
CButton* pc;
- FPOINT pos, dim;
+ Math::Point pos, dim;
if ( m_dim.y < m_dim.x*2.0f ) // very short lift?
{
@@ -106,7 +104,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->Create(Math::Point(0.0f, 0.0f), Math::Point(0.0f, 0.0f), 49, EVENT_NULL);
pc->SetRepeat(true);
m_eventUp = pc->RetEventMsg();
}
@@ -115,7 +113,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->Create(Math::Point(0.0f, 0.0f), Math::Point(0.0f, 0.0f), 50, EVENT_NULL);
pc->SetRepeat(true);
m_eventDown = pc->RetEventMsg();
}
@@ -148,7 +146,7 @@ void CScroll::MoveAdjust()
void CScroll::AdjustGlint()
{
- FPOINT ref;
+ Math::Point ref;
float hButton, h;
hButton = m_buttonUp?m_dim.x/0.75f:0.0f;
@@ -201,7 +199,7 @@ bool CScroll::ClearState(int state)
bool CScroll::EventProcess(const Event &event)
{
- FPOINT pos, dim;
+ Math::Point pos, dim;
float hButton, h, value;
CControl::EventProcess(event);
@@ -322,7 +320,7 @@ bool CScroll::EventProcess(const Event &event)
void CScroll::Draw()
{
- FPOINT pos, dim, ppos, ddim;
+ Math::Point pos, dim, ppos, ddim;
float hButton;
int icon, n, i;
@@ -375,9 +373,9 @@ void CScroll::Draw()
// Draws a rectangle.
-void CScroll::DrawVertex(FPOINT pos, FPOINT dim, int icon)
+void CScroll::DrawVertex(Math::Point pos, Math::Point dim, int icon)
{
- FPOINT uv1, uv2;
+ Math::Point uv1, uv2;
float ex, dp;
if ( icon == 0 )
diff --git a/src/ui/scroll.h b/src/ui/scroll.h
index 67dc543..26b8d9b 100644
--- a/src/ui/scroll.h
+++ b/src/ui/scroll.h
@@ -20,7 +20,6 @@
#include "ui/control.h"
-#include "common/struct.h"
class CD3DEngine;
@@ -37,10 +36,10 @@ public:
CScroll(CInstanceManager* iMan);
~CScroll();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
- void SetPos(FPOINT pos);
- void SetDim(FPOINT dim);
+ void SetPos(Math::Point pos);
+ void SetDim(Math::Point dim);
bool SetState(int state, bool bState);
bool SetState(int state);
@@ -61,7 +60,7 @@ public:
protected:
void MoveAdjust();
void AdjustGlint();
- void DrawVertex(FPOINT pos, FPOINT dim, int icon);
+ void DrawVertex(Math::Point pos, Math::Point dim, int icon);
protected:
CButton* m_buttonUp;
@@ -72,7 +71,7 @@ protected:
float m_step;
bool m_bCapture;
- FPOINT m_pressPos;
+ Math::Point m_pressPos;
float m_pressValue;
EventMsg m_eventUp;
diff --git a/src/ui/shortcut.cpp b/src/ui/shortcut.cpp
index 7022bf2..c96cc92 100644
--- a/src/ui/shortcut.cpp
+++ b/src/ui/shortcut.cpp
@@ -16,8 +16,6 @@
// shortcut.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -50,7 +48,7 @@ CShortcut::~CShortcut()
// Creates a new button.
-bool CShortcut::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CShortcut::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -132,7 +130,7 @@ void CShortcut::Draw()
if ( m_state & STATE_FRAME )
{
- FPOINT p1, p2, c, uv1, uv2;
+ Math::Point p1, p2, c, uv1, uv2;
float zoom, dp;
m_engine->SetTexture("button2.tga");
@@ -170,9 +168,9 @@ void CShortcut::Draw()
DrawIcon(p1, p2, uv1, uv2);
}
- if ( (m_state & STATE_RUN) && Mod(m_time, 0.7f) >= 0.3f )
+ if ( (m_state & STATE_RUN) && Math::Mod(m_time, 0.7f) >= 0.3f )
{
- FPOINT uv1, uv2;
+ Math::Point uv1, uv2;
float dp;
m_engine->SetTexture("button3.tga");
@@ -199,7 +197,7 @@ void CShortcut::DrawVertex(int icon, float zoom)
{
LPDIRECT3DDEVICE7 device;
D3DVERTEX2 vertex[4]; // 2 triangles
- FPOINT p1, p2, c;
+ Math::Point p1, p2, c;
D3DVECTOR n;
float u1, u2, v1, v2, dp;
diff --git a/src/ui/shortcut.h b/src/ui/shortcut.h
index 0b36c84..528afd2 100644
--- a/src/ui/shortcut.h
+++ b/src/ui/shortcut.h
@@ -32,7 +32,7 @@ public:
CShortcut(CInstanceManager* iMan);
~CShortcut();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
diff --git a/src/ui/slider.cpp b/src/ui/slider.cpp
index 6c2a46a..39c8f6b 100644
--- a/src/ui/slider.cpp
+++ b/src/ui/slider.cpp
@@ -16,8 +16,6 @@
// slider.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -73,7 +71,7 @@ CSlider::~CSlider()
// Creates a new button.
-bool CSlider::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CSlider::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
CControl::Create(pos, dim, icon, eventMsg);
@@ -83,13 +81,13 @@ bool CSlider::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
}
-void CSlider::SetPos(FPOINT pos)
+void CSlider::SetPos(Math::Point pos)
{
CControl::SetPos(pos);
MoveAdjust();
}
-void CSlider::SetDim(FPOINT dim)
+void CSlider::SetDim(Math::Point dim)
{
CControl::SetDim(dim);
MoveAdjust();
@@ -97,7 +95,7 @@ void CSlider::SetDim(FPOINT dim)
void CSlider::MoveAdjust()
{
- FPOINT pos, dim;
+ Math::Point pos, dim;
m_bHoriz = ( m_dim.x > m_dim.y );
@@ -118,7 +116,7 @@ void CSlider::MoveAdjust()
if ( m_buttonLeft == 0 )
{
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->Create(Math::Point(0.0f, 0.0f), Math::Point(0.0f, 0.0f), m_bHoriz?55:49, EVENT_NULL); // </^
m_buttonLeft->SetRepeat(true);
if ( m_state & STATE_SHADOW ) m_buttonLeft->SetState(STATE_SHADOW);
m_eventUp = m_buttonLeft->RetEventMsg();
@@ -127,7 +125,7 @@ void CSlider::MoveAdjust()
if ( m_buttonRight == 0 )
{
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->Create(Math::Point(0.0f, 0.0f), Math::Point(0.0f, 0.0f), m_bHoriz?48:50, EVENT_NULL); // >/v
m_buttonRight->SetRepeat(true);
if ( m_state & STATE_SHADOW ) m_buttonRight->SetState(STATE_SHADOW);
m_eventDown = m_buttonRight->RetEventMsg();
@@ -184,7 +182,7 @@ void CSlider::MoveAdjust()
void CSlider::AdjustGlint()
{
- FPOINT ref;
+ Math::Point ref;
float w;
if ( m_bHoriz )
@@ -247,7 +245,7 @@ bool CSlider::ClearState(int state)
bool CSlider::EventProcess(const Event &event)
{
- FPOINT pos, dim;
+ Math::Point pos, dim;
float value;
if ( (m_state & STATE_VISIBLE) == 0 ) return true;
@@ -384,7 +382,7 @@ bool CSlider::EventProcess(const Event &event)
void CSlider::Draw()
{
- FPOINT pos, dim, ppos, ddim, spos;
+ Math::Point pos, dim, ppos, ddim, spos;
int icon;
float h;
char text[100];
@@ -491,9 +489,9 @@ void CSlider::Draw()
// Draws a rectangle.
-void CSlider::DrawVertex(FPOINT pos, FPOINT dim, int icon)
+void CSlider::DrawVertex(Math::Point pos, Math::Point dim, int icon)
{
- FPOINT uv1, uv2, corner;
+ Math::Point uv1, uv2, corner;
float ex, dp;
if ( icon == 0 )
diff --git a/src/ui/slider.h b/src/ui/slider.h
index 8d1033f..a1eb127 100644
--- a/src/ui/slider.h
+++ b/src/ui/slider.h
@@ -20,7 +20,6 @@
#include "ui/control.h"
-#include "common/struct.h"
class CD3DEngine;
@@ -34,10 +33,10 @@ public:
CSlider(CInstanceManager* iMan);
~CSlider();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
- void SetPos(FPOINT pos);
- void SetDim(FPOINT dim);
+ void SetPos(Math::Point pos);
+ void SetDim(Math::Point dim);
bool SetState(int state, bool bState);
bool SetState(int state);
@@ -57,7 +56,7 @@ public:
protected:
void MoveAdjust();
void AdjustGlint();
- void DrawVertex(FPOINT pos, FPOINT dim, int icon);
+ void DrawVertex(Math::Point pos, Math::Point dim, int icon);
protected:
CButton* m_buttonLeft;
@@ -72,7 +71,7 @@ protected:
float m_marginButton;
bool m_bCapture;
- FPOINT m_pressPos;
+ Math::Point m_pressPos;
float m_pressValue;
EventMsg m_eventUp;
diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp
index 1cc522b..b4d196b 100644
--- a/src/ui/studio.cpp
+++ b/src/ui/studio.cpp
@@ -16,8 +16,6 @@
// studio.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <stdlib.h>
#include <stdio.h>
@@ -553,7 +551,7 @@ void CStudio::ColorizeScript(CEdit* edit)
void CStudio::StartEditScript(CScript *script, char* name, int rank)
{
- FPOINT pos, dim;
+ Math::Point pos, dim;
CWindow* pw;
CEdit* edit;
CButton* button;
@@ -591,7 +589,7 @@ void CStudio::StartEditScript(CScript *script, char* name, int rank)
pw->SetClosable(true);
GetResource(RES_TEXT, RT_STUDIO_TITLE, res);
pw->SetName(res);
- pw->SetMinDim(FPOINT(0.49f, 0.50f));
+ pw->SetMinDim(Math::Point(0.49f, 0.50f));
pw->SetMaximized(m_bEditMaximized);
pw->SetMinimized(m_bEditMinimized);
m_main->SetEditFull(m_bEditMaximized);
@@ -669,7 +667,7 @@ void CStudio::AdjustEditScript()
CGroup* group;
CSlider* slider;
CList* list;
- FPOINT wpos, wdim, pos, dim, ppos, ddim;
+ Math::Point wpos, wdim, pos, dim, ppos, ddim;
float hList;
wpos = m_editActualPos;
@@ -1030,7 +1028,7 @@ void CStudio::StartDialog(StudioDialog type)
CLabel* pla;
CList* pli;
CEdit* pe;
- FPOINT pos, dim;
+ Math::Point pos, dim;
char name[100];
m_dialog = type;
@@ -1073,13 +1071,13 @@ void CStudio::StartDialog(StudioDialog type)
pw->SetState(STATE_SHADOW);
pw->SetMovable(true);
pw->SetClosable(true);
- pw->SetMinDim(FPOINT(320.0f/640.0f, (121.0f+18.0f*4)/480.0f));
+ pw->SetMinDim(Math::Point(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);
pw->SetName(name);
- pos = FPOINT(0.0f, 0.0f);
- dim = FPOINT(0.0f, 0.0f);
+ pos = Math::Point(0.0f, 0.0f);
+ dim = Math::Point(0.0f, 0.0f);
if ( m_dialog == SD_OPEN ||
m_dialog == SD_SAVE )
@@ -1195,7 +1193,7 @@ void CStudio::AdjustDialog()
CLabel* pla;
CList* pli;
CEdit* pe;
- FPOINT wpos, wdim, ppos, ddim;
+ Math::Point wpos, wdim, ppos, ddim;
int nli, nch;
char name[100];
@@ -1315,7 +1313,7 @@ void CStudio::AdjustDialog()
bool CStudio::EventDialog(const Event &event)
{
CWindow* pw;
- FPOINT wpos, wdim;
+ Math::Point wpos, wdim;
pw = (CWindow*)m_interface->SearchControl(EVENT_WINDOW9);
if ( pw == 0 ) return false;
diff --git a/src/ui/studio.h b/src/ui/studio.h
index 194ca64..0c9eac2 100644
--- a/src/ui/studio.h
+++ b/src/ui/studio.h
@@ -97,10 +97,10 @@ protected:
bool m_bEditMinimized;
CameraType m_editCamera;
- FPOINT m_editActualPos;
- FPOINT m_editActualDim;
- FPOINT m_editFinalPos;
- FPOINT m_editFinalDim;
+ Math::Point m_editActualPos;
+ Math::Point m_editActualDim;
+ Math::Point m_editFinalPos;
+ Math::Point m_editFinalDim;
float m_time;
float m_fixInfoTextTime;
diff --git a/src/ui/target.cpp b/src/ui/target.cpp
index 4e282b9..0f18efd 100644
--- a/src/ui/target.cpp
+++ b/src/ui/target.cpp
@@ -16,8 +16,6 @@
// target.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -52,7 +50,7 @@ CTarget::~CTarget()
// Creates a new button.
-bool CTarget::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CTarget::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -161,7 +159,7 @@ void CTarget::Draw()
// Returns the tooltip.
-bool CTarget::GetTooltip(FPOINT pos, char* name)
+bool CTarget::GetTooltip(Math::Point pos, char* name)
{
#if 0
if ( (m_state&STATE_VISIBLE) && Detect(pos) ) // in the window?
@@ -194,7 +192,7 @@ bool CTarget::GetTooltip(FPOINT pos, char* name)
// Detects the object aimed by the mouse.
-CObject* CTarget::DetectFriendObject(FPOINT pos)
+CObject* CTarget::DetectFriendObject(Math::Point pos)
{
ObjectType type;
CObject *pObj, *pTarget;
diff --git a/src/ui/target.h b/src/ui/target.h
index 7959c9a..df1c962 100644
--- a/src/ui/target.h
+++ b/src/ui/target.h
@@ -33,14 +33,14 @@ public:
CTarget(CInstanceManager* iMan);
~CTarget();
- bool Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
+ bool Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool EventProcess(const Event &event);
void Draw();
- bool GetTooltip(FPOINT pos, char* name);
+ bool GetTooltip(Math::Point pos, char* name);
protected:
- CObject* DetectFriendObject(FPOINT pos);
+ CObject* DetectFriendObject(Math::Point pos);
protected:
};
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index 26e0a07..41998f1 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -16,8 +16,6 @@
// window.cpp
-#define STRICT
-#define D3D_OVERLOADS
#include <windows.h>
#include <stdio.h>
@@ -70,8 +68,8 @@ CWindow::CWindow(CInstanceManager* iMan) : CControl(iMan)
m_bMinimized = false;
m_bFixed = false;
- m_minDim = FPOINT(0.0f, 0.0f);
- m_maxDim = FPOINT(1.0f, 1.0f);
+ m_minDim = Math::Point(0.0f, 0.0f);
+ m_maxDim = Math::Point(1.0f, 1.0f);
m_buttonReduce = 0;
m_buttonFull = 0;
@@ -130,7 +128,7 @@ void CWindow::Flush()
// Creates a new window.
-bool CWindow::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+bool CWindow::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg();
@@ -141,7 +139,7 @@ bool CWindow::Create(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
// Creates a new button.
-CButton* CWindow::CreateButton(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CButton* CWindow::CreateButton(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CButton* pc;
int i;
@@ -163,7 +161,7 @@ CButton* CWindow::CreateButton(FPOINT pos, FPOINT dim, int icon, EventMsg eventM
// Creates a new button.
-CColor* CWindow::CreateColor(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CColor* CWindow::CreateColor(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CColor* pc;
int i;
@@ -185,7 +183,7 @@ CColor* CWindow::CreateColor(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg
// Creates a new button.
-CCheck* CWindow::CreateCheck(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CCheck* CWindow::CreateCheck(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CCheck* pc;
int i;
@@ -207,7 +205,7 @@ CCheck* CWindow::CreateCheck(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg
// Creates a new button.
-CKey* CWindow::CreateKey(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CKey* CWindow::CreateKey(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CKey* pc;
int i;
@@ -229,7 +227,7 @@ CKey* CWindow::CreateKey(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
// Creates a new button.
-CGroup* CWindow::CreateGroup(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CGroup* CWindow::CreateGroup(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CGroup* pc;
int i;
@@ -251,7 +249,7 @@ CGroup* CWindow::CreateGroup(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg
// Creates a new button.
-CImage* CWindow::CreateImage(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CImage* CWindow::CreateImage(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CImage* pc;
int i;
@@ -273,7 +271,7 @@ CImage* CWindow::CreateImage(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg
// Creates a new label.
-CLabel* CWindow::CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
+CLabel* CWindow::CreateLabel(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg,
char *name)
{
CLabel* pc;
@@ -314,7 +312,7 @@ CLabel* CWindow::CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg
// Creates a new editable pave.
-CEdit* CWindow::CreateEdit(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CEdit* CWindow::CreateEdit(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CEdit* pc;
int i;
@@ -336,7 +334,7 @@ CEdit* CWindow::CreateEdit(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
// Creates a new editable pave.
-CEditValue* CWindow::CreateEditValue(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CEditValue* CWindow::CreateEditValue(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CEditValue* pc;
int i;
@@ -358,7 +356,7 @@ CEditValue* CWindow::CreateEditValue(FPOINT pos, FPOINT dim, int icon, EventMsg
// Creates a new elevator.
-CScroll* CWindow::CreateScroll(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CScroll* CWindow::CreateScroll(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CScroll* pc;
int i;
@@ -380,7 +378,7 @@ CScroll* CWindow::CreateScroll(FPOINT pos, FPOINT dim, int icon, EventMsg eventM
// Creates a new cursor.
-CSlider* CWindow::CreateSlider(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CSlider* CWindow::CreateSlider(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CSlider* pc;
int i;
@@ -402,7 +400,7 @@ CSlider* CWindow::CreateSlider(FPOINT pos, FPOINT dim, int icon, EventMsg eventM
// Creates a new list.
-CList* CWindow::CreateList(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
+CList* CWindow::CreateList(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg,
float expand)
{
CList* pc;
@@ -425,7 +423,7 @@ CList* CWindow::CreateList(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg,
// Creates a new shortcut.
-CShortcut* CWindow::CreateShortcut(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CShortcut* CWindow::CreateShortcut(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CShortcut* ps;
int i;
@@ -447,7 +445,7 @@ CShortcut* CWindow::CreateShortcut(FPOINT pos, FPOINT dim, int icon, EventMsg ev
// Creates a new card.
-CMap* CWindow::CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CMap* CWindow::CreateMap(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CMap* pm;
int i;
@@ -469,7 +467,7 @@ CMap* CWindow::CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
// Creates a new gauge.
-CGauge* CWindow::CreateGauge(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CGauge* CWindow::CreateGauge(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CGauge* pc;
int i;
@@ -491,7 +489,7 @@ CGauge* CWindow::CreateGauge(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg
// Creates a new compass.
-CCompass* CWindow::CreateCompass(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CCompass* CWindow::CreateCompass(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CCompass* pc;
int i;
@@ -513,7 +511,7 @@ CCompass* CWindow::CreateCompass(FPOINT pos, FPOINT dim, int icon, EventMsg even
// Creates a new target.
-CTarget* CWindow::CreateTarget(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg)
+CTarget* CWindow::CreateTarget(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg)
{
CTarget* pc;
int i;
@@ -576,7 +574,7 @@ CControl* CWindow::SearchControl(EventMsg eventMsg)
// Makes the tooltip binds to the window.
-bool CWindow::GetTooltip(FPOINT pos, char* name)
+bool CWindow::GetTooltip(Math::Point pos, char* name)
{
int i;
@@ -677,13 +675,13 @@ void CWindow::SetName(char* name)
}
-void CWindow::SetPos(FPOINT pos)
+void CWindow::SetPos(Math::Point pos)
{
CControl::SetPos(pos);
MoveAdjust();
}
-void CWindow::SetDim(FPOINT dim)
+void CWindow::SetDim(Math::Point dim)
{
if ( dim.x < m_minDim.x ) dim.x = m_minDim.x;
if ( dim.x > m_maxDim.x ) dim.x = m_maxDim.x;
@@ -696,7 +694,7 @@ void CWindow::SetDim(FPOINT dim)
void CWindow::MoveAdjust()
{
- FPOINT pos, dim;
+ Math::Point pos, dim;
float h, offset;
h = m_engine->RetText()->RetHeight(m_fontSize, m_fontType);
@@ -734,22 +732,22 @@ void CWindow::MoveAdjust()
}
-void CWindow::SetMinDim(FPOINT dim)
+void CWindow::SetMinDim(Math::Point dim)
{
m_minDim = dim;
}
-void CWindow::SetMaxDim(FPOINT dim)
+void CWindow::SetMaxDim(Math::Point dim)
{
m_maxDim = dim;
}
-FPOINT CWindow::RetMinDim()
+Math::Point CWindow::RetMinDim()
{
return m_minDim;
}
-FPOINT CWindow::RetMaxDim()
+Math::Point CWindow::RetMaxDim()
{
return m_maxDim;
}
@@ -913,9 +911,9 @@ EventMsg CWindow::RetEventMsgClose()
// Detects whether the mouse is in an edge of the window, to resize it.
// Bit returns: 0 = left, 1 = down, 2 = right, 3 = up, 1 = all.
-int CWindow::BorderDetect(FPOINT pos)
+int CWindow::BorderDetect(Math::Point pos)
{
- FPOINT dim;
+ Math::Point dim;
float h;
int flags;
@@ -966,7 +964,7 @@ int CWindow::BorderDetect(FPOINT pos)
bool CWindow::EventProcess(const Event &event)
{
- FPOINT pos;
+ Math::Point pos;
int i, flags;
if ( event.event == EVENT_MOUSEMOVE )
@@ -1124,7 +1122,7 @@ bool CWindow::EventProcess(const Event &event)
void CWindow::Draw()
{
- FPOINT pos, dim;
+ Math::Point pos, dim;
float width, h, sw;
int i;
@@ -1143,7 +1141,7 @@ void CWindow::Draw()
// Draws the shadow under the title bar.
{
- FPOINT sPos, sDim;
+ Math::Point sPos, sDim;
pos.x = m_pos.x+0.01f;
dim.x = m_dim.x-0.02f;
@@ -1206,9 +1204,9 @@ void CWindow::Draw()
// Draws a rectangle.
-void CWindow::DrawVertex(FPOINT pos, FPOINT dim, int icon)
+void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon)
{
- FPOINT p1, p2, uv1, uv2, corner;
+ Math::Point p1, p2, uv1, uv2, corner;
float dp;
int i;
@@ -1576,11 +1574,11 @@ void CWindow::DrawVertex(FPOINT pos, FPOINT dim, int icon)
// Draws hatching.
-void CWindow::DrawHach(FPOINT pos, FPOINT dim)
+void CWindow::DrawHach(Math::Point pos, Math::Point dim)
{
#if _NEWLOOK
#else
- FPOINT ppos, ddim, uv1, uv2;
+ Math::Point ppos, ddim, uv1, uv2;
float dp, max, ndim;
bool bStop;
diff --git a/src/ui/window.h b/src/ui/window.h
index b06fcfb..169c68e 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -52,24 +52,24 @@ public:
~CWindow();
void Flush();
- 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);
- CKey* CreateKey(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CGroup* CreateGroup(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CImage* CreateImage(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CLabel* CreateLabel(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, char *name);
- CEdit* CreateEdit(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CEditValue* CreateEditValue(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CScroll* CreateScroll(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CSlider* CreateSlider(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CList* CreateList(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg, float expand=1.2f);
- CShortcut* CreateShortcut(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- CMap* CreateMap(FPOINT pos, FPOINT dim, int icon, EventMsg eventMsg);
- 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 Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CButton* CreateButton(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CColor* CreateColor(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CCheck* CreateCheck(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CKey* CreateKey(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CGroup* CreateGroup(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CImage* CreateImage(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CLabel* CreateLabel(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg, char *name);
+ CEdit* CreateEdit(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CEditValue* CreateEditValue(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CScroll* CreateScroll(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CSlider* CreateSlider(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CList* CreateList(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg, float expand=1.2f);
+ CShortcut* CreateShortcut(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CMap* CreateMap(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CGauge* CreateGauge(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CCompass* CreateCompass(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
+ CTarget* CreateTarget(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg);
bool DeleteControl(EventMsg eventMsg);
CControl* SearchControl(EventMsg eventMsg);
@@ -82,13 +82,13 @@ public:
void SetTrashEvent(bool bTrash);
bool RetTrashEvent();
- void SetPos(FPOINT pos);
- void SetDim(FPOINT dim);
+ void SetPos(Math::Point pos);
+ void SetDim(Math::Point dim);
- void SetMinDim(FPOINT dim);
- void SetMaxDim(FPOINT dim);
- FPOINT RetMinDim();
- FPOINT RetMaxDim();
+ void SetMinDim(Math::Point dim);
+ void SetMaxDim(Math::Point dim);
+ Math::Point RetMinDim();
+ Math::Point RetMaxDim();
void SetMovable(bool bMode);
bool RetMovable();
@@ -106,18 +106,18 @@ public:
void SetFixed(bool bFix);
bool RetFixed();
- bool GetTooltip(FPOINT pos, char* name);
+ bool GetTooltip(Math::Point pos, char* name);
bool EventProcess(const Event &event);
void Draw();
protected:
- int BorderDetect(FPOINT pos);
+ int BorderDetect(Math::Point pos);
void AdjustButtons();
void MoveAdjust();
- void DrawVertex(FPOINT pos, FPOINT dim, int icon);
- void DrawHach(FPOINT pos, FPOINT dim);
+ void DrawVertex(Math::Point pos, Math::Point dim, int icon);
+ void DrawHach(Math::Point pos, Math::Point dim);
protected:
CControl* m_table[MAXWINDOW];
@@ -127,8 +127,8 @@ protected:
bool m_bMinimized;
bool m_bFixed;
- FPOINT m_minDim;
- FPOINT m_maxDim;
+ Math::Point m_minDim;
+ Math::Point m_maxDim;
CButton* m_buttonReduce;
CButton* m_buttonFull;
@@ -138,7 +138,7 @@ protected:
bool m_bRedim;
bool m_bClosable;
bool m_bCapture;
- FPOINT m_pressPos;
+ Math::Point m_pressPos;
int m_pressFlags;
D3DMouse m_pressMouse;
};