diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-18 22:13:37 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-18 22:13:37 +0200 |
commit | f4792bc06f21335fc2d1171d937ea7645ca0c253 (patch) | |
tree | c7b11cf81f254f5b9ed2f5dbfe127649abc7545a /src/gui/minimap.cpp | |
parent | f98d003e354a1792117b7cbc771d1dd91475a156 (diff) | |
download | mv-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.gz mv-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.bz2 mv-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.xz mv-f4792bc06f21335fc2d1171d937ea7645ca0c253.zip |
Fix most conversions except manaserv net code and some other code.
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r-- | src/gui/minimap.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index de9d2a150..e5371eaf3 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -208,9 +208,12 @@ void Minimap::draw(gcn::Graphics *graphics) { const Vector &p = player_node->getPosition(); mapOriginX = ((a.width) / 2) - static_cast<int>((p.x - + viewport->getCameraRelativeX()) * mWidthProportion) / 32; + + viewport->getCameraRelativeX()) * static_cast<int>( + mWidthProportion)) / 32; + mapOriginY = ((a.height) / 2) - static_cast<int>((p.y - + viewport->getCameraRelativeX()) * mHeightProportion) / 32; + + viewport->getCameraRelativeX()) * static_cast<int>( + mHeightProportion)) / 32; const int minOriginX = a.width - mMapImage->getWidth(); const int minOriginY = a.height - mMapImage->getHeight(); @@ -304,8 +307,10 @@ void Minimap::draw(gcn::Graphics *graphics) + viewport->getCameraRelativeY()) * mHeightProportion) / 32 + mapOriginY; - const int w = graph->getWidth() * mWidthProportion / 32; - const int h = graph->getHeight() * mHeightProportion / 32; + const int w = static_cast<int>(static_cast<float>( + graph->getWidth()) * mWidthProportion / 32); + const int h = static_cast<int>(static_cast<float>( + graph->getHeight()) * mHeightProportion / 32); if (w <= a.width) { |