diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-06-19 20:11:47 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-06-19 20:11:47 +0200 |
commit | 9f784e81f81651bed087902f9f3afee113e56148 (patch) | |
tree | ae89f6dabe2443b39aba292673027d197fc120e6 /src/graphics/common/text.cpp | |
parent | b8027ce9a7f050b95846a668a02f5801331e127f (diff) | |
download | colobot-9f784e81f81651bed087902f9f3afee113e56148.tar.gz colobot-9f784e81f81651bed087902f9f3afee113e56148.tar.bz2 colobot-9f784e81f81651bed087902f9f3afee113e56148.zip |
Switched to new implementation of the rest of math module
- changed structs from D3DVECTOR to Math::Vector
and from D3DMATRIX to Math::Matrix
- changed functions to new Math namespace functions
- moved mainmovie module from graphics to object
- added Get and Set to Math::Matrix
Diffstat (limited to 'src/graphics/common/text.cpp')
-rw-r--r-- | src/graphics/common/text.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/graphics/common/text.cpp b/src/graphics/common/text.cpp index 2bee6f4..f8d3f49 100644 --- a/src/graphics/common/text.cpp +++ b/src/graphics/common/text.cpp @@ -1648,7 +1648,7 @@ void CText::DrawColor(Math::Point pos, float size, float width, int color) D3DVERTEX2 vertex[4]; // 2 triangles
Math::Point p1, p2;
POINT dim;
- D3DVECTOR n;
+ Math::Vector n;
float h, u1, u2, v1, v2, dp;
int icon;
@@ -1707,12 +1707,12 @@ void CText::DrawColor(Math::Point pos, float size, float width, int color) u2 -= dp;
v2 -= dp;
- n = D3DVECTOR(0.0f, 0.0f, -1.0f); // normal
+ n = Math::Vector(0.0f, 0.0f, -1.0f); // normal
- vertex[0] = D3DVERTEX2(D3DVECTOR(p1.x, p1.y, 0.0f), n, u1,v2);
- vertex[1] = D3DVERTEX2(D3DVECTOR(p1.x, p2.y, 0.0f), n, u1,v1);
- vertex[2] = D3DVERTEX2(D3DVECTOR(p2.x, p1.y, 0.0f), n, u2,v2);
- vertex[3] = D3DVERTEX2(D3DVECTOR(p2.x, p2.y, 0.0f), n, u2,v1);
+ vertex[0] = D3DVERTEX2(Math::Vector(p1.x, p1.y, 0.0f), n, u1,v2);
+ vertex[1] = D3DVERTEX2(Math::Vector(p1.x, p2.y, 0.0f), n, u1,v1);
+ vertex[2] = D3DVERTEX2(Math::Vector(p2.x, p1.y, 0.0f), n, u2,v2);
+ vertex[3] = D3DVERTEX2(Math::Vector(p2.x, p2.y, 0.0f), n, u2,v1);
m_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_VERTEX2, vertex, 4, NULL);
m_engine->AddStatisticTriangle(2);
@@ -1730,12 +1730,12 @@ void CText::DrawChar(int character, Math::Point pos, float size, {
D3DVERTEX2 vertex[4]; // 2 triangles
Math::Point p1, p2;
- D3DVECTOR n;
+ Math::Vector n;
float width, height, u1, u2, v1, v2, dp;
short* pt;
dp = 0.5f/256.0f;
- n = D3DVECTOR(0.0f, 0.0f, -1.0f); // normal
+ n = Math::Vector(0.0f, 0.0f, -1.0f); // normal
if ( font == FONT_BUTTON )
{
@@ -1767,10 +1767,10 @@ void CText::DrawChar(int character, Math::Point pos, float size, u2 -= dp;
v2 -= dp;
- vertex[0] = D3DVERTEX2(D3DVECTOR(p1.x, p1.y, 0.0f), n, u1,v2);
- vertex[1] = D3DVERTEX2(D3DVECTOR(p1.x, p2.y, 0.0f), n, u1,v1);
- vertex[2] = D3DVERTEX2(D3DVECTOR(p2.x, p1.y, 0.0f), n, u2,v2);
- vertex[3] = D3DVERTEX2(D3DVECTOR(p2.x, p2.y, 0.0f), n, u2,v1);
+ vertex[0] = D3DVERTEX2(Math::Vector(p1.x, p1.y, 0.0f), n, u1,v2);
+ vertex[1] = D3DVERTEX2(Math::Vector(p1.x, p2.y, 0.0f), n, u1,v1);
+ vertex[2] = D3DVERTEX2(Math::Vector(p2.x, p1.y, 0.0f), n, u2,v2);
+ vertex[3] = D3DVERTEX2(Math::Vector(p2.x, p2.y, 0.0f), n, u2,v1);
m_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_VERTEX2, vertex, 4, NULL);
m_engine->AddStatisticTriangle(2);
@@ -1803,10 +1803,10 @@ void CText::DrawChar(int character, Math::Point pos, float size, u2 -= dp;
v2 -= dp;
- vertex[0] = D3DVERTEX2(D3DVECTOR(p1.x, p1.y, 0.0f), n, u1,v2);
- vertex[1] = D3DVERTEX2(D3DVECTOR(p1.x, p2.y, 0.0f), n, u1,v1);
- vertex[2] = D3DVERTEX2(D3DVECTOR(p2.x, p1.y, 0.0f), n, u2,v2);
- vertex[3] = D3DVERTEX2(D3DVECTOR(p2.x, p2.y, 0.0f), n, u2,v1);
+ vertex[0] = D3DVERTEX2(Math::Vector(p1.x, p1.y, 0.0f), n, u1,v2);
+ vertex[1] = D3DVERTEX2(Math::Vector(p1.x, p2.y, 0.0f), n, u1,v1);
+ vertex[2] = D3DVERTEX2(Math::Vector(p2.x, p1.y, 0.0f), n, u2,v2);
+ vertex[3] = D3DVERTEX2(Math::Vector(p2.x, p2.y, 0.0f), n, u2,v1);
m_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_VERTEX2, vertex, 4, NULL);
m_engine->AddStatisticTriangle(2);
@@ -1868,10 +1868,10 @@ void CText::DrawChar(int character, Math::Point pos, float size, }
- vertex[0] = D3DVERTEX2(D3DVECTOR(p1.x, p1.y, 0.0f), n, u1,v2);
- vertex[1] = D3DVERTEX2(D3DVECTOR(p1.x, p2.y, 0.0f), n, u1,v1);
- vertex[2] = D3DVERTEX2(D3DVECTOR(p2.x, p1.y, 0.0f), n, u2,v2);
- vertex[3] = D3DVERTEX2(D3DVECTOR(p2.x, p2.y, 0.0f), n, u2,v1);
+ vertex[0] = D3DVERTEX2(Math::Vector(p1.x, p1.y, 0.0f), n, u1,v2);
+ vertex[1] = D3DVERTEX2(Math::Vector(p1.x, p2.y, 0.0f), n, u1,v1);
+ vertex[2] = D3DVERTEX2(Math::Vector(p2.x, p1.y, 0.0f), n, u2,v2);
+ vertex[3] = D3DVERTEX2(Math::Vector(p2.x, p2.y, 0.0f), n, u2,v1);
m_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_VERTEX2, vertex, 4, NULL);
m_engine->AddStatisticTriangle(2);
|