summaryrefslogtreecommitdiffstats
path: root/src/ui/scroll.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-06-13 22:48:35 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-06-13 22:48:35 +0200
commitb735913debff93c1a6444ec731cd4bf99ae2a5c2 (patch)
treeefa532d3b4231e5ffd6df8eddcb0ec8cf5d4b28b /src/ui/scroll.cpp
parentb5d16ef340208bbe1a76f33f7498fb168f6405b6 (diff)
downloadcolobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.tar.gz
colobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.tar.bz2
colobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.zip
FPOINT -> Math::Point & other math functions
- changed FPOINT to Math::Point and some functions from math module to the new implementation - moved old function and FPOINT struct declarations to math3d.cpp - removed some unused functions in math module - fixed some #include dependencies - moved #define STRICT and #define D3D_OVERLOADS to compile options
Diffstat (limited to 'src/ui/scroll.cpp')
-rw-r--r--src/ui/scroll.cpp24
1 files changed, 11 insertions, 13 deletions
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 )