aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2/sprite.cpp
diff options
context:
space:
mode:
authorFabio Battaglia2012-01-08 00:34:15 +0100
committerFabio Battaglia2012-01-08 00:34:15 +0100
commit15ea73104c051a034c39e12d19c96af720ca64b6 (patch)
treeecb3c7d045b39f12208fb0e9f6d41ee703e9922a /engines/sword2/sprite.cpp
parent2852d685d5b1d89772bd6bef0805b7421bf416f8 (diff)
downloadscummvm-rg350-15ea73104c051a034c39e12d19c96af720ca64b6.tar.gz
scummvm-rg350-15ea73104c051a034c39e12d19c96af720ca64b6.tar.bz2
scummvm-rg350-15ea73104c051a034c39e12d19c96af720ca64b6.zip
SWORD2: Fix problem with the height of PSX sprites
Apparently some uncompressed PSX sprites have a wrong height value in the datafiles, creating subtle problems like missing lines in some graphics. Fixed by artificially adding 1 to odd height values of uncompressed sprites.
Diffstat (limited to 'engines/sword2/sprite.cpp')
-rw-r--r--engines/sword2/sprite.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp
index 8d260947f1..73a4eca8bd 100644
--- a/engines/sword2/sprite.cpp
+++ b/engines/sword2/sprite.cpp
@@ -500,6 +500,16 @@ int32 Screen::drawSprite(SpriteInfo *s) {
recomposePsxSprite(s);
}
+ // If the height is not an even value, fix it.
+ // Apparently it's a problem in the data of a few sprites
+ // of the PSX version. This should fix an evident problem
+ // in the foyer at the beginning of the game, where a line
+ // of pixels is missing near the stairs. But it should also
+ // fix a more subtle one in the glease gallery and in quaramonte
+ // police office.
+ if (s->h % 2)
+ s->h++;
+
freeSprite = true;
byte *tempBuf = (byte *)malloc(s->w * s->h * 2);
memset(tempBuf, 0, s->w * s->h * 2);