diff options
author | Johannes Schickel | 2008-12-29 14:37:51 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-12-29 14:37:51 +0000 |
commit | 8ea422f415f30fc5e996f09815c0cd395151267a (patch) | |
tree | d4ebe34b757180772f44e48b1f01859d23dfb78f /engines/kyra | |
parent | 28a5a18a217aaa649b8f89f580b293f0fe34de63 (diff) | |
download | scummvm-rg350-8ea422f415f30fc5e996f09815c0cd395151267a.tar.gz scummvm-rg350-8ea422f415f30fc5e996f09815c0cd395151267a.tar.bz2 scummvm-rg350-8ea422f415f30fc5e996f09815c0cd395151267a.zip |
- Cleanup
- Implemented Screen_LoL::fprintString
svn-id: r35608
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/gui.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/lol.cpp | 38 | ||||
-rw-r--r-- | engines/kyra/screen_lol.cpp | 32 | ||||
-rw-r--r-- | engines/kyra/screen_lol.h | 1 |
4 files changed, 52 insertions, 25 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index f03f028b98..7ec667dfe3 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -448,9 +448,6 @@ int MainMenu::handle(int dim) { _screen->_charWidth = -2; _screen->setScreenDim(dim); - while (!_screen->isMouseVisible()) - _screen->showMouse(); - int backUpX = _screen->_curDim->sx; int backUpY = _screen->_curDim->sy; int backUpWidth = _screen->_curDim->w; @@ -469,7 +466,8 @@ int MainMenu::handle(int dim) { draw(selected); - _screen->showMouse(); + while (!_screen->isMouseVisible()) + _screen->showMouse(); int fh = _screen->getFontHeight(); int textPos = ((_screen->_curDim->w >> 1) + _screen->_curDim->sx) << 3; diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 1e4c78e5c8..f4fb444364 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -30,6 +30,7 @@ #include "kyra/util.h" #include "common/endian.h" +#include "base/version.h" namespace Kyra { @@ -103,9 +104,7 @@ Common::Error LoLEngine::init() { } Common::Error LoLEngine::go() { - bool hasSave = saveFileLoadable(0); - - if (!hasSave) { + if (!saveFileLoadable(0)) { setupPrologueData(true); showIntro(); setupPrologueData(false); @@ -117,10 +116,22 @@ Common::Error LoLEngine::go() { while (!shouldQuit() && processSelection == -1) { _screen->loadBitmap("TITLE.CPS", 2, 2, _screen->getPalette(0)); _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK); + + _screen->setFont(Screen::FID_6_FNT); + // Original version: (260|193) "V CD1.02 D" + _screen->fprintString("SVM %s", 255, 193, 0x67, 0x00, 0x04, gScummVMVersion); + _screen->setFont(Screen::FID_9_FNT); + _screen->fadePalette(_screen->getPalette(0), 0x1E); + _screen->updateScreen(); _eventList.clear(); int selection = mainMenu(); + _screen->hideMouse(); + + // Unlike the original, we add a nice fade to black + memset(_screen->getPalette(0), 0, 768); + _screen->fadePalette(_screen->getPalette(0), 0x54); switch (selection) { case 0: // New game @@ -128,13 +139,8 @@ Common::Error LoLEngine::go() { break; case 1: // Show intro - memset(_screen->getPalette(0), 0, 768); - _screen->fadePalette(_screen->getPalette(0), 0x54); - setupPrologueData(true); - _screen->hideMouse(); showIntro(); - _screen->showMouse(); setupPrologueData(true); break; @@ -149,6 +155,7 @@ Common::Error LoLEngine::go() { case 4: // Quit game default: quitGame(); + updateInput(); break; } } @@ -157,12 +164,6 @@ Common::Error LoLEngine::go() { return Common::kNoError; if (processSelection == 0) { - // Unlike the original, we add a nice fade to black - memset(_screen->getPalette(0), 0, 768); - _screen->fadePalette(_screen->getPalette(0), 0x54); - - _screen->clearPage(0); - setupPrologueData(true); _sound->loadSoundFile("LOREINTR"); _sound->playTrack(6); @@ -193,8 +194,8 @@ void LoLEngine::preInit() { _screen->setScreenPalette(pal); // TODO: We need to check if the SYSEX events of intro and ingame differ. - // If they really need to setup the proper ingame sysex when starting - // the game. But the place to do it would not be here in our code! + // If they differ, we really need to setup the proper ingame SYSEX when starting + // the game. But the proper place to do it would not be in this function. /*if (_sound->getMusicType() == Sound::kMidiMT32 || _sound->getSfxType() == Sound::kMidiMT32) { _sound->loadSoundFile("LOLSYSEX"); _sound->playTrack(0); @@ -212,13 +213,10 @@ void LoLEngine::preInit() { char filename[32]; snprintf(filename, sizeof(filename), "LANDS.%s", _languageExt[_lang]); + _res->exists(filename, true); _landsFile = _res->fileData(filename, 0); initializeCursors(); - - /*_screen->setFont(Screen::FID_6_FNT); - _screen->fprintString("V CD1.02 D", 260, 301, 0x67, 0x00, 0x04);*/ - _screen->setFont(Screen::FID_9_FNT); } void LoLEngine::initializeCursors() { diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index c6b47a9ca9..1698c54bbf 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -43,13 +43,43 @@ const ScreenDim *Screen_LoL::getScreenDim(int dim) { return &_screenDimTable[dim]; } +void Screen_LoL::fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint16 flags, ...) { + debugC(9, kDebugLevelScreen, "Screen_LoL::fprintString('%s', %d, %d, %d, %d, %d, ...)", format, x, y, col1, col2, flags); + if (!format) + return; + + char string[240]; + va_list vaList; + va_start(vaList, flags); + vsnprintf(string, sizeof(string), format, vaList); + va_end(vaList); + + if (flags & 1) + x -= getTextWidth(string) >> 1; + + if (flags & 2) + x -= getTextWidth(string); + + if (flags & 4) { + printText(string, x - 1, y, 1, col2); + printText(string, x, y + 1, 1, col2); + } + + if (flags & 8) { + printText(string, x - 1, y, 227, col2); + printText(string, x, y + 1, 227, col2); + } + + printText(string, x, y, col1, col2); +} + void Screen_LoL::fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint16 flags, ...) { debugC(9, kDebugLevelScreen, "Screen_LoL::fprintStringIntro('%s', %d, %d, %d, %d, %d, %d, ...)", format, x, y, c1, c2, c3, flags); char buffer[400]; va_list args; va_start(args, flags); - vsprintf(buffer, format, args); + vsnprintf(buffer, sizeof(buffer), format, args); va_end(args); if ((flags & 0x0F00) == 0x100) diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h index 38df3ca897..07c5b89604 100644 --- a/engines/kyra/screen_lol.h +++ b/engines/kyra/screen_lol.h @@ -39,6 +39,7 @@ public: void setScreenDim(int dim); const ScreenDim *getScreenDim(int dim); + void fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint16 flags, ...); void fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint16 flags, ...); private: LoLEngine *_vm; |