diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/parallaction.cpp | 68 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 9 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 67 |
3 files changed, 58 insertions, 86 deletions
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index b942cd81ad..6dbcbca50b 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -87,9 +87,6 @@ uint16 _introSarcData2 = 1; // private stuff -static Job *_jDrawInventory = NULL; -static Job *_jRunScripts = NULL; - Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _char(this) { @@ -275,28 +272,6 @@ void waitUntilLeftClick() { void Parallaction::runGame() { - addJob(kJobEraseAnimations, (void*)1, kPriority20); - _jRunScripts = addJob(kJobRunScripts, 0, kPriority15); - addJob(kJobDisplayAnimations, 0, kPriority3); - - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2); - - if (_location._commands.size() > 0) - runCommands(_location._commands); - - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - - if (_location._comment) - doLocationEnterTransition(); - - if (_hasLocationSound) - _soundMan->playSfx(_locationSound, 0, true); - - _vm->setArrowCursor(); - - if (_location._aCommands.size() > 0) - runCommands(_location._aCommands); - while ((_engineFlags & kEngineQuit) == 0) { _keyDown = updateInput(); @@ -862,50 +837,7 @@ void Parallaction::showLocationComment(const char *text, bool end) { return; } -void Parallaction::switchBackground(const char* background, const char* mask) { -// printf("switchBackground(%s)", name); - - Palette pal; - - uint16 v2 = 0; - if (!scumm_stricmp(background, "final")) { - _gfx->clearScreen(Gfx::kBitBack); - for (uint16 _si = 0; _si < 32; _si++) { - pal.setEntry(_si, v2, v2, v2); - v2 += 4; - } - - g_system->delayMillis(20); - _gfx->setPalette(pal); - _gfx->updateScreen(); - } - - setBackground(background, mask, mask); - - return; -} - -void Parallaction::showSlide(const char *name) { - - BackgroundInfo info; - - _disk->loadSlide(info, name); - - // TODO: avoid using screen buffers for displaying slides. Using a generic buffer - // allows for positioning of graphics as needed by Big Red Adventure. - // The main problem lies with menu, which relies on multiple buffers, mainly because - // it is crappy code. - _gfx->setBackground(&info.bg); - _gfx->setPalette(info.palette); - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - - info.bg.free(); - info.mask.free(); - info.path.free(); - - return; -} diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 7a1a272cb7..66a5a12372 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -427,7 +427,6 @@ public: void sortAnimations(); void freeAnimations(); - void showSlide(const char *name); void setBackground(const char *background, const char *mask, const char *path); void freeBackground(); @@ -528,6 +527,10 @@ protected: // data Job *_jEraseLabel; Zone *_hoverZone; + Job *_jDrawInventory; + Job *_jRunScripts; + + protected: // members bool detectGame(void); @@ -544,7 +547,6 @@ protected: // members virtual void changeCharacter(const char *name) = 0; void allocateLocationSlot(const char *name); void finalizeLocationParsing(); - void switchBackground(const char* background, const char* mask); void freeLocation(); void showLocationComment(const char *text, bool end); @@ -911,6 +913,9 @@ protected: uint16 guiChooseLanguage(); uint16 guiSelectGame(); int guiGetSelectedBlock(const Common::Point &p); + + void switchBackground(const char* background, const char* mask); + void showSlide(const char *name); }; diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 0075664a42..9a8419fffb 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -257,28 +257,60 @@ int Parallaction_ns::go() { guiStart(); - _engineFlags &= ~kEngineChangeLocation; + changeLocation(_location._name); - LocationName locname; - locname.bind(_location._name); + addJob(kJobEraseAnimations, (void*)1, kPriority20); + _jRunScripts = addJob(kJobRunScripts, 0, kPriority15); + addJob(kJobDisplayAnimations, 0, kPriority3); - changeCharacter(locname.character()); + runGame(); - strcpy(_location._name, locname.location()); - strcpy(_saveData1, _location._name); - parseLocation(_location._name); + return 0; +} - if (_location._startPosition.x != -1000) { - _char._ani._left = _location._startPosition.x; - _char._ani._top = _location._startPosition.y; - _char._ani._frame = _location._startFrame; - _location._startPosition.y = -1000; - _location._startPosition.x = -1000; - }; +void Parallaction_ns::switchBackground(const char* background, const char* mask) { +// printf("switchBackground(%s)", name); - runGame(); + Palette pal; - return 0; + uint16 v2 = 0; + if (!scumm_stricmp(background, "final")) { + _gfx->clearScreen(Gfx::kBitBack); + for (uint16 _si = 0; _si < 32; _si++) { + pal.setEntry(_si, v2, v2, v2); + v2 += 4; + } + + g_system->delayMillis(20); + _gfx->setPalette(pal); + _gfx->updateScreen(); + } + + setBackground(background, mask, mask); + + return; +} + + +void Parallaction_ns::showSlide(const char *name) { + + BackgroundInfo info; + + _disk->loadSlide(info, name); + + // TODO: avoid using screen buffers for displaying slides. Using a generic buffer + // allows for positioning of graphics as needed by Big Red Adventure. + // The main problem lies with menu, which relies on multiple buffers, mainly because + // it is crappy code. + _gfx->setBackground(&info.bg); + _gfx->setPalette(info.palette); + _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + + info.bg.free(); + info.mask.free(); + info.path.free(); + + return; } // changeLocation handles transitions between locations, and is able to display slides @@ -441,6 +473,9 @@ void Parallaction_ns::initJobs() { }; _jobsFn = jobs; + + _jDrawInventory = 0; + _jRunScripts = 0; } JobOpcode* Parallaction_ns::createJobOpcode(uint functionId, Job *job) { |