From b58f6f397da29454e359384f6908b403f48d990e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 13 Oct 2014 20:28:34 -0400 Subject: MADS: New conversation message logic for cutscene animations --- engines/mads/animation.cpp | 53 +++++++++++++++++++++++---------- engines/mads/animation.h | 6 +++- engines/mads/nebular/menu_nebular.cpp | 4 +-- engines/mads/palette.cpp | 56 +++++++++++++++++++++++++++++++++++ engines/mads/palette.h | 2 ++ 5 files changed, 102 insertions(+), 19 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index 0807d8e409..bc3708b5f5 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -159,6 +159,7 @@ Animation *Animation::init(MADSEngine *vm, Scene *scene) { } Animation::Animation(MADSEngine *vm, Scene *scene) : _vm(vm), _scene(scene) { + _flags = 0; _font = nullptr; _resetFlag = false; _messageCtr = 0; @@ -174,6 +175,8 @@ Animation::Animation(MADSEngine *vm, Scene *scene) : _vm(vm), _scene(scene) { _actionDetails._indirectObjectId = -1; _currentFrame = 0; _oldFrameEntry = 0; + _rgbResult = -1; + _palIndex1 = _palIndex2 = -1; } Animation::~Animation() { @@ -204,6 +207,7 @@ void Animation::load(MSurface &backSurface, DepthSurface &depthSurface, if (_header._bgType == ANIMBG_INTERFACE) flags |= PALFLAG_RESERVED; + _flags = flags; if (flags & ANIMFLAG_LOAD_BACKGROUND) { loadBackground(backSurface, depthSurface, _header, flags, palCycles, sceneInfo); @@ -414,6 +418,7 @@ bool Animation::hasScroll() const { void Animation::update() { Scene &scene = _vm->_game->_scene; + Palette &palette = *_vm->_palette; if (_header._manualFlag) { int spriteListIndex = _spriteListIndexes[_header._spritesIndex]; @@ -532,26 +537,42 @@ void Animation::update() { } else if ((_currentFrame >= _messages[idx]._startFrame) && (_currentFrame <= _messages[idx]._endFrame)) { // Start displaying the message AnimMessage &me = _messages[idx]; + uint8 colIndex1, colIndex2; + + if (_flags & ANIMFLAG_ANIMVIEW) { + _rgbResult = palette._paletteUsage.checkRGB(me._rgb1, -1, true, &_palIndex1); + _rgbResult = palette._paletteUsage.checkRGB(me._rgb2, _rgbResult, true, &_palIndex2); + + // Update the palette with the two needed colors + int palCount = _palIndex2 - _palIndex1; + if (palCount < 0) + palCount = _palIndex1 - _palIndex2 + 1; + palette.setPalette(palette._mainPalette, MIN(_palIndex1, _palIndex2), palCount); + + colIndex1 = _palIndex1; + colIndex2 = _palIndex2; + } else { + // The color index to use is dependant on how many messages are currently on-screen + switch (_messageCtr) { + case 1: + colIndex1 = 252; + break; + case 2: + colIndex1 = 16; + break; + default: + colIndex1 = 250; + break; + } + colIndex2 = colIndex1 + 1; - // The color index to use is dependant on how many messages are currently on-screen - uint8 colIndex; - switch (_messageCtr) { - case 1: - colIndex = 252; - break; - case 2: - colIndex = 16; - break; - default: - colIndex = 250; - break; + _vm->_palette->setEntry(colIndex1, me._rgb1[0], me._rgb1[1], me._rgb1[2]); + _vm->_palette->setEntry(colIndex2, me._rgb2[0], me._rgb2[1], me._rgb2[2]); } - _vm->_palette->setEntry(colIndex, me._rgb1[0], me._rgb1[1], me._rgb1[2]); - _vm->_palette->setEntry(colIndex + 1, me._rgb2[0], me._rgb2[1], me._rgb2[2]); - // Add a kernel message to display the given text - me._kernelMsgIndex = scene._kernelMessages.add(me._pos, colIndex * 0x101 + 0x100, + me._kernelMsgIndex = scene._kernelMessages.add(me._pos, + colIndex1 | (colIndex2 << 8), 0, 0, INDEFINITE_TIMEOUT, me._msg); assert(me._kernelMsgIndex >= 0); ++_messageCtr; diff --git a/engines/mads/animation.h b/engines/mads/animation.h index 917d899ec5..b7e98e72e4 100644 --- a/engines/mads/animation.h +++ b/engines/mads/animation.h @@ -37,7 +37,8 @@ enum AnimFlag { ANIMFLAG_DITHER = 0x1000, // Dither to 16 colors ANIMFLAG_CUSTOM_FONT = 0x2000, // Load ccustom font ANIMFLAG_LOAD_BACKGROUND = 0x0100, // Load background - ANIMFLAG_LOAD_BACKGROUND_ONLY = 0x0200 // Load background only + ANIMFLAG_LOAD_BACKGROUND_ONLY = 0x0200, // Load background only + ANIMFLAG_ANIMVIEW = 0x8000 // Cutscene animation }; enum AnimBgType { @@ -155,6 +156,9 @@ private: uint32 _nextScrollTimer; int _messageCtr; int _trigger; + int _flags; + int _rgbResult; + int _palIndex1, _palIndex2; TriggerMode _triggerMode; ActionDetails _actionDetails; diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 3919e70a09..0d7b11cf4b 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -890,9 +890,9 @@ void AnimationView::loadNextResource() { // Load the new animation delete _currentAnimation; _currentAnimation = Animation::init(_vm, &scene); + int flags = ANIMFLAG_ANIMVIEW | (resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0); _currentAnimation->load(scene._backgroundSurface, scene._depthSurface, - resEntry._resourceName, resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0, - &paletteCycles, _sceneInfo); + resEntry._resourceName, flags, &paletteCycles, _sceneInfo); // Signal for a screen refresh scene._spriteSlots.fullRefresh(); diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index c098e23bf9..1787b3c298 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -317,6 +317,62 @@ int PaletteUsage::rgbFactor(byte *palEntry, RGB6 &pal6) { return total; } +int PaletteUsage::checkRGB(const byte *rgb, int palStart, bool flag, int *palIndex) { + Palette &palette = *_vm->_palette; + bool match = false; + int result; + if (palStart >= 0) { + result = palStart; + } else { + result = -1; + for (int i = 0; i < palette._highRange; ++i) { + if (!palette._rgbList[i]) { + result = i; + break; + } + } + } + + if (result >= 0) { + int mask = 1 << result; + byte *palP = &palette._mainPalette[0]; + uint32 *flagsP = &palette._palFlags[0]; + + for (; flagsP < &palette._palFlags[PALETTE_COUNT]; ++flagsP, ++result) { + if ((!(*flagsP & 1) || flag) && !(*flagsP & 2)) { + if (!memcmp(palP, rgb, 3)) { + *flagsP |= mask; + + if (palIndex) + *palIndex = result; + match = true; + break; + } + } + } + + if (!match) { + palP = &palette._mainPalette[0]; + flagsP = &palette._palFlags[0]; + + for (int i = 0; i < PALETTE_COUNT; ++i, palP += 3, ++flagsP) { + if (!*flagsP) { + Common::copy(rgb, rgb + 3, palP); + *flagsP |= mask; + + if (palIndex) + *palIndex = i; + match = true; + break; + } + } + } + } + + assert(match); + return result; +} + /*------------------------------------------------------------------------*/ void RGBList::clear() { diff --git a/engines/mads/palette.h b/engines/mads/palette.h index 9b8b7146db..27d25f266b 100644 --- a/engines/mads/palette.h +++ b/engines/mads/palette.h @@ -136,6 +136,8 @@ public: void updateUsage(Common::Array &usageList, int sceneUsageIndex); void resetPalFlags(int idx); + + int checkRGB(const byte *rgb, int palStart, bool flag, int *palIndex); }; class RGBList { -- cgit v1.2.3 From b5fb32de5ea2a4f3dd4133c423d666d00f37744f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 14 Oct 2014 21:26:00 -0400 Subject: MADS: Fix to exit game safely when sound driver hasn't been created --- engines/mads/sound.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp index 9d0d9c8d20..d0aa770a4d 100644 --- a/engines/mads/sound.cpp +++ b/engines/mads/sound.cpp @@ -42,9 +42,11 @@ SoundManager::SoundManager(MADSEngine *vm, Audio::Mixer *mixer) { } SoundManager::~SoundManager() { - _driver->stop(); + if (_driver) { + _driver->stop(); + delete _driver; + } - delete _driver; delete _opl; } -- cgit v1.2.3 From ea9599b763e0e8aef55282d621828ebfc7b1a9f6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 14 Oct 2014 21:37:00 -0400 Subject: MADS: Implement subtitles for animation cutscenes --- engines/mads/animation.cpp | 27 +++++++++++---------------- engines/mads/animation.h | 2 +- engines/mads/nebular/menu_nebular.cpp | 2 ++ 3 files changed, 14 insertions(+), 17 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index bc3708b5f5..9f0e0adb6d 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -537,49 +537,44 @@ void Animation::update() { } else if ((_currentFrame >= _messages[idx]._startFrame) && (_currentFrame <= _messages[idx]._endFrame)) { // Start displaying the message AnimMessage &me = _messages[idx]; - uint8 colIndex1, colIndex2; if (_flags & ANIMFLAG_ANIMVIEW) { _rgbResult = palette._paletteUsage.checkRGB(me._rgb1, -1, true, &_palIndex1); _rgbResult = palette._paletteUsage.checkRGB(me._rgb2, _rgbResult, true, &_palIndex2); // Update the palette with the two needed colors - int palCount = _palIndex2 - _palIndex1; - if (palCount < 0) - palCount = _palIndex1 - _palIndex2 + 1; - palette.setPalette(palette._mainPalette, MIN(_palIndex1, _palIndex2), palCount); - - colIndex1 = _palIndex1; - colIndex2 = _palIndex2; + int palStart = MIN(_palIndex1, _palIndex2); + int palCount = ABS(_palIndex2 - _palIndex1) + 1; + palette.setPalette(&palette._mainPalette[palStart * 3], palStart, palCount); } else { // The color index to use is dependant on how many messages are currently on-screen switch (_messageCtr) { case 1: - colIndex1 = 252; + _palIndex1 = 252; break; case 2: - colIndex1 = 16; + _palIndex1 = 16; break; default: - colIndex1 = 250; + _palIndex1 = 250; break; } - colIndex2 = colIndex1 + 1; + _palIndex2 = _palIndex1 + 1; - _vm->_palette->setEntry(colIndex1, me._rgb1[0], me._rgb1[1], me._rgb1[2]); - _vm->_palette->setEntry(colIndex2, me._rgb2[0], me._rgb2[1], me._rgb2[2]); + _vm->_palette->setEntry(_palIndex1, me._rgb1[0], me._rgb1[1], me._rgb1[2]); + _vm->_palette->setEntry(_palIndex2, me._rgb2[0], me._rgb2[1], me._rgb2[2]); } // Add a kernel message to display the given text me._kernelMsgIndex = scene._kernelMessages.add(me._pos, - colIndex1 | (colIndex2 << 8), + _palIndex1 | (_palIndex2 << 8), 0, 0, INDEFINITE_TIMEOUT, me._msg); assert(me._kernelMsgIndex >= 0); ++_messageCtr; // If there's an accompanying sound, also play it if (me._soundId > 0) - _vm->_audio->playSound(me._soundId); + _vm->_audio->playSound(me._soundId - 1); } } diff --git a/engines/mads/animation.h b/engines/mads/animation.h index b7e98e72e4..8b85a5370d 100644 --- a/engines/mads/animation.h +++ b/engines/mads/animation.h @@ -38,7 +38,7 @@ enum AnimFlag { ANIMFLAG_CUSTOM_FONT = 0x2000, // Load ccustom font ANIMFLAG_LOAD_BACKGROUND = 0x0100, // Load background ANIMFLAG_LOAD_BACKGROUND_ONLY = 0x0200, // Load background only - ANIMFLAG_ANIMVIEW = 0x8000 // Cutscene animation + ANIMFLAG_ANIMVIEW = 0x4000 // Cutscene animation }; enum AnimBgType { diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 0d7b11cf4b..64c91d5f1b 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -55,6 +55,8 @@ void MenuView::show() { while (!_breakFlag && !_vm->shouldQuit()) { if (_redrawFlag) { + scene._kernelMessages.update(); + _vm->_game->_scene.drawElements(_vm->_game->_fx, _vm->_game->_fx); _redrawFlag = false; } -- cgit v1.2.3 From 2048fe68d233cfff8523b1b2ee818088cb0fc939 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 14 Oct 2014 21:49:14 -0400 Subject: MADS: Fix clearing on-screen messages when the cutscene animation changes --- engines/mads/nebular/menu_nebular.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 64c91d5f1b..6d014191e9 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -889,6 +889,9 @@ void AnimationView::loadNextResource() { if (resEntry._bgFlag) palette.resetGamePalette(1, 8); + // Free any previous messages + scene._kernelMessages.reset(); + // Load the new animation delete _currentAnimation; _currentAnimation = Animation::init(_vm, &scene); -- cgit v1.2.3 From 1658a34ef5e6e6d48e45c4f38d7d507eb0f4d5ff Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 14 Oct 2014 22:29:29 -0400 Subject: MADS: Correct the color for the top/bottom line bounding the cutscene --- engines/mads/nebular/menu_nebular.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 6d014191e9..a9ed6d3495 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -889,9 +889,24 @@ void AnimationView::loadNextResource() { if (resEntry._bgFlag) palette.resetGamePalette(1, 8); + palette._mainPalette[253 * 3] = palette._mainPalette[253 * 3 + 1] + = palette._mainPalette[253 * 3 + 2] = 0xb4; + palette.setPalette(&palette._mainPalette[253 * 3], 253, 1); + // Free any previous messages scene._kernelMessages.reset(); + // Handle the bars at the top/bottom + if (resEntry._showWhiteBars) { + // For animations the screen has been clipped to the middle 156 rows. + // So although it's slightly messy, bypass our screen class entirely, + // and draw the horizontal lines directly on the physiacl screen surface + Graphics::Surface *s = g_system->lockScreen(); + s->hLine(0, 20, MADS_SCREEN_WIDTH, 253); + s->hLine(0, 179, MADS_SCREEN_WIDTH, 253); + g_system->unlockScreen(); + } + // Load the new animation delete _currentAnimation; _currentAnimation = Animation::init(_vm, &scene); -- cgit v1.2.3 From 331488cae0909084a1e8800706cf102741e3043b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 15 Oct 2014 10:35:49 +0300 Subject: MADS: Bugfix for the text view debugger command --- engines/mads/debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp index ee967cb17e..3b77d5332b 100644 --- a/engines/mads/debugger.cpp +++ b/engines/mads/debugger.cpp @@ -381,7 +381,7 @@ bool Debugger::Cmd_PlayText(int argc, const char **argv) { resName.deleteChar(0); Common::File f; - if (f.exists(resName) || f.exists(resName + ".res")) { + if (f.exists(resName) || f.exists(resName + ".txr")) { Nebular::TextView::execute(_vm, resName); return false; } else { -- cgit v1.2.3 From 701d43b5c208a605465c59e9caf8767df18c3e04 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 14 Oct 2014 01:59:53 +0300 Subject: MADS: Initial implementation of sound driver handling for V2 games --- engines/mads/nebular/menu_nebular.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index a9ed6d3495..6a13cea195 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -922,7 +922,11 @@ void AnimationView::loadNextResource() { const char *chP = strchr(_currentAnimation->_header._soundName.c_str(), '.'); assert(chP); - int driverNum = atoi(chP + 1); + // Handle both Rex naming (xxx.009) and naming in later games (e.g. xxx.ph9) + int driverNum = atoi(chP + 3); + // HACK for Dragon + if (_currentAnimation->_header._soundName == "#SOUND.DRG") + driverNum = 9; _vm->_sound->init(driverNum); } -- cgit v1.2.3 From 33b770ac60354b3a8bea89bc5babe3f5c0ebf4dc Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 15 Oct 2014 11:33:14 +0300 Subject: MADS: Move all the anim and text view code into a common class The animation and text players are more or less common among all MADS games --- engines/mads/debugger.cpp | 4 +- engines/mads/dialogs.cpp | 73 +++ engines/mads/dialogs.h | 32 ++ engines/mads/menu_views.cpp | 782 +++++++++++++++++++++++++++++++ engines/mads/menu_views.h | 226 +++++++++ engines/mads/module.mk | 1 + engines/mads/nebular/dialogs_nebular.cpp | 61 --- engines/mads/nebular/dialogs_nebular.h | 32 -- engines/mads/nebular/menu_nebular.cpp | 753 +---------------------------- engines/mads/nebular/menu_nebular.h | 190 +------- 10 files changed, 1118 insertions(+), 1036 deletions(-) create mode 100644 engines/mads/menu_views.cpp create mode 100644 engines/mads/menu_views.h (limited to 'engines/mads') diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp index 3b77d5332b..99251f9fbb 100644 --- a/engines/mads/debugger.cpp +++ b/engines/mads/debugger.cpp @@ -362,7 +362,7 @@ bool Debugger::Cmd_PlayAnim(int argc, const char **argv) { Common::File f; if (f.exists(resName) || f.exists(resName + ".res")) { - Nebular::AnimationView::execute(_vm, resName); + AnimationView::execute(_vm, resName); return false; } else { debugPrintf("Could not find resource file\n"); @@ -382,7 +382,7 @@ bool Debugger::Cmd_PlayText(int argc, const char **argv) { Common::File f; if (f.exists(resName) || f.exists(resName + ".txr")) { - Nebular::TextView::execute(_vm, resName); + TextView::execute(_vm, resName); return false; } else { debugPrintf("Could not find resource file\n"); diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp index 7e6909d113..5ea8fb115c 100644 --- a/engines/mads/dialogs.cpp +++ b/engines/mads/dialogs.cpp @@ -395,4 +395,77 @@ Dialogs::Dialogs(MADSEngine *vm) _pendingDialog = DIALOG_NONE; } +/*------------------------------------------------------------------------*/ + +FullScreenDialog::FullScreenDialog(MADSEngine *vm) : _vm(vm) { + switch (_vm->getGameID()) { + case GType_RexNebular: + _screenId = 990; + break; + case GType_Phantom: + _screenId = 920; + break; + case GType_Dragonsphere: + _screenId = 922; + break; + default: + error("FullScreenDialog:Unknown game"); + } + _palFlag = true; +} + +FullScreenDialog::~FullScreenDialog() { + _vm->_screen.resetClipBounds(); + _vm->_game->_scene.restrictScene(); +} + +void FullScreenDialog::display() { + Game &game = *_vm->_game; + Scene &scene = game._scene; + + int nextSceneId = scene._nextSceneId; + int currentSceneId = scene._currentSceneId; + int priorSceneId = scene._priorSceneId; + + if (_screenId > 0) { + SceneInfo *sceneInfo = SceneInfo::init(_vm); + sceneInfo->load(_screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface); + } + + scene._priorSceneId = priorSceneId; + scene._currentSceneId = currentSceneId; + scene._nextSceneId = nextSceneId; + + _vm->_events->initVars(); + game._kernelMode = KERNEL_ROOM_INIT; + + byte pal[768]; + if (_vm->_screenFade) { + Common::fill(&pal[0], &pal[PALETTE_SIZE], 0); + _vm->_palette->setFullPalette(pal); + } else { + _vm->_palette->getFullPalette(pal); + _vm->_palette->fadeOut(pal, nullptr, 0, PALETTE_COUNT, 0, 1, 1, 16); + } + + // Set Fx state and palette entries + game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kCenterVertTransition; + game._trigger = 0; + + // Clear the screen and draw the upper and lower horizontal lines + _vm->_screen.empty(); + _vm->_palette->setLowRange(); + _vm->_screen.hLine(0, 20, MADS_SCREEN_WIDTH, 2); + _vm->_screen.hLine(0, 179, MADS_SCREEN_WIDTH, 2); + _vm->_screen.copyRectToScreen(Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT)); + + // Restrict the screen to the area between the two lines + _vm->_screen.setClipBounds(Common::Rect(0, DIALOG_TOP, MADS_SCREEN_WIDTH, + DIALOG_TOP + MADS_SCENE_HEIGHT)); + _vm->_game->_scene.restrictScene(); + + if (_screenId > 0) + scene._spriteSlots.fullRefresh(); +} + } // End of namespace MADS diff --git a/engines/mads/dialogs.h b/engines/mads/dialogs.h index c586a6f1fe..317c7bd792 100644 --- a/engines/mads/dialogs.h +++ b/engines/mads/dialogs.h @@ -30,6 +30,8 @@ namespace MADS { +#define DIALOG_TOP 22 + class Dialog { private: void setDialogPalette(); @@ -226,6 +228,36 @@ public: virtual bool show(int messageId, int objectId = -1) = 0; }; +class FullScreenDialog: public EventTarget { +protected: + /** + * Engine reference + */ + MADSEngine *_vm; + + /** + * Screen/scene to show background from + */ + int _screenId; + + /** + * Flag for palette initialization + */ + bool _palFlag; + + /** + * Handles displaying the screen background and dialog + */ + virtual void display(); +public: + /** + * Constructor + */ + FullScreenDialog(MADSEngine *vm); + + virtual ~FullScreenDialog(); +}; + } // End of namespace MADS #endif /* MADS_DIALOGS_H */ diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp new file mode 100644 index 0000000000..6acf6cdf9f --- /dev/null +++ b/engines/mads/menu_views.cpp @@ -0,0 +1,782 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "common/scummsys.h" +#include "mads/game.h" +#include "mads/mads.h" +#include "mads/menu_views.h" +#include "mads/resources.h" +#include "mads/scene.h" +#include "mads/screen.h" + +namespace MADS { + +MenuView::MenuView(MADSEngine *vm) : FullScreenDialog(vm) { + _breakFlag = false; + _redrawFlag = true; + _palFlag = false; +} + +void MenuView::show() { + Scene &scene = _vm->_game->_scene; + EventsManager &events = *_vm->_events; + _vm->_screenFade = SCREEN_FADE_FAST; + + scene._spriteSlots.reset(true); + display(); + + events.setEventTarget(this); + events.hideCursor(); + + while (!_breakFlag && !_vm->shouldQuit()) { + if (_redrawFlag) { + scene._kernelMessages.update(); + + _vm->_game->_scene.drawElements(_vm->_game->_fx, _vm->_game->_fx); + _redrawFlag = false; + } + + _vm->_events->waitForNextFrame(); + _vm->_game->_fx = kTransitionNone; + doFrame(); + } + + events.setEventTarget(nullptr); + _vm->_sound->stop(); +} + +void MenuView::display() { + _vm->_palette->resetGamePalette(4, 8); + + FullScreenDialog::display(); +} + +bool MenuView::onEvent(Common::Event &event) { + if (event.type == Common::EVENT_KEYDOWN || event.type == Common::EVENT_LBUTTONDOWN) { + _breakFlag = true; + _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; + return true; + } + + return false; +} + +/*------------------------------------------------------------------------*/ + +char TextView::_resourceName[100]; +#define TEXTVIEW_LINE_SPACING 2 +#define TEXT_ANIMATION_DELAY 100 +#define TV_NUM_FADE_STEPS 40 +#define TV_FADE_DELAY_MILLI 50 + +void TextView::execute(MADSEngine *vm, const Common::String &resName) { + assert(resName.size() < 100); + Common::strlcpy(_resourceName, resName.c_str(), sizeof(_resourceName)); + vm->_dialogs->_pendingDialog = DIALOG_TEXTVIEW; +} + +TextView::TextView(MADSEngine *vm) : MenuView(vm) { + _animating = false; + _panSpeed = 0; + _spareScreen = nullptr; + _scrollCount = 0; + _lineY = -1; + _scrollTimeout = 0; + _panCountdown = 0; + _translationX = 0; + _screenId = -1; + + _font = _vm->_font->getFont(FONT_CONVERSATION); + _vm->_palette->resetGamePalette(4, 0); + + load(); +} + +TextView::~TextView() { +} + +void TextView::load() { + Common::String scriptName(_resourceName); + scriptName += ".txr"; + + if (!_script.open(scriptName)) + error("Could not open resource %s", _resourceName); + + processLines(); +} + +void TextView::processLines() { + if (_script.eos()) + error("Attempted to read past end of response file"); + + while (!_script.eos()) { + // Read in the next line + _script.readLine(_currentLine, 79); + char *p = _currentLine + strlen(_currentLine) - 1; + if (*p == '\n') + *p = '\0'; + + // Commented out line, so go loop for another + if (_currentLine[0] == '#') + continue; + + // Process the line + char *cStart = strchr(_currentLine, '['); + if (cStart) { + while (cStart) { + // Loop for possible multiple commands on one line + char *cEnd = strchr(_currentLine, ']'); + if (!cEnd) + error("Unterminated command '%s' in response file", _currentLine); + + *cEnd = '\0'; + processCommand(); + + // Copy rest of line (if any) to start of buffer + Common::strlcpy(_currentLine, cEnd + 1, sizeof(_currentLine)); + + cStart = strchr(_currentLine, '['); + } + + if (_currentLine[0]) { + processText(); + break; + } + + } else { + processText(); + break; + } + } +} + +void TextView::processCommand() { + Scene &scene = _vm->_game->_scene; + Common::String scriptLine(_currentLine + 1); + scriptLine.toUppercase(); + const char *paramP; + const char *commandStr = scriptLine.c_str(); + + if (!strncmp(commandStr, "BACKGROUND", 10)) { + // Set the background + paramP = commandStr + 10; + resetPalette(); + int screenId = getParameter(¶mP); + + SceneInfo *sceneInfo = SceneInfo::init(_vm); + sceneInfo->load(screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface); + scene._spriteSlots.fullRefresh(); + _redrawFlag = true; + + } else if (!strncmp(commandStr, "GO", 2)) { + _animating = true; + + } else if (!strncmp(commandStr, "PAN", 3)) { + // Set panning values + paramP = commandStr + 3; + int panX = getParameter(¶mP); + int panY = getParameter(¶mP); + int panSpeed = getParameter(¶mP); + + if ((panX != 0) || (panY != 0)) { + _pan = Common::Point(panX, panY); + _panSpeed = panSpeed; + } + + } else if (!strncmp(commandStr, "DRIVER", 6)) { + // Set the driver to use + paramP = commandStr + 7; + + if (!strncmp(paramP, "#SOUND.00", 9)) { + int driverNum = paramP[9] - '0'; + _vm->_sound->init(driverNum); + } + } else if (!strncmp(commandStr, "SOUND", 5)) { + // Set sound number + paramP = commandStr + 5; + int soundId = getParameter(¶mP); + _vm->_sound->command(soundId); + + } else if (!strncmp(commandStr, "COLOR", 5) && ((commandStr[5] == '0') || + (commandStr[5] == '1'))) { + // Set the text colors + int index = commandStr[5] - '0'; + paramP = commandStr + 6; + + byte r = getParameter(¶mP); + byte g = getParameter(¶mP); + byte b = getParameter(¶mP); + + _vm->_palette->setEntry(5 + index, r, g, b); + + } else if (!strncmp(commandStr, "SPARE", 5)) { + // Sets a secondary background number that can be later switched in with a PAGE command + paramP = commandStr + 6; + int spareIndex = commandStr[5] - '0'; + assert(spareIndex < 4); + int screenId = getParameter(¶mP); + + // Load the spare background + SceneInfo *sceneInfo = SceneInfo::init(_vm); + sceneInfo->_width = MADS_SCREEN_WIDTH; + sceneInfo->_height = MADS_SCENE_HEIGHT; + _spareScreens[spareIndex].setSize(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT); + sceneInfo->loadMadsV1Background(screenId, "", SCENEFLAG_TRANSLATE, + _spareScreens[spareIndex]); + delete sceneInfo; + + } else if (!strncmp(commandStr, "PAGE", 4)) { + // Signals to change to a previous specified secondary background + paramP = commandStr + 4; + int spareIndex = getParameter(¶mP); + + // Only allow background switches if one isn't currently in progress + if (!_spareScreen && _spareScreens[spareIndex].getPixels() != nullptr) { + _spareScreen = &_spareScreens[spareIndex]; + _translationX = 0; + } + + } else { + error("Unknown response command: '%s'", commandStr); + } +} + +int TextView::getParameter(const char **paramP) { + if ((**paramP != '=') && (**paramP != ',')) + return 0; + + int result = 0; + ++*paramP; + while ((**paramP >= '0') && (**paramP <= '9')) { + result = result * 10 + (**paramP - '0'); + ++*paramP; + } + + return result; +} + +void TextView::processText() { + int xStart; + + if (!strcmp(_currentLine, "***")) { + // Special signifier for end of script + _scrollCount = _font->getHeight() * 13; + _lineY = -1; + return; + } + + _lineY = 0; + + // Lines are always centered, except if line contains a '@', in which case the + // '@' marks the position that must be horizontally centered + char *centerP = strchr(_currentLine, '@'); + if (centerP) { + *centerP = '\0'; + xStart = (MADS_SCREEN_WIDTH / 2) - _font->getWidth(_currentLine); + + // Delete the @ character and shift back the remainder of the string + char *p = centerP + 1; + if (*p == ' ') ++p; + strcpy(centerP, p); + + } else { + int lineWidth = _font->getWidth(_currentLine); + xStart = (MADS_SCREEN_WIDTH - lineWidth) / 2; + } + + // Add the new line to the list of pending lines + TextLine tl; + tl._pos = Common::Point(xStart, MADS_SCENE_HEIGHT); + tl._line = _currentLine; + tl._textDisplayIndex = -1; + _textLines.push_back(tl); +} + +void TextView::display() { + FullScreenDialog::display(); +} + +void TextView::resetPalette() { + _vm->_palette->resetGamePalette(8, 8); + _vm->_palette->setEntry(5, 0, 63, 63); + _vm->_palette->setEntry(6, 0, 45, 45); +} + +void TextView::doFrame() { + Scene &scene = _vm->_game->_scene; + if (!_animating) + return; + + // Only update state if wait period has expired + uint32 currTime = g_system->getMillis(); + + // If a screen transition is in progress and it's time for another column, handle it + if (_spareScreen) { + byte *srcP = _spareScreen->getBasePtr(_translationX, 0); + byte *bgP = scene._backgroundSurface.getBasePtr(_translationX, 0); + byte *screenP = (byte *)_vm->_screen.getBasePtr(_translationX, 0); + + for (int y = 0; y < MADS_SCENE_HEIGHT; ++y, srcP += MADS_SCREEN_WIDTH, + bgP += MADS_SCREEN_WIDTH, screenP += MADS_SCREEN_WIDTH) { + *bgP = *srcP; + *screenP = *srcP; + } + + // Flag the column of the screen is modified + _vm->_screen.copyRectToScreen(Common::Rect(_translationX, 0, + _translationX + 1, MADS_SCENE_HEIGHT)); + + // Keep moving the column to copy to the right + if (++_translationX == MADS_SCREEN_WIDTH) { + // Surface transition is complete + _spareScreen = nullptr; + } + } + + // Make sure it's time for an update + if (currTime < _scrollTimeout) + return; + _scrollTimeout = g_system->getMillis() + TEXT_ANIMATION_DELAY; + _redrawFlag = true; + + // If any panning values are set, pan the background surface + if ((_pan.x != 0) || (_pan.y != 0)) { + if (_panCountdown > 0) { + --_panCountdown; + return; + } + + // Handle horizontal panning + if (_pan.x != 0) { + byte *lineTemp = new byte[_pan.x]; + for (int y = 0; y < MADS_SCENE_HEIGHT; ++y) { + byte *pixelsP = (byte *)scene._backgroundSurface.getBasePtr(0, y); + + // Copy the first X pixels into temp buffer, move the rest of the line + // to the start of the line, and then move temp buffer pixels to end of line + Common::copy(pixelsP, pixelsP + _pan.x, lineTemp); + Common::copy(pixelsP + _pan.x, pixelsP + MADS_SCREEN_WIDTH, pixelsP); + Common::copy(lineTemp, lineTemp + _pan.x, pixelsP + MADS_SCREEN_WIDTH - _pan.x); + } + + delete[] lineTemp; + } + + // Handle vertical panning + if (_pan.y != 0) { + // Store the bottom Y lines into a temp buffer, move the rest of the lines down, + // and then copy the stored lines back to the top of the screen + byte *linesTemp = new byte[_pan.y * MADS_SCREEN_WIDTH]; + byte *pixelsP = (byte *)scene._backgroundSurface.getBasePtr(0, MADS_SCENE_HEIGHT - _pan.y); + Common::copy(pixelsP, pixelsP + MADS_SCREEN_WIDTH * _pan.y, linesTemp); + + for (int y = MADS_SCENE_HEIGHT - 1; y >= _pan.y; --y) { + byte *destP = (byte *)scene._backgroundSurface.getBasePtr(0, y); + byte *srcP = (byte *)scene._backgroundSurface.getBasePtr(0, y - _pan.y); + Common::copy(srcP, srcP + MADS_SCREEN_WIDTH, destP); + } + + Common::copy(linesTemp, linesTemp + _pan.y * MADS_SCREEN_WIDTH, + (byte *)scene._backgroundSurface.getPixels()); + delete[] linesTemp; + } + + // Flag for a full screen refresh + scene._spriteSlots.fullRefresh(); + } + + // Scroll all active text lines up + for (int i = _textLines.size() - 1; i >= 0; --i) { + TextLine &tl = _textLines[i]; + if (tl._textDisplayIndex != -1) + // Expire the text line that's already on-screen + scene._textDisplay.expire(tl._textDisplayIndex); + + tl._pos.y--; + if (tl._pos.y < 0) { + _textLines.remove_at(i); + } else { + tl._textDisplayIndex = scene._textDisplay.add(tl._pos.x, tl._pos.y, + 0x605, -1, tl._line, _font); + } + } + + if (_scrollCount > 0) { + // Handling final scrolling of text off of screen + if (--_scrollCount == 0) { + scriptDone(); + return; + } + } else { + // Handling a text row + if (++_lineY == (_font->getHeight() + TEXTVIEW_LINE_SPACING)) + processLines(); + } +} + +void TextView::scriptDone() { + _breakFlag = true; + _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; +} + +/*------------------------------------------------------------------------*/ + +char AnimationView::_resourceName[100]; + +void AnimationView::execute(MADSEngine *vm, const Common::String &resName) { + assert(resName.size() < 100); + Common::strlcpy(_resourceName, resName.c_str(), sizeof(_resourceName)); + vm->_dialogs->_pendingDialog = DIALOG_ANIMVIEW; +} + +AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) { + _redrawFlag = false; + + _soundDriverLoaded = false; + _previousUpdate = 0; + _screenId = -1; + _resetPalette = false; + _resyncMode = NEVER; + _v1 = 0; + _v2 = -1; + _resourceIndex = -1; + _currentAnimation = nullptr; + _sfx = 0; + _soundFlag = _bgLoadFlag = true; + _showWhiteBars = true; + _manualFrameNumber = 0; + _manualSpriteSet = nullptr; + _manualStartFrame = _manualEndFrame = 0; + _manualFrame2 = 0; + _animFrameNumber = 0; + _nextCyclingActive = false; + _sceneInfo = SceneInfo::init(_vm); + + load(); +} + +AnimationView::~AnimationView() { + delete _currentAnimation; + delete _sceneInfo; +} + +void AnimationView::load() { + Common::String resName(_resourceName); + if (!resName.hasSuffix(".")) + resName += ".res"; + + if (!_script.open(resName)) + error("Could not open resource %s", resName.c_str()); + + processLines(); +} + +void AnimationView::display() { + Scene &scene = _vm->_game->_scene; + _vm->_palette->initPalette(); + Common::fill(&_vm->_palette->_cyclingPalette[0], &_vm->_palette->_cyclingPalette[PALETTE_SIZE], 0); + + _vm->_palette->resetGamePalette(1, 8); + scene._spriteSlots.reset(); + scene._paletteCycles.clear(); + + MenuView::display(); +} + +bool AnimationView::onEvent(Common::Event &event) { + // Wait for the Escape key or a mouse press + if (((event.type == Common::EVENT_KEYDOWN) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) || + (event.type == Common::EVENT_RBUTTONUP)) { + scriptDone(); + return true; + } + + return false; +} + +void AnimationView::doFrame() { + Scene &scene = _vm->_game->_scene; + + if (_resourceIndex == -1 || _currentAnimation->freeFlag()) { + if (++_resourceIndex == (int)_resources.size()) { + scriptDone(); + } else { + scene._frameStartTime = 0; + loadNextResource(); + } + } else if (_currentAnimation->getCurrentFrame() == 1) { + scene._cyclingActive = _nextCyclingActive; + } + + if (_currentAnimation) { + ++scene._frameStartTime; + _currentAnimation->update(); + _redrawFlag = true; + } +} + +void AnimationView::loadNextResource() { + Scene &scene = _vm->_game->_scene; + Palette &palette = *_vm->_palette; + ResourceEntry &resEntry = _resources[_resourceIndex]; + Common::Array paletteCycles; + + if (resEntry._bgFlag) + palette.resetGamePalette(1, 8); + + palette._mainPalette[253 * 3] = palette._mainPalette[253 * 3 + 1] + = palette._mainPalette[253 * 3 + 2] = 0xb4; + palette.setPalette(&palette._mainPalette[253 * 3], 253, 1); + + // Free any previous messages + scene._kernelMessages.reset(); + + // Handle the bars at the top/bottom + if (resEntry._showWhiteBars) { + // For animations the screen has been clipped to the middle 156 rows. + // So although it's slightly messy, bypass our screen class entirely, + // and draw the horizontal lines directly on the physiacl screen surface + Graphics::Surface *s = g_system->lockScreen(); + s->hLine(0, 20, MADS_SCREEN_WIDTH, 253); + s->hLine(0, 179, MADS_SCREEN_WIDTH, 253); + g_system->unlockScreen(); + } + + // Load the new animation + delete _currentAnimation; + _currentAnimation = Animation::init(_vm, &scene); + int flags = ANIMFLAG_ANIMVIEW | (resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0); + _currentAnimation->load(scene._backgroundSurface, scene._depthSurface, + resEntry._resourceName, flags, &paletteCycles, _sceneInfo); + + // Signal for a screen refresh + scene._spriteSlots.fullRefresh(); + + // If a sound driver has been specified, then load the correct one + if (!_currentAnimation->_header._soundName.empty()) { + const char *chP = strchr(_currentAnimation->_header._soundName.c_str(), '.'); + assert(chP); + + // Handle both Rex naming (xxx.009) and naming in later games (e.g. xxx.ph9) + int driverNum = atoi(chP + 3); + // HACK for Dragon + if (_currentAnimation->_header._soundName == "#SOUND.DRG") + driverNum = 9; + _vm->_sound->init(driverNum); + } + + // Handle any manual setup + if (_currentAnimation->_header._manualFlag) { + _manualFrameNumber = _currentAnimation->_header._spritesIndex; + _manualSpriteSet = _currentAnimation->getSpriteSet(_manualFrameNumber); + } + + // Set the sound data for the animation + _vm->_sound->setEnabled(resEntry._soundFlag); + + Common::String dsrName = _currentAnimation->_header._dsrName; + if (!dsrName.empty()) + _vm->_audio->setSoundGroup(dsrName); + + // Start the new animation + _currentAnimation->startAnimation(0); + + // Handle the palette and cycling palette + scene._cyclingActive = false; + Common::copy(&palette._mainPalette[0], &palette._mainPalette[PALETTE_SIZE], + &palette._cyclingPalette[0]); + + _vm->_game->_fx = (ScreenTransition)resEntry._fx; + _nextCyclingActive = paletteCycles.size() > 0; + if (!_vm->_game->_fx) { + palette.setFullPalette(palette._mainPalette); + } + + scene.initPaletteAnimation(paletteCycles, _nextCyclingActive && !_vm->_game->_fx); +} + +void AnimationView::scriptDone() { + _breakFlag = true; + _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; +} + +void AnimationView::processLines() { + if (_script.eos()) { + // end of script, end animation + scriptDone(); + return; + } + + while (!_script.eos()) { + // Get in next line + _currentLine.clear(); + char c; + while (!_script.eos() && (c = _script.readByte()) != '\n') { + if (c != '\r' && c != '\0') + _currentLine += c; + } + + // Process the line + while (!_currentLine.empty()) { + if (_currentLine.hasPrefix("-")) { + _currentLine.deleteChar(0); + + processCommand(); + } else { + // Get resource name + Common::String resName; + while (!_currentLine.empty() && (c = _currentLine[0]) != ' ') { + _currentLine.deleteChar(0); + resName += c; + } + + // Add resource into list along with any set state information + _resources.push_back(ResourceEntry(resName, _sfx, _soundFlag, + _bgLoadFlag, _showWhiteBars)); + + // Fx resets between resource entries + _sfx = 0; + } + + // Skip any spaces + while (_currentLine.hasPrefix(" ")) + _currentLine.deleteChar(0); + } + } +} + +void AnimationView::processCommand() { + // Get the command character + char commandChar = toupper(_currentLine[0]); + _currentLine.deleteChar(0); + + // Handle the command + switch (commandChar) { + case 'B': + _soundFlag = !_soundFlag; + break; + case 'H': + // -h[:ex] Disable EMS / XMS high memory support + if (_currentLine.hasPrefix(":")) + _currentLine.deleteChar(0); + while (_currentLine.hasPrefix("e") || _currentLine.hasPrefix("x")) + _currentLine.deleteChar(0); + break; + case 'O': + // -o:xxx Specify opening special effect + assert(_currentLine[0] == ':'); + _currentLine.deleteChar(0); + _sfx = getParameter(); + break; + case 'P': + // Switch to CONCAT mode, which is ignored anyway + break; + case 'R': { + // Resynch timer (always, beginning, never) + assert(_currentLine[0] == ':'); + _currentLine.deleteChar(0); + + char v = toupper(_currentLine[0]); + _currentLine.deleteChar(0); + if (v == 'N') + _resyncMode = NEVER; + else if (v == 'A') + _resyncMode = ALWAYS; + else if (v == 'B') + _resyncMode = BEGINNING; + else + error("Unknown parameter"); + break; + } + case 'W': + // Switch white bars being visible + _showWhiteBars = !_showWhiteBars; + break; + case 'X': + // Exit after animation finishes. Ignore + break; + case 'D': + // Unimplemented and ignored in the original. Ignore as well + break; + case 'Y': + // Reset palette on startup + _resetPalette = true; + break; + default: + error("Unknown command char: '%c'", commandChar); + } +} + +int AnimationView::getParameter() { + int result = 0; + + while (!_currentLine.empty()) { + char c = _currentLine[0]; + + if (c >= '0' && c <= '9') { + _currentLine.deleteChar(0); + result = result * 10 + (c - '0'); + } else { + break; + } + } + + return result; +} + +void AnimationView::checkResource(const Common::String &resourceName) { + //bool hasSuffix = false; + +} + +int AnimationView::scanResourceIndex(const Common::String &resourceName) { + int foundIndex = -1; + + if (_v1) { + const char *chP = strchr(resourceName.c_str(), '\\'); + if (!chP) { + chP = strchr(resourceName.c_str(), '*'); + } + + Common::String resName = chP ? Common::String(chP + 1) : resourceName; + + if (_v2 != 3) { + assert(_resIndex.size() == 0); + } + + // Scan for the resource name + for (uint resIndex = 0; resIndex < _resIndex.size(); ++resIndex) { + ResIndexEntry &resEntry = _resIndex[resIndex]; + if (resEntry._resourceName.compareToIgnoreCase(resourceName)) { + foundIndex = resIndex; + break; + } + } + } + + if (foundIndex >= 0) { + // TODO + } + return -1; +} + +} // End of namespace MADS diff --git a/engines/mads/menu_views.h b/engines/mads/menu_views.h new file mode 100644 index 0000000000..6faa665bff --- /dev/null +++ b/engines/mads/menu_views.h @@ -0,0 +1,226 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef MADS_MENU_VIEWS_H +#define MADS_MENU_VIEWS_H + +#include "common/scummsys.h" +#include "mads/dialogs.h" +#include "mads/game.h" +#include "mads/msurface.h" + +namespace MADS { + +class MADSEngine; + +class MenuView: public FullScreenDialog { +protected: + bool _breakFlag; + bool _redrawFlag; + + virtual void doFrame() = 0; + + virtual void display(); + + /** + * Event handler + */ + virtual bool onEvent(Common::Event &event); +public: + MenuView(MADSEngine *vm); + + virtual ~MenuView() {} + + virtual void show(); +}; + +struct TextLine { + Common::Point _pos; + Common::String _line; + int _textDisplayIndex; +}; + +/** + * Scrolling text view + */ +class TextView : public MenuView { +private: + static char _resourceName[100]; + + bool _animating; + Common::Array _textLines; + Common::Point _pan; + int _panSpeed; + MSurface _spareScreens[4]; + int _scrollCount; + int _lineY; + uint32 _scrollTimeout; + int _panCountdown; + int _translationX; + Common::File _script; + char _currentLine[80]; + MSurface *_spareScreen; + Font *_font; +private: + /** + * Load the text resource + */ + void load(); + + /** + * Process the lines + */ + void processLines(); + + /** + * Process a command from the script file + */ + void processCommand(); + + /** + * Process text from the script file + */ + void processText(); + + /** + * Get a parameter from line + */ + int getParameter(const char **paramP); + + /** + * Called when the script is finished + */ + void scriptDone(); + + /** + * Reset the game palette + */ + void resetPalette(); +protected: + virtual void display(); + + virtual void doFrame(); +public: + /** + * Queue the given text resource for display + */ + static void execute(MADSEngine *vm, const Common::String &resName); + + TextView(MADSEngine *vm); + + virtual ~TextView(); +}; + +enum ResyncMode { NEVER, ALWAYS, BEGINNING }; + +struct ResourceEntry { + Common::String _resourceName; + int _fx; + bool _soundFlag; + bool _bgFlag; + bool _showWhiteBars; + + ResourceEntry() {} + ResourceEntry(const Common::String &resName, int fx, bool soundFlag, + bool bgFlag, bool showWhiteBars) { + _resourceName = resName; + _fx = fx; + _soundFlag = soundFlag; + _bgFlag = bgFlag; + _showWhiteBars = showWhiteBars; + } +}; + +struct ResIndexEntry { + int _id; + int _v; + Common::String _resourceName; + + ResIndexEntry() {} +}; + +/** +* Animation cutscene view +*/ +class AnimationView : public MenuView { +private: + static char _resourceName[100]; + + Common::File _script; + uint32 _previousUpdate; + Common::String _currentLine; + bool _soundDriverLoaded; + bool _resetPalette; + ResyncMode _resyncMode; + int _sfx; + bool _soundFlag; + bool _bgLoadFlag; + bool _showWhiteBars; + Common::Array _resources; + Common::Array _resIndex; + int _v1; + int _v2; + int _resourceIndex; + SceneInfo *_sceneInfo; + Animation *_currentAnimation; + int _manualFrameNumber; + SpriteAsset *_manualSpriteSet; + int _manualStartFrame, _manualEndFrame; + int _manualFrame2; + int _animFrameNumber; + bool _nextCyclingActive; +private: + void checkResource(const Common::String &resourceName); + + int scanResourceIndex(const Common::String &resourceName); + + void load(); + + void processLines(); + + void processCommand(); + + int getParameter(); + + void scriptDone(); + + void loadNextResource(); +protected: + virtual void display(); + + virtual void doFrame(); + + virtual bool onEvent(Common::Event &event); +public: + /** + * Queue the given text resource for display + */ + static void execute(MADSEngine *vm, const Common::String &resName); + + AnimationView(MADSEngine *vm); + + virtual ~AnimationView(); +}; + +} // End of namespace MADS + +#endif /* MADS_MENU_VIEWS_H */ diff --git a/engines/mads/module.mk b/engines/mads/module.mk index 96353e9ae5..fc04a2f8ba 100644 --- a/engines/mads/module.mk +++ b/engines/mads/module.mk @@ -35,6 +35,7 @@ MODULE_OBJS := \ hotspots.o \ inventory.o \ mads.o \ + menu_views.o \ messages.o \ msurface.o \ palette.o \ diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 35a7d3bdc6..86244bd3bb 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -553,67 +553,6 @@ void PictureDialog::restore() { /*------------------------------------------------------------------------*/ -FullScreenDialog::FullScreenDialog(MADSEngine *vm) : _vm(vm) { - _screenId = 990; - _palFlag = true; -} - -FullScreenDialog::~FullScreenDialog() { - _vm->_screen.resetClipBounds(); - _vm->_game->_scene.restrictScene(); -} - -void FullScreenDialog::display() { - Game &game = *_vm->_game; - Scene &scene = game._scene; - - int nextSceneId = scene._nextSceneId; - int currentSceneId = scene._currentSceneId; - int priorSceneId = scene._priorSceneId; - - if (_screenId > 0) { - SceneInfo *sceneInfo = SceneInfo::init(_vm); - sceneInfo->load(_screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface); - } - - scene._priorSceneId = priorSceneId; - scene._currentSceneId = currentSceneId; - scene._nextSceneId = nextSceneId; - - _vm->_events->initVars(); - game._kernelMode = KERNEL_ROOM_INIT; - - byte pal[768]; - if (_vm->_screenFade) { - Common::fill(&pal[0], &pal[PALETTE_SIZE], 0); - _vm->_palette->setFullPalette(pal); - } else { - _vm->_palette->getFullPalette(pal); - _vm->_palette->fadeOut(pal, nullptr, 0, PALETTE_COUNT, 0, 1, 1, 16); - } - - // Set Fx state and palette entries - game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kCenterVertTransition; - game._trigger = 0; - - // Clear the screen and draw the upper and lower horizontal lines - _vm->_screen.empty(); - _vm->_palette->setLowRange(); - _vm->_screen.hLine(0, 20, MADS_SCREEN_WIDTH, 2); - _vm->_screen.hLine(0, 179, MADS_SCREEN_WIDTH, 2); - _vm->_screen.copyRectToScreen(Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT)); - - // Restrict the screen to the area between the two lines - _vm->_screen.setClipBounds(Common::Rect(0, DIALOG_TOP, MADS_SCREEN_WIDTH, - DIALOG_TOP + MADS_SCENE_HEIGHT)); - _vm->_game->_scene.restrictScene(); - - if (_screenId > 0) - scene._spriteSlots.fullRefresh(); -} - -/*------------------------------------------------------------------------*/ - GameDialog::DialogLine::DialogLine() { _active = true; _state = DLGSTATE_UNSELECTED; diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h index f64f992611..d00cd87ead 100644 --- a/engines/mads/nebular/dialogs_nebular.h +++ b/engines/mads/nebular/dialogs_nebular.h @@ -31,8 +31,6 @@ namespace MADS { namespace Nebular { -#define DIALOG_TOP 22 - enum CapitalizationMode { kUppercase = 0, kLowercase = 1, kUpperAndLower = 2 }; class DialogsNebular : public Dialogs { @@ -109,36 +107,6 @@ enum DialogTextAlign { ALIGN_NONE = 0, ALIGN_CENTER = -1, ALIGN_AT_CENTER = -2, enum DialogState { DLGSTATE_UNSELECTED = 0, DLGSTATE_SELECTED = 1, DLGSTATE_FOCUSED = 2 }; -class FullScreenDialog: public EventTarget { -protected: - /** - * Engine reference - */ - MADSEngine *_vm; - - /** - * Screen/scene to show background from - */ - int _screenId; - - /** - * Flag for palette initialization - */ - bool _palFlag; - - /** - * Handles displaying the screen background and dialog - */ - virtual void display(); -public: - /** - * Constructor - */ - FullScreenDialog(MADSEngine *vm); - - virtual ~FullScreenDialog(); -}; - class GameDialog: public FullScreenDialog { struct DialogLine { bool _active; diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 6a13cea195..717e3f6cf9 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -23,6 +23,7 @@ #include "common/scummsys.h" #include "mads/game.h" #include "mads/mads.h" +#include "mads/menu_views.h" #include "mads/resources.h" #include "mads/scene.h" #include "mads/screen.h" @@ -36,58 +37,6 @@ namespace Nebular { #define MADS_MENU_Y ((MADS_SCREEN_HEIGHT - MADS_SCENE_HEIGHT) / 2) #define MADS_MENU_ANIM_DELAY 70 -MenuView::MenuView(MADSEngine *vm) : FullScreenDialog(vm) { - _breakFlag = false; - _redrawFlag = true; - _palFlag = false; -} - -void MenuView::show() { - Scene &scene = _vm->_game->_scene; - EventsManager &events = *_vm->_events; - _vm->_screenFade = SCREEN_FADE_FAST; - - scene._spriteSlots.reset(true); - display(); - - events.setEventTarget(this); - events.hideCursor(); - - while (!_breakFlag && !_vm->shouldQuit()) { - if (_redrawFlag) { - scene._kernelMessages.update(); - - _vm->_game->_scene.drawElements(_vm->_game->_fx, _vm->_game->_fx); - _redrawFlag = false; - } - - _vm->_events->waitForNextFrame(); - _vm->_game->_fx = kTransitionNone; - doFrame(); - } - - events.setEventTarget(nullptr); - _vm->_sound->stop(); -} - -void MenuView::display() { - _vm->_palette->resetGamePalette(4, 8); - - FullScreenDialog::display(); -} - -bool MenuView::onEvent(Common::Event &event) { - if (event.type == Common::EVENT_KEYDOWN || event.type == Common::EVENT_LBUTTONDOWN) { - _breakFlag = true; - _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; - return true; - } - - return false; -} - -/*------------------------------------------------------------------------*/ - MainMenu::MainMenu(MADSEngine *vm): MenuView(vm) { Common::fill(&_menuItems[0], &_menuItems[7], (SpriteAsset *)nullptr); Common::fill(&_menuItemIndexes[0], &_menuItemIndexes[7], -1); @@ -426,706 +375,6 @@ bool AdvertView::onEvent(Common::Event &event) { return false; } -/*------------------------------------------------------------------------*/ - -char TextView::_resourceName[100]; -#define TEXTVIEW_LINE_SPACING 2 -#define TEXT_ANIMATION_DELAY 100 -#define TV_NUM_FADE_STEPS 40 -#define TV_FADE_DELAY_MILLI 50 - -void TextView::execute(MADSEngine *vm, const Common::String &resName) { - assert(resName.size() < 100); - Common::strlcpy(_resourceName, resName.c_str(), sizeof(_resourceName)); - vm->_dialogs->_pendingDialog = DIALOG_TEXTVIEW; -} - -TextView::TextView(MADSEngine *vm) : MenuView(vm) { - _animating = false; - _panSpeed = 0; - _spareScreen = nullptr; - _scrollCount = 0; - _lineY = -1; - _scrollTimeout = 0; - _panCountdown = 0; - _translationX = 0; - _screenId = -1; - - _font = _vm->_font->getFont(FONT_CONVERSATION); - _vm->_palette->resetGamePalette(4, 0); - - load(); -} - -TextView::~TextView() { -} - -void TextView::load() { - Common::String scriptName(_resourceName); - scriptName += ".txr"; - - if (!_script.open(scriptName)) - error("Could not open resource %s", _resourceName); - - processLines(); -} - -void TextView::processLines() { - if (_script.eos()) - error("Attempted to read past end of response file"); - - while (!_script.eos()) { - // Read in the next line - _script.readLine(_currentLine, 79); - char *p = _currentLine + strlen(_currentLine) - 1; - if (*p == '\n') - *p = '\0'; - - // Commented out line, so go loop for another - if (_currentLine[0] == '#') - continue; - - // Process the line - char *cStart = strchr(_currentLine, '['); - if (cStart) { - while (cStart) { - // Loop for possible multiple commands on one line - char *cEnd = strchr(_currentLine, ']'); - if (!cEnd) - error("Unterminated command '%s' in response file", _currentLine); - - *cEnd = '\0'; - processCommand(); - - // Copy rest of line (if any) to start of buffer - Common::strlcpy(_currentLine, cEnd + 1, sizeof(_currentLine)); - - cStart = strchr(_currentLine, '['); - } - - if (_currentLine[0]) { - processText(); - break; - } - - } else { - processText(); - break; - } - } -} - -void TextView::processCommand() { - Scene &scene = _vm->_game->_scene; - Common::String scriptLine(_currentLine + 1); - scriptLine.toUppercase(); - const char *paramP; - const char *commandStr = scriptLine.c_str(); - - if (!strncmp(commandStr, "BACKGROUND", 10)) { - // Set the background - paramP = commandStr + 10; - resetPalette(); - int screenId = getParameter(¶mP); - - SceneInfo *sceneInfo = SceneInfo::init(_vm); - sceneInfo->load(screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface); - scene._spriteSlots.fullRefresh(); - _redrawFlag = true; - - } else if (!strncmp(commandStr, "GO", 2)) { - _animating = true; - - } else if (!strncmp(commandStr, "PAN", 3)) { - // Set panning values - paramP = commandStr + 3; - int panX = getParameter(¶mP); - int panY = getParameter(¶mP); - int panSpeed = getParameter(¶mP); - - if ((panX != 0) || (panY != 0)) { - _pan = Common::Point(panX, panY); - _panSpeed = panSpeed; - } - - } else if (!strncmp(commandStr, "DRIVER", 6)) { - // Set the driver to use - paramP = commandStr + 7; - - if (!strncmp(paramP, "#SOUND.00", 9)) { - int driverNum = paramP[9] - '0'; - _vm->_sound->init(driverNum); - } - } else if (!strncmp(commandStr, "SOUND", 5)) { - // Set sound number - paramP = commandStr + 5; - int soundId = getParameter(¶mP); - _vm->_sound->command(soundId); - - } else if (!strncmp(commandStr, "COLOR", 5) && ((commandStr[5] == '0') || - (commandStr[5] == '1'))) { - // Set the text colors - int index = commandStr[5] - '0'; - paramP = commandStr + 6; - - byte r = getParameter(¶mP); - byte g = getParameter(¶mP); - byte b = getParameter(¶mP); - - _vm->_palette->setEntry(5 + index, r, g, b); - - } else if (!strncmp(commandStr, "SPARE", 5)) { - // Sets a secondary background number that can be later switched in with a PAGE command - paramP = commandStr + 6; - int spareIndex = commandStr[5] - '0'; - assert(spareIndex < 4); - int screenId = getParameter(¶mP); - - // Load the spare background - SceneInfo *sceneInfo = SceneInfo::init(_vm); - sceneInfo->_width = MADS_SCREEN_WIDTH; - sceneInfo->_height = MADS_SCENE_HEIGHT; - _spareScreens[spareIndex].setSize(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT); - sceneInfo->loadMadsV1Background(screenId, "", SCENEFLAG_TRANSLATE, - _spareScreens[spareIndex]); - delete sceneInfo; - - } else if (!strncmp(commandStr, "PAGE", 4)) { - // Signals to change to a previous specified secondary background - paramP = commandStr + 4; - int spareIndex = getParameter(¶mP); - - // Only allow background switches if one isn't currently in progress - if (!_spareScreen && _spareScreens[spareIndex].getPixels() != nullptr) { - _spareScreen = &_spareScreens[spareIndex]; - _translationX = 0; - } - - } else { - error("Unknown response command: '%s'", commandStr); - } -} - -int TextView::getParameter(const char **paramP) { - if ((**paramP != '=') && (**paramP != ',')) - return 0; - - int result = 0; - ++*paramP; - while ((**paramP >= '0') && (**paramP <= '9')) { - result = result * 10 + (**paramP - '0'); - ++*paramP; - } - - return result; -} - -void TextView::processText() { - int xStart; - - if (!strcmp(_currentLine, "***")) { - // Special signifier for end of script - _scrollCount = _font->getHeight() * 13; - _lineY = -1; - return; - } - - _lineY = 0; - - // Lines are always centered, except if line contains a '@', in which case the - // '@' marks the position that must be horizontally centered - char *centerP = strchr(_currentLine, '@'); - if (centerP) { - *centerP = '\0'; - xStart = (MADS_SCREEN_WIDTH / 2) - _font->getWidth(_currentLine); - - // Delete the @ character and shift back the remainder of the string - char *p = centerP + 1; - if (*p == ' ') ++p; - strcpy(centerP, p); - - } else { - int lineWidth = _font->getWidth(_currentLine); - xStart = (MADS_SCREEN_WIDTH - lineWidth) / 2; - } - - // Add the new line to the list of pending lines - TextLine tl; - tl._pos = Common::Point(xStart, MADS_SCENE_HEIGHT); - tl._line = _currentLine; - tl._textDisplayIndex = -1; - _textLines.push_back(tl); -} - -void TextView::display() { - FullScreenDialog::display(); -} - -void TextView::resetPalette() { - _vm->_palette->resetGamePalette(8, 8); - _vm->_palette->setEntry(5, 0, 63, 63); - _vm->_palette->setEntry(6, 0, 45, 45); -} - -void TextView::doFrame() { - Scene &scene = _vm->_game->_scene; - if (!_animating) - return; - - // Only update state if wait period has expired - uint32 currTime = g_system->getMillis(); - - // If a screen transition is in progress and it's time for another column, handle it - if (_spareScreen) { - byte *srcP = _spareScreen->getBasePtr(_translationX, 0); - byte *bgP = scene._backgroundSurface.getBasePtr(_translationX, 0); - byte *screenP = (byte *)_vm->_screen.getBasePtr(_translationX, 0); - - for (int y = 0; y < MADS_SCENE_HEIGHT; ++y, srcP += MADS_SCREEN_WIDTH, - bgP += MADS_SCREEN_WIDTH, screenP += MADS_SCREEN_WIDTH) { - *bgP = *srcP; - *screenP = *srcP; - } - - // Flag the column of the screen is modified - _vm->_screen.copyRectToScreen(Common::Rect(_translationX, 0, - _translationX + 1, MADS_SCENE_HEIGHT)); - - // Keep moving the column to copy to the right - if (++_translationX == MADS_SCREEN_WIDTH) { - // Surface transition is complete - _spareScreen = nullptr; - } - } - - // Make sure it's time for an update - if (currTime < _scrollTimeout) - return; - _scrollTimeout = g_system->getMillis() + TEXT_ANIMATION_DELAY; - _redrawFlag = true; - - // If any panning values are set, pan the background surface - if ((_pan.x != 0) || (_pan.y != 0)) { - if (_panCountdown > 0) { - --_panCountdown; - return; - } - - // Handle horizontal panning - if (_pan.x != 0) { - byte *lineTemp = new byte[_pan.x]; - for (int y = 0; y < MADS_SCENE_HEIGHT; ++y) { - byte *pixelsP = (byte *)scene._backgroundSurface.getBasePtr(0, y); - - // Copy the first X pixels into temp buffer, move the rest of the line - // to the start of the line, and then move temp buffer pixels to end of line - Common::copy(pixelsP, pixelsP + _pan.x, lineTemp); - Common::copy(pixelsP + _pan.x, pixelsP + MADS_SCREEN_WIDTH, pixelsP); - Common::copy(lineTemp, lineTemp + _pan.x, pixelsP + MADS_SCREEN_WIDTH - _pan.x); - } - - delete[] lineTemp; - } - - // Handle vertical panning - if (_pan.y != 0) { - // Store the bottom Y lines into a temp buffer, move the rest of the lines down, - // and then copy the stored lines back to the top of the screen - byte *linesTemp = new byte[_pan.y * MADS_SCREEN_WIDTH]; - byte *pixelsP = (byte *)scene._backgroundSurface.getBasePtr(0, MADS_SCENE_HEIGHT - _pan.y); - Common::copy(pixelsP, pixelsP + MADS_SCREEN_WIDTH * _pan.y, linesTemp); - - for (int y = MADS_SCENE_HEIGHT - 1; y >= _pan.y; --y) { - byte *destP = (byte *)scene._backgroundSurface.getBasePtr(0, y); - byte *srcP = (byte *)scene._backgroundSurface.getBasePtr(0, y - _pan.y); - Common::copy(srcP, srcP + MADS_SCREEN_WIDTH, destP); - } - - Common::copy(linesTemp, linesTemp + _pan.y * MADS_SCREEN_WIDTH, - (byte *)scene._backgroundSurface.getPixels()); - delete[] linesTemp; - } - - // Flag for a full screen refresh - scene._spriteSlots.fullRefresh(); - } - - // Scroll all active text lines up - for (int i = _textLines.size() - 1; i >= 0; --i) { - TextLine &tl = _textLines[i]; - if (tl._textDisplayIndex != -1) - // Expire the text line that's already on-screen - scene._textDisplay.expire(tl._textDisplayIndex); - - tl._pos.y--; - if (tl._pos.y < 0) { - _textLines.remove_at(i); - } else { - tl._textDisplayIndex = scene._textDisplay.add(tl._pos.x, tl._pos.y, - 0x605, -1, tl._line, _font); - } - } - - if (_scrollCount > 0) { - // Handling final scrolling of text off of screen - if (--_scrollCount == 0) { - scriptDone(); - return; - } - } else { - // Handling a text row - if (++_lineY == (_font->getHeight() + TEXTVIEW_LINE_SPACING)) - processLines(); - } -} - -void TextView::scriptDone() { - _breakFlag = true; - _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; -} - -/*------------------------------------------------------------------------*/ - -char AnimationView::_resourceName[100]; - -void AnimationView::execute(MADSEngine *vm, const Common::String &resName) { - assert(resName.size() < 100); - Common::strlcpy(_resourceName, resName.c_str(), sizeof(_resourceName)); - vm->_dialogs->_pendingDialog = DIALOG_ANIMVIEW; -} - -AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) { - _redrawFlag = false; - - _soundDriverLoaded = false; - _previousUpdate = 0; - _screenId = -1; - _resetPalette = false; - _resyncMode = NEVER; - _v1 = 0; - _v2 = -1; - _resourceIndex = -1; - _currentAnimation = nullptr; - _sfx = 0; - _soundFlag = _bgLoadFlag = true; - _showWhiteBars = true; - _manualFrameNumber = 0; - _manualSpriteSet = nullptr; - _manualStartFrame = _manualEndFrame = 0; - _manualFrame2 = 0; - _animFrameNumber = 0; - _nextCyclingActive = false; - _sceneInfo = SceneInfo::init(_vm); - - load(); -} - -AnimationView::~AnimationView() { - delete _currentAnimation; - delete _sceneInfo; -} - -void AnimationView::load() { - Common::String resName(_resourceName); - if (!resName.hasSuffix(".")) - resName += ".res"; - - if (!_script.open(resName)) - error("Could not open resource %s", resName.c_str()); - - processLines(); -} - -void AnimationView::display() { - Scene &scene = _vm->_game->_scene; - _vm->_palette->initPalette(); - Common::fill(&_vm->_palette->_cyclingPalette[0], &_vm->_palette->_cyclingPalette[PALETTE_SIZE], 0); - - _vm->_palette->resetGamePalette(1, 8); - scene._spriteSlots.reset(); - scene._paletteCycles.clear(); - - MenuView::display(); -} - -bool AnimationView::onEvent(Common::Event &event) { - // Wait for the Escape key or a mouse press - if (((event.type == Common::EVENT_KEYDOWN) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) || - (event.type == Common::EVENT_RBUTTONUP)) { - scriptDone(); - return true; - } - - return false; -} - -void AnimationView::doFrame() { - Scene &scene = _vm->_game->_scene; - - if (_resourceIndex == -1 || _currentAnimation->freeFlag()) { - if (++_resourceIndex == (int)_resources.size()) { - scriptDone(); - } else { - scene._frameStartTime = 0; - loadNextResource(); - } - } else if (_currentAnimation->getCurrentFrame() == 1) { - scene._cyclingActive = _nextCyclingActive; - } - - if (_currentAnimation) { - ++scene._frameStartTime; - _currentAnimation->update(); - _redrawFlag = true; - } -} - -void AnimationView::loadNextResource() { - Scene &scene = _vm->_game->_scene; - Palette &palette = *_vm->_palette; - ResourceEntry &resEntry = _resources[_resourceIndex]; - Common::Array paletteCycles; - - if (resEntry._bgFlag) - palette.resetGamePalette(1, 8); - - palette._mainPalette[253 * 3] = palette._mainPalette[253 * 3 + 1] - = palette._mainPalette[253 * 3 + 2] = 0xb4; - palette.setPalette(&palette._mainPalette[253 * 3], 253, 1); - - // Free any previous messages - scene._kernelMessages.reset(); - - // Handle the bars at the top/bottom - if (resEntry._showWhiteBars) { - // For animations the screen has been clipped to the middle 156 rows. - // So although it's slightly messy, bypass our screen class entirely, - // and draw the horizontal lines directly on the physiacl screen surface - Graphics::Surface *s = g_system->lockScreen(); - s->hLine(0, 20, MADS_SCREEN_WIDTH, 253); - s->hLine(0, 179, MADS_SCREEN_WIDTH, 253); - g_system->unlockScreen(); - } - - // Load the new animation - delete _currentAnimation; - _currentAnimation = Animation::init(_vm, &scene); - int flags = ANIMFLAG_ANIMVIEW | (resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0); - _currentAnimation->load(scene._backgroundSurface, scene._depthSurface, - resEntry._resourceName, flags, &paletteCycles, _sceneInfo); - - // Signal for a screen refresh - scene._spriteSlots.fullRefresh(); - - // If a sound driver has been specified, then load the correct one - if (!_currentAnimation->_header._soundName.empty()) { - const char *chP = strchr(_currentAnimation->_header._soundName.c_str(), '.'); - assert(chP); - - // Handle both Rex naming (xxx.009) and naming in later games (e.g. xxx.ph9) - int driverNum = atoi(chP + 3); - // HACK for Dragon - if (_currentAnimation->_header._soundName == "#SOUND.DRG") - driverNum = 9; - _vm->_sound->init(driverNum); - } - - // Handle any manual setup - if (_currentAnimation->_header._manualFlag) { - _manualFrameNumber = _currentAnimation->_header._spritesIndex; - _manualSpriteSet = _currentAnimation->getSpriteSet(_manualFrameNumber); - } - - // Set the sound data for the animation - _vm->_sound->setEnabled(resEntry._soundFlag); - - Common::String dsrName = _currentAnimation->_header._dsrName; - if (!dsrName.empty()) - _vm->_audio->setSoundGroup(dsrName); - - // Start the new animation - _currentAnimation->startAnimation(0); - - // Handle the palette and cycling palette - scene._cyclingActive = false; - Common::copy(&palette._mainPalette[0], &palette._mainPalette[PALETTE_SIZE], - &palette._cyclingPalette[0]); - - _vm->_game->_fx = (ScreenTransition)resEntry._fx; - _nextCyclingActive = paletteCycles.size() > 0; - if (!_vm->_game->_fx) { - palette.setFullPalette(palette._mainPalette); - } - - scene.initPaletteAnimation(paletteCycles, _nextCyclingActive && !_vm->_game->_fx); -} - -void AnimationView::scriptDone() { - _breakFlag = true; - _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; -} - -void AnimationView::processLines() { - if (_script.eos()) { - // end of script, end animation - scriptDone(); - return; - } - - while (!_script.eos()) { - // Get in next line - _currentLine.clear(); - char c; - while (!_script.eos() && (c = _script.readByte()) != '\n') { - if (c != '\r' && c != '\0') - _currentLine += c; - } - - // Process the line - while (!_currentLine.empty()) { - if (_currentLine.hasPrefix("-")) { - _currentLine.deleteChar(0); - - processCommand(); - } else { - // Get resource name - Common::String resName; - while (!_currentLine.empty() && (c = _currentLine[0]) != ' ') { - _currentLine.deleteChar(0); - resName += c; - } - - // Add resource into list along with any set state information - _resources.push_back(ResourceEntry(resName, _sfx, _soundFlag, - _bgLoadFlag, _showWhiteBars)); - - // Fx resets between resource entries - _sfx = 0; - } - - // Skip any spaces - while (_currentLine.hasPrefix(" ")) - _currentLine.deleteChar(0); - } - } -} - -void AnimationView::processCommand() { - // Get the command character - char commandChar = toupper(_currentLine[0]); - _currentLine.deleteChar(0); - - // Handle the command - switch (commandChar) { - case 'B': - _soundFlag = !_soundFlag; - break; - case 'H': - // -h[:ex] Disable EMS / XMS high memory support - if (_currentLine.hasPrefix(":")) - _currentLine.deleteChar(0); - while (_currentLine.hasPrefix("e") || _currentLine.hasPrefix("x")) - _currentLine.deleteChar(0); - break; - case 'O': - // -o:xxx Specify opening special effect - assert(_currentLine[0] == ':'); - _currentLine.deleteChar(0); - _sfx = getParameter(); - break; - case 'P': - // Switch to CONCAT mode, which is ignored anyway - break; - case 'R': { - // Resynch timer (always, beginning, never) - assert(_currentLine[0] == ':'); - _currentLine.deleteChar(0); - - char v = toupper(_currentLine[0]); - _currentLine.deleteChar(0); - if (v == 'N') - _resyncMode = NEVER; - else if (v == 'A') - _resyncMode = ALWAYS; - else if (v == 'B') - _resyncMode = BEGINNING; - else - error("Unknown parameter"); - break; - } - case 'W': - // Switch white bars being visible - _showWhiteBars = !_showWhiteBars; - break; - case 'X': - // Exit after animation finishes. Ignore - break; - case 'D': - // Unimplemented and ignored in the original. Ignore as well - break; - case 'Y': - // Reset palette on startup - _resetPalette = true; - break; - default: - error("Unknown command char: '%c'", commandChar); - } -} - -int AnimationView::getParameter() { - int result = 0; - - while (!_currentLine.empty()) { - char c = _currentLine[0]; - - if (c >= '0' && c <= '9') { - _currentLine.deleteChar(0); - result = result * 10 + (c - '0'); - } else { - break; - } - } - - return result; -} - -void AnimationView::checkResource(const Common::String &resourceName) { - //bool hasSuffix = false; - -} - -int AnimationView::scanResourceIndex(const Common::String &resourceName) { - int foundIndex = -1; - - if (_v1) { - const char *chP = strchr(resourceName.c_str(), '\\'); - if (!chP) { - chP = strchr(resourceName.c_str(), '*'); - } - - Common::String resName = chP ? Common::String(chP + 1) : resourceName; - - if (_v2 != 3) { - assert(_resIndex.size() == 0); - } - - // Scan for the resource name - for (uint resIndex = 0; resIndex < _resIndex.size(); ++resIndex) { - ResIndexEntry &resEntry = _resIndex[resIndex]; - if (resEntry._resourceName.compareToIgnoreCase(resourceName)) { - foundIndex = resIndex; - break; - } - } - } - - if (foundIndex >= 0) { - // TODO - } - return -1; -} - - } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h index c05c87258e..29777a7a7c 100644 --- a/engines/mads/nebular/menu_nebular.h +++ b/engines/mads/nebular/menu_nebular.h @@ -25,6 +25,7 @@ #include "common/scummsys.h" #include "mads/game.h" +#include "mads/menu_views.h" #include "mads/msurface.h" #include "mads/nebular/dialogs_nebular.h" @@ -36,27 +37,6 @@ namespace Nebular { enum MADSGameAction { START_GAME, RESUME_GAME, SHOW_INTRO, CREDITS, QUOTES, EXIT }; -class MenuView: public FullScreenDialog { -protected: - bool _breakFlag; - bool _redrawFlag; - - virtual void doFrame() = 0; - - virtual void display(); - - /** - * Event handler - */ - virtual bool onEvent(Common::Event &event); -public: - MenuView(MADSEngine *vm); - - virtual ~MenuView() {} - - virtual void show(); -}; - class MainMenu: public MenuView { private: SpriteAsset *_menuItems[7]; @@ -148,174 +128,6 @@ public: void show(); }; -struct TextLine { - Common::Point _pos; - Common::String _line; - int _textDisplayIndex; -}; - -/** - * Scrolling text view - */ -class TextView : public MenuView { -private: - static char _resourceName[100]; - - bool _animating; - Common::Array _textLines; - Common::Point _pan; - int _panSpeed; - MSurface _spareScreens[4]; - int _scrollCount; - int _lineY; - uint32 _scrollTimeout; - int _panCountdown; - int _translationX; - Common::File _script; - char _currentLine[80]; - MSurface *_spareScreen; - Font *_font; -private: - /** - * Load the text resource - */ - void load(); - - /** - * Process the lines - */ - void processLines(); - - /** - * Process a command from the script file - */ - void processCommand(); - - /** - * Process text from the script file - */ - void processText(); - - /** - * Get a parameter from line - */ - int getParameter(const char **paramP); - - /** - * Called when the script is finished - */ - void scriptDone(); - - /** - * Reset the game palette - */ - void resetPalette(); -protected: - virtual void display(); - - virtual void doFrame(); -public: - /** - * Queue the given text resource for display - */ - static void execute(MADSEngine *vm, const Common::String &resName); - - TextView(MADSEngine *vm); - - virtual ~TextView(); -}; - -enum ResyncMode { NEVER, ALWAYS, BEGINNING }; - -struct ResourceEntry { - Common::String _resourceName; - int _fx; - bool _soundFlag; - bool _bgFlag; - bool _showWhiteBars; - - ResourceEntry() {} - ResourceEntry(const Common::String &resName, int fx, bool soundFlag, - bool bgFlag, bool showWhiteBars) { - _resourceName = resName; - _fx = fx; - _soundFlag = soundFlag; - _bgFlag = bgFlag; - _showWhiteBars = showWhiteBars; - } -}; - -struct ResIndexEntry { - int _id; - int _v; - Common::String _resourceName; - - ResIndexEntry() {} -}; - -/** -* Animation cutscene view -*/ -class AnimationView : public MenuView { -private: - static char _resourceName[100]; - - Common::File _script; - uint32 _previousUpdate; - Common::String _currentLine; - bool _soundDriverLoaded; - bool _resetPalette; - ResyncMode _resyncMode; - int _sfx; - bool _soundFlag; - bool _bgLoadFlag; - bool _showWhiteBars; - Common::Array _resources; - Common::Array _resIndex; - int _v1; - int _v2; - int _resourceIndex; - SceneInfo *_sceneInfo; - Animation *_currentAnimation; - int _manualFrameNumber; - SpriteAsset *_manualSpriteSet; - int _manualStartFrame, _manualEndFrame; - int _manualFrame2; - int _animFrameNumber; - bool _nextCyclingActive; -private: - void checkResource(const Common::String &resourceName); - - int scanResourceIndex(const Common::String &resourceName); - - void load(); - - void processLines(); - - void processCommand(); - - int getParameter(); - - void scriptDone(); - - void loadNextResource(); -protected: - virtual void display(); - - virtual void doFrame(); - - virtual bool onEvent(Common::Event &event); -public: - /** - * Queue the given text resource for display - */ - static void execute(MADSEngine *vm, const Common::String &resName); - - AnimationView(MADSEngine *vm); - - virtual ~AnimationView(); -}; - } // End of namespace Nebular } // End of namespace MADS -- cgit v1.2.3 From 8ee1a85f3589bc5da2ad6d0b75a550f8df5d62dd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 15 Oct 2014 21:18:17 -0400 Subject: MADS: Save redundant reloads of digital audio when switching animations --- engines/mads/audio.cpp | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/audio.cpp b/engines/mads/audio.cpp index 1c61e13957..9d62c3f615 100644 --- a/engines/mads/audio.cpp +++ b/engines/mads/audio.cpp @@ -37,6 +37,7 @@ AudioPlayer::AudioPlayer(Audio::Mixer *mixer, uint32 gameID) : _mixer(mixer), _g AudioPlayer::~AudioPlayer() { _dsrEntries.clear(); + _filename = ""; } bool AudioPlayer::isPlaying() const { @@ -65,25 +66,27 @@ void AudioPlayer::setDefaultSoundGroup() { } void AudioPlayer::setSoundGroup(const Common::String &filename) { - _dsrEntries.clear(); - - _filename = filename; - _dsrFile.open(filename); - - // Read header - uint16 entryCount = _dsrFile.readUint16LE(); - - for (uint16 i = 0; i < entryCount; i++) { - DSREntry newEntry; - newEntry.frequency = _dsrFile.readUint16LE(); - newEntry.channels = _dsrFile.readUint32LE(); - newEntry.compSize = _dsrFile.readUint32LE(); - newEntry.uncompSize = _dsrFile.readUint32LE(); - newEntry.offset = _dsrFile.readUint32LE(); - _dsrEntries.push_back(newEntry); + if (_filename != filename) { + _dsrEntries.clear(); + + _filename = filename; + _dsrFile.open(filename); + + // Read header + uint16 entryCount = _dsrFile.readUint16LE(); + + for (uint16 i = 0; i < entryCount; i++) { + DSREntry newEntry; + newEntry.frequency = _dsrFile.readUint16LE(); + newEntry.channels = _dsrFile.readUint32LE(); + newEntry.compSize = _dsrFile.readUint32LE(); + newEntry.uncompSize = _dsrFile.readUint32LE(); + newEntry.offset = _dsrFile.readUint32LE(); + _dsrEntries.push_back(newEntry); + } + + _dsrFile.close(); } - - _dsrFile.close(); } void AudioPlayer::playSound(int soundIndex, bool loop) { -- cgit v1.2.3 From dee4fd193d690baae5afaf906d7604a9df9155ef Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 16 Oct 2014 21:53:21 -0400 Subject: MADS: Fix stopping digital audio, music, and palette cycling when animation ends --- engines/mads/audio.cpp | 4 ++++ engines/mads/audio.h | 1 + engines/mads/menu_views.cpp | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/audio.cpp b/engines/mads/audio.cpp index 9d62c3f615..def2cd6c62 100644 --- a/engines/mads/audio.cpp +++ b/engines/mads/audio.cpp @@ -129,4 +129,8 @@ void AudioPlayer::playSound(int soundIndex, bool loop) { */ } +void AudioPlayer::stop() { + _mixer->stopHandle(_handle); +} + } // End of namespace M4 diff --git a/engines/mads/audio.h b/engines/mads/audio.h index 21f4bed59a..13c540bf85 100644 --- a/engines/mads/audio.h +++ b/engines/mads/audio.h @@ -46,6 +46,7 @@ public: void setSoundGroup(const Common::String &filename); void setDefaultSoundGroup(); void playSound(int soundIndex, bool loop = false); + void stop(); void setVolume(int volume); bool isPlaying() const; diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index 6acf6cdf9f..857db68fa6 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -475,6 +475,13 @@ AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) { } AnimationView::~AnimationView() { + // Turn off palette cycling as well as any playing sound + Scene &scene = _vm->_game->_scene; + scene._cyclingActive = false; + _vm->_sound->stop(); + _vm->_audio->stop(); + + // Delete data delete _currentAnimation; delete _sceneInfo; } @@ -505,7 +512,7 @@ void AnimationView::display() { bool AnimationView::onEvent(Common::Event &event) { // Wait for the Escape key or a mouse press if (((event.type == Common::EVENT_KEYDOWN) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) || - (event.type == Common::EVENT_RBUTTONUP)) { + (event.type == Common::EVENT_LBUTTONUP)) { scriptDone(); return true; } -- cgit v1.2.3 From 72303564f70573dc4bacd9c726dc626920bf21e8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 18 Oct 2014 11:20:50 -0400 Subject: MADS: Hook up Rex game endings to show the correct animation and/or credits --- engines/mads/menu_views.cpp | 15 +++++++++++++++ engines/mads/menu_views.h | 17 ++++++++++------- engines/mads/nebular/dialogs_nebular.cpp | 4 ++-- engines/mads/nebular/game_nebular.cpp | 26 ++++++++++++++++++++++++++ engines/mads/nebular/menu_nebular.cpp | 15 +++++++++++++++ engines/mads/nebular/menu_nebular.h | 12 ++++++++++++ engines/mads/scene.cpp | 3 +++ 7 files changed, 83 insertions(+), 9 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index 857db68fa6..1314774371 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -80,6 +80,15 @@ bool MenuView::onEvent(Common::Event &event) { return false; } +Common::String MenuView::getResourceName() { + Common::String s(_filename); + s.toLowercase(); + while (s.contains('.')) + s.deleteLastChar(); + + return s; +} + /*------------------------------------------------------------------------*/ char TextView::_resourceName[100]; @@ -112,12 +121,17 @@ TextView::TextView(MADSEngine *vm) : MenuView(vm) { } TextView::~TextView() { + // Turn off palette cycling as well as any playing sound + Scene &scene = _vm->_game->_scene; + scene._cyclingActive = false; + _vm->_sound->stop(); } void TextView::load() { Common::String scriptName(_resourceName); scriptName += ".txr"; + _filename = scriptName; if (!_script.open(scriptName)) error("Could not open resource %s", _resourceName); @@ -491,6 +505,7 @@ void AnimationView::load() { if (!resName.hasSuffix(".")) resName += ".res"; + _filename = resName; if (!_script.open(resName)) error("Could not open resource %s", resName.c_str()); diff --git a/engines/mads/menu_views.h b/engines/mads/menu_views.h index 6faa665bff..c13213c3ed 100644 --- a/engines/mads/menu_views.h +++ b/engines/mads/menu_views.h @@ -36,6 +36,7 @@ class MenuView: public FullScreenDialog { protected: bool _breakFlag; bool _redrawFlag; + Common::String _filename; virtual void doFrame() = 0; @@ -51,6 +52,8 @@ public: virtual ~MenuView() {} virtual void show(); + + Common::String getResourceName(); }; struct TextLine { @@ -106,11 +109,6 @@ private: */ int getParameter(const char **paramP); - /** - * Called when the script is finished - */ - void scriptDone(); - /** * Reset the game palette */ @@ -119,6 +117,11 @@ protected: virtual void display(); virtual void doFrame(); + + /** + * Called when the script is finished + */ + virtual void scriptDone(); public: /** * Queue the given text resource for display @@ -201,8 +204,6 @@ private: int getParameter(); - void scriptDone(); - void loadNextResource(); protected: virtual void display(); @@ -210,6 +211,8 @@ protected: virtual void doFrame(); virtual bool onEvent(Common::Event &event); + + virtual void scriptDone(); public: /** * Queue the given text resource for display diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 86244bd3bb..1900a12b59 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -314,13 +314,13 @@ void DialogsNebular::showDialog() { break; } case DIALOG_TEXTVIEW: { - TextView *dlg = new TextView(_vm); + TextView *dlg = new RexTextView(_vm); dlg->show(); delete dlg; break; } case DIALOG_ANIMVIEW: { - AnimationView *dlg = new AnimationView(_vm); + AnimationView *dlg = new RexAnimationView(_vm); dlg->show(); delete dlg; break; diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 902f42507a..eae74d6da0 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -27,6 +27,7 @@ #include "mads/game.h" #include "mads/screen.h" #include "mads/msurface.h" +#include "mads/menu_views.h" #include "mads/nebular/game_nebular.h" #include "mads/nebular/dialogs_nebular.h" #include "mads/nebular/globals_nebular.h" @@ -309,6 +310,31 @@ void GameNebular::setSectionHandler() { } void GameNebular::checkShowDialog() { + // Handling to start endgame sequences if the win/lose type has been set + switch (_winStatus) { + case 1: + // No shields failure ending + AnimationView::execute(_vm, "rexend1"); + break; + case 2: + // Shields, but no targetting failure ending + AnimationView::execute(_vm, "rexend2"); + break; + case 3: + // Completed game successfully, so activate quotes item on the main menu + ConfMan.setBool("ShowQuotes", true); + ConfMan.flushToDisk(); + + AnimationView::execute(_vm, "rexend3"); + break; + case 4: + // Decompression ending + TextView::execute(_vm, "ending4"); + break; + } + _winStatus = 0; + + // Loop for showing dialogs, if any need to be shown if (_vm->_dialogs->_pendingDialog && _player._stepEnabled && !_globals[kCopyProtectFailed]) { _player.releasePlayerSprites(); diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 717e3f6cf9..46dc411678 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -375,6 +375,21 @@ bool AdvertView::onEvent(Common::Event &event) { return false; } +/*------------------------------------------------------------------------*/ + +void RexAnimationView::scriptDone() { + AnimationView::scriptDone(); + + Common::String s = getResourceName(); + if (s == "rexend1") { + TextView::execute(_vm, "ending1"); + } else if (s == "rexend2") { + TextView::execute(_vm, "ending2"); + } else if (s == "rexend3") { + TextView::execute(_vm, "credits"); + } +} + } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h index 29777a7a7c..d00439c1e4 100644 --- a/engines/mads/nebular/menu_nebular.h +++ b/engines/mads/nebular/menu_nebular.h @@ -128,6 +128,18 @@ public: void show(); }; +class RexAnimationView : public AnimationView { +protected: + virtual void scriptDone(); +public: + RexAnimationView(MADSEngine *vm) : AnimationView(vm) {} +}; + +class RexTextView : public TextView { +public: + RexTextView(MADSEngine *vm) : TextView(vm) {} +}; + } // End of namespace Nebular } // End of namespace MADS diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index ad24dd4f60..18ceb3c813 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -360,6 +360,9 @@ void Scene::loop() { if (_vm->_dialogs->_pendingDialog != DIALOG_NONE && !_vm->_game->_trigger && _vm->_game->_player._stepEnabled) _reloadSceneFlag = true; + + if (_vm->_game->_winStatus) + break; } } -- cgit v1.2.3 From a657c3982447704c9262926f853875ca80e7a7c4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 18 Oct 2014 11:42:11 -0400 Subject: MADS: Only show Quotes main menu item after winning the game --- engines/mads/nebular/menu_nebular.cpp | 14 ++++++++++++++ engines/mads/nebular/menu_nebular.h | 2 ++ 2 files changed, 16 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 46dc411678..f2f90e2291 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -21,6 +21,7 @@ */ #include "common/scummsys.h" +#include "common/config-manager.h" #include "mads/game.h" #include "mads/mads.h" #include "mads/menu_views.h" @@ -62,6 +63,10 @@ MainMenu::~MainMenu() { scene._spriteSlots.reset(); } +bool MainMenu::shouldShowQuotes() { + return ConfMan.hasKey("ShowQuotes") && ConfMan.getBool("ShowQuotes"); +} + void MainMenu::display() { MenuView::display(); Scene &scene = _vm->_game->_scene; @@ -101,6 +106,9 @@ void MainMenu::doFrame() { handleAction((MADSGameAction)_selectedIndex); } else { for (_menuItemIndex = 0; _menuItemIndex < 6; ++_menuItemIndex) { + if (_menuItemIndex == 4 && !shouldShowQuotes()) + continue; + if (_menuItemIndex != _selectedIndex) { addSpriteSlot(); } @@ -120,6 +128,9 @@ void MainMenu::doFrame() { if (_skipFlag && _menuItemIndex >= 0) { // Quickly loop through all the menu items to display each's final frame for (; _menuItemIndex < 6; ++_menuItemIndex) { + if (_menuItemIndex == 4 && !shouldShowQuotes()) + continue; + // Draw the final frame of the menuitem _frameIndex = 0; addSpriteSlot(); @@ -129,9 +140,12 @@ void MainMenu::doFrame() { } else { if ((_menuItemIndex == -1) || (_frameIndex == 0)) { if (++_menuItemIndex == 6) { + // Reached end of display animation _vm->_events->showCursor(); return; + } else if (_menuItemIndex == 4 && !shouldShowQuotes()) { + ++_menuItemIndex; } _frameIndex = _menuItems[_menuItemIndex]->getCount() - 1; diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h index d00439c1e4..77b8b6fc6e 100644 --- a/engines/mads/nebular/menu_nebular.h +++ b/engines/mads/nebular/menu_nebular.h @@ -80,6 +80,8 @@ private: * Add a sprite slot for the current menuitem frame */ void addSpriteSlot(); + + bool shouldShowQuotes(); protected: /** * Display the menu -- cgit v1.2.3 From dbfe4972e3a3e1d59aee8993697028cdd2de8da2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 18 Oct 2014 11:55:30 -0400 Subject: MADS: Remove deprecated code from AnimationView and a bunch of out-of-date TODOs --- engines/mads/animation.cpp | 3 --- engines/mads/game.cpp | 2 -- engines/mads/menu_views.cpp | 36 ------------------------------------ engines/mads/menu_views.h | 4 ---- engines/mads/msurface.cpp | 4 ---- engines/mads/nebular/game_nebular.h | 4 +--- 6 files changed, 1 insertion(+), 52 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index 9f0e0adb6d..2b999fa305 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -340,9 +340,6 @@ void Animation::startAnimation(int endTrigger) { _unkIndex = -1; //SpriteAsset *asset = _scene->_sprites[_spriteListIndexes[_header._spritesIndex]]; - // TODO: Weird stuff with _unkList. Seems like it's treated as pointers - // here, but in processText, it's used as POINTs? - loadFrame(1); } diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index b544eff2db..63a7e40d1b 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -433,8 +433,6 @@ void Game::handleKeypress(const Common::Event &event) { default: break; } - - warning("TODO: handleKeypress - %d", (int)event.kbd.keycode); } void Game::synchronize(Common::Serializer &s, bool phase1) { diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index 1314774371..03afc70c3e 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -765,40 +765,4 @@ int AnimationView::getParameter() { return result; } -void AnimationView::checkResource(const Common::String &resourceName) { - //bool hasSuffix = false; - -} - -int AnimationView::scanResourceIndex(const Common::String &resourceName) { - int foundIndex = -1; - - if (_v1) { - const char *chP = strchr(resourceName.c_str(), '\\'); - if (!chP) { - chP = strchr(resourceName.c_str(), '*'); - } - - Common::String resName = chP ? Common::String(chP + 1) : resourceName; - - if (_v2 != 3) { - assert(_resIndex.size() == 0); - } - - // Scan for the resource name - for (uint resIndex = 0; resIndex < _resIndex.size(); ++resIndex) { - ResIndexEntry &resEntry = _resIndex[resIndex]; - if (resEntry._resourceName.compareToIgnoreCase(resourceName)) { - foundIndex = resIndex; - break; - } - } - } - - if (foundIndex >= 0) { - // TODO - } - return -1; -} - } // End of namespace MADS diff --git a/engines/mads/menu_views.h b/engines/mads/menu_views.h index c13213c3ed..cc5a13006f 100644 --- a/engines/mads/menu_views.h +++ b/engines/mads/menu_views.h @@ -192,10 +192,6 @@ private: int _animFrameNumber; bool _nextCyclingActive; private: - void checkResource(const Common::String &resourceName); - - int scanResourceIndex(const Common::String &resourceName); - void load(); void processLines(); diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index 0cb4530a84..39824bac4b 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -87,7 +87,6 @@ void MSurface::drawSprite(const Common::Point &pt, SpriteInfo &info, const Commo // rectangle is always 0, 0 assert(clipRect.top == 0 && clipRect.left == 0); - // TODO: Put err* and scaled* into SpriteInfo int errX = info.hotX * info.scaleX % 100; int errY = info.hotY * info.scaleY % 100; int scaledWidth = scaleValue(info.width, info.scaleX, errX); @@ -160,7 +159,6 @@ void MSurface::drawSprite(const Common::Point &pt, SpriteInfo &info, const Commo if (status == kStatusDraw && clipY == 0) { // Draw previously scaled line - // TODO Implement different drawing types (depth, shadow etc.) byte *tempDst = dst; for (int lineX = 0; lineX < scaledWidth; lineX++) { byte pixel = scaledLineBuf[lineX]; @@ -186,8 +184,6 @@ void MSurface::drawSprite(const Common::Point &pt, SpriteInfo &info, const Commo } dst += pitch; heightAmt--; - // TODO depth etc. - //depthAddress += Destination -> Width; errY += 100; if (errY >= 0) diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h index da607d47ee..efa21a2e73 100644 --- a/engines/mads/nebular/game_nebular.h +++ b/engines/mads/nebular/game_nebular.h @@ -133,18 +133,16 @@ public: virtual void synchronize(Common::Serializer &s, bool phase1); }; - +// Section handlers aren't needed in ScummVM implementation class Section1Handler : public SectionHandler { public: Section1Handler(MADSEngine *vm) : SectionHandler(vm) {} - // TODO: Properly implement handler methods virtual void preLoadSection() {} virtual void sectionPtr2() {} virtual void postLoadSection() {} }; -// TODO: Properly implement handler classes typedef Section1Handler Section2Handler; typedef Section1Handler Section3Handler; typedef Section1Handler Section4Handler; -- cgit v1.2.3 From f0bcacc7b3ad9bc5bb88b9b7db8d36977e96fa08 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 18 Oct 2014 20:12:42 +0300 Subject: MADS: Reset screen clip bounds before copying over a new screen This is needed for the in-game menu, where a dialog spawns another one --- engines/mads/dialogs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads') diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp index 5ea8fb115c..5e38f34fc6 100644 --- a/engines/mads/dialogs.cpp +++ b/engines/mads/dialogs.cpp @@ -457,6 +457,7 @@ void FullScreenDialog::display() { _vm->_palette->setLowRange(); _vm->_screen.hLine(0, 20, MADS_SCREEN_WIDTH, 2); _vm->_screen.hLine(0, 179, MADS_SCREEN_WIDTH, 2); + _vm->_screen.resetClipBounds(); _vm->_screen.copyRectToScreen(Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT)); // Restrict the screen to the area between the two lines -- cgit v1.2.3 From ad1aedec7687019b44066bc7695f4d227cee1a5b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 18 Oct 2014 20:19:14 +0300 Subject: MADS: Implement the Rex Cancel button in the game options dialog The current options are now saved when the dialog opens, and are restored to their original values if the user cancels --- engines/mads/nebular/dialogs_nebular.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 1900a12b59..6e0e7821ab 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -1061,6 +1061,14 @@ void OptionsDialog::display() { void OptionsDialog::show() { Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game; + + // Previous options, restored when cancel is selected + bool prevEasyMouse = _vm->_easyMouse; + bool prevInvObjectsAnimated = _vm->_invObjectsAnimated; + bool prevTextWindowStill = _vm->_textWindowStill; + ScreenFade prevScreenFade = _vm->_screenFade; + StoryMode prevStoryMode = game._storyMode; + do { _selectedLine = 0; GameDialog::show(); @@ -1105,10 +1113,15 @@ void OptionsDialog::show() { switch (_selectedLine) { case 8: // Done - // TODO: Copy from temporary config + // New options will be applied break; case 9: // Cancel - // TODO: Ignore all changes to temporary config + // Revert all options from the saved ones + _vm->_easyMouse = prevEasyMouse; + _vm->_invObjectsAnimated = prevInvObjectsAnimated; + _vm->_textWindowStill = prevTextWindowStill; + _vm->_screenFade = prevScreenFade; + game._storyMode = prevStoryMode; break; default: break; -- cgit v1.2.3 From 879890e021028983dda5af3ea83156357ba239a6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 18 Oct 2014 20:46:17 +0300 Subject: MADS: Clear scene sprites and objects when showing a game menu This shows the game menu, albeit with the wrong palette --- engines/mads/nebular/dialogs_nebular.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 6e0e7821ab..f51d046951 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -594,6 +594,9 @@ GameDialog::GameDialog(MADSEngine *vm) : FullScreenDialog(vm) { _vm->_events->waitCursor(); scene.clearVocab(); scene._dynamicHotspots.clear(); + // Clear scene sprites and objects + scene._spriteSlots.reset(); + _vm->_game->_screenObjects.clear(); _vm->_dialogs->_defaultPosition = Common::Point(-1, -1); _menuSpritesIndex = 0; } -- cgit v1.2.3 From e06327e81aee35b9a523122637f79c9d0530c0bc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 18 Oct 2014 18:27:07 -0400 Subject: MADS: Minor clean up of sprite set removal --- engines/mads/sprites.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index 6cb55aaeee..fd73930475 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -404,9 +404,9 @@ void SpriteSets::remove(int idx) { delete (*this)[idx]; (*this)[idx] = nullptr; } else { - while (size() > 0 && (*this)[size() - 1] == nullptr) { + do { remove_at(size() - 1); - } + } while (size() > 0 && (*this)[size() - 1] == nullptr); } if (_assetCount > 0) -- cgit v1.2.3 From c021759ad2f0fdb723f98a62739bdf6d5de9c350 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 22 Oct 2014 20:43:22 -0400 Subject: MADS: Add md5 checks for the asound.00* sound drivers The implementation of the sound driver code relies on the data for each sound being at specific locations in the files, so this ensures that if any language version changes the sound files, we'll know about it --- engines/mads/nebular/sound_nebular.cpp | 28 ++++++++++++++++++++++++++++ engines/mads/nebular/sound_nebular.h | 5 +++++ engines/mads/sound.cpp | 9 +++++++++ 3 files changed, 42 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp index c540eb4382..a6dce74bba 100644 --- a/engines/mads/nebular/sound_nebular.cpp +++ b/engines/mads/nebular/sound_nebular.cpp @@ -24,6 +24,7 @@ #include "audio/decoders/raw.h" #include "common/algorithm.h" #include "common/debug.h" +#include "common/md5.h" #include "common/memstream.h" #include "mads/sound.h" #include "mads/nebular/sound_nebular.h" @@ -218,6 +219,33 @@ ASound::~ASound() { _mixer->stopHandle(_soundHandle); } +void ASound::validate() { + byte digest[16]; + Common::File f; + static const char *const MD5[] = { + "205398468de2c8873b7d4d73d5be8ddc", + "f9b2d944a2fb782b1af5c0ad592306d3", + "7431f8dad77d6ddfc24e6f3c0c4ac7df", + "eb1f3f5a4673d3e73d8ac1818c957cf4", + "f936dd853073fa44f3daac512e91c476", + "3dc139d3e02437a6d9b732072407c366", + "af0edab2934947982e9a405476702e03", + "8cbc25570b50ba41c9b5361cad4fbedc", + "a31e4783e098f633cbb6689adb41dd4f" + }; + + for (int i = 1; i <= 9; ++i) { + Common::String filename = Common::String::format("ASOUND.00%d", i); + if (!f.open(filename)) + error("Could not process - %s", filename.c_str()); + Common::String md5str = Common::computeStreamMD5AsString(f, 8192); + f.close(); + + if (md5str != MD5[i - 1]) + error("Invalid sound file - %s", filename.c_str()); + } +} + void ASound::adlibInit() { write(4, 0x60); write(4, 0x80); diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h index abb6516030..ccfd40ad52 100644 --- a/engines/mads/nebular/sound_nebular.h +++ b/engines/mads/nebular/sound_nebular.h @@ -317,6 +317,11 @@ public: */ virtual ~ASound(); + /** + * Validates the Adlib sound files + */ + static void validate(); + /** * Execute a player command. Most commands represent sounds to play, but some * low number commands also provide control operations. diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp index d0aa770a4d..1652550ba3 100644 --- a/engines/mads/sound.cpp +++ b/engines/mads/sound.cpp @@ -39,6 +39,15 @@ SoundManager::SoundManager(MADSEngine *vm, Audio::Mixer *mixer) { _opl = OPL::Config::create(); _opl->init(11025); + + // Validate sound files + switch (_vm->getGameID()) { + case GType_RexNebular: + Nebular::ASound::validate(); + break; + default: + break; + } } SoundManager::~SoundManager() { -- cgit v1.2.3 From 6fc5092c039e296195709c2274f2a9d4238b6986 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 22 Oct 2014 21:05:47 -0400 Subject: MADS: Remove unused variable --- engines/mads/nebular/sound_nebular.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp index a6dce74bba..0a054440b2 100644 --- a/engines/mads/nebular/sound_nebular.cpp +++ b/engines/mads/nebular/sound_nebular.cpp @@ -220,7 +220,6 @@ ASound::~ASound() { } void ASound::validate() { - byte digest[16]; Common::File f; static const char *const MD5[] = { "205398468de2c8873b7d4d73d5be8ddc", -- cgit v1.2.3 From 01e8286e1c8df605c98f828e5834584c997713b4 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 28 Oct 2014 16:19:26 +0200 Subject: MADS: Remove trailing whitespace --- engines/mads/game.cpp | 2 +- engines/mads/menu_views.cpp | 24 ++++++++++++------------ engines/mads/nebular/dialogs_nebular.cpp | 2 +- engines/mads/nebular/dialogs_nebular.h | 4 ++-- engines/mads/nebular/game_nebular.cpp | 2 +- engines/mads/nebular/menu_nebular.cpp | 16 ++++++++-------- engines/mads/nebular/nebular_scenes6.cpp | 2 +- engines/mads/nebular/nebular_scenes7.cpp | 2 +- engines/mads/nebular/nebular_scenes8.cpp | 2 +- engines/mads/palette.cpp | 4 ++-- engines/mads/scene_data.cpp | 2 +- engines/mads/sequence.cpp | 2 +- 12 files changed, 32 insertions(+), 32 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 63a7e40d1b..94653f9a39 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -556,7 +556,7 @@ void Game::writeSavegameHeader(Common::OutSaveFile *out, MADSSavegameHeader &hea if (!_saveThumb) createThumbnail(); Graphics::saveThumbnail(*out, *_saveThumb); - + _saveThumb->free(); delete _saveThumb; _saveThumb = nullptr; diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index 03afc70c3e..ee4268a650 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -37,7 +37,7 @@ MenuView::MenuView(MADSEngine *vm) : FullScreenDialog(vm) { } void MenuView::show() { - Scene &scene = _vm->_game->_scene; + Scene &scene = _vm->_game->_scene; EventsManager &events = *_vm->_events; _vm->_screenFade = SCREEN_FADE_FAST; @@ -195,7 +195,7 @@ void TextView::processCommand() { paramP = commandStr + 10; resetPalette(); int screenId = getParameter(¶mP); - + SceneInfo *sceneInfo = SceneInfo::init(_vm); sceneInfo->load(screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface); scene._spriteSlots.fullRefresh(); @@ -230,7 +230,7 @@ void TextView::processCommand() { int soundId = getParameter(¶mP); _vm->_sound->command(soundId); - } else if (!strncmp(commandStr, "COLOR", 5) && ((commandStr[5] == '0') || + } else if (!strncmp(commandStr, "COLOR", 5) && ((commandStr[5] == '0') || (commandStr[5] == '1'))) { // Set the text colors int index = commandStr[5] - '0'; @@ -254,7 +254,7 @@ void TextView::processCommand() { sceneInfo->_width = MADS_SCREEN_WIDTH; sceneInfo->_height = MADS_SCENE_HEIGHT; _spareScreens[spareIndex].setSize(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT); - sceneInfo->loadMadsV1Background(screenId, "", SCENEFLAG_TRANSLATE, + sceneInfo->loadMadsV1Background(screenId, "", SCENEFLAG_TRANSLATE, _spareScreens[spareIndex]); delete sceneInfo; @@ -409,7 +409,7 @@ void TextView::doFrame() { Common::copy(srcP, srcP + MADS_SCREEN_WIDTH, destP); } - Common::copy(linesTemp, linesTemp + _pan.y * MADS_SCREEN_WIDTH, + Common::copy(linesTemp, linesTemp + _pan.y * MADS_SCREEN_WIDTH, (byte *)scene._backgroundSurface.getPixels()); delete[] linesTemp; } @@ -429,7 +429,7 @@ void TextView::doFrame() { if (tl._pos.y < 0) { _textLines.remove_at(i); } else { - tl._textDisplayIndex = scene._textDisplay.add(tl._pos.x, tl._pos.y, + tl._textDisplayIndex = scene._textDisplay.add(tl._pos.x, tl._pos.y, 0x605, -1, tl._line, _font); } } @@ -537,7 +537,7 @@ bool AnimationView::onEvent(Common::Event &event) { void AnimationView::doFrame() { Scene &scene = _vm->_game->_scene; - + if (_resourceIndex == -1 || _currentAnimation->freeFlag()) { if (++_resourceIndex == (int)_resources.size()) { scriptDone(); @@ -565,7 +565,7 @@ void AnimationView::loadNextResource() { if (resEntry._bgFlag) palette.resetGamePalette(1, 8); - palette._mainPalette[253 * 3] = palette._mainPalette[253 * 3 + 1] + palette._mainPalette[253 * 3] = palette._mainPalette[253 * 3 + 1] = palette._mainPalette[253 * 3 + 2] = 0xb4; palette.setPalette(&palette._mainPalette[253 * 3], 253, 1); @@ -587,7 +587,7 @@ void AnimationView::loadNextResource() { delete _currentAnimation; _currentAnimation = Animation::init(_vm, &scene); int flags = ANIMFLAG_ANIMVIEW | (resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0); - _currentAnimation->load(scene._backgroundSurface, scene._depthSurface, + _currentAnimation->load(scene._backgroundSurface, scene._depthSurface, resEntry._resourceName, flags, &paletteCycles, _sceneInfo); // Signal for a screen refresh @@ -656,7 +656,7 @@ void AnimationView::processLines() { if (c != '\r' && c != '\0') _currentLine += c; } - + // Process the line while (!_currentLine.empty()) { if (_currentLine.hasPrefix("-")) { @@ -672,7 +672,7 @@ void AnimationView::processLines() { } // Add resource into list along with any set state information - _resources.push_back(ResourceEntry(resName, _sfx, _soundFlag, + _resources.push_back(ResourceEntry(resName, _sfx, _soundFlag, _bgLoadFlag, _showWhiteBars)); // Fx resets between resource entries @@ -753,7 +753,7 @@ int AnimationView::getParameter() { while (!_currentLine.empty()) { char c = _currentLine[0]; - + if (c >= '0' && c <= '9') { _currentLine.deleteChar(0); result = result * 10 + (c - '0'); diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index f51d046951..f5355517bd 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -908,7 +908,7 @@ void GameDialog::refreshText() { } if (!skipFlag) { - _lines[i]._textDisplayIndex = scene._textDisplay.add(_lines[i]._pos.x, _lines[i]._pos.y, + _lines[i]._textDisplayIndex = scene._textDisplay.add(_lines[i]._pos.x, _lines[i]._pos.y, fontColor, _lines[i]._widthAdjust, _lines[i]._msg, _lines[i]._font); } } diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h index d00cd87ead..5dbe4da6f0 100644 --- a/engines/mads/nebular/dialogs_nebular.h +++ b/engines/mads/nebular/dialogs_nebular.h @@ -116,7 +116,7 @@ class GameDialog: public FullScreenDialog { Common::String _msg; Font *_font; int _widthAdjust; - + DialogLine(); DialogLine(const Common::String &s); }; @@ -130,7 +130,7 @@ protected: int _menuSpritesIndex; int _lineIndex; int _textLineCount; - + /** * Display the dialog */ diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index eae74d6da0..fd669bc5cf 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -625,7 +625,7 @@ void GameNebular::doObjectAction() { _objects.addToInventory(OBJ_DURAFAIL_CELLS); if (_difficulty == DIFFICULTY_HARD) { dialogs.showItem(OBJ_DURAFAIL_CELLS, 416); - } + } _globals[kHandsetCellStatus] = 0; break; case 3: diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index f2f90e2291..28de4e5650 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -48,7 +48,7 @@ MainMenu::MainMenu(MADSEngine *vm): MenuView(vm) { _highlightedIndex = -1; _selectedIndex = -1; _buttonDown = false; - + for (int i = 0; i < 7; ++i) _menuItems[i] = nullptr; } @@ -85,7 +85,7 @@ void MainMenu::display() { Common::Point pt(frame0->_offset.x - (frame0->w / 2), frame0->_offset.y - frame0->h); screenObjects.add( - Common::Rect(pt.x, pt.y + DIALOG_TOP, pt.x + frame0->w, + Common::Rect(pt.x, pt.y + DIALOG_TOP, pt.x + frame0->w, pt.y + frame0->h + DIALOG_TOP), LAYER_GUI, CAT_COMMAND, i); } @@ -126,7 +126,7 @@ void MainMenu::doFrame() { // If the user has chosen to skip the animation, show the full menu immediately if (_skipFlag && _menuItemIndex >= 0) { - // Quickly loop through all the menu items to display each's final frame + // Quickly loop through all the menu items to display each's final frame for (; _menuItemIndex < 6; ++_menuItemIndex) { if (_menuItemIndex == 4 && !shouldShowQuotes()) continue; @@ -161,7 +161,7 @@ void MainMenu::doFrame() { void MainMenu::addSpriteSlot() { Scene &scene = _vm->_game->_scene; SpriteSlots &spriteSlots = scene._spriteSlots; - + int seqIndex = (_menuItemIndex < 6) ? _menuItemIndex : _frameIndex; spriteSlots.deleteTimer(seqIndex); @@ -255,7 +255,7 @@ bool MainMenu::onEvent(Common::Event &event) { } return true; - case Common::EVENT_MOUSEMOVE: + case Common::EVENT_MOUSEMOVE: if (_buttonDown) { int menuIndex = getHighlightedItem(event.mouse); if (menuIndex != _highlightedIndex) { @@ -287,7 +287,7 @@ bool MainMenu::onEvent(Common::Event &event) { default: break; } - + return false; } @@ -317,7 +317,7 @@ void MainMenu::handleAction(MADSGameAction action) { break; case RESUME_GAME: - // The original resumed the most recently saved game. Instead, + // The original resumed the most recently saved game. Instead, // just show the load game scren _vm->_dialogs->_pendingDialog = DIALOG_RESTORE; return; @@ -354,7 +354,7 @@ void AdvertView::show() { uint32 expiryTime = g_system->getMillis() + 10 * 1000; _vm->_palette->resetGamePalette(4, 8); - + // Load the advert background onto the screen SceneInfo *sceneInfo = SceneInfo::init(_vm); sceneInfo->load(screenId, 0, Common::String(), 0, _vm->_game->_scene._depthSurface, diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 13ee1a3dc1..679039535f 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -3155,7 +3155,7 @@ bool Scene611::check2ChargedBatteries() { } bool Scene611::check4ChargedBatteries() { - if (_game._objects.isInInventory(OBJ_DURAFAIL_CELLS) && _game._objects.isInInventory(OBJ_PHONE_CELLS) + if (_game._objects.isInInventory(OBJ_DURAFAIL_CELLS) && _game._objects.isInInventory(OBJ_PHONE_CELLS) && _globals[kDurafailRecharged]) return true; diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 930bb7c250..0f019c4b19 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -2616,7 +2616,7 @@ void Scene752::actions() { default: break; } - } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && (_action._savedFields._mainObjectSource == CAT_HOTSPOT) && + } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && (_action._savedFields._mainObjectSource == CAT_HOTSPOT) && (!_game._objects.isInInventory(OBJ_BONES) || _game._trigger)) { switch (_game._trigger) { case 0: diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 14f36756de..62a1a262b0 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -1098,7 +1098,7 @@ void Scene804::actions() { _action.isAction(VERB_OPEN, NOUN_SERVICE_PANEL)) { _scene->_nextSceneId = 805; } else if ((_action.isAction(VERB_ACTIVATE, NOUN_REMOTE)) && _globals[kTopButtonPushed]) { - if (!_globals[kInSpace]) { + if (!_globals[kInSpace]) { // Top button pressed on panel in hanger control if (!_globals[kBeamIsUp]) { _globals[kFromCockpit] = true; diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 1787b3c298..836d04f7c0 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -233,7 +233,7 @@ int PaletteUsage::process(Common::Array &palette, uint flags) { // CHECKME: When pressing on F1 in the first screen, newPalIndex is set to 0xFF at this point // which is a valid value for the index. Maybe a better check would be "< 256" ? //assert(newPalIndex != -1); - + int var52 = (noUsageFlag && palette[palIndex]._u2) ? 2 : 0; _vm->_palette->_palFlags[newPalIndex] |= var52 | rgbMask; @@ -342,7 +342,7 @@ int PaletteUsage::checkRGB(const byte *rgb, int palStart, bool flag, int *palInd if ((!(*flagsP & 1) || flag) && !(*flagsP & 2)) { if (!memcmp(palP, rgb, 3)) { *flagsP |= mask; - + if (palIndex) *palIndex = result; match = true; diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index b0a5aa35c6..b5e219ed04 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -264,7 +264,7 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName, assert(asset && _depthStyle != 2); MSprite *spr = asset->getFrame(asset->getCount() - 1); - bgSurface.copyFrom(spr, si._position, si._depth, &depthSurface, + bgSurface.copyFrom(spr, si._position, si._depth, &depthSurface, si._scale, spr->getTransparencyIndex()); } diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp index 07b1451718..05f00afb5a 100644 --- a/engines/mads/sequence.cpp +++ b/engines/mads/sequence.cpp @@ -473,7 +473,7 @@ int SequenceList::startReverseCycle(int srcSpriteIndex, bool flipped, int numTic int depth = _vm->_game->_scene._depthSurface.getDepth(Common::Point( frame->_offset.x + frame->w / 2, frame->_offset.y + frame->h / 2)); - return add(srcSpriteIndex, flipped, sprites->getCount(), triggerCountdown, timeoutTicks, + return add(srcSpriteIndex, flipped, sprites->getCount(), triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, true, 100, depth - 1, -1, ANIMTYPE_REVERSIBLE, 0, 0); } -- cgit v1.2.3 From 815851e959bb46b2b9fd0de7ff9d04c9097d6908 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 7 Dec 2014 15:39:11 +0200 Subject: MADS: Remove unused reference to MADSEngine Thanks to fingolfin for finding out the unused reference --- engines/mads/msurface.h | 4 +--- engines/mads/scene.cpp | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/msurface.h b/engines/mads/msurface.h index ebfb1f437a..650d7fdaee 100644 --- a/engines/mads/msurface.h +++ b/engines/mads/msurface.h @@ -223,8 +223,6 @@ public: }; class DepthSurface : public MSurface { -private: - MADSEngine *_vm; public: /** * Depth style @@ -234,7 +232,7 @@ public: /** * Constructor */ - DepthSurface(MADSEngine *vm) : _vm(vm), _depthStyle(0) {} + DepthSurface() : _depthStyle(0) {} /** * Returns the depth at a given position diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 18ceb3c813..d2b4b29622 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -31,7 +31,7 @@ namespace MADS { Scene::Scene(MADSEngine *vm) - : _vm(vm), _action(_vm), _depthSurface(vm), + : _vm(vm), _action(_vm), _depthSurface(), _dirtyAreas(_vm), _dynamicHotspots(vm), _hotspots(vm), _kernelMessages(vm), _sequences(vm), _sprites(vm), _spriteSlots(vm), _textDisplay(vm), _userInterface(vm) { @@ -182,7 +182,7 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) { flags |= ANIMFLAG_LOAD_BACKGROUND_ONLY; _animationData = Animation::init(_vm, this); - DepthSurface depthSurface(_vm); + DepthSurface depthSurface; _animationData->load(_userInterface, depthSurface, prefix, flags, nullptr, nullptr); _vm->_palette->_paletteUsage.load(&_scenePaletteUsage); @@ -611,7 +611,7 @@ void Scene::loadAnimation(const Common::String &resName, int trigger) { if (_activeAnimation) freeAnimation(); - DepthSurface depthSurface(_vm); + DepthSurface depthSurface; UserInterface interfaceSurface(_vm); _activeAnimation = Animation::init(_vm, this); -- cgit v1.2.3 From 9c25e2eea0e257de67c8d8f8cbd3e114585ed72b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 17 Jan 2015 10:57:51 -0500 Subject: MADS: Fix crash on exit after watching introduction twice --- engines/mads/sound.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp index 1652550ba3..fbf217ba0c 100644 --- a/engines/mads/sound.cpp +++ b/engines/mads/sound.cpp @@ -62,6 +62,9 @@ SoundManager::~SoundManager() { void SoundManager::init(int sectionNumber) { assert(sectionNumber > 0 && sectionNumber < 10); + if (_driver != nullptr) + delete _driver; + switch (_vm->getGameID()) { case GType_RexNebular: switch (sectionNumber) { -- cgit v1.2.3 From ccd0c63a7b91031c8a172a60634506a3c810554b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 17 Jan 2015 12:23:41 -0500 Subject: MADS: Implement background scrolling in anim views --- engines/mads/animation.cpp | 2 +- engines/mads/menu_views.cpp | 25 +++++++++++++++++++++++++ engines/mads/menu_views.h | 3 +++ 3 files changed, 29 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index 2b999fa305..469d42cc1b 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -41,7 +41,7 @@ void AAHeader::load(Common::SeekableReadStream *f) { _spritesIndex = f->readUint16LE(); _scrollPosition.x = f->readSint16LE(); _scrollPosition.y = f->readSint16LE(); - _scrollTicks = f->readUint32LE(); + _scrollTicks = f->readUint32LE() & 0xffff; f->skip(6); char buffer[FILENAME_SIZE]; diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index ee4268a650..b492d98125 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -484,6 +484,7 @@ AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) { _animFrameNumber = 0; _nextCyclingActive = false; _sceneInfo = SceneInfo::init(_vm); + _scrollFrameCtr = 0; load(); } @@ -549,6 +550,11 @@ void AnimationView::doFrame() { scene._cyclingActive = _nextCyclingActive; } + if (++_scrollFrameCtr >= _currentAnimation->_header._scrollTicks) { + _scrollFrameCtr = 0; + scroll(); + } + if (_currentAnimation) { ++scene._frameStartTime; _currentAnimation->update(); @@ -636,6 +642,21 @@ void AnimationView::loadNextResource() { scene.initPaletteAnimation(paletteCycles, _nextCyclingActive && !_vm->_game->_fx); } +void AnimationView::scroll() { + Scene &scene = _vm->_game->_scene; + Common::Point pt = _currentAnimation->_header._scrollPosition; + + if (pt.x != 0) { + scene._backgroundSurface.scrollX(pt.x); + scene._spriteSlots.fullRefresh(); + } + + if (pt.y != 0) { + scene._backgroundSurface.scrollY(pt.y); + scene._spriteSlots.fullRefresh(); + } +} + void AnimationView::scriptDone() { _breakFlag = true; _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; @@ -657,6 +678,10 @@ void AnimationView::processLines() { _currentLine += c; } + // Check for comment line + if (_currentLine.hasPrefix("#")) + continue; + // Process the line while (!_currentLine.empty()) { if (_currentLine.hasPrefix("-")) { diff --git a/engines/mads/menu_views.h b/engines/mads/menu_views.h index cc5a13006f..871c0d1d37 100644 --- a/engines/mads/menu_views.h +++ b/engines/mads/menu_views.h @@ -191,6 +191,7 @@ private: int _manualFrame2; int _animFrameNumber; bool _nextCyclingActive; + int _scrollFrameCtr; private: void load(); @@ -201,6 +202,8 @@ private: int getParameter(); void loadNextResource(); + + void scroll(); protected: virtual void display(); -- cgit v1.2.3 From 4ee29ef3a84186b79e00e3f50d3fb15e4c13d213 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 17 Jan 2015 16:46:57 -0500 Subject: MADS: Add loading of SpriteInfo frame numbers for scene background sprites --- engines/mads/scene_data.cpp | 5 +++-- engines/mads/scene_data.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index b5e219ed04..7233e42456 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -86,7 +86,8 @@ void ARTHeader::load(Common::SeekableReadStream *f, bool isV2) { void SceneInfo::SpriteInfo::load(Common::SeekableReadStream *f) { f->skip(3); _spriteSetIndex = f->readByte(); - f->skip(2); + _frameNumber = f->readSByte(); + f->skip(1); _position.x = f->readSint16LE(); _position.y = f->readSint16LE(); _depth = f->readByte(); @@ -263,7 +264,7 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName, SpriteAsset *asset = spriteSets[si._spriteSetIndex]; assert(asset && _depthStyle != 2); - MSprite *spr = asset->getFrame(asset->getCount() - 1); + MSprite *spr = asset->getFrame(si._frameNumber); bgSurface.copyFrom(spr, si._position, si._depth, &depthSurface, si._scale, spr->getTransparencyIndex()); } diff --git a/engines/mads/scene_data.h b/engines/mads/scene_data.h index 41e094b8f5..41a08f74eb 100644 --- a/engines/mads/scene_data.h +++ b/engines/mads/scene_data.h @@ -144,6 +144,7 @@ class SceneInfo { public: int _spriteSetIndex; Common::Point _position; + int _frameNumber; int _depth; int _scale; -- cgit v1.2.3 From 9b8fa20c7610567475c5b41678d41fa618adc49e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 17 Jan 2015 17:29:08 -0500 Subject: MADS: Fix horizontal flipping of scene background sprites --- engines/mads/scene_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index 7233e42456..d0e96be1d7 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -266,7 +266,7 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName, MSprite *spr = asset->getFrame(si._frameNumber); bgSurface.copyFrom(spr, si._position, si._depth, &depthSurface, - si._scale, spr->getTransparencyIndex()); + si._scale, false, spr->getTransparencyIndex()); } // Free the sprite sets -- cgit v1.2.3 From 926404bd10309e98d353acd5515c678234de28aa Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 17 Jan 2015 20:51:52 -0500 Subject: MADS: Renamings of Layer and a transition type --- engines/mads/dialogs.cpp | 2 +- engines/mads/game.cpp | 4 ++-- engines/mads/hotspots.cpp | 2 +- engines/mads/nebular/dialogs_nebular.cpp | 8 ++++---- engines/mads/nebular/menu_nebular.cpp | 4 ++-- engines/mads/scene.cpp | 2 +- engines/mads/scene.h | 2 +- engines/mads/screen.cpp | 20 ++++++++++---------- engines/mads/screen.h | 10 +++++----- engines/mads/user_interface.cpp | 14 +++++++------- 10 files changed, 34 insertions(+), 34 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp index 5e38f34fc6..c02f027302 100644 --- a/engines/mads/dialogs.cpp +++ b/engines/mads/dialogs.cpp @@ -449,7 +449,7 @@ void FullScreenDialog::display() { } // Set Fx state and palette entries - game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kCenterVertTransition; + game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kNullPaletteCopy; game._trigger = 0; // Clear the screen and draw the upper and lower horizontal lines diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 94653f9a39..0ce24daf7a 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -240,7 +240,7 @@ void Game::sectionLoop() { _fx = kTransitionFadeOutIn; break; case SCREEN_FADE_FAST: - _fx = kCenterVertTransition; + _fx = kNullPaletteCopy; break; default: _fx = kTransitionNone; @@ -324,7 +324,7 @@ void Game::initSection(int sectionNumber) { _vm->_palette->resetGamePalette(18, 10); _vm->_palette->setLowRange(); - if (_scene._layer == LAYER_GUI) + if (_scene._mode == SCREENMODE_VGA) _vm->_palette->setPalette(_vm->_palette->_mainPalette, 0, 4); _vm->_events->loadCursors("*CURSOR.SS"); diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp index d75d7ae13e..2af421a112 100644 --- a/engines/mads/hotspots.cpp +++ b/engines/mads/hotspots.cpp @@ -137,7 +137,7 @@ void DynamicHotspots::refresh() { switch (scrObjects._inputMode) { case kInputBuildingSentences: case kInputLimitedSentences: - scrObjects.add(dh._bounds, _vm->_game->_scene._layer, CAT_12, dh._descId); + scrObjects.add(dh._bounds, _vm->_game->_scene._mode, CAT_12, dh._descId); scrObjects._forceRescan = true; break; default: diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index f5355517bd..74da378128 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -643,14 +643,14 @@ void GameDialog::setClickableLines() { int maxHeight = _lines[idx]._font->getHeight(); screenObjects.add(Common::Rect(pt.x, pt.y, pt.x + strWidth, pt.y + maxHeight - 1), - LAYER_GUI, CAT_COMMAND, idx); + SCREENMODE_VGA, CAT_COMMAND, idx); } } if (_vm->_dialogs->_pendingDialog == DIALOG_SAVE || _vm->_dialogs->_pendingDialog == DIALOG_RESTORE) { - screenObjects.add(Common::Rect(293, 26, 312, 75), LAYER_GUI, CAT_INV_LIST, 50); - screenObjects.add(Common::Rect(293, 78, 312, 127), LAYER_GUI, CAT_INV_LIST, 51); + screenObjects.add(Common::Rect(293, 26, 312, 75), SCREENMODE_VGA, CAT_INV_LIST, 50); + screenObjects.add(Common::Rect(293, 78, 312, 127), SCREENMODE_VGA, CAT_INV_LIST, 51); } } @@ -825,7 +825,7 @@ void GameDialog::handleEvents() { // Scan for objects in the dialog Common::Point mousePos = events.currentPos() - Common::Point(0, DIALOG_TOP); - int objIndex = screenObjects.scan(mousePos, LAYER_GUI); + int objIndex = screenObjects.scan(mousePos, SCREENMODE_VGA); if (_movedFlag) { int yp = mousePos.y; diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 28de4e5650..2fdef3443d 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -86,7 +86,7 @@ void MainMenu::display() { frame0->_offset.y - frame0->h); screenObjects.add( Common::Rect(pt.x, pt.y + DIALOG_TOP, pt.x + frame0->w, - pt.y + frame0->h + DIALOG_TOP), LAYER_GUI, CAT_COMMAND, i); + pt.y + frame0->h + DIALOG_TOP), SCREENMODE_VGA, CAT_COMMAND, i); } // Set the cursor for when it's shown @@ -292,7 +292,7 @@ bool MainMenu::onEvent(Common::Event &event) { } int MainMenu::getHighlightedItem(const Common::Point &pt) { - return _vm->_game->_screenObjects.scan(pt, LAYER_GUI) - 1; + return _vm->_game->_screenObjects.scan(pt, SCREENMODE_VGA) - 1; } void MainMenu::unhighlightItem() { diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index d2b4b29622..ea3fe2c148 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -52,7 +52,7 @@ Scene::Scene(MADSEngine *vm) _activeAnimation = nullptr; _textSpacing = -1; _frameStartTime = 0; - _layer = LAYER_GUI; + _mode = SCREENMODE_VGA; _lookFlag = false; _bandsRange = 0; _scaleRange = 0; diff --git a/engines/mads/scene.h b/engines/mads/scene.h index 9fd99ad8e5..05053c3166 100644 --- a/engines/mads/scene.h +++ b/engines/mads/scene.h @@ -121,7 +121,7 @@ public: bool _reloadSceneFlag; Common::Point _posAdjust; uint32 _frameStartTime; - Layer _layer; + ScreenMode _mode; bool _lookFlag; Common::Point _customDest; Common::Array _paletteUsageF; diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index c9a0863d85..8552effd98 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -244,7 +244,7 @@ void DirtyAreas::reset() { ScreenObject::ScreenObject() { _category = CAT_NONE; _descId = 0; - _layer = 0; + _mode = 0; _active = false; } @@ -265,14 +265,12 @@ ScreenObjects::ScreenObjects(MADSEngine *vm) : _vm(vm) { _baseTime = 0; } -void ScreenObjects::add(const Common::Rect &bounds, Layer layer, ScrCategory category, int descId) { - //assert(size() < 100); - +void ScreenObjects::add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId) { ScreenObject so; so._bounds = bounds; so._category = category; so._descId = descId; - so._layer = layer; + so._mode = mode; so._active = true; push_back(so); @@ -288,7 +286,7 @@ void ScreenObjects::check(bool scanFlag) { if ((_vm->_events->_mouseMoved || userInterface._scrollbarActive || _v8332A || _forceRescan) && scanFlag) { _category = CAT_NONE; - _selectedObject = scanBackwards(_vm->_events->currentPos(), LAYER_GUI); + _selectedObject = scanBackwards(_vm->_events->currentPos(), SCREENMODE_VGA); if (_selectedObject > 0) { ScreenObject &scrObject = (*this)[_selectedObject]; _category = (ScrCategory)(scrObject._category & 7); @@ -365,7 +363,7 @@ void ScreenObjects::check(bool scanFlag) { int ScreenObjects::scan(const Common::Point &pt, int layer) { for (uint i = 1; i <= size(); ++i) { ScreenObject &sObj = (*this)[i]; - if (sObj._active && sObj._bounds.contains(pt) && sObj._layer == layer) + if (sObj._active && sObj._bounds.contains(pt) && sObj._mode == layer) return i; } @@ -376,7 +374,7 @@ int ScreenObjects::scan(const Common::Point &pt, int layer) { int ScreenObjects::scanBackwards(const Common::Point &pt, int layer) { for (int i = (int)size(); i >= 1; --i) { ScreenObject &sObj = (*this)[i]; - if (sObj._active && sObj._bounds.contains(pt) && sObj._layer == layer) + if (sObj._active && sObj._bounds.contains(pt) && sObj._mode == layer) return i; } @@ -653,8 +651,10 @@ void ScreenSurface::transition(ScreenTransition transitionType, bool surfaceFlag transition(kTransitionFadeIn, surfaceFlag); break; - case kCenterVertTransition: - warning("TODO: center vert transition"); + case kNullPaletteCopy: + // Original temporarily set the palette to black, copied the scene to the + // screen, and then restored the palette. We can give a similiar effect + // by doing a standard quick palette fade in transition(kTransitionFadeIn, surfaceFlag); break; diff --git a/engines/mads/screen.h b/engines/mads/screen.h index 9d01ca82e3..6800523f92 100644 --- a/engines/mads/screen.h +++ b/engines/mads/screen.h @@ -33,8 +33,8 @@ namespace MADS { #define MADS_SCREEN_WIDTH 320 #define MADS_SCREEN_HEIGHT 200 -enum Layer { - LAYER_GUI = 19 +enum ScreenMode { + SCREENMODE_VGA = 19 }; enum ScreenTransition { @@ -47,7 +47,7 @@ enum ScreenTransition { kTransitionCircleIn3, kTransitionCircleIn4, kVertTransition1, kVertTransition2, kVertTransition3, kVertTransition4, kVertTransition5, kVertTransition6, - kVertTransition7, kCenterVertTransition + kVertTransition7, kNullPaletteCopy }; enum InputMode { @@ -130,7 +130,7 @@ public: Common::Rect _bounds; ScrCategory _category; int _descId; - int _layer; + int _mode; ScreenObject(); }; @@ -162,7 +162,7 @@ public: /** * Add a new item to the list */ - void add(const Common::Rect &bounds, Layer layer, ScrCategory category, int descId); + void add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId); /** * Check objects on the screen diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 1f8d5037bc..822460d549 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -673,7 +673,7 @@ void UserInterface::loadElements() { getBounds(CAT_INV_SCROLLER, idx, bounds); moveRect(bounds); - _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_INV_SCROLLER, idx); + _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_INV_SCROLLER, idx); } // Set up actions @@ -682,7 +682,7 @@ void UserInterface::loadElements() { getBounds(CAT_COMMAND, idx, bounds); moveRect(bounds); - _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_COMMAND, idx); + _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_COMMAND, idx); } // Set up inventory list @@ -691,7 +691,7 @@ void UserInterface::loadElements() { getBounds(CAT_INV_LIST, _inventoryTopIndex + idx, bounds); moveRect(bounds); - _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_INV_LIST, idx); + _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_INV_LIST, idx); } // Set up the inventory vocab list @@ -700,12 +700,12 @@ void UserInterface::loadElements() { getBounds(CAT_INV_VOCAB, idx, bounds); moveRect(bounds); - _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_INV_VOCAB, idx); + _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_INV_VOCAB, idx); } // Set up the inventory item picture _categoryIndexes[CAT_INV_ANIM - 1] = _vm->_game->_screenObjects.size() + 1; - _vm->_game->_screenObjects.add(Common::Rect(160, 159, 231, 194), LAYER_GUI, + _vm->_game->_screenObjects.add(Common::Rect(160, 159, 231, 194), SCREENMODE_VGA, CAT_INV_ANIM, 0); } @@ -714,7 +714,7 @@ void UserInterface::loadElements() { _categoryIndexes[CAT_HOTSPOT - 1] = _vm->_game->_screenObjects.size() + 1; for (int hotspotIdx = scene._hotspots.size() - 1; hotspotIdx >= 0; --hotspotIdx) { Hotspot &hs = scene._hotspots[hotspotIdx]; - _vm->_game->_screenObjects.add(hs._bounds, LAYER_GUI, CAT_HOTSPOT, hotspotIdx); + _vm->_game->_screenObjects.add(hs._bounds, SCREENMODE_VGA, CAT_HOTSPOT, hotspotIdx); } } @@ -725,7 +725,7 @@ void UserInterface::loadElements() { getBounds(CAT_TALK_ENTRY, idx, bounds); moveRect(bounds); - _vm->_game->_screenObjects.add(bounds, LAYER_GUI, CAT_TALK_ENTRY, idx); + _vm->_game->_screenObjects.add(bounds, SCREENMODE_VGA, CAT_TALK_ENTRY, idx); } } -- cgit v1.2.3 From dfe04491c1d8ecb45f4952af96c9d73e9e654a32 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 21 Jan 2015 01:29:22 +0100 Subject: JANITORIAL: Remove unnecessary semicolons --- engines/mads/nebular/game_nebular.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index fd669bc5cf..8c0c00428a 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -810,7 +810,7 @@ void GameNebular::step() { (_player._facing == _player._turnToFacing)) { if (_scene._frameStartTime >= *((uint32 *)&_globals[kWalkerTiming])) { if (!_player._stopWalkerIndex) { - int randomVal = _vm->getRandomNumber(29999);; + int randomVal = _vm->getRandomNumber(29999); if (_globals[kSexOfRex] == REX_MALE) { switch (_player._facing) { case FACING_SOUTHWEST: -- cgit v1.2.3 From c0b2d47f383984d7f36743b9b8b51fd23e34632a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 31 Jan 2015 12:10:55 +0100 Subject: MADS: Add safeguards in DialogsNebular::show --- engines/mads/nebular/dialogs_nebular.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 74da378128..b3d3e0687d 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -91,6 +91,8 @@ bool DialogsNebular::show(int messageId, int objectId) { dialog->incNumLines(); } } else if (commandCheck("ASK", valStr, commandText)) { + if (!dialog) + error("DialogsNebular::show - Uninitialized dialog"); dialog->addInput(); } else if (commandCheck("VERB", valStr, commandText)) { dialogText += getVocab(action._activeAction._verbId); @@ -114,12 +116,18 @@ bool DialogsNebular::show(int messageId, int objectId) { } else if (commandCheck("WIDTH", valStr, commandText)) { _dialogWidth = atoi(valStr.c_str()); } else if (commandCheck("BAR", valStr, commandText)) { + if (!dialog) + error("DialogsNebular::show - Uninitialized dialog"); dialog->addBarLine(); } else if (commandCheck("UNDER", valStr, commandText)) { underlineFlag = true; } else if (commandCheck("DOWN", valStr, commandText)) { + if (!dialog) + error("DialogsNebular::show - Uninitialized dialog"); dialog->downPixelLine(); } else if (commandCheck("TAB", valStr, commandText)) { + if (!dialog) + error("DialogsNebular::show - Uninitialized dialog"); int xp = atoi(valStr.c_str()); dialog->setLineXp(xp); } @@ -164,6 +172,9 @@ bool DialogsNebular::show(int messageId, int objectId) { if (!centerFlag) dialog->incNumLines(); + if (!dialog) + error("DialogsNebular::show - Uninitialized dialog"); + // Show the dialog _vm->_events->setCursor(CURSOR_ARROW); dialog->show(); -- cgit v1.2.3 From 15a10d27449d039dc01a712f2ad4bb93f062db01 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 31 Jan 2015 12:41:03 +0100 Subject: MADS: Remove a useless variable --- engines/mads/events.cpp | 3 +-- engines/mads/events.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index de4dc3c070..e7ec8b0821 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -44,7 +44,6 @@ EventsManager::EventsManager(MADSEngine *vm) { _vD2 = 0; _mouseStatusCopy = 0; _mouseMoved = false; - _vD8 = 0; _rightMousePressed = false; _eventTarget = nullptr; } @@ -261,7 +260,7 @@ void EventsManager::waitForNextFrame() { void EventsManager::initVars() { _mousePos = Common::Point(-1, -1); _mouseStatusCopy = _mouseStatus; - _vD2 = _vD8 = 0; + _vD2 = 0; } } // End of namespace MADS diff --git a/engines/mads/events.h b/engines/mads/events.h index 54df337efd..870d6e03b8 100644 --- a/engines/mads/events.h +++ b/engines/mads/events.h @@ -70,7 +70,6 @@ public: int _vD2; int _mouseStatusCopy; bool _mouseMoved; - int _vD8; Common::Stack _pendingKeys; public: /** -- cgit v1.2.3 From 1c8ecb41bde0bdaba132af3c6fc768813de6d26f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 31 Jan 2015 12:41:46 +0100 Subject: MADS: Fix signed/unsigned comparison warning --- engines/mads/menu_views.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/menu_views.h b/engines/mads/menu_views.h index 871c0d1d37..f39ea4c3b5 100644 --- a/engines/mads/menu_views.h +++ b/engines/mads/menu_views.h @@ -191,7 +191,7 @@ private: int _manualFrame2; int _animFrameNumber; bool _nextCyclingActive; - int _scrollFrameCtr; + uint _scrollFrameCtr; private: void load(); -- cgit v1.2.3 From 772cbc122d4cbfc06021facaa687921a138b98ab Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 31 Jan 2015 12:42:36 +0100 Subject: MADS: Fix a bug in PaletteUsage::process, some renaming --- engines/mads/palette.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 836d04f7c0..95de307f8e 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -178,31 +178,29 @@ int PaletteUsage::process(Common::Array &palette, uint flags) { } if (!changed && !noUsageFlag) { - int var2 = (palette[palIndex]._flags & 0x20) || - (((flags & 0x2000) || (palette[palIndex]._flags & 0x4000)) && + int bestHash = (palette[palIndex]._flags & 0x20) || + (((flags & 0x2000) || (palette[palIndex]._flags & 0x40)) && ((flags & 0x1000) || (palCount == 0))) ? 0x7fff : 1; int var36 = (palette[palIndex]._flags & 0x80) ? 0 : 2; for (int idx = palLow; idx < palIdx; ++idx) { uint32 v = _vm->_palette->_palFlags[idx]; if ((v & var3A) && !(v & var36)) { - int var10; - - if (var2 > 1) { - var10 = rgbFactor(&_vm->_palette->_mainPalette[idx * 3], palette[palIndex]); - } - else if (_vm->_palette->_mainPalette[idx * 3] != palette[palIndex].r || + int hash; + if (bestHash > 1) { + hash = rgbFactor(&_vm->_palette->_mainPalette[idx * 3], palette[palIndex]); + } else if (_vm->_palette->_mainPalette[idx * 3] != palette[palIndex].r || _vm->_palette->_mainPalette[idx * 3 + 1] != palette[palIndex].g || _vm->_palette->_mainPalette[idx * 3 + 2] != palette[palIndex].b) { - var10 = 1; + hash = 1; } else { - var10 = 0; + hash = 0; } - if (var2 > var10) { + if (bestHash > hash) { changed = true; newPalIndex = idx; - var2 = var10; + bestHash = hash; } } } -- cgit v1.2.3 From 0fcd78391b584cee9ca6435d9ee5e88c339aa0cc Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 31 Jan 2015 12:53:35 +0100 Subject: MADS: Add a safeguard in doFrame --- engines/mads/menu_views.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index b492d98125..8f1fd2d7a5 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -550,7 +550,7 @@ void AnimationView::doFrame() { scene._cyclingActive = _nextCyclingActive; } - if (++_scrollFrameCtr >= _currentAnimation->_header._scrollTicks) { + if (_currentAnimation && (++_scrollFrameCtr >= _currentAnimation->_header._scrollTicks)) { _scrollFrameCtr = 0; scroll(); } -- cgit v1.2.3 From 35c17d50663eeeecec5d14744149ac6004135a93 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 31 Jan 2015 13:01:23 +0100 Subject: MADS: Janitorial - fix some else statements with braces on separate lines or extra tabs --- engines/mads/action.cpp | 3 +-- engines/mads/nebular/dialogs_nebular.cpp | 3 +-- engines/mads/nebular/game_nebular.cpp | 2 +- engines/mads/nebular/nebular_scenes8.cpp | 3 +-- engines/mads/palette.cpp | 10 +++------- engines/mads/sequence.cpp | 3 +-- 6 files changed, 8 insertions(+), 16 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp index 199ae39000..628f03526f 100644 --- a/engines/mads/action.cpp +++ b/engines/mads/action.cpp @@ -567,9 +567,8 @@ void MADSAction::leftClick() { switch (userInterface._category) { case CAT_COMMAND: if (_selectedRow >= 0) { - if (_verbType == VERB_ONLY) { + if (_verbType == VERB_ONLY) _selectedAction = -1; - } else { _recentCommand = _selectedRow; _recentCommandSource = _commandSource; diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index b3d3e0687d..05c2e4ba96 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -387,8 +387,7 @@ TextDialog(vm, FONT_INTERFACE, Common::Point(-1, -1), 32) { addLine("ANSWER INCORRECT!", true); wordWrap("\n"); addLine("(But we'll give you another chance!)"); - } - else { + } else { addLine("REX NEBULAR version 8.43", true); wordWrap("\n"); addLine("(Copy Protection, for your convenience)"); diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 8c0c00428a..965ef7fad2 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -454,7 +454,7 @@ void GameNebular::doObjectAction() { dialogs.show(464); } else if (action.isAction(VERB_REFLECT)) { dialogs.show(466); - } else if (action.isAction(VERB_GAZE_INTO, NOUN_REARVIEW_MIRROR)) { + } else if (action.isAction(VERB_GAZE_INTO, NOUN_REARVIEW_MIRROR)) { dialogs.show(467); } else if (action.isAction(VERB_EAT, NOUN_CHICKEN_BOMB)) { dialogs.show(469); diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 62a1a262b0..7e8366c179 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -1129,8 +1129,7 @@ void Scene804::actions() { } else { _messWithThrottle = true; } - } - else if (_action.isAction(VERB_APPLY, NOUN_POLYCEMENT, NOUN_CRACK) || + } else if (_action.isAction(VERB_APPLY, NOUN_POLYCEMENT, NOUN_CRACK) || _action.isAction(VERB_PUT, NOUN_POLYCEMENT, NOUN_CRACK)) { if (!_globals[kWindowFixed]) { _resetFrame = 2; diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 95de307f8e..250eb75955 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -503,16 +503,12 @@ void Fader::fadeIn(byte palette[PALETTE_SIZE], byte destPalette[PALETTE_SIZE], for (int colorCtr = 0; colorCtr < 3; ++colorCtr) { if (_colorFlags[colorCtr]) { int shiftSign = _colorValues[colorCtr]; - if (shiftSign >= 0) { + if (shiftSign >= 0) intensity = map[index]._intensity << shiftSign; - } - else { + else intensity = map[index]._intensity >> abs(shiftSign); - } - } - else { + } else intensity = _colorValues[colorCtr]; - } int diff = _rgb64Map[destPalette[palCtr * 3 + colorCtr]] - intensity; palIndex[palCtr][colorCtr] = (byte)ABS(diff); diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp index 05f00afb5a..c94f3e3ad4 100644 --- a/engines/mads/sequence.cpp +++ b/engines/mads/sequence.cpp @@ -526,8 +526,7 @@ void SequenceList::setMotion(int seqIndex, int flags, int deltaX, int deltaY) { if (deltaY > 0) { se._posSign.y = 1; - } - else if (deltaY < 0) { + } else if (deltaY < 0) { se._posSign.y = -1; } else { se._posSign.y = 0; -- cgit v1.2.3 From 5e00b39caec66e1c5626a89f207c26c577fd30d8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Feb 2015 22:07:42 -0500 Subject: MADS: Implementing code for panning screen transitions --- engines/mads/msurface.cpp | 15 +++++- engines/mads/msurface.h | 7 +++ engines/mads/palette.cpp | 26 ++++++++++ engines/mads/palette.h | 3 ++ engines/mads/screen.cpp | 122 +++++++++++++++++++++++++++++++++++++++++++++- engines/mads/screen.h | 13 +++++ 6 files changed, 183 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index 39824bac4b..d8d01f307c 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -485,7 +485,6 @@ void MSurface::scrollY(int yAmount) { delete[] tempData; } - void MSurface::translate(Common::Array &palette) { for (int y = 0; y < this->h; ++y) { byte *pDest = getBasePtr(0, y); @@ -521,6 +520,20 @@ MSurface *MSurface::flipHorizontal() const { return dest; } +void MSurface::copyRectTranslate(MSurface &srcSurface, const byte *paletteMap, + const Common::Point &destPos, const Common::Rect &srcRect) { + // Loop through the lines + for (int yCtr = 0; yCtr < srcRect.height(); ++yCtr) { + const byte *srcP = srcSurface.getBasePtr(srcRect.left, srcRect.top + yCtr); + byte *destP = getBasePtr(destPos.x, destPos.y + yCtr); + + // Copy the line over + for (int xCtr = 0; xCtr < srcRect.width(); ++xCtr, ++srcP, ++destP) { + *destP = paletteMap[*srcP]; + } + } +} + /*------------------------------------------------------------------------*/ int DepthSurface::getDepth(const Common::Point &pt) { diff --git a/engines/mads/msurface.h b/engines/mads/msurface.h index 650d7fdaee..754e70bf7f 100644 --- a/engines/mads/msurface.h +++ b/engines/mads/msurface.h @@ -220,6 +220,13 @@ public: * Create a new surface which is a flipped horizontal copy of the current one */ MSurface *flipHorizontal() const; + + /** + * Copy an area from one surface to another, translating it using a palette + * map as it's done + */ + void copyRectTranslate(MSurface &srcSurface, const byte *paletteMap, + const Common::Point &destPos, const Common::Rect &srcRect); }; class DepthSurface : public MSurface { diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 250eb75955..250c98b074 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -885,4 +885,30 @@ void Palette::refreshSceneColors() { setPalette(_mainPalette + (val * 3), val, 256 - val); } +int Palette::closestColor(const byte *matchColor, const byte *refPalette, + int listWrap, int count) { + int bestColor = 0; + int bestDifference = 0x7fff; + + for (int idx = 0; idx < count; ++idx) { + // Figure out hash for color + int hash = 0; + for (int rgbIdx = 0; rgbIdx < 3; ++rgbIdx, ++refPalette) { + byte diff = *refPalette - matchColor[rgbIdx]; + hash += (int)diff * (int)diff; + } + + // If the given color is a closer match to our color, store the index + if (hash < bestDifference) { + bestDifference = hash; + bestColor = idx; + } + + refPalette += listWrap - 3; + } + + return bestColor; +} + + } // End of namespace MADS diff --git a/engines/mads/palette.h b/engines/mads/palette.h index 27d25f266b..1c387b4368 100644 --- a/engines/mads/palette.h +++ b/engines/mads/palette.h @@ -318,6 +318,9 @@ public: void unlock(); void refreshSceneColors(); + + static int closestColor(const byte *matchColor, const byte *refPalette, + int listWrap, int count); }; } // End of namespace MADS diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 8552effd98..f7179877d5 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -607,6 +607,7 @@ void ScreenSurface::updateScreen() { void ScreenSurface::transition(ScreenTransition transitionType, bool surfaceFlag) { Palette &pal = *_vm->_palette; + Scene &scene = _vm->_game->_scene; byte palData[PALETTE_SIZE]; switch (transitionType) { @@ -639,8 +640,9 @@ void ScreenSurface::transition(ScreenTransition transitionType, bool surfaceFlag case kTransitionPanLeftToRight: case kTransitionPanRightToLeft: - warning("TODO: pan transition"); - transition(kTransitionFadeIn, surfaceFlag); + panTransition(scene._backgroundSurface, pal._mainPalette, + transitionType - kTransitionPanLeftToRight, + Common::Point(0, 0), scene._posAdjust, THROUGH_BLACK2, true, 1); break; case kTransitionCircleIn1: @@ -674,5 +676,121 @@ void ScreenSurface::resetClipBounds() { setClipBounds(Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT)); } +void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entrySide, + const Common::Point &srcPos, const Common::Point &destPos, + ThroughBlack throughBlack, bool setPalette, int numTicks) { + EventsManager &events = *_vm->_events; + Palette &palette = *_vm->_palette; + Common::Point size; + int y1, y2; + int startX = 0; + int deltaX; + int sizeY; + int xAt; + int loopStart; +// uint32 baseTicks, currentTicks; + byte paletteMap[256]; + + size.x = MIN(newScreen.w, (uint16)MADS_SCREEN_WIDTH); + size.y = newScreen.h; + if (newScreen.h >= MADS_SCREEN_HEIGHT) + size.y = MADS_SCENE_HEIGHT; + + // Set starting position and direction delta for the transition + if (entrySide == 1) + // Right to left + startX = size.x - 1; + deltaX = startX ? -1 : 1; + + if (setPalette & !throughBlack) + palette.setFullPalette(palData); + + // TODO: Original uses a different frequency ticks counter. Need to + // confirm frequency and see whether we need to implement it, or + // if the current frame ticks can substitute for it +// baseTicks = events.getFrameCounter(); + + y1 = 0; + y2 = size.y - 1; + sizeY = y2 - y1 + 1; + + if (throughBlack == THROUGH_BLACK2) + swapForeground(palData, &paletteMap[0]); + + loopStart = throughBlack == THROUGH_BLACK1 ? 0 : 1; + for (int loop = loopStart; loop < 2; ++loop) { + xAt = startX; + for (int xCtr = 0; xCtr < size.x; ++xCtr, xAt += deltaX) { + if (!loop) { + fillRect(Common::Rect(xAt + destPos.x, y1 + destPos.y, + xAt + destPos.x + 1, y2 + destPos.y), 0); + } else if (throughBlack == THROUGH_BLACK2) { + copyRectTranslate(newScreen, paletteMap, + Common::Point(xAt, destPos.y), + Common::Rect(srcPos.x + xAt, srcPos.y, + srcPos.x + xAt + 1, srcPos.y + size.y)); + } else { + newScreen.copyRectToSurface(*this, xAt, destPos.y, + Common::Rect(srcPos.x + xAt, srcPos.y, + srcPos.x + xAt + 1, srcPos.y + size.y)); + } + + copyRectToScreen(Common::Rect(xAt, destPos.y, xAt + 1, destPos.y + size.y)); + + // Slight delay + events.delay(1); + } + + if ((setPalette && !loop) || throughBlack == THROUGH_BLACK2) + palette.setFullPalette(palData); + } + + if (throughBlack == THROUGH_BLACK2) { + Common::Rect r(srcPos.x, srcPos.y, srcPos.x + size.x, srcPos.y + size.y); + copyRectToSurface(newScreen, destPos.x, destPos.y, r); + copyRectToScreen(r); + } +} + +void ScreenSurface::swapForeground(byte palData[PALETTE_SIZE], byte *paletteMap) { + Palette &palette = *_vm->_palette; + byte oldPalette[PALETTE_SIZE]; + byte oldMap[256]; + byte newMap[256]; + + palette.getFullPalette(oldPalette); + swapPalette(oldPalette, oldMap, true); + swapPalette(palData, newMap, false); + + Common::copy(&palData[3], &palData[PALETTE_SIZE], &oldPalette[3]); + + copyRectTranslate(*this, oldMap, Common::Point(0, 0), + Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT)); + palette.setFullPalette(oldPalette); +} + +void ScreenSurface::swapPalette(byte *palData, byte swapTable[PALETTE_COUNT], + int start) { + byte *dynamicList = &palData[start * 3]; + int staticStart = 1 - start; + byte *staticList = &palData[staticStart * 3]; + const int PALETTE_START = 1; + const int PALETTE_END = 252; + + // Set initial index values + for (int idx = 0; idx < PALETTE_COUNT; ++idx) + swapTable[idx] = idx; + + for (int idx = 0; idx < 128; ++idx) { + if (start >= PALETTE_START && start <= PALETTE_END) { + swapTable[start] = Palette::closestColor(dynamicList, staticList, + 6, 128) * 2 + staticStart; + } + + dynamicList += 6; + start += 2; + } +} + } // End of namespace MADS diff --git a/engines/mads/screen.h b/engines/mads/screen.h index 6800523f92..35042e88d2 100644 --- a/engines/mads/screen.h +++ b/engines/mads/screen.h @@ -56,6 +56,11 @@ enum InputMode { kInputLimitedSentences = 2 // Use only scene hotspots }; +enum ThroughBlack { + THROUGH_BLACK1 = 1, + THROUGH_BLACK2 = 2 +}; + class SpriteSlot; class TextDisplay; class UISlot; @@ -207,6 +212,14 @@ private: uint16 _random; byte *_surfacePixels; Common::Rect _clipBounds; + + void panTransition(MSurface &newScreen, byte *palData, int entrySide, + const Common::Point &srcPos, const Common::Point &destPos, + ThroughBlack throughBlack, bool setPalette, int numTicks); + + void swapForeground(byte *palData, byte *paletteMap); + + void swapPalette(byte palData[PALETTE_SIZE], byte swapTable[PALETTE_COUNT], int start); public: int _shakeCountdown; public: -- cgit v1.2.3 From 55be1b82a84454ae838419e22ce15cade5298665 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Feb 2015 23:54:51 -0500 Subject: MADS: Variable renaming in closestColor --- engines/mads/palette.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 250c98b074..b41eaedfcc 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -888,19 +888,19 @@ void Palette::refreshSceneColors() { int Palette::closestColor(const byte *matchColor, const byte *refPalette, int listWrap, int count) { int bestColor = 0; - int bestDifference = 0x7fff; + int bestDistance = 0x7fff; for (int idx = 0; idx < count; ++idx) { // Figure out hash for color - int hash = 0; + int distance = 0; for (int rgbIdx = 0; rgbIdx < 3; ++rgbIdx, ++refPalette) { byte diff = *refPalette - matchColor[rgbIdx]; - hash += (int)diff * (int)diff; + distance += (int)diff * (int)diff; } // If the given color is a closer match to our color, store the index - if (hash < bestDifference) { - bestDifference = hash; + if (distance < bestDistance) { + bestDistance = distance; bestColor = idx; } -- cgit v1.2.3 From 1aa9181466d1916824abb7301ea3e67781d08183 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Feb 2015 15:34:11 -0500 Subject: MADS: Cleanup and bugfixes for panning transition support methods --- engines/mads/palette.cpp | 22 +++++++++++++------- engines/mads/palette.h | 11 ++++------ engines/mads/screen.cpp | 53 ++++++++++++++++++++++++++++++++++-------------- engines/mads/screen.h | 4 ++-- 4 files changed, 59 insertions(+), 31 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index b41eaedfcc..b5ea136abd 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -428,6 +428,14 @@ void Fader::grabPalette(byte *colors, uint start, uint num) { g_system->getPaletteManager()->grabPalette(colors, start, num); } +void Fader::getFullPalette(byte palette[PALETTE_SIZE]) { + grabPalette(&palette[0], 0, PALETTE_COUNT); +} + +void Fader::setFullPalette(byte palette[PALETTE_SIZE]) { + setPalette(&palette[0], 0, PALETTE_COUNT); +} + void Fader::fadeOut(byte palette[PALETTE_SIZE], byte *paletteMap, int baseColor, int numColors, int baseGrey, int numGreys, int tickDelay, int steps) { @@ -886,25 +894,25 @@ void Palette::refreshSceneColors() { } int Palette::closestColor(const byte *matchColor, const byte *refPalette, - int listWrap, int count) { + int paletteInc, int count) { int bestColor = 0; int bestDistance = 0x7fff; for (int idx = 0; idx < count; ++idx) { - // Figure out hash for color + // Figure out figure for 'distance' between two colors int distance = 0; - for (int rgbIdx = 0; rgbIdx < 3; ++rgbIdx, ++refPalette) { - byte diff = *refPalette - matchColor[rgbIdx]; - distance += (int)diff * (int)diff; + for (int rgbIdx = 0; rgbIdx < RGB_SIZE; ++rgbIdx) { + int diff = refPalette[rgbIdx] - matchColor[rgbIdx]; + distance += diff * diff; } // If the given color is a closer match to our color, store the index - if (distance < bestDistance) { + if (distance <= bestDistance) { bestDistance = distance; bestColor = idx; } - refPalette += listWrap - 3; + refPalette += paletteInc; } return bestColor; diff --git a/engines/mads/palette.h b/engines/mads/palette.h index 1c387b4368..5d3bc3a82e 100644 --- a/engines/mads/palette.h +++ b/engines/mads/palette.h @@ -36,6 +36,7 @@ class MADSEngine; #define PALETTE_RESERVED_HIGH_COUNT 10 #define PALETTE_COUNT 256 +#define RGB_SIZE 3 #define PALETTE_SIZE (256 * 3) /** @@ -212,16 +213,12 @@ public: /** * Gets the entire palette at once */ - void getFullPalette(byte palette[PALETTE_SIZE]) { - grabPalette(&palette[0], 0, PALETTE_COUNT); - } + void getFullPalette(byte palette[PALETTE_SIZE]); /** * Sets the entire palette at once */ - void setFullPalette(byte palette[PALETTE_SIZE]) { - setPalette(&palette[0], 0, PALETTE_COUNT); - } + void setFullPalette(byte palette[PALETTE_SIZE]); /** * Calculates a merge/hash for a given palette entry @@ -320,7 +317,7 @@ public: void refreshSceneColors(); static int closestColor(const byte *matchColor, const byte *refPalette, - int listWrap, int count); + int paletteInc, int count); }; } // End of namespace MADS diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index f7179877d5..60f3d8aeaf 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -610,7 +610,7 @@ void ScreenSurface::transition(ScreenTransition transitionType, bool surfaceFlag Scene &scene = _vm->_game->_scene; byte palData[PALETTE_SIZE]; - switch (transitionType) { + switch (transitionType) { case kTransitionFadeIn: case kTransitionFadeOutIn: Common::fill(&pal._colorValues[0], &pal._colorValues[3], 0); @@ -738,7 +738,8 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS copyRectToScreen(Common::Rect(xAt, destPos.y, xAt + 1, destPos.y + size.y)); // Slight delay - events.delay(1); + events.pollEvents(); + g_system->delayMillis(1); } if ((setPalette && !loop) || throughBlack == THROUGH_BLACK2) @@ -752,28 +753,49 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS } } -void ScreenSurface::swapForeground(byte palData[PALETTE_SIZE], byte *paletteMap) { +/** + * Translates the current screen from the old palette to the new palette + */ +void ScreenSurface::swapForeground(byte newPalette[PALETTE_SIZE], byte *paletteMap) { Palette &palette = *_vm->_palette; byte oldPalette[PALETTE_SIZE]; - byte oldMap[256]; - byte newMap[256]; + byte oldMap[PALETTE_COUNT]; palette.getFullPalette(oldPalette); swapPalette(oldPalette, oldMap, true); - swapPalette(palData, newMap, false); - - Common::copy(&palData[3], &palData[PALETTE_SIZE], &oldPalette[3]); + swapPalette(newPalette, paletteMap, false); + + // Transfer translated foreground colors. Since foregrounds are interleaved + // with background, we only copy over each alternate RGB tuplet + const byte *srcP = &newPalette[RGB_SIZE]; + byte *destP = &oldPalette[RGB_SIZE]; + while (destP < &oldPalette[PALETTE_SIZE]) { + Common::copy(srcP, srcP + RGB_SIZE, destP); + srcP += 2 * RGB_SIZE; + destP += 2 * RGB_SIZE; + } + Common::Rect oldClip = _clipBounds; + resetClipBounds(); + copyRectTranslate(*this, oldMap, Common::Point(0, 0), Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT)); palette.setFullPalette(oldPalette); + + setClipBounds(oldClip); } -void ScreenSurface::swapPalette(byte *palData, byte swapTable[PALETTE_COUNT], - int start) { - byte *dynamicList = &palData[start * 3]; +/** + * Translates a given palette into a mapping table. + * Palettes consist of 128 RGB entries for the foreground and background + * respectively, with the two interleaved together. So the start + */ +void ScreenSurface::swapPalette(const byte *palData, byte swapTable[PALETTE_COUNT], + bool foreground) { + int start = foreground ? 1 : 0; + const byte *dynamicList = &palData[start * RGB_SIZE]; int staticStart = 1 - start; - byte *staticList = &palData[staticStart * 3]; + const byte *staticList = &palData[staticStart * RGB_SIZE]; const int PALETTE_START = 1; const int PALETTE_END = 252; @@ -781,13 +803,14 @@ void ScreenSurface::swapPalette(byte *palData, byte swapTable[PALETTE_COUNT], for (int idx = 0; idx < PALETTE_COUNT; ++idx) swapTable[idx] = idx; - for (int idx = 0; idx < 128; ++idx) { + // Handle the 128 palette entries for the foreground or background + for (int idx = 0; idx < (PALETTE_COUNT / 2); ++idx) { if (start >= PALETTE_START && start <= PALETTE_END) { swapTable[start] = Palette::closestColor(dynamicList, staticList, - 6, 128) * 2 + staticStart; + 2 * RGB_SIZE, PALETTE_COUNT / 2) * 2 + staticStart; } - dynamicList += 6; + dynamicList += 2 * RGB_SIZE; start += 2; } } diff --git a/engines/mads/screen.h b/engines/mads/screen.h index 35042e88d2..e2462aff18 100644 --- a/engines/mads/screen.h +++ b/engines/mads/screen.h @@ -217,9 +217,9 @@ private: const Common::Point &srcPos, const Common::Point &destPos, ThroughBlack throughBlack, bool setPalette, int numTicks); - void swapForeground(byte *palData, byte *paletteMap); + void swapForeground(byte newPalette[PALETTE_SIZE], byte *paletteMap); - void swapPalette(byte palData[PALETTE_SIZE], byte swapTable[PALETTE_COUNT], int start); + void swapPalette(const byte palData[PALETTE_SIZE], byte swapTable[PALETTE_COUNT], bool foreground); public: int _shakeCountdown; public: -- cgit v1.2.3 From d31e602add7e5466754d4b651ce7f947f6effdda Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Feb 2015 16:54:47 -0500 Subject: MADS: Allow Escape key to close game options dialog --- engines/mads/events.cpp | 2 +- engines/mads/events.h | 4 +++- engines/mads/game.cpp | 8 ++++---- engines/mads/game.h | 2 +- engines/mads/nebular/dialogs_nebular.cpp | 21 ++++++++++++++++----- engines/mads/scene.cpp | 8 +++++--- 6 files changed, 30 insertions(+), 15 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index e7ec8b0821..586ef7cbf3 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -157,7 +157,7 @@ void EventsManager::pollEvents() { _vm->_debugger->attach(); _vm->_debugger->onFrame(); } else { - _pendingKeys.push(event); + _pendingKeys.push(event.kbd); } return; case Common::EVENT_KEYUP: diff --git a/engines/mads/events.h b/engines/mads/events.h index 870d6e03b8..21ef37407b 100644 --- a/engines/mads/events.h +++ b/engines/mads/events.h @@ -70,7 +70,7 @@ public: int _vD2; int _mouseStatusCopy; bool _mouseMoved; - Common::Stack _pendingKeys; + Common::Stack _pendingKeys; public: /** * Constructor @@ -168,6 +168,8 @@ public: * Returns true if there's any pending keys to be processed */ bool isKeyPressed() const { return !_pendingKeys.empty(); } + + Common::KeyState getKey() { return _pendingKeys.pop(); } }; } // End of namespace MADS diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 0ce24daf7a..27691d3380 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -403,12 +403,12 @@ Common::StringArray Game::getMessage(uint32 id) { static const char *const DEBUG_STRING = "WIDEPIPE"; -void Game::handleKeypress(const Common::Event &event) { - if (event.kbd.flags & Common::KBD_CTRL) { +void Game::handleKeypress(const Common::KeyState &kbd) { + if (kbd.flags & Common::KBD_CTRL) { if (_widepipeCtr == 8) { // Implement original game cheating keys here someday } else { - if (event.kbd.keycode == (Common::KEYCODE_a + + if (kbd.keycode == (Common::KEYCODE_a + (DEBUG_STRING[_widepipeCtr] - 'a'))) { if (++_widepipeCtr == 8) { MessageDialog *dlg = new MessageDialog(_vm, 2, @@ -420,7 +420,7 @@ void Game::handleKeypress(const Common::Event &event) { } } - switch (event.kbd.keycode) { + switch (kbd.keycode) { case Common::KEYCODE_F1: _vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU; break; diff --git a/engines/mads/game.h b/engines/mads/game.h index 1a61fc8ac8..66f2580249 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -204,7 +204,7 @@ public: /** * Handle a keyboard event */ - void handleKeypress(const Common::Event &event); + void handleKeypress(const Common::KeyState &kbd); /** * Starts a savegame loading. diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 05c2e4ba96..be683d0b51 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -804,7 +804,7 @@ void GameDialog::show() { Scene &scene = _vm->_game->_scene; - while (_selectedLine < 1 && !_vm->shouldQuit()) { + while (_selectedLine == -1 && !_vm->shouldQuit()) { handleEvents(); if (_redrawFlag) { if (!_tempLine) @@ -831,7 +831,17 @@ void GameDialog::handleEvents() { _lines[i]._state = DLGSTATE_UNSELECTED; // Process pending events - _vm->_events->pollEvents(); + events.pollEvents(); + + if (events.isKeyPressed()) { + switch (events.getKey().keycode) { + case Common::KEYCODE_ESCAPE: + _selectedLine = 0; + break; + default: + break; + } + } // Scan for objects in the dialog Common::Point mousePos = events.currentPos() - Common::Point(0, DIALOG_TOP); @@ -1010,12 +1020,13 @@ void GameMenuDialog::show() { _vm->_dialogs->_pendingDialog = DIALOG_OPTIONS; _vm->_dialogs->showDialog(); break; + case 5: + _vm->quitGame(); + break; case 4: + default: // Resume game break; - case 5: - default: - _vm->quitGame(); } } diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index ea3fe2c148..61db1a6a32 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -592,12 +592,14 @@ void Scene::doSceneStep() { } void Scene::checkKeyboard() { - if (_vm->_events->isKeyPressed()) { - Common::Event evt = _vm->_events->_pendingKeys.pop(); + EventsManager &events = *_vm->_events; + + if (events.isKeyPressed()) { + Common::KeyState evt = events.getKey(); _vm->_game->handleKeypress(evt); } - if ((_vm->_events->_mouseStatus & 3) == 3 && _vm->_game->_player._stepEnabled) { + if ((events._mouseStatus & 3) == 3 && _vm->_game->_player._stepEnabled) { _reloadSceneFlag = true; _vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU; _action.clear(); -- cgit v1.2.3 From be489d88e6f4e17e4c1873f97831237091c899c4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Feb 2015 18:03:45 -0500 Subject: MADS: Fix palette loading for in-game dialogs --- engines/mads/nebular/dialogs_nebular.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index be683d0b51..6985455d2a 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -612,9 +612,12 @@ GameDialog::GameDialog(MADSEngine *vm) : FullScreenDialog(vm) { } void GameDialog::display() { + Palette &palette = *_vm->_palette; + palette.initPalette(); + palette.resetGamePalette(18, 10); + FullScreenDialog::display(); - Palette &palette = *_vm->_palette; palette.setEntry(10, 0, 63, 0); palette.setEntry(11, 0, 45, 0); palette.setEntry(12, 63, 63, 0); @@ -1094,7 +1097,7 @@ void OptionsDialog::show() { StoryMode prevStoryMode = game._storyMode; do { - _selectedLine = 0; + _selectedLine = -1; GameDialog::show(); switch (_selectedLine) { @@ -1133,22 +1136,16 @@ void OptionsDialog::show() { clearLines(); setLines(); setClickableLines(); - } while (_selectedLine <= 7); + } while (!_vm->shouldQuit() && _selectedLine != 0 && _selectedLine <= 7); - switch (_selectedLine) { - case 8: // Done - // New options will be applied - break; - case 9: // Cancel + // If Done button not pressed, reset settings + if (_selectedLine != 8) { // Revert all options from the saved ones _vm->_easyMouse = prevEasyMouse; _vm->_invObjectsAnimated = prevInvObjectsAnimated; _vm->_textWindowStill = prevTextWindowStill; _vm->_screenFade = prevScreenFade; game._storyMode = prevStoryMode; - break; - default: - break; } } -- cgit v1.2.3 From a505ae941c22149c9892470f6b11087f8ececb91 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Feb 2015 20:44:59 -0500 Subject: MADS: Fix picture when picking up timer module --- engines/mads/nebular/nebular_scenes1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index ab072c1d3c..7c85fd44db 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -1453,7 +1453,7 @@ void Scene103::actions() { _scene->_hotspots.activate(371, false); _vm->_game->_player._visible = true; _vm->_game->_player._stepEnabled = true; - _vm->_dialogs->showItem(OBJ_REBREATHER, 805); + _vm->_dialogs->showItem(OBJ_TIMER_MODULE, 805); break; default: -- cgit v1.2.3 From 2c9ad1ee9b439998b2dac178d295ce3f328b41ae Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Feb 2015 21:34:09 -0500 Subject: MADS: Fix death animations for seaweed and underwater mine --- engines/mads/scene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 61db1a6a32..a72648f0c9 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -675,7 +675,7 @@ void Scene::freeCurrentScene() { } void Scene::removeSprites() { - for (int idx = _sprites.size() - 1; idx >= _spritesCount; --idx) + for (int idx = _sprites._assetCount - 1; idx >= _spritesCount; --idx) _sprites.remove(idx); } -- cgit v1.2.3 From 51561c80c0002ea3f59bc513592f04c656d32a65 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Feb 2015 07:19:42 -0500 Subject: MADS: Fix left edge screen clipping for non-scaled flipped sprites --- engines/mads/msurface.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index d8d01f307c..cc12442db1 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -308,6 +308,9 @@ void MSurface::copyFrom(MSurface *src, const Common::Point &destPos, int depth, if (!copyRect.isValidRect()) return; + if (flipped) + copyRect.moveTo(0, copyRect.top); + byte *data = src->getData(); byte *srcPtr = data + (src->getWidth() * copyRect.top + copyRect.left); byte *destPtr = (byte *)pixels + (destY * pitch) + destX; -- cgit v1.2.3 From 7658821afd7a6d2e70286866c15eff7dd2618115 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Feb 2015 08:10:13 -0500 Subject: MADS: Fix left screen clipping for scaled flipped sprites --- engines/mads/msurface.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index cc12442db1..702b9e5f08 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -400,14 +400,16 @@ void MSurface::copyFrom(MSurface *src, const Common::Point &destPos, int depth, const byte *srcP = srcPixelsP; byte *destP = destPixelsP; - for (int xp = 0, sprX = 0; xp < frameWidth; ++xp, ++srcP) { - if (xp < spriteLeft) - // Not yet reached start of display area - continue; - if (!lineDist[sprX++]) + for (int xp = 0, sprX = -1; xp < frameWidth; ++xp, ++srcP) { + if (!lineDist[xp]) // Not a display pixel continue; + ++sprX; + if (sprX < spriteLeft || sprX >= spriteRight) + // Skip pixel if it's not in horizontal display portion + continue; + // Get depth of current output pixel in depth surface Common::Point pt((destP - (byte *)this->pixels) % this->pitch, (destP - (byte *)this->pixels) / this->pitch); -- cgit v1.2.3 From 7739e12e42edae68264a9675ede1bd840ae3be6b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Feb 2015 09:50:14 -0500 Subject: MADS: Stop player disappearing after cutscene of fish being eaten --- engines/mads/player.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index bde313af8d..e7993f378a 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -509,10 +509,11 @@ void Player::idle() { return; } - if ((_spritesStart + _spritesIdx) < 0 || !_spriteSetsPresent[_spritesStart + _spritesIdx]) + int idx = _spritesStart + _spritesIdx; + if (idx < 0 || (idx < PLAYER_SPRITES_FILE_COUNT && !_spriteSetsPresent[idx])) return; - SpriteAsset &spriteSet = *scene._sprites[_spritesStart + _spritesIdx]; + SpriteAsset &spriteSet = *scene._sprites[idx]; assert(spriteSet._charInfo); if (spriteSet._charInfo->_numEntries == 0) // No entries, so exit immediately -- cgit v1.2.3 From db325695f42e2dec3163b9a371085d8561e5a42a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Feb 2015 11:07:33 -0500 Subject: MADS: Fix proper cycling of idle animations --- engines/mads/player.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index e7993f378a..1622031c6c 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -235,11 +235,12 @@ void Player::selectSeries() { void Player::updateFrame() { // WORKAROUND: Prevent character info being referenced when not present - if ((_spritesStart + _spritesIdx) < 0 || !_spriteSetsPresent[_spritesStart + _spritesIdx]) + int idx = _spritesStart + _spritesIdx; + if (idx < 0 || (idx < PLAYER_SPRITES_FILE_COUNT && !_spriteSetsPresent[idx])) return; Scene &scene = _vm->_game->_scene; - SpriteAsset &spriteSet = *scene._sprites[_spritesStart + _spritesIdx]; + SpriteAsset &spriteSet = *scene._sprites[idx]; assert(spriteSet._charInfo); if (!spriteSet._charInfo->_numEntries) { @@ -529,11 +530,11 @@ void Player::idle() { _frameNumber += direction; _forceRefresh = true; - if (spriteSet._charInfo->_stopFrames[frameIndex] < _frameNumber) { + if (_frameNumber > spriteSet._charInfo->_stopFrames[frameIndex]) { _trigger = _upcomingTrigger; updateFrame(); } - if (spriteSet._charInfo->_startFrames[frameIndex] < _frameNumber) { + if (_frameNumber < spriteSet._charInfo->_startFrames[frameIndex]) { _trigger = _upcomingTrigger; updateFrame(); } -- cgit v1.2.3 From df5742eee41abe7e74a2b47a0ddcc183bf52fe09 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Feb 2015 15:52:01 -0500 Subject: MADS: Fix player animation when getting blown up by mine --- engines/mads/player.cpp | 10 +++++++--- engines/mads/sprites.cpp | 7 ++----- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index 1622031c6c..8720aeead3 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -240,8 +240,13 @@ void Player::updateFrame() { return; Scene &scene = _vm->_game->_scene; + assert(scene._sprites[idx] != nullptr); SpriteAsset &spriteSet = *scene._sprites[idx]; - assert(spriteSet._charInfo); + + // WORKAROUND: Certain cutscenes set up player sprites that don't have any + // character info. In such cases, simply ignore player updates + if (!spriteSet._charInfo) + return; if (!spriteSet._charInfo->_numEntries) { _frameNumber = 1; @@ -515,8 +520,7 @@ void Player::idle() { return; SpriteAsset &spriteSet = *scene._sprites[idx]; - assert(spriteSet._charInfo); - if (spriteSet._charInfo->_numEntries == 0) + if (spriteSet._charInfo == nullptr || spriteSet._charInfo->_numEntries == 0) // No entries, so exit immediately return; diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index fd73930475..f74edafc93 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -371,16 +371,13 @@ int SpriteSets::add(SpriteAsset *asset, int idx) { if (idx) idx = idx + 49; else - idx = size(); + idx = _assetCount++; if (idx >= (int)size()) resize(idx + 1); - if ((*this)[idx]) { + if ((*this)[idx]) delete (*this)[idx]; - } else { - ++_assetCount; - } (*this)[idx] = asset; return idx; -- cgit v1.2.3 From 549b5d435a897e1f6d306d2bdb902cac18159491 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Feb 2015 16:14:59 -0500 Subject: MADS: Fix crash when trapping bouncy native in pit --- engines/mads/nebular/nebular_scenes2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 94e30aa4f2..d00857f0a2 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -1745,7 +1745,8 @@ void Scene208::enter() { } void Scene208::step() { - if (_boundingFl && (_rhotundaTime <= _scene->_activeAnimation->getCurrentFrame())) { + if (_boundingFl && _scene->_activeAnimation && + (_rhotundaTime <= _scene->_activeAnimation->getCurrentFrame())) { _rhotundaTime = _scene->_activeAnimation->getCurrentFrame(); if (_rhotundaTime == 125) -- cgit v1.2.3 From c660119c2282a4a501ab88e9a65e3064fccad21d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Feb 2015 16:48:04 -0500 Subject: MADS: Fix depth for seaweed in scene 104 --- engines/mads/nebular/nebular_scenes1.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index 7c85fd44db..3149343aee 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -1621,6 +1621,7 @@ void Scene104::setup() { void Scene104::enter() { _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('h', -1)); _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 14, 0, 0, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 8); if (_scene->_priorSceneId == 105) _game._player._playerPos = Common::Point(302, 107); -- cgit v1.2.3 From 076ce7e6c158878305ace5d7f334d54f8d44e966 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Feb 2015 17:45:20 -0500 Subject: MADS: Implement scroll wheel support for scrolling inventory --- engines/mads/events.cpp | 6 +++ engines/mads/game.cpp | 11 +++++ engines/mads/user_interface.cpp | 90 +++++++++++++++++++++++------------------ engines/mads/user_interface.h | 7 +++- 4 files changed, 73 insertions(+), 41 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index 586ef7cbf3..06c6055f01 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -162,6 +162,12 @@ void EventsManager::pollEvents() { return; case Common::EVENT_KEYUP: return; + case Common::EVENT_WHEELUP: + _pendingKeys.push(Common::KeyState(Common::KEYCODE_PAGEUP)); + return; + case Common::EVENT_WHEELDOWN: + _pendingKeys.push(Common::KeyState(Common::KEYCODE_PAGEDOWN)); + return; case Common::EVENT_LBUTTONDOWN: case Common::EVENT_RBUTTONDOWN: _mouseClicked = true; diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 27691d3380..3b8b053fec 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -420,6 +420,7 @@ void Game::handleKeypress(const Common::KeyState &kbd) { } } + Scene &scene = _vm->_game->_scene; switch (kbd.keycode) { case Common::KEYCODE_F1: _vm->_dialogs->_pendingDialog = DIALOG_GAME_MENU; @@ -430,6 +431,16 @@ void Game::handleKeypress(const Common::KeyState &kbd) { case Common::KEYCODE_F7: _vm->_dialogs->_pendingDialog = DIALOG_RESTORE; break; + case Common::KEYCODE_PAGEUP: + scene._userInterface._scrollbarStrokeType = SCROLLBAR_UP; + scene._userInterface.changeScrollBar(); + break; + case Common::KEYCODE_PAGEDOWN: + scene._userInterface._scrollbarStrokeType = SCROLLBAR_DOWN; + scene._userInterface.changeScrollBar(); + break; + + default: break; } diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 822460d549..929390a073 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -495,7 +495,6 @@ void UserInterface::drawScroller() { void UserInterface::updateInventoryScroller() { ScreenObjects &screenObjects = _vm->_game->_screenObjects; - Common::Array &inventoryList = _vm->_game->_objects._inventoryList; if (screenObjects._inputMode != kInputBuildingSentences) return; @@ -518,45 +517,8 @@ void UserInterface::updateInventoryScroller() { _scrollbarQuickly = _vm->_events->_vD2 < 1; _scrollbarMilliTime = currentMilli; - switch (_scrollbarStrokeType) { - case SCROLLBAR_UP: - // Scroll up - if (_inventoryTopIndex > 0 && inventoryList.size() > 0) { - --_inventoryTopIndex; - _inventoryChanged = true; - } - break; - - case SCROLLBAR_DOWN: - // Scroll down - if (_inventoryTopIndex < ((int)inventoryList.size() - 1) && inventoryList.size() > 1) { - ++_inventoryTopIndex; - _inventoryChanged = true; - } - break; - - case SCROLLBAR_ELEVATOR: { - // Inventory slider - int newIndex = CLIP((int)_vm->_events->currentPos().y - 170, 0, 17) - * inventoryList.size() / 10; - if (newIndex >= (int)inventoryList.size()) - newIndex = inventoryList.size() - 1; - - if (inventoryList.size() > 0) { - _inventoryChanged = newIndex != _inventoryTopIndex; - _inventoryTopIndex = newIndex; - } - break; - } - - default: - break; - } - - if (_inventoryChanged) { - int dummy; - updateSelection(CAT_INV_LIST, 0, &dummy); - } + // Change the scrollbar and visible inventory list + changeScrollBar(); } } } @@ -569,6 +531,54 @@ void UserInterface::updateInventoryScroller() { _scrollbarOldElevator = _scrollbarElevator; } +void UserInterface::changeScrollBar() { + Common::Array &inventoryList = _vm->_game->_objects._inventoryList; + ScreenObjects &screenObjects = _vm->_game->_screenObjects; + + if (screenObjects._inputMode != kInputBuildingSentences) + return; + + switch (_scrollbarStrokeType) { + case SCROLLBAR_UP: + // Scroll up + if (_inventoryTopIndex > 0 && inventoryList.size() > 0) { + --_inventoryTopIndex; + _inventoryChanged = true; + } + break; + + case SCROLLBAR_DOWN: + // Scroll down + if (_inventoryTopIndex < ((int)inventoryList.size() - 1) && inventoryList.size() > 1) { + ++_inventoryTopIndex; + _inventoryChanged = true; + } + break; + + case SCROLLBAR_ELEVATOR: { + // Inventory slider + int newIndex = CLIP((int)_vm->_events->currentPos().y - 170, 0, 17) + * inventoryList.size() / 10; + if (newIndex >= (int)inventoryList.size()) + newIndex = inventoryList.size() - 1; + + if (inventoryList.size() > 0) { + _inventoryChanged = newIndex != _inventoryTopIndex; + _inventoryTopIndex = newIndex; + } + break; + } + + default: + break; + } + + if (_inventoryChanged) { + int dummy; + updateSelection(CAT_INV_LIST, 0, &dummy); + } +} + void UserInterface::scrollbarChanged() { Common::Rect r(73, 4, 73 + 9, 4 + 38); _uiSlots.add(r); diff --git a/engines/mads/user_interface.h b/engines/mads/user_interface.h index 89044c9bf1..71c6f64c2a 100644 --- a/engines/mads/user_interface.h +++ b/engines/mads/user_interface.h @@ -140,7 +140,6 @@ private: bool _scrollFlag; int _noSegmentsActive; int _someSegmentsActive; - ScrollbarActive _scrollbarStrokeType; /** * Loads the elements of the user interface @@ -216,6 +215,7 @@ public: bool _scrollbarQuickly; uint32 _scrollbarMilliTime; int _scrollbarElevator, _scrollbarOldElevator; + ScrollbarActive _scrollbarStrokeType; public: /** * Constructor @@ -275,6 +275,11 @@ public: void updateSelection(ScrCategory category, int newIndex, int *idx); + /** + * Updates the current top visible item of the scrollbar + */ + void changeScrollBar(); + void scrollerChanged(); void scrollInventory(); -- cgit v1.2.3 From 85aecfaad4d9a0067a10580cea587996f2f37461 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Feb 2015 18:56:06 -0500 Subject: MADS: Fix animations of spider and vulture in witch doctor's hut scene --- engines/mads/nebular/nebular_scenes2.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index d00857f0a2..3eef545b09 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -1448,12 +1448,14 @@ Scene207::Scene207(MADSEngine *vm) : Scene2xx(vm) { _eyeFl = false; _spiderHotspotId = -1; _vultureHotspotId = -1; - _spiderTime = 0; - _vultureTime = 0; + + _spiderTime = _game._player._priorTimer; + _vultureTime = _game._player._priorTimer; } void Scene207::synchronize(Common::Serializer &s) { Scene2xx::synchronize(s); + uint32 unused; s.syncAsByte(_vultureFl); s.syncAsByte(_spiderFl); @@ -1461,8 +1463,8 @@ void Scene207::synchronize(Common::Serializer &s) { s.syncAsSint32LE(_spiderHotspotId); s.syncAsSint32LE(_vultureHotspotId); - s.syncAsSint32LE(_spiderTime); - s.syncAsSint32LE(_vultureTime); + s.syncAsSint32LE(unused); + s.syncAsSint32LE(unused); } void Scene207::setup() { @@ -1501,7 +1503,6 @@ void Scene207::enter() { if (_vultureFl) { _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 30, 0, 0, 400); - _vultureTime = _game._player._priorTimer; _vultureHotspotId = _scene->_dynamicHotspots.add(389, 13, _globals._sequenceIndexes[1], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(_vultureHotspotId, Common::Point(254, 94), FACING_WEST); } @@ -1509,7 +1510,6 @@ void Scene207::enter() { if (_spiderFl) { _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], -1, -1); - _spiderTime = _game._player._priorTimer; _spiderHotspotId = _scene->_dynamicHotspots.add(333, 13, _globals._sequenceIndexes[4], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(_spiderHotspotId, Common::Point(59, 132), FACING_SOUTH); } @@ -1549,11 +1549,17 @@ void Scene207::moveSpider() { } void Scene207::step() { - if (!_vultureFl) - moveVulture(); + Player &player = _game._player; + + if (_vultureFl) { + if (((int32)player._priorTimer - _vultureTime) > 1700) + moveVulture(); + } - if (_spiderFl) - moveSpider(); + if (_spiderFl) { + if (((int32)player._priorTimer - _spiderTime) > 800) + moveSpider(); + } if (_game._trigger == 70) { _globals._sequenceIndexes[6] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], false, 10, 0, 0, 0); -- cgit v1.2.3 From 877474cd327c1fab98c296b4786f3c98b9c93714 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 22 Feb 2015 01:43:02 +0100 Subject: MADS: Allow text to scroll off screen before removing it For example in the credits scroll. Clipping was already done elsewhere, so this really is just a change in how soon the line is removed from the list of text to display. --- engines/mads/menu_views.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index 8f1fd2d7a5..5a0c7ee92e 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -426,7 +426,7 @@ void TextView::doFrame() { scene._textDisplay.expire(tl._textDisplayIndex); tl._pos.y--; - if (tl._pos.y < 0) { + if (tl._pos.y + _font->getHeight() < 0) { _textLines.remove_at(i); } else { tl._textDisplayIndex = scene._textDisplay.add(tl._pos.x, tl._pos.y, -- cgit v1.2.3 From e664e9167a599e1e8ac7d8bb8f5349547fb49832 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 Mar 2015 18:21:39 -0500 Subject: MADS: Fix display of teleporter values with leading zeroes --- engines/mads/nebular/nebular_scenes.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index b5e2491624..0019118593 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -451,7 +451,10 @@ void SceneTeleporter::teleporterHandleKey() { _curCode *= 10; _curCode += _buttonTyped; _digitCount++; - _msgText = Common::String::format("%d", _curCode); + + Common::String format = "%01d"; + format.setChar('0' + _digitCount, 2); + _msgText = Common::String::format(format.c_str(), _curCode); if (_digitCount < 4) _msgText += "_"; -- cgit v1.2.3 From aef874cf50da10f4c18ba450648ac7b84224d710 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 Mar 2015 19:05:47 -0500 Subject: MADS: Fix animation of hand typing code in teleporter --- engines/mads/nebular/nebular_scenes.cpp | 2 +- engines/mads/nebular/nebular_scenes1.cpp | 16 +++---- engines/mads/nebular/nebular_scenes2.cpp | 44 +++++++++--------- engines/mads/nebular/nebular_scenes3.cpp | 68 ++++++++++++++-------------- engines/mads/nebular/nebular_scenes4.cpp | 46 +++++++++---------- engines/mads/nebular/nebular_scenes5.cpp | 54 +++++++++++----------- engines/mads/nebular/nebular_scenes6.cpp | 78 ++++++++++++++++---------------- engines/mads/nebular/nebular_scenes7.cpp | 30 ++++++------ engines/mads/nebular/nebular_scenes8.cpp | 32 ++++++------- engines/mads/sequence.cpp | 6 +-- engines/mads/sequence.h | 4 +- 11 files changed, 190 insertions(+), 190 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index 0019118593..72073b1c7b 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -432,7 +432,7 @@ void SceneTeleporter::teleporterHandleKey() { case 0: { _game._player._stepEnabled = false; Common::Point msgPos = teleporterComputeLocation(); - _handSequenceId = _scene->_sequences.startReverseCycle(_handSpriteId, false, 4, 2, 0, 0); + _handSequenceId = _scene->_sequences.startPingPongCycle(_handSpriteId, false, 4, 2, 0, 0); _scene->_sequences.setPosition(_handSequenceId, msgPos); _scene->_sequences.setDepth(_handSequenceId, 2); _scene->_sequences.addSubEntry(_handSequenceId, SEQUENCE_TRIGGER_LOOP, 0, 1); diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index 3149343aee..f21ab94bcb 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -134,7 +134,7 @@ void Scene101::sayDang() { switch (_game._trigger) { case 0: _scene->_sequences.remove(_globals._sequenceIndexes[11]); - _globals._sequenceIndexes[11] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[11], false, 3, 6, 0, 0); + _globals._sequenceIndexes[11] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[11], false, 3, 6, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[11], 17, 21); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_EXPIRE, 0, 72); _vm->_sound->command(17); @@ -696,7 +696,7 @@ void Scene102::enter() { _globals._spriteIndexes[11] = _scene->_sprites.addSprites("*RXMRC_8"); _globals._spriteIndexes[13] = _scene->_sprites.addSprites(formAnimName('x', 0)); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 8, 0, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 8, 0, 0, 0); _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 170, 0, 1, 6); _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 11, 0, 2, 3); _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 4, 0, 1, 0); @@ -1201,7 +1201,7 @@ void Scene102::actions() { if (_action.isAction(VERB_TAKE, NOUN_BINOCULARS) && _game._objects.isInRoom(OBJ_BINOCULARS)) { switch (_game._trigger) { case 0: - _globals._sequenceIndexes[11] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[11], false, 3, 1, 0, 0); + _globals._sequenceIndexes[11] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[11], false, 3, 1, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[11]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_EXPIRE, 0, 1); _game._player._visible = false; @@ -1433,7 +1433,7 @@ void Scene103::actions() { switch (_vm->_game->_trigger) { case 0: _scene->changeVariant(1); - _globals._sequenceIndexes[13] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[13], false, 3, 2); + _globals._sequenceIndexes[13] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[13], false, 3, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[13]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_SPRITE, 7, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -1463,7 +1463,7 @@ void Scene103::actions() { switch (_vm->_game->_trigger) { case 0: _scene->changeVariant(1); - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 3, 2); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 3, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[12]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2010,7 +2010,7 @@ void Scene106::enter() { } _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('G', -1)); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 21, 0, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 21, 0, 0, 0); _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('I', -1)); _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 6, 0, 32, 47); @@ -2503,7 +2503,7 @@ void Scene109::enter() { _globals._spriteIndexes[10] = _scene->_sprites.addSprites(Resources::formatName(105, 'F', 1, EXT_SS, "")); _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('H', 1)); - _globals._sequenceIndexes[10] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[10], true, 4, 0, 0, 0); + _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], true, 4, 0, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 5); _scene->_sequences.setPosition(_globals._sequenceIndexes[10], Common::Point(126, 39)); _scene->_sequences.setMotion(_globals._sequenceIndexes[10], 0, 200, 0); @@ -2676,7 +2676,7 @@ void Scene109::actions() { case 2: if (_hoovicDifficultFl) - _globals._sequenceIndexes[8] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[8], false, 4, 2, 0, 0); + _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], false, 4, 2, 0, 0); else _globals._sequenceIndexes[8] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[8], false, 4, 1, 0, 0); diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 3eef545b09..b8629a3915 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -556,7 +556,7 @@ void Scene202::step() { case 90: _vm->_sound->command(41); _scene->_sequences.remove(_globals._sequenceIndexes[10]); - _globals._sequenceIndexes[9] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[9], true, 6, 1, 0, 0); + _globals._sequenceIndexes[9] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[9], true, 6, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[9], Common::Point(247, 82)); _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 91); @@ -811,7 +811,7 @@ void Scene202::actions() { } else { _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[7] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[7], false, 3, 2, 0, 0); + _globals._sequenceIndexes[7] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[7], false, 3, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[7]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -1502,7 +1502,7 @@ void Scene207::enter() { _spiderFl = (var2 & 1); if (_vultureFl) { - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 30, 0, 0, 400); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 30, 0, 0, 400); _vultureHotspotId = _scene->_dynamicHotspots.add(389, 13, _globals._sequenceIndexes[1], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(_vultureHotspotId, Common::Point(254, 94), FACING_WEST); } @@ -2164,7 +2164,7 @@ void Scene209::handleLookRight() { switch (_game._trigger) { case 151: _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 8, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 8, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 8, 14); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 152); break; @@ -2231,7 +2231,7 @@ void Scene209::handleGetBinoculars() { case 162: { int oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 8, 6, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 8, 6, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 23, 25); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 163); @@ -2240,7 +2240,7 @@ void Scene209::handleGetBinoculars() { case 163: { int oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 8, 0, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 8, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 23, 24); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx); _scene->_sequences.addTimer(8, 164); @@ -2264,7 +2264,7 @@ void Scene209::handleBinocularBlink() { case 167: { int oldIdx = _globals._sequenceIndexes[3]; _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 8, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 8, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 23, 25); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 168); @@ -2273,7 +2273,7 @@ void Scene209::handleBinocularBlink() { case 168: { int oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 8, 0, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 8, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 23, 24); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx); _scene->_sequences.addTimer(30, 169); @@ -2293,7 +2293,7 @@ void Scene209::handleBinocularScan() { case 171: { int oldIdx = _globals._sequenceIndexes[3]; _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 43, 45); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 172); @@ -2305,10 +2305,10 @@ void Scene209::handleBinocularScan() { int randAction = _vm->getRandomNumber(1,2); switch (randAction) { case 1: - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 2, 0, 0); break; case 2: - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 4, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 4, 0, 0); break; } _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 23, 25); @@ -2319,7 +2319,7 @@ void Scene209::handleBinocularScan() { case 173: { int oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 26, 30); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 174); @@ -2328,7 +2328,7 @@ void Scene209::handleBinocularScan() { case 174: { int oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 0, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 23, 24); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx); _scene->_sequences.addTimer(60, 175); @@ -2414,7 +2414,7 @@ void Scene209::handleTongue() { case 185: { _vm->_sound->command(18); int oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 6, 20, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 6, 20, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 38, 39); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 186); @@ -2534,7 +2534,7 @@ void Scene209::handleMonkeyEating() { case 200: { int oldIdx = _globals._sequenceIndexes[4]; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 10, 10, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 10, 10, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 15, 16); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[4], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 201); @@ -2563,14 +2563,14 @@ void Scene209::handleMonkeyEating() { case 204: _scene->_sequences.remove(_globals._sequenceIndexes[4]); - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 10, 8, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 10, 8, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 18, 19); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 205); break; case 205: { int oldIdx = _globals._sequenceIndexes[4]; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 10, 8, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 10, 8, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 20, 21); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[4], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 206); @@ -2595,7 +2595,7 @@ void Scene209::handleMonkeyEating() { _scene->_kernelMessages.setQuoted(msgIndex, 4, true); int oldIdx = _globals._sequenceIndexes[4]; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 15, 4, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 15, 4, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 26, 27); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[4], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 208); @@ -2605,7 +2605,7 @@ void Scene209::handleMonkeyEating() { case 208: { _scene->_kernelMessages.add(Common::Point(180, 39), 0xFDFC, 0, 0, 90, _game.getQuote(131)); int oldIdx = _globals._sequenceIndexes[4]; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 10, 4, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 10, 4, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 28, 29); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[4], oldIdx); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 209); @@ -3448,7 +3448,7 @@ void Scene209::actions() { _globals._spriteIndexes[11] = _scene->_sprites.addSprites("*RXMBD_2"); _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[11] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[11], false, 3, 2, 0, 0); + _globals._sequenceIndexes[11] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[11], false, 3, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[11]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_SPRITE, 4, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -3480,7 +3480,7 @@ void Scene209::actions() { _globals._spriteIndexes[10] = _scene->_sprites.addSprites("*RXMBD_8"); _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[10] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[10], false, 3, 2, 0, 0); + _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 3, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[10]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_SPRITE, 4, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -5297,7 +5297,7 @@ void Scene215::actions() { if (_globals[kSexOfRex] == REX_MALE) { _game._player._visible = false; _game._player._stepEnabled = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 6, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 4); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_LOOP, 0, 1); diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index bcedf95a27..478a733485 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -370,7 +370,7 @@ void Scene304::enter() { _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('a', 1)); _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('b', 0)); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 150, 0, 3, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 150, 0, 3, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 2); _vm->_palette->setEntry(252, 45, 63, 45); _vm->_palette->setEntry(253, 20, 45, 20); @@ -953,7 +953,7 @@ void Scene307::actions() { case 2: { int oldIdx = _globals._sequenceIndexes[5]; - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 12, 6, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 12, 6, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 2, 3); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[5], oldIdx); @@ -1245,7 +1245,7 @@ void Scene308::step() { switch (_game._trigger) { case 70: { _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 18, 9, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 18, 9, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 2, 3); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); _scene->_kernelMessages.reset(); @@ -1266,7 +1266,7 @@ void Scene308::step() { case 72: _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 20, 5, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 20, 5, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 3, 4); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); _scene->_kernelMessages.reset(); @@ -1284,7 +1284,7 @@ void Scene308::step() { case 74: { _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 20, 8, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 20, 8, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 6, 7); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); _scene->_kernelMessages.reset(); @@ -1306,7 +1306,7 @@ void Scene308::step() { case 76: { int seqIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 26, 0, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 26, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 2, 3); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 9); _scene->_kernelMessages.reset(); @@ -1441,7 +1441,7 @@ void Scene309::step() { case 70: { int idx = _scene->_dynamicHotspots.add(689, 690, _globals._sequenceIndexes[3], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(142, 146), FACING_NORTHEAST); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 4, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 4, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 2, 3); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71); @@ -1462,7 +1462,7 @@ void Scene309::step() { case 72: { int _oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 8, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 8, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 8, 11); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], _oldIdx); @@ -1484,7 +1484,7 @@ void Scene309::step() { case 74: { int _oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 6, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 6, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 21, 23); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], _oldIdx); @@ -1494,7 +1494,7 @@ void Scene309::step() { case 75: { int _oldIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 6, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 6, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 24, 25); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], _oldIdx); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); @@ -1513,7 +1513,7 @@ void Scene309::step() { break; case 77: { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 90, 0, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 90, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 29, 30); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 11); int idx = _scene->_kernelMessages.add(Common::Point(15, 46), 0xFDFC, 0, 0, 120, _game.getQuote(247)); @@ -1965,7 +1965,7 @@ void Scene316::handleRexInGrate() { case 1: _scene->_sequences.setDone(_globals._sequenceIndexes[4]); - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 12, 3, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 12, 3, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 2, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2085,7 +2085,7 @@ void Scene316::handleRoxInGrate() { case 1: _scene->_sequences.setDone(_globals._sequenceIndexes[5]); - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 17, 3, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 17, 3, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 2, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2523,7 +2523,7 @@ void Scene318::handleDialog() { case 0x19C: case 0x19D: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); _scene->_sequences.setPosition(_globals._sequenceIndexes[2], Common::Point(142, 121)); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 6, 8); @@ -2883,7 +2883,7 @@ void Scene318::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 8, 2, 0, 80); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 8, 2, 0, 80); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); _scene->_sequences.setPosition(_globals._sequenceIndexes[2], Common::Point(142, 121)); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 2, 5); @@ -3588,7 +3588,7 @@ void Scene320::setLeftView(int view) { _scene->_sequences.remove(_globals._sequenceIndexes[0]); if (view != 10) { - _globals._sequenceIndexes[0] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[view], false, 6, 0, 0, 18); + _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[view], false, 6, 0, 0, 18); _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 0); if (!_blinkFl) _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 2, 2); @@ -3752,7 +3752,7 @@ void Scene320::actions() { case 0: _game._player._stepEnabled = false; handleButtons(); - _globals._sequenceIndexes[18] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[18], _flippedFl, 4, 2, 0, 0); + _globals._sequenceIndexes[18] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[18], _flippedFl, 4, 2, 0, 0); _scene->_sequences.setScale(_globals._sequenceIndexes[18], 60); _scene->_sequences.setPosition(_globals._sequenceIndexes[18], Common::Point(_posX, 170)); _scene->_sequences.setDepth(_globals._sequenceIndexes[18], 0); @@ -4053,12 +4053,12 @@ void Scene351::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_FEMALE) { - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 5, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 5, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -4160,12 +4160,12 @@ void Scene352::putArmDown(bool corridorExit, bool doorwayExit) { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_FEMALE) { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 5, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 3); } else { - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 5, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 6, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 3); @@ -4305,7 +4305,7 @@ void Scene352::preActions() { _game._player._stepEnabled = false; _scene->_sequences.remove(_commonSequenceIdx); _vm->_sound->command(20); - _commonSequenceIdx = _scene->_sequences.startReverseCycle(_commonSpriteIndex, false, 6, 1, 0, 0); + _commonSequenceIdx = _scene->_sequences.startPingPongCycle(_commonSpriteIndex, false, 6, 1, 0, 0); _scene->_sequences.addSubEntry(_commonSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 1); _scene->_sequences.setDepth(_commonSequenceIdx, 15); } @@ -4364,7 +4364,7 @@ void Scene352::actions() { case 1: { _vm->_sound->command(21); - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 7, 2, 20, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 7, 2, 20, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[12], FACING_NORTH); int oldIdx = _commonSequenceIdx; _commonSequenceIdx = _scene->_sequences.startCycle(_commonSpriteIndex, false, -2); @@ -4376,7 +4376,7 @@ void Scene352::actions() { case 2: _vm->_sound->command(22); _scene->_sequences.remove(_commonSequenceIdx); - _commonSequenceIdx = _scene->_sequences.startReverseCycle(_commonSpriteIndex, false, 8, 1, 0, 0); + _commonSequenceIdx = _scene->_sequences.startPingPongCycle(_commonSpriteIndex, false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_commonSequenceIdx, 1, 3); _scene->_sequences.addSubEntry(_commonSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 3); break; @@ -4431,12 +4431,12 @@ void Scene352::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_FEMALE) { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 5, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 5, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -4478,7 +4478,7 @@ void Scene352::actions() { case 1: { _vm->_sound->command(21); - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 7, 2, 20, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 7, 2, 20, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 8); int oldIdx = _commonSequenceIdx; _commonSequenceIdx = _scene->_sequences.startCycle(_commonSpriteIndex, false, -2); @@ -4490,7 +4490,7 @@ void Scene352::actions() { case 2: _vm->_sound->command(23); _scene->_sequences.remove(_commonSequenceIdx); - _commonSequenceIdx = _scene->_sequences.startReverseCycle(_commonSpriteIndex, false, 8, 1, 0, 0); + _commonSequenceIdx = _scene->_sequences.startPingPongCycle(_commonSpriteIndex, false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_commonSequenceIdx, 1, 4); _scene->_sequences.addSubEntry(_commonSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 3); break; @@ -4545,13 +4545,13 @@ void Scene352::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_MALE) { - _globals._sequenceIndexes[14] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[14], false, 8, 1, 0, 0); + _globals._sequenceIndexes[14] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[14], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[14], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[14]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[14], SEQUENCE_TRIGGER_SPRITE, 2, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[14], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[15] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[15], false, 8, 1, 0, 0); + _globals._sequenceIndexes[15] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[15], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[15], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[15]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[15], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -4592,12 +4592,12 @@ void Scene352::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_MALE) { - _globals._sequenceIndexes[6] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[6], true, 6, 2, 0, 0); + _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], true, 6, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[6]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[7] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[7], true, 6, 2, 0, 0); + _globals._sequenceIndexes[7] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[7], true, 6, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[7]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -4980,12 +4980,12 @@ void Scene359::actions() { _game._player._visible = false; _vm->_dialogs->show(35920); if (_globals[kSexOfRex] == REX_MALE) { - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 4, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 4, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 6, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], true, 7, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], true, 7, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(106, 110)); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 6, 1); diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp index 56f6fb4466..8a9e510591 100644 --- a/engines/mads/nebular/nebular_scenes4.cpp +++ b/engines/mads/nebular/nebular_scenes4.cpp @@ -962,7 +962,7 @@ void Scene402::step() { } if (!_bartenderTalking) { - _globals._sequenceIndexes[10] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[10], false, 7, 0, 0, 0); + _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 7, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 3, 4); _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 8); int idx = _scene->_dynamicHotspots.add(NOUN_BARTENDER, VERB_WALKTO, _globals._sequenceIndexes[10], Common::Rect(0, 0, 0, 0)); @@ -1514,7 +1514,7 @@ void Scene402::step() { break; case 3: - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 4, 5); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 32); _rightWomanMoving = true; @@ -1697,7 +1697,7 @@ void Scene402::step() { _scene->_kernelMessages.add(Common::Point(171, 47), 0xFBFA, 0, 0, 130, _game.getQuote(0x200)); _scene->_sequences.addTimer(150, 63); _scene->_sequences.remove(_globals._sequenceIndexes[13]); - _globals._sequenceIndexes[13] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[13], false, 30, 4, 0, 0); + _globals._sequenceIndexes[13] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[13], false, 30, 4, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[13], 10, 11); _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 8); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 62); @@ -1769,7 +1769,7 @@ void Scene402::step() { case 69: { int seqIdx = _globals._sequenceIndexes[13]; - _globals._sequenceIndexes[13] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[13], false, 25, 4, 0, 0); + _globals._sequenceIndexes[13] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[13], false, 25, 4, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[13], 10, 11); _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 8); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[13], seqIdx); @@ -1783,7 +1783,7 @@ void Scene402::step() { break; case 70: - _globals._sequenceIndexes[13] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[13], false, 25, 4, 0, 0); + _globals._sequenceIndexes[13] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[13], false, 25, 4, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[13], 10, 12); _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 8); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 72); @@ -1840,7 +1840,7 @@ void Scene402::step() { _cutSceneReady = false; _helgaReady = false; _scene->_sequences.remove(_globals._sequenceIndexes[13]); - _globals._sequenceIndexes[13] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[13], false, 15, 2, 0, 0); + _globals._sequenceIndexes[13] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[13], false, 15, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[13], 11, 13); _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 8); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 26); @@ -1860,7 +1860,7 @@ void Scene402::step() { _cutSceneReady = false; _helgaReady = false; _scene->_sequences.remove(_globals._sequenceIndexes[13]); - _globals._sequenceIndexes[13] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[13], false, 15, 2, 0, 0); + _globals._sequenceIndexes[13] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[13], false, 15, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[13], 14, 15); _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 8); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 26); @@ -2069,7 +2069,7 @@ void Scene402::actions() { if (_game._trigger == 0) { _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[21] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[21], false, 7, 2, 0, 0); + _globals._sequenceIndexes[21] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[21], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[21], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[21]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[21], SEQUENCE_TRIGGER_SPRITE, 2, 165); @@ -2202,7 +2202,7 @@ void Scene402::actions() { _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[22] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[22], false, 7, 2, 0, 0); + _globals._sequenceIndexes[22] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[22], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[22], 1, 2); _scene->_sequences.setPosition(_globals._sequenceIndexes[22], Common::Point(_game._player._playerPos.x, _game._player._playerPos.y + 1)); _scene->_sequences.setDepth(_globals._sequenceIndexes[22], 5); @@ -2445,7 +2445,7 @@ void Scene405::step() { if (_game._trigger == 70) { _game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount ; _game._player._visible = true; - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 71); _vm->_sound->command(19); } @@ -2495,7 +2495,7 @@ void Scene405::actions() { _game._player._stepEnabled = false; _game._player._visible = false; _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 75); Common::Point msgPos = Common::Point(_game._player._playerPos.x, _game._player._playerPos.y + 1); @@ -2505,7 +2505,7 @@ void Scene405::actions() { _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 70); _scene->_sequences.setPosition(_globals._sequenceIndexes[3], _game._player._playerPos); @@ -2514,7 +2514,7 @@ void Scene405::actions() { _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 80); _scene->_sequences.setPosition(_globals._sequenceIndexes[3], _game._player._playerPos); @@ -2609,7 +2609,7 @@ void Scene406::enter() { else { _game._player._stepEnabled = false; _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 3, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 3, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 90); _vm->_sound->command(19); } @@ -2647,7 +2647,7 @@ void Scene406::step() { if (_game._trigger == 70) { _game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount; _game._player._visible = true; - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 4, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 4, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 71); _vm->_sound->command(19); } @@ -2703,7 +2703,7 @@ void Scene406::actions() { _game._player._stepEnabled = false; _game._player._visible = false; _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 75); Common::Point msgPos = Common::Point(_game._player._playerPos.x, _game._player._playerPos.y + 1); @@ -2713,7 +2713,7 @@ void Scene406::actions() { _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 70); Common::Point msgPos = Common::Point(_game._player._playerPos.x, _game._player._playerPos.y + 1); @@ -2723,7 +2723,7 @@ void Scene406::actions() { _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 110); _scene->_sequences.setPosition(_globals._sequenceIndexes[2], _game._player._playerPos); @@ -2934,7 +2934,7 @@ void Scene408::actions() { _vm->_sound->command(57); _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], true, 7, 2, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], true, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[1]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -3182,7 +3182,7 @@ void Scene410::actions() { _vm->_sound->command(57); _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 3, 1); @@ -3842,7 +3842,7 @@ void Scene411::actions() { _vm->_sound->command(57); _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[8] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[8], false, 7, 2, 0, 0); + _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[8]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -3879,7 +3879,7 @@ void Scene411::actions() { _vm->_sound->command(57); _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[8] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[8], false, 7, 2, 0, 0); + _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], false, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[8]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -4078,7 +4078,7 @@ void Scene413::enter() { case 1: _vm->_sound->command(30); _game._player._visible = false; - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 7, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 19); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 8); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 76); diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 66d8294fc6..fe15fe0636 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -132,7 +132,7 @@ void Scene501::handleSlotActions() { frameIndex = 2; } - _mainSequenceId = _scene->_sequences.startReverseCycle(_mainSpriteId, false, numTicks, 1, 0, 0); + _mainSequenceId = _scene->_sequences.startPingPongCycle(_mainSpriteId, false, numTicks, 1, 0, 0); _scene->_sequences.setAnimRange(_mainSequenceId, 1, frameIndex); _scene->_sequences.setMsgLayout(_mainSequenceId); _vm->_sound->command(10); @@ -238,7 +238,7 @@ void Scene501::step() { break; case 82: - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 7); _vm->_sound->command(12); _doorHotspotid = _scene->_dynamicHotspots.add(NOUN_DOOR, VERB_WALK_THROUGH, _globals._sequenceIndexes[3], Common::Rect(0, 0, 0, 0)); @@ -273,7 +273,7 @@ void Scene501::step() { case 72: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 73); break; @@ -415,7 +415,7 @@ void Scene501::actions() { case 7: { _vm->_sound->command(12); int syncIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 7); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], syncIdx); _vm->_sound->command(12); @@ -581,13 +581,13 @@ void Scene503::actions() { _game._player._stepEnabled = false; _game._player._visible = false; if (_globals[kSexOfRex] == REX_MALE) { - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 3, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], true, 8, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], true, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 4, 1); @@ -800,7 +800,7 @@ void Scene504::actions() { case 1: { int syncIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 6); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -913,7 +913,7 @@ void Scene505::enter() { _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('e', -1)); if (_scene->_priorSceneId != -2) - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 6, 1, 0, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 6, 1, 0, 0); _globals._sequenceIndexes[13] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[13], false, 6, 1, 120, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 60); @@ -996,7 +996,7 @@ void Scene505::step() { _scene->_sequences.remove(_globals._sequenceIndexes[1]); _scene->_sequences.remove(_globals._sequenceIndexes[0]); _scene->_sequences.remove(_globals._sequenceIndexes[13]); - _globals._sequenceIndexes[13] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[13], false, 6, 1, 0, 0); + _globals._sequenceIndexes[13] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[13], false, 6, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 63); _vm->_sound->command(18); } @@ -1260,7 +1260,7 @@ void Scene506::step() { case 71: _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 5); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 72); break; @@ -1317,7 +1317,7 @@ void Scene506::handleDoorSequences() { case 82: _scene->_sequences.remove(_doorSequenceIdx); - _doorSequenceIdx = _scene->_sequences.startReverseCycle(_doorSpriteIdx, false, 7, 1, 0, 0); + _doorSequenceIdx = _scene->_sequences.startPingPongCycle(_doorSpriteIdx, false, 7, 1, 0, 0); _scene->_sequences.setDepth(_doorSequenceIdx, _doorDepth); if (_actionFl) _scene->_sequences.addSubEntry(_doorSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 84); @@ -1487,7 +1487,7 @@ void Scene507::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 5); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 5, 1); @@ -1613,7 +1613,7 @@ void Scene508::enter() { _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 11); int idx = _scene->_dynamicHotspots.add(NOUN_LASER_BEAM, VERB_WALKTO, _globals._sequenceIndexes[4], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(57, 116), FACING_NORTHEAST); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 15, 0, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 15, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 6, 8); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 6); if (_globals[kLaserHoleIsThere]) { @@ -1659,7 +1659,7 @@ void Scene508::handlePedestral() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[6] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[6], false, 9, 1, 0, 0); + _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], false, 9, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 4); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[6]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_SPRITE, 4, 1); @@ -1732,7 +1732,7 @@ void Scene508::actions() { break; case 4: - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 15, 0, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 15, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 6, 8); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 6); break; @@ -2024,7 +2024,7 @@ void Scene511::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -2257,7 +2257,7 @@ void Scene512::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 5, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2293,7 +2293,7 @@ void Scene512::actions() { case 1: _game._player._visible = false; - _globals._sequenceIndexes[8] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[8], false, 9, 1, 0, 0); + _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], false, 9, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[8]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2326,7 +2326,7 @@ void Scene512::actions() { break; case 5: - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 14, 0, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 14, 0, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 3); _scene->_hotspots.activate(NOUN_PADLOCK_KEY, true); _scene->_sequences.addTimer(60, 6); @@ -2347,7 +2347,7 @@ void Scene512::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 10, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 10, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1); @@ -2358,12 +2358,12 @@ void Scene512::actions() { _game._player._visible = true; if (!_game._objects.isInRoom(OBJ_PADLOCK_KEY) || _game._difficulty == DIFFICULTY_EASY) { _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 12, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 12, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); } else { _scene->_sequences.remove(_globals._sequenceIndexes[5]); - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 12, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 12, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 3); _scene->_hotspots.activate(NOUN_PADLOCK_KEY, false); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2391,7 +2391,7 @@ void Scene512::actions() { else endVal = 2; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 10, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 10, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, endVal); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, endVal, 1); @@ -2529,7 +2529,7 @@ void Scene513::step() { case 80: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2); _vm->_sound->command(24); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 81); @@ -2588,7 +2588,7 @@ void Scene513::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -2626,7 +2626,7 @@ void Scene513::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 7, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 1); @@ -2636,7 +2636,7 @@ void Scene513::actions() { _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[4]); _game._player._visible = true; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2); _vm->_sound->command(24); _scene->_kernelMessages.reset(); diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 679039535f..b0777c13c3 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -130,7 +130,7 @@ void Scene601::step() { case 71: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 3); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 72); break; @@ -313,7 +313,7 @@ void Scene602::handleSafeActions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], true, 12, 1, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 12, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 3, 1); @@ -348,7 +348,7 @@ void Scene602::handleSafeActions() { else _lastSpriteIdx = _globals._spriteIndexes[3]; - _lastSequenceIdx = _scene->_sequences.startReverseCycle(_lastSpriteIdx, false, 12, 1, 0, 0); + _lastSequenceIdx = _scene->_sequences.startPingPongCycle(_lastSpriteIdx, false, 12, 1, 0, 0); _scene->_sequences.setDepth(_lastSequenceIdx, 14); if (_game._objects[OBJ_DOOR_KEY]._roomNumber == _scene->_currentSceneId) _scene->_hotspots.activate(NOUN_DOOR_KEY, false); @@ -460,7 +460,7 @@ void Scene602::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], true, 8, 1, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 3, 1); @@ -600,7 +600,7 @@ void Scene603::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 8, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 5); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 5, 1); @@ -858,7 +858,7 @@ void Scene604::handleBombActions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 9, 1, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 9, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); if (_bombMode == 1) @@ -908,7 +908,7 @@ void Scene604::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -1003,12 +1003,12 @@ void Scene605::enter() { _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('n', -1)); _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('f', -1)); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 15, 0, 0, 0); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 17, 0, 0, 0); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 14, 0, 0, 0); - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 13, 0, 0, 0); - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 17, 0, 0, 0); - _globals._sequenceIndexes[6] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[6], false, 18, 0, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 15, 0, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 17, 0, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 14, 0, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 13, 0, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 17, 0, 0, 0); + _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], false, 18, 0, 0, 0); _game._player._visible = false; _game._player._stepEnabled = false; @@ -1164,7 +1164,7 @@ void Scene607::step() { && !_dogBarking && (_vm->getRandomNumber(1, 50) == 10)) { _dogBarking = true; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 5, 8, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 8, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 6); _scene->_kernelMessages.reset(); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 2, 100); @@ -1250,7 +1250,7 @@ void Scene607::step() { case 61: { int syncIdx = _globals._sequenceIndexes[4]; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 15, 3, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 15, 3, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 46, -2); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 1); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[4], syncIdx); @@ -1397,7 +1397,7 @@ void Scene607::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -1791,7 +1791,7 @@ void Scene608::enter() { if (!_dogUnderCar) resetDogVariables(); else { - _globals._sequenceIndexes[10] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[10], false, 9, 0, 0, 0); + _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 9, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 10, 11); _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 6); } @@ -1833,7 +1833,7 @@ void Scene608::step() { if (_vm->getRandomNumber(1, 50) == 10) { _dogBarkingFl = true; _scene->_sequences.remove(_globals._sequenceIndexes[5]); - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 5, 8, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 5, 8, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 4); int idx = _scene->_dynamicHotspots.add(NOUN_OBNOXIOUS_DOG, VERB_WALKTO, _globals._sequenceIndexes[5], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 142), FACING_EAST); @@ -1958,7 +1958,7 @@ void Scene608::step() { _game._player._visible = true; _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; } else if (_carFrame == 41) { - _globals._sequenceIndexes[10] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[10], false, 9, 0, 0, 0); + _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 9, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 10, 11); _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 6); _dogUnderCar = true; @@ -2148,7 +2148,7 @@ void Scene608::step() { case 82: { int syncIdx = _globals._sequenceIndexes[9]; - _globals._sequenceIndexes[9] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[9], false, 15, 5, 0, 0); + _globals._sequenceIndexes[9] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[9], false, 15, 5, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[9], 39, 40); _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 5); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[9], syncIdx); @@ -2219,7 +2219,7 @@ void Scene608::actions() { if ((_globals[kCarStatus] == CAR_UP) || (_globals[kCarStatus] == CAR_SQUASHES_DOG) || (_globals[kCarStatus] == CAR_SQUASHES_DOG_AGAIN)) { _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], true, 6, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], true, 6, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 1); @@ -2293,7 +2293,7 @@ void Scene608::actions() { if ((_globals[kCarStatus] == CAR_DOWN) || (_globals[kCarStatus] == CAR_DOWN_ON_SQUASHED_DOG)) { _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], true, 6, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], true, 6, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 3); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 1); @@ -2379,7 +2379,7 @@ void Scene608::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], true, 6, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], true, 6, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 4, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2407,7 +2407,7 @@ void Scene608::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], true, 6, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], true, 6, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -2574,7 +2574,7 @@ void Scene609::step() { case 62: _scene->_sequences.remove( _globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_hotspots.activate(NOUN_VIDEO_STORE_DOOR, true); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 9); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 63); @@ -2582,7 +2582,7 @@ void Scene609::step() { case 63: if (!_globals[kHasTalkedToHermit] && (_game._difficulty != DIFFICULTY_HARD)) { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 26, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 26, 2, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 7); _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(287, 73)); _scene->_sequences.setScale(_globals._sequenceIndexes[3], 47); @@ -2605,7 +2605,7 @@ void Scene609::step() { case 71: if (!_globals[kHasTalkedToHermit]) { - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 26, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 26, 2, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 7); _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(287, 73)); _scene->_sequences.setScale(_globals._sequenceIndexes[3], 47); @@ -2648,7 +2648,7 @@ void Scene609::enterStore() { case 2: _game._player._visible = false; - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], true, 11, 2, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 11, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 3); @@ -2690,7 +2690,7 @@ void Scene609::enterStore() { case 7: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 9); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 8); break; @@ -2766,7 +2766,7 @@ void Scene609::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 5); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -2922,7 +2922,7 @@ void Scene610::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], true, 8, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], true, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -2952,7 +2952,7 @@ void Scene610::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], true, 8, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], true, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -4012,7 +4012,7 @@ void Scene611::step() { _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 81); } else if (_game._trigger == 81) { int syncId = _globals._sequenceIndexes[1]; - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 20, 0, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 20, 0, 0, 0); int idx = _scene->_dynamicHotspots.add(NOUN_RAT, VERB_WALKTO, _globals._sequenceIndexes[1], Common::Rect(0, 0, 0, 0)); _ratHotspotId = _scene->_dynamicHotspots.setPosition(idx, Common::Point(272, 154), FACING_SOUTHEAST); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 9, 10); @@ -4040,7 +4040,7 @@ void Scene611::step() { break; case 6: - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 12, 3, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 12, 3, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 2, 4); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 71); @@ -4260,7 +4260,7 @@ void Scene611::step() { if (_hermitMode == 6) { if ((_scene->_activeAnimation->getCurrentFrame() == 9) && _check1Fl) { _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 112); @@ -4300,7 +4300,7 @@ void Scene611::step() { _resetBatterieText = true; int syncIdx = _globals._sequenceIndexes[3]; _nextFrame = 10; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 7, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 2); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], syncIdx); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); @@ -4488,7 +4488,7 @@ void Scene612::handleWinchMovement() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 10, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 10, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 5); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[4]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 5, 1); @@ -4506,7 +4506,7 @@ void Scene612::handleWinchMovement() { _globals[kBoatRaised] = false; } else { _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 17, 9, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 17, 9, 0, 0); _vm->_sound->command(18); } _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); @@ -4608,7 +4608,7 @@ void Scene612::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 0f019c4b19..4838ee27d9 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -148,11 +148,11 @@ void Scene701::enter() { switch (boatStatus) { case BOAT_TIED_FLOATING: - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 20, 0, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 20, 0, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 10); break; case BOAT_ADRIFT: - _globals._sequenceIndexes[6] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[6], false, 20, 0, 0, 0); + _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], false, 20, 0, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 10); break; case BOAT_TIED: @@ -206,7 +206,7 @@ void Scene701::step() { switch(_game._trigger) { case 60: _scene->_sequences.remove(_globals._sequenceIndexes[5]); - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], false, 6, 1, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 6, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[5], Common::Point(155, 129)); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 61); break; @@ -326,7 +326,7 @@ void Scene701::actions() { case 3: _vm->_sound->command(17); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(48, 136)); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 4); @@ -502,7 +502,7 @@ void Scene702::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 5, 2, 0, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[12]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_SPRITE, 4, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -1218,7 +1218,7 @@ void Scene704::handleFillBottle(int quote) { void Scene704::enter() { if (_game._objects[OBJ_BOTTLE]._roomNumber == _scene->_currentSceneId) { _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('b', 0)); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 6, 0, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 0, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1); if (_scene->_priorSceneId == 705) { _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(123, 125)); @@ -1585,7 +1585,7 @@ void Scene705::enter() { void Scene705::step() { switch (_game._trigger) { case 70: - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71); break; @@ -1798,7 +1798,7 @@ void Scene706::handleTakeVase() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[3] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[3], false, 4, 2, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 4, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[3]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 7, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2087,7 +2087,7 @@ void Scene710::enter() { if (_game._objects[OBJ_VASE]._roomNumber == 706) { _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('g', -1)); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 6, 0, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 0, 0, 0); } _game._player._visible = false; @@ -2248,7 +2248,7 @@ void Scene751::step() { switch (_game._trigger) { case 70: _scene->_sequences.remove(_globals._sequenceIndexes[4]); - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 6, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 6, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(155, 129)); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 71); break; @@ -2287,7 +2287,7 @@ void Scene751::step() { case 62: _vm->_sound->command(17); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(48, 136)); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 63); @@ -2329,7 +2329,7 @@ void Scene751::preActions() { _game._player._readyToWalk = false; _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 11, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 11, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, 7); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -2398,7 +2398,7 @@ void Scene751::actions() { case 3: _vm->_sound->command(17); - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(48, 136)); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 4); @@ -2597,7 +2597,7 @@ void Scene752::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 5, 2, 0, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[12]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_SPRITE, 4, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_EXPIRE, 0, 2); @@ -2622,7 +2622,7 @@ void Scene752::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[12] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[12], false, 5, 2, 0, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 5, 2, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[12]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_SPRITE, 4, 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_EXPIRE, 0, 2); diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 7e8366c179..95b3c24938 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -145,7 +145,7 @@ void Scene801::enter() { case 2: _game._player._playerPos = Common::Point(8, 117); _globals[kTeleporterUnderstood] = true; - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 8, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 13); _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 8090); @@ -283,7 +283,7 @@ void Scene801::actions() { _globals[kBetweenRooms] = true; _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 4, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 4, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 90); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 5); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 13); @@ -419,7 +419,7 @@ void Scene802::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], true, 7, 2, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], true, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[2]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 2, 1); @@ -451,7 +451,7 @@ void Scene802::actions() { case 0: _game._player._stepEnabled = false; _game._player._visible = false; - _globals._sequenceIndexes[5] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[5], true, 7, 2, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 7, 2, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 4); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 4, 1); @@ -692,7 +692,7 @@ void Scene803::step() { if (_game._trigger == 90) { int syncIdx = _globals._sequenceIndexes[4]; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 15, 0, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 15, 0, 0, 0); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[4], syncIdx); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 4, 9); if (_globals[kHoppyDead]) @@ -726,7 +726,7 @@ void Scene803::step() { if (_game._trigger == 150) { _scene->_sequences.remove(_globals._sequenceIndexes[6]); _vm->_sound->command(18); - _globals._sequenceIndexes[6] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[6], false, 8, 1, 0, 0); + _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 19); _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 151); @@ -778,7 +778,7 @@ void Scene803::actions() { case 162: _scene->_sequences.remove(_globals._sequenceIndexes[9]); - _globals._sequenceIndexes[9] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[9], true, 6, 1, 0, 0); + _globals._sequenceIndexes[9] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[9], true, 6, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[9], 1, 4); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[9]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 163); @@ -899,7 +899,7 @@ void Scene804::enter() { _scene->_sequences.addTimer(60, 100); } else { _globals._sequenceIndexes[6] = _scene->_sequences.startCycle(_globals._spriteIndexes[6], false, 1); - _globals._sequenceIndexes[7] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[7], false, 4, 0, 0, 0); + _globals._sequenceIndexes[7] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[7], false, 4, 0, 0, 0); _scene->_sequences.addTimer(160, 70); _game._player._stepEnabled = false; } @@ -1277,14 +1277,14 @@ void Scene805::actions() { } else if (_action.isAction(VERB_REMOVE, NOUN_SHIELD_MODULATOR) && _globals[kShieldModInstalled]) { _scene->_sequences.remove(_globals._sequenceIndexes[1]); _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _globals._sequenceIndexes[1] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[1], false, 7, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 71); _game._player._stepEnabled = false; } else if (_action.isAction(VERB_REMOVE, NOUN_TARGET_MODULE) && _globals[kTargetModInstalled]) { _scene->_sequences.remove(_globals._sequenceIndexes[2]); _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _globals._sequenceIndexes[2] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 81); _game._player._stepEnabled = false; @@ -1433,7 +1433,7 @@ void Scene808::actions() { _vm->_sound->command(20); _vm->_sound->command(25); } - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(248, 211)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 71); @@ -1468,7 +1468,7 @@ void Scene808::actions() { _vm->_sound->command(20); } _globals[kTopButtonPushed] = false; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(248, 186)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 91); @@ -1499,7 +1499,7 @@ void Scene808::actions() { _vm->_sound->command(20); } _globals[kTopButtonPushed] = true; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(248, 163)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 81); @@ -1516,7 +1516,7 @@ void Scene808::actions() { switch (_game._trigger) { case 0: _game._player._stepEnabled = false; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 4, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 2, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(168, 211)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 70); @@ -1533,7 +1533,7 @@ void Scene808::actions() { switch (_game._trigger) { case 0: _game._player._stepEnabled = false; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 4, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 2, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(172, 163)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 80); @@ -1550,7 +1550,7 @@ void Scene808::actions() { switch (_game._trigger) { case 0: _game._player._stepEnabled = false; - _globals._sequenceIndexes[4] = _scene->_sequences.startReverseCycle(_globals._spriteIndexes[4], false, 4, 2, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 2, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(172, 186)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 90); diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp index c94f3e3ad4..ab73d70b10 100644 --- a/engines/mads/sequence.cpp +++ b/engines/mads/sequence.cpp @@ -466,15 +466,15 @@ int SequenceList::startCycle(int srcSpriteIndex, bool flipped, int cycleIndex) { return result; } -int SequenceList::startReverseCycle(int srcSpriteIndex, bool flipped, int numTicks, +int SequenceList::startPingPongCycle(int srcSpriteIndex, bool flipped, int numTicks, int triggerCountdown, int timeoutTicks, int extraTicks) { SpriteAsset *sprites = _vm->_game->_scene._sprites[srcSpriteIndex]; MSprite *frame = sprites->getFrame(0); int depth = _vm->_game->_scene._depthSurface.getDepth(Common::Point( frame->_offset.x + frame->w / 2, frame->_offset.y + frame->h / 2)); - return add(srcSpriteIndex, flipped, sprites->getCount(), triggerCountdown, timeoutTicks, - extraTicks, numTicks, 0, 0, true, 100, depth - 1, -1, ANIMTYPE_REVERSIBLE, 0, 0); + return add(srcSpriteIndex, flipped, 1, triggerCountdown, timeoutTicks, + extraTicks, numTicks, 0, 0, true, 100, depth - 1, 1, ANIMTYPE_PING_PONG, 0, 0); } void SequenceList::updateTimeout(int spriteIdx, int seqIndex) { diff --git a/engines/mads/sequence.h b/engines/mads/sequence.h index ee587ff02d..9603296717 100644 --- a/engines/mads/sequence.h +++ b/engines/mads/sequence.h @@ -38,7 +38,7 @@ enum SequenceTrigger { SEQUENCE_TRIGGER_SPRITE = 2 // Trigger when sequence reaches specific sprite }; -enum SpriteAnimType { ANIMTYPE_NONE = 0, ANIMTYPE_CYCLED = 1, ANIMTYPE_REVERSIBLE = 2 }; +enum SpriteAnimType { ANIMTYPE_NONE = 0, ANIMTYPE_CYCLED = 1, ANIMTYPE_PING_PONG = 2 }; #define SEQUENCE_ENTRY_SUBSET_MAX 5 @@ -117,7 +117,7 @@ public: int triggerCountdown = 0, int timeoutTicks = 0, int extraTicks = 0); int startCycle(int srcSpriteIdx, bool flipped, int cycleIndex); - int startReverseCycle(int srcSpriteIndex, bool flipped, int numTicks, + int startPingPongCycle(int srcSpriteIndex, bool flipped, int numTicks, int triggerCountdown = 0, int timeoutTicks = 0, int extraTicks = 0); void updateTimeout(int spriteIdx, int seqIndex); void setScale(int spriteIdx, int scale); -- cgit v1.2.3 From cecb9a9ecc1ec1897fdd27e1bafc7f6d494cd6af Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 Mar 2015 18:55:05 -0500 Subject: MADS: Fix crash throwing bones to dog --- engines/mads/player.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index 8720aeead3..a257cea264 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -790,9 +790,7 @@ void Player::removePlayerSprites() { } } - if (scene._activeAnimation != nullptr) - scene._activeAnimation->resetSpriteSetsCount(); - + scene._spriteSlots.clear(); scene._spriteSlots.fullRefresh(); _visible = false; } -- cgit v1.2.3 From 0780ec95c2a035d122e2afba1beb2143033943a6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 Mar 2015 20:43:57 -0500 Subject: MADS: Fix Herman animating too quickly --- engines/mads/animation.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index 469d42cc1b..7e616bffbc 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -598,8 +598,6 @@ void Animation::setCurrentFrame(int frameNumber) { _currentFrame = frameNumber; _oldFrameEntry = 0; _freeFlag = false; - - _nextScrollTimer = _nextFrameTimer = _vm->_game->_scene._frameStartTime; } void Animation::setNextFrameTimer(int frameNumber) { -- cgit v1.2.3 From 16ced34bc2a21c99f775103008da0f1caf99e26d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 Mar 2015 20:54:35 -0500 Subject: MADS: Fix assert when there are more than 5 talk options available --- engines/mads/user_interface.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 929390a073..a53ab31968 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -843,10 +843,11 @@ void UserInterface::emptyConversationList() { } void UserInterface::addConversationMessage(int vocabId, const Common::String &msg) { - assert(_talkStrings.size() < 5); - - _talkStrings.push_back(msg); - _talkIds.push_back(vocabId); + // Only allow a maximum of 5 talk entries to be displayed + if (_talkStrings.size() < 5) { + _talkStrings.push_back(msg); + _talkIds.push_back(vocabId); + } } void UserInterface::loadInventoryAnim(int objectId) { -- cgit v1.2.3 From 51797d1438e1e0e34e5878e9b6e759870d7b016d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 Mar 2015 21:30:04 -0500 Subject: MADS: Fix gender scanning animation in car --- engines/mads/nebular/nebular_scenes5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index fe15fe0636..63b03bc097 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -800,7 +800,7 @@ void Scene504::actions() { case 1: { int syncIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 6); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2); -- cgit v1.2.3 From ce4c030117ece5f9c0d0384556f82125b2a5ed29 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 Mar 2015 21:51:01 -0500 Subject: MADS: Fix animations for opening car door at various car locations --- engines/mads/nebular/nebular_scenes5.cpp | 4 ++-- engines/mads/nebular/nebular_scenes6.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 63b03bc097..b657a61c2f 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -2024,7 +2024,7 @@ void Scene511::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -2588,7 +2588,7 @@ void Scene513::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index b0777c13c3..cb36064458 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -908,7 +908,7 @@ void Scene604::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -1397,7 +1397,7 @@ void Scene607::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; -- cgit v1.2.3 From bb175b39c1aa9f6b03431bc2e89817ec138f91c3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 Mar 2015 07:40:47 -0500 Subject: MADS: Fix screwed up death animation when getting eaten in village stream --- engines/mads/player.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index a257cea264..68e0355df9 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -785,8 +785,10 @@ void Player::removePlayerSprites() { int heroSpriteId = _spritesStart; for (int i = 0; i < 8; i++) { if (_spriteSetsPresent[i]) { - scene._sprites.remove(heroSpriteId++); + delete scene._sprites[heroSpriteId]; + scene._sprites[heroSpriteId] = nullptr; _spriteSetsPresent[i] = false; + ++heroSpriteId; } } -- cgit v1.2.3 From b84d2e8d73c18c427ef1527b2b066642cfc981c4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 Mar 2015 07:49:00 -0500 Subject: MADS: Fix timer initialization in two scenes --- engines/mads/nebular/nebular_scenes2.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index b8629a3915..2eb7f93a60 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -1152,8 +1152,9 @@ void Scene205::setup() { } Scene205::Scene205(MADSEngine *vm) : Scene2xx(vm) { - _lastFishTime = 0; - _chickenTime = 0; + _lastFishTime = _scene->_frameStartTime; + _chickenTime = _scene->_frameStartTime; + _beingKicked = false; _kernelMessage = -1; } @@ -1161,8 +1162,6 @@ Scene205::Scene205(MADSEngine *vm) : Scene2xx(vm) { void Scene205::synchronize(Common::Serializer &s) { Scene2xx::synchronize(s); - s.syncAsUint32LE(_lastFishTime); - s.syncAsUint32LE(_chickenTime); s.syncAsByte(_beingKicked); s.syncAsSint16LE(_kernelMessage); } @@ -1191,7 +1190,6 @@ void Scene205::enter() { _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 11); if (!_game._visitedScenes._sceneRevisited) { - _lastFishTime = _scene->_frameStartTime; _globals._sequenceIndexes[6] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], false, 7, 1, 0, 0); idx = _scene->_dynamicHotspots.add(269, 13, _globals._sequenceIndexes[6], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(49, 86), FACING_NORTH); @@ -1455,7 +1453,6 @@ Scene207::Scene207(MADSEngine *vm) : Scene2xx(vm) { void Scene207::synchronize(Common::Serializer &s) { Scene2xx::synchronize(s); - uint32 unused; s.syncAsByte(_vultureFl); s.syncAsByte(_spiderFl); @@ -1463,8 +1460,6 @@ void Scene207::synchronize(Common::Serializer &s) { s.syncAsSint32LE(_spiderHotspotId); s.syncAsSint32LE(_vultureHotspotId); - s.syncAsSint32LE(unused); - s.syncAsSint32LE(unused); } void Scene207::setup() { -- cgit v1.2.3 From f501e91ed1490fde5227015dc02fbe6c0cee2b5f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 Mar 2015 09:12:20 -0500 Subject: MADS: Fix crash after throwing both bones to dog --- engines/mads/sprites.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index f74edafc93..aa73fce712 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -406,7 +406,7 @@ void SpriteSets::remove(int idx) { } while (size() > 0 && (*this)[size() - 1] == nullptr); } - if (_assetCount > 0) + if (idx < 50 && _assetCount > 0) --_assetCount; } } -- cgit v1.2.3 From 3fae9f17dacaa4f8253c2f6b47adb9845cdb52b0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 Mar 2015 12:16:24 -0500 Subject: MADS: Show a warning if sound code reads beyond end of sound data blocks --- engines/mads/nebular/sound_nebular.cpp | 24 ++++++++++++++++++++++++ engines/mads/nebular/sound_nebular.h | 20 ++++++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp index 0a054440b2..d41d0075eb 100644 --- a/engines/mads/nebular/sound_nebular.cpp +++ b/engines/mads/nebular/sound_nebular.cpp @@ -36,6 +36,7 @@ namespace Nebular { bool AdlibChannel::_channelsEnabled; AdlibChannel::AdlibChannel() { + _owner = nullptr; _activeCount = 0; _field1 = 0; _field2 = 0; @@ -55,6 +56,7 @@ AdlibChannel::AdlibChannel() { _pSrc = nullptr; _ptr3 = nullptr; _ptr4 = nullptr; + _ptrEnd = nullptr; _field17 = 0; _field19 = 0; _soundData = nullptr; @@ -108,6 +110,9 @@ void AdlibChannel::load(byte *pData) { _fieldB = 0; _field17 = 0; _field19 = 0; + + CachedDataEntry &cacheEntry = _owner->getCachedData(pData); + _ptrEnd = cacheEntry._dataEnd; } void AdlibChannel::check(byte *nullPtr) { @@ -192,6 +197,9 @@ ASound::ASound(Audio::Mixer *mixer, FM_OPL *opl, const Common::String &filename, _channelData[i]._freqBase = 0; _channelData[i]._field6 = 0; } + + for (int i = 0; i < ADLIB_CHANNEL_COUNT; ++i) + _channels[i]._owner = this; AdlibChannel::_channelsEnabled = false; @@ -283,6 +291,17 @@ void ASound::noise() { } } +CachedDataEntry &ASound::getCachedData(byte *pData) { + Common::List::iterator i; + for (i = _dataCache.begin(); i != _dataCache.end(); ++i) { + CachedDataEntry &e = *i; + if (e._data == pData) + return e; + } + + error("Could not find previously loaded data"); +} + void ASound::write(int reg, int val) { _queue.push(RegisterValue(reg, val)); } @@ -331,6 +350,7 @@ byte *ASound::loadData(int offset, int size) { CachedDataEntry rec; rec._offset = offset; rec._data = new byte[size]; + rec._dataEnd = rec._data + size - 1; _soundFile.seek(_dataOffset + offset); _soundFile.read(rec._data, size); _dataCache.push_back(rec); @@ -449,6 +469,10 @@ void ASound::pollActiveChannel() { warning("pollActiveChannel(): No data found for sound channel"); break; } + if (pSrc > chan->_ptrEnd) { + warning("Read beyond end of loaded sound data"); + } + if (!(*pSrc & 0x80) || (*pSrc <= 0xF0)) { if (updateFlag) updateActiveChannel(); diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h index ccfd40ad52..cfacb211a4 100644 --- a/engines/mads/nebular/sound_nebular.h +++ b/engines/mads/nebular/sound_nebular.h @@ -37,11 +37,15 @@ class SoundManager; namespace Nebular { +class ASound; + /** * Represents the data for a channel on the Adlib */ class AdlibChannel { public: + ASound *_owner; + int _activeCount; int _field1; int _field2; @@ -61,6 +65,7 @@ public: byte *_pSrc; byte *_ptr3; byte *_ptr4; + byte *_ptrEnd; int _field17; int _field19; byte *_soundData; @@ -128,15 +133,17 @@ struct RegisterValue { #define ADLIB_CHANNEL_MIDWAY 5 #define CALLBACKS_PER_SECOND 60 +struct CachedDataEntry { + int _offset; + byte *_data; + byte *_dataEnd; +}; + /** * Base class for the sound player resource files */ class ASound : public Audio::AudioStream { private: - struct CachedDataEntry { - int _offset; - byte *_data; - }; Common::List _dataCache; uint16 _randomSeed; @@ -350,6 +357,11 @@ public: */ int getFrameCounter() { return _frameCounter; } + /** + * Return the cached data block record for previously loaded sound data + */ + CachedDataEntry &getCachedData(byte *pData); + // AudioStream interface /** * Main buffer read -- cgit v1.2.3 From c0fafcf33f374fdf85590108835585a0411a0661 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 Mar 2015 12:24:25 -0500 Subject: MADS: Fix mismatched delete/free releasing screen surface --- engines/mads/screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 60f3d8aeaf..8db034c467 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -569,7 +569,7 @@ void ScreenSurface::init() { } ScreenSurface::~ScreenSurface() { - delete[] _surfacePixels; + ::free(_surfacePixels); } void ScreenSurface::copyRectToScreen(const Common::Rect &bounds) { -- cgit v1.2.3 From 76e824eddca2afbdccd109c3c3311e8af0f2bd83 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 5 Mar 2015 17:42:16 -0500 Subject: MADS: Bugfixes and cleanup for Herman conversation --- engines/mads/nebular/globals_nebular.h | 2 +- engines/mads/nebular/nebular_scenes6.cpp | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h index bd1c6d84b0..ce671f653d 100644 --- a/engines/mads/nebular/globals_nebular.h +++ b/engines/mads/nebular/globals_nebular.h @@ -148,7 +148,7 @@ enum GlobalId { /* Section #6 Variables */ kConvHermit1 = 130, - kconvHermit2 = 131, + kConvHermit2 = 131, kHasTalkedToHermit = 132, kExecuted_1_11 = 133, kHandsetCellStatus = 134, diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index cb36064458..5ef175d396 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -3253,6 +3253,8 @@ void Scene611::handleSubDialog1() { handleTalking(500); displayHermitQuestions(17); _dialog1.write(0x290, false); + _dialog1.write(0x28e, false); + if (!_dialog1.read(0x28F)) _dialog1.write(0x291, true); @@ -3271,8 +3273,10 @@ void Scene611::handleSubDialog1() { if ((_game._objects.isInInventory(OBJ_DURAFAIL_CELLS)) || (_game._objects.isInInventory(OBJ_PHONE_CELLS))) _dialog1.write(0x294, true); - if (!_game._objects.isInInventory(OBJ_DURAFAIL_CELLS) && !_game._objects.isInInventory(OBJ_PHONE_CELLS)) - _globals[kExecuted_1_11] = true; + // WORKAROUND: Fix bug in the original where the option to give Hermit batteries + // would be given before the player even has any batteries + //if (!_game._objects.isInInventory(OBJ_DURAFAIL_CELLS) && !_game._objects.isInInventory(OBJ_PHONE_CELLS)) + // _globals[kExecuted_1_11] = true; setDialogNode(1); break; @@ -3921,14 +3925,14 @@ void Scene611::enter() { 0x2D9, 0x2DA, 0x2DB, 0x2DC, 0x2DD, 0x2DE, 0x2DF, 0x2E0, 0x2E1, 0x2E2, 0x2E3, 0x2E4, 0x2E5, 0x2E6, 0x323, 0x324, 0); - _dialog1.setup(0x82, 0x287, 0x288, 0x289, 0x28A, 0x28B, 0x28C, 0x28D, 0x28E, 0x28F, 0x290, + _dialog1.setup(kConvHermit1, 0x287, 0x288, 0x289, 0x28A, 0x28B, 0x28C, 0x28D, 0x28E, 0x28F, 0x290, 0x291, 0x292, 0x293, 0x294, 0x295, 0x296, 0); - _dialog2.setup(0x83, 0x29C, 0x29D, 0x29E, 0x29F, 0); + _dialog2.setup(kConvHermit2, 0x29C, 0x29D, 0x29E, 0x29F, 0); if (!_game._visitedScenes._sceneRevisited) { - _dialog1.set(0x82, 0x287, 0x288, 0x296, 0); - _dialog2.set(0x83, 0x29F, 0); + _dialog1.set(kConvHermit1, 0x287, 0x288, 0x296, 0); + _dialog2.set(kConvHermit2, 0x29F, 0); } _vm->_palette->setEntry(252, 51, 51, 47); @@ -3964,12 +3968,14 @@ void Scene611::enter() { _scene->_hotspots.activate(NOUN_HERMIT, false); } - // CHECKME: The last line of the block looks extremely useless + /* WORKAROUND: Pretty sure this is a debugging code fragment that should be ignored if (_globals[kExecuted_1_11]) { _dialog1.write(0x294, true); _dialog1.write(0x292, false); _globals[kExecuted_1_11] = true; - } + }*/ + if ((_game._objects.isInInventory(OBJ_DURAFAIL_CELLS)) || (_game._objects.isInInventory(OBJ_PHONE_CELLS))) + _dialog1.write(0x294, true); if (_duringDialogFl) { _game._player._playerPos = Common::Point(237, 129); -- cgit v1.2.3 From 4c88d81cc2cbaf244922f01466447a1cef60f7fa Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 08:30:26 -0500 Subject: MADS: Fix another incorrect car door opening animation --- engines/mads/nebular/nebular_scenes6.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 5ef175d396..b50032352f 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -4614,7 +4614,7 @@ void Scene612::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; -- cgit v1.2.3 From 763a962e1456fd8402be4992ab9069e9e507ebc8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 08:39:39 -0500 Subject: MADS: Fix animation of lab door opening --- engines/mads/nebular/nebular_scenes5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index b657a61c2f..4fc603b607 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -1317,7 +1317,7 @@ void Scene506::handleDoorSequences() { case 82: _scene->_sequences.remove(_doorSequenceIdx); - _doorSequenceIdx = _scene->_sequences.startPingPongCycle(_doorSpriteIdx, false, 7, 1, 0, 0); + _doorSequenceIdx = _scene->_sequences.addReverseSpriteCycle(_doorSpriteIdx, false, 7, 1, 0, 0); _scene->_sequences.setDepth(_doorSequenceIdx, _doorDepth); if (_actionFl) _scene->_sequences.addSubEntry(_doorSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 84); -- cgit v1.2.3 From cf845c6dbb6c57f65255e0abd70524d9b9187dd5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 18:40:53 -0500 Subject: MADS: Another car opening animation fix --- engines/mads/nebular/nebular_scenes6.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index b50032352f..43c8193828 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -2766,7 +2766,7 @@ void Scene609::actions() { case 0: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[1]); - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 5); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; -- cgit v1.2.3 From 177d7ac24f9a1cdd884b9f947a0f50c656942ec0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 18:57:00 -0500 Subject: MADS: Fix car door exiting animations --- engines/mads/nebular/nebular_scenes5.cpp | 4 ++-- engines/mads/nebular/nebular_scenes6.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 4fc603b607..85725a75ee 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -273,7 +273,7 @@ void Scene501::step() { case 72: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 73); break; @@ -1260,7 +1260,7 @@ void Scene506::step() { case 71: _scene->_sequences.remove(_globals._sequenceIndexes[3]); - _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 5); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 72); break; diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 43c8193828..c862017462 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -130,7 +130,7 @@ void Scene601::step() { case 71: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 3); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 72); break; -- cgit v1.2.3 From 0deee07844f4748d00c753af283ee52a57654611 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 19:03:49 -0500 Subject: MADS: Fix map fade out when choosing a car destination --- engines/mads/nebular/nebular_scenes5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 85725a75ee..dea5f678c4 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -996,7 +996,7 @@ void Scene505::step() { _scene->_sequences.remove(_globals._sequenceIndexes[1]); _scene->_sequences.remove(_globals._sequenceIndexes[0]); _scene->_sequences.remove(_globals._sequenceIndexes[13]); - _globals._sequenceIndexes[13] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[13], false, 6, 1, 0, 0); + _globals._sequenceIndexes[13] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[13], false, 6, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 63); _vm->_sound->command(18); } -- cgit v1.2.3 From 62d007168a82614f30a8aa64ae613e30ba111771 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 19:24:30 -0500 Subject: MADS: Animation fixes for scene group 8 --- engines/mads/nebular/nebular_scenes8.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 95b3c24938..a0bfa0689a 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -283,7 +283,7 @@ void Scene801::actions() { _globals[kBetweenRooms] = true; _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 4, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 4, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 90); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 5); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 13); @@ -726,7 +726,7 @@ void Scene803::step() { if (_game._trigger == 150) { _scene->_sequences.remove(_globals._sequenceIndexes[6]); _vm->_sound->command(18); - _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], false, 8, 1, 0, 0); + _globals._sequenceIndexes[6] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[6], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 19); _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 151); @@ -778,7 +778,7 @@ void Scene803::actions() { case 162: _scene->_sequences.remove(_globals._sequenceIndexes[9]); - _globals._sequenceIndexes[9] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[9], true, 6, 1, 0, 0); + _globals._sequenceIndexes[9] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[9], true, 6, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[9], 1, 4); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[9]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 163); @@ -1277,14 +1277,14 @@ void Scene805::actions() { } else if (_action.isAction(VERB_REMOVE, NOUN_SHIELD_MODULATOR) && _globals[kShieldModInstalled]) { _scene->_sequences.remove(_globals._sequenceIndexes[1]); _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 7, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 71); _game._player._stepEnabled = false; } else if (_action.isAction(VERB_REMOVE, NOUN_TARGET_MODULE) && _globals[kTargetModInstalled]) { _scene->_sequences.remove(_globals._sequenceIndexes[2]); _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 81); _game._player._stepEnabled = false; -- cgit v1.2.3 From 1cb764b08629c2171314a88c491f8fc461202cc6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 20:20:25 -0500 Subject: MADS: Fix crash after installing cards in ship --- engines/mads/nebular/nebular_scenes8.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index a0bfa0689a..75b6b17a94 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -1218,6 +1218,8 @@ void Scene805::enter() { } void Scene805::step() { + UserInterface &userInterface = _vm->_game->_scene._userInterface; + if (_game._trigger == 70) { _scene->_hotspots.activate(OBJ_SHIELD_MODULATOR, false); _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 25); @@ -1225,6 +1227,7 @@ void Scene805::step() { _scene->_dynamicHotspots.setPosition(idx, Common::Point(0, 0), FACING_DUMMY); _globals[kShieldModInstalled] = true; _game._objects.setRoom(OBJ_SHIELD_MODULATOR, NOWHERE); + userInterface._selectedInvIndex = -1; _game._player._stepEnabled = true; _vm->_sound->command(24); } @@ -1236,6 +1239,7 @@ void Scene805::step() { _scene->_dynamicHotspots.setPosition(idx, Common::Point(0, 0), FACING_DUMMY); _globals[kTargetModInstalled] = true; _game._objects.setRoom(OBJ_TARGET_MODULE, NOWHERE); + userInterface._selectedInvIndex = -1; _game._player._stepEnabled = true; _vm->_sound->command(24); } -- cgit v1.2.3 From 119c179d5aa432a0dc3e1b522639478cd5377b83 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 20:25:25 -0500 Subject: MADS: Fix hand animations on Antigrav control panel --- engines/mads/nebular/nebular_scenes8.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 75b6b17a94..64b6c26bbc 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -1437,7 +1437,7 @@ void Scene808::actions() { _vm->_sound->command(20); _vm->_sound->command(25); } - _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(248, 211)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 71); @@ -1472,7 +1472,7 @@ void Scene808::actions() { _vm->_sound->command(20); } _globals[kTopButtonPushed] = false; - _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(248, 186)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 91); @@ -1503,7 +1503,7 @@ void Scene808::actions() { _vm->_sound->command(20); } _globals[kTopButtonPushed] = true; - _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[4], false, 4, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(248, 163)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 81); -- cgit v1.2.3 From a22d7f2d5f27701766dbf36d50e0a31ea7b26d69 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 6 Mar 2015 20:55:53 -0500 Subject: MADS: Fix crash on leaving planeet --- engines/mads/nebular/nebular_scenes8.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 64b6c26bbc..4b8d7d5dd8 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -1604,7 +1604,8 @@ void Scene810::enter() { } void Scene810::step() { - if ((_scene->_activeAnimation->getCurrentFrame() == 200) && _moveAllowed) { + if (_scene->_activeAnimation && (_scene->_activeAnimation->getCurrentFrame() == 200) + && _moveAllowed) { _scene->_sequences.addTimer(100, 70); _moveAllowed = false; } -- cgit v1.2.3 From c80c74e49926daed108f73e115fda7ba5901eb61 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 17:01:07 -0500 Subject: MADS: Refactoring of text/animation views to show outside game loop --- engines/mads/game.cpp | 25 +++++++------- engines/mads/nebular/game_nebular.cpp | 56 ++++++++++++++++++-------------- engines/mads/nebular/menu_nebular.cpp | 2 ++ engines/mads/nebular/nebular_scenes8.cpp | 6 ++-- 4 files changed, 50 insertions(+), 39 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 3b8b053fec..74c2a3f416 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -105,8 +105,6 @@ Game::~Game() { } void Game::run() { - initializeGlobals(); - // If requested, load a savegame instead of showing the intro if (ConfMan.hasKey("save_slot")) { int saveSlot = ConfMan.getInt("save_slot"); @@ -116,15 +114,19 @@ void Game::run() { _statusFlag = true; - if (_loadGameSlot == -1) { - startGame(); - } + while (!_vm->shouldQuit()) { + initializeGlobals(); - // Get the initial starting time for the first scene - _scene._frameStartTime = _vm->_events->getFrameCounter(); + if (_loadGameSlot == -1) { + startGame(); + } + + // Get the initial starting time for the first scene + _scene._frameStartTime = _vm->_events->getFrameCounter(); - if (!_vm->shouldQuit()) - gameLoop(); + if (!_vm->shouldQuit()) + gameLoop(); + } } void Game::splitQuote(const Common::String &source, Common::String &line1, Common::String &line2) { @@ -140,7 +142,7 @@ void Game::splitQuote(const Common::String &source, Common::String &line1, Commo } void Game::gameLoop() { - while (!_vm->shouldQuit() && _statusFlag) { + while (!_vm->shouldQuit() && _statusFlag && !_winStatus) { if (_loadGameSlot != -1) { loadGame(_loadGameSlot); _loadGameSlot = -1; @@ -168,7 +170,8 @@ void Game::gameLoop() { } void Game::sectionLoop() { - while (!_vm->shouldQuit() && _statusFlag && (_sectionNumber == _currentSectionNumber)) { + while (!_vm->shouldQuit() && _statusFlag && !_winStatus && + (_sectionNumber == _currentSectionNumber)) { _kernelMode = KERNEL_ROOM_PRELOAD; _player._spritesChanged = true; _quoteEmergency = false; diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 965ef7fad2..8c8d4ab974 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -61,6 +61,35 @@ ProtectionResult GameNebular::checkCopyProtection() { } void GameNebular::startGame() { + // First handle any ending credits from a just finished game session. + // Note that, with the exception of the decompression ending, which doesn't + // use animations, the remaining animations will automatically launch their + // own text view credits when the animation is completed + switch (_winStatus) { + case 1: + // No shields failure ending + AnimationView::execute(_vm, "rexend1"); + break; + case 2: + // Shields, but no targetting failure ending + AnimationView::execute(_vm, "rexend2"); + break; + case 3: + // Completed game successfully, so activate quotes item on the main menu + ConfMan.setBool("ShowQuotes", true); + ConfMan.flushToDisk(); + + AnimationView::execute(_vm, "rexend3"); + break; + case 4: + // Decompression ending + TextView::execute(_vm, "ending4"); + break; + } + + checkShowDialog(); + _winStatus = 0; + /* // Check copy protection ProtectionResult protectionResult = checkCopyProtection(); @@ -310,32 +339,9 @@ void GameNebular::setSectionHandler() { } void GameNebular::checkShowDialog() { - // Handling to start endgame sequences if the win/lose type has been set - switch (_winStatus) { - case 1: - // No shields failure ending - AnimationView::execute(_vm, "rexend1"); - break; - case 2: - // Shields, but no targetting failure ending - AnimationView::execute(_vm, "rexend2"); - break; - case 3: - // Completed game successfully, so activate quotes item on the main menu - ConfMan.setBool("ShowQuotes", true); - ConfMan.flushToDisk(); - - AnimationView::execute(_vm, "rexend3"); - break; - case 4: - // Decompression ending - TextView::execute(_vm, "ending4"); - break; - } - _winStatus = 0; - // Loop for showing dialogs, if any need to be shown - if (_vm->_dialogs->_pendingDialog && _player._stepEnabled && !_globals[kCopyProtectFailed]) { + if (_vm->_dialogs->_pendingDialog && (_player._stepEnabled || _winStatus) + && !_globals[kCopyProtectFailed]) { _player.releasePlayerSprites(); // Make a thumbnail in case it's needed for making a savegame diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 2fdef3443d..358a978cfa 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -136,12 +136,14 @@ void MainMenu::doFrame() { addSpriteSlot(); } + _vm->_events->setCursor(CURSOR_ARROW); _vm->_events->showCursor(); } else { if ((_menuItemIndex == -1) || (_frameIndex == 0)) { if (++_menuItemIndex == 6) { // Reached end of display animation + _vm->_events->setCursor(CURSOR_ARROW); _vm->_events->showCursor(); return; } else if (_menuItemIndex == 4 && !shouldShowQuotes()) { diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 4b8d7d5dd8..8a30f88548 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -719,7 +719,7 @@ void Scene803::step() { else _game._winStatus = 3; - _vm->quitGame(); + return; } } @@ -957,7 +957,7 @@ void Scene804::step() { assert(!_globals[kCopyProtectFailed]); _game._winStatus = 4; - _vm->quitGame(); + return; } break; @@ -969,7 +969,7 @@ void Scene804::step() { assert(!_globals[kCopyProtectFailed]); _game._winStatus = 4; - _vm->quitGame(); + return; } } -- cgit v1.2.3 From dacd7d4022ef049fbcf59a3b555b6d9ee8c1511e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 17:14:49 -0500 Subject: MADS: Correctly show main menu after showing credits --- engines/mads/nebular/dialogs_nebular.cpp | 2 +- engines/mads/nebular/game_nebular.cpp | 2 ++ engines/mads/nebular/menu_nebular.cpp | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 6985455d2a..23aef6bdb5 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -328,7 +328,7 @@ void DialogsNebular::showDialog() { TextView *dlg = new RexTextView(_vm); dlg->show(); delete dlg; - break; + return; } case DIALOG_ANIMVIEW: { AnimationView *dlg = new RexAnimationView(_vm); diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 8c8d4ab974..ce3b5a8f58 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -110,7 +110,9 @@ void GameNebular::startGame() { } */ + _sectionNumber = 1; initSection(_sectionNumber); + _vm->_events->setCursor(CURSOR_ARROW); _statusFlag = true; // Show the main menu diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 358a978cfa..2fdef3443d 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -136,14 +136,12 @@ void MainMenu::doFrame() { addSpriteSlot(); } - _vm->_events->setCursor(CURSOR_ARROW); _vm->_events->showCursor(); } else { if ((_menuItemIndex == -1) || (_frameIndex == 0)) { if (++_menuItemIndex == 6) { // Reached end of display animation - _vm->_events->setCursor(CURSOR_ARROW); _vm->_events->showCursor(); return; } else if (_menuItemIndex == 4 && !shouldShowQuotes()) { -- cgit v1.2.3 From 27b6ded6f95fdc01faa5816b8577464685357c2d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 17:18:51 -0500 Subject: MADS: Fix Credits and Quotes option on the main menu --- engines/mads/nebular/game_nebular.cpp | 41 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index ce3b5a8f58..53cdc4df13 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -87,38 +87,39 @@ void GameNebular::startGame() { break; } - checkShowDialog(); - _winStatus = 0; - - /* - // Check copy protection - ProtectionResult protectionResult = checkCopyProtection(); - switch (protectionResult) { - case PROTECTION_FAIL: + do { + checkShowDialog(); + _winStatus = 0; + + /* + // Check copy protection + ProtectionResult protectionResult = checkCopyProtection(); + switch (protectionResult) { + case PROTECTION_FAIL: // Copy protection failed _scene._nextSceneId = 804; initializeGlobals(); _globals[kCopyProtectFailed] = true; return; - case PROTECTION_ESCAPE: + case PROTECTION_ESCAPE: // User escaped out of copy protection dialog _vm->quitGame(); return; - default: + default: // Copy protection check succeeded break; - } - */ + } + */ - _sectionNumber = 1; - initSection(_sectionNumber); - _vm->_events->setCursor(CURSOR_ARROW); - _statusFlag = true; + _sectionNumber = 1; + initSection(_sectionNumber); + _vm->_events->setCursor(CURSOR_ARROW); + _statusFlag = true; - // Show the main menu - _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; - _vm->_dialogs->showDialog(); - _vm->_dialogs->_pendingDialog = DIALOG_NONE; + // Show the main menu + _vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU; + _vm->_dialogs->showDialog(); + } while (!_vm->shouldQuit() && _vm->_dialogs->_pendingDialog != DIALOG_NONE); _priorSectionNumber = 0; _priorSectionNumber = -1; -- cgit v1.2.3 From d7460701ea345dbe6d610b98a9c14993ff2f1f88 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 17:36:32 -0500 Subject: MADS: Fix not being able to leave hanger via teleporter --- engines/mads/nebular/nebular_scenes8.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 8a30f88548..24a1855c36 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -145,10 +145,10 @@ void Scene801::enter() { case 2: _game._player._playerPos = Common::Point(8, 117); _globals[kTeleporterUnderstood] = true; - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 8, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 13); _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 8090); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 80); _vm->_sound->command(30); break; -- cgit v1.2.3 From adc5b5ca2e3b967d51685fec749fc0864b55fa8f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 17:39:00 -0500 Subject: MADS: Fix animation for teleporting into conveyor belt scene --- engines/mads/nebular/nebular_scenes4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp index 8a9e510591..8191d7fe49 100644 --- a/engines/mads/nebular/nebular_scenes4.cpp +++ b/engines/mads/nebular/nebular_scenes4.cpp @@ -4078,7 +4078,7 @@ void Scene413::enter() { case 1: _vm->_sound->command(30); _game._player._visible = false; - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 7, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 19); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 8); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 76); -- cgit v1.2.3 From a35aa07c7911010d21bb79209d88b07ddbfd7c30 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 17:43:15 -0500 Subject: MADS: Fix crash looking at fishing rod in restaurant --- engines/mads/nebular/nebular_scenes5.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index dea5f678c4..b297d2048c 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -2427,7 +2427,8 @@ void Scene512::actions() { _vm->_dialogs->show(51225); else if (_action.isAction(VERB_LOOK, NOUN_PADLOCK_KEY) && _game._objects.isInRoom(OBJ_PADLOCK_KEY)) _vm->_dialogs->show(51215); - else if (_action.isAction(VERB_LOOK, NOUN_FISHING_ROD) && (_scene->_activeAnimation->getCurrentFrame() == 4)) + else if (_action.isAction(VERB_LOOK, NOUN_FISHING_ROD) && (!_scene->_activeAnimation || + _scene->_activeAnimation->getCurrentFrame() == 4)) _vm->_dialogs->show(51216); else if (_action.isAction(VERB_LOOK, NOUN_SHIPS_WHEEL)) _vm->_dialogs->show(51218); -- cgit v1.2.3 From 14a8bb52a0fd92ed1033473d5941a36d5be32d18 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 18:33:11 -0500 Subject: MADS: Fix a large number of incorrect animations --- engines/mads/nebular/nebular_scenes1.cpp | 2 +- engines/mads/nebular/nebular_scenes2.cpp | 2 +- engines/mads/nebular/nebular_scenes3.cpp | 6 +++--- engines/mads/nebular/nebular_scenes4.cpp | 4 ++-- engines/mads/nebular/nebular_scenes5.cpp | 8 ++++---- engines/mads/nebular/nebular_scenes7.cpp | 12 ++++++------ 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index f21ab94bcb..d505bb3d4e 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -1459,7 +1459,7 @@ void Scene103::actions() { default: break; } - } else if (_action.isAction(VERB_TAKE, 289, 0) && _game._objects.isInRoom(OBJ_REBREATHER)) { + } else if (_action.isAction(VERB_TAKE, NOUN_REBREATHER, 0) && _game._objects.isInRoom(OBJ_REBREATHER)) { switch (_vm->_game->_trigger) { case 0: _scene->changeVariant(1); diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 2eb7f93a60..bd8e8aae82 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -556,7 +556,7 @@ void Scene202::step() { case 90: _vm->_sound->command(41); _scene->_sequences.remove(_globals._sequenceIndexes[10]); - _globals._sequenceIndexes[9] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[9], true, 6, 1, 0, 0); + _globals._sequenceIndexes[9] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[9], true, 6, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[9], Common::Point(247, 82)); _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 1); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 91); diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 478a733485..61618ff7e3 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -2523,7 +2523,7 @@ void Scene318::handleDialog() { case 0x19C: case 0x19D: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 8, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); _scene->_sequences.setPosition(_globals._sequenceIndexes[2], Common::Point(142, 121)); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 6, 8); @@ -3588,7 +3588,7 @@ void Scene320::setLeftView(int view) { _scene->_sequences.remove(_globals._sequenceIndexes[0]); if (view != 10) { - _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[view], false, 6, 0, 0, 18); + _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[view], false, 6, 0, 0, 18); _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 0); if (!_blinkFl) _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 2, 2); @@ -4305,7 +4305,7 @@ void Scene352::preActions() { _game._player._stepEnabled = false; _scene->_sequences.remove(_commonSequenceIdx); _vm->_sound->command(20); - _commonSequenceIdx = _scene->_sequences.startPingPongCycle(_commonSpriteIndex, false, 6, 1, 0, 0); + _commonSequenceIdx = _scene->_sequences.addReverseSpriteCycle(_commonSpriteIndex, false, 6, 1, 0, 0); _scene->_sequences.addSubEntry(_commonSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 1); _scene->_sequences.setDepth(_commonSequenceIdx, 15); } diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp index 8191d7fe49..9db597c312 100644 --- a/engines/mads/nebular/nebular_scenes4.cpp +++ b/engines/mads/nebular/nebular_scenes4.cpp @@ -2445,7 +2445,7 @@ void Scene405::step() { if (_game._trigger == 70) { _game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount ; _game._player._visible = true; - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 6, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 71); _vm->_sound->command(19); } @@ -2609,7 +2609,7 @@ void Scene406::enter() { else { _game._player._stepEnabled = false; _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; - _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 3, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 3, 1, 0, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 90); _vm->_sound->command(19); } diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index b297d2048c..f520fd5ed0 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -238,7 +238,7 @@ void Scene501::step() { break; case 82: - _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 7); _vm->_sound->command(12); _doorHotspotid = _scene->_dynamicHotspots.add(NOUN_DOOR, VERB_WALK_THROUGH, _globals._sequenceIndexes[3], Common::Rect(0, 0, 0, 0)); @@ -415,7 +415,7 @@ void Scene501::actions() { case 7: { _vm->_sound->command(12); int syncIdx = _globals._sequenceIndexes[3]; - _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 7); _scene->_sequences.updateTimeout(_globals._sequenceIndexes[3], syncIdx); _vm->_sound->command(12); @@ -913,7 +913,7 @@ void Scene505::enter() { _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('e', -1)); if (_scene->_priorSceneId != -2) - _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 6, 1, 0, 0); + _globals._sequenceIndexes[12] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[12], false, 6, 1, 0, 0); _globals._sequenceIndexes[13] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[13], false, 6, 1, 120, 0); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[13], SEQUENCE_TRIGGER_EXPIRE, 0, 60); @@ -2530,7 +2530,7 @@ void Scene513::step() { case 80: _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2); _vm->_sound->command(24); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 81); diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 4838ee27d9..006b3ca6ec 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -206,7 +206,7 @@ void Scene701::step() { switch(_game._trigger) { case 60: _scene->_sequences.remove(_globals._sequenceIndexes[5]); - _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 6, 1, 0, 0); + _globals._sequenceIndexes[5] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[5], false, 6, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[5], Common::Point(155, 129)); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 61); break; @@ -326,7 +326,7 @@ void Scene701::actions() { case 3: _vm->_sound->command(17); - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(48, 136)); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 4); @@ -1585,7 +1585,7 @@ void Scene705::enter() { void Scene705::step() { switch (_game._trigger) { case 70: - _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); + _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71); break; @@ -2248,7 +2248,7 @@ void Scene751::step() { switch (_game._trigger) { case 70: _scene->_sequences.remove(_globals._sequenceIndexes[4]); - _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 6, 1, 0, 0); + _globals._sequenceIndexes[4] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[4], false, 6, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(155, 129)); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 71); break; @@ -2329,7 +2329,7 @@ void Scene751::preActions() { _game._player._readyToWalk = false; _game._player._stepEnabled = false; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 11, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 11, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, 7); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1); break; @@ -2398,7 +2398,7 @@ void Scene751::actions() { case 3: _vm->_sound->command(17); - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(48, 136)); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 4); -- cgit v1.2.3 From 10361d077a5637f4e64620011b67190bfdeaaf9b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 11:18:10 -0400 Subject: MADS: Fix game startup settings for pit & batteries based on difficulty --- engines/mads/nebular/game_nebular.cpp | 6 ++++-- engines/mads/nebular/nebular_scenes2.cpp | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 53cdc4df13..6de7ad9932 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -280,7 +280,9 @@ void GameNebular::initializeGlobals() { _objects.setRoom(OBJ_PLANT_STALK, NOWHERE); _objects.setRoom(OBJ_PENLIGHT, NOWHERE); - _globals[kLeavesStatus] = LEAVES_ON_TRAP; + _globals[kLeavesStatus] = LEAVES_ON_GROUND; + _globals[kDurafailRecharged] = 0; + _globals[kPenlightCellStatus] = FIRST_TIME_UNCHARGED_DURAFAIL; break; case DIFFICULTY_MEDIUM: @@ -295,7 +297,7 @@ void GameNebular::initializeGlobals() { _objects.setRoom(OBJ_BLOWGUN, NOWHERE); _objects.setRoom(OBJ_NOTE, NOWHERE); - _globals[kLeavesStatus] = LEAVES_ON_GROUND; + _globals[kLeavesStatus] = LEAVES_ON_TRAP; _globals[kPenlightCellStatus] = FIRST_TIME_UNCHARGED_DURAFAIL; _globals[kDurafailRecharged] = 0; break; diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index bd8e8aae82..499073e28a 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -1686,14 +1686,14 @@ void Scene208::updateTrap() { } switch (_globals[kLeavesStatus]) { - case 0: { + case LEAVES_ON_GROUND: { _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, 1); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 15); int idx = _scene->_dynamicHotspots.add(NOUN_PILE_OF_LEAVES, VERB_WALKTO, _globals._sequenceIndexes[2], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(60, 152), FACING_NORTH); } break; - case 2: { + case LEAVES_ON_TRAP: { _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 15); _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 1); _scene->_hotspots.activate(NOUN_DEEP_PIT, false); -- cgit v1.2.3 From 2b1155711fe09bb71cc3678a70eca3aab7766885 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 11:44:06 -0400 Subject: MADS: Fix showing covered pit by default in Easy mode --- engines/mads/nebular/nebular_scenes2.cpp | 17 ++++++++--------- engines/mads/sequence.cpp | 14 +++++++------- engines/mads/sequence.h | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 499073e28a..cb22a2312d 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -1697,7 +1697,7 @@ void Scene208::updateTrap() { _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 15); _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 1); _scene->_hotspots.activate(NOUN_DEEP_PIT, false); - int idx = _scene->_dynamicHotspots.add(NOUN_LEAF_COVERED_PIT, VERB_WALKTO, _globals._sequenceIndexes[2], Common::Rect(0, 0, 0, 0)); + int idx = _scene->_dynamicHotspots.add(NOUN_LEAF_COVERED_PIT, VERB_WALKTO, _globals._sequenceIndexes[3], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(100, 146), FACING_NORTH); _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON; } @@ -1796,7 +1796,6 @@ void Scene208::preActions() { } void Scene208::subAction(int mode) { - switch (_game._trigger) { case 0: { _game._player._stepEnabled = false; @@ -1804,21 +1803,21 @@ void Scene208::subAction(int mode) { _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 6, 1, 0, 0); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); - int abortVal; + int endTrigger; if ((mode == 1) || (mode == 2)) - abortVal = 1; + endTrigger = 1; else - abortVal = 2; + endTrigger = 2; - _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, abortVal); + _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, endTrigger); } break; case 1: { - int oldVal = _globals._sequenceIndexes[5]; - _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], false, 12, 3, 0, 0); + int oldSeq = _globals._sequenceIndexes[5]; + _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 12, 3, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 3, 4); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[5]); - _scene->_sequences.updateTimeout(_globals._sequenceIndexes[5], oldVal); + _scene->_sequences.updateTimeout(_globals._sequenceIndexes[5], oldSeq); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 2); _vm->_sound->command(20); } diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp index ab73d70b10..7dbf4cf3be 100644 --- a/engines/mads/sequence.cpp +++ b/engines/mads/sequence.cpp @@ -95,8 +95,8 @@ bool SequenceList::addSubEntry(int index, SequenceTrigger mode, int frameIndex, } int SequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks, int extraTicks, int numTicks, - int msgX, int msgY, bool nonFixed, int scale, int depth, int frameInc, SpriteAnimType animType, int numSprites, - int frameStart) { + int msgX, int msgY, bool nonFixed, int scale, int depth, int frameInc, SpriteAnimType animType, int numSprites, + int frameStart) { Scene &scene = _vm->_game->_scene; // Find a free slot @@ -477,17 +477,17 @@ int SequenceList::startPingPongCycle(int srcSpriteIndex, bool flipped, int numTi extraTicks, numTicks, 0, 0, true, 100, depth - 1, 1, ANIMTYPE_PING_PONG, 0, 0); } -void SequenceList::updateTimeout(int spriteIdx, int seqIndex) { +void SequenceList::updateTimeout(int srcSeqIndex, int destSeqIndex) { Player &player = _vm->_game->_player; int timeout; - if (spriteIdx >= 0) - timeout = _entries[spriteIdx]._timeout; + if (srcSeqIndex >= 0) + timeout = _entries[srcSeqIndex]._timeout; else timeout = player._priorTimer + player._ticksAmount; - if (seqIndex >= 0) - _entries[seqIndex]._timeout = timeout; + if (destSeqIndex >= 0) + _entries[destSeqIndex]._timeout = timeout; else player._priorTimer = timeout - player._ticksAmount; diff --git a/engines/mads/sequence.h b/engines/mads/sequence.h index 9603296717..1555232780 100644 --- a/engines/mads/sequence.h +++ b/engines/mads/sequence.h @@ -119,7 +119,7 @@ public: int startCycle(int srcSpriteIdx, bool flipped, int cycleIndex); int startPingPongCycle(int srcSpriteIndex, bool flipped, int numTicks, int triggerCountdown = 0, int timeoutTicks = 0, int extraTicks = 0); - void updateTimeout(int spriteIdx, int seqIndex); + void updateTimeout(int destSeqIndex, int srcSeqIndex); void setScale(int spriteIdx, int scale); void setMsgLayout(int seqIndex); void setDone(int seqIndex); -- cgit v1.2.3 From 6454c5f35d2fa7d749266bcdb9346944dd6709d0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 11:49:47 -0400 Subject: MADS: Fix closing door animation for video store --- engines/mads/nebular/nebular_scenes6.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index c862017462..11e3ff78b0 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -2690,7 +2690,7 @@ void Scene609::enterStore() { case 7: _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 9); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 8); break; -- cgit v1.2.3 From b25325599d4b88c323d3bf3319f7b6ee78f2e4c4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 12:05:54 -0400 Subject: MADS: Fix for penlight when starting a new game in Hard mode --- engines/mads/nebular/game_nebular.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 6de7ad9932..cde998e66a 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -277,8 +277,8 @@ void GameNebular::initializeGlobals() { // Final setup based on selected difficulty level switch (_difficulty) { case DIFFICULTY_HARD: - _objects.setRoom(OBJ_PLANT_STALK, NOWHERE); - _objects.setRoom(OBJ_PENLIGHT, NOWHERE); + _objects.setRoom(OBJ_BLOWGUN, NOWHERE); + _objects.setRoom(OBJ_NOTE, NOWHERE); _globals[kLeavesStatus] = LEAVES_ON_GROUND; _globals[kDurafailRecharged] = 0; @@ -294,12 +294,10 @@ void GameNebular::initializeGlobals() { break; case DIFFICULTY_EASY: - _objects.setRoom(OBJ_BLOWGUN, NOWHERE); - _objects.setRoom(OBJ_NOTE, NOWHERE); + _objects.setRoom(OBJ_PLANT_STALK, NOWHERE); + _objects.setRoom(OBJ_PENLIGHT, NOWHERE); _globals[kLeavesStatus] = LEAVES_ON_TRAP; - _globals[kPenlightCellStatus] = FIRST_TIME_UNCHARGED_DURAFAIL; - _globals[kDurafailRecharged] = 0; break; } -- cgit v1.2.3 From 62c1485df2ab17ab18b377b49055c6fcd6a6b15c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 19:51:33 -0400 Subject: MADS: Fix flickering message from sitting at ruined security desk --- engines/mads/nebular/nebular_scenes3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 61618ff7e3..2febbf6bbd 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -5466,7 +5466,7 @@ void Scene361::actions() { _vm->_dialogs->show(36119); else if (_action.isAction(VERB_SIT_AT, NOUN_DESK)) { _scene->_kernelMessages.reset(); - _scene->_kernelMessages.addQuote(0xFC, 120, 0); + _scene->_kernelMessages.addQuote(252, 0, 120); } else if (_action.isAction(VERB_CLIMB_INTO, NOUN_AIR_VENT)) { if (_globals[kSexOfRex] == REX_FEMALE) handleRoxAction(); -- cgit v1.2.3 From 29ac19947f5c95a5133bc7d6f8ee75a0719fe58d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 19:54:00 -0400 Subject: MADS: Rename some outstanding 'abortTimers' to the more proper 'endTrigger' --- engines/mads/messages.cpp | 10 +++++----- engines/mads/messages.h | 4 ++-- engines/mads/nebular/nebular_scenes2.cpp | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/messages.cpp b/engines/mads/messages.cpp index e83b69d210..4b105630d6 100644 --- a/engines/mads/messages.cpp +++ b/engines/mads/messages.cpp @@ -69,7 +69,7 @@ void KernelMessages::clear() { } int KernelMessages::add(const Common::Point &pt, uint fontColor, uint8 flags, - uint8 abortTimers, uint32 timeout, const Common::String &msg) { + int endTrigger, uint32 timeout, const Common::String &msg) { Scene &scene = _vm->_game->_scene; // Find a free slot @@ -77,7 +77,7 @@ int KernelMessages::add(const Common::Point &pt, uint fontColor, uint8 flags, while ((idx < _entries.size()) && ((_entries[idx]._flags & KMSG_ACTIVE) != 0)) ++idx; if (idx == _entries.size()) { - if (abortTimers == 0) + if (endTrigger == 0) return -1; error("KernelMessages overflow"); @@ -92,7 +92,7 @@ int KernelMessages::add(const Common::Point &pt, uint fontColor, uint8 flags, rec._textDisplayIndex = -1; rec._timeout = timeout; rec._frameTimer = _vm->_game->_priorFrameTimer; - rec._trigger = abortTimers; + rec._trigger = endTrigger; rec._abortMode = _vm->_game->_triggerSetupMode; rec._actionDetails = scene._action._activeAction; @@ -104,10 +104,10 @@ int KernelMessages::add(const Common::Point &pt, uint fontColor, uint8 flags, return idx; } -int KernelMessages::addQuote(int quoteId, int abortTimers, uint32 timeout) { +int KernelMessages::addQuote(int quoteId, int endTrigger, uint32 timeout) { Common::String quoteStr = _vm->_game->getQuote(quoteId); return add(Common::Point(), 0x1110, KMSG_PLAYER_TIMEOUT | KMSG_CENTER_ALIGN, - abortTimers, timeout, quoteStr); + endTrigger, timeout, quoteStr); } void KernelMessages::scrollMessage(int msgIndex, int numTicks, bool quoted) { diff --git a/engines/mads/messages.h b/engines/mads/messages.h index a7411d98d1..22ae0b24b5 100644 --- a/engines/mads/messages.h +++ b/engines/mads/messages.h @@ -99,9 +99,9 @@ public: ~KernelMessages(); void clear(); - int add(const Common::Point &pt, uint fontColor, uint8 flags, uint8 abortTimers, + int add(const Common::Point &pt, uint fontColor, uint8 flags, int endTrigger, uint32 timeout, const Common::String &msg); - int addQuote(int quoteId, int abortTimers, uint32 timeout); + int addQuote(int quoteId, int endTrigger, uint32 timeout); void scrollMessage(int msgIndex, int numTicks, bool quoted); void setSeqIndex(int msgIndex, int seqIndex); void remove(int msgIndex); diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index cb22a2312d..9d5e2185e8 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -165,16 +165,16 @@ void Scene201::enter() { int sepChar = (_globals[kSexOfRex] == SEX_MALE) ? 't' : 'u'; // Guess values. What is the default value used by the compiler? int suffixNum = -1; - int abortTimers = -1; + int endTrigger = -1; switch(_globals[kTeleporterCommand]) { case 1: suffixNum = 3; - abortTimers = 76; + endTrigger = 76; _globals[kTeleporterUnderstood] = true; break; case 2: suffixNum = 1; - abortTimers = 77; + endTrigger = 77; break; case 3: _game._player._visible = true; @@ -183,12 +183,12 @@ void Scene201::enter() { break; case 4: suffixNum = 2; - abortTimers = 78; + endTrigger = 78; break; } _globals[kTeleporterCommand] = 0; if (suffixNum >= 0) - _scene->loadAnimation(formAnimName(sepChar, suffixNum), abortTimers); + _scene->loadAnimation(formAnimName(sepChar, suffixNum), endTrigger); } if ((_scene->_priorSceneId == 202) && (_globals[kMeteorologistStatus] == METEOROLOGIST_PRESENT) && !_scene->_roomChanged) { -- cgit v1.2.3 From d048776ef3658a726e1a06666453b30f27188730 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 20:44:19 -0400 Subject: MADS: Fix walking behind counter in software store --- engines/mads/nebular/nebular_scenes5.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index f520fd5ed0..8be52692c6 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -1547,7 +1547,9 @@ void Scene507::actions() { _vm->_dialogs->show(50724); else if (_action.isAction(VERB_LOOK, NOUN_WINDOW)) _vm->_dialogs->show(50725); - else if (_action.isAction(VERB_LOOK, NOUN_COUNTER)) { + else if (_action.isAction(NOUN_WALK_BEHIND, NOUN_COUNTER)) { + // WORkAROUND: Empty handling to prevent default "can't do that" dialogs showing + } else if (_action.isAction(VERB_LOOK, NOUN_COUNTER)) { if (_game._objects.isInRoom(OBJ_PENLIGHT)) _vm->_dialogs->show(50728); else -- cgit v1.2.3 From 1d76659da834d59b7a26c59951f6613d384bd532 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 20:46:40 -0400 Subject: MADS: Fix walking behind counter at Sand Bar restaurant --- engines/mads/nebular/nebular_scenes5.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 8be52692c6..7cdc55e03c 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -2463,7 +2463,9 @@ void Scene512::actions() { _vm->_dialogs->show(51233); else if (_action.isAction(VERB_LOOK, NOUN_LAMP)) _vm->_dialogs->show(51234); - else if (_action.isAction(VERB_LOOK, NOUN_COUNTER)) + else if (_action.isAction(NOUN_WALK_BEHIND, NOUN_COUNTER)) { + // WORkAROUND: Empty handling to prevent default "can't do that" dialogs showing + } else if (_action.isAction(VERB_LOOK, NOUN_COUNTER)) _vm->_dialogs->show(51235); else if (_action.isAction(VERB_LOOK, NOUN_ICE_CHESTS)) _vm->_dialogs->show(51237); -- cgit v1.2.3 From 6dd6e555133dfee1fa5647bfc9ba5cabc94a5ed9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 21:15:14 -0400 Subject: MADS: Fix prior conversation list showing when crawling in vents --- engines/mads/user_interface.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index a53ab31968..bcd409889e 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -410,13 +410,21 @@ void UserInterface::setup(InputMode inputMode) { } void UserInterface::drawTextElements() { - if (_vm->_game->_screenObjects._inputMode) { - drawConversationList(); - } else { + switch (_vm->_game->_screenObjects._inputMode) { + case kInputBuildingSentences: // Draw the actions drawActions(); drawInventoryList(); drawItemVocabList(); + break; + + case kInputConversation: + drawConversationList(); + break; + + case kInputLimitedSentences: + default: + break; } } -- cgit v1.2.3 From 3cb1a6dc553d5f8490728fb9fca39581d17723ed Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 21:25:15 -0400 Subject: MADS: Fix looking at magazine at security station --- engines/mads/nebular/nebular_scenes3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 2febbf6bbd..faf21aaa42 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -3825,7 +3825,7 @@ void Scene320::actions() { else if (_action.isAction(VERB_LOOK, NOUN_DOUGHNUT)) _vm->_dialogs->show(32006); else if (_action.isAction(VERB_LOOK, NOUN_MAGAZINE)) - _vm->_dialogs->show(32006); + _vm->_dialogs->show(32007); else if (_action.isAction(VERB_LOOK, NOUN_PAPER_FOOTBALL)) _vm->_dialogs->show(32008); else if (_action.isAction(VERB_LOOK, NOUN_NEWSPAPER)) -- cgit v1.2.3 From 9ec28cb27f1f637cc407c6b1b50dc87aece0507f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 21:38:28 -0400 Subject: MADS: Fix trying to walk into corridor from security station --- engines/mads/nebular/nebular_scenes3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index faf21aaa42..2ea476008f 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -1749,7 +1749,7 @@ void Scene311::actions() { else if (_checkGuardFl) { _checkGuardFl = false; _scene->_kernelMessages.reset(); - _scene->_kernelMessages.addQuote(0xFA, 120, 0); + _scene->_kernelMessages.addQuote(250, 0, 240); } else if (_action.isAction(VERB_SIT_AT, NOUN_DESK)) _scene->_nextSceneId = 320; else if (_action.isAction(VERB_CLIMB_INTO, NOUN_AIR_VENT)) { -- cgit v1.2.3 From aad048674b3d63c05742ce9091416ad5465cb541 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 22:34:40 -0400 Subject: MADS: Fix unused variable warning --- engines/mads/screen.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 8db034c467..6199da5925 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -685,7 +685,6 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS int y1, y2; int startX = 0; int deltaX; - int sizeY; int xAt; int loopStart; // uint32 baseTicks, currentTicks; @@ -712,7 +711,7 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS y1 = 0; y2 = size.y - 1; - sizeY = y2 - y1 + 1; +// sizeY = y2 - y1 + 1; if (throughBlack == THROUGH_BLACK2) swapForeground(palData, &paletteMap[0]); -- cgit v1.2.3 From cc0b88cc532d7708e13a6a9e22da2595223b8e49 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 23:40:50 -0400 Subject: MADS: Fix leak of SpriteAsset instances --- engines/mads/sprites.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads') diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index aa73fce712..19742e22b0 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -402,6 +402,7 @@ void SpriteSets::remove(int idx) { (*this)[idx] = nullptr; } else { do { + delete (*this)[size() - 1]; remove_at(size() - 1); } while (size() > 0 && (*this)[size() - 1] == nullptr); } -- cgit v1.2.3 From 43aad22eb2a99717b115fe2d00aaa384779eaa67 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Mar 2015 23:53:10 -0400 Subject: MADS: Fix SceneInfo instance leak when showing dialogs --- engines/mads/dialogs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads') diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp index c02f027302..158d9693ad 100644 --- a/engines/mads/dialogs.cpp +++ b/engines/mads/dialogs.cpp @@ -430,6 +430,7 @@ void FullScreenDialog::display() { if (_screenId > 0) { SceneInfo *sceneInfo = SceneInfo::init(_vm); sceneInfo->load(_screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface); + delete sceneInfo; } scene._priorSceneId = priorSceneId; -- cgit v1.2.3 From 05250d14fa8c3b1d2d51066a18d2c96904733590 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 9 Mar 2015 08:56:33 -0400 Subject: MADS: Fix crash picking up bamboo stalk --- engines/mads/nebular/nebular_scenes2.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 9d5e2185e8..164b943282 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -3462,6 +3462,7 @@ void Scene209::actions() { case 3: _scene->_sprites.remove(_globals._spriteIndexes[11]); + _scene->_spriteSlots.fullRefresh(true); break; } _action._inProgress = false; -- cgit v1.2.3 From f37a0b215515e5466bd19c8953c4f53ff4823a59 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 9 Mar 2015 18:24:05 -0400 Subject: MADS: Improved fix for picking up plant stalk --- engines/mads/nebular/nebular_scenes2.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 164b943282..d62497007c 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -2838,6 +2838,7 @@ void Scene209::enter() { _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('m', 3)); _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('m', 6)); _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('m', 8)); + _globals._spriteIndexes[11] = _scene->_sprites.addSprites("*RXMBD_2"); _game.loadQuoteSet(0x82, 0x83, 0x84, 0x9C, 0x97, 0x95, 0x99, 0x9E, 0x98, 0x9B, 0xA0, 0x96, 0x9F, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x91, 0x92, 0x93, 0x94, 0x89, 0x85, 0x8A, 0x86, 0x87, 0x88, 0); @@ -3439,7 +3440,6 @@ void Scene209::actions() { if (_action.isAction(VERB_TAKE, NOUN_PLANT_STALK) && (_game._trigger || _game._objects.isInRoom(OBJ_PLANT_STALK))) { switch (_game._trigger) { case 0: - _globals._spriteIndexes[11] = _scene->_sprites.addSprites("*RXMBD_2"); _game._player._stepEnabled = false; _game._player._visible = false; _globals._sequenceIndexes[11] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[11], false, 3, 2, 0, 0); @@ -3461,8 +3461,6 @@ void Scene209::actions() { break; case 3: - _scene->_sprites.remove(_globals._spriteIndexes[11]); - _scene->_spriteSlots.fullRefresh(true); break; } _action._inProgress = false; -- cgit v1.2.3 From 82faf6b50da5996b1783877a9c2685d8272ffc0e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 9 Mar 2015 20:02:55 -0400 Subject: MADS: Fix walking to exit in guard room after dropping severed arm --- engines/mads/nebular/nebular_scenes3.cpp | 3 +-- engines/mads/player.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 2ea476008f..8f07993e07 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -4152,7 +4152,7 @@ void Scene352::setup() { void Scene352::putArmDown(bool corridorExit, bool doorwayExit) { switch (_game._trigger) { case 0: - _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 60, _game.getQuote(0xFF)); + _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(0xFF)); _scene->_sequences.addTimer(48, 1); break; @@ -4197,7 +4197,6 @@ void Scene352::putArmDown(bool corridorExit, bool doorwayExit) { case 4: _game._player.walk(Common::Point(116, 107), FACING_NORTH); - _game._player._stepEnabled = true; _mustPutArmDownFl = false; _scene->_sequences.addTimer(180, 5); _leaveRoomFl = true; diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index 68e0355df9..38e8638415 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -664,7 +664,7 @@ void Player::startMovement() { _deltaDistance = (majorChange == 0) ? 0 : _totalDistance / majorChange; if (_playerPos.x > _targetPos.x) - _pixelAccum = MAX(_posChange.x, _posChange.y); + _pixelAccum = MIN(_posChange.x, _posChange.y); else _pixelAccum = 0; -- cgit v1.2.3 From d23e493b467a24e5d61dcb936b1c2e042c3ae9ce Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 9 Mar 2015 20:35:10 -0400 Subject: MADS: Fix crash if you talk to intern in gurney room too quickly --- engines/mads/nebular/nebular_scenes3.cpp | 6 ++++++ engines/mads/sequence.cpp | 17 +++++++++++++++-- engines/mads/sequence.h | 3 ++- 3 files changed, 23 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 8f07993e07..0b22aa7720 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -2581,6 +2581,12 @@ void Scene318::handleInternDialog(int quoteId, int quoteNum, uint32 timeout) { _scene->_kernelMessages.reset(); _internTalkingFl = true; + // WORKAROUND: In case the player launches multiple talk selections with the + // intern before previous ones have finished, take care of removing any + int seqIndex; + while ((seqIndex = _scene->_sequences.findByTrigger(63)) != -1) + _scene->_sequences.remove(seqIndex); + for (int i = 0; i < quoteNum; i++) { _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _scene->_sequences.addTimer(180, 63); diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp index 7dbf4cf3be..744e246321 100644 --- a/engines/mads/sequence.cpp +++ b/engines/mads/sequence.cpp @@ -144,7 +144,7 @@ int SequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int tri return seqIndex; } -int SequenceList::addTimer(int timeout, int abortVal) { +int SequenceList::addTimer(int timeout, int endTrigger) { Scene &scene = _vm->_game->_scene; uint seqIndex; for (seqIndex = 0; seqIndex < _entries.size(); ++seqIndex) { @@ -164,7 +164,7 @@ int SequenceList::addTimer(int timeout, int abortVal) { se._entries._count = 0; se._triggerMode = _vm->_game->_triggerSetupMode; se._actionNouns = _vm->_game->_scene._action._activeAction; - addSubEntry(seqIndex, SEQUENCE_TRIGGER_EXPIRE, 0, abortVal); + addSubEntry(seqIndex, SEQUENCE_TRIGGER_EXPIRE, 0, endTrigger); return seqIndex; } @@ -181,6 +181,19 @@ void SequenceList::remove(int seqIndex) { scene._spriteSlots.deleteTimer(seqIndex); } +int SequenceList::findByTrigger(int trigger) { + for (int idx = 0; idx < _entries.size(); ++idx) { + if (_entries[idx]._active) { + for (uint subIdx = 0; subIdx < _entries[idx]._entries._count; ++subIdx) { + if (_entries[idx]._entries._trigger[subIdx] == trigger) + return idx; + } + } + } + + return -1; +} + void SequenceList::setSpriteSlot(int seqIndex, SpriteSlot &spriteSlot) { Scene &scene = _vm->_game->_scene; SequenceEntry &timerEntry = _entries[seqIndex]; diff --git a/engines/mads/sequence.h b/engines/mads/sequence.h index 1555232780..8b236af15e 100644 --- a/engines/mads/sequence.h +++ b/engines/mads/sequence.h @@ -101,8 +101,9 @@ public: int extraTicks, int numTicks, int msgX, int msgY, bool nonFixed, int scale, int depth, int frameInc, SpriteAnimType animType, int numSprites, int frameStart); - int addTimer(int timeout, int abortVal); + int addTimer(int timeout, int endTrigger); void remove(int seqIndex); + int findByTrigger(int trigger); void setSpriteSlot(int seqIndex, SpriteSlot &spriteSlot); bool loadSprites(int seqIndex); void tick(); -- cgit v1.2.3 From b03d46ceeb2c8969fa496298a6bfc8c49b6994f7 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 10 Mar 2015 06:39:09 +0100 Subject: MADS: Silence GCC signed/unsigned warnings --- engines/mads/sequence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp index 744e246321..ba0111a844 100644 --- a/engines/mads/sequence.cpp +++ b/engines/mads/sequence.cpp @@ -182,9 +182,9 @@ void SequenceList::remove(int seqIndex) { } int SequenceList::findByTrigger(int trigger) { - for (int idx = 0; idx < _entries.size(); ++idx) { + for (uint idx = 0; idx < _entries.size(); ++idx) { if (_entries[idx]._active) { - for (uint subIdx = 0; subIdx < _entries[idx]._entries._count; ++subIdx) { + for (int subIdx = 0; subIdx < _entries[idx]._entries._count; ++subIdx) { if (_entries[idx]._entries._trigger[subIdx] == trigger) return idx; } -- cgit v1.2.3 From 98f77a66519bdf8f8004e1f78ed1822246919b58 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Mar 2015 20:10:55 -0400 Subject: MADS: Fix timer module hotspot remaining active after taking it --- engines/mads/screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 6199da5925..5076bbb099 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -538,7 +538,7 @@ void ScreenObjects::elementHighlighted() { } void ScreenObjects::setActive(ScrCategory category, int descId, bool active) { - for (uint idx = 1; idx < size(); ++idx) { + for (uint idx = 1; idx <= size(); ++idx) { ScreenObject &sObj = (*this)[idx]; if (sObj._category == category && sObj._descId == descId) sObj._active = active; -- cgit v1.2.3 From 4c765121bc0b49a115d2248850d9798303e46853 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Mar 2015 20:18:42 -0400 Subject: MADS: Fix door closing anim when leaving video store --- engines/mads/nebular/nebular_scenes6.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 11e3ff78b0..7887044804 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -2574,7 +2574,7 @@ void Scene609::step() { case 62: _scene->_sequences.remove( _globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_hotspots.activate(NOUN_VIDEO_STORE_DOOR, true); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 9); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 63); -- cgit v1.2.3 From 0503893f1cd1f3710e65dd43c236112b62ca1ecc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Mar 2015 20:32:44 -0400 Subject: MADS: Improved fix for giving batteries to Herman --- engines/mads/nebular/globals_nebular.h | 2 +- engines/mads/nebular/nebular_scenes6.cpp | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h index ce671f653d..8d0c26d96d 100644 --- a/engines/mads/nebular/globals_nebular.h +++ b/engines/mads/nebular/globals_nebular.h @@ -150,7 +150,7 @@ enum GlobalId { kConvHermit1 = 130, kConvHermit2 = 131, kHasTalkedToHermit = 132, - kExecuted_1_11 = 133, + kHermitWantsBatteries = 133, kHandsetCellStatus = 134, kBeenInVideoStore = 135, kDurafailRecharged = 136, diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 7887044804..0675ce1c6c 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -3275,8 +3275,7 @@ void Scene611::handleSubDialog1() { // WORKAROUND: Fix bug in the original where the option to give Hermit batteries // would be given before the player even has any batteries - //if (!_game._objects.isInInventory(OBJ_DURAFAIL_CELLS) && !_game._objects.isInInventory(OBJ_PHONE_CELLS)) - // _globals[kExecuted_1_11] = true; + _globals[kHermitWantsBatteries] = true; setDialogNode(1); break; @@ -3968,14 +3967,11 @@ void Scene611::enter() { _scene->_hotspots.activate(NOUN_HERMIT, false); } - /* WORKAROUND: Pretty sure this is a debugging code fragment that should be ignored - if (_globals[kExecuted_1_11]) { - _dialog1.write(0x294, true); - _dialog1.write(0x292, false); - _globals[kExecuted_1_11] = true; - }*/ - if ((_game._objects.isInInventory(OBJ_DURAFAIL_CELLS)) || (_game._objects.isInInventory(OBJ_PHONE_CELLS))) - _dialog1.write(0x294, true); + // WORKAROUND: Fix original adding 'give batteries' option even if you don't have them + if (_globals[kHermitWantsBatteries]) { + if ((_game._objects.isInInventory(OBJ_DURAFAIL_CELLS)) || (_game._objects.isInInventory(OBJ_PHONE_CELLS))) + _dialog1.write(0x294, true); + } if (_duringDialogFl) { _game._player._playerPos = Common::Point(237, 129); -- cgit v1.2.3 From 879e44a2fb548040fdff83b82445ddea43678f32 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Mar 2015 20:51:55 -0400 Subject: MADS: Fix Herman's thanks for batteries speech remaining on-screen --- engines/mads/nebular/nebular_scenes6.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 0675ce1c6c..bcf7d73bd0 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -3829,29 +3829,29 @@ void Scene611::displayHermitQuestions(int question) { Common::String curQuote = _game.getQuote(0x2D3); int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing); int quotePosX = _defaultDialogPos.x - (width / 2); - _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 3), 0xFDFC, 0, 0, 9999999, curQuote); + _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 3), 0xFDFC, 0, 0, 800, curQuote); curQuote = _game.getQuote(0x2D4); width = _vm->_font->getWidth(curQuote, _scene->_textSpacing); quotePosX = _defaultDialogPos.x - (width / 2); - _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote); + _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 800, curQuote); curQuote = _game.getQuote(0x2D5); width = _vm->_font->getWidth(curQuote, _scene->_textSpacing); quotePosX = _defaultDialogPos.x - (width / 2); - _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote); + _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 800, curQuote); curQuote = _game.getQuote(0x2D6); width = _vm->_font->getWidth(curQuote, _scene->_textSpacing); quotePosX = _defaultDialogPos.x - (width / 2); - _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote); + _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 800, curQuote); curQuote = _game.getQuote(0x2D7); width = _vm->_font->getWidth(curQuote, _scene->_textSpacing); quotePosX = _defaultDialogPos.x - (width / 2); - _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote); - } - break; + _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 800, curQuote); + } + break; case 22: { Common::String curQuote = _game.getQuote(0x2D8); -- cgit v1.2.3 From 01c3e3b9d5dcb9393ddb659cf8f01e5dc771b38f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Mar 2015 21:04:36 -0400 Subject: MADS: Fix door animations for South Elevator --- engines/mads/nebular/nebular_scenes5.cpp | 2 +- engines/mads/nebular/nebular_scenes7.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 7cdc55e03c..98efeba82f 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -2641,7 +2641,7 @@ void Scene513::actions() { _scene->_sequences.updateTimeout(-1, _globals._sequenceIndexes[4]); _game._player._visible = true; _scene->_sequences.remove(_globals._sequenceIndexes[2]); - _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); + _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 7, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2); _vm->_sound->command(24); _scene->_kernelMessages.reset(); diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 006b3ca6ec..6e191b2eef 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -2287,7 +2287,7 @@ void Scene751::step() { case 62: _vm->_sound->command(17); - _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); + _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 5, 1, 0, 0); _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(48, 136)); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 63); -- cgit v1.2.3 From 0e03995463c7ae2c297066c89f2fb55569be0392 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Mar 2015 21:16:01 -0400 Subject: MADS: Fix display of crack and background in ship --- engines/mads/nebular/nebular_scenes8.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 24a1855c36..1a8e7efc60 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -904,10 +904,10 @@ void Scene804::enter() { _game._player._stepEnabled = false; } } else { - if (_globals[kBeamIsUp] == 0) + if (_globals[kBeamIsUp]) _globals._sequenceIndexes[8] = _scene->_sequences.startCycle(_globals._spriteIndexes[8], false, 1); - if (_globals[kWindowFixed] == 0) + if (_globals[kWindowFixed]) _globals._sequenceIndexes[4] = _scene->_sequences.startCycle(_globals._spriteIndexes[4], false, 1); _globals._sequenceIndexes[1] = _scene->_sequences.startCycle(_globals._spriteIndexes[1], false, 1); -- cgit v1.2.3 From e18a0af32b77901419865ccc8942c66cbd88e8bd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Mar 2015 22:17:48 -0400 Subject: MADS: Fix incorrect depth for animation when repairing crack in ship --- engines/mads/nebular/nebular_scenes8.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 1a8e7efc60..e18dfc634d 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -904,8 +904,10 @@ void Scene804::enter() { _game._player._stepEnabled = false; } } else { - if (_globals[kBeamIsUp]) + if (_globals[kBeamIsUp]) { _globals._sequenceIndexes[8] = _scene->_sequences.startCycle(_globals._spriteIndexes[8], false, 1); + _scene->_sequences.setDepth(_globals._sequenceIndexes[8], 7); + } if (_globals[kWindowFixed]) _globals._sequenceIndexes[4] = _scene->_sequences.startCycle(_globals._spriteIndexes[4], false, 1); -- cgit v1.2.3 From 1e3442ae44e804c17e51d84972092fc459908ece Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 10 Mar 2015 22:54:47 -0400 Subject: MADS: Fix boat hotspot after loading savegame for scene 801 --- engines/mads/nebular/nebular_scenes7.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 6e191b2eef..96e56b639a 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -155,10 +155,13 @@ void Scene701::enter() { _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], false, 20, 0, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 10); break; - case BOAT_TIED: + case BOAT_TIED: { _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, -1); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 9); + int idx = _scene->_dynamicHotspots.add(837, 759, _globals._sequenceIndexes[2], Common::Rect()); + _scene->_dynamicHotspots.setPosition(idx, Common::Point(231, 127), FACING_NORTH); break; + } case BOAT_GONE: _scene->_hotspots.activate(NOUN_BOAT, false); break; -- cgit v1.2.3 From 8e3ee9523edb3aa47ad512bef82ce535f69042d9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 11 Mar 2015 22:10:41 -0400 Subject: MADS: Fix cycling remaining active when ending TextView starts --- engines/mads/scene.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads') diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index a72648f0c9..bbc83a791b 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -666,6 +666,7 @@ void Scene::freeCurrentScene() { } _vm->_palette->_paletteUsage.load(nullptr); + _cyclingActive = false; _hotspots.clear(); _backgroundSurface.free(); _depthSurface.free(); -- cgit v1.2.3 From ed33dee7539c6b05f7dba18fb87cdd44c09ba3cd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 13 Mar 2015 08:43:27 -0400 Subject: MADS: Fix distortions when playing many of the sounds --- engines/mads/nebular/sound_nebular.cpp | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp index d41d0075eb..6412654fd6 100644 --- a/engines/mads/nebular/sound_nebular.cpp +++ b/engines/mads/nebular/sound_nebular.cpp @@ -594,7 +594,7 @@ void ASound::pollActiveChannel() { break; case 8: - chan->_field1D = *++pSrc; + chan->_field1D = (int8)*++pSrc; chan->_pSrc += 2; break; @@ -733,8 +733,8 @@ void ASound::updateChannelState() { resultCheck(); } else { int reg = 0xA0 + _activeChannelNumber; - int vTimes = (_activeChannelPtr->_field4 + _activeChannelPtr->_field1F) / 12; - int vOffset = (_activeChannelPtr->_field4 + _activeChannelPtr->_field1F) % 12; + int vTimes = (byte)(_activeChannelPtr->_field4 + _activeChannelPtr->_field1F) / 12; + int vOffset = (byte)(_activeChannelPtr->_field4 + _activeChannelPtr->_field1F) % 12; int val = _vList1[vOffset] + _activeChannelPtr->_field1D; write2(8, reg, val & 0xFF); @@ -751,17 +751,6 @@ static const int outputIndexes[] = { static const int outputChannels[] = { 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 0 }; -static const int volumeList[] = { - 0x3F, 0x3F, 0x36, 0x31, 0x2D, 0x2A, 0x28, 0x26, 0x24, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, - 0x1B, 0x1A, 0x19, 0x19, 0x18, 0x17, 0x17, 0x16, 0x16, 0x15, 0x15, 0x14, 0x14, 0x13, 0x12, 0x12, - 0x11, 0x11, 0x10, 0x10, 0x0F, 0x0F, 0x0E, 0x0E, 0x0D, 0x0D, 0x0C, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, - 0x0A, 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; void ASound::updateActiveChannel() { int reg = 0x40 + outputChannels[outputIndexes[_activeChannelNumber * 2 + 1]]; @@ -770,13 +759,9 @@ void ASound::updateActiveChannel() { // Note: Original had a whole block not seeming to be used, since the initialisation // sets a variable to 5660h, and doesn't change it, so the branch is never taken - int val = CLIP(newVolume - volumeList[_activeChannelPtr->_fieldD], 0, 63); - val = (63 - val) | portVal; + portVal |= 63 - newVolume; - int val2 = CLIP(newVolume - volumeList[-(_activeChannelPtr->_fieldD - 127)], 0, 63); - val2 = (63 - val2) | portVal; - write2(0, reg, val); - write2(2, reg, val2); + write2(8, reg, portVal); } void ASound::loadSample(int sampleIndex) { -- cgit v1.2.3 From c0df1248b5a73f4b0f02d0712907878aa265dff4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 13 Mar 2015 21:54:20 -0400 Subject: MADS: Properly handle reloading scenes when closing dialogs --- engines/mads/nebular/dialogs_nebular.cpp | 18 +++++++++++----- engines/mads/nebular/nebular_scenes.cpp | 2 +- engines/mads/nebular/nebular_scenes1.cpp | 28 ++++++++++++------------ engines/mads/nebular/nebular_scenes2.cpp | 28 ++++++++++++------------ engines/mads/nebular/nebular_scenes3.cpp | 37 ++++++++++++++++---------------- engines/mads/nebular/nebular_scenes4.cpp | 20 ++++++++--------- engines/mads/nebular/nebular_scenes5.cpp | 26 +++++++++++----------- engines/mads/nebular/nebular_scenes6.cpp | 20 ++++++++--------- engines/mads/nebular/nebular_scenes7.cpp | 16 +++++++------- engines/mads/nebular/nebular_scenes8.cpp | 6 +++--- engines/mads/scene.h | 2 ++ 11 files changed, 107 insertions(+), 96 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 23aef6bdb5..6c57c85408 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -344,7 +344,7 @@ void DialogsNebular::showDialog() { void DialogsNebular::showScummVMSaveDialog() { Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game; - Scene *scene = &(game._scene); + Scene &scene = game._scene; GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true); int slot = dialog->runModalWithCurrentTarget(); @@ -356,24 +356,31 @@ void DialogsNebular::showScummVMSaveDialog() { desc = dialog->createDefaultSaveDescription(slot); } - scene->_spriteSlots.reset(); - scene->loadScene(scene->_currentSceneId, game._aaName, true); - scene->_userInterface.noInventoryAnim(); + scene._spriteSlots.reset(); + scene.loadScene(scene._currentSceneId, game._aaName, true); + scene._userInterface.noInventoryAnim(); game._scene.drawElements(kTransitionFadeIn, false); game.saveGame(slot, desc); } + + // Flag for scene loading that we're returning from a dialog + scene._currentSceneId = RETURNING_FROM_DIALOG; } void DialogsNebular::showScummVMRestoreDialog() { Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game; GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false); + Scene &scene = game._scene; int slot = dialog->runModalWithCurrentTarget(); if (slot >= 0) { game._loadGameSlot = slot; - game._scene._currentSceneId = -1; + game._scene._currentSceneId = RETURNING_FROM_LOADING; game._currentSectionNumber = -1; + } else { + // Flag for scene loading that we're returning from a dialog + scene._currentSceneId = RETURNING_FROM_DIALOG; } } @@ -637,6 +644,7 @@ void GameDialog::display() { GameDialog::~GameDialog() { _vm->_screen.resetClipBounds(); + _vm->_game->_scene._currentSceneId = RETURNING_FROM_DIALOG; } void GameDialog::clearLines() { diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index 72073b1c7b..14cf71d0fc 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -538,7 +538,7 @@ void SceneTeleporter::teleporterEnter() { _curMessageId = -1; _msgText = "_"; - if (_scene->_priorSceneId == -2) + if (_scene->_priorSceneId == RETURNING_FROM_DIALOG) _scene->_priorSceneId = _globals[kTeleporterDestination]; if (_scene->_priorSceneId < 101) diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index d505bb3d4e..dc2eb1f068 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -188,13 +188,13 @@ void Scene101::enter() { _scene->_hotspots.activate(NOUN_SHIELD_MODULATOR, false); _panelOpened = false; - if (_scene->_priorSceneId != -1) + if (_scene->_priorSceneId != RETURNING_FROM_LOADING) _globals[kNeedToStandUp] = false; - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(100, 152); - if ((_scene->_priorSceneId == 112) || ((_scene->_priorSceneId == -2) && _sittingFl )) { + if ((_scene->_priorSceneId == 112) || ((_scene->_priorSceneId == RETURNING_FROM_DIALOG) && _sittingFl )) { _game._player._visible = false; _sittingFl = true; _game._player._playerPos = Common::Point(161, 123); @@ -721,7 +721,7 @@ void Scene102::enter() { _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 70); } else if (_scene->_priorSceneId == 103) _game._player._playerPos = Common::Point(47, 152); - else if (_scene->_priorSceneId != -2) { + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._facing = FACING_NORTHWEST; _game._player._playerPos = Common::Point(32, 129); } @@ -1342,7 +1342,7 @@ void Scene103::enter() { _scene->_hotspots.activate(362, false); } - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(237, 74); if (_scene->_priorSceneId == 102) { @@ -1625,7 +1625,7 @@ void Scene104::enter() { if (_scene->_priorSceneId == 105) _game._player._playerPos = Common::Point(302, 107); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(160, 134); _loseFl = false; @@ -1847,7 +1847,7 @@ void Scene105::enter() { if (_scene->_priorSceneId == 104) _game._player._playerPos = Common::Point(13, 97); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(116, 147); _game.loadQuoteSet(0x4A, 0x4B, 0x4C, 0x35, 0x34, 0); @@ -2021,7 +2021,7 @@ void Scene106::enter() { _game._player._stepEnabled = false; _game._player._facing = FACING_EAST; _game._player._playerPos = Common::Point(106, 69); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { if (_scene->_priorSceneId == 107) { _game._player._playerPos = Common::Point(319, 84); _game._player._facing = _game._player._prepareWalkFacing = FACING_WEST; @@ -2240,7 +2240,7 @@ void Scene107::enter() { _game._player._playerPos = Common::Point(132, 47); else if (_scene->_priorSceneId == 106) _game._player._playerPos = Common::Point(20, 91); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(223, 151); if (((_scene->_priorSceneId == 105) || (_scene->_priorSceneId == 106)) && (_vm->getRandomNumber(1, 3) == 1)) { @@ -2352,7 +2352,7 @@ void Scene108::enter() { if (_scene->_priorSceneId == 107) _game._player._playerPos = Common::Point(138, 58); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(305, 98); _game.loadQuoteSet(0x4A, 0x4B, 0x4C, 0x35, 0x34, 0); @@ -2459,7 +2459,7 @@ void Scene109::enter() { if (_scene->_priorSceneId == 110) { _game._player._playerPos = Common::Point(248, 38); _globals[kHoovicSated] = 2; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(20, 68); _game._player._facing = FACING_EAST; } @@ -2865,7 +2865,7 @@ void Scene110::enter() { _scene->_dynamicHotspots.setPosition(idx, Common::Point(-1, 0), FACING_NONE); idx = _scene->_dynamicHotspots.add(91, 348, _globals._sequenceIndexes[3], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(-1, 0), FACING_NONE); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(194, 23); _game._player._facing = FACING_SOUTH; _game._player._visible = false; @@ -3008,7 +3008,7 @@ void Scene111::enter() { _launched2Fl = false; _stampedFl = false; - if ((_scene->_priorSceneId < 201) && (_scene->_priorSceneId != -2)) { + if ((_scene->_priorSceneId < 201) && (_scene->_priorSceneId != RETURNING_FROM_DIALOG)) { _game._player._stepEnabled = false; _game._player._visible = false; _scene->loadAnimation(Resources::formatName(111, 'A', 0, EXT_AA, ""), 70); @@ -3019,7 +3019,7 @@ void Scene111::enter() { _launched2Fl = true; _vm->_sound->command(36); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(300, 130); _game._player._facing = FACING_WEST; } diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index d62497007c..84910c4de3 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -152,7 +152,7 @@ void Scene201::enter() { int idx = _scene->_dynamicHotspots.add(NOUN_BIRDS, 209, _globals._sequenceIndexes[4], Common::Rect(0, 0, 0, 0)); _scene->_dynamicHotspots.setPosition(idx, Common::Point(186, 81), FACING_NORTH); - if ((_scene->_priorSceneId == 202) || (_scene->_priorSceneId == -1)) { + if ((_scene->_priorSceneId == 202) || (_scene->_priorSceneId == RETURNING_FROM_LOADING)) { _game._player._playerPos = Common::Point(165, 152); } else { _game._player._playerPos = Common::Point(223, 149); @@ -430,7 +430,7 @@ void Scene202::enter() { if (_scene->_priorSceneId == 201) { _game._player._playerPos = Common::Point(190, 91); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(178, 152); _game._player._facing = FACING_NORTH; } @@ -446,7 +446,7 @@ void Scene202::enter() { _game.loadQuoteSet(0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x62, 0x63, 0x64, 0x65, 0x66, 0x61, 0); _activeMsgFl = false; - if (_scene->_priorSceneId == -2) { + if (_scene->_priorSceneId == RETURNING_FROM_DIALOG) { if (_waitingMeteoFl) { _globals._sequenceIndexes[9] = _scene->_sequences.startCycle(_globals._spriteIndexes[9], false, 1); _game._player._visible = false; @@ -1044,7 +1044,7 @@ void Scene203::enter() { } else if (_scene->_priorSceneId == 209) { _game._player._playerPos = Common::Point(308, 117); _game._player._facing = FACING_WEST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(155, 152); _game._player._facing = FACING_NORTH; } @@ -1222,7 +1222,7 @@ void Scene205::enter() { Common::Rect(195, 99, 264, 134), 13, 2, 0xFDFC, 60, 108, 108, 109, 109, 110, 110, 111, 108, 0); - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(99, 152); if (_globals[kSexOfRex] != SEX_MALE) { @@ -1516,7 +1516,7 @@ void Scene207::enter() { } else if (_scene->_priorSceneId == 214) { _game._player._playerPos = Common::Point(164, 117); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(305, 131); } @@ -1728,7 +1728,7 @@ void Scene208::enter() { } else if (_scene->_priorSceneId == 209) { _game._player._playerPos = Common::Point(307, 123); _game._player._facing = FACING_WEST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(162, 149); _game._player._facing = FACING_NORTH; } @@ -2856,7 +2856,7 @@ void Scene209::enter() { if (_scene->_priorSceneId == 208) { _game._player._playerPos = Common::Point(11, 121); _game._player._facing = FACING_EAST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(28, 121); _game._player._facing = FACING_SOUTH; } @@ -4173,7 +4173,7 @@ void Scene210::enter() { _game._player._playerPos = Common::Point(168, 128); _game._player._facing = FACING_SOUTH; _globals[kCurtainOpen] = true; - } else if (_scene->_priorSceneId != -2) + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(308, 132); if (!_globals[kCurtainOpen]) { @@ -4210,7 +4210,7 @@ void Scene210::enter() { _twinkleAnimationType = 0; _twinklesCurrentFrame = 0; - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _shouldMoveHead = false; _shouldFaceRex = false; _shouldTalk = false; @@ -4647,7 +4647,7 @@ void Scene211::enter() { _game._player._visible = false; _scene->loadAnimation(formAnimName('A', -1), 100); _scene->_activeAnimation->setCurrentFrame(169); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(310, 31); _game._player._facing = FACING_SOUTHWEST; } @@ -4905,7 +4905,7 @@ void Scene212::enter() { if (_scene->_priorSceneId == 208) { _game._player._playerPos = Common::Point(195, 85); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(67, 117); _game._player._facing = FACING_NORTHEAST; } @@ -5061,7 +5061,7 @@ void Scene214::enter() { _scene->_hotspots.activate(NOUN_BLOWGUN, false); } - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(191, 152); sceneEntrySound(); @@ -5257,7 +5257,7 @@ void Scene215::enter() { _game._player._stepEnabled = false; _globals._sequenceIndexes[3] = _scene->_sequences.startCycle(_globals._spriteIndexes[3], false, 1); _scene->_sequences.addTimer(120, 70); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(204, 152); _game._player._facing = FACING_NORTH; } diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 0b22aa7720..1a477c3bb8 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -769,7 +769,7 @@ void Scene307::enter() { _dialog2.write(0x11E, true); - if (_scene->_priorSceneId == -2) { + if (_scene->_priorSceneId == RETURNING_FROM_DIALOG) { if (_grateOpenedFl) _vm->_sound->command(10); else @@ -1618,7 +1618,7 @@ void Scene311::enter() { else if (_scene->_priorSceneId == 320) { _game._player._playerPos = Common::Point(129, 113); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._visible = false; _game._player._stepEnabled = false; _scene->loadAnimation(formAnimName('a', -1), 70); @@ -1896,7 +1896,7 @@ void Scene313::enter() { } else if (_scene->_priorSceneId == 388) { _game._player._playerPos = Common::Point(199, 70); _game._player._facing = FACING_WEST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(234, 70); _game._player._facing = FACING_WEST; } @@ -2215,7 +2215,7 @@ void Scene316::enter() { _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[spriteIdx], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 2); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 60); - } else if (_scene->_priorSceneId != -2) + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(291, 126); sceneEntrySound(); @@ -2617,7 +2617,7 @@ void Scene318::enter() { if (_scene->_priorSceneId == 357) _game._player._playerPos = Common::Point(15, 110); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(214, 152); _dialog1.setup(0x47, 0x191, 0x192, 0x193, 0x194, 0x195, 0x196, 0x197, 0x198, 0x199, 0x19A, 0x19B, 0x19C, 0x19D, 0); @@ -2638,7 +2638,7 @@ void Scene318::enter() { _lastFrame = 0; _scene->_hotspots.activate(NOUN_INTERN, false); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _dialogFl = false; _internWalkingFl = false; _counter= 0; @@ -2655,7 +2655,8 @@ void Scene318::enter() { 0x1C8, 0x1C9, 0x1CA, 0x1CB, 0x1CC, 0x1CD, 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3, 0x190, 0x19D, 0); - if ((_scene->_priorSceneId== -2) || (((_scene->_priorSceneId == 318) || (_scene->_priorSceneId == -1)) && (!_globals[kAfterHavoc]))) { + if ((_scene->_priorSceneId == RETURNING_FROM_DIALOG) || (((_scene->_priorSceneId == 318) || + (_scene->_priorSceneId == RETURNING_FROM_LOADING)) && (!_globals[kAfterHavoc]))) { if (!_globals[kAfterHavoc]) { _game._player._visible = false; _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('g', -1)); @@ -3119,7 +3120,7 @@ void Scene319::enter() { _dialog2.setup(0x44, 0x171, 0x172, 0x173, 0x174, 0x175, 0x176, 0); _dialog3.setup(0x45, 0x17D, 0x17E, 0x17F, 0x180, 0x181, 0x182, 0x183, 0); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _dialog1.set(0x165, 0x166, 0x167, 0x168, 0); _dialog2.set(0x171, 0x172, 0x173, 0x174, 0); _dialog3.set(0x17D, 0x17E, 0x17F, 0x180, 0); @@ -3142,7 +3143,7 @@ void Scene319::enter() { _scene->loadAnimation(formAnimName('b', 0)); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _animMode = 1; _nextAction1 = 2; _nextAction2 = 2; @@ -3981,7 +3982,7 @@ void Scene351::enter() { if (_scene->_priorSceneId == 352) _game._player._playerPos = Common::Point(148, 152); - else if (_scene->_priorSceneId != -2) { + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(207, 81); _game._player._facing = FACING_NORTH; } @@ -4266,7 +4267,7 @@ void Scene352::enter() { _vaultOpenFl = false; - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _mustPutArmDownFl = false; if (!_game._visitedScenes._sceneRevisited) _globals[kHaveYourStuff] = false; @@ -4281,7 +4282,7 @@ void Scene352::enter() { if (_scene->_priorSceneId == 353) _game._player._playerPos = Common::Point(171, 155); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(116, 107); sceneEntrySound(); @@ -4750,7 +4751,7 @@ void Scene354::enter() { _game._player._facing = FACING_NORTH; } else if (_scene->_priorSceneId == 316) _game._player._playerPos = Common::Point(71, 107); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(167, 57); sceneEntrySound(); @@ -4817,7 +4818,7 @@ void Scene357::enter() { _game._player._playerPos = Common::Point(298, 142); else if (_scene->_priorSceneId == 313) _game._player._playerPos = Common::Point(127, 101); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(15, 148); sceneEntrySound(); @@ -4881,7 +4882,7 @@ void Scene358::enter() { if (_scene->_priorSceneId == 357) _game._player._playerPos = Common::Point(305, 142); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(12, 141); sceneEntrySound(); @@ -4957,7 +4958,7 @@ void Scene359::enter() { if (_scene->_priorSceneId == 358) _game._player._playerPos = Common::Point(301, 141); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(15, 148); sceneEntrySound(); @@ -5080,7 +5081,7 @@ void Scene360::enter() { if (_scene->_priorSceneId == 359) _game._player._playerPos = Common::Point(304, 143); - else if (_scene->_priorSceneId != -2) + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(13, 141); sceneEntrySound(); @@ -5346,7 +5347,7 @@ void Scene361::enter() { else if (_scene->_priorSceneId == 320) { _game._player._playerPos = Common::Point(129, 113); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(13, 145); _game.loadQuoteSet(0xFB, 0xFC, 0); diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp index 9db597c312..29b17c42c0 100644 --- a/engines/mads/nebular/nebular_scenes4.cpp +++ b/engines/mads/nebular/nebular_scenes4.cpp @@ -113,7 +113,7 @@ void Scene401::setup() { } void Scene401::enter() { - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _northFl = false; _timer = 0; @@ -125,7 +125,7 @@ void Scene401::enter() { _game._player._playerPos = Common::Point(149, 90); _game._player._facing = FACING_SOUTH; _northFl = true; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(142, 131); _game._player._facing = FACING_NORTH; } @@ -718,7 +718,7 @@ void Scene402::enter() { _roxOnStool = false; _bartenderDialogNode = 1; _conversationFl = false; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(160, 150); _game._player._facing = FACING_NORTH; _game._objects.addToInventory(OBJ_CREDIT_CHIP); @@ -2411,7 +2411,7 @@ void Scene405::enter() { } else if (_scene->_priorSceneId == 413) { _game._player._playerPos = Common::Point(284, 109); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(23, 123); _game._player._facing = FACING_EAST; } @@ -2587,7 +2587,7 @@ void Scene406::enter() { } else if (_scene->_priorSceneId == 411) { _game._player._playerPos = Common::Point(153, 108); _game._player._facing = FACING_SOUTH; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(15, 129); _game._player._facing = FACING_EAST; } @@ -2791,14 +2791,14 @@ void Scene407::setup() { } void Scene407::enter() { - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _fromNorth = false; if (_scene->_priorSceneId == 318) { _game._player._playerPos = Common::Point(172, 92); _game._player._facing = FACING_SOUTH; _fromNorth = true; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(172, 132); _game._player._facing = FACING_NORTH; } @@ -3118,7 +3118,7 @@ void Scene410::enter() { else _scene->_hotspots.activate(NOUN_CHARGE_CASES, false); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(155, 150); _game._player._facing = FACING_NORTH; } @@ -3646,7 +3646,7 @@ void Scene411::enter() { _scene->_dynamicHotspots.setPosition(idx, Common::Point(220, 121), FACING_NORTHEAST); } - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(60, 146); _game._player._facing = FACING_NORTHEAST; } @@ -4058,7 +4058,7 @@ void Scene413::enter() { _game._player._playerPos = Common::Point(142, 146); _game._player._facing = FACING_NORTH; _game._player._visible = true; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { if (_globals[kSexOfRex] == REX_MALE) { _scene->loadAnimation(Resources::formatName(413, 'd', 1, EXT_AA, ""), 78); _vm->_sound->command(30); diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 98efeba82f..e6ab658eb4 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -199,7 +199,7 @@ void Scene501::enter() { _game._player._playerPos = Common::Point(317, 102); _game._player._facing = FACING_SOUTHWEST; _scene->_sequences.addTimer(15, 80); - } else if (_scene->_priorSceneId != -2) + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(299, 131); if (_scene->_roomChanged) { @@ -563,7 +563,7 @@ void Scene503::enter() { _scene->_dynamicHotspots.setPosition(_detonatorHotspotId, Common::Point(254, 135), FACING_SOUTH); } - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(191, 152); _game._player._facing = FACING_NORTHWEST; } @@ -709,7 +709,7 @@ void Scene504::enter() { _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('a', 3)); _carAnimationMode = 1; _scene->loadAnimation(formAnimName('A', -1)); - if ((_scene->_priorSceneId != -2) && (_scene->_priorSceneId != 505)) + if ((_scene->_priorSceneId != RETURNING_FROM_DIALOG) && (_scene->_priorSceneId != 505)) _globals[kHoverCarLocation] = _scene->_priorSceneId; _globals._sequenceIndexes[7] = _scene->_sequences.startCycle(_globals._spriteIndexes[7], false, 1); @@ -912,7 +912,7 @@ void Scene505::enter() { _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('t', -1)); _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('e', -1)); - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _globals._sequenceIndexes[12] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[12], false, 6, 1, 0, 0); _globals._sequenceIndexes[13] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[13], false, 6, 1, 120, 0); @@ -934,7 +934,7 @@ void Scene505::enter() { for (int i = 0; i < 9; i++) { if (_globals[kHoverCarLocation] == _carLocations[i]) { _homeSelectedId = i; - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _selectedId = i; } } @@ -1222,7 +1222,7 @@ void Scene506::enter() { _game._player._facing = FACING_SOUTHEAST; _scene->_sequences.addTimer(60, 80); _game._player._stepEnabled = false; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(138, 116); _game._player._facing = FACING_NORTHEAST; _game._player._visible = false; @@ -1471,7 +1471,7 @@ void Scene507::enter() { _scene->_dynamicHotspots.setPosition(_penlightHotspotId, Common::Point(233, 152), FACING_SOUTHEAST); } - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(121, 147); _game._player._facing = FACING_NORTH; } @@ -1630,7 +1630,7 @@ void Scene508::enter() { if (_scene->_priorSceneId == 515) { _game._player._playerPos = Common::Point(57, 116); _game._player._facing = FACING_NORTHEAST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(289, 139); _game._player._facing = FACING_WEST; } @@ -1868,7 +1868,7 @@ void Scene511::enter() { _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 0)); _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RXCD_6"); - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _handingLine = false; if (_globals[kBoatRaised]) { @@ -1923,7 +1923,7 @@ void Scene511::enter() { if (_scene->_priorSceneId == 512) { _game._player._playerPos = Common::Point(60, 112); _game._player._facing = FACING_SOUTHEAST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(55, 152); _game._player._facing = FACING_NORTHWEST; _game._player._visible = false; @@ -2242,7 +2242,7 @@ void Scene512::enter() { } else _scene->_hotspots.activate(NOUN_PADLOCK_KEY, false); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(144, 152); _game._player._facing = FACING_NORTHEAST; } @@ -2510,7 +2510,7 @@ void Scene513::enter() { _game._player._facing = FACING_WEST; _game._player._stepEnabled = false; _scene->_sequences.addTimer(15, 80); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(63, 149); _game._player._facing = FACING_NORTHEAST; _game._player._visible = false; @@ -2744,7 +2744,7 @@ void Scene551::enter() { if (_scene->_priorSceneId == 501) _game._player._playerPos = Common::Point(18, 130); - else if (_scene->_priorSceneId != -2) { + else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(124, 119); _game._player._facing = FACING_NORTH; } diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index bcf7d73bd0..046782b772 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -112,7 +112,7 @@ void Scene601::enter() { _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, -2); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 3); _scene->loadAnimation(formAnimName('R', 1), 70); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(229, 129); _game._player._facing = FACING_SOUTHWEST; } @@ -293,7 +293,7 @@ void Scene602::enter() { if (_scene->_priorSceneId == 603) { _game._player._playerPos = Common::Point(228, 126); _game._player._facing = FACING_WEST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(50, 127); _game._player._facing = FACING_EAST; } @@ -585,7 +585,7 @@ void Scene603::enter() { _scene->_dynamicHotspots.setPosition(_noteHotspotId, Common::Point(242, 118), FACING_NORTHEAST); } - if (_scene->_priorSceneId != -2) + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) _game._player._playerPos = Common::Point(113, 134); sceneEntrySound(); @@ -750,7 +750,7 @@ void Scene604::enter() { _vm->_palette->setEntry(253, 45, 24, 17); _animationActiveFl = false; - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(72, 149); _game._player._facing = FACING_NORTHEAST; _game._player._visible = false; @@ -1106,7 +1106,7 @@ void Scene607::enter() { if (_scene->_priorSceneId == 608) { _game._player._playerPos = Common::Point(297, 50); _game._player._facing = FACING_SOUTHEAST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(40, 104); _game._player._facing = FACING_SOUTHEAST; _game._player._visible = false; @@ -1778,7 +1778,7 @@ void Scene608::enter() { _vm->_palette->setEntry(252, 63, 44, 30); _vm->_palette->setEntry(253, 63, 20, 22); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(46, 132); _game._player._facing = FACING_EAST; if (_game._difficulty == DIFFICULTY_HARD) { @@ -2535,7 +2535,7 @@ void Scene609::enter() { _game._player._facing = FACING_EAST; _scene->_sequences.addTimer(60, 60); _game._player._stepEnabled = false; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(86, 136); _game._player._facing = FACING_NORTHEAST; _game._player._visible = false; @@ -2884,7 +2884,7 @@ void Scene610::enter() { if (_scene->_roomChanged && _game._difficulty != DIFFICULTY_EASY) _game._objects.addToInventory(OBJ_PENLIGHT); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(175, 152); _game._player._facing = FACING_NORTHWEST; } @@ -3948,7 +3948,7 @@ void Scene611::enter() { _alreadyTalkingFl = false; _startTradingFl = false; - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(22, 132); _game._player._facing = FACING_EAST; _duringDialogFl = false; @@ -4560,7 +4560,7 @@ void Scene612::enter() { _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, _cycleIndex); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1); - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(280, 75); _game._player._facing = FACING_SOUTHWEST; _game._player._visible = false; diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 96e56b639a..7be66670d5 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -194,7 +194,7 @@ void Scene701::enter() { _game._player._stepEnabled = false; _scene->loadAnimation(formAnimName('B', 1), 80); _vm->_sound->command(28); - } else if (_scene->_priorSceneId != -2 && _scene->_priorSceneId != 620) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG && _scene->_priorSceneId != 620) { _game._player._playerPos = Common::Point(22, 131); _game._player._facing = FACING_EAST; _game._player._stepEnabled = false; @@ -463,7 +463,7 @@ void Scene702::enter() { if (_scene->_priorSceneId == 701) { _game._player._playerPos = Common::Point(13, 145); _game._player._facing = FACING_EAST; - } else if (_scene->_priorSceneId != -2 && _scene->_priorSceneId != 620) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG && _scene->_priorSceneId != 620) { _game._player._playerPos = Common::Point(289, 138); _game._player.walk(Common::Point(262, 148), FACING_WEST); _game._player._facing = FACING_WEST; @@ -697,7 +697,7 @@ void Scene703::enter() { _monsterMode = 0; _scene->loadAnimation(formAnimName('A', -1)); _scene->_activeAnimation->setCurrentFrame(34); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._stepEnabled = false; _boatDir = 1; if (_globals[kMonsterAlive]) { @@ -1244,7 +1244,7 @@ void Scene704::enter() { _boatDirection = 2; _scene->loadAnimation(formAnimName('A', -1)); _scene->_activeAnimation->setCurrentFrame(36); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._stepEnabled = false; _boatDirection = 1; _scene->loadAnimation(formAnimName('A', -1)); @@ -1570,7 +1570,7 @@ void Scene705::enter() { _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 9, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._stepEnabled = false; _scene->_sequences.addTimer(1, 80); _vm->_sound->command(28); @@ -1857,7 +1857,7 @@ void Scene706::enter() { if (_scene->_priorSceneId == 707) { _game._player._playerPos = Common::Point(277, 103); _game._player._facing = FACING_SOUTHWEST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(167, 152); _game._player._facing = FACING_NORTH; } @@ -2216,7 +2216,7 @@ void Scene751::enter() { _globals._sequenceIndexes[4] = _scene->_sequences.startCycle(_globals._spriteIndexes[4], false, -2); _scene->_sequences.setPosition(_globals._sequenceIndexes[4], Common::Point(155, 129)); _scene->_sequences.addTimer(15, 70); - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(22, 131); _game._player._facing = FACING_EAST; _game._player._stepEnabled = false; @@ -2530,7 +2530,7 @@ void Scene752::enter() { if (_scene->_priorSceneId == 751) { _game._player._playerPos = Common::Point(13, 145); _game._player._facing = FACING_EAST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(289, 138); _game._player.walk(Common::Point(262, 148), FACING_WEST); _game._player._facing = FACING_WEST; diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index e18dfc634d..8ce559b82b 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -121,7 +121,7 @@ void Scene801::enter() { _game._player._playerPos = Common::Point(307, 111); _game._player.walk(Common::Point(270, 118), FACING_WEST); _game._player._visible = true; - } else if ((_scene->_priorSceneId != -2) && !_globals[kTeleporterCommand]) { + } else if ((_scene->_priorSceneId != RETURNING_FROM_DIALOG) && !_globals[kTeleporterCommand]) { _game._player._playerPos = Common::Point(8, 117); _game._player.walk(Common::Point(41, 115), FACING_EAST); _game._player._visible = true; @@ -346,7 +346,7 @@ void Scene802::enter() { _game._player._playerPos = Common::Point(303, 119); _game._player._facing = FACING_WEST; - } else if (_scene->_priorSceneId != -2) { + } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(15, 129); _game._player._facing = FACING_EAST; } @@ -557,7 +557,7 @@ void Scene803::enter() { if (!_globals[kFromCockpit]) { if (!_globals[kReturnFromCut]) { - if (_scene->_priorSceneId != -2) { + if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(15, 130); _game._player._facing = FACING_EAST; } diff --git a/engines/mads/scene.h b/engines/mads/scene.h index 05053c3166..5927f4e70f 100644 --- a/engines/mads/scene.h +++ b/engines/mads/scene.h @@ -40,6 +40,8 @@ namespace MADS { +enum { RETURNING_FROM_DIALOG = -2, RETURNING_FROM_LOADING = -1 }; + class Scene { private: /** -- cgit v1.2.3 From 5c834815436014efd1f2b88455d8e44cf28ebc85 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 13 Mar 2015 22:05:21 -0400 Subject: MADS: Action fixes for top of south elevator scene --- engines/mads/nebular/nebular_scenes.h | 1 - engines/mads/nebular/nebular_scenes7.cpp | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes.h b/engines/mads/nebular/nebular_scenes.h index cf33b21aad..8549643ff8 100644 --- a/engines/mads/nebular/nebular_scenes.h +++ b/engines/mads/nebular/nebular_scenes.h @@ -924,7 +924,6 @@ enum Noun { NOUN_WHISKEY = 0x30F, NOUN_ALCOHOL = 0x310, NOUN_RIM = 0x311, - //NOUN_WALK_ALONG = 0x312, NOUN_SUBMERGED_CITY = 0x313, NOUN_GOVERNORS_HOUSE = 0x314, NOUN_RIM_TOWARDS_EAST = 0x315, diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index 7be66670d5..b40a8054f7 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -279,10 +279,8 @@ void Scene701::preActions() { } void Scene701::actions() { - if (_action.isAction(VERB_WALK_ALONG, NOUN_PLATFORM)) - return; - - if (_action.isAction(VERB_LOOK, NOUN_BINOCULARS, NOUN_BUILDING) && _game._objects[OBJ_VASE]._roomNumber == 706) { + if (_action.isAction(VERB_WALK_ALONG, NOUN_PLATFORM)) { + } else if (_action.isAction(VERB_LOOK, NOUN_BINOCULARS, NOUN_BUILDING) && _game._objects[OBJ_VASE]._roomNumber == 706) { switch (_game._trigger) { case 0: _game._player._stepEnabled = false; @@ -418,7 +416,7 @@ void Scene701::actions() { _vm->_dialogs->show(70111); } else if (_action.isAction(VERB_LOOK, NOUN_SUBMERGED_CITY)) _vm->_dialogs->show(70112); - else if (_action.isAction(VERB_LOOK, 0)) + else if (_action.isAction(VERB_LOOK, NOUN_ELEVATOR)) _vm->_dialogs->show(70113); else if (_action.isAction(VERB_LOOK, NOUN_PLATFORM)) _vm->_dialogs->show(70114); -- cgit v1.2.3 From 84702e7d5c646ba757bf6fbfc59986570c43540b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 13 Mar 2015 22:52:58 -0400 Subject: MADS: Fix text display when opening the Slippery Pig fridge --- engines/mads/nebular/nebular_scenes1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index dc2eb1f068..0c5888b6ec 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -906,7 +906,7 @@ void Scene102::actions() { _fridgeFirstOpenFl = false; int quoteId = _vm->getRandomNumber(59, 63); Common::String curQuote = _game.getQuote(quoteId); - int width = _vm->_font->getWidth(curQuote, -1); + int width = _scene->_kernelMessages._talkFont->getWidth(curQuote, -1); _scene->_kernelMessages.reset(); _game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON; _scene->_kernelMessages.add(Common::Point(210, 60), 0x1110, 0, 73, 120, curQuote); -- cgit v1.2.3 From 4c97e08e33f5a94c62c7ae480d05eae85a6721b6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 14 Mar 2015 12:50:04 +0200 Subject: MADS: Fix some verbs --- engines/mads/nebular/nebular_scenes.h | 17 +++++++++-------- engines/mads/nebular/nebular_scenes3.cpp | 4 ++-- engines/mads/nebular/nebular_scenes5.cpp | 8 ++++---- 3 files changed, 15 insertions(+), 14 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes.h b/engines/mads/nebular/nebular_scenes.h index 8549643ff8..db7738f13b 100644 --- a/engines/mads/nebular/nebular_scenes.h +++ b/engines/mads/nebular/nebular_scenes.h @@ -106,6 +106,7 @@ enum Verb { VERB_WALK_UP = 0x227, VERB_WALK_INTO = 0x242, VERB_EXIT = 0x298, + VERB_WALK_BEHIND = 0x2A2, VERB_WALK_ONTO = 0x2B5, VERB_RETURN_TO = 0x2D5, VERB_CLIMB_INTO = 0x2F7, @@ -216,9 +217,9 @@ enum Noun { NOUN_CLEARING_TO_EAST = 0x4B, NOUN_CLEARING_TO_SOUTH = 0x4C, NOUN_CLIFF_FACE = 0x4D, - NOUN_CLIMB_DOWN = 0x4E, - NOUN_CLIMB_THROUGH = 0x4F, - NOUN_CLIMB_UP = 0x50, + //NOUN_CLIMB_DOWN = 0x4E, + //NOUN_CLIMB_THROUGH = 0x4F, + //NOUN_CLIMB_UP = 0x50, NOUN_CLOCK = 0x51, NOUN_CLOSET = 0x52, NOUN_CLOTHESLINE = 0x53, @@ -397,7 +398,7 @@ enum Noun { NOUN_PALM_TREE = 0x100, NOUN_PASSAGE_WAY_TO_SOUTH = 0x101, NOUN_PASSION_PUSS = 0x102, - NOUN_PEER_THROUGH = 0x103, + //NOUN_PEER_THROUGH = 0x103, NOUN_PENCIL = 0x104, NOUN_PENDULOUS_CRAG = 0x105, NOUN_PENLIGHT = 0x106, @@ -812,7 +813,7 @@ enum Noun { NOUN_COUNTER = 0x29F, NOUN_SENSOR = 0x2A0, NOUN_SOFTWARE_INFORMATION = 0x2A1, - NOUN_WALK_BEHIND = 0x2A2, + //NOUN_WALK_BEHIND = 0x2A2, NOUN_BARGAINS = 0x2A3, NOUN_SCAN_LIGHT = 0x2A4, NOUN_OLD_SOFTWARE_STAND = 0x2A5, @@ -831,7 +832,7 @@ enum Noun { //NOUN_GAWK_AT = 0x2B2, NOUN_CORRIDOR_TO_SOUTH = 0x2B3, NOUN_CORRIDOR_TO_NORTH = 0x2B4, - NOUN_WALK_ONTO = 0x2B5, + //NOUN_WALK_ONTO = 0x2B5, NOUN_ROCK_WALL = 0x2B6, NOUN_WOMAN = 0x2B7, NOUN_WOMEN = 0x2B8, @@ -897,7 +898,7 @@ enum Noun { NOUN_YOUR_STUFF = 0x2F4, NOUN_OTHER_STUFF = 0x2F5, NOUN_LAMP = 0x2F6, - NOUN_CLIMB_INTO = 0x2F7, + //NOUN_CLIMB_INTO = 0x2F7, NOUN_LIGHT_BULB = 0x2F8, //NOUN_STEP_INTO = 0x2F9, NOUN_ROOM = 0x2FA, @@ -1056,7 +1057,7 @@ enum Noun { NOUN_PAD_TO_EAST = 0x394, NOUN_PAD_TO_WEST = 0x395, NOUN_TOWER = 0x396, - NOUN_LOOK_OUT = 0x397, + //NOUN_LOOK_OUT = 0x397, NOUN_SERVICE_PANEL = 0x398, NOUN_CRACK = 0x399, NOUN_THROTTLE = 0x39A, diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 1a477c3bb8..d6c7ba1cc7 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -521,7 +521,7 @@ void Scene307::setup() { setPlayerSpritesPrefix(); setAAName(); _scene->addActiveVocab(NOUN_AIR_VENT); - _scene->addActiveVocab(NOUN_CLIMB_INTO); + _scene->addActiveVocab(VERB_CLIMB_INTO); } void Scene307::handleRexDialog(int quote) { @@ -992,7 +992,7 @@ void Scene307::actions() { _scene->_sequences.remove(_globals._sequenceIndexes[5]); _grateOpenedFl = true; _scene->_hotspots.activate(17, false); - int idx = _scene->_dynamicHotspots.add(17, NOUN_CLIMB_INTO, -1, Common::Rect(117, 67, 117 + 19, 67 + 13)); + int idx = _scene->_dynamicHotspots.add(17, VERB_CLIMB_INTO, -1, Common::Rect(117, 67, 117 + 19, 67 + 13)); int hotspotId = _scene->_dynamicHotspots.setPosition(idx, Common::Point(129, 104), FACING_NORTH); _scene->_dynamicHotspots.setCursor(hotspotId, CURSOR_GO_UP); _game._objects.removeFromInventory(OBJ_SCALPEL, NOWHERE); diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index e6ab658eb4..a76edaca67 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -1547,8 +1547,8 @@ void Scene507::actions() { _vm->_dialogs->show(50724); else if (_action.isAction(VERB_LOOK, NOUN_WINDOW)) _vm->_dialogs->show(50725); - else if (_action.isAction(NOUN_WALK_BEHIND, NOUN_COUNTER)) { - // WORkAROUND: Empty handling to prevent default "can't do that" dialogs showing + else if (_action.isAction(VERB_WALK_BEHIND, NOUN_COUNTER)) { + // WORKAROUND: Empty handling to prevent default "can't do that" dialogs showing } else if (_action.isAction(VERB_LOOK, NOUN_COUNTER)) { if (_game._objects.isInRoom(OBJ_PENLIGHT)) _vm->_dialogs->show(50728); @@ -2463,8 +2463,8 @@ void Scene512::actions() { _vm->_dialogs->show(51233); else if (_action.isAction(VERB_LOOK, NOUN_LAMP)) _vm->_dialogs->show(51234); - else if (_action.isAction(NOUN_WALK_BEHIND, NOUN_COUNTER)) { - // WORkAROUND: Empty handling to prevent default "can't do that" dialogs showing + else if (_action.isAction(VERB_WALK_BEHIND, NOUN_COUNTER)) { + // WORKAROUND: Empty handling to prevent default "can't do that" dialogs showing } else if (_action.isAction(VERB_LOOK, NOUN_COUNTER)) _vm->_dialogs->show(51235); else if (_action.isAction(VERB_LOOK, NOUN_ICE_CHESTS)) -- cgit v1.2.3 From 1f8845e9f433365c3586240b4e395cf888ec770b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 14 Mar 2015 13:04:46 +0200 Subject: MADS: Fix toggling of game options --- engines/mads/nebular/dialogs_nebular.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 6c57c85408..530cf8a785 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -1142,8 +1142,9 @@ void OptionsDialog::show() { // Reload menu _lineIndex = -1; clearLines(); + _vm->_game->_screenObjects.clear(); + _vm->_game->_scene._spriteSlots.reset(); setLines(); - setClickableLines(); } while (!_vm->shouldQuit() && _selectedLine != 0 && _selectedLine <= 7); // If Done button not pressed, reset settings -- cgit v1.2.3 From 0f02cdb4aa0a0e29bea414583a6db8a5ae389f49 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 10:11:19 -0400 Subject: MADS: Fix crash in stream crossing death, simplify SpriteSets class --- engines/mads/game.cpp | 2 +- engines/mads/player.cpp | 2 +- engines/mads/scene.cpp | 2 +- engines/mads/sprites.cpp | 52 +++++++++++++++++++++++++----------------------- engines/mads/sprites.h | 8 +++++--- 5 files changed, 35 insertions(+), 31 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 74c2a3f416..b601a12c82 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -160,7 +160,7 @@ void Game::gameLoop() { sectionLoop(); _player.releasePlayerSprites(); - assert(_scene._sprites._assetCount == 0); + assert(_scene._sprites.size() == 0); _vm->_palette->unlock(); _vm->_events->waitCursor(); diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index 38e8638415..f61a5a1592 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -709,7 +709,7 @@ void Player::releasePlayerSprites() { _spritesLoaded = false; _spritesChanged = true; - if (scene._sprites._assetCount > 0) { + if (scene._sprites.size() > 0) { warning("Player::releasePlayerSprites(): leftover sprites remain, clearing list"); scene._sprites.clear(); } diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index bbc83a791b..463d4a62fd 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -676,7 +676,7 @@ void Scene::freeCurrentScene() { } void Scene::removeSprites() { - for (int idx = _sprites._assetCount - 1; idx >= _spritesCount; --idx) + for (int idx = _sprites.size() - 1; idx >= _spritesCount; --idx) _sprites.remove(idx); } diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index 19742e22b0..6488add86c 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -368,19 +368,18 @@ SpriteSets::~SpriteSets() { } int SpriteSets::add(SpriteAsset *asset, int idx) { - if (idx) - idx = idx + 49; - else - idx = _assetCount++; + if (idx) { + assert(idx == 1); + delete _uiSprites; + _uiSprites = asset; - if (idx >= (int)size()) - resize(idx + 1); + return SPRITE_SLOTS_MAX_SIZE; + } else { + assert(size() < SPRITE_SLOTS_MAX_SIZE); + push_back(asset); - if ((*this)[idx]) - delete (*this)[idx]; - - (*this)[idx] = asset; - return idx; + return (int)size() - 1; + } } int SpriteSets::addSprites(const Common::String &resName, int flags) { @@ -390,26 +389,29 @@ int SpriteSets::addSprites(const Common::String &resName, int flags) { void SpriteSets::clear() { for (uint i = 0; i < size(); ++i) delete (*this)[i]; - - _assetCount = 0; Common::Array::clear(); + + delete _uiSprites; + _uiSprites = nullptr; } void SpriteSets::remove(int idx) { - if (idx >= 0) { - if (idx < ((int)size() - 1)) { - delete (*this)[idx]; - (*this)[idx] = nullptr; - } else { - do { - delete (*this)[size() - 1]; - remove_at(size() - 1); - } while (size() > 0 && (*this)[size() - 1] == nullptr); - } + if (idx == SPRITE_SLOTS_MAX_SIZE) { + delete _uiSprites; + _uiSprites = nullptr; + } else if (idx >= 0) { + delete (*this)[idx]; - if (idx < 50 && _assetCount > 0) - --_assetCount; + if (idx == ((int)size() - 1)) + remove_at(size() - 1); + else + (*this)[idx] = nullptr; } } +SpriteAsset *&SpriteSets::operator[](int idx) { + return (idx == SPRITE_SLOTS_MAX_SIZE) ? _uiSprites : + Common::Array::operator[](idx); +} + } // End of namespace MADS diff --git a/engines/mads/sprites.h b/engines/mads/sprites.h index 6ea3c9e52e..bb5fdbe964 100644 --- a/engines/mads/sprites.h +++ b/engines/mads/sprites.h @@ -202,12 +202,12 @@ class SpriteSets : public Common::Array { private: MADSEngine *_vm; public: - int _assetCount; - + SpriteAsset *_uiSprites; +public: /** * Constructor */ - SpriteSets(MADSEngine *vm) : _vm(vm), _assetCount(0) {} + SpriteSets(MADSEngine *vm) : _vm(vm), _uiSprites(nullptr) {} /** * Destructor @@ -233,6 +233,8 @@ public: * Remove an asset from the list */ void remove(int idx); + + SpriteAsset *&operator[](int idx); }; } // End of namespace MADS -- cgit v1.2.3 From ff29535074c630987a99f2ac8bab9600ca2da645 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 10:23:45 -0400 Subject: MADS: Fix animation for putting severed arm on scanner --- engines/mads/nebular/nebular_scenes3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index d6c7ba1cc7..e1540b502b 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -4496,7 +4496,7 @@ void Scene352::actions() { case 2: _vm->_sound->command(23); _scene->_sequences.remove(_commonSequenceIdx); - _commonSequenceIdx = _scene->_sequences.startPingPongCycle(_commonSpriteIndex, false, 8, 1, 0, 0); + _commonSequenceIdx = _scene->_sequences.addReverseSpriteCycle(_commonSpriteIndex, false, 8, 1, 0, 0); _scene->_sequences.setAnimRange(_commonSequenceIdx, 1, 4); _scene->_sequences.addSubEntry(_commonSequenceIdx, SEQUENCE_TRIGGER_EXPIRE, 0, 3); break; -- cgit v1.2.3 From d47197f1fac36082783c6236552fe64415349a94 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 11:41:27 -0400 Subject: MADS: Fix original bug re-adding disabled hotspots to scene as active --- engines/mads/screen.cpp | 4 +++- engines/mads/screen.h | 2 +- engines/mads/user_interface.cpp | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 5076bbb099..c06ff2b7b7 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -265,7 +265,7 @@ ScreenObjects::ScreenObjects(MADSEngine *vm) : _vm(vm) { _baseTime = 0; } -void ScreenObjects::add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId) { +ScreenObject *ScreenObjects::add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId) { ScreenObject so; so._bounds = bounds; so._category = category; @@ -274,6 +274,8 @@ void ScreenObjects::add(const Common::Rect &bounds, ScreenMode mode, ScrCategory so._active = true; push_back(so); + + return &(*this)[size()]; } void ScreenObjects::check(bool scanFlag) { diff --git a/engines/mads/screen.h b/engines/mads/screen.h index e2462aff18..85c55419ca 100644 --- a/engines/mads/screen.h +++ b/engines/mads/screen.h @@ -167,7 +167,7 @@ public: /** * Add a new item to the list */ - void add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId); + ScreenObject *add(const Common::Rect &bounds, ScreenMode mode, ScrCategory category, int descId); /** * Check objects on the screen diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index bcd409889e..0363ae5ef9 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -732,7 +732,9 @@ void UserInterface::loadElements() { _categoryIndexes[CAT_HOTSPOT - 1] = _vm->_game->_screenObjects.size() + 1; for (int hotspotIdx = scene._hotspots.size() - 1; hotspotIdx >= 0; --hotspotIdx) { Hotspot &hs = scene._hotspots[hotspotIdx]; - _vm->_game->_screenObjects.add(hs._bounds, SCREENMODE_VGA, CAT_HOTSPOT, hotspotIdx); + ScreenObject *so = _vm->_game->_screenObjects.add(hs._bounds, SCREENMODE_VGA, + CAT_HOTSPOT, hotspotIdx); + so->_active = hs._active; } } -- cgit v1.2.3 From 561481499d4cb6e1d2a85e5dc35c7c8ff0534e3d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 11:57:28 -0400 Subject: MADS: Persist gameplay options --- engines/mads/mads.cpp | 19 +++++++++++++++++++ engines/mads/mads.h | 4 ++++ engines/mads/nebular/dialogs_nebular.cpp | 3 +++ 3 files changed, 26 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index 52a0b40561..a62ad2d7df 100644 --- a/engines/mads/mads.cpp +++ b/engines/mads/mads.cpp @@ -82,6 +82,8 @@ void MADSEngine::initialize() { MSurface::setVm(this); MSprite::setVm(this); + loadOptions(); + Resources::init(this); Conversation::init(this); _debugger = new Debugger(this); @@ -98,6 +100,23 @@ void MADSEngine::initialize() { _screen.empty(); } +void MADSEngine::loadOptions() { + if (ConfMan.hasKey("EasyMouse")) + _easyMouse = ConfMan.getBool("EasyMouse"); + if (ConfMan.hasKey("InvObjectsAnimated")) + _invObjectsAnimated = ConfMan.getBool("InvObjectsAnimated"); + if (ConfMan.hasKey("TextWindowStill")) + _textWindowStill = ConfMan.getBool("TextWindowStill"); +} + +void MADSEngine::saveOptions() { + ConfMan.setBool("EasyMouse", _easyMouse); + ConfMan.setBool("InvObjectsAnimated", _invObjectsAnimated); + ConfMan.setBool("TextWindowStill", _textWindowStill); + + ConfMan.flushToDisk(); +} + Common::Error MADSEngine::run() { initGraphics(MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT, false); initialize(); diff --git a/engines/mads/mads.h b/engines/mads/mads.h index 9a8f2152a1..7cc0ac8bc2 100644 --- a/engines/mads/mads.h +++ b/engines/mads/mads.h @@ -84,6 +84,8 @@ private: * Handles basic initialisation */ void initialize(); + + void loadOptions(); protected: // Engine APIs virtual Common::Error run(); @@ -145,6 +147,8 @@ public: * Handles saving the game via the GMM */ virtual Common::Error saveGameState(int slot, const Common::String &desc); + + void saveOptions(); }; } // End of namespace MADS diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 530cf8a785..1c780c85b7 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -1117,12 +1117,15 @@ void OptionsDialog::show() { break; case 3: // Interface _vm->_easyMouse = !_vm->_easyMouse; + _vm->saveOptions(); break; case 4: // Inventory _vm->_invObjectsAnimated = !_vm->_invObjectsAnimated; + _vm->saveOptions(); break; case 5: // Text window _vm->_textWindowStill = !_vm->_textWindowStill; + _vm->saveOptions(); break; case 6: // Screen fade if (_vm->_screenFade == SCREEN_FADE_FAST) -- cgit v1.2.3 From a924d4beefc9d82ebe4c5a1880015aa7c97503de Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 12:46:46 -0400 Subject: MADS: Fix hotspot highlighting when easy mouse is off --- engines/mads/events.cpp | 4 ++-- engines/mads/events.h | 2 +- engines/mads/screen.cpp | 6 +++--- engines/mads/user_interface.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index 06c6055f01..767f998d81 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -41,7 +41,7 @@ EventsManager::EventsManager(MADSEngine *vm) { _mouseReleased = false; _mouseButtons = 0; _mouseStatus = 0; - _vD2 = 0; + _strokeGoing = 0; _mouseStatusCopy = 0; _mouseMoved = false; _rightMousePressed = false; @@ -266,7 +266,7 @@ void EventsManager::waitForNextFrame() { void EventsManager::initVars() { _mousePos = Common::Point(-1, -1); _mouseStatusCopy = _mouseStatus; - _vD2 = 0; + _strokeGoing = 0; } } // End of namespace MADS diff --git a/engines/mads/events.h b/engines/mads/events.h index 21ef37407b..1a92754f10 100644 --- a/engines/mads/events.h +++ b/engines/mads/events.h @@ -67,7 +67,7 @@ public: byte _mouseButtons; bool _rightMousePressed; int _mouseStatus; - int _vD2; + int _strokeGoing; int _mouseStatusCopy; bool _mouseMoved; Common::Stack _pendingKeys; diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index c06ff2b7b7..3e2fe22611 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -308,10 +308,10 @@ void ScreenObjects::check(bool scanFlag) { } //_released = _vm->_events->_mouseReleased; - if (_vm->_events->_vD2 || (_vm->_easyMouse && !_vm->_events->_mouseStatusCopy)) + if (_vm->_events->_mouseButtons || (_vm->_easyMouse && !_vm->_events->_mouseStatusCopy)) scene._userInterface._category = _category; - if (!_vm->_events->_mouseButtons || _vm->_easyMouse) { + if (_vm->_events->_mouseButtons || _vm->_easyMouse) { if (userInterface._category >= CAT_COMMAND && userInterface._category <= CAT_TALK_ENTRY) { elementHighlighted(); } @@ -526,7 +526,7 @@ void ScreenObjects::elementHighlighted() { action._pickedWord = newIndex; if (_category == CAT_INV_LIST || _category == CAT_INV_ANIM) { - if (action._interAwaiting == 1 && newIndex >= 0 && _released && + if (action._interAwaiting == AWAITING_COMMAND && newIndex >= 0 && _released && (!_vm->_events->_mouseReleased || !_vm->_easyMouse)) newIndex = -1; } diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 0363ae5ef9..eced2fdb12 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -522,7 +522,7 @@ void UserInterface::updateInventoryScroller() { uint32 timeInc = _scrollbarQuickly ? 100 : 380; if (_vm->_events->_mouseStatus && (_scrollbarMilliTime + timeInc) <= currentMilli) { - _scrollbarQuickly = _vm->_events->_vD2 < 1; + _scrollbarQuickly = _vm->_events->_strokeGoing < 1; _scrollbarMilliTime = currentMilli; // Change the scrollbar and visible inventory list -- cgit v1.2.3 From b39abbfb4955521211847f33bcc133cdd9642fe3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 14:04:41 -0400 Subject: MADS: Save reverted options if you cancel out of Game Options dialog --- engines/mads/nebular/dialogs_nebular.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 1c780c85b7..10fa28c013 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -1158,6 +1158,8 @@ void OptionsDialog::show() { _vm->_textWindowStill = prevTextWindowStill; _vm->_screenFade = prevScreenFade; game._storyMode = prevStoryMode; + + _vm->saveOptions(); } } -- cgit v1.2.3 From 1e15c02d1ea56439509926b68b9e393957241e65 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 14:38:22 -0400 Subject: MADS: Fix animation of tying rope to the boat --- engines/mads/animation.cpp | 14 ++++++++++---- engines/mads/animation.h | 5 +++++ engines/mads/nebular/nebular_scenes5.cpp | 9 +++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index 7e616bffbc..bda0bb6876 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -436,10 +436,7 @@ void Animation::update() { if (_vm->_game->_scene._frameStartTime < _nextFrameTimer) return; - for (uint idx = 0; idx < scene._spriteSlots.size(); ++idx) { - if (scene._spriteSlots[idx]._seqIndex >= 0x80) - scene._spriteSlots[idx]._flags = IMG_ERASE; - } + eraseSprites(); // Validate the current frame if (_currentFrame >= (int)_miscEntries.size()) { @@ -604,4 +601,13 @@ void Animation::setNextFrameTimer(int frameNumber) { _nextFrameTimer = frameNumber; } +void Animation::eraseSprites() { + Scene &scene = _vm->_game->_scene; + + for (uint idx = 0; idx < scene._spriteSlots.size(); ++idx) { + if (scene._spriteSlots[idx]._seqIndex >= 0x80) + scene._spriteSlots[idx]._flags = IMG_ERASE; + } +} + } // End of namespace MADS diff --git a/engines/mads/animation.h b/engines/mads/animation.h index 8b85a5370d..1c87273e62 100644 --- a/engines/mads/animation.h +++ b/engines/mads/animation.h @@ -219,6 +219,11 @@ public: */ void update(); + /** + * Erases any sprites from the previous animation frame + */ + void eraseSprites(); + void setNextFrameTimer(int frameNumber); int getNextFrameTimer() const { return _nextFrameTimer; } void setCurrentFrame(int frameNumber); diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index a76edaca67..2470137b2e 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -2066,6 +2066,7 @@ void Scene511::actions() { if (_game._trigger == 0) { _game._player._stepEnabled = false; _game._player._visible = false; + _game._player.update(); _lineAnimationMode = 1; _lineAnimationPosition = 1; _lineMoving = true; @@ -2088,7 +2089,8 @@ void Scene511::actions() { } else { _vm->_dialogs->show(51130); } - } else if (_action.isAction(VERB_TIE, NOUN_FISHING_LINE, NOUN_BOAT) || _action.isAction(VERB_ATTACH, NOUN_FISHING_LINE, NOUN_BOAT)) { + } else if (_action.isAction(VERB_TIE, NOUN_FISHING_LINE, NOUN_BOAT) || + _action.isAction(VERB_ATTACH, NOUN_FISHING_LINE, NOUN_BOAT)) { if (_globals[kBoatRaised]) _vm->_dialogs->show(51131); else if (_globals[kLineStatus] == 1) @@ -2106,7 +2108,6 @@ void Scene511::actions() { _scene->_sequences.addTimer(1, 1); else { _game._player._visible = true; - _game._player._priorTimer = _scene->_frameStartTime - _game._player._ticksAmount; _globals._sequenceIndexes[7] = _scene->_sequences.startCycle(_globals._spriteIndexes[7], false, -2); _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 4); int idx = _scene->_dynamicHotspots.add(NOUN_FISHING_LINE, VERB_WALKTO, _globals._sequenceIndexes[7], Common::Rect(0, 0, 0, 0)); @@ -2116,6 +2117,10 @@ void Scene511::actions() { _lineMoving = true; _globals[kLineStatus] = 3; _game._player._stepEnabled = true; + + if (_scene->_activeAnimation) + _scene->_activeAnimation->eraseSprites(); + _game._player.update(); } } } -- cgit v1.2.3 From fa7dfc396a2ca33e01a0151f63857dd64406502c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 15:05:42 -0400 Subject: MADS: Fix greeting when talking to cell wall the first time --- engines/mads/nebular/nebular_scenes3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index e1540b502b..383f5b509f 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -525,7 +525,7 @@ void Scene307::setup() { } void Scene307::handleRexDialog(int quote) { - Common::String curQuote = _game.getQuote(_action._activeAction._verbId); + Common::String curQuote = _game.getQuote(quote); if (_vm->_font->getWidth(curQuote, _scene->_textSpacing) > 200) { Common::String subQuote1; _game.splitQuote(curQuote, subQuote1, _subQuote2); -- cgit v1.2.3 From 9eb342615c4cdbc1f38374b9a7808dc54bfb7ad9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 18:34:26 -0400 Subject: MADS: Fix frequently getting endless wait cursor after doctor hits you --- engines/mads/nebular/nebular_scenes3.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 383f5b509f..4e7781e7a2 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -3313,7 +3313,7 @@ void Scene319::step() { switch (_game._trigger) { case 70: - case 71: + case 71: { _animMode = 1; _nextAction1 = _nextAction2; _animFrame = 0; @@ -3336,7 +3336,14 @@ void Scene319::step() { _scene->_sequences.updateTimeout(_globals._sequenceIndexes[i], oldIdx); } _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 74); + + // WORKAROUND: This fixes the game sometimes going into an endless waiting + // loop even after the doctor has finished hitting Rex. Note sure if it's due + // to a bug in room script or in the engine, but this at least fixes it + int seqIndex = _scene->_sequences.findByTrigger(2); + _scene->_sequences[seqIndex]._doneFlag = false; break; + } case 72: _vm->_palette->setColorFlags(0xFF, 0, 0); -- cgit v1.2.3 From 97ef41707ab957099b4972bba501479001315e69 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 19:09:44 -0400 Subject: MADS: Hook up sfx/music flags --- engines/mads/detection_tables.h | 4 ++-- engines/mads/mads.cpp | 18 ++++++++++++++++++ engines/mads/mads.h | 6 ++++++ engines/mads/sound.cpp | 5 ++++- 4 files changed, 30 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/detection_tables.h b/engines/mads/detection_tables.h index e68ae380d0..92614ba361 100644 --- a/engines/mads/detection_tables.h +++ b/engines/mads/detection_tables.h @@ -56,7 +56,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO1(GUIO_NOSPEECH) }, GType_RexNebular, 0 @@ -74,7 +74,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO1(GUIO_NOSPEECH) }, GType_RexNebular, 0 diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index a62ad2d7df..761aef3e66 100644 --- a/engines/mads/mads.cpp +++ b/engines/mads/mads.cpp @@ -44,6 +44,7 @@ MADSEngine::MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc) : _textWindowStill = false; _screenFade = SCREEN_FADE_SMOOTH; _musicFlag = true; + _soundFlag = true; _dithering = false; _debugger = nullptr; @@ -107,12 +108,23 @@ void MADSEngine::loadOptions() { _invObjectsAnimated = ConfMan.getBool("InvObjectsAnimated"); if (ConfMan.hasKey("TextWindowStill")) _textWindowStill = ConfMan.getBool("TextWindowStill"); + + if (ConfMan.hasKey("mute") && ConfMan.getBool("mute")) { + _soundFlag = false; + _musicFlag = false; + } else { + _soundFlag = !ConfMan.hasKey("sfx_mute") || !ConfMan.getBool("sfx_mute"); + _musicFlag = !ConfMan.hasGameDomain("music_mute") || !ConfMan.getBool("music_mute"); + } } void MADSEngine::saveOptions() { ConfMan.setBool("EasyMouse", _easyMouse); ConfMan.setBool("InvObjectsAnimated", _invObjectsAnimated); ConfMan.setBool("TextWindowStill", _textWindowStill); + ConfMan.setBool("mute", !_soundFlag && !_musicFlag); + ConfMan.setBool("sfx_mute", !_soundFlag && _musicFlag); + ConfMan.setBool("music_mute", _soundFlag && !_musicFlag); ConfMan.flushToDisk(); } @@ -153,6 +165,12 @@ bool MADSEngine::canSaveGameStateCurrently() { && _events->_cursorId != CURSOR_WAIT; } +void MADSEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + loadOptions(); +} + /** * Support method that generates a savegame name * @param slot Slot number diff --git a/engines/mads/mads.h b/engines/mads/mads.h index 7cc0ac8bc2..1d641e7c87 100644 --- a/engines/mads/mads.h +++ b/engines/mads/mads.h @@ -106,6 +106,7 @@ public: bool _textWindowStill; ScreenFade _screenFade; bool _musicFlag; + bool _soundFlag; bool _dithering; public: MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc); @@ -148,6 +149,11 @@ public: */ virtual Common::Error saveGameState(int slot, const Common::String &desc); + /** + * Handles updating sound settings after they're changed in the GMM dialog + */ + virtual void syncSoundSettings(); + void saveOptions(); }; diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp index fbf217ba0c..1baa169c55 100644 --- a/engines/mads/sound.cpp +++ b/engines/mads/sound.cpp @@ -146,7 +146,10 @@ void SoundManager::command(int commandId, int param) { if (_queuedCommands.size() < 8) _queuedCommands.push(commandId); } else if (_driver) { - _driver->command(commandId, param); + // Note: I don't know any way to identify music commands versus sfx + // commands, so if sfx is mute, then so is music + if (_vm->_soundFlag) + _driver->command(commandId, param); } } -- cgit v1.2.3 From 299bfa3696aaf3c689798faef198d714eb234f4f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 19:24:56 -0400 Subject: MADS: Fix showing inventory pictures when inventory animating is off --- engines/mads/user_interface.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index eced2fdb12..93a555d9c7 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -864,13 +864,13 @@ void UserInterface::loadInventoryAnim(int objectId) { Scene &scene = _vm->_game->_scene; noInventoryAnim(); - if (_vm->_invObjectsAnimated) { - Common::String resName = Common::String::format("*OB%.3dI", objectId); - SpriteAsset *asset = new SpriteAsset(_vm, resName, ASSET_SPINNING_OBJECT); - _invSpritesIndex = scene._sprites.add(asset, 1); - if (_invSpritesIndex >= 0) { - _invFrameNumber = 1; - } + // WORKAROUND: Even in still mode, we now load the animation frames for the + // object, so we can show the first frame as a 'still' + Common::String resName = Common::String::format("*OB%.3dI", objectId); + SpriteAsset *asset = new SpriteAsset(_vm, resName, ASSET_SPINNING_OBJECT); + _invSpritesIndex = scene._sprites.add(asset, 1); + if (_invSpritesIndex >= 0) { + _invFrameNumber = 1; } } @@ -902,10 +902,13 @@ void UserInterface::inventoryAnim() { _invSpritesIndex < 0) return; - // Move to the next frame number in the sequence, resetting if at the end - SpriteAsset *asset = scene._sprites[_invSpritesIndex]; - if (++_invFrameNumber > asset->getCount()) - _invFrameNumber = 1; + // WORKAROUND: Fix still inventory display, which was broken in the original + if (_vm->_invObjectsAnimated) { + // Move to the next frame number in the sequence, resetting if at the end + SpriteAsset *asset = scene._sprites[_invSpritesIndex]; + if (++_invFrameNumber > asset->getCount()) + _invFrameNumber = 1; + } // Loop through the slots list for inventory animation entry for (uint i = 0; i < _uiSlots.size(); ++i) { -- cgit v1.2.3 From d3afff9bc736175b0275d923788198706adc7d78 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Mar 2015 19:30:01 -0400 Subject: MADS: Fix animations erasing sprites on the last frame before transitioning --- engines/mads/animation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index bda0bb6876..b48491626d 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -436,8 +436,6 @@ void Animation::update() { if (_vm->_game->_scene._frameStartTime < _nextFrameTimer) return; - eraseSprites(); - // Validate the current frame if (_currentFrame >= (int)_miscEntries.size()) { // Is the animation allowed to be repeated? @@ -450,6 +448,8 @@ void Animation::update() { } } + eraseSprites(); + // Handle executing any sound command for this frame AnimMiscEntry &misc = _miscEntries[_currentFrame]; if (misc._soundId) -- cgit v1.2.3 From 19a9c068f994d5800a60dff6f14221f03f5d4cc3 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 15 Mar 2015 04:05:06 +0200 Subject: MADS: Hook up all of the remaining options, and add custom game options --- engines/mads/detection.cpp | 63 +++++++++++++++++++++++++++++++- engines/mads/game.h | 3 ++ engines/mads/mads.cpp | 35 +++++++++++++----- engines/mads/nebular/dialogs_nebular.cpp | 24 ++++++------ engines/mads/nebular/game_nebular.h | 3 ++ 5 files changed, 105 insertions(+), 23 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/detection.cpp b/engines/mads/detection.cpp index 971acde024..ea71fc8539 100644 --- a/engines/mads/detection.cpp +++ b/engines/mads/detection.cpp @@ -29,6 +29,7 @@ #include "common/memstream.h" #include "engines/advancedDetector.h" #include "common/system.h" +#include "common/translation.h" #include "graphics/colormasks.h" #include "graphics/surface.h" #include "mads/events.h" @@ -75,11 +76,71 @@ static const PlainGameDescriptor MADSGames[] = { {0, 0} }; +#define GAMEOPTION_EASY_MOUSE GUIO_GAMEOPTIONS1 +#define GAMEOPTION_ANIMATED_INVENTORY GUIO_GAMEOPTIONS2 +#define GAMEOPTION_ANIMATED_INTERFACE GUIO_GAMEOPTIONS3 +#define GAMEOPTION_NAUGHTY_MODE GUIO_GAMEOPTIONS4 +//#define GAMEOPTION_GRAPHICS_DITHERING GUIO_GAMEOPTIONS5 + #include "mads/detection_tables.h" +static const ADExtraGuiOptionsMap optionsList[] = { + { + GAMEOPTION_EASY_MOUSE, + { + _s("Easy mouse interface"), + _s("Shows object names when hovering the mouse over them"), + "EasyMouse", + true + } + }, + + { + GAMEOPTION_ANIMATED_INVENTORY, + { + _s("Animated inventory items"), + _s("Animated inventory items"), + "InvObjectsAnimated", + true + } + }, + + { + GAMEOPTION_ANIMATED_INTERFACE, + { + _s("Animated game interface"), + _s("Animated game interface"), + "TextWindowAnimated", + true + } + }, + + { + GAMEOPTION_NAUGHTY_MODE, + { + _s("Naughty game mode"), + _s("Naughty game mode"), + "NaughtyMode", + true + } + }, + + /*{ + GAMEOPTION_GRAPHICS_DITHERING, + { + _s("Graphics dithering"), + _s("Graphics dithering"), + "GraphicsDithering", + true + } + },*/ + + AD_EXTRA_GUI_OPTIONS_TERMINATOR +}; + class MADSMetaEngine : public AdvancedMetaEngine { public: - MADSMetaEngine() : AdvancedMetaEngine(MADS::gameDescriptions, sizeof(MADS::MADSGameDescription), MADSGames) { + MADSMetaEngine() : AdvancedMetaEngine(MADS::gameDescriptions, sizeof(MADS::MADSGameDescription), MADSGames, optionsList) { _maxScanDepth = 3; } diff --git a/engines/mads/game.h b/engines/mads/game.h index 66f2580249..d246aa501e 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -195,6 +195,9 @@ public: */ virtual void synchronize(Common::Serializer &s, bool phase1); + virtual void setNaughtyMode(bool naughtyMode) {} + virtual bool getNaughtyMode() const { return true; } + // DEPRECATED: ScummVM re-implementation keeps all the quotes loaded, so the methods below are stubs void clearQuotes() {} void loadQuoteRange(int startNum, int endNum) {} diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index 761aef3e66..59d600fbfb 100644 --- a/engines/mads/mads.cpp +++ b/engines/mads/mads.cpp @@ -38,7 +38,7 @@ namespace MADS { MADSEngine::MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc) : _gameDescription(gameDesc), Engine(syst), _randomSource("MADS") { - // Initialize fields + // Initialize game/engine options _easyMouse = true; _invObjectsAnimated = true; _textWindowStill = false; @@ -83,8 +83,6 @@ void MADSEngine::initialize() { MSurface::setVm(this); MSprite::setVm(this); - loadOptions(); - Resources::init(this); Conversation::init(this); _debugger = new Debugger(this); @@ -98,16 +96,14 @@ void MADSEngine::initialize() { _audio = new AudioPlayer(_mixer, getGameID()); _game = Game::init(this); + loadOptions(); + _screen.empty(); } void MADSEngine::loadOptions() { if (ConfMan.hasKey("EasyMouse")) _easyMouse = ConfMan.getBool("EasyMouse"); - if (ConfMan.hasKey("InvObjectsAnimated")) - _invObjectsAnimated = ConfMan.getBool("InvObjectsAnimated"); - if (ConfMan.hasKey("TextWindowStill")) - _textWindowStill = ConfMan.getBool("TextWindowStill"); if (ConfMan.hasKey("mute") && ConfMan.getBool("mute")) { _soundFlag = false; @@ -116,16 +112,37 @@ void MADSEngine::loadOptions() { _soundFlag = !ConfMan.hasKey("sfx_mute") || !ConfMan.getBool("sfx_mute"); _musicFlag = !ConfMan.hasGameDomain("music_mute") || !ConfMan.getBool("music_mute"); } + + if (ConfMan.hasKey("ScreenFade")) + _screenFade = (ScreenFade)ConfMan.getInt("ScreenFade"); + //if (ConfMan.hasKey("GraphicsDithering")) + // _dithering = ConfMan.getBool("GraphicsDithering"); + + if (getGameID() == GType_RexNebular) { + if (ConfMan.hasKey("InvObjectsAnimated")) + _invObjectsAnimated = ConfMan.getBool("InvObjectsAnimated"); + if (ConfMan.hasKey("TextWindowStill")) + _textWindowStill = !ConfMan.getBool("TextWindowAnimated"); + if (ConfMan.hasKey("NaughtyMode")) + _game->setNaughtyMode(ConfMan.getBool("NaughtyMode")); + } } void MADSEngine::saveOptions() { ConfMan.setBool("EasyMouse", _easyMouse); - ConfMan.setBool("InvObjectsAnimated", _invObjectsAnimated); - ConfMan.setBool("TextWindowStill", _textWindowStill); + ConfMan.setInt("ScreenFade", (int)_screenFade); + //ConfMan.setBool("GraphicsDithering", _dithering); + ConfMan.setBool("mute", !_soundFlag && !_musicFlag); ConfMan.setBool("sfx_mute", !_soundFlag && _musicFlag); ConfMan.setBool("music_mute", _soundFlag && !_musicFlag); + if (getGameID() == GType_RexNebular) { + ConfMan.setBool("InvObjectsAnimated", _invObjectsAnimated); + ConfMan.setBool("TextWindowAnimated", !_textWindowStill); + ConfMan.setBool("NaughtyMode", _game->getNaughtyMode()); + } + ConfMan.flushToDisk(); } diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 10fa28c013..0b5e921dcc 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -1050,12 +1050,11 @@ OptionsDialog::OptionsDialog(MADSEngine *vm) : GameDialog(vm) { int OptionsDialog::getOptionQuote(int option) { Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game; - // TODO: Hook the rest of the options to the current config switch (option) { case 17: // Music - return 24; // 24: ON, 25: OFF + return _vm->_musicFlag ? 24 : 25; // 24: ON, 25: OFF case 18: // Sound - return 26; // 26: ON, 27: OFF + return _vm->_soundFlag ? 26 : 27; // 26: ON, 27: OFF case 19: // Interface return !_vm->_easyMouse ? 28 : 29; // 28: Standard, 29: Easy case 20: // Inventory @@ -1098,6 +1097,7 @@ void OptionsDialog::show() { Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game; // Previous options, restored when cancel is selected + bool prevMusicFlag = _vm->_musicFlag; bool prevEasyMouse = _vm->_easyMouse; bool prevInvObjectsAnimated = _vm->_invObjectsAnimated; bool prevTextWindowStill = _vm->_textWindowStill; @@ -1110,22 +1110,19 @@ void OptionsDialog::show() { switch (_selectedLine) { case 1: // Music - warning("STUB: Music toggle"); + _vm->_musicFlag = _vm->_soundFlag = !_vm->_musicFlag; break; case 2: // Sound - warning("STUB: Sound toggle"); + _vm->_musicFlag = _vm->_soundFlag = !_vm->_musicFlag; break; case 3: // Interface _vm->_easyMouse = !_vm->_easyMouse; - _vm->saveOptions(); break; case 4: // Inventory _vm->_invObjectsAnimated = !_vm->_invObjectsAnimated; - _vm->saveOptions(); break; case 5: // Text window _vm->_textWindowStill = !_vm->_textWindowStill; - _vm->saveOptions(); break; case 6: // Screen fade if (_vm->_screenFade == SCREEN_FADE_FAST) @@ -1150,16 +1147,17 @@ void OptionsDialog::show() { setLines(); } while (!_vm->shouldQuit() && _selectedLine != 0 && _selectedLine <= 7); - // If Done button not pressed, reset settings - if (_selectedLine != 8) { - // Revert all options from the saved ones + if (_selectedLine == 8) { + // OK button, save settings + _vm->saveOptions(); + } else if (_selectedLine == 9) { + // Cancel button, revert all options from the saved ones + _vm->_musicFlag = prevMusicFlag; _vm->_easyMouse = prevEasyMouse; _vm->_invObjectsAnimated = prevInvObjectsAnimated; _vm->_textWindowStill = prevTextWindowStill; _vm->_screenFade = prevScreenFade; game._storyMode = prevStoryMode; - - _vm->saveOptions(); } } diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h index efa21a2e73..1b89d11412 100644 --- a/engines/mads/nebular/game_nebular.h +++ b/engines/mads/nebular/game_nebular.h @@ -131,6 +131,9 @@ public: virtual void step(); virtual void synchronize(Common::Serializer &s, bool phase1); + + virtual void setNaughtyMode(bool naughtyMode) { _storyMode = naughtyMode ? STORYMODE_NAUGHTY : STORYMODE_NICE; } + virtual bool getNaughtyMode() const { return _storyMode == STORYMODE_NAUGHTY; } }; // Section handlers aren't needed in ScummVM implementation -- cgit v1.2.3 From 97ca67ecac3bd4e27cd2ea93c5e88e44722972a3 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 15 Mar 2015 13:45:31 +0200 Subject: MADS: Properly reset the sound flag --- engines/mads/nebular/dialogs_nebular.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 0b5e921dcc..4ba5366a60 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -1152,7 +1152,7 @@ void OptionsDialog::show() { _vm->saveOptions(); } else if (_selectedLine == 9) { // Cancel button, revert all options from the saved ones - _vm->_musicFlag = prevMusicFlag; + _vm->_musicFlag = _vm->_soundFlag = prevMusicFlag; _vm->_easyMouse = prevEasyMouse; _vm->_invObjectsAnimated = prevInvObjectsAnimated; _vm->_textWindowStill = prevTextWindowStill; -- cgit v1.2.3 From 74327cadad47824863f52fdb2b68d093b3a939a6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 15 Mar 2015 13:47:45 +0200 Subject: MADS: Add custom game options to the ScummVM GUI This should be part of commit 19a9c068f, but it wasn't committed --- engines/mads/detection_tables.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/detection_tables.h b/engines/mads/detection_tables.h index 92614ba361..0a8e98bb31 100644 --- a/engines/mads/detection_tables.h +++ b/engines/mads/detection_tables.h @@ -37,7 +37,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO5(GUIO_NOSPEECH, GAMEOPTION_EASY_MOUSE, GAMEOPTION_ANIMATED_INVENTORY, GAMEOPTION_ANIMATED_INTERFACE, GAMEOPTION_NAUGHTY_MODE) }, GType_RexNebular, 0 @@ -56,7 +56,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NOSPEECH) + GUIO5(GUIO_NOSPEECH, GAMEOPTION_EASY_MOUSE, GAMEOPTION_ANIMATED_INVENTORY, GAMEOPTION_ANIMATED_INTERFACE, GAMEOPTION_NAUGHTY_MODE) }, GType_RexNebular, 0 @@ -74,7 +74,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NOSPEECH) + GUIO5(GUIO_NOSPEECH, GAMEOPTION_EASY_MOUSE, GAMEOPTION_ANIMATED_INVENTORY, GAMEOPTION_ANIMATED_INTERFACE, GAMEOPTION_NAUGHTY_MODE) }, GType_RexNebular, 0 @@ -92,7 +92,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO1(GAMEOPTION_EASY_MOUSE) }, GType_Phantom, 0 @@ -110,7 +110,7 @@ static const MADSGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO1(GAMEOPTION_EASY_MOUSE) }, GType_Dragonsphere, 0 -- cgit v1.2.3 From 9caed13d906b852cd90033a2df304d19f0f0e38c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Mar 2015 16:18:38 -0400 Subject: MADS: Better handling for removing sprite sets --- engines/mads/sprites.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index 6488add86c..67d5e20fe5 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -402,10 +402,13 @@ void SpriteSets::remove(int idx) { } else if (idx >= 0) { delete (*this)[idx]; - if (idx == ((int)size() - 1)) - remove_at(size() - 1); - else + if (idx < ((int)size() - 1)) { (*this)[idx] = nullptr; + } else { + do { + remove_at(size() - 1); + } while (size() > 0 && (*this)[size() - 1] == nullptr); + } } } -- cgit v1.2.3 From 6d8134f7518a2c368a55cfc49ba0a625a9744645 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Mar 2015 16:20:01 -0400 Subject: MADS: Revert fix for sprites disappearing on last frame of cutscenes The fix that kept the sprites on-screen for the last frame before scene changes in the intro/ending sequences was also causing crashes in-game, where the animation is getting freed before the scene update to remove the sprites was done, so it couldn't get the areas of the screen to refresh --- engines/mads/animation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index b48491626d..cf02e7b0b5 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -436,6 +436,9 @@ void Animation::update() { if (_vm->_game->_scene._frameStartTime < _nextFrameTimer) return; + // Erase any active sprites + eraseSprites(); + // Validate the current frame if (_currentFrame >= (int)_miscEntries.size()) { // Is the animation allowed to be repeated? @@ -448,8 +451,6 @@ void Animation::update() { } } - eraseSprites(); - // Handle executing any sound command for this frame AnimMiscEntry &misc = _miscEntries[_currentFrame]; if (misc._soundId) -- cgit v1.2.3 From 7a9514567f44f5a717fcfb1994431e54e06ea148 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 16 Mar 2015 01:41:08 +0200 Subject: MADS: Handle a game bug in scene 604, which prevents game completion --- engines/mads/nebular/nebular_scenes6.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index 046782b772..d94fb17fd4 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -948,8 +948,14 @@ void Scene604::actions() { _bombMode = 1; if ((_game._difficulty == DIFFICULTY_HARD) || _globals[kWarnedFloodCity]) handleBombActions(); - else if ((_game._objects.isInInventory(OBJ_POLYCEMENT) && _game._objects.isInInventory(OBJ_CHICKEN)) - && ((_globals[kLineStatus] == LINE_TIED) || ((_game._difficulty == DIFFICULTY_EASY) && (!_globals[kBoatRaised])))) + else if ( + (_game._objects.isInInventory(OBJ_POLYCEMENT) && (_game._objects.isInInventory(OBJ_CHICKEN) || _game._objects.isInInventory(OBJ_CHICKEN_BOMB))) + && (_globals[kLineStatus] == LINE_TIED || (_game._difficulty == DIFFICULTY_EASY && !_globals[kBoatRaised])) + ) + // The original can get in an impossible state at this point, if the player has + // combined the chicken with the bomb before placing the timer bomb on the ledge. + // Therefore, we also allow the player to place the bomb if the chicken bomb is + // in the inventory. handleBombActions(); else if (_game._difficulty == DIFFICULTY_EASY) _vm->_dialogs->show(60424); -- cgit v1.2.3 From 4009305070f3f8a1a718526b3e00fc9902a9d87e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 18 Mar 2015 20:29:50 -0400 Subject: MADS: Hook up ScummVM volume control --- engines/mads/mads.cpp | 7 +++++++ engines/mads/nebular/sound_nebular.cpp | 37 +++++++++++++++++++++------------- engines/mads/nebular/sound_nebular.h | 8 +++++++- engines/mads/sound.cpp | 15 ++++++++++++-- engines/mads/sound.h | 6 ++++++ 5 files changed, 56 insertions(+), 17 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index 59d600fbfb..374e373035 100644 --- a/engines/mads/mads.cpp +++ b/engines/mads/mads.cpp @@ -126,6 +126,13 @@ void MADSEngine::loadOptions() { if (ConfMan.hasKey("NaughtyMode")) _game->setNaughtyMode(ConfMan.getBool("NaughtyMode")); } + + // Note: MADS is weird in that sfx and music are handled by the same driver, + // and the game scripts themselves check for music being enabled before playing + // a "music" sound. Which means we can independantly mute music in ScummVM, but + // otherwise all sound, music and sfx, is controlled by the SFX volume slider. + int soundVolume = MIN(255, ConfMan.getInt("sfx_volume")); + _sound->setVolume(soundVolume); } void MADSEngine::saveOptions() { diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp index 6412654fd6..9716e6d522 100644 --- a/engines/mads/nebular/sound_nebular.cpp +++ b/engines/mads/nebular/sound_nebular.cpp @@ -44,6 +44,7 @@ AdlibChannel::AdlibChannel() { _field4 = 0; _sampleIndex = 0; _volume = 0; + _volumeOffset = 0; _field7 = 0; _field8 = 0; _field9 = 0; @@ -61,7 +62,6 @@ AdlibChannel::AdlibChannel() { _field19 = 0; _soundData = nullptr; _field1D = 0; - _field1E = 0; _field1F = 0; _field20 = 0; @@ -97,6 +97,7 @@ void AdlibChannel::setPtr2(byte *pData) { void AdlibChannel::load(byte *pData) { _ptr1 = _pSrc = _ptr3 = pData; _ptr4 = _soundData = pData; + _volumeOffset = 0; _fieldA = 0xFF; _activeCount = 1; _fieldD = 64; @@ -104,7 +105,7 @@ void AdlibChannel::load(byte *pData) { _field1F = 0; _field2 = _field3 = 0; _volume = _field7 = 0; - _field1D = _field1E = 0; + _field1D = 0; _fieldE = 0; _field9 = 0; _fieldB = 0; @@ -117,7 +118,7 @@ void AdlibChannel::load(byte *pData) { void AdlibChannel::check(byte *nullPtr) { if (_activeCount && _fieldE) { - if (!_field1E) { + if (!_volumeOffset) { _pSrc = nullPtr; _fieldE = 0; } else { @@ -166,6 +167,7 @@ ASound::ASound(Audio::Mixer *mixer, FM_OPL *opl, const Common::String &filename, _samplePtr = nullptr; _frameCounter = 0; _isDisabled = false; + _masterVolume = 255; _v1 = 0; _v2 = 0; _activeChannelNumber = 0; @@ -540,7 +542,7 @@ void ASound::pollActiveChannel() { chan->_field1 = 0; chan->_field2 = chan->_field3 = 0; chan->_volume = chan->_field7 = 0; - chan->_field1D = chan->_field1E = 0; + chan->_field1D = chan->_volumeOffset = 0; chan->_field8 = 0; chan->_field9 = 0; chan->_fieldB = 0; @@ -615,7 +617,7 @@ void ASound::pollActiveChannel() { if (chan->_fieldE) { chan->_pSrc += 2; } else { - chan->_field1E = *pSrc >> 1; + chan->_volumeOffset = *pSrc >> 1; updateFlag = true; chan->_pSrc += 2; } @@ -659,7 +661,7 @@ void ASound::pollActiveChannel() { if (!--chan->_field9) { chan->_field9 = chan->_fieldA; if (chan->_field2) { - int8 newVal = (int8)chan->_field2 + (int8)chan->_field1E; + int8 newVal = (int8)chan->_field2 + (int8)chan->_volumeOffset; if (newVal < 0) { chan->_field9 = 0; newVal = 0; @@ -668,7 +670,7 @@ void ASound::pollActiveChannel() { newVal = 63; } - chan->_field1E = newVal; + chan->_volumeOffset = newVal; updateFlag = true; } } @@ -755,7 +757,8 @@ static const int outputChannels[] = { void ASound::updateActiveChannel() { int reg = 0x40 + outputChannels[outputIndexes[_activeChannelNumber * 2 + 1]]; int portVal = _ports[reg] & 0xFFC0; - int newVolume = CLIP(_activeChannelPtr->_volume + _activeChannelPtr->_field1E, 0, 63); + int newVolume = CLIP(_activeChannelPtr->_volume + _activeChannelPtr->_volumeOffset, 0, 63); + newVolume = newVolume * _masterVolume / 255; // Note: Original had a whole block not seeming to be used, since the initialisation // sets a variable to 5660h, and doesn't change it, so the branch is never taken @@ -857,6 +860,12 @@ int ASound::readBuffer(int16 *buffer, const int numSamples) { return numSamples; } +void ASound::setVolume(int volume) { + _masterVolume = volume; + if (!volume) + command0(); +} + int ASound::command0() { bool isDisabled = _isDisabled; _isDisabled = true; @@ -1014,22 +1023,22 @@ int ASound1::command10() { int ASound1::command11() { command111213(); - _channels[0]._field1E = 0; - _channels[1]._field1E = 0; + _channels[0]._volumeOffset = 0; + _channels[1]._volumeOffset = 0; return 0; } int ASound1::command12() { command111213(); - _channels[0]._field1E = 40; - _channels[1]._field1E = 0; + _channels[0]._volumeOffset = 40; + _channels[1]._volumeOffset = 0; return 0; } int ASound1::command13() { command111213(); - _channels[0]._field1E = 40; - _channels[1]._field1E = 50; + _channels[0]._volumeOffset = 40; + _channels[1]._volumeOffset = 50; return 0; } diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h index cfacb211a4..d2fc552eec 100644 --- a/engines/mads/nebular/sound_nebular.h +++ b/engines/mads/nebular/sound_nebular.h @@ -70,7 +70,7 @@ public: int _field19; byte *_soundData; int _field1D; - int _field1E; + int _volumeOffset; int _field1F; // TODO: Only used by asound.003. Figure out usage @@ -146,6 +146,7 @@ class ASound : public Audio::AudioStream { private: Common::List _dataCache; uint16 _randomSeed; + int _masterVolume; /** * Does the initial Adlib initialisation @@ -382,6 +383,11 @@ public: * Return sample rate */ virtual int getRate() const { return 11025; } + + /** + * Set the volume + */ + void setVolume(int volume); }; class ASound1 : public ASound { diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp index 1baa169c55..4036ee8112 100644 --- a/engines/mads/sound.cpp +++ b/engines/mads/sound.cpp @@ -36,6 +36,7 @@ SoundManager::SoundManager(MADSEngine *vm, Audio::Mixer *mixer) { _pollSoundEnabled = false; _soundPollFlag = false; _newSoundsPaused = false; + _masterVolume = 255; _opl = OPL::Config::create(); _opl->init(11025); @@ -97,15 +98,18 @@ void SoundManager::init(int sectionNumber) { break; default: _driver = nullptr; - break; + return; } break; default: warning("SoundManager: Unknown game"); _driver = nullptr; - break; + return; } + + // Set volume for newly loaded driver + _driver->setVolume(_masterVolume); } void SoundManager::closeDriver() { @@ -141,6 +145,13 @@ void SoundManager::startQueuedCommands() { } } +void SoundManager::setVolume(int volume) { + _masterVolume = volume; + + if (_driver) + _driver->setVolume(volume); +} + void SoundManager::command(int commandId, int param) { if (_newSoundsPaused) { if (_queuedCommands.size() < 8) diff --git a/engines/mads/sound.h b/engines/mads/sound.h index 72bb21a812..5884323474 100644 --- a/engines/mads/sound.h +++ b/engines/mads/sound.h @@ -43,6 +43,7 @@ private: bool _soundPollFlag; bool _newSoundsPaused; Common::Queue _queuedCommands; + int _masterVolume; public: SoundManager(MADSEngine *vm, Audio::Mixer *mixer); ~SoundManager(); @@ -78,6 +79,11 @@ public: */ void startQueuedCommands(); + /** + * Set the master volume + */ + void setVolume(int volume); + //@{ /** * Executes a command on the sound driver -- cgit v1.2.3 From fb0f95172a0395cc6d86f26fea5de2c6a780999a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 29 Mar 2015 16:21:49 -0400 Subject: MADS: Don't hide sprites bewteen resources in an animation sequence --- engines/mads/menu_views.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index 5a0c7ee92e..319f5b0f87 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -544,6 +544,7 @@ void AnimationView::doFrame() { scriptDone(); } else { scene._frameStartTime = 0; + scene._spriteSlots.clear(); loadNextResource(); } } else if (_currentAnimation->getCurrentFrame() == 1) { @@ -559,6 +560,10 @@ void AnimationView::doFrame() { ++scene._frameStartTime; _currentAnimation->update(); _redrawFlag = true; + + if (_currentAnimation->freeFlag()) + // We don't want the sprites removed after the last animation frame + scene._spriteSlots.clear(); } } -- cgit v1.2.3 From 478fae2a6ea6d1c896cd9d5454b170889fc8447a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 29 Mar 2015 22:12:27 -0400 Subject: MADS: Set testing flags for Rex Nebular --- engines/mads/detection_tables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/detection_tables.h b/engines/mads/detection_tables.h index 0a8e98bb31..faf73996ac 100644 --- a/engines/mads/detection_tables.h +++ b/engines/mads/detection_tables.h @@ -55,7 +55,7 @@ static const MADSGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformDOS, - ADGF_NO_FLAGS, + ADGF_TESTING, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EASY_MOUSE, GAMEOPTION_ANIMATED_INVENTORY, GAMEOPTION_ANIMATED_INTERFACE, GAMEOPTION_NAUGHTY_MODE) }, GType_RexNebular, @@ -73,7 +73,7 @@ static const MADSGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformDOS, - ADGF_NO_FLAGS, + ADGF_TESTING, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EASY_MOUSE, GAMEOPTION_ANIMATED_INVENTORY, GAMEOPTION_ANIMATED_INTERFACE, GAMEOPTION_NAUGHTY_MODE) }, GType_RexNebular, -- cgit v1.2.3 From a44ab1facc9c1ed8bc1f1ff38876c65f2624a406 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Apr 2015 21:08:15 -0500 Subject: MADS: Fix incorrect depth handling after picking up rebreather --- engines/mads/nebular/nebular_scenes1.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index 0c5888b6ec..047dc1f498 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -1462,7 +1462,6 @@ void Scene103::actions() { } else if (_action.isAction(VERB_TAKE, NOUN_REBREATHER, 0) && _game._objects.isInRoom(OBJ_REBREATHER)) { switch (_vm->_game->_trigger) { case 0: - _scene->changeVariant(1); _globals._sequenceIndexes[12] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[12], false, 3, 2); _scene->_sequences.setMsgLayout(_globals._sequenceIndexes[12]); _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_SPRITE, 6, 1); -- cgit v1.2.3 From 355fa444caadfc951ba289bf23fc275f949bf36e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Apr 2015 21:40:21 -0500 Subject: MADS: Fix throwing burger in the different difficulty modes --- engines/mads/nebular/nebular_scenes1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index 047dc1f498..0a62e375d7 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -2637,7 +2637,7 @@ void Scene109::actions() { break; case OBJ_BURGER: - _hoovicDifficultFl = (_game._difficulty == DIFFICULTY_EASY); + _hoovicDifficultFl = (_game._difficulty == DIFFICULTY_HARD); _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('H', (_hoovicDifficultFl ? 3 : 1))); break; } -- cgit v1.2.3 From ae61f8ba04aca3cbd84c4dd27f9302744246f109 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Apr 2015 22:03:06 -0500 Subject: MADS: Fix wait cursor when leaving crashed ship for the first time --- engines/mads/events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index 767f998d81..52569af375 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -84,8 +84,8 @@ void EventsManager::waitCursor() { CursorType cursorId = (CursorType)MIN(_cursorSprites->getCount(), (int)CURSOR_WAIT); _newCursorId = cursorId; if (_cursorId != _newCursorId) { - changeCursor(); _cursorId = _newCursorId; + changeCursor(); } } -- cgit v1.2.3 From d6945864ea450cdaa20e5120771e3c497e5515ee Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Apr 2015 22:39:56 -0500 Subject: MADS: Keep Rex's speech on-screen longer when exitting crashed ship --- engines/mads/messages.cpp | 8 +++++--- engines/mads/nebular/nebular_scenes1.cpp | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/messages.cpp b/engines/mads/messages.cpp index 4b105630d6..304c79aa46 100644 --- a/engines/mads/messages.cpp +++ b/engines/mads/messages.cpp @@ -91,7 +91,7 @@ int KernelMessages::add(const Common::Point &pt, uint fontColor, uint8 flags, rec._position = pt; rec._textDisplayIndex = -1; rec._timeout = timeout; - rec._frameTimer = _vm->_game->_priorFrameTimer; + rec._frameTimer = scene._frameStartTime; rec._trigger = endTrigger; rec._abortMode = _vm->_game->_triggerSetupMode; @@ -162,8 +162,10 @@ void KernelMessages::update() { uint32 currentTimer = _vm->_game->_scene._frameStartTime; for (uint i = 0; i < _entries.size() && !_vm->_game->_trigger; ++i) { - KernelMessage &msg = _entries[i]; + if (_vm->_game->_trigger) + break; + KernelMessage &msg = _entries[i]; if (((msg._flags & KMSG_ACTIVE) != 0) && (currentTimer >= msg._frameTimer)) processText(i); } @@ -172,7 +174,7 @@ void KernelMessages::update() { void KernelMessages::processText(int msgIndex) { Scene &scene = _vm->_game->_scene; KernelMessage &msg = _entries[msgIndex]; - uint32 currentTimer = _vm->_game->_priorFrameTimer; + uint32 currentTimer = scene._frameStartTime; bool flag = false; if ((msg._flags & KMSG_EXPIRE) != 0) { diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index 0a62e375d7..bcc4fb43d5 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -2112,9 +2112,9 @@ void Scene106::step() { } if (msgId >= 0) { - int nextAbortVal = _game._trigger + 1; + int nextTrigger = _game._trigger + 1; _scene->_kernelMessages.add(Common::Point(15, _positionY), 0x1110, 0, 0, 360, _game.getQuote(msgId)); - _scene->_sequences.addTimer(150, nextAbortVal); + _scene->_sequences.addTimer(150, nextTrigger); _positionY += 14; } } -- cgit v1.2.3 From cb91e1518a3ba88e378d4e90cbe0d8e99ba4e639 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Apr 2015 22:59:43 -0500 Subject: MADS: Have Rex swim to correct spot when throwing burger or fish --- engines/mads/nebular/nebular_scenes1.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index bcc4fb43d5..c9eda08859 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -2589,8 +2589,8 @@ void Scene109::preActions() { _game._player._walkOffScreenSceneId = 108; if ((_action.isAction(VERB_THROW) || _action.isAction(VERB_GIVE) || _action.isAction(VERB_PUT)) - && (_action.isObject(NOUN_SMALL_HOLE) || _action.isObject(NOUN_TUNNEL)) - && (_action.isObject(NOUN_DEAD_FISH) || _action.isObject(NOUN_STUFFED_FISH) || _action.isObject(NOUN_BURGER))) { + && (_action.isTarget(NOUN_SMALL_HOLE) || _action.isTarget(NOUN_TUNNEL)) + && (_action.isObject(NOUN_DEAD_FISH) || _action.isObject(NOUN_STUFFED_FISH) || _action.isObject(NOUN_BURGER))) { int idx = _game._objects.getIdFromDesc(_action._activeAction._objectNameId); if ((idx >= 0) && _game._objects.isInInventory(idx)) { _game._player._prepareWalkPos = Common::Point(106, 38); -- cgit v1.2.3 From d9168c8fae304c0984b59d142dfc66e04b9fab36 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 Apr 2015 15:28:10 -0500 Subject: MADS: Fix placement of blowgun in easy mode --- engines/mads/game.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index b601a12c82..72d7988c05 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -115,8 +115,6 @@ void Game::run() { _statusFlag = true; while (!_vm->shouldQuit()) { - initializeGlobals(); - if (_loadGameSlot == -1) { startGame(); } -- cgit v1.2.3 From 661542b8c62a618f5d4b8265c8f9fb4d7e58a3a7 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 6 Apr 2015 03:12:15 +0300 Subject: MADS: Implement copy protection screen for Rex --- engines/mads/nebular/dialogs_nebular.cpp | 44 +++++++++++++++++++---- engines/mads/nebular/dialogs_nebular.h | 3 ++ engines/mads/nebular/game_nebular.cpp | 62 +++++++++++++++++--------------- engines/mads/nebular/nebular_scenes8.cpp | 2 +- 4 files changed, 74 insertions(+), 37 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 4ba5366a60..9388aa2aa5 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -417,7 +417,7 @@ TextDialog(vm, FONT_INTERFACE, Common::Point(-1, -1), 32) { _hogEntry._pageNum, _hogEntry._lineNum, _hogEntry._wordNum); wordWrap(line); - wordWrap("and type it on the line below (we',27h,'ve even given you"); + wordWrap("and type it on the line below (we've even given you"); wordWrap("first letter as a hint). As soon as you do that, we can get"); wordWrap("right into this really COOL adventure game!\n"); wordWrap("\n"); @@ -428,17 +428,47 @@ TextDialog(vm, FONT_INTERFACE, Common::Point(-1, -1), 32) { void CopyProtectionDialog::show() { draw(); - _vm->_events->showCursor(); - // TODO: Replace with text input - while (!_vm->shouldQuit() && !_vm->_events->isKeyPressed() && - !_vm->_events->_mouseClicked) { - _vm->_events->delay(1); + Common::KeyState curKey; + Common::Rect inputArea(110, 165, 210, 175); + MSurface *origInput = new MSurface(inputArea.width(), inputArea.height()); + _vm->_screen.frameRect(inputArea, TEXTDIALOG_BLACK); + _vm->_screen.copyTo(origInput, inputArea, Common::Point(0, 0)); + _font->setColors(TEXTDIALOG_FE, TEXTDIALOG_FE, TEXTDIALOG_FE, TEXTDIALOG_FE); + _vm->_screen.copyRectToScreen(inputArea); + _vm->_screen.updateScreen(); + + while (!_vm->shouldQuit()) { + while (!_vm->_events->isKeyPressed()) { + _vm->_events->delay(1); + } + + curKey = _vm->_events->getKey(); + + if (curKey.keycode == Common::KEYCODE_RETURN || curKey.keycode == Common::KEYCODE_KP_ENTER) + break; + else if (curKey.keycode == Common::KEYCODE_BACKSPACE) + _textInput.deleteLastChar(); + else if (_textInput.size() < 14) + _textInput += curKey.ascii; + + _vm->_events->_pendingKeys.clear(); + + _vm->_screen.copyFrom(origInput, Common::Rect(0, 0, inputArea.width(), inputArea.height()), Common::Point(inputArea.left, inputArea.top)); + _font->writeString(&_vm->_screen, _textInput, + Common::Point(inputArea.left + 2, inputArea.top + 1), 1); + _vm->_screen.copyRectToScreen(inputArea); + _vm->_screen.updateScreen(); } - _vm->_events->_pendingKeys.clear(); + delete origInput; } +bool CopyProtectionDialog::isCorrectAnswer() { + return _hogEntry._word == _textInput; +} + + bool CopyProtectionDialog::getHogAnusEntry(HOGANUS &entry) { File f; f.open("*HOGANUS.DAT"); diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h index 5dbe4da6f0..0f086f6ec1 100644 --- a/engines/mads/nebular/dialogs_nebular.h +++ b/engines/mads/nebular/dialogs_nebular.h @@ -69,6 +69,7 @@ struct HOGANUS { class CopyProtectionDialog : public TextDialog { private: HOGANUS _hogEntry; + Common::String _textInput; /** * Get a random copy protection entry from the HOGANUS resource @@ -84,6 +85,8 @@ public: * Show the dialog */ virtual void show(); + + bool isCorrectAnswer(); }; class PictureDialog : public TextDialog { diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index cde998e66a..ec7c6678e8 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -45,19 +45,25 @@ GameNebular::GameNebular(MADSEngine *vm) } ProtectionResult GameNebular::checkCopyProtection() { - /* - // DEBUG: Flag copy protection failure - _globals[kCopyProtectFailed] = -1; + //if (!ConfMan.getBool("copy_protection")) + // return PROTECTION_SUCCEED; - if (!ConfMan.getBool("copy_protection")) - return true; + CopyProtectionDialog *dlg; + bool correctAnswer; - * DEBUG: Disabled for now - CopyProtectionDialog *dlg = new CopyProtectionDialog(_vm, false); + dlg = new CopyProtectionDialog(_vm, false); dlg->show(); + correctAnswer = dlg->isCorrectAnswer(); delete dlg; - */ - return PROTECTION_SUCCEED; + + if (!correctAnswer) { + dlg = new CopyProtectionDialog(_vm, true); + dlg->show(); + correctAnswer = dlg->isCorrectAnswer(); + delete dlg; + } + + return correctAnswer ? PROTECTION_SUCCEED : PROTECTION_FAIL; } void GameNebular::startGame() { @@ -91,26 +97,6 @@ void GameNebular::startGame() { checkShowDialog(); _winStatus = 0; - /* - // Check copy protection - ProtectionResult protectionResult = checkCopyProtection(); - switch (protectionResult) { - case PROTECTION_FAIL: - // Copy protection failed - _scene._nextSceneId = 804; - initializeGlobals(); - _globals[kCopyProtectFailed] = true; - return; - case PROTECTION_ESCAPE: - // User escaped out of copy protection dialog - _vm->quitGame(); - return; - default: - // Copy protection check succeeded - break; - } - */ - _sectionNumber = 1; initSection(_sectionNumber); _vm->_events->setCursor(CURSOR_ARROW); @@ -128,6 +114,24 @@ void GameNebular::startGame() { _scene._nextSceneId = 101; initializeGlobals(); + + // Check copy protection + ProtectionResult protectionResult = checkCopyProtection(); + + switch (protectionResult) { + case PROTECTION_FAIL: + // Copy protection failed + _scene._nextSceneId = 804; + _globals[kCopyProtectFailed] = true; + return; + case PROTECTION_ESCAPE: + // User escaped out of copy protection dialog + _vm->quitGame(); + return; + default: + // Copy protection check succeeded + break; + } } void GameNebular::initializeGlobals() { diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 8ce559b82b..5f8417cee1 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -957,7 +957,7 @@ void Scene804::step() { _globals[kInSpace] = false; _globals[kBeamIsUp] = true; - assert(!_globals[kCopyProtectFailed]); + //assert(!_globals[kCopyProtectFailed]); _game._winStatus = 4; return; } -- cgit v1.2.3 From f3251b5bb65bbd4ecee7a0700e1f876987cc7644 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 6 Apr 2015 08:29:46 +0200 Subject: MADS: Allow quitting in Rex's copy protection dialog --- engines/mads/nebular/dialogs_nebular.cpp | 5 ++++- engines/mads/nebular/game_nebular.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 9388aa2aa5..731e7e960d 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -439,10 +439,13 @@ void CopyProtectionDialog::show() { _vm->_screen.updateScreen(); while (!_vm->shouldQuit()) { - while (!_vm->_events->isKeyPressed()) { + while (!_vm->shouldQuit() && !_vm->_events->isKeyPressed()) { _vm->_events->delay(1); } + if (_vm->shouldQuit()) + break; + curKey = _vm->_events->getKey(); if (curKey.keycode == Common::KEYCODE_RETURN || curKey.keycode == Common::KEYCODE_KP_ENTER) diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index ec7c6678e8..c96f1c6df9 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -56,7 +56,7 @@ ProtectionResult GameNebular::checkCopyProtection() { correctAnswer = dlg->isCorrectAnswer(); delete dlg; - if (!correctAnswer) { + if (!correctAnswer && !_vm->shouldQuit()) { dlg = new CopyProtectionDialog(_vm, true); dlg->show(); correctAnswer = dlg->isCorrectAnswer(); -- cgit v1.2.3 From c8ac76b22bfd676bb72a850a141730022d6d476c Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 6 Apr 2015 10:42:16 +0200 Subject: MADS: Show first character of the Rex Nebular copy protection word --- engines/mads/nebular/dialogs_nebular.cpp | 35 +++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 731e7e960d..10715797ed 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -438,24 +438,31 @@ void CopyProtectionDialog::show() { _vm->_screen.copyRectToScreen(inputArea); _vm->_screen.updateScreen(); + bool firstTime = true; + while (!_vm->shouldQuit()) { - while (!_vm->shouldQuit() && !_vm->_events->isKeyPressed()) { - _vm->_events->delay(1); - } + if (!firstTime) { + while (!_vm->shouldQuit() && !_vm->_events->isKeyPressed()) { + _vm->_events->delay(1); + } - if (_vm->shouldQuit()) - break; + if (_vm->shouldQuit()) + break; - curKey = _vm->_events->getKey(); - - if (curKey.keycode == Common::KEYCODE_RETURN || curKey.keycode == Common::KEYCODE_KP_ENTER) - break; - else if (curKey.keycode == Common::KEYCODE_BACKSPACE) - _textInput.deleteLastChar(); - else if (_textInput.size() < 14) - _textInput += curKey.ascii; + curKey = _vm->_events->getKey(); + + if (curKey.keycode == Common::KEYCODE_RETURN || curKey.keycode == Common::KEYCODE_KP_ENTER) + break; + else if (curKey.keycode == Common::KEYCODE_BACKSPACE) + _textInput.deleteLastChar(); + else if (_textInput.size() < 14) + _textInput += curKey.ascii; - _vm->_events->_pendingKeys.clear(); + _vm->_events->_pendingKeys.clear(); + } else { + firstTime = false; + _textInput = _hogEntry._word[0]; + } _vm->_screen.copyFrom(origInput, Common::Rect(0, 0, inputArea.width(), inputArea.height()), Common::Point(inputArea.left, inputArea.top)); _font->writeString(&_vm->_screen, _textInput, -- cgit v1.2.3 From 07c7f5e31a1f1952ebe583a138352e13e45e0c66 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 7 Apr 2015 20:09:00 -0500 Subject: MADS: Fix crash leaving scene after shooting monkey --- engines/mads/sprites.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index 67d5e20fe5..bc36b5575a 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -399,7 +399,7 @@ void SpriteSets::remove(int idx) { if (idx == SPRITE_SLOTS_MAX_SIZE) { delete _uiSprites; _uiSprites = nullptr; - } else if (idx >= 0) { + } else if (idx >= 0 && idx < (int)size()) { delete (*this)[idx]; if (idx < ((int)size() - 1)) { -- cgit v1.2.3 From 47afe424c194d5d4fd1797948b53f999473fe922 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 8 Apr 2015 21:28:24 -0500 Subject: MADS: Don't show protection dialog when exiting directly from main menu --- engines/mads/nebular/game_nebular.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/mads') diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index c96f1c6df9..e9a3d0b716 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -107,6 +107,9 @@ void GameNebular::startGame() { _vm->_dialogs->showDialog(); } while (!_vm->shouldQuit() && _vm->_dialogs->_pendingDialog != DIALOG_NONE); + if (_vm->shouldQuit()) + return; + _priorSectionNumber = 0; _priorSectionNumber = -1; _scene._priorSceneId = 0; -- cgit v1.2.3 From ec999f1cb74dff8c42c69898bb6cbc3823b169dd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 9 Apr 2015 13:44:39 +0300 Subject: MADS: Plug some memory leaks Surfaces should be freed (to free their inner allocated surface buffers) before being deleted --- engines/mads/game.cpp | 1 + engines/mads/nebular/dialogs_nebular.cpp | 4 +++- engines/mads/scene_data.cpp | 2 ++ engines/mads/sprites.cpp | 4 +++- engines/mads/user_interface.cpp | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 72d7988c05..3d1c194612 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -100,6 +100,7 @@ Game::~Game() { } delete _saveFile; + _surface->free(); delete _surface; delete _sectionHandler; } diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 10715797ed..5b9942db07 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -430,7 +430,7 @@ void CopyProtectionDialog::show() { draw(); Common::KeyState curKey; - Common::Rect inputArea(110, 165, 210, 175); + const Common::Rect inputArea(110, 165, 210, 175); MSurface *origInput = new MSurface(inputArea.width(), inputArea.height()); _vm->_screen.frameRect(inputArea, TEXTDIALOG_BLACK); _vm->_screen.copyTo(origInput, inputArea, Common::Point(0, 0)); @@ -471,6 +471,7 @@ void CopyProtectionDialog::show() { _vm->_screen.updateScreen(); } + origInput->free(); delete origInput; } @@ -592,6 +593,7 @@ void PictureDialog::save() { void PictureDialog::restore() { if (_savedSurface) { _savedSurface->copyTo(&_vm->_screen); + _savedSurface->free(); delete _savedSurface; _savedSurface = nullptr; diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index d0e96be1d7..e594406447 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -451,6 +451,8 @@ void SceneInfo::loadMadsV2Background(int sceneId, const Common::String &resName, fab.decompress(compressedTileData, compressedTileDataSize, (byte*)newTile->getPixels(), tileWidth * tileHeight); tileSet.push_back(TileSetList::value_type(newTile)); + newTile->free(); + delete newTile; delete[] compressedTileData; } diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index bc36b5575a..f15d6456d3 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -347,8 +347,10 @@ void SpriteSlots::drawSprites(MSurface *s) { spr->copyTo(s, Common::Point(xp, yp), sprite->getTransparencyIndex()); // Free sprite if it was a flipped one - if (flipped) + if (flipped) { + spr->free(); delete spr; + } } } } diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 93a555d9c7..1e5a1d80d2 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -164,6 +164,7 @@ void UISlots::draw(bool updateFlag, bool delFlag) { MSurface *spr = sprite->flipHorizontal(); userInterface.mergeFrom(spr, spr->getBounds(), slot._position, sprite->getTransparencyIndex()); + spr->free(); delete spr; } else { userInterface.mergeFrom(sprite, sprite->getBounds(), slot._position, -- cgit v1.2.3 From ec03857d7dd7614675b41cfc412be20b733b469a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 9 Apr 2015 14:08:48 +0300 Subject: MADS: Fix a regression in V2 games --- engines/mads/scene_data.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp index e594406447..e48bcd8c6f 100644 --- a/engines/mads/scene_data.cpp +++ b/engines/mads/scene_data.cpp @@ -451,8 +451,6 @@ void SceneInfo::loadMadsV2Background(int sceneId, const Common::String &resName, fab.decompress(compressedTileData, compressedTileDataSize, (byte*)newTile->getPixels(), tileWidth * tileHeight); tileSet.push_back(TileSetList::value_type(newTile)); - newTile->free(); - delete newTile; delete[] compressedTileData; } @@ -471,6 +469,7 @@ void SceneInfo::loadMadsV2Background(int sceneId, const Common::String &resName, for (int i = 0; i < tileIndex; i++) ++tile; ((*tile).get())->copyTo(&bgSurface, Common::Point(x * tileWidth, y * tileHeight)); + ((*tile).get())->free(); } } tileSet.clear(); -- cgit v1.2.3 From dd63cef93efce72b300c99a6a8b9415a111c2b82 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 11 Apr 2015 15:38:31 -0500 Subject: MADS: Fix memory leak in Dialog class --- engines/mads/dialogs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/mads') diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp index 158d9693ad..7f0b02bc65 100644 --- a/engines/mads/dialogs.cpp +++ b/engines/mads/dialogs.cpp @@ -43,6 +43,7 @@ Dialog::Dialog(MADSEngine *vm) } Dialog::~Dialog() { + delete _savedSurface; } void Dialog::save() { -- cgit v1.2.3 From 5dd69b4dd1be1dd8793111df089a4c737231a614 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 9 May 2015 15:56:27 +0200 Subject: MADS: Make GPL header consistent with what we normally use. --- engines/mads/action.cpp | 4 ++-- engines/mads/action.h | 4 ++-- engines/mads/animation.cpp | 4 ++-- engines/mads/animation.h | 4 ++-- engines/mads/assets.cpp | 4 ++-- engines/mads/assets.h | 4 ++-- engines/mads/audio.cpp | 4 ++-- engines/mads/audio.h | 4 ++-- engines/mads/compression.cpp | 4 ++-- engines/mads/compression.h | 4 ++-- engines/mads/debugger.cpp | 6 +++--- engines/mads/debugger.h | 6 +++--- engines/mads/detection.cpp | 4 ++-- engines/mads/detection_tables.h | 4 ++-- engines/mads/dialogs.cpp | 4 ++-- engines/mads/dialogs.h | 4 ++-- engines/mads/dragonsphere/dragonsphere_scenes.cpp | 4 ++-- engines/mads/dragonsphere/dragonsphere_scenes.h | 4 ++-- engines/mads/dragonsphere/game_dragonsphere.cpp | 4 ++-- engines/mads/dragonsphere/game_dragonsphere.h | 4 ++-- engines/mads/events.cpp | 4 ++-- engines/mads/events.h | 4 ++-- engines/mads/font.cpp | 4 ++-- engines/mads/font.h | 4 ++-- engines/mads/game.cpp | 4 ++-- engines/mads/game.h | 4 ++-- engines/mads/game_data.cpp | 4 ++-- engines/mads/game_data.h | 4 ++-- engines/mads/globals.cpp | 4 ++-- engines/mads/globals.h | 4 ++-- engines/mads/hotspots.cpp | 6 +++--- engines/mads/hotspots.h | 6 +++--- engines/mads/inventory.cpp | 4 ++-- engines/mads/inventory.h | 4 ++-- engines/mads/mads.cpp | 4 ++-- engines/mads/mads.h | 4 ++-- engines/mads/menu_views.cpp | 4 ++-- engines/mads/menu_views.h | 4 ++-- engines/mads/messages.cpp | 4 ++-- engines/mads/messages.h | 4 ++-- engines/mads/msurface.cpp | 4 ++-- engines/mads/msurface.h | 4 ++-- engines/mads/nebular/dialogs_nebular.cpp | 4 ++-- engines/mads/nebular/dialogs_nebular.h | 4 ++-- engines/mads/nebular/game_nebular.cpp | 4 ++-- engines/mads/nebular/game_nebular.h | 4 ++-- engines/mads/nebular/globals_nebular.cpp | 4 ++-- engines/mads/nebular/globals_nebular.h | 4 ++-- engines/mads/nebular/menu_nebular.cpp | 4 ++-- engines/mads/nebular/menu_nebular.h | 4 ++-- engines/mads/nebular/nebular_scenes.cpp | 4 ++-- engines/mads/nebular/nebular_scenes.h | 4 ++-- engines/mads/nebular/nebular_scenes1.cpp | 6 +++--- engines/mads/nebular/nebular_scenes1.h | 4 ++-- engines/mads/nebular/nebular_scenes2.cpp | 6 +++--- engines/mads/nebular/nebular_scenes2.h | 4 ++-- engines/mads/nebular/nebular_scenes3.cpp | 6 +++--- engines/mads/nebular/nebular_scenes3.h | 4 ++-- engines/mads/nebular/nebular_scenes4.cpp | 6 +++--- engines/mads/nebular/nebular_scenes4.h | 4 ++-- engines/mads/nebular/nebular_scenes5.cpp | 6 +++--- engines/mads/nebular/nebular_scenes5.h | 4 ++-- engines/mads/nebular/nebular_scenes6.cpp | 6 +++--- engines/mads/nebular/nebular_scenes6.h | 6 +++--- engines/mads/nebular/nebular_scenes7.cpp | 6 +++--- engines/mads/nebular/nebular_scenes7.h | 4 ++-- engines/mads/nebular/nebular_scenes8.cpp | 6 +++--- engines/mads/nebular/nebular_scenes8.h | 4 ++-- engines/mads/nebular/sound_nebular.cpp | 4 ++-- engines/mads/nebular/sound_nebular.h | 4 ++-- engines/mads/palette.cpp | 4 ++-- engines/mads/palette.h | 4 ++-- engines/mads/phantom/game_phantom.cpp | 4 ++-- engines/mads/phantom/game_phantom.h | 4 ++-- engines/mads/phantom/phantom_scenes.cpp | 4 ++-- engines/mads/phantom/phantom_scenes.h | 4 ++-- engines/mads/player.cpp | 4 ++-- engines/mads/player.h | 4 ++-- engines/mads/rails.cpp | 4 ++-- engines/mads/rails.h | 4 ++-- engines/mads/resources.cpp | 4 ++-- engines/mads/resources.h | 4 ++-- engines/mads/scene.cpp | 4 ++-- engines/mads/scene.h | 4 ++-- engines/mads/screen.cpp | 4 ++-- engines/mads/screen.h | 4 ++-- engines/mads/sequence.cpp | 4 ++-- engines/mads/sequence.h | 4 ++-- engines/mads/sound.cpp | 4 ++-- engines/mads/sound.h | 4 ++-- engines/mads/sprites.cpp | 4 ++-- engines/mads/sprites.h | 4 ++-- engines/mads/staticres.cpp | 4 ++-- engines/mads/staticres.h | 4 ++-- engines/mads/user_interface.cpp | 4 ++-- engines/mads/user_interface.h | 4 ++-- 96 files changed, 205 insertions(+), 205 deletions(-) (limited to 'engines/mads') diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp index 628f03526f..f1c562675f 100644 --- a/engines/mads/action.cpp +++ b/engines/mads/action.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/action.h b/engines/mads/action.h index cfd5a3be3f..3ea10cd964 100644 --- a/engines/mads/action.h +++ b/engines/mads/action.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index cf02e7b0b5..e4f44fc308 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/animation.h b/engines/mads/animation.h index 1c87273e62..46ef85c5eb 100644 --- a/engines/mads/animation.h +++ b/engines/mads/animation.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/assets.cpp b/engines/mads/assets.cpp index a2d495f311..1d4634e383 100644 --- a/engines/mads/assets.cpp +++ b/engines/mads/assets.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/assets.h b/engines/mads/assets.h index 155590f9bd..8a0dc2cd44 100644 --- a/engines/mads/assets.h +++ b/engines/mads/assets.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/audio.cpp b/engines/mads/audio.cpp index def2cd6c62..8f33f22243 100644 --- a/engines/mads/audio.cpp +++ b/engines/mads/audio.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/audio.h b/engines/mads/audio.h index 13c540bf85..5c3cd5e682 100644 --- a/engines/mads/audio.h +++ b/engines/mads/audio.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/compression.cpp b/engines/mads/compression.cpp index 79cd1786de..1f6f1ee202 100644 --- a/engines/mads/compression.cpp +++ b/engines/mads/compression.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/compression.h b/engines/mads/compression.h index f7381e4af3..b560ed33c1 100644 --- a/engines/mads/compression.h +++ b/engines/mads/compression.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp index 99251f9fbb..a6a4d3edbc 100644 --- a/engines/mads/debugger.cpp +++ b/engines/mads/debugger.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/debugger.h b/engines/mads/debugger.h index c8fee5f5b2..70b2cadc65 100644 --- a/engines/mads/debugger.h +++ b/engines/mads/debugger.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/detection.cpp b/engines/mads/detection.cpp index ea71fc8539..57f4776e82 100644 --- a/engines/mads/detection.cpp +++ b/engines/mads/detection.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/detection_tables.h b/engines/mads/detection_tables.h index faf73996ac..56df09577c 100644 --- a/engines/mads/detection_tables.h +++ b/engines/mads/detection_tables.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp index 7f0b02bc65..d9b27ce926 100644 --- a/engines/mads/dialogs.cpp +++ b/engines/mads/dialogs.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/dialogs.h b/engines/mads/dialogs.h index 317c7bd792..efd2871d89 100644 --- a/engines/mads/dialogs.h +++ b/engines/mads/dialogs.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/dragonsphere/dragonsphere_scenes.cpp b/engines/mads/dragonsphere/dragonsphere_scenes.cpp index f32d17d9c9..ff01c32174 100644 --- a/engines/mads/dragonsphere/dragonsphere_scenes.cpp +++ b/engines/mads/dragonsphere/dragonsphere_scenes.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/dragonsphere/dragonsphere_scenes.h b/engines/mads/dragonsphere/dragonsphere_scenes.h index a6c778eca7..173cc667ce 100644 --- a/engines/mads/dragonsphere/dragonsphere_scenes.h +++ b/engines/mads/dragonsphere/dragonsphere_scenes.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/dragonsphere/game_dragonsphere.cpp b/engines/mads/dragonsphere/game_dragonsphere.cpp index 3836adb6d2..b07eab9daa 100644 --- a/engines/mads/dragonsphere/game_dragonsphere.cpp +++ b/engines/mads/dragonsphere/game_dragonsphere.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/dragonsphere/game_dragonsphere.h b/engines/mads/dragonsphere/game_dragonsphere.h index 7869dc87b4..b57f8833c6 100644 --- a/engines/mads/dragonsphere/game_dragonsphere.h +++ b/engines/mads/dragonsphere/game_dragonsphere.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index 52569af375..7ba9098935 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/events.h b/engines/mads/events.h index 1a92754f10..1a2579cae0 100644 --- a/engines/mads/events.h +++ b/engines/mads/events.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/font.cpp b/engines/mads/font.cpp index f7c1c52703..3e6d23fe6f 100644 --- a/engines/mads/font.cpp +++ b/engines/mads/font.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/font.h b/engines/mads/font.h index 47df647637..486cadcfff 100644 --- a/engines/mads/font.h +++ b/engines/mads/font.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 3d1c194612..91f6cd5630 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/game.h b/engines/mads/game.h index d246aa501e..95b54b0d1a 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/game_data.cpp b/engines/mads/game_data.cpp index 70e9e6c30b..6421d057e8 100644 --- a/engines/mads/game_data.cpp +++ b/engines/mads/game_data.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/game_data.h b/engines/mads/game_data.h index 65a9ae1553..e9bf45d8a5 100644 --- a/engines/mads/game_data.h +++ b/engines/mads/game_data.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/globals.cpp b/engines/mads/globals.cpp index 1d088992ea..e4a681d551 100644 --- a/engines/mads/globals.cpp +++ b/engines/mads/globals.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/globals.h b/engines/mads/globals.h index a6c9b628dd..27553a2b06 100644 --- a/engines/mads/globals.h +++ b/engines/mads/globals.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp index 2af421a112..bd28645504 100644 --- a/engines/mads/hotspots.cpp +++ b/engines/mads/hotspots.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/hotspots.h b/engines/mads/hotspots.h index f9334eace8..902275bb21 100644 --- a/engines/mads/hotspots.h +++ b/engines/mads/hotspots.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/inventory.cpp b/engines/mads/inventory.cpp index ca05575ec5..fe1d24baea 100644 --- a/engines/mads/inventory.cpp +++ b/engines/mads/inventory.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/inventory.h b/engines/mads/inventory.h index cf82de59f1..2897f950e4 100644 --- a/engines/mads/inventory.h +++ b/engines/mads/inventory.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp index 374e373035..8c7b6b1ce3 100644 --- a/engines/mads/mads.cpp +++ b/engines/mads/mads.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/mads.h b/engines/mads/mads.h index 1d641e7c87..901035320a 100644 --- a/engines/mads/mads.h +++ b/engines/mads/mads.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp index 319f5b0f87..cfc3b09461 100644 --- a/engines/mads/menu_views.cpp +++ b/engines/mads/menu_views.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/menu_views.h b/engines/mads/menu_views.h index f39ea4c3b5..6c8a2a8bdd 100644 --- a/engines/mads/menu_views.h +++ b/engines/mads/menu_views.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/messages.cpp b/engines/mads/messages.cpp index 304c79aa46..d88806150d 100644 --- a/engines/mads/messages.cpp +++ b/engines/mads/messages.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/messages.h b/engines/mads/messages.h index 22ae0b24b5..764477a7fc 100644 --- a/engines/mads/messages.h +++ b/engines/mads/messages.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index 702b9e5f08..f768624278 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/msurface.h b/engines/mads/msurface.h index 754e70bf7f..80891afb83 100644 --- a/engines/mads/msurface.h +++ b/engines/mads/msurface.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 5b9942db07..960a2cc2f4 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h index 0f086f6ec1..4935ee4b8c 100644 --- a/engines/mads/nebular/dialogs_nebular.h +++ b/engines/mads/nebular/dialogs_nebular.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index e9a3d0b716..e8e0a4f42c 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h index 1b89d11412..3cf7aefc18 100644 --- a/engines/mads/nebular/game_nebular.h +++ b/engines/mads/nebular/game_nebular.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/globals_nebular.cpp b/engines/mads/nebular/globals_nebular.cpp index 9f8b8a7888..c44506e546 100644 --- a/engines/mads/nebular/globals_nebular.cpp +++ b/engines/mads/nebular/globals_nebular.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h index 8d0c26d96d..7c7069892e 100644 --- a/engines/mads/nebular/globals_nebular.h +++ b/engines/mads/nebular/globals_nebular.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 2fdef3443d..6fe17f3beb 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h index 77b8b6fc6e..35af0bb34f 100644 --- a/engines/mads/nebular/menu_nebular.h +++ b/engines/mads/nebular/menu_nebular.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp index 14cf71d0fc..eb6f7a5610 100644 --- a/engines/mads/nebular/nebular_scenes.cpp +++ b/engines/mads/nebular/nebular_scenes.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes.h b/engines/mads/nebular/nebular_scenes.h index db7738f13b..58a6d1c98f 100644 --- a/engines/mads/nebular/nebular_scenes.h +++ b/engines/mads/nebular/nebular_scenes.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index c9eda08859..fd97f71727 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes1.h b/engines/mads/nebular/nebular_scenes1.h index 1afa7fccc1..d8c9059846 100644 --- a/engines/mads/nebular/nebular_scenes1.h +++ b/engines/mads/nebular/nebular_scenes1.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 84910c4de3..1cbd6f56ef 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes2.h b/engines/mads/nebular/nebular_scenes2.h index c860db9470..0ea4702eea 100644 --- a/engines/mads/nebular/nebular_scenes2.h +++ b/engines/mads/nebular/nebular_scenes2.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 4e7781e7a2..5a6edbf995 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes3.h b/engines/mads/nebular/nebular_scenes3.h index 9efd38e9a4..cf925b3867 100644 --- a/engines/mads/nebular/nebular_scenes3.h +++ b/engines/mads/nebular/nebular_scenes3.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp index 29b17c42c0..c981f6a6e4 100644 --- a/engines/mads/nebular/nebular_scenes4.cpp +++ b/engines/mads/nebular/nebular_scenes4.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes4.h b/engines/mads/nebular/nebular_scenes4.h index fbd5ce81f0..de11bd4129 100644 --- a/engines/mads/nebular/nebular_scenes4.h +++ b/engines/mads/nebular/nebular_scenes4.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 2470137b2e..95eb429193 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes5.h b/engines/mads/nebular/nebular_scenes5.h index 2face26508..f314ae8513 100644 --- a/engines/mads/nebular/nebular_scenes5.h +++ b/engines/mads/nebular/nebular_scenes5.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index d94fb17fd4..d97e37ea0b 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes6.h b/engines/mads/nebular/nebular_scenes6.h index c5cac56626..4fc4a2e8ae 100644 --- a/engines/mads/nebular/nebular_scenes6.h +++ b/engines/mads/nebular/nebular_scenes6.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index b40a8054f7..c2a249e5f8 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes7.h b/engines/mads/nebular/nebular_scenes7.h index dfb3c0f16e..b5aeba818c 100644 --- a/engines/mads/nebular/nebular_scenes7.h +++ b/engines/mads/nebular/nebular_scenes7.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 5f8417cee1..a904569624 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/nebular_scenes8.h b/engines/mads/nebular/nebular_scenes8.h index 7f2c34a843..439815f05c 100644 --- a/engines/mads/nebular/nebular_scenes8.h +++ b/engines/mads/nebular/nebular_scenes8.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp index 9716e6d522..240c18f6dc 100644 --- a/engines/mads/nebular/sound_nebular.cpp +++ b/engines/mads/nebular/sound_nebular.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h index d2fc552eec..9bc1a49458 100644 --- a/engines/mads/nebular/sound_nebular.h +++ b/engines/mads/nebular/sound_nebular.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index b5ea136abd..36c9e5694f 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/palette.h b/engines/mads/palette.h index 5d3bc3a82e..6c98947384 100644 --- a/engines/mads/palette.h +++ b/engines/mads/palette.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp index 0b2531ef65..cbeb6b0d26 100644 --- a/engines/mads/phantom/game_phantom.cpp +++ b/engines/mads/phantom/game_phantom.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/phantom/game_phantom.h b/engines/mads/phantom/game_phantom.h index 99cc2c1230..5504054bcf 100644 --- a/engines/mads/phantom/game_phantom.h +++ b/engines/mads/phantom/game_phantom.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/phantom/phantom_scenes.cpp b/engines/mads/phantom/phantom_scenes.cpp index 7fd7ce642d..c2cec47bd9 100644 --- a/engines/mads/phantom/phantom_scenes.cpp +++ b/engines/mads/phantom/phantom_scenes.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/phantom/phantom_scenes.h b/engines/mads/phantom/phantom_scenes.h index cd295a28b6..0e22610086 100644 --- a/engines/mads/phantom/phantom_scenes.h +++ b/engines/mads/phantom/phantom_scenes.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index f61a5a1592..bb747f4b52 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/player.h b/engines/mads/player.h index 671ac9d16e..e5765a9bca 100644 --- a/engines/mads/player.h +++ b/engines/mads/player.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/rails.cpp b/engines/mads/rails.cpp index 322e6e7cb3..9b2ec71de6 100644 --- a/engines/mads/rails.cpp +++ b/engines/mads/rails.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/rails.h b/engines/mads/rails.h index e6cab08f85..c95f5c47a6 100644 --- a/engines/mads/rails.h +++ b/engines/mads/rails.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/resources.cpp b/engines/mads/resources.cpp index 1fb75e6ba2..d5352fb205 100644 --- a/engines/mads/resources.cpp +++ b/engines/mads/resources.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/resources.h b/engines/mads/resources.h index 8d9ab1e39f..95ea17d3c4 100644 --- a/engines/mads/resources.h +++ b/engines/mads/resources.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 463d4a62fd..5662d8349a 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/scene.h b/engines/mads/scene.h index 5927f4e70f..c0784c3812 100644 --- a/engines/mads/scene.h +++ b/engines/mads/scene.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 3e2fe22611..3c27001ae0 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/screen.h b/engines/mads/screen.h index 85c55419ca..d910e88633 100644 --- a/engines/mads/screen.h +++ b/engines/mads/screen.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp index ba0111a844..e5bf1631c2 100644 --- a/engines/mads/sequence.cpp +++ b/engines/mads/sequence.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/sequence.h b/engines/mads/sequence.h index 8b236af15e..c3a277c5a5 100644 --- a/engines/mads/sequence.h +++ b/engines/mads/sequence.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp index 4036ee8112..7b9388eee3 100644 --- a/engines/mads/sound.cpp +++ b/engines/mads/sound.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/sound.h b/engines/mads/sound.h index 5884323474..16128f8284 100644 --- a/engines/mads/sound.h +++ b/engines/mads/sound.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index f15d6456d3..0a1c0b710d 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/sprites.h b/engines/mads/sprites.h index bb5fdbe964..3db922c40b 100644 --- a/engines/mads/sprites.h +++ b/engines/mads/sprites.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/staticres.cpp b/engines/mads/staticres.cpp index 189e5f72e7..b659d9a27c 100644 --- a/engines/mads/staticres.cpp +++ b/engines/mads/staticres.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/staticres.h b/engines/mads/staticres.h index 560fd12e67..b805729327 100644 --- a/engines/mads/staticres.h +++ b/engines/mads/staticres.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 1e5a1d80d2..62fd036c03 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/mads/user_interface.h b/engines/mads/user_interface.h index 71c6f64c2a..1366aa2c32 100644 --- a/engines/mads/user_interface.h +++ b/engines/mads/user_interface.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 3c9a5f02d2555dec0b2e2192a6ae96a224f05d50 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 31 May 2015 09:21:23 +0200 Subject: MADS: Remove unnecessary semicolon --- engines/mads/palette.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mads') diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 36c9e5694f..7651fe8e65 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -497,7 +497,7 @@ void Fader::fadeIn(byte palette[PALETTE_SIZE], byte destPalette[PALETTE_SIZE], int baseColor, int numColors, int baseGrey, int numGreys, int tickDelay, int steps) { GreyEntry map[PALETTE_COUNT]; - byte tempPal[PALETTE_SIZE];; + byte tempPal[PALETTE_SIZE]; int8 signs[PALETTE_COUNT][3]; byte palIndex[PALETTE_COUNT][3]; int intensity; -- cgit v1.2.3