[Scummvm-cvs-logs] scummvm master -> 7986f1709d77a84df92ba86ecf04a0cb1e88e0cf
athrxx
athrxx at scummvm.org
Tue Feb 21 22:03:28 CET 2012
This automated email contains information about 15 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ab5c3e2dad KYRA: (EOB) - move EOB 1 intro code into separate class
9f19bace44 COMMON: remove unnecessary commas
d9c05f7121 COMMON: add gui options for rendering modes
70cfbcd046 KYRA: add new rendering mode gui options
47005de313 KYRA: (EOB) - fix minor bug (wrongly initialized value) and some renaming
d192fed3b5 KYRA: (EOB) - fix character hand icons
66ba934398 KYRA: (EOB) - fix minor glitch in hp and food bar graphs
86a817beb5 KYRA: (EOB) - start work on CGA and EGA graphics modes
151d314912 KYRA: (EOB) - complete CGA graphics mode implementation
a4223e9c2b KYRA: (EOB) - fix EOB1 door clipping
df9b1bd2e4 KYRA: (EOB) - implement EGA graphics mode for EOB1
930bcbf2dc KYRA: (EOB) - fix minor text displayer glitch
3c1e2686b8 KYRA: (EOB) - fix minor sprite drawing glitch in EOB1
66da4777d4 KYRA: (EOB) - implement EGA mode (hi res dithering) for EOB II
7986f1709d KYRA: (EOB) - make detection entries for EOB I more unique (bug #3488973)
Commit: ab5c3e2dad5b1c3493b686647dc73094979fc208
https://github.com/scummvm/scummvm/commit/ab5c3e2dad5b1c3493b686647dc73094979fc208
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:33-08:00
Commit Message:
KYRA: (EOB) - move EOB 1 intro code into separate class
Changed paths:
engines/kyra/eob.cpp
engines/kyra/eob.h
engines/kyra/sequences_eob.cpp
engines/kyra/staticres_eob.cpp
diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp
index a2ddc92..40b0281 100644
--- a/engines/kyra/eob.cpp
+++ b/engines/kyra/eob.cpp
@@ -33,18 +33,14 @@ EoBEngine::EoBEngine(OSystem *system, const GameFlags &flags)
_numSpells = 53;
_menuChoiceInit = 4;
- _turnUndeadString = _introFilesOpening = _introFilesTower = _introFilesOrb = 0;
- _introFilesWdEntry = _introFilesKing = _introFilesHands = _introFilesWdExit = 0;
- _introFilesTunnel = _finBonusStrings = _npcStrings[1] = _npcStrings[2] = 0;
+ _turnUndeadString = 0;
+ _finBonusStrings = _npcStrings[1] = _npcStrings[2] = 0;
_npcStrings[3] = _npcStrings[4] = _npcStrings[5] = _npcStrings[6] = 0;
_npcStrings[7] = _npcStrings[8] = _npcStrings[9] = _npcStrings[10] = 0;
- _introOpeningFrmDelay = _introWdEncodeX = _introWdEncodeY = _introWdEncodeWH = 0;
- _npcShpData = _npcSubShpIndex1 = _npcSubShpIndex2 = _npcSubShpY = _introWdDsY = 0;
- _introTvlX1 = _introTvlY1 = _introTvlX2 = _introTvlY2 = _introTvlW = _introTvlH = 0;
+ _npcShpData = _npcSubShpIndex1 = _npcSubShpIndex2 = _npcSubShpY = 0;
_dscDoorScaleMult4 = _dscDoorScaleMult5 = _dscDoorScaleMult6 = _dscDoorY3 = 0;
_dscDoorY4 = _dscDoorY5 = _dscDoorY6 = _dscDoorY7 = _doorShapeEncodeDefs = 0;
_doorSwitchShapeEncodeDefs = _doorSwitchCoords = 0;
- _introWdDsX = 0;
_dscDoorCoordsExt = 0;
}
diff --git a/engines/kyra/eob.h b/engines/kyra/eob.h
index ce71c76..89d2b25 100644
--- a/engines/kyra/eob.h
+++ b/engines/kyra/eob.h
@@ -31,6 +31,7 @@ namespace Kyra {
class EoBEngine : public EoBCoreEngine {
friend class GUI_EoB;
+friend class EoBIntroPlayer;
public:
EoBEngine(OSystem *system, const GameFlags &flags);
~EoBEngine();
@@ -51,46 +52,10 @@ private:
void startupLoad();
// Intro/Outro
- void seq_playOpeningCredits();
void seq_playIntro();
void seq_playFinale();
-
- void seq_tower();
- void seq_orb();
- void seq_waterdeepEntry();
- void seq_king();
- void seq_hands();
- void seq_waterdeepExit();
- void seq_tunnel();
-
void seq_xdeath();
- void loadSetIntroPalette(const char *filename);
- void copyBlurRegion(int x1, int y1, int x2, int y2, int w, int h, int step);
- void boxMorphTransition(int targetDestX, int targetDestY, int targetFinalX, int targetFinalY, int targetSrcX, int targetSrcY, int targetFinalW, int targetFinalH, int originX1, int originY1, int originW, int originH);
- void whirlTransition();
-
- const char *const *_introFilesOpening;
- const char *const *_introFilesTower;
- const char *const *_introFilesOrb;
- const char *const *_introFilesWdEntry;
- const char *const *_introFilesKing;
- const char *const *_introFilesHands;
- const char *const *_introFilesWdExit;
- const char *const *_introFilesTunnel;
- const uint8 *_introOpeningFrmDelay;
- const uint8 *_introWdEncodeX;
- const uint8 *_introWdEncodeY;
- const uint8 *_introWdEncodeWH;
- const uint16 *_introWdDsX;
- const uint8 *_introWdDsY;
- const uint8 *_introTvlX1;
- const uint8 *_introTvlY1;
- const uint8 *_introTvlX2;
- const uint8 *_introTvlY2;
- const uint8 *_introTvlW;
- const uint8 *_introTvlH;
-
const char *const *_finBonusStrings;
// characters
diff --git a/engines/kyra/sequences_eob.cpp b/engines/kyra/sequences_eob.cpp
index 64f88e9..f18c67f 100644
--- a/engines/kyra/sequences_eob.cpp
+++ b/engines/kyra/sequences_eob.cpp
@@ -33,111 +33,89 @@
namespace Kyra {
-int EoBEngine::mainMenu() {
- int menuChoice = _menuChoiceInit;
- _menuChoiceInit = 0;
-
- Screen::FontId of = _screen->_currentFont;
-
- while (menuChoice >= 0 && !shouldQuit()) {
- switch (menuChoice) {
- case 0: {
- _screen->loadPalette("EOBPAL.COL", _screen->getPalette(0));
- _screen->loadEoBBitmap("INTRO", 0, 5, 3, 2);
- _screen->setScreenPalette(_screen->getPalette(0));
- _screen->_curPage = 2;
- of = _screen->setFont(Screen::FID_6_FNT);
- Common::String versionString(Common::String::format("ScummVM %s", gScummVMVersion));
- _screen->printText(versionString.c_str(), 280 - versionString.size() * 6, 153, _screen->getPagePixel(2, 0, 0), 0);
- _screen->setFont(of);
- _screen->fillRect(0, 159, 319, 199, _screen->getPagePixel(2, 0, 0));
- gui_drawBox(77, 165, 173, 29, 13, 14, 12);
- gui_drawBox(76, 164, 175, 31, 13, 14, -1);
- _screen->_curPage = 0;
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
- _allowImport = true;
- menuChoice = mainMenuLoop();
- _allowImport = false;
- } break;
-
- case 1:
- // load game in progress
- //
- menuChoice = -1;
- break;
-
- case 2:
- // create new party
- menuChoice = -2;
- break;
-
- case 3:
- // quit
- menuChoice = -5;
- break;
-
- case 4:
- // intro
- _sound->loadSoundFile("SOUND");
- _screen->hideMouse();
- seq_playOpeningCredits();
- seq_playIntro();
- _screen->showMouse();
- _sound->loadSoundFile("ADLIB");
- menuChoice = 0;
- break;
- }
- }
-
- return shouldQuit() ? -5 : menuChoice;
-}
-
-int EoBEngine::mainMenuLoop() {
- int sel = -1;
- do {
- _screen->setScreenDim(28);
- _gui->simpleMenu_setup(8, 0, _mainMenuStrings, -1, 0, 0);
-
- while (sel == -1 && !shouldQuit())
- sel = _gui->simpleMenu_process(8, _mainMenuStrings, 0, -1, 0);
- } while ((sel < 0 || sel > 5) && !shouldQuit());
-
- return sel + 1;
-}
-
-void EoBEngine::seq_playOpeningCredits() {
- _allowSkip = true;
-
- loadSetIntroPalette(_introFilesOpening[5]);
- _screen->loadBitmap(_introFilesOpening[4], 5, 3, 0);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
-
- snd_playSong(1);
- delay(_introOpeningFrmDelay[0] * _tickLength);
-
- for (int i = 0; i < 4 && !shouldQuit() && !skipFlag(); i++) {
- _screen->loadBitmap(_introFilesOpening[i], 5, 3, 0);
- uint32 nextFrameTimer = _system->getMillis() + _introOpeningFrmDelay[i + 1] * _tickLength;
- _screen->crossFadeRegion(0, 50, 0, 50, 320, 102, 2, 0);
- delayUntil(nextFrameTimer);
- }
-
- _allowSkip = false;
+class EoBIntroPlayer {
+public:
+ EoBIntroPlayer(EoBEngine *vm, Screen_EoB *screen);
+ ~EoBIntroPlayer() {}
+
+ void start();
+
+private:
+ void openingCredits();
+ void tower();
+ void orb();
+ void waterdeepEntry();
+ void king();
+ void hands();
+ void waterdeepExit();
+ void tunnel();
+
+ void loadAndSetPalette(const char *filename);
+ void copyBlurRegion(int x1, int y1, int x2, int y2, int w, int h, int step);
+ void boxMorphTransition(int targetDestX, int targetDestY, int targetFinalX, int targetFinalY, int targetSrcX, int targetSrcY, int targetFinalW, int targetFinalH, int originX1, int originY1, int originW, int originH);
+ void whirlTransition();
+
+ EoBEngine *_vm;
+ Screen_EoB *_screen;
+
+ const char *const *_filesOpening;
+ const char *const *_filesTower;
+ const char *const *_filesOrb;
+ const char *const *_filesWdEntry;
+ const char *const *_filesKing;
+ const char *const *_filesHands;
+ const char *const *_filesWdExit;
+ const char *const *_filesTunnel;
+ const uint8 *_openingFrmDelay;
+ const uint8 *_wdEncodeX;
+ const uint8 *_wdEncodeY;
+ const uint8 *_wdEncodeWH;
+ const uint16 *_wdDsX;
+ const uint8 *_wdDsY;
+ const uint8 *_tvlX1;
+ const uint8 *_tvlY1;
+ const uint8 *_tvlX2;
+ const uint8 *_tvlY2;
+ const uint8 *_tvlW;
+ const uint8 *_tvlH;
+};
+
+EoBIntroPlayer::EoBIntroPlayer(EoBEngine *vm, Screen_EoB *screen) : _vm(vm), _screen(screen) {
+ int temp = 0;
+ _filesOpening = _vm->staticres()->loadStrings(kEoB1IntroFilesOpening, temp);
+ _filesTower = _vm->staticres()->loadStrings(kEoB1IntroFilesTower, temp);
+ _filesOrb = _vm->staticres()->loadStrings(kEoB1IntroFilesOrb, temp);
+ _filesWdEntry = _vm->staticres()->loadStrings(kEoB1IntroFilesWdEntry, temp);
+ _filesKing = _vm->staticres()->loadStrings(kEoB1IntroFilesKing, temp);
+ _filesHands = _vm->staticres()->loadStrings(kEoB1IntroFilesHands, temp);
+ _filesWdExit = _vm->staticres()->loadStrings(kEoB1IntroFilesWdExit, temp);
+ _filesTunnel = _vm->staticres()->loadStrings(kEoB1IntroFilesTunnel, temp);
+ _openingFrmDelay = _vm->staticres()->loadRawData(kEoB1IntroOpeningFrmDelay, temp);
+ _wdEncodeX = _vm->staticres()->loadRawData(kEoB1IntroWdEncodeX, temp);
+ _wdEncodeY = _vm->staticres()->loadRawData(kEoB1IntroWdEncodeY, temp);
+ _wdEncodeWH = _vm->staticres()->loadRawData(kEoB1IntroWdEncodeWH, temp);
+ _wdDsX = _vm->staticres()->loadRawDataBe16(kEoB1IntroWdDsX, temp);
+ _wdDsY = _vm->staticres()->loadRawData(kEoB1IntroWdDsY, temp);
+ _tvlX1 = _vm->staticres()->loadRawData(kEoB1IntroTvlX1, temp);
+ _tvlY1 = _vm->staticres()->loadRawData(kEoB1IntroTvlY1, temp);
+ _tvlX2 = _vm->staticres()->loadRawData(kEoB1IntroTvlX2, temp);
+ _tvlY2 = _vm->staticres()->loadRawData(kEoB1IntroTvlY2, temp);
+ _tvlW = _vm->staticres()->loadRawData(kEoB1IntroTvlW, temp);
+ _tvlH = _vm->staticres()->loadRawData(kEoB1IntroTvlH, temp);
}
-void EoBEngine::seq_playIntro() {
- _allowSkip = true;
+void EoBIntroPlayer::start() {
+ _vm->_allowSkip = true;
+ openingCredits();
- if (!shouldQuit() && !skipFlag()) {
- snd_playSong(2);
+ if (!_vm->shouldQuit() && !_vm->skipFlag()) {
+ _vm->snd_playSong(2);
_screen->loadBitmap("TITLE-V.CMP", 5, 3, 0);
_screen->crossFadeRegion(0, 0, 0, 0, 320, 200, 2, 0);
- delay(120 * _tickLength);
+ _vm->delay(120 * _vm->_tickLength);
}
- Common::SeekableReadStream *s = _res->createReadStream("TEXT.RAW");
+ Common::SeekableReadStream *s = _vm->resource()->createReadStream("TEXT.RAW");
if (s) {
s->seek(768);
_screen->loadFileDataToPage(s, 6, s->size() - 768);
@@ -146,65 +124,41 @@ void EoBEngine::seq_playIntro() {
_screen->loadBitmap("TEXT.CMP", 3, 6, 0);
}
- seq_tower();
- seq_orb();
- seq_waterdeepEntry();
- seq_king();
- seq_hands();
- seq_waterdeepExit();
- seq_tunnel();
+ tower();
+ orb();
+ waterdeepEntry();
+ king();
+ hands();
+ waterdeepExit();
+ tunnel();
whirlTransition();
- _sound->haltTrack();
- _allowSkip = false;
+ _vm->snd_stopSound();
+ _vm->_allowSkip = false;
}
-void EoBEngine::seq_playFinale() {
- Common::SeekableReadStream *s = _res->createReadStream("TEXT.DAT");
- _screen->loadFileDataToPage(s, 5, 32000);
- delete s;
-
- snd_playSoundEffect(20);
-
- _txt->resetPageBreakString();
- _txt->setWaitButtonMode(1);
- _txt->setupField(12, true);
- gui_drawBox(0, 0, 176, 175, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill);
- _txt->printDialogueText(51, _moreStrings[0]);
-
- if (!checkScriptFlags(0x1ffe)) {
- _screen->fadeToBlack();
- return;
- }
-
- _txt->printDialogueText(_finBonusStrings[0]);
- for (int i = 0; i < 6; i++) {
- _txt->printDialogueText(_finBonusStrings[1]);
- if (_characters[i].flags & 1)
- _txt->printDialogueText(_characters[i].name);
- }
+void EoBIntroPlayer::openingCredits() {
+ loadAndSetPalette(_filesOpening[5]);
+ _screen->loadBitmap(_filesOpening[4], 5, 3, 0);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
- uint32 password = 0;
- for (int i = 0; i < 4; i++) {
- if (!(_characters[i].flags & 1))
- continue;
+ _vm->snd_playSong(1);
+ _vm->delay(_openingFrmDelay[0] * _vm->_tickLength);
- int len = strlen(_characters[i].name);
- for (int ii = 0; ii < len; ii++) {
- uint32 c = _characters[i].name[ii];
- password += (c * c);
- }
+ for (int i = 0; i < 4 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ _screen->loadBitmap(_filesOpening[i], 5, 3, 0);
+ uint32 nextFrameTimer = _vm->_system->getMillis() + _openingFrmDelay[i + 1] * _vm->_tickLength;
+ _screen->crossFadeRegion(0, 50, 0, 50, 320, 102, 2, 0);
+ _vm->delayUntil(nextFrameTimer);
}
-
- _txt->printDialogueText(Common::String::format(_finBonusStrings[2], password).c_str(), true);
- _screen->fadeToBlack();
}
-void EoBEngine::seq_tower() {
- if (shouldQuit() || skipFlag())
+void EoBIntroPlayer::tower() {
+ if (_vm->shouldQuit() || _vm->skipFlag())
return;
- _screen->loadBitmap(_introFilesTower[1], 5, 3, 0);
+ _screen->loadBitmap(_filesTower[1], 5, 3, 0);
_screen->setCurPage(2);
uint8 *shp = _screen->encodeShape(0, 0, 16, 56, true);
_screen->copyPage(3, 4);
@@ -216,7 +170,7 @@ void EoBEngine::seq_tower() {
_screen->fillRect(0, 184, 319, 199, 12);
int cp = _screen->setCurPage(0);
whirlTransition();
- loadSetIntroPalette(_introFilesTower[0]);
+ loadAndSetPalette(_filesTower[0]);
_screen->setCurPage(cp);
_screen->clearCurPage();
@@ -226,29 +180,29 @@ void EoBEngine::seq_tower() {
_screen->setCurPage(0);
- for (int i = 0; i < 64 && !shouldQuit() && !skipFlag(); i += 2) {
- uint32 end = _system->getMillis() + 2 * _tickLength;
+ for (int i = 0; i < 64 && !_vm->shouldQuit() && !_vm->skipFlag(); i += 2) {
+ uint32 end = _vm->_system->getMillis() + 2 * _vm->_tickLength;
_screen->copyRegion(0, 142 - i, 96, 0, 128, i + 1, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(0, 0, 96, i + 1, 128, 167 - i, 2, 0, Screen::CR_NO_P_CHECK);
if (!i)
_screen->copyRegion(0, 0, 0, 168, 320, 32, 6, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- for (int i = 0; i < 24 && !shouldQuit() && !skipFlag(); i += 2) {
- uint32 end = _system->getMillis() + 2 * _tickLength;
+ for (int i = 0; i < 24 && !_vm->shouldQuit() && !_vm->skipFlag(); i += 2) {
+ uint32 end = _vm->_system->getMillis() + 2 * _vm->_tickLength;
_screen->copyRegion(0, 79 - i, 96, 0, 24, 65 + i, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(104, 79 - i, 200, 0, 24, 65 + i, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(24, 110, 120, i + 31, 80, 34, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(152, 0, 120, 32, 80, i + 1, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(0, 0, 96, 65 + i, 128, 103 - i, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- for (int i = 0; i < 56 && !shouldQuit() && !skipFlag(); i += 2) {
- uint32 end = _system->getMillis() + 2 * _tickLength;
+ for (int i = 0; i < 56 && !_vm->shouldQuit() && !_vm->skipFlag(); i += 2) {
+ uint32 end = _vm->_system->getMillis() + 2 * _vm->_tickLength;
_screen->copyRegion(0, 56, 96, i, 24, 54, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(104, 56, 200, i, 24, 54, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(0, 110, 96, 54 + i, 128, 34, 4, 0, Screen::CR_NO_P_CHECK);
@@ -266,24 +220,24 @@ void EoBEngine::seq_tower() {
_screen->copyRegion(128, 0, 96, 0, 128, i + 1, 2, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(0, 0, 96, i + 89, 128, 79 - i, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
_screen->copyRegion(0, 32, 0, 168, 320, 32, 6, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(65 * _tickLength);
+ _vm->delay(65 * _vm->_tickLength);
delete[] shp;
}
-void EoBEngine::seq_orb() {
- if (shouldQuit() || skipFlag())
+void EoBIntroPlayer::orb() {
+ if (_vm->shouldQuit() || _vm->skipFlag())
return;
uint8 *shp[5];
- _screen->loadBitmap(_introFilesOrb[0], 5, 3, 0);
+ _screen->loadBitmap(_filesOrb[0], 5, 3, 0);
_screen->setCurPage(2);
shp[4] = _screen->encodeShape(0, 0, 20, 136, true);
- _screen->loadBitmap(_introFilesOrb[1], 5, 3, 0);
+ _screen->loadBitmap(_filesOrb[1], 5, 3, 0);
shp[3] = _screen->encodeShape(16, 0, 16, 104, true);
_screen->fillRect(0, 0, 127, 103, 12);
@@ -297,51 +251,51 @@ void EoBEngine::seq_orb() {
_screen->copyPage(3, 4);
_screen->clearCurPage();
- snd_playSoundEffect(6);
+ _vm->snd_playSoundEffect(6);
- for (int i = -1; i < 4 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + 3 * _tickLength;
+ for (int i = -1; i < 4 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + 3 * _vm->_tickLength;
if (i >= 0)
_screen->drawShape(2, shp[i], 16, 16, 0);
_screen->drawShape(2, shp[4], 0, 0, 0);
_screen->copyRegion(0, 0, 80, 24, 160, 136, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
_screen->copyRegion(0, 64, 0, 168, 320, 16, 6, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(40 * _tickLength);
+ _vm->delay(40 * _vm->_tickLength);
- snd_playSoundEffect(6);
+ _vm->snd_playSoundEffect(6);
- for (int i = 3; i > -2 && !shouldQuit() && !skipFlag(); i--) {
- uint32 end = _system->getMillis() + 3 * _tickLength;
+ for (int i = 3; i > -2 && !_vm->shouldQuit() && !_vm->skipFlag(); i--) {
+ uint32 end = _vm->_system->getMillis() + 3 * _vm->_tickLength;
_screen->fillRect(16, 16, 143, 119, 12, 2);
if (i >= 0)
_screen->drawShape(2, shp[i], 16, 16, 0);
_screen->drawShape(2, shp[4], 0, 0, 0);
_screen->copyRegion(0, 0, 80, 24, 160, 136, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- delay(40 * _tickLength);
+ _vm->delay(40 * _vm->_tickLength);
for (int i = 0; i < 5; i++)
delete[] shp[i];
}
-void EoBEngine::seq_waterdeepEntry() {
- if (shouldQuit() || skipFlag())
+void EoBIntroPlayer::waterdeepEntry() {
+ if (_vm->shouldQuit() || _vm->skipFlag())
return;
uint8 *shp[4];
uint8 *shp2[31];
uint8 *shp3[3];
- loadSetIntroPalette(_introFilesWdEntry[0]);
- _screen->loadBitmap(_introFilesWdEntry[1], 5, 3, 0);
+ loadAndSetPalette(_filesWdEntry[0]);
+ _screen->loadBitmap(_filesWdEntry[1], 5, 3, 0);
_screen->setCurPage(2);
shp[3] = _screen->encodeShape(0, 0, 20, 136, true);
for (int i = 1; i < 4; i++) {
@@ -352,57 +306,57 @@ void EoBEngine::seq_waterdeepEntry() {
_screen->copyPage(3, 4);
_screen->fillRect(0, 168, 319, 199, 12, 0);
- snd_playSoundEffect(6);
+ _vm->snd_playSoundEffect(6);
- for (int i = 0; i < 4 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + 3 * _tickLength;
+ for (int i = 0; i < 4 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + 3 * _vm->_tickLength;
_screen->drawShape(0, shp[i], 80, 24, 0);
delete[] shp[i];
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
_screen->copyRegion(0, 80, 0, 168, 320, 16, 6, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(50 * _tickLength);
+ _vm->delay(50 * _vm->_tickLength);
_screen->setCurPage(2);
shp[0] = _screen->encodeShape(20, 0, 20, 136, true);
- _screen->loadBitmap(_introFilesWdEntry[2], 5, 3, 0);
+ _screen->loadBitmap(_filesWdEntry[2], 5, 3, 0);
shp[1] = _screen->encodeShape(0, 0, 20, 136, true);
shp[2] = _screen->encodeShape(20, 0, 20, 136, true);
- _screen->loadBitmap(_introFilesWdEntry[3], 5, 3, 0);
+ _screen->loadBitmap(_filesWdEntry[3], 5, 3, 0);
for (int i = 0; i < 31; i++)
- shp2[i] = _screen->encodeShape(_introWdEncodeX[i], 136 + (_introWdEncodeY[i] << 3), _introWdEncodeWH[i], _introWdEncodeWH[i] << 3, true);
+ shp2[i] = _screen->encodeShape(_wdEncodeX[i], 136 + (_wdEncodeY[i] << 3), _wdEncodeWH[i], _wdEncodeWH[i] << 3, true);
for (int i = 0; i < 3; i++)
shp3[i] = _screen->encodeShape(5 * i, 152, 5, 32, true);
_screen->copyPage(3, 4);
- for (int i = 0; i < 3 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + 3 * _tickLength;
+ for (int i = 0; i < 3 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + 3 * _vm->_tickLength;
_screen->fillRect(0, 0, 159, 135, 12, 2);
_screen->drawShape(2, shp[i], 0, 0, 0);
_screen->copyRegion(0, 0, 80, 24, 160, 136, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
_screen->copyRegion(0, 0, 80, 24, 160, 136, 4, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(4 * _tickLength);
+ _vm->delay(4 * _vm->_tickLength);
_screen->copyRegion(160, 0, 80, 24, 160, 136, 4, 0, Screen::CR_NO_P_CHECK);
_screen->fillRect(0, 168, 319, 199, 12, 0);
_screen->updateScreen();
- delay(4 * _tickLength);
+ _vm->delay(4 * _vm->_tickLength);
_screen->copyRegion(0, 184, 40, 184, 232, 16, 4, 0, Screen::CR_NO_P_CHECK);
int cx = 264;
int cy = 11;
- for (int i = 0; i < 70 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + 3 * _tickLength;
+ for (int i = 0; i < 70 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + 3 * _vm->_tickLength;
_screen->copyRegion(cx - 2, cy - 2, 0, 0, 48, 36, 4, 4, Screen::CR_NO_P_CHECK);
_screen->drawShape(4, shp3[((i & 3) == 3) ? 1 : (i & 3)], cx, cy, 0);
@@ -412,15 +366,15 @@ void EoBEngine::seq_waterdeepEntry() {
cy++;
for (int ii = 0; ii < 5; ii++) {
- int s = _rnd.getRandomNumber(255) % 31;
- _screen->drawShape(0, shp2[s], _introWdDsX[s] - 80, _introWdDsY[s] + 24, 0);
+ int s = _vm->_rnd.getRandomNumber(255) % 31;
+ _screen->drawShape(0, shp2[s], _wdDsX[s] - 80, _wdDsY[s] + 24, 0);
}
- if (!(_rnd.getRandomNumber(255) & 7))
- snd_playSoundEffect(_rnd.getRandomBit() ? 5 : 14);
+ if (!(_vm->_rnd.getRandomNumber(255) & 7))
+ _vm->snd_playSoundEffect(_vm->_rnd.getRandomBit() ? 5 : 14);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
for (int i = 0; i < 3; i++) {
@@ -432,11 +386,11 @@ void EoBEngine::seq_waterdeepEntry() {
delete[] shp2[i];
}
-void EoBEngine::seq_king() {
- if (shouldQuit() || skipFlag())
+void EoBIntroPlayer::king() {
+ if (_vm->shouldQuit() || _vm->skipFlag())
return;
- _screen->loadBitmap(_introFilesKing[0], 5, 3, 0);
+ _screen->loadBitmap(_filesKing[0], 5, 3, 0);
_screen->copyPage(3, 4);
int x = 15;
@@ -444,8 +398,8 @@ void EoBEngine::seq_king() {
int w = 1;
int h = 1;
- for (int i = 0; i < 10 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = 0; i < 10 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->copyRegion(x << 3, y << 3, x << 3, y << 3, w << 3, h << 3, 4, 0, Screen::CR_NO_P_CHECK);
if (x > 6)
x --;
@@ -458,10 +412,10 @@ void EoBEngine::seq_king() {
if (y + h > 23)
h = 23 - y;
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- delay(25 * _tickLength);
+ _vm->delay(25 * _vm->_tickLength);
uint8 *shp[4];
int16 dy[4];
@@ -471,19 +425,19 @@ void EoBEngine::seq_king() {
static const uint8 advEncW[] = { 6, 6, 7, 6 };
static const int8 modY[] = { -4, -8, -2, -2, 1, 0, 0, 0 };
- _screen->loadBitmap(_introFilesKing[1], 5, 3, 0);
+ _screen->loadBitmap(_filesKing[1], 5, 3, 0);
_screen->setCurPage(2);
for (int i = 0; i < 4; i++) {
shp[i] = _screen->encodeShape(advEncX[i], 0, advEncW[i], 98, true);
- dy[i] = 180 + ((_rnd.getRandomNumber(255) & 3) << 3);
+ dy[i] = 180 + ((_vm->_rnd.getRandomNumber(255) & 3) << 3);
stepY[i] = (i * 5) & 3;
}
_screen->copyPage(0, 4);
- for (bool runloop = true; runloop && !shouldQuit() && !skipFlag();) {
+ for (bool runloop = true; runloop && !_vm->shouldQuit() && !_vm->skipFlag();) {
runloop = false;
- uint32 end = _system->getMillis() + 2 * _tickLength;
+ uint32 end = _vm->_system->getMillis() + 2 * _vm->_tickLength;
for (int i = 0; i < 4; i++) {
if (dy[i] <= 82)
@@ -503,29 +457,29 @@ void EoBEngine::seq_king() {
runloop = true;
}
- if (!(_rnd.getRandomNumber(255) & 3))
- snd_playSoundEffect(7);
+ if (!(_vm->_rnd.getRandomNumber(255) & 3))
+ _vm->snd_playSoundEffect(7);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
_screen->copyRegion(0, 96, 0, 160, 320, 32, 6, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(70 * _tickLength);
+ _vm->delay(70 * _vm->_tickLength);
for (int i = 0; i < 4; i++)
delete[] shp[i];
}
-void EoBEngine::seq_hands() {
- if (shouldQuit() || skipFlag())
+void EoBIntroPlayer::hands() {
+ if (_vm->shouldQuit() || _vm->skipFlag())
return;
_screen->setCurPage(2);
uint8 *shp1 = _screen->encodeShape(0, 140, 21, 60, true);
uint8 *shp2 = _screen->encodeShape(21, 140, 12, 60, true);
- _screen->loadBitmap(_introFilesHands[0], 3, 5, 0);
+ _screen->loadBitmap(_filesHands[0], 3, 5, 0);
_screen->fillRect(0, 160, 319, 199, 12, 0);
_screen->fillRect(0, 0, 191, 63, 157, 2);
@@ -535,24 +489,24 @@ void EoBEngine::seq_hands() {
_screen->copyRegion(0, 128, 0, 176, 320, 16, 6, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(15 * _tickLength);
- snd_playSoundEffect(11);
+ _vm->delay(15 * _vm->_tickLength);
+ _vm->snd_playSoundEffect(11);
- for (int i = -22; i <= 20 && !shouldQuit() && !skipFlag(); i += 4) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = -22; i <= 20 && !_vm->shouldQuit() && !_vm->skipFlag(); i += 4) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->fillRect(0, 0, 167, 63, 157);
_screen->drawShape(2, shp1, i, 4, 0);
_screen->drawShape(2, shp2, 105 - i, 4, 0);
_screen->copyRegion(0, 0, 144, 32, 168, 64, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- snd_playSoundEffect(10);
+ _vm->snd_playSoundEffect(10);
delete[] shp1;
delete[] shp2;
- delay(15 * _tickLength);
+ _vm->delay(15 * _vm->_tickLength);
_screen->setCurPage(4);
shp1 = _screen->encodeShape(17, 0, 11, 120, true);
@@ -564,35 +518,35 @@ void EoBEngine::seq_hands() {
_screen->drawShape(2, shp1, 32, -80, 0);
_screen->drawShape(2, shp2, 40, -16, 0);
boxMorphTransition(18, 16, 10, 12, 0, 0, 17, 8, 17, 3, 25, 10);
- delay(15 * _tickLength);
+ _vm->delay(15 * _vm->_tickLength);
- for (int i = -80; i <= 0 && !shouldQuit() && !skipFlag(); i += 4) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = -80; i <= 0 && !_vm->shouldQuit() && !_vm->skipFlag(); i += 4) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->fillRect(0, 0, 135, 63, 157);
_screen->drawShape(2, shp1, 32, i, 0);
_screen->drawShape(2, shp2, 40, i + 64, 0);
_screen->copyRegion(0, 0, 80, 96, 136, 64, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- snd_playSoundEffect(12);
- delay(5 * _tickLength);
+ _vm->snd_playSoundEffect(12);
+ _vm->delay(5 * _vm->_tickLength);
- for (int i = 0; i > -54 && !shouldQuit() && !skipFlag(); i -= 4) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = 0; i > -54 && !_vm->shouldQuit() && !_vm->skipFlag(); i -= 4) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->fillRect(0, 0, 135, 63, 157);
_screen->drawShape(2, shp3, 12, 64 + i, 0);
_screen->drawShape(2, shp1, 32, i, 0);
_screen->copyRegion(0, 0, 80, 96, 136, 64, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
delete[] shp1;
delete[] shp2;
delete[] shp3;
- delay(15 * _tickLength);
+ _vm->delay(15 * _vm->_tickLength);
_screen->setCurPage(4);
shp1 = _screen->encodeShape(0, 0, 17, 136, true);
@@ -603,23 +557,23 @@ void EoBEngine::seq_hands() {
_screen->drawShape(2, shp1, -56, -56, 0);
_screen->drawShape(2, shp2, 52, 49, 0);
boxMorphTransition(9, 6, 0, 0, 0, 0, 18, 12, 8, 11, 21, 10);
- delay(15 * _tickLength);
- snd_playSoundEffect(11);
+ _vm->delay(15 * _vm->_tickLength);
+ _vm->snd_playSoundEffect(11);
- for (int i = -56; i <= -8 && !shouldQuit() && !skipFlag(); i += 4) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = -56; i <= -8 && !_vm->shouldQuit() && !_vm->skipFlag(); i += 4) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->fillRect(0, 0, 143, 95, 157);
_screen->drawShape(2, shp1, i, i, 0);
_screen->drawShape(2, shp2, (i == -8) ? 55 : 52, (i == -8) ? 52 : 49, 0);
_screen->copyRegion(0, 0, 0, 0, 144, 96, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- snd_playSoundEffect(10);
+ _vm->snd_playSoundEffect(10);
delete[] shp1;
delete[] shp2;
- delay(30 * _tickLength);
+ _vm->delay(30 * _vm->_tickLength);
_screen->setCurPage(4);
shp1 = _screen->encodeShape(28, 0, 11, 40, true);
@@ -629,46 +583,46 @@ void EoBEngine::seq_hands() {
_screen->fillRect(0, 0, 87, 112, 157);
_screen->drawShape(2, shp2, 0, 90, 0);
boxMorphTransition(20, 13, 15, 6, 0, 0, 11, 14, 0, 0, 24, 16);
- delay(15 * _tickLength);
+ _vm->delay(15 * _vm->_tickLength);
int dy = 90;
- for (int i = -40; i <= 0 && !shouldQuit() && !skipFlag(); i += 4) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = -40; i <= 0 && !_vm->shouldQuit() && !_vm->skipFlag(); i += 4) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->fillRect(0, 0, 87, 112, 157);
_screen->drawShape(2, shp2, 0, dy, 0);
_screen->copyRegion(0, 0, 120, 48, 88, 112, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
dy -= 5;
}
- snd_playSoundEffect(13);
+ _vm->snd_playSoundEffect(13);
- for (int i = -40; i <= 0 && !shouldQuit() && !skipFlag(); i += 4) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = -40; i <= 0 && !_vm->shouldQuit() && !_vm->skipFlag(); i += 4) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->fillRect(0, 0, 87, 39, 157);
_screen->drawShape(2, shp1, 0, i, 0);
_screen->copyRegion(0, 0, 120, 48, 88, 112, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
delete[] shp1;
delete[] shp2;
- delay(48 * _tickLength);
+ _vm->delay(48 * _vm->_tickLength);
}
-void EoBEngine::seq_waterdeepExit() {
- if (shouldQuit() || skipFlag())
+void EoBIntroPlayer::waterdeepExit() {
+ if (_vm->shouldQuit() || _vm->skipFlag())
return;
uint8 *shp2[31];
uint8 *shp3[3];
- _screen->loadBitmap(_introFilesWdExit[0], 5, 3, 0);
+ _screen->loadBitmap(_filesWdExit[0], 5, 3, 0);
_screen->setCurPage(2);
for (int i = 0; i < 31; i++)
- shp2[i] = _screen->encodeShape(_introWdEncodeX[i], 136 + (_introWdEncodeY[i] << 3), _introWdEncodeWH[i], _introWdEncodeWH[i] << 3, true);
+ shp2[i] = _screen->encodeShape(_wdEncodeX[i], 136 + (_wdEncodeY[i] << 3), _wdEncodeWH[i], _wdEncodeWH[i] << 3, true);
for (int i = 0; i < 3; i++)
shp3[i] = _screen->encodeShape(5 * i + 15, 152, 5, 32, true);
uint8 *shp1 = _screen->encodeShape(31, 136, 5, 32, true);
@@ -680,8 +634,8 @@ void EoBEngine::seq_waterdeepExit() {
int cx = 140;
int cy = 128;
- for (int i = 0; i < 70 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + 3 * _tickLength;
+ for (int i = 0; i < 70 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + 3 * _vm->_tickLength;
int fx = cx - 2;
if (fx < 160)
fx = 160;
@@ -698,15 +652,15 @@ void EoBEngine::seq_waterdeepExit() {
cy--;
for (int ii = 0; ii < 5; ii++) {
- int s = _rnd.getRandomNumber(255) % 31;
- _screen->drawShape(0, shp2[s], _introWdDsX[s] - 80, _introWdDsY[s] + 24, 0);
+ int s = _vm->_rnd.getRandomNumber(255) % 31;
+ _screen->drawShape(0, shp2[s], _wdDsX[s] - 80, _wdDsY[s] + 24, 0);
}
- if (!(_rnd.getRandomNumber(255) & 7))
- snd_playSoundEffect(_rnd.getRandomBit() ? 5 : 14);
+ if (!(_vm->_rnd.getRandomNumber(255) & 7))
+ _vm->snd_playSoundEffect(_vm->_rnd.getRandomBit() ? 5 : 14);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
for (int i = 0; i < 3; i++)
@@ -720,19 +674,19 @@ void EoBEngine::seq_waterdeepExit() {
_screen->fillRect(0, 168, 319, 199, 12, 0);
_screen->copyRegion(0, 136, 0, 0, 48, 36, 0, 4, Screen::CR_NO_P_CHECK);
- loadSetIntroPalette(_introFilesWdExit[1]);
- _screen->loadBitmap(_introFilesWdExit[2], 3, 5, 0);
+ loadAndSetPalette(_filesWdExit[1]);
+ _screen->loadBitmap(_filesWdExit[2], 3, 5, 0);
_screen->copyPage(5, 2);
whirlTransition();
- delay(6 * _tickLength);
+ _vm->delay(6 * _vm->_tickLength);
_screen->copyRegion(0, 144, 0, 184, 320, 16, 6, 0, Screen::CR_NO_P_CHECK);
cx = 0;
cy = 136;
int dy = 0;
- for (int i = 0; i < 19 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = 0; i < 19 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->copyRegion(cx, cy, 80, dy + 16, 160, 8, 2, 0, Screen::CR_NO_P_CHECK);
cy += 8;
dy += 8;
@@ -741,199 +695,142 @@ void EoBEngine::seq_waterdeepExit() {
cy = 0;
}
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- snd_playSong(3);
- delay(60 * _tickLength);
+ _vm->snd_playSong(3);
+ _vm->delay(60 * _vm->_tickLength);
- for (int i = 0; i < 56 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = 0; i < 56 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() +_vm->_tickLength;
_screen->copyRegion(0, 136 + i, 80, 16, 160, 56 - i, 2, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(160, 0, 80, 72 - i, 160, 96 + i, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- for (int i = 1; i < 48 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = 1; i < 48 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->copyRegion(160, i, 80, 16, 160, 152, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- _screen->loadBitmap(_introFilesWdExit[3], 3, 5, 0);
+ _screen->loadBitmap(_filesWdExit[3], 3, 5, 0);
_screen->copyPage(5, 2);
- delay(30 * _tickLength);
+ _vm->delay(30 * _vm->_tickLength);
_screen->setCurPage(0);
_screen->fillRect(0, 16, 319, 31, 12);
_screen->fillRect(0, 136, 319, 199, 12);
_screen->copyRegion(0, 0, 80, 32, 160, 120, 2, 0, Screen::CR_NO_P_CHECK);
- loadSetIntroPalette(_introFilesWdExit[4]);
+ loadAndSetPalette(_filesWdExit[4]);
_screen->updateScreen();
- delay(50 * _tickLength);
+ _vm->delay(50 * _vm->_tickLength);
}
-void EoBEngine::seq_tunnel() {
- if (shouldQuit() || skipFlag())
+void EoBIntroPlayer::tunnel() {
+ if (_vm->shouldQuit() || _vm->skipFlag())
return;
_screen->setCurPage(4);
uint8 *shp2 = _screen->encodeShape(20, 0, 20, 120, true);
uint8 *shp1 = _screen->encodeShape(0, 0, 20, 120, true);
- drawBlockObject(1, 4, shp2, 160, 0, 0);
- drawBlockObject(1, 4, shp1, 0, 0, 0);
+ _vm->drawBlockObject(1, 4, shp2, 160, 0, 0);
+ _vm->drawBlockObject(1, 4, shp1, 0, 0, 0);
delete[] shp1;
delete[] shp2;
- for (int i = 0; i < 3 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + 8 * _tickLength;
+ for (int i = 0; i < 3 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + 8 * _vm->_tickLength;
_screen->copyRegion(0, 0, 80, 32, 160, 120, 4, 0, Screen::CR_NO_P_CHECK);
- snd_playSoundEffect(7);
+ _vm->snd_playSoundEffect(7);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
_screen->copyRegion(0, 0, 80, 32, 160, 120, 2, 0, Screen::CR_NO_P_CHECK);
- snd_playSoundEffect(7);
- end = _system->getMillis() + 8 * _tickLength;
+ _vm->snd_playSoundEffect(7);
+ end = _vm->_system->getMillis() + 8 * _vm->_tickLength;
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
_screen->copyRegion(0, 160, 0, 184, 320, 16, 6, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(18 * _tickLength);
+ _vm->delay(18 * _vm->_tickLength);
_screen->copyRegion(160, 0, 80, 32, 160, 120, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(5 * _tickLength);
+ _vm->delay(5 * _vm->_tickLength);
_screen->copyRegion(0, 122, 80, 32, 160, 60, 2, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(160, 122, 80, 92, 160, 60, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(5 * _tickLength);
+ _vm->delay(5 * _vm->_tickLength);
_screen->copyRegion(160, 0, 80, 32, 160, 120, 4, 0, Screen::CR_NO_P_CHECK);
for (int i = 0; i < 6; i++)
_screen->copyRegion(i * 48, 185, 56, (i << 3) + 24, 48, 8, 2, 2, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(5 * _tickLength);
+ _vm->delay(5 * _vm->_tickLength);
_screen->copyRegion(0, 0, 80, 32, 160, 120, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->loadBitmap(_introFilesTunnel[0], 5, 3, 0);
+ _screen->loadBitmap(_filesTunnel[0], 5, 3, 0);
_screen->copyPage(3, 4);
_screen->updateScreen();
- delay(40 * _tickLength);
+ _vm->delay(40 * _vm->_tickLength);
_screen->copyRegion(264, 0, 136, 56, 48, 48, 4, 0, Screen::CR_NO_P_CHECK);
- snd_playSoundEffect(8);
+ _vm->snd_playSoundEffect(8);
_screen->copyRegion(0, 0, 0, 0, 320, 184, 0, 2, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(16 * _tickLength);
- snd_playSoundEffect(4);
+ _vm->delay(16 * _vm->_tickLength);
+ _vm->snd_playSoundEffect(4);
- for (int i = 0; i < 30 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (int i = 0; i < 30 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
if (i == 0)
_screen->fillRect(0, 168, 319, 199, 12, 0);
- _screen->copyRegion(80, 25 + (_rnd.getRandomNumber(255) & 7), 80, 24, 160, 144, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(80, 25 + (_vm->_rnd.getRandomNumber(255) & 7), 80, 24, 160, 144, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
- snd_playSoundEffect(9);
+ _vm->snd_playSoundEffect(9);
- for (int i = 0; i < 6 && !shouldQuit() && !skipFlag(); i++) {
- uint32 end = _system->getMillis() + _tickLength;
- _screen->copyRegion(_introTvlX1[i] << 3, _introTvlY1[i], _introTvlX2[i] << 3, _introTvlY2[i], _introTvlW[i] << 3, _introTvlH[i], 4, 2, Screen::CR_NO_P_CHECK);
- for (int ii = 0; ii < 4 && !shouldQuit() && !skipFlag(); ii++) {
+ for (int i = 0; i < 6 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
+ _screen->copyRegion(_tvlX1[i] << 3, _tvlY1[i], _tvlX2[i] << 3, _tvlY2[i], _tvlW[i] << 3, _tvlH[i], 4, 2, Screen::CR_NO_P_CHECK);
+ for (int ii = 0; ii < 4 && !_vm->shouldQuit() && !_vm->skipFlag(); ii++) {
_screen->updateScreen();
- delayUntil(end);
- end = _system->getMillis() + _tickLength;
- _screen->copyRegion(80, 25 + (_rnd.getRandomNumber(255) & 7), 80, 24, 160, 144, 2, 0, Screen::CR_NO_P_CHECK);
+ _vm->delayUntil(end);
+ end = _vm->_system->getMillis() + _vm->_tickLength;
+ _screen->copyRegion(80, 25 + (_vm->_rnd.getRandomNumber(255) & 7), 80, 24, 160, 144, 2, 0, Screen::CR_NO_P_CHECK);
}
}
_screen->copyRegion(0, 0, 0, 0, 320, 168, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(40 * _tickLength);
+ _vm->delay(40 * _vm->_tickLength);
- _screen->loadBitmap(_introFilesTunnel[1], 5, 3, 0);
+ _screen->loadBitmap(_filesTunnel[1], 5, 3, 0);
_screen->copyPage(3, 4);
- snd_playSoundEffect(6);
+ _vm->snd_playSoundEffect(6);
_screen->copyRegion(0, 0, 80, 32, 160, 120, 4, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(2 * _tickLength);
+ _vm->delay(2 * _vm->_tickLength);
_screen->copyRegion(160, 0, 80, 32, 160, 120, 4, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
- delay(2 * _tickLength);
+ _vm->delay(2 * _vm->_tickLength);
_screen->copyRegion(0, 120, 80, 30, 160, 64, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(160, 120, 80, 94, 160, 64, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(0, 176, 0, 184, 320, 16, 6, 0, Screen::CR_NO_P_CHECK);
_screen->setCurPage(0);
_screen->updateScreen();
- delay(50 * _tickLength);
+ _vm->delay(50 * _vm->_tickLength);
}
-void EoBEngine::seq_xdeath() {
- uint8 *shapes1[5];
- uint8 *shapes2;
-
- _screen->loadShapeSetBitmap("XDEATH2", 5, 3);
- for (int i = 0; i < 4; i++)
- shapes1[i] = _screen->encodeShape(i / 2 * 14, i / 2 * 88, 14, 88, true);
- _screen->loadShapeSetBitmap("XDEATH3", 5, 3);
- shapes2 = _screen->encodeShape(22, 0, 16, 95, true);
- _screen->loadEoBBitmap("XDEATH1", 0, 5, 3, -1);
- _screen->setCurPage(0);
-
- for (int i = 0; i < 10; i++) {
- if (i == 2)
- snd_playSoundEffect(72);
- else if (i == 4 || i == 6)
- snd_playSoundEffect(54);
- else
- snd_playSoundEffect(34);
-
- if (i < 6) {
- _screen->copyRegion((i % 3) * 104, i / 3 * 88, 32, 10, 104, 88, 2, 0, Screen::CR_NO_P_CHECK);
- } else {
- snd_playSoundEffect(42);
- _screen->drawShape(0, shapes1[i - 6], 32, 10, 0);
- }
-
- _screen->updateScreen();
- delay(4 * _tickLength);
- }
-
- const ScreenDim *dm = _screen->getScreenDim(5);
- _screen->modifyScreenDim(5, dm->sx, 8, dm->w, dm->h);
- _screen->copyRegion(0, 0, 0, 0, 176, 120, 0, 5, Screen::CR_NO_P_CHECK);
-
- for (int i = 0; i < 19; i++) {
- snd_playSoundEffect(119);
- _screen->copyRegion(0, 0, 0, 0, 176, 120, 5, 2, Screen::CR_NO_P_CHECK);
- _screen->drawShape(2, shapes2, 24, i * 5 - 90, 5);
- _screen->copyRegion(0, 0, 0, 0, 176, 120, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
- delay(2 * _tickLength);
- }
-
- _screen->modifyScreenDim(5, dm->sx, 0, dm->w, dm->h);
-
- snd_playSoundEffect(5);
- delay(60 * _tickLength);
-
- for (int i = 0; i < 4; i++)
- delete[] shapes1[i];
- delete[] shapes2;
-
- gui_drawPlayField(false);
- gui_drawAllCharPortraitsWithStats();
-}
-
-void EoBEngine::loadSetIntroPalette(const char *filename) {
+void EoBIntroPlayer::loadAndSetPalette(const char *filename) {
_screen->loadPalette(filename, _screen->getPalette(0));
_screen->getPalette(0).fill(0, 1, 0);
_screen->setScreenPalette(_screen->getPalette(0));
}
-void EoBEngine::copyBlurRegion(int x1, int y1, int x2, int y2, int w, int h, int step) {
+void EoBIntroPlayer::copyBlurRegion(int x1, int y1, int x2, int y2, int w, int h, int step) {
const uint8 *ptr2 = _screen->getCPagePtr(3) + y1 * 320 + x1;
if (step == 1) {
@@ -993,7 +890,7 @@ void EoBEngine::copyBlurRegion(int x1, int y1, int x2, int y2, int w, int h, int
}
}
-void EoBEngine::boxMorphTransition(int targetDestX, int targetDestY, int targetFinalX, int targetFinalY, int targetSrcX, int targetSrcY, int targetFinalW, int targetFinalH, int originX1, int originY1, int originW, int originH) {
+void EoBIntroPlayer::boxMorphTransition(int targetDestX, int targetDestY, int targetFinalX, int targetFinalY, int targetSrcX, int targetSrcY, int targetFinalW, int targetFinalH, int originX1, int originY1, int originW, int originH) {
int originX2 = originX1 + originW;
int originY2 = originY1 + originH;
if (originY2 > 21)
@@ -1001,8 +898,8 @@ void EoBEngine::boxMorphTransition(int targetDestX, int targetDestY, int targetF
int w = 1;
int h = 1;
- for (bool runloop = true; runloop && !shouldQuit() && !skipFlag();) {
- uint32 end = _system->getMillis() + _tickLength;
+ for (bool runloop = true; runloop && !_vm->shouldQuit() && !_vm->skipFlag();) {
+ uint32 end = _vm->_system->getMillis() + _vm->_tickLength;
_screen->copyRegion(targetSrcX << 3, targetSrcY << 3, targetDestX << 3, targetDestY << 3, w << 3, h << 3, 2, 0, Screen::CR_NO_P_CHECK);
if (originX1 < targetDestX)
_screen->copyRegion(312, 0, originX1 << 3, 0, 8, 176, 0, 0, Screen::CR_NO_P_CHECK);
@@ -1046,14 +943,14 @@ void EoBEngine::boxMorphTransition(int targetDestX, int targetDestY, int targetF
originY2--;
_screen->updateScreen();
- delayUntil(end);
+ _vm->delayUntil(end);
}
}
-void EoBEngine::whirlTransition() {
+void EoBIntroPlayer::whirlTransition() {
for (int i = 0; i < 2; i++) {
for (int ii = 0; ii < 8; ii++) {
- uint32 e = _system->getMillis() + 3;
+ uint32 e = _vm->_system->getMillis() + 3;
if (ii & 1) {
for (int iii = i + ii; iii < 320; iii += 8)
_screen->drawClippedLine(iii, 0, iii, 199, 12);
@@ -1062,11 +959,185 @@ void EoBEngine::whirlTransition() {
_screen->drawClippedLine(0, iii, 319, iii, 12);
}
_screen->updateScreen();
- uint32 c = _system->getMillis();
+ uint32 c = _vm->_system->getMillis();
if (e > c)
- _system->delayMillis(e - c);
+ _vm->_system->delayMillis(e - c);
+ }
+ }
+}
+
+int EoBEngine::mainMenu() {
+ int menuChoice = _menuChoiceInit;
+ _menuChoiceInit = 0;
+
+ Screen::FontId of = _screen->_currentFont;
+
+ while (menuChoice >= 0 && !shouldQuit()) {
+ switch (menuChoice) {
+ case 0: {
+ _screen->loadPalette("EOBPAL.COL", _screen->getPalette(0));
+ _screen->loadEoBBitmap("INTRO", 0, 5, 3, 2);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ _screen->_curPage = 2;
+ of = _screen->setFont(Screen::FID_6_FNT);
+ Common::String versionString(Common::String::format("ScummVM %s", gScummVMVersion));
+ _screen->printText(versionString.c_str(), 280 - versionString.size() * 6, 153, _screen->getPagePixel(2, 0, 0), 0);
+ _screen->setFont(of);
+ _screen->fillRect(0, 159, 319, 199, _screen->getPagePixel(2, 0, 0));
+ gui_drawBox(77, 165, 173, 29, 13, 14, 12);
+ gui_drawBox(76, 164, 175, 31, 13, 14, -1);
+ _screen->_curPage = 0;
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ _allowImport = true;
+ menuChoice = mainMenuLoop();
+ _allowImport = false;
+ } break;
+
+ case 1:
+ // load game in progress
+ //
+ menuChoice = -1;
+ break;
+
+ case 2:
+ // create new party
+ menuChoice = -2;
+ break;
+
+ case 3:
+ // quit
+ menuChoice = -5;
+ break;
+
+ case 4:
+ // intro
+ _sound->loadSoundFile("SOUND");
+ _screen->hideMouse();
+ seq_playIntro();
+ _screen->showMouse();
+ _sound->loadSoundFile("ADLIB");
+ menuChoice = 0;
+ break;
}
}
+
+ return shouldQuit() ? -5 : menuChoice;
+}
+
+int EoBEngine::mainMenuLoop() {
+ int sel = -1;
+ do {
+ _screen->setScreenDim(28);
+ _gui->simpleMenu_setup(8, 0, _mainMenuStrings, -1, 0, 0);
+
+ while (sel == -1 && !shouldQuit())
+ sel = _gui->simpleMenu_process(8, _mainMenuStrings, 0, -1, 0);
+ } while ((sel < 0 || sel > 5) && !shouldQuit());
+
+ return sel + 1;
+}
+
+void EoBEngine::seq_playIntro() {
+ EoBIntroPlayer(this, _screen).start();
+}
+
+void EoBEngine::seq_playFinale() {
+ Common::SeekableReadStream *s = _res->createReadStream("TEXT.DAT");
+ _screen->loadFileDataToPage(s, 5, 32000);
+ delete s;
+
+ snd_playSoundEffect(20);
+
+ _txt->resetPageBreakString();
+ _txt->setWaitButtonMode(1);
+ _txt->setupField(12, true);
+ gui_drawBox(0, 0, 176, 175, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill);
+ _txt->printDialogueText(51, _moreStrings[0]);
+
+ if (!checkScriptFlags(0x1ffe)) {
+ _screen->fadeToBlack();
+ return;
+ }
+
+ _txt->printDialogueText(_finBonusStrings[0]);
+ for (int i = 0; i < 6; i++) {
+ _txt->printDialogueText(_finBonusStrings[1]);
+ if (_characters[i].flags & 1)
+ _txt->printDialogueText(_characters[i].name);
+ }
+
+ uint32 password = 0;
+ for (int i = 0; i < 4; i++) {
+ if (!(_characters[i].flags & 1))
+ continue;
+
+ int len = strlen(_characters[i].name);
+ for (int ii = 0; ii < len; ii++) {
+ uint32 c = _characters[i].name[ii];
+ password += (c * c);
+ }
+ }
+
+ _txt->printDialogueText(Common::String::format(_finBonusStrings[2], password).c_str(), true);
+ _screen->fadeToBlack();
+}
+
+void EoBEngine::seq_xdeath() {
+ uint8 *shapes1[5];
+ uint8 *shapes2;
+
+ _screen->loadShapeSetBitmap("XDEATH2", 5, 3);
+ for (int i = 0; i < 4; i++)
+ shapes1[i] = _screen->encodeShape(i / 2 * 14, i / 2 * 88, 14, 88, true);
+ _screen->loadShapeSetBitmap("XDEATH3", 5, 3);
+ shapes2 = _screen->encodeShape(22, 0, 16, 95, true);
+ _screen->loadEoBBitmap("XDEATH1", 0, 5, 3, -1);
+ _screen->setCurPage(0);
+
+ for (int i = 0; i < 10; i++) {
+ if (i == 2)
+ snd_playSoundEffect(72);
+ else if (i == 4 || i == 6)
+ snd_playSoundEffect(54);
+ else
+ snd_playSoundEffect(34);
+
+ if (i < 6) {
+ _screen->copyRegion((i % 3) * 104, i / 3 * 88, 32, 10, 104, 88, 2, 0, Screen::CR_NO_P_CHECK);
+ } else {
+ snd_playSoundEffect(42);
+ _screen->drawShape(0, shapes1[i - 6], 32, 10, 0);
+ }
+
+ _screen->updateScreen();
+ delay(4 * _tickLength);
+ }
+
+ const ScreenDim *dm = _screen->getScreenDim(5);
+ _screen->modifyScreenDim(5, dm->sx, 8, dm->w, dm->h);
+ _screen->copyRegion(0, 0, 0, 0, 176, 120, 0, 5, Screen::CR_NO_P_CHECK);
+
+ for (int i = 0; i < 19; i++) {
+ snd_playSoundEffect(119);
+ _screen->copyRegion(0, 0, 0, 0, 176, 120, 5, 2, Screen::CR_NO_P_CHECK);
+ _screen->drawShape(2, shapes2, 24, i * 5 - 90, 5);
+ _screen->copyRegion(0, 0, 0, 0, 176, 120, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delay(2 * _tickLength);
+ }
+
+ _screen->modifyScreenDim(5, dm->sx, 0, dm->w, dm->h);
+
+ snd_playSoundEffect(5);
+ delay(60 * _tickLength);
+
+ for (int i = 0; i < 4; i++)
+ delete[] shapes1[i];
+ delete[] shapes2;
+
+ gui_drawPlayField(false);
+ gui_drawAllCharPortraitsWithStats();
}
} // End of namespace Kyra
diff --git a/engines/kyra/staticres_eob.cpp b/engines/kyra/staticres_eob.cpp
index 638a185..a65ade7 100644
--- a/engines/kyra/staticres_eob.cpp
+++ b/engines/kyra/staticres_eob.cpp
@@ -1016,27 +1016,6 @@ void EoBEngine::initStaticResource() {
_mainMenuStrings = _staticres->loadStrings(kEoB1MainMenuStrings, temp);
_finBonusStrings = _staticres->loadStrings(kEoB1BonusStrings, temp);
- _introFilesOpening = _staticres->loadStrings(kEoB1IntroFilesOpening, temp);
- _introFilesTower = _staticres->loadStrings(kEoB1IntroFilesTower, temp);
- _introFilesOrb = _staticres->loadStrings(kEoB1IntroFilesOrb, temp);
- _introFilesWdEntry = _staticres->loadStrings(kEoB1IntroFilesWdEntry, temp);
- _introFilesKing = _staticres->loadStrings(kEoB1IntroFilesKing, temp);
- _introFilesHands = _staticres->loadStrings(kEoB1IntroFilesHands, temp);
- _introFilesWdExit = _staticres->loadStrings(kEoB1IntroFilesWdExit, temp);
- _introFilesTunnel = _staticres->loadStrings(kEoB1IntroFilesTunnel, temp);
- _introOpeningFrmDelay = _staticres->loadRawData(kEoB1IntroOpeningFrmDelay, temp);
- _introWdEncodeX = _staticres->loadRawData(kEoB1IntroWdEncodeX, temp);
- _introWdEncodeY = _staticres->loadRawData(kEoB1IntroWdEncodeY, temp);
- _introWdEncodeWH = _staticres->loadRawData(kEoB1IntroWdEncodeWH, temp);
- _introWdDsX = _staticres->loadRawDataBe16(kEoB1IntroWdDsX, temp);
- _introWdDsY = _staticres->loadRawData(kEoB1IntroWdDsY, temp);
- _introTvlX1 = _staticres->loadRawData(kEoB1IntroTvlX1, temp);
- _introTvlY1 = _staticres->loadRawData(kEoB1IntroTvlY1, temp);
- _introTvlX2 = _staticres->loadRawData(kEoB1IntroTvlX2, temp);
- _introTvlY2 = _staticres->loadRawData(kEoB1IntroTvlY2, temp);
- _introTvlW = _staticres->loadRawData(kEoB1IntroTvlW, temp);
- _introTvlH = _staticres->loadRawData(kEoB1IntroTvlH, temp);
-
_doorShapeEncodeDefs = _staticres->loadRawData(kEoB1DoorShapeDefs, temp);
_doorSwitchShapeEncodeDefs = _staticres->loadRawData(kEoB1DoorSwitchShapeDefs, temp);
_doorSwitchCoords = _staticres->loadRawData(kEoB1DoorSwitchCoords, temp);
Commit: 9f19bace4491753235051bc2f4f4037b79b5c9ac
https://github.com/scummvm/scummvm/commit/9f19bace4491753235051bc2f4f4037b79b5c9ac
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:34-08:00
Commit Message:
COMMON: remove unnecessary commas
Changed paths:
audio/mididrv.cpp
audio/softsynth/cms.cpp
diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp
index 829bc3c..6817791 100644
--- a/audio/mididrv.cpp
+++ b/audio/mididrv.cpp
@@ -59,17 +59,17 @@ static const struct {
uint32 type;
const char *guio;
} GUIOMapping[] = {
- { MT_PCSPK, GUIO_MIDIPCSPK, },
- { MT_CMS, GUIO_MIDICMS, },
- { MT_PCJR, GUIO_MIDIPCJR, },
- { MT_ADLIB, GUIO_MIDIADLIB, },
- { MT_C64, GUIO_MIDIC64, },
- { MT_AMIGA, GUIO_MIDIAMIGA, },
- { MT_APPLEIIGS, GUIO_MIDIAPPLEIIGS, },
- { MT_TOWNS, GUIO_MIDITOWNS, },
- { MT_PC98, GUIO_MIDIPC98, },
- { MT_GM, GUIO_MIDIGM, },
- { MT_MT32, GUIO_MIDIMT32, },
+ { MT_PCSPK, GUIO_MIDIPCSPK },
+ { MT_CMS, GUIO_MIDICMS },
+ { MT_PCJR, GUIO_MIDIPCJR },
+ { MT_ADLIB, GUIO_MIDIADLIB },
+ { MT_C64, GUIO_MIDIC64 },
+ { MT_AMIGA, GUIO_MIDIAMIGA },
+ { MT_APPLEIIGS, GUIO_MIDIAPPLEIIGS },
+ { MT_TOWNS, GUIO_MIDITOWNS },
+ { MT_PC98, GUIO_MIDIPC98 },
+ { MT_GM, GUIO_MIDIGM },
+ { MT_MT32, GUIO_MIDIMT32 },
{ 0, 0 },
};
diff --git a/audio/softsynth/cms.cpp b/audio/softsynth/cms.cpp
index a675da3..681f08d 100644
--- a/audio/softsynth/cms.cpp
+++ b/audio/softsynth/cms.cpp
@@ -41,7 +41,7 @@ static const byte envelope[8][64] = {
{15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
- 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, },
+ 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 },
/* single decay */
{15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Commit: d9c05f7121f6d3cdd800f295c2ec33783babdee2
https://github.com/scummvm/scummvm/commit/d9c05f7121f6d3cdd800f295c2ec33783babdee2
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:35-08:00
Commit Message:
COMMON: add gui options for rendering modes
The purpose is the same as for the sound gui options: users shouldn't be offered modes that the engine doesn't support.
Changed paths:
common/util.cpp
common/util.h
gui/options.cpp
gui/options.h
diff --git a/common/util.cpp b/common/util.cpp
index 3f97308..05d29fa 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -286,7 +286,10 @@ const RenderModeDescription g_renderModes[] = {
{ "hercAmber", _s("Hercules Amber"), kRenderHercA },
{ "cga", "CGA", kRenderCGA },
{ "ega", "EGA", kRenderEGA },
+ { "vga", "VGA", kRenderVGA },
{ "amiga", "Amiga", kRenderAmiga },
+ { "fmtowns", "FM-Towns", kRenderFMTowns },
+ { "pc98", "PC-98", kRenderPC98 },
{0, 0, kRenderDefault}
};
@@ -351,6 +354,15 @@ const struct GameOpt {
{ GUIO_NOASPECT, "noAspect" },
{ GUIO_EGAUNDITHER, "egaUndither" },
+ { GUIO_RENDERHERCGREEN, "hercGreen" },
+ { GUIO_RENDERHERCAMBER, "hercAmber" },
+ { GUIO_RENDERCGA, "cga" },
+ { GUIO_RENDEREGA, "ega" },
+ { GUIO_RENDERVGA, "vga" },
+ { GUIO_RENDERAMIGA, "amiga" },
+ { GUIO_RENDERFMTOWNS, "fmtowns" },
+ { GUIO_RENDERPC98, "pc98" },
+
{ GUIO_NONE, 0 }
};
diff --git a/common/util.h b/common/util.h
index 617bc3d..b6f6370 100644
--- a/common/util.h
+++ b/common/util.h
@@ -101,12 +101,22 @@ template<typename T> inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; }
#define GUIO_NOASPECT "\022"
#define GUIO_EGAUNDITHER "\023"
+#define GUIO_RENDERHERCGREEN "\030"
+#define GUIO_RENDERHERCAMBER "\031"
+#define GUIO_RENDERCGA "\032"
+#define GUIO_RENDEREGA "\033"
+#define GUIO_RENDERVGA "\034"
+#define GUIO_RENDERAMIGA "\035"
+#define GUIO_RENDERFMTOWNS "\036"
+#define GUIO_RENDERPC98 "\037"
+
#define GUIO0() (GUIO_NONE)
#define GUIO1(a) (a)
#define GUIO2(a,b) (a b)
#define GUIO3(a,b,c) (a b c)
#define GUIO4(a,b,c,d) (a b c d)
#define GUIO5(a,b,c,d,e) (a b c d e)
+#define GUIO6(a,b,c,d,e,f) (a b c d e f)
namespace Common {
@@ -299,11 +309,14 @@ extern const char *getPlatformDescription(Platform id);
*/
enum RenderMode {
kRenderDefault = 0,
- kRenderEGA = 1,
- kRenderCGA = 2,
- kRenderHercG = 3,
- kRenderHercA = 4,
- kRenderAmiga = 5
+ kRenderVGA = 1,
+ kRenderEGA = 2,
+ kRenderCGA = 3,
+ kRenderHercG = 4,
+ kRenderHercA = 5,
+ kRenderAmiga = 6,
+ kRenderFMTowns = 7,
+ kRenderPC98 = 8
};
struct RenderModeDescription {
diff --git a/gui/options.cpp b/gui/options.cpp
index 4fa5a82..bfad81c 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -191,9 +191,9 @@ void OptionsDialog::open() {
int sel = 0;
for (int i = 0; p->code; ++p, ++i) {
if (renderMode == p->id)
- sel = i + 2;
+ sel = p->id;
}
- _renderModePopUp->setSelected(sel);
+ _renderModePopUp->setSelectedTag(sel);
}
#ifdef SMALL_SCREEN_DEVICE
@@ -748,13 +748,18 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
}
// RenderMode popup
+ const Common::String allFlags = renderType2GUIO((uint32)-1);
+ bool renderingTypeDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != NULL);
+
_renderModePopUpDesc = new StaticTextWidget(boss, prefix + "grRenderPopupDesc", _("Render mode:"), _("Special dithering modes supported by some games"));
_renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", _("Special dithering modes supported by some games"));
_renderModePopUp->appendEntry(_("<default>"), Common::kRenderDefault);
_renderModePopUp->appendEntry("");
const Common::RenderModeDescription *rm = Common::g_renderModes;
for (; rm->code; ++rm) {
- _renderModePopUp->appendEntry(_c(rm->description, context), rm->id);
+ Common::String renderGuiOption = renderType2GUIO(rm->id);
+ if ((_domain == Common::ConfigManager::kApplicationDomain) || (_domain != Common::ConfigManager::kApplicationDomain && !renderingTypeDefined) || (_guioptions.contains(renderGuiOption)))
+ _renderModePopUp->appendEntry(_c(rm->description, context), rm->id);
}
// Fullscreen checkbox
@@ -1033,6 +1038,30 @@ void OptionsDialog::saveMusicDeviceSetting(PopUpWidget *popup, Common::String se
ConfMan.removeKey(setting, _domain);
}
+Common::String OptionsDialog::renderType2GUIO(uint32 renderType) {
+ static const struct {
+ Common::RenderMode type;
+ const char *guio;
+ } renderGUIOMapping[] = {
+ { Common::kRenderHercG, GUIO_RENDERHERCGREEN },
+ { Common::kRenderHercA, GUIO_RENDERHERCAMBER },
+ { Common::kRenderCGA, GUIO_RENDERCGA },
+ { Common::kRenderEGA, GUIO_RENDEREGA },
+ { Common::kRenderVGA, GUIO_RENDERVGA },
+ { Common::kRenderAmiga, GUIO_RENDERAMIGA },
+ { Common::kRenderFMTowns, GUIO_RENDERFMTOWNS },
+ { Common::kRenderPC98, GUIO_RENDERPC98 }
+ };
+ Common::String res;
+
+ for (int i = 0; i < ARRAYSIZE(renderGUIOMapping); i++) {
+ if (renderType == renderGUIOMapping[i].type || renderType == (uint32)-1)
+ res += renderGUIOMapping[i].guio;
+ }
+
+ return res;
+}
+
int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) {
if (_guioptions.contains(GUIO_NOSUBTITLES))
return kSubtitlesSpeech; // Speech only
diff --git a/gui/options.h b/gui/options.h
index 92ce3e5..4e0187f 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -85,6 +85,8 @@ protected:
bool loadMusicDeviceSetting(PopUpWidget *popup, Common::String setting, MusicType preferredType = MT_AUTO);
void saveMusicDeviceSetting(PopUpWidget *popup, Common::String setting);
+ Common::String renderType2GUIO(uint32 renderType);
+
TabWidget *_tabWidget;
int _graphicsTabId;
Commit: 70cfbcd0468db96a788d7886b6f851d5dfee4769
https://github.com/scummvm/scummvm/commit/70cfbcd0468db96a788d7886b6f851d5dfee4769
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:36-08:00
Commit Message:
KYRA: add new rendering mode gui options
(EOB should support EGA and CGA mode, but this isn't implemented yet)
Changed paths:
engines/kyra/detection_tables.h
diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h
index 2b37085..4d84b09 100644
--- a/engines/kyra/detection_tables.h
+++ b/engines/kyra/detection_tables.h
@@ -97,7 +97,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -110,7 +110,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -122,7 +122,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -134,7 +134,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -146,7 +146,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -158,7 +158,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_OLDFLOPPY_FLAGS
},
@@ -170,7 +170,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::ES_ESP,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -182,7 +182,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::ES_ESP,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -194,7 +194,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -211,7 +211,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDIAMIGA)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA)
},
KYRA1_AMIGA_FLAGS
},
@@ -228,7 +228,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformAmiga,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDIAMIGA)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA)
},
KYRA1_AMIGA_FLAGS
},
@@ -245,7 +245,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformMacintosh,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDIGM)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDIGM, GUIO_RENDERVGA)
},
KYRA1_FLOPPY_FLAGS
},
@@ -262,7 +262,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformFMTowns,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDITOWNS)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_RENDERFMTOWNS)
},
KYRA1_TOWNS_FLAGS
},
@@ -278,7 +278,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::JA_JPN,
Common::kPlatformFMTowns,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDITOWNS)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_RENDERFMTOWNS)
},
KYRA1_TOWNS_SJIS_FLAGS
},
@@ -297,7 +297,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::JA_JPN,
Common::kPlatformPC98,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDIPC98)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDIPC98, GUIO_RENDERPC98)
},
KYRA1_TOWNS_SJIS_FLAGS
},
@@ -310,7 +310,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_CD,
- GUIO3(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_CD_FLAGS
},
@@ -322,7 +322,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_CD,
- GUIO3(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_CD_FLAGS
},
@@ -334,7 +334,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_CD,
- GUIO3(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_CD_FLAGS
},
@@ -347,7 +347,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_CD,
- GUIO3(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_CD_FLAGS
},
@@ -409,7 +409,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_DEMO_FLAGS
},
@@ -422,7 +422,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO | ADGF_CD,
- GUIO3(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK)
+ GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA1_DEMO_CD_FLAGS
},
@@ -435,7 +435,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_FLOPPY_CMP_FLAGS
},
@@ -448,7 +448,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_FLOPPY_CMP_FLAGS
},
@@ -461,7 +461,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_FLOPPY_FLAGS
},
@@ -474,7 +474,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_FLOPPY_FLAGS
},
@@ -487,7 +487,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_FLOPPY_FLAGS
},
@@ -500,7 +500,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_FLOPPY_FLAGS
},
@@ -513,7 +513,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_FLOPPY_FAN_FLAGS(Common::RU_RUS, Common::EN_ANY)
},
@@ -526,7 +526,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_FLOPPY_FAN_FLAGS(Common::RU_RUS, Common::EN_ANY)
},
@@ -539,7 +539,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FLAGS
},
@@ -551,7 +551,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FLAGS
},
@@ -563,7 +563,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FLAGS
},
@@ -577,7 +577,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -589,7 +589,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -601,7 +601,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -614,7 +614,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -627,7 +627,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -640,7 +640,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -654,7 +654,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_FAN_FLAGS(Common::RU_RUS, Common::EN_ANY)
},
@@ -667,7 +667,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD | ADGF_DEMO,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_DEMO_FLAGS
},
@@ -680,7 +680,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD | ADGF_DEMO,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_DEMO_FLAGS
},
@@ -693,7 +693,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD | ADGF_DEMO,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_CD_DEMO_FLAGS
},
@@ -706,7 +706,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
KYRA2_DEMO_FLAGS
},
@@ -719,7 +719,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformFMTowns,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDITOWNS)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_RENDERFMTOWNS)
},
KYRA2_TOWNS_FLAGS
},
@@ -731,7 +731,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::JA_JPN,
Common::kPlatformFMTowns,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDITOWNS)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_RENDERFMTOWNS)
},
KYRA2_TOWNS_SJIS_FLAGS
},
@@ -743,7 +743,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC98,
ADGF_CD,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDIPC98)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDIPC98, GUIO_RENDERPC98)
},
KYRA2_TOWNS_FLAGS
},
@@ -755,7 +755,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::JA_JPN,
Common::kPlatformPC98,
ADGF_CD,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDIPC98)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDIPC98, GUIO_RENDERPC98)
},
KYRA2_TOWNS_SJIS_FLAGS
},
@@ -775,7 +775,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FLAGS
},
@@ -791,7 +791,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FLAGS
},
@@ -807,7 +807,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FLAGS
},
@@ -825,7 +825,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_INS_FLAGS
},
@@ -841,7 +841,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_INS_FLAGS
},
@@ -857,7 +857,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_INS_FLAGS
},
@@ -875,7 +875,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformMacintosh,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_INS_FLAGS
},
@@ -891,7 +891,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformMacintosh,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_INS_FLAGS
},
@@ -907,7 +907,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformMacintosh,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_INS_FLAGS
},
@@ -925,7 +925,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::ES_ESP,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FAN_FLAGS(Common::ES_ESP, Common::EN_ANY)
},
@@ -941,7 +941,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FAN_FLAGS(Common::ES_ESP, Common::EN_ANY)
},
@@ -957,7 +957,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FAN_FLAGS(Common::ES_ESP, Common::EN_ANY)
},
@@ -975,7 +975,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FAN_FLAGS(Common::IT_ITA, Common::FR_FRA)
},
@@ -991,7 +991,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FAN_FLAGS(Common::IT_ITA, Common::FR_FRA)
},
@@ -1007,7 +1007,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO1(GUIO_NOMIDI)
+ GUIO2(GUIO_NOMIDI, GUIO_RENDERVGA)
},
KYRA3_CD_FAN_FLAGS(Common::IT_ITA, Common::FR_FRA)
},
@@ -1026,7 +1026,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FLAGS
},
@@ -1043,7 +1043,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FLAGS
},
@@ -1060,7 +1060,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FLAGS
},
@@ -1077,7 +1077,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FLAGS
},
@@ -1094,7 +1094,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FLAGS
},
@@ -1111,7 +1111,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FLAGS
},
@@ -1129,7 +1129,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::RU_RUS, Common::DE_DEU)
},
@@ -1147,7 +1147,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::RU_RUS, Common::DE_DEU)
},
@@ -1164,7 +1164,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::RU_RUS, Common::DE_DEU)
},
@@ -1182,7 +1182,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -1199,7 +1199,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -1216,7 +1216,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -1233,7 +1233,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -1250,7 +1250,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -1267,7 +1267,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_CD_FAN_FLAGS(Common::IT_ITA, Common::EN_ANY)
},
@@ -1283,7 +1283,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_FLOPPY_CMP_FLAGS
},
@@ -1299,7 +1299,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_FLOPPY_CMP_FLAGS
},
@@ -1315,7 +1315,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_FLOPPY_CMP_FLAGS
},
@@ -1332,7 +1332,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_FLOPPY_FLAGS
},
@@ -1349,7 +1349,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_FLOPPY_FLAGS
},
@@ -1366,7 +1366,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_FLOPPY_FLAGS
},
@@ -1383,7 +1383,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_FLOPPY_FLAGS
},
@@ -1401,7 +1401,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_FLOPPY_FAN_FLAGS(Common::RU_RUS, Common::EN_ANY)
},
@@ -1418,7 +1418,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::JA_JPN,
Common::kPlatformPC98,
ADGF_NO_FLAGS,
- GUIO2(GUIO_NOSPEECH, GUIO_MIDIPC98)
+ GUIO3(GUIO_NOSPEECH, GUIO_MIDIPC98, GUIO_RENDERPC98)
},
LOL_PC98_SJIS_FLAGS
},
@@ -1435,7 +1435,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_DEMO_FLAGS
},
@@ -1451,7 +1451,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO4(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_MIDIPCSPK, GUIO_RENDERVGA)
},
LOL_KYRA2_DEMO_FLAGS
},
@@ -1469,7 +1469,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_TESTING,
- GUIO3(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA)
},
EOB_FLAGS
},
@@ -1485,7 +1485,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_TESTING,
- GUIO3(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK)
+ GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA)
},
EOB_FLAGS
},
@@ -1501,7 +1501,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_TESTING,
- GUIO3(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA)
},
EOB2_FLAGS
},
@@ -1517,7 +1517,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_TESTING,
- GUIO3(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA)
},
EOB2_FLAGS
},
Commit: 47005de313ac9646d8b676042d0695346c96b9dd
https://github.com/scummvm/scummvm/commit/47005de313ac9646d8b676042d0695346c96b9dd
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:37-08:00
Commit Message:
KYRA: (EOB) - fix minor bug (wrongly initialized value) and some renaming
Changed paths:
engines/kyra/eobcommon.cpp
engines/kyra/items_eob.cpp
engines/kyra/kyra_rpg.h
engines/kyra/saveload_eob.cpp
engines/kyra/timer_eob.cpp
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp
index ffee24f..42ceed5 100644
--- a/engines/kyra/eobcommon.cpp
+++ b/engines/kyra/eobcommon.cpp
@@ -201,6 +201,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags)
_coneOfColdDest1 = _coneOfColdDest2 = _coneOfColdDest3 = _coneOfColdDest4 = 0;
_coneOfColdGfxTblSize = 0;
_menuButtonDefs = 0;
+ _updateCharNum = 0;
_menuStringsMain = _menuStringsSaveLoad = _menuStringsOnOff = _menuStringsSpells = 0;
_menuStringsRest = _menuStringsDrop = _menuStringsExit = _menuStringsStarve = 0;
_menuStringsScribe = _menuStringsDrop2 = _menuStringsHead = _menuStringsPoison = 0;
diff --git a/engines/kyra/items_eob.cpp b/engines/kyra/items_eob.cpp
index 33b47c1..979b68d 100644
--- a/engines/kyra/items_eob.cpp
+++ b/engines/kyra/items_eob.cpp
@@ -531,7 +531,7 @@ bool EoBCoreEngine::launchObject(int charIndex, Item item, uint16 startBlock, in
setItemPosition((Item *)&_levelBlockProperties[startBlock].drawObjects, startBlock, item, startPos | 4);
t->enable = 1;
- t->u2 = 1;
+ t->starting = 1;
t->flags = 0;
t->direction = dir;
t->distance = 12;
@@ -559,7 +559,7 @@ void EoBCoreEngine::launchMagicObject(int charIndex, int type, uint16 startBlock
return;
t->enable = 2;
- t->u2 = 1;
+ t->starting = 1;
t->flags = _magicFlightObjectProperties[(type << 2) + 2];
t->direction = dir;
t->distance = _magicFlightObjectProperties[(type << 2) + 1];
@@ -568,7 +568,6 @@ void EoBCoreEngine::launchMagicObject(int charIndex, int type, uint16 startBlock
t->item = type;
t->objectType = _magicFlightObjectProperties[(type << 2) + 3];
t->attackerId = charIndex;
- t->u2 = 1;
t->callBackIndex = _magicFlightObjectProperties[type << 2];
_sceneUpdateRequired = true;
}
@@ -576,7 +575,7 @@ void EoBCoreEngine::launchMagicObject(int charIndex, int type, uint16 startBlock
bool EoBCoreEngine::updateObjectFlight(EoBFlyingObject *fo, int block, int pos) {
uint8 wallFlags = _wllWallFlags[_levelBlockProperties[block].walls[fo->direction ^ 2]];
if (fo->enable == 1) {
- if ((wallFlags & 1) || (fo->u2) || ((wallFlags & 2) && (_dscItemShapeMap[_items[fo->item].icon] >= 15))) {
+ if ((wallFlags & 1) || (fo->starting) || ((wallFlags & 2) && (_dscItemShapeMap[_items[fo->item].icon] >= 15))) {
getQueuedItem((Item *)&_levelBlockProperties[fo->curBlock].drawObjects, 0, fo->item);
setItemPosition((Item *)&_levelBlockProperties[block].drawObjects, block, fo->item, pos | 4);
fo->curBlock = block;
@@ -602,7 +601,7 @@ bool EoBCoreEngine::updateObjectFlight(EoBFlyingObject *fo, int block, int pos)
}
bool EoBCoreEngine::updateFlyingObjectHitTest(EoBFlyingObject *fo, int block, int pos) {
- if (fo->u2 && (fo->curBlock != _currentBlock || fo->attackerId >= 0) && (!blockHasMonsters(block) || fo->attackerId < 0))
+ if (fo->starting && (fo->curBlock != _currentBlock || fo->attackerId >= 0) && (!blockHasMonsters(fo->curBlock) || fo->attackerId < 0))
return false;
if (fo->enable == 2) {
diff --git a/engines/kyra/kyra_rpg.h b/engines/kyra/kyra_rpg.h
index b5530a9..b606963 100644
--- a/engines/kyra/kyra_rpg.h
+++ b/engines/kyra/kyra_rpg.h
@@ -70,7 +70,7 @@ struct EoBFlyingObject {
int16 attackerId;
Item item;
uint16 curBlock;
- uint16 u2;
+ uint16 starting;
uint8 u1;
uint8 direction;
uint8 distance;
diff --git a/engines/kyra/saveload_eob.cpp b/engines/kyra/saveload_eob.cpp
index 8884765..9f9476d 100644
--- a/engines/kyra/saveload_eob.cpp
+++ b/engines/kyra/saveload_eob.cpp
@@ -255,7 +255,7 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
m->attackerId = in.readSint16BE();
m->item = in.readSint16BE();
m->curBlock = in.readUint16BE();
- m->u2 = in.readUint16BE();
+ m->starting = in.readUint16BE();
m->u1 = in.readByte();
m->direction = in.readByte();
m->distance = in.readByte();
@@ -494,7 +494,7 @@ Common::Error EoBCoreEngine::saveGameStateIntern(int slot, const char *saveName,
out->writeSint16BE(m->attackerId);
out->writeSint16BE(m->item);
out->writeUint16BE(m->curBlock);
- out->writeUint16BE(m->u2);
+ out->writeUint16BE(m->starting);
out->writeByte(m->u1);
out->writeByte(m->direction);
out->writeByte(m->distance);
diff --git a/engines/kyra/timer_eob.cpp b/engines/kyra/timer_eob.cpp
index 8ad28c2..de1becf 100644
--- a/engines/kyra/timer_eob.cpp
+++ b/engines/kyra/timer_eob.cpp
@@ -195,7 +195,7 @@ void EoBCoreEngine::timerProcessFlyingObjects(int timerNum) {
if (newBl) {
bl = calcNewBlockPosition(fo->curBlock, fo->direction);
pos &= 3;
- fo->u2 = 0;
+ fo->starting = 0;
}
if (updateObjectFlight(fo, bl, pos)) {
Commit: d192fed3b52ec36abaf0f2d85158ddb28ee69fb1
https://github.com/scummvm/scummvm/commit/d192fed3b52ec36abaf0f2d85158ddb28ee69fb1
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:37-08:00
Commit Message:
KYRA: (EOB) - fix character hand icons
(upper thumbs should point to the right, lower thumb to the left)
Changed paths:
engines/kyra/gui_eob.cpp
diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp
index 3df19f3..b89a6d7 100644
--- a/engines/kyra/gui_eob.cpp
+++ b/engines/kyra/gui_eob.cpp
@@ -285,7 +285,7 @@ void EoBCoreEngine::gui_drawWeaponSlot(int charIndex, int slot) {
else if (!slot && _flags.gameID == GI_EOB2 && checkScriptFlags(0x80000000))
_screen->drawShape(_screen->_curPage, _itemIconShapes[103], x + 8, y, 0);
else
- _screen->drawShape(_screen->_curPage, _itemIconShapes[85], x + 8, y, 0);
+ _screen->drawShape(_screen->_curPage, _itemIconShapes[85 + slot], x + 8, y, 0);
if ((_characters[charIndex].disabledSlots & (1 << slot)) || !validateWeaponSlotItem(charIndex, slot) || (_characters[charIndex].hitPointsCur <= 0) || (_characters[charIndex].flags & 0x0c))
_screen->drawShape(_screen->_curPage, _weaponSlotGrid, x, y, 0);
Commit: 66ba9343987d67e8bf8e1742fcf139dee95a8448
https://github.com/scummvm/scummvm/commit/66ba9343987d67e8bf8e1742fcf139dee95a8448
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:38-08:00
Commit Message:
KYRA: (EOB) - fix minor glitch in hp and food bar graphs
Changed paths:
engines/kyra/gui_rpg.cpp
diff --git a/engines/kyra/gui_rpg.cpp b/engines/kyra/gui_rpg.cpp
index 718722f..a8b9403 100644
--- a/engines/kyra/gui_rpg.cpp
+++ b/engines/kyra/gui_rpg.cpp
@@ -72,7 +72,7 @@ void KyraRpgEngine::gui_drawHorizontalBarGraph(int x, int y, int w, int h, int32
screen()->fillRect(x, y, x + t - 1, y + h, col1);
if (t < w && col2)
- screen()->fillRect(x + t, y, x + w, y + h, col2);
+ screen()->fillRect(x + t, y, x + w - 1, y + h, col2);
}
void KyraRpgEngine::gui_initButtonsFromList(const int16 *list) {
Commit: 86a817beb5eef248c5f5e28f18133db802a59c2e
https://github.com/scummvm/scummvm/commit/86a817beb5eef248c5f5e28f18133db802a59c2e
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:39-08:00
Commit Message:
KYRA: (EOB) - start work on CGA and EGA graphics modes
Changed paths:
devtools/create_kyradat/create_kyradat.cpp
devtools/create_kyradat/create_kyradat.h
devtools/create_kyradat/games.cpp
devtools/create_kyradat/tables.cpp
dists/engine-data/kyra.dat
engines/kyra/chargen.cpp
engines/kyra/darkmoon.cpp
engines/kyra/darkmoon.h
engines/kyra/eob.cpp
engines/kyra/eob.h
engines/kyra/eobcommon.cpp
engines/kyra/eobcommon.h
engines/kyra/gui_eob.cpp
engines/kyra/kyra_rpg.cpp
engines/kyra/kyra_rpg.h
engines/kyra/kyra_v1.cpp
engines/kyra/kyra_v1.h
engines/kyra/resource.h
engines/kyra/saveload_eob.cpp
engines/kyra/scene_eob.cpp
engines/kyra/scene_lol.cpp
engines/kyra/scene_rpg.cpp
engines/kyra/screen.cpp
engines/kyra/screen.h
engines/kyra/screen_eob.cpp
engines/kyra/screen_eob.h
engines/kyra/sequences_darkmoon.cpp
engines/kyra/sequences_eob.cpp
engines/kyra/sprites_eob.cpp
engines/kyra/staticres.cpp
engines/kyra/staticres_eob.cpp
diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp
index 0b7d4af..a3d88c7 100644
--- a/devtools/create_kyradat/create_kyradat.cpp
+++ b/devtools/create_kyradat/create_kyradat.cpp
@@ -45,7 +45,7 @@
#include <map>
enum {
- kKyraDatVersion = 80
+ kKyraDatVersion = 81
};
const ExtractFilename extractFilenames[] = {
@@ -445,6 +445,21 @@ const ExtractFilename extractFilenames[] = {
{ kEoB1BeholderSfx, kTypeRawData, false },
{ kEoB1TurnUndeadString, kTypeStringList, true },
+ { kEoB1CgaMappingDefault, kTypeRawData, false },
+ { kEoB1CgaMappingAlt, kTypeRawData, false },
+ { kEoB1CgaMappingInv, kTypeRawData, false },
+ { kEoB1CgaMappingItemsL, kTypeRawData, false },
+ { kEoB1CgaMappingItemsS, kTypeRawData, false },
+ { kEoB1CgaMappingThrown, kTypeRawData, false },
+ { kEoB1CgaMappingIcons, kTypeRawData, false },
+ { kEoB1CgaMappingDeco, kTypeRawData, false },
+ { kEoB1CgaLevelMappingIndex, kTypeRawData, false },
+ { kEoB1CgaMappingLevel0, kTypeRawData, false },
+ { kEoB1CgaMappingLevel1, kTypeRawData, false },
+ { kEoB1CgaMappingLevel2, kTypeRawData, false },
+ { kEoB1CgaMappingLevel3, kTypeRawData, false },
+ { kEoB1CgaMappingLevel4, kTypeRawData, false },
+
{ kEoB1NpcShpData, kTypeRawData, false },
{ kEoB1NpcSubShpIndex1, kTypeRawData, false },
{ kEoB1NpcSubShpIndex2, kTypeRawData, false },
@@ -474,50 +489,50 @@ const ExtractFilename extractFilenames[] = {
{ kEoB2IntroStrings, k2TypeSfxList, true },
{ kEoB2IntroCPSFiles, kTypeStringList, true },
- { kEoB2IntroSeqData00, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData01, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData02, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData03, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData04, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData05, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData06, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData07, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData08, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData09, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData10, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData11, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData12, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData13, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData14, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData15, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData16, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData17, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData18, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData19, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData20, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData21, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData22, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData23, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData24, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData25, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData26, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData27, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData28, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData29, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData30, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData31, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData32, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData33, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData34, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData35, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData36, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData37, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData38, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData39, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData40, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData41, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData42, kEoB2TypeSeqData, false },
- { kEoB2IntroSeqData43, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData00, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData01, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData02, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData03, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData04, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData05, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData06, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData07, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData08, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData09, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData10, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData11, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData12, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData13, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData14, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData15, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData16, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData17, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData18, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData19, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData20, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData21, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData22, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData23, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData24, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData25, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData26, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData27, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData28, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData29, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData30, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData31, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData32, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData33, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData34, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData35, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData36, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData37, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData38, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData39, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData40, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData41, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData42, kEoB2TypeSeqData, false },
+ { kEob2IntroAnimData43, kEoB2TypeSeqData, false },
{ kEoB2IntroShapes00, kEoB2TypeShapeData, false },
{ kEoB2IntroShapes01, kEoB2TypeShapeData, false },
{ kEoB2IntroShapes04, kEoB2TypeShapeData, false },
@@ -526,27 +541,27 @@ const ExtractFilename extractFilenames[] = {
{ kEoB2FinaleStrings, k2TypeSfxList, true },
{ kEoB2CreditsData, kTypeRawData, true },
{ kEoB2FinaleCPSFiles, kTypeStringList, true },
- { kEoB2FinaleSeqData00, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData01, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData02, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData03, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData04, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData05, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData06, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData07, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData08, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData09, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData10, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData11, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData12, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData13, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData14, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData15, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData16, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData17, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData18, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData19, kEoB2TypeSeqData, false },
- { kEoB2FinaleSeqData20, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData00, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData01, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData02, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData03, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData04, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData05, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData06, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData07, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData08, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData09, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData10, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData11, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData12, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData13, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData14, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData15, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData16, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData17, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData18, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData19, kEoB2TypeSeqData, false },
+ { kEob2FinaleAnimData20, kEoB2TypeSeqData, false },
{ kEoB2FinaleShapes00, kEoB2TypeShapeData, false },
{ kEoB2FinaleShapes03, kEoB2TypeShapeData, false },
{ kEoB2FinaleShapes07, kEoB2TypeShapeData, false },
@@ -1756,6 +1771,34 @@ const char *getIdString(const int id) {
return "kEoB1BeholderSfx";
case kEoB1TurnUndeadString:
return "kEoB1TurnUndeadString";
+ case kEoB1CgaMappingDefault:
+ return "kEoB1CgaMappingDefault";
+ case kEoB1CgaMappingAlt:
+ return "kEoB1CgaMappingAlt";
+ case kEoB1CgaMappingInv:
+ return "kEoB1CgaMappingInv";
+ case kEoB1CgaMappingItemsL:
+ return "kEoB1CgaMappingItemsL";
+ case kEoB1CgaMappingItemsS:
+ return "kEoB1CgaMappingItemsS";
+ case kEoB1CgaMappingThrown:
+ return "kEoB1CgaMappingThrown";
+ case kEoB1CgaMappingIcons:
+ return "kEoB1CgaMappingIcons";
+ case kEoB1CgaMappingDeco:
+ return "kEoB1CgaMappingDeco";
+ case kEoB1CgaLevelMappingIndex:
+ return "kEoB1CgaLevelMappingIndex";
+ case kEoB1CgaMappingLevel0:
+ return "kEoB1CgaMappingLevel0";
+ case kEoB1CgaMappingLevel1:
+ return "kEoB1CgaMappingLevel1";
+ case kEoB1CgaMappingLevel2:
+ return "kEoB1CgaMappingLevel2";
+ case kEoB1CgaMappingLevel3:
+ return "kEoB1CgaMappingLevel3";
+ case kEoB1CgaMappingLevel4:
+ return "kEoB1CgaMappingLevel4";
case kEoB1NpcShpData:
return "kEoB1NpcShpData";
case kEoB1NpcSubShpIndex1:
@@ -1806,94 +1849,94 @@ const char *getIdString(const int id) {
return "kEoB2IntroStrings";
case kEoB2IntroCPSFiles:
return "kEoB2IntroCPSFiles";
- case kEoB2IntroSeqData00:
- return "kEoB2IntroSeqData00";
- case kEoB2IntroSeqData01:
- return "kEoB2IntroSeqData01";
- case kEoB2IntroSeqData02:
- return "kEoB2IntroSeqData02";
- case kEoB2IntroSeqData03:
- return "kEoB2IntroSeqData03";
- case kEoB2IntroSeqData04:
- return "kEoB2IntroSeqData04";
- case kEoB2IntroSeqData05:
- return "kEoB2IntroSeqData05";
- case kEoB2IntroSeqData06:
- return "kEoB2IntroSeqData06";
- case kEoB2IntroSeqData07:
- return "kEoB2IntroSeqData07";
- case kEoB2IntroSeqData08:
- return "kEoB2IntroSeqData08";
- case kEoB2IntroSeqData09:
- return "kEoB2IntroSeqData09";
- case kEoB2IntroSeqData10:
- return "kEoB2IntroSeqData10";
- case kEoB2IntroSeqData11:
- return "kEoB2IntroSeqData11";
- case kEoB2IntroSeqData12:
- return "kEoB2IntroSeqData12";
- case kEoB2IntroSeqData13:
- return "kEoB2IntroSeqData13";
- case kEoB2IntroSeqData14:
- return "kEoB2IntroSeqData14";
- case kEoB2IntroSeqData15:
- return "kEoB2IntroSeqData15";
- case kEoB2IntroSeqData16:
- return "kEoB2IntroSeqData16";
- case kEoB2IntroSeqData17:
- return "kEoB2IntroSeqData17";
- case kEoB2IntroSeqData18:
- return "kEoB2IntroSeqData18";
- case kEoB2IntroSeqData19:
- return "kEoB2IntroSeqData19";
- case kEoB2IntroSeqData20:
- return "kEoB2IntroSeqData20";
- case kEoB2IntroSeqData21:
- return "kEoB2IntroSeqData21";
- case kEoB2IntroSeqData22:
- return "kEoB2IntroSeqData22";
- case kEoB2IntroSeqData23:
- return "kEoB2IntroSeqData23";
- case kEoB2IntroSeqData24:
- return "kEoB2IntroSeqData24";
- case kEoB2IntroSeqData25:
- return "kEoB2IntroSeqData25";
- case kEoB2IntroSeqData26:
- return "kEoB2IntroSeqData26";
- case kEoB2IntroSeqData27:
- return "kEoB2IntroSeqData27";
- case kEoB2IntroSeqData28:
- return "kEoB2IntroSeqData28";
- case kEoB2IntroSeqData29:
- return "kEoB2IntroSeqData29";
- case kEoB2IntroSeqData30:
- return "kEoB2IntroSeqData30";
- case kEoB2IntroSeqData31:
- return "kEoB2IntroSeqData31";
- case kEoB2IntroSeqData32:
- return "kEoB2IntroSeqData32";
- case kEoB2IntroSeqData33:
- return "kEoB2IntroSeqData33";
- case kEoB2IntroSeqData34:
- return "kEoB2IntroSeqData34";
- case kEoB2IntroSeqData35:
- return "kEoB2IntroSeqData35";
- case kEoB2IntroSeqData36:
- return "kEoB2IntroSeqData36";
- case kEoB2IntroSeqData37:
- return "kEoB2IntroSeqData37";
- case kEoB2IntroSeqData38:
- return "kEoB2IntroSeqData38";
- case kEoB2IntroSeqData39:
- return "kEoB2IntroSeqData39";
- case kEoB2IntroSeqData40:
- return "kEoB2IntroSeqData40";
- case kEoB2IntroSeqData41:
- return "kEoB2IntroSeqData41";
- case kEoB2IntroSeqData42:
- return "kEoB2IntroSeqData42";
- case kEoB2IntroSeqData43:
- return "kEoB2IntroSeqData43";
+ case kEob2IntroAnimData00:
+ return "kEob2IntroAnimData00";
+ case kEob2IntroAnimData01:
+ return "kEob2IntroAnimData01";
+ case kEob2IntroAnimData02:
+ return "kEob2IntroAnimData02";
+ case kEob2IntroAnimData03:
+ return "kEob2IntroAnimData03";
+ case kEob2IntroAnimData04:
+ return "kEob2IntroAnimData04";
+ case kEob2IntroAnimData05:
+ return "kEob2IntroAnimData05";
+ case kEob2IntroAnimData06:
+ return "kEob2IntroAnimData06";
+ case kEob2IntroAnimData07:
+ return "kEob2IntroAnimData07";
+ case kEob2IntroAnimData08:
+ return "kEob2IntroAnimData08";
+ case kEob2IntroAnimData09:
+ return "kEob2IntroAnimData09";
+ case kEob2IntroAnimData10:
+ return "kEob2IntroAnimData10";
+ case kEob2IntroAnimData11:
+ return "kEob2IntroAnimData11";
+ case kEob2IntroAnimData12:
+ return "kEob2IntroAnimData12";
+ case kEob2IntroAnimData13:
+ return "kEob2IntroAnimData13";
+ case kEob2IntroAnimData14:
+ return "kEob2IntroAnimData14";
+ case kEob2IntroAnimData15:
+ return "kEob2IntroAnimData15";
+ case kEob2IntroAnimData16:
+ return "kEob2IntroAnimData16";
+ case kEob2IntroAnimData17:
+ return "kEob2IntroAnimData17";
+ case kEob2IntroAnimData18:
+ return "kEob2IntroAnimData18";
+ case kEob2IntroAnimData19:
+ return "kEob2IntroAnimData19";
+ case kEob2IntroAnimData20:
+ return "kEob2IntroAnimData20";
+ case kEob2IntroAnimData21:
+ return "kEob2IntroAnimData21";
+ case kEob2IntroAnimData22:
+ return "kEob2IntroAnimData22";
+ case kEob2IntroAnimData23:
+ return "kEob2IntroAnimData23";
+ case kEob2IntroAnimData24:
+ return "kEob2IntroAnimData24";
+ case kEob2IntroAnimData25:
+ return "kEob2IntroAnimData25";
+ case kEob2IntroAnimData26:
+ return "kEob2IntroAnimData26";
+ case kEob2IntroAnimData27:
+ return "kEob2IntroAnimData27";
+ case kEob2IntroAnimData28:
+ return "kEob2IntroAnimData28";
+ case kEob2IntroAnimData29:
+ return "kEob2IntroAnimData29";
+ case kEob2IntroAnimData30:
+ return "kEob2IntroAnimData30";
+ case kEob2IntroAnimData31:
+ return "kEob2IntroAnimData31";
+ case kEob2IntroAnimData32:
+ return "kEob2IntroAnimData32";
+ case kEob2IntroAnimData33:
+ return "kEob2IntroAnimData33";
+ case kEob2IntroAnimData34:
+ return "kEob2IntroAnimData34";
+ case kEob2IntroAnimData35:
+ return "kEob2IntroAnimData35";
+ case kEob2IntroAnimData36:
+ return "kEob2IntroAnimData36";
+ case kEob2IntroAnimData37:
+ return "kEob2IntroAnimData37";
+ case kEob2IntroAnimData38:
+ return "kEob2IntroAnimData38";
+ case kEob2IntroAnimData39:
+ return "kEob2IntroAnimData39";
+ case kEob2IntroAnimData40:
+ return "kEob2IntroAnimData40";
+ case kEob2IntroAnimData41:
+ return "kEob2IntroAnimData41";
+ case kEob2IntroAnimData42:
+ return "kEob2IntroAnimData42";
+ case kEob2IntroAnimData43:
+ return "kEob2IntroAnimData43";
case kEoB2IntroShapes00:
return "kEoB2IntroShapes00";
case kEoB2IntroShapes01:
@@ -1908,48 +1951,48 @@ const char *getIdString(const int id) {
return "kEoB2CreditsData";
case kEoB2FinaleCPSFiles:
return "kEoB2FinaleCPSFiles";
- case kEoB2FinaleSeqData00:
- return "kEoB2FinaleSeqData00";
- case kEoB2FinaleSeqData01:
- return "kEoB2FinaleSeqData01";
- case kEoB2FinaleSeqData02:
- return "kEoB2FinaleSeqData02";
- case kEoB2FinaleSeqData03:
- return "kEoB2FinaleSeqData03";
- case kEoB2FinaleSeqData04:
- return "kEoB2FinaleSeqData04";
- case kEoB2FinaleSeqData05:
- return "kEoB2FinaleSeqData05";
- case kEoB2FinaleSeqData06:
- return "kEoB2FinaleSeqData06";
- case kEoB2FinaleSeqData07:
- return "kEoB2FinaleSeqData07";
- case kEoB2FinaleSeqData08:
- return "kEoB2FinaleSeqData08";
- case kEoB2FinaleSeqData09:
- return "kEoB2FinaleSeqData09";
- case kEoB2FinaleSeqData10:
- return "kEoB2FinaleSeqData10";
- case kEoB2FinaleSeqData11:
- return "kEoB2FinaleSeqData11";
- case kEoB2FinaleSeqData12:
- return "kEoB2FinaleSeqData12";
- case kEoB2FinaleSeqData13:
- return "kEoB2FinaleSeqData13";
- case kEoB2FinaleSeqData14:
- return "kEoB2FinaleSeqData14";
- case kEoB2FinaleSeqData15:
- return "kEoB2FinaleSeqData15";
- case kEoB2FinaleSeqData16:
- return "kEoB2FinaleSeqData16";
- case kEoB2FinaleSeqData17:
- return "kEoB2FinaleSeqData17";
- case kEoB2FinaleSeqData18:
- return "kEoB2FinaleSeqData18";
- case kEoB2FinaleSeqData19:
- return "kEoB2FinaleSeqData19";
- case kEoB2FinaleSeqData20:
- return "kEoB2FinaleSeqData20";
+ case kEob2FinaleAnimData00:
+ return "kEob2FinaleAnimData00";
+ case kEob2FinaleAnimData01:
+ return "kEob2FinaleAnimData01";
+ case kEob2FinaleAnimData02:
+ return "kEob2FinaleAnimData02";
+ case kEob2FinaleAnimData03:
+ return "kEob2FinaleAnimData03";
+ case kEob2FinaleAnimData04:
+ return "kEob2FinaleAnimData04";
+ case kEob2FinaleAnimData05:
+ return "kEob2FinaleAnimData05";
+ case kEob2FinaleAnimData06:
+ return "kEob2FinaleAnimData06";
+ case kEob2FinaleAnimData07:
+ return "kEob2FinaleAnimData07";
+ case kEob2FinaleAnimData08:
+ return "kEob2FinaleAnimData08";
+ case kEob2FinaleAnimData09:
+ return "kEob2FinaleAnimData09";
+ case kEob2FinaleAnimData10:
+ return "kEob2FinaleAnimData10";
+ case kEob2FinaleAnimData11:
+ return "kEob2FinaleAnimData11";
+ case kEob2FinaleAnimData12:
+ return "kEob2FinaleAnimData12";
+ case kEob2FinaleAnimData13:
+ return "kEob2FinaleAnimData13";
+ case kEob2FinaleAnimData14:
+ return "kEob2FinaleAnimData14";
+ case kEob2FinaleAnimData15:
+ return "kEob2FinaleAnimData15";
+ case kEob2FinaleAnimData16:
+ return "kEob2FinaleAnimData16";
+ case kEob2FinaleAnimData17:
+ return "kEob2FinaleAnimData17";
+ case kEob2FinaleAnimData18:
+ return "kEob2FinaleAnimData18";
+ case kEob2FinaleAnimData19:
+ return "kEob2FinaleAnimData19";
+ case kEob2FinaleAnimData20:
+ return "kEob2FinaleAnimData20";
case kEoB2FinaleShapes00:
return "kEoB2FinaleShapes00";
case kEoB2FinaleShapes03:
diff --git a/devtools/create_kyradat/create_kyradat.h b/devtools/create_kyradat/create_kyradat.h
index ad54c6c..83ee285 100644
--- a/devtools/create_kyradat/create_kyradat.h
+++ b/devtools/create_kyradat/create_kyradat.h
@@ -446,6 +446,21 @@ enum kExtractID {
kEoB1BeholderSfx,
kEoB1TurnUndeadString,
+ kEoB1CgaMappingDefault,
+ kEoB1CgaMappingAlt,
+ kEoB1CgaMappingInv,
+ kEoB1CgaMappingItemsL,
+ kEoB1CgaMappingItemsS,
+ kEoB1CgaMappingThrown,
+ kEoB1CgaMappingIcons,
+ kEoB1CgaMappingDeco,
+ kEoB1CgaLevelMappingIndex,
+ kEoB1CgaMappingLevel0,
+ kEoB1CgaMappingLevel1,
+ kEoB1CgaMappingLevel2,
+ kEoB1CgaMappingLevel3,
+ kEoB1CgaMappingLevel4,
+
kEoB1NpcShpData,
kEoB1NpcSubShpIndex1,
kEoB1NpcSubShpIndex2,
@@ -474,50 +489,50 @@ enum kExtractID {
kEoB2IntroStrings,
kEoB2IntroCPSFiles,
- kEoB2IntroSeqData00,
- kEoB2IntroSeqData01,
- kEoB2IntroSeqData02,
- kEoB2IntroSeqData03,
- kEoB2IntroSeqData04,
- kEoB2IntroSeqData05,
- kEoB2IntroSeqData06,
- kEoB2IntroSeqData07,
- kEoB2IntroSeqData08,
- kEoB2IntroSeqData09,
- kEoB2IntroSeqData10,
- kEoB2IntroSeqData11,
- kEoB2IntroSeqData12,
- kEoB2IntroSeqData13,
- kEoB2IntroSeqData14,
- kEoB2IntroSeqData15,
- kEoB2IntroSeqData16,
- kEoB2IntroSeqData17,
- kEoB2IntroSeqData18,
- kEoB2IntroSeqData19,
- kEoB2IntroSeqData20,
- kEoB2IntroSeqData21,
- kEoB2IntroSeqData22,
- kEoB2IntroSeqData23,
- kEoB2IntroSeqData24,
- kEoB2IntroSeqData25,
- kEoB2IntroSeqData26,
- kEoB2IntroSeqData27,
- kEoB2IntroSeqData28,
- kEoB2IntroSeqData29,
- kEoB2IntroSeqData30,
- kEoB2IntroSeqData31,
- kEoB2IntroSeqData32,
- kEoB2IntroSeqData33,
- kEoB2IntroSeqData34,
- kEoB2IntroSeqData35,
- kEoB2IntroSeqData36,
- kEoB2IntroSeqData37,
- kEoB2IntroSeqData38,
- kEoB2IntroSeqData39,
- kEoB2IntroSeqData40,
- kEoB2IntroSeqData41,
- kEoB2IntroSeqData42,
- kEoB2IntroSeqData43,
+ kEob2IntroAnimData00,
+ kEob2IntroAnimData01,
+ kEob2IntroAnimData02,
+ kEob2IntroAnimData03,
+ kEob2IntroAnimData04,
+ kEob2IntroAnimData05,
+ kEob2IntroAnimData06,
+ kEob2IntroAnimData07,
+ kEob2IntroAnimData08,
+ kEob2IntroAnimData09,
+ kEob2IntroAnimData10,
+ kEob2IntroAnimData11,
+ kEob2IntroAnimData12,
+ kEob2IntroAnimData13,
+ kEob2IntroAnimData14,
+ kEob2IntroAnimData15,
+ kEob2IntroAnimData16,
+ kEob2IntroAnimData17,
+ kEob2IntroAnimData18,
+ kEob2IntroAnimData19,
+ kEob2IntroAnimData20,
+ kEob2IntroAnimData21,
+ kEob2IntroAnimData22,
+ kEob2IntroAnimData23,
+ kEob2IntroAnimData24,
+ kEob2IntroAnimData25,
+ kEob2IntroAnimData26,
+ kEob2IntroAnimData27,
+ kEob2IntroAnimData28,
+ kEob2IntroAnimData29,
+ kEob2IntroAnimData30,
+ kEob2IntroAnimData31,
+ kEob2IntroAnimData32,
+ kEob2IntroAnimData33,
+ kEob2IntroAnimData34,
+ kEob2IntroAnimData35,
+ kEob2IntroAnimData36,
+ kEob2IntroAnimData37,
+ kEob2IntroAnimData38,
+ kEob2IntroAnimData39,
+ kEob2IntroAnimData40,
+ kEob2IntroAnimData41,
+ kEob2IntroAnimData42,
+ kEob2IntroAnimData43,
kEoB2IntroShapes00,
kEoB2IntroShapes01,
kEoB2IntroShapes04,
@@ -526,27 +541,27 @@ enum kExtractID {
kEoB2FinaleStrings,
kEoB2CreditsData,
kEoB2FinaleCPSFiles,
- kEoB2FinaleSeqData00,
- kEoB2FinaleSeqData01,
- kEoB2FinaleSeqData02,
- kEoB2FinaleSeqData03,
- kEoB2FinaleSeqData04,
- kEoB2FinaleSeqData05,
- kEoB2FinaleSeqData06,
- kEoB2FinaleSeqData07,
- kEoB2FinaleSeqData08,
- kEoB2FinaleSeqData09,
- kEoB2FinaleSeqData10,
- kEoB2FinaleSeqData11,
- kEoB2FinaleSeqData12,
- kEoB2FinaleSeqData13,
- kEoB2FinaleSeqData14,
- kEoB2FinaleSeqData15,
- kEoB2FinaleSeqData16,
- kEoB2FinaleSeqData17,
- kEoB2FinaleSeqData18,
- kEoB2FinaleSeqData19,
- kEoB2FinaleSeqData20,
+ kEob2FinaleAnimData00,
+ kEob2FinaleAnimData01,
+ kEob2FinaleAnimData02,
+ kEob2FinaleAnimData03,
+ kEob2FinaleAnimData04,
+ kEob2FinaleAnimData05,
+ kEob2FinaleAnimData06,
+ kEob2FinaleAnimData07,
+ kEob2FinaleAnimData08,
+ kEob2FinaleAnimData09,
+ kEob2FinaleAnimData10,
+ kEob2FinaleAnimData11,
+ kEob2FinaleAnimData12,
+ kEob2FinaleAnimData13,
+ kEob2FinaleAnimData14,
+ kEob2FinaleAnimData15,
+ kEob2FinaleAnimData16,
+ kEob2FinaleAnimData17,
+ kEob2FinaleAnimData18,
+ kEob2FinaleAnimData19,
+ kEob2FinaleAnimData20,
kEoB2FinaleShapes00,
kEoB2FinaleShapes03,
kEoB2FinaleShapes07,
diff --git a/devtools/create_kyradat/games.cpp b/devtools/create_kyradat/games.cpp
index e0e6f01..a45cb80 100644
--- a/devtools/create_kyradat/games.cpp
+++ b/devtools/create_kyradat/games.cpp
@@ -1089,6 +1089,21 @@ const int eob1FloppyNeed[] = {
kEoB1BeholderSfx,
kEoB1TurnUndeadString,
+ kEoB1CgaMappingDefault,
+ kEoB1CgaMappingAlt,
+ kEoB1CgaMappingInv,
+ kEoB1CgaMappingItemsL,
+ kEoB1CgaMappingItemsS,
+ kEoB1CgaMappingThrown,
+ kEoB1CgaMappingIcons,
+ kEoB1CgaMappingDeco,
+ kEoB1CgaLevelMappingIndex,
+ kEoB1CgaMappingLevel0,
+ kEoB1CgaMappingLevel1,
+ kEoB1CgaMappingLevel2,
+ kEoB1CgaMappingLevel3,
+ kEoB1CgaMappingLevel4,
+
kEoB1NpcShpData,
kEoB1NpcSubShpIndex1,
kEoB1NpcSubShpIndex2,
@@ -1497,50 +1512,50 @@ const int eob2FloppyNeed[] = {
kEoB2IntroStrings,
kEoB2IntroCPSFiles,
- kEoB2IntroSeqData00,
- kEoB2IntroSeqData01,
- kEoB2IntroSeqData02,
- kEoB2IntroSeqData03,
- kEoB2IntroSeqData04,
- kEoB2IntroSeqData05,
- kEoB2IntroSeqData06,
- kEoB2IntroSeqData07,
- kEoB2IntroSeqData08,
- kEoB2IntroSeqData09,
- kEoB2IntroSeqData10,
- kEoB2IntroSeqData11,
- kEoB2IntroSeqData12,
- kEoB2IntroSeqData13,
- kEoB2IntroSeqData14,
- kEoB2IntroSeqData15,
- kEoB2IntroSeqData16,
- kEoB2IntroSeqData17,
- kEoB2IntroSeqData18,
- kEoB2IntroSeqData19,
- kEoB2IntroSeqData20,
- kEoB2IntroSeqData21,
- kEoB2IntroSeqData22,
- kEoB2IntroSeqData23,
- kEoB2IntroSeqData24,
- kEoB2IntroSeqData25,
- kEoB2IntroSeqData26,
- kEoB2IntroSeqData27,
- kEoB2IntroSeqData28,
- kEoB2IntroSeqData29,
- kEoB2IntroSeqData30,
- kEoB2IntroSeqData31,
- kEoB2IntroSeqData32,
- kEoB2IntroSeqData33,
- kEoB2IntroSeqData34,
- kEoB2IntroSeqData35,
- kEoB2IntroSeqData36,
- kEoB2IntroSeqData37,
- kEoB2IntroSeqData38,
- kEoB2IntroSeqData39,
- kEoB2IntroSeqData40,
- kEoB2IntroSeqData41,
- kEoB2IntroSeqData42,
- kEoB2IntroSeqData43,
+ kEob2IntroAnimData00,
+ kEob2IntroAnimData01,
+ kEob2IntroAnimData02,
+ kEob2IntroAnimData03,
+ kEob2IntroAnimData04,
+ kEob2IntroAnimData05,
+ kEob2IntroAnimData06,
+ kEob2IntroAnimData07,
+ kEob2IntroAnimData08,
+ kEob2IntroAnimData09,
+ kEob2IntroAnimData10,
+ kEob2IntroAnimData11,
+ kEob2IntroAnimData12,
+ kEob2IntroAnimData13,
+ kEob2IntroAnimData14,
+ kEob2IntroAnimData15,
+ kEob2IntroAnimData16,
+ kEob2IntroAnimData17,
+ kEob2IntroAnimData18,
+ kEob2IntroAnimData19,
+ kEob2IntroAnimData20,
+ kEob2IntroAnimData21,
+ kEob2IntroAnimData22,
+ kEob2IntroAnimData23,
+ kEob2IntroAnimData24,
+ kEob2IntroAnimData25,
+ kEob2IntroAnimData26,
+ kEob2IntroAnimData27,
+ kEob2IntroAnimData28,
+ kEob2IntroAnimData29,
+ kEob2IntroAnimData30,
+ kEob2IntroAnimData31,
+ kEob2IntroAnimData32,
+ kEob2IntroAnimData33,
+ kEob2IntroAnimData34,
+ kEob2IntroAnimData35,
+ kEob2IntroAnimData36,
+ kEob2IntroAnimData37,
+ kEob2IntroAnimData38,
+ kEob2IntroAnimData39,
+ kEob2IntroAnimData40,
+ kEob2IntroAnimData41,
+ kEob2IntroAnimData42,
+ kEob2IntroAnimData43,
kEoB2IntroShapes00,
kEoB2IntroShapes01,
@@ -1550,27 +1565,27 @@ const int eob2FloppyNeed[] = {
kEoB2FinaleStrings,
kEoB2CreditsData,
kEoB2FinaleCPSFiles,
- kEoB2FinaleSeqData00,
- kEoB2FinaleSeqData01,
- kEoB2FinaleSeqData02,
- kEoB2FinaleSeqData03,
- kEoB2FinaleSeqData04,
- kEoB2FinaleSeqData05,
- kEoB2FinaleSeqData06,
- kEoB2FinaleSeqData07,
- kEoB2FinaleSeqData08,
- kEoB2FinaleSeqData09,
- kEoB2FinaleSeqData10,
- kEoB2FinaleSeqData11,
- kEoB2FinaleSeqData12,
- kEoB2FinaleSeqData13,
- kEoB2FinaleSeqData14,
- kEoB2FinaleSeqData15,
- kEoB2FinaleSeqData16,
- kEoB2FinaleSeqData17,
- kEoB2FinaleSeqData18,
- kEoB2FinaleSeqData19,
- kEoB2FinaleSeqData20,
+ kEob2FinaleAnimData00,
+ kEob2FinaleAnimData01,
+ kEob2FinaleAnimData02,
+ kEob2FinaleAnimData03,
+ kEob2FinaleAnimData04,
+ kEob2FinaleAnimData05,
+ kEob2FinaleAnimData06,
+ kEob2FinaleAnimData07,
+ kEob2FinaleAnimData08,
+ kEob2FinaleAnimData09,
+ kEob2FinaleAnimData10,
+ kEob2FinaleAnimData11,
+ kEob2FinaleAnimData12,
+ kEob2FinaleAnimData13,
+ kEob2FinaleAnimData14,
+ kEob2FinaleAnimData15,
+ kEob2FinaleAnimData16,
+ kEob2FinaleAnimData17,
+ kEob2FinaleAnimData18,
+ kEob2FinaleAnimData19,
+ kEob2FinaleAnimData20,
kEoB2FinaleShapes00,
kEoB2FinaleShapes03,
kEoB2FinaleShapes07,
diff --git a/devtools/create_kyradat/tables.cpp b/devtools/create_kyradat/tables.cpp
index e3f658a..b1b542d 100644
--- a/devtools/create_kyradat/tables.cpp
+++ b/devtools/create_kyradat/tables.cpp
@@ -2548,6 +2548,76 @@ const ExtractEntrySearchData kEoB1TurnUndeadStringProvider[] = {
EXTRACT_END_ENTRY
};
+const ExtractEntrySearchData kEoB1CgaMappingDefaultProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x0000002C, { { 0x7E, 0x1C, 0x75, 0xC3, 0x8E, 0xF7, 0x56, 0x62, 0x9B, 0xB6, 0xF4, 0x3A, 0x21, 0x03, 0xFA, 0xF5 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingAltProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000030, { { 0x2A, 0x8C, 0xF6, 0xD7, 0x87, 0xFA, 0x7B, 0x22, 0x28, 0x2A, 0x50, 0xE2, 0x26, 0x7B, 0xC7, 0x44 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingInvProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x0000002E, { { 0x3A, 0x06, 0xBF, 0x0C, 0xD4, 0xD0, 0x15, 0x1F, 0xB5, 0xC5, 0x49, 0xFD, 0x21, 0xE1, 0xE1, 0x66 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingItemsLProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x0000002A, { { 0xE0, 0x85, 0xA1, 0x3A, 0x3D, 0xC9, 0xF8, 0x56, 0x17, 0x0A, 0xD8, 0x44, 0x56, 0xDF, 0x3C, 0x57 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingItemsSProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000036, { { 0x2E, 0x6F, 0xD4, 0x2E, 0xB2, 0x84, 0xB2, 0xC3, 0x36, 0x88, 0x80, 0xC1, 0x67, 0x5A, 0xEB, 0x60 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingThrownProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000030, { { 0x0C, 0x3D, 0x1E, 0xAB, 0x0B, 0x25, 0x9F, 0x78, 0xE6, 0xB1, 0x52, 0x79, 0x0F, 0x96, 0x33, 0x97 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingIconsProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000039, { { 0x99, 0x50, 0x1A, 0xE1, 0xF3, 0x52, 0xC3, 0x5A, 0x4E, 0xBD, 0x03, 0x74, 0x2C, 0x39, 0xCA, 0x71 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingDecoProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000035, { { 0xA5, 0x17, 0xED, 0xEE, 0x02, 0x87, 0x8C, 0x9D, 0xAC, 0x96, 0xC6, 0x07, 0xB0, 0x8E, 0x5D, 0xE3 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaLevelMappingIndexProvider[] = {
+ { UNK_LANG, kPlatformPC, { 0x0000000C, 0x00000013, { { 0x48, 0x5D, 0xDF, 0x8F, 0xFD, 0x5D, 0xA0, 0xB0, 0x00, 0xD8, 0xB3, 0x09, 0x90, 0x5D, 0x13, 0x3F } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingLevel0Provider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000035, { { 0xC2, 0x4D, 0x2F, 0x0A, 0xB0, 0x3E, 0x46, 0x80, 0xD1, 0xEE, 0x32, 0x5F, 0xBA, 0x5C, 0xCC, 0x7A } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingLevel1Provider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000030, { { 0x94, 0x8E, 0xAE, 0x12, 0xB5, 0x68, 0xCD, 0x43, 0x95, 0xD2, 0x01, 0x21, 0x0C, 0xA1, 0x34, 0xF5 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingLevel2Provider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000030, { { 0x20, 0x6F, 0x9F, 0x57, 0x0C, 0xFD, 0xDA, 0x5C, 0xA0, 0x1D, 0x28, 0xB4, 0x88, 0x24, 0x68, 0x68 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingLevel3Provider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000030, { { 0x44, 0x95, 0x9A, 0x69, 0x70, 0xB2, 0x63, 0xB6, 0xFB, 0xD0, 0xFF, 0xD9, 0xF0, 0xCD, 0xD4, 0x75 } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kEoB1CgaMappingLevel4Provider[] = {
+ { UNK_LANG, kPlatformPC, { 0x00000020, 0x00000031, { { 0xEA, 0xC4, 0x01, 0xC0, 0x21, 0xFE, 0x66, 0xDD, 0xD4, 0x83, 0xC1, 0x2C, 0x09, 0xD3, 0xD0, 0x97 } } } },
+ EXTRACT_END_ENTRY
+};
+
const ExtractEntrySearchData kEoB1NpcShpDataProvider[] = {
{ UNK_LANG, kPlatformPC, { 0x0000004C, 0x00000A42, { { 0x70, 0x21, 0x85, 0x8C, 0xD4, 0x04, 0xAA, 0x20, 0x1D, 0x0E, 0x9D, 0xB7, 0x74, 0x58, 0xCC, 0x0C } } } },
EXTRACT_END_ENTRY
@@ -2701,222 +2771,222 @@ const ExtractEntrySearchData kEoB2IntroCPSFilesProvider[] = {
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData00Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData00Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000037, 0x000003E1, { { 0x38, 0xC2, 0x0F, 0xE1, 0x43, 0x6A, 0xE8, 0x7C, 0x82, 0x65, 0x9B, 0x4A, 0x9F, 0x83, 0xCD, 0xC8 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData01Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData01Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000037, 0x000003A3, { { 0x84, 0x44, 0xF4, 0x46, 0x4E, 0x2B, 0xD7, 0xC6, 0xAD, 0x14, 0xF1, 0x9E, 0x8A, 0xBE, 0x7B, 0x42 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData02Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData02Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000037, 0x00000446, { { 0x0C, 0xCA, 0x41, 0x0C, 0x89, 0x59, 0xD5, 0x28, 0x9A, 0xDC, 0x51, 0x1C, 0x0B, 0x8C, 0xD2, 0xDB } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData03Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData03Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000002C, 0x0000010E, { { 0xAB, 0x48, 0x64, 0x02, 0xB3, 0xF3, 0x6C, 0x82, 0x9D, 0x37, 0x5F, 0x52, 0x0F, 0x5B, 0xDF, 0x96 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData04Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData04Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000021, 0x00000149, { { 0x3B, 0xAC, 0x14, 0x51, 0xDF, 0x5D, 0x22, 0x15, 0x46, 0x4E, 0xCD, 0xF3, 0xD4, 0x61, 0x29, 0x4A } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData05Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData05Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000002C, 0x0000010E, { { 0x28, 0x29, 0x5F, 0x31, 0x23, 0x53, 0xBA, 0xD7, 0x24, 0xB9, 0x21, 0x70, 0x84, 0x8A, 0x1C, 0x2E } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData06Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData06Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x000000B0, 0x00001365, { { 0x91, 0x28, 0x2F, 0x10, 0x45, 0x4D, 0xCF, 0x3E, 0x70, 0x1E, 0xD4, 0xBA, 0x0E, 0x70, 0xDE, 0xD0 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData07Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData07Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000037, 0x000003C4, { { 0x8C, 0x72, 0xDE, 0x4F, 0x92, 0x52, 0x0A, 0xED, 0xF4, 0x79, 0xD6, 0x3D, 0x8F, 0x59, 0x9D, 0x69 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData08Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData08Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000042, 0x00000442, { { 0xD2, 0x91, 0x51, 0xEB, 0x91, 0x13, 0x43, 0xCE, 0x7E, 0x60, 0xB8, 0xFF, 0xA7, 0xE2, 0x4C, 0x11 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData09Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData09Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000002C, 0x000004BC, { { 0xD6, 0xC7, 0x44, 0x2E, 0xE7, 0x2A, 0x44, 0x09, 0x39, 0xC3, 0xD3, 0xA8, 0x02, 0xC8, 0xA0, 0x19 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData10Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData10Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000006E, 0x00000C12, { { 0x91, 0xDB, 0x41, 0x7A, 0x4F, 0x7C, 0x7B, 0x83, 0x32, 0x13, 0x68, 0xF6, 0x58, 0x79, 0xDA, 0x99 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData11Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData11Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x000000B0, 0x0000073C, { { 0x17, 0x1F, 0x4D, 0x05, 0x3F, 0x14, 0x2E, 0x77, 0xD3, 0xDB, 0x78, 0x67, 0xBB, 0x18, 0xDC, 0x85 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData12Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData12Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000021, 0x00000228, { { 0xC9, 0x50, 0x68, 0x51, 0xD0, 0xC1, 0x5D, 0xD4, 0xFF, 0x08, 0x28, 0xDE, 0xC4, 0x41, 0x8C, 0xDB } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData13Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData13Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000002C, 0x00000340, { { 0x03, 0xCA, 0x5D, 0xD1, 0x15, 0xFA, 0x60, 0xD7, 0x70, 0x64, 0x3D, 0x44, 0x08, 0xB8, 0xDB, 0xAD } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData14Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData14Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000042, 0x000007C0, { { 0x82, 0xA9, 0x0B, 0x90, 0x9D, 0x65, 0x1E, 0xC7, 0x03, 0x5E, 0xB7, 0xDF, 0x6E, 0x1F, 0xED, 0xD6 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData15Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData15Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000002C, 0x00000504, { { 0xA7, 0x91, 0x4F, 0xAD, 0xB1, 0x77, 0x80, 0x3A, 0xC7, 0xDE, 0x35, 0x7A, 0x96, 0x16, 0xD2, 0x13 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData16Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData16Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000079, 0x00000B3D, { { 0xCC, 0x63, 0x5A, 0x11, 0xEE, 0x8A, 0xAE, 0x3A, 0x14, 0xC3, 0xBC, 0xDA, 0xAF, 0x1D, 0xD4, 0x2C } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData17Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData17Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000084, 0x00000911, { { 0x09, 0x1C, 0x4B, 0xD9, 0x0B, 0x2A, 0xD6, 0xC1, 0xE3, 0x8D, 0xFE, 0x43, 0x8F, 0x2E, 0x21, 0x51 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData18Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData18Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000058, 0x000008FA, { { 0xFE, 0x58, 0xD9, 0x67, 0x78, 0x97, 0xE2, 0xCD, 0x82, 0xB8, 0xC9, 0xC0, 0x1F, 0xCA, 0x7C, 0xF5 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData19Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData19Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000009A, 0x00000D6B, { { 0xA1, 0xDD, 0x7B, 0x8B, 0x25, 0xA5, 0x96, 0x5A, 0x33, 0x5E, 0x80, 0x5F, 0xA5, 0xBB, 0xAC, 0x11 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData20Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData20Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000009A, 0x00000D6C, { { 0x19, 0xF9, 0x93, 0x1D, 0x01, 0xEE, 0x7C, 0x8B, 0x6C, 0x3E, 0x35, 0x2C, 0x5C, 0x88, 0xCD, 0xB6 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData21Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData21Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000009A, 0x00000D83, { { 0xCB, 0x4F, 0x21, 0x29, 0x63, 0x5B, 0x8C, 0xF2, 0xBA, 0x03, 0x49, 0xD1, 0xAF, 0x22, 0xB0, 0xD5 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData22Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData22Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x00000200, { { 0x66, 0xEE, 0x45, 0xB1, 0x87, 0x66, 0xC4, 0x55, 0xCE, 0x60, 0x0C, 0x5B, 0xBB, 0x3C, 0x7D, 0x33 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData23Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData23Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x0000020D, { { 0xC4, 0x49, 0xE2, 0x5B, 0x2E, 0x17, 0x68, 0xC4, 0xBA, 0x20, 0xEC, 0xB1, 0xEB, 0x1A, 0xFB, 0xE0 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData24Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData24Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x00000214, { { 0xF1, 0x46, 0x82, 0xEF, 0x6D, 0xCA, 0x68, 0xA2, 0xF3, 0x55, 0x63, 0xD2, 0x13, 0x25, 0x19, 0xF7 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData25Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData25Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x00000256, { { 0x8F, 0xB9, 0xCD, 0xB8, 0x58, 0xCB, 0x90, 0x03, 0xFC, 0xB6, 0x95, 0x6F, 0x52, 0xF8, 0x7D, 0x19 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData26Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData26Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x00000263, { { 0x7A, 0x37, 0x07, 0xC4, 0x67, 0x72, 0x1F, 0xCB, 0xAC, 0x98, 0x46, 0x9A, 0xF3, 0x5F, 0xBA, 0x78 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData27Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData27Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x0000026A, { { 0x80, 0x11, 0xEE, 0x44, 0xDA, 0xE1, 0x26, 0x1F, 0x14, 0x7E, 0x93, 0x99, 0x44, 0x44, 0x9F, 0x85 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData28Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData28Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x000001F6, { { 0x45, 0xA1, 0xA5, 0xEC, 0x85, 0x06, 0xE2, 0x91, 0x28, 0xE0, 0xBB, 0x53, 0x74, 0x44, 0xD9, 0xA6 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData29Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData29Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x000001F9, { { 0x3F, 0x03, 0x2F, 0x8B, 0xFB, 0x6A, 0x97, 0x05, 0xED, 0xBB, 0xD6, 0xA0, 0xF5, 0x7A, 0x6D, 0x08 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData30Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData30Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x00000204, { { 0xA1, 0x37, 0x57, 0xC3, 0x72, 0x08, 0x98, 0xA6, 0xF4, 0x5E, 0x58, 0x9E, 0xF3, 0x11, 0x88, 0x1E } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData31Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData31Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x00000212, { { 0x19, 0xCC, 0x6F, 0xA8, 0x29, 0xB5, 0x3B, 0x15, 0x2F, 0x2C, 0x43, 0xED, 0x7A, 0xF5, 0xC5, 0x69 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData32Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData32Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000037, 0x000006C9, { { 0xBF, 0x65, 0xBA, 0x3F, 0x44, 0xEE, 0xB0, 0x5C, 0x8B, 0xBD, 0x15, 0xAB, 0x03, 0xD1, 0x55, 0x21 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData33Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData33Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000009A, 0x00001585, { { 0xB5, 0x44, 0x06, 0xC9, 0xE8, 0x27, 0x75, 0x6E, 0x63, 0x77, 0xE9, 0xA9, 0x68, 0x73, 0xF5, 0x78 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData34Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData34Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000058, 0x00000B43, { { 0x52, 0xB4, 0x1E, 0x14, 0x88, 0xBD, 0x8A, 0xD7, 0x38, 0xDF, 0x25, 0xB0, 0xAF, 0xAE, 0x76, 0xE1 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData35Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData35Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000037, 0x000005A4, { { 0xFB, 0x82, 0xE7, 0xB2, 0x54, 0xDB, 0xB5, 0xE1, 0xCE, 0xFB, 0xD1, 0x23, 0x39, 0x8F, 0xA1, 0x0D } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData36Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData36Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000042, 0x00000572, { { 0x2C, 0x16, 0xD9, 0xBE, 0xDB, 0xBA, 0x04, 0xCA, 0x97, 0xB5, 0x88, 0x43, 0xA8, 0x62, 0xE2, 0x04 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData37Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData37Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x0000024E, { { 0xFF, 0x28, 0xD8, 0x62, 0xC6, 0xAD, 0x48, 0xC7, 0x31, 0x84, 0x6C, 0xBA, 0x9F, 0x4D, 0x15, 0xDA } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData38Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData38Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x000001D9, 0x00001FB1, { { 0x16, 0xB0, 0xDF, 0x86, 0x8C, 0xB3, 0x52, 0xEF, 0x21, 0x04, 0x22, 0x6D, 0xC0, 0x03, 0xB8, 0xC6 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData39Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData39Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000004D, 0x00000582, { { 0x11, 0x6C, 0xBB, 0xF6, 0x1B, 0x3C, 0xAE, 0xAA, 0x40, 0x27, 0x3F, 0x86, 0x33, 0x92, 0xCB, 0xA9 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData40Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData40Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000160, 0x000010A2, { { 0xD9, 0x9D, 0xF1, 0x7D, 0xE1, 0x7C, 0x61, 0xC0, 0xD4, 0xD3, 0x05, 0x0C, 0x79, 0xDD, 0xDB, 0xD1 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData41Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData41Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000037, 0x00000355, { { 0x92, 0x85, 0xBE, 0x5A, 0x38, 0x08, 0xF3, 0xDF, 0xC6, 0x56, 0x74, 0xC3, 0x0B, 0x3F, 0x72, 0x4D } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData42Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData42Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000021, 0x0000010B, { { 0x68, 0xF8, 0x1D, 0x74, 0x6D, 0x32, 0x1E, 0x3A, 0x1C, 0xD1, 0x1D, 0x4B, 0x89, 0x3D, 0x5F, 0x2B } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2IntroSeqData43Provider[] = {
+const ExtractEntrySearchData kEob2IntroAnimData43Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000037, 0x00000116, { { 0xD5, 0x46, 0xCB, 0x3F, 0x27, 0xBD, 0x2B, 0xD6, 0x35, 0x69, 0x9E, 0x0A, 0x28, 0xDA, 0xC9, 0x84 } } } },
EXTRACT_END_ENTRY
};
@@ -2959,107 +3029,107 @@ const ExtractEntrySearchData kEoB2FinaleCPSFilesProvider[] = {
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData00Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData00Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000079, 0x00000B66, { { 0x9B, 0x8C, 0x17, 0xFA, 0xD2, 0x4F, 0x4B, 0x0E, 0x3A, 0x43, 0xB1, 0x86, 0x0C, 0xDC, 0x73, 0xAB } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData01Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData01Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000063, 0x00000A03, { { 0xBB, 0x31, 0xEA, 0x35, 0xFB, 0x99, 0x4C, 0x3E, 0x72, 0xBD, 0x36, 0x6B, 0x5C, 0x03, 0x19, 0x7F } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData02Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData02Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000002C, 0x000007C2, { { 0xF6, 0x83, 0x37, 0x58, 0x3C, 0x59, 0x84, 0x8F, 0x97, 0x80, 0xE2, 0xD8, 0xFD, 0x77, 0xA9, 0x54 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData03Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData03Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000042, 0x0000092B, { { 0x47, 0xE4, 0x34, 0xE8, 0x72, 0xCC, 0xA4, 0x4A, 0xA4, 0x8F, 0xBA, 0xBC, 0x0C, 0x04, 0x18, 0xAF } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData04Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData04Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000058, 0x0000080B, { { 0x16, 0xDB, 0x77, 0x4C, 0x8E, 0xFD, 0x44, 0xF6, 0x5E, 0x28, 0x0B, 0x74, 0x93, 0x45, 0x8F, 0xD9 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData05Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData05Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000004D, 0x00000C72, { { 0x6C, 0x57, 0x56, 0x7E, 0x87, 0x10, 0x9C, 0xE7, 0x69, 0xAC, 0x3B, 0x3F, 0xF6, 0x43, 0x5C, 0xD4 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData06Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData06Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000016, 0x00000264, { { 0x48, 0x49, 0x5D, 0x78, 0xE2, 0xF1, 0x0D, 0x87, 0xEE, 0xEE, 0xD1, 0xA1, 0xC6, 0x64, 0xCA, 0x13 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData07Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData07Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000042, 0x00000ABE, { { 0xFE, 0xA9, 0x5D, 0x87, 0xAF, 0x55, 0x04, 0x92, 0x41, 0xD3, 0xAD, 0x1D, 0xFF, 0x03, 0x81, 0x3C } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData08Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData08Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000021, 0x000004D8, { { 0x4E, 0xA7, 0xCC, 0x0B, 0x1B, 0x48, 0x22, 0x09, 0x33, 0xF7, 0x23, 0xF1, 0xF5, 0x9F, 0xA5, 0x7B } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData09Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData09Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000058, 0x000004BE, { { 0xF6, 0xEA, 0xA0, 0x7F, 0x54, 0x61, 0x79, 0x4C, 0x71, 0xD7, 0x9B, 0xA6, 0xC3, 0x45, 0xEE, 0x3E } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData10Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData10Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000009A, 0x00000FC4, { { 0xA9, 0xFB, 0x31, 0x55, 0xB8, 0x28, 0x63, 0xC3, 0x4B, 0x9E, 0x7D, 0x41, 0xC7, 0x1F, 0x2F, 0xBD } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData11Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData11Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x000000C6, 0x0000166B, { { 0xCC, 0x16, 0x50, 0xFF, 0xFF, 0xD5, 0xAE, 0x03, 0x40, 0xA3, 0x9A, 0x1F, 0xF8, 0x8E, 0x23, 0x7A } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData12Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData12Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x000000FD, 0x00001A69, { { 0x6A, 0x80, 0x89, 0x7E, 0xFC, 0xE4, 0x01, 0xF5, 0xA2, 0x11, 0xE7, 0x26, 0x20, 0x96, 0x62, 0x7B } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData13Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData13Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x000000FD, 0x00001886, { { 0xF9, 0x5B, 0x62, 0xDD, 0xAB, 0x14, 0x35, 0x77, 0x53, 0x05, 0xDB, 0xC5, 0xFD, 0x4D, 0x4F, 0x12 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData14Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData14Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000108, 0x00001895, { { 0x22, 0xA1, 0x88, 0x69, 0xF9, 0x1C, 0xA2, 0x64, 0x44, 0xCD, 0x00, 0xFA, 0xB1, 0x94, 0xEB, 0x3A } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData15Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData15Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x000000D1, 0x000016E5, { { 0xD8, 0xE9, 0xA5, 0xEE, 0x54, 0x1B, 0x3E, 0x32, 0xDA, 0x78, 0x90, 0xC2, 0x54, 0xFC, 0xD5, 0x39 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData16Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData16Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000008F, 0x00000C69, { { 0xBC, 0x41, 0xE5, 0xAF, 0x89, 0xE2, 0x54, 0x12, 0x9E, 0xB0, 0x5F, 0x28, 0xFF, 0x92, 0x9D, 0x89 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData17Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData17Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x000000DC, 0x0000170D, { { 0x7A, 0x7B, 0x74, 0xCB, 0x68, 0xC2, 0xFF, 0xC7, 0xBE, 0x47, 0xE9, 0x43, 0xF7, 0x15, 0x8D, 0x59 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData18Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData18Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000134, 0x00002651, { { 0x71, 0x26, 0x47, 0x0D, 0x7C, 0x96, 0x45, 0x0B, 0x82, 0xD0, 0x37, 0xB9, 0xD4, 0xD0, 0x84, 0xFC } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData19Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData19Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000004D, 0x000009C3, { { 0xDA, 0x96, 0xDF, 0x16, 0xEB, 0x5D, 0x49, 0xA4, 0x3F, 0xD3, 0x31, 0xBE, 0x49, 0x72, 0xF2, 0x71 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEoB2FinaleSeqData20Provider[] = {
+const ExtractEntrySearchData kEob2FinaleAnimData20Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000021, 0x000003D8, { { 0xD9, 0xC8, 0x58, 0x4B, 0x7D, 0x79, 0x86, 0xCB, 0xEB, 0x77, 0xC2, 0xD4, 0xB7, 0xB4, 0xE9, 0x6A } } } },
EXTRACT_END_ENTRY
};
@@ -4106,6 +4176,21 @@ const ExtractEntry extractProviders[] = {
{ kEoB1BeholderSfx, kEoB1BeholderSfxProvider },
{ kEoB1TurnUndeadString, kEoB1TurnUndeadStringProvider },
+ { kEoB1CgaMappingDefault, kEoB1CgaMappingDefaultProvider },
+ { kEoB1CgaMappingAlt, kEoB1CgaMappingAltProvider },
+ { kEoB1CgaMappingInv, kEoB1CgaMappingInvProvider },
+ { kEoB1CgaMappingItemsL, kEoB1CgaMappingItemsLProvider },
+ { kEoB1CgaMappingItemsS, kEoB1CgaMappingItemsSProvider },
+ { kEoB1CgaMappingThrown, kEoB1CgaMappingThrownProvider },
+ { kEoB1CgaMappingIcons, kEoB1CgaMappingIconsProvider },
+ { kEoB1CgaMappingDeco, kEoB1CgaMappingDecoProvider },
+ { kEoB1CgaLevelMappingIndex, kEoB1CgaLevelMappingIndexProvider },
+ { kEoB1CgaMappingLevel0, kEoB1CgaMappingLevel0Provider },
+ { kEoB1CgaMappingLevel1, kEoB1CgaMappingLevel1Provider },
+ { kEoB1CgaMappingLevel2, kEoB1CgaMappingLevel2Provider },
+ { kEoB1CgaMappingLevel3, kEoB1CgaMappingLevel3Provider },
+ { kEoB1CgaMappingLevel4, kEoB1CgaMappingLevel4Provider },
+
{ kEoB1NpcShpData, kEoB1NpcShpDataProvider },
{ kEoB1NpcSubShpIndex1, kEoB1NpcSubShpIndex1Provider },
{ kEoB1NpcSubShpIndex2, kEoB1NpcSubShpIndex2Provider },
@@ -4134,50 +4219,50 @@ const ExtractEntry extractProviders[] = {
{ kEoB2IntroStrings, kEoB2IntroStringsProvider },
{ kEoB2IntroCPSFiles, kEoB2IntroCPSFilesProvider },
- { kEoB2IntroSeqData00, kEoB2IntroSeqData00Provider },
- { kEoB2IntroSeqData01, kEoB2IntroSeqData01Provider },
- { kEoB2IntroSeqData02, kEoB2IntroSeqData02Provider },
- { kEoB2IntroSeqData03, kEoB2IntroSeqData03Provider },
- { kEoB2IntroSeqData04, kEoB2IntroSeqData04Provider },
- { kEoB2IntroSeqData05, kEoB2IntroSeqData05Provider },
- { kEoB2IntroSeqData06, kEoB2IntroSeqData06Provider },
- { kEoB2IntroSeqData07, kEoB2IntroSeqData07Provider },
- { kEoB2IntroSeqData08, kEoB2IntroSeqData08Provider },
- { kEoB2IntroSeqData09, kEoB2IntroSeqData09Provider },
- { kEoB2IntroSeqData10, kEoB2IntroSeqData10Provider },
- { kEoB2IntroSeqData11, kEoB2IntroSeqData11Provider },
- { kEoB2IntroSeqData12, kEoB2IntroSeqData12Provider },
- { kEoB2IntroSeqData13, kEoB2IntroSeqData13Provider },
- { kEoB2IntroSeqData14, kEoB2IntroSeqData14Provider },
- { kEoB2IntroSeqData15, kEoB2IntroSeqData15Provider },
- { kEoB2IntroSeqData16, kEoB2IntroSeqData16Provider },
- { kEoB2IntroSeqData17, kEoB2IntroSeqData17Provider },
- { kEoB2IntroSeqData18, kEoB2IntroSeqData18Provider },
- { kEoB2IntroSeqData19, kEoB2IntroSeqData19Provider },
- { kEoB2IntroSeqData20, kEoB2IntroSeqData20Provider },
- { kEoB2IntroSeqData21, kEoB2IntroSeqData21Provider },
- { kEoB2IntroSeqData22, kEoB2IntroSeqData22Provider },
- { kEoB2IntroSeqData23, kEoB2IntroSeqData23Provider },
- { kEoB2IntroSeqData24, kEoB2IntroSeqData24Provider },
- { kEoB2IntroSeqData25, kEoB2IntroSeqData25Provider },
- { kEoB2IntroSeqData26, kEoB2IntroSeqData26Provider },
- { kEoB2IntroSeqData27, kEoB2IntroSeqData27Provider },
- { kEoB2IntroSeqData28, kEoB2IntroSeqData28Provider },
- { kEoB2IntroSeqData29, kEoB2IntroSeqData29Provider },
- { kEoB2IntroSeqData30, kEoB2IntroSeqData30Provider },
- { kEoB2IntroSeqData31, kEoB2IntroSeqData31Provider },
- { kEoB2IntroSeqData32, kEoB2IntroSeqData32Provider },
- { kEoB2IntroSeqData33, kEoB2IntroSeqData33Provider },
- { kEoB2IntroSeqData34, kEoB2IntroSeqData34Provider },
- { kEoB2IntroSeqData35, kEoB2IntroSeqData35Provider },
- { kEoB2IntroSeqData36, kEoB2IntroSeqData36Provider },
- { kEoB2IntroSeqData37, kEoB2IntroSeqData37Provider },
- { kEoB2IntroSeqData38, kEoB2IntroSeqData38Provider },
- { kEoB2IntroSeqData39, kEoB2IntroSeqData39Provider },
- { kEoB2IntroSeqData40, kEoB2IntroSeqData40Provider },
- { kEoB2IntroSeqData41, kEoB2IntroSeqData41Provider },
- { kEoB2IntroSeqData42, kEoB2IntroSeqData42Provider },
- { kEoB2IntroSeqData43, kEoB2IntroSeqData43Provider },
+ { kEob2IntroAnimData00, kEob2IntroAnimData00Provider },
+ { kEob2IntroAnimData01, kEob2IntroAnimData01Provider },
+ { kEob2IntroAnimData02, kEob2IntroAnimData02Provider },
+ { kEob2IntroAnimData03, kEob2IntroAnimData03Provider },
+ { kEob2IntroAnimData04, kEob2IntroAnimData04Provider },
+ { kEob2IntroAnimData05, kEob2IntroAnimData05Provider },
+ { kEob2IntroAnimData06, kEob2IntroAnimData06Provider },
+ { kEob2IntroAnimData07, kEob2IntroAnimData07Provider },
+ { kEob2IntroAnimData08, kEob2IntroAnimData08Provider },
+ { kEob2IntroAnimData09, kEob2IntroAnimData09Provider },
+ { kEob2IntroAnimData10, kEob2IntroAnimData10Provider },
+ { kEob2IntroAnimData11, kEob2IntroAnimData11Provider },
+ { kEob2IntroAnimData12, kEob2IntroAnimData12Provider },
+ { kEob2IntroAnimData13, kEob2IntroAnimData13Provider },
+ { kEob2IntroAnimData14, kEob2IntroAnimData14Provider },
+ { kEob2IntroAnimData15, kEob2IntroAnimData15Provider },
+ { kEob2IntroAnimData16, kEob2IntroAnimData16Provider },
+ { kEob2IntroAnimData17, kEob2IntroAnimData17Provider },
+ { kEob2IntroAnimData18, kEob2IntroAnimData18Provider },
+ { kEob2IntroAnimData19, kEob2IntroAnimData19Provider },
+ { kEob2IntroAnimData20, kEob2IntroAnimData20Provider },
+ { kEob2IntroAnimData21, kEob2IntroAnimData21Provider },
+ { kEob2IntroAnimData22, kEob2IntroAnimData22Provider },
+ { kEob2IntroAnimData23, kEob2IntroAnimData23Provider },
+ { kEob2IntroAnimData24, kEob2IntroAnimData24Provider },
+ { kEob2IntroAnimData25, kEob2IntroAnimData25Provider },
+ { kEob2IntroAnimData26, kEob2IntroAnimData26Provider },
+ { kEob2IntroAnimData27, kEob2IntroAnimData27Provider },
+ { kEob2IntroAnimData28, kEob2IntroAnimData28Provider },
+ { kEob2IntroAnimData29, kEob2IntroAnimData29Provider },
+ { kEob2IntroAnimData30, kEob2IntroAnimData30Provider },
+ { kEob2IntroAnimData31, kEob2IntroAnimData31Provider },
+ { kEob2IntroAnimData32, kEob2IntroAnimData32Provider },
+ { kEob2IntroAnimData33, kEob2IntroAnimData33Provider },
+ { kEob2IntroAnimData34, kEob2IntroAnimData34Provider },
+ { kEob2IntroAnimData35, kEob2IntroAnimData35Provider },
+ { kEob2IntroAnimData36, kEob2IntroAnimData36Provider },
+ { kEob2IntroAnimData37, kEob2IntroAnimData37Provider },
+ { kEob2IntroAnimData38, kEob2IntroAnimData38Provider },
+ { kEob2IntroAnimData39, kEob2IntroAnimData39Provider },
+ { kEob2IntroAnimData40, kEob2IntroAnimData40Provider },
+ { kEob2IntroAnimData41, kEob2IntroAnimData41Provider },
+ { kEob2IntroAnimData42, kEob2IntroAnimData42Provider },
+ { kEob2IntroAnimData43, kEob2IntroAnimData43Provider },
{ kEoB2IntroShapes00, kEoB2IntroShapes00Provider },
{ kEoB2IntroShapes01, kEoB2IntroShapes01Provider },
{ kEoB2IntroShapes04, kEoB2IntroShapes04Provider },
@@ -4186,27 +4271,27 @@ const ExtractEntry extractProviders[] = {
{ kEoB2FinaleStrings, kEoB2FinaleStringsProvider },
{ kEoB2CreditsData, kEoB2CreditsDataProvider },
{ kEoB2FinaleCPSFiles, kEoB2FinaleCPSFilesProvider },
- { kEoB2FinaleSeqData00, kEoB2FinaleSeqData00Provider },
- { kEoB2FinaleSeqData01, kEoB2FinaleSeqData01Provider },
- { kEoB2FinaleSeqData02, kEoB2FinaleSeqData02Provider },
- { kEoB2FinaleSeqData03, kEoB2FinaleSeqData03Provider },
- { kEoB2FinaleSeqData04, kEoB2FinaleSeqData04Provider },
- { kEoB2FinaleSeqData05, kEoB2FinaleSeqData05Provider },
- { kEoB2FinaleSeqData06, kEoB2FinaleSeqData06Provider },
- { kEoB2FinaleSeqData07, kEoB2FinaleSeqData07Provider },
- { kEoB2FinaleSeqData08, kEoB2FinaleSeqData08Provider },
- { kEoB2FinaleSeqData09, kEoB2FinaleSeqData09Provider },
- { kEoB2FinaleSeqData10, kEoB2FinaleSeqData10Provider },
- { kEoB2FinaleSeqData11, kEoB2FinaleSeqData11Provider },
- { kEoB2FinaleSeqData12, kEoB2FinaleSeqData12Provider },
- { kEoB2FinaleSeqData13, kEoB2FinaleSeqData13Provider },
- { kEoB2FinaleSeqData14, kEoB2FinaleSeqData14Provider },
- { kEoB2FinaleSeqData15, kEoB2FinaleSeqData15Provider },
- { kEoB2FinaleSeqData16, kEoB2FinaleSeqData16Provider },
- { kEoB2FinaleSeqData17, kEoB2FinaleSeqData17Provider },
- { kEoB2FinaleSeqData18, kEoB2FinaleSeqData18Provider },
- { kEoB2FinaleSeqData19, kEoB2FinaleSeqData19Provider },
- { kEoB2FinaleSeqData20, kEoB2FinaleSeqData20Provider },
+ { kEob2FinaleAnimData00, kEob2FinaleAnimData00Provider },
+ { kEob2FinaleAnimData01, kEob2FinaleAnimData01Provider },
+ { kEob2FinaleAnimData02, kEob2FinaleAnimData02Provider },
+ { kEob2FinaleAnimData03, kEob2FinaleAnimData03Provider },
+ { kEob2FinaleAnimData04, kEob2FinaleAnimData04Provider },
+ { kEob2FinaleAnimData05, kEob2FinaleAnimData05Provider },
+ { kEob2FinaleAnimData06, kEob2FinaleAnimData06Provider },
+ { kEob2FinaleAnimData07, kEob2FinaleAnimData07Provider },
+ { kEob2FinaleAnimData08, kEob2FinaleAnimData08Provider },
+ { kEob2FinaleAnimData09, kEob2FinaleAnimData09Provider },
+ { kEob2FinaleAnimData10, kEob2FinaleAnimData10Provider },
+ { kEob2FinaleAnimData11, kEob2FinaleAnimData11Provider },
+ { kEob2FinaleAnimData12, kEob2FinaleAnimData12Provider },
+ { kEob2FinaleAnimData13, kEob2FinaleAnimData13Provider },
+ { kEob2FinaleAnimData14, kEob2FinaleAnimData14Provider },
+ { kEob2FinaleAnimData15, kEob2FinaleAnimData15Provider },
+ { kEob2FinaleAnimData16, kEob2FinaleAnimData16Provider },
+ { kEob2FinaleAnimData17, kEob2FinaleAnimData17Provider },
+ { kEob2FinaleAnimData18, kEob2FinaleAnimData18Provider },
+ { kEob2FinaleAnimData19, kEob2FinaleAnimData19Provider },
+ { kEob2FinaleAnimData20, kEob2FinaleAnimData20Provider },
{ kEoB2FinaleShapes00, kEoB2FinaleShapes00Provider },
{ kEoB2FinaleShapes03, kEoB2FinaleShapes03Provider },
{ kEoB2FinaleShapes07, kEoB2FinaleShapes07Provider },
diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat
index 7fd8be0..2fc6791 100644
Binary files a/dists/engine-data/kyra.dat and b/dists/engine-data/kyra.dat differ
diff --git a/engines/kyra/chargen.cpp b/engines/kyra/chargen.cpp
index ed761e5..2327434 100644
--- a/engines/kyra/chargen.cpp
+++ b/engines/kyra/chargen.cpp
@@ -248,10 +248,10 @@ void CharacterGenerator::init() {
_faceShapes = new uint8*[44];
for (int i = 0; i < 44; i++)
- _faceShapes[i] = _screen->encodeShape((i % 10) << 2, (i / 10) << 5, 4, 32, true);
+ _faceShapes[i] = _screen->encodeShape((i % 10) << 2, (i / 10) << 5, 4, 32, true, _vm->_cgaMappingDefault);
_screen->_curPage = 0;
- _screen->loadEoBBitmap("CHARGEN", 0, 3, 3, 0);
+ _screen->loadEoBBitmap("CHARGEN", _vm->_cgaMappingDefault, 3, 3, 0);
_screen->loadShapeSetBitmap("CHARGENB", 3, 3);
if (_chargenMagicShapes) {
for (int i = 0; i < 10; i++)
@@ -261,14 +261,14 @@ void CharacterGenerator::init() {
_chargenMagicShapes = new uint8*[10];
for (int i = 0; i < 10; i++)
- _chargenMagicShapes[i] = _screen->encodeShape(i << 2, 0, 4, 32, true);
+ _chargenMagicShapes[i] = _screen->encodeShape(i << 2, 0, 4, 32, true, _vm->_cgaMappingDefault);
for (int i = 0; i < 17; i++) {
const CreatePartyModButton *c = &_chargenModButtons[i];
- _chargenButtonLabels[i] = c->labelW ? _screen->encodeShape(c->encodeLabelX, c->encodeLabelY, c->labelW, c->labelH, true) : 0;
+ _chargenButtonLabels[i] = c->labelW ? _screen->encodeShape(c->encodeLabelX, c->encodeLabelY, c->labelW, c->labelH, true, _vm->_cgaMappingDefault) : 0;
}
- _screen->copyPage(3, 2);
+ _screen->convertPage(3, 2, _vm->_cgaMappingDefault);
_screen->_curPage = 0;
_screen->copyRegion(144, 64, 0, 0, 180, 128, 0, 2, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
diff --git a/engines/kyra/darkmoon.cpp b/engines/kyra/darkmoon.cpp
index f63d499..918221e 100644
--- a/engines/kyra/darkmoon.cpp
+++ b/engines/kyra/darkmoon.cpp
@@ -29,22 +29,21 @@
namespace Kyra {
DarkMoonEngine::DarkMoonEngine(OSystem *system, const GameFlags &flags) : EoBCoreEngine(system, flags) {
- _seqIntro = _seqFinale = 0;
+ _animIntro = _animFinale = 0;
_shapesIntro = _shapesFinale = 0;
_dscDoorType5Offs = 0;
_numSpells = 70;
_menuChoiceInit = 4;
_introStrings = _cpsFilesIntro = _cpsFilesFinale = _finaleStrings = _kheldranStrings = _npcStrings[0] = _npcStrings[1] = _hornStrings = 0;
- _seqIntro = _seqFinale = 0;
_shapesIntro = _shapesFinale = 0;
_creditsData = _npcShpData = _dscDoorType5Offs = _hornSounds = 0;
_dreamSteps = 0;
}
DarkMoonEngine::~DarkMoonEngine() {
- delete[] _seqIntro;
- delete[] _seqFinale;
+ delete[] _animIntro;
+ delete[] _animFinale;
delete[] _shapesIntro;
delete[] _shapesFinale;
}
@@ -58,6 +57,14 @@ Common::Error DarkMoonEngine::init() {
_monsterProps = new EoBMonsterProperty[10];
+ if (_configRenderMode == Common::kRenderEGA) {
+ Palette pal(16);
+ _screen->loadPalette(_egaDefaultPalette, pal, 16);
+ _screen->setScreenPalette(pal);
+ } else {
+ _screen->loadPalette("palette.col", _screen->getPalette(0));
+ }
+
return Common::kNoError;
}
diff --git a/engines/kyra/darkmoon.h b/engines/kyra/darkmoon.h
index 78413d2..f6e7b3e 100644
--- a/engines/kyra/darkmoon.h
+++ b/engines/kyra/darkmoon.h
@@ -31,7 +31,7 @@ namespace Kyra {
class DarkmoonSequenceHelper;
-struct EoBSequenceStep {
+struct DarkMoonAnimCommand {
uint8 command;
uint8 obj;
int16 x1;
@@ -74,17 +74,19 @@ private:
const char * const *_introStrings;
const char * const *_cpsFilesIntro;
- const EoBSequenceStep **_seqIntro;
- const EoBShapeDef **_shapesIntro;
+ const DarkMoonAnimCommand **_animIntro;
+ const DarkMoonShapeDef **_shapesIntro;
const char * const *_finaleStrings;
const uint8 *_creditsData;
const char * const *_cpsFilesFinale;
- const EoBSequenceStep **_seqFinale;
- const EoBShapeDef **_shapesFinale;
+ const DarkMoonAnimCommand **_animFinale;
+ const DarkMoonShapeDef **_shapesFinale;
- static const char *_palFilesIntro[];
- static const char *_palFilesFinale[];
+ static const char *_palFilesIntroVGA[];
+ static const char *_palFilesIntroEGA[];
+ static const char *_palFilesFinaleVGA[];
+ static const char *_palFilesFinaleEGA[];
// Ingame sequence
void seq_nightmare();
@@ -135,6 +137,7 @@ private:
const uint8 *_hornSounds;
static const KyraRpgGUISettings _guiSettings;
+ static const uint8 _egaDefaultPalette[];
};
} // End of namespace Kyra
diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp
index 40b0281..3a1cfc1 100644
--- a/engines/kyra/eob.cpp
+++ b/engines/kyra/eob.cpp
@@ -55,7 +55,7 @@ Common::Error EoBEngine::init() {
initStaticResource();
- _itemsOverlay = _res->fileData("ITEMRMP.VGA", 0);
+ _itemsOverlay = _res->fileData((_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA) ? "ITEMRMP.EGA" : "ITEMRMP.VGA", 0);
_screen->modifyScreenDim(7, 0x01, 0xB3, 0x22, 0x12);
_screen->modifyScreenDim(9, 0x01, 0x7D, 0x26, 0x3F);
@@ -63,6 +63,14 @@ Common::Error EoBEngine::init() {
_scriptTimersCount = 1;
+ if (_configRenderMode == Common::kRenderEGA) {
+ Palette pal(16);
+ _screen->loadPalette(_egaDefaultPalette, pal, 16);
+ _screen->setScreenPalette(pal);
+ } else {
+ _screen->loadPalette("palette.col", _screen->getPalette(0));
+ }
+
return Common::kNoError;
}
@@ -73,6 +81,7 @@ void EoBEngine::startupNew() {
_currentBlock = 490;
_currentDirection = 0;
setHandItem(0);
+
EoBCoreEngine::startupNew();
}
@@ -134,7 +143,7 @@ void EoBEngine::drawNpcScene(int npcIndex) {
void EoBEngine::encodeDrawNpcSeqShape(int npcIndex, int drawX, int drawY) {
const uint8 *shpDef = &_npcShpData[npcIndex << 2];
_screen->_curPage = 2;
- const uint8 *shp = _screen->encodeShape(shpDef[0], shpDef[1], shpDef[2], shpDef[3]);
+ const uint8 *shp = _screen->encodeShape(shpDef[0], shpDef[1], shpDef[2], shpDef[3], false, _cgaMappingDefault);
_screen->_curPage = 0;
_screen->drawShape(0, shp, drawX - (shp[2] << 2), drawY - shp[1], 5);
delete[] shp;
@@ -352,9 +361,9 @@ void EoBEngine::loadDoorShapes(int doorType1, int shapeId1, int doorType2, int s
if (doorType1 != 0xff) {
for (int i = 0; i < 3; i++) {
const uint8 *enc = &_doorShapeEncodeDefs[(doorType1 * 3 + i) << 2];
- _doorShapes[shapeId1 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3]);
+ _doorShapes[shapeId1 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
enc = &_doorSwitchShapeEncodeDefs[(doorType1 * 3 + i) << 2];
- _doorSwitches[shapeId1 + i].shp = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3]);
+ _doorSwitches[shapeId1 + i].shp = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
_doorSwitches[shapeId1 + i].x = _doorSwitchCoords[doorType1 * 6 + i * 2];
_doorSwitches[shapeId1 + i].y = _doorSwitchCoords[doorType1 * 6 + i * 2 + 1];
}
@@ -363,9 +372,9 @@ void EoBEngine::loadDoorShapes(int doorType1, int shapeId1, int doorType2, int s
if (doorType2 != 0xff) {
for (int i = 0; i < 3; i++) {
const uint8 *enc = &_doorShapeEncodeDefs[(doorType2 * 3 + i) << 2];
- _doorShapes[shapeId2 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3]);
+ _doorShapes[shapeId2 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
enc = &_doorSwitchShapeEncodeDefs[(doorType2 * 3 + i) << 2];
- _doorSwitches[shapeId2 + i].shp = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3]);
+ _doorSwitches[shapeId2 + i].shp = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
_doorSwitches[shapeId2 + i].x = _doorSwitchCoords[doorType2 * 6 + i * 2];
_doorSwitches[shapeId2 + i].y = _doorSwitchCoords[doorType2 * 6 + i * 2 + 1];
}
diff --git a/engines/kyra/eob.h b/engines/kyra/eob.h
index 89d2b25..9d583a0 100644
--- a/engines/kyra/eob.h
+++ b/engines/kyra/eob.h
@@ -109,6 +109,7 @@ private:
const KyraRpgGUISettings *guiSettings();
static const KyraRpgGUISettings _guiSettings;
+ static const uint8 _egaDefaultPalette[];
};
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp
index 42ceed5..a68c7de 100644
--- a/engines/kyra/eobcommon.cpp
+++ b/engines/kyra/eobcommon.cpp
@@ -47,6 +47,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags)
_numThrownItemShapes(flags.gameID == GI_EOB1 ? 12 : 9),
_numItemIconShapes(flags.gameID == GI_EOB1 ? 89 : 112),
_teleporterWallId(flags.gameID == GI_EOB1 ? 52 : 44) {
+
_screen = 0;
_gui = 0;
_debugger = 0;
@@ -212,6 +213,8 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags)
_spellLevelsMage = _spellLevelsCleric = _numSpellsCleric = _numSpellsWisAdj = _numSpellsPal = _numSpellsMage = 0;
_mnNumWord = _numSpells = _mageSpellListSize = _spellLevelsMageSize = _spellLevelsClericSize = 0;
_inventorySlotsX = _slotValidationFlags = _encodeMonsterShpTable = 0;
+ _cgaMappingDefault = _cgaMappingAlt = _cgaMappingInv = _cgaLevelMappingIndex = _cgaMappingItemsL = _cgaMappingItemsS = _cgaMappingThrown = _cgaMappingIcons = _cgaMappingDeco = 0;
+ memset(_cgaMappingLevel, 0, sizeof(_cgaMappingLevel));
memset(_expRequirementTables, 0, sizeof(_expRequirementTables));
memset(_saveThrowTables, 0, sizeof(_saveThrowTables));
memset(_doorType, 0, sizeof(_doorType));
@@ -364,6 +367,9 @@ Common::Error EoBCoreEngine::init() {
// This makes a tick length of 54.94.
_tickLength = 55;
+ if (ConfMan.hasKey("render_mode"))
+ _configRenderMode = Common::parseRenderMode(ConfMan.get("render_mode"));
+
_screen = new Screen_EoB(this, _system);
assert(_screen);
_screen->setResolution();
@@ -497,8 +503,7 @@ Common::Error EoBCoreEngine::go() {
_debugger->initialize();
_txt->removePageBreakFlag();
- _screen->loadPalette("palette.col", _screen->getPalette(0));
- _screen->setScreenPalette(_screen->getPalette(0));
+
_screen->setFont(Screen::FID_8_FNT);
loadItemsAndDecorationsShapes();
@@ -661,44 +666,43 @@ bool EoBCoreEngine::checkPartyStatus(bool handleDeath) {
void EoBCoreEngine::loadItemsAndDecorationsShapes() {
releaseItemsAndDecorationsShapes();
- _screen->setCurPage(2);
- _screen->loadBitmap("ITEML1.CPS", 5, 3, 0);
+ _screen->loadShapeSetBitmap("ITEML1", 5, 3);
_largeItemShapes = new const uint8*[_numLargeItemShapes];
int div = (_flags.gameID == GI_EOB1) ? 3 : 8;
int mul = (_flags.gameID == GI_EOB1) ? 64 : 24;
for (int i = 0; i < _numLargeItemShapes; i++)
- _largeItemShapes[i] = _screen->encodeShape((i / div) << 3, (i % div) * mul, 8, 24);
+ _largeItemShapes[i] = _screen->encodeShape((i / div) << 3, (i % div) * mul, 8, 24, false, _cgaMappingItemsL);
- _screen->loadBitmap("ITEMS1.CPS", 5, 3, 0);
+ _screen->loadShapeSetBitmap("ITEMS1", 5, 3);
_smallItemShapes = new const uint8*[_numSmallItemShapes];
for (int i = 0; i < _numSmallItemShapes; i++)
- _smallItemShapes[i] = _screen->encodeShape((i / div) << 2, (i % div) * mul, 4, 24);
+ _smallItemShapes[i] = _screen->encodeShape((i / div) << 2, (i % div) * mul, 4, 24, false, _cgaMappingItemsS);
- _screen->loadBitmap("THROWN.CPS", 5, 3, 0);
+ _screen->loadShapeSetBitmap("THROWN", 5, 3);
_thrownItemShapes = new const uint8*[_numThrownItemShapes];
for (int i = 0; i < _numThrownItemShapes; i++)
- _thrownItemShapes[i] = _screen->encodeShape((i / div) << 2, (i % div) * mul, 4, 24);
+ _thrownItemShapes[i] = _screen->encodeShape((i / div) << 2, (i % div) * mul, 4, 24, false, _cgaMappingThrown);
_spellShapes = new const uint8*[4];
for (int i = 0; i < 4; i++)
- _spellShapes[i] = _screen->encodeShape(8, i << 5, 6, 32);
+ _spellShapes[i] = _screen->encodeShape(8, i << 5, 6, 32, false, _cgaMappingThrown);
_firebeamShapes = new const uint8*[3];
- _firebeamShapes[0] = _screen->encodeShape(16, 0, 4, 24);
- _firebeamShapes[1] = _screen->encodeShape(16, 24, 4, 24);
- _firebeamShapes[2] = _screen->encodeShape(16, 48, 3, 24);
- _redSplatShape = _screen->encodeShape(16, _flags.gameID == GI_EOB1 ? 144 : 72, 5, 24);
- _greenSplatShape = _screen->encodeShape(16, _flags.gameID == GI_EOB1 ? 168 : 96, 5, 16);
+ _firebeamShapes[0] = _screen->encodeShape(16, 0, 4, 24, false, _cgaMappingThrown);
+ _firebeamShapes[1] = _screen->encodeShape(16, 24, 4, 24, false, _cgaMappingThrown);
+ _firebeamShapes[2] = _screen->encodeShape(16, 48, 3, 24, false, _cgaMappingThrown);
+ _redSplatShape = _screen->encodeShape(16, _flags.gameID == GI_EOB1 ? 144 : 72, 5, 24, false, _cgaMappingThrown);
+ _greenSplatShape = _screen->encodeShape(16, _flags.gameID == GI_EOB1 ? 168 : 96, 5, 16, false, _cgaMappingThrown);
- _screen->loadBitmap("ITEMICN.CPS", 5, 3, 0);
+ _screen->loadShapeSetBitmap("ITEMICN", 5, 3);
_itemIconShapes = new const uint8*[_numItemIconShapes];
for (int i = 0; i < _numItemIconShapes; i++)
- _itemIconShapes[i] = _screen->encodeShape((i % 0x14) << 1, (i / 0x14) << 4, 2, 0x10);
+ _itemIconShapes[i] = _screen->encodeShape((i % 0x14) << 1, (i / 0x14) << 4, 2, 0x10, false, _cgaMappingIcons);
_tempIconShape = new uint8[300];
- _screen->loadBitmap("DECORATE.CPS", 5, 3, 0);
+ _screen->loadShapeSetBitmap("DECORATE", 5, 3);
if (_flags.gameID == GI_EOB2) {
_lightningColumnShape = _screen->encodeShape(18, 88, 4, 64);
@@ -709,16 +713,16 @@ void EoBCoreEngine::loadItemsAndDecorationsShapes() {
_teleporterShapes = new const uint8*[6];
for (int i = 0; i < 6; i++)
- _teleporterShapes[i] = _screen->encodeShape(_teleporterShapeDefs[(i << 2)], _teleporterShapeDefs[(i << 2) + 1], _teleporterShapeDefs[(i << 2) + 2], _teleporterShapeDefs[(i << 2) + 3]);
+ _teleporterShapes[i] = _screen->encodeShape(_teleporterShapeDefs[(i << 2)], _teleporterShapeDefs[(i << 2) + 1], _teleporterShapeDefs[(i << 2) + 2], _teleporterShapeDefs[(i << 2) + 3], false, _cgaMappingDefault);
_sparkShapes = new const uint8*[3];
- _sparkShapes[0] = _screen->encodeShape(29, 0, 2, 16);
- _sparkShapes[1] = _screen->encodeShape(31, 0, 2, 16);
- _sparkShapes[2] = _screen->encodeShape(33, 0, 2, 16);
- _deadCharShape = _screen->encodeShape(0, 88, 4, 32);
- _disabledCharGrid = _screen->encodeShape(4, 88, 4, 32);
- _blackBoxSmallGrid = _screen->encodeShape(9, 88, 2, 8);
- _weaponSlotGrid = _screen->encodeShape(8, 88, 4, 16);
- _blackBoxWideGrid = _screen->encodeShape(8, 104, 4, 8);
+ _sparkShapes[0] = _screen->encodeShape(29, 0, 2, 16, false, _cgaMappingDeco);
+ _sparkShapes[1] = _screen->encodeShape(31, 0, 2, 16, false, _cgaMappingDeco);
+ _sparkShapes[2] = _screen->encodeShape(33, 0, 2, 16, false, _cgaMappingDeco);
+ _deadCharShape = _screen->encodeShape(0, 88, 4, 32, false, _cgaMappingDeco);
+ _disabledCharGrid = _screen->encodeShape(4, 88, 4, 32, false, _cgaMappingDeco);
+ _blackBoxSmallGrid = _screen->encodeShape(9, 88, 2, 8, false, _cgaMappingDeco);
+ _weaponSlotGrid = _screen->encodeShape(8, 88, 4, 16, false, _cgaMappingDeco);
+ _blackBoxWideGrid = _screen->encodeShape(8, 104, 4, 8, false, _cgaMappingDeco);
static const uint8 dHeight[] = { 17, 10, 10 };
static const uint8 dY[] = { 120, 137, 147 };
@@ -726,7 +730,7 @@ void EoBCoreEngine::loadItemsAndDecorationsShapes() {
_compassShapes = new const uint8*[12];
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 4; x++)
- _compassShapes[(y << 2) + x] = _screen->encodeShape(x * 3, dY[y], 3, dHeight[y]);
+ _compassShapes[(y << 2) + x] = _screen->encodeShape(x * 3, dY[y], 3, dHeight[y], false, _cgaMappingDeco);
}
}
@@ -1197,7 +1201,7 @@ void EoBCoreEngine::initNpc(int npcIndex) {
_screen->loadShapeSetBitmap(_flags.gameID == GI_EOB2 ? "OUTPORTS" : "OUTTAKE", 3, 3);
_screen->_curPage = 2;
- c->faceShape = _screen->encodeShape(npcIndex << 2, _flags.gameID == GI_EOB2 ? 0 : 160, 4, 32, true);
+ c->faceShape = _screen->encodeShape(npcIndex << 2, _flags.gameID == GI_EOB2 ? 0 : 160, 4, 32, true, _cgaMappingDefault);
_screen->_curPage = 0;
}
@@ -1679,13 +1683,13 @@ void EoBCoreEngine::seq_portal() {
_screen->loadShapeSetBitmap("PORTALA", 5, 3);
for (int i = 0; i < 5; i++) {
- shapes1[i] = _screen->encodeShape(i * 3, 0, 3, 75);
- shapes2[i] = _screen->encodeShape(i * 3, 80, 3, 75);
- shapes3[i] = _screen->encodeShape(15, i * 18, 15, 18);
+ shapes1[i] = _screen->encodeShape(i * 3, 0, 3, 75, false, _cgaMappingDefault);
+ shapes2[i] = _screen->encodeShape(i * 3, 80, 3, 75, false, _cgaMappingDefault);
+ shapes3[i] = _screen->encodeShape(15, i * 18, 15, 18, false, _cgaMappingDefault);
}
- shape0 = _screen->encodeShape(30, 0, 8, 77);
- _screen->loadEoBBitmap("PORTALB", 0, 5, 3, 2);
+ shape0 = _screen->encodeShape(30, 0, 8, 77, false, _cgaMappingDefault);
+ _screen->loadEoBBitmap("PORTALB", _cgaMappingDefault, 5, 3, 2);
snd_playSoundEffect(33);
snd_playSoundEffect(19);
diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h
index dff2427..49589c8 100644
--- a/engines/kyra/eobcommon.h
+++ b/engines/kyra/eobcommon.h
@@ -31,7 +31,7 @@
namespace Kyra {
-struct EoBShapeDef {
+struct DarkMoonShapeDef {
int16 index;
uint8 x, y, w, h;
};
@@ -577,7 +577,7 @@ protected:
void readLevelFileData(int level);
Common::String initLevelData(int sub);
void addLevelItems();
- void loadVcnData(const char *file, const char * /*nextFile*/);
+ void loadVcnData(const char *file, const uint8 *cgaMapping);
void loadBlockProperties(const char *mazFile);
const uint8 *getBlockFileData(int levelIndex = 0);
Common::String getBlockFileName(int levelIndex, int sub);
@@ -834,6 +834,17 @@ protected:
Common::Error loadGameState(int slot);
Common::Error saveGameStateIntern(int slot, const char *saveName, const Graphics::Surface *thumbnail);
+ const uint8 *_cgaMappingDefault;
+ const uint8 *_cgaMappingAlt;
+ const uint8 *_cgaMappingInv;
+ const uint8 *_cgaMappingItemsL;
+ const uint8 *_cgaMappingItemsS;
+ const uint8 *_cgaMappingThrown;
+ const uint8 *_cgaMappingIcons;
+ const uint8 *_cgaMappingDeco;
+ const uint8 *_cgaMappingLevel[5];
+ const uint8 *_cgaLevelMappingIndex;
+
// Default parameters will import all present original save files and push them to the top of the save dialog.
bool importOriginalSaveFile(int destSlot, const char *sourceFile = 0);
Common::String readOriginalSaveFile(Common::String &file);
diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp
index b89a6d7..2fdfb0c 100644
--- a/engines/kyra/gui_eob.cpp
+++ b/engines/kyra/gui_eob.cpp
@@ -47,7 +47,7 @@ Button *EoBCoreEngine::gui_getButton(Button *buttonList, int index) {
}
void EoBCoreEngine::gui_drawPlayField(bool refresh) {
- _screen->loadEoBBitmap("PLAYFLD", 0, 5, 3, 2);
+ _screen->loadEoBBitmap("PLAYFLD", _cgaMappingDeco, 5, 3, 2);
int cp = _screen->setCurPage(2);
gui_drawCompass(true);
@@ -60,11 +60,11 @@ void EoBCoreEngine::gui_drawPlayField(bool refresh) {
if (!_loading)
_screen->updateScreen();
- _screen->loadEoBBitmap("INVENT", 0, 5, 3, 2);
+ _screen->loadEoBBitmap("INVENT", _cgaMappingInv, 5, 3, 2);
}
void EoBCoreEngine::gui_restorePlayField() {
- loadVcnData(0, 0);
+ loadVcnData(0, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
_screen->_curPage = 0;
gui_drawPlayField(true);
gui_drawAllCharPortraitsWithStats();
@@ -1891,7 +1891,7 @@ void GUI_EoB::simpleMenu_setup(int sd, int maxItem, const char *const *strings,
for (int i = 0; i < _menuNumItems; i++) {
int item = simpleMenu_getMenuItem(i, menuItemsMask, itemOffset);
int ty = y + i * (lineSpacing + _screen->getFontHeight());
- _screen->printShadedText(strings[item], x, ty, dm->unkA, 0);
+ _screen->printShadedText(strings[item], x, ty, (_vm->_configRenderMode == Common::kRenderCGA) ? 1 : dm->unkA, 0);
if (item == v)
_screen->printText(strings[item], x, ty, dm->unkC, 0);
}
@@ -1944,7 +1944,7 @@ int GUI_EoB::simpleMenu_process(int sd, const char *const *strings, void *b, int
}
if (newItem != currentItem) {
- _screen->printText(strings[simpleMenu_getMenuItem(currentItem, menuItemsMask, itemOffset)], x, y + currentItem * lineH , dm->unkA, 0);
+ _screen->printText(strings[simpleMenu_getMenuItem(currentItem, menuItemsMask, itemOffset)], x, y + currentItem * lineH, (_vm->_configRenderMode == Common::kRenderCGA) ? 1 : dm->unkA, 0);
_screen->printText(strings[simpleMenu_getMenuItem(newItem, menuItemsMask, itemOffset)], x, y + newItem * lineH , dm->unkC, 0);
_screen->updateScreen();
}
diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp
index b282925..8c9a1ec 100644
--- a/engines/kyra/kyra_rpg.cpp
+++ b/engines/kyra/kyra_rpg.cpp
@@ -45,7 +45,7 @@ KyraRpgEngine::KyraRpgEngine(OSystem *system, const GameFlags &flags) : KyraEngi
_vcnBlocks = 0;
_vcfBlocks = 0;
_vcnShift = 0;
- _vcnExpTable = 0;
+ _vcnColTable = 0;
_vmpPtr = 0;
_blockBrightness = _wllVcnOffset = 0;
_blockDrawingBuffer = 0;
@@ -123,7 +123,7 @@ KyraRpgEngine::~KyraRpgEngine() {
delete[] _wllWallFlags;
delete[] _vmpPtr;
- delete[] _vcnExpTable;
+ delete[] _vcnColTable;
delete[] _vcnBlocks;
delete[] _vcfBlocks;
delete[] _vcnShift;
@@ -173,9 +173,9 @@ Common::Error KyraRpgEngine::init() {
_lvlShapeLeftRight = new int16[36];
memset(_lvlShapeLeftRight, 0, 36 * sizeof(int16));
- _vcnExpTable = new uint8[128];
+ _vcnColTable = new uint8[128];
for (int i = 0; i < 128; i++)
- _vcnExpTable[i] = i & 0x0f;
+ _vcnColTable[i] = i & 0x0f;
_doorShapes = new uint8*[6];
memset(_doorShapes, 0, 6 * sizeof(uint8 *));
diff --git a/engines/kyra/kyra_rpg.h b/engines/kyra/kyra_rpg.h
index b606963..6a71239 100644
--- a/engines/kyra/kyra_rpg.h
+++ b/engines/kyra/kyra_rpg.h
@@ -225,7 +225,7 @@ protected:
uint8 *_vcnBlocks;
uint8 *_vcfBlocks;
uint8 *_vcnShift;
- uint8 *_vcnExpTable;
+ uint8 *_vcnColTable;
uint16 *_blockDrawingBuffer;
uint8 *_sceneWindowBuffer;
uint8 _blockBrightness;
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 7167d41..0f7da76 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -42,6 +42,8 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
_emc = 0;
_debugger = 0;
+ _configRenderMode = Common::kRenderDefault;
+
if (_flags.platform == Common::kPlatformAmiga)
_gameSpeed = 50;
else
@@ -163,6 +165,9 @@ Common::Error KyraEngine_v1::init() {
if (_sound)
_sound->updateVolumeSettings();
+ if (ConfMan.hasKey("render_mode"))
+ _configRenderMode = Common::parseRenderMode(ConfMan.get("render_mode"));
+
_res = new Resource(this);
assert(_res);
_res->reset();
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 04bfab2..2c2901a 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -306,6 +306,8 @@ protected:
bool _configSounds;
uint8 _configVoice;
+ Common::RenderMode _configRenderMode;
+
// game speed
virtual bool skipFlag() const;
virtual void resetSkipFlag(bool removeEvent = true);
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index 5de1577..8459288 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -517,9 +517,23 @@ enum KyraResources {
kEoB1EnemyMageSfx,
kEoB1BeholderSpellList,
kEoB1BeholderSfx,
-
kEoB1TurnUndeadString,
+ kEoB1CgaMappingDefault,
+ kEoB1CgaMappingAlt,
+ kEoB1CgaMappingInv,
+ kEoB1CgaMappingItemsL,
+ kEoB1CgaMappingItemsS,
+ kEoB1CgaMappingThrown,
+ kEoB1CgaMappingIcons,
+ kEoB1CgaMappingDeco,
+ kEoB1CgaLevelMappingIndex,
+ kEoB1CgaMappingLevel0,
+ kEoB1CgaMappingLevel1,
+ kEoB1CgaMappingLevel2,
+ kEoB1CgaMappingLevel3,
+ kEoB1CgaMappingLevel4,
+
kEoB1NpcShpData,
kEoB1NpcSubShpIndex1,
kEoB1NpcSubShpIndex2,
@@ -548,50 +562,50 @@ enum KyraResources {
kEoB2IntroStrings,
kEoB2IntroCPSFiles,
- kEoB2IntroSeqData00,
- kEoB2IntroSeqData01,
- kEoB2IntroSeqData02,
- kEoB2IntroSeqData03,
- kEoB2IntroSeqData04,
- kEoB2IntroSeqData05,
- kEoB2IntroSeqData06,
- kEoB2IntroSeqData07,
- kEoB2IntroSeqData08,
- kEoB2IntroSeqData09,
- kEoB2IntroSeqData10,
- kEoB2IntroSeqData11,
- kEoB2IntroSeqData12,
- kEoB2IntroSeqData13,
- kEoB2IntroSeqData14,
- kEoB2IntroSeqData15,
- kEoB2IntroSeqData16,
- kEoB2IntroSeqData17,
- kEoB2IntroSeqData18,
- kEoB2IntroSeqData19,
- kEoB2IntroSeqData20,
- kEoB2IntroSeqData21,
- kEoB2IntroSeqData22,
- kEoB2IntroSeqData23,
- kEoB2IntroSeqData24,
- kEoB2IntroSeqData25,
- kEoB2IntroSeqData26,
- kEoB2IntroSeqData27,
- kEoB2IntroSeqData28,
- kEoB2IntroSeqData29,
- kEoB2IntroSeqData30,
- kEoB2IntroSeqData31,
- kEoB2IntroSeqData32,
- kEoB2IntroSeqData33,
- kEoB2IntroSeqData34,
- kEoB2IntroSeqData35,
- kEoB2IntroSeqData36,
- kEoB2IntroSeqData37,
- kEoB2IntroSeqData38,
- kEoB2IntroSeqData39,
- kEoB2IntroSeqData40,
- kEoB2IntroSeqData41,
- kEoB2IntroSeqData42,
- kEoB2IntroSeqData43,
+ kEob2IntroAnimData00,
+ kEob2IntroAnimData01,
+ kEob2IntroAnimData02,
+ kEob2IntroAnimData03,
+ kEob2IntroAnimData04,
+ kEob2IntroAnimData05,
+ kEob2IntroAnimData06,
+ kEob2IntroAnimData07,
+ kEob2IntroAnimData08,
+ kEob2IntroAnimData09,
+ kEob2IntroAnimData10,
+ kEob2IntroAnimData11,
+ kEob2IntroAnimData12,
+ kEob2IntroAnimData13,
+ kEob2IntroAnimData14,
+ kEob2IntroAnimData15,
+ kEob2IntroAnimData16,
+ kEob2IntroAnimData17,
+ kEob2IntroAnimData18,
+ kEob2IntroAnimData19,
+ kEob2IntroAnimData20,
+ kEob2IntroAnimData21,
+ kEob2IntroAnimData22,
+ kEob2IntroAnimData23,
+ kEob2IntroAnimData24,
+ kEob2IntroAnimData25,
+ kEob2IntroAnimData26,
+ kEob2IntroAnimData27,
+ kEob2IntroAnimData28,
+ kEob2IntroAnimData29,
+ kEob2IntroAnimData30,
+ kEob2IntroAnimData31,
+ kEob2IntroAnimData32,
+ kEob2IntroAnimData33,
+ kEob2IntroAnimData34,
+ kEob2IntroAnimData35,
+ kEob2IntroAnimData36,
+ kEob2IntroAnimData37,
+ kEob2IntroAnimData38,
+ kEob2IntroAnimData39,
+ kEob2IntroAnimData40,
+ kEob2IntroAnimData41,
+ kEob2IntroAnimData42,
+ kEob2IntroAnimData43,
kEoB2IntroShapes00,
kEoB2IntroShapes01,
kEoB2IntroShapes04,
@@ -600,27 +614,27 @@ enum KyraResources {
kEoB2FinaleStrings,
kEoB2CreditsData,
kEoB2FinaleCPSFiles,
- kEoB2FinaleSeqData00,
- kEoB2FinaleSeqData01,
- kEoB2FinaleSeqData02,
- kEoB2FinaleSeqData03,
- kEoB2FinaleSeqData04,
- kEoB2FinaleSeqData05,
- kEoB2FinaleSeqData06,
- kEoB2FinaleSeqData07,
- kEoB2FinaleSeqData08,
- kEoB2FinaleSeqData09,
- kEoB2FinaleSeqData10,
- kEoB2FinaleSeqData11,
- kEoB2FinaleSeqData12,
- kEoB2FinaleSeqData13,
- kEoB2FinaleSeqData14,
- kEoB2FinaleSeqData15,
- kEoB2FinaleSeqData16,
- kEoB2FinaleSeqData17,
- kEoB2FinaleSeqData18,
- kEoB2FinaleSeqData19,
- kEoB2FinaleSeqData20,
+ kEob2FinaleAnimData00,
+ kEob2FinaleAnimData01,
+ kEob2FinaleAnimData02,
+ kEob2FinaleAnimData03,
+ kEob2FinaleAnimData04,
+ kEob2FinaleAnimData05,
+ kEob2FinaleAnimData06,
+ kEob2FinaleAnimData07,
+ kEob2FinaleAnimData08,
+ kEob2FinaleAnimData09,
+ kEob2FinaleAnimData10,
+ kEob2FinaleAnimData11,
+ kEob2FinaleAnimData12,
+ kEob2FinaleAnimData13,
+ kEob2FinaleAnimData14,
+ kEob2FinaleAnimData15,
+ kEob2FinaleAnimData16,
+ kEob2FinaleAnimData17,
+ kEob2FinaleAnimData18,
+ kEob2FinaleAnimData19,
+ kEob2FinaleAnimData20,
kEoB2FinaleShapes00,
kEoB2FinaleShapes03,
kEoB2FinaleShapes07,
@@ -757,8 +771,8 @@ public:
const LoLButtonDef *loadButtonDefs(int id, int &entries);
#endif // ENABLE_LOL
#ifdef ENABLE_EOB
- const EoBSequenceStep *loadEoB2SeqData(int id, int &entries);
- const EoBShapeDef *loadEoB2ShapeData(int id, int &entries);
+ const DarkMoonAnimCommand *loadEoB2SeqData(int id, int &entries);
+ const DarkMoonShapeDef *loadEoB2ShapeData(int id, int &entries);
const EoBCharacter *loadEoBNpcData(int id, int &entries);
#endif // ENABLE_EOB
diff --git a/engines/kyra/saveload_eob.cpp b/engines/kyra/saveload_eob.cpp
index 9f9476d..7f20c12 100644
--- a/engines/kyra/saveload_eob.cpp
+++ b/engines/kyra/saveload_eob.cpp
@@ -110,7 +110,7 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
EoBCharacter *c = &_characters[i];
if (!c->flags || c->portrait < 0)
continue;
- c->faceShape = _screen->encodeShape((c->portrait % 10) << 2, (c->portrait / 10) << 5, 4, 32, true);
+ c->faceShape = _screen->encodeShape((c->portrait % 10) << 2, (c->portrait / 10) << 5, 4, 32, true, _cgaMappingDefault);
}
_screen->loadShapeSetBitmap(_flags.gameID == GI_EOB2 ? "OUTPORTS" : "OUTTAKE", 3, 3);
@@ -118,7 +118,7 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
EoBCharacter *c = &_characters[i];
if (!c->flags || c->portrait >= 0)
continue;
- c->faceShape = _screen->encodeShape((-(c->portrait + 1)) << 2, _flags.gameID == GI_EOB2 ? 0 : 160, 4, 32, true);
+ c->faceShape = _screen->encodeShape((-(c->portrait + 1)) << 2, _flags.gameID == GI_EOB2 ? 0 : 160, 4, 32, true, _cgaMappingDefault);
}
_screen->_curPage = 0;
diff --git a/engines/kyra/scene_eob.cpp b/engines/kyra/scene_eob.cpp
index 3d615e9..2a59a97 100644
--- a/engines/kyra/scene_eob.cpp
+++ b/engines/kyra/scene_eob.cpp
@@ -86,8 +86,8 @@ void EoBCoreEngine::loadLevel(int level, int sub) {
pos += 2;
}
- loadVcnData(gfxFile.c_str(), 0);
- _screen->loadEoBBitmap("INVENT", 0, 5, 3, 2);
+ loadVcnData(gfxFile.c_str(), (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[level - 1]] : 0);
+ _screen->loadEoBBitmap("INVENT", _cgaMappingInv, 5, 3, 2);
delayUntil(end);
snd_stopSound();
@@ -142,7 +142,8 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
loadBlockProperties((const char *)pos);
pos += slen;
- Common::SeekableReadStream *s = _res->createReadStream(Common::String::format("%s.VMP", (const char *)pos));
+ const char *vmpPattern = (_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)) ? "%s.EMP" : "%s.VMP";
+ Common::SeekableReadStream *s = _res->createReadStream(Common::String::format(vmpPattern, (const char *)pos));
uint16 size = s->readUint16LE();
delete[] _vmpPtr;
_vmpPtr = new uint16[size];
@@ -150,12 +151,14 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
_vmpPtr[i] = s->readUint16LE();
delete s;
- Common::String tmpStr = Common::String::format("%s.PAL", (const char *)pos);
+ const char *paletteFilePattern = (_flags.gameID == GI_EOB2 && _configRenderMode == Common::kRenderEGA) ? "%s.EGA" : "%s.PAL";
+
+ Common::String tmpStr = Common::String::format(paletteFilePattern, (const char *)pos);
_curGfxFile = (const char *)pos;
pos += slen;
if (*pos++ != 0xff && _flags.gameID == GI_EOB2) {
- tmpStr = Common::String::format("%s.PAL", (const char *)pos);
+ tmpStr = Common::String::format(paletteFilePattern, (const char *)pos);
pos += 13;
}
@@ -165,21 +168,24 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
_screen->setShapeFadeMode(1, false);
}
- _screen->loadPalette(tmpStr.c_str(), _screen->getPalette(0));
+ if (_flags.gameID == GI_EOB2 || _configRenderMode != Common::kRenderEGA)
+ _screen->loadPalette(tmpStr.c_str(), _screen->getPalette(0));
- Palette backupPal(256);
- backupPal.copy(_screen->getPalette(0), 224, 32, 224);
- _screen->getPalette(0).fill(224, 32, 0x3f);
- uint8 *src = _screen->getPalette(0).getData();
+ if (_configRenderMode != Common::kRenderCGA) {
+ Palette backupPal(256);
+ backupPal.copy(_screen->getPalette(0), 224, 32, 224);
+ _screen->getPalette(0).fill(224, 32, 0x3f);
+ uint8 *src = _screen->getPalette(0).getData();
- _screen->createFadeTable(src, _screen->getFadeTable(0), 4, 75); // green
- _screen->createFadeTable(src, _screen->getFadeTable(1), 12, 200); // black
- _screen->createFadeTable(src, _screen->getFadeTable(2), 10, 85); // blue
- _screen->createFadeTable(src, _screen->getFadeTable(3), 11, 125); // light blue
+ _screen->createFadeTable(src, _screen->getFadeTable(0), 4, 75); // green
+ _screen->createFadeTable(src, _screen->getFadeTable(1), 12, 200); // black
+ _screen->createFadeTable(src, _screen->getFadeTable(2), 10, 85); // blue
+ _screen->createFadeTable(src, _screen->getFadeTable(3), 11, 125); // light blue
- _screen->getPalette(0).copy(backupPal, 224, 32, 224);
- _screen->createFadeTable(src, _screen->getFadeTable(4), 12, 85); // grey (shadow)
- _screen->setFadeTableIndex(4);
+ _screen->getPalette(0).copy(backupPal, 224, 32, 224);
+ _screen->createFadeTable(src, _screen->getFadeTable(4), 12, 85); // grey (shadow)
+ _screen->setFadeTableIndex(4);
+ }
}
if (_flags.gameID == GI_EOB2) {
@@ -267,15 +273,17 @@ void EoBCoreEngine::addLevelItems() {
}
}
-void EoBCoreEngine::loadVcnData(const char *file, const char * /*nextFile*/) {
+void EoBCoreEngine::loadVcnData(const char *file, const uint8 *cgaMapping) {
if (file)
strcpy(_lastBlockDataFile, file);
- _screen->loadBitmap(Common::String::format("%s.VCN", _lastBlockDataFile).c_str(), 3, 3, 0);
- const uint8 *v = _screen->getCPagePtr(2);
+ const char *filePattern = (_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)) ? "%s.ECN" : "%s.VCN";
+ _screen->loadBitmap(Common::String::format(filePattern, _lastBlockDataFile).c_str(), 3, 3, 0);
+ const uint8 *v = _screen->getCPagePtr(3);
uint32 tlen = READ_LE_UINT16(v) << 5;
v += 2;
- memcpy(_vcnExpTable, v, 32);
+ if (!(_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)))
+ memcpy(_vcnColTable, v, 32);
v += 32;
delete[] _vcnBlocks;
_vcnBlocks = new uint8[tlen];
@@ -301,7 +309,7 @@ const uint8 *EoBCoreEngine::getBlockFileData(int) {
Common::SeekableReadStream *s = _res->createReadStream(_curBlockFile);
_screen->loadFileDataToPage(s, 15, s->size());
delete s;
- return _screen->getCPagePtr(14);
+ return _screen->getCPagePtr(15);
}
Common::String EoBCoreEngine::getBlockFileName(int levelIndex, int sub) {
@@ -400,7 +408,7 @@ void EoBCoreEngine::assignWallsAndDecorations(int wallIndex, int vmpIndex, int d
if (r->w == 0 || r->h == 0)
error("Error trying to make decoration %d (x: %d, y: %d, w: %d, h: %d)", decIndex, r->x, r->y, r->w, r->h);
- _levelDecorationShapes[t] = _screen->encodeShape(r->x, r->y, r->w, r->h);
+ _levelDecorationShapes[t] = _screen->encodeShape(r->x, r->y, r->w, r->h, false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
}
decIndex = _levelDecorationProperties[_mappedDecorationsCount++].next;
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index 796db9a..7988471 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -358,7 +358,7 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
memcpy(_vcnShift, v, tlen);
v += tlen;
- memcpy(_vcnExpTable, v, 128);
+ memcpy(_vcnColTable, v, 128);
v += 128;
if (_lastOverridePalFilePtr) {
@@ -451,7 +451,7 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
for (int i = 0; i < 8; i++) {
uint8 *pl = _screen->getLevelOverlay(7 - i);
for (int ii = 0; ii < 16; ii++)
- _vcnExpTable[(i << 4) + ii] = pl[(ii << 4) | ii];
+ _vcnColTable[(i << 4) + ii] = pl[(ii << 4) | ii];
}
}
diff --git a/engines/kyra/scene_rpg.cpp b/engines/kyra/scene_rpg.cpp
index 07a7a87..55d02d8 100644
--- a/engines/kyra/scene_rpg.cpp
+++ b/engines/kyra/scene_rpg.cpp
@@ -389,8 +389,8 @@ void KyraRpgEngine::drawVcnBlocks() {
src += 3;
for (int blockX = 0; blockX < 4; blockX++) {
uint8 t = *src--;
- *d++ = _vcnExpTable[((t & 0x0f) + wllVcnOffset) | shift];
- *d++ = _vcnExpTable[((t >> 4) + wllVcnOffset) | shift];
+ *d++ = _vcnColTable[((t & 0x0f) + wllVcnOffset) | shift];
+ *d++ = _vcnColTable[((t >> 4) + wllVcnOffset) | shift];
}
src += 5;
d += 168;
@@ -399,8 +399,8 @@ void KyraRpgEngine::drawVcnBlocks() {
for (int blockY = 0; blockY < 8; blockY++) {
for (int blockX = 0; blockX < 4; blockX++) {
uint8 t = *src++;
- *d++ = _vcnExpTable[((t >> 4) + wllVcnOffset) | shift];
- *d++ = _vcnExpTable[((t & 0x0f) + wllVcnOffset) | shift];
+ *d++ = _vcnColTable[((t >> 4) + wllVcnOffset) | shift];
+ *d++ = _vcnColTable[((t & 0x0f) + wllVcnOffset) | shift];
}
d += 168;
}
@@ -424,8 +424,8 @@ void KyraRpgEngine::drawVcnBlocks() {
src += 3;
for (int blockX = 0; blockX < 4; blockX++) {
uint8 t = *src--;
- uint8 h = _vcnExpTable[((t & 0x0f) + wllVcnRmdOffset) | shift];
- uint8 l = _vcnExpTable[((t >> 4) + wllVcnRmdOffset) | shift];
+ uint8 h = _vcnColTable[((t & 0x0f) + wllVcnRmdOffset) | shift];
+ uint8 l = _vcnColTable[((t >> 4) + wllVcnRmdOffset) | shift];
if (h)
*d = h;
d++;
@@ -440,8 +440,8 @@ void KyraRpgEngine::drawVcnBlocks() {
for (int blockY = 0; blockY < 8; blockY++) {
for (int blockX = 0; blockX < 4; blockX++) {
uint8 t = *src++;
- uint8 h = _vcnExpTable[((t >> 4) + wllVcnRmdOffset) | shift];
- uint8 l = _vcnExpTable[((t & 0x0f) + wllVcnRmdOffset) | shift];
+ uint8 h = _vcnColTable[((t >> 4) + wllVcnRmdOffset) | shift];
+ uint8 l = _vcnColTable[((t & 0x0f) + wllVcnRmdOffset) | shift];
if (h)
*d = h;
d++;
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 6a76cfd..ebf7835 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -27,6 +27,7 @@
#include "common/endian.h"
#include "common/memstream.h"
#include "common/system.h"
+#include "common/config-manager.h"
#include "engines/util.h"
@@ -49,6 +50,9 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, co
memset(_fonts, 0, sizeof(_fonts));
+ _renderMode = Common::kRenderDefault;
+ _cgaDrawCharDitheringTable = 0;
+
_currentFont = FID_8_FNT;
_paletteChanged = true;
_curDim = 0;
@@ -84,6 +88,10 @@ bool Screen::init() {
_useSJIS = false;
_use16ColorMode = _vm->gameFlags().use16ColorMode;
_isAmiga = (_vm->gameFlags().platform == Common::kPlatformAmiga);
+
+ if (ConfMan.hasKey("render_mode"))
+ _renderMode = Common::parseRenderMode(ConfMan.get("render_mode"));
+
memset(_fonts, 0, sizeof(_fonts));
if (_vm->gameFlags().useHiResOverlay) {
@@ -110,15 +118,33 @@ bool Screen::init() {
}
_curPage = 0;
- uint8 *pagePtr = new uint8[SCREEN_PAGE_SIZE * 8];
- for (int pageNum = 0; pageNum < SCREEN_PAGE_NUM; pageNum += 2)
- _pagePtrs[pageNum] = _pagePtrs[pageNum + 1] = pagePtr + (pageNum >> 1) * SCREEN_PAGE_SIZE;
- memset(pagePtr, 0, SCREEN_PAGE_SIZE * 8);
+
+ int numPages = SCREEN_PAGE_NUM / 2;
+ // CGA and EGA modes use additional pages to do the CGA/EGA specific graphics conversions.
+ if (_renderMode == Common::kRenderEGA || _renderMode == Common::kRenderCGA)
+ numPages += 4;
+
+ uint8 *pagePtr = new uint8[numPages * SCREEN_PAGE_SIZE];
+ memset(pagePtr, 0, numPages * SCREEN_PAGE_SIZE);
+
+ if (_renderMode == Common::kRenderEGA || _renderMode == Common::kRenderCGA) {
+ // Unlike VGA mode the odd and even page numbers do not always point to the same buffers.
+ // Instead, the odd pages are used for CGA/EGA specific graphics conversions.
+ int pageNum = 0;
+ for (; pageNum < 8; pageNum++)
+ _pagePtrs[pageNum] = pagePtr + pageNum * SCREEN_PAGE_SIZE;
+ for (; pageNum < SCREEN_PAGE_NUM; pageNum += 2)
+ _pagePtrs[pageNum] = _pagePtrs[pageNum + 1] = pagePtr + (pageNum / 2) * SCREEN_PAGE_SIZE;
+ } else {
+ for (int pageNum = 0; pageNum < SCREEN_PAGE_NUM; pageNum += 2)
+ _pagePtrs[pageNum] = _pagePtrs[pageNum + 1] = pagePtr + (pageNum / 2) * SCREEN_PAGE_SIZE;
+ }
memset(_shapePages, 0, sizeof(_shapePages));
const int paletteCount = _isAmiga ? 13 : 4;
- const int numColors = _use16ColorMode ? 16 : (_isAmiga ? 32 : 256);
+ // We allow 256 color palettes in EGA mode, since original EOB II code does the same and requires it
+ const int numColors = _use16ColorMode ? 16 : (_isAmiga ? 32 : (_renderMode == Common::kRenderCGA ? 4 : 256));
_interfacePaletteEnabled = false;
@@ -131,6 +157,13 @@ bool Screen::init() {
assert(_palettes[i]);
}
+ // Setup CGA colors (if CGA mode is selected)
+ if (_renderMode == Common::kRenderCGA) {
+ Palette pal(4);
+ pal.setCGAPalette(1, Palette::kIntensityHigh);
+ Screen::setScreenPalette(pal);
+ }
+
_internFadePalette = new Palette(numColors);
assert(_internFadePalette);
@@ -618,8 +651,14 @@ void Screen::fadeToBlack(int delay, const UpdateFunctor *upFunc) {
}
void Screen::fadePalette(const Palette &pal, int delay, const UpdateFunctor *upFunc) {
+ if (_renderMode == Common::kRenderEGA)
+ setScreenPalette(pal);
+
updateScreen();
+ if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderEGA)
+ return;
+
int diff = 0, delayInc = 0;
getFadeParams(pal, delay, delayInc, diff);
@@ -1126,7 +1165,7 @@ bool Screen::loadFont(FontId fontId, const char *filename) {
fnt = new AMIGAFont();
#ifdef ENABLE_EOB
else if (_vm->game() == GI_EOB1 || _vm->game() == GI_EOB2)
- fnt = new OldDOSFont();
+ fnt = new OldDOSFont(_renderMode, _cgaDrawCharDitheringTable);
#endif // ENABLE_EOB
else
fnt = new DOSFont();
@@ -3013,6 +3052,9 @@ void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, Palette
}
bool Screen::loadPalette(const char *filename, Palette &pal) {
+ if (_renderMode == Common::kRenderCGA)
+ return true;
+
Common::SeekableReadStream *stream = _vm->resource()->createReadStream(filename);
if (!stream)
@@ -3029,6 +3071,17 @@ bool Screen::loadPalette(const char *filename, Palette &pal) {
} else if (_vm->gameFlags().platform == Common::kPlatformPC98 && _use16ColorMode) {
numCols = stream->size() / Palette::kPC98BytesPerColor;
pal.loadPC98Palette(*stream, 0, MIN(maxCols, numCols));
+ } else if (_renderMode == Common::kRenderEGA) {
+ // EOB II checks the number of palette bytes to distinguish between real EGA palettes
+ // and normal palettes (which are used to generate a color map).
+ if (stream->size() == 16) {
+ numCols = 16;
+ pal.loadEGAPalette(*stream, 0, 16);
+ } else {
+ numCols = stream->size() / Palette::kVGABytesPerColor;
+ pal.loadVGAPalette(*stream, 0, numCols);
+ }
+
} else {
numCols = stream->size() / Palette::kVGABytesPerColor;
pal.loadVGAPalette(*stream, 0, MIN(maxCols, numCols));
@@ -3076,7 +3129,14 @@ void Screen::loadPalette(const byte *data, Palette &pal, int bytes) {
pal.loadAmigaPalette(stream, 0, stream.size() / Palette::kAmigaBytesPerColor);
else if (_vm->gameFlags().platform == Common::kPlatformPC98 && _use16ColorMode)
pal.loadPC98Palette(stream, 0, stream.size() / Palette::kPC98BytesPerColor);
- else
+ else if (_renderMode == Common::kRenderEGA) {
+ // EOB II checks the number of palette bytes to distinguish between real EGA palettes
+ // and normal palettes (which are used to generate a color map).
+ if (stream.size() == 16)
+ pal.loadEGAPalette(stream, 0, stream.size());
+ else
+ pal.loadVGAPalette(stream, 0, stream.size() / Palette::kVGABytesPerColor);
+ } else
pal.loadVGAPalette(stream, 0, stream.size() / Palette::kVGABytesPerColor);
}
@@ -3553,6 +3613,24 @@ void Palette::loadVGAPalette(Common::ReadStream &stream, int startIndex, int col
*pos++ = stream.readByte() & 0x3f;
}
+void Palette::loadEGAPalette(Common::ReadStream &stream, int startIndex, int colors) {
+ assert(startIndex + colors <= 16);
+
+ uint8 *dst = _palData + startIndex * 3;
+ for (int i = 0; i < colors; i++) {
+ uint8 index = stream.readByte();
+ assert(index < _egaNumColors);
+ memcpy(dst, &_egaColors[index * 3], 3);
+ dst += 3;
+ }
+}
+
+void Palette::setCGAPalette(int palIndex, CGAIntensity intensity) {
+ assert(_numColors == _cgaNumColors);
+ assert(!(palIndex & ~1));
+ memcpy(_palData, _cgaColors[palIndex * 2 + intensity], _numColors * 3);
+}
+
void Palette::loadAmigaPalette(Common::ReadStream &stream, int startIndex, int colors) {
assert(startIndex + colors <= _numColors);
@@ -3629,4 +3707,22 @@ uint8 *Palette::fetchRealPalette() const {
return buffer;
}
+const uint8 Palette::_egaColors[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x00, 0xAA, 0x00, 0x00, 0xAA, 0xAA,
+ 0xAA, 0x00, 0x00, 0xAA, 0x00, 0xAA, 0xAA, 0x55, 0x00, 0xAA, 0xAA, 0xAA,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0xFF, 0x55, 0xFF, 0x55, 0x55, 0xFF, 0xFF,
+ 0xFF, 0x55, 0x55, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, 0x55, 0xFF, 0xFF, 0xFF
+};
+
+const int Palette::_egaNumColors = ARRAYSIZE(_egaColors) / 3;
+
+const uint8 Palette::_cgaColors[4][12] = {
+ { 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x2A, 0x00, 0x00, 0x2A, 0x15, 0x00 },
+ { 0x00, 0x00, 0x00, 0x15, 0x3F, 0x15, 0x3F, 0x15, 0x15, 0x3F, 0x3F, 0x15 },
+ { 0x00, 0x00, 0x00, 0x00, 0x2A, 0x2A, 0x2A, 0x00, 0x2A, 0x2A, 0x2A, 0x2A },
+ { 0x00, 0x00, 0x00, 0x15, 0x3F, 0x3F, 0x3F, 0x15, 0x3F, 0x3F, 0x3F, 0x3F }
+};
+
+const int Palette::_cgaNumColors = ARRAYSIZE(_cgaColors[0]) / 3;
+
} // End of namespace Kyra
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 62ea35a..fcb5ef2 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -145,8 +145,8 @@ private:
*/
class OldDOSFont : public Font {
public:
- OldDOSFont();
- ~OldDOSFont() { unload(); }
+ OldDOSFont(Common::RenderMode mode, const uint16 *cgaDitheringTable);
+ ~OldDOSFont();
bool load(Common::SeekableReadStream &file);
int getHeight() const { return _height; }
@@ -165,6 +165,9 @@ private:
const uint8 *_colorMap;
int _numGlyphs;
+
+ Common::RenderMode _renderMode;
+ const uint16 *_cgaDitheringTable;
};
#endif // ENABLE_EOB
@@ -252,6 +255,21 @@ public:
void loadVGAPalette(Common::ReadStream &stream, int startIndex, int colors);
/**
+ * Load a EGA palette from the given stream.
+ */
+ void loadEGAPalette(Common::ReadStream &stream, int startIndex, int colors);
+
+ /**
+ * Set default CGA palette. We only need the cyan/magenta/grey mode.
+ */
+ enum CGAIntensity {
+ kIntensityLow = 0,
+ kIntensityHigh = 1
+ };
+
+ void setCGAPalette(int palIndex, CGAIntensity intensity);
+
+ /**
* Load a AMIGA palette from the given stream.
*/
void loadAmigaPalette(Common::ReadStream &stream, int startIndex, int colors);
@@ -325,9 +343,15 @@ public:
*/
uint8 *getData() { return _palData; }
const uint8 *getData() const { return _palData; }
+
private:
uint8 *_palData;
const int _numColors;
+
+ static const uint8 _egaColors[];
+ static const int _egaNumColors;
+ static const uint8 _cgaColors[4][12];
+ static const int _cgaNumColors;
};
class Screen {
@@ -480,9 +504,9 @@ public:
// misc
void loadBitmap(const char *filename, int tempPage, int dstPage, Palette *pal, bool skip=false);
- bool loadPalette(const char *filename, Palette &pal);
+ virtual bool loadPalette(const char *filename, Palette &pal);
bool loadPaletteTable(const char *filename, int firstPalette);
- void loadPalette(const byte *data, Palette &pal, int bytes);
+ virtual void loadPalette(const byte *data, Palette &pal, int bytes);
void setAnimBlockPtr(int size);
@@ -550,6 +574,8 @@ protected:
bool _useSJIS;
bool _use16ColorMode;
bool _isAmiga;
+ Common::RenderMode _renderMode;
+ uint16 *_cgaDrawCharDitheringTable;
uint8 _sjisInvisibleColor;
diff --git a/engines/kyra/screen_eob.cpp b/engines/kyra/screen_eob.cpp
index 6b1128b..aa94114 100644
--- a/engines/kyra/screen_eob.cpp
+++ b/engines/kyra/screen_eob.cpp
@@ -33,6 +33,7 @@
#include "common/system.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
namespace Kyra {
@@ -49,29 +50,66 @@ Screen_EoB::Screen_EoB(EoBCoreEngine *vm, OSystem *system) : Screen(vm, system,
_dsRem = 0;
_dsScaleTmp = 0;
_gfxMaxY = 0;
+ _egaColorMap = 0;
+ _egaPixelValueTable = 0;
+ _cgaMappingDefault = 0;
+ _cgaDitheringTables[0] = _cgaDitheringTables[1] = 0;
+ _useHiResEGADithering = false;
}
Screen_EoB::~Screen_EoB() {
delete[] _fadeData;
delete[] _dsTempPage;
+ delete[] _egaColorMap;
+ delete[] _egaPixelValueTable;
+ delete[] _cgaDitheringTables[0];
+ delete[] _cgaDitheringTables[1];
+ delete[] _cgaDrawCharDitheringTable;
}
bool Screen_EoB::init() {
if (Screen::init()) {
int temp;
_gfxMaxY = _vm->staticres()->loadRawData(kEoBBaseExpObjectY, temp);
- _fadeData = _vm->resource()->fileData("FADING.DAT", 0);
+
+ if (_renderMode != Common::kRenderCGA && _renderMode != Common::kRenderEGA)
+ _fadeData = _vm->resource()->fileData("FADING.DAT", 0);
if (!_fadeData) {
_fadeData = new uint8[0x700];
memset(_fadeData, 0, 0x700);
- uint8 *pal = _vm->resource()->fileData("palette1.pal", 0); // EGA: palette0.pal
- for (int i = 0; i < 7; i++)
- createFadeTable(pal, &_fadeData[i << 8], 18, (i + 1) * 36);
- delete[] pal;
+ if (_renderMode != Common::kRenderCGA && _renderMode != Common::kRenderEGA) {
+ uint8 *pal = _vm->resource()->fileData("PALETTE1.PAL", 0);
+ for (int i = 0; i < 7; i++)
+ createFadeTable(pal, &_fadeData[i << 8], 18, (i + 1) * 36);
+ delete[] pal;
+ }
}
_dsTempPage = new uint8[6000];
+ if (_renderMode == Common::kRenderEGA) {
+ _egaColorMap = new uint8[256];
+ _egaPixelValueTable = new uint8[256];
+ for (int i = 0; i < 256; i++) {
+ _egaColorMap[i] = i & 0x0f;
+ _egaPixelValueTable[i] = i & 0x0f;
+ }
+
+ if (_vm->game() == GI_EOB2)
+ _useHiResEGADithering = true;
+ } else if (_renderMode == Common::kRenderCGA) {
+ _cgaMappingDefault = _vm->staticres()->loadRawData(kEoB1CgaMappingDefault, temp);
+ _cgaDitheringTables[0] = new uint16[256];
+ memset(_cgaDitheringTables[0], 0, 256 * sizeof(uint16));
+ _cgaDitheringTables[1] = new uint16[256];
+ memset(_cgaDitheringTables[1], 0, 256 * sizeof(uint16));
+ _cgaDrawCharDitheringTable = new uint16[256];
+ memset(_cgaDrawCharDitheringTable, 0, 256 * sizeof(uint16));
+
+ static const uint bits[] = { 0, 3, 12, 15 };
+ for (int i = 0; i < 256; i++)
+ WRITE_BE_UINT16(&_cgaDrawCharDitheringTable[i], (bits[i & 3] << 8) | (bits[(i >> 2) & 3] << 12) | (bits[(i >> 4) & 3] << 0) | (bits[(i >> 6) & 3] << 4));
+ }
return true;
}
@@ -121,12 +159,13 @@ void Screen_EoB::printShadedText(const char *string, int x, int y, int col1, int
}
void Screen_EoB::loadShapeSetBitmap(const char *file, int tempPage, int destPage) {
- loadEoBBitmap(file, 0, tempPage, destPage, -1);
+ loadEoBBitmap(file, _cgaMappingDefault, tempPage, destPage, -1);
_curPage = 2;
}
-void Screen_EoB::loadEoBBitmap(const char *file, const uint8 *ditheringData, int tempPage, int destPage, int copyToPage) {
- Common::String tmp = Common::String::format("%s.CPS", file);
+void Screen_EoB::loadEoBBitmap(const char *file, const uint8 *cgaMapping, int tempPage, int destPage, int convertToPage) {
+ const char *filePattern = (_vm->game() == GI_EOB1 && (_renderMode == Common::kRenderEGA || _renderMode == Common::kRenderCGA)) ? "%s.EGA" : "%s.CPS";
+ Common::String tmp = Common::String::format(filePattern, file);
Common::SeekableReadStream *s = _vm->resource()->createReadStream(tmp);
bool loadAlternative = false;
if (s) {
@@ -149,28 +188,124 @@ void Screen_EoB::loadEoBBitmap(const char *file, const uint8 *ditheringData, int
tmp.setChar('X', 0);
s = _vm->resource()->createReadStream(tmp);
if (!s)
- error("Screen_EoB::loadEoBBitmap(): CPS file loading failed.");
+ error("Screen_EoB::loadEoBBitmap(): Failed to load file '%s'", file);
s->seek(768);
loadFileDataToPage(s, destPage, 64000);
delete s;
}
}
- if (copyToPage == -1) {
+ if (convertToPage == -1) {
return;
- } else if (copyToPage == 0) {
- copyPage(destPage, 2);
+ } else if (convertToPage == 2 && _renderMode == Common::kRenderCGA) {
+ convertPage(destPage, 4, cgaMapping);
+ copyRegion(0, 0, 0, 0, 320, 200, 4, 2, Screen::CR_NO_P_CHECK);
+ } else if (convertToPage == 0) {
+ convertPage(destPage, 2, cgaMapping);
copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
} else {
- copyPage(destPage, copyToPage);
+ convertPage(destPage, convertToPage, cgaMapping);
+ }
+}
+
+void Screen_EoB::convertPage(int srcPage, int dstPage, const uint8 *cgaMapping) {
+ uint8 *src = getPagePtr(srcPage);
+ uint8 *dst = getPagePtr(dstPage);
+ if (src == dst)
+ return;
+
+ if (_renderMode == Common::kRenderCGA) {
+ generateCGADitheringTables(cgaMapping);
+ uint16 *d = (uint16*)dst;
+ uint8 tblSwitch = 0;
+ for (int height = SCREEN_H; height; height--) {
+ const uint16 *table = _cgaDitheringTables[(tblSwitch++) & 1];
+ for (int width = SCREEN_W / 2; width; width--) {
+ *d++ = table[((src[0] & 0x0f) << 4) | (src[1] & 0x0f)];
+ src += 2;
+ }
+ }
+
+ if (dstPage == 0 || dstPage == 1)
+ _forceFullUpdate = true;
+
+ } else if (_renderMode == Common::kRenderEGA) {
+ uint32 len = SCREEN_W * SCREEN_H;
+ if (_useHiResEGADithering) {
+ while (len--) {
+ uint8 col = _egaColorMap[*src++] & 0x0f;
+ *dst++ = col;
+
+ /*for (int i = 4; i; i--) {
+ uint8 col = _egaColorMap[*src++];
+
+ }*/
+ }
+ } else {
+ while (len--)
+ *dst++ = *src++ & 0x0f;
+ }
+
+ if (dstPage == 0 || dstPage == 1)
+ _forceFullUpdate = true;
+ } else {
+ copyPage(srcPage, dstPage);
+ }
+}
+
+void Screen_EoB::setScreenPalette(const Palette &pal) {
+ if (_renderMode == Common::kRenderEGA && _egaColorMap && pal.getNumColors() != 16) {
+ const uint8 *src = pal.getData();
+ uint8 *dst = _egaColorMap;
+
+ for (int i = 256; i; i--) {
+ uint8 r = *src++;
+ uint8 g = *src++;
+ uint8 b = *src++;
+
+ uint8 col = 0;
+ uint16 min = 11907;
+
+ for (int ii = 256; ii; ii--) {
+ const uint8 *palEntry = _egaMatchTable + (ii - 1) * 3;
+ if (*palEntry == 0xff)
+ continue;
+
+ int e_r = palEntry[0];
+ e_r -= r;
+ int e_g = palEntry[1];
+ e_g -= g;
+ int e_b = palEntry[2];
+ e_b -= b;
+
+ int s = (e_r * e_r) + (e_g * e_g) + (e_b * e_b);
+
+ if (s < min) {
+ min = s;
+ col = ii - 1;
+ }
+ }
+ *dst++ = col;
+ }
+
+ memset(_egaPixelValueTable, 0, 256);
+ for (int i = 0; i < 256; i++)
+ _egaPixelValueTable[_egaColorMap[i]] = i;
+
+ } else if (_renderMode == Common::kRenderEGA) {
+ _screenPalette->copy(pal);
+ _system->getPaletteManager()->setPalette(_screenPalette->getData(), 0, _screenPalette->getNumColors());
+
+ } else if (_renderMode != Common::kRenderCGA) {
+ Screen::setScreenPalette(pal);
}
}
-uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4bitEncoding) {
+uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4bitEncoding, const uint8 *cgaMapping) {
uint8 *shp = 0;
uint16 shapesize = 0;
- uint8 *srcPage = getPagePtr(_curPage) + y * 320 + (x << 3);
+ uint8 *srcPage = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
uint8 *src = srcPage;
if (no4bitEncoding) {
@@ -206,7 +341,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4b
*dst++ = (w & 0xff);
*dst++ = (h & 0xff);
- srcPage = getPagePtr(_curPage) + y * 320 + (x << 3);
+ srcPage = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
src = srcPage;
h1 = h;
@@ -255,7 +390,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4b
uint8 *pal = dst;
dst += 0x10;
- srcPage = getPagePtr(_curPage) + y * 320 + (x << 3);
+ srcPage = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
src = srcPage;
nib = col = 0;
@@ -1096,12 +1231,74 @@ bool Screen_EoB::posWithinRect(int posX, int posY, int x1, int y1, int x2, int y
return true;
}
-OldDOSFont::OldDOSFont() {
+void Screen_EoB::generateCGADitheringTables(const uint8 *mappingData) {
+ for (int i = 0; i < 256; i++) {
+ WRITE_BE_UINT16(&_cgaDitheringTables[0][i], (mappingData[i >> 4] << 8) | mappingData[(i & 0x0f) + 16]);
+ WRITE_BE_UINT16(&_cgaDitheringTables[1][i], (mappingData[(i >> 4) + 16] << 8) | mappingData[i & 0x0f]);
+ }
+}
+
+const uint8 Screen_EoB::_egaMatchTable[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x1E, 0x00, 0x00, 0x1E, 0x1E, 0x1E, 0x00, 0x00, 0x1E,
+ 0x00, 0x1E, 0x1E, 0x0F, 0x00, 0x1E, 0x1E, 0x1E, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x2D, 0x0F, 0x2D,
+ 0x0F, 0x0F, 0x2D, 0x2D, 0x2D, 0x0F, 0x0F, 0x2D, 0x0F, 0x2D, 0x2D, 0x2D, 0x0F, 0x2D, 0x2D, 0x2D,
+ 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x2A, 0x00, 0x1E, 0x1E, 0x00, 0x1E, 0x2A, 0x1E, 0x00, 0x1E, 0x1E,
+ 0x00, 0x2A, 0x1E, 0x0F, 0x1E, 0x1E, 0x1E, 0x2A, 0x0F, 0x0F, 0x21, 0x0F, 0x0F, 0x36, 0x0F, 0x2D,
+ 0x21, 0x0F, 0x2D, 0x36, 0x2D, 0x0F, 0x21, 0x2D, 0x0F, 0x36, 0x2D, 0x2D, 0x21, 0x2D, 0x2D, 0x36,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x2A, 0x00, 0x00, 0x2A, 0x1E, 0x1E, 0x1E, 0x00, 0x1E,
+ 0x1E, 0x1E, 0x1E, 0x21, 0x00, 0x1E, 0x2A, 0x1E, 0x0F, 0x21, 0x0F, 0x0F, 0x21, 0x2D, 0x0F, 0x36,
+ 0x0F, 0x0F, 0x36, 0x2D, 0x2D, 0x21, 0x0F, 0x2D, 0x21, 0x2D, 0x2D, 0x36, 0x0F, 0x2D, 0x36, 0x2D,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x2A, 0x2A, 0x1E, 0x1E, 0x1E, 0x1E,
+ 0x1E, 0x2A, 0x1E, 0x21, 0x1E, 0x1E, 0x2A, 0x2A, 0x0F, 0x21, 0x21, 0x0F, 0x21, 0x36, 0x0F, 0x36,
+ 0x21, 0x0F, 0x36, 0x36, 0x2D, 0x21, 0x21, 0x2D, 0x21, 0x36, 0x2D, 0x36, 0x21, 0x2D, 0x36, 0x36,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2A, 0x00, 0x00, 0x2A,
+ 0x00, 0x1E, 0x2A, 0x0F, 0x00, 0x2A, 0x1E, 0x1E, 0x21, 0x0F, 0x0F, 0x21, 0x0F, 0x2D, 0x21, 0x2D,
+ 0x0F, 0x21, 0x2D, 0x2D, 0x36, 0x0F, 0x0F, 0x36, 0x0F, 0x2D, 0x36, 0x2D, 0x0F, 0x36, 0x2D, 0x2D,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2A,
+ 0x00, 0x2A, 0x2A, 0x0F, 0x1E, 0x2A, 0x1E, 0x2A, 0x21, 0x0F, 0x21, 0x21, 0x0F, 0x36, 0x21, 0x2D,
+ 0x21, 0x21, 0x2D, 0x36, 0x36, 0x0F, 0x21, 0x36, 0x0F, 0x36, 0x36, 0x2D, 0x21, 0x36, 0x2D, 0x36,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x2A, 0x15, 0x00, 0x2A, 0x21, 0x1E, 0x21, 0x15, 0x0F, 0x21, 0x15, 0x2D, 0x21, 0x2F,
+ 0x0F, 0x21, 0x2F, 0x2D, 0x36, 0x15, 0x0F, 0x36, 0x15, 0x2D, 0x36, 0x2F, 0x0F, 0x36, 0x2F, 0x2D,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2A, 0x2A, 0x2A, 0x21, 0x21, 0x21, 0x21, 0x21, 0x36, 0x21, 0x36,
+ 0x21, 0x21, 0x36, 0x36, 0x36, 0x21, 0x21, 0x36, 0x21, 0x36, 0x36, 0x36, 0x21, 0x36, 0x36, 0x36,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x15, 0x15, 0x15, 0x15, 0x15, 0x2F, 0x15, 0x2F,
+ 0x15, 0x15, 0x2F, 0x2F, 0x2F, 0x15, 0x15, 0x2F, 0x15, 0x2F, 0x2F, 0x2F, 0x15, 0x2F, 0x2F, 0x2F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x15, 0x15, 0x3F, 0x15, 0x2F,
+ 0x2F, 0x15, 0x2F, 0x3F, 0x2F, 0x15, 0x2F, 0x2F, 0x15, 0x3F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x3F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x15, 0x3F,
+ 0x15, 0x15, 0x3F, 0x2F, 0x2F, 0x2F, 0x15, 0x2F, 0x2F, 0x2F, 0x2F, 0x3F, 0x15, 0x2F, 0x3F, 0x2F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x15, 0x3F, 0x3F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x3F, 0x2F, 0x3F, 0x2F, 0x2F, 0x3F, 0x3F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x15, 0x15, 0x3F, 0x15, 0x2F, 0x3F, 0x2F, 0x15, 0x3F, 0x2F, 0x2F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x15, 0x3F, 0x3F, 0x2F, 0x2F, 0x3F, 0x2F, 0x3F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0x15, 0x3F, 0x3F, 0x2F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0x3F
+};
+
+OldDOSFont::OldDOSFont(Common::RenderMode mode, const uint16 *cgaDitheringTable) : _renderMode(mode), _cgaDitheringTable(cgaDitheringTable) {
_data = 0;
_width = _height = _numGlyphs = 0;
_bitmapOffsets = 0;
}
+OldDOSFont::~OldDOSFont() {
+ unload();
+}
+
bool OldDOSFont::load(Common::SeekableReadStream &file) {
unload();
@@ -1192,36 +1389,87 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
uint8 color1 = _colorMap[1];
uint8 color2 = _colorMap[0];
+ static const uint16 cgaColorMask[] = { 0, 0x5555, 0xAAAA, 0xFFFF };
+ uint16 cgaMask1 = cgaColorMask[color1 & 3];
+ uint16 cgaMask2 = cgaColorMask[color2 & 3];
+
int cH = _height;
while (cH--) {
int cW = w;
+ uint8 last = 0;
const uint8 *mtbl = _width == 8 ? renderMaskTable8 : renderMaskTable6;
- for (bool runWidthLoop = true; runWidthLoop;) {
+ if (_renderMode == Common::kRenderCGA) {
uint8 s = *src++;
uint8 m = *mtbl++;
- for (uint8 i = 0x80; i; i >>= 1) {
- if (!(m & i)) {
- runWidthLoop = false;
- break;
- }
+ uint8 in = s | last;
+ uint16 cmp1 = 0;
+ uint16 cmp2 = 0;
+
+ if (color1) {
+ in &= m;
+ cmp1 = _cgaDitheringTable[in];
+ }
- if (s & i) {
- if (color1)
- *dst = color1;
- } else if (color2) {
- *dst = color2;
- }
- dst++;
+ if (color2) {
+ in = ~in & m;
+ cmp2 = _cgaDitheringTable[in];
}
- if (cW)
- cW--;
- else
- runWidthLoop = false;
- }
+ uint16 cDst = 0;
+ uint8 sh = 14;
+ for (int i = 0; i < _width; i++) {
+ cDst |= ((dst[i] & 3) << sh);
+ sh -= 2;
+ }
+ uint16 out = (~(cmp1 | cmp2) & cDst) | (cmp1 & cgaMask1) | (cmp2 & cgaMask2);
+
+ sh = 14;
+ for (int i = 0; i < _width; i++) {
+ *dst++ = (out >> sh) & 3;
+ sh -= 2;
+ }
+
+ last = s;
+ } else {
+ for (bool runWidthLoop = true; runWidthLoop;) {
+ uint8 s = *src++;
+ uint8 m = *mtbl++;
+
+ for (uint8 i = 0x80; i; i >>= 1) {
+ if (!(m & i)) {
+ runWidthLoop = false;
+ break;
+ }
+
+ if (_renderMode == Common::kRenderCGA) {
+ uint8 in = s | last;
+ if (s & i) {
+ if (color1)
+ *dst = color1;
+ } else if (color2) {
+ *dst = color2;
+ }
+ last = s;
+ } else {
+ if (s & i) {
+ if (color1)
+ *dst = color1;
+ } else if (color2) {
+ *dst = color2;
+ }
+ }
+ dst++;
+ }
+
+ if (cW)
+ cW--;
+ else
+ runWidthLoop = false;
+ }
+ }
dst += pitch;
}
}
diff --git a/engines/kyra/screen_eob.h b/engines/kyra/screen_eob.h
index 7040177..1b55806 100644
--- a/engines/kyra/screen_eob.h
+++ b/engines/kyra/screen_eob.h
@@ -45,10 +45,14 @@ public:
void loadFileDataToPage(Common::SeekableReadStream *s, int pageNum, uint32 size);
void printShadedText(const char *string, int x, int y, int col1, int col2);
- void loadEoBBitmap(const char *file, const uint8 *ditheringData, int tempPage, int destPage, int copyToPage);
+ void loadEoBBitmap(const char *file, const uint8 *cgaMapping, int tempPage, int destPage, int convertToPage);
void loadShapeSetBitmap(const char *file, int tempPage, int destPage);
- uint8 *encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4bitEncoding = false);
+ void convertPage(int srcPage, int dstPage, const uint8 *cgaMapping);
+
+ void setScreenPalette(const Palette &pal);
+
+ uint8 *encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4bitEncoding = false, const uint8 *cgaMapping = 0);
void drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int sd = -1, int flags = 0, ...);
const uint8 *scaleShape(const uint8 *shapeData, int blockDistance);
const uint8 *scaleShapeStep(const uint8 *shp);
@@ -77,6 +81,8 @@ private:
void scaleShapeProcessLine(uint8 *&dst, const uint8 *&src);
bool posWithinRect(int posX, int posY, int x1, int y1, int x2, int y2);
+ void generateCGADitheringTables(const uint8 *mappingData);
+
int _dsDiv, _dsRem, _dsScaleTmp;
int16 _gfxX, _gfxY;
uint8 _gfxCol;
@@ -90,6 +96,14 @@ private:
uint8 *_dsTempPage;
+ uint16 *_cgaDitheringTables[2];
+ const uint8 *_cgaMappingDefault;
+
+ uint8 *_egaColorMap;
+ uint8 *_egaPixelValueTable;
+ bool _useHiResEGADithering;
+
+ static const uint8 _egaMatchTable[];
static const ScreenDim _screenDimTable[];
static const int _screenDimTableCount;
};
diff --git a/engines/kyra/sequences_darkmoon.cpp b/engines/kyra/sequences_darkmoon.cpp
index f0d4a01..d4f5c84 100644
--- a/engines/kyra/sequences_darkmoon.cpp
+++ b/engines/kyra/sequences_darkmoon.cpp
@@ -41,11 +41,22 @@ public:
kFinale
};
- DarkmoonSequenceHelper(OSystem *system, DarkMoonEngine *vm, Screen_EoB *screen, Mode mode, const char *const *strings, const char *const *cpsFiles, const char *const *palFiles, const EoBShapeDef **shapeDefList, const EoBSequenceStep **seqList);
+ struct Config {
+ Config(Mode m, const char *const *str, const char *const *cps, const char *const *pal, const DarkMoonShapeDef **shp, const DarkMoonAnimCommand **anim, bool paletteFading) : mode(m), strings(str), cpsFiles(cps), palFiles(pal), shapeDefs(shp), animData(anim), palFading(paletteFading) {}
+ Mode mode;
+ const char *const *strings;
+ const char *const *cpsFiles;
+ const char *const *palFiles;
+ const DarkMoonShapeDef **shapeDefs;
+ const DarkMoonAnimCommand **animData;
+ bool palFading;
+ };
+
+ DarkmoonSequenceHelper(OSystem *system, DarkMoonEngine *vm, Screen_EoB *screen, const Config *config);
~DarkmoonSequenceHelper();
void loadScene(int index, int pageNum);
- void runSequence(int index, int del = -1);
+ void animCommand(int index, int del = -1);
void printText(int index, int color);
void fadeText();
@@ -68,13 +79,7 @@ private:
OSystem *_system;
DarkMoonEngine *_vm;
Screen_EoB *_screen;
- Mode _mode;
-
- const char *const *_strings;
- const char *const *_cpsFiles;
- const char *const *_palFiles;
- const EoBShapeDef **_shapeDefs;
- const EoBSequenceStep **_seqData;
+ const Config *_config;
Palette *_palettes[12];
@@ -103,10 +108,14 @@ int DarkMoonEngine::mainMenu() {
_screen->loadFileDataToPage(s, 3, 64000);
delete s;
} else {
- _screen->loadBitmap("MENU.CPS", 3, 2, &_screen->getPalette(0));
+ _screen->loadBitmap("MENU.CPS", 3, 3, &_screen->getPalette(0));
}
+ if (_configRenderMode == Common::kRenderEGA)
+ _screen->loadPalette("MENU.EGA", _screen->getPalette(0));
+
_screen->setScreenPalette(_screen->getPalette(0));
+ _screen->convertPage(3, 2, 0);
of = _screen->setFont(Screen::FID_6_FNT);
op = _screen->setCurPage(2);
@@ -167,7 +176,8 @@ int DarkMoonEngine::mainMenuLoop() {
}
void DarkMoonEngine::seq_playIntro() {
- DarkmoonSequenceHelper sq(_system, this, _screen, DarkmoonSequenceHelper::kIntro, _introStrings, _cpsFilesIntro, _palFilesIntro, _shapesIntro, _seqIntro);
+ DarkmoonSequenceHelper::Config config(DarkmoonSequenceHelper::kIntro, _introStrings, _cpsFilesIntro, _configRenderMode == Common::kRenderEGA ? _palFilesIntroEGA : _palFilesIntroVGA, _shapesIntro, _animIntro, false);
+ DarkmoonSequenceHelper sq(_system, this, _screen, &config);
_screen->setCurPage(0);
_screen->clearCurPage();
@@ -192,24 +202,24 @@ void DarkMoonEngine::seq_playIntro() {
removeInputTop();
sq.delay(18);
- sq.runSequence(3, 18);
- sq.runSequence(6, 18);
- sq.runSequence(0);
+ sq.animCommand(3, 18);
+ sq.animCommand(6, 18);
+ sq.animCommand(0);
sq.waitForSongNotifier(1);
- sq.runSequence(11);
- sq.runSequence(7, 6);
- sq.runSequence(2, 6);
+ sq.animCommand(_configRenderMode == Common::kRenderEGA ? 12 : 11);
+ sq.animCommand(7, 6);
+ sq.animCommand(2, 6);
sq.waitForSongNotifier(2);
- sq.runSequence(38);
- sq.runSequence(3);
- sq.runSequence(8);
- sq.runSequence(1, 10);
- sq.runSequence(0, 6);
- sq.runSequence(2);
+ sq.animCommand(_configRenderMode == Common::kRenderEGA ? 39 : 38);
+ sq.animCommand(3);
+ sq.animCommand(8);
+ sq.animCommand(1, 10);
+ sq.animCommand(0, 6);
+ sq.animCommand(2);
sq.waitForSongNotifier(3);
@@ -218,22 +228,22 @@ void DarkMoonEngine::seq_playIntro() {
_screen->setClearScreenDim(17);
_screen->setCurPage(0);
- sq.runSequence(40);
- sq.runSequence(7, 18);
+ sq.animCommand(_configRenderMode == Common::kRenderEGA ? 41 : 40);
+ sq.animCommand(7, 18);
sq.printText(0, 16); // You were settling...
- sq.runSequence(7, 90);
+ sq.animCommand(7, 90);
sq.fadeText();
sq.printText(1, 16); // Then a note was slipped to you
- sq.runSequence(8);
- sq.runSequence(2, 72);
+ sq.animCommand(8);
+ sq.animCommand(2, 72);
sq.fadeText();
sq.printText(2, 16); // It was from your friend Khelben Blackstaff...
- sq.runSequence(2);
- sq.runSequence(6, 36);
- sq.runSequence(3);
+ sq.animCommand(2);
+ sq.animCommand(6, 36);
+ sq.animCommand(3);
sq.fadeText();
sq.printText(3, 16); // The message was urgent.
@@ -243,19 +253,33 @@ void DarkMoonEngine::seq_playIntro() {
// intro scroll
if (!skipFlag() && !shouldQuit()) {
- for (int i = 0; i < 280; i += 3) {
- uint32 endtime = _system->getMillis() + _tickLength;
- _screen->copyRegion(11, 8, 8, 8, 301, 128, 0, 0, Screen::CR_NO_P_CHECK);
- _screen->copyRegion(i, 0, 309, 8, 3, 128, 2, 0, Screen::CR_NO_P_CHECK);
- _screen->updateScreen();
- if (i == 96)
- sq.runSequence(42);
- delayUntil(endtime);
+ if (_configRenderMode == Common::kRenderEGA) {
+ for (int i = 0; i < 35; i++) {
+ uint32 endtime = _system->getMillis() + 2 * _tickLength;
+ _screen->copyRegion(16, 8, 8, 8, 296, 128, 0, 0, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(i << 3, 0, 304, 8, 8, 128, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ if (i == 12)
+ sq.animCommand(42);
+ else if (i == 25)
+ snd_playSoundEffect(11);
+ delayUntil(endtime);
+ }
+ } else {
+ for (int i = 0; i < 280; i += 3) {
+ uint32 endtime = _system->getMillis() + _tickLength;
+ _screen->copyRegion(11, 8, 8, 8, 301, 128, 0, 0, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(i, 0, 309, 8, 3, 128, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ if (i == 96)
+ sq.animCommand(42);
+ delayUntil(endtime);
+ }
}
}
_screen->copyRegion(8, 8, 0, 0, 304, 128, 0, 2, Screen::CR_NO_P_CHECK);
- sq.runSequence(4);
+ sq.animCommand(4);
sq.fadeText();
sq.delay(10);
@@ -268,22 +292,22 @@ void DarkMoonEngine::seq_playIntro() {
sq.loadScene(3, 2);
sq.delay(54);
- sq.runSequence(13);
+ sq.animCommand(13);
_screen->copyRegion(104, 16, 96, 8, 120, 100, 0, 2, Screen::CR_NO_P_CHECK);
sq.fadeText();
sq.printText(5, 15); // Welcome, please come in
- sq.runSequence(10);
- sq.runSequence(10);
- sq.runSequence(9);
- sq.runSequence(9);
+ sq.animCommand(10);
+ sq.animCommand(10);
+ sq.animCommand(9);
+ sq.animCommand(9);
sq.fadeText();
sq.printText(6, 15); // Khelben awaits you in his study
for (int i = 0; i < 3; i++)
- sq.runSequence(10);
- sq.runSequence(9);
- sq.runSequence(14);
+ sq.animCommand(10);
+ sq.animCommand(9);
+ sq.animCommand(14);
sq.loadScene(5, 2);
sq.waitForSongNotifier(5);
@@ -293,45 +317,50 @@ void DarkMoonEngine::seq_playIntro() {
_screen->updateScreen();
for (int i = 0; i < 6; i++)
- sq.runSequence(15);
+ sq.animCommand(15);
+
+ if (_configRenderMode == Common::kRenderEGA && !skipFlag() && !shouldQuit()) {
+ _screen->loadPalette("INTRO.EGA", _screen->getPalette(0));
+ _screen->setScreenPalette(_screen->getPalette(0));
+ }
sq.loadScene(6, 2);
sq.loadScene(7, 2);
_screen->clearCurPage();
sq.update(2);
- sq.runSequence(16);
+ sq.animCommand(16);
sq.printText(7, 15); // Thank you for coming so quickly
- sq.runSequence(16);
- sq.runSequence(17);
+ sq.animCommand(16);
+ sq.animCommand(17);
for (int i = 0; i < 3; i++)
- sq.runSequence(16);
+ sq.animCommand(16);
sq.fadeText();
- sq.runSequence(16);
+ sq.animCommand(16);
sq.loadScene(8, 2);
sq.update(2);
- sq.runSequence(32);
+ sq.animCommand(32);
sq.printText(8, 15); // I am troubled my friend
- sq.runSequence(33);
- sq.runSequence(33);
+ sq.animCommand(33);
+ sq.animCommand(33);
for (int i = 0; i < 4; i++)
- sq.runSequence(32);
+ sq.animCommand(32);
sq.fadeText();
sq.printText(9, 15); // Ancient evil stirs in the Temple Darkmoon
- sq.runSequence(33);
- sq.runSequence(43);
- sq.runSequence(33);
+ sq.animCommand(33);
+ sq.animCommand(43);
+ sq.animCommand(33);
for (int i = 0; i < 3; i++)
- sq.runSequence(32);
+ sq.animCommand(32);
sq.fadeText();
sq.printText(10, 15); // I fear for the safety of our city
for (int i = 0; i < 4; i++)
- sq.runSequence(33);
- sq.runSequence(32);
- sq.runSequence(32);
+ sq.animCommand(33);
+ sq.animCommand(32);
+ sq.animCommand(32);
sq.loadScene(9, 2);
sq.fadeText();
@@ -339,67 +368,67 @@ void DarkMoonEngine::seq_playIntro() {
sq.waitForSongNotifier(6);
sq.update(2);
- sq.runSequence(34);
+ sq.animCommand(34);
sq.printText(11, 15); // I need your help
for (int i = 0; i < 3; i++)
- sq.runSequence(34);
- sq.runSequence(35);
+ sq.animCommand(34);
+ sq.animCommand(35);
for (int i = 0; i < 4; i++)
- sq.runSequence(34);
+ sq.animCommand(34);
sq.fadeText();
sq.loadScene(12, 2);
sq.update(2);
sq.loadScene(6, 2);
- sq.runSequence(18);
+ sq.animCommand(18);
sq.printText(12, 15); // Three nights ago I sent forth a scout
- sq.runSequence(19);
- sq.runSequence(20);
- sq.runSequence(22);
- sq.runSequence(19);
- sq.runSequence(20);
- sq.runSequence(18);
+ sq.animCommand(19);
+ sq.animCommand(20);
+ sq.animCommand(22);
+ sq.animCommand(19);
+ sq.animCommand(20);
+ sq.animCommand(18);
sq.fadeText();
sq.printText(13, 15); // She has not yet returned
- sq.runSequence(20);
- sq.runSequence(19);
- sq.runSequence(23);
- sq.runSequence(24);
- sq.runSequence(20);
- sq.runSequence(19);
- sq.runSequence(17);
- sq.runSequence(18);
+ sq.animCommand(20);
+ sq.animCommand(19);
+ sq.animCommand(23);
+ sq.animCommand(24);
+ sq.animCommand(20);
+ sq.animCommand(19);
+ sq.animCommand(17);
+ sq.animCommand(18);
sq.fadeText();
sq.printText(14, 15); // I fear for her safety
- sq.runSequence(19);
- sq.runSequence(20);
- sq.runSequence(20);
- sq.runSequence(18);
- sq.runSequence(25);
- sq.runSequence(18);
- sq.runSequence(18);
+ sq.animCommand(19);
+ sq.animCommand(20);
+ sq.animCommand(20);
+ sq.animCommand(18);
+ sq.animCommand(25);
+ sq.animCommand(18);
+ sq.animCommand(18);
sq.fadeText();
- sq.runSequence(18);
- sq.runSequence(18);
+ sq.animCommand(18);
+ sq.animCommand(18);
sq.printText(15, 15); // Take this coin
- sq.runSequence(28);
- sq.runSequence(19);
- sq.runSequence(20);
- sq.runSequence(18);
- sq.runSequence(18);
+ sq.animCommand(28);
+ sq.animCommand(19);
+ sq.animCommand(20);
+ sq.animCommand(18);
+ sq.animCommand(18);
sq.fadeText();
sq.loadScene(10, 2);
_screen->clearCurPage();
_screen->updateScreen();
- sq.runSequence(37, 18);
- sq.runSequence(36, 36);
+ sq.animCommand(37, 18);
+ sq.animCommand(36, 36);
sq.loadScene(12, 2);
_screen->clearCurPage();
@@ -407,44 +436,44 @@ void DarkMoonEngine::seq_playIntro() {
sq.loadScene(11, 2);
sq.printText(16, 15); // I will use it to contact you
- sq.runSequence(19);
- sq.runSequence(20);
- sq.runSequence(20);
- sq.runSequence(18);
- sq.runSequence(18);
+ sq.animCommand(19);
+ sq.animCommand(20);
+ sq.animCommand(20);
+ sq.animCommand(18);
+ sq.animCommand(18);
sq.fadeText();
sq.printText(17, 15); // You must act quickly
- sq.runSequence(19);
- sq.runSequence(20);
- sq.runSequence(19);
- sq.runSequence(18);
- sq.runSequence(18);
+ sq.animCommand(19);
+ sq.animCommand(20);
+ sq.animCommand(19);
+ sq.animCommand(18);
+ sq.animCommand(18);
sq.fadeText();
- sq.runSequence(18);
+ sq.animCommand(18);
sq.printText(18, 15); // I will teleport you near Darkmoon
- sq.runSequence(20);
- sq.runSequence(27);
- sq.runSequence(20);
- sq.runSequence(19);
- sq.runSequence(18);
- sq.runSequence(18);
+ sq.animCommand(20);
+ sq.animCommand(27);
+ sq.animCommand(20);
+ sq.animCommand(19);
+ sq.animCommand(18);
+ sq.animCommand(18);
sq.fadeText();
- sq.runSequence(18);
+ sq.animCommand(18);
sq.printText(19, 15); // May luck be with you my friend
- sq.runSequence(19);
- sq.runSequence(19);
- sq.runSequence(20);
- sq.runSequence(18);
+ sq.animCommand(19);
+ sq.animCommand(19);
+ sq.animCommand(20);
+ sq.animCommand(18);
sq.fadeText();
- sq.runSequence(29);
+ sq.animCommand(29);
sq.waitForSongNotifier(7);
- sq.runSequence(30);
- sq.runSequence(31);
+ sq.animCommand(30);
+ sq.animCommand(31);
sq.waitForSongNotifier(8, true);
@@ -454,17 +483,21 @@ void DarkMoonEngine::seq_playIntro() {
_screen->setScreenDim(17);
_screen->clearCurDim();
snd_playSoundEffect(14);
- sq.fadePalette(10, 1);
+
+ if (_configRenderMode != Common::kRenderEGA)
+ sq.fadePalette(10, 1);
_screen->setClearScreenDim(18);
sq.delay(6);
- sq.fadePalette(9, 1);
+ if (_configRenderMode != Common::kRenderEGA)
+ sq.fadePalette(9, 1);
_screen->clearCurPage();
}
sq.fadePalette(9, 10);
}
void DarkMoonEngine::seq_playFinale() {
- DarkmoonSequenceHelper sq(_system, this, _screen, DarkmoonSequenceHelper::kFinale, _finaleStrings, _cpsFilesFinale, _palFilesFinale, _shapesFinale, _seqFinale);
+ DarkmoonSequenceHelper::Config config(DarkmoonSequenceHelper::kFinale, _finaleStrings, _cpsFilesFinale, _configRenderMode == Common::kRenderEGA ? _palFilesFinaleEGA : _palFilesFinaleVGA, _shapesFinale, _animFinale, true);
+ DarkmoonSequenceHelper sq(_system, this, _screen, &config);
_screen->setCurPage(0);
_screen->setFont(Screen::FID_8_FNT);
@@ -485,76 +518,76 @@ void DarkMoonEngine::seq_playFinale() {
sq.loadScene(1, 2);
- sq.runSequence(0);
- sq.runSequence(0);
+ sq.animCommand(0);
+ sq.animCommand(0);
for (int i = 0; i < 3; i++)
- sq.runSequence(2);
- sq.runSequence(1);
- sq.runSequence(2);
- sq.runSequence(2);
+ sq.animCommand(2);
+ sq.animCommand(1);
+ sq.animCommand(2);
+ sq.animCommand(2);
sq.printText(0, 10); // Finally, Dran has been defeated
for (int i = 0; i < 7; i++)
- sq.runSequence(2);
+ sq.animCommand(2);
sq.fadeText();
- sq.runSequence(2);
+ sq.animCommand(2);
sq.waitForSongNotifier(1);
sq.printText(1, 10); // Suddenly, your friend Khelben appears
- sq.runSequence(4);
+ sq.animCommand(4);
for (int i = 0; i < 3; i++)
- sq.runSequence(2);
+ sq.animCommand(2);
sq.fadeText();
sq.printText(2, 15); // Greetings, my victorious friends
for (int i = 0; i < 4; i++)
- sq.runSequence(5);
- sq.runSequence(2);
- sq.runSequence(2);
+ sq.animCommand(5);
+ sq.animCommand(2);
+ sq.animCommand(2);
sq.fadeText();
- sq.runSequence(6);
+ sq.animCommand(6);
sq.printText(3, 15); // You have defeated Dran
for (int i = 0; i < 5; i++)
- sq.runSequence(5);
- sq.runSequence(2);
- sq.runSequence(2);
+ sq.animCommand(5);
+ sq.animCommand(2);
+ sq.animCommand(2);
sq.fadeText();
sq.printText(4, 15); // I did not know Dran was a dragon
for (int i = 0; i < 4; i++)
- sq.runSequence(5);
- sq.runSequence(2);
- sq.runSequence(2);
+ sq.animCommand(5);
+ sq.animCommand(2);
+ sq.animCommand(2);
sq.fadeText();
sq.printText(5, 15); // He must have been over 300 years old
for (int i = 0; i < 4; i++)
- sq.runSequence(5);
- sq.runSequence(2);
- sq.runSequence(2);
+ sq.animCommand(5);
+ sq.animCommand(2);
+ sq.animCommand(2);
sq.fadeText();
sq.printText(6, 15); // His power is gone
for (int i = 0; i < 3; i++)
- sq.runSequence(5);
- sq.runSequence(2);
- sq.runSequence(2);
+ sq.animCommand(5);
+ sq.animCommand(2);
+ sq.animCommand(2);
sq.fadeText();
sq.printText(7, 15); // But Darkmoon is still a source of great evil
for (int i = 0; i < 4; i++)
- sq.runSequence(5);
- sq.runSequence(2);
- sq.runSequence(2);
+ sq.animCommand(5);
+ sq.animCommand(2);
+ sq.animCommand(2);
sq.fadeText();
sq.printText(8, 15); // And many of his minions remain
for (int i = 0; i < 4; i++)
- sq.runSequence(5);
- sq.runSequence(2);
- sq.runSequence(2);
+ sq.animCommand(5);
+ sq.animCommand(2);
+ sq.animCommand(2);
sq.fadeText();
sq.loadScene(2, 2);
@@ -563,29 +596,32 @@ void DarkMoonEngine::seq_playFinale() {
_screen->copyRegion(8, 8, 0, 0, 304, 128, 0, 2, Screen::CR_NO_P_CHECK);
sq.printText(9, 15); // Now we must leave this place
- sq.runSequence(7);
- sq.runSequence(8);
- sq.runSequence(7);
- sq.runSequence(7, 36);
+ sq.animCommand(7);
+ sq.animCommand(8);
+ sq.animCommand(7);
+ sq.animCommand(7, 36);
sq.fadeText();
sq.printText(10, 15); // So my forces can destroy it..
for (int i = 0; i < 3; i++)
- sq.runSequence(7);
- sq.runSequence(8);
- sq.runSequence(7);
- sq.runSequence(7, 36);
- sq.runSequence(8, 18);
+ sq.animCommand(7);
+ sq.animCommand(8);
+ sq.animCommand(7);
+ sq.animCommand(7, 36);
+ sq.animCommand(8, 18);
sq.fadeText();
sq.printText(11, 15); // Follow me
- sq.runSequence(7, 18);
- sq.runSequence(9, 18);
- sq.runSequence(8, 18);
+ sq.animCommand(7, 18);
+ sq.animCommand(9, 18);
+ sq.animCommand(8, 18);
sq.fadeText();
sq.loadScene(7, 2);
- sq.copyPalette(3, 0);
+
+ if (_configRenderMode != Common::kRenderEGA)
+ sq.copyPalette(3, 0);
+
sq.loadScene(4, 2);
sq.waitForSongNotifier(2);
@@ -607,23 +643,23 @@ void DarkMoonEngine::seq_playFinale() {
snd_playSoundEffect(7);
sq.delay(8);
- sq.runSequence(10);
- sq.runSequence(13);
+ sq.animCommand(10);
+ sq.animCommand(13);
sq.initDelayedPaletteFade(4, 1);
- sq.runSequence(14);
- sq.runSequence(13);
- sq.runSequence(14);
- sq.runSequence(14);
- sq.runSequence(13);
+ sq.animCommand(14);
+ sq.animCommand(13);
+ sq.animCommand(14);
+ sq.animCommand(14);
+ sq.animCommand(13);
sq.initDelayedPaletteFade(2, 1);
- sq.runSequence(15);
- sq.runSequence(14);
- sq.runSequence(13);
- sq.runSequence(15);
- sq.runSequence(15);
- sq.runSequence(11);
+ sq.animCommand(15);
+ sq.animCommand(14);
+ sq.animCommand(13);
+ sq.animCommand(15);
+ sq.animCommand(15);
+ sq.animCommand(11);
sq.printText(13, 10); // The temple's evil is very strong
sq.delay(72);
@@ -639,22 +675,22 @@ void DarkMoonEngine::seq_playFinale() {
snd_playSoundEffect(7);
sq.delay(8);
- sq.runSequence(10);
+ sq.animCommand(10);
sq.initDelayedPaletteFade(5, 1);
- sq.runSequence(13);
- sq.runSequence(14);
- sq.runSequence(13);
- sq.runSequence(14);
- sq.runSequence(13);
- sq.runSequence(13);
- sq.runSequence(14);
- sq.runSequence(14);
- sq.runSequence(13);
- sq.runSequence(12);
+ sq.animCommand(13);
+ sq.animCommand(14);
+ sq.animCommand(13);
+ sq.animCommand(14);
+ sq.animCommand(13);
+ sq.animCommand(13);
+ sq.animCommand(14);
+ sq.animCommand(14);
+ sq.animCommand(13);
+ sq.animCommand(12);
for (int i = 0; i < 4; i++)
- sq.runSequence(16);
- sq.runSequence(17);
- sq.runSequence(18);
+ sq.animCommand(16);
+ sq.animCommand(17);
+ sq.animCommand(18);
sq.printText(15, 10); // The temple ceases to exist
sq.initDelayedPaletteFade(6, 1);
@@ -672,40 +708,43 @@ void DarkMoonEngine::seq_playFinale() {
if (!skipFlag() && !shouldQuit())
snd_playSoundEffect(6);
- if (!skipFlag() && !shouldQuit())
+ if (!skipFlag() && !shouldQuit()) {
+ if (_configRenderMode != Common::kRenderEGA)
+ sq.setPaletteWithoutTextColor(0);
_screen->crossFadeRegion(0, 0, 8, 8, 304, 128, 2, 0);
+ }
sq.delay(18);
sq.printText(16, 15); // My friends, our work is done
- sq.runSequence(20);
- sq.runSequence(19);
- sq.runSequence(19, 36);
+ sq.animCommand(20);
+ sq.animCommand(19);
+ sq.animCommand(19, 36);
if (!skipFlag() && !shouldQuit())
snd_playSoundEffect(12);
sq.fadeText();
sq.printText(17, 15); // Thank you
- sq.runSequence(19);
- sq.runSequence(20, 36);
+ sq.animCommand(19);
+ sq.animCommand(20, 36);
sq.fadeText();
sq.printText(18, 15); // You have earned my deepest respect
if (!skipFlag() && !shouldQuit())
snd_playSoundEffect(11);
- sq.runSequence(20);
- sq.runSequence(19);
- sq.runSequence(19);
+ sq.animCommand(20);
+ sq.animCommand(19);
+ sq.animCommand(19);
if (!skipFlag() && !shouldQuit())
snd_playSoundEffect(11);
sq.delay(36);
sq.fadeText();
sq.printText(19, 15); // We will remember you always
- sq.runSequence(19);
- sq.runSequence(19, 18);
+ sq.animCommand(19);
+ sq.animCommand(19, 18);
if (!skipFlag() && !shouldQuit())
snd_playSoundEffect(11);
- sq.runSequence(20, 18);
+ sq.animCommand(20, 18);
sq.fadeText();
sq.delay(28);
@@ -718,6 +757,8 @@ void DarkMoonEngine::seq_playFinale() {
_screen->copyRegion(0, 0, 8, 8, 304, 128, 2, 0, Screen::CR_NO_P_CHECK);
} else {
snd_playSoundEffect(6);
+ if (_configRenderMode != Common::kRenderEGA)
+ sq.setPaletteWithoutTextColor(0);
_screen->crossFadeRegion(0, 0, 8, 8, 304, 128, 2, 0);
}
@@ -756,8 +797,10 @@ void DarkMoonEngine::seq_playFinale() {
resetSkipFlag(true);
- sq.setPalette(11);
- sq.fadePalette(9, 10);
+ if (_configRenderMode != Common::kRenderEGA) {
+ sq.setPalette(11);
+ sq.fadePalette(9, 10);
+ }
_screen->clearCurPage();
sq.loadScene(11, 2);
@@ -912,15 +955,15 @@ void DarkMoonEngine::seq_playCredits(DarkmoonSequenceHelper *sq, const uint8 *da
delete[] items[i].str;
}
-DarkmoonSequenceHelper::DarkmoonSequenceHelper(OSystem *system, DarkMoonEngine *vm, Screen_EoB *screen, Mode mode, const char *const *strings, const char *const *cpsFiles, const char *const *palFiles, const EoBShapeDef **shapeDefList, const EoBSequenceStep **seqList) :
- _system(system), _vm(vm), _screen(screen), _mode(mode), _strings(strings), _cpsFiles(cpsFiles), _palFiles(palFiles), _shapeDefs(shapeDefList), _seqData(seqList) {
+DarkmoonSequenceHelper::DarkmoonSequenceHelper(OSystem *system, DarkMoonEngine *vm, Screen_EoB *screen, const Config *config) :
+ _system(system), _vm(vm), _screen(screen), _config(config) {
- for (int i = 0; _palFiles[i]; i++) {
+ for (int i = 0; _config->palFiles[i]; i++) {
if (i < 4)
_palettes[i] = &_screen->getPalette(i);
else
_palettes[i] = new Palette(256);
- _screen->loadPalette(_palFiles[i], *_palettes[i]);
+ _screen->loadPalette(_config->palFiles[i], *_palettes[i]);
}
_palettes[9] = new Palette(256);
@@ -946,7 +989,7 @@ DarkmoonSequenceHelper::DarkmoonSequenceHelper(OSystem *system, DarkMoonEngine *
}
DarkmoonSequenceHelper::~DarkmoonSequenceHelper() {
- for (int i = 4; _palFiles[i]; i++)
+ for (int i = 4; _config->palFiles[i]; i++)
delete _palettes[i];
delete _palettes[9];
delete _palettes[10];
@@ -967,12 +1010,22 @@ DarkmoonSequenceHelper::~DarkmoonSequenceHelper() {
void DarkmoonSequenceHelper::loadScene(int index, int pageNum) {
char file[13];
- strcpy(file, _cpsFiles[index]);
+ strcpy(file, _config->cpsFiles[index]);
Common::SeekableReadStream *s = _vm->resource()->createReadStream(file);
- if (s && file[0] != 'X') {
+ uint32 chunkID = 0;
+ if (s) {
+ chunkID = s->readUint32LE();
+ s->seek(0);
+ }
+
+ if (s && chunkID == MKTAG('F', 'O', 'R', 'M')) {
+ // The original code also handles files with FORM chunks and ILBM and PBM sub chunks. This will probably be necessary for Amiga versions.
+ // The DOS versions do not need this, but still have the code for it. We error out for now.
+ error("DarkmoonSequenceHelper::loadScene(): CPS file loading failure in scene %d - unhandled FORM chunk encountered", index);
+ } else if (s && file[0] != 'X') {
delete s;
- _screen->loadBitmap(_cpsFiles[index], pageNum | 1, pageNum | 1, _palettes[0]);
+ _screen->loadBitmap(_config->cpsFiles[index], pageNum | 1, pageNum | 1, _palettes[0]);
} else {
if (!s) {
file[0] = 'X';
@@ -982,7 +1035,7 @@ void DarkmoonSequenceHelper::loadScene(int index, int pageNum) {
if (!s)
error("DarkmoonSequenceHelper::loadScene(): CPS file loading failure in scene %d", index);
- if (_mode == kFinale)
+ if (_config->mode == kFinale)
s->read(_palettes[0]->getData(), 768);
else
s->seek(768);
@@ -992,8 +1045,8 @@ void DarkmoonSequenceHelper::loadScene(int index, int pageNum) {
int cp = _screen->setCurPage(pageNum);
- if (_shapeDefs[index]) {
- for (const EoBShapeDef *df = _shapeDefs[index]; df->w; df++) {
+ if (_config->shapeDefs[index]) {
+ for (const DarkMoonShapeDef *df = _config->shapeDefs[index]; df->w; df++) {
uint16 shapeIndex = (df->index < 0) ? df->index * -1 : df->index;
if (_shapes[shapeIndex])
delete[] _shapes[shapeIndex];
@@ -1002,20 +1055,24 @@ void DarkmoonSequenceHelper::loadScene(int index, int pageNum) {
}
_screen->setCurPage(cp);
- _screen->copyPage(pageNum | 1, pageNum);
+
+ if (_vm->_configRenderMode == Common::kRenderEGA)
+ setPalette(0);
+
+ _screen->convertPage(pageNum | 1, pageNum, 0);
if ((pageNum == 0 || pageNum == 1) && !_vm->skipFlag() && !_vm->shouldQuit())
_screen->updateScreen();
}
-void DarkmoonSequenceHelper::runSequence(int index, int del) {
+void DarkmoonSequenceHelper::animCommand(int index, int del) {
if (_vm->skipFlag() || _vm->shouldQuit())
return;
uint32 end = 0;
- for (const EoBSequenceStep *s = _seqData[index]; s->command != 0xff && !_vm->skipFlag() && !_vm->shouldQuit(); s++) {
- int palIndex = _mode == kFinale ? (s->pal + 1) : s->pal;
+ for (const DarkMoonAnimCommand *s = _config->animData[index]; s->command != 0xff && !_vm->skipFlag() && !_vm->shouldQuit(); s++) {
+ int palIndex = _config->mode == kFinale ? (s->pal + 1) : s->pal;
int x = s->x1;
int y = s->y1;
int x2 = 0;
@@ -1025,10 +1082,10 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) {
switch (s->command) {
case 0:
// flash palette
- if (s->pal)
+ if (_vm->_configRenderMode != Common::kRenderEGA && s->pal)
setPaletteWithoutTextColor(palIndex);
delay(s->delay);
- if (_mode == kIntro && s->pal)
+ if (_vm->_configRenderMode != Common::kRenderEGA && _config->mode == kIntro && s->pal)
setPaletteWithoutTextColor(0);
break;
@@ -1037,7 +1094,7 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) {
shapeW = _shapes[s->obj][2];
shapeH = _shapes[s->obj][3];
- if (_mode == kFinale) {
+ if (_config->mode == kFinale) {
_screen->setScreenDim(18);
x -= (_screen->_curDim->sx << 3);
y -= _screen->_curDim->sy;
@@ -1047,17 +1104,17 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) {
x2 = x;
}
- _screen->drawShape(0, _shapes[s->obj], x, y, _mode == kIntro ? 0 : 18);
+ _screen->drawShape(0, _shapes[s->obj], x, y, _config->mode == kIntro ? 0 : 18);
- if (s->pal)
+ if (_vm->_configRenderMode != Common::kRenderEGA && s->pal)
setPaletteWithoutTextColor(palIndex);
else
_screen->updateScreen();
delay(s->delay);
- if (_mode == kIntro) {
- if (s->pal)
+ if (_config->mode == kIntro) {
+ if (_vm->_configRenderMode != Common::kRenderEGA && s->pal)
setPaletteWithoutTextColor(0);
_screen->copyRegion(x - 8, y - 8, x, y, (shapeW + 1) << 3, shapeH, 2, 0, Screen::CR_NO_P_CHECK);
} else {
@@ -1071,50 +1128,59 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) {
// draw shape
_screen->drawShape(_screen->_curPage, _shapes[s->obj], x, y, 0);
- if (s->pal)
+ if (_vm->_configRenderMode != Common::kRenderEGA && s->pal)
setPaletteWithoutTextColor(palIndex);
else if (!_screen->_curPage)
_screen->updateScreen();
delay(s->delay);
- if (_mode == kIntro && s->pal)
+ if (_vm->_configRenderMode != Common::kRenderEGA && _config->mode == kIntro && s->pal)
setPaletteWithoutTextColor(0);
break;
case 3:
case 4:
// fade shape in or out or restore background
- if (_mode == kFinale)
+ if (_config->mode == kFinale)
break;
- _screen->setShapeFadeMode(0, true);
- _screen->setShapeFadeMode(1, true);
+ if (_vm->_configRenderMode == Common::kRenderEGA) {
+ if (palIndex)
+ _screen->drawShape(0, _shapes[s->obj], s->x1, y, 0);
+ else
+ _screen->copyRegion(s->x1 - 8, s->y1 - 8, s->x1, s->y1, (_shapes[s->obj][2] + 1) << 3, _shapes[s->obj][3], 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delay(s->delay /** 7*/);
+ } else {
+ _screen->setShapeFadeMode(0, true);
+ _screen->setShapeFadeMode(1, true);
- end = _system->getMillis() + s->delay * _vm->tickLength();
+ end = _system->getMillis() + s->delay * _vm->tickLength();
- if (palIndex) {
- _screen->setFadeTableIndex(palIndex - 1);
+ if (palIndex) {
+ _screen->setFadeTableIndex(palIndex - 1);
- _screen->copyRegion(s->x1 - 8, s->y1 - 8, 0, 0, (_shapes[s->obj][2] + 1) << 3, _shapes[s->obj][3], 2, 4, Screen::CR_NO_P_CHECK);
- _screen->drawShape(4, _shapes[s->obj], s->x1 & 7, 0, 0);
- _screen->copyRegion(0, 0, s->x1, s->y1, (_shapes[s->obj][2] + 1) << 3, _shapes[s->obj][3], 4, 0, Screen::CR_NO_P_CHECK);
- } else {
- _screen->copyRegion(s->x1 - 8, s->y1 - 8, s->x1, s->y1, (_shapes[s->obj][2] + 1) << 3, _shapes[s->obj][3], 2, 0, Screen::CR_NO_P_CHECK);
- }
- _screen->updateScreen();
+ _screen->copyRegion(s->x1 - 8, s->y1 - 8, 0, 0, (_shapes[s->obj][2] + 1) << 3, _shapes[s->obj][3], 2, 4, Screen::CR_NO_P_CHECK);
+ _screen->drawShape(4, _shapes[s->obj], s->x1 & 7, 0, 0);
+ _screen->copyRegion(0, 0, s->x1, s->y1, (_shapes[s->obj][2] + 1) << 3, _shapes[s->obj][3], 4, 0, Screen::CR_NO_P_CHECK);
+ } else {
+ _screen->copyRegion(s->x1 - 8, s->y1 - 8, s->x1, s->y1, (_shapes[s->obj][2] + 1) << 3, _shapes[s->obj][3], 2, 0, Screen::CR_NO_P_CHECK);
+ }
+ _screen->updateScreen();
- _vm->delayUntil(end);
- _screen->setShapeFadeMode(0, false);
- _screen->setShapeFadeMode(1, false);
+ _vm->delayUntil(end);
+ _screen->setShapeFadeMode(0, false);
+ _screen->setShapeFadeMode(1, false);
+ }
break;
case 5:
// copy region
- if (_mode == kFinale && s->pal)
+ if (_config->mode == kFinale && s->pal)
setPaletteWithoutTextColor(palIndex);
- _screen->copyRegion(s->x2 << 3, s->y2, s->x1, s->y1, s->w << 3, s->h, (s->obj && _mode == kFinale) ? 6 : 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(s->x2 << 3, s->y2, s->x1, s->y1, s->w << 3, s->h, (s->obj && _config->mode == kFinale) ? 6 : 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
delay(s->delay);
break;
@@ -1125,8 +1191,15 @@ void DarkmoonSequenceHelper::runSequence(int index, int del) {
_vm->snd_playSoundEffect(s->obj);
break;
+ case 7:
+ // restore background (only used in EGA mode)
+ delay(s->delay);
+ _screen->copyRegion(s->x1 - 8, s->y1 - 8, s->x1, s->y1, (_shapes[s->obj][2] + 1) << 3, _shapes[s->obj][3], 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ break;
+
default:
- error("DarkmoonSequenceHelper::runSequence(): Unknown animation opcode encountered.");
+ error("DarkmoonSequenceHelper::animCommand(): Unknown animation opcode encountered.");
break;
}
}
@@ -1140,12 +1213,17 @@ void DarkmoonSequenceHelper::printText(int index, int color) {
return;
_screen->setClearScreenDim(17);
- _palettes[0]->copy(*_palettes[0], color, 1, 255);
- setPalette(0);
+ uint8 col1 = 15;
+
+ if (_vm->_configRenderMode != Common::kRenderEGA) {
+ _palettes[0]->copy(*_palettes[0], color, 1, 255);
+ setPalette(0);
+ col1 = 255;
+ }
- char *temp = new char[strlen(_strings[index]) + 1];
+ char *temp = new char[strlen(_config->strings[index]) + 1];
char *str = temp;
- strcpy(str, _strings[index]);
+ strcpy(str, _config->strings[index]);
const ScreenDim *dm = _screen->_curDim;
@@ -1156,7 +1234,7 @@ void DarkmoonSequenceHelper::printText(int index, int color) {
*cr = 0;
uint32 len = strlen(str);
- _screen->printText(str, (dm->sx + ((dm->w - len) >> 1)) << 3, dm->sy + yOffs, 255, dm->unkA);
+ _screen->printText(str, (dm->sx + ((dm->w - len) >> 1)) << 3, dm->sy + yOffs, col1, dm->unkA);
if (cr) {
*cr = 13;
@@ -1173,8 +1251,8 @@ void DarkmoonSequenceHelper::printText(int index, int color) {
void DarkmoonSequenceHelper::fadeText() {
if (_vm->skipFlag() || _vm->shouldQuit())
return;
-
- _screen->fadeTextColor(_palettes[0], 255, 8);
+ if (_vm->_configRenderMode != Common::kRenderEGA)
+ _screen->fadeTextColor(_palettes[0], 255, 8);
_screen->clearCurDim();
}
@@ -1183,11 +1261,13 @@ void DarkmoonSequenceHelper::update(int srcPage) {
return;
_screen->copyRegion(0, 0, 8, 8, 304, 128, srcPage, 0, Screen::CR_NO_P_CHECK);
- setPaletteWithoutTextColor(0);
+
+ if (_vm->_configRenderMode != Common::kRenderEGA)
+ setPaletteWithoutTextColor(0);
}
void DarkmoonSequenceHelper::setPaletteWithoutTextColor(int index) {
- if (_vm->skipFlag() || _vm->shouldQuit())
+ if (_vm->_configRenderMode == Common::kRenderEGA || _vm->skipFlag() || _vm->shouldQuit())
return;
if (!memcmp(_palettes[11]->getData(), _palettes[index]->getData(), 765))
@@ -1198,6 +1278,7 @@ void DarkmoonSequenceHelper::setPaletteWithoutTextColor(int index) {
setPalette(11);
_screen->updateScreen();
+ _system->delayMillis(10);
}
void DarkmoonSequenceHelper::setPalette(int index) {
@@ -1207,8 +1288,12 @@ void DarkmoonSequenceHelper::setPalette(int index) {
void DarkmoonSequenceHelper::fadePalette(int index, int del) {
if (_vm->skipFlag() || _vm->shouldQuit())
return;
-
- _screen->fadePalette(*_palettes[index], del * _vm->tickLength());
+ if (_vm->_configRenderMode == Common::kRenderEGA) {
+ setPalette(index);
+ _screen->updateScreen();
+ } else {
+ _screen->fadePalette(*_palettes[index], del * _vm->tickLength());
+ }
}
void DarkmoonSequenceHelper::copyPalette(int srcIndex, int destIndex) {
@@ -1227,7 +1312,7 @@ bool DarkmoonSequenceHelper::processDelayedPaletteFade() {
if (_vm->skipFlag() || _vm->shouldQuit())
return true;
- if (!_fadePalRate || (_system->getMillis() <= _fadePalTimer))
+ if (_vm->_configRenderMode == Common::kRenderEGA || !_fadePalRate || (_system->getMillis() <= _fadePalTimer))
return false;
if (_screen->delayedFadePalStep(_palettes[_fadePalIndex], _palettes[0], _fadePalRate)) {
@@ -1246,7 +1331,7 @@ void DarkmoonSequenceHelper::delay(uint32 ticks) {
uint32 end = _system->getMillis() + ticks * _vm->_tickLength;
- if (_mode == kFinale) {
+ if (_config->palFading) {
do {
if (processDelayedPaletteFade())
break;
@@ -1263,11 +1348,11 @@ void DarkmoonSequenceHelper::waitForSongNotifier(int index, bool introUpdateAnim
int seq = 0;
while (_vm->sound()->checkTrigger() < index && !(_vm->skipFlag() || _vm->shouldQuit())) {
if (introUpdateAnim) {
- runSequence(30 | seq);
+ animCommand(30 | seq);
seq ^= 1;
}
- if (_mode == kFinale)
+ if (_config->palFading)
processDelayedPaletteFade();
_vm->updateInput();
diff --git a/engines/kyra/sequences_eob.cpp b/engines/kyra/sequences_eob.cpp
index f18c67f..195c44e 100644
--- a/engines/kyra/sequences_eob.cpp
+++ b/engines/kyra/sequences_eob.cpp
@@ -110,7 +110,8 @@ void EoBIntroPlayer::start() {
if (!_vm->shouldQuit() && !_vm->skipFlag()) {
_vm->snd_playSong(2);
- _screen->loadBitmap("TITLE-V.CMP", 5, 3, 0);
+ _screen->loadBitmap((_vm->_configRenderMode == Common::kRenderCGA || _vm->_configRenderMode == Common::kRenderEGA) ? "TITLE-E.CMP" : "TITLE-V.CMP", 3, 5, 0);
+ _screen->convertPage(5, 2, _vm->_cgaMappingDefault);
_screen->crossFadeRegion(0, 0, 0, 0, 320, 200, 2, 0);
_vm->delay(120 * _vm->_tickLength);
}
@@ -121,7 +122,8 @@ void EoBIntroPlayer::start() {
_screen->loadFileDataToPage(s, 6, s->size() - 768);
delete s;
} else {
- _screen->loadBitmap("TEXT.CMP", 3, 6, 0);
+ _screen->loadBitmap("TEXT.CMP", 3, 5, 0);
+ _screen->convertPage(5, 6, _vm->_cgaMappingAlt);
}
tower();
@@ -139,8 +141,9 @@ void EoBIntroPlayer::start() {
void EoBIntroPlayer::openingCredits() {
loadAndSetPalette(_filesOpening[5]);
+
_screen->loadBitmap(_filesOpening[4], 5, 3, 0);
- _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->convertPage(3, 0, _vm->_cgaMappingAlt);
_screen->updateScreen();
_vm->snd_playSong(1);
@@ -149,7 +152,8 @@ void EoBIntroPlayer::openingCredits() {
for (int i = 0; i < 4 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
_screen->loadBitmap(_filesOpening[i], 5, 3, 0);
uint32 nextFrameTimer = _vm->_system->getMillis() + _openingFrmDelay[i + 1] * _vm->_tickLength;
- _screen->crossFadeRegion(0, 50, 0, 50, 320, 102, 2, 0);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
+ _screen->crossFadeRegion(0, 50, 0, 50, 320, 102, 4, 0);
_vm->delayUntil(nextFrameTimer);
}
}
@@ -160,8 +164,8 @@ void EoBIntroPlayer::tower() {
_screen->loadBitmap(_filesTower[1], 5, 3, 0);
_screen->setCurPage(2);
- uint8 *shp = _screen->encodeShape(0, 0, 16, 56, true);
- _screen->copyPage(3, 4);
+ uint8 *shp = _screen->encodeShape(0, 0, 16, 56, true, _vm->_cgaMappingAlt);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
_screen->clearCurPage();
for (int i = 0; i < 200; i += 64)
@@ -236,19 +240,19 @@ void EoBIntroPlayer::orb() {
uint8 *shp[5];
_screen->loadBitmap(_filesOrb[0], 5, 3, 0);
_screen->setCurPage(2);
- shp[4] = _screen->encodeShape(0, 0, 20, 136, true);
+ shp[4] = _screen->encodeShape(0, 0, 20, 136, true, _vm->_cgaMappingAlt);
_screen->loadBitmap(_filesOrb[1], 5, 3, 0);
- shp[3] = _screen->encodeShape(16, 0, 16, 104, true);
+ shp[3] = _screen->encodeShape(16, 0, 16, 104, true, _vm->_cgaMappingAlt);
_screen->fillRect(0, 0, 127, 103, 12);
for (int i = 1; i < 4; i++) {
copyBlurRegion(128, 0, 0, 0, 128, 104, i);
- shp[3 - i] = _screen->encodeShape(0, 0, 16, 104, true);
+ shp[3 - i] = _screen->encodeShape(0, 0, 16, 104, true, _vm->_cgaMappingAlt);
}
_screen->fillRect(0, 0, 159, 135, 12);
_screen->setCurPage(0);
- _screen->copyPage(3, 4);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
_screen->clearCurPage();
_vm->snd_playSoundEffect(6);
@@ -297,14 +301,14 @@ void EoBIntroPlayer::waterdeepEntry() {
loadAndSetPalette(_filesWdEntry[0]);
_screen->loadBitmap(_filesWdEntry[1], 5, 3, 0);
_screen->setCurPage(2);
- shp[3] = _screen->encodeShape(0, 0, 20, 136, true);
+ shp[3] = _screen->encodeShape(0, 0, 20, 136, true, _vm->_cgaMappingAlt);
for (int i = 1; i < 4; i++) {
copyBlurRegion(0, 0, 0, 0, 160, 136, i);
- shp[3 - i] = _screen->encodeShape(0, 0, 20, 136, true);
+ shp[3 - i] = _screen->encodeShape(0, 0, 20, 136, true, _vm->_cgaMappingAlt);
}
_screen->setCurPage(0);
- _screen->copyPage(3, 4);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
_screen->fillRect(0, 168, 319, 199, 12, 0);
_vm->snd_playSoundEffect(6);
@@ -321,18 +325,18 @@ void EoBIntroPlayer::waterdeepEntry() {
_vm->delay(50 * _vm->_tickLength);
_screen->setCurPage(2);
- shp[0] = _screen->encodeShape(20, 0, 20, 136, true);
+ shp[0] = _screen->encodeShape(20, 0, 20, 136, true, _vm->_cgaMappingAlt);
_screen->loadBitmap(_filesWdEntry[2], 5, 3, 0);
- shp[1] = _screen->encodeShape(0, 0, 20, 136, true);
- shp[2] = _screen->encodeShape(20, 0, 20, 136, true);
+ shp[1] = _screen->encodeShape(0, 0, 20, 136, true, _vm->_cgaMappingAlt);
+ shp[2] = _screen->encodeShape(20, 0, 20, 136, true, _vm->_cgaMappingAlt);
_screen->loadBitmap(_filesWdEntry[3], 5, 3, 0);
for (int i = 0; i < 31; i++)
- shp2[i] = _screen->encodeShape(_wdEncodeX[i], 136 + (_wdEncodeY[i] << 3), _wdEncodeWH[i], _wdEncodeWH[i] << 3, true);
+ shp2[i] = _screen->encodeShape(_wdEncodeX[i], 136 + (_wdEncodeY[i] << 3), _wdEncodeWH[i], _wdEncodeWH[i] << 3, true, _vm->_cgaMappingAlt);
for (int i = 0; i < 3; i++)
- shp3[i] = _screen->encodeShape(5 * i, 152, 5, 32, true);
+ shp3[i] = _screen->encodeShape(5 * i, 152, 5, 32, true, _vm->_cgaMappingAlt);
- _screen->copyPage(3, 4);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
for (int i = 0; i < 3 && !_vm->shouldQuit() && !_vm->skipFlag(); i++) {
uint32 end = _vm->_system->getMillis() + 3 * _vm->_tickLength;
@@ -391,7 +395,7 @@ void EoBIntroPlayer::king() {
return;
_screen->loadBitmap(_filesKing[0], 5, 3, 0);
- _screen->copyPage(3, 4);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
int x = 15;
int y = 14;
@@ -428,7 +432,7 @@ void EoBIntroPlayer::king() {
_screen->loadBitmap(_filesKing[1], 5, 3, 0);
_screen->setCurPage(2);
for (int i = 0; i < 4; i++) {
- shp[i] = _screen->encodeShape(advEncX[i], 0, advEncW[i], 98, true);
+ shp[i] = _screen->encodeShape(advEncX[i], 0, advEncW[i], 98, true, _vm->_cgaMappingAlt);
dy[i] = 180 + ((_vm->_rnd.getRandomNumber(255) & 3) << 3);
stepY[i] = (i * 5) & 3;
}
@@ -477,8 +481,8 @@ void EoBIntroPlayer::hands() {
return;
_screen->setCurPage(2);
- uint8 *shp1 = _screen->encodeShape(0, 140, 21, 60, true);
- uint8 *shp2 = _screen->encodeShape(21, 140, 12, 60, true);
+ uint8 *shp1 = _screen->encodeShape(0, 140, 21, 60, true, _vm->_cgaMappingAlt);
+ uint8 *shp2 = _screen->encodeShape(21, 140, 12, 60, true, _vm->_cgaMappingAlt);
_screen->loadBitmap(_filesHands[0], 3, 5, 0);
_screen->fillRect(0, 160, 319, 199, 12, 0);
@@ -509,9 +513,9 @@ void EoBIntroPlayer::hands() {
_vm->delay(15 * _vm->_tickLength);
_screen->setCurPage(4);
- shp1 = _screen->encodeShape(17, 0, 11, 120, true);
- shp2 = _screen->encodeShape(28, 112, 1, 31, true);
- uint8 *shp3 = _screen->encodeShape(9, 138, 14, 54, true);
+ shp1 = _screen->encodeShape(17, 0, 11, 120, true, _vm->_cgaMappingAlt);
+ shp2 = _screen->encodeShape(28, 112, 1, 31, true, _vm->_cgaMappingAlt);
+ uint8 *shp3 = _screen->encodeShape(9, 138, 14, 54, true, _vm->_cgaMappingAlt);
_screen->setCurPage(2);
_screen->fillRect(0, 0, 135, 63, 157);
@@ -549,8 +553,8 @@ void EoBIntroPlayer::hands() {
_vm->delay(15 * _vm->_tickLength);
_screen->setCurPage(4);
- shp1 = _screen->encodeShape(0, 0, 17, 136, true);
- shp2 = _screen->encodeShape(0, 136, 9, 48, true);
+ shp1 = _screen->encodeShape(0, 0, 17, 136, true, _vm->_cgaMappingAlt);
+ shp2 = _screen->encodeShape(0, 136, 9, 48, true, _vm->_cgaMappingAlt);
_screen->setCurPage(2);
_screen->fillRect(0, 0, 143, 95, 157);
@@ -576,8 +580,8 @@ void EoBIntroPlayer::hands() {
_vm->delay(30 * _vm->_tickLength);
_screen->setCurPage(4);
- shp1 = _screen->encodeShape(28, 0, 11, 40, true);
- shp2 = _screen->encodeShape(28, 40, 10, 72, true);
+ shp1 = _screen->encodeShape(28, 0, 11, 40, true, _vm->_cgaMappingAlt);
+ shp2 = _screen->encodeShape(28, 40, 10, 72, true, _vm->_cgaMappingAlt);
_screen->setCurPage(2);
_screen->fillRect(0, 0, 87, 112, 157);
@@ -622,11 +626,11 @@ void EoBIntroPlayer::waterdeepExit() {
_screen->loadBitmap(_filesWdExit[0], 5, 3, 0);
_screen->setCurPage(2);
for (int i = 0; i < 31; i++)
- shp2[i] = _screen->encodeShape(_wdEncodeX[i], 136 + (_wdEncodeY[i] << 3), _wdEncodeWH[i], _wdEncodeWH[i] << 3, true);
+ shp2[i] = _screen->encodeShape(_wdEncodeX[i], 136 + (_wdEncodeY[i] << 3), _wdEncodeWH[i], _wdEncodeWH[i] << 3, true, _vm->_cgaMappingAlt);
for (int i = 0; i < 3; i++)
- shp3[i] = _screen->encodeShape(5 * i + 15, 152, 5, 32, true);
- uint8 *shp1 = _screen->encodeShape(31, 136, 5, 32, true);
- _screen->copyPage(3, 4);
+ shp3[i] = _screen->encodeShape(5 * i + 15, 152, 5, 32, true, _vm->_cgaMappingAlt);
+ uint8 *shp1 = _screen->encodeShape(31, 136, 5, 32, true, _vm->_cgaMappingAlt);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
_screen->copyRegion(0, 0, 0, 136, 48, 36, 4, 4, Screen::CR_NO_P_CHECK);
_screen->fillRect(0, 168, 319, 199, 12, 0);
_screen->copyRegion(160, 0, 80, 24, 160, 136, 4, 0, Screen::CR_NO_P_CHECK);
@@ -676,7 +680,7 @@ void EoBIntroPlayer::waterdeepExit() {
loadAndSetPalette(_filesWdExit[1]);
_screen->loadBitmap(_filesWdExit[2], 3, 5, 0);
- _screen->copyPage(5, 2);
+ _screen->convertPage(5, 2, _vm->_cgaMappingAlt);
whirlTransition();
_vm->delay(6 * _vm->_tickLength);
@@ -717,7 +721,7 @@ void EoBIntroPlayer::waterdeepExit() {
}
_screen->loadBitmap(_filesWdExit[3], 3, 5, 0);
- _screen->copyPage(5, 2);
+ _screen->convertPage(5, 2, _vm->_cgaMappingAlt);
_vm->delay(30 * _vm->_tickLength);
_screen->setCurPage(0);
_screen->fillRect(0, 16, 319, 31, 12);
@@ -733,8 +737,8 @@ void EoBIntroPlayer::tunnel() {
return;
_screen->setCurPage(4);
- uint8 *shp2 = _screen->encodeShape(20, 0, 20, 120, true);
- uint8 *shp1 = _screen->encodeShape(0, 0, 20, 120, true);
+ uint8 *shp2 = _screen->encodeShape(20, 0, 20, 120, true, _vm->_cgaMappingAlt);
+ uint8 *shp1 = _screen->encodeShape(0, 0, 20, 120, true, _vm->_cgaMappingAlt);
_vm->drawBlockObject(1, 4, shp2, 160, 0, 0);
_vm->drawBlockObject(1, 4, shp1, 0, 0, 0);
delete[] shp1;
@@ -771,7 +775,7 @@ void EoBIntroPlayer::tunnel() {
_screen->copyRegion(0, 0, 80, 32, 160, 120, 2, 0, Screen::CR_NO_P_CHECK);
_screen->loadBitmap(_filesTunnel[0], 5, 3, 0);
- _screen->copyPage(3, 4);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
_screen->updateScreen();
_vm->delay(40 * _vm->_tickLength);
@@ -808,7 +812,7 @@ void EoBIntroPlayer::tunnel() {
_vm->delay(40 * _vm->_tickLength);
_screen->loadBitmap(_filesTunnel[1], 5, 3, 0);
- _screen->copyPage(3, 4);
+ _screen->convertPage(3, 4, _vm->_cgaMappingAlt);
_vm->snd_playSoundEffect(6);
_screen->copyRegion(0, 0, 80, 32, 160, 120, 4, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
@@ -825,6 +829,8 @@ void EoBIntroPlayer::tunnel() {
}
void EoBIntroPlayer::loadAndSetPalette(const char *filename) {
+ if (_vm->_configRenderMode == Common::kRenderCGA || _vm->_configRenderMode == Common::kRenderEGA)
+ return;
_screen->loadPalette(filename, _screen->getPalette(0));
_screen->getPalette(0).fill(0, 1, 0);
_screen->setScreenPalette(_screen->getPalette(0));
@@ -975,8 +981,9 @@ int EoBEngine::mainMenu() {
while (menuChoice >= 0 && !shouldQuit()) {
switch (menuChoice) {
case 0: {
- _screen->loadPalette("EOBPAL.COL", _screen->getPalette(0));
- _screen->loadEoBBitmap("INTRO", 0, 5, 3, 2);
+ if (_configRenderMode != Common::kRenderEGA)
+ _screen->loadPalette("EOBPAL.COL", _screen->getPalette(0));
+ _screen->loadEoBBitmap("INTRO", _cgaMappingDefault, 5, 3, 2);
_screen->setScreenPalette(_screen->getPalette(0));
_screen->_curPage = 2;
of = _screen->setFont(Screen::FID_6_FNT);
@@ -984,8 +991,8 @@ int EoBEngine::mainMenu() {
_screen->printText(versionString.c_str(), 280 - versionString.size() * 6, 153, _screen->getPagePixel(2, 0, 0), 0);
_screen->setFont(of);
_screen->fillRect(0, 159, 319, 199, _screen->getPagePixel(2, 0, 0));
- gui_drawBox(77, 165, 173, 29, 13, 14, 12);
- gui_drawBox(76, 164, 175, 31, 13, 14, -1);
+ gui_drawBox(77, 165, 173, 29, 14, 13, 12);
+ gui_drawBox(76, 164, 175, 31, 14, 13, -1);
_screen->_curPage = 0;
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
@@ -996,7 +1003,6 @@ int EoBEngine::mainMenu() {
case 1:
// load game in progress
- //
menuChoice = -1;
break;
@@ -1089,10 +1095,10 @@ void EoBEngine::seq_xdeath() {
_screen->loadShapeSetBitmap("XDEATH2", 5, 3);
for (int i = 0; i < 4; i++)
- shapes1[i] = _screen->encodeShape(i / 2 * 14, i / 2 * 88, 14, 88, true);
+ shapes1[i] = _screen->encodeShape(i / 2 * 14, i / 2 * 88, 14, 88, true, _cgaMappingDefault);
_screen->loadShapeSetBitmap("XDEATH3", 5, 3);
- shapes2 = _screen->encodeShape(22, 0, 16, 95, true);
- _screen->loadEoBBitmap("XDEATH1", 0, 5, 3, -1);
+ shapes2 = _screen->encodeShape(22, 0, 16, 95, true, _cgaMappingDefault);
+ _screen->loadEoBBitmap("XDEATH1", _cgaMappingDefault, 5, 3, -1);
_screen->setCurPage(0);
for (int i = 0; i < 10; i++) {
diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp
index 360d314..9e450a5 100644
--- a/engines/kyra/sprites_eob.cpp
+++ b/engines/kyra/sprites_eob.cpp
@@ -37,7 +37,7 @@ void EoBCoreEngine::loadMonsterShapes(const char *filename, int monsterIndex, bo
const uint16 *enc = &_encodeMonsterShpTable[encodeTableIndex << 2];
for (int i = 0; i < 6; i++, enc += 4)
- _monsterShapes[monsterIndex + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3]);
+ _monsterShapes[monsterIndex + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, _cgaMappingDefault);
generateMonsterPalettes(filename, monsterIndex);
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 99ad6ea..2be25ce 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -38,7 +38,7 @@
namespace Kyra {
-#define RESFILE_VERSION 80
+#define RESFILE_VERSION 81
namespace {
bool checkKyraDat(Common::SeekableReadStream *file) {
diff --git a/engines/kyra/staticres_eob.cpp b/engines/kyra/staticres_eob.cpp
index a65ade7..5e28757 100644
--- a/engines/kyra/staticres_eob.cpp
+++ b/engines/kyra/staticres_eob.cpp
@@ -28,12 +28,12 @@
namespace Kyra {
#ifdef ENABLE_EOB
-const EoBSequenceStep *StaticResource::loadEoB2SeqData(int id, int &entries) {
- return (const EoBSequenceStep *)getData(id, kEoB2SequenceData, entries);
+const DarkMoonAnimCommand *StaticResource::loadEoB2SeqData(int id, int &entries) {
+ return (const DarkMoonAnimCommand *)getData(id, kEoB2SequenceData, entries);
}
-const EoBShapeDef *StaticResource::loadEoB2ShapeData(int id, int &entries) {
- return (const EoBShapeDef *)getData(id, kEoB2ShapeData, entries);
+const DarkMoonShapeDef *StaticResource::loadEoB2ShapeData(int id, int &entries) {
+ return (const DarkMoonShapeDef *)getData(id, kEoB2ShapeData, entries);
}
const EoBCharacter *StaticResource::loadEoBNpcData(int id, int &entries) {
@@ -43,7 +43,7 @@ const EoBCharacter *StaticResource::loadEoBNpcData(int id, int &entries) {
bool StaticResource::loadEoB2SeqData(Common::SeekableReadStream &stream, void *&ptr, int &size) {
size = stream.size() / 11;
- EoBSequenceStep *s = new EoBSequenceStep[size];
+ DarkMoonAnimCommand *s = new DarkMoonAnimCommand[size];
for (int i = 0; i < size; i++) {
s[i].command = stream.readByte();
@@ -65,7 +65,7 @@ bool StaticResource::loadEoB2SeqData(Common::SeekableReadStream &stream, void *&
bool StaticResource::loadEoB2ShapeData(Common::SeekableReadStream &stream, void *&ptr, int &size) {
size = stream.size() / 6;
- EoBShapeDef *s = new EoBShapeDef[size];
+ DarkMoonShapeDef *s = new DarkMoonShapeDef[size];
for (int i = 0; i < size; i++) {
s[i].index = stream.readSint16BE();
@@ -127,14 +127,14 @@ bool StaticResource::loadEoBNpcData(Common::SeekableReadStream &stream, void *&p
}
void StaticResource::freeEoB2SeqData(void *&ptr, int &size) {
- EoBSequenceStep *d = (EoBSequenceStep *)ptr;
+ DarkMoonAnimCommand *d = (DarkMoonAnimCommand *)ptr;
delete[] d;
ptr = 0;
size = 0;
}
void StaticResource::freeEoB2ShapeData(void *&ptr, int &size) {
- EoBShapeDef *d = (EoBShapeDef *)ptr;
+ DarkMoonShapeDef *d = (DarkMoonShapeDef *)ptr;
delete[] d;
ptr = 0;
size = 0;
@@ -1035,6 +1035,18 @@ void EoBEngine::initStaticResource() {
_beholderSpellList = _staticres->loadRawData(kEoB1BeholderSpellList, temp);
_beholderSfx = _staticres->loadRawData(kEoB1BeholderSfx, temp);
+ _cgaMappingDefault = _staticres->loadRawData(kEoB1CgaMappingDefault, temp);
+ _cgaMappingAlt = _staticres->loadRawData(kEoB1CgaMappingAlt, temp);
+ _cgaMappingInv = _staticres->loadRawData(kEoB1CgaMappingInv, temp);
+ _cgaMappingItemsL = _staticres->loadRawData(kEoB1CgaMappingItemsL, temp);
+ _cgaMappingItemsS = _staticres->loadRawData(kEoB1CgaMappingItemsS, temp);
+ _cgaMappingThrown = _staticres->loadRawData(kEoB1CgaMappingThrown, temp);
+ _cgaMappingIcons = _staticres->loadRawData(kEoB1CgaMappingIcons, temp);
+ _cgaMappingDeco = _staticres->loadRawData(kEoB1CgaMappingDeco, temp);
+ _cgaLevelMappingIndex = _staticres->loadRawData(kEoB1CgaLevelMappingIndex, temp);
+ for (int i = 0; i < 5; i++)
+ _cgaMappingLevel[i] = _staticres->loadRawData(kEoB1CgaMappingLevel0 + i, temp);
+
_turnUndeadString = _staticres->loadStrings(kEoB1TurnUndeadString, temp);
_npcShpData = _staticres->loadRawData(kEoB1NpcShpData, temp);
@@ -1174,18 +1186,22 @@ const KyraRpgGUISettings EoBEngine::_guiSettings = {
{ 135, 130, 132, 133, 133, 17, 23, 20, 184, 177, 180, 184, 177, 180 }
};
+const uint8 EoBEngine::_egaDefaultPalette[] = {
+ 0, 5, 3, 2, 10, 14, 12, 6, 4, 11, 9, 1, 0, 8, 7, 15
+};
+
void DarkMoonEngine::initStaticResource() {
int temp;
_mainMenuStrings = _staticres->loadStrings(kEoB2MainMenuStrings, temp);
_introStrings = _staticres->loadStrings(kEoB2IntroStrings, temp);
_cpsFilesIntro = _staticres->loadStrings(kEoB2IntroCPSFiles, temp);
- _seqIntro = new const EoBSequenceStep*[44];
+ _animIntro = new const DarkMoonAnimCommand*[44];
for (int i = 0; i < 44; i++)
- _seqIntro[i] = _staticres->loadEoB2SeqData(kEoB2IntroSeqData00 + i, temp);
+ _animIntro[i] = _staticres->loadEoB2SeqData(kEob2IntroAnimData00 + i, temp);
- _shapesIntro = new const EoBShapeDef*[13];
- memset(_shapesIntro, 0, sizeof(EoBShapeDef *) * 13);
+ _shapesIntro = new const DarkMoonShapeDef*[13];
+ memset(_shapesIntro, 0, sizeof(DarkMoonShapeDef*) * 13);
_shapesIntro[0] = _staticres->loadEoB2ShapeData(kEoB2IntroShapes00, temp);
_shapesIntro[1] = _staticres->loadEoB2ShapeData(kEoB2IntroShapes01, temp);
_shapesIntro[4] = _staticres->loadEoB2ShapeData(kEoB2IntroShapes04, temp);
@@ -1195,12 +1211,12 @@ void DarkMoonEngine::initStaticResource() {
_creditsData = _staticres->loadRawData(kEoB2CreditsData, temp);
_cpsFilesFinale = _staticres->loadStrings(kEoB2FinaleCPSFiles, temp);
- _seqFinale = new const EoBSequenceStep*[21];
+ _animFinale = new const DarkMoonAnimCommand*[21];
for (int i = 0; i < 21; i++)
- _seqFinale[i] = _staticres->loadEoB2SeqData(kEoB2FinaleSeqData00 + i, temp);
+ _animFinale[i] = _staticres->loadEoB2SeqData(kEob2FinaleAnimData00 + i, temp);
- _shapesFinale = new const EoBShapeDef*[13];
- memset(_shapesFinale, 0, sizeof(EoBShapeDef *) * 13);
+ _shapesFinale = new const DarkMoonShapeDef*[13];
+ memset(_shapesFinale, 0, sizeof(DarkMoonShapeDef*) * 13);
_shapesFinale[0] = _staticres->loadEoB2ShapeData(kEoB2FinaleShapes00, temp);
_shapesFinale[3] = _staticres->loadEoB2ShapeData(kEoB2FinaleShapes03, temp);
_shapesFinale[7] = _staticres->loadEoB2ShapeData(kEoB2FinaleShapes07, temp);
@@ -1275,15 +1291,23 @@ void DarkMoonEngine::initSpells() {
}
}
-const char *DarkMoonEngine::_palFilesIntro[] = {
- "PALETTE1.PAL", // EGA: palette0.pal
+const char *DarkMoonEngine::_palFilesIntroVGA[] = {
+ "PALETTE1.PAL",
+ "PALETTE3.PAL",
+ "PALETTE2.PAL",
+ "PALETTE4.PAL",
+ 0
+};
+
+const char *DarkMoonEngine::_palFilesIntroEGA[] = {
+ "PALETTE0.PAL",
"PALETTE3.PAL",
"PALETTE2.PAL",
"PALETTE4.PAL",
0
};
-const char *DarkMoonEngine::_palFilesFinale[] = {
+const char *DarkMoonEngine::_palFilesFinaleVGA[] = {
"FINALE_0.PAL",
"FINALE_0.PAL",
"FINALE_1.PAL",
@@ -1296,11 +1320,28 @@ const char *DarkMoonEngine::_palFilesFinale[] = {
0
};
+const char *DarkMoonEngine::_palFilesFinaleEGA[] = {
+ "FINALE_0.PAL",
+ "FINALE_0.PAL",
+ "FINALE_1.PAL",
+ "FINALE_2.PAL",
+ "FINALE_3.PAL",
+ "FINALE_4.PAL",
+ "FINALE_5.PAL",
+ "FINALE_0.PAL",
+ "FINALE_0.PAL",
+ 0
+};
+
const KyraRpgGUISettings DarkMoonEngine::_guiSettings = {
{ 9, 15, 95, 9, 7, { 221, 76 }, { 189, 162 }, { 95, 95 } },
{ 186, 181, 183, 133, 184, 17, 23, 20, 186, 181, 183, 182, 177, 180 }
};
+const uint8 DarkMoonEngine::_egaDefaultPalette[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
+};
+
#endif // ENABLE_EOB
} // End of namespace Kyra
Commit: 151d314912b08d7d598a3995524d89c8b4ab0371
https://github.com/scummvm/scummvm/commit/151d314912b08d7d598a3995524d89c8b4ab0371
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:41-08:00
Commit Message:
KYRA: (EOB) - complete CGA graphics mode implementation
Changed paths:
engines/kyra/eob.cpp
engines/kyra/eob.h
engines/kyra/eobcommon.cpp
engines/kyra/eobcommon.h
engines/kyra/gui_eob.cpp
engines/kyra/items_eob.cpp
engines/kyra/kyra_rpg.cpp
engines/kyra/kyra_rpg.h
engines/kyra/scene_eob.cpp
engines/kyra/scene_rpg.cpp
engines/kyra/screen.cpp
engines/kyra/screen_eob.cpp
engines/kyra/screen_eob.h
engines/kyra/sequences_eob.cpp
engines/kyra/sprites_eob.cpp
engines/kyra/staticres_eob.cpp
diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp
index 3a1cfc1..769e77e 100644
--- a/engines/kyra/eob.cpp
+++ b/engines/kyra/eob.cpp
@@ -55,7 +55,8 @@ Common::Error EoBEngine::init() {
initStaticResource();
- _itemsOverlay = _res->fileData((_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA) ? "ITEMRMP.EGA" : "ITEMRMP.VGA", 0);
+ if (_configRenderMode != Common::kRenderCGA)
+ _itemsOverlay = _res->fileData((_configRenderMode == Common::kRenderEGA) ? "ITEMRMP.EGA" : "ITEMRMP.VGA", 0);
_screen->modifyScreenDim(7, 0x01, 0xB3, 0x22, 0x12);
_screen->modifyScreenDim(9, 0x01, 0x7D, 0x26, 0x3F);
@@ -553,7 +554,7 @@ void EoBEngine::healParty() {
}
const KyraRpgGUISettings *EoBEngine::guiSettings() {
- return &_guiSettings;
+ return (_configRenderMode == Common::kRenderCGA || _configRenderMode == Common::kRenderEGA) ? &_guiSettingsEGA : &_guiSettingsVGA;
}
} // End of namespace Kyra
diff --git a/engines/kyra/eob.h b/engines/kyra/eob.h
index 9d583a0..37ce483 100644
--- a/engines/kyra/eob.h
+++ b/engines/kyra/eob.h
@@ -108,7 +108,8 @@ private:
const KyraRpgGUISettings *guiSettings();
- static const KyraRpgGUISettings _guiSettings;
+ static const KyraRpgGUISettings _guiSettingsVGA;
+ static const KyraRpgGUISettings _guiSettingsEGA;
static const uint8 _egaDefaultPalette[];
};
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp
index a68c7de..ecac20a 100644
--- a/engines/kyra/eobcommon.cpp
+++ b/engines/kyra/eobcommon.cpp
@@ -65,7 +65,6 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags)
_itemIconShapes = _wallOfForceShapes = _teleporterShapes = _sparkShapes = _compassShapes = 0;
_redSplatShape = _greenSplatShape = _deadCharShape = _disabledCharGrid = 0;
_blackBoxSmallGrid = _weaponSlotGrid = _blackBoxWideGrid = _lightningColumnShape = 0;
- _tempIconShape = 0;
_monsterDustStrings = 0;
_enemyMageSpellList = 0;
@@ -93,7 +92,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags)
_doorSwitches = 0;
_monsterProps = 0;
_monsterDecorations = 0;
- _monsterOvl1 = _monsterOvl2 = 0;
+ _monsterFlashOverlay = _monsterStoneOverlay = 0;
_monsters = 0;
_dstMonsterIndex = 0;
_preventMonsterFlash = false;
@@ -214,7 +213,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags)
_mnNumWord = _numSpells = _mageSpellListSize = _spellLevelsMageSize = _spellLevelsClericSize = 0;
_inventorySlotsX = _slotValidationFlags = _encodeMonsterShpTable = 0;
_cgaMappingDefault = _cgaMappingAlt = _cgaMappingInv = _cgaLevelMappingIndex = _cgaMappingItemsL = _cgaMappingItemsS = _cgaMappingThrown = _cgaMappingIcons = _cgaMappingDeco = 0;
- memset(_cgaMappingLevel, 0, sizeof(_cgaMappingLevel));
+ memset(_cgaMappingLevel, 0, sizeof(_cgaMappingLevel));
memset(_expRequirementTables, 0, sizeof(_expRequirementTables));
memset(_saveThrowTables, 0, sizeof(_saveThrowTables));
memset(_doorType, 0, sizeof(_doorType));
@@ -271,8 +270,8 @@ EoBCoreEngine::~EoBCoreEngine() {
delete[] _itemNames;
delete[] _flyingObjects;
- delete[] _monsterOvl1;
- delete[] _monsterOvl2;
+ delete[] _monsterFlashOverlay;
+ delete[] _monsterStoneOverlay;
delete[] _monsters;
if (_monsterDecorations) {
@@ -483,11 +482,11 @@ Common::Error EoBCoreEngine::init() {
_doorSwitches = new SpriteDecoration[6];
memset(_doorSwitches, 0, 6 * sizeof(SpriteDecoration));
- _monsterOvl1 = new uint8[16];
- _monsterOvl2 = new uint8[16];
- memset(_monsterOvl1, 15, 16 * sizeof(uint8));
- memset(_monsterOvl2, 13, 16 * sizeof(uint8));
- _monsterOvl1[0] = _monsterOvl2[0] = 0;
+ _monsterFlashOverlay = new uint8[16];
+ _monsterStoneOverlay = new uint8[16];
+ memset(_monsterFlashOverlay, (_configRenderMode == Common::kRenderCGA) ? 0xff : 0x0f, 16 * sizeof(uint8));
+ memset(_monsterStoneOverlay, 0x0d, 16 * sizeof(uint8));
+ _monsterFlashOverlay[0] = _monsterStoneOverlay[0] = 0;
// Prevent autosave on game startup
_lastAutosave = _system->getMillis();
@@ -700,7 +699,6 @@ void EoBCoreEngine::loadItemsAndDecorationsShapes() {
_itemIconShapes = new const uint8*[_numItemIconShapes];
for (int i = 0; i < _numItemIconShapes; i++)
_itemIconShapes[i] = _screen->encodeShape((i % 0x14) << 1, (i / 0x14) << 4, 2, 0x10, false, _cgaMappingIcons);
- _tempIconShape = new uint8[300];
_screen->loadShapeSetBitmap("DECORATE", 5, 3);
@@ -774,7 +772,6 @@ void EoBCoreEngine::releaseItemsAndDecorationsShapes() {
}
delete[] _itemIconShapes;
}
- delete[] _tempIconShape;
if (_sparkShapes) {
for (int i = 0; i < 3; i++) {
@@ -838,18 +835,13 @@ void EoBCoreEngine::setHandItem(Item itemIndex) {
_itemInHand = itemIndex;
int icon = _items[_itemInHand].icon;
const uint8 *shp = _itemIconShapes[icon];
+ const uint8 *ovl = 0;
- if (icon && (_items[_itemInHand].flags & 0x80) && (_partyEffectFlags & 2)) {
- memcpy(_tempIconShape, shp, shp[1] * shp[2] * 4 + 20);
- if (_flags.gameID == GI_EOB1)
- _screen->replaceShapePalette(_tempIconShape, &_itemsOverlay[icon << 4]);
- else
- _screen->applyShapeOverlay(_tempIconShape, 3);
- shp = _tempIconShape;
- }
+ if (icon && (_items[_itemInHand].flags & 0x80) && (_partyEffectFlags & 2))
+ ovl = _flags.gameID == GI_EOB1 ? ((_configRenderMode == Common::kRenderCGA) ? _itemsOverlayCGA : &_itemsOverlay[icon << 4]) : _screen->generateShapeOverlay(shp, 3);
int mouseOffs = itemIndex ? 8 : 0;
- _screen->setMouseCursor(mouseOffs, mouseOffs, shp);
+ _screen->setMouseCursor(mouseOffs, mouseOffs, shp, ovl);
}
int EoBCoreEngine::getDexterityArmorClassModifier(int dexterity) {
diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h
index 49589c8..38be2a6 100644
--- a/engines/kyra/eobcommon.h
+++ b/engines/kyra/eobcommon.h
@@ -302,8 +302,8 @@ protected:
const uint8 *_blackBoxWideGrid;
const uint8 *_lightningColumnShape;
- uint8 *_tempIconShape;
uint8 *_itemsOverlay;
+ static const uint8 _itemsOverlayCGA[];
static const uint8 _teleporterShapeDefs[];
static const uint8 _wallOfForceShapeDefs[];
@@ -528,8 +528,8 @@ protected:
void updateMonstersSpellStatus(EoBMonsterInPlay *m);
void setBlockMonsterDirection(int block, int dir);
- uint8 *_monsterOvl1;
- uint8 *_monsterOvl2;
+ uint8 *_monsterFlashOverlay;
+ uint8 *_monsterStoneOverlay;
SpriteDecoration *_monsterDecorations;
EoBMonsterProperty *_monsterProps;
diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp
index 2fdfb0c..39cc469 100644
--- a/engines/kyra/gui_eob.cpp
+++ b/engines/kyra/gui_eob.cpp
@@ -116,7 +116,7 @@ void EoBCoreEngine::gui_drawCharPortraitWithStats(int index) {
if (c->damageTaken > 0) {
_screen->drawShape(2, _redSplatShape, x2 + 13, y2 + 30, 0);
Common::String tmpStr = Common::String::format("%d", c->damageTaken);
- _screen->printText(tmpStr.c_str(), x2 + 34 - tmpStr.size() * 3, y2 + 42, 15, 0);
+ _screen->printText(tmpStr.c_str(), x2 + 34 - tmpStr.size() * 3, y2 + 42, (_configRenderMode == Common::kRenderCGA) ? 12 : 15, 0);
}
_screen->setCurPage(cp);
@@ -256,10 +256,8 @@ void EoBCoreEngine::gui_drawFaceShape(int index) {
if (c->hitPointsCur < 1)
_screen->drawShape(_screen->_curPage, _disabledCharGrid, x, y, 0);
- //if ((c->flags & 2) || (c->flags & 8) || (c->effectFlags & 0x140)) {
- _screen->setFadeTableIndex(4);
- _screen->setShapeFadeMode(1, false);
- //}
+ _screen->setFadeTableIndex(4);
+ _screen->setShapeFadeMode(1, false);
}
void EoBCoreEngine::gui_drawWeaponSlot(int charIndex, int slot) {
@@ -323,11 +321,13 @@ void EoBCoreEngine::gui_drawWeaponSlotStatus(int x, int y, int status) {
break;
}
+ int textColor= (_configRenderMode == Common::kRenderCGA) ? 2 : 15;
+
if (!tmpStr2.empty()) {
- _screen->printText(tmpStr.c_str(), x + (16 - tmpStr.size() * 3), y + 2, 15, 0);
- _screen->printText(tmpStr2.c_str(), x + (16 - tmpStr.size() * 3), y + 9, 15, 0);
+ _screen->printText(tmpStr.c_str(), x + (16 - tmpStr.size() * 3), y + 2, textColor, 0);
+ _screen->printText(tmpStr2.c_str(), x + (16 - tmpStr.size() * 3), y + 9, textColor, 0);
} else {
- _screen->printText(tmpStr.c_str(), x + (16 - tmpStr.size() * 3), y + 5, 15, 0);
+ _screen->printText(tmpStr.c_str(), x + (16 - tmpStr.size() * 3), y + 5, textColor, 0);
}
}
@@ -408,12 +408,13 @@ void EoBCoreEngine::gui_drawHorizontalBarGraph(int x, int y, int w, int h, int32
}
void EoBCoreEngine::gui_drawCharPortraitStatusFrame(int index) {
- uint8 redGreenColor = (_partyEffectFlags & 0x20000) ? 4 : 6;
+ uint8 redGreenColor = (_partyEffectFlags & 0x20000) ? 4 : ((_configRenderMode == Common::kRenderCGA) ? 3 : 6);
static const uint8 xCoords[] = { 8, 80 };
static const uint8 yCoords[] = { 2, 54, 106 };
int x = xCoords[index & 1];
int y = yCoords[index >> 1];
+ int xOffset = (_configRenderMode == Common::kRenderCGA) ? 0 : 1;
if (!_screen->_curPage)
x += 176;
@@ -467,7 +468,7 @@ void EoBCoreEngine::gui_drawCharPortraitStatusFrame(int index) {
} else {
_screen->drawClippedLine(x, y, x + 62, y, guiSettings()->colors.frame2);
_screen->drawClippedLine(x, y + 49, x + 62, y + 49, guiSettings()->colors.frame1);
- _screen->drawClippedLine(x - 1, y, x - 1, y + 50, 12);
+ _screen->drawClippedLine(x - xOffset, y, x - xOffset, y + 50, 12);
_screen->drawClippedLine(x + 63, y, x + 63, y + 50, 12);
}
}
@@ -481,7 +482,15 @@ void EoBCoreEngine::gui_drawInventoryItem(int slot, int special, int pageNum) {
if (special) {
int wh = (slot == 25 || slot == 26) ? 10 : 18;
- gui_drawBox(x - 1, y - 1, wh, wh, guiSettings()->colors.frame1, guiSettings()->colors.frame2, slot == 16 ? -1 : guiSettings()->colors.fill);
+
+ uint8 col1 = guiSettings()->colors.frame1;
+ uint8 col2 = guiSettings()->colors.frame2;
+ if (_configRenderMode == Common::kRenderCGA ) {
+ col1 = 1;
+ col2 = 3;
+ }
+
+ gui_drawBox(x - 1, y - 1, wh, wh, col1, col2, slot == 16 ? -1 : guiSettings()->colors.fill);
if (slot == 16) {
_screen->fillRect(227, 65, 238, 69, 12);
@@ -528,14 +537,26 @@ void EoBCoreEngine::gui_drawSpellbook() {
_screen->copyRegion(64, 121, 64, 121, 112, 56, 0, 2, Screen::CR_NO_P_CHECK);
for (int i = 0; i < numTab; i++) {
- int col1 = guiSettings()->colors.inactiveTabFrame1;
- int col2 = guiSettings()->colors.inactiveTabFrame2;
- int col3 = guiSettings()->colors.inactiveTabFill;
-
- if (i == _openBookSpellLevel) {
- col1 = guiSettings()->colors.frame1;
- col2 = guiSettings()->colors.frame2;
- col3 = guiSettings()->colors.fill;
+ int col1 = 0;
+ int col2 = 1;
+ int col3 = 2;
+
+ if (_configRenderMode == Common::kRenderCGA) {
+ if (i == _openBookSpellLevel) {
+ col1 = 1;
+ col2 = 2;
+ col3 = 3;
+ }
+ } else {
+ col1 = guiSettings()->colors.inactiveTabFrame1;
+ col2 = guiSettings()->colors.inactiveTabFrame2;
+ col3 = guiSettings()->colors.inactiveTabFill;
+
+ if (i == _openBookSpellLevel) {
+ col1 = guiSettings()->colors.frame1;
+ col2 = guiSettings()->colors.frame2;
+ col3 = guiSettings()->colors.fill;
+ }
}
if (_flags.gameID == GI_EOB1) {
@@ -558,19 +579,21 @@ void EoBCoreEngine::gui_drawSpellbook() {
gui_drawSpellbookScrollArrow(165, 169, 1);
}
- int textCol1 = 15;
+ int textCol1 = (_configRenderMode == Common::kRenderCGA) ? 3 : 15;
int textCol2 = 8;
int textXa = 74;
int textXs = 71;
int textY = 170;
- int col3 = guiSettings()->colors.fill;
+ int col3 = (_configRenderMode == Common::kRenderCGA) ? 2 : guiSettings()->colors.fill;
int col4 = guiSettings()->colors.extraFill;
+ int col5 = 12;
if (_flags.gameID == GI_EOB1) {
- textCol2 = 11;
+ textCol2 = (_configRenderMode == Common::kRenderCGA) ? 12 : 11;
textXa = textXs = 73;
textY = 168;
- col4 = guiSettings()->colors.fill;
+ col4 = col3;
+ col5 = textCol1;
}
for (int i = 0; i < 7; i++) {
@@ -587,7 +610,7 @@ void EoBCoreEngine::gui_drawSpellbook() {
if (d >= 0 && i < 6 && (i + _openBookSpellListOffset) < 9)
_screen->printText(_openBookSpellList[d], textXs, 132 + 6 * i, textCol1, col3);
else
- _screen->printText(_magicStrings1[0], textXa, textY, 12, col4);
+ _screen->printText(_magicStrings1[0], textXa, textY, col5, col4);
}
}
@@ -2704,13 +2727,14 @@ bool GUI_EoB::runSaveMenu(int x, int y) {
int GUI_EoB::selectSaveSlotDialogue(int x, int y, int id) {
_saveSlotX = _saveSlotY = 0;
+ int col1 = (_vm->_configRenderMode == Common::kRenderCGA) ? 1 : 15;
_screen->setCurPage(2);
_savegameOffset = 0;
drawMenuButtonBox(0, 0, 176, 144, false, false);
const char *title = (id < 2) ? _vm->_saveLoadStrings[2 + id] : _vm->_transferStringsScummVM[id - 1];
- _screen->printShadedText(title, 52, 5, 15, 0);
+ _screen->printShadedText(title, 52, 5, col1, 0);
_screen->copyRegion(0, 0, x, y, 176, 144, 2, 0, Screen::CR_NO_P_CHECK);
_screen->setCurPage(0);
@@ -2783,12 +2807,12 @@ int GUI_EoB::selectSaveSlotDialogue(int x, int y, int id) {
lastHighlight = -1;
setupSaveMenuSlots();
for (int i = 0; i < 7; i++)
- drawSaveSlotButton(i, 1, 15);
+ drawSaveSlotButton(i, 1, col1);
lastOffset = _savegameOffset;
}
if (lastHighlight != newHighlight) {
- drawSaveSlotButton(lastHighlight, 0, 15);
+ drawSaveSlotButton(lastHighlight, 0, col1);
drawSaveSlotButton(newHighlight, 0, 6);
// Display highlighted slot index in the bottom left corner to avoid people getting lost with the 990 save slots
@@ -3797,10 +3821,12 @@ void GUI_EoB::drawMenuButton(Button *b, bool clicked, bool highlight, bool noFil
yOffs = (b->height - 7) >> 1;
}
+ int col1 = (_vm->_configRenderMode == Common::kRenderCGA) ? 1 : 15;
+
if (noFill || clicked)
- _screen->printText(s, b->x + xOffs, b->y + yOffs, highlight ? 6 : 15, 0);
+ _screen->printText(s, b->x + xOffs, b->y + yOffs, highlight ? 6 : col1, 0);
else
- _screen->printShadedText(s, b->x + xOffs, b->y + yOffs, highlight ? 6 : 15, 0);
+ _screen->printShadedText(s, b->x + xOffs, b->y + yOffs, highlight ? 6 : col1, 0);
}
}
@@ -3862,13 +3888,14 @@ void GUI_EoB::memorizePrayMenuPrintString(int spellId, int bookPageIndex, int sp
return;
int y = bookPageIndex * 9 + 50;
+ int col1 = (_vm->_configRenderMode == Common::kRenderCGA) ? 1 : 15;
if (spellId) {
Common::String s(Common::String::format(_vm->_menuStringsMgc[0], spellType ? _vm->_clericSpellList[spellId] : _vm->_mageSpellList[spellId], _numAssignedSpellsOfType[spellId * 2 - 2]));
if (noFill)
- _screen->printText(s.c_str(), 8, y, highLight ? 6 : 15, 0);
+ _screen->printText(s.c_str(), 8, y, highLight ? 6 : col1, 0);
else
- _screen->printShadedText(s.c_str(), 8, y, highLight ? 6 : 15, _vm->guiSettings()->colors.fill);
+ _screen->printShadedText(s.c_str(), 8, y, highLight ? 6 : col1, _vm->guiSettings()->colors.fill);
} else {
_screen->fillRect(6, y, 168, y + 8, _vm->guiSettings()->colors.fill);
diff --git a/engines/kyra/items_eob.cpp b/engines/kyra/items_eob.cpp
index 979b68d..5b65887 100644
--- a/engines/kyra/items_eob.cpp
+++ b/engines/kyra/items_eob.cpp
@@ -462,19 +462,18 @@ void EoBCoreEngine::identifyQueuedItems(Item itemQueue) {
void EoBCoreEngine::drawItemIconShape(int pageNum, Item itemId, int x, int y) {
int icn = _items[itemId].icon;
bool applyBluePal = ((_partyEffectFlags & 2) && (_items[itemId].flags & 0x80)) ? true : false;
-
- memcpy(_tempIconShape, _itemIconShapes[icn], _itemIconShapes[icn][1] * _itemIconShapes[icn][2] * 4 + 20);
+ const uint8 *ovl = 0;
if (applyBluePal) {
- if (_flags.gameID == GI_EOB1) {
- _screen->replaceShapePalette(_tempIconShape, &_itemsOverlay[icn << 4]);
+ if (_flags.gameID == GI_EOB1) {
+ ovl = (_configRenderMode == Common::kRenderCGA) ? _itemsOverlayCGA : &_itemsOverlay[icn << 4];
} else {
_screen->setFadeTableIndex(3);
_screen->setShapeFadeMode(1, true);
}
}
- _screen->drawShape(pageNum, _tempIconShape, x, y, 0);
+ _screen->drawShape(pageNum, _itemIconShapes[icn], x, y, 0, ovl ? 2 : 0, ovl);
if (applyBluePal) {
_screen->setFadeTableIndex(4);
diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp
index 8c9a1ec..a885eb9 100644
--- a/engines/kyra/kyra_rpg.cpp
+++ b/engines/kyra/kyra_rpg.cpp
@@ -44,6 +44,7 @@ KyraRpgEngine::KyraRpgEngine(OSystem *system, const GameFlags &flags) : KyraEngi
_vmpPtr = 0;
_vcnBlocks = 0;
_vcfBlocks = 0;
+ _vcnTransitionMask = 0;
_vcnShift = 0;
_vcnColTable = 0;
_vmpPtr = 0;
@@ -126,6 +127,7 @@ KyraRpgEngine::~KyraRpgEngine() {
delete[] _vcnColTable;
delete[] _vcnBlocks;
delete[] _vcfBlocks;
+ delete[] _vcnTransitionMask;
delete[] _vcnShift;
delete[] _blockDrawingBuffer;
delete[] _sceneWindowBuffer;
diff --git a/engines/kyra/kyra_rpg.h b/engines/kyra/kyra_rpg.h
index 6a71239..aec34fc 100644
--- a/engines/kyra/kyra_rpg.h
+++ b/engines/kyra/kyra_rpg.h
@@ -224,6 +224,7 @@ protected:
uint16 *_vmpPtr;
uint8 *_vcnBlocks;
uint8 *_vcfBlocks;
+ uint8 *_vcnTransitionMask;
uint8 *_vcnShift;
uint8 *_vcnColTable;
uint16 *_blockDrawingBuffer;
diff --git a/engines/kyra/scene_eob.cpp b/engines/kyra/scene_eob.cpp
index 2a59a97..5a06fe7 100644
--- a/engines/kyra/scene_eob.cpp
+++ b/engines/kyra/scene_eob.cpp
@@ -279,15 +279,51 @@ void EoBCoreEngine::loadVcnData(const char *file, const uint8 *cgaMapping) {
const char *filePattern = (_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)) ? "%s.ECN" : "%s.VCN";
_screen->loadBitmap(Common::String::format(filePattern, _lastBlockDataFile).c_str(), 3, 3, 0);
- const uint8 *v = _screen->getCPagePtr(3);
- uint32 tlen = READ_LE_UINT16(v) << 5;
- v += 2;
+ const uint8 *pos = _screen->getCPagePtr(3);
+ uint32 tlen = READ_LE_UINT16(pos) << 5;
+ pos += 2;
if (!(_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)))
- memcpy(_vcnColTable, v, 32);
- v += 32;
+ memcpy(_vcnColTable, pos, 32);
+ pos += 32;
delete[] _vcnBlocks;
_vcnBlocks = new uint8[tlen];
- memcpy(_vcnBlocks, v, tlen);
+
+ if (_configRenderMode == Common::kRenderCGA) {
+ uint8 *tmp = _screen->encodeShape(0, 0, 1, 8, false, cgaMapping);
+ delete[] tmp;
+
+ delete[] _vcnTransitionMask;
+ _vcnTransitionMask = new uint8[tlen];
+ uint8 tblSwitch = 0;
+ uint8 *dst = _vcnBlocks;
+ uint8 *dst2 = _vcnTransitionMask;
+
+ while (dst < _vcnBlocks + tlen) {
+ const uint16 *table = _screen->getCGADitheringTable((tblSwitch++) & 1);
+ for (int ii = 0; ii < 2; ii++) {
+ *dst++ = ((table[pos[0]] & 0x000f) << 4) | ((table[pos[0]] & 0x0f00) >> 8);
+ *dst++= ((table[pos[1]] & 0x000f) << 4) | ((table[pos[1]] & 0x0f00) >> 8);
+
+ uint8 msk = 0;
+ if (pos[0] & 0xf0)
+ msk |= 0x30;
+ if (pos[0] & 0x0f)
+ msk |= 0x03;
+ *dst2++ = msk ^ 0x33;
+
+ msk = 0;
+ if (pos[1] & 0xf0)
+ msk |= 0x30;
+ if (pos[1] & 0x0f)
+ msk |= 0x03;
+ *dst2++ = msk ^ 0x33;
+
+ pos += 2;
+ }
+ }
+ } else {
+ memcpy(_vcnBlocks, pos, tlen);
+ }
}
void EoBCoreEngine::loadBlockProperties(const char *mazFile) {
@@ -338,7 +374,7 @@ const uint8 *EoBCoreEngine::getBlockFileData(const char *mazFile) {
}
void EoBCoreEngine::loadDecorations(const char *cpsFile, const char *decFile) {
- _screen->loadShapeSetBitmap(cpsFile, 3, 3);
+ _screen->loadShapeSetBitmap(cpsFile, 5, 3);
Common::SeekableReadStream *s = _res->createReadStream(decFile);
_levelDecorationDataSize = s->readUint16LE();
diff --git a/engines/kyra/scene_rpg.cpp b/engines/kyra/scene_rpg.cpp
index 55d02d8..269a5d3 100644
--- a/engines/kyra/scene_rpg.cpp
+++ b/engines/kyra/scene_rpg.cpp
@@ -349,15 +349,14 @@ void KyraRpgEngine::drawVcnBlocks() {
for (int y = 0; y < 15; y++) {
for (int x = 0; x < 22; x++) {
bool horizontalFlip = false;
- int remainder = 0;
-
uint16 vcnOffset = *bdb++;
+ uint16 vcnExtraOffsetWll = 0;
int wllVcnOffset = 0;
int wllVcnRmdOffset = 0;
if (vcnOffset & 0x8000) {
// this renders a wall block over the transparent pixels of a floor/ceiling block
- remainder = vcnOffset - 0x8000;
+ vcnExtraOffsetWll = vcnOffset - 0x8000;
vcnOffset = 0;
wllVcnRmdOffset = _wllVcnOffset;
}
@@ -388,9 +387,9 @@ void KyraRpgEngine::drawVcnBlocks() {
for (int blockY = 0; blockY < 8; blockY++) {
src += 3;
for (int blockX = 0; blockX < 4; blockX++) {
- uint8 t = *src--;
- *d++ = _vcnColTable[((t & 0x0f) + wllVcnOffset) | shift];
- *d++ = _vcnColTable[((t >> 4) + wllVcnOffset) | shift];
+ uint8 bl = *src--;
+ *d++ = _vcnColTable[((bl & 0x0f) + wllVcnOffset) | shift];
+ *d++ = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift];
}
src += 5;
d += 168;
@@ -398,54 +397,71 @@ void KyraRpgEngine::drawVcnBlocks() {
} else {
for (int blockY = 0; blockY < 8; blockY++) {
for (int blockX = 0; blockX < 4; blockX++) {
- uint8 t = *src++;
- *d++ = _vcnColTable[((t >> 4) + wllVcnOffset) | shift];
- *d++ = _vcnColTable[((t & 0x0f) + wllVcnOffset) | shift];
+ uint8 bl = *src++;
+ *d++ = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift];
+ *d++ = _vcnColTable[((bl & 0x0f) + wllVcnOffset) | shift];
}
d += 168;
}
}
d -= 1400;
- if (remainder) {
+ if (vcnExtraOffsetWll) {
d -= 8;
horizontalFlip = false;
- if (remainder & 0x4000) {
- remainder &= 0x3fff;
+ if (vcnExtraOffsetWll & 0x4000) {
+ vcnExtraOffsetWll &= 0x3fff;
horizontalFlip = true;
}
- shift = _vcnShift ? _vcnShift[remainder] : _blockBrightness;
- src = &_vcnBlocks[remainder << 5];
+ shift = _vcnShift ? _vcnShift[vcnExtraOffsetWll] : _blockBrightness;
+ src = &_vcnBlocks[vcnExtraOffsetWll << 5];
+ uint8 *maskTable = _vcnTransitionMask ? &_vcnTransitionMask[vcnExtraOffsetWll << 5] : 0;
if (horizontalFlip) {
for (int blockY = 0; blockY < 8; blockY++) {
src += 3;
+ maskTable += 3;
for (int blockX = 0; blockX < 4; blockX++) {
- uint8 t = *src--;
- uint8 h = _vcnColTable[((t & 0x0f) + wllVcnRmdOffset) | shift];
- uint8 l = _vcnColTable[((t >> 4) + wllVcnRmdOffset) | shift];
- if (h)
+ uint8 bl = *src--;
+ uint8 mask = _vcnTransitionMask ? *maskTable-- : 0;
+ uint8 h = _vcnColTable[((bl & 0x0f) + wllVcnRmdOffset) | shift];
+ uint8 l = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift];
+
+ if (_vcnTransitionMask)
+ *d = (*d & (mask & 0x0f)) | h;
+ else if (h)
*d = h;
d++;
- if (l)
+
+ if (_vcnTransitionMask)
+ *d = (*d & (mask >> 4)) | l;
+ else if (l)
*d = l;
d++;
}
src += 5;
+ maskTable += 5;
d += 168;
}
} else {
for (int blockY = 0; blockY < 8; blockY++) {
for (int blockX = 0; blockX < 4; blockX++) {
- uint8 t = *src++;
- uint8 h = _vcnColTable[((t >> 4) + wllVcnRmdOffset) | shift];
- uint8 l = _vcnColTable[((t & 0x0f) + wllVcnRmdOffset) | shift];
- if (h)
+ uint8 bl = *src++;
+ uint8 mask = _vcnTransitionMask ? *maskTable++ : 0;
+ uint8 h = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift];
+ uint8 l = _vcnColTable[((bl & 0x0f) + wllVcnRmdOffset) | shift];
+
+ if (_vcnTransitionMask)
+ *d = (*d & (mask >> 4)) | h;
+ else if (h)
*d = h;
d++;
- if (l)
+
+ if (_vcnTransitionMask)
+ *d = (*d & (mask & 0x0f)) | l;
+ else if (l)
*d = l;
d++;
}
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index ebf7835..d394a86 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -159,8 +159,10 @@ bool Screen::init() {
// Setup CGA colors (if CGA mode is selected)
if (_renderMode == Common::kRenderCGA) {
- Palette pal(4);
+ Palette pal(5);
pal.setCGAPalette(1, Palette::kIntensityHigh);
+ // create additional black color 4 for use with the mouse cursor manager
+ pal.fill(4, 1, 0);
Screen::setScreenPalette(pal);
}
@@ -1035,6 +1037,8 @@ void Screen::fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum,
if (_use16ColorMode) {
color &= 0x0F;
color |= (color << 4);
+ } else if (_renderMode == Common::kRenderCGA) {
+ color &= 3;
}
if (xored) {
@@ -1112,6 +1116,8 @@ void Screen::drawLine(bool vertical, int x, int y, int length, int color) {
if (_use16ColorMode) {
color &= 0x0F;
color |= (color << 4);
+ } else if (_renderMode == Common::kRenderCGA) {
+ color &= 3;
}
if (vertical) {
@@ -2086,17 +2092,16 @@ void Screen::decodeFrame1(const uint8 *src, uint8 *dst, uint32 size) {
while (dst < dstEnd) {
code = decodeEGAGetCode(src, nib);
- last = code & 0xff;
uint8 cmd = code >> 8;
if (cmd--) {
- code = (cmd << 8) | last;
+ code = (cmd << 8) | (code & 0xff);
uint8 *tmpDst = dst;
- last = *dst;
if (code < numPatterns) {
const uint8 *tmpSrc = patterns[code].pos;
countPrev = patterns[code].len;
+ last = *tmpSrc;
for (int i = 0; i < countPrev; i++)
*dst++ = *tmpSrc++;
@@ -2118,7 +2123,7 @@ void Screen::decodeFrame1(const uint8 *src, uint8 *dst, uint32 size) {
count = countPrev;
} else {
- *dst++ = last;
+ *dst++ = last = (code & 0xff);
if (numPatterns < 3840) {
patterns[numPatterns].pos = dstPrev;
@@ -3626,7 +3631,7 @@ void Palette::loadEGAPalette(Common::ReadStream &stream, int startIndex, int col
}
void Palette::setCGAPalette(int palIndex, CGAIntensity intensity) {
- assert(_numColors == _cgaNumColors);
+ assert(_numColors >= _cgaNumColors);
assert(!(palIndex & ~1));
memcpy(_palData, _cgaColors[palIndex * 2 + intensity], _numColors * 3);
}
diff --git a/engines/kyra/screen_eob.cpp b/engines/kyra/screen_eob.cpp
index aa94114..8721c2c 100644
--- a/engines/kyra/screen_eob.cpp
+++ b/engines/kyra/screen_eob.cpp
@@ -48,7 +48,8 @@ Screen_EoB::Screen_EoB(EoBCoreEngine *vm, OSystem *system) : Screen(vm, system,
_dsTempPage = 0;
_dsDiv = 0;
_dsRem = 0;
- _dsScaleTmp = 0;
+ _dsScaleTrans = 0;
+ _cgaScaleTable = 0;
_gfxMaxY = 0;
_egaColorMap = 0;
_egaPixelValueTable = 0;
@@ -60,6 +61,7 @@ Screen_EoB::Screen_EoB(EoBCoreEngine *vm, OSystem *system) : Screen(vm, system,
Screen_EoB::~Screen_EoB() {
delete[] _fadeData;
delete[] _dsTempPage;
+ delete[] _cgaScaleTable;
delete[] _egaColorMap;
delete[] _egaPixelValueTable;
delete[] _cgaDitheringTables[0];
@@ -71,7 +73,7 @@ bool Screen_EoB::init() {
if (Screen::init()) {
int temp;
_gfxMaxY = _vm->staticres()->loadRawData(kEoBBaseExpObjectY, temp);
-
+
if (_renderMode != Common::kRenderCGA && _renderMode != Common::kRenderEGA)
_fadeData = _vm->resource()->fileData("FADING.DAT", 0);
@@ -86,7 +88,8 @@ bool Screen_EoB::init() {
}
}
- _dsTempPage = new uint8[6000];
+ _dsTempPage = new uint8[12000];
+
if (_renderMode == Common::kRenderEGA) {
_egaColorMap = new uint8[256];
_egaPixelValueTable = new uint8[256];
@@ -97,18 +100,24 @@ bool Screen_EoB::init() {
if (_vm->game() == GI_EOB2)
_useHiResEGADithering = true;
+
} else if (_renderMode == Common::kRenderCGA) {
_cgaMappingDefault = _vm->staticres()->loadRawData(kEoB1CgaMappingDefault, temp);
_cgaDitheringTables[0] = new uint16[256];
memset(_cgaDitheringTables[0], 0, 256 * sizeof(uint16));
_cgaDitheringTables[1] = new uint16[256];
memset(_cgaDitheringTables[1], 0, 256 * sizeof(uint16));
+
_cgaDrawCharDitheringTable = new uint16[256];
memset(_cgaDrawCharDitheringTable, 0, 256 * sizeof(uint16));
-
static const uint bits[] = { 0, 3, 12, 15 };
for (int i = 0; i < 256; i++)
- WRITE_BE_UINT16(&_cgaDrawCharDitheringTable[i], (bits[i & 3] << 8) | (bits[(i >> 2) & 3] << 12) | (bits[(i >> 4) & 3] << 0) | (bits[(i >> 6) & 3] << 4));
+ _cgaDrawCharDitheringTable[i] = (bits[i & 3] << 8) | (bits[(i >> 2) & 3] << 12) | (bits[(i >> 4) & 3] << 0) | (bits[(i >> 6) & 3] << 4);
+
+ _cgaScaleTable = new uint8[256];
+ memset(_cgaScaleTable, 0, 256 * sizeof(uint8));
+ for (int i = 0; i < 256; i++)
+ _cgaScaleTable[i] = ((i & 0xf0) >> 2) | (i & 0x03);
}
return true;
@@ -126,15 +135,43 @@ void Screen_EoB::clearCurDim() {
}
void Screen_EoB::setMouseCursor(int x, int y, const byte *shape) {
+ setMouseCursor(x, y, shape, 0);
+}
+
+void Screen_EoB::setMouseCursor(int x, int y, const byte *shape, const uint8 *ovl) {
if (!shape)
return;
int mouseW = shape[2] << 3;
int mouseH = shape[3];
uint8 *cursor = new uint8[mouseW * mouseH];
fillRect(0, 0, mouseW, mouseH, _cursorColorKey, 8);
- drawShape(8, shape, 0, 0, 0);
+ drawShape(8, shape, 0, 0, 0, 2, ovl);
CursorMan.showMouse(false);
copyRegionToBuffer(8, 0, 0, mouseW, mouseH, cursor);
+
+ // Mouse cursor post processing for CGA mode. Unlike the original (which uses drawShape for the mouse cursor)
+ // the cursor manager cannot know whether a pixel value of 0 is supposed to be black or transparent. Thus, we
+ // go over the transparency mask again and turn the black pixels to color 4.
+ if (_renderMode == Common::kRenderCGA) {
+ const uint8 *maskTbl = shape + 4 + ((mouseW * mouseH) >> 2);
+ uint8 *dst = cursor;
+ uint8 trans = 0;
+ uint8 shift = 6;
+
+ uint16 mH = mouseH;
+ while (mH--) {
+ uint16 mW = mouseW;
+ while (mW--) {
+ if (shift == 6)
+ trans = *maskTbl++;
+ if (!*dst && !((trans >> shift) & 3))
+ *dst = 4;
+ dst++;
+ shift = (shift - 2) & 7;
+ }
+ }
+ }
+
CursorMan.replaceCursor(cursor, mouseW, mouseH, x, y, _cursorColorKey);
if (isMouseVisible())
CursorMan.showMouse(true);
@@ -215,13 +252,14 @@ void Screen_EoB::convertPage(int srcPage, int dstPage, const uint8 *cgaMapping)
return;
if (_renderMode == Common::kRenderCGA) {
- generateCGADitheringTables(cgaMapping);
+ if (cgaMapping)
+ generateCGADitheringTables(cgaMapping);
uint16 *d = (uint16*)dst;
- uint8 tblSwitch = 0;
+ uint8 tblSwitch = 0;
for (int height = SCREEN_H; height; height--) {
const uint16 *table = _cgaDitheringTables[(tblSwitch++) & 1];
for (int width = SCREEN_W / 2; width; width--) {
- *d++ = table[((src[0] & 0x0f) << 4) | (src[1] & 0x0f)];
+ *d++ = table[((src[1] & 0x0f) << 4) | (src[0] & 0x0f)];
src += 2;
}
}
@@ -301,14 +339,53 @@ void Screen_EoB::setScreenPalette(const Palette &pal) {
}
}
-uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4bitEncoding, const uint8 *cgaMapping) {
+uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool encode8bit, const uint8 *cgaMapping) {
uint8 *shp = 0;
uint16 shapesize = 0;
- uint8 *srcPage = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
- uint8 *src = srcPage;
+ uint8 *srcLineStart = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
+ uint8 *src = srcLineStart;
+
+ if (_renderMode == Common::kRenderCGA) {
+ if (cgaMapping)
+ generateCGADitheringTables(cgaMapping);
+ shapesize = h * (w << 2) + 4;
+ shp = new uint8[shapesize];
+ memset(shp, 0, shapesize);
+ uint8 *dst = shp;
+
+ *dst++ = 4;
+ *dst++ = (h & 0xff);
+ *dst++ = (w & 0xff);
+ *dst++ = (h & 0xff);
+
+ uint8 *dst2 = dst + (h * (w << 1));
+
+ uint8 tblSwitch = 0;
+ uint16 h1 = h;
+ while (h1--) {
+ uint16 w1 = w << 1;
+ const uint16 *table = _cgaDitheringTables[(tblSwitch++) & 1];
+
+ while (w1--) {
+ uint16 p0 = table[((src[1] & 0x0f) << 4) | (src[0] & 0x0f)];
+ uint16 p1 = table[((src[3] & 0x0f) << 4) | (src[2] & 0x0f)];
+
+ *dst++ = ((p0 & 0x0003) << 6) | ((p0 & 0x0300) >> 4) | ((p1 & 0x0003) << 2) | ((p1 & 0x0300) >> 8);
+
+ uint8 msk = 0;
+ for (int i = 0; i < 4; i++) {
+ if (!src[3 - i])
+ msk |= (3 << (i << 1));
+ }
+ *dst2++ = msk;
+ src += 4;
+ }
+ srcLineStart += SCREEN_W;
+ src = srcLineStart;
+ }
- if (no4bitEncoding) {
+ } else if (encode8bit) {
uint16 h1 = h;
while (h1--) {
uint8 *lineEnd = src + (w << 3);
@@ -326,8 +403,8 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4b
shapesize++;
} while (src != lineEnd);
- srcPage += 320;
- src = srcPage;
+ srcLineStart += SCREEN_W;
+ src = srcLineStart;
}
shapesize += 4;
@@ -336,13 +413,13 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4b
memset(shp, 0, shapesize);
uint8 *dst = shp;
- *dst++ = 0;
+ *dst++ = 8;
*dst++ = (h & 0xff);
*dst++ = (w & 0xff);
*dst++ = (h & 0xff);
- srcPage = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
- src = srcPage;
+ srcLineStart = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
+ src = srcLineStart;
h1 = h;
while (h1--) {
@@ -367,8 +444,8 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4b
*dst++ = val;
} while (src != lineEnd);
- srcPage += 320;
- src = srcPage;
+ srcLineStart += SCREEN_W;
+ src = srcLineStart;
}
} else {
@@ -381,17 +458,14 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4b
memset(shp, 0, shapesize);
uint8 *dst = shp;
- *dst++ = 1;
+ *dst++ = 2;
*dst++ = (h & 0xff);
*dst++ = (w & 0xff);
*dst++ = (h & 0xff);
memset(dst, 0xff, 0x10);
uint8 *pal = dst;
- dst += 0x10;
-
- srcPage = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
- src = srcPage;
+ dst += 16;
nib = col = 0;
uint16 h1 = h;
@@ -411,14 +485,13 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4b
}
}
- if (++nib & 1) {
+ if (++nib & 1)
*dst = c << 4;
- } else {
+ else
*dst++ |= c;
- }
}
- srcPage += 320;
- src = srcPage;
+ srcLineStart += SCREEN_W;
+ src = srcLineStart;
}
delete [] colorMap;
}
@@ -449,10 +522,11 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
int16 dX = x - (_dsX1 << 3);
int16 dY = y;
int16 dW = _dsX2 - _dsX1;
- uint8 flag = *src++;
+ uint8 pixelsPerByte = *src++ ;
uint16 dH = *src++;
uint16 width = (*src++) << 3;
+ uint16 transOffset = (pixelsPerByte == 4) ? (dH * width) >> 2 : 0;
src++;
int rX = x;
@@ -465,148 +539,7 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
int pixelStep = (flags & 1) ? -1 : 1;
- if (flag) {
- const uint8 *pal = ovl ? ovl : src;
- src += 16;
-
- if (d < 0) {
- d = -d;
- if (d >= dH)
- return;
- src += (d * (width >> 1));
- d = dY + dH - _dsY1;
- if (d >= 0) {
- dH = d;
- dY = _dsY1;
- d = _dsY2 - dY;
- }
- } else {
- d = _dsY2 - dY;
- }
-
- if (d < 1)
- return;
-
- if (d < dH)
- dH = d;
-
- int16 cnt1 = 0;
- int16 cnt2 = 0;
- int16 dXbit1 = dX & 1;
-
- if (dX < 0) {
- width += dX;
- d = -dX;
- if (flags & 1)
- src -= (d >> 1);
- else
- src += (d >> 1);
-
- if (d >= w2)
- return;
-
- dX = 0;
- cnt1++;
- }
-
- d = (dW << 3) - dX;
-
- if (d < 1)
- return;
-
- if (d < width) {
- width = d;
- cnt2++;
- }
-
- dst += (dY * 320 + dX);
-
- if (pageNum == 0 || pageNum == 1)
- addDirtyRect(rX, rY, rW, rH);
-
- int w3 = w2;
- dY = 320 - width;
- width >>= 1;
- w2 >>= 1;
- if (flags & 1)
- src += (w2 - 1);
-
- int16 w1shr = width;
-
- if (cnt1 && (dXbit1 & 1)) {
- w1shr++;
- w2++;
- if (!cnt2)
- dY += 2;
- }
-
- if (cnt2 && (dXbit1 & 1))
- w1shr++;
-
- int lineSrcStep = (w2 - w1shr);
- if (flags & 1)
- lineSrcStep = w3 - lineSrcStep;
-
- while (dH--) {
- int16 hpos = width;
- uint8 col = 0;
- uint8 b = 0;
- uint8 nextloop = 0;
-
- if (cnt1 && dXbit1) {
- if (!hpos)
- return;
- b = *src;
- src += pixelStep;
- nextloop = 2;
- } else {
- nextloop = hpos ? 1 : 3;
- }
-
- while (nextloop) {
- switch (nextloop) {
- case 1:
- b = *src;
- src += pixelStep;
- col = pal[(flags & 1) ? (b & 0x0f) : (b >> 4)];
- if (col)
- drawShapeSetPixel(dst, col);
- dst++;
-
- case 2:
- col = pal[(flags & 1) ? (b >> 4) : (b & 0x0f)];
-
- if (!col) {
- nextloop = 4;
- break;
- }
-
- drawShapeSetPixel(dst++, col);
- nextloop = --hpos ? 1 : 3;
- break;
-
- case 3:
- if (cnt2 && dXbit1) {
- col = pal[(flags & 1) ? (*src & 0x0f) : (*src >> 4)];
- src += pixelStep;
- if (col)
- drawShapeSetPixel(dst, col);
- dst++;
- }
-
- src += lineSrcStep;
- dst += dY;
- nextloop = 0;
- break;
-
- case 4:
- dst++;
- nextloop = --hpos ? 1 : 3;
- break;
- }
- }
- }
- } else {
+ if (pixelsPerByte == 8) {
uint16 marginLeft = 0;
uint16 marginRight = 0;
@@ -740,6 +673,127 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
if (flags & 1)
src = src2 + 1;
}
+ } else {
+ const uint8 *pal = 0;
+ uint8 cgaPal[4];
+ memset(cgaPal, 0, 4);
+
+ if (pixelsPerByte == 2) {
+ pal = ovl ? ovl : src;
+ src += 16;
+ } else {
+ static const uint8 cgaDefOvl[] = { 0x00, 0x55, 0xaa, 0xff };
+ pal = ovl ? ovl : cgaDefOvl;
+ for (int i = 0; i < 4; i++)
+ cgaPal[i] = pal[i] & 3;
+ pal = cgaPal;
+ }
+
+ if (d < 0) {
+ d = -d;
+ if (d >= dH)
+ return;
+ src += (d * (width / pixelsPerByte));
+ d = dY + dH - _dsY1;
+ if (d >= 0) {
+ dH = d;
+ dY = _dsY1;
+ d = _dsY2 - dY;
+ }
+ } else {
+ d = _dsY2 - dY;
+ }
+
+ if (d < 1)
+ return;
+
+ if (d < dH)
+ dH = d;
+
+ bool trimL = false;
+ uint8 dXbitAlign = dX & (pixelsPerByte - 1);
+
+ if (dX < 0) {
+ width += dX;
+ d = -dX;
+ if (flags & 1)
+ src -= (d / pixelsPerByte);
+ else
+ src += (d / pixelsPerByte);
+
+ if (d >= w2)
+ return;
+
+ dX = 0;
+ trimL = true;
+ }
+
+ d = (dW << 3) - dX;
+
+ if (d < 1)
+ return;
+
+ if (d < width)
+ width = d;
+
+ dst += (dY * 320 + dX);
+
+ if (pageNum == 0 || pageNum == 1)
+ addDirtyRect(rX, rY, rW, rH);
+
+ int pitch = 320 - width;
+ int16 lineSrcStep = (w2 - width) / pixelsPerByte;
+ uint8 lineSrcStepRemainder = (w2 - width) % pixelsPerByte;
+
+ w2 /= pixelsPerByte;
+ if (flags & 1)
+ src += (w2 - 1);
+
+ uint8 pixelPacking = 8 / pixelsPerByte;
+ uint8 pixelPackingMask = 0;
+
+ for (int i = 0; i < pixelPacking; i++)
+ pixelPackingMask |= (1 << i);
+
+ if (trimL && (dXbitAlign > lineSrcStepRemainder))
+ lineSrcStep--;
+
+ uint8 bitShDef = 8 - pixelPacking;
+ if (flags & 1) {
+ lineSrcStep = (w2 << 1) - lineSrcStep;
+ bitShDef = 0;
+ }
+
+ uint8 bitShLineStart = bitShDef;
+ if (trimL)
+ bitShLineStart -= (dXbitAlign * pixelStep * pixelPacking);
+
+ while (dH--) {
+ int16 wd = width;
+ uint8 in = 0;
+ uint8 trans = 0;
+ uint8 shift = bitShLineStart;
+ uint8 shSwtch = bitShLineStart;
+
+ while (wd--) {
+ if (shift == shSwtch) {
+ in = *src;
+ trans = src[transOffset];
+ src += pixelStep;
+ shSwtch = bitShDef;
+ }
+ if (pixelsPerByte == 2) {
+ if (pal[(in >> shift) & pixelPackingMask])
+ drawShapeSetPixel(dst, pal[(in >> shift) & pixelPackingMask]);
+ } else {
+ *dst = (*dst & ((trans >> shift) & (pixelPackingMask))) | pal[(in >> shift) & pixelPackingMask];
+ }
+ dst++;
+ shift = (shift - (pixelStep * pixelPacking) & 7);
+ }
+ src += lineSrcStep;
+ dst += pitch;
+ }
}
}
@@ -753,69 +807,75 @@ const uint8 *Screen_EoB::scaleShape(const uint8 *shapeData, int steps) {
}
const uint8 *Screen_EoB::scaleShapeStep(const uint8 *shp) {
- uint8 *d = _dsTempPage;
- *d++ = *shp++;
+ uint8 *dst = (shp != _dsTempPage) ? _dsTempPage : _dsTempPage + 6000;
+ uint8 *d = dst;
+ uint8 pixelsPerByte = *d++ = *shp++;
+ assert (pixelsPerByte > 1);
- uint16 h = (*shp++) + 1;
+ uint16 h = shp[0] + 1;
d[0] = d[2] = (h << 1) / 3;
- d++;
- uint16 w = *shp++;
- uint16 w2 = w << 2;
+ uint16 w = shp[1];
+ uint16 w2 = (w << 3) / pixelsPerByte;
uint16 t = ((w << 1) % 3) ? 1 : 0;
- *d++ = ((w << 1) / 3) + t;
-
- shp++;
- d++;
-
- int i = 0;
- while (i < 16) {
- if (!shp[i]) {
- i = -i;
- break;
+ d[1] = ((w << 1) / 3) + t;
+
+ uint32 transOffsetSrc = (pixelsPerByte == 4) ? (shp[0] * shp[1]) << 1 : 0;
+ uint32 transOffsetDst = (pixelsPerByte == 4) ? (d[0] * d[1]) << 1 : 0;
+ shp += 3;
+ d += 3;
+
+ if (pixelsPerByte == 2) {
+ int i = 0;
+ while (i < 16) {
+ if (!shp[i]) {
+ i = -i;
+ break;
+ }
+ i++;
}
- i++;
- }
- if (i >= 0)
- i = 0;
- else
- i = -i;
+ if (i >= 0)
+ i = 0;
+ else
+ i = -i;
- _dsScaleTmp = (i << 4) | (i & 0x0f);
- for (int ii = 0; ii < 16; ii++)
- *d++ = *shp++;
+ _dsScaleTrans = (i << 4) | (i & 0x0f);
+ for (int ii = 0; ii < 16; ii++)
+ *d++ = *shp++;
+ }
_dsDiv = w2 / 3;
_dsRem = w2 % 3;
while (--h) {
- scaleShapeProcessLine(d, shp);
+ if (pixelsPerByte == 2)
+ scaleShapeProcessLine4Bit(d, shp);
+ else
+ scaleShapeProcessLine2Bit(d, shp, transOffsetDst, transOffsetSrc);
if (!--h)
break;
- scaleShapeProcessLine(d, shp);
+ if (pixelsPerByte == 2)
+ scaleShapeProcessLine4Bit(d, shp);
+ else
+ scaleShapeProcessLine2Bit(d, shp, transOffsetDst, transOffsetSrc);
if (!--h)
break;
shp += w2;
}
- return (const uint8 *)_dsTempPage;
+ return (const uint8*)dst;
}
-void Screen_EoB::replaceShapePalette(uint8 *shp, const uint8 *pal) {
- if (*shp != 1)
- return;
- shp += 4;
- memcpy(shp, pal, 16);
-}
+const uint8 *Screen_EoB::generateShapeOverlay(const uint8 *shp, int paletteOverlayIndex) {
+ if (*shp != 2)
+ return 0;
-void Screen_EoB::applyShapeOverlay(uint8 *shp, int ovlIndex) {
- if (*shp != 1)
- return;
shp += 4;
- uint8 *ovl = getFadeTable(ovlIndex);
+ uint8 *ovl = getFadeTable(paletteOverlayIndex);
for (int i = 0; i < 16; i++)
- shp[i] = ovl[shp[i]];
+ _shapeOverlay[i] = ovl[shp[i]];
+ return _shapeOverlay;
}
void Screen_EoB::setShapeFrame(int x1, int y1, int x2, int y2) {
@@ -1187,6 +1247,10 @@ uint8 *Screen_EoB::getFadeTable(int index) {
return (index >= 0 && index < 5) ? &_fadeData[index << 8] : 0;
}
+const uint16 *Screen_EoB::getCGADitheringTable(int index) {
+ return !(index & ~1) ? _cgaDitheringTables[index] : 0;
+}
+
void Screen_EoB::drawShapeSetPixel(uint8 *dst, uint8 c) {
if (_shapeFadeMode[0]) {
if (_shapeFadeMode[1]) {
@@ -1206,7 +1270,35 @@ void Screen_EoB::drawShapeSetPixel(uint8 *dst, uint8 c) {
*dst = c;
}
-void Screen_EoB::scaleShapeProcessLine(uint8 *&dst, const uint8 *&src) {
+void Screen_EoB::scaleShapeProcessLine2Bit(uint8 *&shpDst, const uint8 *&shpSrc, uint32 transOffsetDst, uint32 transOffsetSrc) {
+ for (int i = 0; i < _dsDiv; i++) {
+ shpDst[0] = (_cgaScaleTable[shpSrc[0]] << 2) | (shpSrc[1] >> 6);
+ shpDst[1] = ((shpSrc[1] & 0x0f) << 4) | ((shpSrc[2] >> 2) & 0x0f);
+ shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | (shpSrc[transOffsetSrc + 1] >> 6);
+ shpDst[transOffsetDst + 1] = ((shpSrc[transOffsetSrc + 1] & 0x0f) << 4) | ((shpSrc[transOffsetSrc + 2] >> 2) & 0x0f);
+ shpSrc += 3;
+ shpDst += 2;
+ }
+
+ if (_dsRem == 1) {
+ shpDst[0] = _cgaScaleTable[shpSrc[0]] << 2;
+ shpDst[1] = 0;
+ shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | 3;
+ shpDst[transOffsetDst + 1] = 0xff;
+ shpSrc++;
+ shpDst += 2;
+
+ } else if (_dsRem == 2) {
+ shpDst[0] = (_cgaScaleTable[shpSrc[0]] << 2) | (shpSrc[1] >> 6);
+ shpDst[1] = (shpSrc[1] & 0x3f) << 2;
+ shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | (shpSrc[transOffsetSrc + 1] >> 6);
+ shpDst[transOffsetDst + 1] = ((shpSrc[transOffsetSrc + 1] & 0x3f) << 2) | 3;
+ shpSrc += 2;
+ shpDst += 2;
+ }
+}
+
+void Screen_EoB::scaleShapeProcessLine4Bit(uint8 *&dst, const uint8 *&src) {
for (int i = 0; i < _dsDiv; i++) {
*dst++ = *src++;
*dst++ = (READ_BE_UINT16(src) >> 4) & 0xff;
@@ -1215,13 +1307,13 @@ void Screen_EoB::scaleShapeProcessLine(uint8 *&dst, const uint8 *&src) {
if (_dsRem == 1) {
*dst++ = *src++;
- *dst++ = _dsScaleTmp;
+ *dst++ = _dsScaleTrans;
} else if (_dsRem == 2) {
*dst++ = (src[0] & 0xf0) | (src[1] >> 4);
src += 2;
- *dst++ = _dsScaleTmp;
- *dst++ = _dsScaleTmp;
- *dst++ = _dsScaleTmp;
+ *dst++ = _dsScaleTrans;
+ *dst++ = _dsScaleTrans;
+ *dst++ = _dsScaleTrans;
}
}
@@ -1233,8 +1325,8 @@ bool Screen_EoB::posWithinRect(int posX, int posY, int x1, int y1, int x2, int y
void Screen_EoB::generateCGADitheringTables(const uint8 *mappingData) {
for (int i = 0; i < 256; i++) {
- WRITE_BE_UINT16(&_cgaDitheringTables[0][i], (mappingData[i >> 4] << 8) | mappingData[(i & 0x0f) + 16]);
- WRITE_BE_UINT16(&_cgaDitheringTables[1][i], (mappingData[(i >> 4) + 16] << 8) | mappingData[i & 0x0f]);
+ _cgaDitheringTables[0][i] = (mappingData[(i >> 4) + 16] << 8) | mappingData[i & 0x0f];
+ _cgaDitheringTables[1][i] = (mappingData[i >> 4] << 8) | mappingData[(i & 0x0f) + 16];
}
}
@@ -1406,7 +1498,7 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
uint8 in = s | last;
uint16 cmp1 = 0;
uint16 cmp2 = 0;
-
+
if (color1) {
in &= m;
cmp1 = _cgaDitheringTable[in];
@@ -1418,18 +1510,18 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
}
uint16 cDst = 0;
- uint8 sh = 14;
+ uint8 sh = 6;
for (int i = 0; i < _width; i++) {
cDst |= ((dst[i] & 3) << sh);
- sh -= 2;
+ sh = (sh - 2) & 0x0f;
}
uint16 out = (~(cmp1 | cmp2) & cDst) | (cmp1 & cgaMask1) | (cmp2 & cgaMask2);
- sh = 14;
+ sh = 6;
for (int i = 0; i < _width; i++) {
*dst++ = (out >> sh) & 3;
- sh -= 2;
+ sh = (sh - 2) & 0x0f;
}
last = s;
diff --git a/engines/kyra/screen_eob.h b/engines/kyra/screen_eob.h
index 1b55806..dc6c4b2 100644
--- a/engines/kyra/screen_eob.h
+++ b/engines/kyra/screen_eob.h
@@ -41,6 +41,7 @@ public:
void clearCurDim();
void setMouseCursor(int x, int y, const byte *shape);
+ void setMouseCursor(int x, int y, const byte *shape, const uint8 *ovl);
void loadFileDataToPage(Common::SeekableReadStream *s, int pageNum, uint32 size);
@@ -52,12 +53,11 @@ public:
void setScreenPalette(const Palette &pal);
- uint8 *encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool no4bitEncoding = false, const uint8 *cgaMapping = 0);
+ uint8 *encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool encode8bit = false, const uint8 *cgaMapping = 0);
void drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int sd = -1, int flags = 0, ...);
const uint8 *scaleShape(const uint8 *shapeData, int blockDistance);
const uint8 *scaleShapeStep(const uint8 *shp);
- void replaceShapePalette(uint8 *shp, const uint8 *pal);
- void applyShapeOverlay(uint8 *shp, int ovlIndex);
+ const uint8 *generateShapeOverlay(const uint8 *shp, int paletteOverlayIndex);
void setShapeFrame(int x1, int y1, int x2, int y2);
void setShapeFadeMode (uint8 i, bool b);
@@ -75,15 +75,18 @@ public:
void setFadeTableIndex(int index);
void createFadeTable(uint8 *palData, uint8 *dst, uint8 rootColor, uint8 weight);
uint8 *getFadeTable(int index);
+ const uint16 *getCGADitheringTable(int index);
private:
void drawShapeSetPixel(uint8 *dst, uint8 c);
- void scaleShapeProcessLine(uint8 *&dst, const uint8 *&src);
+ void scaleShapeProcessLine2Bit(uint8 *&shpDst, const uint8 *&shpSrc, uint32 transOffsetDst, uint32 transOffsetSrc);
+ void scaleShapeProcessLine4Bit(uint8 *&dst, const uint8 *&src);
bool posWithinRect(int posX, int posY, int x1, int y1, int x2, int y2);
void generateCGADitheringTables(const uint8 *mappingData);
- int _dsDiv, _dsRem, _dsScaleTmp;
+ int _dsDiv, _dsRem, _dsScaleTrans;
+ uint8 *_cgaScaleTable;
int16 _gfxX, _gfxY;
uint8 _gfxCol;
const uint8 *_gfxMaxY;
@@ -93,12 +96,13 @@ private:
uint16 _shapeFadeInternal;
uint8 *_fadeData;
int _fadeDataIndex;
+ uint8 _shapeOverlay[16];
uint8 *_dsTempPage;
uint16 *_cgaDitheringTables[2];
const uint8 *_cgaMappingDefault;
-
+
uint8 *_egaColorMap;
uint8 *_egaPixelValueTable;
bool _useHiResEGADithering;
diff --git a/engines/kyra/sequences_eob.cpp b/engines/kyra/sequences_eob.cpp
index 195c44e..aa8d18f 100644
--- a/engines/kyra/sequences_eob.cpp
+++ b/engines/kyra/sequences_eob.cpp
@@ -1099,6 +1099,7 @@ void EoBEngine::seq_xdeath() {
_screen->loadShapeSetBitmap("XDEATH3", 5, 3);
shapes2 = _screen->encodeShape(22, 0, 16, 95, true, _cgaMappingDefault);
_screen->loadEoBBitmap("XDEATH1", _cgaMappingDefault, 5, 3, -1);
+ _screen->convertPage(3, 2, _cgaMappingDefault);
_screen->setCurPage(0);
for (int i = 0; i < 10; i++) {
diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp
index 9e450a5..40fc7c1 100644
--- a/engines/kyra/sprites_eob.cpp
+++ b/engines/kyra/sprites_eob.cpp
@@ -342,9 +342,9 @@ void EoBCoreEngine::drawMonsterShape(const uint8 *shape, int x, int y, int flipp
uint8 *ovl = 0;
if (flags & 2)
- ovl = _monsterOvl1;
+ ovl = _monsterFlashOverlay;
else if (_flags.gameID == GI_EOB2 && flags & 0x20)
- ovl = _monsterOvl2;
+ ovl = _monsterStoneOverlay;
else if (palIndex != -1)
ovl = _monsterPalettes[palIndex];
diff --git a/engines/kyra/staticres_eob.cpp b/engines/kyra/staticres_eob.cpp
index 5e28757..7a5012f 100644
--- a/engines/kyra/staticres_eob.cpp
+++ b/engines/kyra/staticres_eob.cpp
@@ -198,6 +198,10 @@ const uint8 EoBCoreEngine::_charClassModifier[] = {
0x00, 0x00, 0x02
};
+const uint8 EoBCoreEngine::_itemsOverlayCGA[] = {
+ 0x00, 0x55, 0x55, 0xFF
+};
+
const uint8 EoBCoreEngine::_teleporterShapeDefs[] = {
0x0C, 0x58, 0x02, 0x0E,
0x0C, 0x67, 0x01, 0x07,
@@ -1181,11 +1185,16 @@ void EoBEngine::initSpells() {
}
}
-const KyraRpgGUISettings EoBEngine::_guiSettings = {
+const KyraRpgGUISettings EoBEngine::_guiSettingsVGA = {
{ 9, 15, 95, 9, 7, { 285, 139 }, { 189, 162 }, { 31, 31 } },
{ 135, 130, 132, 133, 133, 17, 23, 20, 184, 177, 180, 184, 177, 180 }
};
+const KyraRpgGUISettings EoBEngine::_guiSettingsEGA = {
+ { 9, 15, 95, 9, 7, { 285, 139 }, { 189, 162 }, { 31, 31 } },
+ { 13, 9, 2, 133, 2, 6, 13, 8, 13, 15, 14, 13, 15, 14 }
+};
+
const uint8 EoBEngine::_egaDefaultPalette[] = {
0, 5, 3, 2, 10, 14, 12, 6, 4, 11, 9, 1, 0, 8, 7, 15
};
Commit: a4223e9c2ba7d53097df95a3f640ffdba7d0fb20
https://github.com/scummvm/scummvm/commit/a4223e9c2ba7d53097df95a3f640ffdba7d0fb20
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:42-08:00
Commit Message:
KYRA: (EOB) - fix EOB1 door clipping
(this was done in the same way as in EOB2 and LOL, but it has to be slightly different)
Changed paths:
devtools/create_kyradat/create_kyradat.cpp
devtools/create_kyradat/create_kyradat.h
devtools/create_kyradat/games.cpp
devtools/create_kyradat/tables.cpp
dists/engine-data/kyra.dat
engines/kyra/eob.cpp
engines/kyra/kyra_rpg.cpp
engines/kyra/kyra_rpg.h
engines/kyra/resource.h
engines/kyra/scene_lol.cpp
engines/kyra/scene_rpg.cpp
engines/kyra/sprites_eob.cpp
engines/kyra/staticres.cpp
engines/kyra/staticres_rpg.cpp
diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp
index a3d88c7..489be3e 100644
--- a/devtools/create_kyradat/create_kyradat.cpp
+++ b/devtools/create_kyradat/create_kyradat.cpp
@@ -45,7 +45,7 @@
#include <map>
enum {
- kKyraDatVersion = 81
+ kKyraDatVersion = 82
};
const ExtractFilename extractFilenames[] = {
@@ -656,6 +656,10 @@ const ExtractFilename extractFilenames[] = {
{ kRpgCommonDscBlockIndex, kTypeRawData, false },
{ kLoLDscDoor4, kLoLTypeRaw16, false },
{ kRpgCommonDscDoorY2, kTypeRawData, false },
+ { kRpgCommonDscDoorFrameY1, kTypeRawData, false },
+ { kRpgCommonDscDoorFrameY2, kTypeRawData, false },
+ { kRpgCommonDscDoorFrameIndex1, kTypeRawData, false },
+ { kRpgCommonDscDoorFrameIndex2, kTypeRawData, false },
{ kLoLDscDoorX, kLoLTypeRaw16, false },
{ kLoLDscDoorY, kLoLTypeRaw16, false },
@@ -1786,7 +1790,7 @@ const char *getIdString(const int id) {
case kEoB1CgaMappingIcons:
return "kEoB1CgaMappingIcons";
case kEoB1CgaMappingDeco:
- return "kEoB1CgaMappingDeco";
+ return "kEoB1CgaMappingDeco";
case kEoB1CgaLevelMappingIndex:
return "kEoB1CgaLevelMappingIndex";
case kEoB1CgaMappingLevel0:
@@ -2165,6 +2169,14 @@ const char *getIdString(const int id) {
return "kRpgCommonDscBlockIndex";
case kRpgCommonDscDoorY2:
return "kRpgCommonDscDoorY2";
+ case kRpgCommonDscDoorFrameY1:
+ return "kRpgCommonDscDoorFrameY1";
+ case kRpgCommonDscDoorFrameY2:
+ return "kRpgCommonDscDoorFrameY2";
+ case kRpgCommonDscDoorFrameIndex1:
+ return "kRpgCommonDscDoorFrameIndex1";
+ case kRpgCommonDscDoorFrameIndex2:
+ return "kRpgCommonDscDoorFrameIndex2";
case kLoLDscDoorScale:
return "kLoLDscDoorScale";
case kLoLDscDoor4:
diff --git a/devtools/create_kyradat/create_kyradat.h b/devtools/create_kyradat/create_kyradat.h
index 83ee285..c2a69cf 100644
--- a/devtools/create_kyradat/create_kyradat.h
+++ b/devtools/create_kyradat/create_kyradat.h
@@ -190,6 +190,10 @@ enum kExtractID {
kRpgCommonDscBlockMap,
kRpgCommonDscDimMap,
kRpgCommonDscDoorY2,
+ kRpgCommonDscDoorFrameY1,
+ kRpgCommonDscDoorFrameY2,
+ kRpgCommonDscDoorFrameIndex1,
+ kRpgCommonDscDoorFrameIndex2,
kRpgCommonDscBlockIndex,
kEoBBaseChargenStrings1,
diff --git a/devtools/create_kyradat/games.cpp b/devtools/create_kyradat/games.cpp
index a45cb80..258d2dd 100644
--- a/devtools/create_kyradat/games.cpp
+++ b/devtools/create_kyradat/games.cpp
@@ -827,6 +827,8 @@ const int lolFloppyNeed[] = {
kLoLDscOvlIndex,
kRpgCommonDscBlockIndex,
kRpgCommonDscDoorY2,
+ kRpgCommonDscDoorFrameY1,
+ kRpgCommonDscDoorFrameY2,
kLoLDscDoorScale,
kLoLDscDoor4,
kLoLDscDoorX,
@@ -907,6 +909,8 @@ const int lolPC98Need[] = {
kLoLDscOvlIndex,
kRpgCommonDscBlockIndex,
kRpgCommonDscDoorY2,
+ kRpgCommonDscDoorFrameY1,
+ kRpgCommonDscDoorFrameY2,
kLoLDscDoorScale,
kLoLDscDoor4,
kLoLDscDoorX,
@@ -992,6 +996,8 @@ const int lolCDNeed[] = {
kLoLDscOvlIndex,
kRpgCommonDscBlockIndex,
kRpgCommonDscDoorY2,
+ kRpgCommonDscDoorFrameY1,
+ kRpgCommonDscDoorFrameY2,
kLoLDscDoorScale,
kLoLDscDoor4,
kLoLDscDoorX,
@@ -1253,6 +1259,10 @@ const int eob1FloppyNeed[] = {
kEoBBaseDscDoorY6,
kEoBBaseDscDoorY7,
kEoBBaseDscDoorCoordsExt,
+ kRpgCommonDscDoorFrameY1,
+ kRpgCommonDscDoorFrameY2,
+ kRpgCommonDscDoorFrameIndex1,
+ kRpgCommonDscDoorFrameIndex2,
kEoBBaseDscItemPosIndex,
kEoBBaseDscItemShpX,
@@ -1472,6 +1482,8 @@ const int eob2FloppyNeed[] = {
kEoBBaseDscDoorType5Offs,
kEoBBaseDscDoorY1,
kRpgCommonDscDoorY2,
+ kRpgCommonDscDoorFrameY1,
+ kRpgCommonDscDoorFrameY2,
kEoBBaseDscItemPosIndex,
kEoBBaseDscItemShpX,
diff --git a/devtools/create_kyradat/tables.cpp b/devtools/create_kyradat/tables.cpp
index b1b542d..1b9ca45 100644
--- a/devtools/create_kyradat/tables.cpp
+++ b/devtools/create_kyradat/tables.cpp
@@ -3647,6 +3647,28 @@ const ExtractEntrySearchData kRpgCommonDscDoorY2Provider[] = {
EXTRACT_END_ENTRY
};
+const ExtractEntrySearchData kRpgCommonDscDoorFrameY1Provider[] = {
+ { UNK_LANG, kPlatformUnknown, { 0x00000020, 0x0000053B, { { 0xF0, 0x9E, 0xC5, 0xB1, 0xEA, 0x5A, 0x58, 0xBD, 0xAC, 0x7B, 0xB2, 0xD4, 0xFE, 0x3F, 0x4F, 0x51 } } } }, // EOB I
+ { UNK_LANG, kPlatformUnknown, { 0x00000004, 0x00000046, { { 0xD4, 0xA4, 0xEC, 0xA2, 0x99, 0xB6, 0x5E, 0x12, 0x98, 0xFF, 0xF2, 0x55, 0xC8, 0xBD, 0xC5, 0x8F } } } }, // EOB II
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kRpgCommonDscDoorFrameY2Provider[] = {
+ { UNK_LANG, kPlatformUnknown, { 0x00000020, 0x0000053B, { { 0xF0, 0x9E, 0xC5, 0xB1, 0xEA, 0x5A, 0x58, 0xBD, 0xAC, 0x7B, 0xB2, 0xD4, 0xFE, 0x3F, 0x4F, 0x51 } } } }, // EOB I
+ { UNK_LANG, kPlatformUnknown, { 0x00000004, 0x00000150, { { 0x49, 0x7E, 0xF4, 0xDF, 0x8D, 0x04, 0x0A, 0xCE, 0x49, 0xBB, 0xA2, 0x1D, 0x8D, 0xC2, 0x14, 0x9E } } } }, // EOB II
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kRpgCommonDscDoorFrameIndex1Provider[] = {
+ { UNK_LANG, kPlatformUnknown, { 0x0000000C, 0x00000058, { { 0xC9, 0xAF, 0x1F, 0x68, 0xF1, 0xDE, 0x96, 0x9B, 0x3B, 0xCB, 0x56, 0xEC, 0x2E, 0x62, 0x9A, 0x0A } } } },
+ EXTRACT_END_ENTRY
+};
+
+const ExtractEntrySearchData kRpgCommonDscDoorFrameIndex2Provider[] = {
+ { UNK_LANG, kPlatformUnknown, { 0x0000000C, 0x000000E8, { { 0x8C, 0x10, 0x56, 0xEA, 0x4D, 0x1A, 0x9C, 0xB2, 0x55, 0x54, 0xA5, 0x61, 0x1D, 0x19, 0x4E, 0x50 } } } },
+ EXTRACT_END_ENTRY
+};
+
const ExtractEntrySearchData kLoLDscDoorScaleProvider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000010, 0x0000024C, { { 0x8D, 0x83, 0x26, 0xEE, 0xDC, 0xF7, 0x13, 0xC0, 0xAA, 0x88, 0xC2, 0xAA, 0x66, 0xA7, 0x59, 0x41 } } } },
@@ -4382,6 +4404,10 @@ const ExtractEntry extractProviders[] = {
{ kLoLDscOvlIndex, kLoLDscOvlIndexProvider },
{ kRpgCommonDscBlockIndex, kRpgCommonDscBlockIndexProvider },
{ kRpgCommonDscDoorY2, kRpgCommonDscDoorY2Provider },
+ { kRpgCommonDscDoorFrameY1, kRpgCommonDscDoorFrameY1Provider },
+ { kRpgCommonDscDoorFrameY2, kRpgCommonDscDoorFrameY2Provider },
+ { kRpgCommonDscDoorFrameIndex1, kRpgCommonDscDoorFrameIndex1Provider },
+ { kRpgCommonDscDoorFrameIndex2, kRpgCommonDscDoorFrameIndex2Provider },
{ kLoLDscDoorScale, kLoLDscDoorScaleProvider },
{ kLoLDscDoor4, kLoLDscDoor4Provider },
{ kLoLDscDoorX, kLoLDscDoorXProvider },
diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat
index 2fc6791..c89b21c 100644
Binary files a/dists/engine-data/kyra.dat and b/dists/engine-data/kyra.dat differ
diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp
index 769e77e..9e58aff 100644
--- a/engines/kyra/eob.cpp
+++ b/engines/kyra/eob.cpp
@@ -421,7 +421,7 @@ void EoBEngine::drawDoorIntern(int type, int index, int x, int y, int w, int wal
d1 = x - (_doorShapes[shapeIndex + 3][2] << 2);
x -= (shp[2] << 2);
drawBlockObject(0, 2, _doorShapes[shapeIndex + 3], d1, y, 5);
- scaleLevelShapesDim(index, y1, y2, 5);
+ setDoorShapeDim(index, y1, y2, 5);
y = _dscDoorY3[mDim] - ((wall < 30) ? (wall - _dscDoorScaleOffs[wall]) * _dscDoorScaleMult1[mDim] : _dscDoorScaleMult2[mDim]);
drawBlockObject(0, 2, shp, x, y, 5);
if (_wllShapeMap[wall] == -1)
diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp
index a885eb9..1e3890b 100644
--- a/engines/kyra/kyra_rpg.cpp
+++ b/engines/kyra/kyra_rpg.cpp
@@ -94,6 +94,10 @@ KyraRpgEngine::KyraRpgEngine(OSystem *system, const GameFlags &flags) : KyraEngi
_dscDimMap = 0;
_dscDoorShpIndex = 0;
_dscDoorY2 = 0;
+ _dscDoorFrameY1 = 0;
+ _dscDoorFrameY2 = 0;
+ _dscDoorFrameIndex1 = 0;
+ _dscDoorFrameIndex2 = 0;
_shpDmX1 = _shpDmX2 = 0;
diff --git a/engines/kyra/kyra_rpg.h b/engines/kyra/kyra_rpg.h
index aec34fc..f4678e3 100644
--- a/engines/kyra/kyra_rpg.h
+++ b/engines/kyra/kyra_rpg.h
@@ -183,7 +183,7 @@ protected:
virtual const uint8 *getBlockFileData(int levelIndex) = 0;
void setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim);
- void scaleLevelShapesDim(int index, int16 &y1, int16 &y2, int dim);
+ void setDoorShapeDim(int index, int16 &y1, int16 &y2, int dim);
void drawLevelModifyScreenDim(int dim, int16 x1, int16 y1, int16 x2, int16 y2);
void generateBlockDrawingBuffer();
void generateVmpTileData(int16 startBlockX, uint8 startBlockY, uint8 wllVmpIndex, int16 vmpOffset, uint8 numBlocksX, uint8 numBlocksY);
@@ -271,6 +271,10 @@ protected:
const uint8 *_dscDoorShpIndex;
int _dscDoorShpIndexSize;
const uint8 *_dscDoorY2;
+ const uint8 *_dscDoorFrameY1;
+ const uint8 *_dscDoorFrameY2;
+ const uint8 *_dscDoorFrameIndex1;
+ const uint8 *_dscDoorFrameIndex2;
// Script
virtual void runLevelScript(int block, int flags) = 0;
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index 8459288..f2bc4e8 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -263,6 +263,10 @@ enum KyraResources {
kRpgCommonDscBlockMap,
kRpgCommonDscDimMap,
kRpgCommonDscDoorY2,
+ kRpgCommonDscDoorFrameY1,
+ kRpgCommonDscDoorFrameY2,
+ kRpgCommonDscDoorFrameIndex1,
+ kRpgCommonDscDoorFrameIndex2,
kRpgCommonDscBlockIndex,
kEoBBaseChargenStrings1,
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index 7988471..628654f 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -1436,7 +1436,7 @@ void LoLEngine::drawSceneShapes(int) {
if (v > 80)
v = 80;
- scaleLevelShapesDim(t, dimY1, dimY2, _sceneShpDim);
+ setDoorShapeDim(t, dimY1, dimY2, _sceneShpDim);
drawDoor(_doorShapes[(s < 23 ? _dscDoorShpIndex[s] : 0)], 0, t, 10, 0, -v, 2);
setLevelShapesDim(t, dimY1, dimY2, _sceneShpDim);
}
diff --git a/engines/kyra/scene_rpg.cpp b/engines/kyra/scene_rpg.cpp
index 269a5d3..7f6b16b 100644
--- a/engines/kyra/scene_rpg.cpp
+++ b/engines/kyra/scene_rpg.cpp
@@ -51,7 +51,7 @@ void KyraRpgEngine::setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim)
if (t > x1) {
x1 = t;
if (!(a & 0x10))
- scaleLevelShapesDim(index, y1, y2, -1);
+ setDoorShapeDim(index, y1, y2, -1);
}
t = _dscDim2[((m + i) << 1) + 1];
@@ -59,7 +59,7 @@ void KyraRpgEngine::setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim)
if (t < x2) {
x2 = t;
if (!(a & 0x10))
- scaleLevelShapesDim(index, y1, y2, -1);
+ setDoorShapeDim(index, y1, y2, -1);
}
} else {
int t = _dscDim1[m + i];
@@ -100,17 +100,20 @@ void KyraRpgEngine::setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim)
drawLevelModifyScreenDim(dim, x1, 0, x2, 15);
}
-void KyraRpgEngine::scaleLevelShapesDim(int index, int16 &y1, int16 &y2, int dim) {
- static const int8 dscY1[] = { 0x1E, 0x18, 0x10, 0x00 };
- static const int8 dscY2[] = { 0x3B, 0x47, 0x56, 0x78 };
-
+void KyraRpgEngine::setDoorShapeDim(int index, int16 &y1, int16 &y2, int dim) {
uint8 a = _dscDimMap[index];
- if (dim == -1 && a != 3)
+ if (_flags.gameID != GI_EOB1 && dim == -1 && a != 3)
a++;
- y1 = dscY1[a];
- y2 = dscY2[a];
+ uint8 b = a;
+ if (_flags.gameID == GI_EOB1) {
+ a += _dscDoorFrameIndex1[_currentLevel - 1];
+ b += _dscDoorFrameIndex2[_currentLevel - 1];
+ }
+
+ y1 = _dscDoorFrameY1[a];
+ y2 = _dscDoorFrameY2[b];
if (dim == -1)
return;
diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp
index 40fc7c1..068647a 100644
--- a/engines/kyra/sprites_eob.cpp
+++ b/engines/kyra/sprites_eob.cpp
@@ -462,7 +462,7 @@ void EoBCoreEngine::drawDoor(int index) {
int16 y1 = 0;
int16 y2 = 0;
- scaleLevelShapesDim(index, y1, y2, 5);
+ setDoorShapeDim(index, y1, y2, 5);
drawDoorIntern(type, index, x, y, w, s, d, y1, y2);
drawLevelModifyScreenDim(5, _shpDmX1, 0, _shpDmX2, 15);
}
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 2be25ce..423b827 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -38,7 +38,7 @@
namespace Kyra {
-#define RESFILE_VERSION 81
+#define RESFILE_VERSION 82
namespace {
bool checkKyraDat(Common::SeekableReadStream *file) {
diff --git a/engines/kyra/staticres_rpg.cpp b/engines/kyra/staticres_rpg.cpp
index cc75ae3..a30cbf7 100644
--- a/engines/kyra/staticres_rpg.cpp
+++ b/engines/kyra/staticres_rpg.cpp
@@ -88,6 +88,10 @@ void KyraRpgEngine::initStaticResource() {
_dscDimMap = _staticres->loadRawData(kRpgCommonDscDimMap, temp);
_dscDoorShpIndex = _staticres->loadRawData(kRpgCommonDscDoorShapeIndex, _dscDoorShpIndexSize);
_dscDoorY2 = _staticres->loadRawData(kRpgCommonDscDoorY2, temp);
+ _dscDoorFrameY1 = _staticres->loadRawData(kRpgCommonDscDoorFrameY1, temp);
+ _dscDoorFrameY2 = _staticres->loadRawData(kRpgCommonDscDoorFrameY2, temp);
+ _dscDoorFrameIndex1 = _staticres->loadRawData(kRpgCommonDscDoorFrameIndex1, temp);
+ _dscDoorFrameIndex2 = _staticres->loadRawData(kRpgCommonDscDoorFrameIndex2, temp);
_moreStrings = _staticres->loadStrings(kRpgCommonMoreStrings, temp);
}
Commit: df9b1bd2e4f70b3d9b2ad35ce806d0da4de253fe
https://github.com/scummvm/scummvm/commit/df9b1bd2e4f70b3d9b2ad35ce806d0da4de253fe
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:43-08:00
Commit Message:
KYRA: (EOB) - implement EGA graphics mode for EOB1
Changed paths:
engines/kyra/eobcommon.cpp
engines/kyra/items_eob.cpp
engines/kyra/scene_rpg.cpp
engines/kyra/screen.cpp
engines/kyra/screen_eob.cpp
engines/kyra/screen_eob.h
engines/kyra/sequences_eob.cpp
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp
index ecac20a..9bec256 100644
--- a/engines/kyra/eobcommon.cpp
+++ b/engines/kyra/eobcommon.cpp
@@ -390,7 +390,7 @@ Common::Error EoBCoreEngine::init() {
if (!_staticres->init())
error("_staticres->init() failed");
- if (!screen()->init())
+ if (!_screen->init(_flags.gameID == GI_EOB2 && _configRenderMode == Common::kRenderEGA))
error("screen()->init() failed");
if (ConfMan.hasKey("save_slot")) {
diff --git a/engines/kyra/items_eob.cpp b/engines/kyra/items_eob.cpp
index 5b65887..0994e12 100644
--- a/engines/kyra/items_eob.cpp
+++ b/engines/kyra/items_eob.cpp
@@ -465,7 +465,7 @@ void EoBCoreEngine::drawItemIconShape(int pageNum, Item itemId, int x, int y) {
const uint8 *ovl = 0;
if (applyBluePal) {
- if (_flags.gameID == GI_EOB1) {
+ if (_flags.gameID == GI_EOB1) {
ovl = (_configRenderMode == Common::kRenderCGA) ? _itemsOverlayCGA : &_itemsOverlay[icn << 4];
} else {
_screen->setFadeTableIndex(3);
diff --git a/engines/kyra/scene_rpg.cpp b/engines/kyra/scene_rpg.cpp
index 7f6b16b..da7c9fd 100644
--- a/engines/kyra/scene_rpg.cpp
+++ b/engines/kyra/scene_rpg.cpp
@@ -111,7 +111,7 @@ void KyraRpgEngine::setDoorShapeDim(int index, int16 &y1, int16 &y2, int dim) {
a += _dscDoorFrameIndex1[_currentLevel - 1];
b += _dscDoorFrameIndex2[_currentLevel - 1];
}
-
+
y1 = _dscDoorFrameY1[a];
y2 = _dscDoorFrameY2[b];
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index d394a86..3087a8a 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -648,6 +648,9 @@ void Screen::fadeFromBlack(int delay, const UpdateFunctor *upFunc) {
}
void Screen::fadeToBlack(int delay, const UpdateFunctor *upFunc) {
+ if (_renderMode == Common::kRenderEGA)
+ return;
+
Palette pal(getPalette(0).getNumColors());
fadePalette(pal, delay, upFunc);
}
@@ -1038,7 +1041,9 @@ void Screen::fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum,
color &= 0x0F;
color |= (color << 4);
} else if (_renderMode == Common::kRenderCGA) {
- color &= 3;
+ color &= 0x03;
+ } else if (_renderMode == Common::kRenderEGA) {
+ color &= 0x0F;
}
if (xored) {
@@ -1117,7 +1122,9 @@ void Screen::drawLine(bool vertical, int x, int y, int length, int color) {
color &= 0x0F;
color |= (color << 4);
} else if (_renderMode == Common::kRenderCGA) {
- color &= 3;
+ color &= 0x03;
+ } else if (_renderMode == Common::kRenderEGA) {
+ color &= 0x0F;
}
if (vertical) {
diff --git a/engines/kyra/screen_eob.cpp b/engines/kyra/screen_eob.cpp
index 8721c2c..51665a0 100644
--- a/engines/kyra/screen_eob.cpp
+++ b/engines/kyra/screen_eob.cpp
@@ -70,6 +70,10 @@ Screen_EoB::~Screen_EoB() {
}
bool Screen_EoB::init() {
+ return init(false);
+}
+
+bool Screen_EoB::init(bool useHiResEGADithering) {
if (Screen::init()) {
int temp;
_gfxMaxY = _vm->staticres()->loadRawData(kEoBBaseExpObjectY, temp);
@@ -91,6 +95,7 @@ bool Screen_EoB::init() {
_dsTempPage = new uint8[12000];
if (_renderMode == Common::kRenderEGA) {
+ _useHiResEGADithering = useHiResEGADithering;
_egaColorMap = new uint8[256];
_egaPixelValueTable = new uint8[256];
for (int i = 0; i < 256; i++) {
@@ -98,9 +103,6 @@ bool Screen_EoB::init() {
_egaPixelValueTable[i] = i & 0x0f;
}
- if (_vm->game() == GI_EOB2)
- _useHiResEGADithering = true;
-
} else if (_renderMode == Common::kRenderCGA) {
_cgaMappingDefault = _vm->staticres()->loadRawData(kEoB1CgaMappingDefault, temp);
_cgaDitheringTables[0] = new uint16[256];
@@ -346,6 +348,9 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
uint8 *srcLineStart = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
uint8 *src = srcLineStart;
+ if (_renderMode == Common::kRenderEGA && !_useHiResEGADithering)
+ encode8bit = false;
+
if (_renderMode == Common::kRenderCGA) {
if (cgaMapping)
generateCGADitheringTables(cgaMapping);
@@ -450,8 +455,12 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
} else {
uint8 nib = 0, col = 0;
- uint8 *colorMap = new uint8[0x100];
- memset(colorMap, 0xff, 0x100);
+ uint8 *colorMap = 0;
+
+ if (_renderMode != Common::kRenderEGA) {
+ colorMap = new uint8[0x100];
+ memset(colorMap, 0xff, 0x100);
+ }
shapesize = h * (w << 2) + 20;
shp = new uint8[shapesize];
@@ -462,7 +471,13 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
*dst++ = (h & 0xff);
*dst++ = (w & 0xff);
*dst++ = (h & 0xff);
- memset(dst, 0xff, 0x10);
+
+ if (_renderMode == Common::kRenderEGA) {
+ for (int i = 0; i < 16; i++)
+ dst[i] = i;
+ } else {
+ memset(dst, 0xff, 0x10);
+ }
uint8 *pal = dst;
dst += 16;
@@ -473,15 +488,18 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
uint16 w1 = w << 3;
while (w1--) {
uint8 s = *src++;
- uint8 c = colorMap[s];
- if (c == 0xff) {
- if (col < 0x10) {
- *pal++ = s;
- c = colorMap[s] = col++;
- if (!col)
+ uint8 c = s & 0x0f;
+ if (colorMap) {
+ c = colorMap[s];
+ if (c == 0xff) {
+ if (col < 0x10) {
+ *pal++ = s;
+ c = colorMap[s] = col++;
+ if (!col)
+ c = 0;
+ } else {
c = 0;
- } else {
- c = 0;
+ }
}
}
@@ -782,12 +800,9 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
src += pixelStep;
shSwtch = bitShDef;
}
- if (pixelsPerByte == 2) {
- if (pal[(in >> shift) & pixelPackingMask])
- drawShapeSetPixel(dst, pal[(in >> shift) & pixelPackingMask]);
- } else {
- *dst = (*dst & ((trans >> shift) & (pixelPackingMask))) | pal[(in >> shift) & pixelPackingMask];
- }
+ uint8 col = (pixelsPerByte == 2) ? pal[(in >> shift) & pixelPackingMask] : (*dst & ((trans >> shift) & (pixelPackingMask))) | pal[(in >> shift) & pixelPackingMask];
+ if (col || pixelsPerByte == 4)
+ drawShapeSetPixel(dst, col);
dst++;
shift = (shift - (pixelStep * pixelPacking) & 7);
}
@@ -819,11 +834,11 @@ const uint8 *Screen_EoB::scaleShapeStep(const uint8 *shp) {
uint16 w2 = (w << 3) / pixelsPerByte;
uint16 t = ((w << 1) % 3) ? 1 : 0;
d[1] = ((w << 1) / 3) + t;
-
+
uint32 transOffsetSrc = (pixelsPerByte == 4) ? (shp[0] * shp[1]) << 1 : 0;
uint32 transOffsetDst = (pixelsPerByte == 4) ? (d[0] * d[1]) << 1 : 0;
shp += 3;
- d += 3;
+ d += 3;
if (pixelsPerByte == 2) {
int i = 0;
@@ -1252,19 +1267,21 @@ const uint16 *Screen_EoB::getCGADitheringTable(int index) {
}
void Screen_EoB::drawShapeSetPixel(uint8 *dst, uint8 c) {
- if (_shapeFadeMode[0]) {
- if (_shapeFadeMode[1]) {
- c = *dst;
- } else {
- _shapeFadeInternal &= 7;
- c = *(dst + _shapeFadeInternal++);
+ if ((_renderMode != Common::kRenderCGA && _renderMode != Common::kRenderEGA) || _useHiResEGADithering) {
+ if (_shapeFadeMode[0]) {
+ if (_shapeFadeMode[1]) {
+ c = *dst;
+ } else {
+ _shapeFadeInternal &= 7;
+ c = *(dst + _shapeFadeInternal++);
+ }
}
- }
- if (_shapeFadeMode[1]) {
- uint8 cnt = _shapeFadeMode[1];
- while (cnt--)
- c = _fadeData[_fadeDataIndex + c];
+ if (_shapeFadeMode[1]) {
+ uint8 cnt = _shapeFadeMode[1];
+ while (cnt--)
+ c = _fadeData[_fadeDataIndex + c];
+ }
}
*dst = c;
@@ -1485,6 +1502,11 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
uint16 cgaMask1 = cgaColorMask[color1 & 3];
uint16 cgaMask2 = cgaColorMask[color2 & 3];
+ if (_renderMode == Common::kRenderCGA) {
+ color1 &= 0x0f;
+ color2 &= 0x0f;
+ }
+
int cH = _height;
while (cH--) {
int cW = w;
@@ -1525,6 +1547,7 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
}
last = s;
+
} else {
for (bool runWidthLoop = true; runWidthLoop;) {
uint8 s = *src++;
@@ -1536,22 +1559,11 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
break;
}
- if (_renderMode == Common::kRenderCGA) {
- uint8 in = s | last;
- if (s & i) {
- if (color1)
- *dst = color1;
- } else if (color2) {
- *dst = color2;
- }
- last = s;
- } else {
- if (s & i) {
- if (color1)
- *dst = color1;
- } else if (color2) {
- *dst = color2;
- }
+ if (s & i) {
+ if (color1)
+ *dst = color1;
+ } else if (color2) {
+ *dst = color2;
}
dst++;
}
diff --git a/engines/kyra/screen_eob.h b/engines/kyra/screen_eob.h
index dc6c4b2..cf8f869 100644
--- a/engines/kyra/screen_eob.h
+++ b/engines/kyra/screen_eob.h
@@ -36,6 +36,7 @@ public:
virtual ~Screen_EoB();
bool init();
+ bool init(bool useHiResEGADithering);
void setClearScreenDim(int dim);
void clearCurDim();
diff --git a/engines/kyra/sequences_eob.cpp b/engines/kyra/sequences_eob.cpp
index aa8d18f..4a9f7d8 100644
--- a/engines/kyra/sequences_eob.cpp
+++ b/engines/kyra/sequences_eob.cpp
@@ -119,12 +119,12 @@ void EoBIntroPlayer::start() {
Common::SeekableReadStream *s = _vm->resource()->createReadStream("TEXT.RAW");
if (s) {
s->seek(768);
- _screen->loadFileDataToPage(s, 6, s->size() - 768);
+ _screen->loadFileDataToPage(s, 5, s->size() - 768);
delete s;
} else {
_screen->loadBitmap("TEXT.CMP", 3, 5, 0);
- _screen->convertPage(5, 6, _vm->_cgaMappingAlt);
}
+ _screen->convertPage(5, 6, _vm->_cgaMappingAlt);
tower();
orb();
Commit: 930bcbf2dceebbdd7d29e3e1c478b2f7aafbf933
https://github.com/scummvm/scummvm/commit/930bcbf2dceebbdd7d29e3e1c478b2f7aafbf933
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:44-08:00
Commit Message:
KYRA: (EOB) - fix minor text displayer glitch
Changed paths:
engines/kyra/text_rpg.cpp
diff --git a/engines/kyra/text_rpg.cpp b/engines/kyra/text_rpg.cpp
index a78adb9..d0f7b5e 100644
--- a/engines/kyra/text_rpg.cpp
+++ b/engines/kyra/text_rpg.cpp
@@ -229,7 +229,7 @@ void TextDisplayer_rpg::displayText(char *str, ...) {
break;
default:
- if (_vm->game() == GI_LOL || c > 30) {
+ if (_vm->game() == GI_LOL || (unsigned char)c > 30) {
_lineWidth += (pc98PrintFlag ? 4 : _screen->getCharWidth((uint8)c));
_currentLine[_numCharsLeft++] = c;
_currentLine[_numCharsLeft] = 0;
@@ -282,14 +282,18 @@ void TextDisplayer_rpg::readNextPara() {
_tempString1 = 0;
}
- if ((_vm->game() != GI_LOL) && (d & 0x80)) {
+ // This seems to be some sort of character conversion mechanism. The original doesn't make any use of it, however.
+ // All necessary conversions take place somewhere else. This code actually causes issues if the character conversions
+ // don't take place before calling displayText(). So we disable it for now. If some (not yet supported) localized
+ // versions depend on this code we'll have to look at this again.
+ /* if ((_vm->game() != GI_LOL) && (d & 0x80)) {
d &= 0x7f;
c = d & 7;
d = (d & 0x78) >> 3;
uint8 l = d;
c = _table1[(l << 3) + c];
d = _table2[l];
- }
+ }*/
_ctrl[1] = d;
_ctrl[2] = c;
Commit: 3c1e2686b8e8ad36f1cdc3bb2afebd7f9de72845
https://github.com/scummvm/scummvm/commit/3c1e2686b8e8ad36f1cdc3bb2afebd7f9de72845
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:45-08:00
Commit Message:
KYRA: (EOB) - fix minor sprite drawing glitch in EOB1
(some sprites were drawn one pixel too far to the right)
Changed paths:
engines/kyra/sprites_eob.cpp
diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp
index 068647a..5c679f5 100644
--- a/engines/kyra/sprites_eob.cpp
+++ b/engines/kyra/sprites_eob.cpp
@@ -335,6 +335,8 @@ const int16 *EoBCoreEngine::findBlockMonsters(uint16 block, int pos, int dir, in
void EoBCoreEngine::drawBlockObject(int flipped, int page, const uint8 *shape, int x, int y, int sd, uint8 *ovl) {
const ScreenDim *d = _screen->getScreenDim(sd);
+ if (_flags.gameID == GI_EOB1)
+ x &= ~1;
_screen->drawShape(page, shape, x - (d->sx << 3), y - d->sy, sd, flipped | (ovl ? 2 : 0), ovl);
}
Commit: 66da4777d476c6a9fc2a13351e3b30afc748fd94
https://github.com/scummvm/scummvm/commit/66da4777d476c6a9fc2a13351e3b30afc748fd94
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:46-08:00
Commit Message:
KYRA: (EOB) - implement EGA mode (hi res dithering) for EOB II
(also fix various thing connected to CGA/EGA modes)
Changed paths:
engines/kyra/chargen.cpp
engines/kyra/darkmoon.cpp
engines/kyra/eob.cpp
engines/kyra/eobcommon.cpp
engines/kyra/gui_eob.cpp
engines/kyra/gui_eob.h
engines/kyra/kyra_hof.cpp
engines/kyra/kyra_lok.cpp
engines/kyra/kyra_mr.cpp
engines/kyra/kyra_rpg.cpp
engines/kyra/kyra_rpg.h
engines/kyra/kyra_v1.cpp
engines/kyra/kyra_v1.h
engines/kyra/lol.cpp
engines/kyra/magic_eob.cpp
engines/kyra/saveload_eob.cpp
engines/kyra/scene_eob.cpp
engines/kyra/scene_rpg.cpp
engines/kyra/screen.cpp
engines/kyra/screen.h
engines/kyra/screen_eob.cpp
engines/kyra/screen_eob.h
diff --git a/engines/kyra/chargen.cpp b/engines/kyra/chargen.cpp
index 2327434..73f5fcc 100644
--- a/engines/kyra/chargen.cpp
+++ b/engines/kyra/chargen.cpp
@@ -1496,7 +1496,7 @@ TransferPartyWiz::~TransferPartyWiz() {
}
bool TransferPartyWiz::start() {
- _screen->copyPage(0, 12);
+ _screen->copyPage(0, (_screen->getPageScaleFactor(0) == 2) ? 1 : 12);
if (!selectAndLoadTransferFile())
return false;
@@ -1536,7 +1536,7 @@ bool TransferPartyWiz::start() {
bool TransferPartyWiz::selectAndLoadTransferFile() {
do {
- _screen->copyPage(12, 0);
+ _screen->copyPage((_screen->getPageScaleFactor(0) == 2) ? 1 : 12, 0);
if (transferFileDialogue(_vm->_savegameFilename))
break;
} while (_vm->_gui->confirmDialogue2(15, 68, 1));
@@ -1566,7 +1566,7 @@ bool TransferPartyWiz::selectAndLoadTransferFile() {
return false;
Common::String target = _vm->_gui->transferTargetMenu(eobTargets);
- _screen->copyPage(12, 0);
+ _screen->copyPage((_screen->getPageScaleFactor(0) == 2) ? 1 : 12, 0);
if (target.empty())
return true;
@@ -1579,10 +1579,10 @@ bool TransferPartyWiz::selectAndLoadTransferFile() {
return true;
}
- _screen->copyPage(12, 0);
+ _screen->copyPage((_screen->getPageScaleFactor(0) == 2) ? 1 : 12, 0);
bool result = _vm->_gui->transferFileMenu(target, dest);
- _screen->copyPage(12, 0);
+ _screen->copyPage((_screen->getPageScaleFactor(0) == 2) ? 1 : 12, 0);
return result;
}
diff --git a/engines/kyra/darkmoon.cpp b/engines/kyra/darkmoon.cpp
index 918221e..16bd3da 100644
--- a/engines/kyra/darkmoon.cpp
+++ b/engines/kyra/darkmoon.cpp
@@ -61,10 +61,11 @@ Common::Error DarkMoonEngine::init() {
Palette pal(16);
_screen->loadPalette(_egaDefaultPalette, pal, 16);
_screen->setScreenPalette(pal);
- } else {
- _screen->loadPalette("palette.col", _screen->getPalette(0));
}
+ _screen->loadPalette("PALETTE.COL", _screen->getPalette(0));
+ _screen->setScreenPalette(_screen->getPalette(0));
+
return Common::kNoError;
}
@@ -157,7 +158,9 @@ void DarkMoonEngine::generateMonsterPalettes(const char *file, int16 monsterInde
int colx = 302 + 3 * i;
for (int ii = 0; ii < 16; ii++) {
- uint8 col = _screen->getPagePixel(_screen->_curPage, colx, 184 + ii);
+ // Don't use getPagePixel() here, since in EGA mode it will try to
+ // undither the pixel (although the shape bitmap is undithered already)
+ uint8 col = _screen->getCPagePtr(_screen->_curPage | 1)[(184 + ii) * Screen::SCREEN_W + colx];
int iii = 0;
for (; iii < 16; iii++) {
@@ -175,7 +178,9 @@ void DarkMoonEngine::generateMonsterPalettes(const char *file, int16 monsterInde
memcpy(tmpPal, _monsterShapes[dci] + 4, 16);
for (int iii = 0; iii < 16; iii++) {
- uint8 col = _screen->getPagePixel(_screen->_curPage, colx + ii, 184 + iii);
+ // Don't use getPagePixel() here, since in EGA mode it will try to
+ // undither the pixel (although the shape bitmap is undithered already)
+ uint8 col = _screen->getCPagePtr(_screen->_curPage | 1)[(184 + iii) * Screen::SCREEN_W + colx + ii];
if (newPal[iii])
tmpPal[newPal[iii]] = col;
}
diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp
index 9e58aff..a7bde9f 100644
--- a/engines/kyra/eob.cpp
+++ b/engines/kyra/eob.cpp
@@ -69,7 +69,7 @@ Common::Error EoBEngine::init() {
_screen->loadPalette(_egaDefaultPalette, pal, 16);
_screen->setScreenPalette(pal);
} else {
- _screen->loadPalette("palette.col", _screen->getPalette(0));
+ _screen->loadPalette("PALETTE.COL", _screen->getPalette(0));
}
return Common::kNoError;
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp
index 9bec256..ff53ba8 100644
--- a/engines/kyra/eobcommon.cpp
+++ b/engines/kyra/eobcommon.cpp
@@ -371,7 +371,7 @@ Common::Error EoBCoreEngine::init() {
_screen = new Screen_EoB(this, _system);
assert(_screen);
- _screen->setResolution();
+ _screen->setResolution(_flags.useHiResOverlay || (_flags.gameID == GI_EOB2 && _configRenderMode == Common::kRenderEGA));
//MidiDriverType midiDriver = MidiDriver::detectDevice(MDT_PCSPK | MDT_ADLIB);
_sound = new SoundAdLibPC(this, _mixer);
@@ -1738,7 +1738,7 @@ void EoBCoreEngine::seq_portal() {
bool EoBCoreEngine::checkPassword() {
char answ[20];
Screen::FontId of = _screen->setFont(Screen::FID_8_FNT);
- _screen->copyPage(0, 10);
+ _screen->copyPage(0, (_screen->getPageScaleFactor(0) == 2) ? 4 : 10);
_screen->setScreenDim(13);
gui_drawBox(_screen->_curDim->sx << 3, _screen->_curDim->sy, _screen->_curDim->w << 3, _screen->_curDim->h, guiSettings()->colors.frame1, guiSettings()->colors.frame2, -1);
@@ -1765,7 +1765,7 @@ bool EoBCoreEngine::checkPassword() {
_screen->modifyScreenDim(13, _screen->_curDim->sx - 1, _screen->_curDim->sy - 2, _screen->_curDim->w + 2, _screen->_curDim->h + 16);
_screen->setFont(of);
- _screen->copyPage(10, 0);
+ _screen->copyPage((_screen->getPageScaleFactor(0) == 2) ? 4 : 10, 0);
return true;
}
diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp
index 39cc469..eadfd10 100644
--- a/engines/kyra/gui_eob.cpp
+++ b/engines/kyra/gui_eob.cpp
@@ -777,11 +777,11 @@ int EoBCoreEngine::clickedCamp(Button *button) {
}
_screen->copyPage(0, 7);
- _screen->copyRegion(0, 120, 0, 0, 176, 24, 0, 12, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, 120, 0, 0, 176, 24, 0, (_screen->getPageScaleFactor(0) == 2) ? 1 : 12, Screen::CR_NO_P_CHECK);
_gui->runCampMenu();
- _screen->copyRegion(0, 0, 0, 120, 176, 24, 12, 2, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, 0, 0, 120, 176, 24, (_screen->getPageScaleFactor(0) == 2) ? 1 : 12, 2, Screen::CR_NO_P_CHECK);
_screen->setScreenDim(cd);
drawScene(0);
@@ -1170,7 +1170,7 @@ int EoBCoreEngine::clickedSceneSpecial(Button *button) {
int EoBCoreEngine::clickedSpellbookAbort(Button *button) {
_updateFlags = 0;
- _screen->copyRegion(0, 0, 64, 121, 112, 56, 10, 0, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, 0, 64, 121, 112, 56, (_screen->getPageScaleFactor(0) == 2) ? 4 : 10, 0, Screen::CR_NO_P_CHECK);
_screen->updateScreen();
gui_drawCompass(true);
gui_toggleButtons();
@@ -1392,9 +1392,11 @@ GUI_EoB::GUI_EoB(EoBCoreEngine *vm) : GUI(vm), _vm(vm), _screen(vm->_screen) {
_charSelectRedraw = false;
+ _highLightColorTable = (_vm->game() == GI_EOB1 && (_vm->_configRenderMode == Common::kRenderCGA || _vm->_configRenderMode == Common::kRenderEGA)) ? _highlightColorTableEGA : _highlightColorTableVGA;
_updateBoxIndex = -1;
_highLightBoxTimer = 0;
_updateBoxColorIndex = 0;
+
_needRest = false;
}
@@ -2170,7 +2172,7 @@ void GUI_EoB::runCampMenu() {
if (cnt > 4) {
_vm->dropCharacter(selectCharacterDialogue(53));
_vm->gui_drawPlayField(false);
- _screen->copyRegion(0, 120, 0, 0, 176, 24, 0, 12, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, 120, 0, 0, 176, 24, 0, (_screen->getPageScaleFactor(0) == 2) ? 1 : 12, Screen::CR_NO_P_CHECK);
_screen->setFont(Screen::FID_6_FNT);
_vm->gui_drawAllCharPortraitsWithStats();
_screen->setFont(Screen::FID_8_FNT);
@@ -2411,8 +2413,6 @@ void GUI_EoB::messageDialogue2(int dim, int id, int buttonTextCol) {
}
void GUI_EoB::updateBoxFrameHighLight(int box) {
- static const uint8 colorTable[] = { 0x0F, 0xB0, 0xB2, 0xB4, 0xB6, 0xB8, 0xBA, 0xBC, 0x0C, 0xBC, 0xBA, 0xB8, 0xB6, 0xB4, 0xB2, 0xB0, 0x00 };
-
if (_updateBoxIndex == box) {
if (_updateBoxIndex == -1)
return;
@@ -2420,18 +2420,18 @@ void GUI_EoB::updateBoxFrameHighLight(int box) {
if (_vm->_system->getMillis() <= _highLightBoxTimer)
return;
- if (!colorTable[_updateBoxColorIndex])
+ if (!_highLightColorTable[_updateBoxColorIndex])
_updateBoxColorIndex = 0;
- const EoBRect16 *r = &_updateBoxFrameHighLights[_updateBoxIndex];
- _screen->drawBox(r->x1, r->y1, r->x2, r->y2, colorTable[_updateBoxColorIndex++]);
+ const EoBRect16 *r = &_highlightFrames[_updateBoxIndex];
+ _screen->drawBox(r->x1, r->y1, r->x2, r->y2, _highLightColorTable[_updateBoxColorIndex++]);
_screen->updateScreen();
_highLightBoxTimer = _vm->_system->getMillis() + _vm->_tickLength;
} else {
if (_updateBoxIndex != -1) {
- const EoBRect16 *r = &_updateBoxFrameHighLights[_updateBoxIndex];
+ const EoBRect16 *r = &_highlightFrames[_updateBoxIndex];
_screen->drawBox(r->x1, r->y1, r->x2, r->y2, 12);
_screen->updateScreen();
}
@@ -2607,7 +2607,7 @@ Common::String GUI_EoB::transferTargetMenu(Common::Array<Common::String> &target
break;
} while (_saveSlotIdTemp[slot] == -1);
- _screen->copyRegion(72, 14, 72, 14, 176, 144, 12, 0, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(72, 14, 72, 14, 176, 144, (_screen->getPageScaleFactor(0) == 2) ? 7 : 12, 0, Screen::CR_NO_P_CHECK);
_screen->modifyScreenDim(11, xo, yo, dm->w, dm->h);
return (slot < 6) ? _savegameList[_savegameOffset + slot] : Common::String();
@@ -4054,7 +4054,7 @@ void GUI_EoB::restParty_updateRestTime(int hours, bool init) {
_screen->setFont(of);
}
-const EoBRect16 GUI_EoB::_updateBoxFrameHighLights[] = {
+const EoBRect16 GUI_EoB::_highlightFrames[] = {
{ 0x00B7, 0x0001, 0x00F7, 0x0034 },
{ 0x00FF, 0x0001, 0x013F, 0x0034 },
{ 0x00B7, 0x0035, 0x00F7, 0x0068 },
@@ -4077,6 +4077,10 @@ const EoBRect16 GUI_EoB::_updateBoxFrameHighLights[] = {
{ 0x00A3, 0x0068, 0x00C3, 0x0089 }
};
+const uint8 GUI_EoB::_highlightColorTableVGA[] = { 0x0F, 0xB0, 0xB2, 0xB4, 0xB6, 0xB8, 0xBA, 0xBC, 0x0C, 0xBC, 0xBA, 0xB8, 0xB6, 0xB4, 0xB2, 0xB0, 0x00 };
+
+const uint8 GUI_EoB::_highlightColorTableEGA[] = { 0x0C, 0x0D, 0x0E, 0x0F, 0x0E, 0x0D, 0x00 };
+
} // End of namespace Kyra
#endif // ENABLE_EOB
diff --git a/engines/kyra/gui_eob.h b/engines/kyra/gui_eob.h
index 759ed64..f6be18f 100644
--- a/engines/kyra/gui_eob.h
+++ b/engines/kyra/gui_eob.h
@@ -148,9 +148,12 @@ private:
int _updateBoxIndex;
int _updateBoxColorIndex;
+ const uint8 *_highLightColorTable;
uint32 _highLightBoxTimer;
- static const EoBRect16 _updateBoxFrameHighLights[];
+ static const EoBRect16 _highlightFrames[];
+ static const uint8 _highlightColorTableVGA[];
+ static const uint8 _highlightColorTableEGA[];
};
} // End of namespace Kyra
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index 0ba173d..b07e3a4 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -221,7 +221,7 @@ void KyraEngine_HoF::pauseEngineIntern(bool pause) {
Common::Error KyraEngine_HoF::init() {
_screen = new Screen_HoF(this, _system);
assert(_screen);
- _screen->setResolution();
+ _screen->setResolution(_flags.useHiResOverlay);
_debugger = new Debugger_HoF(this);
assert(_debugger);
diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp
index d7e7957..e8a2c02 100644
--- a/engines/kyra/kyra_lok.cpp
+++ b/engines/kyra/kyra_lok.cpp
@@ -172,7 +172,7 @@ Common::Error KyraEngine_LoK::init() {
else
_screen = new Screen_LoK(this, _system);
assert(_screen);
- _screen->setResolution();
+ _screen->setResolution(_flags.useHiResOverlay);
_debugger = new Debugger_LoK(this);
assert(_debugger);
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index 39ed0d0..38f473a 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -203,7 +203,7 @@ KyraEngine_MR::~KyraEngine_MR() {
Common::Error KyraEngine_MR::init() {
_screen = new Screen_MR(this, _system);
assert(_screen);
- _screen->setResolution();
+ _screen->setResolution(_flags.useHiResOverlay);
_debugger = new Debugger_v2(this);
assert(_debugger);
diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp
index 1e3890b..121731e 100644
--- a/engines/kyra/kyra_rpg.cpp
+++ b/engines/kyra/kyra_rpg.cpp
@@ -41,13 +41,17 @@ KyraRpgEngine::KyraRpgEngine(OSystem *system, const GameFlags &flags) : KyraEngi
_currentLevel = 0;
- _vmpPtr = 0;
_vcnBlocks = 0;
_vcfBlocks = 0;
_vcnTransitionMask = 0;
_vcnShift = 0;
_vcnColTable = 0;
+ _vcnBlockWidth = 4;
+ _vcnBlockHeight = 8;
+ _vcnFlip0 = 0;
+ _vcnFlip1 = 1;
_vmpPtr = 0;
+ _vmpSize = 0;
_blockBrightness = _wllVcnOffset = 0;
_blockDrawingBuffer = 0;
_sceneWindowBuffer = 0;
@@ -167,10 +171,17 @@ Common::Error KyraRpgEngine::init() {
_wllWallFlags = new uint8[256];
memset(_wllWallFlags, 0, 256);
+ if (_flags.gameID == GI_EOB2 && _configRenderMode == Common::kRenderEGA) {
+ _vcnBlockWidth <<= 1;
+ _vcnBlockHeight <<= 1;
+ SWAP(_vcnFlip0, _vcnFlip1);
+ }
+
_blockDrawingBuffer = new uint16[1320];
memset(_blockDrawingBuffer, 0, 1320 * sizeof(uint16));
- _sceneWindowBuffer = new uint8[21120];
- memset(_sceneWindowBuffer, 0, 21120);
+ uint32 swbSize = 22 * _vcnBlockWidth * 2 * 15 * _vcnBlockHeight;
+ _sceneWindowBuffer = new uint8[swbSize];
+ memset(_sceneWindowBuffer, 0, swbSize);
_lvlShapeTop = new int16[18];
memset(_lvlShapeTop, 0, 18 * sizeof(int16));
diff --git a/engines/kyra/kyra_rpg.h b/engines/kyra/kyra_rpg.h
index f4678e3..50a4c9b 100644
--- a/engines/kyra/kyra_rpg.h
+++ b/engines/kyra/kyra_rpg.h
@@ -222,6 +222,7 @@ protected:
uint16 _decorationCount;
int16 _mappedDecorationsCount;
uint16 *_vmpPtr;
+ uint16 _vmpSize;
uint8 *_vcnBlocks;
uint8 *_vcfBlocks;
uint8 *_vcnTransitionMask;
@@ -231,6 +232,10 @@ protected:
uint8 *_sceneWindowBuffer;
uint8 _blockBrightness;
uint8 _wllVcnOffset;
+ uint8 _vcnBlockWidth;
+ uint8 _vcnBlockHeight;
+ uint8 _vcnFlip0;
+ uint8 _vcnFlip1;
uint8 **_doorShapes;
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 0f7da76..7c67af2 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -230,7 +230,7 @@ KyraEngine_v1::~KyraEngine_v1() {
delete _debugger;
}
-Common::Point KyraEngine_v1::getMousePos() const {
+Common::Point KyraEngine_v1::getMousePos() {
Common::Point mouse = _eventMan->getMousePos();
if (_flags.useHiResOverlay) {
@@ -238,6 +238,9 @@ Common::Point KyraEngine_v1::getMousePos() const {
mouse.y >>= 1;
}
+ mouse.x /= screen()->getPageScaleFactor(0);
+ mouse.y /= screen()->getPageScaleFactor(0);
+
return mouse;
}
@@ -313,6 +316,8 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag)
_mouseX >>= 1;
_mouseY >>= 1;
}
+ _mouseX /= screen()->getPageScaleFactor(0);
+ _mouseY /= screen()->getPageScaleFactor(0);
keys = (event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800));
breakLoop = true;
} break;
@@ -325,6 +330,8 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag)
_mouseX >>= 1;
_mouseY >>= 1;
}
+ _mouseX /= screen()->getPageScaleFactor(0);
+ _mouseY /= screen()->getPageScaleFactor(0);
keys = (event.type == Common::EVENT_RBUTTONDOWN ? 201 : (202 | 0x800));
breakLoop = true;
} break;
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 2c2901a..95d58d4 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -210,7 +210,7 @@ public:
// input
void setMousePos(int x, int y);
- Common::Point getMousePos() const;
+ Common::Point getMousePos();
// config specific
bool speechEnabled();
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 38e9d33..022a878 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -364,7 +364,7 @@ GUI *LoLEngine::gui() const {
Common::Error LoLEngine::init() {
_screen = new Screen_LoL(this, _system);
assert(_screen);
- _screen->setResolution();
+ _screen->setResolution(_flags.useHiResOverlay);
_debugger = new Debugger_LoL(this);
assert(_debugger);
diff --git a/engines/kyra/magic_eob.cpp b/engines/kyra/magic_eob.cpp
index fbddd62..b2949ce 100644
--- a/engines/kyra/magic_eob.cpp
+++ b/engines/kyra/magic_eob.cpp
@@ -60,7 +60,7 @@ void EoBCoreEngine::useMagicBookOrSymbol(int charIndex, int type) {
}
if (!_updateFlags)
- _screen->copyRegion(64, 121, 0, 0, 112, 56, 0, 10, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(64, 121, 0, 0, 112, 56, 0, (_screen->getPageScaleFactor(0) == 2) ? 4 : 10, Screen::CR_NO_P_CHECK);
_updateFlags = 1;
gui_setPlayFieldButtons();
gui_drawSpellbook();
diff --git a/engines/kyra/saveload_eob.cpp b/engines/kyra/saveload_eob.cpp
index 7f20c12..4a446aa 100644
--- a/engines/kyra/saveload_eob.cpp
+++ b/engines/kyra/saveload_eob.cpp
@@ -298,7 +298,7 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
useMagicBookOrSymbol(_openBookChar, _openBookType);
}
- _screen->copyRegion(0, 120, 0, 0, 176, 24, 0, 12, Screen::CR_NO_P_CHECK);
+ _screen->copyRegion(0, 120, 0, 0, 176, 24, 0, (_screen->getPageScaleFactor(0) == 2) ? 1 : 12, Screen::CR_NO_P_CHECK);
gui_toggleButtons();
setHandItem(_itemInHand);
diff --git a/engines/kyra/scene_eob.cpp b/engines/kyra/scene_eob.cpp
index 5a06fe7..3db055d 100644
--- a/engines/kyra/scene_eob.cpp
+++ b/engines/kyra/scene_eob.cpp
@@ -144,10 +144,10 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
const char *vmpPattern = (_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)) ? "%s.EMP" : "%s.VMP";
Common::SeekableReadStream *s = _res->createReadStream(Common::String::format(vmpPattern, (const char *)pos));
- uint16 size = s->readUint16LE();
+ _vmpSize = s->readUint16LE();
delete[] _vmpPtr;
- _vmpPtr = new uint16[size];
- for (int i = 0; i < size; i++)
+ _vmpPtr = new uint16[_vmpSize];
+ for (int i = 0; i < _vmpSize; i++)
_vmpPtr[i] = s->readUint16LE();
delete s;
@@ -185,6 +185,8 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
_screen->getPalette(0).copy(backupPal, 224, 32, 224);
_screen->createFadeTable(src, _screen->getFadeTable(4), 12, 85); // grey (shadow)
_screen->setFadeTableIndex(4);
+ if (_flags.gameID == GI_EOB2 && _configRenderMode == Common::kRenderEGA)
+ _screen->setScreenPalette(_screen->getPalette(0));
}
}
@@ -280,25 +282,64 @@ void EoBCoreEngine::loadVcnData(const char *file, const uint8 *cgaMapping) {
const char *filePattern = (_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)) ? "%s.ECN" : "%s.VCN";
_screen->loadBitmap(Common::String::format(filePattern, _lastBlockDataFile).c_str(), 3, 3, 0);
const uint8 *pos = _screen->getCPagePtr(3);
- uint32 tlen = READ_LE_UINT16(pos) << 5;
+
+ uint32 vcnSize = READ_LE_UINT16(pos) * _vcnBlockWidth * _vcnBlockHeight;
pos += 2;
- if (!(_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)))
- memcpy(_vcnColTable, pos, 32);
+
+ const uint8 *colMap = pos;
pos += 32;
+
delete[] _vcnBlocks;
- _vcnBlocks = new uint8[tlen];
+ _vcnBlocks = new uint8[vcnSize];
- if (_configRenderMode == Common::kRenderCGA) {
+ if (_flags.gameID == GI_EOB2 && _configRenderMode == Common::kRenderEGA) {
+ const uint8 *egaTable = _screen->getEGADitheringTable();
+ assert(_vmpPtr);
+ assert(egaTable);
+
+ delete[] _vcnTransitionMask;
+ _vcnTransitionMask = new uint8[vcnSize];
+
+ for (int i = 0; i < _vmpSize; i++) {
+ uint16 vcnOffs = _vmpPtr[i] & 0x3FFF;
+ const uint8 *src = &pos[vcnOffs << 5];
+ uint8 *dst1 = &_vcnBlocks[vcnOffs << 7];
+ uint8 *dst3 = &_vcnTransitionMask[vcnOffs << 7];
+ int palOffset = (i < 330) ? 0 : _wllVcnOffset;
+
+ for (int y = 0; y < 8; y++) {
+ uint8 *dst2 = dst1 + 8;
+ uint8 *dst4 = dst3 + 8;
+
+ for (int x = 0; x < 4; x++) {
+ uint8 in = *src++;
+
+ dst1[0] = dst2[0] = egaTable[colMap[(in >> 4) + palOffset]];
+ dst1[1] = dst2[1] = egaTable[colMap[(in & 0x0f) + palOffset]];
+ dst3[0] = dst4[0] = (in & 0xf0) ? 0 : 0xff;
+ dst3[1] = dst4[1] = (in & 0x0f) ? 0 : 0xff;
+
+ dst1 += 2;
+ dst2 += 2;
+ dst3 += 2;
+ dst4 += 2;
+ }
+
+ dst1 += 8;
+ dst3 += 8;
+ }
+ }
+ } else if (_configRenderMode == Common::kRenderCGA) {
uint8 *tmp = _screen->encodeShape(0, 0, 1, 8, false, cgaMapping);
delete[] tmp;
delete[] _vcnTransitionMask;
- _vcnTransitionMask = new uint8[tlen];
+ _vcnTransitionMask = new uint8[vcnSize];
uint8 tblSwitch = 0;
uint8 *dst = _vcnBlocks;
uint8 *dst2 = _vcnTransitionMask;
- while (dst < _vcnBlocks + tlen) {
+ while (dst < _vcnBlocks + vcnSize) {
const uint16 *table = _screen->getCGADitheringTable((tblSwitch++) & 1);
for (int ii = 0; ii < 2; ii++) {
*dst++ = ((table[pos[0]] & 0x000f) << 4) | ((table[pos[0]] & 0x0f00) >> 8);
@@ -322,7 +363,9 @@ void EoBCoreEngine::loadVcnData(const char *file, const uint8 *cgaMapping) {
}
}
} else {
- memcpy(_vcnBlocks, pos, tlen);
+ if (_configRenderMode != Common::kRenderEGA)
+ memcpy(_vcnColTable, colMap, 32);
+ memcpy(_vcnBlocks, pos, vcnSize);
}
}
diff --git a/engines/kyra/scene_rpg.cpp b/engines/kyra/scene_rpg.cpp
index da7c9fd..b015b10 100644
--- a/engines/kyra/scene_rpg.cpp
+++ b/engines/kyra/scene_rpg.cpp
@@ -348,6 +348,9 @@ bool KyraRpgEngine::checkSceneUpdateNeed(int block) {
void KyraRpgEngine::drawVcnBlocks() {
uint8 *d = _sceneWindowBuffer;
uint16 *bdb = _blockDrawingBuffer;
+ uint16 pitch = 22 * _vcnBlockWidth * 2;
+ uint8 pxl[2];
+ pxl[0] = pxl[1] = 0;
for (int y = 0; y < 15; y++) {
for (int x = 0; x < 22; x++) {
@@ -371,7 +374,7 @@ void KyraRpgEngine::drawVcnBlocks() {
uint8 *src = 0;
if (vcnOffset) {
- src = &_vcnBlocks[vcnOffset << 5];
+ src = &_vcnBlocks[vcnOffset * _vcnBlockWidth * _vcnBlockHeight];
wllVcnOffset = _wllVcnOffset;
} else {
// floor/ceiling blocks
@@ -381,36 +384,37 @@ void KyraRpgEngine::drawVcnBlocks() {
vcnOffset &= 0x3fff;
}
- src = (_vcfBlocks ? _vcfBlocks : _vcnBlocks) + (vcnOffset << 5);
+ src = (_vcfBlocks ? _vcfBlocks : _vcnBlocks) + (vcnOffset * _vcnBlockWidth * _vcnBlockHeight);
}
uint8 shift = _vcnShift ? _vcnShift[vcnOffset] : _blockBrightness;
if (horizontalFlip) {
- for (int blockY = 0; blockY < 8; blockY++) {
- src += 3;
- for (int blockX = 0; blockX < 4; blockX++) {
+ for (int blockY = 0; blockY < _vcnBlockHeight; blockY++) {
+ src += (_vcnBlockWidth - 1);
+ for (int blockX = 0; blockX < _vcnBlockWidth; blockX++) {
uint8 bl = *src--;
- *d++ = _vcnColTable[((bl & 0x0f) + wllVcnOffset) | shift];
- *d++ = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift];
+ d[_vcnFlip0] = _vcnColTable[((bl & 0x0f) + wllVcnOffset) | shift];
+ d[_vcnFlip1] = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift];
+ d += 2;
}
- src += 5;
- d += 168;
+ src += (_vcnBlockWidth + 1);
+ d += (pitch - 2 * _vcnBlockWidth);
}
} else {
- for (int blockY = 0; blockY < 8; blockY++) {
- for (int blockX = 0; blockX < 4; blockX++) {
+ for (int blockY = 0; blockY < _vcnBlockHeight; blockY++) {
+ for (int blockX = 0; blockX < _vcnBlockWidth; blockX++) {
uint8 bl = *src++;
*d++ = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift];
*d++ = _vcnColTable[((bl & 0x0f) + wllVcnOffset) | shift];
}
- d += 168;
+ d += (pitch - 2 * _vcnBlockWidth);
}
}
- d -= 1400;
+ d -= (pitch * _vcnBlockHeight - 2 * _vcnBlockWidth);
if (vcnExtraOffsetWll) {
- d -= 8;
+ d -= (2 * _vcnBlockWidth);
horizontalFlip = false;
if (vcnExtraOffsetWll & 0x4000) {
@@ -419,38 +423,38 @@ void KyraRpgEngine::drawVcnBlocks() {
}
shift = _vcnShift ? _vcnShift[vcnExtraOffsetWll] : _blockBrightness;
- src = &_vcnBlocks[vcnExtraOffsetWll << 5];
- uint8 *maskTable = _vcnTransitionMask ? &_vcnTransitionMask[vcnExtraOffsetWll << 5] : 0;
+ src = &_vcnBlocks[vcnExtraOffsetWll * _vcnBlockWidth * _vcnBlockHeight];
+ uint8 *maskTable = _vcnTransitionMask ? &_vcnTransitionMask[vcnExtraOffsetWll * _vcnBlockWidth * _vcnBlockHeight] : 0;
if (horizontalFlip) {
- for (int blockY = 0; blockY < 8; blockY++) {
- src += 3;
- maskTable += 3;
- for (int blockX = 0; blockX < 4; blockX++) {
+ for (int blockY = 0; blockY < _vcnBlockHeight; blockY++) {
+ src += (_vcnBlockWidth - 1);
+ maskTable += (_vcnBlockWidth - 1);
+ for (int blockX = 0; blockX < _vcnBlockWidth; blockX++) {
uint8 bl = *src--;
uint8 mask = _vcnTransitionMask ? *maskTable-- : 0;
- uint8 h = _vcnColTable[((bl & 0x0f) + wllVcnRmdOffset) | shift];
- uint8 l = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift];
+ pxl[_vcnFlip0] = _vcnColTable[((bl & 0x0f) + wllVcnRmdOffset) | shift];
+ pxl[_vcnFlip1] = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift];
if (_vcnTransitionMask)
- *d = (*d & (mask & 0x0f)) | h;
- else if (h)
- *d = h;
+ *d = (*d & (mask & 0x0f)) | pxl[0];
+ else if (pxl[0])
+ *d = pxl[0];
d++;
if (_vcnTransitionMask)
- *d = (*d & (mask >> 4)) | l;
- else if (l)
- *d = l;
+ *d = (*d & (mask >> 4)) | pxl[1];
+ else if (pxl[1])
+ *d = pxl[1];
d++;
}
- src += 5;
- maskTable += 5;
- d += 168;
+ src += (_vcnBlockWidth + 1);
+ maskTable += (_vcnBlockWidth + 1);
+ d += (pitch - 2 * _vcnBlockWidth);
}
} else {
- for (int blockY = 0; blockY < 8; blockY++) {
- for (int blockX = 0; blockX < 4; blockX++) {
+ for (int blockY = 0; blockY < _vcnBlockHeight; blockY++) {
+ for (int blockX = 0; blockX < _vcnBlockWidth; blockX++) {
uint8 bl = *src++;
uint8 mask = _vcnTransitionMask ? *maskTable++ : 0;
uint8 h = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift];
@@ -468,13 +472,13 @@ void KyraRpgEngine::drawVcnBlocks() {
*d = l;
d++;
}
- d += 168;
+ d += (pitch - 2 * _vcnBlockWidth);
}
}
- d -= 1400;
+ d -= (pitch * _vcnBlockHeight - 2 * _vcnBlockWidth);
}
}
- d += 1232;
+ d += (pitch * (_vcnBlockHeight - 1));
}
screen()->copyBlockToPage(_sceneDrawPage1, _sceneXoffset, 0, 176, 120, _sceneWindowBuffer);
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 3087a8a..ef6333b 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -39,7 +39,7 @@ namespace Kyra {
Screen::Screen(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, const int dimTableSize)
: _system(system), _vm(vm), _sjisInvisibleColor(0), _dimTable(dimTable), _dimTableCount(dimTableSize),
- _cursorColorKey((vm->game() == GI_KYRA1) ? 0xFF : 0x00) {
+ _cursorColorKey((vm->game() == GI_KYRA1 || vm->game() == GI_EOB1 || vm->game() == GI_EOB2) ? 0xFF : 0) {
_debugEnabled = false;
_maskMinY = _maskMaxY = -1;
@@ -50,8 +50,14 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system, const ScreenDim *dimTable, co
memset(_fonts, 0, sizeof(_fonts));
+ memset(_pagePtrs, 0, sizeof(_pagePtrs));
+ // Set scale factor to 1 (no scaling) for all pages
+ memset(_pageScaleFactor, 1, sizeof(_pageScaleFactor));
+ // In VGA mode the odd and even page pointers point to the same buffers.
+ for (int i = 0; i < SCREEN_PAGE_NUM; i++)
+ _pageMapping[i] = i & ~1;
+
_renderMode = Common::kRenderDefault;
- _cgaDrawCharDitheringTable = 0;
_currentFont = FID_8_FNT;
_paletteChanged = true;
@@ -92,6 +98,12 @@ bool Screen::init() {
if (ConfMan.hasKey("render_mode"))
_renderMode = Common::parseRenderMode(ConfMan.get("render_mode"));
+ // CGA and EGA modes use additional pages to do the CGA/EGA specific graphics conversions.
+ if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderEGA) {
+ for (int i = 0; i < 8; i++)
+ _pageMapping[i] = i;
+ }
+
memset(_fonts, 0, sizeof(_fonts));
if (_vm->gameFlags().useHiResOverlay) {
@@ -119,25 +131,28 @@ bool Screen::init() {
_curPage = 0;
- int numPages = SCREEN_PAGE_NUM / 2;
- // CGA and EGA modes use additional pages to do the CGA/EGA specific graphics conversions.
- if (_renderMode == Common::kRenderEGA || _renderMode == Common::kRenderCGA)
- numPages += 4;
-
- uint8 *pagePtr = new uint8[numPages * SCREEN_PAGE_SIZE];
- memset(pagePtr, 0, numPages * SCREEN_PAGE_SIZE);
-
- if (_renderMode == Common::kRenderEGA || _renderMode == Common::kRenderCGA) {
- // Unlike VGA mode the odd and even page numbers do not always point to the same buffers.
- // Instead, the odd pages are used for CGA/EGA specific graphics conversions.
- int pageNum = 0;
- for (; pageNum < 8; pageNum++)
- _pagePtrs[pageNum] = pagePtr + pageNum * SCREEN_PAGE_SIZE;
- for (; pageNum < SCREEN_PAGE_NUM; pageNum += 2)
- _pagePtrs[pageNum] = _pagePtrs[pageNum + 1] = pagePtr + (pageNum / 2) * SCREEN_PAGE_SIZE;
- } else {
- for (int pageNum = 0; pageNum < SCREEN_PAGE_NUM; pageNum += 2)
- _pagePtrs[pageNum] = _pagePtrs[pageNum + 1] = pagePtr + (pageNum / 2) * SCREEN_PAGE_SIZE;
+ Common::Array<uint8> realPages;
+ for (int i = 0; i < SCREEN_PAGE_NUM; i++) {
+ if (Common::find(realPages.begin(), realPages.end(), _pageMapping[i]) == realPages.end())
+ realPages.push_back(_pageMapping[i]);
+ }
+
+ int numPages = realPages.size();
+ uint32 bufferSize = 0;
+ for (int i = 0; i < numPages; i++)
+ bufferSize += (SCREEN_PAGE_SIZE * _pageScaleFactor[realPages[i]] * _pageScaleFactor[realPages[i]]);
+
+ uint8 *pagePtr = new uint8[bufferSize];
+ memset(pagePtr, 0, bufferSize);
+
+ memset(_pagePtrs, 0, sizeof(_pagePtrs));
+ for (int i = 0; i < SCREEN_PAGE_NUM; i++) {
+ if (_pagePtrs[_pageMapping[i]]) {
+ _pagePtrs[i] = _pagePtrs[_pageMapping[i]];
+ } else {
+ _pagePtrs[i] = pagePtr;
+ pagePtr += (SCREEN_PAGE_SIZE * _pageScaleFactor[i] * _pageScaleFactor[i]);
+ }
}
memset(_shapePages, 0, sizeof(_shapePages));
@@ -211,7 +226,7 @@ bool Screen::enableScreenDebug(bool enable) {
if (_debugEnabled != enable) {
_debugEnabled = enable;
- setResolution();
+ setResolution(_vm->gameFlags().useHiResOverlay);
_forceFullUpdate = true;
updateScreen();
}
@@ -219,14 +234,14 @@ bool Screen::enableScreenDebug(bool enable) {
return temp;
}
-void Screen::setResolution() {
+void Screen::setResolution(bool hiRes) {
byte palette[3*256];
_system->getPaletteManager()->grabPalette(palette, 0, 256);
int width = 320, height = 200;
bool defaultTo1xScaler = false;
- if (_vm->gameFlags().useHiResOverlay) {
+ if (hiRes) {
defaultTo1xScaler = true;
height = 400;
@@ -261,7 +276,7 @@ void Screen::updateScreen() {
needRealUpdate = true;
if (!_useOverlays)
- _system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W, SCREEN_H);
+ _system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W * _pageScaleFactor[2], SCREEN_H * _pageScaleFactor[2]);
else
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 640, 0, SCREEN_W, SCREEN_H);
}
@@ -272,12 +287,12 @@ void Screen::updateScreen() {
void Screen::updateDirtyRects() {
if (_forceFullUpdate) {
- _system->copyRectToScreen(getCPagePtr(0), SCREEN_W, 0, 0, SCREEN_W, SCREEN_H);
+ _system->copyRectToScreen(getCPagePtr(0), SCREEN_W * _pageScaleFactor[0], 0, 0, SCREEN_W * _pageScaleFactor[0], SCREEN_H * _pageScaleFactor[0]);
} else {
const byte *page0 = getCPagePtr(0);
Common::List<Common::Rect>::iterator it;
for (it = _dirtyRects.begin(); it != _dirtyRects.end(); ++it) {
- _system->copyRectToScreen(page0 + it->top * SCREEN_W + it->left, SCREEN_W, it->left, it->top, it->width(), it->height());
+ _system->copyRectToScreen(page0 + it->top * SCREEN_W * _pageScaleFactor[0] + it->left, SCREEN_W * _pageScaleFactor[0], it->left, it->top, it->width(), it->height());
}
}
_forceFullUpdate = false;
@@ -451,6 +466,11 @@ const uint8 *Screen::getCPagePtr(int pageNum) const {
return _pagePtrs[pageNum];
}
+int Screen::getPageScaleFactor(int pageNum) {
+ assert(pageNum < SCREEN_PAGE_NUM);
+ return _pageScaleFactor[pageNum];
+}
+
uint8 *Screen::getPageRect(int pageNum, int x, int y, int w, int h) {
assert(pageNum < SCREEN_PAGE_NUM);
if (pageNum == 0 || pageNum == 1)
@@ -462,7 +482,7 @@ void Screen::clearPage(int pageNum) {
assert(pageNum < SCREEN_PAGE_NUM);
if (pageNum == 0 || pageNum == 1)
_forceFullUpdate = true;
- memset(getPagePtr(pageNum), 0, SCREEN_PAGE_SIZE);
+ memset(getPagePtr(pageNum), 0, SCREEN_PAGE_SIZE * _pageScaleFactor[_curPage] * _pageScaleFactor[_curPage]);
clearOverlayPage(pageNum);
}
@@ -476,7 +496,7 @@ int Screen::setCurPage(int pageNum) {
void Screen::clearCurPage() {
if (_curPage == 0 || _curPage == 1)
_forceFullUpdate = true;
- memset(getPagePtr(_curPage), 0, SCREEN_PAGE_SIZE);
+ memset(getPagePtr(_curPage), 0, SCREEN_PAGE_SIZE * _pageScaleFactor[_curPage] * _pageScaleFactor[_curPage]);
clearOverlayPage(_curPage);
}
@@ -632,12 +652,17 @@ uint8 Screen::getPagePixel(int pageNum, int x, int y) {
void Screen::setPagePixel(int pageNum, int x, int y, uint8 color) {
assert(pageNum < SCREEN_PAGE_NUM);
assert(x >= 0 && x < SCREEN_W && y >= 0 && y < SCREEN_H);
+
if (pageNum == 0 || pageNum == 1)
addDirtyRect(x, y, 1, 1);
if (_use16ColorMode) {
color &= 0x0F;
color |= (color << 4);
+ } else if (_renderMode == Common::kRenderCGA) {
+ color &= 0x03;
+ } else if (_renderMode == Common::kRenderEGA) {
+ color &= 0x0F;
}
_pagePtrs[pageNum][y * SCREEN_W + x] = color;
@@ -845,16 +870,26 @@ void Screen::copyToPage0(int y, int h, uint8 page, uint8 *seqBuf) {
}
void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage, int flags) {
+ // Since we don't (need to) do any actual scaling, we check for compatible pages here
+ assert(_pageScaleFactor[srcPage] == _pageScaleFactor[dstPage]);
+
+ x1 *= _pageScaleFactor[srcPage];
+ y1 *= _pageScaleFactor[srcPage];
+ x2 *= _pageScaleFactor[dstPage];
+ y2 *= _pageScaleFactor[dstPage];
+ w *= _pageScaleFactor[srcPage];
+ h *= _pageScaleFactor[srcPage];
+
if (x2 < 0) {
if (x2 <= -w)
return;
w += x2;
x1 -= x2;
x2 = 0;
- } else if (x2 + w >= SCREEN_W) {
- if (x2 > SCREEN_W)
+ } else if (x2 + w >= SCREEN_W * _pageScaleFactor[dstPage]) {
+ if (x2 > SCREEN_W * _pageScaleFactor[dstPage])
return;
- w = SCREEN_W - x2;
+ w = SCREEN_W * _pageScaleFactor[srcPage] - x2;
}
if (y2 < 0) {
@@ -863,14 +898,14 @@ void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPag
h += y2;
y1 -= y2;
y2 = 0;
- } else if (y2 + h >= SCREEN_H) {
- if (y2 > SCREEN_H)
+ } else if (y2 + h >= SCREEN_H * _pageScaleFactor[dstPage]) {
+ if (y2 > SCREEN_H * _pageScaleFactor[dstPage])
return;
- h = SCREEN_H - y2;
+ h = SCREEN_H * _pageScaleFactor[srcPage] - y2;
}
- const uint8 *src = getPagePtr(srcPage) + y1 * SCREEN_W + x1;
- uint8 *dst = getPagePtr(dstPage) + y2 * SCREEN_W + x2;
+ const uint8 *src = getPagePtr(srcPage) + y1 * SCREEN_W * _pageScaleFactor[srcPage] + x1;
+ uint8 *dst = getPagePtr(dstPage) + y2 * SCREEN_W * _pageScaleFactor[dstPage] + x2;
if (src == dst)
return;
@@ -883,8 +918,8 @@ void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPag
if (flags & CR_NO_P_CHECK) {
while (h--) {
memmove(dst, src, w);
- src += SCREEN_W;
- dst += SCREEN_W;
+ src += SCREEN_W * _pageScaleFactor[srcPage];
+ dst += SCREEN_W * _pageScaleFactor[dstPage];
}
} else {
while (h--) {
@@ -892,19 +927,24 @@ void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPag
if (src[i])
dst[i] = src[i];
}
- src += SCREEN_W;
- dst += SCREEN_W;
+ src += SCREEN_W * _pageScaleFactor[srcPage];
+ dst += SCREEN_W * _pageScaleFactor[dstPage];
}
}
}
void Screen::copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *dest) {
+ x *= _pageScaleFactor[pageNum];
+ y *= _pageScaleFactor[pageNum];
+ w *= _pageScaleFactor[pageNum];
+ h *= _pageScaleFactor[pageNum];
+
if (y < 0) {
dest += (-y) * w;
h += y;
y = 0;
} else if (y + h > SCREEN_H) {
- h = SCREEN_H - y;
+ h = SCREEN_H * _pageScaleFactor[pageNum] - y;
}
if (x < 0) {
@@ -912,7 +952,7 @@ void Screen::copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *
w += x;
x = 0;
} else if (x + w > SCREEN_W) {
- w = SCREEN_W - x;
+ w = SCREEN_W * _pageScaleFactor[pageNum] - x;
}
if (w < 0 || h < 0)
@@ -921,14 +961,17 @@ void Screen::copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *
uint8 *pagePtr = getPagePtr(pageNum);
for (int i = y; i < y + h; ++i)
- memcpy(dest + (i - y) * w, pagePtr + i * SCREEN_W + x, w);
+ memcpy(dest + (i - y) * w, pagePtr + i * SCREEN_W * _pageScaleFactor[pageNum] + x, w);
}
void Screen::copyPage(uint8 srcPage, uint8 dstPage) {
+ // Since we don't (need to) do any actual scaling, we check for compatible pages here
+ assert(_pageScaleFactor[srcPage] == _pageScaleFactor[dstPage]);
+
uint8 *src = getPagePtr(srcPage);
uint8 *dst = getPagePtr(dstPage);
if (src != dst)
- memcpy(dst, src, SCREEN_W * SCREEN_H);
+ memcpy(dst, src, SCREEN_W * _pageScaleFactor[srcPage] * SCREEN_H * _pageScaleFactor[srcPage]);
copyOverlayRegion(0, 0, 0, 0, SCREEN_W, SCREEN_H, srcPage, dstPage);
if (dstPage == 0 || dstPage == 1)
@@ -955,7 +998,12 @@ void Screen::copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint
if (w < 0 || h < 0)
return;
- uint8 *dst = getPagePtr(pageNum) + y * SCREEN_W + x;
+ x *= _pageScaleFactor[pageNum];
+ y *= _pageScaleFactor[pageNum];
+ w *= _pageScaleFactor[pageNum];
+ h *= _pageScaleFactor[pageNum];
+
+ uint8 *dst = getPagePtr(pageNum) + y * SCREEN_W * _pageScaleFactor[pageNum] + x;
if (pageNum == 0 || pageNum == 1)
addDirtyRect(x, y, w, h);
@@ -964,7 +1012,7 @@ void Screen::copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint
while (h--) {
memcpy(dst, src, w);
- dst += SCREEN_W;
+ dst += SCREEN_W * _pageScaleFactor[pageNum];
src += w;
}
}
@@ -1132,7 +1180,7 @@ void Screen::drawLine(bool vertical, int x, int y, int length, int color) {
int currLine = 0;
while (currLine < length) {
*ptr = color;
- ptr += SCREEN_W;
+ ptr += SCREEN_W * _pageScaleFactor[_curPage];
currLine++;
}
} else {
@@ -1178,7 +1226,7 @@ bool Screen::loadFont(FontId fontId, const char *filename) {
fnt = new AMIGAFont();
#ifdef ENABLE_EOB
else if (_vm->game() == GI_EOB1 || _vm->game() == GI_EOB2)
- fnt = new OldDOSFont(_renderMode, _cgaDrawCharDitheringTable);
+ fnt = new OldDOSFont(_renderMode, (_vm->game() == GI_EOB2) && (_renderMode == Common::kRenderEGA));
#endif // ENABLE_EOB
else
fnt = new DOSFont();
@@ -1265,12 +1313,12 @@ void Screen::printText(const char *str, int x, int y, uint8 color1, uint8 color2
break;
} else if (c == '\r') {
x = x_start;
- y += charHeightFnt + _charOffset;
+ y += (charHeightFnt + _charOffset);
} else {
int charWidth = getCharWidth(c);
if (x + charWidth > SCREEN_W) {
x = x_start;
- y += charHeightFnt + _charOffset;
+ y += (charHeightFnt + _charOffset);
if (y >= SCREEN_H)
break;
}
@@ -1307,6 +1355,9 @@ void Screen::drawChar(uint16 c, int x, int y) {
if (x + charWidth > SCREEN_W || y + charHeight > SCREEN_H)
return;
+ x *= _pageScaleFactor[_curPage];
+ y *= _pageScaleFactor[_curPage];
+
if (useOverlay) {
uint8 *destPage = getOverlayPtr(_curPage);
if (!destPage) {
@@ -1318,11 +1369,11 @@ void Screen::drawChar(uint16 c, int x, int y) {
fnt->drawChar(c, destPage, 640);
} else {
- fnt->drawChar(c, getPagePtr(_curPage) + y * SCREEN_W + x, SCREEN_W);
+ fnt->drawChar(c, getPagePtr(_curPage) + y * SCREEN_W * _pageScaleFactor[_curPage] + x, SCREEN_W * _pageScaleFactor[_curPage]);
}
if (_curPage == 0 || _curPage == 1)
- addDirtyRect(x, y, charWidth, charHeight);
+ addDirtyRect(x, y, charWidth * _pageScaleFactor[_curPage], charHeight * _pageScaleFactor[_curPage]);
}
void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int sd, int flags, ...) {
@@ -3084,16 +3135,11 @@ bool Screen::loadPalette(const char *filename, Palette &pal) {
numCols = stream->size() / Palette::kPC98BytesPerColor;
pal.loadPC98Palette(*stream, 0, MIN(maxCols, numCols));
} else if (_renderMode == Common::kRenderEGA) {
- // EOB II checks the number of palette bytes to distinguish between real EGA palettes
- // and normal palettes (which are used to generate a color map).
- if (stream->size() == 16) {
- numCols = 16;
- pal.loadEGAPalette(*stream, 0, 16);
- } else {
- numCols = stream->size() / Palette::kVGABytesPerColor;
- pal.loadVGAPalette(*stream, 0, numCols);
- }
-
+ numCols = stream->size();
+ // There aren't any 16 color EGA palette files. So this shouldn't ever get triggered.
+ assert (numCols != 16);
+ numCols /= Palette::kVGABytesPerColor;
+ pal.loadVGAPalette(*stream, 0, numCols);
} else {
numCols = stream->size() / Palette::kVGABytesPerColor;
pal.loadVGAPalette(*stream, 0, MIN(maxCols, numCols));
@@ -3163,7 +3209,7 @@ void Screen::addDirtyRect(int x, int y, int w, int h) {
Common::Rect r(x, y, x + w, y + h);
// Clip rectangle
- r.clip(SCREEN_W, SCREEN_H);
+ r.clip(SCREEN_W * _pageScaleFactor[0], SCREEN_H * _pageScaleFactor[0]);
// If it is empty after clipping, we are done
if (r.isEmpty())
@@ -3270,6 +3316,8 @@ void Screen::crossFadeRegion(int x1, int y1, int x2, int y2, int w, int h, int s
if (srcPage > 13 || dstPage > 13)
error("Screen::crossFadeRegion(): attempting to use temp page as source or dest page.");
+ assert(_pageScaleFactor[srcPage] == _pageScaleFactor[dstPage]);
+
hideMouse();
uint16 *wB = (uint16 *)_pagePtrs[14];
@@ -3287,23 +3335,19 @@ void Screen::crossFadeRegion(int x1, int y1, int x2, int y2, int w, int h, int s
for (int i = 0; i < h; i++)
SWAP(hB[_vm->_rnd.getRandomNumberRng(0, h - 1)], hB[i]);
- uint8 *s = _pagePtrs[srcPage];
- uint8 *d = _pagePtrs[dstPage];
-
for (int i = 0; i < h; i++) {
int iH = i;
uint32 end = _system->getMillis() + 3;
for (int ii = 0; ii < w; ii++) {
- int sX = x1 + wB[ii];
- int sY = y1 + hB[iH];
- int dX = x2 + wB[ii];
- int dY = y2 + hB[iH];
+ int sX = (x1 + wB[ii]);
+ int sY = (y1 + hB[iH]);
+ int dX = (x2 + wB[ii]);
+ int dY = (y2 + hB[iH]);
if (++iH >= h)
iH = 0;
- d[dY * 320 + dX] = s[sY * 320 + sX];
- addDirtyRect(dX, dY, 1, 1);
+ setPagePixel(dstPage, dX, dY, getPagePixel(srcPage, sX, sY));
}
// This tries to speed things up, to get similiar speeds as in DOSBox etc.
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index fcb5ef2..18c0aa9 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -145,7 +145,7 @@ private:
*/
class OldDOSFont : public Font {
public:
- OldDOSFont(Common::RenderMode mode, const uint16 *cgaDitheringTable);
+ OldDOSFont(Common::RenderMode mode, bool useHiResEGADithering);
~OldDOSFont();
bool load(Common::SeekableReadStream &file);
@@ -167,7 +167,10 @@ private:
int _numGlyphs;
Common::RenderMode _renderMode;
- const uint16 *_cgaDitheringTable;
+ bool _useHiResEGADithering;
+
+ static uint16 *_cgaDitheringTable;
+ static int _numRef;
};
#endif // ENABLE_EOB
@@ -395,7 +398,7 @@ public:
// init
virtual bool init();
- virtual void setResolution();
+ virtual void setResolution(bool hiRes = false);
void updateScreen();
@@ -422,14 +425,16 @@ public:
void copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint8 *src);
void shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPage, int ticks, bool transparent);
- void fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum = -1, bool xored = false);
+ virtual void fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum = -1, bool xored = false);
void clearPage(int pageNum);
- uint8 getPagePixel(int pageNum, int x, int y);
- void setPagePixel(int pageNum, int x, int y, uint8 color);
+ virtual uint8 getPagePixel(int pageNum, int x, int y);
+ virtual void setPagePixel(int pageNum, int x, int y, uint8 color);
const uint8 *getCPagePtr(int pageNum) const;
+ int getPageScaleFactor(int pageNum);
+
uint8 *getPageRect(int pageNum, int x, int y, int w, int h);
// palette handling
@@ -453,7 +458,7 @@ public:
void copyPalette(const int dst, const int src);
// gui specific (processing on _curPage)
- void drawLine(bool vertical, int x, int y, int length, int color);
+ virtual void drawLine(bool vertical, int x, int y, int length, int color);
void drawClippedLine(int x1, int y1, int x2, int y2, int color);
virtual void drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2);
void drawBox(int x1, int y1, int x2, int y2, int color);
@@ -468,7 +473,7 @@ public:
int getCharWidth(uint16 c) const;
int getTextWidth(const char *str) const;
- void printText(const char *str, int x, int y, uint8 color1, uint8 color2);
+ virtual void printText(const char *str, int x, int y, uint8 color1, uint8 color2);
virtual void setTextColorMap(const uint8 *cmap) = 0;
void setTextColor(const uint8 *cmap, int a, int b);
@@ -569,13 +574,14 @@ protected:
uint8 *_pagePtrs[16];
uint8 *_sjisOverlayPtrs[SCREEN_OVLS_NUM];
+ uint8 _pageScaleFactor[SCREEN_PAGE_NUM];
+ uint8 _pageMapping[SCREEN_PAGE_NUM];
bool _useOverlays;
bool _useSJIS;
bool _use16ColorMode;
bool _isAmiga;
Common::RenderMode _renderMode;
- uint16 *_cgaDrawCharDitheringTable;
uint8 _sjisInvisibleColor;
diff --git a/engines/kyra/screen_eob.cpp b/engines/kyra/screen_eob.cpp
index 51665a0..38521d7 100644
--- a/engines/kyra/screen_eob.cpp
+++ b/engines/kyra/screen_eob.cpp
@@ -51,7 +51,7 @@ Screen_EoB::Screen_EoB(EoBCoreEngine *vm, OSystem *system) : Screen(vm, system,
_dsScaleTrans = 0;
_cgaScaleTable = 0;
_gfxMaxY = 0;
- _egaColorMap = 0;
+ _egaDitheringTable = 0;
_egaPixelValueTable = 0;
_cgaMappingDefault = 0;
_cgaDitheringTables[0] = _cgaDitheringTables[1] = 0;
@@ -62,11 +62,10 @@ Screen_EoB::~Screen_EoB() {
delete[] _fadeData;
delete[] _dsTempPage;
delete[] _cgaScaleTable;
- delete[] _egaColorMap;
+ delete[] _egaDitheringTable;
delete[] _egaPixelValueTable;
delete[] _cgaDitheringTables[0];
delete[] _cgaDitheringTables[1];
- delete[] _cgaDrawCharDitheringTable;
}
bool Screen_EoB::init() {
@@ -74,6 +73,12 @@ bool Screen_EoB::init() {
}
bool Screen_EoB::init(bool useHiResEGADithering) {
+ // Define hi-res pages for EGA mode in EOB II
+ if (useHiResEGADithering) {
+ for (int i = 0; i < 8; i++)
+ _pageScaleFactor[i] = 2;
+ }
+
if (Screen::init()) {
int temp;
_gfxMaxY = _vm->staticres()->loadRawData(kEoBBaseExpObjectY, temp);
@@ -96,10 +101,10 @@ bool Screen_EoB::init(bool useHiResEGADithering) {
if (_renderMode == Common::kRenderEGA) {
_useHiResEGADithering = useHiResEGADithering;
- _egaColorMap = new uint8[256];
+ _egaDitheringTable = new uint8[256];
_egaPixelValueTable = new uint8[256];
for (int i = 0; i < 256; i++) {
- _egaColorMap[i] = i & 0x0f;
+ _egaDitheringTable[i] = i & 0x0f;
_egaPixelValueTable[i] = i & 0x0f;
}
@@ -110,12 +115,6 @@ bool Screen_EoB::init(bool useHiResEGADithering) {
_cgaDitheringTables[1] = new uint16[256];
memset(_cgaDitheringTables[1], 0, 256 * sizeof(uint16));
- _cgaDrawCharDitheringTable = new uint16[256];
- memset(_cgaDrawCharDitheringTable, 0, 256 * sizeof(uint16));
- static const uint bits[] = { 0, 3, 12, 15 };
- for (int i = 0; i < 256; i++)
- _cgaDrawCharDitheringTable[i] = (bits[i & 3] << 8) | (bits[(i >> 2) & 3] << 12) | (bits[(i >> 4) & 3] << 0) | (bits[(i >> 6) & 3] << 4);
-
_cgaScaleTable = new uint8[256];
memset(_cgaScaleTable, 0, 256 * sizeof(uint8));
for (int i = 0; i < 256; i++)
@@ -143,13 +142,19 @@ void Screen_EoB::setMouseCursor(int x, int y, const byte *shape) {
void Screen_EoB::setMouseCursor(int x, int y, const byte *shape, const uint8 *ovl) {
if (!shape)
return;
- int mouseW = shape[2] << 3;
- int mouseH = shape[3];
- uint8 *cursor = new uint8[mouseW * mouseH];
- fillRect(0, 0, mouseW, mouseH, _cursorColorKey, 8);
- drawShape(8, shape, 0, 0, 0, 2, ovl);
+
+ int mouseW = (shape[2] << 3);
+ int mouseH = (shape[3]);
+ int colorKey = (_renderMode == Common::kRenderCGA) ? 0 : _cursorColorKey;
+
+ uint8 *cursor = new uint8[mouseW * _pageScaleFactor[6] * mouseH * _pageScaleFactor[6]];
+ // We use memset and copyBlockToPage instead of fillRect to make sure that the
+ // color key 0xFF doesn't get converted into EGA color
+ memset (cursor, colorKey, mouseW * _pageScaleFactor[6] * mouseH * _pageScaleFactor[6]);
+ copyBlockToPage(6, 0, 0, mouseW, mouseH, cursor);
+ drawShape(6, shape, 0, 0, 0, 2, ovl);
CursorMan.showMouse(false);
- copyRegionToBuffer(8, 0, 0, mouseW, mouseH, cursor);
+ copyRegionToBuffer(6, 0, 0, mouseW, mouseH, cursor);
// Mouse cursor post processing for CGA mode. Unlike the original (which uses drawShape for the mouse cursor)
// the cursor manager cannot know whether a pixel value of 0 is supposed to be black or transparent. Thus, we
@@ -174,7 +179,7 @@ void Screen_EoB::setMouseCursor(int x, int y, const byte *shape, const uint8 *ov
}
}
- CursorMan.replaceCursor(cursor, mouseW, mouseH, x, y, _cursorColorKey);
+ CursorMan.replaceCursor(cursor, mouseW * _pageScaleFactor[6], mouseH * _pageScaleFactor[6], x, y, colorKey);
if (isMouseVisible())
CursorMan.showMouse(true);
delete[] cursor;
@@ -190,6 +195,19 @@ void Screen_EoB::loadFileDataToPage(Common::SeekableReadStream *s, int pageNum,
s->read(_pagePtrs[pageNum], size);
}
+void Screen_EoB::printText(const char *str, int x, int y, uint8 color1, uint8 color2) {
+ if (_useHiResEGADithering) {
+ // This is sort of an abuse of the text color map. But since EOB doesn't use it anyway
+ // and the font drawing code needs access to both the original color values and the
+ // EGA dithering colors we pass them on like this.
+ uint8 cmap[2];
+ cmap[0] = _egaDitheringTable[color2];
+ cmap[1] = _egaDitheringTable[color1];
+ setTextColor(cmap, 2, 3);
+ }
+ Screen::printText(str, x, y, color1, color2);
+}
+
void Screen_EoB::printShadedText(const char *string, int x, int y, int col1, int col2) {
printText(string, x - 1, y, 12, col2);
printText(string, x, y + 1, 12, 0);
@@ -256,87 +274,153 @@ void Screen_EoB::convertPage(int srcPage, int dstPage, const uint8 *cgaMapping)
if (_renderMode == Common::kRenderCGA) {
if (cgaMapping)
generateCGADitheringTables(cgaMapping);
+
uint16 *d = (uint16*)dst;
uint8 tblSwitch = 0;
for (int height = SCREEN_H; height; height--) {
const uint16 *table = _cgaDitheringTables[(tblSwitch++) & 1];
for (int width = SCREEN_W / 2; width; width--) {
- *d++ = table[((src[1] & 0x0f) << 4) | (src[0] & 0x0f)];
+ WRITE_LE_UINT16(d++, table[((src[1] & 0x0f) << 4) | (src[0] & 0x0f)]);
src += 2;
}
}
- if (dstPage == 0 || dstPage == 1)
- _forceFullUpdate = true;
+ } else if (_useHiResEGADithering) {
+ for (int height = SCREEN_H; height; height--) {
+ uint8 *dst2 = dst + SCREEN_W * 2;
+ for (int width = SCREEN_W; width; width--) {
+ uint8 in = _egaDitheringTable[*src++];
+ *dst++ = *dst2++ = in >> 4;
+ *dst++ = *dst2++ = in & 0x0f;
+ }
+ dst += (SCREEN_W * 2);
+ }
} else if (_renderMode == Common::kRenderEGA) {
uint32 len = SCREEN_W * SCREEN_H;
- if (_useHiResEGADithering) {
- while (len--) {
- uint8 col = _egaColorMap[*src++] & 0x0f;
- *dst++ = col;
+ while (len--)
+ *dst++ = *src++ & 0x0f;
+
+ } else {
+ copyPage(srcPage, dstPage);
+ }
- /*for (int i = 4; i; i--) {
- uint8 col = _egaColorMap[*src++];
+ if (dstPage == 0 || dstPage == 1)
+ _forceFullUpdate = true;
+}
- }*/
- }
- } else {
- while (len--)
- *dst++ = *src++ & 0x0f;
+void Screen_EoB::fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum, bool xored) {
+ if (!_useHiResEGADithering) {
+ Screen::fillRect(x1, y1, x2, y2, color, pageNum, xored);
+ return;
+ }
+
+ assert(x2 < SCREEN_W && y2 < SCREEN_H);
+ if (pageNum == -1)
+ pageNum = _curPage;
+
+ uint16 pitch = (SCREEN_W - (x2 - x1 + 1)) * _pageScaleFactor[pageNum];
+ uint8 col1 = (_egaDitheringTable[color] >> 4);
+ uint8 col2 = (_egaDitheringTable[color] & 0x0f);
+
+ x1 *= _pageScaleFactor[pageNum];
+ y1 *= _pageScaleFactor[pageNum];
+ x2 *= _pageScaleFactor[pageNum];
+ y2 *= _pageScaleFactor[pageNum];
+ uint16 w = x2 - x1 + _pageScaleFactor[pageNum];
+ uint16 h = y2 - y1 + _pageScaleFactor[pageNum];
+
+ uint8 *dst = getPagePtr(pageNum) + y1 * SCREEN_W * _pageScaleFactor[pageNum] + x1;
+ if (pageNum == 0 || pageNum == 1)
+ addDirtyRect(x1, y1, w, h);
+
+ while (h--) {
+ for (uint16 w1 = w; w1; w1 -= 2) {
+ *dst++ = col1;
+ *dst++ = col2;
}
+ dst += pitch;
+ }
+}
- if (dstPage == 0 || dstPage == 1)
- _forceFullUpdate = true;
+void Screen_EoB::drawLine(bool vertical, int x, int y, int length, int color) {
+ if (!_useHiResEGADithering) {
+ Screen::drawLine(vertical, x, y, length, color);
+ return;
+ }
+
+ uint16 pitch = (SCREEN_W - 1) * _pageScaleFactor[_curPage];
+ uint8 col1 = (_egaDitheringTable[color] >> 4);
+ uint8 col2 = (_egaDitheringTable[color] & 0x0f);
+
+ x *= _pageScaleFactor[_curPage];
+ y *= _pageScaleFactor[_curPage];
+ length *= _pageScaleFactor[_curPage];
+ uint8 *ptr = getPagePtr(_curPage) + y * SCREEN_W * _pageScaleFactor[_curPage] + x;
+ uint8 *ptr2 = ptr + SCREEN_W * _pageScaleFactor[_curPage];
+
+ if (vertical) {
+ assert((y + length) <= SCREEN_H * _pageScaleFactor[_curPage]);
+ int currLine = 0;
+ while (currLine < length) {
+ *ptr++ = col1;
+ *ptr++ = col2;
+ ptr += pitch;
+ currLine++;
+ }
} else {
- copyPage(srcPage, dstPage);
+ assert((x + length) <= SCREEN_W * _pageScaleFactor[_curPage]);
+ int currLine = 0;
+ while (currLine < length) {
+ *ptr++ = *ptr2++ = col1;
+ *ptr++ = *ptr2++ = col2;
+ currLine += 2;
+ }
}
+
+ if (_curPage == 0 || _curPage == 1)
+ addDirtyRect(x, y, (vertical) ? _pageScaleFactor[_curPage] : length, (vertical) ? length : _pageScaleFactor[_curPage]);
}
-void Screen_EoB::setScreenPalette(const Palette &pal) {
- if (_renderMode == Common::kRenderEGA && _egaColorMap && pal.getNumColors() != 16) {
- const uint8 *src = pal.getData();
- uint8 *dst = _egaColorMap;
-
- for (int i = 256; i; i--) {
- uint8 r = *src++;
- uint8 g = *src++;
- uint8 b = *src++;
-
- uint8 col = 0;
- uint16 min = 11907;
-
- for (int ii = 256; ii; ii--) {
- const uint8 *palEntry = _egaMatchTable + (ii - 1) * 3;
- if (*palEntry == 0xff)
- continue;
-
- int e_r = palEntry[0];
- e_r -= r;
- int e_g = palEntry[1];
- e_g -= g;
- int e_b = palEntry[2];
- e_b -= b;
-
- int s = (e_r * e_r) + (e_g * e_g) + (e_b * e_b);
-
- if (s < min) {
- min = s;
- col = ii - 1;
- }
- }
- *dst++ = col;
- }
+uint8 Screen_EoB::getPagePixel(int pageNum, int x, int y) {
+ if (!_useHiResEGADithering)
+ return Screen::getPagePixel(pageNum, x, y);
- memset(_egaPixelValueTable, 0, 256);
- for (int i = 0; i < 256; i++)
- _egaPixelValueTable[_egaColorMap[i]] = i;
+ x *= _pageScaleFactor[_curPage];
+ y *= _pageScaleFactor[_curPage];
+ uint8 *pos = &_pagePtrs[pageNum][y * SCREEN_W * _pageScaleFactor[_curPage] + x];
- } else if (_renderMode == Common::kRenderEGA) {
+ return _egaPixelValueTable[(pos[0] << 4) | (pos[1] & 0x0f)];
+}
+
+void Screen_EoB::setPagePixel(int pageNum, int x, int y, uint8 color) {
+ if (!_useHiResEGADithering) {
+ Screen::setPagePixel(pageNum, x, y, color);
+ return;
+ }
+
+ assert(pageNum < SCREEN_PAGE_NUM);
+ assert(x >= 0 && x < SCREEN_W && y >= 0 && y < SCREEN_H);
+
+ x *= _pageScaleFactor[_curPage];
+ y *= _pageScaleFactor[_curPage];
+
+ if (pageNum == 0 || pageNum == 1)
+ addDirtyRect(x, y, _pageScaleFactor[pageNum], _pageScaleFactor[pageNum]);
+
+ uint8 *pos = &_pagePtrs[pageNum][y * SCREEN_W * _pageScaleFactor[_curPage] + x];
+ uint8 *pos2 = pos + SCREEN_W * _pageScaleFactor[_curPage];
+ pos[0] = pos2[0] = _egaDitheringTable[color] >> 4;
+ pos[1] = pos2[1] = _egaDitheringTable[color] & 0x0f;
+}
+
+void Screen_EoB::setScreenPalette(const Palette &pal) {
+ if (_useHiResEGADithering && pal.getNumColors() != 16) {
+ generateEGADitheringTable(pal);
+ } else if (_renderMode == Common::kRenderEGA && pal.getNumColors() == 16) {
_screenPalette->copy(pal);
_system->getPaletteManager()->setPalette(_screenPalette->getData(), 0, _screenPalette->getNumColors());
-
- } else if (_renderMode != Common::kRenderCGA) {
+ } else if (_renderMode != Common::kRenderCGA && _renderMode != Common::kRenderEGA) {
Screen::setScreenPalette(pal);
}
}
@@ -457,7 +541,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
uint8 nib = 0, col = 0;
uint8 *colorMap = 0;
- if (_renderMode != Common::kRenderEGA) {
+ if (_renderMode != Common::kRenderEGA || _useHiResEGADithering) {
colorMap = new uint8[0x100];
memset(colorMap, 0xff, 0x100);
}
@@ -472,7 +556,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
*dst++ = (w & 0xff);
*dst++ = (h & 0xff);
- if (_renderMode == Common::kRenderEGA) {
+ if (_renderMode == Common::kRenderEGA && !_useHiResEGADithering) {
for (int i = 0; i < 16; i++)
dst[i] = i;
} else {
@@ -536,7 +620,7 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
y += _dsY1;
}
- dst += (_dsX1 << 3);
+ dst += (_dsX1 << 3) * _pageScaleFactor[pageNum];
int16 dX = x - (_dsX1 << 3);
int16 dY = y;
int16 dW = _dsX2 - _dsX1;
@@ -608,11 +692,11 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
marginRight = w2 - marginLeft - width;
}
- dst += (dY * 320 + dX);
+ dst += (dY * SCREEN_W * _pageScaleFactor[pageNum] * _pageScaleFactor[pageNum] + dX * _pageScaleFactor[pageNum]);
uint8 *dstL = dst;
if (pageNum == 0 || pageNum == 1)
- addDirtyRect(rX, rY, rW, rH);
+ addDirtyRect(rX * _pageScaleFactor[pageNum], rY * _pageScaleFactor[pageNum], rW * _pageScaleFactor[pageNum], rH * _pageScaleFactor[pageNum]);
while (dH--) {
int16 xpos = (int16) marginLeft;
@@ -647,7 +731,7 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
} while (xpos > 0);
}
- dst -= xpos;
+ dst -= (xpos * _pageScaleFactor[pageNum]);
xpos += width;
while (xpos > 0) {
@@ -656,11 +740,12 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
src += pixelStep;
if (m) {
- drawShapeSetPixel(dst++, c);
+ drawShapeSetPixel(dst, c, SCREEN_W * _pageScaleFactor[pageNum]);
+ dst += _pageScaleFactor[pageNum];
xpos--;
} else {
uint8 len = (flags & 1) ? src[1] : src[0];
- dst += len;
+ dst += (len * _pageScaleFactor[pageNum]);
xpos -= len;
src += pixelStep;
}
@@ -686,7 +771,7 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
} while (xpos > 0);
}
- dstL += 320;
+ dstL += SCREEN_W * _pageScaleFactor[pageNum] * _pageScaleFactor[pageNum];
dst = dstL;
if (flags & 1)
src = src2 + 1;
@@ -754,12 +839,12 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
if (d < width)
width = d;
- dst += (dY * 320 + dX);
+ dst += (dY * _pageScaleFactor[pageNum] * SCREEN_W * _pageScaleFactor[pageNum] + dX * _pageScaleFactor[pageNum]);
if (pageNum == 0 || pageNum == 1)
- addDirtyRect(rX, rY, rW, rH);
+ addDirtyRect(rX * _pageScaleFactor[pageNum], rY * _pageScaleFactor[pageNum], rW * _pageScaleFactor[pageNum], rH * _pageScaleFactor[pageNum]);
- int pitch = 320 - width;
+ int pitch = SCREEN_W * _pageScaleFactor[pageNum] * _pageScaleFactor[pageNum] - width * _pageScaleFactor[pageNum];
int16 lineSrcStep = (w2 - width) / pixelsPerByte;
uint8 lineSrcStepRemainder = (w2 - width) % pixelsPerByte;
@@ -802,9 +887,9 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
}
uint8 col = (pixelsPerByte == 2) ? pal[(in >> shift) & pixelPackingMask] : (*dst & ((trans >> shift) & (pixelPackingMask))) | pal[(in >> shift) & pixelPackingMask];
if (col || pixelsPerByte == 4)
- drawShapeSetPixel(dst, col);
- dst++;
- shift = (shift - (pixelStep * pixelPacking) & 7);
+ drawShapeSetPixel(dst, col, SCREEN_W * _pageScaleFactor[pageNum]);
+ dst += _pageScaleFactor[pageNum];
+ shift = ((shift - (pixelStep * pixelPacking)) & 7);
}
src += lineSrcStep;
dst += pitch;
@@ -1266,25 +1351,36 @@ const uint16 *Screen_EoB::getCGADitheringTable(int index) {
return !(index & ~1) ? _cgaDitheringTables[index] : 0;
}
-void Screen_EoB::drawShapeSetPixel(uint8 *dst, uint8 c) {
+const uint8 *Screen_EoB::getEGADitheringTable() {
+ return _egaDitheringTable;
+}
+
+void Screen_EoB::drawShapeSetPixel(uint8 *dst, uint8 col, uint16 pitch) {
if ((_renderMode != Common::kRenderCGA && _renderMode != Common::kRenderEGA) || _useHiResEGADithering) {
if (_shapeFadeMode[0]) {
if (_shapeFadeMode[1]) {
- c = *dst;
+ col = _useHiResEGADithering ? _egaPixelValueTable[(dst[0] << 4) | (dst[1] & 0x0f)] : *dst;
} else {
_shapeFadeInternal &= 7;
- c = *(dst + _shapeFadeInternal++);
+ col = _useHiResEGADithering ? _egaPixelValueTable[(dst[_shapeFadeInternal] << 4) | (dst[_shapeFadeInternal + 1] & 0x0f)] : dst[_shapeFadeInternal];
+ _shapeFadeInternal++;
}
}
if (_shapeFadeMode[1]) {
uint8 cnt = _shapeFadeMode[1];
while (cnt--)
- c = _fadeData[_fadeDataIndex + c];
+ col = _fadeData[_fadeDataIndex + col];
}
}
- *dst = c;
+ if (_useHiResEGADithering) {
+ col = _egaDitheringTable[col];
+ dst[0] = dst[pitch] = col >> 4;
+ dst[1] = dst[pitch + 1] = col & 0x0f;
+ } else {
+ *dst = col;
+ }
}
void Screen_EoB::scaleShapeProcessLine2Bit(uint8 *&shpDst, const uint8 *&shpSrc, uint32 transOffsetDst, uint32 transOffsetSrc) {
@@ -1340,6 +1436,43 @@ bool Screen_EoB::posWithinRect(int posX, int posY, int x1, int y1, int x2, int y
return true;
}
+void Screen_EoB::generateEGADitheringTable(const Palette &pal) {
+ assert(_egaDitheringTable);
+ const uint8 *src = pal.getData();
+ uint8 *dst = _egaDitheringTable;
+
+ for (int i = 256; i; i--) {
+ int r = *src++;
+ int g = *src++;
+ int b = *src++;
+
+ uint8 col = 0;
+ uint16 min = 0x2E83;
+
+ for (int ii = 256; ii; ii--) {
+ const uint8 *palEntry = _egaMatchTable + (ii - 1) * 3;
+ if (*palEntry == 0xff)
+ continue;
+
+ int e_r = palEntry[0] - r;
+ int e_g = palEntry[1] - g;
+ int e_b = palEntry[2] - b;
+
+ uint16 s = (e_r * e_r) + (e_g * e_g) + (e_b * e_b);
+
+ if (s <= min) {
+ min = s;
+ col = ii - 1;
+ }
+ }
+ *dst++ = col;
+ }
+
+ memset(_egaPixelValueTable, 0, 256);
+ for (int i = 0; i < 256; i++)
+ _egaPixelValueTable[_egaDitheringTable[i]] = i;
+}
+
void Screen_EoB::generateCGADitheringTables(const uint8 *mappingData) {
for (int i = 0; i < 256; i++) {
_cgaDitheringTables[0][i] = (mappingData[(i >> 4) + 16] << 8) | mappingData[i & 0x0f];
@@ -1398,14 +1531,34 @@ const uint8 Screen_EoB::_egaMatchTable[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0x3F
};
-OldDOSFont::OldDOSFont(Common::RenderMode mode, const uint16 *cgaDitheringTable) : _renderMode(mode), _cgaDitheringTable(cgaDitheringTable) {
+uint16 *OldDOSFont::_cgaDitheringTable = 0;
+int OldDOSFont::_numRef = 0;
+
+OldDOSFont::OldDOSFont(Common::RenderMode mode, bool useHiResEGADithering) : _renderMode(mode), _useHiResEGADithering(useHiResEGADithering) {
_data = 0;
_width = _height = _numGlyphs = 0;
_bitmapOffsets = 0;
+
+ _numRef++;
+ if (!_cgaDitheringTable && _numRef == 1) {
+ _cgaDitheringTable = new uint16[256];
+ memset(_cgaDitheringTable, 0, 256 * sizeof(uint16));
+ static const uint bits[] = { 0, 3, 12, 15 };
+ for (int i = 0; i < 256; i++)
+ _cgaDitheringTable[i] = (bits[i & 3] << 8) | (bits[(i >> 2) & 3] << 12) | (bits[(i >> 4) & 3] << 0) | (bits[(i >> 6) & 3] << 4);
+ }
}
OldDOSFont::~OldDOSFont() {
unload();
+
+ if (_numRef)
+ --_numRef;
+
+ if (_cgaDitheringTable && !_numRef) {
+ delete[] _cgaDitheringTable;
+ _cgaDitheringTable = 0;
+ }
}
bool OldDOSFont::load(Common::SeekableReadStream &file) {
@@ -1491,18 +1644,27 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
}
const uint8 *src = &_data[_bitmapOffsets[c]];
+ uint8 *dst2 = dst + pitch;
int w = (_width - 1) >> 3;
pitch -= _width;
+ if (_useHiResEGADithering)
+ pitch *= 2;
+
uint8 color1 = _colorMap[1];
uint8 color2 = _colorMap[0];
+ uint8 colEGA11 = _colorMap[3] >> 4;
+ uint8 colEGA12 = _colorMap[3] & 0x0f;
+ uint8 colEGA21 = _colorMap[2] >> 4;
+ uint8 colEGA22 = _colorMap[2] & 0x0f;
+
static const uint16 cgaColorMask[] = { 0, 0x5555, 0xAAAA, 0xFFFF };
uint16 cgaMask1 = cgaColorMask[color1 & 3];
uint16 cgaMask2 = cgaColorMask[color2 & 3];
- if (_renderMode == Common::kRenderCGA) {
+ if (_renderMode == Common::kRenderCGA || (_renderMode == Common::kRenderEGA && !_useHiResEGADithering)) {
color1 &= 0x0f;
color2 &= 0x0f;
}
@@ -1559,13 +1721,27 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
break;
}
- if (s & i) {
- if (color1)
- *dst = color1;
- } else if (color2) {
- *dst = color2;
+ if (_useHiResEGADithering) {
+ if (s & i) {
+ if (color1) {
+ dst[0] = dst2[0] = colEGA11;
+ dst[1] = dst2[1] = colEGA12;
+ }
+ } else if (color2) {
+ dst[0] = dst2[0] = colEGA21;
+ dst[1] = dst2[1] = colEGA22;
+ }
+ dst += 2;
+ dst2 += 2;
+ } else {
+ if (s & i) {
+ if (color1)
+ *dst = color1;
+ } else if (color2) {
+ *dst = color2;
+ }
+ dst++;
}
- dst++;
}
if (cW)
@@ -1574,7 +1750,9 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
runWidthLoop = false;
}
}
+
dst += pitch;
+ dst2 += pitch;
}
}
diff --git a/engines/kyra/screen_eob.h b/engines/kyra/screen_eob.h
index cf8f869..2bcfbd8 100644
--- a/engines/kyra/screen_eob.h
+++ b/engines/kyra/screen_eob.h
@@ -46,12 +46,19 @@ public:
void loadFileDataToPage(Common::SeekableReadStream *s, int pageNum, uint32 size);
+ void printText(const char *str, int x, int y, uint8 color1, uint8 color2);
void printShadedText(const char *string, int x, int y, int col1, int col2);
+
void loadEoBBitmap(const char *file, const uint8 *cgaMapping, int tempPage, int destPage, int convertToPage);
void loadShapeSetBitmap(const char *file, int tempPage, int destPage);
void convertPage(int srcPage, int dstPage, const uint8 *cgaMapping);
+ void fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum = -1, bool xored = false);
+ void drawLine(bool vertical, int x, int y, int length, int color);
+ uint8 getPagePixel(int pageNum, int x, int y);
+ void setPagePixel(int pageNum, int x, int y, uint8 color);
+
void setScreenPalette(const Palette &pal);
uint8 *encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool encode8bit = false, const uint8 *cgaMapping = 0);
@@ -76,14 +83,17 @@ public:
void setFadeTableIndex(int index);
void createFadeTable(uint8 *palData, uint8 *dst, uint8 rootColor, uint8 weight);
uint8 *getFadeTable(int index);
+
const uint16 *getCGADitheringTable(int index);
+ const uint8 *getEGADitheringTable();
private:
- void drawShapeSetPixel(uint8 *dst, uint8 c);
+ void drawShapeSetPixel(uint8 *dst, uint8 col, uint16 pitch);
void scaleShapeProcessLine2Bit(uint8 *&shpDst, const uint8 *&shpSrc, uint32 transOffsetDst, uint32 transOffsetSrc);
void scaleShapeProcessLine4Bit(uint8 *&dst, const uint8 *&src);
bool posWithinRect(int posX, int posY, int x1, int y1, int x2, int y2);
+ void generateEGADitheringTable(const Palette &pal);
void generateCGADitheringTables(const uint8 *mappingData);
int _dsDiv, _dsRem, _dsScaleTrans;
@@ -104,7 +114,7 @@ private:
uint16 *_cgaDitheringTables[2];
const uint8 *_cgaMappingDefault;
- uint8 *_egaColorMap;
+ uint8 *_egaDitheringTable;
uint8 *_egaPixelValueTable;
bool _useHiResEGADithering;
Commit: 7986f1709d77a84df92ba86ecf04a0cb1e88e0cf
https://github.com/scummvm/scummvm/commit/7986f1709d77a84df92ba86ecf04a0cb1e88e0cf
Author: athrxx (athrxx at scummvm.org)
Date: 2012-02-21T12:48:48-08:00
Commit Message:
KYRA: (EOB) - make detection entries for EOB I more unique (bug #3488973)
This makes sure that non English versions don't get detected as English.
Changed paths:
engines/kyra/detection_tables.h
diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h
index 4d84b09..44e604c 100644
--- a/engines/kyra/detection_tables.h
+++ b/engines/kyra/detection_tables.h
@@ -1463,7 +1463,7 @@ const KYRAGameDescription adGameDescs[] = {
"eob",
0,
{
- { "EOBDATA2.PAK", 0, "feaf0345086b3a1d931352f4b0ad8feb", -1 },
+ { "EOBDATA3.PAK", 0, "61aff543131bd61a8b7d7dc901a8278b", -1 },
{ 0, 0, 0, 0 }
},
Common::EN_ANY,
@@ -1479,7 +1479,7 @@ const KYRAGameDescription adGameDescs[] = {
"eob",
0,
{
- { "SHINDIA.CPS", 0, "383b0c7ba0903eae5d04cad28ce90aaf", -1 },
+ { "TEXT.DAT", 0, "fb59b50f97fd1806756911d986b9b2b5", -1 },
{ 0, 0, 0, 0 }
},
Common::DE_DEU,
More information about the Scummvm-git-logs
mailing list