From 5f43cf85c7e59f0e1192f803560848777d64743f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Jul 2011 04:57:16 +0300 Subject: Replace some getters to direct members access in graphics class. --- src/gui/viewport.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui/viewport.cpp') 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(playerPos.x) @@ -176,8 +176,8 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) } // Auto center when player is off screen - if (player_x - static_cast(mPixelViewX) > graphics->getWidth() / 2 - || static_cast(mPixelViewX) - player_x > graphics->getWidth() / 2 + if (player_x - static_cast(mPixelViewX) > graphics->mWidth / 2 + || static_cast(mPixelViewX) - player_x > graphics->mWidth / 2 || static_cast(mPixelViewY) - player_y > graphics->getHeight() / 2 || player_y - static_cast(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) -- cgit v1.2.3-70-g09d2