diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-07-02 04:36:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-07-02 04:37:42 +0300 |
commit | ca58a3cced99fc2a8989da0155c1927bc0f08b6f (patch) | |
tree | c8fc16ac2c5c0a9184c17c2920266b96934ed28f /src/gui | |
parent | d4dd89e72f8b1e2c0517981f7e3ffac4a040f9fa (diff) | |
download | mv-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')
-rw-r--r-- | src/gui/minimap.cpp | 26 | ||||
-rw-r--r-- | src/gui/outfitwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/icon.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/resizegrip.cpp | 4 |
6 files changed, 26 insertions, 26 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; diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index 8e7fbd1d1..93dbd77a9 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -342,8 +342,8 @@ void OutfitWindow::draw(gcn::Graphics *graphics) Image* image = mItemMoved->getImage(); if (image) { - const int tPosX = mCursorPosX - (image->getWidth() / 2); - const int tPosY = mCursorPosY - (image->getHeight() / 2); + const int tPosX = mCursorPosX - (image->mBounds.w / 2); + const int tPosY = mCursorPosY - (image->mBounds.h / 2); g->drawImage(image, tPosX, tPosY); } diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index fd920ffa4..7fec6bf44 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -156,8 +156,8 @@ void DropShortcutContainer::draw(gcn::Graphics *graphics) Image* image = mItemMoved->getImage(); if (image) { - const int tPosX = mCursorPosX - (image->getWidth() / 2); - const int tPosY = mCursorPosY - (image->getHeight() / 2); + const int tPosX = mCursorPosX - (image->mBounds.w / 2); + const int tPosY = mCursorPosY - (image->mBounds.h / 2); g->drawImage(image, tPosX, tPosY); g->drawText(toString(mItemMoved->getQuantity()), diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp index 2799080b6..3e9c7dd24 100644 --- a/src/gui/widgets/icon.cpp +++ b/src/gui/widgets/icon.cpp @@ -34,21 +34,21 @@ Icon::Icon(const std::string &file) { mImage = ResourceManager::getInstance()->getImage(file); if (mImage) - setSize(mImage->getWidth(), mImage->getHeight()); + setSize(mImage->mBounds.w, mImage->mBounds.h); } Icon::Icon(Image *image) : mImage(image) { if (mImage) - setSize(mImage->getWidth(), mImage->getHeight()); + setSize(mImage->mBounds.w, mImage->mBounds.h); } void Icon::setImage(Image *image) { mImage = image; if (mImage) - setSize(mImage->getWidth(), mImage->getHeight()); + setSize(mImage->mBounds.w, mImage->mBounds.h); } void Icon::draw(gcn::Graphics *g) @@ -56,8 +56,8 @@ void Icon::draw(gcn::Graphics *g) if (mImage) { Graphics *graphics = static_cast<Graphics*>(g); - const int x = (getWidth() - mImage->getWidth()) / 2; - const int y = (getHeight() - mImage->getHeight()) / 2; + const int x = (getWidth() - mImage->mBounds.w) / 2; + const int y = (getHeight() - mImage->mBounds.h) / 2; graphics->drawImage(mImage, x, y); } } diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index b33c7ee26..ab089ca45 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -196,8 +196,8 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) Image* image = mItemMoved->getImage(); if (image) { - const int tPosX = mCursorPosX - (image->getWidth() / 2); - const int tPosY = mCursorPosY - (image->getHeight() / 2); + const int tPosX = mCursorPosX - (image->mBounds.w / 2); + const int tPosY = mCursorPosY - (image->mBounds.h / 2); g->drawImage(image, tPosX, tPosY); g->drawText(toString(mItemMoved->getQuantity()), diff --git a/src/gui/widgets/resizegrip.cpp b/src/gui/widgets/resizegrip.cpp index f477e51a8..861dde29e 100644 --- a/src/gui/widgets/resizegrip.cpp +++ b/src/gui/widgets/resizegrip.cpp @@ -52,8 +52,8 @@ ResizeGrip::ResizeGrip(const std::string &image) if (gripImage) { - setWidth(gripImage->getWidth() + 2); - setHeight(gripImage->getHeight() + 2); + setWidth(gripImage->mBounds.w + 2); + setHeight(gripImage->mBounds.h + 2); } else { |