summaryrefslogtreecommitdiffstats
path: root/src/ui/map.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-15 18:50:51 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-15 18:50:51 +0200
commitad6bc13dc2b70741ee3f006e321ba46dd421b9b5 (patch)
tree72540c0d47f5501f6080f7b03de600daed0a029a /src/ui/map.cpp
parent95d2f8da2c1df9a02fc1d668f2ce9c0b64c4bf65 (diff)
parent94e7fd920353c39471d8836a8bf87ffb113f1349 (diff)
downloadcolobot-ad6bc13dc2b70741ee3f006e321ba46dd421b9b5.tar.gz
colobot-ad6bc13dc2b70741ee3f006e321ba46dd421b9b5.tar.bz2
colobot-ad6bc13dc2b70741ee3f006e321ba46dd421b9b5.zip
Merge dev-common and various fixes to achieve compilation
- merged changes from dev-common - fixed many compilation errors (CBrain, UI, ...) - temporarily commented out some problematic code (e.g. input bindings) - (partially) fixed #include styling - everything compiles except for CRobotMain, CMainDialog and CStudio
Diffstat (limited to 'src/ui/map.cpp')
-rw-r--r--src/ui/map.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/ui/map.cpp b/src/ui/map.cpp
index 5139d88..5440854 100644
--- a/src/ui/map.cpp
+++ b/src/ui/map.cpp
@@ -20,7 +20,7 @@
#include "map.h"
-
+#include <string.h>
namespace Ui {
@@ -48,7 +48,7 @@ CMap::CMap() : CControl()
m_waterColor.g = 0.80f;
m_waterColor.b = 1.00f; // blue
- m_half = m_terrain->GetMosaic() * m_terrain->GetBrick() * m_terrain->GetSize() / 2.0f;
+ m_half = m_terrain->GetMosaicCount() * m_terrain->GetBrickCount() * m_terrain->GetBrickSize() / 2.0f;
m_highlightRank = -1;
FlushObject();
@@ -84,7 +84,7 @@ void CMap::SetOffset(float ox, float oy)
{
m_offset.x = ox;
m_offset.y = oy;
- m_half = m_terrain->GetMosaic() * m_terrain->GetBrick() * m_terrain->GetSize() / 2.0f;
+ m_half = m_terrain->GetMosaicCount() * m_terrain->GetBrickCount() * m_terrain->GetBrickSize() / 2.0f;
}
// Choice of the global angle of rotation.
@@ -119,7 +119,7 @@ void CMap::SetDebug(bool bDebug)
void CMap::SetZoom(float value)
{
m_zoom = value;
- m_half = m_terrain->GetMosaic() * m_terrain->GetBrick() * m_terrain->GetSize() / 2.0f;
+ m_half = m_terrain->GetMosaicCount() * m_terrain->GetBrickCount() * m_terrain->GetBrickSize() / 2.0f;
}
float CMap::GetZoom()
@@ -999,9 +999,13 @@ void CMap::UpdateTerrain()
int x, y;
if ( m_fixImage[0] != 0 ) return; // still image?
- if ( !m_engine->OpenImage("map.tga") ) return;
- scale = m_terrain->GetScaleRelief();
+ // TODO: map texture manipulation
+ return;
+
+ // if ( !m_engine->OpenImage("map.tga") ) return;
+
+ scale = m_terrain->GetReliefScale();
water = m_water->GetLevel();
color.a = 0.0f;
@@ -1040,12 +1044,12 @@ void CMap::UpdateTerrain()
color.b = m_waterColor.b + (intensity-0.5f);
}
- m_engine->SetDot(x, y, color);
+ //m_engine->SetDot(x, y, color);
}
}
- m_engine->CopyImage(); // copy the ground drawing
- m_engine->CloseImage();
+ //m_engine->CopyImage(); // copy the ground drawing
+ //m_engine->CloseImage();
}
// Updates the field in the map.
@@ -1058,10 +1062,14 @@ void CMap::UpdateTerrain(int bx, int by, int ex, int ey)
int x, y;
if ( m_fixImage[0] != 0 ) return; // still image?
- if ( !m_engine->OpenImage("map.tga") ) return;
- m_engine->LoadImage();
- scale = m_terrain->GetScaleRelief();
+ // TODO: map texture manipulation
+ return;
+
+ //if ( !m_engine->OpenImage("map.tga") ) return;
+ //m_engine->LoadImage();
+
+ scale = m_terrain->GetReliefScale();
water = m_water->GetLevel();
color.a = 0.0f;
@@ -1100,12 +1108,12 @@ void CMap::UpdateTerrain(int bx, int by, int ex, int ey)
color.b = m_waterColor.b + (intensity-0.5f);
}
- m_engine->SetDot(x, y, color);
+ //m_engine->SetDot(x, y, color);
}
}
- m_engine->CopyImage(); // copy the ground drawing
- m_engine->CloseImage();
+ //m_engine->CopyImage(); // copy the ground drawing
+ //m_engine->CloseImage();
}