summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/minimap.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index 74da37341..5a1e66c25 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -229,13 +229,11 @@ void Minimap::draw(gcn::Graphics *graphics)
mMapImage->mBounds.h > a.height)
{
const Vector &p = player_node->getPosition();
- mMapOriginX = ((a.width) / 2) - static_cast<int>((p.x
- + viewport->getCameraRelativeX()) * static_cast<int>(
- mWidthProportion)) / 32;
+ mMapOriginX = ((a.width) / 2) - (static_cast<float>(p.x
+ + viewport->getCameraRelativeX()) * mWidthProportion) / 32;
- mMapOriginY = ((a.height) / 2) - static_cast<int>((p.y
- + viewport->getCameraRelativeX()) * static_cast<int>(
- mHeightProportion)) / 32;
+ mMapOriginY = ((a.height) / 2) - (static_cast<float>(p.y
+ + viewport->getCameraRelativeX()) * mHeightProportion) / 32;
const int minOriginX = a.width - mMapImage->mBounds.w;
const int minOriginY = a.height - mMapImage->mBounds.h;
@@ -314,9 +312,9 @@ void Minimap::draw(gcn::Graphics *graphics)
const Vector &pos = being->getPosition();
graphics->fillRectangle(gcn::Rectangle(
- static_cast<int>(pos.x * mWidthProportion) / 32
+ static_cast<float>(pos.x * mWidthProportion) / 32
+ mMapOriginX - offsetWidth,
- static_cast<int>(pos.y * mHeightProportion) / 32
+ static_cast<float>(pos.y * mHeightProportion) / 32
+ mMapOriginY - offsetHeight,
dotSize, dotSize));
}
@@ -367,10 +365,10 @@ void Minimap::draw(gcn::Graphics *graphics)
const Vector &pos = player_node->getPosition();
// logger->log("width:" + toString(graph->getWidth()));
- int x = static_cast<int>((pos.x - (graph->getWidth() / 2)
+ int x = static_cast<float>((pos.x - (graph->getWidth() / 2)
+ viewport->getCameraRelativeX())
* mWidthProportion) / 32 + mMapOriginX;
- int y = static_cast<int>((pos.y - (graph->getHeight() / 2)
+ int y = static_cast<float>((pos.y - (graph->getHeight() / 2)
+ viewport->getCameraRelativeY())
* mHeightProportion) / 32 + mMapOriginY;