diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-01 22:30:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-01 22:30:44 +0300 |
commit | d13de51121a332cf8613a38d7ed5468f971c999f (patch) | |
tree | 253c2911e291303fd90eb5d61c23076630782a11 /src/gui | |
parent | 6915c38ca9c35bfb9a5ea05fe957463d644a75de (diff) | |
download | manaplus-d13de51121a332cf8613a38d7ed5468f971c999f.tar.gz manaplus-d13de51121a332cf8613a38d7ed5468f971c999f.tar.bz2 manaplus-d13de51121a332cf8613a38d7ed5468f971c999f.tar.xz manaplus-d13de51121a332cf8613a38d7ed5468f971c999f.zip |
replace tile size from 32 to mapTitleSize.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 2 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 14 | ||||
-rw-r--r-- | src/gui/widgets/playerbox.cpp | 12 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_other.cpp | 3 | ||||
-rw-r--r-- | src/gui/windows/debugwindow.cpp | 5 |
5 files changed, 19 insertions, 17 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 0d81e4314..015067a6f 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1119,7 +1119,7 @@ void PopupMenu::handleLink(const std::string &link, else if (link == "movecamera" && (mX || mY)) { if (viewport) - viewport->moveCameraToPosition(mX * 32, mY * 32); + viewport->moveCameraToPosition(mX * mapTileSize, mY * mapTileSize); } else if (link == "split" && mItem) { diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 5e855bea5..958fd3587 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -147,7 +147,7 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) int cnt = 0; // Apply lazy scrolling - while (lastTick < tick_time && cnt < 32) + while (lastTick < tick_time && cnt < mapTileSize) { if (player_x > mPixelViewX + mScrollRadius) { @@ -309,9 +309,9 @@ void Viewport::_drawDebugPath(Graphics *const graphics) const Vector &playerPos = player_node->getPosition(); debugPath = mMap->findPath( - static_cast<int>(playerPos.x - 16) / 32, - static_cast<int>(playerPos.y - 32) / 32, - mousePosX / 32, mousePosY / 32, + static_cast<int>(playerPos.x - mapTileSize / 2) / mapTileSize, + static_cast<int>(playerPos.y - mapTileSize) / mapTileSize, + mousePosX / mapTileSize, mousePosY / mapTileSize, player_node->getWalkMask(), 500); lastMouseDestination = mouseDestination; @@ -345,8 +345,8 @@ void Viewport::_drawPath(Graphics *const graphics, const Path &path, int cnt = 1; FOR_EACH (Path::const_iterator, i, path) { - const int squareX = i->x * 32 - mPixelViewX + 12; - const int squareY = i->y * 32 - mPixelViewY + 12; + const int squareX = i->x * mapTileSize - mPixelViewX + 12; + const int squareY = i->y * mapTileSize - mPixelViewY + 12; graphics->fillRectangle(gcn::Rectangle(squareX, squareY, 8, 8)); if (mMap) @@ -371,7 +371,7 @@ void Viewport::_drawPath(Graphics *const graphics, const Path &path, if (mMap) { const std::string str = toString(mMap->getMetaTile( - i->x / 32, i->y / 32)->Gcost); + i->x / mapTileSize, i->y / mapTileSize)->Gcost); font->drawString(graphics, str, squareX + 4 - font->getWidth(text) / 2, squareY + 12); } diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index ff865bdbe..21617c57b 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -40,8 +40,8 @@ PlayerBox::PlayerBox(Being *const being, const std::string &skin, mSelectedBackground(), mSkin(nullptr), mSelectedSkin(nullptr), - mOffsetX(-16), - mOffsetY(-32), + mOffsetX(-mapTileSize / 2), + mOffsetY(-mapTileSize), mDrawBackground(false), mSelected(false) { @@ -57,8 +57,8 @@ PlayerBox::PlayerBox(const std::string &skin, mSelectedBackground(), mSkin(nullptr), mSelectedSkin(nullptr), - mOffsetX(-16), - mOffsetY(-32), + mOffsetX(-mapTileSize / 2), + mOffsetY(-mapTileSize), mDrawBackground(false), mSelected(false) { @@ -94,8 +94,8 @@ void PlayerBox::init(std::string name, std::string selectedName) if (mSkin) { mDrawBackground = (mSkin->getOption("drawbackground") != 0); - mOffsetX = mSkin->getOption("offsetX", -16); - mOffsetY = mSkin->getOption("offsetY", -32); + mOffsetX = mSkin->getOption("offsetX", -mapTileSize / 2); + mOffsetY = mSkin->getOption("offsetY", -mapTileSize); mFrameSize = mSkin->getOption("frameSize", 2); } if (selectedName.empty()) diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp index ec4e2fe06..b59edfd4a 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -28,6 +28,7 @@ #include "gui/widgets/scrollarea.h" #include "configuration.h" +#include "map.h" #include "utils/gettext.h" @@ -161,7 +162,7 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : // TRANSLATORS: settings option new SetupItemIntTextField(_("Scroll radius"), "", "ScrollRadius", - this, "ScrollRadiusEvent", 0, 32); + this, "ScrollRadiusEvent", 0, mapTileSize); // TRANSLATORS: settings option new SetupItemCheckBox(_("Auto resize minimaps"), "", "autoresizeminimaps", diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp index 0104af792..3c3a856b8 100644 --- a/src/gui/windows/debugwindow.cpp +++ b/src/gui/windows/debugwindow.cpp @@ -133,8 +133,9 @@ void DebugWindow::draw(gcn::Graphics *g) if (target) { Graphics *const g2 = static_cast<Graphics*>(g); - target->draw(g2, -target->getPixelX() + 16 + mDimension.width / 2, - -target->getPixelY() + 32 + mDimension.height / 2); + target->draw(g2, -target->getPixelX() + mapTileSize / 2 + + mDimension.width / 2, -target->getPixelY() + mapTileSize + + mDimension.height / 2); } } BLOCK_END("DebugWindow::draw") |