From 0248b2f58c783f21b7e68a20deadc0a3f942c869 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 30 May 2011 11:13:31 -0600 Subject: Remove some uneeded offsetting Also fix position of being names. Reviewed-by: Bertram --- src/compoundsprite.cpp | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) (limited to 'src/compoundsprite.cpp') diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index 4e91d281..e96137c4 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -281,19 +281,8 @@ void CompoundSprite::redraw() const { mWidth = at(0)->getWidth(); mHeight = at(0)->getHeight(); - - // Temporary fix for position - Map *map = Game::instance() ? Game::instance()->getCurrentMap() : 0; - if (map) - { - mOffsetX = map->getTileWidth() / 2; - mOffsetY = map->getTileHeight(); - } - else // Char selection screen fix - { - mOffsetX = 16; - mOffsetY = 32; - } + mOffsetX = 0; + mOffsetY = 0; mNeedsRedraw = false; return; } @@ -326,18 +315,6 @@ void CompoundSprite::redraw() const mOffsetX -= posX; mOffsetY -= posY; - Map *map = Game::instance() ? Game::instance()->getCurrentMap() : 0; - if (map) - { - mOffsetX += map->getTileWidth() / 2; - mOffsetY += map->getTileHeight(); - } - else // Char selection screen fix - { - mOffsetX += 16; - mOffsetY += 32; - } - #if SDL_BYTEORDER == SDL_BIG_ENDIAN int rmask = 0xff000000; int gmask = 0x00ff0000; @@ -369,6 +346,12 @@ void CompoundSprite::redraw() const s->draw(graphics, posX - s->getWidth() / 2, posY - s->getHeight()); } + // Uncomment to see buffer sizes + /*graphics->fillRectangle(gcn::Rectangle(0, 0, 3, 3)); + graphics->fillRectangle(gcn::Rectangle(mWidth - 3, 0, 3, 3)); + graphics->fillRectangle(gcn::Rectangle(mWidth - 3, mHeight - 3, 3, 3)); + graphics->fillRectangle(gcn::Rectangle(0, mHeight - 3, 3, 3));*/ + delete graphics; SDL_Surface *surfaceA = SDL_CreateRGBSurface(SDL_HWSURFACE, mWidth, mHeight, -- cgit v1.2.3-70-g09d2