diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-05 03:23:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-05 03:23:24 +0300 |
commit | 3f43bdd12b50a2ff3afb687fd3d2101865e946f2 (patch) | |
tree | 218051a0398f77ea3ca555ba706daea82a32f8e0 /src/gui/windows | |
parent | 31782ba3cdeced9baa91739c55e9ae819d70d616 (diff) | |
download | manaverse-3f43bdd12b50a2ff3afb687fd3d2101865e946f2.tar.gz manaverse-3f43bdd12b50a2ff3afb687fd3d2101865e946f2.tar.bz2 manaverse-3f43bdd12b50a2ff3afb687fd3d2101865e946f2.tar.xz manaverse-3f43bdd12b50a2ff3afb687fd3d2101865e946f2.zip |
Use in most places int being positions and not float.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/minimap.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 3f0f4c14e..291cb7a7a 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -281,12 +281,11 @@ void Minimap::draw2(Graphics *const graphics) const int h = rect.h; if (w > a.width || h > a.height) { - const Vector &p = localPlayer->getPixelPositionF(); - mMapOriginX = (a.width / 2) - (p.x + static_cast<float>( - viewport->getCameraRelativeX()) * mWidthProportion) / 32; + mMapOriginX = (a.width / 2) - (localPlayer->mPixelX + + viewport->getCameraRelativeX() * mWidthProportion) / 32; - mMapOriginY = (a.height / 2) - (p.y + static_cast<float>( - viewport->getCameraRelativeY()) * mHeightProportion) / 32; + mMapOriginY = (a.height / 2) - (localPlayer->mPixelY + + viewport->getCameraRelativeY() * mHeightProportion) / 32; const int minOriginX = a.width - w; const int minOriginY = a.height - h; @@ -382,12 +381,10 @@ void Minimap::draw2(Graphics *const graphics) dotSize - 1) * mHeightProportion); const int offsetWidth = CAST_S32(static_cast<float>( dotSize - 1) * mWidthProportion); - const Vector &pos = being->getPixelPositionF(); - graphics->fillRectangle(Rect( - static_cast<float>(pos.x * mWidthProportion) / 32 + (being->mPixelX * mWidthProportion) / 32 + mMapOriginX - offsetWidth, - static_cast<float>(pos.y * mHeightProportion) / 32 + (being->mPixelY * mHeightProportion) / 32 + mMapOriginY - offsetHeight, dotSize, dotSize)); } @@ -435,16 +432,14 @@ void Minimap::draw2(Graphics *const graphics) } } - const Vector &pos = localPlayer->getPixelPositionF(); - const int gw = graphics->getWidth(); const int gh = graphics->getHeight(); - int x = static_cast<float>((pos.x - (gw / 2) + int x = (localPlayer->mPixelX - (gw / 2) + viewport->getCameraRelativeX()) - * mWidthProportion) / 32 + mMapOriginX; - int y = static_cast<float>((pos.y - (gh / 2) + * mWidthProportion / 32 + mMapOriginX; + int y = (localPlayer->mPixelY - (gh / 2) + viewport->getCameraRelativeY()) - * mHeightProportion) / 32 + mMapOriginY; + * mHeightProportion / 32 + mMapOriginY; const int w = CAST_S32(static_cast<float>( gw) * mWidthProportion / 32); |