summaryrefslogtreecommitdiff
path: root/src/gui/minimap.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-02 04:36:59 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-02 04:37:42 +0300
commitca58a3cced99fc2a8989da0155c1927bc0f08b6f (patch)
treec8fc16ac2c5c0a9184c17c2920266b96934ed28f /src/gui/minimap.cpp
parentd4dd89e72f8b1e2c0517981f7e3ffac4a040f9fa (diff)
downloadmv-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.gz
mv-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.bz2
mv-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.xz
mv-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.zip
Replace some getters to direct member access in Image class.
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r--src/gui/minimap.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index dd0edc0ba..5022f9210 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -165,22 +165,22 @@ void Minimap::setMap(Map *map)
const int offsetX = 2 * getPadding();
const int offsetY = getTitleBarHeight() + getPadding();
const int titleWidth = getFont()->getWidth(getCaption()) + 15;
- const int mapWidth = mMapImage->getWidth() < 100 ?
- mMapImage->getWidth() + offsetX : 100;
- const int mapHeight = mMapImage->getHeight() < 100 ?
- mMapImage->getHeight() + offsetY : 100;
+ const int mapWidth = mMapImage->mBounds.w < 100 ?
+ mMapImage->mBounds.w + offsetX : 100;
+ const int mapHeight = mMapImage->mBounds.h < 100 ?
+ mMapImage->mBounds.h + offsetY : 100;
setMinWidth(mapWidth > titleWidth ? mapWidth : titleWidth);
setMinHeight(mapHeight);
mWidthProportion = static_cast<float>(
- mMapImage->getWidth()) / static_cast<float>(map->getWidth());
+ mMapImage->mBounds.w) / static_cast<float>(map->getWidth());
mHeightProportion = static_cast<float>(
- mMapImage->getHeight()) / static_cast<float>(map->getHeight());
+ mMapImage->mBounds.h) / static_cast<float>(map->getHeight());
- setMaxWidth(mMapImage->getWidth() > titleWidth ?
- mMapImage->getWidth() + offsetX : titleWidth);
- setMaxHeight(mMapImage->getHeight() + offsetY);
+ setMaxWidth(mMapImage->mBounds.w > titleWidth ?
+ mMapImage->mBounds.w + offsetX : titleWidth);
+ setMaxHeight(mMapImage->mBounds.h + offsetY);
setDefaultSize(getX(), getY(), getWidth(), getHeight());
resetToDefaultSize();
@@ -219,8 +219,8 @@ void Minimap::draw(gcn::Graphics *graphics)
if (mMapImage)
{
- if (mMapImage->getWidth() > a.width ||
- mMapImage->getHeight() > a.height)
+ if (mMapImage->mBounds.w > a.width ||
+ mMapImage->mBounds.h > a.height)
{
const Vector &p = player_node->getPosition();
mapOriginX = ((a.width) / 2) - static_cast<int>((p.x
@@ -231,8 +231,8 @@ void Minimap::draw(gcn::Graphics *graphics)
+ viewport->getCameraRelativeX()) * static_cast<int>(
mHeightProportion)) / 32;
- const int minOriginX = a.width - mMapImage->getWidth();
- const int minOriginY = a.height - mMapImage->getHeight();
+ const int minOriginX = a.width - mMapImage->mBounds.w;
+ const int minOriginY = a.height - mMapImage->mBounds.h;
if (mapOriginX < minOriginX)
mapOriginX = minOriginX;