diff options
author | Matthew Hoops | 2012-03-20 14:18:57 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-03-20 14:49:16 -0400 |
commit | 71756bdf4eae5ba9cc3f329b85e894f04640aaef (patch) | |
tree | 40d464262da107ab5eed82f198685209161ebac1 /engines/sword2/sprite.cpp | |
parent | 03eba05b09e5c9e5a351f8111185934b92a3fed3 (diff) | |
parent | 3c3576a224b92c703b4e8ea20008ac8a069980dd (diff) | |
download | scummvm-rg350-71756bdf4eae5ba9cc3f329b85e894f04640aaef.tar.gz scummvm-rg350-71756bdf4eae5ba9cc3f329b85e894f04640aaef.tar.bz2 scummvm-rg350-71756bdf4eae5ba9cc3f329b85e894f04640aaef.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/sword2/sprite.cpp')
-rw-r--r-- | engines/sword2/sprite.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp index 8d260947f1..cb0923cc2f 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); @@ -762,14 +772,18 @@ int32 Screen::drawSprite(SpriteInfo *s) { src = sprite + rs.top * srcPitch + rs.left; dst = _buffer + _screenWide * rd.top + rd.left; - if (s->type & RDSPR_BLEND && !Sword2Engine::isPsx()) { // Blending is unavailable in PSX version + if (s->type & RDSPR_BLEND) { // The original code had two different blending cases. One for // s->blend & 0x01 and one for s->blend & 0x02. However, the // only values that actually appear in the cluster files are // 0, 513 and 1025 so the s->blend & 0x02 case was never used. // Which is just as well since that code made no sense to me. - if (!(_renderCaps & RDBLTFX_SPRITEBLEND)) { + // TODO: In PSX version, blending is done through hardware transparency. + // The only correct way to simulate this would be using 16-bit mode. + // As this is not yet available for this engine, fake transparency is used + // as placeholder. + if (!(_renderCaps & RDBLTFX_SPRITEBLEND) || Sword2Engine::isPsx()) { for (i = 0; i < rs.height(); i++) { for (j = 0; j < rs.width(); j++) { if (src[j] && ((i & 1) == (j & 1))) |