aboutsummaryrefslogtreecommitdiff
path: root/engines/cryo/graphics.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2017-02-12 00:53:23 +0200
committerFilippos Karapetis2017-02-12 00:54:39 +0200
commita7d681764f4a9d499cf08b253aea0c1813ec6e05 (patch)
treeda75a04191e5161efb99afb51ef1285596af41cd /engines/cryo/graphics.cpp
parentd3d5ff2a888e7134b299db7fcb928735089f908e (diff)
downloadscummvm-rg350-a7d681764f4a9d499cf08b253aea0c1813ec6e05.tar.gz
scummvm-rg350-a7d681764f4a9d499cf08b253aea0c1813ec6e05.tar.bz2
scummvm-rg350-a7d681764f4a9d499cf08b253aea0c1813ec6e05.zip
CRYO: Merge spriteOnSubtitle() into drawSprite()
Diffstat (limited to 'engines/cryo/graphics.cpp')
-rw-r--r--engines/cryo/graphics.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/cryo/graphics.cpp b/engines/cryo/graphics.cpp
index 29ebffc7a6..bfbce13949 100644
--- a/engines/cryo/graphics.cpp
+++ b/engines/cryo/graphics.cpp
@@ -30,10 +30,12 @@
namespace Cryo {
// Original name: noclipax
-void EdenGame::drawSprite(int16 index, int16 x, int16 y, bool withBlack) {
+void EdenGame::drawSprite(int16 index, int16 x, int16 y, bool withBlack, bool onSubtitle) {
+ uint16 width = (!onSubtitle) ? 640 : _subtitlesXWidth;
byte *pix = _bankData;
- byte *scr = _mainViewBuf + x + y * 640;
- if (_curBankNum != 117 && (!_noPalette || withBlack)) {
+ byte *buf = (!onSubtitle) ? _mainViewBuf : _subtitlesViewBuf;
+ byte *scr = buf + x + y * width;
+ if (_curBankNum != 117 && (!_noPalette || withBlack || onSubtitle)) {
if (READ_LE_UINT16(pix) > 2)
readPalette(pix + 2);
}
@@ -49,7 +51,7 @@ void EdenGame::drawSprite(int16 index, int16 x, int16 y, bool withBlack) {
byte mode = *pix++;
if (mode != 0xFF && mode != 0xFE)
return;
- if (y + h > 200)
+ if (y + h > 200 && !onSubtitle)
h -= (y + h - 200);
if (h1 & 0x80) {
// compressed
@@ -95,7 +97,7 @@ void EdenGame::drawSprite(int16 index, int16 x, int16 y, bool withBlack) {
}
}
}
- scr += 640 - w;
+ scr += width - w;
}
}
else {
@@ -108,7 +110,7 @@ void EdenGame::drawSprite(int16 index, int16 x, int16 y, bool withBlack) {
else
*scr++ = p;
}
- scr += 640 - w;
+ scr += width - w;
}
}
}