aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Kagerer2009-10-13 19:48:41 +0000
committerFlorian Kagerer2009-10-13 19:48:41 +0000
commit73fa80d94088cfac87f4302112bff5c3b2fb9754 (patch)
treef779d6a429d41df0d55235cb41f874046f2c9605
parent94cd10297406f4b57d6d0d38a3ac3be18311f22b (diff)
downloadscummvm-rg350-73fa80d94088cfac87f4302112bff5c3b2fb9754.tar.gz
scummvm-rg350-73fa80d94088cfac87f4302112bff5c3b2fb9754.tar.bz2
scummvm-rg350-73fa80d94088cfac87f4302112bff5c3b2fb9754.zip
LOL/PC-98: fixed outro
svn-id: r45046
-rw-r--r--engines/kyra/lol.cpp8
-rw-r--r--engines/kyra/scene_lol.cpp9
-rw-r--r--engines/kyra/script_lol.cpp47
-rw-r--r--engines/kyra/script_tim.cpp16
-rw-r--r--engines/kyra/sequences_lol.cpp43
5 files changed, 87 insertions, 36 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 63b0e63f62..9f50da5d50 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -1761,10 +1761,12 @@ void LoLEngine::createGfxTables() {
Palette tpal(256);
if (_flags.use16ColorMode) {
static const uint8 colTbl[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
- uint8 *p = _screen->getPalette(0).getData();
-
tpal.fill(0, 256, 0xff);
+ uint8 *p = _screen->getPalette(0).getData();
uint8 *d = tpal.getData();
+
+ _res->loadFileToBuf("LOL.NOL", p, 48);
+
for (int i = 15; i >= 0; i--) {
d[colTbl[i] * 3 + 2] = p[i * 3 + 2];
d[colTbl[i] * 3 + 1] = p[i * 3 + 1];
@@ -1772,7 +1774,7 @@ void LoLEngine::createGfxTables() {
}
_screen->generateTruelightTables(colTbl, 16, tpal, tpal, _trueLightTable1, _trueLightTable2, 80);
- _screen->loadPalette("lol.nol", _screen->getPalette(0));
+ _screen->loadPalette("LOL.NOL", _screen->getPalette(0));
} else {
_screen->loadPalette("fxpal.col", tpal);
_screen->loadBitmap("fxpal.shp", 3, 3, 0);
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index a91120746d..82930ef36d 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -397,9 +397,7 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
delete[] _vcnBlocks;
_vcnBlocks = new uint8[vcnLen];
- if (_flags.use16ColorMode) {
- _res->loadFileToBuf("LOL.NOL", _screen->getPalette(0).getData(), 48);
- } else {
+ if (!_flags.use16ColorMode) {
delete[] _vcnShift;
_vcnShift = new uint8[tlen];
@@ -453,16 +451,17 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
_vmpPtr[i] = READ_LE_UINT16(&v[i << 1]);
Palette tpal(256);
- tpal.copy(_screen->getPalette(0));
if (_flags.use16ColorMode) {
- tpal.fill(16, 240, 0xff);
uint8 *dst = tpal.getData();
+ _res->loadFileToBuf("LOL.NOL", dst, 48);
for (int i = 1; i < 16; i++) {
int s = ((i << 4) | i) * 3;
SWAP(dst[s], dst[i * 3]);
SWAP(dst[s + 1], dst[i * 3 + 1]);
SWAP(dst[s + 2], dst[i * 3 + 2]);
}
+ } else {
+ tpal.copy(_screen->getPalette(0));
}
for (int i = 0; i < 7; i++) {
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index acc0f7cab6..7f1bd16f22 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -2599,27 +2599,35 @@ int LoLEngine::tlol_fadeInScene(const TIM *tim, const uint16 *param) {
_screen->loadBitmap(filename, 7, 5, &_screen->getPalette(0));
- filename[0] = 0;
+ uint8 *overlay = 0;
+ if (!_flags.use16ColorMode) {
+ filename[0] = 0;
- if (_flags.isTalkie) {
- strcpy(filename, _languageExt[_lang]);
- strcat(filename, "/");
- }
+ if (_flags.isTalkie) {
+ strcpy(filename, _languageExt[_lang]);
+ strcat(filename, "/");
+ }
- strcat(filename, overlayFile);
- uint8 *overlay = _res->fileData(filename, 0);
+ strcat(filename, overlayFile);
+ overlay = _res->fileData(filename, 0);
- for (int i = 0; i < 3; ++i) {
- uint32 endTime = _system->getMillis() + 10 * _tickLength;
- _screen->copyBlockAndApplyOverlayOutro(4, 2, overlay);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
- delayUntil(endTime);
+ for (int i = 0; i < 3; ++i) {
+ uint32 endTime = _system->getMillis() + 10 * _tickLength;
+ _screen->copyBlockAndApplyOverlayOutro(4, 2, overlay);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delayUntil(endTime);
+ }
}
_screen->copyRegion(0, 0, 0, 0, 320, 200, 4, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
- delete[] overlay;
+
+ if (_flags.use16ColorMode) {
+ _screen->fadePalette(_screen->getPalette(0), 5);
+ } else {
+ _screen->updateScreen();
+ delete[] overlay;
+ }
return 1;
}
@@ -2636,7 +2644,14 @@ int LoLEngine::tlol_fadeInPalette(const TIM *tim, const uint16 *param) {
Palette pal(_screen->getPalette(0).getNumColors());
_screen->loadBitmap(bitmap, 3, 3, &pal);
- _screen->fadePalette(pal, param[1]);
+
+ if (_flags.use16ColorMode) {
+ _screen->getPalette(0).clear();
+ _screen->setScreenPalette(_screen->getPalette(0));
+ _screen->copyPage(2, 0);
+ }
+
+ _screen->fadePalette(pal, param[1]);
return 1;
}
diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp
index e4e1c01f6b..ae4ae04e92 100644
--- a/engines/kyra/script_tim.cpp
+++ b/engines/kyra/script_tim.cpp
@@ -392,7 +392,8 @@ void TIMInterpreter::displayText(uint16 textId, int16 flags, uint8 color) {
static const uint8 colorMap[] = { 0x00, 0xA0, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
_screen->setTextColorMap(colorMap);
_screen->_charWidth = 0;
- _screen->_charOffset = -4;
+ if (!_vm->gameFlags().use16ColorMode)
+ _screen->_charOffset = -4;
if (!flags)
_screen->copyRegionToBuffer(0, 0, 0, 320, 40, _textAreaBuffer);
@@ -401,6 +402,17 @@ void TIMInterpreter::displayText(uint16 textId, int16 flags, uint8 color) {
char *str = text;
int y = 0;
+ if (_vm->gameFlags().use16ColorMode) {
+ if (color == 0xda)
+ color = 0xa1;
+ else if (color == 0xf2)
+ color = 0xe1;
+ else if (flags < 0)
+ color = 0xe1;
+ else
+ color = 0xc1;
+ }
+
while (str[0]) {
char *nextLine = strchr(str, '\r');
@@ -417,7 +429,7 @@ void TIMInterpreter::displayText(uint16 textId, int16 flags, uint8 color) {
else
_screen->printText(str, 0, y, color, 0x00);
- y += _screen->getFontHeight() - 4;
+ y += (_vm->gameFlags().use16ColorMode ? 16 : (_screen->getFontHeight() - 4));
str += strlen(str);
if (backupChar) {
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index c2cc27dbd4..2a4b4910dd 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -1134,7 +1134,7 @@ void LoLEngine::showOutro(int character, bool maxDifficulty) {
}
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
- if (maxDifficulty)
+ if (maxDifficulty && !_flags.use16ColorMode)
_tim->displayText(0x8000, 0, 0xDC);
_screen->updateScreen();
_screen->fadePalette(_screen->getPalette(0), 30, 0);
@@ -1153,8 +1153,13 @@ void LoLEngine::showOutro(int character, bool maxDifficulty) {
void LoLEngine::showCredits() {
for (int i = 0; i < 255; ++i)
_outroShapeTable[i] = i;
- _outroShapeTable[255] = 0;
+ if (_flags.use16ColorMode)
+ for (int i = 1; i < 16; ++i)
+ _outroShapeTable[i] = (i << 4) | i;
+ else
+ _outroShapeTable[255] = 0;
+
_sound->haltTrack();
_sound->loadSoundFile("LOREFINL");
_sound->playTrack(4);
@@ -1162,11 +1167,15 @@ void LoLEngine::showCredits() {
_screen->hideMouse();
static const uint8 colorMap[] = { 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x72, 0x6F, 0x6F, 0x6D };
- _screen->setTextColorMap(colorMap);
_screen->_charWidth = 0;
_screen->loadBitmap("ROOM.CPS", 2, 2, &_screen->getPalette(0));
- _screen->getPalette(0).fill(255, 1, 0);
+
+ if (!_flags.use16ColorMode) {
+ _screen->setTextColorMap(colorMap);
+ _screen->getPalette(0).fill(_screen->getPalette(0).getNumColors() - 1, 1, 0);
+ }
+
_screen->fadeToBlack(30);
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
@@ -1212,10 +1221,16 @@ void LoLEngine::processCredits(char *t, int dimState, int page, int delayTime) {
memset(shapes, 0, sizeof(shapes));
loadOutroShapes(curShapeFile++, shapes);
- uint8 *monsterPal = _res->fileData("MONSTERS.PAL", 0);
- assert(monsterPal);
+ uint8 *monsterPal = 0;
+
+ if (_flags.use16ColorMode) {
+ _screen->loadPalette("LOL.NOL", _screen->getPalette(0));
+ } else {
+ monsterPal = _res->fileData("MONSTERS.PAL", 0);
+ assert(monsterPal);
+ _screen->getPalette(0).copy(monsterPal, 0, 40, 88);
+ }
- _screen->getPalette(0).copy(monsterPal, 0, 40, 88);
_screen->fadePalette(_screen->getPalette(0), 30);
uint32 waitTimer = _system->getMillis();
@@ -1413,7 +1428,12 @@ void LoLEngine::processCredits(char *t, int dimState, int page, int delayTime) {
if (y < _screen->_curDim->h) {
_screen->_curPage = page;
_screen->setFont(Screen::FID_6_FNT);
- _screen->printText(s.str, (_screen->_curDim->sx << 3) + x, _screen->_curDim->sy + y, 0xDC, 0x00);
+ if (_flags.use16ColorMode) {
+ _screen->printText(s.str, (_screen->_curDim->sx << 3) + x + 1, _screen->_curDim->sy + y + 1, 0x44, 0x00);
+ _screen->printText(s.str, (_screen->_curDim->sx << 3) + x, _screen->_curDim->sy + y, 0x33, 0x00);
+ } else {
+ _screen->printText(s.str, (_screen->_curDim->sx << 3) + x, _screen->_curDim->sy + y, 0xDC, 0x00);
+ }
_screen->_curPage = 0;
}
@@ -1438,8 +1458,11 @@ void LoLEngine::processCredits(char *t, int dimState, int page, int delayTime) {
curShapeFile = curShapeFile % 28;
loadOutroShapes(curShapeFile, shapes);
- _screen->getPalette(0).copy(monsterPal, curShapeFile * 40, 40, 88);
- _screen->setScreenPalette(_screen->getPalette(0));
+
+ if (!_flags.use16ColorMode) {
+ _screen->getPalette(0).copy(monsterPal, curShapeFile * 40, 40, 88);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ }
needNewShape = false;
}