diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-07-02 04:57:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-07-02 04:57:16 +0300 |
commit | 5f43cf85c7e59f0e1192f803560848777d64743f (patch) | |
tree | 283ddb56228ab7b19a62be6f6be0344e77745757 /src/gui/viewport.cpp | |
parent | ca58a3cced99fc2a8989da0155c1927bc0f08b6f (diff) | |
download | plus-5f43cf85c7e59f0e1192f803560848777d64743f.tar.gz plus-5f43cf85c7e59f0e1192f803560848777d64743f.tar.bz2 plus-5f43cf85c7e59f0e1192f803560848777d64743f.tar.xz plus-5f43cf85c7e59f0e1192f803560848777d64743f.zip |
Replace some getters to direct members access in graphics class.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index d2c0db7b1..1b8769602 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -133,8 +133,8 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) lastTick = tick_time; // Calculate viewpoint - int midTileX = (graphics->getWidth() + mScrollCenterOffsetX) / 2; - int midTileY = (graphics->getHeight() + mScrollCenterOffsetX) / 2; + int midTileX = (graphics->mWidth + mScrollCenterOffsetX) / 2; + int midTileY = (graphics->mHeight + mScrollCenterOffsetX) / 2; const Vector &playerPos = player_node->getPosition(); const int player_x = static_cast<int>(playerPos.x) @@ -176,8 +176,8 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) } // Auto center when player is off screen - if (player_x - static_cast<int>(mPixelViewX) > graphics->getWidth() / 2 - || static_cast<int>(mPixelViewX) - player_x > graphics->getWidth() / 2 + if (player_x - static_cast<int>(mPixelViewX) > graphics->mWidth / 2 + || static_cast<int>(mPixelViewX) - player_x > graphics->mWidth / 2 || static_cast<int>(mPixelViewY) - player_y > graphics->getHeight() / 2 || player_y - static_cast<int>(mPixelViewY) @@ -189,9 +189,9 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) // Don't move camera so that the end of the map is on screen const int viewXmax = - mMap->getWidth() * mMap->getTileWidth() - graphics->getWidth(); + mMap->getWidth() * mMap->getTileWidth() - graphics->mWidth; const int viewYmax = - mMap->getHeight() * mMap->getTileHeight() - graphics->getHeight(); + mMap->getHeight() * mMap->getTileHeight() - graphics->mHeight; if (mMap) { if (mPixelViewX < 0) |