diff options
author | Johannes Schickel | 2009-05-18 19:53:57 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-05-18 19:53:57 +0000 |
commit | b1bdbef419ea9bec09c9a96309ba55cf456d505e (patch) | |
tree | 84f07a2cb208952c3b5acb924586897b0c49b2da /engines | |
parent | a652e1ae3d3a57a20c9daf487a5ee4c91e7966b2 (diff) | |
download | scummvm-rg350-b1bdbef419ea9bec09c9a96309ba55cf456d505e.tar.gz scummvm-rg350-b1bdbef419ea9bec09c9a96309ba55cf456d505e.tar.bz2 scummvm-rg350-b1bdbef419ea9bec09c9a96309ba55cf456d505e.zip |
Add some code differences for LoL intro demo.
svn-id: r40696
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/detection.cpp | 7 | ||||
-rw-r--r-- | engines/kyra/screen_v2.h | 2 | ||||
-rw-r--r-- | engines/kyra/script_lol.cpp | 5 | ||||
-rw-r--r-- | engines/kyra/script_tim.cpp | 59 | ||||
-rw-r--r-- | engines/kyra/script_tim.h | 2 | ||||
-rw-r--r-- | engines/kyra/sequences_lol.cpp | 14 | ||||
-rw-r--r-- | engines/kyra/wsamovie.h | 9 |
7 files changed, 68 insertions, 30 deletions
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 23ae91e8ca..9303941ccc 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -71,7 +71,7 @@ namespace { #define LOL_FLOPPY_FLAGS FLAGS(false, false, false, false, false, false, false, Kyra::GI_LOL) #define LOL_FLOPPY_CMP_FLAGS FLAGS(false, false, false, false, false, false, true, Kyra::GI_LOL) #define LOL_PC98_SJIS_FLAGS FLAGS(false, false, false, true, true, false, false, Kyra::GI_LOL) -#define LOL_DEMO_FLAGS FLAGS(true, false, false, false, false, false, false, Kyra::GI_LOL) +#define LOL_DEMO_FLAGS FLAGS(true, true, false, false, false, false, false, Kyra::GI_LOL) #define LOL_KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, false, false, false, Kyra::GI_KYRA2) const KYRAGameDescription adGameDescs[] = { @@ -1036,9 +1036,8 @@ const KYRAGameDescription adGameDescs[] = { LOL_PC98_SJIS_FLAGS }, - // TODO: It looks like this demo version does not use WSA v2 files, that means - // it is probably being quite old... Since our TIM player relies on WSA v2 features, - // we disable the detection entry for now. + // TODO: It looks like this demo version does use something between + // WSA v1 and WSA v2 files, that means it is probably being quite old... /*{ { "lol", diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_v2.h index 22bab346db..18bac764ec 100644 --- a/engines/kyra/screen_v2.h +++ b/engines/kyra/screen_v2.h @@ -71,7 +71,7 @@ public: virtual int getLayer(int x, int y); // special WSA handling - void wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim); + void wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim); protected: uint8 *_wsaFrameAnimBuffer; }; diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index ce752e6254..8bb2c16dcd 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -2022,8 +2022,9 @@ int LoLEngine::tlol_processWsaFrame(const TIM *tim, const uint16 *param) { int h2 = (h1 * factor) / 100; anim->wsa->displayFrame(frame, 2, x1, y1, anim->wsaCopyParams & 0xF0FF, 0, 0); - _screen->wsaFrameAnimationStep(x1, y1, x2, y2, w1, h1, w2, h2, 2, 8, 0); - _screen->checkedPageUpdate(8, 4); + _screen->wsaFrameAnimationStep(x1, y1, x2, y2, w1, h1, w2, h2, 2, _flags.isDemo ? 0 : 8, 0); + if (!_flags.isDemo) + _screen->checkedPageUpdate(8, 4); _screen->updateScreen(); return 1; diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 71a183d7a8..b13639960c 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -53,7 +53,7 @@ TIMInterpreter::TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSys COMMAND(cmd_initFunc), COMMAND(cmd_stopFunc), COMMAND(cmd_wsaDisplayFrame), - COMMAND_UNIMPL(), + COMMAND(cmd_displayText), // 0x08 COMMAND(cmd_loadVocFile), COMMAND(cmd_unloadVocFile), @@ -98,7 +98,7 @@ TIMInterpreter::TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSys _textDisplayed = false; _textAreaBuffer = new uint8[320*40]; assert(_textAreaBuffer); - _drawPage2 = 8; + _drawPage2 = (vm()->gameFlags().isDemo && vm()->gameFlags().gameID == GI_LOL) ? 0 : 8; _palDelayInc = _palDiff = _palDelayAcc = 0; _abortFlag = 0; @@ -401,7 +401,9 @@ TIMInterpreter::Animation *TIMInterpreter::initAnimStruct(int index, const char anim->x = x; anim->y = y; anim->wsaCopyParams = wsaFlags; - _drawPage2 = 8; + const bool isLoLDemo = vm()->gameFlags().isDemo && vm()->gameFlags().gameID == GI_LOL; + + _drawPage2 = isLoLDemo ? 0 : 8; uint16 wsaOpenFlags = ((wsaFlags & 0x10) != 0) ? 2 : 0; @@ -409,22 +411,42 @@ TIMInterpreter::Animation *TIMInterpreter::initAnimStruct(int index, const char snprintf(file, 32, "%s.WSA", filename); if (vm()->resource()->exists(file)) { - anim->wsa = new WSAMovie_v2(_vm, _screen); + if (isLoLDemo) + anim->wsa = new WSAMovie_v1(_vm); + else + anim->wsa = new WSAMovie_v2(_vm, _screen); assert(anim->wsa); anim->wsa->open(file, wsaOpenFlags, (index == 1) ? screen()->getPalette(0) : 0); } if (anim->wsa && anim->wsa->opened()) { - if (x == -1) - anim->x = x = 0; - if (y == -1) - anim->y = y = 0; + if (isLoLDemo) { + if (x == -1) { + int16 t = int8(320 - anim->wsa->width()); + uint8 v = int8(t & 0x00FF) - int8((t & 0xFF00) >> 8); + v >>= 1; + anim->x = x = v; + } + + if (y == -1) { + int16 t = int8(200 - anim->wsa->height()); + uint8 v = int8(t & 0x00FF) - int8((t & 0xFF00) >> 8); + v >>= 1; + anim->y = y = v; + } + } else { + if (x == -1) + anim->x = x = 0; + if (y == -1) + anim->y = y = 0; + } if (wsaFlags & 2) { screen()->fadePalette(screen()->getPalette(1), 15, 0); - screen()->clearPage(8); - screen()->checkedPageUpdate(8, 4); + screen()->clearPage(_drawPage2); + if (_drawPage2) + screen()->checkedPageUpdate(8, 4); screen()->updateScreen(); } @@ -433,12 +455,13 @@ TIMInterpreter::Animation *TIMInterpreter::initAnimStruct(int index, const char if (vm()->resource()->exists(file)) { screen()->loadBitmap(file, 3, 3, screen()->getPalette(0)); - screen()->copyRegion(0, 0, 0, 0, 320, 200, 2, 8, Screen::CR_NO_P_CHECK); - screen()->checkedPageUpdate(8, 4); + screen()->copyRegion(0, 0, 0, 0, 320, 200, 2, _drawPage2, Screen::CR_NO_P_CHECK); + if (_drawPage2) + screen()->checkedPageUpdate(8, 4); screen()->updateScreen(); } - anim->wsa->displayFrame(0, 0, 0, 0, 0); + anim->wsa->displayFrame(0, x, y, 0, 0); } if (wsaFlags & 2) @@ -446,8 +469,9 @@ TIMInterpreter::Animation *TIMInterpreter::initAnimStruct(int index, const char } else { if (wsaFlags & 2) { screen()->fadePalette(screen()->getPalette(1), 15, 0); - screen()->clearPage(8); - screen()->checkedPageUpdate(8, 4); + screen()->clearPage(_drawPage2); + if (_drawPage2) + screen()->checkedPageUpdate(8, 4); screen()->updateScreen(); } @@ -455,8 +479,9 @@ TIMInterpreter::Animation *TIMInterpreter::initAnimStruct(int index, const char if (vm()->resource()->exists(file)) { screen()->loadBitmap(file, 3, 3, screen()->getPalette(0)); - screen()->copyRegion(0, 0, 0, 0, 320, 200, 2, 8, Screen::CR_NO_P_CHECK); - screen()->checkedPageUpdate(8, 4); + screen()->copyRegion(0, 0, 0, 0, 320, 200, 2, _drawPage2, Screen::CR_NO_P_CHECK); + if (_drawPage2) + screen()->checkedPageUpdate(8, 4); screen()->updateScreen(); } diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index 6e9d5fc6b8..e2275908c2 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -96,7 +96,7 @@ public: }; struct Animation { - WSAMovie_v2 *wsa; + Movie *wsa; int16 x, y; uint32 nextFrame; uint8 enable; diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index 463bb45bba..19cd7d215f 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -43,8 +43,17 @@ int LoLEngine::processPrologue() { if (!saveFileLoadable(0) || _flags.isDemo) showIntro(); - if (_flags.isDemo) + if (_flags.isDemo) { + _screen->fadePalette(_screen->getPalette(1), 30, 0); + _screen->loadBitmap("FINAL.CPS", 2, 2, _screen->getPalette(0)); + _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK); + _screen->fadePalette(_screen->getPalette(0), 30, 0); + delayWithTicks(300); + _screen->fadePalette(_screen->getPalette(1), 60, 0); + + setupPrologueData(false); return -1; + } preInit(); @@ -219,7 +228,8 @@ void LoLEngine::showIntro() { while (!_tim->finished() && !shouldQuit() && !skipFlag()) { updateInput(); _tim->exec(intro, false); - _screen->checkedPageUpdate(8, 4); + if (!_flags.isDemo) + _screen->checkedPageUpdate(8, 4); if (_tim->_palDiff) { if (palNextFadeStep < _system->getMillis()) { diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h index a1e0562f60..bc5d723bbd 100644 --- a/engines/kyra/wsamovie.h +++ b/engines/kyra/wsamovie.h @@ -42,6 +42,9 @@ public: virtual bool opened() { return _opened; } + virtual int width() const = 0; + virtual int height() const = 0; + virtual int open(const char *filename, int offscreen, uint8 *palette) = 0; virtual void close() = 0; @@ -62,6 +65,9 @@ public: WSAMovie_v1(KyraEngine_v1 *vm); virtual ~WSAMovie_v1(); + int width() const { return _width; } + int height() const { return _height; } + virtual int open(const char *filename, int offscreen, uint8 *palette); virtual void close(); @@ -115,9 +121,6 @@ public: int xAdd() const { return _xAdd; } int yAdd() const { return _yAdd; } - int width() const { return _width; } - int height() const { return _height; } - void setWidth(int w) { _width = w; } void setHeight(int h) { _height = h; } protected: |