summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2011-05-30 11:13:31 -0600
committerJared Adams <jaxad0127@gmail.com>2011-05-30 12:35:08 -0600
commit0248b2f58c783f21b7e68a20deadc0a3f942c869 (patch)
treefb9487625c282f59325f0585f08e2efd0683cd39 /src/compoundsprite.cpp
parentb69c0511206d68a61fd08042d1c122c9fac22202 (diff)
downloadmana-0248b2f58c783f21b7e68a20deadc0a3f942c869.tar.gz
mana-0248b2f58c783f21b7e68a20deadc0a3f942c869.tar.bz2
mana-0248b2f58c783f21b7e68a20deadc0a3f942c869.tar.xz
mana-0248b2f58c783f21b7e68a20deadc0a3f942c869.zip
Remove some uneeded offsetting
Also fix position of being names. Reviewed-by: Bertram
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r--src/compoundsprite.cpp33
1 files changed, 8 insertions, 25 deletions
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,