summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-31 16:54:22 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-01 03:56:16 +0300
commit761682b6254a3d43e65ff45e07683c61afa6f1e4 (patch)
tree2ee462840f3aadb1e96bfa5c6784ec2cc0d2861a /src/gui/viewport.cpp
parenta39f63cdfa5ce15b22f294a8bb1db3a036ce462d (diff)
downloadManaVerse-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.gz
ManaVerse-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.bz2
ManaVerse-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.xz
ManaVerse-761682b6254a3d43e65ff45e07683c61afa6f1e4.zip
Last part of fixes.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index f55385029..7fa0dc464 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -228,11 +228,8 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
mPixelViewX = static_cast<float>(viewXmax);
if (mPixelViewY > viewYmax)
mPixelViewY = static_cast<float>(viewYmax);
- }
- // Draw tiles and sprites
- if (mMap)
- {
+ // Draw tiles and sprites
mMap->draw(graphics, static_cast<int>(mPixelViewX),
static_cast<int>(mPixelViewY));
@@ -255,8 +252,10 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
// Draw text
if (textManager)
+ {
textManager->draw(graphics, static_cast<int>(mPixelViewX),
- static_cast<int>(mPixelViewY));
+ static_cast<int>(mPixelViewY));
+ }
// Draw player names, speech, and emotion sprite as needed
const ActorSprites &actors = actorSpriteManager->getAll();
@@ -764,12 +763,9 @@ void Viewport::mouseMoved(gcn::MouseEvent &event A_UNUSED)
mBeingPopup->setVisible(false);
}
- mHoverItem = nullptr;
- if (actorSpriteManager)
- {
- mHoverItem = actorSpriteManager->findItem(x / mMap->getTileWidth(),
- y / mMap->getTileHeight());
- }
+ mHoverItem = actorSpriteManager->findItem(x / mMap->getTileWidth(),
+ y / mMap->getTileHeight());
+
if (!mHoverBeing && !mHoverItem)
{
SpecialLayer *specialLayer = mMap->getSpecialLayer();