diff options
author | Paul Gilbert | 2015-02-22 22:58:37 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-22 22:58:37 -0500 |
commit | 2d2fc3f9ed100fab85e736555048a62ac1e00dcd (patch) | |
tree | 99686de22c7e16c3059bc0313a666a58dddbc13f /engines/xeen | |
parent | 3e05d9008e88b108a55455643900939f91174670 (diff) | |
download | scummvm-rg350-2d2fc3f9ed100fab85e736555048a62ac1e00dcd.tar.gz scummvm-rg350-2d2fc3f9ed100fab85e736555048a62ac1e00dcd.tar.bz2 scummvm-rg350-2d2fc3f9ed100fab85e736555048a62ac1e00dcd.zip |
XEEN: Add horizontal placement fix for scaled sprites
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/sprites.cpp | 5 | ||||
-rw-r--r-- | engines/xeen/sprites.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp index d75eb9cb4f..b596432992 100644 --- a/engines/xeen/sprites.cpp +++ b/engines/xeen/sprites.cpp @@ -115,7 +115,7 @@ void SpriteResource::clear() { /** * Draws a frame using data at a specific offset in the sprite resource */ -void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Point &destPos, +void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Point &pt, const Common::Rect &bounds, int flags, int scale) { // Get cell header Common::MemoryReadStream f(_data, _filesize); @@ -133,6 +133,9 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi return; setupScaling(newScale, xOffset + width, yOffset + height); + Common::Point destPos = pt; + destPos.x += (xOffset + width - _scaledWidth) / 2; + bool flipped = (flags & SPRFLAG_HORIZ_FLIPPED) != 0; int xInc = flipped ? -1 : 1; diff --git a/engines/xeen/sprites.h b/engines/xeen/sprites.h index 2d9fe2f8c6..0e3a3c3059 100644 --- a/engines/xeen/sprites.h +++ b/engines/xeen/sprites.h @@ -53,7 +53,7 @@ private: void draw(XSurface &dest, int frame, const Common::Point &destPos, const Common::Rect &bounds, int flags = 0, int scale = 0); - void drawOffset(XSurface &dest, uint16 offset, const Common::Point &destPos, + void drawOffset(XSurface &dest, uint16 offset, const Common::Point &pt, const Common::Rect &bounds, int flags, int scale); void setupScaling(int scale, int frameWidth, int frameHeight); |