From 79dd3274111132eb89fe104406110541bf2329de Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 16 Sep 2013 05:45:56 +0300 Subject: FULLPIPE: Fix cheat codes. Bug in original? --- engines/fullpipe/fullpipe.cpp | 2 +- engines/fullpipe/input.cpp | 1 - engines/fullpipe/scenes.cpp | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 6a4a587ff7..99de4dc0d4 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -260,7 +260,7 @@ void FullpipeEngine::updateEvents() { } ex = new ExCommand(0, 17, 36, 0, 0, 0, 1, 0, 0, 0); - ex->_keyCode = 83; + ex->_keyCode = event.kbd.keycode; ex->_excFlags |= 3; ex->handle(); break; diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp index c4af54ddc3..dfd8d32168 100644 --- a/engines/fullpipe/input.cpp +++ b/engines/fullpipe/input.cpp @@ -165,7 +165,6 @@ void FullpipeEngine::defHandleKeyDown(int key) { return; } - warning("%d %d", _currentCheat, _currentCheatPos); if (toupper(key) != input_cheats[_currentCheat][_currentCheatPos]) { _currentCheat = -1; diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index f6620a2fc7..c9cdc0a3d8 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -731,6 +731,8 @@ int global_messageHandler1(ExCommand *cmd) { } break; case 36: // keydown + g_fullpipe->defHandleKeyDown(cmd->_keyCode); + switch (cmd->_keyCode) { case '\x1B': // ESC if (g_fullpipe->_currentScene) { @@ -768,7 +770,6 @@ int global_messageHandler1(ExCommand *cmd) { cmd->_messageKind = 0; break; default: - g_fullpipe->defHandleKeyDown(cmd->_keyCode); break; } break; -- cgit v1.2.3 From ac66cc921904387518f2e0b2a14670e9598defe4 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 11 Aug 2013 23:36:57 +0200 Subject: GRAPHICS: Implement JPEGDecoder based on libjpeg. --- engines/configure.engines | 4 ++-- engines/groovie/roq.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/configure.engines b/engines/configure.engines index 963b9f774f..8111cd0fb4 100644 --- a/engines/configure.engines +++ b/engines/configure.engines @@ -15,7 +15,7 @@ add_engine drascula "Drascula: The Vampire Strikes Back" yes add_engine dreamweb "Dreamweb" yes add_engine gob "Gobli*ns" yes add_engine groovie "Groovie" yes "groovie2" "7th Guest" -add_engine groovie2 "Groovie 2 games" no +add_engine groovie2 "Groovie 2 games" no "" "" "jpeg" add_engine hopkins "Hopkins FBI" yes "" "" "16bit" add_engine hugo "Hugo Trilogy" yes add_engine kyra "Kyra" yes "lol eob" "Legend of Kyrandia 1-3" @@ -51,4 +51,4 @@ add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes add_engine tony "Tony Tough and the Night of Roasted Moths" yes "" "" "16bit" add_engine tsage "TsAGE" yes add_engine tucker "Bud Tucker in Double Trouble" yes -add_engine wintermute "Wintermute" no "" "" "png zlib vorbis 16bit" +add_engine wintermute "Wintermute" no "" "" "jpeg png zlib vorbis 16bit" diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index f9a938bfd4..d9c682b98a 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -436,9 +436,9 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { Graphics::JPEGDecoder *jpg = new Graphics::JPEGDecoder(); jpg->loadStream(*_file); - const byte *y = (const byte *)jpg->getComponent(1)->getPixels(); - const byte *u = (const byte *)jpg->getComponent(2)->getPixels(); - const byte *v = (const byte *)jpg->getComponent(3)->getPixels(); + const byte *y = (const byte *)jpg->getYComponent().getPixels(); + const byte *u = (const byte *)jpg->getUComponent().getPixels(); + const byte *v = (const byte *)jpg->getVComponent().getPixels(); byte *ptr = (byte *)_currBuf->getPixels(); for (int i = 0; i < _currBuf->w * _currBuf->h; i++) { -- cgit v1.2.3 From 4809294b43e1c43957874bdfcdadfc299fd7ace4 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 12 Aug 2013 00:53:34 +0200 Subject: GRAPHICS: Make JPEGDecoder request RGB output from libjpeg by default. This fixes loading of JPEG files which contain RGB color space instead of YUV. It is a pretty odd extension of JPEG files by Adobe which is indicated by this: http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/JPEG.html#Adobe To still support Groovie's need for YUV data I added some possibility to request direct YUV output. --- engines/groovie/roq.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index d9c682b98a..5592d848a9 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -435,17 +435,13 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { warning("Groovie::ROQ: JPEG frame (unfinished)"); Graphics::JPEGDecoder *jpg = new Graphics::JPEGDecoder(); + jpg->setOutputColorSpace(Graphics::JPEGDecoder::kColorSpaceYUV); jpg->loadStream(*_file); - const byte *y = (const byte *)jpg->getYComponent().getPixels(); - const byte *u = (const byte *)jpg->getUComponent().getPixels(); - const byte *v = (const byte *)jpg->getVComponent().getPixels(); + const Graphics::Surface *srcSurf = jpg->getSurface(); + const byte *src = (const byte *)srcSurf->getPixels(); byte *ptr = (byte *)_currBuf->getPixels(); - for (int i = 0; i < _currBuf->w * _currBuf->h; i++) { - *ptr++ = *y++; - *ptr++ = *u++; - *ptr++ = *v++; - } + memcpy(ptr, src, _currBuf->w * _currBuf->h); delete jpg; return true; -- cgit v1.2.3 From ce63a325103234a0bd382891b81a7a6ac4f857a2 Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Mon, 16 Sep 2013 21:07:49 +0200 Subject: SCI: QfG1VGA: script patch to fix a typo in a Sierra script -> looking at a cheetaur returned the text for saurus rex, fixes bug #3604943 --- engines/sci/engine/script_patches.cpp | 36 +++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index d4dddb6faf..6dbdd2baf5 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -995,14 +995,38 @@ const uint16 qfg1vgaPatchMoveToCastleGate[] = { PATCH_END }; +// Typo in the original Sierra scripts +// Looking at a cheetaur resulted in a text about a Saurus Rex +// Code is in smallMonster::doVerb. It treats both monster +// types the same. We fix this. Fixes bug #3604943. +const byte qfg1vgaSignatureCheetaurDescription[] = { + 16, + 0x34, 0xb8, 0x01, // ldi 01b8 + 0x1a, // eq? + 0x31, 0x16, // bnt 16 + 0x38, 0x27, 0x01, // pushi 0127 + 0x39, 0x06, // pushi 06 + 0x39, 0x03, // pushi 03 + 0x78, // push1 + 0x39, 0x12, // pushi 12 -> monster type Saurus Rex + 0 +}; + +const uint16 qfg1vgaPatchCheetaurDescription[] = { + PATCH_ADDTOOFFSET | +14, + 0x39, 0x11, // pushi 11 -> monster type cheetaur + PATCH_END +}; + // script, description, magic DWORD, adjust const SciScriptSignature qfg1vgaSignatures[] = { - { 215, "fight event issue", 1, PATCH_MAGICDWORD(0x6d, 0x76, 0x51, 0x07), -1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents }, - { 216, "weapon master event issue", 1, PATCH_MAGICDWORD(0x6d, 0x76, 0x51, 0x07), -1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents }, - { 814, "window text temp space", 1, PATCH_MAGICDWORD(0x3f, 0xba, 0x87, 0x00), 0, qfg1vgaSignatureTempSpace, qfg1vgaPatchTempSpace }, - { 814, "dialog header offset", 3, PATCH_MAGICDWORD(0x5b, 0x04, 0x80, 0x36), 0, qfg1vgaSignatureDialogHeader, qfg1vgaPatchDialogHeader }, - { 331, "moving to crusher", 1, PATCH_MAGICDWORD(0x51, 0x1f, 0x36, 0x39), 0, qfg1vgaSignatureMoveToCrusher, qfg1vgaPatchMoveToCrusher }, - { 41, "moving to castle gate", 1, PATCH_MAGICDWORD(0x51, 0x1f, 0x36, 0x39), 0, qfg1vgaSignatureMoveToCastleGate, qfg1vgaPatchMoveToCastleGate }, + { 215, "fight event issue", 1, PATCH_MAGICDWORD(0x6d, 0x76, 0x51, 0x07), -1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents }, + { 216, "weapon master event issue", 1, PATCH_MAGICDWORD(0x6d, 0x76, 0x51, 0x07), -1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents }, + { 814, "window text temp space", 1, PATCH_MAGICDWORD(0x3f, 0xba, 0x87, 0x00), 0, qfg1vgaSignatureTempSpace, qfg1vgaPatchTempSpace }, + { 814, "dialog header offset", 3, PATCH_MAGICDWORD(0x5b, 0x04, 0x80, 0x36), 0, qfg1vgaSignatureDialogHeader, qfg1vgaPatchDialogHeader }, + { 331, "moving to crusher", 1, PATCH_MAGICDWORD(0x51, 0x1f, 0x36, 0x39), 0, qfg1vgaSignatureMoveToCrusher, qfg1vgaPatchMoveToCrusher }, + { 41, "moving to castle gate", 1, PATCH_MAGICDWORD(0x51, 0x1f, 0x36, 0x39), 0, qfg1vgaSignatureMoveToCastleGate, qfg1vgaPatchMoveToCastleGate }, + { 210, "cheetaur description fixed", 1, PATCH_MAGICDWORD(0x34, 0xb8, 0x01, 0x1a), 0, qfg1vgaSignatureCheetaurDescription, qfg1vgaPatchCheetaurDescription }, SCI_SIGNATUREENTRY_TERMINATOR }; -- cgit v1.2.3 From 960320ddb73e0752131bb22f0faa0b6f0270f694 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 17 Sep 2013 02:13:39 +0200 Subject: BUILD: Disable Full Pipe engine by default. The engine is still WIP and should not be enabled yet. --- engines/configure.engines | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/configure.engines b/engines/configure.engines index 3c7397fcba..20e5a56ef1 100644 --- a/engines/configure.engines +++ b/engines/configure.engines @@ -13,7 +13,7 @@ add_engine cruise "Cinematique evo 2" yes add_engine draci "Dragon History" yes add_engine drascula "Drascula: The Vampire Strikes Back" yes add_engine dreamweb "Dreamweb" yes -add_engine fullpipe "Full Pipe" yes +add_engine fullpipe "Full Pipe" no add_engine gob "Gobli*ns" yes add_engine groovie "Groovie" yes "groovie2" "7th Guest" add_engine groovie2 "Groovie 2 games" no "" "" "jpeg" -- cgit v1.2.3 From c1226b7d4a305dba7b62b046be4d3fe728a8209d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 17 Sep 2013 03:25:36 +0300 Subject: NEVERHOOD: Split the code that stops all music and sound effects --- engines/neverhood/gamemodule.cpp | 2 ++ engines/neverhood/sound.cpp | 36 ++++++++++++++++++++++-------------- engines/neverhood/sound.h | 2 ++ 3 files changed, 26 insertions(+), 14 deletions(-) (limited to 'engines') diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index 47cc818fea..50c7c503d3 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -411,7 +411,9 @@ void GameModule::checkRequests() { } if (_restoreGameRequested) { _restoreGameRequested = false; + _vm->_audioResourceMan->stopAllMusic(); _vm->_audioResourceMan->stopAllSounds(); + _vm->_soundMan->stopAllMusic(); _vm->_soundMan->stopAllSounds(); delete _childObject; delete _prevChildObject; diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp index c3bc3501b5..1fd09674a2 100644 --- a/engines/neverhood/sound.cpp +++ b/engines/neverhood/sound.cpp @@ -254,9 +254,20 @@ SoundMan::SoundMan(NeverhoodEngine *vm) } SoundMan::~SoundMan() { + stopAllMusic(); stopAllSounds(); } +void SoundMan::stopAllMusic() { + for (uint i = 0; i < _musicItems.size(); ++i) { + if (_musicItems[i]) { + _musicItems[i]->stopMusic(0, 0); + delete _musicItems[i]; + _musicItems[i] = NULL; + } + } +} + void SoundMan::stopAllSounds() { for (uint i = 0; i < _soundItems.size(); ++i) { if (_soundItems[i]) { @@ -265,13 +276,6 @@ void SoundMan::stopAllSounds() { _soundItems[i] = NULL; } } - for (uint i = 0; i < _musicItems.size(); ++i) { - if (_musicItems[i]) { - _musicItems[i]->stopMusic(0, 0); - delete _musicItems[i]; - _musicItems[i] = NULL; - } - } _soundIndex1 = _soundIndex2 = _soundIndex3 = -1; } @@ -724,6 +728,16 @@ AudioResourceMan::AudioResourceMan(NeverhoodEngine *vm) : _vm(vm) { } +void AudioResourceMan::stopAllMusic() { + for (uint i = 0; i < _musicItems.size(); ++i) { + if (_musicItems[i]) { + _musicItems[i]->stopMusic(0); + delete _musicItems[i]; + _musicItems[i] = NULL; + } + } +} + void AudioResourceMan::stopAllSounds() { for (uint i = 0; i < _soundItems.size(); ++i) { if (_soundItems[i]) { @@ -732,16 +746,10 @@ void AudioResourceMan::stopAllSounds() { _soundItems[i] = NULL; } } - for (uint i = 0; i < _musicItems.size(); ++i) { - if (_musicItems[i]) { - _musicItems[i]->stopMusic(0); - delete _musicItems[i]; - _musicItems[i] = NULL; - } - } } AudioResourceMan::~AudioResourceMan() { + stopAllMusic(); stopAllSounds(); } diff --git a/engines/neverhood/sound.h b/engines/neverhood/sound.h index 0733346daa..548fe88501 100644 --- a/engines/neverhood/sound.h +++ b/engines/neverhood/sound.h @@ -129,6 +129,7 @@ public: SoundMan(NeverhoodEngine *vm); ~SoundMan(); + void stopAllMusic(); void stopAllSounds(); // Music @@ -264,6 +265,7 @@ public: AudioResourceMan(NeverhoodEngine *vm); ~AudioResourceMan(); + void stopAllMusic(); void stopAllSounds(); int16 addSound(uint32 fileHash); -- cgit v1.2.3 From 783aa9977c544c7e63aef3dac4fff85abcb682ce Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 17 Sep 2013 03:26:12 +0300 Subject: NEVERHOOD: Implement the music toggle menu button --- engines/neverhood/menumodule.cpp | 7 ++++--- engines/neverhood/menumodule.h | 1 - engines/neverhood/neverhood.cpp | 1 + engines/neverhood/neverhood.h | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp index 7bf64a4602..86434452f5 100644 --- a/engines/neverhood/menumodule.cpp +++ b/engines/neverhood/menumodule.cpp @@ -160,7 +160,8 @@ void MenuModule::updateScene() { createScene(MAKING_OF, -1); break; case kMainMenuToggleMusic: - // TODO Toggle music 0048A367 + _vm->toggleMusic(!_vm->musicIsEnabled()); + _vm->_mixer->muteSoundType(Audio::Mixer::kMusicSoundType, !_vm->musicIsEnabled()); createScene(MAIN_MENU, -1); break; case kMainMenuDeleteGame: @@ -356,8 +357,8 @@ MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule) insertStaticSprite(0x41137051, 100); insertStaticSprite(0xC10B2015, 100); - // TODO Only if music is enabled - _musicOnButton = insertStaticSprite(0x0C24C0EE, 100); + if (!_vm->musicIsEnabled()) + insertStaticSprite(0x0C24C0EE, 100); // "Music is off" button for (uint buttonIndex = 0; buttonIndex < 9; ++buttonIndex) { Sprite *menuButton = insertSprite(this, buttonIndex, diff --git a/engines/neverhood/menumodule.h b/engines/neverhood/menumodule.h index f201654ceb..9da9c849a9 100644 --- a/engines/neverhood/menumodule.h +++ b/engines/neverhood/menumodule.h @@ -79,7 +79,6 @@ class MainMenu : public Scene { public: MainMenu(NeverhoodEngine *vm, Module *parentModule); protected: - Sprite *_musicOnButton; uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); }; diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp index 061e6d1279..1fb32a1834 100644 --- a/engines/neverhood/neverhood.cpp +++ b/engines/neverhood/neverhood.cpp @@ -109,6 +109,7 @@ Common::Error NeverhoodEngine::run() { _isSaveAllowed = true; _updateSound = true; + _enableMusic = !_mixer->isSoundTypeMuted(Audio::Mixer::kMusicSoundType); if (isDemo()) { // Adjust this navigation list for the demo version diff --git a/engines/neverhood/neverhood.h b/engines/neverhood/neverhood.h index 5643e345ad..9b65f6740e 100644 --- a/engines/neverhood/neverhood.h +++ b/engines/neverhood/neverhood.h @@ -135,9 +135,12 @@ public: NPoint getMousePos(); void toggleSoundUpdate(bool state) { _updateSound = state; } + void toggleMusic(bool state) { _enableMusic = state; } + bool musicIsEnabled() { return _enableMusic; } private: bool _updateSound; + bool _enableMusic; }; -- cgit v1.2.3 From b88293914106fc3b9e503412ab72b030ea0960de Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 16 Sep 2013 20:56:59 -0400 Subject: GROOVIE: Fix ROQ JPEG decoding --- engines/groovie/roq.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 5592d848a9..e1ca7fb945 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -28,6 +28,7 @@ #include "groovie/groovie.h" #include "common/debug.h" +#include "common/substream.h" #include "common/textconsole.h" #include "graphics/palette.h" @@ -436,14 +437,19 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { Graphics::JPEGDecoder *jpg = new Graphics::JPEGDecoder(); jpg->setOutputColorSpace(Graphics::JPEGDecoder::kColorSpaceYUV); - jpg->loadStream(*_file); + + uint32 startPos = _file->pos(); + Common::SeekableSubReadStream subStream(_file, startPos, startPos + blockHeader.size, DisposeAfterUse::NO); + jpg->loadStream(subStream); const Graphics::Surface *srcSurf = jpg->getSurface(); const byte *src = (const byte *)srcSurf->getPixels(); byte *ptr = (byte *)_currBuf->getPixels(); - memcpy(ptr, src, _currBuf->w * _currBuf->h); + memcpy(ptr, src, _currBuf->w * _currBuf->h * srcSurf->format.bytesPerPixel); delete jpg; + + _file->seek(startPos + blockHeader.size); return true; } -- cgit v1.2.3 From 615f352576a65f571eb6abb0aa571bb31289d6f2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 16 Sep 2013 21:40:41 -0400 Subject: TSAGE: Fixes and renaming for R2R forest --- engines/tsage/ringworld2/ringworld2_logic.cpp | 7 +- engines/tsage/ringworld2/ringworld2_scenes2.cpp | 240 ++++++++++++----------- engines/tsage/ringworld2/ringworld2_scenes2.h | 41 ++-- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 2 +- engines/tsage/ringworld2/ringworld2_speakers.cpp | 8 +- 5 files changed, 154 insertions(+), 144 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 013abfa4a4..9c50d810fc 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -215,13 +215,13 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Spill Mountains: Exit return new Scene2600(); case 2700: - // Forest Maze + // Outer Forest return new Scene2700(); case 2750: - // Forest Maze + // Inner Forest return new Scene2750(); case 2800: - // Exiting Forest + // Guard post return new Scene2800(); case 2900: // Balloon Cutscene @@ -297,6 +297,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Desert return new Scene3800(); case 3900: + // Forest Entrance return new Scene3900(); default: error("Unknown scene number - %d", sceneNumber); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 3eac2bffe1..c6a4729b7a 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -3022,11 +3022,19 @@ void Scene2600::signal() { } /*-------------------------------------------------------------------------- - * Scene 2700 - Forest Maze + * Scene 2700 - Outer Forest * *--------------------------------------------------------------------------*/ + Scene2700::Scene2700(): SceneExt() { _field412 = _field414 = _field416 = 0; + + _walkRect1.set(70, 122, 90, 132); + _walkRect2.set(150, 122, 160, 132); + _walkRect3.set(90, 142, 130, 157); + _walkRect4.set(175, 137, 200, 147); + _walkRect5.set(280, 127, 300, 137); + _walkRect6.set(240, 157, 265, 167); } void Scene2700::synchronize(Serializer &s) { @@ -3041,28 +3049,28 @@ void Scene2700::Action1::signal() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; setDelay(600 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor2.animate(ANIM_MODE_5, NULL); + scene->_ghoulHome6.animate(ANIM_MODE_5, NULL); } void Scene2700::Action2::signal() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; setDelay(300 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor3.animate(ANIM_MODE_5, NULL); + scene->_ghoulHome7.animate(ANIM_MODE_5, NULL); } void Scene2700::Action3::signal() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; setDelay(450 + R2_GLOBALS._randomSource.getRandomNumber(450)); - scene->_actor4.animate(ANIM_MODE_8, 1, NULL); + scene->_ghoulHome8.animate(ANIM_MODE_8, 1, NULL); } void Scene2700::Action4::signal() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; setDelay(300 + R2_GLOBALS._randomSource.getRandomNumber(300)); - scene->_actor5.animate(ANIM_MODE_8, 1, NULL); + scene->_ghoulHome9.animate(ANIM_MODE_8, 1, NULL); } void Scene2700::Area1::process(Event &event) { @@ -3177,39 +3185,33 @@ void Scene2700::postInit(SceneObjectList *OwnerList) { _area1.setDetails(Rect(135, 160, 185, 168), SHADECURSOR_DOWN); _area2.setDetails(Rect(300, 90, 320, 135), EXITCURSOR_E); - _rect1.set(70, 122, 90, 132); - _rect2.set(150, 122, 160, 132); - _rect3.set(90, 142, 130, 157); - _rect4.set(175, 137, 200, 147); - _rect5.set(280, 127, 300, 137); - _rect6.set(240, 157, 265, 167); - - _actor2.postInit(); - _actor2.setup(2700, 1, 1); - _actor2.setPosition(Common::Point(140, 29)); - _actor2.setAction(&_action1); - _actor3.postInit(); - _actor3.setup(2700, 2, 1); - _actor3.setPosition(Common::Point(213, 32)); - _actor3.setAction(&_action2); - - _actor4.postInit(); - _actor4.setup(2700, 3, 1); - _actor4.setPosition(Common::Point(17, 39)); - _actor4.setAction(&_action3); - - _actor5.postInit(); - _actor5.setup(2700, 5, 1); - _actor5.setPosition(Common::Point(17, 71)); - _actor5.setAction(&_action4); - - _item2.setDetails(Rect(52, 38, 68, 60), 2700, 4, -1, 6, 1, NULL); - _item3.setDetails(Rect(113, 22, 127, 33), 2700, 4, -1, 6, 1, NULL); - _item4.setDetails(Rect(161, 44, 170, 52), 2700, 4, -1, 6, 1, NULL); - _item5.setDetails(Rect(221, 19, 233, 31), 2700, 4, -1, 6, 1, NULL); - _item6.setDetails(Rect(235, 59, 250, 75), 2700, 4, -1, 6, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2700, 4, -1, 6, 1, NULL); + _ghoulHome6.postInit(); + _ghoulHome6.setup(2700, 1, 1); + _ghoulHome6.setPosition(Common::Point(140, 29)); + _ghoulHome6.setAction(&_action1); + + _ghoulHome7.postInit(); + _ghoulHome7.setup(2700, 2, 1); + _ghoulHome7.setPosition(Common::Point(213, 32)); + _ghoulHome7.setAction(&_action2); + + _ghoulHome8.postInit(); + _ghoulHome8.setup(2700, 3, 1); + _ghoulHome8.setPosition(Common::Point(17, 39)); + _ghoulHome8.setAction(&_action3); + + _ghoulHome9.postInit(); + _ghoulHome9.setup(2700, 5, 1); + _ghoulHome9.setPosition(Common::Point(17, 71)); + _ghoulHome9.setAction(&_action4); + + _ghoulHome1.setDetails(Rect(52, 38, 68, 60), 2700, 4, -1, 6, 1, NULL); + _ghoulHome2.setDetails(Rect(113, 22, 127, 33), 2700, 4, -1, 6, 1, NULL); + _ghoulHome3.setDetails(Rect(161, 44, 170, 52), 2700, 4, -1, 6, 1, NULL); + _ghoulHome4.setDetails(Rect(221, 19, 233, 31), 2700, 4, -1, 6, 1, NULL); + _ghoulHome5.setDetails(Rect(235, 59, 250, 75), 2700, 4, -1, 6, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2700, 4, -1, 6, 1, NULL); _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -3467,31 +3469,31 @@ void Scene2700::signal() { R2_GLOBALS._player.disableControl(); _field412 = 0; _sceneMode = 2700; - setAction(&_sequenceManager, this, 2700, &_actor1, NULL); + setAction(&_sequenceManager, this, 2700, &_nej, NULL); break; case 12: R2_GLOBALS._sound1.play(234); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2711; _stripManager.start(_field416, this); break; case 13: - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2712; _stripManager.start(_field416, this); break; case 14: - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 2713; _stripManager.start(_field416, this); break; case 15: - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _sceneMode = 11; _stripManager.start(_field416, this); break; case 2700: - _actor1.remove(); + _nej.remove(); R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 2703: @@ -3501,28 +3503,29 @@ void Scene2700::signal() { g_globals->_sceneManager.changeScene(2750); break; case 2710: + // Start of Nej assault _field416 = 1200; _sceneMode = 12; - _actor1.postInit(); - setAction(&_sequenceManager, this, 2710, &R2_GLOBALS._player, &_actor1, NULL); + _nej.postInit(); + setAction(&_sequenceManager, this, 2710, &R2_GLOBALS._player, &_nej, NULL); break; case 2711: R2_GLOBALS._player.disableControl(); _field416 = 1201; _sceneMode = 13; - setAction(&_sequenceManager, this, 2711, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 2711, &R2_GLOBALS._player, &_nej, NULL); break; case 2712: R2_GLOBALS._player.disableControl(); _field416 = 1202; _sceneMode = 14; - setAction(&_sequenceManager, this, 2712, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 2712, &R2_GLOBALS._player, &_nej, NULL); break; case 2713: R2_GLOBALS._player.disableControl(); _field416 = 1203; - _sceneMode = 14; - setAction(&_sequenceManager, this, 2713, &R2_GLOBALS._player, &_actor1, NULL); + _sceneMode = 15; + setAction(&_sequenceManager, this, 2713, &R2_GLOBALS._player, &_nej, NULL); break; default: R2_GLOBALS._player.enableControl(CURSOR_WALK); @@ -3536,7 +3539,8 @@ void Scene2700::process(Event &event) { _sceneMode = 10; _field414 = 2710; R2_GLOBALS._player.disableControl(); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); + switch (_field412) { case 0: { _sceneMode = 2710; @@ -3584,43 +3588,44 @@ void Scene2700::process(Event &event) { default: break; } - event.handled = true; } else { SceneItem::display(2700, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } - } else if (R2_GLOBALS._events.getCursor() == R2_NEGATOR_GUN) { - if (_rect1.contains(event.mousePos)) { - if (!_rect1.contains(R2_GLOBALS._player._position)) { + + event.handled = true; + } else if (R2_GLOBALS._events.getCursor() == CURSOR_WALK) { + if (_walkRect1.contains(event.mousePos)) { + if (!_walkRect1.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 1; } - } else if (_rect2.contains(event.mousePos)) { - if (!_rect2.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect2.contains(event.mousePos)) { + if (!_walkRect2.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 2; } - } else if (_rect3.contains(event.mousePos)) { - if (!_rect3.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect3.contains(event.mousePos)) { + if (!_walkRect3.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 3; } - } else if (_rect4.contains(event.mousePos)) { - if (!_rect4.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect4.contains(event.mousePos)) { + if (!_walkRect4.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 4; } - } else if (_rect5.contains(event.mousePos)) { - if (!_rect5.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect5.contains(event.mousePos)) { + if (!_walkRect5.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 5; } - } else if (_rect6.contains(event.mousePos)) { - if (!_rect6.contains(R2_GLOBALS._player._position)) { + } else if (_walkRect6.contains(event.mousePos)) { + if (!_walkRect6.contains(R2_GLOBALS._player._position)) { event.handled = true; _sceneMode = 10; _field414 = 6; @@ -3703,9 +3708,10 @@ void Scene2700::process(Event &event) { } /*-------------------------------------------------------------------------- - * Scene 2750 - Forest Maze + * Scene 2750 - Inner Forest * *--------------------------------------------------------------------------*/ + Scene2750::Scene2750(): SceneExt() { _field412 = _field414 = _field416 = 0; } @@ -3929,11 +3935,11 @@ void Scene2750::postInit(SceneObjectList *OwnerList) { _actor11.setPosition(Common::Point(80, 35)); _actor11.setAction(&_action7); - _item2.setDetails(Rect(29, 50, 35, 56), 2750, 3, -1, 5, 1, NULL); - _item3.setDetails(Rect(47, 36, 54, 42), 2750, 3, -1, 5, 1, NULL); - _item4.setDetails(Rect(193, 21, 206, 34), 2750, 3, -1, 5, 1, NULL); - _item5.setDetails(Rect(301, 18, 315, 32), 2750, 3, -1, 5, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2700, 0, -1, 2, 1, NULL); + _ghoulHome1.setDetails(Rect(29, 50, 35, 56), 2750, 3, -1, 5, 1, NULL); + _ghoulHome2.setDetails(Rect(47, 36, 54, 42), 2750, 3, -1, 5, 1, NULL); + _ghoulHome3.setDetails(Rect(193, 21, 206, 34), 2750, 3, -1, 5, 1, NULL); + _ghoulHome4.setDetails(Rect(301, 18, 315, 32), 2750, 3, -1, 5, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2700, 0, -1, 2, 1, NULL); _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -3941,10 +3947,10 @@ void Scene2750::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_nejSpeaker); if (R2_INVENTORY.getObjectScene(R2_FLUTE) == 0) { - _actor1.postInit(); - _actor1.setup(2752, 5, 1); - _actor1.animate(ANIM_MODE_NONE, NULL); - _actor1.setPosition(Common::Point(101, 148)); + _nej.postInit(); + _nej.setup(2752, 5, 1); + _nej.animate(ANIM_MODE_NONE, NULL); + _nej.setPosition(Common::Point(101, 148)); } R2_GLOBALS._player.postInit(); @@ -3959,7 +3965,7 @@ void Scene2750::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setStrip(6); R2_GLOBALS._player.animate(ANIM_MODE_NONE, NULL); R2_GLOBALS._player.setPosition(Common::Point(81, 165)); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _field416 = 1204; _sceneMode = 11; _stripManager.start(_field416, this); @@ -4094,7 +4100,7 @@ void Scene2750::signal() { g_globals->_sceneManager.changeScene(2700); break; default: - R2_GLOBALS._player.enableControl(R2_NEGATOR_GUN); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } @@ -4159,9 +4165,10 @@ void Scene2750::process(Event &event) { } /*-------------------------------------------------------------------------- - * Scene 2800 - Exiting forest + * Scene 2800 - Guard post * *--------------------------------------------------------------------------*/ + Scene2800::Scene2800(): SceneExt() { _field412 = 0; } @@ -4184,12 +4191,12 @@ bool Scene2800::Item2::startAction(CursorType action, Event &event) { return SceneHotspot::startAction(action, event); } -bool Scene2800::Actor1::startAction(CursorType action, Event &event) { +bool Scene2800::Guard::startAction(CursorType action, Event &event) { Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; if (action == CURSOR_TALK) { R2_GLOBALS._player.disableControl(); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS.setFlag(47); scene->_field412 = 1205; scene->_sceneMode = 2803; @@ -4200,7 +4207,7 @@ bool Scene2800::Actor1::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); R2_GLOBALS.setFlag(47); scene->_sceneMode = 10; - scene->setAction(&scene->_sequenceManager, scene, 2802, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2802, &R2_GLOBALS._player, &scene->_actor2, &scene->_guard, NULL); return true; } else return SceneActor::startAction(action, event); @@ -4271,37 +4278,37 @@ void Scene2800::Action2::signal() { case 4: setDelay(18); _object4.setStrip(4); - scene->_actor1.setVisage(2800); - scene->_actor1.setStrip(5); - scene->_actor1.setFrame(1); - scene->_actor1._numFrames = 5; - scene->_actor1._moveRate = 5; - scene->_actor1.setPosition(Common::Point(300, 104)); - scene->_actor1.fixPriority(110); - scene->_actor1.changeZoom(100); - scene->_actor1.show(); + scene->_guard.setVisage(2800); + scene->_guard.setStrip(5); + scene->_guard.setFrame(1); + scene->_guard._numFrames = 5; + scene->_guard._moveRate = 5; + scene->_guard.setPosition(Common::Point(300, 104)); + scene->_guard.fixPriority(110); + scene->_guard.changeZoom(100); + scene->_guard.show(); break; case 5: - scene->_actor1.animate(ANIM_MODE_5, this); + scene->_guard.animate(ANIM_MODE_5, this); break; case 6: { - scene->_actor1.changeZoom(-1); - scene->_actor1.setVisage(3107); - scene->_actor1.animate(ANIM_MODE_1, NULL); - scene->_actor1.setStrip(3); - scene->_actor1.setPosition(Common::Point(297, 140)); - scene->_actor1._numFrames = 10; - scene->_actor1._moveRate = 10; - scene->_actor1._moveDiff = Common::Point(3, 2); + scene->_guard.changeZoom(-1); + scene->_guard.setVisage(3107); + scene->_guard.animate(ANIM_MODE_1, NULL); + scene->_guard.setStrip(3); + scene->_guard.setPosition(Common::Point(297, 140)); + scene->_guard._numFrames = 10; + scene->_guard._moveRate = 10; + scene->_guard._moveDiff = Common::Point(3, 2); Common::Point pt(297, 160); NpcMover *mover = new NpcMover(); - scene->_actor1.addMover(mover, &pt, this); + scene->_guard.addMover(mover, &pt, this); break; } case 7: { - scene->_actor1.changeZoom(75); - scene->_actor1.updateAngle(R2_GLOBALS._player._position); + scene->_guard.changeZoom(75); + scene->_guard.updateAngle(R2_GLOBALS._player._position); Common::Point pt(105, 82); NpcMover *mover = new NpcMover(); @@ -4356,7 +4363,7 @@ void Scene2800::Action2::signal() { break; } case 13: - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); scene->_field412 = 1207; scene->_stripManager.start(scene->_field412, this); break; @@ -4371,7 +4378,7 @@ void Scene2800::Action2::signal() { } case 15: setDelay(18); - scene->_actor1.updateAngle(R2_GLOBALS._player._position); + scene->_guard.updateAngle(R2_GLOBALS._player._position); R2_GLOBALS._player.setVisage(2800); R2_GLOBALS._player.setStrip(6); R2_GLOBALS._player.setFrame(1); @@ -4440,15 +4447,15 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { _actor3._numFrames = 6; if (!R2_GLOBALS.getFlag(47)) { - _actor1.postInit(); - _actor1.setVisage(3105); - _actor1.setStrip(3); - _actor1.setFrame(1); - _actor1.setZoom(50); - _actor1._moveDiff = Common::Point(2, 1); - _actor1.setPosition(Common::Point(122, 82)); - _actor1.animate(ANIM_MODE_NONE, NULL); - _actor1.setDetails(2800, -1, -1, -1, 1, (SceneItem *)NULL); + _guard.postInit(); + _guard.setVisage(3105); + _guard.setStrip(3); + _guard.setFrame(1); + _guard.setZoom(50); + _guard._moveDiff = Common::Point(2, 1); + _guard.setPosition(Common::Point(122, 82)); + _guard.animate(ANIM_MODE_NONE, NULL); + _guard.setDetails(2800, -1, -1, -1, 1, (SceneItem *)NULL); } _item1.setDetails(Rect(0, 0, 320, 200), 2800, -1, -1, -1, 1, NULL); @@ -4480,7 +4487,8 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(2, 2); R2_GLOBALS._player.disableControl(); - if (R2_INVENTORY.getObjectScene(R2_FLUTE) == 0) { + if (R2_INVENTORY.getObjectScene(R2_FLUTE) != 0) { + _sceneMode = 2800; R2_GLOBALS._player.setAction(&_sequenceManager, this, 2800, &R2_GLOBALS._player, NULL); } else if (R2_GLOBALS.getFlag(47)) { R2_GLOBALS._player.setVisage(3110); @@ -4490,7 +4498,7 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(); } else { _sceneMode = 2801; - R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, &_actor2, &_actor1, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, &_actor2, &_guard, NULL); } } @@ -4498,7 +4506,7 @@ void Scene2800::signal() { switch (_sceneMode) { case 10: R2_GLOBALS._sound1.play(238); - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _field412 = 1206; _sceneMode = 2804; _stripManager.start(_field412, this); @@ -4525,7 +4533,7 @@ void Scene2800::signal() { case 2803: R2_GLOBALS._player.disableControl(); _sceneMode = 10; - setAction(&_sequenceManager, this, 2803, &R2_GLOBALS._player, &_actor2, &_actor1, NULL); + setAction(&_sequenceManager, this, 2803, &R2_GLOBALS._player, &_actor2, &_guard, NULL); break; case 2804: R2_GLOBALS._player.disableControl(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.h b/engines/tsage/ringworld2/ringworld2_scenes2.h index 422507883f..819513e7ec 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -520,24 +520,25 @@ class Scene2700 : public SceneExt { public: SpeakerQuinn2700 _quinnSpeaker; SpeakerNej2700 _nejSpeaker; - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - NamedHotspot _item5; - NamedHotspot _item6; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; + NamedHotspot _background; + NamedHotspot _ghoulHome1; + NamedHotspot _ghoulHome2; + NamedHotspot _ghoulHome3; + NamedHotspot _ghoulHome4; + NamedHotspot _ghoulHome5; + SceneActor _nej; + SceneActor _ghoulHome6; + SceneActor _ghoulHome7; + SceneActor _ghoulHome8; + SceneActor _ghoulHome9; Action1 _action1; Action2 _action2; Action3 _action3; Action4 _action4; Area1 _area1; Area2 _area2; - Rect _rect1, _rect2, _rect3, _rect4, _rect5, _rect6; + Rect _walkRect1, _walkRect2, _walkRect3; + Rect _walkRect4, _walkRect5, _walkRect6; SequenceManager _sequenceManager; int _field412, _field414, _field416; @@ -589,12 +590,12 @@ class Scene2750 : public SceneExt { public: SpeakerQuinn2750 _quinnSpeaker; SpeakerNej2750 _nejSpeaker; - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - NamedHotspot _item5; - SceneActor _actor1; + NamedHotspot _background; + NamedHotspot _ghoulHome1; + NamedHotspot _ghoulHome2; + NamedHotspot _ghoulHome3; + NamedHotspot _ghoulHome4; + SceneActor _nej; SceneActor _actor2; SceneActor _actor3; SceneActor _actor4; @@ -631,7 +632,7 @@ class Scene2800 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor1 : public SceneActor { + class Guard : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -652,7 +653,7 @@ public: SpeakerGuard2800 _guardSpeaker; NamedHotspot _item1; Item2 _item2; - Actor1 _actor1; + Guard _guard; SceneActor _actor2; SceneActor _actor3; SceneObject _object1; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index b40263b2ae..d8922f0839 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -5344,7 +5344,7 @@ void Scene3800::process(Event &event) { } /*-------------------------------------------------------------------------- - * Scene 3900 - + * Scene 3900 - Forest Entrance * *--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index e908fb4412..02687f102f 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -414,10 +414,10 @@ SpeakerGuard::SpeakerGuard() { void SpeakerGuard2800::proc15() { int v = _speakerMode; - Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_guard; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -933,7 +933,7 @@ void SpeakerNej2700::proc15() { Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_nej; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -968,7 +968,7 @@ void SpeakerNej2750::proc15() { Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_nej; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); -- cgit v1.2.3 From c0da007c7a8b1f8cb1ff880c1ae6baefe8abe6f2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 16 Sep 2013 23:06:29 -0400 Subject: TSAGE: Bugfixes and renaming for entering ARM hanger, and more for Spill Mountains --- engines/tsage/core.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes2.cpp | 92 ++++++++++++------------- engines/tsage/ringworld2/ringworld2_scenes2.h | 16 ++--- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 29 ++++---- engines/tsage/ringworld2/ringworld2_scenes3.h | 1 - 6 files changed, 71 insertions(+), 71 deletions(-) (limited to 'engines') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index fbbf982c28..029f9b5075 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1518,7 +1518,7 @@ void ScenePalette::changeBackground(const Rect &bounds, FadeMode fadeMode) { tempRect, Rect(0, 0, tempRect.width(), tempRect.height()), NULL); if (g_vm->getGameID() == GType_Ringworld2 && !GLOBALS._player._uiEnabled && T2_GLOBALS._interfaceY == UI_INTERFACE_Y) { - g_globals->_screenSurface.fillRect(Rect(0, UI_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT), 0); + g_globals->_screenSurface.fillRect(Rect(0, UI_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT - 1), 0); } for (SynchronizedList::iterator i = tempPalette._listeners.begin(); i != tempPalette._listeners.end(); ++i) diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 0941f09677..aab6c8ad6e 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -68,7 +68,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) { _sceneMode = 100; break; case 2800: - _sceneMode = 2800; + _sceneMode = 70; break; case 3100: if (R2_GLOBALS._player._oldCharacterScene[R2_QUINN] == 1000) diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index c6a4729b7a..a8fc6eae49 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1294,9 +1294,9 @@ bool Scene2425::Item1::startAction(CursorType action, Event &event) { R2_GLOBALS.setFlag(84); return true; } else if (action == R2_GUNPOWDER) { - R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); - R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); - return NamedHotspot::startAction(R2_STEPPING_DISKS, event); + R2_GLOBALS._events.setCursor(CURSOR_USE); + R2_GLOBALS._player.enableControl(CURSOR_USE); + return NamedHotspot::startAction(CURSOR_USE, event); } else return NamedHotspot::startAction(action, event); } @@ -1311,9 +1311,9 @@ bool Scene2425::Item2::startAction(CursorType action, Event &event) { R2_GLOBALS.clearFlag(84); return true; } else if (action == R2_GUNPOWDER) { - R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); - R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); - return NamedHotspot::startAction(R2_STEPPING_DISKS, event); + R2_GLOBALS._events.setCursor(CURSOR_USE); + R2_GLOBALS._player.enableControl(CURSOR_USE); + return NamedHotspot::startAction(CURSOR_USE, event); } else return NamedHotspot::startAction(action, event); } @@ -1341,15 +1341,15 @@ bool Scene2425::Item4::startAction(CursorType action, Event &event) { if (action != R2_GUNPOWDER) return NamedHotspot::startAction(action, event); else { - R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); - R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); - return NamedHotspot::startAction(R2_STEPPING_DISKS, event); + R2_GLOBALS._events.setCursor(CURSOR_USE); + R2_GLOBALS._player.enableControl(CURSOR_USE); + return NamedHotspot::startAction(CURSOR_USE, event); } } bool Scene2425::Actor1::startAction(CursorType action, Event &event) { if (action == R2_STEPPING_DISKS) { - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._events.setCursor(R2_GUNPOWDER); return true; } else { @@ -1365,9 +1365,9 @@ bool Scene2425::Actor2::startAction(CursorType action, Event &event) { if (action != R2_GUNPOWDER) return SceneActor::startAction(action, event); else { - R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); - R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); - return SceneActor::startAction(R2_STEPPING_DISKS, event); + R2_GLOBALS._events.setCursor(CURSOR_USE); + R2_GLOBALS._player.enableControl(CURSOR_USE); + return SceneActor::startAction(CURSOR_USE, event); } } @@ -1503,27 +1503,27 @@ bool Scene2430::Actor1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene2430::Actor2::startAction(CursorType action, Event &event) { +bool Scene2430::GunPowder::startAction(CursorType action, Event &event) { Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; - if ((action != R2_STEPPING_DISKS) || (R2_GLOBALS._player._characterIndex != 2)) + if ((action != CURSOR_USE) || (R2_GLOBALS._player._characterIndex != 2)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2430; - scene->setAction(&scene->_sequenceManager, scene, 2430, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2430, &R2_GLOBALS._player, &scene->_gunPowder, NULL); return true; } -bool Scene2430::Actor3::startAction(CursorType action, Event &event) { +bool Scene2430::OilLamp::startAction(CursorType action, Event &event) { Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; - if ((action != R2_STEPPING_DISKS) || (R2_GLOBALS._player._characterIndex != 2)) + if ((action != CURSOR_USE) || (R2_GLOBALS._player._characterIndex != 2)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2435; - scene->setAction(&scene->_sequenceManager, scene, 2435, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2435, &R2_GLOBALS._player, &scene->_oilLamp, NULL); return true; } @@ -1546,18 +1546,18 @@ void Scene2430::postInit(SceneObjectList *OwnerList) { _exit1.setDest(Common::Point(108, 160)); if (R2_INVENTORY.getObjectScene(R2_GUNPOWDER) == 2430) { - _actor2.postInit(); - _actor2.setup(2435, 1, 5); - _actor2.setPosition(Common::Point(205, 119)); - _actor2.fixPriority(152); - _actor2.setDetails(2430, 51, -1, 53, 1, (SceneItem *)NULL); + _gunPowder.postInit(); + _gunPowder.setup(2435, 1, 5); + _gunPowder.setPosition(Common::Point(205, 119)); + _gunPowder.fixPriority(152); + _gunPowder.setDetails(2430, 51, -1, 53, 1, (SceneItem *)NULL); } if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2435) { - _actor3.postInit(); - _actor3.setup(2435, 1, 1); - _actor3.setPosition(Common::Point(31, 65)); - _actor3.setDetails(2430, 48, -1, -1, 1, (SceneItem *)NULL); + _oilLamp.postInit(); + _oilLamp.setup(2435, 1, 1); + _oilLamp.setPosition(Common::Point(31, 65)); + _oilLamp.setDetails(2430, 48, -1, -1, 1, (SceneItem *)NULL); } R2_GLOBALS._player.postInit(); @@ -1618,12 +1618,12 @@ void Scene2430::signal() { g_globals->_sceneManager.changeScene(2000); break; case 2430: - _actor2.remove(); + _gunPowder.remove(); R2_INVENTORY.setObjectScene(R2_GUNPOWDER, 2); R2_GLOBALS._player.enableControl(); break; case 2435: - _actor3.remove(); + _oilLamp.remove(); R2_INVENTORY.setObjectScene(R2_ALCOHOL_LAMP_3, 2); R2_GLOBALS._player.enableControl(); break; @@ -1803,13 +1803,13 @@ bool Scene2440::Actor1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene2440::Actor2::startAction(CursorType action, Event &event) { +bool Scene2440::OilLamp::startAction(CursorType action, Event &event) { Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == 2)){ + if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_SEEKER)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2440; - scene->setAction(&scene->_sequenceManager, scene, 2440, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2440, &R2_GLOBALS._player, &scene->_oilLamp, NULL); return true; } @@ -1835,11 +1835,11 @@ void Scene2440::postInit(SceneObjectList *OwnerList) { _exit1.setDetails(Rect(172, 155, 250, 167), EXITCURSOR_SE, 2000); _exit1.setDest(Common::Point(210, 160)); if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2440) { - _actor2.postInit(); - _actor2.setup(2435, 1, 1); - _actor2.setPosition(Common::Point(94, 80)); - _actor2.fixPriority(106); - _actor2.setDetails(2430, 48, -1, -1, 1, (SceneItem *)NULL); + _oilLamp.postInit(); + _oilLamp.setup(2435, 1, 1); + _oilLamp.setPosition(Common::Point(94, 80)); + _oilLamp.fixPriority(106); + _oilLamp.setDetails(2430, 48, -1, -1, 1, (SceneItem *)NULL); } R2_GLOBALS._player.postInit(); R2_GLOBALS._player.enableControl(); @@ -1898,7 +1898,7 @@ void Scene2440::signal() { g_globals->_sceneManager.changeScene(2000); break; case 2440: - _actor2.remove(); + _oilLamp.remove(); R2_INVENTORY.setObjectScene(R2_ALCOHOL_LAMP_2, 2); // No break on purpose default: @@ -1965,7 +1965,7 @@ bool Scene2450::CareTaker::startAction(CursorType action, Event &event) { void Scene2450::Exit1::changeScene() { Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if ((R2_GLOBALS._player._characterIndex == 2) || (R2_GLOBALS.getFlag(61))) { + if ((R2_GLOBALS._player._characterIndex == R2_SEEKER) || (R2_GLOBALS.getFlag(61))) { _enabled = false; R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS._player.disableControl(); @@ -2526,7 +2526,7 @@ bool Scene2525::Actor3::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2525; scene->setAction(&scene->_sequenceManager, scene, 2525, &R2_GLOBALS._player, &scene->_actor3, NULL); @@ -2653,7 +2653,7 @@ bool Scene2530::Actor2::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2530; scene->setAction(&scene->_sequenceManager, scene, 2530, &R2_GLOBALS._player, &scene->_actor2, NULL); @@ -2830,7 +2830,7 @@ bool Scene2535::TannerMask::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2535; scene->setAction(&scene->_sequenceManager, scene, 2535, &R2_GLOBALS._player, &scene->_tannerMask, NULL); @@ -4179,7 +4179,7 @@ void Scene2800::synchronize(Serializer &s) { s.syncAsSint16LE(_field412); } -bool Scene2800::Item2::startAction(CursorType action, Event &event) { +bool Scene2800::Outpost::startAction(CursorType action, Event &event) { Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; if ((action == CURSOR_USE) && (R2_GLOBALS.getFlag(47))) { @@ -4469,7 +4469,7 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { if (R2_INVENTORY.getObjectScene(R2_FLUTE) == 0) { R2_GLOBALS._sound1.fadeSound(237); if (R2_GLOBALS.getFlag(47)) { - _item2.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); + _outpost.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); } else { _actor2.postInit(); _actor2.setup(2752, 5, 1); @@ -4516,7 +4516,7 @@ void Scene2800::signal() { _object1.setAction(NULL); R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - _item2.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); + _outpost.setDetails(Rect(76, 45, 155, 90), 2800, 3, -1, -1, 2, NULL); break; case 12: R2_GLOBALS._sound1.fadeOut2(NULL); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.h b/engines/tsage/ringworld2/ringworld2_scenes2.h index 819513e7ec..90dd97a5e4 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -192,11 +192,11 @@ class Scene2430 : public SceneExt { public: bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class GunPowder : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class OilLamp : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -220,8 +220,8 @@ public: NamedHotspot _item12; NamedHotspot _item13; Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; + GunPowder _gunPowder; + OilLamp _oilLamp; Exit1 _exit1; SequenceManager _sequenceManager; @@ -265,7 +265,7 @@ class Scene2440 : public SceneExt { public: bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class OilLamp : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -283,7 +283,7 @@ public: NamedHotspot _item6; NamedHotspot _item7; Actor1 _actor1; - Actor2 _actor2; + OilLamp _oilLamp; Exit1 _exit1; SequenceManager _sequenceManager; @@ -627,7 +627,7 @@ public: }; class Scene2800 : public SceneExt { - class Item2 : public NamedHotspot { + class Outpost : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -652,7 +652,7 @@ public: SpeakerNej2800 _nejSpeaker; SpeakerGuard2800 _guardSpeaker; NamedHotspot _item1; - Item2 _item2; + Outpost _outpost; Guard _guard; SceneActor _actor2; SceneActor _actor3; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index d8922f0839..233e83effd 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -30,9 +30,10 @@ namespace TsAGE { namespace Ringworld2 { /*-------------------------------------------------------------------------- - * Scene 3100 - + * Scene 3100 - ARM Base Hanager * *--------------------------------------------------------------------------*/ + Scene3100::Scene3100() { _field412 = 0; } @@ -63,7 +64,7 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._uiElements._active = false; } else { loadScene(3100); - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); + _sceneBounds = Rect(160, 0, 480, SCREEN_HEIGHT); } } else { loadScene(3100); @@ -148,7 +149,7 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.setPosition(Common::Point(160, 150)); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._sound1.play(243); } @@ -172,7 +173,7 @@ void Scene3100::signal() { case 3100: R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 3101: R2_GLOBALS._sceneManager.changeScene(1000); @@ -182,7 +183,7 @@ void Scene3100::signal() { R2_GLOBALS._sceneManager.changeScene(1000); break; default: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } @@ -2119,7 +2120,7 @@ void Scene3375::signalCase3379() { _actor1._effect = 1; _actor2._effect = 1; _actor3._effect = 1; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } void Scene3375::signal() { @@ -2412,7 +2413,7 @@ void Scene3385::signal() { R2_GLOBALS._player.enableControl(CURSOR_TALK); break; default: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } @@ -2632,7 +2633,7 @@ void Scene3395::signal() { R2_GLOBALS._player.enableControl(CURSOR_TALK); break; default: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } @@ -4511,7 +4512,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _sceneMode = 3623; g_globals->_events.setCursor(CURSOR_ARROW); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } else { _field254A = 0; _field2548 = 0; @@ -4630,14 +4631,14 @@ void Scene3600::signal() { // No break on purpose case 3607: g_globals->_events.setCursor(CURSOR_ARROW); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); _actor13.fixPriority(-1); _sceneMode = 3623; _field2548 = 1; break; case 3327: g_globals->_events.setCursor(CURSOR_ARROW); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); _sceneMode = 3623; break; case 3450: @@ -5188,7 +5189,7 @@ void Scene3800::enterArea() { break; } default: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } break; @@ -5554,7 +5555,7 @@ void Scene3900::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.addMover(mover, &pt, this); } else { R2_GLOBALS._player.setPosition(Common::Point(160, 145)); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } } @@ -5585,7 +5586,7 @@ void Scene3900::signal() { _eastExit._enabled = true; _southExit._enabled = true; _westExit._enabled = true; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; default: break; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 14600ff6df..f1203f96a1 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -45,7 +45,6 @@ class Scene3100 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; public: - int _field412; SpeakerGuard _guardSpeaker; NamedHotspot _item1; -- cgit v1.2.3 From 9534ee0152b43885d15c1199e11e203d667bbeb8 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 17 Sep 2013 11:07:41 +0300 Subject: NEVERHOOD: Slight cleanup in Module2800::updateScene() --- engines/neverhood/modules/module2800.cpp | 50 ++------------------------------ 1 file changed, 3 insertions(+), 47 deletions(-) (limited to 'engines') diff --git a/engines/neverhood/modules/module2800.cpp b/engines/neverhood/modules/module2800.cpp index 1c0f9fc9fb..7980c6b308 100644 --- a/engines/neverhood/modules/module2800.cpp +++ b/engines/neverhood/modules/module2800.cpp @@ -294,30 +294,8 @@ void Module2800::updateScene() { createScene(8, 0); else if (_moduleResult == 6) createScene(2, 6); - else if (_moduleResult == 11) - createScene(12, 0); - else if (_moduleResult == 12) - createScene(13, 0); - else if (_moduleResult == 13) - createScene(14, 0); - else if (_moduleResult == 14) - createScene(15, 0); - else if (_moduleResult == 15) - createScene(16, 0); - else if (_moduleResult == 16) - createScene(17, 0); - else if (_moduleResult == 17) - createScene(18, 0); - else if (_moduleResult == 18) - createScene(19, 0); - else if (_moduleResult == 19) - createScene(20, 0); - else if (_moduleResult == 20) - createScene(21, 0); - else if (_moduleResult == 21) - createScene(22, 0); - else if (_moduleResult == 22) - createScene(23, 0); + else if (_moduleResult >= 11 && _moduleResult <= 22) + createScene(_moduleResult + 1, 0); else createScene(2, 4); break; @@ -335,40 +313,18 @@ void Module2800::updateScene() { createScene(9, 1); break; case 12: - createScene(9, 11); - break; case 13: - createScene(9, 12); - break; case 14: - createScene(9, 13); - break; case 15: - createScene(9, 14); - break; case 16: - createScene(9, 15); - break; case 17: - createScene(9, 16); - break; case 18: - createScene(9, 17); - break; case 19: - createScene(9, 18); - break; case 20: - createScene(9, 19); - break; case 21: - createScene(9, 20); - break; case 22: - createScene(9, 21); - break; case 23: - createScene(9, 22); + createScene(9, _sceneNum - 1); break; case 24: createScene(9, 3); -- cgit v1.2.3 From 32d28c9f7a18857308514f7a05144c0ac930dc27 Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Tue, 17 Sep 2013 21:58:05 +0200 Subject: SCI: script patch for larry 2 - fixes no points granted when wearing parachute - was a sierra script bug - fixes bug #3614419 --- engines/sci/engine/script_patches.cpp | 52 +++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 6dbdd2baf5..a8054e5bd5 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -741,6 +741,48 @@ const SciScriptSignature longbowSignatures[] = { SCI_SIGNATUREENTRY_TERMINATOR }; +// =========================================================================== +// Leisure Suit Larry 2 +// On the plane, Larry is able to wear the parachute. This grants 4 points. +// In early versions of LSL2, it was possible to get "unlimited" points by +// simply wearing it multiple times. +// They fixed it in later versions by remembering, if the parachute was already +// used before. +// But instead of adding it properly, it seems they hacked the script / forgot +// to replace script 0 as well, which holds information about how many global +// variables are allocated at the start of the game. +// The script tries to read an out-of-bounds global variable, which somewhat +// "worked" in SSCI, but ScummVM/SCI doesn't allow that. +// That's why those points weren't granted here at all. +// We patch the script to use global 90, which seems to be unused in the whole game. +// Responsible method: rm63Script::handleEvent +// Fixes bug #3614419 +const byte larry2SignatureWearParachutePoints[] = { + 16, + 0x35, 0x01, // ldi 01 + 0xa1, 0x8e, // sag 8e + 0x80, 0xe0, 0x01, // lag 1e0 + 0x18, // not + 0x30, 0x0f, 0x00, // bnt [don't give points] + 0x35, 0x01, // ldi 01 + 0xa0, 0xe0, 0x01, // sag 1e0 + 0 +}; + +const uint16 larry2PatchWearParachutePoints[] = { + PATCH_ADDTOOFFSET | +4, + 0x80, 0x5a, 0x00, // lag 5a (global 90) + PATCH_ADDTOOFFSET | +6, + 0xa0, 0x5a, 0x00, // sag 5a (global 90) + PATCH_END +}; + +// script, description, magic DWORD, adjust +const SciScriptSignature larry2Signatures[] = { + { 63, "plane: no points for wearing plane", 1, PATCH_MAGICDWORD(0x8e, 0x80, 0xe0, 0x01), -3, larry2SignatureWearParachutePoints, larry2PatchWearParachutePoints }, + SCI_SIGNATUREENTRY_TERMINATOR +}; + // =========================================================================== // this is called on every death dialog. Problem is at least the german // version of lsl6 gets title text that is far too long for the @@ -996,9 +1038,10 @@ const uint16 qfg1vgaPatchMoveToCastleGate[] = { }; // Typo in the original Sierra scripts -// Looking at a cheetaur resulted in a text about a Saurus Rex -// Code is in smallMonster::doVerb. It treats both monster -// types the same. We fix this. Fixes bug #3604943. +// Looking at a cheetaur resulted in a text about a Saurus Rex +// The code treats both monster types the same. +// Responsible method: smallMonster::doVerb +// Fixes bug #3604943. const byte qfg1vgaSignatureCheetaurDescription[] = { 16, 0x34, 0xb8, 0x01, // ldi 01b8 @@ -1444,6 +1487,9 @@ void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uin case GID_LONGBOW: signatureTable = longbowSignatures; break; + case GID_LSL2: + signatureTable = larry2Signatures; + break; case GID_LSL6: signatureTable = larry6Signatures; break; -- cgit v1.2.3 From eeac2c0c4ff986071cbe097f7c063b906b926806 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 00:00:33 +0400 Subject: FULLPIPE: Implement CMovGraph_messageHandler() --- engines/fullpipe/motion.cpp | 20 +++++++++++++++- engines/fullpipe/motion.h | 6 +++++ engines/fullpipe/scenes.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++++ engines/fullpipe/utils.cpp | 2 ++ engines/fullpipe/utils.h | 3 ++- 5 files changed, 86 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 514dde5185..1d46f7994f 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -28,6 +28,7 @@ #include "fullpipe/objects.h" #include "fullpipe/motion.h" +#include "fullpipe/messages.h" namespace Fullpipe { @@ -104,13 +105,17 @@ bool CMctlCompoundArray::load(MfcArchive &file) { return true; } +int CMovGraph_messageHandler(ExCommand *cmd); + CMovGraph::CMovGraph() { warning("STUB: CMovGraph::CMovGraph()"); _itemsCount = 0; _items = 0; //_callback1 = CMovGraphCallback1; // TODO _field_44 = 0; - // insertMessageHandler(CMovGraph_messageHandler, getMessageHandlersCount() - 1, 129); + insertMessageHandler(CMovGraph_messageHandler, getMessageHandlersCount() - 1, 129); + + _objtype = kObjTypeMovGraph; } bool CMovGraph::load(MfcArchive &file) { @@ -126,6 +131,19 @@ void CMovGraph::addObject(StaticANIObject *obj) { warning("STUB: CMovGraph::addObject()"); } +double CMovGraph::calcDistance(Common::Point *point, CMovGraphLink *link, int flag) { + warning("STUB: CMovGraph::calcDistance()"); + + return 0; +} + +CMovGraphNode *CMovGraph::calcOffset(int ox, int oy) { + warning("STUB: CMovGraph::calcOffset()"); + + return 0; +} + + CMovGraphLink::CMovGraphLink() { _distance = 0; _angle = 0; diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 85a52918f0..79739845c2 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -77,6 +77,7 @@ class Unk2 : public CObject { }; class CMovGraphNode : public CObject { + public: int _x; int _y; int _distance; @@ -137,6 +138,7 @@ class CReactPolygonal : public CMovGraphReact { }; class CMovGraphLink : public CObject { + public: CMovGraphNode *_movGraphNode1; CMovGraphNode *_movGraphNode2; CDWordArray _dwordArray1; @@ -155,6 +157,7 @@ class CMovGraphLink : public CObject { }; class CMovGraph : public CMotionController { + public: CObList _nodes; CObList _links; int _field_44; @@ -168,6 +171,9 @@ class CMovGraph : public CMotionController { virtual bool load(MfcArchive &file); virtual void addObject(StaticANIObject *obj); + + double calcDistance(Common::Point *point, CMovGraphLink *link, int flag); + CMovGraphNode *calcOffset(int ox, int oy); }; class CMctlConnectionPoint : public CObject { diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index c9cdc0a3d8..7aec8652f0 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1313,6 +1313,63 @@ int global_messageHandler4(ExCommand *cmd) { return 1; } +int CMovGraph_messageHandler(ExCommand *cmd) { + if (cmd->_messageKind != 17) + return 0; + + if (cmd->_messageNum != 33) + return 0; + + StaticANIObject *ani = g_fullpipe->_currentScene->getStaticANIObject1ById(g_fullpipe->_gameLoader->_field_FA, -1); + + if (!getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)) + return 0; + + if (getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)->_objtype != kObjTypeMovGraph || !ani) + return 0; + + CMovGraph *gr = (CMovGraph *)getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId); + + CMovGraphLink *link = 0; + double mindistance = 1.0e10; + Common::Point point; + + for (CObList::iterator i = gr->_links.begin(); i != gr->_links.end(); ++i) { + point.x = ani->_ox; + point.y = ani->_oy; + + double dst = gr->calcDistance(&point, (CMovGraphLink *)(*i), 0); + if (dst >= 0.0 && dst < mindistance) { + mindistance = dst; + link = (CMovGraphLink *)(*i); + } + } + + int top; + + if (link) { + CMovGraphNode *node = link->_movGraphNode1; + + double sq = (ani->_oy - node->_y) * (ani->_oy - node->_y) + (ani->_ox - node->_x) * (ani->_ox - node->_x); + int off = (node->_field_14 >> 16) & 0xFF; + double off2 = (link->_movGraphNode2->_field_14 >> 8) & 0xff - off; + + top = off + (int)(sqrt(sq) * off2 / link->_distance); + } else { + top = (gr->calcOffset(ani->_ox, ani->_oy)->_field_14 >> 8) & 0xff; + } + + if (ani->_movement) { + ani->_movement->_currDynamicPhase->_rect->top = 255 - top; + return 0; + } + + if (ani->_statics) + ani->_statics->_rect->top = 255 - top; + + return 0; +} + int defaultUpdateCursor() { g_fullpipe->updateCursorsCommon(); diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index ee73aeaa64..2ba5a85e68 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -396,6 +396,8 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) { if (_objectMap.size() < obTag) { error("Object index too big: %d at 0x%08x", obTag, pos() - 2); } + debug(7, "parseClass::obTag <%s>", lookupObjectId(_objectIdMap[obTag])); + res = _objectMap[obTag]; *isCopyReturned = true; diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index 76a1ae944c..2199706b9b 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -68,7 +68,8 @@ enum ObjType { kObjTypeDefault, kObjTypeObjstateCommand, kObjTypeStaticANIObject, - kObjTypePictureObject + kObjTypePictureObject, + kObjTypeMovGraph }; class CObject { -- cgit v1.2.3 From ed865856dc1b486c52e0a22ae6d39f686e9a79ab Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Tue, 17 Sep 2013 23:27:02 +0200 Subject: SCI: PQ1 script patch, fixes gun locker crash fixes bug #3303802 / bug #3036933 --- engines/sci/engine/script_patches.cpp | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index a8054e5bd5..5f461aab3f 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -909,6 +909,68 @@ const SciScriptSignature mothergoose256Signatures[] = { SCI_SIGNATUREENTRY_TERMINATOR }; +// =========================================================================== +// Police Quest 1 VGA +// When at the police station, you can put or get your gun from your locker. +// The script, that handles this, is buggy. It disposes the gun as soon as +// you click, but then waits 2 seconds before it also closes the locker. +// Problem is that it's possible to click again, which then results in a +// disposed object getting accessed. This happened to work by pure luck in +// SSCI. +// This patch changes the code, so that the gun is actually given away +// when the 2 seconds have passed and the locker got closed. +// Responsible method: putGun::changeState (script 341) +// Fixes bug #3036933 / #3303802 +const byte pq1vgaSignaturePutGunInLockerBug[] = { + 5, + 0x35, 0x00, // ldi 00 + 0x1a, // eq? + 0x31, 0x25, // bnt [next state check] + +22, 29, // [skip 22 bytes] + 0x38, 0x5f, 0x01, // pushi 15fh + 0x78, // push1 + 0x76, // push0 + 0x81, 0x00, // lag 00 + 0x4a, 0x06, // send 06 - ego::put(0) + 0x35, 0x02, // ldi 02 + 0x65, 0x1c, // aTop 1c (set timer to 2 seconds) + 0x33, 0x0e, // jmp [end of method] + 0x3c, // dup --- next state check target + 0x35, 0x01, // ldi 01 + 0x1a, // eq? + 0x31, 0x08, // bnt [end of method] + 0x39, 0x6f, // pushi 6fh + 0x76, // push0 + 0x72, 0x88, 0x00, // lofsa 0088 + 0x4a, 0x04, // send 04 - locker::dispose + 0 +}; + +const uint16 pq1vgaPatchPutGunInLockerBug[] = { + PATCH_ADDTOOFFSET | +3, + 0x31, 0x1c, // bnt [next state check] + PATCH_ADDTOOFFSET | +22, + 0x35, 0x02, // ldi 02 + 0x65, 0x1c, // aTop 1c (set timer to 2 seconds) + 0x33, 0x17, // jmp [end of method] + 0x3c, // dup --- next state check target + 0x35, 0x01, // ldi 01 + 0x1a, // eq? + 0x31, 0x11, // bnt [end of method] + 0x38, 0x5f, 0x01, // pushi 15fh + 0x78, // push1 + 0x76, // push0 + 0x81, 0x00, // lag 00 + 0x4a, 0x06, // send 06 - ego::put(0) + PATCH_END +}; + +// script, description, magic DWORD, adjust +const SciScriptSignature pq1vgaSignatures[] = { + { 341, "put gun in locker bug", 1, PATCH_MAGICDWORD(0x38, 0x5f, 0x01, 0x78), -27, pq1vgaSignaturePutGunInLockerBug, pq1vgaPatchPutGunInLockerBug }, + SCI_SIGNATUREENTRY_TERMINATOR +}; + // =========================================================================== // script 215 of qfg1vga pointBox::doit actually processes button-presses // during fighting with monsters. It strangely also calls kGetEvent. Because @@ -1496,6 +1558,9 @@ void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uin case GID_MOTHERGOOSE256: signatureTable = mothergoose256Signatures; break; + case GID_PQ1: + signatureTable = pq1vgaSignatures; + break; case GID_QFG1VGA: signatureTable = qfg1vgaSignatures; break; -- cgit v1.2.3 From 7b50481082e67a046e82516dc9d83e444f391a85 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 17 Sep 2013 21:31:33 -0400 Subject: TSAGE: Fixes and renaming for R2R Hall of Records and Crevasse --- engines/tsage/events.cpp | 5 + engines/tsage/events.h | 1 + engines/tsage/ringworld2/ringworld2_logic.cpp | 4 + engines/tsage/ringworld2/ringworld2_scenes2.cpp | 193 ++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes2.h | 40 ++--- 5 files changed, 127 insertions(+), 116 deletions(-) (limited to 'engines') diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index ac6ce0bf8e..d2d8464763 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -271,6 +271,11 @@ void EventsClass::setCursor(CursorType cursorType) { _currentCursor = cursorType; cursor = g_resourceManager->getSubResource(5, 1, cursorType - R2CURSORS_START, &size); break; + + case R2_CURSOR_ROPE: + _currentCursor = cursorType; + cursor = g_resourceManager->getSubResource(5, 4, 1, &size); + break; } // Decode the cursor diff --git a/engines/tsage/events.h b/engines/tsage/events.h index a1e9da3477..9ef4813e47 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -108,6 +108,7 @@ enum CursorType { EXITCURSOR_NE = 0x800D, EXITCURSOR_SE = 0x800E, EXITCURSOR_SW = 0x800F, EXITCURSOR_NW = 0x8010, SHADECURSOR_UP = 0x8011, SHADECURSOR_DOWN = 0x8012, SHADECURSOR_HAND = 0x8013, R2_CURSOR_20 = 0x8014, R2_CURSOR_21 = 0x8015, R2_CURSOR_22 = 0x8016, R2_CURSOR_23 = 0x8017, + R2_CURSOR_ROPE = 0x8025, // Cursors CURSOR_WALK = 0x100, CURSOR_LOOK = 0x200, CURSOR_700 = 700, CURSOR_USE = 0x400, CURSOR_TALK = 0x800, diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 9c50d810fc..9dbff39fcc 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -376,6 +376,10 @@ void SceneExt::remove() { _sceneAreas.clear(); Scene::remove(); R2_GLOBALS._uiElements._active = true; + + if (R2_GLOBALS._events.getCursor() >= EXITCURSOR_N && + R2_GLOBALS._events.getCursor() <= SHADECURSOR_DOWN) + R2_GLOBALS._events.setCursor(CURSOR_WALK); } void SceneExt::process(Event &event) { diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index a8fc6eae49..d91c8f4afd 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1280,20 +1280,20 @@ void Scene2400::signal() { } /*-------------------------------------------------------------------------- - * Scene 2425 - Spill Mountains: + * Scene 2425 - Spill Mountains: The Hall Of Records * *--------------------------------------------------------------------------*/ -bool Scene2425::Item1::startAction(CursorType action, Event &event) { +bool Scene2425::RopeDest1::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_GUNPOWDER) && (!R2_GLOBALS.getFlag(84))) { + if ((action == R2_CURSOR_ROPE) && (!R2_GLOBALS.getFlag(84))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2426; - scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_rope, NULL); R2_GLOBALS.setFlag(84); return true; - } else if (action == R2_GUNPOWDER) { + } else if (action == R2_CURSOR_ROPE) { R2_GLOBALS._events.setCursor(CURSOR_USE); R2_GLOBALS._player.enableControl(CURSOR_USE); return NamedHotspot::startAction(CURSOR_USE, event); @@ -1301,16 +1301,16 @@ bool Scene2425::Item1::startAction(CursorType action, Event &event) { return NamedHotspot::startAction(action, event); } -bool Scene2425::Item2::startAction(CursorType action, Event &event) { +bool Scene2425::RopeDest2::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_GUNPOWDER) && (R2_GLOBALS.getFlag(84))) { + if ((action == R2_CURSOR_ROPE) && (R2_GLOBALS.getFlag(84))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2427; - scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_rope, NULL); R2_GLOBALS.clearFlag(84); return true; - } else if (action == R2_GUNPOWDER) { + } else if (action == R2_CURSOR_ROPE) { R2_GLOBALS._events.setCursor(CURSOR_USE); R2_GLOBALS._player.enableControl(CURSOR_USE); return NamedHotspot::startAction(CURSOR_USE, event); @@ -1318,27 +1318,27 @@ bool Scene2425::Item2::startAction(CursorType action, Event &event) { return NamedHotspot::startAction(action, event); } -bool Scene2425::Item3::startAction(CursorType action, Event &event) { +bool Scene2425::Crevasse::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if (action != R2_GUNPOWDER) + if (action != R2_CURSOR_ROPE) return NamedHotspot::startAction(action, event); else { R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(84)) { scene->_sceneMode = 20; - scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_rope, NULL); R2_GLOBALS.clearFlag(84); } else { scene->_sceneMode = 2425; - scene->setAction(&scene->_sequenceManager, scene, 2425, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2425, &R2_GLOBALS._player, &scene->_rope, NULL); } return true; } } bool Scene2425::Item4::startAction(CursorType action, Event &event) { - if (action != R2_GUNPOWDER) + if (action != R2_CURSOR_ROPE) return NamedHotspot::startAction(action, event); else { R2_GLOBALS._events.setCursor(CURSOR_USE); @@ -1347,22 +1347,22 @@ bool Scene2425::Item4::startAction(CursorType action, Event &event) { } } -bool Scene2425::Actor1::startAction(CursorType action, Event &event) { - if (action == R2_STEPPING_DISKS) { +bool Scene2425::Rope::startAction(CursorType action, Event &event) { + if (action == CURSOR_USE) { if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { - R2_GLOBALS._events.setCursor(R2_GUNPOWDER); + R2_GLOBALS._events.setCursor(R2_CURSOR_ROPE); return true; } else { return SceneActor::startAction(action, event); } - } else if (R2_GLOBALS._events.getCursor() == R2_GUNPOWDER) + } else if (R2_GLOBALS._events.getCursor() == R2_CURSOR_ROPE) return false; else return SceneActor::startAction(action, event); } -bool Scene2425::Actor2::startAction(CursorType action, Event &event) { - if (action != R2_GUNPOWDER) +bool Scene2425::Pictographs::startAction(CursorType action, Event &event) { + if (action != R2_CURSOR_ROPE) return SceneActor::startAction(action, event); else { R2_GLOBALS._events.setCursor(CURSOR_USE); @@ -1407,39 +1407,39 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { } if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { - _actor2.postInit(); + _pictographs1.postInit(); if (R2_GLOBALS._player._characterIndex == 1) { - _actor2.setup(20, 5, 1); - _actor2.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); + _pictographs1.setup(20, 5, 1); + _pictographs1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { - _actor2.setup(2008, 5, 1); - _actor2.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); + _pictographs1.setup(2008, 5, 1); + _pictographs1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } - _actor2.setPosition(Common::Point(250, 185)); + _pictographs1.setPosition(Common::Point(250, 185)); } - _actor1.postInit(); + _rope.postInit(); if (R2_GLOBALS._sceneManager._previousScene == 2455) - _actor1.setup(2426, 1, 1); + _rope.setup(2426, 1, 1); else - _actor1.setup(2426, 1, 2); + _rope.setup(2426, 1, 2); - _actor1.setPosition(Common::Point(290, 9)); - _actor1.fixPriority(20); - _actor1.setDetails(2455, 12, -1, -1, 1, (SceneItem *)NULL); - _item1.setDetails(Rect(225, 52, 248, 65), 2425, -1, -1, -1, 1, NULL); - _item2.setDetails(Rect(292, 81, 316, 94), 2425, -1, -1, -1, 1, NULL); + _rope.setPosition(Common::Point(290, 9)); + _rope.fixPriority(20); + _rope.setDetails(2455, 12, -1, -1, 1, (SceneItem *)NULL); + _ropeDest1.setDetails(Rect(225, 52, 248, 65), 2425, -1, -1, -1, 1, NULL); + _ropeDest2.setDetails(Rect(292, 81, 316, 94), 2425, -1, -1, -1, 1, NULL); // CHECKME: SceneActor using a SceneItem function?? -// _actor3.setDetails(11, 2425, 3, -1, 6); - _actor3._sceneRegionId = 11; - _actor3._resNum = 2425; - _actor3._lookLineNum = 3; - _actor3._talkLineNum = -1; - _actor3._useLineNum = 6; - g_globals->_sceneItems.push_back(&_actor3); - - _item3.setDetails(12, 2425, 7, -1, 9); +// _pictographs2.setDetails(11, 2425, 3, -1, 6); + _pictographs2._sceneRegionId = 11; + _pictographs2._resNum = 2425; + _pictographs2._lookLineNum = 3; + _pictographs2._talkLineNum = -1; + _pictographs2._useLineNum = 6; + g_globals->_sceneItems.push_back(&_pictographs2); + + _crevasse.setDetails(12, 2425, 7, -1, 9); _item4.setDetails(Rect(0, 0, 320, 200), 2425, 0, -1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); @@ -1460,7 +1460,7 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { break; case 2455: _sceneMode = 2428; - setAction(&_sequenceManager, this, 2428, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 2428, &R2_GLOBALS._player, &_rope, NULL); break; default: R2_GLOBALS._player.setPosition(Common::Point(280, 150)); @@ -1483,7 +1483,7 @@ void Scene2425::signal() { break; case 20: _sceneMode = 2425; - setAction(&_sequenceManager, this, 2425, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 2425, &R2_GLOBALS._player, &_rope, NULL); break; case 2425: g_globals->_sceneManager.changeScene(2455); @@ -2223,18 +2223,18 @@ void Scene2450::signal() { * *--------------------------------------------------------------------------*/ -bool Scene2455::Actor1::startAction(CursorType action, Event &event) { +bool Scene2455::Lamp::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; if (action == R2_GLASS_DOME) { if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455) || (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2458; - scene->_actor2._lookLineNum = 9; - scene->_actor1.remove(); - scene->_actor3.postInit(); - scene->_actor3.setDetails(2455, 16, 1, -1, 2, (SceneItem *)NULL); - scene->setAction(&scene->_sequenceManager, scene, 2458, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor3, NULL); + scene->_pool._lookLineNum = 9; + scene->_lamp.remove(); + scene->_scrithKey.postInit(); + scene->_scrithKey.setDetails(2455, 16, 1, -1, 2, (SceneItem *)NULL); + scene->setAction(&scene->_sequenceManager, scene, 2458, &R2_GLOBALS._player, &scene->_pool, &scene->_scrithKey, NULL); return true; } } @@ -2242,31 +2242,31 @@ bool Scene2455::Actor1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene2455::Actor2::startAction(CursorType action, Event &event) { +bool Scene2455::Pool::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; switch (action) { case R2_ALCOHOL_LAMP_2: if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) != 2455) { R2_GLOBALS._player.disableControl(); - scene->_actor1.postInit(); - scene->_actor1.setup(2456, 3, 3); - scene->_actor1.setPosition(Common::Point(162, 165)); - scene->_actor1.setDetails(2455, 15, 1, -1, 2, (SceneItem *)NULL); + scene->_lamp.postInit(); + scene->_lamp.setup(2456, 3, 3); + scene->_lamp.setPosition(Common::Point(162, 165)); + scene->_lamp.setDetails(2455, 15, 1, -1, 2, (SceneItem *)NULL); scene->_sceneMode = 11; - scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_pool, NULL); return true; } break; case R2_ALCOHOL_LAMP_3: if (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) != 2455) { R2_GLOBALS._player.disableControl(); - scene->_actor1.postInit(); - scene->_actor1.setup(2456, 3, 3); - scene->_actor1.setPosition(Common::Point(162, 165)); - scene->_actor1.setDetails(2455, 15, 1, -1, 2, (SceneItem *)NULL); + scene->_lamp.postInit(); + scene->_lamp.setup(2456, 3, 3); + scene->_lamp.setPosition(Common::Point(162, 165)); + scene->_lamp.setDetails(2455, 15, 1, -1, 2, (SceneItem *)NULL); scene->_sceneMode = 12; - scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2457, &R2_GLOBALS._player, &scene->_pool, NULL); return true; } break; @@ -2277,13 +2277,13 @@ bool Scene2455::Actor2::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); } -bool Scene2455::Actor3::startAction(CursorType action, Event &event) { +bool Scene2455::ScrithKey::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; if (action == CURSOR_USE) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2459; - scene->setAction(&scene->_sequenceManager, scene, 2459, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2459, &R2_GLOBALS._player, &scene->_scrithKey, NULL); return true; } @@ -2313,37 +2313,36 @@ void Scene2455::postInit(SceneObjectList *OwnerList) { _exit1.setDetails(Rect(0, 0, 320, 15), EXITCURSOR_N, 2425); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) == 2455) { - if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455) || (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455)) { - _actor1.postInit(); - _actor1.setup(2456, 3, 3); - _actor1.setPosition(Common::Point(162, 165)); - _actor1.setDetails(2455, 15, 1, -1, 1, (SceneItem *)NULL); - } - } else { - _actor3.postInit(); - _actor3.setup(2456, 3, 1); - _actor3.setPosition(Common::Point(176, 165)); - _actor3.setDetails(2455, 16, 1, -1, 1, (SceneItem *)NULL); - } - - _actor2.postInit(); + _scrithKey.postInit(); + _scrithKey.setup(2456, 3, 1); + _scrithKey.setPosition(Common::Point(176, 165)); + _scrithKey.setDetails(2455, 16, 1, -1, 1, (SceneItem *)NULL); + } else if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455) || + (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455)) { + _lamp.postInit(); + _lamp.setup(2456, 3, 3); + _lamp.setPosition(Common::Point(162, 165)); + _lamp.setDetails(2455, 15, 1, -1, 1, (SceneItem *)NULL); + } + + _pool.postInit(); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) == 2455) { - _actor2.setup(2456, 3, 2); - _actor2.setDetails(2455, 9, 1, -1, 1, (SceneItem *)NULL); + _pool.setup(2456, 3, 2); + _pool.setDetails(2455, 9, 1, -1, 1, (SceneItem *)NULL); } else { if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) != 2455) && (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) != 2455)) - _actor2.setup(2455, 1, 1); + _pool.setup(2455, 1, 1); else - _actor2.setup(2456, 1, 1); - _actor2.setDetails(2455, 3, 1, -1, 1, (SceneItem *)NULL); + _pool.setup(2456, 1, 1); + _pool.setDetails(2455, 3, 1, -1, 1, (SceneItem *)NULL); } - _actor2.setPosition(Common::Point(162, 165)); - _actor2.fixPriority(20); + _pool.setPosition(Common::Point(162, 165)); + _pool.fixPriority(20); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) != 2455) - _actor2.animate(ANIM_MODE_2, NULL); + _pool.animate(ANIM_MODE_2, NULL); R2_GLOBALS._player.postInit(); - _item1.setDetails(Rect(0, 0, 320, 200), 2455, 0, 1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2455, 0, 1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2425) { @@ -2386,7 +2385,7 @@ void Scene2455::signal() { R2_GLOBALS._player._canWalk = false; break; case 2459: - _actor3.remove(); + _scrithKey.remove(); R2_INVENTORY.setObjectScene(R2_SCRITH_KEY, 2); R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; @@ -2507,6 +2506,7 @@ void Scene2500::signal() { * Scene 2525 - Furnace room * *--------------------------------------------------------------------------*/ + bool Scene2525::Item5::startAction(CursorType action, Event &event) { Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; @@ -2520,7 +2520,7 @@ bool Scene2525::Item5::startAction(CursorType action, Event &event) { return SceneItem::startAction(action, event); } -bool Scene2525::Actor3::startAction(CursorType action, Event &event) { +bool Scene2525::GlassDome::startAction(CursorType action, Event &event) { Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -2529,7 +2529,7 @@ bool Scene2525::Actor3::startAction(CursorType action, Event &event) { if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2525; - scene->setAction(&scene->_sequenceManager, scene, 2525, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2525, &R2_GLOBALS._player, &scene->_glassDome, NULL); } else { SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } @@ -2558,11 +2558,11 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { _exit1.setDetails(Rect(86, 155, 228, 168), EXITCURSOR_S, 2000); if (R2_INVENTORY.getObjectScene(R2_GLASS_DOME) == 2525) { - _actor3.postInit(); - _actor3.setup(2435, 1, 2); - _actor3.setPosition(Common::Point(78, 155)); - _actor3.fixPriority(155); - _actor3.setDetails(2525, 27, -1, -1, 1, (SceneItem *)NULL); + _glassDome.postInit(); + _glassDome.setup(2435, 1, 2); + _glassDome.setPosition(Common::Point(78, 155)); + _glassDome.fixPriority(155); + _glassDome.setDetails(2525, 27, -1, -1, 1, (SceneItem *)NULL); } _actor2.postInit(); @@ -2629,7 +2629,7 @@ void Scene2525::signal() { g_globals->_sceneManager.changeScene(2000); break; case 2525: - _actor3.remove(); + _glassDome.remove(); R2_INVENTORY.setObjectScene(R2_GLASS_DOME, 2); R2_GLOBALS._player.enableControl(); break; @@ -2647,6 +2647,7 @@ void Scene2525::signal() { * Scene 2530 - Spill Mountains: Well * *--------------------------------------------------------------------------*/ + bool Scene2530::Actor2::startAction(CursorType action, Event &event) { Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.h b/engines/tsage/ringworld2/ringworld2_scenes2.h index 90dd97a5e4..9fb408108c 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -141,15 +141,15 @@ public: }; class Scene2425 : public SceneExt { - class Item1 : public NamedHotspot { + class RopeDest1 : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item2 : public NamedHotspot { + class RopeDest2 : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item3 : public NamedHotspot { + class Crevasse : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -158,11 +158,11 @@ class Scene2425 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor1 : public SceneActor { + class Rope : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Pictographs : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -172,13 +172,13 @@ class Scene2425 : public SceneExt { virtual void changeScene(); }; public: - Item1 _item1; - Item2 _item2; - Item3 _item3; + RopeDest1 _ropeDest1; + RopeDest2 _ropeDest2; + Crevasse _crevasse; Item4 _item4; - Actor1 _actor1; - Actor2 _actor2; - Actor2 _actor3; + Rope _rope; + Pictographs _pictographs1; + Pictographs _pictographs2; Exit1 _exit1; SequenceManager _sequenceManager; @@ -333,15 +333,15 @@ public: }; class Scene2455 : public SceneExt { - class Actor1 : public SceneActor { + class Lamp : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Pool : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class ScrithKey : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -351,10 +351,10 @@ class Scene2455 : public SceneExt { virtual void changeScene(); }; public: - NamedHotspot _item1; - Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; + NamedHotspot _background; + Lamp _lamp; + Pool _pool; + ScrithKey _scrithKey; Exit1 _exit1; SequenceManager _sequenceManager; @@ -390,7 +390,7 @@ class Scene2525 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class GlassDome : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -407,7 +407,7 @@ public: Item5 _item5; SceneActor _actor1; SceneActor _actor2; - Actor3 _actor3; + GlassDome _glassDome; Exit1 _exit1; SequenceManager _sequenceManager; -- cgit v1.2.3 From c6ef07f651645658d107e72a6f1a5216a88a318b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 17 Sep 2013 22:52:58 -0400 Subject: TSAGE: Fixes and renaming for the R2R inventory list --- engines/tsage/ringworld2/ringworld2_logic.cpp | 203 ++++++++++++------------ engines/tsage/ringworld2/ringworld2_logic.h | 100 ++++++------ engines/tsage/ringworld2/ringworld2_scenes2.cpp | 49 +++--- engines/tsage/ringworld2/ringworld2_scenes2.h | 12 +- 4 files changed, 182 insertions(+), 182 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 9dbff39fcc..a607ebe6a4 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -782,116 +782,115 @@ bool DisplayObject::performAction(int action) { Ringworld2InvObjectList::Ringworld2InvObjectList(): _none(1, 1), - _inv1(1, 2), - _inv2(1, 3), + _optoDisk(1, 2), + _reader(1, 3), _negatorGun(1, 4), _steppingDisks(1, 5), - _inv5(1, 6), - _inv6(1, 7), - _inv7(1, 8), - _inv8(1, 9), - _inv9(1, 10), - _inv10(1, 11), - _inv11(1, 12), - _inv12(1, 13), - _inv13(1, 14), - _inv14(1, 15), - _inv15(1, 16), - _inv16(1, 17), - _inv17(2, 2), - _inv18(2, 3), - _inv19(2, 4), - _inv20(2, 5), - _inv21(2, 5), - _inv22(2, 6), - _inv23(2, 7), - _inv24(2, 8), - _inv25(2, 9), - _inv26(2, 10), - _inv27(2, 11), - _inv28(2, 12), - _inv29(2, 13), - _inv30(2, 14), - _inv31(2, 15), - _inv32(2, 16), - _inv33(3, 2), - _inv34(3, 3), - _inv35(3, 4), - _inv36(3, 5), - _inv37(3, 6), - _inv38(3, 7), - _inv39(1, 10), - _inv40(3, 8), - _inv41(3, 9), - _inv42(3, 10), - _inv43(3, 11), - _inv44(3, 12), - _inv45(3, 13), - _inv46(3, 17), - _inv47(3, 14), - _inv48(3, 14), - _inv49(3, 15), - _inv50(3, 15), - _inv51(3, 17), - _inv52(4, 2) { + _attractorUnit(1, 6), + _sensorProbe(1, 7), + _sonicStunner(1, 8), + _cableHarness(1, 9), + _comScanner(1, 10), + _spentPowerCapsule(1, 11), // 10 + _chargedPowerCapsule(1, 12), + _aerosol(1, 13), + _remoteControl(1, 14), + _opticalFibre(1, 15), + _clamp(1, 16), + _attractorHarness(1, 17), + _fuelCell(2, 2), + _gyroscope(2, 3), + _airbag(2, 4), + _rebreatherTank(2, 5), // 20 + _reserveTank(2, 5), + _guidanceModule(2, 6), + _thrusterValve(2, 7), + _balloonBackpack(2, 8), + _radarMechanism(2, 9), + _joystick(2, 10), + _ignitor(2, 11), + _diagnosticsDisplay(2, 12), + _glassDome(2, 13), + _wickLamp(2, 14), // 30 + _scrithKey(2, 15), + _tannerMask(2, 16), + _pureGrainAlcohol(3, 2), + _blueSapphire(3, 3), + _ancientScrolls(3, 4), + _flute(3, 5), + _gunpowder(3, 6), + _unused(3, 7), + _comScanner2(1, 10), + _superconductorWire(3, 8), // 40 + _pillow(3, 9), + _foodTray(3, 10), + _laserHacksaw(3, 11), + _photonStunner(3, 12), + _battery(3, 13), + _soakedFaceMask(2, 17), + _lightBulb(3, 14), + _alcoholLamp1(2, 14), + _alcoholLamp2(3, 15), + _alocholLamp3(3, 15), // 50 + _brokenDisplay(3, 17), + _toolbox(4, 2) { // Add the items to the list _itemList.push_back(&_none); - _itemList.push_back(&_inv1); - _itemList.push_back(&_inv2); + _itemList.push_back(&_optoDisk); + _itemList.push_back(&_reader); _itemList.push_back(&_negatorGun); _itemList.push_back(&_steppingDisks); - _itemList.push_back(&_inv5); - _itemList.push_back(&_inv6); - _itemList.push_back(&_inv7); - _itemList.push_back(&_inv8); - _itemList.push_back(&_inv9); - _itemList.push_back(&_inv10); - _itemList.push_back(&_inv11); - _itemList.push_back(&_inv12); - _itemList.push_back(&_inv13); - _itemList.push_back(&_inv14); - _itemList.push_back(&_inv15); - _itemList.push_back(&_inv16); - _itemList.push_back(&_inv17); - _itemList.push_back(&_inv18); - _itemList.push_back(&_inv19); - _itemList.push_back(&_inv20); - _itemList.push_back(&_inv21); - _itemList.push_back(&_inv22); - _itemList.push_back(&_inv23); - _itemList.push_back(&_inv24); - _itemList.push_back(&_inv25); - _itemList.push_back(&_inv26); - _itemList.push_back(&_inv27); - _itemList.push_back(&_inv28); - _itemList.push_back(&_inv29); - _itemList.push_back(&_inv30); - _itemList.push_back(&_inv31); - _itemList.push_back(&_inv32); - _itemList.push_back(&_inv33); - _itemList.push_back(&_inv34); - _itemList.push_back(&_inv35); - _itemList.push_back(&_inv36); - _itemList.push_back(&_inv37); - _itemList.push_back(&_inv38); - _itemList.push_back(&_inv39); - _itemList.push_back(&_inv40); - _itemList.push_back(&_inv41); - _itemList.push_back(&_inv42); - _itemList.push_back(&_inv43); - _itemList.push_back(&_inv44); - _itemList.push_back(&_inv45); - _itemList.push_back(&_inv46); - _itemList.push_back(&_inv47); - _itemList.push_back(&_inv48); - _itemList.push_back(&_inv49); - _itemList.push_back(&_inv50); - _itemList.push_back(&_inv51); - _itemList.push_back(&_inv52); + _itemList.push_back(&_attractorUnit); + _itemList.push_back(&_sensorProbe); + _itemList.push_back(&_sonicStunner); + _itemList.push_back(&_cableHarness); + _itemList.push_back(&_comScanner); + _itemList.push_back(&_spentPowerCapsule); // 10 + _itemList.push_back(&_chargedPowerCapsule); + _itemList.push_back(&_aerosol); + _itemList.push_back(&_remoteControl); + _itemList.push_back(&_opticalFibre); + _itemList.push_back(&_clamp); + _itemList.push_back(&_attractorHarness); + _itemList.push_back(&_fuelCell); + _itemList.push_back(&_gyroscope); + _itemList.push_back(&_airbag); + _itemList.push_back(&_rebreatherTank); // 20 + _itemList.push_back(&_reserveTank); + _itemList.push_back(&_guidanceModule); + _itemList.push_back(&_thrusterValve); + _itemList.push_back(&_balloonBackpack); + _itemList.push_back(&_radarMechanism); + _itemList.push_back(&_joystick); + _itemList.push_back(&_ignitor); + _itemList.push_back(&_diagnosticsDisplay); + _itemList.push_back(&_glassDome); + _itemList.push_back(&_wickLamp); // 30 + _itemList.push_back(&_scrithKey); + _itemList.push_back(&_tannerMask); + _itemList.push_back(&_pureGrainAlcohol); + _itemList.push_back(&_blueSapphire); + _itemList.push_back(&_ancientScrolls); + _itemList.push_back(&_flute); + _itemList.push_back(&_gunpowder); + _itemList.push_back(&_unused); + _itemList.push_back(&_comScanner2); + _itemList.push_back(&_superconductorWire); // 40 + _itemList.push_back(&_pillow); + _itemList.push_back(&_foodTray); + _itemList.push_back(&_laserHacksaw); + _itemList.push_back(&_photonStunner); + _itemList.push_back(&_battery); + _itemList.push_back(&_soakedFaceMask); + _itemList.push_back(&_lightBulb); + _itemList.push_back(&_alcoholLamp1); + _itemList.push_back(&_alcoholLamp2); + _itemList.push_back(&_alocholLamp3); // 50 + _itemList.push_back(&_brokenDisplay); + _itemList.push_back(&_toolbox); _selectedItem = NULL; - } void Ringworld2InvObjectList::reset() { @@ -1065,7 +1064,7 @@ bool Ringworld2InvObjectList::SelectItem(int objectNumber) { currentItem == R2_PURE_GRAIN_ALCOHOL) { R2_INVENTORY.setObjectScene(R2_TANNER_MASK, 0); R2_INVENTORY.setObjectScene(R2_PURE_GRAIN_ALCOHOL, 0); - R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, 1); + R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, R2_SEEKER); } else { selectDefault(objectNumber); } diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index c7e36fc5f0..b3d501935b 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -163,58 +163,58 @@ private: static void selectDefault(int obectNumber); public: InvObject _none; - InvObject _inv1; - InvObject _inv2; + InvObject _optoDisk; + InvObject _reader; InvObject _negatorGun; InvObject _steppingDisks; - InvObject _inv5; - InvObject _inv6; - InvObject _inv7; - InvObject _inv8; - InvObject _inv9; - InvObject _inv10; - InvObject _inv11; - InvObject _inv12; - InvObject _inv13; - InvObject _inv14; - InvObject _inv15; - InvObject _inv16; - InvObject _inv17; - InvObject _inv18; - InvObject _inv19; - InvObject _inv20; - InvObject _inv21; - InvObject _inv22; - InvObject _inv23; - InvObject _inv24; - InvObject _inv25; - InvObject _inv26; - InvObject _inv27; - InvObject _inv28; - InvObject _inv29; - InvObject _inv30; - InvObject _inv31; - InvObject _inv32; - InvObject _inv33; - InvObject _inv34; - InvObject _inv35; - InvObject _inv36; - InvObject _inv37; - InvObject _inv38; - InvObject _inv39; - InvObject _inv40; - InvObject _inv41; - InvObject _inv42; - InvObject _inv43; - InvObject _inv44; - InvObject _inv45; - InvObject _inv46; - InvObject _inv47; - InvObject _inv48; - InvObject _inv49; - InvObject _inv50; - InvObject _inv51; - InvObject _inv52; + InvObject _attractorUnit; + InvObject _sensorProbe; + InvObject _sonicStunner; + InvObject _cableHarness; + InvObject _comScanner; + InvObject _spentPowerCapsule; // 10 + InvObject _chargedPowerCapsule; + InvObject _aerosol; + InvObject _remoteControl; + InvObject _opticalFibre; + InvObject _clamp; + InvObject _attractorHarness; + InvObject _fuelCell; + InvObject _gyroscope; + InvObject _airbag; + InvObject _rebreatherTank; // 20 + InvObject _reserveTank; + InvObject _guidanceModule; + InvObject _thrusterValve; + InvObject _balloonBackpack; + InvObject _radarMechanism; + InvObject _joystick; + InvObject _ignitor; + InvObject _diagnosticsDisplay; + InvObject _glassDome; + InvObject _wickLamp; // 30 + InvObject _scrithKey; + InvObject _tannerMask; + InvObject _pureGrainAlcohol; + InvObject _blueSapphire; + InvObject _ancientScrolls; + InvObject _flute; + InvObject _gunpowder; + InvObject _unused; + InvObject _comScanner2; + InvObject _superconductorWire; // 40 + InvObject _pillow; + InvObject _foodTray; + InvObject _laserHacksaw; + InvObject _photonStunner; + InvObject _battery; + InvObject _soakedFaceMask; + InvObject _lightBulb; + InvObject _alcoholLamp1; + InvObject _alcoholLamp2; + InvObject _alocholLamp3; // 50 + InvObject _brokenDisplay; + InvObject _toolbox; Ringworld2InvObjectList(); void reset(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index d91c8f4afd..cc50de0cf5 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -349,9 +349,9 @@ void Scene2000::initExits() { break; case 23: _northExit._enabled = true; - _northExit._bounds.set(108, 83, 128, 184); + _northExit._bounds.set(108, 83, 184, 125); _northExit.setDest(Common::Point(135, 129)); - _northExit._cursorNum = CURSOR_INVALID; + _northExit._cursorNum = EXITCURSOR_NE; loadScene(2275); R2_GLOBALS._walkRegions.load(2000); if (!_exitingFlag) @@ -2648,7 +2648,7 @@ void Scene2525::signal() { * *--------------------------------------------------------------------------*/ -bool Scene2530::Actor2::startAction(CursorType action, Event &event) { +bool Scene2530::Flask::startAction(CursorType action, Event &event) { Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -2657,7 +2657,7 @@ bool Scene2530::Actor2::startAction(CursorType action, Event &event) { if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2530; - scene->setAction(&scene->_sequenceManager, scene, 2530, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2530, &R2_GLOBALS._player, &scene->_flask, NULL); } else { SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } @@ -2665,29 +2665,29 @@ bool Scene2530::Actor2::startAction(CursorType action, Event &event) { return true; } -bool Scene2530::Actor3::startAction(CursorType action, Event &event) { +bool Scene2530::Crank::startAction(CursorType action, Event &event) { Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS.getFlag(73)) SceneItem::display(2530, 35, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2532; - scene->setAction(&scene->_sequenceManager, scene, 2532, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2532, &R2_GLOBALS._player, &scene->_crank, NULL); } } else { if (R2_GLOBALS.getFlag(73)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2533; - scene->setAction(&scene->_sequenceManager, scene, 2533, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2533, &R2_GLOBALS._player, &scene->_crank, NULL); } else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2531; - scene->setAction(&scene->_sequenceManager, scene, 2531, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 2531, &R2_GLOBALS._player, &scene->_crank, NULL); } } @@ -2715,22 +2715,22 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { _exit1.setDest(Common::Point(108, 160)); if (R2_INVENTORY.getObjectScene(R2_PURE_GRAIN_ALCOHOL) == 2530) { - _actor2.postInit(); - _actor2.setup(2435, 1, 3); - _actor2.setPosition(Common::Point(299, 80)); - _actor2.fixPriority(80); - _actor2.setDetails(2530, 28, -1, -1, 1, (SceneItem *)NULL); + _flask.postInit(); + _flask.setup(2435, 1, 3); + _flask.setPosition(Common::Point(299, 80)); + _flask.fixPriority(80); + _flask.setDetails(2530, 28, -1, -1, 1, (SceneItem *)NULL); } - _actor3.postInit(); + _crank.postInit(); if (R2_GLOBALS.getFlag(73)) { - _actor3.setup(2531, 4, 2); - _actor3.setPosition(Common::Point(154, 130)); + _crank.setup(2531, 4, 2); + _crank.setPosition(Common::Point(154, 130)); } else { - _actor3.setup(2531, 4, 1); - _actor3.setPosition(Common::Point(173, 131)); + _crank.setup(2531, 4, 1); + _crank.setPosition(Common::Point(173, 131)); } - _actor3.setDetails(2530, 22, -1, -1, 1, (SceneItem *)NULL); + _crank.setDetails(2530, 22, -1, -1, 1, (SceneItem *)NULL); R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -2759,8 +2759,8 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { _item2.setDetails(Rect(108, 90, 135, 205), 2530, 22, -1, -1, 1, NULL); _item5.setDetails(Rect(115, 112, 206, 130), 2530, 25, -1, 27, 1, NULL); - _item3.setDetails(Rect(256, 64, 311, 85), 2530, 31, -1, 33, 1, NULL); - _item1.setDetails(Rect(0, 0, 320, 200), 2530, 0, 1, -1, 1, NULL); + _shelf.setDetails(Rect(256, 64, 311, 85), 2530, 31, -1, 33, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 2530, 0, 1, -1, 1, NULL); R2_GLOBALS._player.disableControl(); @@ -2783,7 +2783,8 @@ void Scene2530::signal() { break; case 2530: R2_INVENTORY.setObjectScene(R2_PURE_GRAIN_ALCOHOL, 2); - _actor2.remove(); + _flask.remove(); + R2_GLOBALS._player.enableControl(); break; case 2531: // No break on purpose @@ -2946,7 +2947,7 @@ void Scene2535::signal() { g_globals->_sceneManager.changeScene(2000); break; case 2535: - R2_INVENTORY.setObjectScene(R2_TANNER_MASK, 2); + R2_INVENTORY.setObjectScene(R2_TANNER_MASK, R2_SEEKER); _tannerMask.remove(); R2_GLOBALS._player.enableControl(); break; diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.h b/engines/tsage/ringworld2/ringworld2_scenes2.h index 9fb408108c..f90126b5a1 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.h +++ b/engines/tsage/ringworld2/ringworld2_scenes2.h @@ -417,11 +417,11 @@ public: }; class Scene2530 : public SceneExt { - class Actor2 : public SceneActor { + class Flask : public SceneActor { public: bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Crank : public SceneActor { public: bool startAction(CursorType action, Event &event); }; @@ -431,14 +431,14 @@ class Scene2530 : public SceneExt { virtual void changeScene(); }; public: - NamedHotspot _item1; + NamedHotspot _background; NamedHotspot _item2; - NamedHotspot _item3; + NamedHotspot _shelf; NamedHotspot _item4; NamedHotspot _item5; SceneActor _actor1; - Actor2 _actor2; - Actor3 _actor3; + Flask _flask; + Crank _crank; Exit1 _exit1; SequenceManager _sequenceManager; -- cgit v1.2.3 From 5d25dd3b365d2f74d90f3838013dbb90d3a72f60 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:04:36 +0400 Subject: FULLPIPE: Remove C* prefixes from motion classes --- engines/fullpipe/gameloader.cpp | 6 +-- engines/fullpipe/gameloader.h | 8 ++-- engines/fullpipe/motion.cpp | 96 ++++++++++++++++++++--------------------- engines/fullpipe/motion.h | 58 ++++++++++++------------- engines/fullpipe/scenes.cpp | 14 +++--- engines/fullpipe/utils.cpp | 48 ++++++++++----------- 6 files changed, 115 insertions(+), 115 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 2a8f64dac9..6abe26743f 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -35,10 +35,10 @@ CInventory2 *getGameLoaderInventory() { return &g_fullpipe->_gameLoader->_inventory; } -CMctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId) { +MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId) { for (uint i = 0; i < g_fullpipe->_gameLoader->_sc2array.size(); i++) if (g_fullpipe->_gameLoader->_sc2array[i]._sceneId == sceneId) - return (CMctlCompound *)g_fullpipe->_gameLoader->_sc2array[i]._motionController; + return (MctlCompound *)g_fullpipe->_gameLoader->_sc2array[i]._motionController; return 0; } @@ -425,7 +425,7 @@ bool Sc2::load(MfcArchive &file) { _sceneId = file.readUint16LE(); - _motionController = (CMotionController *)file.readClass(); + _motionController = (MotionController *)file.readClass(); _count1 = file.readUint32LE(); debug(4, "count1: %d", _count1); diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index 2f1f57a5e2..db691005f9 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -30,17 +30,17 @@ namespace Fullpipe { class SceneTag; -class CMctlCompound; +class MctlCompound; class CInputController; class CInteractionController; -class CMotionController; +class MotionController; class Sc2 : public CObject { public: int16 _sceneId; int16 _field_2; Scene *_scene; - CMotionController *_motionController; + MotionController *_motionController; int32 *_data1; // FIXME, could be a struct int _count1; PicAniInfo **_defPicAniInfos; @@ -110,7 +110,7 @@ class CGameLoader : public CObject { CInventory2 *getGameLoaderInventory(); CInteractionController *getGameLoaderInteractionController(); -CMctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId); +MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId); } // End of namespace Fullpipe diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 1d46f7994f..022eef87be 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -32,31 +32,31 @@ namespace Fullpipe { -bool CMotionController::load(MfcArchive &file) { +bool MotionController::load(MfcArchive &file) { // Is originally empty file.readClass(); - debug(5, "CMotionController::load()"); + debug(5, "MotionController::load()"); return true; } -bool CMctlCompound::load(MfcArchive &file) { - debug(5, "CMctlCompound::load()"); +bool MctlCompound::load(MfcArchive &file) { + debug(5, "MctlCompound::load()"); int count = file.readUint32LE(); - debug(6, "CMctlCompound::count = %d", count); + debug(6, "MctlCompound::count = %d", count); for (int i = 0; i < count; i++) { debug(6, "CompoundArray[%d]", i); - CMctlCompoundArrayItem *obj = (CMctlCompoundArrayItem *)file.readClass(); + MctlCompoundArrayItem *obj = (MctlCompoundArrayItem *)file.readClass(); int count1 = file.readUint32LE(); debug(6, "ConnectionPoint::count: %d", count1); for (int j = 0; j < count1; j++) { debug(6, "ConnectionPoint[%d]", j); - CMctlConnectionPoint *obj1 = (CMctlConnectionPoint *)file.readClass(); + MctlConnectionPoint *obj1 = (MctlConnectionPoint *)file.readClass(); obj->_connectionPoints.push_back(*obj1); } @@ -65,7 +65,7 @@ bool CMctlCompound::load(MfcArchive &file) { obj->_field_24 = file.readUint32LE(); debug(6, "graphReact"); - obj->_movGraphReactObj = (CMovGraphReact *)file.readClass(); + obj->_movGraphReactObj = (MovGraphReact *)file.readClass(); _motionControllers.push_back(*obj); } @@ -73,53 +73,53 @@ bool CMctlCompound::load(MfcArchive &file) { return true; } -void CMctlCompound::addObject(StaticANIObject *obj) { - warning("STUB: CMctlCompound::addObject()"); +void MctlCompound::addObject(StaticANIObject *obj) { + warning("STUB: MctlCompound::addObject()"); } -void CMctlCompound::initMovGraph2() { - warning("STUB: CMctlCompound::initMovGraph2()"); +void MctlCompound::initMovGraph2() { + warning("STUB: MctlCompound::initMovGraph2()"); } -MessageQueue *CMctlCompound::method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { - warning("STUB: CMctlCompound::method34()"); +MessageQueue *MctlCompound::method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { + warning("STUB: MctlCompound::method34()"); return 0; } -MessageQueue *CMctlCompound::method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { - warning("STUB: CMctlCompound::method4C()"); +MessageQueue *MctlCompound::method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { + warning("STUB: MctlCompound::method4C()"); return 0; } -bool CMctlCompoundArray::load(MfcArchive &file) { - debug(5, "CMctlCompoundArray::load()"); +bool MctlCompoundArray::load(MfcArchive &file) { + debug(5, "MctlCompoundArray::load()"); int count = file.readUint32LE(); - debug(0, "CMctlCompoundArray::count = %d", count); + debug(0, "MctlCompoundArray::count = %d", count); assert(0); return true; } -int CMovGraph_messageHandler(ExCommand *cmd); +int MovGraph_messageHandler(ExCommand *cmd); -CMovGraph::CMovGraph() { - warning("STUB: CMovGraph::CMovGraph()"); +MovGraph::MovGraph() { + warning("STUB: MovGraph::MovGraph()"); _itemsCount = 0; _items = 0; - //_callback1 = CMovGraphCallback1; // TODO + //_callback1 = MovGraphCallback1; // TODO _field_44 = 0; - insertMessageHandler(CMovGraph_messageHandler, getMessageHandlersCount() - 1, 129); + insertMessageHandler(MovGraph_messageHandler, getMessageHandlersCount() - 1, 129); _objtype = kObjTypeMovGraph; } -bool CMovGraph::load(MfcArchive &file) { - debug(5, "CMovGraph::load()"); +bool MovGraph::load(MfcArchive &file) { + debug(5, "MovGraph::load()"); _links.load(file); _nodes.load(file); @@ -127,24 +127,24 @@ bool CMovGraph::load(MfcArchive &file) { return true; } -void CMovGraph::addObject(StaticANIObject *obj) { - warning("STUB: CMovGraph::addObject()"); +void MovGraph::addObject(StaticANIObject *obj) { + warning("STUB: MovGraph::addObject()"); } -double CMovGraph::calcDistance(Common::Point *point, CMovGraphLink *link, int flag) { - warning("STUB: CMovGraph::calcDistance()"); +double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int flag) { + warning("STUB: MovGraph::calcDistance()"); return 0; } -CMovGraphNode *CMovGraph::calcOffset(int ox, int oy) { - warning("STUB: CMovGraph::calcOffset()"); +MovGraphNode *MovGraph::calcOffset(int ox, int oy) { + warning("STUB: MovGraph::calcOffset()"); return 0; } -CMovGraphLink::CMovGraphLink() { +MovGraphLink::MovGraphLink() { _distance = 0; _angle = 0; _flags = 0x10000000; @@ -156,8 +156,8 @@ CMovGraphLink::CMovGraphLink() { _name = 0; } -bool CMovGraphLink::load(MfcArchive &file) { - debug(5, "CMovGraphLink::load()"); +bool MovGraphLink::load(MfcArchive &file) { + debug(5, "MovGraphLink::load()"); _dwordArray1.load(file); _dwordArray2.load(file); @@ -165,23 +165,23 @@ bool CMovGraphLink::load(MfcArchive &file) { _flags = file.readUint32LE(); debug(8, "GraphNode1"); - _movGraphNode1 = (CMovGraphNode *)file.readClass(); + _movGraphNode1 = (MovGraphNode *)file.readClass(); debug(8, "GraphNode2"); - _movGraphNode2 = (CMovGraphNode *)file.readClass(); + _movGraphNode2 = (MovGraphNode *)file.readClass(); _distance = file.readDouble(); _angle = file.readDouble(); debug(8, "distance: %g, angle: %g", _distance, _angle); - _movGraphReact = (CMovGraphReact *)file.readClass(); + _movGraphReact = (MovGraphReact *)file.readClass(); _name = file.readPascalString(); return true; } -bool CMovGraphNode::load(MfcArchive &file) { - debug(5, "CMovGraphNode::load()"); +bool MovGraphNode::load(MfcArchive &file) { + debug(5, "MovGraphNode::load()"); _field_14 = file.readUint32LE(); _x = file.readUint32LE(); @@ -191,7 +191,7 @@ bool CMovGraphNode::load(MfcArchive &file) { return true; } -CReactParallel::CReactParallel() { +ReactParallel::ReactParallel() { _x1 = 0; _x2 = 0; _dy = 0; @@ -201,8 +201,8 @@ CReactParallel::CReactParallel() { _y2 = 0; } -bool CReactParallel::load(MfcArchive &file) { - debug(5, "CReactParallel::load()"); +bool ReactParallel::load(MfcArchive &file) { + debug(5, "ReactParallel::load()"); _x1 = file.readUint32LE(); _y1 = file.readUint32LE(); @@ -216,7 +216,7 @@ bool CReactParallel::load(MfcArchive &file) { return true; } -void CReactParallel::createRegion() { +void ReactParallel::createRegion() { _points = (Common::Point **)malloc(sizeof(Common::Point *) * 4); for (int i = 0; i < 4; i++) @@ -241,15 +241,15 @@ void CReactParallel::createRegion() { // GdiObject::Attach(_rgn, CreatePolygonRgn(_points, 4, 2); } -CReactPolygonal::CReactPolygonal() { +ReactPolygonal::ReactPolygonal() { _field_C = 0; _points = 0; _pointCount = 0; _field_10 = 0; } -bool CReactPolygonal::load(MfcArchive &file) { - debug(5, "CReactPolygonal::load()"); +bool ReactPolygonal::load(MfcArchive &file) { + debug(5, "ReactPolygonal::load()"); _field_C = file.readUint32LE(); _field_10 = file.readUint32LE(); @@ -272,7 +272,7 @@ bool CReactPolygonal::load(MfcArchive &file) { return true; } -void CReactPolygonal::createRegion() { +void ReactPolygonal::createRegion() { if (_points) { // GdiObject::Attach(_rgn, CreatePolygonRgn(_points, _pointCount, 2); diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 79739845c2..332a494e1c 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -29,13 +29,13 @@ int startWalkTo(int objId, int objKey, int x, int y, int a5); int doSomeAnimation(int objId, int objKey, int a3); int doSomeAnimation2(int objId, int objKey); -class CMotionController : public CObject { +class MotionController : public CObject { public: int _field_4; bool _isEnabled; public: - CMotionController() : _isEnabled(true) {} + MotionController() : _isEnabled(true) {} virtual bool load(MfcArchive &file); void setEnabled() { _isEnabled = true; } @@ -45,18 +45,18 @@ class CMotionController : public CObject { virtual void freeItems() {} }; -class CMctlCompoundArray : public Common::Array, public CObject { +class MctlCompoundArray : public Common::Array, public CObject { public: virtual bool load(MfcArchive &file); }; -class CMctlConnectionPointsArray : public Common::Array, public CObject { +class MctlConnectionPointsArray : public Common::Array, public CObject { public: virtual bool load(MfcArchive &file); }; -class CMctlCompound : public CMotionController { - CMctlCompoundArray _motionControllers; +class MctlCompound : public MotionController { + MctlCompoundArray _motionControllers; public: virtual bool load(MfcArchive &file); @@ -76,7 +76,7 @@ class Unk2 : public CObject { Unk2() : _items(0), _count(0) {} }; -class CMovGraphNode : public CObject { +class MovGraphNode : public CObject { public: int _x; int _y; @@ -85,30 +85,30 @@ class CMovGraphNode : public CObject { int _field_14; public: - CMovGraphNode() : _x(0), _y(0), _distance(0), _field_10(0), _field_14(0) {} + MovGraphNode() : _x(0), _y(0), _distance(0), _field_10(0), _field_14(0) {} virtual bool load(MfcArchive &file); }; -class CMovGraphReact : public CObject { +class MovGraphReact : public CObject { // Empty }; -class CMctlCompoundArrayItem : public CObject { - friend class CMctlCompound; +class MctlCompoundArrayItem : public CObject { + friend class MctlCompound; protected: - CMotionController *_motionControllerObj; - CMovGraphReact *_movGraphReactObj; - CMctlConnectionPointsArray _connectionPoints; + MotionController *_motionControllerObj; + MovGraphReact *_movGraphReactObj; + MctlConnectionPointsArray _connectionPoints; int _field_20; int _field_24; int _field_28; public: - CMctlCompoundArrayItem() : _movGraphReactObj(0) {} + MctlCompoundArrayItem() : _movGraphReactObj(0) {} }; -class CReactParallel : public CMovGraphReact { +class ReactParallel : public MovGraphReact { //CRgn _rgn; int _x1; int _y1; @@ -119,12 +119,12 @@ class CReactParallel : public CMovGraphReact { Common::Point **_points; public: - CReactParallel(); + ReactParallel(); virtual bool load(MfcArchive &file); void createRegion(); }; -class CReactPolygonal : public CMovGraphReact { +class ReactPolygonal : public MovGraphReact { //CRgn _rgn; int _field_C; int _field_10; @@ -132,15 +132,15 @@ class CReactPolygonal : public CMovGraphReact { Common::Point **_points; public: - CReactPolygonal(); + ReactPolygonal(); virtual bool load(MfcArchive &file); void createRegion(); }; -class CMovGraphLink : public CObject { +class MovGraphLink : public CObject { public: - CMovGraphNode *_movGraphNode1; - CMovGraphNode *_movGraphNode2; + MovGraphNode *_movGraphNode1; + MovGraphNode *_movGraphNode2; CDWordArray _dwordArray1; CDWordArray _dwordArray2; int _flags; @@ -148,15 +148,15 @@ class CMovGraphLink : public CObject { int _field_3C; double _distance; double _angle; - CMovGraphReact *_movGraphReact; + MovGraphReact *_movGraphReact; char *_name; public: - CMovGraphLink(); + MovGraphLink(); virtual bool load(MfcArchive &file); }; -class CMovGraph : public CMotionController { +class MovGraph : public MotionController { public: CObList _nodes; CObList _links; @@ -167,16 +167,16 @@ class CMovGraph : public CMotionController { Unk2 _unk2; public: - CMovGraph(); + MovGraph(); virtual bool load(MfcArchive &file); virtual void addObject(StaticANIObject *obj); - double calcDistance(Common::Point *point, CMovGraphLink *link, int flag); - CMovGraphNode *calcOffset(int ox, int oy); + double calcDistance(Common::Point *point, MovGraphLink *link, int flag); + MovGraphNode *calcOffset(int ox, int oy); }; -class CMctlConnectionPoint : public CObject { +class MctlConnectionPoint : public CObject { int _connectionX; int _connectionY; int _field_C; diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 7aec8652f0..a709d35f14 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -139,7 +139,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { if (_aniMan) { _aniMan2 = _aniMan; - CMctlCompound *cmp = getSc2MctlCompoundBySceneId(entrance->_sceneId); + MctlCompound *cmp = getSc2MctlCompoundBySceneId(entrance->_sceneId); cmp->initMovGraph2(); cmp->addObject(_aniMan); cmp->setEnabled(); @@ -1313,7 +1313,7 @@ int global_messageHandler4(ExCommand *cmd) { return 1; } -int CMovGraph_messageHandler(ExCommand *cmd) { +int MovGraph_messageHandler(ExCommand *cmd) { if (cmd->_messageKind != 17) return 0; @@ -1328,9 +1328,9 @@ int CMovGraph_messageHandler(ExCommand *cmd) { if (getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)->_objtype != kObjTypeMovGraph || !ani) return 0; - CMovGraph *gr = (CMovGraph *)getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId); + MovGraph *gr = (MovGraph *)getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId); - CMovGraphLink *link = 0; + MovGraphLink *link = 0; double mindistance = 1.0e10; Common::Point point; @@ -1338,17 +1338,17 @@ int CMovGraph_messageHandler(ExCommand *cmd) { point.x = ani->_ox; point.y = ani->_oy; - double dst = gr->calcDistance(&point, (CMovGraphLink *)(*i), 0); + double dst = gr->calcDistance(&point, (MovGraphLink *)(*i), 0); if (dst >= 0.0 && dst < mindistance) { mindistance = dst; - link = (CMovGraphLink *)(*i); + link = (MovGraphLink *)(*i); } } int top; if (link) { - CMovGraphNode *node = link->_movGraphNode1; + MovGraphNode *node = link->_movGraphNode1; double sq = (ani->_oy - node->_y) * (ani->_oy - node->_y) + (ani->_ox - node->_x) * (ani->_ox - node->_x); int off = (node->_field_14 >> 16) & 0xFF; diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index 2ba5a85e68..920c3e29cf 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -267,12 +267,12 @@ enum { kExCommand, kCObjstateCommand, kCGameVar, - kCMctlCompound, - kCMovGraph, - kCMovGraphLink, - kCMovGraphNode, - kCReactParallel, - kCReactPolygonal + kMctlCompound, + kMovGraph, + kMovGraphLink, + kMovGraphNode, + kReactParallel, + kReactPolygonal }; const struct { @@ -284,12 +284,12 @@ const struct { { "ExCommand", kExCommand }, { "CObjstateCommand", kCObjstateCommand }, { "CGameVar", kCGameVar }, - { "CMctlCompound", kCMctlCompound }, - { "CMovGraph", kCMovGraph }, - { "CMovGraphLink", kCMovGraphLink }, - { "CMovGraphNode", kCMovGraphNode }, - { "CReactParallel", kCReactParallel }, - { "CReactPolygonal", kCReactPolygonal }, + { "MctlCompound", kMctlCompound }, + { "MovGraph", kMovGraph }, + { "MovGraphLink", kMovGraphLink }, + { "MovGraphNode", kMovGraphNode }, + { "ReactParallel", kReactParallel }, + { "ReactPolygonal", kReactPolygonal }, { 0, 0 } }; @@ -316,18 +316,18 @@ static CObject *createObject(int objectId) { return new CObjstateCommand(); case kCGameVar: return new CGameVar(); - case kCMctlCompound: - return new CMctlCompound(); - case kCMovGraph: - return new CMovGraph(); - case kCMovGraphLink: - return new CMovGraphLink(); - case kCMovGraphNode: - return new CMovGraphNode(); - case kCReactParallel: - return new CReactParallel(); - case kCReactPolygonal: - return new CReactPolygonal(); + case kMctlCompound: + return new MctlCompound(); + case kMovGraph: + return new MovGraph(); + case kMovGraphLink: + return new MovGraphLink(); + case kMovGraphNode: + return new MovGraphNode(); + case kReactParallel: + return new ReactParallel(); + case kReactPolygonal: + return new ReactPolygonal(); default: error("Unknown objectId: %d", objectId); } -- cgit v1.2.3 From f70b737ad93544a905209ff9e002aad1f0db6050 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:08:31 +0400 Subject: FULLPIPE: Remove C* prefixes in utils.cpp --- engines/fullpipe/interaction.cpp | 4 ++-- engines/fullpipe/interaction.h | 2 +- engines/fullpipe/motion.h | 8 ++++---- engines/fullpipe/scenes.cpp | 2 +- engines/fullpipe/utils.cpp | 18 +++++++++--------- engines/fullpipe/utils.h | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp index dcc7e90145..cdcbf2ec16 100644 --- a/engines/fullpipe/interaction.cpp +++ b/engines/fullpipe/interaction.cpp @@ -40,7 +40,7 @@ bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId) { sceneId = g_fullpipe->_currentScene->_sceneId; CInteractionController *intC = getGameLoaderInteractionController(); - for (CObList::iterator i = intC->_interactions.begin(); i != intC->_interactions.end(); ++i) { + for (ObList::iterator i = intC->_interactions.begin(); i != intC->_interactions.end(); ++i) { CInteraction *intr = (CInteraction *)*i; if (intr->_sceneId > 0 && intr->_sceneId != sceneId) @@ -112,7 +112,7 @@ bool CInteractionController::handleInteraction(StaticANIObject *subj, GameObject MessageQueue *mq; ExCommand *ex; - for (CObList::iterator i = _interactions.begin(); i != _interactions.end(); ++i) { + for (ObList::iterator i = _interactions.begin(); i != _interactions.end(); ++i) { CInteraction *cinter = (CInteraction *)*i; if (!cinter->canInteract(subj, obj, invId)) diff --git a/engines/fullpipe/interaction.h b/engines/fullpipe/interaction.h index 28a03fb496..176ec940b9 100644 --- a/engines/fullpipe/interaction.h +++ b/engines/fullpipe/interaction.h @@ -61,7 +61,7 @@ class CInteraction : public CObject { class CInteractionController : public CObject { public: - CObList _interactions; + ObList _interactions; int16 _field_20; bool _flag24; diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 332a494e1c..e692c01726 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -141,8 +141,8 @@ class MovGraphLink : public CObject { public: MovGraphNode *_movGraphNode1; MovGraphNode *_movGraphNode2; - CDWordArray _dwordArray1; - CDWordArray _dwordArray2; + DWordArray _dwordArray1; + DWordArray _dwordArray2; int _flags; int _field_38; int _field_3C; @@ -158,8 +158,8 @@ class MovGraphLink : public CObject { class MovGraph : public MotionController { public: - CObList _nodes; - CObList _links; + ObList _nodes; + ObList _links; int _field_44; int _items; int _itemsCount; diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index a709d35f14..2195ee7585 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1334,7 +1334,7 @@ int MovGraph_messageHandler(ExCommand *cmd) { double mindistance = 1.0e10; Common::Point point; - for (CObList::iterator i = gr->_links.begin(); i != gr->_links.end(); ++i) { + for (ObList::iterator i = gr->_links.begin(); i != gr->_links.end(); ++i) { point.x = ani->_ox; point.y = ani->_oy; diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index 920c3e29cf..f516fb49c5 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -44,14 +44,14 @@ bool CObject::loadFile(const char *fname) { return load(archive); } -bool CObList::load(MfcArchive &file) { - debug(5, "CObList::load()"); +bool ObList::load(MfcArchive &file) { + debug(5, "ObList::load()"); int count = file.readCount(); - debug(9, "CObList::count: %d:", count); + debug(9, "ObList::count: %d:", count); for (int i = 0; i < count; i++) { - debug(9, "CObList::[%d]", i); + debug(9, "ObList::[%d]", i); CObject *t = file.readClass(); push_back(t); @@ -60,8 +60,8 @@ bool CObList::load(MfcArchive &file) { return true; } -bool CObArray::load(MfcArchive &file) { - debug(5, "CObArray::load()"); +bool ObArray::load(MfcArchive &file) { + debug(5, "ObArray::load()"); int count = file.readCount(); resize(count); @@ -75,11 +75,11 @@ bool CObArray::load(MfcArchive &file) { return true; } -bool CDWordArray::load(MfcArchive &file) { - debug(5, "CWordArray::load()"); +bool DWordArray::load(MfcArchive &file) { + debug(5, "DWordArray::load()"); int count = file.readCount(); - debug(9, "CDWordArray::count: %d", count); + debug(9, "DWordArray::count: %d", count); resize(count); diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index 2199706b9b..31bfe86041 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -83,7 +83,7 @@ class CObject { bool loadFile(const char *fname); }; -class CObList : public Common::List, public CObject { +class ObList : public Common::List, public CObject { public: virtual bool load(MfcArchive &file); }; @@ -135,12 +135,12 @@ class MemoryObject2 : public MemoryObject { void copyData(byte *src, int dataSize); }; -class CObArray : public Common::Array, public CObject { +class ObArray : public Common::Array, public CObject { public: virtual bool load(MfcArchive &file); }; -class CDWordArray : public Common::Array, public CObject { +class DWordArray : public Common::Array, public CObject { public: virtual bool load(MfcArchive &file); }; -- cgit v1.2.3 From 3bd3431ad421ba2832d79080b9e26c7967e8a50e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:12:22 +0400 Subject: FULLPIPE: Remove C* prefixes from interaction classes --- engines/fullpipe/gameloader.cpp | 4 ++-- engines/fullpipe/gameloader.h | 6 +++--- engines/fullpipe/interaction.cpp | 36 ++++++++++++++++++------------------ engines/fullpipe/interaction.h | 8 ++++---- engines/fullpipe/utils.cpp | 20 ++++++++++---------- 5 files changed, 37 insertions(+), 37 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 6abe26743f..d130539c33 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -43,12 +43,12 @@ MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId) { return 0; } -CInteractionController *getGameLoaderInteractionController() { +InteractionController *getGameLoaderInteractionController() { return g_fullpipe->_gameLoader->_interactionController; } CGameLoader::CGameLoader() { - _interactionController = new CInteractionController(); + _interactionController = new InteractionController(); _inputController = new CInputController(); _gameProject = 0; diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index db691005f9..99f263e2d5 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -32,7 +32,7 @@ namespace Fullpipe { class SceneTag; class MctlCompound; class CInputController; -class CInteractionController; +class InteractionController; class MotionController; class Sc2 : public CObject { @@ -90,7 +90,7 @@ class CGameLoader : public CObject { void saveScenePicAniInfos(int sceneId); GameProject *_gameProject; - CInteractionController *_interactionController; + InteractionController *_interactionController; CInputController *_inputController; CInventory2 _inventory; Sc2Array _sc2array; @@ -109,7 +109,7 @@ class CGameLoader : public CObject { }; CInventory2 *getGameLoaderInventory(); -CInteractionController *getGameLoaderInteractionController(); +InteractionController *getGameLoaderInteractionController(); MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId); } // End of namespace Fullpipe diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp index cdcbf2ec16..9fd42c15ae 100644 --- a/engines/fullpipe/interaction.cpp +++ b/engines/fullpipe/interaction.cpp @@ -39,9 +39,9 @@ bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId) { if (g_fullpipe->_currentScene) sceneId = g_fullpipe->_currentScene->_sceneId; - CInteractionController *intC = getGameLoaderInteractionController(); + InteractionController *intC = getGameLoaderInteractionController(); for (ObList::iterator i = intC->_interactions.begin(); i != intC->_interactions.end(); ++i) { - CInteraction *intr = (CInteraction *)*i; + Interaction *intr = (Interaction *)*i; if (intr->_sceneId > 0 && intr->_sceneId != sceneId) break; @@ -55,17 +55,17 @@ bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId) { return false; } -bool CInteractionController::load(MfcArchive &file) { - debug(5, "CInteractionController::load()"); +bool InteractionController::load(MfcArchive &file) { + debug(5, "InteractionController::load()"); return _interactions.load(file); } int static_compSceneId = 0; -bool CInteractionController::compareInteractions(const void *p1, const void *p2) { - const CInteraction *i1 = (const CInteraction *)p1; - const CInteraction *i2 = (const CInteraction *)p2; +bool InteractionController::compareInteractions(const void *p1, const void *p2) { + const Interaction *i1 = (const Interaction *)p1; + const Interaction *i2 = (const Interaction *)p2; if (i2->_sceneId < i1->_sceneId) { if (i1->_sceneId != static_compSceneId) @@ -89,13 +89,13 @@ bool CInteractionController::compareInteractions(const void *p1, const void *p2) return true; } -void CInteractionController::sortInteractions(int sceneId) { +void InteractionController::sortInteractions(int sceneId) { static_compSceneId = sceneId; - Common::sort(_interactions.begin(), _interactions.end(), CInteractionController::compareInteractions); + Common::sort(_interactions.begin(), _interactions.end(), InteractionController::compareInteractions); } -bool CInteractionController::handleInteraction(StaticANIObject *subj, GameObject *obj, int invId) { +bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject *obj, int invId) { if (subj) { if (!subj->isIdle() || (subj->_flags & 0x100)) return false; @@ -104,8 +104,8 @@ bool CInteractionController::handleInteraction(StaticANIObject *subj, GameObject if (!_interactions.size()) return false; - CInteraction *inter = 0; - CInteraction *previnter = 0; + Interaction *inter = 0; + Interaction *previnter = 0; int dur = 0; int mindur = 0xFFFF; @@ -113,7 +113,7 @@ bool CInteractionController::handleInteraction(StaticANIObject *subj, GameObject ExCommand *ex; for (ObList::iterator i = _interactions.begin(); i != _interactions.end(); ++i) { - CInteraction *cinter = (CInteraction *)*i; + Interaction *cinter = (Interaction *)*i; if (!cinter->canInteract(subj, obj, invId)) continue; @@ -394,7 +394,7 @@ LABEL_38: return true; } -CInteraction::CInteraction() { +Interaction::Interaction() { _objectId1 = 0; _objectId2 = 0; _staticsId1 = 0; @@ -411,8 +411,8 @@ CInteraction::CInteraction() { _actionName = 0; } -bool CInteraction::load(MfcArchive &file) { - debug(5, "CInteraction::load()"); +bool Interaction::load(MfcArchive &file) { + debug(5, "Interaction::load()"); _objectId1 = file.readUint16LE(); _objectId2 = file.readUint16LE(); @@ -432,7 +432,7 @@ bool CInteraction::load(MfcArchive &file) { return true; } -bool CInteraction::canInteract(GameObject *obj1, GameObject *obj2, int invId) { +bool Interaction::canInteract(GameObject *obj1, GameObject *obj2, int invId) { if (_sceneId > 0 && g_fullpipe->_currentScene && g_fullpipe->_currentScene->_sceneId != _sceneId) return false; @@ -489,7 +489,7 @@ bool CInteraction::canInteract(GameObject *obj1, GameObject *obj2, int invId) { return true; } -bool CInteraction::isOverlapping(StaticANIObject *subj, GameObject *obj) { +bool Interaction::isOverlapping(StaticANIObject *subj, GameObject *obj) { StaticANIObject *ani = (StaticANIObject *)obj; if (abs(_xOffs + obj->_ox - subj->_ox) <= 1 diff --git a/engines/fullpipe/interaction.h b/engines/fullpipe/interaction.h index 176ec940b9..f968cca8ee 100644 --- a/engines/fullpipe/interaction.h +++ b/engines/fullpipe/interaction.h @@ -35,7 +35,7 @@ int handleObjectInteraction(StaticANIObject *subject, GameObject *object, int in bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId); -class CInteraction : public CObject { +class Interaction : public CObject { public: int16 _objectId1; int16 _objectId2; @@ -53,13 +53,13 @@ class CInteraction : public CObject { char *_actionName; public: - CInteraction(); + Interaction(); virtual bool load(MfcArchive &file); bool canInteract(GameObject *obj1, GameObject *obj2, int invId); bool isOverlapping(StaticANIObject *subj, GameObject *obj); }; -class CInteractionController : public CObject { +class InteractionController : public CObject { public: ObList _interactions; int16 _field_20; @@ -69,7 +69,7 @@ class CInteractionController : public CObject { static bool compareInteractions(const void *p1, const void *p2); public: - CInteractionController() : _field_20(0), _flag24(true) {} + InteractionController() : _field_20(0), _flag24(true) {} virtual bool load(MfcArchive &file); diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index f516fb49c5..a35a275c95 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -262,7 +262,7 @@ double MfcArchive::readDouble() { enum { kNullObject, - kCInteraction, + kInteraction, kMessageQueue, kExCommand, kCObjstateCommand, @@ -279,17 +279,17 @@ const struct { const char *name; int id; } classMap[] = { - { "CInteraction", kCInteraction }, + { "CInteraction", kInteraction }, { "MessageQueue", kMessageQueue }, { "ExCommand", kExCommand }, { "CObjstateCommand", kCObjstateCommand }, { "CGameVar", kCGameVar }, - { "MctlCompound", kMctlCompound }, - { "MovGraph", kMovGraph }, - { "MovGraphLink", kMovGraphLink }, - { "MovGraphNode", kMovGraphNode }, - { "ReactParallel", kReactParallel }, - { "ReactPolygonal", kReactPolygonal }, + { "CMctlCompound", kMctlCompound }, + { "CMovGraph", kMovGraph }, + { "CMovGraphLink", kMovGraphLink }, + { "CMovGraphNode", kMovGraphNode }, + { "CReactParallel", kReactParallel }, + { "CReactPolygonal", kReactPolygonal }, { 0, 0 } }; @@ -306,8 +306,8 @@ static CObject *createObject(int objectId) { switch (objectId) { case kNullObject: return 0; - case kCInteraction: - return new CInteraction(); + case kInteraction: + return new Interaction(); case kMessageQueue: return new MessageQueue(); case kExCommand: -- cgit v1.2.3 From c354981037621fd1bc7b44381d0e7d24d984d5a6 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:14:56 +0400 Subject: FULLPIPE: Remove C* prefix from input classes --- engines/fullpipe/fullpipe.h | 6 +++--- engines/fullpipe/gameloader.cpp | 4 ++-- engines/fullpipe/gameloader.h | 4 ++-- engines/fullpipe/input.cpp | 14 +++++++------- engines/fullpipe/input.h | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 348ac2c9c5..7cc1397394 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -47,7 +47,7 @@ class BehaviorManager; class CBaseModalObject; class CGameLoader; class CGameVar; -class CInputController; +class InputController; class CInventory2; struct CursorInfo; struct EntranceInfo; @@ -103,7 +103,7 @@ public: bool loadGam(const char *fname, int scene = 0); CGameVar *getGameLoaderGameVar(); - CInputController *getGameLoaderInputController(); + InputController *getGameLoaderInputController(); int _gameProjectVersion; int _pictureScale; @@ -124,7 +124,7 @@ public: StaticANIObject *_aniMan2; byte *_globalPalette; - CInputController *_inputController; + InputController *_inputController; bool _inputDisabled; int _currentCheat; diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index d130539c33..7b68ff51ed 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -49,7 +49,7 @@ InteractionController *getGameLoaderInteractionController() { CGameLoader::CGameLoader() { _interactionController = new InteractionController(); - _inputController = new CInputController(); + _inputController = new InputController(); _gameProject = 0; _gameName = 0; @@ -503,7 +503,7 @@ CGameVar *FullpipeEngine::getGameLoaderGameVar() { return 0; } -CInputController *FullpipeEngine::getGameLoaderInputController() { +InputController *FullpipeEngine::getGameLoaderInputController() { if (_gameLoader) return _gameLoader->_inputController; else diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index 99f263e2d5..fe0ec95c4c 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -31,7 +31,7 @@ namespace Fullpipe { class SceneTag; class MctlCompound; -class CInputController; +class InputController; class InteractionController; class MotionController; @@ -91,7 +91,7 @@ class CGameLoader : public CObject { GameProject *_gameProject; InteractionController *_interactionController; - CInputController *_inputController; + InputController *_inputController; CInventory2 _inventory; Sc2Array _sc2array; void *_sceneSwitcher; diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp index dfd8d32168..4db0ffb49f 100644 --- a/engines/fullpipe/input.cpp +++ b/engines/fullpipe/input.cpp @@ -33,7 +33,7 @@ namespace Fullpipe { -CInputController::CInputController() { +InputController::InputController() { g_fullpipe->_inputController = this; _flag = 0; @@ -52,13 +52,13 @@ CInputController::CInputController() { _cursorItemPicture = 0; } -CInputController::~CInputController() { +InputController::~InputController() { removeMessageHandler(126, -1); g_fullpipe->_inputController = 0; } -void CInputController::setInputDisabled(bool state) { +void InputController::setInputDisabled(bool state) { _flag = state; g_fullpipe->_inputDisabled = state; } @@ -67,7 +67,7 @@ void setInputDisabled(bool state) { g_fullpipe->_inputController->setInputDisabled(state); } -void CInputController::addCursor(CursorInfo *cursor) { +void InputController::addCursor(CursorInfo *cursor) { CursorInfo *newc = new CursorInfo(cursor); Common::Point p; @@ -82,14 +82,14 @@ void CInputController::addCursor(CursorInfo *cursor) { _cursorsArray.push_back(newc); } -void CInputController::setCursorMode(bool enabled) { +void InputController::setCursorMode(bool enabled) { if (enabled) _inputFlags |= 1; else _inputFlags &= ~1; } -void CInputController::drawCursor(int x, int y) { +void InputController::drawCursor(int x, int y) { if (_cursorIndex == -1) return; @@ -105,7 +105,7 @@ void CInputController::drawCursor(int x, int y) { _cursorBounds.top + _cursorsArray[_cursorIndex]->itemPictureOffsY, 0, 0); } -void CInputController::setCursor(int cursorId) { +void InputController::setCursor(int cursorId) { if (_cursorIndex == -1 || _cursorsArray[_cursorIndex]->pictureId != cursorId) { _cursorIndex = -1; diff --git a/engines/fullpipe/input.h b/engines/fullpipe/input.h index 4b32e510e3..bfd547ae2f 100644 --- a/engines/fullpipe/input.h +++ b/engines/fullpipe/input.h @@ -45,7 +45,7 @@ struct CursorInfo { typedef Common::Array CursorsArray; -class CInputController { +class InputController { //CObject obj; int _flag; int _inputFlags; @@ -59,8 +59,8 @@ class CInputController { Picture *_cursorItemPicture; public: - CInputController(); - ~CInputController(); + InputController(); + ~InputController(); void setInputDisabled(bool state); void addCursor(CursorInfo *cursor); -- cgit v1.2.3 From 1ce1712b7ba5042ab88d1ad6d825d249836c7d7b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:17:19 +0400 Subject: FULLPIPE: Remove C* prefix from inventory classes --- engines/fullpipe/fullpipe.h | 4 ++-- engines/fullpipe/gameloader.cpp | 2 +- engines/fullpipe/gameloader.h | 4 ++-- engines/fullpipe/inventory.cpp | 50 ++++++++++++++++++++--------------------- engines/fullpipe/inventory.h | 8 +++---- 5 files changed, 34 insertions(+), 34 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 7cc1397394..24fa9db9aa 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -48,7 +48,7 @@ class CBaseModalObject; class CGameLoader; class CGameVar; class InputController; -class CInventory2; +class Inventory2; struct CursorInfo; struct EntranceInfo; class ExCommand; @@ -190,7 +190,7 @@ public: int32 _mapTable[200]; Scene *_inventoryScene; - CInventory2 *_inventory; + Inventory2 *_inventory; int _currSelectedInventoryItemId; int32 _updateTicks; diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 7b68ff51ed..3f8255c28f 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -31,7 +31,7 @@ namespace Fullpipe { -CInventory2 *getGameLoaderInventory() { +Inventory2 *getGameLoaderInventory() { return &g_fullpipe->_gameLoader->_inventory; } diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index fe0ec95c4c..2fe8bf730f 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -92,7 +92,7 @@ class CGameLoader : public CObject { GameProject *_gameProject; InteractionController *_interactionController; InputController *_inputController; - CInventory2 _inventory; + Inventory2 _inventory; Sc2Array _sc2array; void *_sceneSwitcher; bool (*_preloadCallback)(const PreloadItem &pre, int flag); @@ -108,7 +108,7 @@ class CGameLoader : public CObject { int _preloadEntranceId; }; -CInventory2 *getGameLoaderInventory(); +Inventory2 *getGameLoaderInventory(); InteractionController *getGameLoaderInteractionController(); MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId); diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp index ccedb57ce2..18ef3c4d97 100644 --- a/engines/fullpipe/inventory.cpp +++ b/engines/fullpipe/inventory.cpp @@ -30,8 +30,8 @@ namespace Fullpipe { -bool CInventory::load(MfcArchive &file) { - debug(5, "CInventory::load()"); +bool Inventory::load(MfcArchive &file) { + debug(5, "Inventory::load()"); _sceneId = file.readUint16LE(); int numInvs = file.readUint32LE(); @@ -52,7 +52,7 @@ bool CInventory::load(MfcArchive &file) { return true; } -int CInventory::getInventoryPoolItemIndexById(int itemId) { +int Inventory::getInventoryPoolItemIndexById(int itemId) { if (_itemsPool.size() <= 0) return -1; @@ -64,7 +64,7 @@ int CInventory::getInventoryPoolItemIndexById(int itemId) { return 0; } -bool CInventory::setItemFlags(int itemId, int flags) { +bool Inventory::setItemFlags(int itemId, int flags) { int idx = getInventoryPoolItemIndexById(itemId); if (idx < 0) @@ -75,7 +75,7 @@ bool CInventory::setItemFlags(int itemId, int flags) { return true; } -CInventory2::CInventory2() { +Inventory2::Inventory2() { _selectedId = -1; _field_48 = -1; _scene = 0; @@ -85,7 +85,7 @@ CInventory2::CInventory2() { _topOffset = -65; } -bool CInventory2::loadPartial(MfcArchive &file) { // CInventory2_SerializePartially +bool Inventory2::loadPartial(MfcArchive &file) { // Inventory2_SerializePartially int numInvs = file.readUint32LE(); for (int i = 0; i < numInvs; i++) { @@ -98,27 +98,27 @@ bool CInventory2::loadPartial(MfcArchive &file) { // CInventory2_SerializePartia return true; } -void CInventory2::addItem(int itemId, int count) { +void Inventory2::addItem(int itemId, int count) { if (getInventoryPoolItemIndexById(itemId) >= 0) _inventoryItems.push_back(new InventoryItem(itemId, count)); } -void CInventory2::addItem2(StaticANIObject *obj) { +void Inventory2::addItem2(StaticANIObject *obj) { if (getInventoryPoolItemIndexById(obj->_id) >= 0 && getInventoryPoolItemFieldCById(obj->_id) != 2) { addItem(obj->_id, 1); obj->hide(); } } -void CInventory2::removeItem(int itemId, int count) { - warning("STUB: CInventory2::removeItem(%d, %d)", itemId, count); +void Inventory2::removeItem(int itemId, int count) { + warning("STUB: Inventory2::removeItem(%d, %d)", itemId, count); } -void CInventory2::removeItem2(Scene *sceneObj, int itemId, int x, int y, int priority) { +void Inventory2::removeItem2(Scene *sceneObj, int itemId, int x, int y, int priority) { warning("STUB: void removeItem2(sc, %d, %d, %d, %d)", itemId, x, y, priority); } -int CInventory2::getCountItemsWithId(int itemId) { +int Inventory2::getCountItemsWithId(int itemId) { int res = 0; for (uint i = 0; i < _inventoryItems.size(); i++) { @@ -129,7 +129,7 @@ int CInventory2::getCountItemsWithId(int itemId) { return res; } -int CInventory2::getInventoryItemIndexById(int itemId) { +int Inventory2::getInventoryItemIndexById(int itemId) { for (uint i = 0; i < _inventoryItems.size(); i++) { if (_inventoryItems[i]->itemId == itemId) return i; @@ -138,11 +138,11 @@ int CInventory2::getInventoryItemIndexById(int itemId) { return -1; } -int CInventory2::getInventoryPoolItemIdAtIndex(int itemId) { +int Inventory2::getInventoryPoolItemIdAtIndex(int itemId) { return _itemsPool[itemId]->id; } -int CInventory2::getInventoryPoolItemFieldCById(int itemId) { +int Inventory2::getInventoryPoolItemFieldCById(int itemId) { for (uint i = 0; i < _itemsPool.size(); i++) { if (_itemsPool[i]->id == itemId) return _itemsPool[i]->field_C; @@ -151,7 +151,7 @@ int CInventory2::getInventoryPoolItemFieldCById(int itemId) { return 0; } -int CInventory2::getItemFlags(int itemId) { +int Inventory2::getItemFlags(int itemId) { int idx = getInventoryPoolItemIndexById(itemId); if (idx < 0) @@ -160,7 +160,7 @@ int CInventory2::getItemFlags(int itemId) { return _itemsPool[idx]->flags; } -void CInventory2::rebuildItemRects() { +void Inventory2::rebuildItemRects() { _scene = g_fullpipe->accessScene(_sceneId); if (!_scene) @@ -222,7 +222,7 @@ void CInventory2::rebuildItemRects() { } } -void CInventory2::draw() { +void Inventory2::draw() { if (!_scene) return; @@ -295,7 +295,7 @@ reset: } -void CInventory2::slideIn() { +void Inventory2::slideIn() { _isInventoryOut = false; ExCommand *ex = new ExCommand(0, 17, 65, 0, 0, 0, 1, 0, 0, 0); @@ -307,7 +307,7 @@ void CInventory2::slideIn() { ex->postMessage(); } -void CInventory2::slideOut() { +void Inventory2::slideOut() { _isInventoryOut = true; ExCommand *ex = new ExCommand(0, 17, 65, 0, 0, 0, 1, 0, 0, 0); @@ -319,7 +319,7 @@ void CInventory2::slideOut() { ex->postMessage(); } -bool CInventory2::handleLeftClick(ExCommand *cmd) { +bool Inventory2::handleLeftClick(ExCommand *cmd) { if (!_isInventoryOut) return false; @@ -353,7 +353,7 @@ bool CInventory2::handleLeftClick(ExCommand *cmd) { return res; } -int CInventory2::selectItem(int itemId) { +int Inventory2::selectItem(int itemId) { if (getInventoryItemIndexById(itemId) < 0) return -1; @@ -371,7 +371,7 @@ int CInventory2::selectItem(int itemId) { return _selectedId; } -bool CInventory2::unselectItem(bool flag) { +bool Inventory2::unselectItem(bool flag) { if (_selectedId < 0) return false; @@ -387,7 +387,7 @@ bool CInventory2::unselectItem(bool flag) { return true; } -int CInventory2::getHoveredItem(Common::Point *point) { +int Inventory2::getHoveredItem(Common::Point *point) { int selId = getSelectedItemId(); if (point->y <= 20 && !_isInventoryOut && !_isLocked) @@ -422,7 +422,7 @@ int CInventory2::getHoveredItem(Common::Point *point) { } void FullpipeEngine::getAllInventory() { - CInventory2 *inv = getGameLoaderInventory(); + Inventory2 *inv = getGameLoaderInventory(); for (uint i = 0; i < inv->getItemsPoolCount(); ++i ) { int id = inv->getInventoryPoolItemIdAtIndex(i); diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h index 5f1030398c..6d07f069bd 100644 --- a/engines/fullpipe/inventory.h +++ b/engines/fullpipe/inventory.h @@ -42,13 +42,13 @@ struct InventoryPoolItem { typedef Common::Array InventoryPoolItems; -class CInventory : public CObject { +class Inventory : public CObject { protected: int16 _sceneId; InventoryPoolItems _itemsPool; public: - CInventory() { _sceneId = 0; } + Inventory() { _sceneId = 0; } virtual bool load(MfcArchive &file); int getInventoryPoolItemIndexById(int itemId); @@ -83,7 +83,7 @@ struct InventoryIcon { typedef Common::Array InventoryIcons; -class CInventory2 : public CInventory { +class Inventory2 : public Inventory { InventoryItems _inventoryItems; InventoryIcons _inventoryIcons; int _selectedId; @@ -95,7 +95,7 @@ class CInventory2 : public CInventory { BigPicture *_picture; public: - CInventory2(); + Inventory2(); bool loadPartial(MfcArchive &file); void addItem(int itemId, int count); void addItem2(StaticANIObject *obj); -- cgit v1.2.3 From fb2d0c02dfbabf0f3b17938d3346bb4477bea384 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:20:53 +0400 Subject: FULLPIPE: CPtrList -> PtrList --- engines/fullpipe/gfx.cpp | 4 ++-- engines/fullpipe/gfx.h | 6 +++--- engines/fullpipe/scene.cpp | 12 ++++++------ engines/fullpipe/scene.h | 10 +++++----- engines/fullpipe/scenes.cpp | 2 +- engines/fullpipe/stateloader.cpp | 2 +- engines/fullpipe/statics.h | 6 +++--- engines/fullpipe/utils.h | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 2ab038b74d..2e89bd6003 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -171,7 +171,7 @@ bool PictureObject::load(MfcArchive &file, bool bigPicture) { _picture->load(file); - _pictureObject2List = new CPtrList(); + _pictureObject2List = new PtrList(); int count = file.readUint16LE(); @@ -325,7 +325,7 @@ void GameObject::setOXY(int x, int y) { _oy = y; } -void GameObject::renumPictures(CPtrList *lst) { +void GameObject::renumPictures(PtrList *lst) { int *buf = (int *)calloc(lst->size() + 2, sizeof(int)); for (uint i = 0; i < lst->size(); i++) { diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h index 82e082d8cb..1f7284a6eb 100644 --- a/engines/fullpipe/gfx.h +++ b/engines/fullpipe/gfx.h @@ -137,7 +137,7 @@ class GameObject : public CObject { virtual bool load(MfcArchive &file); void setOXY(int x, int y); - void renumPictures(CPtrList *lst); + void renumPictures(PtrList *lst); void setFlags(int16 flags) { _flags = flags; } void clearFlags() { _flags = 0; } const char *getName() { return _objectName; } @@ -149,7 +149,7 @@ class GameObject : public CObject { class PictureObject : public GameObject { public: Picture *_picture; - CPtrList *_pictureObject2List; + PtrList *_pictureObject2List; int _ox2; int _oy2; @@ -169,7 +169,7 @@ class PictureObject : public GameObject { class Background : public CObject { public: - CPtrList _picObjList; + PtrList _picObjList; char *_bgname; int _x; diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 6ac062fb37..0f988b0a39 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -259,7 +259,7 @@ void Scene::init() { if (_staticANIObjectList2.size() != _staticANIObjectList1.size()) { _staticANIObjectList2.clear(); - for (CPtrList::iterator s = _staticANIObjectList1.begin(); s != _staticANIObjectList1.end(); ++s) + for (PtrList::iterator s = _staticANIObjectList1.begin(); s != _staticANIObjectList1.end(); ++s) _staticANIObjectList2.push_back(*s); } } @@ -273,7 +273,7 @@ StaticANIObject *Scene::getAniMan() { } StaticANIObject *Scene::getStaticANIObject1ById(int obj, int a3) { - for (CPtrList::iterator s = _staticANIObjectList1.begin(); s != _staticANIObjectList1.end(); ++s) { + for (PtrList::iterator s = _staticANIObjectList1.begin(); s != _staticANIObjectList1.end(); ++s) { StaticANIObject *o = (StaticANIObject *)*s; if (o->_id == obj && (a3 == -1 || o->_okeyCode == a3)) return o; @@ -441,7 +441,7 @@ bool Scene::compareObjPriority(const void *p1, const void *p2) { return false; } -void Scene::objectList_sortByPriority(CPtrList &list) { +void Scene::objectList_sortByPriority(PtrList &list) { Common::sort(list.begin(), list.end(), Scene::compareObjPriority); } @@ -453,12 +453,12 @@ void Scene::draw() { objectList_sortByPriority(_staticANIObjectList2); - for (CPtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s) { + for (PtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s) { ((StaticANIObject *)*s)->draw2(); } int priority = -1; - for (CPtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s) { + for (PtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s) { drawContent(((StaticANIObject *)*s)->_priority, priority, false); ((StaticANIObject *)*s)->draw(); @@ -526,7 +526,7 @@ int Scene::getPictureObjectIdAtPos(int x, int y) { void Scene::update(int counterdiff) { debug(0, "Scene::update(%d)", counterdiff); - for (CPtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s) + for (PtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s) ((StaticANIObject *)*s)->update(counterdiff); } diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h index c1c8d47ba8..c01df15828 100644 --- a/engines/fullpipe/scene.h +++ b/engines/fullpipe/scene.h @@ -31,10 +31,10 @@ class MessageQueue; class Scene : public Background { public: - CPtrList _staticANIObjectList1; - CPtrList _staticANIObjectList2; - CPtrList _messageQueueList; - CPtrList _faObjectList; + PtrList _staticANIObjectList1; + PtrList _staticANIObjectList2; + PtrList _messageQueueList; + PtrList _faObjectList; Shadows *_shadows; SoundList *_soundList; int16 _sceneId; @@ -79,7 +79,7 @@ class Scene : public Background { private: static bool compareObjPriority(const void *p1, const void *p2); - void objectList_sortByPriority(CPtrList &list); + void objectList_sortByPriority(PtrList &list); }; class SceneTag : public CObject { diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 2195ee7585..670d752bd7 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -151,7 +151,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->setPictureObjectsFlag4(); - for (CPtrList::iterator s = scene->_staticANIObjectList1.begin(); s != scene->_staticANIObjectList1.end(); ++s) { + for (PtrList::iterator s = scene->_staticANIObjectList1.begin(); s != scene->_staticANIObjectList1.end(); ++s) { StaticANIObject *o = (StaticANIObject *)*s; o->setFlags(o->_flags & 0xFE7F); } diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 4c58d564dd..8681347703 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -54,7 +54,7 @@ bool FullpipeEngine::loadGam(const char *fname, int scene) { _inventory->rebuildItemRects(); - for (CPtrList::iterator p = _inventory->getScene()->_picObjList.begin(); p != _inventory->getScene()->_picObjList.end(); ++p) { + for (PtrList::iterator p = _inventory->getScene()->_picObjList.begin(); p != _inventory->getScene()->_picObjList.end(); ++p) { ((MemoryObject *)((PictureObject *)*p)->_picture)->load(); } diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 03d87c8e32..44ea8b3da1 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -118,7 +118,7 @@ class Movement : public GameObject { int _field_50; int _counterMax; int _counter; - CPtrList _dynamicPhases; + PtrList _dynamicPhases; int _field_78; Common::Point **_framePosOffsets; Movement *_currMovement; @@ -172,8 +172,8 @@ class StaticANIObject : public GameObject { int _initialCounter; int _callback1; void (*_callback2)(int *); - CPtrList _movements; - CPtrList _staticsList; + PtrList _movements; + PtrList _staticsList; CStepArray _stepArray; int16 _field_96; int _messageQueueId; diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index 31bfe86041..64631f4215 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -145,7 +145,7 @@ class DWordArray : public Common::Array, public CObject { virtual bool load(MfcArchive &file); }; -typedef Common::Array CPtrList; +typedef Common::Array PtrList; char *genFileName(int superId, int sceneId, const char *ext); byte *transCyrillic(byte *s); -- cgit v1.2.3 From 0b358dbdce1be8dcb170a603e359b603ba51e882 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:21:51 +0400 Subject: FULLPIPE: CStepArray -> StepArray --- engines/fullpipe/statics.cpp | 10 +++++----- engines/fullpipe/statics.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index ac80e809c1..023099547e 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -33,7 +33,7 @@ namespace Fullpipe { -CStepArray::CStepArray() { +StepArray::StepArray() { _points = 0; _maxPointIndex = 0; _currPointIndex = 0; @@ -41,7 +41,7 @@ CStepArray::CStepArray() { _isEos = 0; } -CStepArray::~CStepArray() { +StepArray::~StepArray() { if (_pointsCount) { for (int i = 0; i < _pointsCount; i++) delete _points[i]; @@ -52,7 +52,7 @@ CStepArray::~CStepArray() { } } -void CStepArray::clear() { +void StepArray::clear() { _currPointIndex = 0; _maxPointIndex = 0; _isEos = 0; @@ -63,7 +63,7 @@ void CStepArray::clear() { } } -Common::Point *CStepArray::getCurrPoint(Common::Point *point) { +Common::Point *StepArray::getCurrPoint(Common::Point *point) { if (_isEos || _points == 0) { point->x = 0; point->y = 0; @@ -73,7 +73,7 @@ Common::Point *CStepArray::getCurrPoint(Common::Point *point) { return point; } -bool CStepArray::gotoNextPoint() { +bool StepArray::gotoNextPoint() { if (_currPointIndex < _maxPointIndex) { _currPointIndex++; return true; diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 44ea8b3da1..1767a5720e 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -29,7 +29,7 @@ namespace Fullpipe { class ExCommand; -class CStepArray : public CObject { +class StepArray : public CObject { int _currPointIndex; Common::Point **_points; int _maxPointIndex; @@ -37,8 +37,8 @@ class CStepArray : public CObject { int _isEos; public: - CStepArray(); - ~CStepArray(); + StepArray(); + ~StepArray(); void clear(); int getCurrPointIndex() { return _currPointIndex; } @@ -174,7 +174,7 @@ class StaticANIObject : public GameObject { void (*_callback2)(int *); PtrList _movements; PtrList _staticsList; - CStepArray _stepArray; + StepArray _stepArray; int16 _field_96; int _messageQueueId; int _messageNum; -- cgit v1.2.3 From f40787dbbfa27242d28de2a68b734874ad2a08f4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:26:02 +0400 Subject: FULLPIPE: Rename C* modal objects --- engines/fullpipe/fullpipe.cpp | 4 ++-- engines/fullpipe/fullpipe.h | 4 ++-- engines/fullpipe/modal.cpp | 20 ++++++++++---------- engines/fullpipe/modal.h | 12 ++++++------ engines/fullpipe/scenes.cpp | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 99de4dc0d4..5b3f1788e0 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -236,7 +236,7 @@ void FullpipeEngine::updateEvents() { _modalObject->update(); } else { _modalObject->saveload(); - CBaseModalObject *obj = _modalObject->_parentObj; + BaseModalObject *obj = _modalObject->_parentObj; if (obj) delete _modalObject; _modalObject = obj; @@ -360,7 +360,7 @@ void FullpipeEngine::updateScreen() { _modalObject->update(); } else { _modalObject->saveload(); - CBaseModalObject *tmp = _modalObject->_parentObj; + BaseModalObject *tmp = _modalObject->_parentObj; delete _modalObject; diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 24fa9db9aa..c950ed5a76 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -44,7 +44,7 @@ enum FullpipeGameFeatures { }; class BehaviorManager; -class CBaseModalObject; +class BaseModalObject; class CGameLoader; class CGameVar; class InputController; @@ -197,7 +197,7 @@ public: int32 _lastInputTicks; int32 _lastButtonUpTicks; - CBaseModalObject *_modalObject; + BaseModalObject *_modalObject; int (*_updateScreenCallback)(); int (*_updateCursorCallback)(); diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 6f1bc0cc1f..26048ced13 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -28,30 +28,30 @@ namespace Fullpipe { -bool CBaseModalObject::handleMessage(ExCommand *message) { - warning("STUB: CBaseModalObject::handleMessage()"); +bool BaseModalObject::handleMessage(ExCommand *message) { + warning("STUB: BaseModalObject::handleMessage()"); return true; } -bool CBaseModalObject::init(int counterdiff) { - warning("STUB: CBaseModalObject::init(%d)", counterdiff); +bool BaseModalObject::init(int counterdiff) { + warning("STUB: BaseModalObject::init(%d)", counterdiff); return true; } -bool CBaseModalObject::update() { - warning("STUB: CBaseModalObject::update()"); +bool BaseModalObject::update() { + warning("STUB: BaseModalObject::update()"); return true; } -void CBaseModalObject::saveload() { - warning("STUB: CBaseModalObject::saveload()"); +void BaseModalObject::saveload() { + warning("STUB: BaseModalObject::saveload()"); } -CModalIntro::CModalIntro() { +ModalIntro::ModalIntro() { _field_8 = 0; _countDown = 0; _needRedraw = 0; @@ -68,7 +68,7 @@ CModalIntro::CModalIntro() { _sfxVolume = g_fullpipe->_sfxVolume; } -bool CModalIntro::handleMessage(ExCommand *message) { +bool ModalIntro::handleMessage(ExCommand *message) { if (message->_messageKind != 17) return false; diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index 73236e8e5b..7d98427e20 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -25,14 +25,14 @@ namespace Fullpipe { -class CBaseModalObject { +class BaseModalObject { public: - CBaseModalObject *_parentObj; + BaseModalObject *_parentObj; public: - CBaseModalObject() : _parentObj(0) {} - virtual ~CBaseModalObject() {} + BaseModalObject() : _parentObj(0) {} + virtual ~BaseModalObject() {} virtual bool handleMessage(ExCommand *message); virtual bool init(int counterdiff); @@ -41,7 +41,7 @@ class CBaseModalObject { void saveload(); }; -class CModalIntro : public CBaseModalObject { +class ModalIntro : public BaseModalObject { int _field_8; int _introFlags; int _countDown; @@ -49,7 +49,7 @@ class CModalIntro : public CBaseModalObject { int _sfxVolume; public: - CModalIntro(); + ModalIntro(); virtual bool handleMessage(ExCommand *message); }; diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 670d752bd7..1ac92c3c10 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1406,7 +1406,7 @@ void sceneIntro_initScene(Scene *sc) { if (g_fullpipe->_recordEvents || g_fullpipe->_inputArFlag) g_vars->sceneIntro_skipIntro = false; - g_fullpipe->_modalObject = new CModalIntro; + g_fullpipe->_modalObject = new ModalIntro; } int sceneHandlerIntro(ExCommand *cmd) { -- cgit v1.2.3 From 655054fb37eb53b376f63d8cf8839c7bd4550682 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:28:44 +0400 Subject: FULLPIPE: CObjstateCommand -> ObjStateCommand --- engines/fullpipe/messages.cpp | 6 +++--- engines/fullpipe/messages.h | 4 ++-- engines/fullpipe/scenes.cpp | 2 +- engines/fullpipe/utils.cpp | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index 36fd1399ce..e74aae0ddb 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -169,13 +169,13 @@ Message::Message(int16 parentId, int messageKind, int x, int y, int a6, int a7, _field_34 = 0; } -CObjstateCommand::CObjstateCommand() { +ObjstateCommand::ObjstateCommand() { _value = 0; _objCommandName = 0; } -bool CObjstateCommand::load(MfcArchive &file) { - debug(5, "CObjStateCommand::load()"); +bool ObjstateCommand::load(MfcArchive &file) { + debug(5, "ObjStateCommand::load()"); _objtype = kObjTypeObjstateCommand; diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h index 7ba9126d46..5ae94b9cef 100644 --- a/engines/fullpipe/messages.h +++ b/engines/fullpipe/messages.h @@ -82,14 +82,14 @@ class ExCommand2 : public ExCommand { int _pointsSize; }; -class CObjstateCommand : public CObject { +class ObjstateCommand : public CObject { public: ExCommand _cmd; char *_objCommandName; int _value; public: - CObjstateCommand(); + ObjstateCommand(); virtual bool load(MfcArchive &file); }; diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 1ac92c3c10..8aed9e7f48 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1076,7 +1076,7 @@ int global_messageHandler3(ExCommand *cmd) { return doSomeAnimation2(cmd->_parentId, cmd->_keyCode); case 63: if (cmd->_objtype == kObjTypeObjstateCommand) { - CObjstateCommand *c = (CObjstateCommand *)cmd; + ObjstateCommand *c = (ObjstateCommand *)cmd; result = 1; g_fullpipe->setObjectState(c->_objCommandName, c->_value); } diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index a35a275c95..60426524c2 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -265,7 +265,7 @@ enum { kInteraction, kMessageQueue, kExCommand, - kCObjstateCommand, + kObjstateCommand, kCGameVar, kMctlCompound, kMovGraph, @@ -282,7 +282,7 @@ const struct { { "CInteraction", kInteraction }, { "MessageQueue", kMessageQueue }, { "ExCommand", kExCommand }, - { "CObjstateCommand", kCObjstateCommand }, + { "CObjstateCommand", kObjstateCommand }, { "CGameVar", kCGameVar }, { "CMctlCompound", kMctlCompound }, { "CMovGraph", kMovGraph }, @@ -312,8 +312,8 @@ static CObject *createObject(int objectId) { return new MessageQueue(); case kExCommand: return new ExCommand(); - case kCObjstateCommand: - return new CObjstateCommand(); + case kObjstateCommand: + return new ObjstateCommand(); case kCGameVar: return new CGameVar(); case kMctlCompound: -- cgit v1.2.3 From 918d2f175a84b8de2255b0df664dd2c792b2c170 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:37:07 +0400 Subject: FULLPIPE: CGameVar -> GameVar --- engines/fullpipe/behavior.cpp | 20 ++++++++--------- engines/fullpipe/behavior.h | 10 ++++----- engines/fullpipe/fullpipe.cpp | 6 +++--- engines/fullpipe/fullpipe.h | 6 +++--- engines/fullpipe/gameloader.cpp | 6 +++--- engines/fullpipe/gameloader.h | 2 +- engines/fullpipe/init.cpp | 2 +- engines/fullpipe/objects.h | 22 +++++++++---------- engines/fullpipe/scene.cpp | 14 ++++++------ engines/fullpipe/scene.h | 2 +- engines/fullpipe/scenes.cpp | 8 +++---- engines/fullpipe/scenes.h | 6 +++--- engines/fullpipe/sound.cpp | 2 +- engines/fullpipe/stateloader.cpp | 46 ++++++++++++++++++++-------------------- engines/fullpipe/statics.cpp | 6 +++--- engines/fullpipe/utils.cpp | 8 +++---- 16 files changed, 83 insertions(+), 83 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp index 6bfb400c24..1a2b7bb8e2 100644 --- a/engines/fullpipe/behavior.cpp +++ b/engines/fullpipe/behavior.cpp @@ -48,17 +48,17 @@ void BehaviorManager::clear() { _behaviors.clear(); } -void BehaviorManager::initBehavior(Scene *sc, CGameVar *var) { +void BehaviorManager::initBehavior(Scene *sc, GameVar *var) { clear(); _scene = sc; BehaviorInfo *behinfo; - CGameVar *behvar = var->getSubVarByName("BEHAVIOR"); + GameVar *behvar = var->getSubVarByName("BEHAVIOR"); if (!behvar) return; - for (CGameVar *subvar = behvar->_subVars; subvar; subvar = subvar->_nextVarObj) { + for (GameVar *subvar = behvar->_subVars; subvar; subvar = subvar->_nextVarObj) { if (!strcmp(subvar->_varName, "AMBIENT")) { behinfo = new BehaviorInfo; behinfo->initAmbientBehavior(subvar, sc); @@ -191,7 +191,7 @@ void BehaviorInfo::clear() { _bheItems.clear(); } -void BehaviorInfo::initAmbientBehavior(CGameVar *var, Scene *sc) { +void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) { debug(0, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName)); clear(); @@ -215,7 +215,7 @@ void BehaviorInfo::initAmbientBehavior(CGameVar *var, Scene *sc) { } } -void BehaviorInfo::initObjectBehavior(CGameVar *var, Scene *sc, StaticANIObject *ani) { +void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *ani) { debug(0, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName)); clear(); @@ -227,7 +227,7 @@ void BehaviorInfo::initObjectBehavior(CGameVar *var, Scene *sc, StaticANIObject if (strcmp(var->_value.stringValue, "ROOT")) break; - CGameVar *v1 = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("BEHAVIOR")->getSubVarByName(ani->getName()); + GameVar *v1 = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("BEHAVIOR")->getSubVarByName(ani->getName()); if (v1 == var) return; @@ -255,7 +255,7 @@ BehaviorEntry::BehaviorEntry() { _items = 0; } -BehaviorEntry::BehaviorEntry(CGameVar *var, Scene *sc, StaticANIObject *ani, int *minDelay) { +BehaviorEntry::BehaviorEntry(GameVar *var, Scene *sc, StaticANIObject *ani, int *minDelay) { _staticsId = 0; _itemsCount = 0; @@ -274,7 +274,7 @@ BehaviorEntry::BehaviorEntry(CGameVar *var, Scene *sc, StaticANIObject *ani, int _items = (BehaviorEntryInfo**)calloc(_itemsCount, sizeof(BehaviorEntryInfo *)); for (int i = 0; i < _itemsCount; i++) { - CGameVar *subvar = var->getSubVarByIndex(i); + GameVar *subvar = var->getSubVarByIndex(i); int delay; _items[i] = new BehaviorEntryInfo(subvar, sc, &delay); @@ -289,14 +289,14 @@ BehaviorEntry::BehaviorEntry(CGameVar *var, Scene *sc, StaticANIObject *ani, int } } -BehaviorEntryInfo::BehaviorEntryInfo(CGameVar *subvar, Scene *sc, int *delay) { +BehaviorEntryInfo::BehaviorEntryInfo(GameVar *subvar, Scene *sc, int *delay) { _messageQueue = 0; _delay = 0; _percent = 0; _flags = 0; _messageQueue = sc->getMessageQueueByName(subvar->_varName); - CGameVar *vart = subvar->getSubVarByName("dwDelay"); + GameVar *vart = subvar->getSubVarByName("dwDelay"); if (vart) _delay = vart->_value.intValue; diff --git a/engines/fullpipe/behavior.h b/engines/fullpipe/behavior.h index d9375d4d01..83a548f486 100644 --- a/engines/fullpipe/behavior.h +++ b/engines/fullpipe/behavior.h @@ -31,7 +31,7 @@ struct BehaviorEntryInfo { uint32 _percent; int _flags; - BehaviorEntryInfo(CGameVar *subvar, Scene *sc, int *delay); + BehaviorEntryInfo(GameVar *subvar, Scene *sc, int *delay); }; struct BehaviorEntry { @@ -41,7 +41,7 @@ struct BehaviorEntry { BehaviorEntryInfo **_items; BehaviorEntry(); - BehaviorEntry(CGameVar *var, Scene *sc, StaticANIObject *ani, int *minDelay); + BehaviorEntry(GameVar *var, Scene *sc, StaticANIObject *ani, int *minDelay); }; struct BehaviorInfo { @@ -57,8 +57,8 @@ struct BehaviorInfo { BehaviorInfo() { clear(); } void clear(); - void initAmbientBehavior(CGameVar *var, Scene *sc); - void initObjectBehavior(CGameVar *var, Scene *sc, StaticANIObject *ani); + void initAmbientBehavior(GameVar *var, Scene *sc); + void initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *ani); }; class BehaviorManager : public CObject { @@ -72,7 +72,7 @@ class BehaviorManager : public CObject { void clear(); - void initBehavior(Scene *scene, CGameVar *var); + void initBehavior(Scene *scene, GameVar *var); void updateBehaviors(); void updateBehavior(BehaviorInfo *behaviorInfo, BehaviorEntry *entry); diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 5b3f1788e0..5e1af1227c 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -389,7 +389,7 @@ void FullpipeEngine::updateScreen() { } int FullpipeEngine::getObjectEnumState(const char *name, const char *state) { - CGameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); + GameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); if (!var) { var = _gameLoader->_gameVar->addSubVarAsInt("OBJSTATES", 0); @@ -406,7 +406,7 @@ int FullpipeEngine::getObjectEnumState(const char *name, const char *state) { } int FullpipeEngine::getObjectState(const char *objname) { - CGameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); + GameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); if (var) return var->getSubVarAsInt(objname); @@ -415,7 +415,7 @@ int FullpipeEngine::getObjectState(const char *objname) { } void FullpipeEngine::setObjectState(const char *name, int state) { - CGameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); + GameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); if (!var) { var = _gameLoader->_gameVar->addSubVarAsInt("OBJSTATES", 0); diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index c950ed5a76..bab1d8e786 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -46,7 +46,7 @@ enum FullpipeGameFeatures { class BehaviorManager; class BaseModalObject; class CGameLoader; -class CGameVar; +class GameVar; class InputController; class Inventory2; struct CursorInfo; @@ -102,7 +102,7 @@ public: GameProject *_gameProject; bool loadGam(const char *fname, int scene = 0); - CGameVar *getGameLoaderGameVar(); + GameVar *getGameLoaderGameVar(); InputController *getGameLoaderInputController(); int _gameProjectVersion; @@ -218,7 +218,7 @@ public: bool sceneSwitcher(EntranceInfo *entrance); Scene *accessScene(int sceneId); - void setSceneMusicParameters(CGameVar *var); + void setSceneMusicParameters(GameVar *var); NGIArchive *_currArchive; diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 3f8255c28f..2d1f14436f 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -124,7 +124,7 @@ bool CGameLoader::load(MfcArchive &file) { _field_FA = file.readUint16LE(); _field_F8 = file.readUint16LE(); - _gameVar = (CGameVar *)file.readClass(); + _gameVar = (GameVar *)file.readClass(); return true; } @@ -181,7 +181,7 @@ bool CGameLoader::gotoScene(int sceneId, int entranceId) { return false; } - CGameVar *sg = _gameVar->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME"); + GameVar *sg = _gameVar->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME"); if (sg || (sg = _gameVar->getSubVarByName("OBJSTATES")->addSubVarAsInt("SAVEGAME", 0)) != 0) sg->setSubVarAsInt("Entrance", entranceId); @@ -496,7 +496,7 @@ bool PreloadItems::load(MfcArchive &file) { return true; } -CGameVar *FullpipeEngine::getGameLoaderGameVar() { +GameVar *FullpipeEngine::getGameLoaderGameVar() { if (_gameLoader) return _gameLoader->_gameVar; else diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index 2fe8bf730f..e702001b77 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -100,7 +100,7 @@ class CGameLoader : public CObject { int16 _field_F8; int16 _field_FA; PreloadItems _preloadItems; - CGameVar *_gameVar; + GameVar *_gameVar; char *_gameName; ExCommand _exCommand; int _updateCounter; diff --git a/engines/fullpipe/init.cpp b/engines/fullpipe/init.cpp index c334542247..fb60a4cc57 100644 --- a/engines/fullpipe/init.cpp +++ b/engines/fullpipe/init.cpp @@ -123,7 +123,7 @@ void FullpipeEngine::initObjectStates() { } void FullpipeEngine::setLevelStates() { - CGameVar *v = _gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons); + GameVar *v = _gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons); if (v) { v->setSubVarAsInt(sO_Level0, 2833); diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h index 9e7c7531a7..a12851e63b 100644 --- a/engines/fullpipe/objects.h +++ b/engines/fullpipe/objects.h @@ -69,27 +69,27 @@ union VarValue { char *stringValue; }; -class CGameVar : public CObject { +class GameVar : public CObject { public: - CGameVar *_nextVarObj; - CGameVar *_prevVarObj; - CGameVar *_parentVarObj; - CGameVar *_subVars; - CGameVar *_field_14; + GameVar *_nextVarObj; + GameVar *_prevVarObj; + GameVar *_parentVarObj; + GameVar *_subVars; + GameVar *_field_14; char *_varName; VarValue _value; int _varType; public: - CGameVar(); + GameVar(); virtual bool load(MfcArchive &file); - CGameVar *getSubVarByName(const char *name); + GameVar *getSubVarByName(const char *name); bool setSubVarAsInt(const char *name, int value); int getSubVarAsInt(const char *name); - CGameVar *addSubVarAsInt(const char *name, int value); - bool addSubVar(CGameVar *subvar); + GameVar *addSubVarAsInt(const char *name, int value); + bool addSubVar(GameVar *subvar); int getSubVarsCount(); - CGameVar *getSubVarByIndex(int idx); + GameVar *getSubVarByIndex(int idx); }; } // End of namespace Fullpipe diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 0f988b0a39..0ea724fbed 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -371,16 +371,16 @@ MessageQueue *Scene::getMessageQueueByName(char *name) { return 0; } -void Scene::preloadMovements(CGameVar *var) { - CGameVar *preload = var->getSubVarByName("PRELOAD"); +void Scene::preloadMovements(GameVar *var) { + GameVar *preload = var->getSubVarByName("PRELOAD"); if (!preload) return; - for (CGameVar *i = preload->_subVars; i; i = i->_nextVarObj) { + for (GameVar *i = preload->_subVars; i; i = i->_nextVarObj) { StaticANIObject *ani = getStaticANIObject1ByName(i->_varName, -1); if (ani) { - CGameVar *subVars = i->_subVars; + GameVar *subVars = i->_subVars; if (subVars) { for (;subVars; subVars = subVars->_nextVarObj) { @@ -397,7 +397,7 @@ void Scene::preloadMovements(CGameVar *var) { } void Scene::initObjectCursors(const char *varname) { - CGameVar *cursorsVar = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(varname)->getSubVarByName("CURSORS"); + GameVar *cursorsVar = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(varname)->getSubVarByName("CURSORS"); if (!cursorsVar || !cursorsVar->_subVars) return; @@ -405,7 +405,7 @@ void Scene::initObjectCursors(const char *varname) { int maxId = 0; int minId = 0xffff; - for (CGameVar *sub = cursorsVar->_subVars; sub; sub = sub->_nextVarObj) { + for (GameVar *sub = cursorsVar->_subVars; sub; sub = sub->_nextVarObj) { GameObject *obj = getPictureObjectByName(sub->_varName, -1); if (obj || (obj = getStaticANIObject1ByName(sub->_varName, -1)) != 0) { @@ -421,7 +421,7 @@ void Scene::initObjectCursors(const char *varname) { g_fullpipe->_objectIdCursors.resize(maxId - minId + 1); - for (CGameVar *sub = cursorsVar->_subVars; sub; sub = sub->_nextVarObj) { + for (GameVar *sub = cursorsVar->_subVars; sub; sub = sub->_nextVarObj) { GameObject *obj = getPictureObjectByName(sub->_varName, -1); if (!obj) diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h index c01df15828..7fe3b9363d 100644 --- a/engines/fullpipe/scene.h +++ b/engines/fullpipe/scene.h @@ -69,7 +69,7 @@ class Scene : public Background { PictureObject *getPictureObjectById(int objId, int flags); PictureObject *getPictureObjectByName(const char *name, int keyCode); void deletePictureObject(PictureObject *obj); - void preloadMovements(CGameVar *var); + void preloadMovements(GameVar *var); StaticANIObject *getStaticANIObjectAtPos(int x, int y); PictureObject *getPictureObjectAtPos(int x, int y); diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 8aed9e7f48..d66291d9fc 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -75,7 +75,7 @@ Vars::Vars() { } bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { - CGameVar *sceneVar; + GameVar *sceneVar; Common::Point sceneDim; Scene *scene = accessScene(entrance->_sceneId); @@ -657,7 +657,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { } void setElevatorButton(const char *name, int state) { - CGameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons); + GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons); if (var) var->setSubVarAsInt(name, state); @@ -1383,7 +1383,7 @@ int sceneIntro_updateCursor() { } void FullpipeEngine::setSwallowedEggsState() { - CGameVar *v = _gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_GulpedEggs); + GameVar *v = _gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_GulpedEggs); g_vars->swallowedEgg1 = v->getSubVarByName(sO_Egg1); g_vars->swallowedEgg2 = v->getSubVarByName(sO_Egg2); @@ -1416,7 +1416,7 @@ int sceneHandlerIntro(ExCommand *cmd) { } void scene01_fixEntrance() { - CGameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME"); + GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME"); if (var->getSubVarAsInt("Entrance") == TrubaLeft) var->setSubVarAsInt("Entrance", TrubaRight); } diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index be42838920..5597612aa6 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -31,9 +31,9 @@ class Vars { public: Vars(); - CGameVar *swallowedEgg1; - CGameVar *swallowedEgg2; - CGameVar *swallowedEgg3; + GameVar *swallowedEgg1; + GameVar *swallowedEgg2; + GameVar *swallowedEgg3; StaticANIObject *sceneIntro_aniin1man; bool sceneIntro_needSleep; diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index 821049cd0f..6da848a621 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -111,7 +111,7 @@ void Sound::setPanAndVolumeByStaticAni() { debug(3, "STUB Sound::setPanAndVolumeByStaticAni()"); } -void FullpipeEngine::setSceneMusicParameters(CGameVar *var) { +void FullpipeEngine::setSceneMusicParameters(GameVar *var) { warning("STUB: FullpipeEngine::setSceneMusicParameters()"); } diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 8681347703..8fe70271ff 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -145,7 +145,7 @@ GameProject::~GameProject() { free(_headerFilename); } -CGameVar::CGameVar() { +GameVar::GameVar() { _subVars = 0; _parentVarObj = 0; _nextVarObj = 0; @@ -156,7 +156,7 @@ CGameVar::CGameVar() { _varName = 0; } -bool CGameVar::load(MfcArchive &file) { +bool GameVar::load(MfcArchive &file) { _varName = file.readPascalString(); _varType = file.readUint32LE(); @@ -184,18 +184,18 @@ bool CGameVar::load(MfcArchive &file) { } file.incLevel(); - _parentVarObj = (CGameVar *)file.readClass(); - _prevVarObj = (CGameVar *)file.readClass(); - _nextVarObj = (CGameVar *)file.readClass(); - _field_14 = (CGameVar *)file.readClass(); - _subVars = (CGameVar *)file.readClass(); + _parentVarObj = (GameVar *)file.readClass(); + _prevVarObj = (GameVar *)file.readClass(); + _nextVarObj = (GameVar *)file.readClass(); + _field_14 = (GameVar *)file.readClass(); + _subVars = (GameVar *)file.readClass(); file.decLevel(); return true; } -CGameVar *CGameVar::getSubVarByName(const char *name) { - CGameVar *sv = 0; +GameVar *GameVar::getSubVarByName(const char *name) { + GameVar *sv = 0; if (_subVars != 0) { sv = _subVars; @@ -205,8 +205,8 @@ CGameVar *CGameVar::getSubVarByName(const char *name) { return sv; } -bool CGameVar::setSubVarAsInt(const char *name, int value) { - CGameVar *var = getSubVarByName(name); +bool GameVar::setSubVarAsInt(const char *name, int value) { + GameVar *var = getSubVarByName(name); if (var) { if (var->_varType == 0) { @@ -217,7 +217,7 @@ bool CGameVar::setSubVarAsInt(const char *name, int value) { return false; } - var = new CGameVar(); + var = new GameVar(); var->_varType = 0; var->_value.intValue = value; var->_varName = (char *)calloc(strlen(name) + 1, 1); @@ -226,8 +226,8 @@ bool CGameVar::setSubVarAsInt(const char *name, int value) { return addSubVar(var); } -int CGameVar::getSubVarAsInt(const char *name) { - CGameVar *var = getSubVarByName(name); +int GameVar::getSubVarAsInt(const char *name) { + GameVar *var = getSubVarByName(name); if (var) return var->_value.intValue; @@ -235,11 +235,11 @@ int CGameVar::getSubVarAsInt(const char *name) { return 0; } -CGameVar *CGameVar::addSubVarAsInt(const char *name, int value) { +GameVar *GameVar::addSubVarAsInt(const char *name, int value) { if (getSubVarByName(name)) { return 0; } else { - CGameVar *var = new CGameVar(); + GameVar *var = new GameVar(); var->_varType = 0; var->_value.intValue = value; @@ -251,11 +251,11 @@ CGameVar *CGameVar::addSubVarAsInt(const char *name, int value) { } } -bool CGameVar::addSubVar(CGameVar *subvar) { - CGameVar *var = _subVars; +bool GameVar::addSubVar(GameVar *subvar) { + GameVar *var = _subVars; if (var) { - for (CGameVar *i = var->_nextVarObj; i; i = i->_nextVarObj) + for (GameVar *i = var->_nextVarObj; i; i = i->_nextVarObj) var = i; var->_nextVarObj = subvar; @@ -273,9 +273,9 @@ bool CGameVar::addSubVar(CGameVar *subvar) { return false; } -int CGameVar::getSubVarsCount() { +int GameVar::getSubVarsCount() { int res; - CGameVar *sub = _subVars; + GameVar *sub = _subVars; for (res = 0; sub; res++) sub = sub->_nextVarObj; @@ -283,8 +283,8 @@ int CGameVar::getSubVarsCount() { return res; } -CGameVar *CGameVar::getSubVarByIndex(int idx) { - CGameVar *sub = _subVars; +GameVar *GameVar::getSubVarByIndex(int idx) { + GameVar *sub = _subVars; while (idx--) { sub = sub->_nextVarObj; diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 023099547e..343d5e92dc 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -547,7 +547,7 @@ void StaticANIObject::draw2() { } MovTable *StaticANIObject::countMovements() { - CGameVar *preloadSubVar = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("PRELOAD"); + GameVar *preloadSubVar = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("PRELOAD"); if (!preloadSubVar || preloadSubVar->getSubVarsCount() == 0) return 0; @@ -561,7 +561,7 @@ MovTable *StaticANIObject::countMovements() { GameObject *obj = (GameObject *)_movements[i]; movTable->movs[i] = 2; - for (CGameVar *sub = preloadSubVar->_subVars; sub; sub = sub->_nextVarObj) { + for (GameVar *sub = preloadSubVar->_subVars; sub; sub = sub->_nextVarObj) { if (scumm_stricmp(obj->getName(), sub->_varName) == 0) { movTable->movs[i] = 1; break; @@ -573,7 +573,7 @@ MovTable *StaticANIObject::countMovements() { } void StaticANIObject::setSpeed(int speed) { - CGameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("SpeedUp"); + GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("SpeedUp"); if (!var) return; diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index 60426524c2..3304a93667 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -266,7 +266,7 @@ enum { kMessageQueue, kExCommand, kObjstateCommand, - kCGameVar, + kGameVar, kMctlCompound, kMovGraph, kMovGraphLink, @@ -283,7 +283,7 @@ const struct { { "MessageQueue", kMessageQueue }, { "ExCommand", kExCommand }, { "CObjstateCommand", kObjstateCommand }, - { "CGameVar", kCGameVar }, + { "CGameVar", kGameVar }, { "CMctlCompound", kMctlCompound }, { "CMovGraph", kMovGraph }, { "CMovGraphLink", kMovGraphLink }, @@ -314,8 +314,8 @@ static CObject *createObject(int objectId) { return new ExCommand(); case kObjstateCommand: return new ObjstateCommand(); - case kCGameVar: - return new CGameVar(); + case kGameVar: + return new GameVar(); case kMctlCompound: return new MctlCompound(); case kMovGraph: -- cgit v1.2.3 From 4a6ede35e764d60c35e17052414ffbc8682a0a04 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 19:39:14 +0400 Subject: FULLPIPE: CGameLoader -> GameLoader --- engines/fullpipe/fullpipe.h | 4 ++-- engines/fullpipe/gameloader.cpp | 28 ++++++++++++++-------------- engines/fullpipe/gameloader.h | 6 +++--- engines/fullpipe/stateloader.cpp | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index bab1d8e786..6872dd8356 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -45,7 +45,7 @@ enum FullpipeGameFeatures { class BehaviorManager; class BaseModalObject; -class CGameLoader; +class GameLoader; class GameVar; class InputController; class Inventory2; @@ -98,7 +98,7 @@ public: Graphics::Surface _backgroundSurface; - CGameLoader *_gameLoader; + GameLoader *_gameLoader; GameProject *_gameProject; bool loadGam(const char *fname, int scene = 0); diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 2d1f14436f..f8ede5cff2 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -47,7 +47,7 @@ InteractionController *getGameLoaderInteractionController() { return g_fullpipe->_gameLoader->_interactionController; } -CGameLoader::CGameLoader() { +GameLoader::GameLoader() { _interactionController = new InteractionController(); _inputController = new InputController(); @@ -74,15 +74,15 @@ CGameLoader::CGameLoader() { g_fullpipe->_msgId = 0; } -CGameLoader::~CGameLoader() { +GameLoader::~GameLoader() { free(_gameName); delete _gameProject; delete _interactionController; delete _inputController; } -bool CGameLoader::load(MfcArchive &file) { - debug(5, "CGameLoader::load()"); +bool GameLoader::load(MfcArchive &file) { + debug(5, "GameLoader::load()"); _gameName = file.readPascalString(); debug(6, "_gameName: %s", _gameName); @@ -129,7 +129,7 @@ bool CGameLoader::load(MfcArchive &file) { return true; } -bool CGameLoader::loadScene(int sceneId) { +bool GameLoader::loadScene(int sceneId) { SceneTag *st; int idx = getSceneTagBySceneId(sceneId, &st); @@ -155,7 +155,7 @@ bool CGameLoader::loadScene(int sceneId) { return false; } -bool CGameLoader::gotoScene(int sceneId, int entranceId) { +bool GameLoader::gotoScene(int sceneId, int entranceId) { SceneTag *st; int sc2idx = getSceneTagBySceneId(sceneId, &st); @@ -234,7 +234,7 @@ bool preloadCallback(const PreloadItem &pre, int flag) { return true; } -bool CGameLoader::preloadScene(int sceneId, int entranceId) { +bool GameLoader::preloadScene(int sceneId, int entranceId) { debug(0, "preloadScene(%d, %d), ", sceneId, entranceId); if (_preloadSceneId != sceneId || _preloadEntranceId != entranceId) { @@ -289,7 +289,7 @@ bool CGameLoader::preloadScene(int sceneId, int entranceId) { return true; } -bool CGameLoader::unloadScene(int sceneId) { +bool GameLoader::unloadScene(int sceneId) { SceneTag *tag; int sceneTag = getSceneTagBySceneId(sceneId, &tag); @@ -310,7 +310,7 @@ bool CGameLoader::unloadScene(int sceneId) { return true; } -int CGameLoader::getSceneTagBySceneId(int sceneId, SceneTag **st) { +int GameLoader::getSceneTagBySceneId(int sceneId, SceneTag **st) { if (_sc2array.size() > 0 && _gameProject->_sceneTagList->size() > 0) { for (uint i = 0; i < _sc2array.size(); i++) { if (_sc2array[i]._sceneId == sceneId) { @@ -329,11 +329,11 @@ int CGameLoader::getSceneTagBySceneId(int sceneId, SceneTag **st) { return -1; } -void CGameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAniInfoCount) { +void GameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAniInfoCount) { if (picAniInfoCount <= 0) return; - debug(0, "CGameLoader::applyPicAniInfos(sc, ptr, %d)", picAniInfoCount); + debug(0, "GameLoader::applyPicAniInfos(sc, ptr, %d)", picAniInfoCount); PictureObject *pict; StaticANIObject *ani; @@ -381,11 +381,11 @@ void CGameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAn } } -void CGameLoader::saveScenePicAniInfos(int sceneId) { - warning("STUB: CGameLoader::saveScenePicAniInfos(%d)", sceneId); +void GameLoader::saveScenePicAniInfos(int sceneId) { + warning("STUB: GameLoader::saveScenePicAniInfos(%d)", sceneId); } -void CGameLoader::updateSystems(int counterdiff) { +void GameLoader::updateSystems(int counterdiff) { if (g_fullpipe->_currentScene) { g_fullpipe->_currentScene->update(counterdiff); diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index e702001b77..4f5462671d 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -72,10 +72,10 @@ class PreloadItems : public Common::Array, public CObject { virtual bool load(MfcArchive &file); }; -class CGameLoader : public CObject { +class GameLoader : public CObject { public: - CGameLoader(); - virtual ~CGameLoader(); + GameLoader(); + virtual ~GameLoader(); virtual bool load(MfcArchive &file); bool loadScene(int sceneId); diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 8fe70271ff..747015e9a1 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -37,7 +37,7 @@ namespace Fullpipe { bool FullpipeEngine::loadGam(const char *fname, int scene) { - _gameLoader = new CGameLoader(); + _gameLoader = new GameLoader(); if (!_gameLoader->loadFile(fname)) return false; -- cgit v1.2.3 From 83ea7b7d949afe5c27e2ba221fd9cb065236afd0 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Sun, 4 Aug 2013 10:44:01 +0200 Subject: WINTERMUTE: Fix types in transform_struct for coherence; this silences warnings --- engines/wintermute/graphics/transform_struct.cpp | 13 ++++++++++++- engines/wintermute/graphics/transform_struct.h | 7 ++++--- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/graphics/transform_struct.cpp b/engines/wintermute/graphics/transform_struct.cpp index 8edbf765b5..68cc1d9ad7 100644 --- a/engines/wintermute/graphics/transform_struct.cpp +++ b/engines/wintermute/graphics/transform_struct.cpp @@ -37,7 +37,6 @@ void TransformStruct::init(Point32 zoom, uint32 angle, Point32 hotspot, bool alp _offset = offset; } - TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY, int32 offsetX, int32 offsetY) { init(Point32(zoomX, zoomY), angle, @@ -49,6 +48,18 @@ TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 h Point32(offsetX, offsetY)); } +TransformStruct::TransformStruct(float zoomX, float zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY, int32 offsetX, int32 offsetY) { + init(Point32(zoomX / 100.0 * kDefaultZoomX, + zoomY / 100.0 * kDefaultZoomY), + angle, + Point32(hotspotX, hotspotY), + false, + blendMode, + rgbaMod, + mirrorX, mirrorY, + Point32(offsetX, offsetY)); +} + TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY) { init(Point32(zoomX, zoomY), kDefaultAngle, diff --git a/engines/wintermute/graphics/transform_struct.h b/engines/wintermute/graphics/transform_struct.h index a54c4cc5d0..702664a72d 100644 --- a/engines/wintermute/graphics/transform_struct.h +++ b/engines/wintermute/graphics/transform_struct.h @@ -33,14 +33,14 @@ namespace Wintermute { * Has a number of overloaded constructors to accomodate various argument lists. */ -const uint32 kDefaultZoomX = 100; -const uint32 kDefaultZoomY = 100; +const int32 kDefaultZoomX = 100; +const int32 kDefaultZoomY = 100; const uint32 kDefaultRgbaMod = 0xFFFFFFFF; const int32 kDefaultHotspotX = 0; const int32 kDefaultHotspotY = 0; const int32 kDefaultOffsetX = 0; const int32 kDefaultOffsetY = 0; -const int32 kDefaultAngle = 0; +const uint32 kDefaultAngle = 0; struct TransformStruct { private: @@ -48,6 +48,7 @@ private: public: TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX = false, bool mirrorY = false, int32 offsetX = 0, int32 offsetY = 0); + TransformStruct(float zoomX, float zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX = false, bool mirrorY = false, int32 offsetX = 0, int32 offsetY = 0); TransformStruct(int32 zoomX, int32 zoomY, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX = false, bool mirrorY = false); TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX = 0, int32 hotspotY = 0); TransformStruct(); -- cgit v1.2.3 From 64a3294ec5698db299d224229d6401417acdc9f6 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Wed, 18 Sep 2013 13:58:18 +0200 Subject: WINTERMUTE: Cast zoom inside display(Trans?)Zoom --- engines/wintermute/base/gfx/base_surface.h | 4 ++-- engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp | 10 +++++----- engines/wintermute/base/gfx/osystem/base_surface_osystem.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/base/gfx/base_surface.h b/engines/wintermute/base/gfx/base_surface.h index 8a0603734e..42fd593f61 100644 --- a/engines/wintermute/base/gfx/base_surface.h +++ b/engines/wintermute/base/gfx/base_surface.h @@ -50,12 +50,12 @@ public: virtual bool displayHalfTrans(int x, int y, Rect32 rect); virtual bool isTransparentAt(int x, int y); - virtual bool displayTransZoom(int x, int y, Rect32 rect, int32 zoomX, int32 zoomY, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0; + virtual bool displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0; virtual bool displayTrans(int x, int y, Rect32 rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0; virtual bool displayTransOffset(int x, int y, Rect32 rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0) = 0; virtual bool display(int x, int y, Rect32 rect, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0; virtual bool displayTransform(int x, int y, Rect32 rect, Rect32 newRect, const TransformStruct &transform) = 0; - virtual bool displayZoom(int x, int y, Rect32 rect, int32 zoomX, int32 zoomY, uint32 alpha = 0xFFFFFFFF, bool transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0; + virtual bool displayZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, bool transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0; virtual bool repeatLastDisplayOp(int offsetX, int offsetY, int numTimesX, int numTimesY) = 0; virtual bool restore(); virtual bool create(const Common::String &filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime = -1, bool keepLoaded = false) = 0; diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index 14767aa067..e04af45dd9 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -350,20 +350,20 @@ bool BaseSurfaceOSystem::displayTransOffset(int x, int y, Rect32 rect, uint32 al } ////////////////////////////////////////////////////////////////////////// -bool BaseSurfaceOSystem::displayTransZoom(int x, int y, Rect32 rect, int32 zoomX, int32 zoomY, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) { +bool BaseSurfaceOSystem::displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) { _rotation = 0; - return drawSprite(x, y, &rect, nullptr, TransformStruct(zoomX, zoomY, blendMode, alpha, mirrorX, mirrorY)); + return drawSprite(x, y, &rect, nullptr, TransformStruct((int32)zoomX, (int32)zoomY, blendMode, alpha, mirrorX, mirrorY)); } ////////////////////////////////////////////////////////////////////////// -bool BaseSurfaceOSystem::displayZoom(int x, int y, Rect32 rect, int32 zoomX, int32 zoomY, uint32 alpha, bool transparent, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) { +bool BaseSurfaceOSystem::displayZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, bool transparent, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) { _rotation = 0; TransformStruct transform; if (transparent) { - transform = TransformStruct(zoomX, zoomY, kDefaultAngle, kDefaultHotspotX, kDefaultHotspotY, blendMode, alpha, mirrorX, mirrorY); + transform = TransformStruct((int32)zoomX, (int32)zoomY, kDefaultAngle, kDefaultHotspotX, kDefaultHotspotY, blendMode, alpha, mirrorX, mirrorY); } else { - transform = TransformStruct(zoomX, zoomY, mirrorX, mirrorY); + transform = TransformStruct((int32)zoomX, (int32)zoomY, mirrorX, mirrorY); } return drawSprite(x, y, &rect, nullptr, transform); } diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.h b/engines/wintermute/base/gfx/osystem/base_surface_osystem.h index 6cf19d00fb..340a5a5ffc 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.h +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.h @@ -52,11 +52,11 @@ public: bool endPixelOp() override; - bool displayTransZoom(int x, int y, Rect32 rect, int32 zoomX, int32 zoomY, uint32 alpha = kDefaultRgbaMod, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override; + bool displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = kDefaultRgbaMod, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override; bool displayTrans(int x, int y, Rect32 rect, uint32 alpha = kDefaultRgbaMod, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override; bool displayTransOffset(int x, int y, Rect32 rect, uint32 alpha = kDefaultRgbaMod, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0) override; bool display(int x, int y, Rect32 rect, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override; - bool displayZoom(int x, int y, Rect32 rect, int32 zoomX, int32 zoomY, uint32 alpha = kDefaultRgbaMod, bool transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override; + bool displayZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = kDefaultRgbaMod, bool transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) override; bool displayTransform(int x, int y, Rect32 rect, Rect32 newRect, const TransformStruct &transform) override; bool repeatLastDisplayOp(int offsetX, int offsetY, int numTimesX, int numTimesY) override; virtual bool putSurface(const Graphics::Surface &surface, bool hasAlpha = false) override; -- cgit v1.2.3 From 9578bab703b6c1e32a547179a347b7bea9c2e054 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Wed, 18 Sep 2013 14:02:07 +0200 Subject: WINTERMUTE: Explicitly cast zoom for float version of TransformStruct --- engines/wintermute/graphics/transform_struct.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/graphics/transform_struct.cpp b/engines/wintermute/graphics/transform_struct.cpp index 68cc1d9ad7..643c6b413f 100644 --- a/engines/wintermute/graphics/transform_struct.cpp +++ b/engines/wintermute/graphics/transform_struct.cpp @@ -49,8 +49,8 @@ TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 h } TransformStruct::TransformStruct(float zoomX, float zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY, int32 offsetX, int32 offsetY) { - init(Point32(zoomX / 100.0 * kDefaultZoomX, - zoomY / 100.0 * kDefaultZoomY), + init(Point32((int32)(zoomX / 100.0 * kDefaultZoomX), + (int32)(zoomY / 100.0 * kDefaultZoomY)), angle, Point32(hotspotX, hotspotY), false, -- cgit v1.2.3 From 2c4d5ae6224dfa4450957eaaf3a1231e5dadc535 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Wed, 18 Sep 2013 15:31:32 +0200 Subject: WINTERMUTE: Cast rotate in base_sub_frame --- engines/wintermute/base/base_sub_frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/wintermute/base/base_sub_frame.cpp b/engines/wintermute/base/base_sub_frame.cpp index 8a8f63240b..c22e0982a6 100644 --- a/engines/wintermute/base/base_sub_frame.cpp +++ b/engines/wintermute/base/base_sub_frame.cpp @@ -269,7 +269,7 @@ bool BaseSubFrame::draw(int x, int y, BaseObject *registerOwner, float zoomX, fl Point32 origin(x, y); Rect32 oldRect = getRect(); Point32 newHotspot; - TransformStruct transform = TransformStruct(zoomX, zoomY, rotate, _hotspotX, _hotspotY, blendMode, alpha, _mirrorX, _mirrorY, 0, 0); + TransformStruct transform = TransformStruct(zoomX, zoomY, (uint32)rotate, _hotspotX, _hotspotY, blendMode, alpha, _mirrorX, _mirrorY, 0, 0); Rect32 newRect = TransformTools::newRect (oldRect, transform, &newHotspot); newOrigin = origin - newHotspot; res = _surface->displayTransform(newOrigin.x, newOrigin.y, oldRect, newRect, transform); -- cgit v1.2.3 From e4568817bb4a6f7631d8253d32d7b2fb3f2d72a2 Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Wed, 18 Sep 2013 22:52:32 +0200 Subject: SCI: QfG1VGA script patch fixes bug #3585793 --- engines/sci/engine/script_patches.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 5f461aab3f..1b1ece8b57 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -1123,6 +1123,29 @@ const uint16 qfg1vgaPatchCheetaurDescription[] = { PATCH_END }; +const byte qfg1vgaSignatureFunnyRoomFix[] = { + 14, + 0x65, 0x14, // aTop 14 (state) + 0x36, // push + 0x3c, // dup + 0x35, 0x00, // ldi 00 + 0x1a, // eq? + 0x30, 0x25, 0x00, // bnt 0025 [-> next state] + 0x35, 0x01, // ldi 01 + 0xa3, 0x4e, // sal 4e + 0 +}; + +const uint16 qfg1vgaPatchFunnyRoomFix[] = { + PATCH_ADDTOOFFSET | +3, + 0x2e, 0x29, 0x00, // bt 0029 [-> next state] - saves 4 bytes + 0x35, 0x01, // ldi 01 + 0xa3, 0x4e, // sal 4e + 0xa3, 0x05, // sal 05 (sets local 5 to 1) + 0xa3, 0x05, // and again to make absolutely sure (actually to waste 2 bytes) + PATCH_END +}; + // script, description, magic DWORD, adjust const SciScriptSignature qfg1vgaSignatures[] = { { 215, "fight event issue", 1, PATCH_MAGICDWORD(0x6d, 0x76, 0x51, 0x07), -1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents }, @@ -1132,6 +1155,7 @@ const SciScriptSignature qfg1vgaSignatures[] = { { 331, "moving to crusher", 1, PATCH_MAGICDWORD(0x51, 0x1f, 0x36, 0x39), 0, qfg1vgaSignatureMoveToCrusher, qfg1vgaPatchMoveToCrusher }, { 41, "moving to castle gate", 1, PATCH_MAGICDWORD(0x51, 0x1f, 0x36, 0x39), 0, qfg1vgaSignatureMoveToCastleGate, qfg1vgaPatchMoveToCastleGate }, { 210, "cheetaur description fixed", 1, PATCH_MAGICDWORD(0x34, 0xb8, 0x01, 0x1a), 0, qfg1vgaSignatureCheetaurDescription, qfg1vgaPatchCheetaurDescription }, + { 96, "funny room script bug fixed", 1, PATCH_MAGICDWORD(0x35, 0x01, 0xa3, 0x4e), -10, qfg1vgaSignatureFunnyRoomFix, qfg1vgaPatchFunnyRoomFix }, SCI_SIGNATUREENTRY_TERMINATOR }; -- cgit v1.2.3 From 6c85ad12aa9512da4c10c857d024e389ac317fa5 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 18 Sep 2013 23:00:38 +0200 Subject: SCI: Explain qfg1vga script patch slightly --- engines/sci/engine/script_patches.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 1b1ece8b57..2fe349ad22 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -1123,6 +1123,12 @@ const uint16 qfg1vgaPatchCheetaurDescription[] = { PATCH_END }; + +// Hitting the button on the right causes extremely broken behaviour if the +// door on the top right is open at the time (bug #3585793). +// Local 5 is the timer controlling automatically closing that door (door11). +// We force it to 1 in happyFace::changeState which is triggered on hitting the +// button. const byte qfg1vgaSignatureFunnyRoomFix[] = { 14, 0x65, 0x14, // aTop 14 (state) -- cgit v1.2.3 From 448063a8dfd623415b0fa943b2f1e322db1424ab Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Wed, 18 Sep 2013 23:11:07 +0200 Subject: SCI: Fully explain qfg1vga script patch --- engines/sci/engine/script_patches.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 2fe349ad22..9fb7d08e56 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -1123,12 +1123,18 @@ const uint16 qfg1vgaPatchCheetaurDescription[] = { PATCH_END }; - -// Hitting the button on the right causes extremely broken behaviour if the -// door on the top right is open at the time (bug #3585793). -// Local 5 is the timer controlling automatically closing that door (door11). -// We force it to 1 in happyFace::changeState which is triggered on hitting the -// button. +// In the "funny" room (Yorick's room) in QfG1 VGA, pulling the chain and +// then pressing the button on the right side of the room results in +// a broken game. This also happens in SSCI. +// Problem is that the Sierra programmers forgot to disable the door, that +// gets opened by pulling the chain. So when ego falls down and then +// rolls through the door, one method thinks that the player walks through +// it and acts that way and the other method is still doing the roll animation. +// Local 5 of that room is a timer, that closes the door (object door11). +// Setting it to 1 during happyFace::changeState(0) stops door11::doit from +// calling goTo6::init, so the whole issue is stopped from happening. +// Responsible method: happyFace::changeState, door11::doit +// Fixes bug #3585793 const byte qfg1vgaSignatureFunnyRoomFix[] = { 14, 0x65, 0x14, // aTop 14 (state) -- cgit v1.2.3 From f9f4f4eb17a9e5d5a9c68baf671c5666fc3c5a88 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 18 Sep 2013 22:20:24 -0400 Subject: TSAGE: Renamings for R2R elevator shaft --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 11 ++++++----- engines/tsage/ringworld2/ringworld2_scenes1.h | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index aab6c8ad6e..44d2bad7f3 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -12917,9 +12917,10 @@ void Scene1900::signal() { } /*-------------------------------------------------------------------------- - * Scene 1925 - + * Scene 1925 - Spill Mountains Elevator Shaft * *--------------------------------------------------------------------------*/ + Scene1925::Scene1925() { _field9B8 = 0; for (int i = 0; i < 5; i++) @@ -12934,7 +12935,7 @@ void Scene1925::synchronize(Serializer &s) { s.syncAsSint16LE(_levelResNum[i]); } -bool Scene1925::Hotspot2::startAction(CursorType action, Event &event) { +bool Scene1925::Button::startAction(CursorType action, Event &event) { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -13092,7 +13093,7 @@ void Scene1925::changeLevel(bool upFlag) { break; case 3: loadScene(_levelResNum[4]); - _item2.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 2, NULL); + _button.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 2, NULL); _actor1.setDetails(1925, 0, 1, 2, 2, (SceneItem *) NULL); _actor1.show(); break; @@ -13101,7 +13102,7 @@ void Scene1925::changeLevel(bool upFlag) { // No break on purpose default: loadScene(_levelResNum[(R2_GLOBALS._scene1925CurrLevel % 4)]); - R2_GLOBALS._sceneItems.remove(&_item2); + R2_GLOBALS._sceneItems.remove(&_button); R2_GLOBALS._sceneItems.remove(&_actor1); _actor1.hide(); break; @@ -13140,7 +13141,7 @@ void Scene1925::postInit(SceneObjectList *OwnerList) { break; case 3: _actor1.setDetails(1925, 0, 1, 2, 1, (SceneItem *) NULL); - _item2.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 1, NULL); + _button.setDetails(Rect(133, 68, 140, 77), 1925, 3, -1, 5, 1, NULL); // No break on purpose case -3: _exit3.setDetails(Rect(83, 38, 128, 101), EXITCURSOR_W, 1925); diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 82895c7ab0..fbc1f15565 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1011,7 +1011,7 @@ public: }; class Scene1925 : public SceneExt { - class Hotspot2 : public NamedHotspot { + class Button : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1038,7 +1038,7 @@ class Scene1925 : public SceneExt { }; public: NamedHotspot _item1; - Hotspot2 _item2; + Button _button; Hotspot3 _item3; SceneActor _actor1; ExitUp _exitUp; -- cgit v1.2.3 From 4aac2579368104870dd410995d34c7e020cb1583 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 18 Sep 2013 22:21:50 -0400 Subject: TSAGE: Generalised saving of R2R walk regions resource --- engines/tsage/ringworld2/ringworld2_logic.cpp | 1 + engines/tsage/ringworld2/ringworld2_scenes2.cpp | 6 ------ engines/tsage/scenes.cpp | 8 ++++++++ 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index a607ebe6a4..6f5dbd04eb 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -162,6 +162,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Spill Mountains Elevator Exit return new Scene1900(); case 1925: + // Spill Mountains Elevator Shaft return new Scene1925(); case 1945: return new Scene1945(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index cc50de0cf5..9fa64b3ec1 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1030,12 +1030,6 @@ void Scene2000::process(Event &event) { void Scene2000::synchronize(Serializer &s) { SceneExt::synchronize(s); - // Synchronise active walk regions - int regionsId = R2_GLOBALS._walkRegions._resNum; - s.syncAsUint16LE(regionsId); - if (s.isLoading()) - R2_GLOBALS._walkRegions.load(regionsId); - s.syncAsByte(_exitingFlag); s.syncAsSint16LE(_mazePlayerMode); } diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 774a5277dc..23623b1900 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -247,6 +247,14 @@ void SceneManager::listenerSynchronize(Serializer &s) { } } + // Walk regions loading + if (g_vm->getGameID() == GType_Ringworld2) { + int walkRegionsId = GLOBALS._walkRegions._resNum; + s.syncAsSint16LE(walkRegionsId); + if (s.isLoading()) + GLOBALS._walkRegions.load(walkRegionsId); + } + g_globals->_sceneManager._scrollerRect.synchronize(s); SYNC_POINTER(g_globals->_scrollFollower); s.syncAsSint16LE(_loadMode); -- cgit v1.2.3 From dd592a67c9ded2dbdc91dc2f3bb93c5ea59bc85c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 18 Sep 2013 22:33:17 -0400 Subject: TSAGE: Added missing header change from previous commit --- engines/tsage/ringworld2/ringworld2_logic.cpp | 2 + engines/tsage/ringworld2/ringworld2_scenes1.cpp | 245 ++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes1.h | 30 +-- 3 files changed, 141 insertions(+), 136 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 6f5dbd04eb..cd22141a3c 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -165,8 +165,10 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Spill Mountains Elevator Shaft return new Scene1925(); case 1945: + // Spill Mountains Shaft Bottom return new Scene1945(); case 1950: + // Flup Tube Corridor Maze return new Scene1950(); /* Scene group #2 */ // diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 44d2bad7f3..35b4ba4545 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -1146,7 +1146,7 @@ void Scene1100::signal() { break; case 26: R2_GLOBALS._player.disableControl(); - R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _stripManager.start(302, this); break; case 27: @@ -1155,7 +1155,7 @@ void Scene1100::signal() { break; case 28: R2_GLOBALS._player.disableControl(); - R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._events.setCursor(CURSOR_WALK); _stripManager.start(303, this); break; case 29: @@ -1248,7 +1248,7 @@ void Scene1100::signal() { _stripManager.start3(314, this, _stripManager._lookupList); break; case 1116: - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); R2_GLOBALS._stripManager_lookupList[9] = 1; R2_GLOBALS._stripManager_lookupList[10] = 1; R2_GLOBALS._stripManager_lookupList[11] = 1; @@ -11301,7 +11301,7 @@ void Scene1800::Exit1::changeScene() { Scene1800 *scene = (Scene1800 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._events.setCursor(CURSOR_ARROW); + R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(14)) { scene->_sceneMode = 3; @@ -11497,7 +11497,7 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; } else { - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } } else if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 1850) { if (R2_GLOBALS.getFlag(29)) { @@ -11603,7 +11603,7 @@ void Scene1800::signal() { // The following check is completely dumb. // Either an original bug, or dead code. if (R2_GLOBALS.getFlag(63)) { - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } else { _sceneMode = 10; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -12333,7 +12333,7 @@ void Scene1850::signal() { R2_GLOBALS._walkRegions.enableRegion(5); R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1); R2_GLOBALS.setFlag(32); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 1875: R2_INVENTORY.setObjectScene(R2_AIRBAG, 1850); @@ -12396,7 +12396,7 @@ void Scene1850::signal() { } void Scene1850::process(Event &event) { - if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_ARROW) + if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_WALK) && (R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { _field41A = event.mousePos; R2_GLOBALS._player.disableControl(); @@ -12697,7 +12697,7 @@ bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) { void Scene1900::WestExit::changeScene() { Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 10; Common::Point pt(-10, 135); @@ -12708,7 +12708,7 @@ void Scene1900::WestExit::changeScene() { void Scene1900::EastExit::changeScene() { Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 11; Common::Point pt(330, 135); @@ -12897,12 +12897,12 @@ void Scene1900::signal() { R2_GLOBALS._scene1925CurrLevel = -3; // No break on purpose case 1905: - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._sceneManager.changeScene(1925); break; case 1910: R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 2535); - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 1900; R2_GLOBALS._player._oldCharacterScene[R2_SEEKER] = 1900; R2_GLOBALS._sceneManager.changeScene(2450); @@ -12951,12 +12951,12 @@ bool Scene1925::Button::startAction(CursorType action, Event &event) { else scene->_sceneMode = 1930; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, NULL); return true; } -bool Scene1925::Hotspot3::startAction(CursorType action, Event &event) { +bool Scene1925::Ladder::startAction(CursorType action, Event &event) { if ((!R2_GLOBALS.getFlag(29)) || (action != CURSOR_USE)) return SceneHotspot::startAction(action, event); @@ -13058,7 +13058,7 @@ void Scene1925::Exit3::changeScene() { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; _moving = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 1921; scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); } @@ -13067,7 +13067,7 @@ void Scene1925::Exit4::changeScene() { Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; _moving = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_sceneMode = 1920; scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); } @@ -13137,7 +13137,7 @@ void Scene1925::postInit(SceneObjectList *OwnerList) { switch (R2_GLOBALS._scene1925CurrLevel) { case -2: _exit4.setDetails(Rect(203, 44, 247, 111), EXITCURSOR_E, 1925); - _item3.setDetails(Rect(31, 3, 45, 167), 1925, 6, -1, 8, 1, NULL); + _ladder.setDetails(Rect(31, 3, 45, 167), 1925, 6, -1, 8, 1, NULL); break; case 3: _actor1.setDetails(1925, 0, 1, 2, 1, (SceneItem *) NULL); @@ -13149,7 +13149,7 @@ void Scene1925::postInit(SceneObjectList *OwnerList) { default: _exitUp.setDetails(Rect(128, 0, 186, 10), EXITCURSOR_N, 1925); _exit2.setDetails(Rect(128, 160, 190, 167), EXITCURSOR_S, 1925); - _item3.setDetails(Rect(141, 11, 167, 159), 1925, 6, -1, -1, 1, NULL); + _ladder.setDetails(Rect(141, 11, 167, 159), 1925, 6, -1, -1, 1, NULL); break; } @@ -13238,24 +13238,25 @@ void Scene1925::signal() { } /*-------------------------------------------------------------------------- - * Scene 1945 - + * Scene 1945 - Spill Mountains Shaft Bottom * *--------------------------------------------------------------------------*/ + Scene1945::Scene1945() { - _fieldEAA = 0; - _fieldEAC = 0; - _fieldEAE = CURSOR_NONE; + _nextSceneMode1 = 0; + _nextSceneMode2 = 0; + _lampUsed = CURSOR_NONE; } void Scene1945::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_fieldEAA); - s.syncAsSint16LE(_fieldEAC); - s.syncAsSint16LE(_fieldEAE); + s.syncAsSint16LE(_nextSceneMode1); + s.syncAsSint16LE(_nextSceneMode2); + s.syncAsSint16LE(_lampUsed); } -bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { +bool Scene1945::Ice::startAction(CursorType action, Event &event) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -13266,10 +13267,10 @@ bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { scene->_sceneMode = 1942; else { scene->_sceneMode = 1940; - scene->_fieldEAA = 1942; + scene->_nextSceneMode1 = 1942; } // At this point the original check if _sceneMode != 0. Skipped. - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_gunpowder, NULL); return true; break; case CURSOR_USE: @@ -13284,9 +13285,9 @@ bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; if (event.mousePos.x > 130) - scene->_item3.setDetails(1945, 3, -1, -1, 3, (SceneItem *) NULL); + scene->_ice.setDetails(1945, 3, -1, -1, 3, (SceneItem *) NULL); else - scene->_item3.setDetails(1945, 3, -1, 5, 3, (SceneItem *) NULL); + scene->_ice.setDetails(1945, 3, -1, 5, 3, (SceneItem *) NULL); } // No break on purpose default: @@ -13295,7 +13296,7 @@ bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { } } -bool Scene1945::Hotspot4::startAction(CursorType action, Event &event) { +bool Scene1945::Ladder::startAction(CursorType action, Event &event) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -13306,7 +13307,7 @@ bool Scene1945::Hotspot4::startAction(CursorType action, Event &event) { if ((R2_GLOBALS._player._position.x == 221) && (R2_GLOBALS._player._position.y == 142)) { scene->_sceneMode = 1949; - scene->_fieldEAA = 1947; + scene->_nextSceneMode1 = 1947; } else if ( ((R2_GLOBALS._player._position.x == 197) && (R2_GLOBALS._player._position.y == 158)) || ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) ) { scene->_sceneMode = 1947; @@ -13323,23 +13324,23 @@ bool Scene1945::Hotspot4::startAction(CursorType action, Event &event) { return true; } -bool Scene1945::Actor3::startAction(CursorType action, Event &event) { - if ((action == R2_ALCOHOL_LAMP_3) && (action == R2_ALCOHOL_LAMP_2)) { +bool Scene1945::Gunpowder::startAction(CursorType action, Event &event) { + if ((action == R2_ALCOHOL_LAMP_3) || (action == R2_ALCOHOL_LAMP_2)) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; - scene->_fieldEAE = action; + scene->_lampUsed = action; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 0; if ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) { scene->_sceneMode= 1947; - scene->_fieldEAA = 1943; + scene->_nextSceneMode1 = 1943; } else if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 50)) { scene->_sceneMode = 1940; - scene->_fieldEAA = 1943; + scene->_nextSceneMode1 = 1943; } else { scene->_sceneMode = 1949; - scene->_fieldEAA = 1947; - scene->_fieldEAC = 1943; + scene->_nextSceneMode1 = 1947; + scene->_nextSceneMode2 = 1943; } // At this point the original check if _sceneMode != 0. Skipped. scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, NULL); @@ -13358,7 +13359,7 @@ void Scene1945::ExitUp::changeScene() { if ((R2_GLOBALS._player._position.x == 221) && (R2_GLOBALS._player._position.y == 142)) { scene->_sceneMode = 1949; - scene->_fieldEAA = 1947; + scene->_nextSceneMode1 = 1947; } else if ( ((R2_GLOBALS._player._position.x == 197) && (R2_GLOBALS._player._position.y == 158)) || ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) ) { scene->_sceneMode = 1947; @@ -13381,7 +13382,7 @@ void Scene1945::Exit2::changeScene() { if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 50)) { scene->_sceneMode = 1940; - scene->_fieldEAA = 1945; + scene->_nextSceneMode1 = 1945; } else if ( ((R2_GLOBALS._player._position.x == 197) && (R2_GLOBALS._player._position.y == 158)) || ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) ) { scene->_sceneMode = 1945; @@ -13405,19 +13406,19 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { _exitUp.setDetails(Rect(128, 0, 186, 10), EXITCURSOR_N, 1945); _exit2.setDetails(Rect(238, 144, 274, 167), EXITCURSOR_E, 1945); - _item4.setDetails(Rect(141, 3, 167, 126), 1945, 9, -1, -1, 1, NULL); + _ladder.setDetails(Rect(141, 3, 167, 126), 1945, 9, -1, -1, 1, NULL); if (!R2_GLOBALS.getFlag(43)) { _exit2._enabled = false; - _actor3.postInit(); - _actor3.setup(1945, 4, 1); - _actor3.setPosition(Common::Point(253, 169)); - _actor3.fixPriority(150); + _gunpowder.postInit(); + _gunpowder.setup(1945, 4, 1); + _gunpowder.setPosition(Common::Point(253, 169)); + _gunpowder.fixPriority(150); if (R2_GLOBALS.getFlag(42)) - _actor3.setDetails(1945, 15, -1, -1, 1, (SceneItem *) NULL); + _gunpowder.setDetails(1945, 15, -1, -1, 1, (SceneItem *) NULL); else - _actor3.hide(); + _gunpowder.hide(); _actor1.postInit(); _actor1.setup(1945, 8, 1); @@ -13451,10 +13452,10 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { } R2_GLOBALS._player._canWalk = false; - _fieldEAA = 0; - _fieldEAC = 0; + _nextSceneMode1 = 0; + _nextSceneMode2 = 0; - _item3.setDetails(11, 1945, 3, -1, 5); + _ice.setDetails(11, 1945, 3, -1, 5); _item1.setDetails(Rect(238, 144, 274, 167), 1945, 0, -1, 2, 1, NULL); _item2.setDetails(Rect(27, 3, 292, 167), 1945, 3, -1, -1, 1, NULL); } @@ -13467,8 +13468,8 @@ void Scene1945::remove() { void Scene1945::signal() { switch (_sceneMode) { case 1940: - if (_fieldEAA == 1943) { - _sceneMode = _fieldEAA; + if (_nextSceneMode1 == 1943) { + _sceneMode = _nextSceneMode1; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); } else { _sceneMode = 1946; @@ -13477,27 +13478,27 @@ void Scene1945::signal() { return; break; case 1941: - if (_fieldEAA == 0) { + if (_nextSceneMode1 == 0) { R2_GLOBALS._scene1925CurrLevel = 0; R2_GLOBALS.setFlag(29); R2_GLOBALS._sceneManager.changeScene(1925); } else { - _sceneMode = _fieldEAA; - _fieldEAA = 0; + _sceneMode = _nextSceneMode1; + _nextSceneMode1 = 0; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, NULL); } return; case 1942: R2_INVENTORY.setObjectScene(R2_GUNPOWDER, 0); - _actor3.setDetails(1945, 15, -1, -1, 2, (SceneItem *) NULL); + _gunpowder.setDetails(1945, 15, -1, -1, 2, (SceneItem *) NULL); R2_GLOBALS.setFlag(42); break; case 1943: R2_GLOBALS._sound1.fadeOut2(NULL); - R2_INVENTORY.setObjectScene(_fieldEAE, 0); + R2_INVENTORY.setObjectScene(_lampUsed, 0); _sceneMode = 1948; - setAction(&_sequenceManager1, this, _sceneMode, &_actor3, &_actor2, &_actor1, NULL); - setAction(&_sequenceManager2, NULL, 1941, &R2_GLOBALS._player, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &_gunpowder, &_actor2, &_actor1, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager2, NULL, 1941, &R2_GLOBALS._player, NULL); return; case 1944: break; @@ -13505,17 +13506,17 @@ void Scene1945::signal() { R2_GLOBALS._sceneManager.changeScene(1950); return; case 1946: - if (_fieldEAA == 1942) { - _sceneMode = _fieldEAA; - _fieldEAA = 0; - setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor3, NULL); + if (_nextSceneMode1 == 1942) { + _sceneMode = _nextSceneMode1; + _nextSceneMode1 = 0; + setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_gunpowder, NULL); return; } break; case 1947: - if (_fieldEAA == 1943) { - _sceneMode = _fieldEAA; - _fieldEAA = 1948; + if (_nextSceneMode1 == 1943) { + _sceneMode = _nextSceneMode1; + _nextSceneMode1 = 1948; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); } else { _sceneMode = 1941; @@ -13525,19 +13526,19 @@ void Scene1945::signal() { case 1948: R2_GLOBALS._sound1.play(220); _exit2._enabled = true; - R2_GLOBALS._sceneItems.remove(&_actor3); + R2_GLOBALS._sceneItems.remove(&_gunpowder); R2_GLOBALS.clearFlag(42); R2_GLOBALS.clearFlag(43); - _fieldEAA = 1940; + _nextSceneMode1 = 1940; // No break on purpose case 1949: - _sceneMode = _fieldEAA; - if (_fieldEAC == 1943) { - _fieldEAA = _fieldEAC; - _fieldEAC = 0; + _sceneMode = _nextSceneMode1; + if (_nextSceneMode2 == 1943) { + _nextSceneMode1 = _nextSceneMode2; + _nextSceneMode2 = 0; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_actor2, NULL); } else { - _fieldEAA = 0; + _nextSceneMode1 = 0; setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, NULL); } return; @@ -13550,9 +13551,10 @@ void Scene1945::signal() { } /*-------------------------------------------------------------------------- - * Scene 1950 - + * Scene 1950 - Flup Tube Corridor Maze * *--------------------------------------------------------------------------*/ + Scene1950::Area1::Area1() { _field20 = 0; _fieldB65 = 0; @@ -13656,7 +13658,7 @@ void Scene1950::Area1::remove() { if (!R2_GLOBALS.getFlag(37)) R2_GLOBALS._sound2.play(278); - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); scene->_exit3._enabled = true; if (!R2_GLOBALS.getFlag(37)) { @@ -13742,7 +13744,7 @@ bool Scene1950::Hotspot2::startAction(CursorType action, Event &event) { return true; } -bool Scene1950::Actor2::startAction(CursorType action, Event &event) { +bool Scene1950::Door::startAction(CursorType action, Event &event) { if (action != R2_SCRITH_KEY) return SceneActor::startAction(action, event); @@ -13751,7 +13753,7 @@ bool Scene1950::Actor2::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); R2_INVENTORY.setObjectScene(R2_SCRITH_KEY, 0); scene->_sceneMode = 1958; - scene->setAction(&scene->_sequenceManager, scene, 1958, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 1958, &R2_GLOBALS._player, &scene->_door, NULL); return true; } @@ -13893,7 +13895,7 @@ void Scene1950::Actor8::signal() { NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } else { - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } if (R2_GLOBALS._v566A5 == 3) @@ -13905,7 +13907,7 @@ void Scene1950::Actor8::signal() { break; case 22: SceneItem::display(1950, 18, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 23: SceneItem::display(1950, 25, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); @@ -13945,7 +13947,7 @@ void Scene1950::Exit1::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._v566A5 = 1; scene->_sceneMode = 11; @@ -13958,7 +13960,7 @@ void Scene1950::Exit2::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._v566A5 = 2; scene->_sceneMode = 12; @@ -13979,7 +13981,7 @@ void Scene1950::Exit3::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._v566A5 = 3; scene->_sceneMode = 13; @@ -13995,7 +13997,7 @@ void Scene1950::Exit4::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._v566A5 = 4; scene->_sceneMode = 14; @@ -14009,7 +14011,7 @@ void Scene1950::Exit5::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._v566A5 = 5; scene->_sceneMode = 15; @@ -14022,7 +14024,7 @@ void Scene1950::Exit6::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._v566A5 = 5; if (R2_GLOBALS._v566A4 == 2) { if ((R2_GLOBALS.getFlag(36)) && (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 2) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2)) { @@ -14055,7 +14057,7 @@ void Scene1950::Exit7::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._v566A5 = 0; scene->_sceneMode = 1951; scene->setAction(&scene->_sequenceManager, scene, 1951, &R2_GLOBALS._player, NULL); @@ -14065,7 +14067,7 @@ void Scene1950::Exit8::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._v566A5 = 3; if (R2_GLOBALS._player._visage == 22) { scene->_sceneMode = 1975; @@ -14081,7 +14083,7 @@ void Scene1950::Exit8::changeScene() { } } -void Scene1950::subBDC1E() { +void Scene1950::initExits() { _exit1._enabled = false; _exit2._enabled = false; _exit3._enabled = false; @@ -14107,6 +14109,7 @@ void Scene1950::subBDC1E() { _exit7._moving = false; _exit8._moving = false; _field412 = 0; + switch (R2_GLOBALS._v566A4 - 1) { case 0: loadScene(1948); @@ -14769,12 +14772,12 @@ void Scene1950::subBDC1E() { R2_GLOBALS._uiElements.draw(); } -void Scene1950::subBE59B() { +void Scene1950::enterArea() { R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); _actor8.remove(); - _actor2.remove(); + _door.remove(); _actor3.remove(); _field416 = 0; @@ -14863,12 +14866,12 @@ void Scene1950::subBE59B() { } } if ((R2_GLOBALS._v566A4 == 1) && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) != 0)) { - _actor2.postInit(); - _actor2.setVisage(1948); - _actor2.setStrip(3); - _actor2.setPosition(Common::Point(278, 155)); - _actor2.fixPriority(100); - _actor2.setDetails(1950, 19, 20, 23, 2, (SceneItem *) NULL); + _door.postInit(); + _door.setVisage(1948); + _door.setStrip(3); + _door.setPosition(Common::Point(278, 155)); + _door.fixPriority(100); + _door.setDetails(1950, 19, 20, 23, 2, (SceneItem *) NULL); } if (R2_GLOBALS._v566A4 == 102) { @@ -14950,7 +14953,7 @@ void Scene1950::subBE59B() { _sceneMode = 1950; if (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) { R2_GLOBALS._v56AAB = 0; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); } else { setAction(&_sequenceManager, this, 1950, &R2_GLOBALS._player, NULL); } @@ -15134,7 +15137,7 @@ void Scene1950::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._sceneManager._previousScene == 300) R2_GLOBALS._v566A4 = 103; - subBDC1E(); + initExits(); SceneExt::postInit(); R2_GLOBALS._sound1.play(105); @@ -15172,7 +15175,7 @@ void Scene1950::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(5, 3); _item1.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 1, NULL); - subBE59B(); + enterArea(); } void Scene1950::remove() { @@ -15185,44 +15188,44 @@ void Scene1950::signal() { switch (_sceneMode) { case 11: R2_GLOBALS._v566A4 += 7; - subBDC1E(); - subBE59B(); + initExits(); + enterArea(); break; case 12: R2_GLOBALS._v566A4 += 35; - subBDC1E(); - subBE59B(); + initExits(); + enterArea(); break; case 1975: SceneItem::display(1950, 21, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); // No break on purpose case 13: ++R2_GLOBALS._v566A4; - subBDC1E(); - subBE59B(); + initExits(); + enterArea(); break; case 14: R2_GLOBALS._v566A4 += 221; - subBDC1E(); - subBE59B(); + initExits(); + enterArea(); break; case 15: R2_GLOBALS._v566A4 += 249; - subBDC1E(); - subBE59B(); + initExits(); + enterArea(); break; case 16: // No break on purpose case 1961: --R2_GLOBALS._v566A4; - subBDC1E(); - subBE59B(); + initExits(); + enterArea(); break; case 17: { _sceneMode = 13; R2_GLOBALS._v566A5 = 3; _field416 = 0; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; R2_GLOBALS._player.setVisage(22); R2_GLOBALS._player.animate(ANIM_MODE_9, NULL); @@ -15238,7 +15241,7 @@ void Scene1950::signal() { _sceneMode = 16; R2_GLOBALS._v566A5 = 6; _field416 = 0; - R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; R2_GLOBALS._player.setVisage(22); R2_GLOBALS._player.animate(ANIM_MODE_9, NULL); @@ -15263,13 +15266,13 @@ void Scene1950::signal() { case 1958: SceneItem::display(1950, 24, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); R2_GLOBALS._v56AAB = 0; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); _exit8._enabled = true; break; case 1959: R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, 0); R2_GLOBALS._v56AAB = 0; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); _exit8._enabled = true; break; case 1962: @@ -15323,17 +15326,17 @@ void Scene1950::signal() { break; default: R2_GLOBALS._v56AAB = 0; - R2_GLOBALS._player.enableControl(CURSOR_ARROW); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; } } void Scene1950::process(Event &event) { if ( (event.eventType == EVENT_BUTTON_DOWN) - && (R2_GLOBALS._player._uiEnabled) - && (R2_GLOBALS._events.getCursor() == R2_LIGHT_BULB) - && (R2_GLOBALS._player._bounds.contains(event.mousePos)) - && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0)) { + && (R2_GLOBALS._player._uiEnabled) + && (R2_GLOBALS._events.getCursor() == R2_SOAKED_FACEMASK) + && (R2_GLOBALS._player._bounds.contains(event.mousePos)) + && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0)) { event.handled = true; R2_GLOBALS._player.disableControl(); _exit7._enabled = false; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index fbc1f15565..1dcc5ded56 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1015,7 +1015,7 @@ class Scene1925 : public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Hotspot3 : public NamedHotspot { + class Ladder : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1039,7 +1039,7 @@ class Scene1925 : public SceneExt { public: NamedHotspot _item1; Button _button; - Hotspot3 _item3; + Ladder _ladder; SceneActor _actor1; ExitUp _exitUp; Exit2 _exit2; @@ -1060,16 +1060,16 @@ public: }; class Scene1945 : public SceneExt { - class Hotspot3 : public NamedHotspot { + class Ice : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Hotspot4 : public NamedHotspot { + class Ladder : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Gunpowder : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1085,19 +1085,19 @@ class Scene1945 : public SceneExt { public: NamedHotspot _item1; NamedHotspot _item2; - Hotspot3 _item3; - Hotspot4 _item4; + Ice _ice; + Ladder _ladder; SceneActor _actor1; SceneActor _actor2; - Actor3 _actor3; + Gunpowder _gunpowder; ExitUp _exitUp; Exit2 _exit2; SequenceManager _sequenceManager1; SequenceManager _sequenceManager2; - int _fieldEAA; - int _fieldEAC; - CursorType _fieldEAE; + int _nextSceneMode1; + int _nextSceneMode2; + CursorType _lampUsed; Scene1945(); void synchronize(Serializer &s); @@ -1144,7 +1144,7 @@ class Scene1950 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Door : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1214,7 +1214,7 @@ public: Hotspot2 _item2; SceneActor _actor1; BackgroundSceneObject _object1; - Actor2 _actor2; + Door _door; Actor3 _actor3; SceneActor _actor4; Actor5 _actor5; @@ -1241,8 +1241,8 @@ public: Scene1950(); void synchronize(Serializer &s); - void subBDC1E(); - void subBE59B(); + void initExits(); + void enterArea(); void subBF4B4(int indx); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); -- cgit v1.2.3 From 3dbab52fc564d82bd5eef68d0aaadcc6ad48bfbe Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 22:19:37 +0400 Subject: FULLPIPE: Unstubbed MovGraph constructor --- engines/fullpipe/motion.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 022eef87be..2332994540 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -107,11 +107,16 @@ bool MctlCompoundArray::load(MfcArchive &file) { int MovGraph_messageHandler(ExCommand *cmd); +int MovGraphCallback(int a1, int a2, int a3) { + warning("STUB: MovgraphCallback"); + + return 0; +} + MovGraph::MovGraph() { - warning("STUB: MovGraph::MovGraph()"); _itemsCount = 0; _items = 0; - //_callback1 = MovGraphCallback1; // TODO + _callback1 = MovGraphCallback; _field_44 = 0; insertMessageHandler(MovGraph_messageHandler, getMessageHandlersCount() - 1, 129); -- cgit v1.2.3 From 38a0c8556f24bec7590c4d846640eaf0170f3fa8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 22:30:06 +0400 Subject: FULLPIPE: Implement startWalkTo() --- engines/fullpipe/motion.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 2332994540..337c1817dd 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -29,6 +29,7 @@ #include "fullpipe/objects.h" #include "fullpipe/motion.h" #include "fullpipe/messages.h" +#include "fullpipe/gameloader.h" namespace Fullpipe { @@ -285,7 +286,10 @@ void ReactPolygonal::createRegion() { } int startWalkTo(int objId, int objKey, int x, int y, int a5) { - warning("STUB: startWalkTo(%d, %d, %d, %d, %d)", objId, objKey, x, y, a5); + MctlCompound *mc = getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId); + + if (mc) + return (mc->method34(g_fullpipe->_currentScene->getStaticANIObject1ById(objId, objKey), x, y, a5, 0) != 0); return 0; } -- cgit v1.2.3 From 77daa12f85b112c4b5d1182144c71816ae7ea28c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Sep 2013 23:45:04 +0400 Subject: FULLPIPE: Fix bug in picture search --- engines/fullpipe/scene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 0ea724fbed..8bae697492 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -327,7 +327,7 @@ void Scene::setPictureObjectsFlag4() { } PictureObject *Scene::getPictureObjectById(int objId, int flags) { - for (uint i = 0; i < _picObjList.size(); i++) { + for (uint i = 1; i < _picObjList.size(); i++) { if (((PictureObject *)_picObjList[i])->_id == objId && ((PictureObject *)_picObjList[i])->_okeyCode == flags) return (PictureObject *)_picObjList[i]; } -- cgit v1.2.3 From d6c5eed8ffd542bc137139f1289002e9c907094e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 19 Sep 2013 23:33:26 +0300 Subject: FULLPIPE: Remove leftover debug output --- engines/fullpipe/input.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp index 4db0ffb49f..ee826fd359 100644 --- a/engines/fullpipe/input.cpp +++ b/engines/fullpipe/input.cpp @@ -172,7 +172,6 @@ void FullpipeEngine::defHandleKeyDown(int key) { } _currentCheatPos++; - warning("%d %d", _currentCheat, _currentCheatPos); if (!input_cheats[_currentCheat][_currentCheatPos]) { switch (_currentCheat) { -- cgit v1.2.3 From 5b23a251ceefaecdd4d46e1b27835adaf7dd7f99 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 19 Sep 2013 23:53:12 +0200 Subject: SCI: Fix too strict assert triggering in LSL5 --- engines/sci/sound/midiparser_sci.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 7640c5f314..4b4333a37c 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -663,7 +663,10 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) { // as there aren't any subsequent MIDI events after this one. // This assert is here to detect cases where the song ends // up jumping forward, like with bug #3614566 (see above). - assert(_loopTick + info.delta < _position._playTick); + // (Exception: delta == 0, in which case the loop points + // at the previous event, which is fine.) + assert(_loopTick + info.delta < _position._playTick || + ((_loopTick == _position._playTick && info.delta == 0))); uint32 extraDelta = info.delta; _pSnd->inFastForward = true; -- cgit v1.2.3 From 5ea8e28d281f44d4f35edd7fbc4bc33a4ee7be90 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 19 Sep 2013 19:19:03 -0400 Subject: TSAGE: Reversed all R2R enableRegion/disableRegion calls --- engines/tsage/ringworld2/ringworld2_scenes0.cpp | 26 ++-- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 152 ++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes2.cpp | 16 +-- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 142 +++++++++++----------- 4 files changed, 168 insertions(+), 168 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 40e17b6ed9..3e5b230a05 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -5225,7 +5225,7 @@ void Scene500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_SEEKER] = 500; if (R2_GLOBALS._player._characterIndex == R2_QUINN) { - R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(1); _seeker.postInit(); _seeker._effect = 1; @@ -5239,9 +5239,9 @@ void Scene500::postInit(SceneObjectList *OwnerList) { _seeker.setup(R2_GLOBALS.getFlag(26) ? 1500 : 10, 1, 1); _seeker.setPosition(Common::Point(42, 151)); - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); _seeker.setDetails(500, 37, 38, -1, 1, (SceneItem *)NULL); } @@ -5757,7 +5757,7 @@ void Scene600::postInit(SceneObjectList *OwnerList) { loadScene(600); SceneExt::postInit(); R2_GLOBALS.setFlag(39); - R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(3); _field412 = 0; // Initialize pixel map for the obscuring effect @@ -5907,10 +5907,10 @@ void Scene600::signal() { case 605: // After cloud is active R2_GLOBALS._player.enableControl(); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(9); - R2_GLOBALS._walkRegions.enableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(10); R2_INVENTORY.setObjectScene(R2_AEROSOL, 600); R2_GLOBALS.setFlag(5); @@ -5932,9 +5932,9 @@ void Scene600::signal() { // deactivate cloud R2_GLOBALS.setFlag(8); _smoke.remove(); - R2_GLOBALS._walkRegions.disableRegion(6); - R2_GLOBALS._walkRegions.disableRegion(9); - R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.enableRegion(9); + R2_GLOBALS._walkRegions.enableRegion(10); R2_GLOBALS._player.enableControl(); break; case 612: @@ -5951,7 +5951,7 @@ void Scene600::signal() { R2_GLOBALS._player.enableControl(); _aerosol.remove(); R2_INVENTORY.setObjectScene(R2_AEROSOL, 1); - R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(7); break; case 615: // Pick up Com Scanner diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 35b4ba4545..f17310ec7b 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -7877,7 +7877,7 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { _companion.setDetails(1550, -1, -1, -1, 2, (SceneItem *) NULL); assert(_field419 >= 1550); - R2_GLOBALS._walkRegions.enableRegion(k5A750[_field419 - 1550]); + R2_GLOBALS._walkRegions.disableRegion(k5A750[_field419 - 1550]); setAction(&_sequenceManager1, this, 1590, &_companion, NULL); } else if ((_sceneMode != 1577) && (_sceneMode != 1578)) @@ -7955,7 +7955,7 @@ void Scene1550::signal() { case 42: { _sceneMode = 43; int junkRegionIndex = R2_GLOBALS._scene1550JunkLocations[_junk[0]._junkNumber + 3]; - R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[junkRegionIndex]); + R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[junkRegionIndex]); switch (_junk[0]._frame) { case 1: @@ -9011,10 +9011,10 @@ void Scene1550::enterArea() { _junk[di].setPosition(Common::Point(150, 70)); _junk[di].setup(1562, 1, 1); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[2]); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[3]); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[6]); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[7]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[2]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[3]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[6]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[7]); if (R2_INVENTORY.getObjectScene(R2_JOYSTICK) == 1550) { _actor9.postInit(); @@ -9033,7 +9033,7 @@ void Scene1550::enterArea() { } _junk[di].setPosition(Common::Point(k5A72E[tmpIdx], k5A73F[tmpIdx])); if (scene1550JunkRegions[tmpIdx] != 0) - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[tmpIdx]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[tmpIdx]); di++; } } @@ -9092,7 +9092,7 @@ void Scene1550::enterArea() { _actor4.setPosition(Common::Point(172, 48)); _actor4.fixPriority(169); - R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[15]); + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[15]); break; case 2: _wreckage.postInit(); @@ -9249,7 +9249,7 @@ void Scene1550::enterArea() { _companion.changeZoom(-1); assert((_field419 >= 1550) && (_field419 <= 2008)); - R2_GLOBALS._walkRegions.enableRegion(k5A750[_field419 - 1550]); + R2_GLOBALS._walkRegions.disableRegion(k5A750[_field419 - 1550]); _companion.setPosition(Common::Point(k5A72E[k5A76D[_field419 - 1550]], k5A73F[k5A76D[_field419 - 1550]] + 8)); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS._player._characterScene[R2_SEEKER] == 1580) { @@ -10403,8 +10403,8 @@ void Scene1700::enterArea() { _ledgeHopper.setup(1701, 1, 1); _ledgeHopper.setPosition(Common::Point(220, 137)); _ledgeHopper.setDetails(1700, 6, -1, -1, 2, (SceneItem *) NULL); - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(12); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(12); } if ((R2_GLOBALS._rimLocation + 2) % 4 == 0) { @@ -10428,7 +10428,7 @@ void Scene1700::enterArea() { _slabEast.setup(1700, 1, 2); _slabEast.setPosition(Common::Point(424, 84)); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(11); } if ((R2_GLOBALS._rimLocation + 399) % 800 == 0) { @@ -10441,7 +10441,7 @@ void Scene1700::enterArea() { _westExit._enabled = true; } else { - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); _westExit._enabled = false; } @@ -10587,11 +10587,11 @@ void Scene1700::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setPosition(Common::Point(109, 160)); _actor12.setPosition(Common::Point(156, 160)); - R2_GLOBALS._walkRegions.enableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(15); } else { R2_GLOBALS._player.setPosition(Common::Point(156, 160)); _actor12.setPosition(Common::Point(109, 160)); - R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(17); } _sceneMode = 50; setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL); @@ -10630,13 +10630,13 @@ void Scene1700::signal() { Common::Point pt2(156, 160); NpcMover *mover2 = new NpcMover(); _actor12.addMover(mover2, &pt2, NULL); - R2_GLOBALS._walkRegions.enableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(15); } else { _actor12.setPosition(Common::Point(109, 170)); Common::Point pt3(109, 160); NpcMover *mover3 = new NpcMover(); _actor12.addMover(mover3, &pt3, NULL); - R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(17); } } break; @@ -10655,13 +10655,13 @@ void Scene1700::signal() { Common::Point pt2(155, 10); NpcMover *mover2 = new NpcMover(); _actor12.addMover(mover2, &pt2, NULL); - R2_GLOBALS._walkRegions.enableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(15); } else { _actor12.setPosition(Common::Point(188, 0)); Common::Point pt3(188, 10); NpcMover *mover3 = new NpcMover(); _actor12.addMover(mover3, &pt3, NULL); - R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(17); } } break; @@ -10702,13 +10702,13 @@ void Scene1700::signal() { _actor12.setObjectWrapper(new SceneObjectWrapper()); _actor12._strip = 1; R2_GLOBALS._player.enableControl(CURSOR_WALK); - R2_GLOBALS._walkRegions.enableRegion(14); + R2_GLOBALS._walkRegions.disableRegion(14); break; case 8: R2_GLOBALS._player._strip = 2; _actor12._strip = 1; R2_GLOBALS._player.enableControl(CURSOR_WALK); - R2_GLOBALS._walkRegions.enableRegion(12); + R2_GLOBALS._walkRegions.disableRegion(12); break; case 30: _sceneMode = 31; @@ -10730,17 +10730,17 @@ void Scene1700::signal() { break; case 50: if (R2_GLOBALS._player._characterIndex == R2_QUINN) - R2_GLOBALS._walkRegions.enableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(15); else - R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(17); R2_GLOBALS._player.enableControl(); break; case 1704: R2_GLOBALS._sound1.play(134); - R2_GLOBALS._walkRegions.enableRegion(15); - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(12); + R2_GLOBALS._walkRegions.disableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(12); R2_GLOBALS._player.fixPriority(-1); R2_GLOBALS._player.enableControl(CURSOR_WALK); break; @@ -11390,7 +11390,7 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setObjectWrapper(NULL); R2_GLOBALS._player.setup(1801, 5, 12); R2_GLOBALS._player.setPosition(Common::Point(160, 139)); - R2_GLOBALS._walkRegions.enableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(9); _doors.hide(); } else { R2_GLOBALS._player.setVisage(1507); @@ -11407,7 +11407,7 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { _companion.setObjectWrapper(NULL); _companion.setup(1801, 5, 12); - R2_GLOBALS._walkRegions.enableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(9); _doors.hide(); } else { _companion.setup(1507, 1, 1); @@ -11427,11 +11427,11 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setStrip(5); if (R2_GLOBALS.getFlag(14)) { _companion.setPosition(Common::Point(160, 139)); - R2_GLOBALS._walkRegions.enableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(8); } else { _companion.setPosition(Common::Point(209, 150)); _companion.setStrip(6); - R2_GLOBALS._walkRegions.enableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(8); } } else { if (R2_GLOBALS.getFlag(14)) { @@ -11443,8 +11443,8 @@ void Scene1800::postInit(SceneObjectList *OwnerList) { } _companion.setPosition(Common::Point(114, 150)); _companion.setStrip(5); - R2_GLOBALS._walkRegions.enableRegion(10); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(11); } } else { if (R2_GLOBALS._player._characterIndex == R2_QUINN) { @@ -11586,7 +11586,7 @@ void Scene1800::signal() { R2_GLOBALS._player.enableControl(CURSOR_USE); break; case 1800: - R2_GLOBALS._walkRegions.enableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(8); if (R2_GLOBALS.getFlag(63)) R2_GLOBALS._player.enableControl(CURSOR_USE); else { @@ -11596,8 +11596,8 @@ void Scene1800::signal() { } break; case 1801: - R2_GLOBALS._walkRegions.enableRegion(10); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(11); R2_GLOBALS.setFlag(63); // The following check is completely dumb. @@ -11636,14 +11636,14 @@ void Scene1800::signal() { case 1814: // No break on purpose case 1815: - R2_GLOBALS._walkRegions.enableRegion(10); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(11); R2_GLOBALS._player.enableControl(); break; case 1816: // No break on purpose case 1817: - R2_GLOBALS._walkRegions.enableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(8); R2_GLOBALS._player.enableControl(); break; default: @@ -11908,19 +11908,19 @@ void Scene1850::postInit(SceneObjectList *OwnerList) { _rightDoor.setPosition(Common::Point(253, 102)); _rightDoor.setDetails(1850, 22, -1, -1, 1, (SceneItem *) NULL); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); _robot.postInit(); if (R2_GLOBALS.getFlag(34)) { - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); _robot.setup(1851, 4, 3); } else if (R2_GLOBALS.getFlag(30)) { _robot.setup(1851, 2, 2); } else { - R2_GLOBALS._walkRegions.enableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(5); if (R2_GLOBALS.getFlag(33)) { - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); _robot.setup(1851, 1, 3); } else { _robot.setup(1851, 2, 1); @@ -12167,7 +12167,7 @@ void Scene1850::signal() { _companion._effect = 6; _companion._shade = 6; - R2_GLOBALS._walkRegions.enableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(5); if (R2_GLOBALS.getFlag(68)) { R2_GLOBALS._player.enableControl(); @@ -12229,7 +12229,7 @@ void Scene1850::signal() { } else if (R2_GLOBALS.getFlag(33)) { R2_GLOBALS.setFlag(62); R2_GLOBALS.setFlag(34); - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); _actor2.postInit(); _actor2.setDetails(1850, 6, -1, -1, 5, &_robot); @@ -12330,7 +12330,7 @@ void Scene1850::signal() { _field41E = 0; break; case 1870: - R2_GLOBALS._walkRegions.enableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(5); R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1); R2_GLOBALS.setFlag(32); R2_GLOBALS._player.enableControl(CURSOR_WALK); @@ -12376,7 +12376,7 @@ void Scene1850::signal() { case 1878: R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1850); R2_GLOBALS.setFlag(33); - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); R2_GLOBALS._player.enableControl(); break; case 1879: @@ -12813,7 +12813,7 @@ void Scene1900::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); _actor1.setPosition(Common::Point(30, 110)); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); _actor1.setup(2008, 3, 1); _actor1.setDetails(9001, 0, -1, -1, 1, (SceneItem *) NULL); } @@ -12822,7 +12822,7 @@ void Scene1900::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); _actor1.setPosition(Common::Point(30, 110)); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 3, 1); _actor1.setDetails(9002, 1, -1, -1, 1, (SceneItem *) NULL); @@ -14349,11 +14349,11 @@ void Scene1950::initExits() { _exit7._enabled = true; if ((R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) && (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 1950)) _exit8._enabled = true; - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(4); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); break; case 1: // No break on purpose @@ -14471,8 +14471,8 @@ void Scene1950::initExits() { // No break on purpose case 104: _exit6._enabled = true; - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(9); break; case 5: // No break on purpose @@ -14522,16 +14522,16 @@ void Scene1950::initExits() { // No break on purpose case 101: _exit3._enabled = true; - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(13); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(13); break; default: - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(9); - R2_GLOBALS._walkRegions.enableRegion(13); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(13); break; } @@ -14586,8 +14586,8 @@ void Scene1950::initExits() { _actor1.setFrame(2); _actor1.setPosition(Common::Point(160, 167)); _actor1.fixPriority(220); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(4); break; case 7: // No break on purpose @@ -14650,8 +14650,8 @@ void Scene1950::initExits() { _actor1.setFrame(3); _actor1.setPosition(Common::Point(160, 167)); _actor1.fixPriority(220); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(4); break; default: _actor1.postInit(); @@ -14761,11 +14761,11 @@ void Scene1950::initExits() { // No break on purpose case 100: _exit4._enabled = true; - R2_GLOBALS._walkRegions.enableRegion(4); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(10); - R2_GLOBALS._walkRegions.enableRegion(11); + R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(10); + R2_GLOBALS._walkRegions.disableRegion(11); default: break; } @@ -14876,10 +14876,10 @@ void Scene1950::enterArea() { if (R2_GLOBALS._v566A4 == 102) { R2_GLOBALS._walkRegions.load(1951); - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); _actor6.postInit(); _actor6.setVisage(1970); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 9fa64b3ec1..01c5ae3fd6 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1575,7 +1575,7 @@ void Scene2430::postInit(SceneObjectList *OwnerList) { _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } _actor1.setPosition(Common::Point(189, 137)); - R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(4); } _item2.setDetails(Rect(11, 30, 37, 45), 2430, 3, -1, 5, 1, NULL); @@ -1720,7 +1720,7 @@ void Scene2435::postInit(SceneObjectList *OwnerList) { _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } _companion.setPosition(Common::Point(107, 145)); - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); } _leftWindow.setDetails(Rect(52, 44, 96, 82), 2430, 3, -1, 5, 1, NULL); @@ -1778,7 +1778,7 @@ void Scene2435::signal() { setAction(&_sequenceManager, this, 2436, &_companion, NULL); break; case 2436: - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); _sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_ARROW); _stripManager.start(709, this); @@ -2587,7 +2587,7 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { } _actor1.setPosition(Common::Point(209, 162)); - R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(4); } _item5.setDetails(Rect(125, 73, 140, 86), 2525, 6, -1, -1, 1, NULL); @@ -2748,7 +2748,7 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } _actor1.setPosition(Common::Point(20, 130)); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); } _item2.setDetails(Rect(108, 90, 135, 205), 2530, 22, -1, -1, 1, NULL); @@ -2872,7 +2872,7 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { _rebreatherTank.setup(2535, 3, 1); _rebreatherTank.setPosition(Common::Point(203, 131)); _rebreatherTank.setDetails(3, 20, -1, -1, 1, (SceneItem *)NULL); - R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(6); } if ((R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) == 0) && (R2_GLOBALS.getFlag(73))) { @@ -2911,7 +2911,7 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { _companion.setDetails(9001, 0, 5, 3, 1, (SceneItem *)NULL); } _companion.setPosition(Common::Point(245, 115)); - R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(2); } _roof.setDetails(Rect(96, 3, 215, 33), 2535, 3, 6, 5, 1, NULL); @@ -2947,7 +2947,7 @@ void Scene2535::signal() { break; case 2536: R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 0); - R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.enableRegion(6); if (!R2_GLOBALS.getFlag(73)) { _rebreatherTank.remove(); R2_GLOBALS._player.enableControl(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 233e83effd..3b83e96b7b 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -588,10 +588,10 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { _actor4.postInit(); if (R2_GLOBALS.getFlag(75)) { if (R2_GLOBALS.getFlag(76)) { - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(4); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); _actor4.setup(3152, 4, 10); _actor4.setDetails(3150, 14, -1, -1, 1, (SceneItem *)NULL); } else { @@ -765,10 +765,10 @@ void Scene3150::signal() { R2_GLOBALS._sceneItems.remove(&_actor2); _exit1.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); _exit1.setDest(Common::Point(70, 125)); - R2_GLOBALS._walkRegions.enableRegion(1); - R2_GLOBALS._walkRegions.enableRegion(4); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); R2_GLOBALS.setFlag(78); R2_GLOBALS._player.enableControl(); break; @@ -1844,16 +1844,16 @@ bool Scene3375::Actor4::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); if (R2_GLOBALS._v56A9E != 0) { - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); } else { - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(3); - R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(4); } - R2_GLOBALS._walkRegions.disableRegion(6); - R2_GLOBALS._walkRegions.disableRegion(7); - R2_GLOBALS._walkRegions.disableRegion(8); + R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.enableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(8); R2_GLOBALS._player.disableControl(CURSOR_ARROW); @@ -1870,12 +1870,12 @@ void Scene3375::Exit1::changeScene() { R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3376; if (R2_GLOBALS._v56A9E != 0) { - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); } else { - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(3); - R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(4); } if (scene->_actor1._position.y != 163) { R2_GLOBALS._player.setStrip(-1); @@ -1908,12 +1908,12 @@ void Scene3375::Exit2::changeScene() { scene->_field1488 = 3381; if (R2_GLOBALS._v56A9E != 0) { - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); } else { - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(3); - R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(4); } scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); } @@ -1930,12 +1930,12 @@ void Scene3375::Exit3::changeScene() { scene->_field1488 = 3380; if (R2_GLOBALS._v56A9E != 0) { - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(3); } else { - R2_GLOBALS._walkRegions.disableRegion(1); - R2_GLOBALS._walkRegions.disableRegion(3); - R2_GLOBALS._walkRegions.disableRegion(4); + R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.enableRegion(3); + R2_GLOBALS._walkRegions.enableRegion(4); } scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); } @@ -2091,28 +2091,28 @@ void Scene3375::signalCase3379() { case 0: _exit1._enabled = true; if (R2_GLOBALS._sceneManager._previousScene == 3385) - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); else { - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(4); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(4); } - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); case 2: _exit1._enabled = false; - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(8); - R2_GLOBALS._walkRegions.enableRegion(9); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(8); + R2_GLOBALS._walkRegions.disableRegion(9); default: _exit1._enabled = false; - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(3); - R2_GLOBALS._walkRegions.enableRegion(5); - R2_GLOBALS._walkRegions.enableRegion(6); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(3); + R2_GLOBALS._walkRegions.disableRegion(5); + R2_GLOBALS._walkRegions.disableRegion(6); break; } R2_GLOBALS._sceneManager._previousScene = 3375; @@ -2602,7 +2602,7 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { _actor3.setPosition(Common::Point(155, 242)); _actor4.setup(3395, 1, 1); - R2_GLOBALS._walkRegions.enableRegion(1); + R2_GLOBALS._walkRegions.disableRegion(1); _sceneMode = 3395; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); @@ -4283,8 +4283,8 @@ bool Scene3600::Item5::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (scene->_action1._field1E == 0)) return SceneItem::startAction(action, event); - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(7); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3624; @@ -4439,11 +4439,11 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _field254A = 1; _field2548 = 1; - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(14); - R2_GLOBALS._walkRegions.enableRegion(15); - R2_GLOBALS._walkRegions.enableRegion(16); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(14); + R2_GLOBALS._walkRegions.disableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(16); _actor10.setup(10, 5, 11); _actor10.animate(ANIM_MODE_1, NULL); @@ -4517,8 +4517,8 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _field254A = 0; _field2548 = 0; - R2_GLOBALS._walkRegions.enableRegion(17); - R2_GLOBALS._walkRegions.enableRegion(18); + R2_GLOBALS._walkRegions.disableRegion(17); + R2_GLOBALS._walkRegions.disableRegion(18); _actor10.setPosition(Common::Point(393, 148)); _actor11.setPosition(Common::Point(364, 153)); @@ -4568,7 +4568,7 @@ void Scene3600::signal() { switch (_sceneMode) { case 3320: warning("STUB: sub_1D227()"); - R2_GLOBALS._walkRegions.enableRegion(14); + R2_GLOBALS._walkRegions.disableRegion(14); R2_GLOBALS._scrollFollower = &_actor11; _tealSpeaker._object1.hide(); _actor5.show(); @@ -4617,13 +4617,13 @@ void Scene3600::signal() { _quinnSpeaker._displayMode = 1; _actor13.show(); R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - R2_GLOBALS._walkRegions.disableRegion(17); - R2_GLOBALS._walkRegions.disableRegion(18); - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(7); - R2_GLOBALS._walkRegions.enableRegion(14); - R2_GLOBALS._walkRegions.enableRegion(15); - R2_GLOBALS._walkRegions.enableRegion(16); + R2_GLOBALS._walkRegions.enableRegion(17); + R2_GLOBALS._walkRegions.enableRegion(18); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(14); + R2_GLOBALS._walkRegions.disableRegion(15); + R2_GLOBALS._walkRegions.disableRegion(16); _actor13.setAction(&_action1); } break; @@ -4713,8 +4713,8 @@ void Scene3600::signal() { case 3602: // No break on purpose case 3603: - R2_GLOBALS._walkRegions.enableRegion(2); - R2_GLOBALS._walkRegions.enableRegion(7); + R2_GLOBALS._walkRegions.disableRegion(2); + R2_GLOBALS._walkRegions.disableRegion(7); R2_GLOBALS._v558B6.set(60, 0, 260, 200); _tealSpeaker._displayMode = 1; _sceneMode = 3321; @@ -4723,8 +4723,8 @@ void Scene3600::signal() { case 3604: R2_GLOBALS._sound2.fadeOut2(NULL); R2_GLOBALS._sound1.stop(); - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(7); _actor2.hide(); _actor3.hide(); @@ -4826,8 +4826,8 @@ void Scene3600::dispatch() { _field254C = 0; _field254E = 1; - R2_GLOBALS._walkRegions.disableRegion(2); - R2_GLOBALS._walkRegions.disableRegion(7); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._walkRegions.enableRegion(7); R2_GLOBALS._player.disableControl(); _sceneMode = 3624; -- cgit v1.2.3 From 05b877d617ed9aa1267b57772cb0a85e61088c2d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 19 Sep 2013 19:45:56 -0400 Subject: TSAGE: Further bugfixes and renaming for R2R shaft bottom --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 12 ++++++------ engines/tsage/ringworld2/ringworld2_scenes1.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index f17310ec7b..559e56f36e 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -13373,7 +13373,7 @@ void Scene1945::ExitUp::changeScene() { } } -void Scene1945::Exit2::changeScene() { +void Scene1945::CorridorExit::changeScene() { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -13404,12 +13404,12 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterIndex = R2_SEEKER; _exitUp.setDetails(Rect(128, 0, 186, 10), EXITCURSOR_N, 1945); - _exit2.setDetails(Rect(238, 144, 274, 167), EXITCURSOR_E, 1945); + _corridorExit.setDetails(Rect(238, 144, 274, 167), EXITCURSOR_E, 1945); _ladder.setDetails(Rect(141, 3, 167, 126), 1945, 9, -1, -1, 1, NULL); if (!R2_GLOBALS.getFlag(43)) { - _exit2._enabled = false; + _corridorExit._enabled = false; _gunpowder.postInit(); _gunpowder.setup(1945, 4, 1); _gunpowder.setPosition(Common::Point(253, 169)); @@ -13429,7 +13429,7 @@ void Scene1945::postInit(SceneObjectList *OwnerList) { _actor2.setup(1945, 3, 1); _actor2.hide(); } else { - _exit2._enabled = true; + _corridorExit._enabled = true; } switch (R2_GLOBALS._sceneManager._previousScene) { @@ -13525,10 +13525,10 @@ void Scene1945::signal() { return; case 1948: R2_GLOBALS._sound1.play(220); - _exit2._enabled = true; + _corridorExit._enabled = true; R2_GLOBALS._sceneItems.remove(&_gunpowder); R2_GLOBALS.clearFlag(42); - R2_GLOBALS.clearFlag(43); + R2_GLOBALS.setFlag(43); _nextSceneMode1 = 1940; // No break on purpose case 1949: diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 1dcc5ded56..a2d5d75dfd 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1078,7 +1078,7 @@ class Scene1945 : public SceneExt { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class CorridorExit : public SceneExit { public: virtual void changeScene(); }; @@ -1091,7 +1091,7 @@ public: SceneActor _actor2; Gunpowder _gunpowder; ExitUp _exitUp; - Exit2 _exit2; + CorridorExit _corridorExit; SequenceManager _sequenceManager1; SequenceManager _sequenceManager2; -- cgit v1.2.3 From 995d689ef355ce465f3647270a33ccf08802754e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 20 Sep 2013 08:27:54 -0400 Subject: TSAGE: Beginnings of fixes and renames for R2R Flub maze --- engines/tsage/globals.cpp | 8 +- engines/tsage/globals.h | 4 +- engines/tsage/ringworld2/ringworld2_scenes0.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 404 ++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes1.h | 46 +-- 5 files changed, 241 insertions(+), 223 deletions(-) (limited to 'engines') diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 7068c2fa1a..eaf978bd22 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -453,8 +453,8 @@ void Ringworld2Globals::reset() { _v566A6 = 3800; _landerSuitNumber = 2; - _v566A4 = 1; - _v566A5 = 0; + _flubMazeArea = 1; + _flubMazeEntryDirection = 0; _desertStepsRemaining = 5; _desertCorrectDirection = 0; _desertPreviousDirection = 0; @@ -553,8 +553,8 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsByte(_scannerFrequencies[i]); s.syncAsByte(_v565AE); - s.syncAsByte(_v566A4); - s.syncAsByte(_v566A5); + s.syncAsByte(_flubMazeArea); + s.syncAsByte(_flubMazeEntryDirection); s.syncAsByte(_desertStepsRemaining); s.syncAsByte(_desertCorrectDirection); s.syncAsByte(_desertPreviousDirection); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 0684076b1e..46beea9513 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -271,8 +271,8 @@ public: byte _v565AE; byte _spillLocation[14]; int _v56613[76]; - byte _v566A4; - byte _v566A5; + byte _flubMazeArea; + byte _flubMazeEntryDirection; int _v566A6; byte _landerSuitNumber; byte _desertStepsRemaining; diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 3e5b230a05..de6e0aaf38 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -5172,7 +5172,7 @@ void Scene500::PanelDialog::Button::doButtonPress() { case 2: if (++R2_GLOBALS._landerSuitNumber == 4) - R2_GLOBALS._v566A4 = 1; + R2_GLOBALS._flubMazeArea = 1; if (R2_GLOBALS.getFlag(35)) { scene->_sceneMode = 6; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 559e56f36e..fbc8834ceb 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -13571,7 +13571,7 @@ Scene1950::Scene1950() { _field414 = 0; _field416 = 0; _field418 = Common::Point(0, 0); - _field41C = 0; + _vampireIndex = 0; } void Scene1950::synchronize(Serializer &s) { @@ -13582,7 +13582,7 @@ void Scene1950::synchronize(Serializer &s) { s.syncAsSint16LE(_field416); s.syncAsSint16LE(_field418.x); s.syncAsSint16LE(_field418.y); - s.syncAsSint16LE(_field41C); + s.syncAsSint16LE(_vampireIndex); } Scene1950::Area1::Actor10::Actor10() { @@ -13659,7 +13659,7 @@ void Scene1950::Area1::remove() { R2_GLOBALS._sound2.play(278); R2_GLOBALS._player.disableControl(CURSOR_WALK); - scene->_exit3._enabled = true; + scene->_eastExit._enabled = true; if (!R2_GLOBALS.getFlag(37)) { if (R2_GLOBALS.getFlag(36)) { @@ -13715,7 +13715,7 @@ void Scene1950::Area1::proc12(int visage, int stripFrameNum, int frameNum, int p // _areaActor.fixPriority(248); - scene->_exit3._enabled = false; + scene->_eastExit._enabled = false; proc13(1950, 27, 28, 27); for (_fieldB65 = 0; _fieldB65 < 16; _fieldB65++) @@ -13783,7 +13783,7 @@ bool Scene1950::Actor5::startAction(CursorType action, Event &event) { return true; } -Scene1950::Actor8::Actor8() { +Scene1950::Vampire::Vampire() { _fieldA4 = 0; _fieldA6 = 0; _fieldA8 = 0; @@ -13793,7 +13793,7 @@ Scene1950::Actor8::Actor8() { _fieldAF = 0; } -void Scene1950::Actor8::synchronize(Serializer &s) { +void Scene1950::Vampire::synchronize(Serializer &s) { SceneActor::synchronize(s); s.syncAsSint16LE(_fieldA4); @@ -13805,14 +13805,14 @@ void Scene1950::Actor8::synchronize(Serializer &s) { s.syncAsByte(_fieldAF); } -void Scene1950::Actor8::signal() { +void Scene1950::Vampire::signal() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; switch (_fieldAC) { case 19: { _fieldAC = 0; setVisage(1960); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) setStrip(2); else setStrip(1); @@ -13824,14 +13824,14 @@ void Scene1950::Actor8::signal() { case 20: { _fieldAC = 19; R2_GLOBALS._player.setVisage(22); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) R2_GLOBALS._player.setStrip(1); else R2_GLOBALS._player.setStrip(2); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 1]--; + R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 1]--; - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) _fieldA4 = _position.x + 10; else _fieldA4 = _position.x - 10; @@ -13839,7 +13839,7 @@ void Scene1950::Actor8::signal() { _fieldA6 = _position.y -4; setVisage(1961); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) setStrip(2); else setStrip(1); @@ -13854,14 +13854,14 @@ void Scene1950::Actor8::signal() { break; case 21: R2_GLOBALS._player.setVisage(22); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) R2_GLOBALS._player.setStrip(1); else R2_GLOBALS._player.setStrip(2); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); setVisage(1961); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) setStrip(4); else setStrip(3); @@ -13871,10 +13871,10 @@ void Scene1950::Actor8::signal() { R2_GLOBALS._sound2.play(226); animate(ANIM_MODE_5, NULL); fixPriority(10); - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) ]--; - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 1]--; - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 2] = _position.x; - R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 3] = _position.y; + R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) ]--; + R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 1]--; + R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 2] = _position.x; + R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 3] = _position.y; _fieldA8 = (_position.x - R2_GLOBALS._player._position.x) / 2; _fieldAA = (_position.y - R2_GLOBALS._player._position.y) / 2; @@ -13898,10 +13898,10 @@ void Scene1950::Actor8::signal() { R2_GLOBALS._player.enableControl(CURSOR_WALK); } - if (R2_GLOBALS._v566A5 == 3) - scene->_exit3._enabled = true; + if (R2_GLOBALS._flubMazeEntryDirection == 3) + scene->_eastExit._enabled = true; else - scene->_exit6._enabled = true; + scene->_westExit._enabled = true; scene->_field416 = 0; break; @@ -13911,7 +13911,7 @@ void Scene1950::Actor8::signal() { break; case 23: SceneItem::display(1950, 25, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - scene->_sceneMode = R2_GLOBALS._v566A5; + scene->_sceneMode = R2_GLOBALS._flubMazeEntryDirection; scene->setAction(&scene->_sequenceManager, scene, 1960, &R2_GLOBALS._player, NULL); break; default: @@ -13919,21 +13919,22 @@ void Scene1950::Actor8::signal() { } } -bool Scene1950::Actor8::startAction(CursorType action, Event &event) { +bool Scene1950::Vampire::startAction(CursorType action, Event &event) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - if ((R2_GLOBALS._v56613[(scene->_field41C - 1) * 4] == 0) || (action != R2_PHOTON_STUNNER)) + if ((R2_GLOBALS._v56613[(scene->_vampireIndex - 1) * 4] == 0) || + (action != R2_PHOTON_STUNNER)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 1] <= 1) + if (R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 1] <= 1) _fieldAC = 21; else _fieldAC = 20; R2_GLOBALS._player.setVisage(25); - if (R2_GLOBALS._v566A5 == 3) + if (R2_GLOBALS._flubMazeEntryDirection == 3) R2_GLOBALS._player.setStrip(2); else R2_GLOBALS._player.setStrip(1); @@ -13943,12 +13944,12 @@ bool Scene1950::Actor8::startAction(CursorType action, Event &event) { return true; } -void Scene1950::Exit1::changeScene() { +void Scene1950::NorthExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); - R2_GLOBALS._v566A5 = 1; + R2_GLOBALS._flubMazeEntryDirection = 1; scene->_sceneMode = 11; Common::Point pt(160, 127); @@ -13956,12 +13957,12 @@ void Scene1950::Exit1::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } -void Scene1950::Exit2::changeScene() { +void Scene1950::UpExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); - R2_GLOBALS._v566A5 = 2; + R2_GLOBALS._flubMazeEntryDirection = 2; scene->_sceneMode = 12; if (scene->_field412 == 0) { @@ -13977,12 +13978,12 @@ void Scene1950::Exit2::changeScene() { } } -void Scene1950::Exit3::changeScene() { +void Scene1950::EastExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); - R2_GLOBALS._v566A5 = 3; + R2_GLOBALS._flubMazeEntryDirection = 3; scene->_sceneMode = 13; if (scene->_field416 != 0) @@ -13993,12 +13994,12 @@ void Scene1950::Exit3::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } -void Scene1950::Exit4::changeScene() { +void Scene1950::DownExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); - R2_GLOBALS._v566A5 = 4; + R2_GLOBALS._flubMazeEntryDirection = 4; scene->_sceneMode = 14; if (R2_GLOBALS.getFlag(36)) @@ -14007,12 +14008,12 @@ void Scene1950::Exit4::changeScene() { scene->setAction(&scene->_sequenceManager, scene, 1973, &R2_GLOBALS._player, NULL); } -void Scene1950::Exit5::changeScene() { +void Scene1950::SouthExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); - R2_GLOBALS._v566A5 = 5; + R2_GLOBALS._flubMazeEntryDirection = 5; scene->_sceneMode = 15; Common::Point pt(160, 213); @@ -14020,13 +14021,15 @@ void Scene1950::Exit5::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } -void Scene1950::Exit6::changeScene() { +void Scene1950::WestExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); - R2_GLOBALS._v566A5 = 5; - if (R2_GLOBALS._v566A4 == 2) { + R2_GLOBALS._flubMazeEntryDirection = 6; + + if (R2_GLOBALS._flubMazeArea == 2) { + // In the very first corridor area after the Scrith Door if ((R2_GLOBALS.getFlag(36)) && (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 2) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2)) { scene->_sceneMode = 1961; Common::Point pt(-20, 160); @@ -14058,7 +14061,7 @@ void Scene1950::Exit7::changeScene() { _enabled = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); - R2_GLOBALS._v566A5 = 0; + R2_GLOBALS._flubMazeEntryDirection = 0; scene->_sceneMode = 1951; scene->setAction(&scene->_sequenceManager, scene, 1951, &R2_GLOBALS._player, NULL); } @@ -14068,13 +14071,13 @@ void Scene1950::Exit8::changeScene() { _enabled = false; R2_GLOBALS._player.disableControl(CURSOR_WALK); - R2_GLOBALS._v566A5 = 3; + R2_GLOBALS._flubMazeEntryDirection = 3; if (R2_GLOBALS._player._visage == 22) { scene->_sceneMode = 1975; scene->setAction(&scene->_sequenceManager, scene, 1975, &R2_GLOBALS._player, NULL); } else { SceneItem::display(1950, 22, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - R2_GLOBALS._v566A5 = 0; + R2_GLOBALS._flubMazeEntryDirection = 0; scene->_sceneMode = 0; Common::Point pt(250, 150); NpcMover *mover = new NpcMover(); @@ -14083,34 +14086,34 @@ void Scene1950::Exit8::changeScene() { } } -void Scene1950::initExits() { - _exit1._enabled = false; - _exit2._enabled = false; - _exit3._enabled = false; - _exit4._enabled = false; - _exit5._enabled = false; - _exit6._enabled = false; +void Scene1950::initArea() { + _northExit._enabled = false; + _upExit._enabled = false; + _eastExit._enabled = false; + _downExit._enabled = false; + _southExit._enabled = false; + _westExit._enabled = false; _exit7._enabled = false; _exit8._enabled = false; - _exit1._insideArea = false; - _exit2._insideArea = false; - _exit3._insideArea = false; - _exit4._insideArea = false; - _exit5._insideArea = false; - _exit6._insideArea = false; + _northExit._insideArea = false; + _upExit._insideArea = false; + _eastExit._insideArea = false; + _downExit._insideArea = false; + _southExit._insideArea = false; + _westExit._insideArea = false; _exit7._insideArea = false; _exit8._insideArea = false; - _exit1._moving = false; - _exit2._moving = false; - _exit3._moving = false; - _exit4._moving = false; - _exit5._moving = false; - _exit6._moving = false; + _northExit._moving = false; + _upExit._moving = false; + _eastExit._moving = false; + _downExit._moving = false; + _southExit._moving = false; + _westExit._moving = false; _exit7._moving = false; _exit8._moving = false; _field412 = 0; - switch (R2_GLOBALS._v566A4 - 1) { + switch (R2_GLOBALS._flubMazeArea - 1) { case 0: loadScene(1948); break; @@ -14341,10 +14344,10 @@ void Scene1950::initExits() { break; } - if (R2_GLOBALS._v566A4 != 1) + if (R2_GLOBALS._flubMazeArea != 1) R2_GLOBALS._walkRegions.load(1950); - switch (R2_GLOBALS._v566A4 - 1) { + switch (R2_GLOBALS._flubMazeArea - 1) { case 0: _exit7._enabled = true; if ((R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) && (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 1950)) @@ -14418,8 +14421,8 @@ void Scene1950::initExits() { case 102: // No break on purpose case 103: - _exit3._enabled = true; - _exit6._enabled = true; + _eastExit._enabled = true; + _westExit._enabled = true; break; case 4: // No break on purpose @@ -14470,7 +14473,7 @@ void Scene1950::initExits() { case 100: // No break on purpose case 104: - _exit6._enabled = true; + _westExit._enabled = true; R2_GLOBALS._walkRegions.disableRegion(6); R2_GLOBALS._walkRegions.disableRegion(9); break; @@ -14521,7 +14524,7 @@ void Scene1950::initExits() { case 99: // No break on purpose case 101: - _exit3._enabled = true; + _eastExit._enabled = true; R2_GLOBALS._walkRegions.disableRegion(1); R2_GLOBALS._walkRegions.disableRegion(7); R2_GLOBALS._walkRegions.disableRegion(13); @@ -14535,11 +14538,11 @@ void Scene1950::initExits() { break; } - _object1.remove(); - _object1.removeObject(); - _actor1.remove(); + _northDoorway.remove(); + _northDoorway.removeObject(); + _southDoorway.remove(); - switch (R2_GLOBALS._v566A4 - 4) { + switch (R2_GLOBALS._flubMazeArea - 4) { case 0: // No break on purpose case 3: @@ -14577,15 +14580,15 @@ void Scene1950::initExits() { case 82: // No break on purpose case 90: - _exit1._enabled = true; - _object1.setup2(1950, (R2_GLOBALS._v566A4 % 2) + 1, 1, 160, 237, 25, 0); - - _actor1.postInit(); - _actor1.setVisage(1950); - _actor1.setStrip((((R2_GLOBALS._v566A4 - 1) / 35) % 2) + 1); - _actor1.setFrame(2); - _actor1.setPosition(Common::Point(160, 167)); - _actor1.fixPriority(220); + _northExit._enabled = true; + _northDoorway.setup(1950, (R2_GLOBALS._flubMazeArea % 2) + 1, 1, 160, 137, 25); + //visage,strip,frame,px,py,priority,effect + _southDoorway.postInit(); + _southDoorway.setVisage(1950); + _southDoorway.setStrip((((R2_GLOBALS._flubMazeArea - 1) / 35) % 2) + 1); + _southDoorway.setFrame(2); + _southDoorway.setPosition(Common::Point(160, 167)); + _southDoorway.fixPriority(220); R2_GLOBALS._walkRegions.disableRegion(3); R2_GLOBALS._walkRegions.disableRegion(4); break; @@ -14626,44 +14629,45 @@ void Scene1950::initExits() { case 89: // No break on purpose case 97: - _exit5._enabled = true; - _actor1.postInit(); - _actor1.setVisage(1950); - _actor1.setStrip((((R2_GLOBALS._v566A4 - 1) / 35) % 2) + 1); - _actor1.setFrame(3); - _actor1.setPosition(Common::Point(160, 167)); - _actor1.fixPriority(220); + _southExit._enabled = true; + + _southDoorway.postInit(); + _southDoorway.setVisage(1950); + _southDoorway.setStrip((((R2_GLOBALS._flubMazeArea - 1) / 35) % 2) + 1); + _southDoorway.setFrame(3); + _southDoorway.setPosition(Common::Point(160, 167)); + _southDoorway.fixPriority(220); break; case 58: // No break on purpose case 74: // No break on purpose case 80: - _exit1._enabled = true; - _exit5._enabled = true; + _northExit._enabled = true; + _southExit._enabled = true; - _object1.setup(1950, (R2_GLOBALS._v566A4 % 2) + 1, 1, 160, 137, 25); + _northDoorway.setup(1950, (R2_GLOBALS._flubMazeArea % 2) + 1, 1, 160, 137, 25); - _actor1.postInit(); - _actor1.setVisage(1950); - _actor1.setStrip((((R2_GLOBALS._v566A4 - 1) / 35) % 2) + 1); - _actor1.setFrame(3); - _actor1.setPosition(Common::Point(160, 167)); - _actor1.fixPriority(220); + _southDoorway.postInit(); + _southDoorway.setVisage(1950); + _southDoorway.setStrip((((R2_GLOBALS._flubMazeArea - 1) / 35) % 2) + 1); + _southDoorway.setFrame(3); + _southDoorway.setPosition(Common::Point(160, 167)); + _southDoorway.fixPriority(220); R2_GLOBALS._walkRegions.disableRegion(3); R2_GLOBALS._walkRegions.disableRegion(4); break; default: - _actor1.postInit(); - _actor1.setVisage(1950); - _actor1.setStrip(((R2_GLOBALS._v566A4 - 1) % 35) + 1); - _actor1.setFrame(2); - _actor1.setPosition(Common::Point(160, 167)); - _actor1.fixPriority(220); + _southDoorway.postInit(); + _southDoorway.setVisage(1950); + _southDoorway.setStrip(((R2_GLOBALS._flubMazeArea - 1) / 35) % 2 + 1); + _southDoorway.setFrame(2); + _southDoorway.setPosition(Common::Point(160, 167)); + _southDoorway.fixPriority(220); break; } - switch (R2_GLOBALS._v566A4 - 3) { + switch (R2_GLOBALS._flubMazeArea - 3) { case 0: // No break on purpose case 3: @@ -14707,7 +14711,8 @@ void Scene1950::initExits() { case 60: // No break on purpose case 63: - _exit2._enabled = true; + _upExit._enabled = true; + break; case 54: // No break on purpose case 61: @@ -14715,7 +14720,7 @@ void Scene1950::initExits() { case 62: // No break on purpose case 65: - _exit2._enabled = true; + _upExit._enabled = true; // No break on purpose case 35: // No break on purpose @@ -14760,7 +14765,7 @@ void Scene1950::initExits() { case 98: // No break on purpose case 100: - _exit4._enabled = true; + _downExit._enabled = true; R2_GLOBALS._walkRegions.disableRegion(4); R2_GLOBALS._walkRegions.disableRegion(5); R2_GLOBALS._walkRegions.disableRegion(6); @@ -14776,96 +14781,97 @@ void Scene1950::enterArea() { R2_GLOBALS._player.disableControl(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - _actor8.remove(); + _vampire.remove(); _door.remove(); _actor3.remove(); _field416 = 0; - _field41C = 0; + _vampireIndex = 0; - switch (R2_GLOBALS._v566A4) { + switch (R2_GLOBALS._flubMazeArea) { case 10: - _field41C = 1; + _vampireIndex = 1; break; case 13: - _field41C = 2; + _vampireIndex = 2; break; case 16: - _field41C = 3; + _vampireIndex = 3; break; case 17: - _field41C = 4; + _vampireIndex = 4; break; case 24: - _field41C = 5; + _vampireIndex = 5; break; case 25: - _field41C = 6; + _vampireIndex = 6; break; case 31: - _field41C = 7; + _vampireIndex = 7; break; case 40: - _field41C = 8; + _vampireIndex = 8; break; case 45: - _field41C = 9; + _vampireIndex = 9; break; case 46: - _field41C = 10; + _vampireIndex = 10; break; case 73: - _field41C = 11; + _vampireIndex = 11; break; case 75: - _field41C = 12; + _vampireIndex = 12; break; case 80: - _field41C = 13; + _vampireIndex = 13; break; case 87: - _field41C = 14; + _vampireIndex = 14; break; case 88: - _field41C = 15; + _vampireIndex = 15; break; case 96: - _field41C = 16; + _vampireIndex = 16; break; case 97: - _field41C = 17; + _vampireIndex = 17; break; case 104: - _field41C = 18; + _vampireIndex = 18; break; default: break; } - if (_field41C != 0) { - _actor8.postInit(); - _actor8._numFrames = 6; - _actor8._moveRate = 6; - _actor8._moveDiff = Common::Point(3, 2); - _actor8._effect = 1; - if (R2_GLOBALS._v56613[(_field41C - 1) * 4] == 0) { - _actor8.setPosition(Common::Point(R2_GLOBALS._v56613[((_field41C - 1) * 4) + 2], R2_GLOBALS._v56613[((_field41C - 1) * 4) + 3])); - _actor8.animate(ANIM_MODE_NONE, NULL); - _actor8.addMover(NULL); - _actor8.setVisage(1961); - _actor8.setStrip(4); - _actor8.setFrame(10); - _actor8.fixPriority(10); - _actor8.setDetails(1950, 15, -1, 17, 2, (SceneItem *) NULL); + if (_vampireIndex != 0) { + _vampire.postInit(); + _vampire._numFrames = 6; + _vampire._moveRate = 6; + _vampire._moveDiff = Common::Point(3, 2); + _vampire._effect = 1; + if (R2_GLOBALS._v56613[(_vampireIndex - 1) * 4] == 0) { + _vampire.setPosition(Common::Point(R2_GLOBALS._v56613[((_vampireIndex - 1) * 4) + 2], R2_GLOBALS._v56613[((_vampireIndex - 1) * 4) + 3])); + _vampire.animate(ANIM_MODE_NONE, NULL); + _vampire.addMover(NULL); + _vampire.setVisage(1961); + _vampire.setStrip(4); + _vampire.setFrame(10); + _vampire.fixPriority(10); + _vampire.setDetails(1950, 15, -1, 17, 2, (SceneItem *) NULL); } else { - _actor8.setVisage(1960); - _actor8.setPosition(Common::Point(160, 130)); - _actor8.animate(ANIM_MODE_2, NULL); - _actor8.setDetails(1950, 12, -1, 14, 2, (SceneItem *) NULL); + _vampire.setVisage(1960); + _vampire.setPosition(Common::Point(160, 130)); + _vampire.animate(ANIM_MODE_2, NULL); + _vampire.setDetails(1950, 12, -1, 14, 2, (SceneItem *) NULL); _field416 = 1; } } - if ((R2_GLOBALS._v566A4 == 1) && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) != 0)) { + if ((R2_GLOBALS._flubMazeArea == 1) && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) != 0)) { + // Show doorway at the right hand side of the very first flub corridor _door.postInit(); _door.setVisage(1948); _door.setStrip(3); @@ -14874,7 +14880,7 @@ void Scene1950::enterArea() { _door.setDetails(1950, 19, 20, 23, 2, (SceneItem *) NULL); } - if (R2_GLOBALS._v566A4 == 102) { + if (R2_GLOBALS._flubMazeArea == 102) { R2_GLOBALS._walkRegions.load(1951); R2_GLOBALS._walkRegions.disableRegion(1); R2_GLOBALS._walkRegions.disableRegion(5); @@ -14948,7 +14954,7 @@ void Scene1950::enterArea() { _item1.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 2, NULL); } - switch (R2_GLOBALS._v566A5) { + switch (R2_GLOBALS._flubMazeEntryDirection) { case 0: _sceneMode = 1950; if (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) { @@ -14959,7 +14965,7 @@ void Scene1950::enterArea() { } break; case 1: { - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; R2_GLOBALS._player.setPosition(Common::Point(160, 213)); Common::Point pt(160, 160); NpcMover *mover = new NpcMover(); @@ -14967,30 +14973,31 @@ void Scene1950::enterArea() { } break; case 2: - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; if (R2_GLOBALS.getFlag(36)) setAction(&_sequenceManager, this, 1957, &R2_GLOBALS._player, NULL); else setAction(&_sequenceManager, this, 1974, &R2_GLOBALS._player, NULL); break; case 3: + // Entering from the left if (_field416 == 0) { - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; R2_GLOBALS._player.setPosition(Common::Point(-20, 160)); Common::Point pt(30, 160); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } else { _sceneMode = 18; - _exit3._enabled = false; + _eastExit._enabled = false; _field418 = Common::Point(60, 152); R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; - _actor8.setStrip(2); + _vampire.setStrip(2); NpcMover *mover = new NpcMover(); - _actor8.addMover(mover, &_field418, this); + _vampire.addMover(mover, &_field418, this); R2_GLOBALS._player.setPosition(Common::Point(-20, 160)); Common::Point pt2(30, 160); @@ -14999,7 +15006,7 @@ void Scene1950::enterArea() { } break; case 4: - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; if (_field412 == 0) { if (R2_GLOBALS.getFlag(36)) setAction(&_sequenceManager, this, 1955, &R2_GLOBALS._player, NULL); @@ -15013,7 +15020,7 @@ void Scene1950::enterArea() { } break; case 5: { - _sceneMode = R2_GLOBALS._v566A5; + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; R2_GLOBALS._player.setPosition(Common::Point(160, 127)); Common::Point pt(160, 160); NpcMover *mover = new NpcMover(); @@ -15021,9 +15028,10 @@ void Scene1950::enterArea() { } break; case 6: + // Entering from the right if (_field416 == 0) { - _sceneMode = R2_GLOBALS._v566A5; - if (R2_GLOBALS._v566A4 == 1) { + _sceneMode = R2_GLOBALS._flubMazeEntryDirection; + if (R2_GLOBALS._flubMazeArea == 1) { setAction(&_sequenceManager, this, 1961, &R2_GLOBALS._player, NULL); } else { R2_GLOBALS._player.setPosition(Common::Point(340, 160)); @@ -15033,16 +15041,16 @@ void Scene1950::enterArea() { } } else { _sceneMode = 17; - _exit6._enabled = false; + _westExit._enabled = false; _field418 = Common::Point(259, 152); R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_USE); R2_GLOBALS._player._canWalk = false; - _actor8.setStrip(1); + _vampire.setStrip(1); NpcMover *mover = new NpcMover(); - _actor8.addMover(mover, &_field418, this); + _vampire.addMover(mover, &_field418, this); R2_GLOBALS._player.setPosition(Common::Point(340, 160)); Common::Point pt2(289, 160); @@ -15133,31 +15141,31 @@ void Scene1950::postInit(SceneObjectList *OwnerList) { _field412 = 0; _field414 = 0; _field416 = 0; - _field41C = 0; + _vampireIndex = 0; if (R2_GLOBALS._sceneManager._previousScene == 300) - R2_GLOBALS._v566A4 = 103; + R2_GLOBALS._flubMazeArea = 103; - initExits(); + initArea(); SceneExt::postInit(); R2_GLOBALS._sound1.play(105); - _exit1.setDetails(Rect(130, 46, 189, 135), SHADECURSOR_UP, 1950); - _exit1.setDest(Common::Point(160, 145)); + _northExit.setDetails(Rect(130, 46, 189, 135), SHADECURSOR_UP, 1950); + _northExit.setDest(Common::Point(160, 145)); - _exit2.setDetails(Rect(208, 0, 255, 73), EXITCURSOR_N, 1950); - _exit2.setDest(Common::Point(200, 151)); + _upExit.setDetails(Rect(208, 0, 255, 73), EXITCURSOR_N, 1950); + _upExit.setDest(Common::Point(200, 151)); - _exit3.setDetails(Rect(305, 95, 320, 147), EXITCURSOR_E, 1950); - _exit3.setDest(Common::Point(312, 160)); + _eastExit.setDetails(Rect(305, 95, 320, 147), EXITCURSOR_E, 1950); + _eastExit.setDest(Common::Point(312, 160)); - _exit4.setDetails(Rect(208, 99, 255, 143), EXITCURSOR_S, 1950); - _exit4.setDest(Common::Point(200, 151)); + _downExit.setDetails(Rect(208, 99, 255, 143), EXITCURSOR_S, 1950); + _downExit.setDest(Common::Point(200, 151)); - _exit5.setDetails(Rect(113, 154, 206, 168), SHADECURSOR_DOWN, 1950); - _exit5.setDest(Common::Point(160, 165)); + _southExit.setDetails(Rect(113, 154, 206, 168), SHADECURSOR_DOWN, 1950); + _southExit.setDest(Common::Point(160, 165)); - _exit6.setDetails(Rect(0, 95, 14, 147), EXITCURSOR_W, 1950); - _exit6.setDest(Common::Point(7, 160)); + _westExit.setDetails(Rect(0, 95, 14, 147), EXITCURSOR_W, 1950); + _westExit.setDest(Common::Point(7, 160)); _exit7.setDetails(Rect(72, 54, 120, 128), EXITCURSOR_NW, 1950); _exit7.setDest(Common::Point(120, 140)); @@ -15187,43 +15195,48 @@ void Scene1950::remove() { void Scene1950::signal() { switch (_sceneMode) { case 11: - R2_GLOBALS._v566A4 += 7; - initExits(); + R2_GLOBALS._flubMazeArea += 7; + initArea(); enterArea(); break; case 12: - R2_GLOBALS._v566A4 += 35; - initExits(); + // Moving up a ladder within the Flub maze + R2_GLOBALS._flubMazeArea += 35; + initArea(); enterArea(); break; case 1975: - SceneItem::display(1950, 21, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + SceneItem::display(1950, 21, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, + SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); // No break on purpose case 13: - ++R2_GLOBALS._v566A4; - initExits(); + // Moving east within the Flub maze + ++R2_GLOBALS._flubMazeArea; + initArea(); enterArea(); break; case 14: - R2_GLOBALS._v566A4 += 221; - initExits(); + // Moving down a ladder within the Flub maze + R2_GLOBALS._flubMazeArea -= 35; + initArea(); enterArea(); break; case 15: - R2_GLOBALS._v566A4 += 249; - initExits(); + R2_GLOBALS._flubMazeArea -= 7; + initArea(); enterArea(); break; case 16: + // Moving west within the Flub maze // No break on purpose case 1961: - --R2_GLOBALS._v566A4; - initExits(); + --R2_GLOBALS._flubMazeArea; + initArea(); enterArea(); break; case 17: { _sceneMode = 13; - R2_GLOBALS._v566A5 = 3; + R2_GLOBALS._flubMazeEntryDirection = 3; _field416 = 0; R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; @@ -15234,12 +15247,12 @@ void Scene1950::signal() { R2_GLOBALS._player.addMover(mover, &pt, this); Common::Point pt2(289, 160); NpcMover *mover2 = new NpcMover(); - _actor8.addMover(mover2, &pt2, NULL); + _vampire.addMover(mover2, &pt2, NULL); } break; case 18: { _sceneMode = 16; - R2_GLOBALS._v566A5 = 6; + R2_GLOBALS._flubMazeEntryDirection = 6; _field416 = 0; R2_GLOBALS._player.disableControl(CURSOR_WALK); R2_GLOBALS._player._canWalk = true; @@ -15250,7 +15263,7 @@ void Scene1950::signal() { R2_GLOBALS._player.addMover(mover, &pt, this); Common::Point pt2(30, 160); NpcMover *mover2 = new NpcMover(); - _actor8.addMover(mover2, &pt2, NULL); + _vampire.addMover(mover2, &pt2, NULL); } break; case 24: @@ -15344,6 +15357,7 @@ void Scene1950::process(Event &event) { _sceneMode = 1959; setAction(&_sequenceManager, this, 1959, &R2_GLOBALS._player, NULL); } + Scene::process(event); } diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index a2d5d75dfd..754994c76f 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1108,6 +1108,7 @@ public: }; class Scene1950 : public SceneExt { + /* Areas */ class Area1: public SceneArea { public: class Actor10 : public SceneActor { @@ -1144,6 +1145,7 @@ class Scene1950 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; + /* Actors */ class Door : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); @@ -1160,7 +1162,7 @@ class Scene1950 : public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor8 : public SceneActor { + class Vampire : public SceneActor { public: int _fieldA4; int _fieldA6; @@ -1170,34 +1172,35 @@ class Scene1950 : public SceneExt { byte _fieldAE; byte _fieldAF; - Actor8(); + Vampire(); void synchronize(Serializer &s); virtual void signal(); virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + /* Exits */ + class NorthExit : public SceneExit { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class UpExit : public SceneExit { public: virtual void changeScene(); }; - class Exit3 : public SceneExit { + class EastExit : public SceneExit { public: virtual void changeScene(); }; - class Exit4 : public SceneExit { + class DownExit : public SceneExit { public: virtual void changeScene(); }; - class Exit5 : public SceneExit { + class SouthExit : public SceneExit { public: virtual void changeScene(); }; - class Exit6 : public SceneExit { + class WestExit : public SceneExit { public: virtual void changeScene(); }; @@ -1209,25 +1212,29 @@ class Scene1950 : public SceneExt { public: virtual void changeScene(); }; +private: + void initArea(); + void enterArea(); + void subBF4B4(int indx); public: NamedHotspot _item1; Hotspot2 _item2; - SceneActor _actor1; - BackgroundSceneObject _object1; + SceneActor _southDoorway; + SceneObject _northDoorway; Door _door; Actor3 _actor3; SceneActor _actor4; Actor5 _actor5; SceneActor _actor6; SceneActor _actor7; - Actor8 _actor8; + Vampire _vampire; Area1 _area1; - Exit1 _exit1; - Exit2 _exit2; - Exit3 _exit3; - Exit4 _exit4; - Exit5 _exit5; - Exit6 _exit6; + NorthExit _northExit; + UpExit _upExit; + EastExit _eastExit; + DownExit _downExit; + SouthExit _southExit; + WestExit _westExit; Exit7 _exit7; Exit8 _exit8; SequenceManager _sequenceManager; @@ -1236,14 +1243,11 @@ public: int _field414; int _field416; Common::Point _field418; - int _field41C; + int _vampireIndex; Scene1950(); void synchronize(Serializer &s); - void initExits(); - void enterArea(); - void subBF4B4(int indx); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); virtual void signal(); -- cgit v1.2.3 From ff885af28ac9218dff5bd57b9167dfc51dbbe78d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 20 Sep 2013 21:59:19 +0300 Subject: FULLPIPE: Remove unused variables. CID 1063179 --- engines/fullpipe/utils.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index 64631f4215..3223b9c76c 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -98,9 +98,6 @@ class MemoryObject : CObject { int _mfield_C; int _mfield_10; char _mfield_14; - char _mfield_15; - char _mfield_16; - char _mfield_17; byte *_data; int _dataSize; int _mflags; -- cgit v1.2.3 From 24af4402611e8c932ec7aa60aa773108c8d5ba07 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 20 Sep 2013 22:00:57 +0300 Subject: FULLPIPE: Remove unused class variable. CID 1063185 --- engines/fullpipe/sound.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/sound.h b/engines/fullpipe/sound.h index 4014cdd94e..ea6987aae6 100644 --- a/engines/fullpipe/sound.h +++ b/engines/fullpipe/sound.h @@ -29,7 +29,6 @@ class Sound : public MemoryObject { int _id; char *_description; int16 _objectId; - int16 _field_32; int _directSoundBuffer; int _directSoundBuffers[7]; byte *_soundData; -- cgit v1.2.3 From a9a1e69f493556351c5862ef0f426867ddc258d4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 20 Sep 2013 22:03:36 +0300 Subject: FULLPIPE: Initisalize uninitialized variable. CID 1063191 --- engines/fullpipe/scene.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines') diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 8bae697492..cc93363786 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -72,6 +72,7 @@ SceneTag::SceneTag() { _field_4 = 0; _scene = 0; _tag = 0; + _sceneId = 0; } bool SceneTag::load(MfcArchive &file) { -- cgit v1.2.3 From 11d425b76c7d6cdae8b72a1c3c438cc74e9c37a0 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 20 Sep 2013 23:34:46 +0200 Subject: SCI: Move MIDI event processing out of parseNextEvent --- engines/sci/sound/midiparser_sci.cpp | 261 +++++++++++++++++------------------ engines/sci/sound/midiparser_sci.h | 6 +- 2 files changed, 130 insertions(+), 137 deletions(-) (limited to 'engines') diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 4b4333a37c..0af8e7aedd 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -53,11 +53,6 @@ MidiParser_SCI::MidiParser_SCI(SciVersion soundVersion, SciMusic *music) : _masterVolume = 15; _volume = 127; - _signalSet = false; - _signalToSet = 0; - _dataincAdd = false; - _dataincToAdd = 0; - _jumpToHoldTick = false; _resetOnPause = false; _pSnd = 0; } @@ -440,26 +435,6 @@ void MidiParser_SCI::sendToDriver(uint32 midi) { } void MidiParser_SCI::parseNextEvent(EventInfo &info) { - // Set signal AFTER waiting for delta, otherwise we would set signal too soon resulting in all sorts of bugs - if (_dataincAdd) { - _dataincAdd = false; - _pSnd->dataInc += _dataincToAdd; - _pSnd->signal = 0x7f + _pSnd->dataInc; - debugC(4, kDebugLevelSound, "datainc %04x", _dataincToAdd); - } - if (_signalSet) { - _signalSet = false; - _pSnd->setSignal(_signalToSet); - - debugC(4, kDebugLevelSound, "signal %04x", _signalToSet); - } - if (_jumpToHoldTick) { - _jumpToHoldTick = false; - _pSnd->inFastForward = true; - jumpToTick(_loopTick, false, false); - _pSnd->inFastForward = false; - } - info.start = _position._playPos; info.delta = 0; while (*_position._playPos == 0xF8) { @@ -481,6 +456,76 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) { case 0xC: info.basic.param1 = *(_position._playPos++); info.basic.param2 = 0; + break; + case 0xD: + info.basic.param1 = *(_position._playPos++); + info.basic.param2 = 0; + break; + + case 0xB: + info.basic.param1 = *(_position._playPos++); + info.basic.param2 = *(_position._playPos++); + info.length = 0; + break; + + case 0x8: + case 0x9: + case 0xA: + case 0xE: + info.basic.param1 = *(_position._playPos++); + info.basic.param2 = *(_position._playPos++); + if (info.command() == 0x9 && info.basic.param2 == 0) + info.event = info.channel() | 0x80; + info.length = 0; + break; + + case 0xF: // System Common, Meta or SysEx event + switch (info.event & 0x0F) { + case 0x2: // Song Position Pointer + info.basic.param1 = *(_position._playPos++); + info.basic.param2 = *(_position._playPos++); + break; + + case 0x3: // Song Select + info.basic.param1 = *(_position._playPos++); + info.basic.param2 = 0; + break; + + case 0x6: + case 0x8: + case 0xA: + case 0xB: + case 0xC: + case 0xE: + info.basic.param1 = info.basic.param2 = 0; + break; + + case 0x0: // SysEx + info.length = readVLQ(_position._playPos); + info.ext.data = _position._playPos; + _position._playPos += info.length; + break; + + case 0xF: // META event + info.ext.type = *(_position._playPos++); + info.length = readVLQ(_position._playPos); + info.ext.data = _position._playPos; + _position._playPos += info.length; + break; + default: + warning( + "MidiParser_SCI::parseNextEvent: Unsupported event code %x", + info.event); + } // // System Common, Meta or SysEx event + }// switch (info.command()) +} + +void MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) { + + // TODO: Properly handle fireEvents + + switch (info.command()) { + case 0xC: if (info.channel() == 0xF) {// SCI special case if (info.basic.param1 != kSetSignalLoop) { // At least in kq5/french&mac the first scene in the intro has @@ -497,27 +542,23 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) { // of the stream, but at a fixed location a few commands later. // That is probably why this signal isn't triggered // immediately there. - if (_soundVersion <= SCI_VERSION_0_LATE || - _position._playTick || info.delta) { + if (_soundVersion <= SCI_VERSION_0_LATE || _position._playTick) { if (!_pSnd->inFastForward) { - _signalSet = true; - _signalToSet = info.basic.param1; + _pSnd->setSignal(info.basic.param1); + debugC(4, kDebugLevelSound, "signal %04x", info.basic.param1); } } } else { - _loopTick = _position._playTick + info.delta; + _loopTick = _position._playTick; } + + // Done with this event. + return; } - break; - case 0xD: - info.basic.param1 = *(_position._playPos++); - info.basic.param2 = 0; - break; + // Break to let parent handle the rest. + break; case 0xB: - info.basic.param1 = *(_position._playPos++); - info.basic.param2 = *(_position._playPos++); - // Reference for some events: // http://wiki.scummvm.org/index.php/SCI/Specifications/Sound/SCI0_Resource_Format#Status_Reference // Handle common special events @@ -539,50 +580,51 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) { switch (info.basic.param1) { case kSetReverb: // Already handled above - break; + return; case kMidiHold: // Check if the hold ID marker is the same as the hold ID // marker set for that song by cmdSetSoundHold. // If it is, loop back, but don't stop notes when jumping. - // We need to wait for the delta of the current event before - // jumping, thus the jump will be performed on the next - // parseNextEvent() call, like with the signal set events. - // In LSL6, room 360, song 381, this ends up jumping forward - // one tick (the hold marker occurs at playtick 27, with - // _loopTick being 15 and the event itself having a delta of - // 13, total = 28) - bug #3614566. if (info.basic.param2 == _pSnd->hold) { - _jumpToHoldTick = true; + _pSnd->inFastForward = true; + jumpToTick(_loopTick, false, false); + _pSnd->inFastForward = false; + // Done with this event. + return; } - break; + return; case kUpdateCue: if (!_pSnd->inFastForward) { - _dataincAdd = true; + int inc; switch (_soundVersion) { case SCI_VERSION_0_EARLY: case SCI_VERSION_0_LATE: - _dataincToAdd = info.basic.param2; + inc = info.basic.param2; break; case SCI_VERSION_1_EARLY: case SCI_VERSION_1_LATE: case SCI_VERSION_2_1: - _dataincToAdd = 1; + inc = 1; break; default: error("unsupported _soundVersion"); } + _pSnd->dataInc += inc; + _pSnd->signal = 0x7f + inc; + debugC(4, kDebugLevelSound, "datainc %04x", inc); + } - break; + return; case kResetOnPause: _resetOnPause = info.basic.param2; - break; + return; // Unhandled SCI commands case 0x46: // LSL3 - binoculars case 0x61: // Iceman (AdLib?) case 0x73: // Hoyle case 0xD1: // KQ4, when riding the unicorn // Obscure SCI commands - ignored - break; + return; // Standard MIDI commands case 0x01: // mod wheel case 0x04: // foot controller @@ -597,96 +639,51 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) { case 0x4B: // voice mapping // TODO: is any support for this needed at the MIDI parser level? warning("Unhanded SCI MIDI command 0x%x - voice mapping (parameter %d)", info.basic.param1, info.basic.param2); - break; + return; default: warning("Unhandled SCI MIDI command 0x%x (parameter %d)", info.basic.param1, info.basic.param2); - break; + return; } + } - info.length = 0; - break; - case 0x8: - case 0x9: - case 0xA: - case 0xE: - info.basic.param1 = *(_position._playPos++); - info.basic.param2 = *(_position._playPos++); - if (info.command() == 0x9 && info.basic.param2 == 0) - info.event = info.channel() | 0x80; - info.length = 0; + // Break to let parent handle the rest. break; + case 0xF: // META event + if (info.ext.type == 0x2F) {// end of track reached + if (_pSnd->loop) + _pSnd->loop--; + // QFG3 abuses the hold flag. Its scripts call kDoSoundSetHold, + // but sometimes there's no hold marker in the associated songs + // (e.g. song 110, during the intro). The original interpreter + // treats this case as an infinite loop (bug #3311911). + if (_pSnd->loop || _pSnd->hold > 0) { + _pSnd->inFastForward = true; + jumpToTick(_loopTick); + _pSnd->inFastForward = false; + + // Done with this event. + return; - case 0xF: // System Common, Meta or SysEx event - switch (info.event & 0x0F) { - case 0x2: // Song Position Pointer - info.basic.param1 = *(_position._playPos++); - info.basic.param2 = *(_position._playPos++); - break; + } else { + _pSnd->status = kSoundStopped; + _pSnd->setSignal(SIGNAL_OFFSET); - case 0x3: // Song Select - info.basic.param1 = *(_position._playPos++); - info.basic.param2 = 0; - break; + debugC(4, kDebugLevelSound, "signal EOT"); + } + } - case 0x6: - case 0x8: - case 0xA: - case 0xB: - case 0xC: - case 0xE: - info.basic.param1 = info.basic.param2 = 0; - break; + // Break to let parent handle the rest. + break; - case 0x0: // SysEx - info.length = readVLQ(_position._playPos); - info.ext.data = _position._playPos; - _position._playPos += info.length; - break; + default: + // Break to let parent handle the rest. + break; + } - case 0xF: // META event - info.ext.type = *(_position._playPos++); - info.length = readVLQ(_position._playPos); - info.ext.data = _position._playPos; - _position._playPos += info.length; - if (info.ext.type == 0x2F) {// end of track reached - if (_pSnd->loop) - _pSnd->loop--; - // QFG3 abuses the hold flag. Its scripts call kDoSoundSetHold, - // but sometimes there's no hold marker in the associated songs - // (e.g. song 110, during the intro). The original interpreter - // treats this case as an infinite loop (bug #3311911). - if (_pSnd->loop || _pSnd->hold > 0) { - // TODO: this jump is also vulnerable to the same lockup as - // the MIDI hold one above. However, we can't perform the - // jump on the next tick like with the MIDI hold jump above, - // as there aren't any subsequent MIDI events after this one. - // This assert is here to detect cases where the song ends - // up jumping forward, like with bug #3614566 (see above). - // (Exception: delta == 0, in which case the loop points - // at the previous event, which is fine.) - assert(_loopTick + info.delta < _position._playTick || - ((_loopTick == _position._playTick && info.delta == 0))); - - uint32 extraDelta = info.delta; - _pSnd->inFastForward = true; - jumpToTick(_loopTick); - _pSnd->inFastForward = false; - _nextEvent.delta += extraDelta; - } else { - _pSnd->status = kSoundStopped; - _pSnd->setSignal(SIGNAL_OFFSET); - debugC(4, kDebugLevelSound, "signal EOT"); - } - } - break; - default: - warning( - "MidiParser_SCI::parseNextEvent: Unsupported event code %x", - info.event); - } // // System Common, Meta or SysEx event - }// switch (info.command()) + // Let parent handle the rest + MidiParser::processEvent(info, fireEvents); } byte MidiParser_SCI::getSongReverb() { diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h index 7bd68994c8..5784dca1ab 100644 --- a/engines/sci/sound/midiparser_sci.h +++ b/engines/sci/sound/midiparser_sci.h @@ -89,6 +89,7 @@ public: protected: void parseNextEvent(EventInfo &info); + void processEvent(const EventInfo &info, bool fireEvents = true); byte *midiMixChannels(); byte *midiFilterChannels(int channelMask); byte midiGetNextChannel(long ticker); @@ -106,11 +107,6 @@ protected: byte _masterVolume; // the overall master volume (same for all tracks) byte _volume; // the global volume of the current track - bool _signalSet; - int16 _signalToSet; - bool _dataincAdd; - int16 _dataincToAdd; - bool _jumpToHoldTick; bool _resetOnPause; bool _channelUsed[16]; -- cgit v1.2.3 From ba56896f349c06c8425b0f2ee7059b9281bdac0c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 20 Sep 2013 22:21:58 -0400 Subject: TSAGE: Cleanup of vampire statuses in R2R Flub maze --- engines/tsage/globals.cpp | 50 ++++++++++++---------- engines/tsage/globals.h | 8 +++- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 56 +++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes1.h | 5 +-- 4 files changed, 67 insertions(+), 52 deletions(-) (limited to 'engines') diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index eaf978bd22..6984b03ba5 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -427,29 +427,29 @@ void Ringworld2Globals::reset() { _spillLocation[12] = 27; _spillLocation[13] = 31; + // Initialise the vampire data within the Flub maze for (int i = 0; i < 18; i++) { - _v56613[(i * 4) ] = 1; - _v56613[(i * 4) + 2] = 0; - _v56613[(i * 4) + 3] = 0; + _vampireData[i]._isAlive = true; + _vampireData[i]._position = Common::Point(); } - _v56613[( 0 * 4) + 1] = 1; - _v56613[( 1 * 4) + 1] = 2; - _v56613[( 2 * 4) + 1] = 2; - _v56613[( 3 * 4) + 1] = 3; - _v56613[( 4 * 4) + 1] = 2; - _v56613[( 5 * 4) + 1] = 2; - _v56613[( 6 * 4) + 1] = 3; - _v56613[( 7 * 4) + 1] = 1; - _v56613[( 8 * 4) + 1] = 1; - _v56613[( 9 * 4) + 1] = 3; - _v56613[(10 * 4) + 1] = 3; - _v56613[(11 * 4) + 1] = 1; - _v56613[(12 * 4) + 1] = 2; - _v56613[(13 * 4) + 1] = 3; - _v56613[(14 * 4) + 1] = 2; - _v56613[(15 * 4) + 1] = 3; - _v56613[(16 * 4) + 1] = 1; - _v56613[(17 * 4) + 1] = 1; + _vampireData[0].var2 = 1; + _vampireData[1].var2 = 2; + _vampireData[2].var2 = 2; + _vampireData[3].var2 = 3; + _vampireData[4].var2 = 2; + _vampireData[5].var2 = 2; + _vampireData[6].var2 = 3; + _vampireData[7].var2 = 1; + _vampireData[8].var2 = 1; + _vampireData[9].var2 = 3; + _vampireData[10].var2 = 3; + _vampireData[11].var2 = 1; + _vampireData[12].var2 = 2; + _vampireData[13].var2 = 3; + _vampireData[14].var2 = 2; + _vampireData[15].var2 = 3; + _vampireData[16].var2 = 1; + _vampireData[17].var2 = 1; _v566A6 = 3800; _landerSuitNumber = 2; @@ -580,6 +580,14 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_balloonPosition.x); s.syncAsSint16LE(_balloonPosition.y); + + // Synchronise Flub maze vampire data + for (i = 0; i < 18; ++i) { + s.syncAsSint16LE(_vampireData[i]._isAlive); + s.syncAsSint16LE(_vampireData[i].var2); + s.syncAsSint16LE(_vampireData[i]._position.x); + s.syncAsSint16LE(_vampireData[i]._position.y); + } } } // end of namespace Ringworld2 diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 46beea9513..99634ed175 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -244,6 +244,12 @@ namespace Ringworld2 { class ScannerDialog; +struct VampireData { + bool _isAlive; + int var2; + Common::Point _position; +}; + class Ringworld2Globals: public TsAGE2Globals { public: ASoundExt _sound1, _sound2, _sound3, _sound4; @@ -270,7 +276,7 @@ public: int _v5657C; byte _v565AE; byte _spillLocation[14]; - int _v56613[76]; + VampireData _vampireData[18]; byte _flubMazeArea; byte _flubMazeEntryDirection; int _v566A6; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index fbc8834ceb..8533360063 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -13784,11 +13784,9 @@ bool Scene1950::Actor5::startAction(CursorType action, Event &event) { } Scene1950::Vampire::Vampire() { - _fieldA4 = 0; - _fieldA6 = 0; _fieldA8 = 0; _fieldAA = 0; - _fieldAC = 0; + _vampireMode = 0; _fieldAE = 0; _fieldAF = 0; } @@ -13796,11 +13794,11 @@ Scene1950::Vampire::Vampire() { void Scene1950::Vampire::synchronize(Serializer &s) { SceneActor::synchronize(s); - s.syncAsSint16LE(_fieldA4); - s.syncAsSint16LE(_fieldA6); + s.syncAsSint16LE(_deadPosition.x); + s.syncAsSint16LE(_deadPosition.y); s.syncAsSint16LE(_fieldA8); s.syncAsSint16LE(_fieldAA); - s.syncAsSint16LE(_fieldAC); + s.syncAsSint16LE(_vampireMode); s.syncAsByte(_fieldAE); s.syncAsByte(_fieldAF); } @@ -13808,9 +13806,9 @@ void Scene1950::Vampire::synchronize(Serializer &s) { void Scene1950::Vampire::signal() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - switch (_fieldAC) { + switch (_vampireMode) { case 19: { - _fieldAC = 0; + _vampireMode = 0; setVisage(1960); if (R2_GLOBALS._flubMazeEntryDirection == 3) setStrip(2); @@ -13822,21 +13820,21 @@ void Scene1950::Vampire::signal() { } break; case 20: { - _fieldAC = 19; + _vampireMode = 19; R2_GLOBALS._player.setVisage(22); if (R2_GLOBALS._flubMazeEntryDirection == 3) R2_GLOBALS._player.setStrip(1); else R2_GLOBALS._player.setStrip(2); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 1]--; + R2_GLOBALS._vampireData[scene->_vampireIndex - 1].var2--; if (R2_GLOBALS._flubMazeEntryDirection == 3) - _fieldA4 = _position.x + 10; + _deadPosition.x = _position.x + 10; else - _fieldA4 = _position.x - 10; + _deadPosition.x = _position.x - 10; + _deadPosition.y = _position.y - 4; - _fieldA6 = _position.y -4; setVisage(1961); if (R2_GLOBALS._flubMazeEntryDirection == 3) @@ -13845,7 +13843,7 @@ void Scene1950::Vampire::signal() { setStrip(1); animate(ANIM_MODE_2, NULL); - Common::Point pt(_fieldA4, _fieldA6); + Common::Point pt = _deadPosition; PlayerMover *mover = new PlayerMover(); addMover(mover, &pt, this); @@ -13871,26 +13869,26 @@ void Scene1950::Vampire::signal() { R2_GLOBALS._sound2.play(226); animate(ANIM_MODE_5, NULL); fixPriority(10); - R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) ]--; - R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 1]--; - R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 2] = _position.x; - R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 3] = _position.y; + + R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive = false; + R2_GLOBALS._vampireData[scene->_vampireIndex - 1].var2--; + R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._position = _position; _fieldA8 = (_position.x - R2_GLOBALS._player._position.x) / 2; _fieldAA = (_position.y - R2_GLOBALS._player._position.y) / 2; _fieldAE = 0; for (_fieldAF = 0; _fieldAF < 18; ++_fieldAF) - if (R2_GLOBALS._v56613[4 * _fieldAF] == 0) + if (!R2_GLOBALS._vampireData[_fieldAF]._isAlive) ++_fieldAE; if (_fieldAE == 18) { R2_GLOBALS.setFlag(36); - _fieldAC = 23; + _vampireMode = 23; Common::Point pt(R2_GLOBALS._player._position.x + _fieldA8, R2_GLOBALS._player._position.y + _fieldAA); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } else if (_fieldAE == 1) { - _fieldAC = 22; + _vampireMode = 22; Common::Point pt(R2_GLOBALS._player._position.x + _fieldA8, R2_GLOBALS._player._position.y + _fieldAA); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); @@ -13922,16 +13920,16 @@ void Scene1950::Vampire::signal() { bool Scene1950::Vampire::startAction(CursorType action, Event &event) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - if ((R2_GLOBALS._v56613[(scene->_vampireIndex - 1) * 4] == 0) || + if (!R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive || (action != R2_PHOTON_STUNNER)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._v56613[((scene->_vampireIndex - 1) * 4) + 1] <= 1) - _fieldAC = 21; + if (R2_GLOBALS._vampireData[scene->_vampireIndex - 1].var2 <= 1) + _vampireMode = 21; else - _fieldAC = 20; + _vampireMode = 20; R2_GLOBALS._player.setVisage(25); if (R2_GLOBALS._flubMazeEntryDirection == 3) @@ -14788,6 +14786,7 @@ void Scene1950::enterArea() { _field416 = 0; _vampireIndex = 0; + // Certain areas have a vampire in them switch (R2_GLOBALS._flubMazeArea) { case 10: _vampireIndex = 1; @@ -14853,8 +14852,10 @@ void Scene1950::enterArea() { _vampire._moveRate = 6; _vampire._moveDiff = Common::Point(3, 2); _vampire._effect = 1; - if (R2_GLOBALS._v56613[(_vampireIndex - 1) * 4] == 0) { - _vampire.setPosition(Common::Point(R2_GLOBALS._v56613[((_vampireIndex - 1) * 4) + 2], R2_GLOBALS._v56613[((_vampireIndex - 1) * 4) + 3])); + + if (!R2_GLOBALS._vampireData[_vampireIndex - 1]._isAlive) { + // Show vampire ashes + _vampire.setPosition(Common::Point(R2_GLOBALS._vampireData[_vampireIndex - 1]._position)); _vampire.animate(ANIM_MODE_NONE, NULL); _vampire.addMover(NULL); _vampire.setVisage(1961); @@ -14863,6 +14864,7 @@ void Scene1950::enterArea() { _vampire.fixPriority(10); _vampire.setDetails(1950, 15, -1, 17, 2, (SceneItem *) NULL); } else { + // Start the vampire _vampire.setVisage(1960); _vampire.setPosition(Common::Point(160, 130)); _vampire.animate(ANIM_MODE_2, NULL); diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 754994c76f..58b1730941 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1164,11 +1164,10 @@ class Scene1950 : public SceneExt { }; class Vampire : public SceneActor { public: - int _fieldA4; - int _fieldA6; + Common::Point _deadPosition; int _fieldA8; int _fieldAA; - int _fieldAC; + int _vampireMode; byte _fieldAE; byte _fieldAF; -- cgit v1.2.3 From 3792af8e955bea5a07359c808361a16b15481327 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 21 Sep 2013 09:30:42 +0200 Subject: AUDIO: Simplify SCI inFastForward flag by moving it to MidiParser --- engines/sci/sound/midiparser_sci.cpp | 8 ++------ engines/sci/sound/music.cpp | 5 ----- engines/sci/sound/music.h | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) (limited to 'engines') diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 0af8e7aedd..40ae91d83d 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -543,7 +543,7 @@ void MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) { // That is probably why this signal isn't triggered // immediately there. if (_soundVersion <= SCI_VERSION_0_LATE || _position._playTick) { - if (!_pSnd->inFastForward) { + if (!_jumpingToTick) { _pSnd->setSignal(info.basic.param1); debugC(4, kDebugLevelSound, "signal %04x", info.basic.param1); } @@ -586,15 +586,13 @@ void MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) { // marker set for that song by cmdSetSoundHold. // If it is, loop back, but don't stop notes when jumping. if (info.basic.param2 == _pSnd->hold) { - _pSnd->inFastForward = true; jumpToTick(_loopTick, false, false); - _pSnd->inFastForward = false; // Done with this event. return; } return; case kUpdateCue: - if (!_pSnd->inFastForward) { + if (!_jumpingToTick) { int inc; switch (_soundVersion) { case SCI_VERSION_0_EARLY: @@ -658,9 +656,7 @@ void MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) { // (e.g. song 110, during the intro). The original interpreter // treats this case as an infinite loop (bug #3311911). if (_pSnd->loop || _pSnd->hold > 0) { - _pSnd->inFastForward = true; jumpToTick(_loopTick); - _pSnd->inFastForward = false; // Done with this event. return; diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 1628a22386..8c6d0d6431 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -521,11 +521,7 @@ void SciMusic::soundPlay(MusicEntry *pSnd) { pSnd->pMidiParser->jumpToTick(0); else { // Fast forward to the last position and perform associated events when loading - pSnd->inFastForward = true; - // we set this flag, so that the midiparser doesn't set any signals for scripts - // if we don't do this, at least accessing the debugger will reset previously set signals pSnd->pMidiParser->jumpToTick(pSnd->ticker, true, true, true); - pSnd->inFastForward = false; } // Restore looping and hold @@ -765,7 +761,6 @@ MusicEntry::MusicEntry() { resourceId = 0; isQueued = false; - inFastForward = false; dataInc = 0; ticker = 0; diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h index 5924a0fd12..1f798c90d7 100644 --- a/engines/sci/sound/music.h +++ b/engines/sci/sound/music.h @@ -65,7 +65,6 @@ public: uint16 resourceId; bool isQueued; // for SCI0 only! - bool inFastForward; // if we are currently fast-forwarding (disables any signals to scripts) uint16 dataInc; uint16 ticker; -- cgit v1.2.3 From f5b2d86d13ca01640d34807808bfed616fbe5727 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 21 Sep 2013 14:27:18 +0300 Subject: NEVERHOOD: Split the sprites in module 2800 into a separate file --- engines/neverhood/module.mk | 1 + engines/neverhood/modules/module2400.h | 1 + engines/neverhood/modules/module2800.cpp | 962 +------------------- engines/neverhood/modules/module2800.h | 236 +---- engines/neverhood/modules/module2800_sprites.cpp | 1020 ++++++++++++++++++++++ engines/neverhood/modules/module2800_sprites.h | 268 ++++++ 6 files changed, 1296 insertions(+), 1192 deletions(-) create mode 100644 engines/neverhood/modules/module2800_sprites.cpp create mode 100644 engines/neverhood/modules/module2800_sprites.h (limited to 'engines') diff --git a/engines/neverhood/module.mk b/engines/neverhood/module.mk index 030c78a407..052c830182 100644 --- a/engines/neverhood/module.mk +++ b/engines/neverhood/module.mk @@ -33,6 +33,7 @@ MODULE_OBJS = \ modules/module2600.o \ modules/module2700.o \ modules/module2800.o \ + modules/module2800_sprites.o \ modules/module2900.o \ modules/module3000.o \ mouse.o \ diff --git a/engines/neverhood/modules/module2400.h b/engines/neverhood/modules/module2400.h index b50fff91c4..3802c747f1 100644 --- a/engines/neverhood/modules/module2400.h +++ b/engines/neverhood/modules/module2400.h @@ -33,6 +33,7 @@ #include "neverhood/modules/module2100.h" #include "neverhood/modules/module2200.h" #include "neverhood/modules/module2800.h" +#include "neverhood/modules/module2800_sprites.h" #include "neverhood/diskplayerscene.h" namespace Neverhood { diff --git a/engines/neverhood/modules/module2800.cpp b/engines/neverhood/modules/module2800.cpp index 7980c6b308..3a33598090 100644 --- a/engines/neverhood/modules/module2800.cpp +++ b/engines/neverhood/modules/module2800.cpp @@ -26,6 +26,7 @@ #include "neverhood/modules/module1200.h" #include "neverhood/modules/module1700.h" #include "neverhood/modules/module2200.h" +#include "neverhood/modules/module2800_sprites.h" #include "neverhood/diskplayerscene.h" namespace Neverhood { @@ -643,154 +644,6 @@ void Scene2802::changeTuneStatus(int prevTuneStatus, int newTuneStatus) { } -AsScene2803LightCord::AsScene2803LightCord(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int16 x, int16 y) - : AnimatedSprite(vm, 1100), _parentScene(parentScene), _fileHash1(fileHash1), _fileHash2(fileHash2), - _isPulled(false), _isBusy(false) { - - createSurface(1010, 28, 379); - SetUpdateHandler(&AnimatedSprite::update); - SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); - _x = x; - _y = y; - stIdle(); -} - -uint32 AsScene2803LightCord::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x100D: - if (!_isBusy && param.asInteger() == calcHash("ClickSwitch")) { - sendMessage(_parentScene, 0x480F, 0); - playSound(0, 0x4E1CA4A0); - } - break; - case 0x480F: - stPulled(); - break; - case 0x482A: - sendMessage(_parentScene, 0x1022, 990); - break; - case 0x482B: - sendMessage(_parentScene, 0x1022, 1010); - break; - } - return messageResult; -} - -uint32 AsScene2803LightCord::hmPulled(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x3002: - gotoNextState(); - break; - } - return messageResult; -} - -void AsScene2803LightCord::stPulled() { - _isBusy = false; - _isPulled = true; - startAnimation(_fileHash2, 0, -1); - SetMessageHandler(&AsScene2803LightCord::hmPulled); - NextState(&AsScene2803LightCord::stIdle); -} - -void AsScene2803LightCord::stIdle() { - _isPulled = false; - startAnimation(_fileHash1, 0, -1); - SetMessageHandler(&AsScene2803LightCord::handleMessage); -} - -void AsScene2803LightCord::setFileHashes(uint32 fileHash1, uint32 fileHash2) { - _fileHash1 = fileHash1; - _fileHash2 = fileHash2; - if (_isPulled) { - startAnimation(_fileHash2, _currFrameIndex, -1); - _isBusy = true; - } else { - startAnimation(_fileHash1, 0, -1); - } -} - -AsScene2803TestTubeOne::AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2) - : AnimatedSprite(vm, 1200), _fileHash1(fileHash1), _fileHash2(fileHash2) { - - createSurface1(fileHash1, 100); - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2803TestTubeOne::handleMessage); - _x = 529; - _y = 326; -} - -uint32 AsScene2803TestTubeOne::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2000: - if (param.asInteger()) - startAnimation(_fileHash2, 0, -1); - else - startAnimation(_fileHash1, 0, -1); - break; - } - return messageResult; -} - -AsScene2803Rope::AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x) - : AnimatedSprite(vm, 1100), _parentScene(parentScene) { - - createSurface(990, 68, 476); - SetUpdateHandler(&AnimatedSprite::update); - SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); - SetMessageHandler(&AsScene2803Rope::handleMessage); - startAnimation(0x9D098C23, 35, 53); - NextState(&AsScene2803Rope::stReleased); - _x = x; - _y = -276; -} - -uint32 AsScene2803Rope::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x3002: - startAnimation(0x9D098C23, 50, -1); - SetMessageHandler(&AsScene2803Rope::hmReleased); - break; - case 0x482A: - sendMessage(_parentScene, 0x1022, 990); - break; - case 0x482B: - sendMessage(_parentScene, 0x1022, 1010); - break; - } - return messageResult; -} - -uint32 AsScene2803Rope::hmReleased(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x3002: - gotoNextState(); - break; - case 0x482A: - sendMessage(_parentScene, 0x1022, 990); - break; - case 0x482B: - sendMessage(_parentScene, 0x1022, 1010); - break; - } - return messageResult; -} - -void AsScene2803Rope::stReleased() { - startAnimation(0x8258A030, 0, 1); - NextState(&AsScene2803Rope::stHide); -} - -void AsScene2803Rope::stHide() { - stopAnimation(); - setVisible(false); -} - Scene2803::Scene2803(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule), _paletteArea(0) { @@ -1306,379 +1159,6 @@ void Scene2803Small::updatePaletteArea(bool instantly) { _palette->startFadeToPalette(instantly ? 0 : 12); } -SsScene2804RedButton::SsScene2804RedButton(NeverhoodEngine *vm, Scene2804 *parentScene) - : StaticSprite(vm, 900), _countdown(0), _parentScene(parentScene) { - - loadSprite(getGlobalVar(V_SHRINK_LIGHTS_ON) ? 0x51A10202 : 0x11814A21, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400); - setVisible(false); - SetUpdateHandler(&SsScene2804RedButton::update); - SetMessageHandler(&SsScene2804RedButton::handleMessage); - loadSound(0, 0x44241240); -} - -void SsScene2804RedButton::update() { - updatePosition(); - if (_countdown != 0 && (--_countdown) == 0) { - setVisible(false); - } -} - -uint32 SsScene2804RedButton::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x1011: - if (_countdown == 0 && !_parentScene->isWorking()) { - playSound(0); - setVisible(true); - _countdown = 4; - sendMessage(_parentScene, 0x2000, 0); - } - messageResult = 1; - break; - } - return messageResult; -} - -SsScene2804LightCoil::SsScene2804LightCoil(NeverhoodEngine *vm) - : StaticSprite(vm, 900) { - - loadSprite(0x8889B008, kSLFDefDrawOffset | kSLFDefPosition, 400); - setVisible(false); - SetMessageHandler(&SsScene2804LightCoil::handleMessage); -} - -uint32 SsScene2804LightCoil::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2002: - setVisible(true); - updatePosition(); - messageResult = 1; - break; - case 0x2003: - setVisible(false); - updatePosition(); - messageResult = 1; - break; - } - return messageResult; -} - -SsScene2804LightTarget::SsScene2804LightTarget(NeverhoodEngine *vm) - : StaticSprite(vm, 900) { - - loadSprite(0x06092132, kSLFDefDrawOffset | kSLFDefPosition, 400); - setVisible(false); - SetMessageHandler(&SsScene2804LightTarget::handleMessage); -} - -uint32 SsScene2804LightTarget::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2004: - setVisible(true); - updatePosition(); - messageResult = 1; - break; - case 0x2005: - setVisible(false); - updatePosition(); - messageResult = 1; - break; - } - return messageResult; -} - -SsScene2804Flash::SsScene2804Flash(NeverhoodEngine *vm) - : StaticSprite(vm, 900) { - - loadSprite(0x211003A0, kSLFDefDrawOffset | kSLFDefPosition, 400); - setVisible(false); - loadSound(0, 0xCB36BA54); -} - -void SsScene2804Flash::show() { - setVisible(true); - updatePosition(); - playSound(0); -} - -SsScene2804BeamCoilBody::SsScene2804BeamCoilBody(NeverhoodEngine *vm) - : StaticSprite(vm, 900) { - - loadSprite(0x9A816000, kSLFDefDrawOffset | kSLFDefPosition, 400); - setVisible(false); -} - -AsScene2804CrystalWaves::AsScene2804CrystalWaves(NeverhoodEngine *vm, uint crystalIndex) - : AnimatedSprite(vm, 1100), _crystalIndex(crystalIndex) { - - static const NPoint kAsScene2804CrystalWavesPoints[] = { - {323, 245}, - {387, 76}, - {454, 260}, - {527, 70} - }; - - _x = kAsScene2804CrystalWavesPoints[crystalIndex].x; - _y = kAsScene2804CrystalWavesPoints[crystalIndex].y; - createSurface1(0x840C41F0, 1200); - if (crystalIndex & 1) - setDoDeltaY(1); - setVisible(false); - _needRefresh = true; - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&Sprite::handleMessage); -} - -void AsScene2804CrystalWaves::show() { - setVisible(true); - startAnimation(0x840C41F0, 0, -1); -} - -void AsScene2804CrystalWaves::hide() { - setVisible(false); - stopAnimation(); -} - -static const int16 kAsScene2804CrystalFrameNums[] = { - 0, 6, 2, 8, 1, 10, 0, 0 -}; - -static const uint32 kAsScene2804CrystalFileHashes[] = { - 0x000540B0, - 0x001280D0, - 0x003D0010, - 0x00620190, - 0x00DC0290 -}; - -AsScene2804Crystal::AsScene2804Crystal(NeverhoodEngine *vm, AsScene2804CrystalWaves *asCrystalWaves, uint crystalIndex) - : AnimatedSprite(vm, 1100), _asCrystalWaves(asCrystalWaves), _crystalIndex(crystalIndex), _isShowing(false) { - - static const NPoint kAsScene2804CrystalPoints[] = { - {204, 196}, - {272, 316}, - {334, 206}, - {410, 334}, - {470, 180} - }; - - _colorNum = (int16)getSubVar(VA_CURR_CRYSTAL_COLORS, crystalIndex); - _isLightOn = getGlobalVar(V_SHRINK_LIGHTS_ON) != 0; - if (_isLightOn) { - _x = kAsScene2804CrystalPoints[crystalIndex].x; - _y = kAsScene2804CrystalPoints[crystalIndex].y; - createSurface1(0x108DFB12, 1200); - startAnimation(0x108DFB12, kAsScene2804CrystalFrameNums[_colorNum], -1); - _needRefresh = true; - _newStickFrameIndex = kAsScene2804CrystalFrameNums[_colorNum]; - } else { - _x = 320; - _y = 240; - createSurface1(kAsScene2804CrystalFileHashes[crystalIndex], 1200); - startAnimation(kAsScene2804CrystalFileHashes[crystalIndex], _colorNum, -1); - setVisible(false); - _needRefresh = true; - _newStickFrameIndex = _colorNum; - } - loadSound(0, 0x725294D4); - SetUpdateHandler(&AnimatedSprite::update); -} - -void AsScene2804Crystal::show() { - if (!_isLightOn) { - setVisible(true); - _isShowing = true; - if (_asCrystalWaves) - _asCrystalWaves->show(); - playSound(0); - } -} - -void AsScene2804Crystal::hide() { - if (!_isLightOn) { - setVisible(false); - _isShowing = false; - if (_asCrystalWaves) - _asCrystalWaves->hide(); - } -} - -void AsScene2804Crystal::activate() { - if (!_isShowing) { - int16 frameNum = kAsScene2804CrystalFrameNums[_colorNum]; - _colorNum++; - if (_colorNum >= 6) - _colorNum = 0; - if (_isLightOn) { - startAnimation(0x108DFB12, frameNum, kAsScene2804CrystalFrameNums[_colorNum]); - _playBackwards = kAsScene2804CrystalFrameNums[_colorNum] < _colorNum; - _newStickFrameIndex = kAsScene2804CrystalFrameNums[_colorNum]; - } else { - startAnimation(kAsScene2804CrystalFileHashes[_crystalIndex], _colorNum, -1); - _newStickFrameIndex = _colorNum; - } - setSubVar(VA_CURR_CRYSTAL_COLORS, _crystalIndex, _colorNum); - } -} - -SsScene2804CrystalButton::SsScene2804CrystalButton(NeverhoodEngine *vm, Scene2804 *parentScene, AsScene2804Crystal *asCrystal, uint crystalIndex) - : StaticSprite(vm, 900), _countdown(0), _parentScene(parentScene), _asCrystal(asCrystal), _crystalIndex(crystalIndex) { - - static const uint32 kSsScene2804CrystalButtonFileHashes1[] = { - 0x911101B0, - 0x22226001, - 0x4444A362, - 0x888925A4, - 0x11122829 - }; - - static const uint32 kSsScene2804CrystalButtonFileHashes2[] = { - 0xB500A1A0, - 0x6A012021, - 0xD4022322, - 0xA8042525, - 0x5008292B - }; - - loadSprite(getGlobalVar(V_SHRINK_LIGHTS_ON) ? kSsScene2804CrystalButtonFileHashes1[crystalIndex] : kSsScene2804CrystalButtonFileHashes2[crystalIndex], - kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400); - setVisible(false); - loadSound(0, 0x44045140); - SetUpdateHandler(&SsScene2804CrystalButton::update); - SetMessageHandler(&SsScene2804CrystalButton::handleMessage); -} - -void SsScene2804CrystalButton::update() { - updatePosition(); - if (_countdown != 0 && (--_countdown) == 0) { - setVisible(false); - } -} - -uint32 SsScene2804CrystalButton::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x1011: - if (_countdown == 0 && !_parentScene->isWorking()) { - playSound(0); - setVisible(true); - _countdown = 4; - _asCrystal->activate(); - } - messageResult = 1; - break; - } - return messageResult; -} - -AsScene2804BeamCoil::AsScene2804BeamCoil(NeverhoodEngine *vm, Scene *parentScene, SsScene2804BeamCoilBody *ssBeamCoilBody) - : AnimatedSprite(vm, 1400), _parentScene(parentScene), _ssBeamCoilBody(ssBeamCoilBody), _countdown(0) { - - createSurface1(0x00494891, 1000); - _x = 125; - _y = 184; - setVisible(false); - _needRefresh = true; - AnimatedSprite::updatePosition(); - loadSound(0, 0x6352F051); - _vm->_soundMan->addSound(0xC5EA0B28, 0xEF56B094); - SetUpdateHandler(&AsScene2804BeamCoil::update); - SetMessageHandler(&AsScene2804BeamCoil::handleMessage); -} - -AsScene2804BeamCoil::~AsScene2804BeamCoil() { - _vm->_soundMan->deleteSoundGroup(0xC5EA0B28); -} - -void AsScene2804BeamCoil::update() { - updateAnim(); - updatePosition(); - if (_countdown != 0 && (--_countdown) == 0) { - sendMessage(_parentScene, 0x2001, 0); - } -} - -uint32 AsScene2804BeamCoil::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2002: - show(); - _countdown = 92; - messageResult = 1; - break; - case 0x2003: - hide(); - messageResult = 1; - break; - } - return messageResult; -} - -void AsScene2804BeamCoil::show() { - _ssBeamCoilBody->setVisible(true); - setVisible(true); - startAnimation(0x00494891, 0, -1); - playSound(0); - SetMessageHandler(&AsScene2804BeamCoil::hmBeaming); - NextState(&AsScene2804BeamCoil::stBeaming); -} - -void AsScene2804BeamCoil::hide() { - stopAnimation(); - SetMessageHandler(&AsScene2804BeamCoil::handleMessage); - setVisible(false); - _ssBeamCoilBody->setVisible(false); - _vm->_soundMan->stopSound(0xEF56B094); -} - -void AsScene2804BeamCoil::stBeaming() { - startAnimation(0x00494891, 93, -1); - NextState(&AsScene2804BeamCoil::stBeaming); - _vm->_soundMan->playSoundLooping(0xEF56B094); -} - -uint32 AsScene2804BeamCoil::hmBeaming(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x3002: - gotoNextState(); - break; - } - return messageResult; -} - -AsScene2804BeamTarget::AsScene2804BeamTarget(NeverhoodEngine *vm) - : AnimatedSprite(vm, 1400) { - - createSurface1(0x03842000, 1000); - _x = 475; - _y = 278; - setVisible(false); - _needRefresh = true; - updatePosition(); - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2804BeamTarget::handleMessage); -} - -uint32 AsScene2804BeamTarget::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2004: - setVisible(true); - startAnimation(0x03842000, 0, -1); - messageResult = 1; - break; - case 0x2005: - setVisible(false); - stopAnimation(); - messageResult = 1; - break; - } - return messageResult; -} - Scene2804::Scene2804(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule), _countdown1(0), _countdown2(0), _countdown3(0), _beamStatus(0), _isSolved(false), _isWorking(false) { @@ -1848,34 +1328,6 @@ uint32 Scene2805::handleMessage(int messageNum, const MessageParam ¶m, Entit return 0; } -AsScene2806Spew::AsScene2806Spew(NeverhoodEngine *vm) - : AnimatedSprite(vm, 1200) { - - createSurface1(0x04211490, 1200); - _x = 378; - _y = 423; - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2806Spew::handleMessage); - setDoDeltaX(1); - setVisible(false); -} - -uint32 AsScene2806Spew::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2000: - playSound(0, 0x48640244); - startAnimation(0x04211490, 0, -1); - setVisible(true); - break; - case 0x3002: - stopAnimation(); - setVisible(false); - break; - } - return messageResult; -} - Scene2806::Scene2806(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule) { @@ -2067,267 +1519,6 @@ static const uint32 kClass428FileHashes[] = { 0x40800711 }; -static const int kClass428Countdowns1[] = { - 18, 16, 10, 0 -}; - -static const int kClass428Countdowns2[] = { - 9, 9, 8, 8, 5, 5, 0, 0 -}; - -static const uint32 kClass490FileHashes[] = { - 0x08100071, - 0x24084215, - 0x18980A10 -}; - -static const int16 kClass490FrameIndices1[] = { - 0, 8, 15, 19 -}; - -static const int16 kClass490FrameIndices2[] = { - 0, 4, 8, 11, 15, 17, 19, 0 -}; - -SsScene2808Dispenser::SsScene2808Dispenser(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum, int testTubeIndex) - : StaticSprite(vm, 900), _parentScene(parentScene), _countdown(0), _testTubeSetNum(testTubeSetNum), - _testTubeIndex(testTubeIndex) { - - loadSprite(kClass428FileHashes[testTubeSetNum * 3 + testTubeIndex], kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 1500); - setVisible(false); - SetUpdateHandler(&SsScene2808Dispenser::update); - SetMessageHandler(&SsScene2808Dispenser::handleMessage); -} - -void SsScene2808Dispenser::update() { - updatePosition(); - if (_countdown != 0 && (--_countdown) == 0) { - setVisible(false); - } -} - -uint32 SsScene2808Dispenser::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x1011: - sendMessage(_parentScene, 0x2000, _testTubeIndex); - messageResult = 1; - break; - } - return messageResult; -} - -void SsScene2808Dispenser::startCountdown(int index) { - setVisible(true); - updatePosition(); - if (_testTubeSetNum == 0) { - _countdown = kClass428Countdowns1[index]; - } else { - _countdown = kClass428Countdowns2[index]; - } -} - -AsScene2808TestTube::AsScene2808TestTube(NeverhoodEngine *vm, int testTubeSetNum, int testTubeIndex, SsScene2808Dispenser *ssDispenser) - : AnimatedSprite(vm, 1100), _testTubeSetNum(testTubeSetNum), _testTubeIndex(testTubeIndex), _ssDispenser(ssDispenser), _fillLevel(0) { - - if (testTubeSetNum == 0) { - _x = 504; - _y = 278; - } else { - setDoDeltaX(1); - _x = 136; - _y = 278; - } - - createSurface1(kClass490FileHashes[testTubeIndex], 1100); - - if (testTubeSetNum == 0) { - loadSound(0, 0x30809E2D); - loadSound(1, 0x72811E2D); - loadSound(2, 0x78B01625); - } else { - loadSound(3, 0x70A41E0C); - loadSound(4, 0x50205E2D); - loadSound(5, 0xF8621E2D); - loadSound(6, 0xF1A03C2D); - loadSound(7, 0x70A43D2D); - loadSound(8, 0xF0601E2D); - } - - startAnimation(kClass490FileHashes[testTubeIndex], 0, -1); - _newStickFrameIndex = 0; - - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2808TestTube::handleMessage); - - if (_fillLevel == 0) - setVisible(false); - -} - -uint32 AsScene2808TestTube::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x1011: - fill(); - messageResult = 1; - break; - } - return messageResult; -} - -void AsScene2808TestTube::fill() { - if ((int)_fillLevel < _testTubeSetNum * 3 + 3) { - if (_testTubeSetNum == 0) { - playSound(_fillLevel); - setVisible(true); - startAnimation(kClass490FileHashes[_testTubeIndex], kClass490FrameIndices1[_fillLevel], kClass490FrameIndices1[_fillLevel + 1]); - _newStickFrameIndex = kClass490FrameIndices1[_fillLevel + 1]; - } else { - playSound(3 + _fillLevel); - setVisible(true); - startAnimation(kClass490FileHashes[_testTubeIndex], kClass490FrameIndices2[_fillLevel], kClass490FrameIndices2[_fillLevel + 1]); - _newStickFrameIndex = kClass490FrameIndices2[_fillLevel + 1]; - } - _ssDispenser->startCountdown(_fillLevel); - _fillLevel++; - } -} - -void AsScene2808TestTube::flush() { - if (_fillLevel != 0) { - if (_testTubeSetNum == 0) { - startAnimation(kClass490FileHashes[_testTubeIndex], kClass490FrameIndices1[_fillLevel], -1); - } else { - startAnimation(kClass490FileHashes[_testTubeIndex], kClass490FrameIndices2[_fillLevel], -1); - } - _newStickFrameIndex = 0; - _playBackwards = true; - setVisible(true); - } -} - -AsScene2808Handle::AsScene2808Handle(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum) - : AnimatedSprite(vm, 1300), _parentScene(parentScene), _testTubeSetNum(testTubeSetNum), _isActivated(false) { - - loadSound(0, 0xE18D1F30); - _x = 320; - _y = 240; - if (_testTubeSetNum == 1) - setDoDeltaX(1); - createSurface1(0x040900D0, 1300); - startAnimation(0x040900D0, 0, -1); - _needRefresh = true; - _newStickFrameIndex = 0; - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2808Handle::handleMessage); - AnimatedSprite::updatePosition(); -} - -uint32 AsScene2808Handle::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x1011: - if (!_isActivated) { - sendMessage(_parentScene, 0x2001, 0); - playSound(0); - activate(); - } - messageResult = 1; - break; - } - return messageResult; -} - -uint32 AsScene2808Handle::hmActivating(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x3002: - gotoNextState(); - break; - } - return messageResult; -} - -void AsScene2808Handle::activate() { - startAnimation(0x040900D0, 0, -1); - SetMessageHandler(&AsScene2808Handle::hmActivating); - NextState(&AsScene2808Handle::stActivated); - _isActivated = true; - _newStickFrameIndex = -1; -} - -void AsScene2808Handle::stActivated() { - stopAnimation(); - sendMessage(_parentScene, 0x2002, 0); -} - -AsScene2808Flow::AsScene2808Flow(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum) - : AnimatedSprite(vm, 1100), _parentScene(parentScene), _testTubeSetNum(testTubeSetNum) { - - if (testTubeSetNum == 0) { - _x = 312; - _y = 444; - } else { - _x = 328; - _y = 444; - } - createSurface1(0xB8414818, 1200); - startAnimation(0xB8414818, 0, -1); - setVisible(false); - _newStickFrameIndex = 0; - _needRefresh = true; - loadSound(0, 0x6389B652); - SetUpdateHandler(&AnimatedSprite::update); - AnimatedSprite::updatePosition(); -} - -uint32 AsScene2808Flow::hmFlowing(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x3002: - gotoNextState(); - break; - } - return messageResult; -} - -void AsScene2808Flow::start() { - startAnimation(0xB8414818, 0, -1); - setVisible(true); - SetMessageHandler(&AsScene2808Flow::hmFlowing); - NextState(&AsScene2808Flow::stKeepFlowing); - playSound(0); -} - -void AsScene2808Flow::stKeepFlowing() { - startAnimation(0xB8414818, 1, -1); - NextState(&AsScene2808Flow::stKeepFlowing); -} - -AsScene2808LightEffect::AsScene2808LightEffect(NeverhoodEngine *vm, int testTubeSetNum) - : AnimatedSprite(vm, 800), _countdown(1) { - - _x = 320; - _y = 240; - if (testTubeSetNum == 1) - setDoDeltaX(1); - createSurface1(0x804C2404, 800); - SetUpdateHandler(&AsScene2808LightEffect::update); - _needRefresh = true; - AnimatedSprite::updatePosition(); -} - -void AsScene2808LightEffect::update() { - if (_countdown != 0 && (--_countdown) == 0) { - int16 frameIndex = _vm->_rnd->getRandomNumber(3 - 1); - startAnimation(0x804C2404, frameIndex, frameIndex); - updateAnim(); - updatePosition(); - _countdown = _vm->_rnd->getRandomNumber(3 - 1) + 1; - } -} - Scene2808::Scene2808(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule), _countdown(0), _testTubeSetNum(which), _leaveResult(0), _isFlowing(false) { @@ -2422,34 +1613,6 @@ bool Scene2808::isAnyTestTubeFilled() { _asTestTubes[2]->getFillLevel() > 0; } -AsScene2809Spew::AsScene2809Spew(NeverhoodEngine *vm) - : AnimatedSprite(vm, 1200) { - - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2809Spew::handleMessage); - createSurface1(0x04211490, 1200); - _x = 262; - _y = 423; - setDoDeltaX(0); - setVisible(false); -} - -uint32 AsScene2809Spew::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2000: - playSound(0, 0x48640244); - startAnimation(0x04211490, 0, -1); - setVisible(true); - break; - case 0x3002: - stopAnimation(); - setVisible(false); - break; - } - return messageResult; -} - Scene2809::Scene2809(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule) { @@ -2569,34 +1732,6 @@ void Scene2809::findClosestPoint() { } -AsScene2810Rope::AsScene2810Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x) - : AnimatedSprite(vm, 1100) { - - createSurface(990, 68, 476); - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2810Rope::handleMessage); - SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); - _x = x; - _y = -276; - startAnimation(0x9D098C23, 35, 53); -} - -uint32 AsScene2810Rope::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x3002: - startAnimation(0x9D098C23, 35, 53); - break; - case 0x482A: - sendMessage(_parentScene, 0x1022, 990); - break; - case 0x482B: - sendMessage(_parentScene, 0x1022, 1010); - break; - } - return messageResult; -} - Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule) { @@ -2818,101 +1953,6 @@ uint32 Scene2810::handleMessage(int messageNum, const MessageParam ¶m, Entit return messageResult; } -AsScene2812Winch::AsScene2812Winch(NeverhoodEngine *vm) - : AnimatedSprite(vm, 1100) { - - createSurface1(0x20DA08A0, 1200); - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2812Winch::handleMessage); - setVisible(false); - _x = 280; - _y = 184; -} - -AsScene2812Winch::~AsScene2812Winch() { - _vm->_soundMan->deleteSoundGroup(0x00B000E2); -} - -uint32 AsScene2812Winch::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2000: - startAnimation(0x20DA08A0, 0, -1); - setVisible(true); - _vm->_soundMan->addSound(0x00B000E2, 0xC874EE6C); - _vm->_soundMan->playSoundLooping(0xC874EE6C); - break; - case 0x3002: - startAnimation(0x20DA08A0, 7, -1); - break; - } - return messageResult; -} - -AsScene2812Rope::AsScene2812Rope(NeverhoodEngine *vm, Scene *parentScene) - : AnimatedSprite(vm, 1100), _parentScene(parentScene) { - - createSurface(990, 68, 476); - SetUpdateHandler(&AnimatedSprite::update); - SetMessageHandler(&AsScene2812Rope::handleMessage); - SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); - startAnimation(0xAE080551, 0, -1); - _x = 334; - _y = 201; -} - -uint32 AsScene2812Rope::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x4806: - setDoDeltaX(((Sprite*)sender)->isDoDeltaX() ? 1 : 0); - stRopingDown(); - break; - case 0x482A: - sendMessage(_parentScene, 0x1022, 990); - break; - case 0x482B: - sendMessage(_parentScene, 0x1022, 1010); - break; - } - return messageResult; -} - -uint32 AsScene2812Rope::hmRopingDown(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x3002: - gotoNextState(); - break; - } - return messageResult; -} - -void AsScene2812Rope::stRopingDown() { - sendMessage(_parentScene, 0x4806, 0); - startAnimation(0x9D098C23, 0, -1); - SetMessageHandler(&AsScene2812Rope::hmRopingDown); -} - -AsScene2812TrapDoor::AsScene2812TrapDoor(NeverhoodEngine *vm) - : AnimatedSprite(vm, 0x805D0029, 100, 320, 240) { - - SetMessageHandler(&AsScene2812TrapDoor::handleMessage); - _newStickFrameIndex = 0; -} - -uint32 AsScene2812TrapDoor::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); - switch (messageNum) { - case 0x2000: - startAnimation(0x805D0029, 0, -1); - playSound(0, 0xEA005F40); - _newStickFrameIndex = STICK_LAST_FRAME; - break; - } - return messageResult; -} - Scene2812::Scene2812(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule), _paletteArea(0) { diff --git a/engines/neverhood/modules/module2800.h b/engines/neverhood/modules/module2800.h index 54a9daeb16..26e44bc543 100644 --- a/engines/neverhood/modules/module2800.h +++ b/engines/neverhood/modules/module2800.h @@ -70,38 +70,7 @@ protected: void changeTuneStatus(int prevTuneStatus, int newTuneStatus); }; -class AsScene2803LightCord : public AnimatedSprite { -public: - AsScene2803LightCord(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int16 x, int16 y); - void stPulled(); - void stIdle(); - void setFileHashes(uint32 fileHash1, uint32 fileHash2); -protected: - Scene *_parentScene; - uint32 _fileHash1, _fileHash2; - bool _isPulled, _isBusy; - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); - uint32 hmPulled(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2803TestTubeOne : public AnimatedSprite { -public: - AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2); -protected: - uint32 _fileHash1, _fileHash2; - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2803Rope : public AnimatedSprite { -public: - AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x); -protected: - Scene *_parentScene; - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); - uint32 hmReleased(int messageNum, const MessageParam ¶m, Entity *sender); - void stReleased(); - void stHide(); -}; +class AsScene2803LightCord; class Scene2803 : public Scene { public: @@ -158,101 +127,8 @@ protected: void updatePaletteArea(bool instantly); }; -class Scene2804; - -class SsScene2804RedButton : public StaticSprite { -public: - SsScene2804RedButton(NeverhoodEngine *vm, Scene2804 *parentScene); -protected: - Scene2804 *_parentScene; - int _countdown; - void update(); - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class SsScene2804LightCoil : public StaticSprite { -public: - SsScene2804LightCoil(NeverhoodEngine *vm); -protected: - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class SsScene2804BeamCoilBody : public StaticSprite { -public: - SsScene2804BeamCoilBody(NeverhoodEngine *vm); -}; - -class SsScene2804LightTarget : public StaticSprite { -public: - SsScene2804LightTarget(NeverhoodEngine *vm); -protected: - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class SsScene2804Flash : public StaticSprite { -public: - SsScene2804Flash(NeverhoodEngine *vm); - void show(); -}; - -class AsScene2804CrystalWaves : public AnimatedSprite { -public: - AsScene2804CrystalWaves(NeverhoodEngine *vm, uint crystalIndex); - void show(); - void hide(); -protected: - uint _crystalIndex; -}; - -class AsScene2804Crystal : public AnimatedSprite { -public: - AsScene2804Crystal(NeverhoodEngine *vm, AsScene2804CrystalWaves *asCrystalWaves, uint crystalIndex); - void show(); - void hide(); - void activate(); - int16 getColorNum() const { return _colorNum; } -protected: - AsScene2804CrystalWaves *_asCrystalWaves; - uint _crystalIndex; - int16 _colorNum; - bool _isLightOn; - bool _isShowing; -}; - -class SsScene2804CrystalButton : public StaticSprite { -public: - SsScene2804CrystalButton(NeverhoodEngine *vm, Scene2804 *parentScene, AsScene2804Crystal *asCrystal, uint crystalIndex); -protected: - Scene2804 *_parentScene; - AsScene2804Crystal *_asCrystal; - uint _crystalIndex; - int _countdown; - void update(); - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2804BeamCoil : public AnimatedSprite { -public: - AsScene2804BeamCoil(NeverhoodEngine *vm, Scene *parentScene, SsScene2804BeamCoilBody *ssBeamCoilBody); - virtual ~AsScene2804BeamCoil(); -protected: - Scene *_parentScene; - SsScene2804BeamCoilBody *_ssBeamCoilBody; - int _countdown; - void update(); - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); - void show(); - void hide(); - void stBeaming(); - uint32 hmBeaming(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2804BeamTarget : public AnimatedSprite { -public: - AsScene2804BeamTarget(NeverhoodEngine *vm); -protected: - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; +class SsScene2804Flash; +class AsScene2804Crystal; class Scene2804 : public Scene { public: @@ -284,13 +160,6 @@ protected: uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); }; -class AsScene2806Spew : public AnimatedSprite { -public: - AsScene2806Spew(NeverhoodEngine *vm); -protected: - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - class Scene2806 : public Scene { public: Scene2806(NeverhoodEngine *vm, Module *parentModule, int which); @@ -315,63 +184,8 @@ protected: uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); }; -class SsScene2808Dispenser : public StaticSprite { -public: - SsScene2808Dispenser(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum, int testTubeIndex); - void startCountdown(int index); -protected: - Scene *_parentScene; - int _countdown; - int _testTubeSetNum, _testTubeIndex; - void update(); - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2808TestTube : public AnimatedSprite { -public: - AsScene2808TestTube(NeverhoodEngine *vm, int testTubeSetNum, int testTubeIndex, SsScene2808Dispenser *ssDispenser); - void fill(); - void flush(); - uint32 getFillLevel() const { return _fillLevel; } -protected: - SsScene2808Dispenser *_ssDispenser; - int _testTubeSetNum; - uint32 _fillLevel; - int _testTubeIndex; - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2808Handle : public AnimatedSprite { -public: - AsScene2808Handle(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum); - void activate(); - void stActivated(); -protected: - Scene *_parentScene; - int _testTubeSetNum; - bool _isActivated; - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); - uint32 hmActivating(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2808Flow : public AnimatedSprite { -public: - AsScene2808Flow(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum); - void start(); - void stKeepFlowing(); -protected: - Scene *_parentScene; - int _testTubeSetNum; - uint32 hmFlowing(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2808LightEffect : public AnimatedSprite { -public: - AsScene2808LightEffect(NeverhoodEngine *vm, int which); -protected: - int _countdown; - void update(); -}; +class AsScene2808Flow; +class AsScene2808TestTube; class Scene2808 : public Scene { public: @@ -389,13 +203,6 @@ protected: bool isAnyTestTubeFilled(); }; -class AsScene2809Spew : public AnimatedSprite { -public: - AsScene2809Spew(NeverhoodEngine *vm); -protected: - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - class Scene2809 : public Scene { public: Scene2809(NeverhoodEngine *vm, Module *parentModule, int which); @@ -413,14 +220,6 @@ protected: void findClosestPoint(); }; -class AsScene2810Rope : public AnimatedSprite { -public: - AsScene2810Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x); -protected: - Scene *_parentScene; - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - class Scene2810 : public Scene { public: Scene2810(NeverhoodEngine *vm, Module *parentModule, int which); @@ -440,31 +239,6 @@ protected: void insertKlaymenLadder(); }; -class AsScene2812Winch : public AnimatedSprite { -public: - AsScene2812Winch(NeverhoodEngine *vm); - virtual ~AsScene2812Winch(); -protected: - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - -class AsScene2812Rope : public AnimatedSprite { -public: - AsScene2812Rope(NeverhoodEngine *vm, Scene *parentScene); -protected: - Scene *_parentScene; - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); - uint32 hmRopingDown(int messageNum, const MessageParam ¶m, Entity *sender); - void stRopingDown(); -}; - -class AsScene2812TrapDoor : public AnimatedSprite { -public: - AsScene2812TrapDoor(NeverhoodEngine *vm); -protected: - uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); -}; - class Scene2812 : public Scene { public: Scene2812(NeverhoodEngine *vm, Module *parentModule, int which); diff --git a/engines/neverhood/modules/module2800_sprites.cpp b/engines/neverhood/modules/module2800_sprites.cpp new file mode 100644 index 0000000000..28e2657ee7 --- /dev/null +++ b/engines/neverhood/modules/module2800_sprites.cpp @@ -0,0 +1,1020 @@ +/* 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 "neverhood/modules/module2800.h" +#include "neverhood/modules/module2800_sprites.h" +#include "neverhood/gamemodule.h" +#include "neverhood/modules/module1000.h" +#include "neverhood/modules/module1200.h" +#include "neverhood/modules/module1700.h" +#include "neverhood/modules/module2200.h" +#include "neverhood/diskplayerscene.h" + +namespace Neverhood { + +AsScene2803LightCord::AsScene2803LightCord(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int16 x, int16 y) + : AnimatedSprite(vm, 1100), _parentScene(parentScene), _fileHash1(fileHash1), _fileHash2(fileHash2), + _isPulled(false), _isBusy(false) { + + createSurface(1010, 28, 379); + SetUpdateHandler(&AnimatedSprite::update); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); + _x = x; + _y = y; + stIdle(); +} + +uint32 AsScene2803LightCord::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x100D: + if (!_isBusy && param.asInteger() == calcHash("ClickSwitch")) { + sendMessage(_parentScene, 0x480F, 0); + playSound(0, 0x4E1CA4A0); + } + break; + case 0x480F: + stPulled(); + break; + case 0x482A: + sendMessage(_parentScene, 0x1022, 990); + break; + case 0x482B: + sendMessage(_parentScene, 0x1022, 1010); + break; + } + return messageResult; +} + +uint32 AsScene2803LightCord::hmPulled(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x3002: + gotoNextState(); + break; + } + return messageResult; +} + +void AsScene2803LightCord::stPulled() { + _isBusy = false; + _isPulled = true; + startAnimation(_fileHash2, 0, -1); + SetMessageHandler(&AsScene2803LightCord::hmPulled); + NextState(&AsScene2803LightCord::stIdle); +} + +void AsScene2803LightCord::stIdle() { + _isPulled = false; + startAnimation(_fileHash1, 0, -1); + SetMessageHandler(&AsScene2803LightCord::handleMessage); +} + +void AsScene2803LightCord::setFileHashes(uint32 fileHash1, uint32 fileHash2) { + _fileHash1 = fileHash1; + _fileHash2 = fileHash2; + if (_isPulled) { + startAnimation(_fileHash2, _currFrameIndex, -1); + _isBusy = true; + } else { + startAnimation(_fileHash1, 0, -1); + } +} + +AsScene2803TestTubeOne::AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2) + : AnimatedSprite(vm, 1200), _fileHash1(fileHash1), _fileHash2(fileHash2) { + + createSurface1(fileHash1, 100); + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2803TestTubeOne::handleMessage); + _x = 529; + _y = 326; +} + +uint32 AsScene2803TestTubeOne::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2000: + if (param.asInteger()) + startAnimation(_fileHash2, 0, -1); + else + startAnimation(_fileHash1, 0, -1); + break; + } + return messageResult; +} + +AsScene2803Rope::AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x) + : AnimatedSprite(vm, 1100), _parentScene(parentScene) { + + createSurface(990, 68, 476); + SetUpdateHandler(&AnimatedSprite::update); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); + SetMessageHandler(&AsScene2803Rope::handleMessage); + startAnimation(0x9D098C23, 35, 53); + NextState(&AsScene2803Rope::stReleased); + _x = x; + _y = -276; +} + +uint32 AsScene2803Rope::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x3002: + startAnimation(0x9D098C23, 50, -1); + SetMessageHandler(&AsScene2803Rope::hmReleased); + break; + case 0x482A: + sendMessage(_parentScene, 0x1022, 990); + break; + case 0x482B: + sendMessage(_parentScene, 0x1022, 1010); + break; + } + return messageResult; +} + +uint32 AsScene2803Rope::hmReleased(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x3002: + gotoNextState(); + break; + case 0x482A: + sendMessage(_parentScene, 0x1022, 990); + break; + case 0x482B: + sendMessage(_parentScene, 0x1022, 1010); + break; + } + return messageResult; +} + +void AsScene2803Rope::stReleased() { + startAnimation(0x8258A030, 0, 1); + NextState(&AsScene2803Rope::stHide); +} + +void AsScene2803Rope::stHide() { + stopAnimation(); + setVisible(false); +} + +SsScene2804RedButton::SsScene2804RedButton(NeverhoodEngine *vm, Scene2804 *parentScene) + : StaticSprite(vm, 900), _countdown(0), _parentScene(parentScene) { + + loadSprite(getGlobalVar(V_SHRINK_LIGHTS_ON) ? 0x51A10202 : 0x11814A21, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400); + setVisible(false); + SetUpdateHandler(&SsScene2804RedButton::update); + SetMessageHandler(&SsScene2804RedButton::handleMessage); + loadSound(0, 0x44241240); +} + +void SsScene2804RedButton::update() { + updatePosition(); + if (_countdown != 0 && (--_countdown) == 0) { + setVisible(false); + } +} + +uint32 SsScene2804RedButton::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x1011: + if (_countdown == 0 && !_parentScene->isWorking()) { + playSound(0); + setVisible(true); + _countdown = 4; + sendMessage(_parentScene, 0x2000, 0); + } + messageResult = 1; + break; + } + return messageResult; +} + +SsScene2804LightCoil::SsScene2804LightCoil(NeverhoodEngine *vm) + : StaticSprite(vm, 900) { + + loadSprite(0x8889B008, kSLFDefDrawOffset | kSLFDefPosition, 400); + setVisible(false); + SetMessageHandler(&SsScene2804LightCoil::handleMessage); +} + +uint32 SsScene2804LightCoil::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2002: + setVisible(true); + updatePosition(); + messageResult = 1; + break; + case 0x2003: + setVisible(false); + updatePosition(); + messageResult = 1; + break; + } + return messageResult; +} + +SsScene2804LightTarget::SsScene2804LightTarget(NeverhoodEngine *vm) + : StaticSprite(vm, 900) { + + loadSprite(0x06092132, kSLFDefDrawOffset | kSLFDefPosition, 400); + setVisible(false); + SetMessageHandler(&SsScene2804LightTarget::handleMessage); +} + +uint32 SsScene2804LightTarget::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2004: + setVisible(true); + updatePosition(); + messageResult = 1; + break; + case 0x2005: + setVisible(false); + updatePosition(); + messageResult = 1; + break; + } + return messageResult; +} + +SsScene2804Flash::SsScene2804Flash(NeverhoodEngine *vm) + : StaticSprite(vm, 900) { + + loadSprite(0x211003A0, kSLFDefDrawOffset | kSLFDefPosition, 400); + setVisible(false); + loadSound(0, 0xCB36BA54); +} + +void SsScene2804Flash::show() { + setVisible(true); + updatePosition(); + playSound(0); +} + +SsScene2804BeamCoilBody::SsScene2804BeamCoilBody(NeverhoodEngine *vm) + : StaticSprite(vm, 900) { + + loadSprite(0x9A816000, kSLFDefDrawOffset | kSLFDefPosition, 400); + setVisible(false); +} + +AsScene2804CrystalWaves::AsScene2804CrystalWaves(NeverhoodEngine *vm, uint crystalIndex) + : AnimatedSprite(vm, 1100), _crystalIndex(crystalIndex) { + + static const NPoint kAsScene2804CrystalWavesPoints[] = { + {323, 245}, + {387, 76}, + {454, 260}, + {527, 70} + }; + + _x = kAsScene2804CrystalWavesPoints[crystalIndex].x; + _y = kAsScene2804CrystalWavesPoints[crystalIndex].y; + createSurface1(0x840C41F0, 1200); + if (crystalIndex & 1) + setDoDeltaY(1); + setVisible(false); + _needRefresh = true; + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&Sprite::handleMessage); +} + +void AsScene2804CrystalWaves::show() { + setVisible(true); + startAnimation(0x840C41F0, 0, -1); +} + +void AsScene2804CrystalWaves::hide() { + setVisible(false); + stopAnimation(); +} + +static const int16 kAsScene2804CrystalFrameNums[] = { + 0, 6, 2, 8, 1, 10, 0, 0 +}; + +static const uint32 kAsScene2804CrystalFileHashes[] = { + 0x000540B0, + 0x001280D0, + 0x003D0010, + 0x00620190, + 0x00DC0290 +}; + +AsScene2804Crystal::AsScene2804Crystal(NeverhoodEngine *vm, AsScene2804CrystalWaves *asCrystalWaves, uint crystalIndex) + : AnimatedSprite(vm, 1100), _asCrystalWaves(asCrystalWaves), _crystalIndex(crystalIndex), _isShowing(false) { + + static const NPoint kAsScene2804CrystalPoints[] = { + {204, 196}, + {272, 316}, + {334, 206}, + {410, 334}, + {470, 180} + }; + + _colorNum = (int16)getSubVar(VA_CURR_CRYSTAL_COLORS, crystalIndex); + _isLightOn = getGlobalVar(V_SHRINK_LIGHTS_ON) != 0; + if (_isLightOn) { + _x = kAsScene2804CrystalPoints[crystalIndex].x; + _y = kAsScene2804CrystalPoints[crystalIndex].y; + createSurface1(0x108DFB12, 1200); + startAnimation(0x108DFB12, kAsScene2804CrystalFrameNums[_colorNum], -1); + _needRefresh = true; + _newStickFrameIndex = kAsScene2804CrystalFrameNums[_colorNum]; + } else { + _x = 320; + _y = 240; + createSurface1(kAsScene2804CrystalFileHashes[crystalIndex], 1200); + startAnimation(kAsScene2804CrystalFileHashes[crystalIndex], _colorNum, -1); + setVisible(false); + _needRefresh = true; + _newStickFrameIndex = _colorNum; + } + loadSound(0, 0x725294D4); + SetUpdateHandler(&AnimatedSprite::update); +} + +void AsScene2804Crystal::show() { + if (!_isLightOn) { + setVisible(true); + _isShowing = true; + if (_asCrystalWaves) + _asCrystalWaves->show(); + playSound(0); + } +} + +void AsScene2804Crystal::hide() { + if (!_isLightOn) { + setVisible(false); + _isShowing = false; + if (_asCrystalWaves) + _asCrystalWaves->hide(); + } +} + +void AsScene2804Crystal::activate() { + if (!_isShowing) { + int16 frameNum = kAsScene2804CrystalFrameNums[_colorNum]; + _colorNum++; + if (_colorNum >= 6) + _colorNum = 0; + if (_isLightOn) { + startAnimation(0x108DFB12, frameNum, kAsScene2804CrystalFrameNums[_colorNum]); + _playBackwards = kAsScene2804CrystalFrameNums[_colorNum] < _colorNum; + _newStickFrameIndex = kAsScene2804CrystalFrameNums[_colorNum]; + } else { + startAnimation(kAsScene2804CrystalFileHashes[_crystalIndex], _colorNum, -1); + _newStickFrameIndex = _colorNum; + } + setSubVar(VA_CURR_CRYSTAL_COLORS, _crystalIndex, _colorNum); + } +} + +SsScene2804CrystalButton::SsScene2804CrystalButton(NeverhoodEngine *vm, Scene2804 *parentScene, AsScene2804Crystal *asCrystal, uint crystalIndex) + : StaticSprite(vm, 900), _countdown(0), _parentScene(parentScene), _asCrystal(asCrystal), _crystalIndex(crystalIndex) { + + static const uint32 kSsScene2804CrystalButtonFileHashes1[] = { + 0x911101B0, + 0x22226001, + 0x4444A362, + 0x888925A4, + 0x11122829 + }; + + static const uint32 kSsScene2804CrystalButtonFileHashes2[] = { + 0xB500A1A0, + 0x6A012021, + 0xD4022322, + 0xA8042525, + 0x5008292B + }; + + loadSprite(getGlobalVar(V_SHRINK_LIGHTS_ON) ? kSsScene2804CrystalButtonFileHashes1[crystalIndex] : kSsScene2804CrystalButtonFileHashes2[crystalIndex], + kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400); + setVisible(false); + loadSound(0, 0x44045140); + SetUpdateHandler(&SsScene2804CrystalButton::update); + SetMessageHandler(&SsScene2804CrystalButton::handleMessage); +} + +void SsScene2804CrystalButton::update() { + updatePosition(); + if (_countdown != 0 && (--_countdown) == 0) { + setVisible(false); + } +} + +uint32 SsScene2804CrystalButton::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x1011: + if (_countdown == 0 && !_parentScene->isWorking()) { + playSound(0); + setVisible(true); + _countdown = 4; + _asCrystal->activate(); + } + messageResult = 1; + break; + } + return messageResult; +} + +AsScene2804BeamCoil::AsScene2804BeamCoil(NeverhoodEngine *vm, Scene *parentScene, SsScene2804BeamCoilBody *ssBeamCoilBody) + : AnimatedSprite(vm, 1400), _parentScene(parentScene), _ssBeamCoilBody(ssBeamCoilBody), _countdown(0) { + + createSurface1(0x00494891, 1000); + _x = 125; + _y = 184; + setVisible(false); + _needRefresh = true; + AnimatedSprite::updatePosition(); + loadSound(0, 0x6352F051); + _vm->_soundMan->addSound(0xC5EA0B28, 0xEF56B094); + SetUpdateHandler(&AsScene2804BeamCoil::update); + SetMessageHandler(&AsScene2804BeamCoil::handleMessage); +} + +AsScene2804BeamCoil::~AsScene2804BeamCoil() { + _vm->_soundMan->deleteSoundGroup(0xC5EA0B28); +} + +void AsScene2804BeamCoil::update() { + updateAnim(); + updatePosition(); + if (_countdown != 0 && (--_countdown) == 0) { + sendMessage(_parentScene, 0x2001, 0); + } +} + +uint32 AsScene2804BeamCoil::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2002: + show(); + _countdown = 92; + messageResult = 1; + break; + case 0x2003: + hide(); + messageResult = 1; + break; + } + return messageResult; +} + +void AsScene2804BeamCoil::show() { + _ssBeamCoilBody->setVisible(true); + setVisible(true); + startAnimation(0x00494891, 0, -1); + playSound(0); + SetMessageHandler(&AsScene2804BeamCoil::hmBeaming); + NextState(&AsScene2804BeamCoil::stBeaming); +} + +void AsScene2804BeamCoil::hide() { + stopAnimation(); + SetMessageHandler(&AsScene2804BeamCoil::handleMessage); + setVisible(false); + _ssBeamCoilBody->setVisible(false); + _vm->_soundMan->stopSound(0xEF56B094); +} + +void AsScene2804BeamCoil::stBeaming() { + startAnimation(0x00494891, 93, -1); + NextState(&AsScene2804BeamCoil::stBeaming); + _vm->_soundMan->playSoundLooping(0xEF56B094); +} + +uint32 AsScene2804BeamCoil::hmBeaming(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x3002: + gotoNextState(); + break; + } + return messageResult; +} + +AsScene2804BeamTarget::AsScene2804BeamTarget(NeverhoodEngine *vm) + : AnimatedSprite(vm, 1400) { + + createSurface1(0x03842000, 1000); + _x = 475; + _y = 278; + setVisible(false); + _needRefresh = true; + updatePosition(); + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2804BeamTarget::handleMessage); +} + +uint32 AsScene2804BeamTarget::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2004: + setVisible(true); + startAnimation(0x03842000, 0, -1); + messageResult = 1; + break; + case 0x2005: + setVisible(false); + stopAnimation(); + messageResult = 1; + break; + } + return messageResult; +} + +AsScene2806Spew::AsScene2806Spew(NeverhoodEngine *vm) + : AnimatedSprite(vm, 1200) { + + createSurface1(0x04211490, 1200); + _x = 378; + _y = 423; + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2806Spew::handleMessage); + setDoDeltaX(1); + setVisible(false); +} + +uint32 AsScene2806Spew::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2000: + playSound(0, 0x48640244); + startAnimation(0x04211490, 0, -1); + setVisible(true); + break; + case 0x3002: + stopAnimation(); + setVisible(false); + break; + } + return messageResult; +} + +static const uint32 kScene2808FileHashes1[] = { + 0x90B0392, + 0x90B0192 +}; + +static const uint32 kScene2808FileHashes2[] = { + 0xB0396098, + 0xB0196098 +}; + +static const uint32 kClass428FileHashes[] = { + 0x140022CA, + 0x4C30A602, + 0xB1633402, + 0x12982135, + 0x0540B728, + 0x002A81E3, + 0x08982841, + 0x10982841, + 0x20982841, + 0x40982841, + 0x80982841, + 0x40800711 +}; + +static const int kClass428Countdowns1[] = { + 18, 16, 10, 0 +}; + +static const int kClass428Countdowns2[] = { + 9, 9, 8, 8, 5, 5, 0, 0 +}; + +static const uint32 kClass490FileHashes[] = { + 0x08100071, + 0x24084215, + 0x18980A10 +}; + +static const int16 kClass490FrameIndices1[] = { + 0, 8, 15, 19 +}; + +static const int16 kClass490FrameIndices2[] = { + 0, 4, 8, 11, 15, 17, 19, 0 +}; + +SsScene2808Dispenser::SsScene2808Dispenser(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum, int testTubeIndex) + : StaticSprite(vm, 900), _parentScene(parentScene), _countdown(0), _testTubeSetNum(testTubeSetNum), + _testTubeIndex(testTubeIndex) { + + loadSprite(kClass428FileHashes[testTubeSetNum * 3 + testTubeIndex], kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 1500); + setVisible(false); + SetUpdateHandler(&SsScene2808Dispenser::update); + SetMessageHandler(&SsScene2808Dispenser::handleMessage); +} + +void SsScene2808Dispenser::update() { + updatePosition(); + if (_countdown != 0 && (--_countdown) == 0) { + setVisible(false); + } +} + +uint32 SsScene2808Dispenser::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x1011: + sendMessage(_parentScene, 0x2000, _testTubeIndex); + messageResult = 1; + break; + } + return messageResult; +} + +void SsScene2808Dispenser::startCountdown(int index) { + setVisible(true); + updatePosition(); + if (_testTubeSetNum == 0) { + _countdown = kClass428Countdowns1[index]; + } else { + _countdown = kClass428Countdowns2[index]; + } +} + +AsScene2808TestTube::AsScene2808TestTube(NeverhoodEngine *vm, int testTubeSetNum, int testTubeIndex, SsScene2808Dispenser *ssDispenser) + : AnimatedSprite(vm, 1100), _testTubeSetNum(testTubeSetNum), _testTubeIndex(testTubeIndex), _ssDispenser(ssDispenser), _fillLevel(0) { + + if (testTubeSetNum == 0) { + _x = 504; + _y = 278; + } else { + setDoDeltaX(1); + _x = 136; + _y = 278; + } + + createSurface1(kClass490FileHashes[testTubeIndex], 1100); + + if (testTubeSetNum == 0) { + loadSound(0, 0x30809E2D); + loadSound(1, 0x72811E2D); + loadSound(2, 0x78B01625); + } else { + loadSound(3, 0x70A41E0C); + loadSound(4, 0x50205E2D); + loadSound(5, 0xF8621E2D); + loadSound(6, 0xF1A03C2D); + loadSound(7, 0x70A43D2D); + loadSound(8, 0xF0601E2D); + } + + startAnimation(kClass490FileHashes[testTubeIndex], 0, -1); + _newStickFrameIndex = 0; + + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2808TestTube::handleMessage); + + if (_fillLevel == 0) + setVisible(false); + +} + +uint32 AsScene2808TestTube::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x1011: + fill(); + messageResult = 1; + break; + } + return messageResult; +} + +void AsScene2808TestTube::fill() { + if ((int)_fillLevel < _testTubeSetNum * 3 + 3) { + if (_testTubeSetNum == 0) { + playSound(_fillLevel); + setVisible(true); + startAnimation(kClass490FileHashes[_testTubeIndex], kClass490FrameIndices1[_fillLevel], kClass490FrameIndices1[_fillLevel + 1]); + _newStickFrameIndex = kClass490FrameIndices1[_fillLevel + 1]; + } else { + playSound(3 + _fillLevel); + setVisible(true); + startAnimation(kClass490FileHashes[_testTubeIndex], kClass490FrameIndices2[_fillLevel], kClass490FrameIndices2[_fillLevel + 1]); + _newStickFrameIndex = kClass490FrameIndices2[_fillLevel + 1]; + } + _ssDispenser->startCountdown(_fillLevel); + _fillLevel++; + } +} + +void AsScene2808TestTube::flush() { + if (_fillLevel != 0) { + if (_testTubeSetNum == 0) { + startAnimation(kClass490FileHashes[_testTubeIndex], kClass490FrameIndices1[_fillLevel], -1); + } else { + startAnimation(kClass490FileHashes[_testTubeIndex], kClass490FrameIndices2[_fillLevel], -1); + } + _newStickFrameIndex = 0; + _playBackwards = true; + setVisible(true); + } +} + +AsScene2808Handle::AsScene2808Handle(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum) + : AnimatedSprite(vm, 1300), _parentScene(parentScene), _testTubeSetNum(testTubeSetNum), _isActivated(false) { + + loadSound(0, 0xE18D1F30); + _x = 320; + _y = 240; + if (_testTubeSetNum == 1) + setDoDeltaX(1); + createSurface1(0x040900D0, 1300); + startAnimation(0x040900D0, 0, -1); + _needRefresh = true; + _newStickFrameIndex = 0; + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2808Handle::handleMessage); + AnimatedSprite::updatePosition(); +} + +uint32 AsScene2808Handle::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x1011: + if (!_isActivated) { + sendMessage(_parentScene, 0x2001, 0); + playSound(0); + activate(); + } + messageResult = 1; + break; + } + return messageResult; +} + +uint32 AsScene2808Handle::hmActivating(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x3002: + gotoNextState(); + break; + } + return messageResult; +} + +void AsScene2808Handle::activate() { + startAnimation(0x040900D0, 0, -1); + SetMessageHandler(&AsScene2808Handle::hmActivating); + NextState(&AsScene2808Handle::stActivated); + _isActivated = true; + _newStickFrameIndex = -1; +} + +void AsScene2808Handle::stActivated() { + stopAnimation(); + sendMessage(_parentScene, 0x2002, 0); +} + +AsScene2808Flow::AsScene2808Flow(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum) + : AnimatedSprite(vm, 1100), _parentScene(parentScene), _testTubeSetNum(testTubeSetNum) { + + if (testTubeSetNum == 0) { + _x = 312; + _y = 444; + } else { + _x = 328; + _y = 444; + } + createSurface1(0xB8414818, 1200); + startAnimation(0xB8414818, 0, -1); + setVisible(false); + _newStickFrameIndex = 0; + _needRefresh = true; + loadSound(0, 0x6389B652); + SetUpdateHandler(&AnimatedSprite::update); + AnimatedSprite::updatePosition(); +} + +uint32 AsScene2808Flow::hmFlowing(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x3002: + gotoNextState(); + break; + } + return messageResult; +} + +void AsScene2808Flow::start() { + startAnimation(0xB8414818, 0, -1); + setVisible(true); + SetMessageHandler(&AsScene2808Flow::hmFlowing); + NextState(&AsScene2808Flow::stKeepFlowing); + playSound(0); +} + +void AsScene2808Flow::stKeepFlowing() { + startAnimation(0xB8414818, 1, -1); + NextState(&AsScene2808Flow::stKeepFlowing); +} + +AsScene2808LightEffect::AsScene2808LightEffect(NeverhoodEngine *vm, int testTubeSetNum) + : AnimatedSprite(vm, 800), _countdown(1) { + + _x = 320; + _y = 240; + if (testTubeSetNum == 1) + setDoDeltaX(1); + createSurface1(0x804C2404, 800); + SetUpdateHandler(&AsScene2808LightEffect::update); + _needRefresh = true; + AnimatedSprite::updatePosition(); +} + +void AsScene2808LightEffect::update() { + if (_countdown != 0 && (--_countdown) == 0) { + int16 frameIndex = _vm->_rnd->getRandomNumber(3 - 1); + startAnimation(0x804C2404, frameIndex, frameIndex); + updateAnim(); + updatePosition(); + _countdown = _vm->_rnd->getRandomNumber(3 - 1) + 1; + } +} + +AsScene2809Spew::AsScene2809Spew(NeverhoodEngine *vm) + : AnimatedSprite(vm, 1200) { + + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2809Spew::handleMessage); + createSurface1(0x04211490, 1200); + _x = 262; + _y = 423; + setDoDeltaX(0); + setVisible(false); +} + +uint32 AsScene2809Spew::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2000: + playSound(0, 0x48640244); + startAnimation(0x04211490, 0, -1); + setVisible(true); + break; + case 0x3002: + stopAnimation(); + setVisible(false); + break; + } + return messageResult; +} + +AsScene2810Rope::AsScene2810Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x) + : AnimatedSprite(vm, 1100) { + + createSurface(990, 68, 476); + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2810Rope::handleMessage); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); + _x = x; + _y = -276; + startAnimation(0x9D098C23, 35, 53); +} + +uint32 AsScene2810Rope::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x3002: + startAnimation(0x9D098C23, 35, 53); + break; + case 0x482A: + sendMessage(_parentScene, 0x1022, 990); + break; + case 0x482B: + sendMessage(_parentScene, 0x1022, 1010); + break; + } + return messageResult; +} + +AsScene2812Winch::AsScene2812Winch(NeverhoodEngine *vm) + : AnimatedSprite(vm, 1100) { + + createSurface1(0x20DA08A0, 1200); + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2812Winch::handleMessage); + setVisible(false); + _x = 280; + _y = 184; +} + +AsScene2812Winch::~AsScene2812Winch() { + _vm->_soundMan->deleteSoundGroup(0x00B000E2); +} + +uint32 AsScene2812Winch::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2000: + startAnimation(0x20DA08A0, 0, -1); + setVisible(true); + _vm->_soundMan->addSound(0x00B000E2, 0xC874EE6C); + _vm->_soundMan->playSoundLooping(0xC874EE6C); + break; + case 0x3002: + startAnimation(0x20DA08A0, 7, -1); + break; + } + return messageResult; +} + +AsScene2812Rope::AsScene2812Rope(NeverhoodEngine *vm, Scene *parentScene) + : AnimatedSprite(vm, 1100), _parentScene(parentScene) { + + createSurface(990, 68, 476); + SetUpdateHandler(&AnimatedSprite::update); + SetMessageHandler(&AsScene2812Rope::handleMessage); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); + startAnimation(0xAE080551, 0, -1); + _x = 334; + _y = 201; +} + +uint32 AsScene2812Rope::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x4806: + setDoDeltaX(((Sprite*)sender)->isDoDeltaX() ? 1 : 0); + stRopingDown(); + break; + case 0x482A: + sendMessage(_parentScene, 0x1022, 990); + break; + case 0x482B: + sendMessage(_parentScene, 0x1022, 1010); + break; + } + return messageResult; +} + +uint32 AsScene2812Rope::hmRopingDown(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x3002: + gotoNextState(); + break; + } + return messageResult; +} + +void AsScene2812Rope::stRopingDown() { + sendMessage(_parentScene, 0x4806, 0); + startAnimation(0x9D098C23, 0, -1); + SetMessageHandler(&AsScene2812Rope::hmRopingDown); +} + +AsScene2812TrapDoor::AsScene2812TrapDoor(NeverhoodEngine *vm) + : AnimatedSprite(vm, 0x805D0029, 100, 320, 240) { + + SetMessageHandler(&AsScene2812TrapDoor::handleMessage); + _newStickFrameIndex = 0; +} + +uint32 AsScene2812TrapDoor::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x2000: + startAnimation(0x805D0029, 0, -1); + playSound(0, 0xEA005F40); + _newStickFrameIndex = STICK_LAST_FRAME; + break; + } + return messageResult; +} + +} // End of namespace Neverhood diff --git a/engines/neverhood/modules/module2800_sprites.h b/engines/neverhood/modules/module2800_sprites.h new file mode 100644 index 0000000000..39ca88ef73 --- /dev/null +++ b/engines/neverhood/modules/module2800_sprites.h @@ -0,0 +1,268 @@ +/* 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 NEVERHOOD_MODULES_MODULE2800_SPRITES_H +#define NEVERHOOD_MODULES_MODULE2800_SPRITES_H + +#include "neverhood/neverhood.h" +#include "neverhood/module.h" +#include "neverhood/scene.h" + +namespace Neverhood { + +class AsScene2803LightCord : public AnimatedSprite { +public: + AsScene2803LightCord(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int16 x, int16 y); + void stPulled(); + void stIdle(); + void setFileHashes(uint32 fileHash1, uint32 fileHash2); +protected: + Scene *_parentScene; + uint32 _fileHash1, _fileHash2; + bool _isPulled, _isBusy; + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); + uint32 hmPulled(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2803TestTubeOne : public AnimatedSprite { +public: + AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2); +protected: + uint32 _fileHash1, _fileHash2; + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2803Rope : public AnimatedSprite { +public: + AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x); +protected: + Scene *_parentScene; + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); + uint32 hmReleased(int messageNum, const MessageParam ¶m, Entity *sender); + void stReleased(); + void stHide(); +}; + +class Scene2804; + +class SsScene2804RedButton : public StaticSprite { +public: + SsScene2804RedButton(NeverhoodEngine *vm, Scene2804 *parentScene); +protected: + Scene2804 *_parentScene; + int _countdown; + void update(); + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class SsScene2804LightCoil : public StaticSprite { +public: + SsScene2804LightCoil(NeverhoodEngine *vm); +protected: + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class SsScene2804BeamCoilBody : public StaticSprite { +public: + SsScene2804BeamCoilBody(NeverhoodEngine *vm); +}; + +class SsScene2804LightTarget : public StaticSprite { +public: + SsScene2804LightTarget(NeverhoodEngine *vm); +protected: + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class SsScene2804Flash : public StaticSprite { +public: + SsScene2804Flash(NeverhoodEngine *vm); + void show(); +}; + +class AsScene2804CrystalWaves : public AnimatedSprite { +public: + AsScene2804CrystalWaves(NeverhoodEngine *vm, uint crystalIndex); + void show(); + void hide(); +protected: + uint _crystalIndex; +}; + +class AsScene2804Crystal : public AnimatedSprite { +public: + AsScene2804Crystal(NeverhoodEngine *vm, AsScene2804CrystalWaves *asCrystalWaves, uint crystalIndex); + void show(); + void hide(); + void activate(); + int16 getColorNum() const { return _colorNum; } +protected: + AsScene2804CrystalWaves *_asCrystalWaves; + uint _crystalIndex; + int16 _colorNum; + bool _isLightOn; + bool _isShowing; +}; + +class SsScene2804CrystalButton : public StaticSprite { +public: + SsScene2804CrystalButton(NeverhoodEngine *vm, Scene2804 *parentScene, AsScene2804Crystal *asCrystal, uint crystalIndex); +protected: + Scene2804 *_parentScene; + AsScene2804Crystal *_asCrystal; + uint _crystalIndex; + int _countdown; + void update(); + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2804BeamCoil : public AnimatedSprite { +public: + AsScene2804BeamCoil(NeverhoodEngine *vm, Scene *parentScene, SsScene2804BeamCoilBody *ssBeamCoilBody); + virtual ~AsScene2804BeamCoil(); +protected: + Scene *_parentScene; + SsScene2804BeamCoilBody *_ssBeamCoilBody; + int _countdown; + void update(); + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); + void show(); + void hide(); + void stBeaming(); + uint32 hmBeaming(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2804BeamTarget : public AnimatedSprite { +public: + AsScene2804BeamTarget(NeverhoodEngine *vm); +protected: + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2806Spew : public AnimatedSprite { +public: + AsScene2806Spew(NeverhoodEngine *vm); +protected: + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class SsScene2808Dispenser : public StaticSprite { +public: + SsScene2808Dispenser(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum, int testTubeIndex); + void startCountdown(int index); +protected: + Scene *_parentScene; + int _countdown; + int _testTubeSetNum, _testTubeIndex; + void update(); + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2808TestTube : public AnimatedSprite { +public: + AsScene2808TestTube(NeverhoodEngine *vm, int testTubeSetNum, int testTubeIndex, SsScene2808Dispenser *ssDispenser); + void fill(); + void flush(); + uint32 getFillLevel() const { return _fillLevel; } +protected: + SsScene2808Dispenser *_ssDispenser; + int _testTubeSetNum; + uint32 _fillLevel; + int _testTubeIndex; + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2808Handle : public AnimatedSprite { +public: + AsScene2808Handle(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum); + void activate(); + void stActivated(); +protected: + Scene *_parentScene; + int _testTubeSetNum; + bool _isActivated; + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); + uint32 hmActivating(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2808Flow : public AnimatedSprite { +public: + AsScene2808Flow(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum); + void start(); + void stKeepFlowing(); +protected: + Scene *_parentScene; + int _testTubeSetNum; + uint32 hmFlowing(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2808LightEffect : public AnimatedSprite { +public: + AsScene2808LightEffect(NeverhoodEngine *vm, int which); +protected: + int _countdown; + void update(); +}; + +class AsScene2809Spew : public AnimatedSprite { +public: + AsScene2809Spew(NeverhoodEngine *vm); +protected: + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2810Rope : public AnimatedSprite { +public: + AsScene2810Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x); +protected: + Scene *_parentScene; + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2812Winch : public AnimatedSprite { +public: + AsScene2812Winch(NeverhoodEngine *vm); + virtual ~AsScene2812Winch(); +protected: + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +class AsScene2812Rope : public AnimatedSprite { +public: + AsScene2812Rope(NeverhoodEngine *vm, Scene *parentScene); +protected: + Scene *_parentScene; + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); + uint32 hmRopingDown(int messageNum, const MessageParam ¶m, Entity *sender); + void stRopingDown(); +}; + +class AsScene2812TrapDoor : public AnimatedSprite { +public: + AsScene2812TrapDoor(NeverhoodEngine *vm); +protected: + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + +} // End of namespace Neverhood + +#endif /* NEVERHOOD_MODULES_MODULE2800_SPRITES_H */ -- cgit v1.2.3 From cca0bbfe435308d597a1fbe6463ba4e462feab8b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 21 Sep 2013 14:28:12 +0300 Subject: NEVERHOOD: Document two resources used in game menus --- engines/neverhood/menumodule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp index 86434452f5..362f5270e3 100644 --- a/engines/neverhood/menumodule.cpp +++ b/engines/neverhood/menumodule.cpp @@ -354,8 +354,8 @@ MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule) setPalette(0x08C0020C); insertScreenMouse(0x00208084); - insertStaticSprite(0x41137051, 100); - insertStaticSprite(0xC10B2015, 100); + insertStaticSprite(0x41137051, 100); // "Options" header text + insertStaticSprite(0xC10B2015, 100); // Button texts if (!_vm->musicIsEnabled()) insertStaticSprite(0x0C24C0EE, 100); // "Music is off" button -- cgit v1.2.3 From c85698e87fd745fbf2c6800032626771fb57df93 Mon Sep 17 00:00:00 2001 From: Enrico Horn Date: Thu, 19 Sep 2013 22:08:06 +0200 Subject: SCI: Add detection entry for the German version of RAMA --- engines/sci/detection_tables.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines') diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 92e77cead9..9a31e2557b 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -3297,6 +3297,17 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, + // RAMA - German Windows CD + {"rama", "", { + {"resmap.001", 0, "f68cd73308c46977a9632dfc618e1e38", 8338}, + {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70595521}, + {"resmap.002", 0, "891fc2f5d9e23e7d9a9454acc7aaae52", 12082}, + {"ressci.002", 0, "2a68edd064e5e4937b5e9c74b38f2082", 128508558}, + {"resmap.003", 0, "222096000bd83a1d56577114a452cccf", 1636}, + {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6954219}, + AD_LISTEND}, + Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, + // RAMA - Italian Windows CD (from glorifindel) // SCI interpreter version 3.000.000 (a guess?) {"rama", "", { -- cgit v1.2.3 From ac0c890bccfb0a15cd739be60228c4de5a7afeab Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 21 Sep 2013 14:59:26 +0300 Subject: SCI: Add source of the checksums for RAMA German --- engines/sci/detection_tables.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 9a31e2557b..d0a0db2a3b 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -3297,17 +3297,17 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, - // RAMA - German Windows CD - {"rama", "", { - {"resmap.001", 0, "f68cd73308c46977a9632dfc618e1e38", 8338}, - {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70595521}, - {"resmap.002", 0, "891fc2f5d9e23e7d9a9454acc7aaae52", 12082}, - {"ressci.002", 0, "2a68edd064e5e4937b5e9c74b38f2082", 128508558}, - {"resmap.003", 0, "222096000bd83a1d56577114a452cccf", 1636}, - {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6954219}, - AD_LISTEND}, - Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, - + // RAMA - German Windows CD (from farmboy0, in pull request 397) + {"rama", "", { + {"resmap.001", 0, "f68cd73308c46977a9632dfc618e1e38", 8338}, + {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70595521}, + {"resmap.002", 0, "891fc2f5d9e23e7d9a9454acc7aaae52", 12082}, + {"ressci.002", 0, "2a68edd064e5e4937b5e9c74b38f2082", 128508558}, + {"resmap.003", 0, "222096000bd83a1d56577114a452cccf", 1636}, + {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6954219}, + AD_LISTEND}, + Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, + // RAMA - Italian Windows CD (from glorifindel) // SCI interpreter version 3.000.000 (a guess?) {"rama", "", { -- cgit v1.2.3 From 4443793b97761ab1dc1fb312a4092211356b008e Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Sat, 21 Sep 2013 14:27:16 +0200 Subject: SCI: sfx/music priority int16 fixes bug #3615038 it seems that sound system up till SCI0_LATE uses int16, afterwards it seems they changed to byte main music object (conMusic) in Laura Bow 1 uses -1 as priority. This was truncated to 255 till now, which resulted in many sound effects not getting played, because those used priority 0 --- engines/sci/engine/savegame.cpp | 5 ++++- engines/sci/engine/savegame.h | 3 ++- engines/sci/sound/music.h | 2 +- engines/sci/sound/soundcmd.cpp | 7 +++++-- 4 files changed, 12 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index c8076ec819..fa9363abe3 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -600,7 +600,10 @@ void MusicEntry::saveLoadWithSerializer(Common::Serializer &s) { s.syncAsSint16LE(dataInc); s.syncAsSint16LE(ticker); s.syncAsSint16LE(signal, VER(17)); - s.syncAsByte(priority); + if (s.getVersion() >= 31) // ffs. sound/music.h -> priority + s.syncAsSint16LE(priority); + else + s.syncAsByte(priority); s.syncAsSint16LE(loop, VER(17)); s.syncAsByte(volume); s.syncAsByte(hold, VER(17)); diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index 1d899b0d37..f1f02f89f2 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -37,6 +37,7 @@ struct EngineState; * * Version - new/changed feature * ============================= + * 31 - priority for sound effects/music is now a signed int16, instead of a byte * 30 - synonyms * 29 - system strings * 28 - heap @@ -55,7 +56,7 @@ struct EngineState; */ enum { - CURRENT_SAVEGAME_VERSION = 30, + CURRENT_SAVEGAME_VERSION = 31, MINIMUM_SAVEGAME_VERSION = 14 }; diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h index 5924a0fd12..b582e7f1a9 100644 --- a/engines/sci/sound/music.h +++ b/engines/sci/sound/music.h @@ -70,7 +70,7 @@ public: uint16 dataInc; uint16 ticker; uint16 signal; - byte priority; + int16 priority; // must be int16, at least in Laura Bow 1, main music (object conMusic) uses priority -1 uint16 loop; int16 volume; int16 hold; diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index b0102a002b..90ad51b5d8 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -116,7 +116,10 @@ void SoundCommandParser::processInitSound(reg_t obj) { newSound->resourceId = resourceId; newSound->soundObj = obj; newSound->loop = readSelectorValue(_segMan, obj, SELECTOR(loop)); - newSound->priority = readSelectorValue(_segMan, obj, SELECTOR(priority)) & 0xFF; + if (_soundVersion <= SCI_VERSION_0_LATE) + newSound->priority = readSelectorValue(_segMan, obj, SELECTOR(priority)); + else + newSound->priority = readSelectorValue(_segMan, obj, SELECTOR(priority)) & 0xFF; if (_soundVersion >= SCI_VERSION_1_EARLY) newSound->volume = CLIP(readSelectorValue(_segMan, obj, SELECTOR(vol)), 0, MUSIC_VOLUME_MAX); newSound->reverb = -1; // initialize to SCI invalid, it'll be set correctly in soundInitSnd() below @@ -428,7 +431,7 @@ reg_t SoundCommandParser::kDoSoundUpdate(int argc, reg_t *argv, reg_t acc) { int16 objVol = CLIP(readSelectorValue(_segMan, obj, SELECTOR(vol)), 0, 255); if (objVol != musicSlot->volume) _music->soundSetVolume(musicSlot, objVol); - uint32 objPrio = readSelectorValue(_segMan, obj, SELECTOR(priority)); + int32 objPrio = readSelectorValue(_segMan, obj, SELECTOR(priority)); if (objPrio != musicSlot->priority) _music->soundSetPriority(musicSlot, objPrio); return acc; -- cgit v1.2.3 From 158d12e555abe05e6e08a026c156097e48b2802f Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Sat, 21 Sep 2013 14:34:42 +0200 Subject: SCI: abbrev. ffs to FE and priority check fix --- engines/sci/engine/savegame.cpp | 2 +- engines/sci/sound/soundcmd.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index fa9363abe3..c60b50a964 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -600,7 +600,7 @@ void MusicEntry::saveLoadWithSerializer(Common::Serializer &s) { s.syncAsSint16LE(dataInc); s.syncAsSint16LE(ticker); s.syncAsSint16LE(signal, VER(17)); - if (s.getVersion() >= 31) // ffs. sound/music.h -> priority + if (s.getVersion() >= 31) // FE sound/music.h -> priority s.syncAsSint16LE(priority); else s.syncAsByte(priority); diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 90ad51b5d8..e36c5705ab 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -431,7 +431,7 @@ reg_t SoundCommandParser::kDoSoundUpdate(int argc, reg_t *argv, reg_t acc) { int16 objVol = CLIP(readSelectorValue(_segMan, obj, SELECTOR(vol)), 0, 255); if (objVol != musicSlot->volume) _music->soundSetVolume(musicSlot, objVol); - int32 objPrio = readSelectorValue(_segMan, obj, SELECTOR(priority)); + int16 objPrio = readSelectorValue(_segMan, obj, SELECTOR(priority)); if (objPrio != musicSlot->priority) _music->soundSetPriority(musicSlot, objPrio); return acc; -- cgit v1.2.3 From a6d902df2827b91dc641b6f51c0a070b70a09179 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 21 Sep 2013 14:42:54 +0200 Subject: SCI: Handle !fireEvents in processEvent --- engines/sci/sound/midiparser_sci.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 40ae91d83d..3332edd5a6 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -521,8 +521,11 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) { } void MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) { - - // TODO: Properly handle fireEvents + if (!fireEvents) { + // We don't do any processing that should be done while skipping events + MidiParser::processEvent(info, fireEvents); + return; + } switch (info.command()) { case 0xC: -- cgit v1.2.3 From 97b255ab33fa5fcd4507573e77cd42a8406e1b55 Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Sat, 21 Sep 2013 19:41:45 +0200 Subject: SCI: fix dataInc signalling fixes bug #3035159 we set signal in parseNextEvent on dataInc events, which then effectively triggered 2 cues through kDoSoundUpdateCues instead of one. Fixes Freddy Pharkas Ballad intro on floppy + demos --- engines/sci/sound/midiparser_sci.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines') diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 4b4333a37c..b367eeead0 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -444,7 +444,6 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) { if (_dataincAdd) { _dataincAdd = false; _pSnd->dataInc += _dataincToAdd; - _pSnd->signal = 0x7f + _pSnd->dataInc; debugC(4, kDebugLevelSound, "datainc %04x", _dataincToAdd); } if (_signalSet) { -- cgit v1.2.3 From fa41ee132b83d99d77349f3e7d647248f2907ff5 Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Sat, 21 Sep 2013 22:35:53 +0200 Subject: SCI: fix for heap corruption during lsl3 ending --- engines/sci/graphics/screen.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 7b92bc89eb..0df163dd7b 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -286,11 +286,15 @@ void GfxScreen::putPixelOnDisplay(int x, int y, byte color) { * with flood fill, due to small difference in the Bresenham logic. */ void GfxScreen::drawLine(Common::Point startPoint, Common::Point endPoint, byte color, byte priority, byte control) { - int16 left = startPoint.x; - int16 top = startPoint.y; - int16 right = endPoint.x; - int16 bottom = endPoint.y; - + int16 maxWidth = _width - 1; + int16 maxHeight = _height - 1; + // we need to clip values here, lsl3 room 620 background picture draws a line from 0, 199 t 320, 199 + // otherwise we would get heap corruption. + int16 left = CLIP(startPoint.x, 0, maxWidth); + int16 top = CLIP(startPoint.y, 0, maxHeight); + int16 right = CLIP(endPoint.x, 0, maxWidth); + int16 bottom = CLIP(endPoint.y, 0, maxHeight); + //set_drawing_flag byte drawMask = getDrawingMask(color, priority, control); -- cgit v1.2.3 From bac818ccb74d8d608189dc5959e3472c7b2358d3 Mon Sep 17 00:00:00 2001 From: m-kiewitz Date: Sun, 22 Sep 2013 02:26:19 +0200 Subject: SCI: patch for camelot sierra bug fixes #3614969 fixes sierra script bug for Conquests of Camelot (peeking through window) --- engines/sci/engine/script_patches.cpp | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 9fb7d08e56..abb7351d97 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -58,6 +58,58 @@ struct SciScriptSignature { // - if not EOS, an adjust offset and the actual bytes // - rinse and repeat +// =========================================================================== +// Conquests of Camelot +// At the bazaar in Jerusalem, it's possible to see a girl taking a shower. +// If you get too close, you get warned by the father - if you don't get away, +// he will kill you. +// Instead of walking there manually, it's also possible to enter "look window" +// and ego will automatically walk to the window. It seems that this is something +// that wasn't properly implemented, because instead of getting killed, you will +// get an "Oops" message in Sierra SCI. +// +// This is caused by peepingTom in script 169 not getting properly initialized. +// peepingTom calls the object behind global b9h. This global variable is +// properly initialized, when walking there manually (method fawaz::doit). +// When you instead walk there automatically (method fawaz::handleEvent), that +// global isn't initialized, which then results in the Oops-message in Sierra SCI +// and an error message in ScummVM/SCI. +// +// We fix the script by patching in a jump to the proper code inside fawaz::doit. +// Responsible method: fawaz::handleEvent +// Fixes bug #3614969 +const byte camelotSignaturePeepingTom[] = { + 5, + 0x72, 0x7e, 0x07, // lofsa fawaz <-- start of proper initializion code + 0xa1, 0xb9, // sag b9h + +255, 0, + +255, 0, + +61, 19, // skip 571 bytes + 0x39, 0x7a, // pushi 7a <-- initialization code when walking automatically + 0x78, // push1 + 0x7a, // push2 + 0x38, 0xa9, 0x00, // pushi 00a9 - script 169 + 0x78, // push1 + 0x43, 0x02, 0x04, // call kScriptID + 0x36, // push + 0x81, 0x00, // lag 00 + 0x4a, 0x06, // send 06 + 0x32, 0x20, 0x05, // jmp [end of fawaz::handleEvent] + 0 +}; + +const uint16 camelotPatchPeepingTom[] = { + PATCH_ADDTOOFFSET | +576, + 0x32, 0xbd, 0xfd, // jmp to fawaz::doit / properly init peepingTom code + PATCH_END +}; + +// script, description, magic DWORD, adjust +const SciScriptSignature camelotSignatures[] = { + { 62, "fix peepingTom Sierra bug", 1, PATCH_MAGICDWORD(0x7e, 0x07, 0xa1, 0xb9), -1, camelotSignaturePeepingTom, camelotPatchPeepingTom }, + SCI_SIGNATUREENTRY_TERMINATOR +}; + // =========================================================================== // stayAndHelp::changeState (0) is called when ego swims to the left or right // boundaries of room 660. Normally a textbox is supposed to get on screen @@ -1554,6 +1606,9 @@ int32 Script::findSignature(const SciScriptSignature *signature, const byte *scr void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uint32 scriptSize) { const SciScriptSignature *signatureTable = NULL; switch (g_sci->getGameId()) { + case GID_CAMELOT: + signatureTable = camelotSignatures; + break; case GID_ECOQUEST: signatureTable = ecoquest1Signatures; break; -- cgit v1.2.3 From c83df61fbbf6ebc6d9baee074723b982a6e288e0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Sep 2013 22:27:10 -0400 Subject: TSAGE: Further cleanup of R2R maze, and beginning of work on keypad sub-scene --- engines/tsage/globals.cpp | 38 ++--- engines/tsage/globals.h | 2 +- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 200 +++++++++++------------- engines/tsage/ringworld2/ringworld2_scenes1.h | 33 ++-- 4 files changed, 125 insertions(+), 148 deletions(-) (limited to 'engines') diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 6984b03ba5..a5abb4e105 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -432,24 +432,24 @@ void Ringworld2Globals::reset() { _vampireData[i]._isAlive = true; _vampireData[i]._position = Common::Point(); } - _vampireData[0].var2 = 1; - _vampireData[1].var2 = 2; - _vampireData[2].var2 = 2; - _vampireData[3].var2 = 3; - _vampireData[4].var2 = 2; - _vampireData[5].var2 = 2; - _vampireData[6].var2 = 3; - _vampireData[7].var2 = 1; - _vampireData[8].var2 = 1; - _vampireData[9].var2 = 3; - _vampireData[10].var2 = 3; - _vampireData[11].var2 = 1; - _vampireData[12].var2 = 2; - _vampireData[13].var2 = 3; - _vampireData[14].var2 = 2; - _vampireData[15].var2 = 3; - _vampireData[16].var2 = 1; - _vampireData[17].var2 = 1; + _vampireData[0]._shotsRequired = 1; + _vampireData[1]._shotsRequired = 2; + _vampireData[2]._shotsRequired = 2; + _vampireData[3]._shotsRequired = 3; + _vampireData[4]._shotsRequired = 2; + _vampireData[5]._shotsRequired = 2; + _vampireData[6]._shotsRequired = 3; + _vampireData[7]._shotsRequired = 1; + _vampireData[8]._shotsRequired = 1; + _vampireData[9]._shotsRequired = 3; + _vampireData[10]._shotsRequired = 3; + _vampireData[11]._shotsRequired = 1; + _vampireData[12]._shotsRequired = 2; + _vampireData[13]._shotsRequired = 3; + _vampireData[14]._shotsRequired = 2; + _vampireData[15]._shotsRequired = 3; + _vampireData[16]._shotsRequired = 1; + _vampireData[17]._shotsRequired = 1; _v566A6 = 3800; _landerSuitNumber = 2; @@ -584,7 +584,7 @@ void Ringworld2Globals::synchronize(Serializer &s) { // Synchronise Flub maze vampire data for (i = 0; i < 18; ++i) { s.syncAsSint16LE(_vampireData[i]._isAlive); - s.syncAsSint16LE(_vampireData[i].var2); + s.syncAsSint16LE(_vampireData[i]._shotsRequired); s.syncAsSint16LE(_vampireData[i]._position.x); s.syncAsSint16LE(_vampireData[i]._position.y); } diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 99634ed175..3a8f61bf13 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -246,7 +246,7 @@ class ScannerDialog; struct VampireData { bool _isAlive; - int var2; + int _shotsRequired; Common::Point _position; }; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 8533360063..fbd26d8710 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -13555,15 +13555,16 @@ void Scene1945::signal() { * *--------------------------------------------------------------------------*/ -Scene1950::Area1::Area1() { +Scene1950::KeypadWindow::KeypadWindow() { _field20 = 0; - _fieldB65 = 0; + _buttonIndex = 0; } -void Scene1950::Area1::synchronize(Serializer &s) { + +void Scene1950::KeypadWindow::synchronize(Serializer &s) { SceneArea::synchronize(s); s.syncAsByte(_field20); - s.syncAsSint16LE(_fieldB65); + s.syncAsSint16LE(_buttonIndex); } Scene1950::Scene1950() { @@ -13585,35 +13586,35 @@ void Scene1950::synchronize(Serializer &s) { s.syncAsSint16LE(_vampireIndex); } -Scene1950::Area1::Actor10::Actor10() { - _fieldA4 = 0; +Scene1950::KeypadWindow::KeypadButton::KeypadButton() { + _buttonIndex = 0; _fieldA6 = 0; _fieldA8 = 0; } -void Scene1950::Area1::Actor10::synchronize(Serializer &s) { +void Scene1950::KeypadWindow::KeypadButton::synchronize(Serializer &s) { SceneActor::synchronize(s); - s.syncAsSint16LE(_fieldA4); + s.syncAsSint16LE(_buttonIndex); s.syncAsSint16LE(_fieldA6); s.syncAsSint16LE(_fieldA8); } -void Scene1950::Area1::Actor10::init(int indx) { -// Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; +void Scene1950::KeypadWindow::KeypadButton::init(int indx) { + Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - _fieldA4 = indx; + _buttonIndex = indx; _fieldA6 = 0; _fieldA8 = 0; postInit(); setup(1971, 2, 1); fixPriority(249); - setPosition(Common::Point(((_fieldA4 / 4) * 22) + 127, ((_fieldA4 / 4) * 19) + 71)); - warning("FIXME: invalid call to scene->_sceneAreas.push_front(this);"); + setPosition(Common::Point(((_buttonIndex % 4) * 22) + 127, ((_buttonIndex / 4) * 19) + 71)); + scene->_sceneAreas.push_front(this); } -void Scene1950::Area1::Actor10::process(Event &event) { +void Scene1950::KeypadWindow::KeypadButton::process(Event &event) { if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos)) && (_fieldA6 == 0)) { R2_GLOBALS._sound2.play(227); if (_fieldA8 == 0) { @@ -13631,22 +13632,21 @@ void Scene1950::Area1::Actor10::process(Event &event) { _fieldA6 = 0; event.handled = true; Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - scene->subBF4B4(_fieldA4); + scene->subBF4B4(_buttonIndex); } } -bool Scene1950::Area1::Actor10::startAction(CursorType action, Event &event) { +bool Scene1950::KeypadWindow::KeypadButton::startAction(CursorType action, Event &event) { if (action == CURSOR_USE) return false; return SceneActor::startAction(action, event); } -void Scene1950::Area1::remove() { +void Scene1950::KeypadWindow::remove() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - for (_fieldB65 = 0; _fieldB65 < 16; ++_fieldB65) { - warning("Unexpected _sceneAreas.remove() call"); - // R2_GLOBALS._sceneAreas.remove(&_arrActor1[_fieldB65]); - _arrActor1[_fieldB65].remove(); + for (_buttonIndex = 0; _buttonIndex < 16; ++_buttonIndex) { + scene->_sceneAreas.remove(&_buttons[_buttonIndex]); + _buttons[_buttonIndex].remove(); } // sub201EA @@ -13672,38 +13672,14 @@ void Scene1950::Area1::remove() { } } -void Scene1950::Area1::process(Event &event) { - // This is a copy of Scene1200::LaserPanel::process - if (_field20 != R2_GLOBALS._insetUp) - return; - - CursorType cursor = R2_GLOBALS._events.getCursor(); - - if (_areaActor._bounds.contains(event.mousePos.x + g_globals->gfxManager()._bounds.left , event.mousePos.y)) { - if (cursor == _cursorNum) { - R2_GLOBALS._events.setCursor(_savedCursorNum); - } - } else if (event.mousePos.y < 168) { - if (cursor != _cursorNum) { - _savedCursorNum = cursor; - R2_GLOBALS._events.setCursor(CURSOR_INVALID); - } - if (event.eventType == EVENT_BUTTON_DOWN) { - event.handled = true; - R2_GLOBALS._events.setCursor(_savedCursorNum); - remove(); - } - } -} - -void Scene1950::Area1::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) { +void Scene1950::KeypadWindow::proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; if (R2_GLOBALS._player._mover) R2_GLOBALS._player.addMover(NULL); R2_GLOBALS._player._canWalk = false; - // UnkArea1200::proc12(); + ModalWindow::proc12(visage, stripFrameNum, frameNum, posX, posY); _areaActor.postInit(); _areaActor.setup(visage, stripFrameNum, frameNum); _areaActor.setPosition(Common::Point(posX, posY)); @@ -13718,16 +13694,16 @@ void Scene1950::Area1::proc12(int visage, int stripFrameNum, int frameNum, int p scene->_eastExit._enabled = false; proc13(1950, 27, 28, 27); - for (_fieldB65 = 0; _fieldB65 < 16; _fieldB65++) - _arrActor1[_fieldB65].init(_fieldB65); + for (_buttonIndex = 0; _buttonIndex < 16; _buttonIndex++) + _buttons[_buttonIndex].init(_buttonIndex); } -void Scene1950::Area1::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { +void Scene1950::KeypadWindow::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { // Copy of Scene1200::LaserPanel::proc13() _areaActor.setDetails(resNum, lookLineNum, talkLineNum, useLineNum, 2, (SceneItem *) NULL); } -bool Scene1950::Hotspot2::startAction(CursorType action, Event &event) { +bool Scene1950::Keypad::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (R2_GLOBALS.getFlag(37))) return SceneHotspot::startAction(action, event); @@ -13757,7 +13733,7 @@ bool Scene1950::Door::startAction(CursorType action, Event &event) { return true; } -bool Scene1950::Actor3::startAction(CursorType action, Event &event) { +bool Scene1950::Scrolls::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) != 1950)) return SceneActor::startAction(action, event); @@ -13816,10 +13792,11 @@ void Scene1950::Vampire::signal() { setStrip(1); NpcMover *mover = new NpcMover(); - R2_GLOBALS._player.addMover(mover, &scene->_field418, this); + addMover(mover, &scene->_field418, scene); } break; case 20: { + // Non fatal shot _vampireMode = 19; R2_GLOBALS._player.setVisage(22); if (R2_GLOBALS._flubMazeEntryDirection == 3) @@ -13827,7 +13804,7 @@ void Scene1950::Vampire::signal() { else R2_GLOBALS._player.setStrip(2); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - R2_GLOBALS._vampireData[scene->_vampireIndex - 1].var2--; + R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._shotsRequired--; if (R2_GLOBALS._flubMazeEntryDirection == 3) _deadPosition.x = _position.x + 10; @@ -13851,6 +13828,7 @@ void Scene1950::Vampire::signal() { } break; case 21: + // Fatal shot R2_GLOBALS._player.setVisage(22); if (R2_GLOBALS._flubMazeEntryDirection == 3) R2_GLOBALS._player.setStrip(1); @@ -13871,7 +13849,7 @@ void Scene1950::Vampire::signal() { fixPriority(10); R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive = false; - R2_GLOBALS._vampireData[scene->_vampireIndex - 1].var2--; + R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._shotsRequired--; R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._position = _position; _fieldA8 = (_position.x - R2_GLOBALS._player._position.x) / 2; _fieldAA = (_position.y - R2_GLOBALS._player._position.y) / 2; @@ -13926,7 +13904,7 @@ bool Scene1950::Vampire::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._vampireData[scene->_vampireIndex - 1].var2 <= 1) + if (R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._shotsRequired <= 1) _vampireMode = 21; else _vampireMode = 20; @@ -14781,7 +14759,7 @@ void Scene1950::enterArea() { _vampire.remove(); _door.remove(); - _actor3.remove(); + _scrolls.remove(); _field416 = 0; _vampireIndex = 0; @@ -14889,15 +14867,15 @@ void Scene1950::enterArea() { R2_GLOBALS._walkRegions.disableRegion(6); R2_GLOBALS._walkRegions.disableRegion(7); - _actor6.postInit(); - _actor6.setVisage(1970); - _actor6.setStrip(1); + _cube.postInit(); + _cube.setVisage(1970); + _cube.setStrip(1); if (R2_GLOBALS.getFlag(37)) - _actor6.setFrame(3); + _cube.setFrame(3); else - _actor6.setFrame(1); - _actor6.setPosition(Common::Point(193, 158)); - _actor6.setDetails(1950, 3, 4, 5, 2, (SceneItem *) NULL); + _cube.setFrame(1); + _cube.setPosition(Common::Point(193, 158)); + _cube.setDetails(1950, 3, 4, 5, 2, (SceneItem *) NULL); _actor7.postInit(); _actor7.setVisage(1970); @@ -14907,7 +14885,7 @@ void Scene1950::enterArea() { _actor7.setPosition(Common::Point(194, 158)); _actor7.fixPriority(159); - _item2.setDetails(Rect(188, 124, 199, 133), 1950, 27, 28, -1, 2, NULL); + _keypad.setDetails(Rect(188, 124, 199, 133), 1950, 27, 28, -1, 2, NULL); if (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 1950) { _actor5.postInit(); @@ -14921,37 +14899,37 @@ void Scene1950::enterArea() { _actor5.setPosition(Common::Point(192, 118)); _actor5.setDetails(1950, 9, 4, -1, 2, (SceneItem *) NULL); } else { - _actor4.postInit(); - _actor4.setVisage(1970); - _actor4.setStrip(4); - _actor4._numFrames = 4; - _actor4.animate(ANIM_MODE_8, NULL); - _actor4.setPosition(Common::Point(192, 121)); - _actor4.fixPriority(159); - _actor4.setDetails(1950, 6, 7, 8, 2, (SceneItem *) NULL); + _containmentField.postInit(); + _containmentField.setVisage(1970); + _containmentField.setStrip(4); + _containmentField._numFrames = 4; + _containmentField.animate(ANIM_MODE_8, 0, NULL); + _containmentField.setPosition(Common::Point(192, 121)); + _containmentField.fixPriority(159); + _containmentField.setDetails(1950, 6, 7, 8, 2, (SceneItem *) NULL); _actor5.setPosition(Common::Point(192, 109)); _actor5.setDetails(1950, 9, 7, 8, 2, (SceneItem *) NULL); } - _actor3.postInit(); - _actor3.setVisage(1972); - _actor3.setStrip(1); - _actor3.setPosition(Common::Point(76, 94)); - _actor3.fixPriority(25); - _actor3.setDetails(1950, 30, -1, -1, 2, (SceneItem *) NULL); + _scrolls.postInit(); + _scrolls.setVisage(1972); + _scrolls.setStrip(1); + _scrolls.setPosition(Common::Point(76, 94)); + _scrolls.fixPriority(25); + _scrolls.setDetails(1950, 30, -1, -1, 2, (SceneItem *) NULL); if (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2) - _actor3.setFrame(2); + _scrolls.setFrame(2); else - _actor3.setFrame(1); + _scrolls.setFrame(1); _field414 = 1; } else if (_field414 != 0) { - _actor6.remove(); - _actor4.remove(); + _cube.remove(); + _containmentField.remove(); _actor5.remove(); _actor7.remove(); - _actor3.remove(); + _scrolls.remove(); _item1.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 2, NULL); } @@ -15074,12 +15052,12 @@ void Scene1950::subBF4B4(int indx) { } else si = 4; - if (_area1._arrActor1[si]._fieldA8 == 0) { - _area1._arrActor1[si].setFrame(2); - _area1._arrActor1[si]._fieldA8 = 1; + if (_KeypadWindow._buttons[si]._fieldA8 == 0) { + _KeypadWindow._buttons[si].setFrame(2); + _KeypadWindow._buttons[si]._fieldA8 = 1; } else { - _area1._arrActor1[si].setFrame(1); - _area1._arrActor1[si]._fieldA8 = 0; + _KeypadWindow._buttons[si].setFrame(1); + _KeypadWindow._buttons[si]._fieldA8 = 0; } si = indx + 1; @@ -15089,41 +15067,41 @@ void Scene1950::subBF4B4(int indx) { } else si -= 4; - if (_area1._arrActor1[si]._fieldA8 == 0) { - _area1._arrActor1[si].setFrame(2); - _area1._arrActor1[si]._fieldA8 = 1; + if (_KeypadWindow._buttons[si]._fieldA8 == 0) { + _KeypadWindow._buttons[si].setFrame(2); + _KeypadWindow._buttons[si]._fieldA8 = 1; } else { - _area1._arrActor1[si].setFrame(1); - _area1._arrActor1[si]._fieldA8 = 0; + _KeypadWindow._buttons[si].setFrame(1); + _KeypadWindow._buttons[si]._fieldA8 = 0; } si = indx - 4; if (si < 0) si += 16; - if (_area1._arrActor1[si]._fieldA8 == 0) { - _area1._arrActor1[si].setFrame(2); - _area1._arrActor1[si]._fieldA8 = 1; + if (_KeypadWindow._buttons[si]._fieldA8 == 0) { + _KeypadWindow._buttons[si].setFrame(2); + _KeypadWindow._buttons[si]._fieldA8 = 1; } else { - _area1._arrActor1[si].setFrame(1); - _area1._arrActor1[si]._fieldA8 = 0; + _KeypadWindow._buttons[si].setFrame(1); + _KeypadWindow._buttons[si]._fieldA8 = 0; } si = indx + 4; if (si > 15) si -= 16; - if (_area1._arrActor1[si]._fieldA8 == 0) { - _area1._arrActor1[si].setFrame(2); - _area1._arrActor1[si]._fieldA8 = 1; + if (_KeypadWindow._buttons[si]._fieldA8 == 0) { + _KeypadWindow._buttons[si].setFrame(2); + _KeypadWindow._buttons[si]._fieldA8 = 1; } else { - _area1._arrActor1[si].setFrame(1); - _area1._arrActor1[si]._fieldA8 = 0; + _KeypadWindow._buttons[si].setFrame(1); + _KeypadWindow._buttons[si]._fieldA8 = 0; } int cpt = 0; for (si = 0; si < 16; si++) { - if (_area1._arrActor1[si]._fieldA8 != 0) + if (_KeypadWindow._buttons[si]._fieldA8 != 0) ++cpt; } @@ -15269,10 +15247,10 @@ void Scene1950::signal() { } break; case 24: - _area1.remove(); + _KeypadWindow.remove(); _sceneMode = 1966; - _actor6.setFrame(3); - setAction(&_sequenceManager, this, 1966, &_actor4, &_actor5, NULL); + _cube.setFrame(3); + setAction(&_sequenceManager, this, 1966, &_containmentField, &_actor5, NULL); break; case 1951: R2_GLOBALS._sound1.fadeOut2(NULL); @@ -15294,7 +15272,7 @@ void Scene1950::signal() { // No break on purpose case 1963: R2_GLOBALS._player.enableControl(); - _area1.proc12(1971, 1, 1, 160, 135); + _KeypadWindow.proc12(1971, 1, 1, 160, 135); break; case 1964: // No break on purpose @@ -15305,7 +15283,7 @@ void Scene1950::signal() { } break; case 1966: - _actor4.remove(); + _containmentField.remove(); if (R2_GLOBALS.getFlag(36)) { _sceneMode = 1964; setAction(&_sequenceManager, this, 1964, &R2_GLOBALS._player, NULL); @@ -15332,7 +15310,7 @@ void Scene1950::signal() { case 1968: R2_GLOBALS._player.disableControl(); R2_INVENTORY.setObjectScene(R2_ANCIENT_SCROLLS, 2); - _actor3.setFrame(2); + _scrolls.setFrame(2); if (R2_GLOBALS.getFlag(36)) R2_GLOBALS._player.setVisage(20); else diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 58b1730941..aa130d9626 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1108,16 +1108,16 @@ public: }; class Scene1950 : public SceneExt { - /* Areas */ - class Area1: public SceneArea { + /* Windows */ + class KeypadWindow: public ModalWindow { public: - class Actor10 : public SceneActor { + class KeypadButton : public SceneActor { public: - int _fieldA4; + int _buttonIndex; int _fieldA6; int _fieldA8; - Actor10(); + KeypadButton(); void synchronize(Serializer &s); void init(int indx); @@ -1126,21 +1126,20 @@ class Scene1950 : public SceneExt { }; SceneActor _areaActor; - Actor10 _arrActor1[16]; + KeypadButton _buttons[16]; byte _field20; - int _fieldB65; - - Area1(); - void synchronize(Serializer &s); + int _buttonIndex; + KeypadWindow(); + virtual void synchronize(Serializer &s); virtual void remove(); virtual void process(Event &event); virtual void proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY); virtual void proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum); }; - class Hotspot2 : public NamedHotspot { + class Keypad : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1150,7 +1149,7 @@ class Scene1950 : public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Scrolls : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1217,17 +1216,17 @@ private: void subBF4B4(int indx); public: NamedHotspot _item1; - Hotspot2 _item2; + Keypad _keypad; SceneActor _southDoorway; SceneObject _northDoorway; Door _door; - Actor3 _actor3; - SceneActor _actor4; + Scrolls _scrolls; + SceneActor _containmentField; Actor5 _actor5; - SceneActor _actor6; + SceneActor _cube; SceneActor _actor7; Vampire _vampire; - Area1 _area1; + KeypadWindow _KeypadWindow; NorthExit _northExit; UpExit _upExit; EastExit _eastExit; -- cgit v1.2.3 From 55a759b9d513f083fc9a10d3fa653ac22a9a54d8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Sep 2013 22:51:59 -0400 Subject: TSAGE: Removed redundant process method entry --- engines/tsage/ringworld2/ringworld2_scenes1.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index aa130d9626..86e92c550e 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1134,7 +1134,6 @@ class Scene1950 : public SceneExt { KeypadWindow(); virtual void synchronize(Serializer &s); virtual void remove(); - virtual void process(Event &event); virtual void proc12(int visage, int stripFrameNum, int frameNum, int posX, int posY); virtual void proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum); }; -- cgit v1.2.3 From 19955e5d1943309c9ac2d696d9ee22eb4dee4eb9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 22 Sep 2013 11:24:57 +0300 Subject: FULLPIPE: Fix stupid c/p error. CID 1063216 --- engines/fullpipe/statics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 343d5e92dc..4b5e4c1e35 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -1553,7 +1553,7 @@ bool Movement::gotoPrevFrame() { _currDynamicPhaseIndex--; if (_currDynamicPhaseIndex < 0) - _currDynamicPhaseIndex = _currMovement->_dynamicPhases.size() - 1; + _currDynamicPhaseIndex = _dynamicPhases.size() - 1; } updateCurrDynamicPhase(); -- cgit v1.2.3 From 2fb823c19bdd62e24d2e86ee2b77f6e4a84e3d66 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 22 Sep 2013 11:28:44 +0300 Subject: FULLPIPE: Fix unneeded check. CID 1063206 --- engines/fullpipe/scenes.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index d66291d9fc..7bc8f68fa5 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -137,17 +137,13 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { _aniMan->_statics = _aniMan->getStaticsById(ST_MAN_EMPTY); _aniMan->setOXY(0, 0); - if (_aniMan) { - _aniMan2 = _aniMan; - MctlCompound *cmp = getSc2MctlCompoundBySceneId(entrance->_sceneId); - cmp->initMovGraph2(); - cmp->addObject(_aniMan); - cmp->setEnabled(); - getGameLoaderInteractionController()->enableFlag24(); - setInputDisabled(0); - } else { - _aniMan2 = 0; - } + _aniMan2 = _aniMan; + MctlCompound *cmp = getSc2MctlCompoundBySceneId(entrance->_sceneId); + cmp->initMovGraph2(); + cmp->addObject(_aniMan); + cmp->setEnabled(); + getGameLoaderInteractionController()->enableFlag24(); + setInputDisabled(0); scene->setPictureObjectsFlag4(); -- cgit v1.2.3 From 0b88ffab1bd5d4d3bf45d32c5c3833eafaa82e13 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 22 Sep 2013 11:31:47 +0300 Subject: FULLPIPE: Fix uninitialized class variables --- engines/fullpipe/statics.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines') diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 4b5e4c1e35..e33eb1139e 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -1131,6 +1131,9 @@ Movement::Movement(Movement *src, StaticANIObject *ani) { _currDynamicPhaseIndex = src->_currDynamicPhaseIndex; _field_94 = 0; + _field_24 = 0; + _field_28 = 0; + _currMovement = src; _ox = src->_ox; _oy = src->_oy; -- cgit v1.2.3 From 4d52f7b70129247396bc19a0ca7d37e2d8381031 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 22 Sep 2013 11:33:50 +0300 Subject: FULLPIPE: Remove unused class variable. CID 1063191 --- engines/fullpipe/scene.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h index 7fe3b9363d..db0da5db31 100644 --- a/engines/fullpipe/scene.h +++ b/engines/fullpipe/scene.h @@ -88,7 +88,6 @@ class SceneTag : public CObject { char *_tag; Scene *_scene; int16 _sceneId; - int16 _field_12; public: SceneTag(); -- cgit v1.2.3 From 3329dc8fe04aeb9b2bab2cd68d5a00a31c0ce2a4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 22 Sep 2013 11:38:07 +0300 Subject: FULLPIPE: Initialized class variables. CID 1063198 --- engines/fullpipe/messages.cpp | 3 +++ engines/fullpipe/messages.h | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index e74aae0ddb..a7aa0ff49d 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -196,6 +196,9 @@ MessageQueue::MessageQueue() { _isFinished = 0; _flags = 0; _queueName = 0; + _counter = 0; + _field_38 = 0; + _flag1 = 0; } MessageQueue::MessageQueue(MessageQueue *src, int parId, int field_38) { diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h index 5ae94b9cef..6b72364323 100644 --- a/engines/fullpipe/messages.h +++ b/engines/fullpipe/messages.h @@ -99,7 +99,6 @@ class MessageQueue : public CObject { int _flags; char *_queueName; int16 _dataId; - int16 _field_12; CObject *_field_14; Common::List _exCommands; int _counter; -- cgit v1.2.3 From 6e7f4d3669437e616676cc332c06c79cb0ce4c97 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 22 Sep 2013 11:40:34 +0300 Subject: FULLPIPE: Initialize class variable --- engines/fullpipe/messages.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines') diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index a7aa0ff49d..b5f2cb8303 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -225,6 +225,7 @@ MessageQueue::MessageQueue(MessageQueue *src, int parId, int field_38) { g_fullpipe->_globalMessageQueueList->addMessageQueue(this); _isFinished = 0; + _flag1 = 0; } MessageQueue::~MessageQueue() { -- cgit v1.2.3 From 2b2157cf620da980bb8bad0adcf43fef4b4d40a8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 22 Sep 2013 11:42:50 +0300 Subject: FULLPIPE: Initialize class variable in constructor. CID 1090697 --- engines/fullpipe/motion.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index e692c01726..d666bc5cd4 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -30,12 +30,12 @@ int doSomeAnimation(int objId, int objKey, int a3); int doSomeAnimation2(int objId, int objKey); class MotionController : public CObject { - public: +public: int _field_4; bool _isEnabled; - public: - MotionController() : _isEnabled(true) {} +public: + MotionController() : _isEnabled(true), _field_4(0) {} virtual bool load(MfcArchive &file); void setEnabled() { _isEnabled = true; } -- cgit v1.2.3 From f5115dd91e48be817c2a5139b118db38597b64dd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 22 Sep 2013 09:10:19 -0400 Subject: TSAGE: Further work on R2R keypad area sub-scene --- engines/tsage/ringworld2/ringworld2_logic.cpp | 8 +- engines/tsage/ringworld2/ringworld2_logic.h | 2 +- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 218 ++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes1.h | 8 +- 4 files changed, 120 insertions(+), 116 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index cd22141a3c..1b402b0d0c 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -2138,7 +2138,7 @@ void AnimationPlayerExt::synchronize(Serializer &s) { /*--------------------------------------------------------------------------*/ ModalWindow::ModalWindow() { - _field20 = 0; + _insetCount = 0; } void ModalWindow::remove() { @@ -2153,11 +2153,11 @@ void ModalWindow::remove() { void ModalWindow::synchronize(Serializer &s) { SceneArea::synchronize(s); - s.syncAsByte(_field20); + s.syncAsByte(_insetCount); } void ModalWindow::process(Event &event) { - if (_field20 != R2_GLOBALS._insetUp) + if (_insetCount != R2_GLOBALS._insetUp) return; CursorType cursor = R2_GLOBALS._events.getCursor(); @@ -2189,7 +2189,7 @@ void ModalWindow::proc12(int visage, int stripFrameNum, int frameNum, int posX, _cursorNum = CURSOR_INVALID; scene->_sceneAreas.push_front(this); ++R2_GLOBALS._insetUp; - _field20 = R2_GLOBALS._insetUp; + _insetCount = R2_GLOBALS._insetUp; } void ModalWindow::proc13(int resNum, int lookLineNum, int talkLineNum, int useLineNum) { diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index b3d501935b..57a30dcc13 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -451,7 +451,7 @@ public: class ModalWindow: public SceneArea { public: SceneActor _object1; - byte _field20; + int _insetCount; public: ModalWindow(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index fbd26d8710..1caecc7087 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -13567,45 +13567,26 @@ void Scene1950::KeypadWindow::synchronize(Serializer &s) { s.syncAsSint16LE(_buttonIndex); } -Scene1950::Scene1950() { - _field412 = 0; - _field414 = 0; - _field416 = 0; - _field418 = Common::Point(0, 0); - _vampireIndex = 0; -} - -void Scene1950::synchronize(Serializer &s) { - SceneExt::synchronize(s); - - s.syncAsSint16LE(_field412); - s.syncAsSint16LE(_field414); - s.syncAsSint16LE(_field416); - s.syncAsSint16LE(_field418.x); - s.syncAsSint16LE(_field418.y); - s.syncAsSint16LE(_vampireIndex); -} - Scene1950::KeypadWindow::KeypadButton::KeypadButton() { _buttonIndex = 0; - _fieldA6 = 0; - _fieldA8 = 0; + _pressed = false; + _toggled = false; } void Scene1950::KeypadWindow::KeypadButton::synchronize(Serializer &s) { SceneActor::synchronize(s); s.syncAsSint16LE(_buttonIndex); - s.syncAsSint16LE(_fieldA6); - s.syncAsSint16LE(_fieldA8); + s.syncAsSint16LE(_pressed); + s.syncAsSint16LE(_toggled); } void Scene1950::KeypadWindow::KeypadButton::init(int indx) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _buttonIndex = indx; - _fieldA6 = 0; - _fieldA8 = 0; + _pressed = false; + _toggled = false; postInit(); setup(1971, 2, 1); @@ -13615,24 +13596,25 @@ void Scene1950::KeypadWindow::KeypadButton::init(int indx) { } void Scene1950::KeypadWindow::KeypadButton::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos)) && (_fieldA6 == 0)) { + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) + && (_bounds.contains(event.mousePos)) && !_pressed) { R2_GLOBALS._sound2.play(227); - if (_fieldA8 == 0) { + if (!_toggled) { setFrame(2); - _fieldA8 = 1; + _toggled = true; } else { setFrame(1); - _fieldA8 = 0; + _toggled = false; } - _fieldA6 = 1; + _pressed = true; event.handled = true; } - if ((event.eventType == EVENT_BUTTON_UP) && (_fieldA6 != 0)) { - _fieldA6 = 0; + if ((event.eventType == EVENT_BUTTON_UP) && _pressed) { + _pressed = false; event.handled = true; Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - scene->subBF4B4(_buttonIndex); + scene->doButtonPress(_buttonIndex); } } @@ -13649,11 +13631,7 @@ void Scene1950::KeypadWindow::remove() { _buttons[_buttonIndex].remove(); } - // sub201EA - R2_GLOBALS._sceneItems.remove((SceneItem *)this); - _areaActor.remove(); - SceneArea::remove(); - R2_GLOBALS._insetUp--; + ModalWindow::remove(); if (!R2_GLOBALS.getFlag(37)) R2_GLOBALS._sound2.play(278); @@ -13680,17 +13658,8 @@ void Scene1950::KeypadWindow::proc12(int visage, int stripFrameNum, int frameNum R2_GLOBALS._player._canWalk = false; ModalWindow::proc12(visage, stripFrameNum, frameNum, posX, posY); - _areaActor.postInit(); - _areaActor.setup(visage, stripFrameNum, frameNum); - _areaActor.setPosition(Common::Point(posX, posY)); - _areaActor.fixPriority(250); - _cursorNum = CURSOR_INVALID; - scene->_sceneAreas.push_front(this); - ++R2_GLOBALS._insetUp; - _field20 = R2_GLOBALS._insetUp; - // - _areaActor.fixPriority(248); + _object1.fixPriority(248); scene->_eastExit._enabled = false; proc13(1950, 27, 28, 27); @@ -13703,6 +13672,8 @@ void Scene1950::KeypadWindow::proc13(int resNum, int lookLineNum, int talkLineNu _areaActor.setDetails(resNum, lookLineNum, talkLineNum, useLineNum, 2, (SceneItem *) NULL); } +/*--------------------------------------------------------------------------*/ + bool Scene1950::Keypad::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (R2_GLOBALS.getFlag(37))) return SceneHotspot::startAction(action, event); @@ -13759,6 +13730,8 @@ bool Scene1950::Actor5::startAction(CursorType action, Event &event) { return true; } +/*--------------------------------------------------------------------------*/ + Scene1950::Vampire::Vampire() { _fieldA8 = 0; _fieldAA = 0; @@ -13920,6 +13893,8 @@ bool Scene1950::Vampire::startAction(CursorType action, Event &event) { return true; } +/*--------------------------------------------------------------------------*/ + void Scene1950::NorthExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; @@ -14062,6 +14037,27 @@ void Scene1950::Exit8::changeScene() { } } +/*--------------------------------------------------------------------------*/ + +Scene1950::Scene1950() { + _field412 = 0; + _field414 = 0; + _field416 = 0; + _field418 = Common::Point(0, 0); + _vampireIndex = 0; +} + +void Scene1950::synchronize(Serializer &s) { + SceneExt::synchronize(s); + + s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_field414); + s.syncAsSint16LE(_field416); + s.syncAsSint16LE(_field418.x); + s.syncAsSint16LE(_field418.y); + s.syncAsSint16LE(_vampireIndex); +} + void Scene1950::initArea() { _northExit._enabled = false; _upExit._enabled = false; @@ -14888,16 +14884,16 @@ void Scene1950::enterArea() { _keypad.setDetails(Rect(188, 124, 199, 133), 1950, 27, 28, -1, 2, NULL); if (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 1950) { - _actor5.postInit(); - _actor5.setVisage(1970); - _actor5.setStrip(1); - _actor5.setFrame(2); - _actor5.fixPriority(160); + _gem.postInit(); + _gem.setVisage(1970); + _gem.setStrip(1); + _gem.setFrame(2); + _gem.fixPriority(160); } if (R2_GLOBALS.getFlag(37)) { - _actor5.setPosition(Common::Point(192, 118)); - _actor5.setDetails(1950, 9, 4, -1, 2, (SceneItem *) NULL); + _gem.setPosition(Common::Point(192, 118)); + _gem.setDetails(1950, 9, 4, -1, 2, (SceneItem *) NULL); } else { _containmentField.postInit(); _containmentField.setVisage(1970); @@ -14908,8 +14904,8 @@ void Scene1950::enterArea() { _containmentField.fixPriority(159); _containmentField.setDetails(1950, 6, 7, 8, 2, (SceneItem *) NULL); - _actor5.setPosition(Common::Point(192, 109)); - _actor5.setDetails(1950, 9, 7, 8, 2, (SceneItem *) NULL); + _gem.setPosition(Common::Point(192, 109)); + _gem.setDetails(1950, 9, 7, 8, 2, (SceneItem *) NULL); } _scrolls.postInit(); @@ -14927,7 +14923,7 @@ void Scene1950::enterArea() { } else if (_field414 != 0) { _cube.remove(); _containmentField.remove(); - _actor5.remove(); + _gem.remove(); _actor7.remove(); _scrolls.remove(); @@ -15043,65 +15039,74 @@ void Scene1950::enterArea() { } } -void Scene1950::subBF4B4(int indx) { +void Scene1950::doButtonPress(int indx) { + Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); - int si = indx - 1; - if ((indx / 4) == (si / 4)) { - if (si < 0) - si = 3; - } else - si = 4; - if (_KeypadWindow._buttons[si]._fieldA8 == 0) { - _KeypadWindow._buttons[si].setFrame(2); - _KeypadWindow._buttons[si]._fieldA8 = 1; + int prevIndex = indx - 1; + if ((indx / 4) == (prevIndex / 4)) { + if (prevIndex < 0) + prevIndex = 3; } else { - _KeypadWindow._buttons[si].setFrame(1); - _KeypadWindow._buttons[si]._fieldA8 = 0; + prevIndex += 4; } - si = indx + 1; - if ((indx / 4) == (si / 4)) { - if (si > 15) - si = 12; - } else - si -= 4; + assert(prevIndex >= 0 && prevIndex < 16); + if (!_KeypadWindow._buttons[prevIndex]._toggled) { + _KeypadWindow._buttons[prevIndex].setFrame(2); + _KeypadWindow._buttons[prevIndex]._toggled = true; + } else { + _KeypadWindow._buttons[prevIndex].setFrame(1); + _KeypadWindow._buttons[prevIndex]._toggled = false; + } - if (_KeypadWindow._buttons[si]._fieldA8 == 0) { - _KeypadWindow._buttons[si].setFrame(2); - _KeypadWindow._buttons[si]._fieldA8 = 1; + prevIndex = indx + 1; + if ((indx / 4) == (prevIndex / 4)) { + if (prevIndex > 15) + prevIndex = 12; } else { - _KeypadWindow._buttons[si].setFrame(1); - _KeypadWindow._buttons[si]._fieldA8 = 0; + prevIndex -= 4; } - si = indx - 4; - if (si < 0) - si += 16; + assert(prevIndex >= 0 && prevIndex < 16); + if (!_KeypadWindow._buttons[prevIndex]._toggled) { + _KeypadWindow._buttons[prevIndex].setFrame(2); + _KeypadWindow._buttons[prevIndex]._toggled = true; + } else { + _KeypadWindow._buttons[prevIndex].setFrame(1); + _KeypadWindow._buttons[prevIndex]._toggled = false; + } - if (_KeypadWindow._buttons[si]._fieldA8 == 0) { - _KeypadWindow._buttons[si].setFrame(2); - _KeypadWindow._buttons[si]._fieldA8 = 1; + prevIndex = indx - 4; + if (prevIndex < 0) + prevIndex += 16; + + assert(prevIndex >= 0 && prevIndex < 16); + if (!_KeypadWindow._buttons[prevIndex]._toggled) { + _KeypadWindow._buttons[prevIndex].setFrame(2); + _KeypadWindow._buttons[prevIndex]._toggled = true; } else { - _KeypadWindow._buttons[si].setFrame(1); - _KeypadWindow._buttons[si]._fieldA8 = 0; + _KeypadWindow._buttons[prevIndex].setFrame(1); + _KeypadWindow._buttons[prevIndex]._toggled = false; } - si = indx + 4; - if (si > 15) - si -= 16; + prevIndex = indx + 4; + if (prevIndex > 15) + prevIndex -= 16; - if (_KeypadWindow._buttons[si]._fieldA8 == 0) { - _KeypadWindow._buttons[si].setFrame(2); - _KeypadWindow._buttons[si]._fieldA8 = 1; + assert(prevIndex >= 0 && prevIndex < 16); + if (!_KeypadWindow._buttons[prevIndex]._toggled) { + _KeypadWindow._buttons[prevIndex].setFrame(2); + _KeypadWindow._buttons[prevIndex]._toggled = true; } else { - _KeypadWindow._buttons[si].setFrame(1); - _KeypadWindow._buttons[si]._fieldA8 = 0; + _KeypadWindow._buttons[prevIndex].setFrame(1); + _KeypadWindow._buttons[prevIndex]._toggled = false; } + // Check whether all the buttons are highlighted int cpt = 0; - for (si = 0; si < 16; si++) { - if (_KeypadWindow._buttons[si]._fieldA8 != 0) + for (prevIndex = 0; prevIndex < 16; prevIndex++) { + if (_KeypadWindow._buttons[prevIndex]._toggled) ++cpt; } @@ -15111,9 +15116,7 @@ void Scene1950::subBF4B4(int indx) { } else { R2_GLOBALS.setFlag(37); _sceneMode = 24; - // TODO: check if correct. The original doesn't countain a sceneActor in - // this call, but it's extremely unusual - setAction(&_sequenceManager, this, 1976, NULL); + setAction(&_sequenceManager, scene, 1976, NULL); } } @@ -15250,7 +15253,7 @@ void Scene1950::signal() { _KeypadWindow.remove(); _sceneMode = 1966; _cube.setFrame(3); - setAction(&_sequenceManager, this, 1966, &_containmentField, &_actor5, NULL); + setAction(&_sequenceManager, this, 1966, &_containmentField, &_gem, NULL); break; case 1951: R2_GLOBALS._sound1.fadeOut2(NULL); @@ -15279,8 +15282,8 @@ void Scene1950::signal() { case 1965: if (!R2_GLOBALS.getFlag(37)) { SceneItem::display(1950, 26, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - R2_GLOBALS._player.enableControl(); } + R2_GLOBALS._player.enableControl(); break; case 1966: _containmentField.remove(); @@ -15291,11 +15294,12 @@ void Scene1950::signal() { _sceneMode = 1965; setAction(&_sequenceManager, this, 1965, &R2_GLOBALS._player, NULL); } - _actor5.setDetails(1950, 9, -1, -1, 2, (SceneItem *) NULL); + _gem.setDetails(1950, 9, -1, -1, 2, (SceneItem *) NULL); + break; case 1967: { _sceneMode = 0; R2_INVENTORY.setObjectScene(R2_SAPPHIRE_BLUE, 2); - _actor5.remove(); + _gem.remove(); if (R2_GLOBALS.getFlag(36)) R2_GLOBALS._player.setVisage(20); else @@ -15308,7 +15312,7 @@ void Scene1950::signal() { } break; case 1968: - R2_GLOBALS._player.disableControl(); + R2_GLOBALS._player.enableControl(); R2_INVENTORY.setObjectScene(R2_ANCIENT_SCROLLS, 2); _scrolls.setFrame(2); if (R2_GLOBALS.getFlag(36)) diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 86e92c550e..96c0ff7451 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1114,8 +1114,8 @@ class Scene1950 : public SceneExt { class KeypadButton : public SceneActor { public: int _buttonIndex; - int _fieldA6; - int _fieldA8; + bool _pressed; + bool _toggled; KeypadButton(); void synchronize(Serializer &s); @@ -1212,7 +1212,7 @@ class Scene1950 : public SceneExt { private: void initArea(); void enterArea(); - void subBF4B4(int indx); + void doButtonPress(int indx); public: NamedHotspot _item1; Keypad _keypad; @@ -1221,7 +1221,7 @@ public: Door _door; Scrolls _scrolls; SceneActor _containmentField; - Actor5 _actor5; + Actor5 _gem; SceneActor _cube; SceneActor _actor7; Vampire _vampire; -- cgit v1.2.3 From f1b0a7740855f9c16c537f161772483a9f850e96 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 22 Sep 2013 15:40:51 +0200 Subject: SCI: fix music start code fixes eq2 bug #3037267 we start at offset 10 for sound SCI1 games. This is hardcoded in the interpreter. Also removing not handling signals on tick 0. This fixes Eco Quest 2 / Gonzales dancing in room 530. Thanks to wjp for the help. --- engines/sci/sound/midiparser_sci.cpp | 34 +++++++++++++++------------------- engines/sci/sound/midiparser_sci.h | 1 + engines/sci/sound/music.cpp | 20 +++++++++++++++++++- 3 files changed, 35 insertions(+), 20 deletions(-) (limited to 'engines') diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index d6ff4f6cc8..83b5bf520f 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -103,6 +103,18 @@ bool MidiParser_SCI::loadMusic(SoundResource::Track *track, MusicEntry *psnd, in return true; } +bool MidiParser_SCI::jumpToOffset(uint32 offset) { + if (_activeTrack >= _numTracks) + return false; + + assert(!_jumpingToTick); // This function must not be called while within MidiParser::jumpToTick() + + resetTracking(); + _position._playPos = _tracks[_activeTrack] + offset; + parseNextEvent(_nextEvent); + return true; +} + byte MidiParser_SCI::midiGetNextChannel(long ticker) { byte curr = 0xFF; long closest = ticker + 1000000, next = 0; @@ -531,25 +543,9 @@ void MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) { case 0xC: if (info.channel() == 0xF) {// SCI special case if (info.basic.param1 != kSetSignalLoop) { - // At least in kq5/french&mac the first scene in the intro has - // a song that sets signal to 4 immediately on tick 0. Signal - // isn't set at that point by sierra sci and it would cause the - // castle daventry text to get immediately removed, so we - // currently filter it. Sierra SCI ignores them as well at that - // time. However, this filtering should only be performed for - // SCI1 and newer games. Signalling is done differently in SCI0 - // though, so ignoring these signals in SCI0 games will result - // in glitches (e.g. the intro of LB1 Amiga gets stuck - bug - // #3297883). Refer to MusicEntry::setSignal() in sound/music.cpp. - // FIXME: SSCI doesn't start playing at the very beginning - // of the stream, but at a fixed location a few commands later. - // That is probably why this signal isn't triggered - // immediately there. - if (_soundVersion <= SCI_VERSION_0_LATE || _position._playTick) { - if (!_jumpingToTick) { - _pSnd->setSignal(info.basic.param1); - debugC(4, kDebugLevelSound, "signal %04x", info.basic.param1); - } + if (!_jumpingToTick) { + _pSnd->setSignal(info.basic.param1); + debugC(4, kDebugLevelSound, "signal %04x", info.basic.param1); } } else { _loopTick = _position._playTick; diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h index 5784dca1ab..098fbc2ccb 100644 --- a/engines/sci/sound/midiparser_sci.h +++ b/engines/sci/sound/midiparser_sci.h @@ -60,6 +60,7 @@ public: bool loadMusic(byte *, uint32) { return false; } + bool jumpToOffset(uint32 offset); void sendInitCommands(); void unloadMusic(); void setMasterVolume(byte masterVolume); diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 8c6d0d6431..fe017868b5 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -518,7 +518,25 @@ void SciMusic::soundPlay(MusicEntry *pSnd) { pSnd->hold = -1; if (pSnd->status == kSoundStopped) - pSnd->pMidiParser->jumpToTick(0); + if (_soundVersion <= SCI_VERSION_0_LATE) { + // SCI0 sound subsystem seems to start at offset 0 + // Not starting at offset 0 for SCI0 games will result + // in glitches (e.g. the intro of LB1 Amiga gets stuck - bug + // #3297883). Refer to MusicEntry::setSignal() in sound/music.cpp. + pSnd->pMidiParser->jumpToOffset(0); + } else { + // SCI1 sound subsystem starts at offset 10 (and also sets loop offset to 0) + // At least in kq5/french&mac the first scene in the intro has + // a song that sets signal to 4 immediately on tick 0. Signal + // isn't set at that point by sierra sci and it would cause the + // castle daventry text to get immediately removed. + // Also Eco Quest 2 Gonzales Dances music (room 530) requires a signal + // to get set exactly at tick 0. We previously didn't handle signals + // on tick 0 for SCI1. Which then resulted in broken dance animations. + // See bug #3037267 + // FIXME: maybe also change looping logic to use offset instead of ticks + pSnd->pMidiParser->jumpToOffset(10); + } else { // Fast forward to the last position and perform associated events when loading pSnd->pMidiParser->jumpToTick(pSnd->ticker, true, true, true); -- cgit v1.2.3 From 551e263165c5906e4fb6b27de3f42d960553bd9e Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 22 Sep 2013 20:13:33 +0200 Subject: SCI: revert fix music start code add workaround for eq2 the issue is known, but can't be properly fixed without rewriting the midiparser into a channel specific parser previous commit caused issues in kq5/french and others --- engines/sci/sound/midiparser_sci.cpp | 57 ++++++++++++++++++++++++++---------- engines/sci/sound/midiparser_sci.h | 1 - engines/sci/sound/music.cpp | 20 +------------ 3 files changed, 43 insertions(+), 35 deletions(-) (limited to 'engines') diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 83b5bf520f..186fc18a5c 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -20,6 +20,9 @@ * */ +#include "sci/sci.h" +#include "sci/engine/state.h" + #include "sci/engine/kernel.h" #include "sci/engine/state.h" #include "sci/sound/midiparser_sci.h" @@ -103,18 +106,6 @@ bool MidiParser_SCI::loadMusic(SoundResource::Track *track, MusicEntry *psnd, in return true; } -bool MidiParser_SCI::jumpToOffset(uint32 offset) { - if (_activeTrack >= _numTracks) - return false; - - assert(!_jumpingToTick); // This function must not be called while within MidiParser::jumpToTick() - - resetTracking(); - _position._playPos = _tracks[_activeTrack] + offset; - parseNextEvent(_nextEvent); - return true; -} - byte MidiParser_SCI::midiGetNextChannel(long ticker) { byte curr = 0xFF; long closest = ticker + 1000000, next = 0; @@ -543,9 +534,45 @@ void MidiParser_SCI::processEvent(const EventInfo &info, bool fireEvents) { case 0xC: if (info.channel() == 0xF) {// SCI special case if (info.basic.param1 != kSetSignalLoop) { - if (!_jumpingToTick) { - _pSnd->setSignal(info.basic.param1); - debugC(4, kDebugLevelSound, "signal %04x", info.basic.param1); + // At least in kq5/french&mac the first scene in the intro has + // a song that sets signal to 4 immediately on tick 0. Signal + // isn't set at that point by sierra sci and it would cause the + // castle daventry text to get immediately removed, so we + // currently filter it. Sierra SCI ignores them as well at that + // time. However, this filtering should only be performed for + // SCI1 and newer games. Signalling is done differently in SCI0 + // though, so ignoring these signals in SCI0 games will result + // in glitches (e.g. the intro of LB1 Amiga gets stuck - bug + // #3297883). Refer to MusicEntry::setSignal() in sound/music.cpp. + // FIXME: SSCI doesn't start playing at the very beginning + // of the stream, but at a fixed location a few commands later. + // That is probably why this signal isn't triggered + // immediately there. + bool skipSignal = false; + if (_soundVersion >= SCI_VERSION_1_EARLY) { + if (!_position._playTick) { + skipSignal = true; + switch (g_sci->getGameId()) { + case GID_ECOQUEST2: + // In Eco Quest 2 room 530 - gonzales is supposed to dance + // WORKAROUND: we need to signal in this case on tick 0 + // this whole issue is complicated and can only be properly fixed by + // changing the whole parser to a per-channel parser. SSCI seems to + // start each channel at offset 13 (may be 10 for us) and only + // starting at offset 0 when the music loops to the initial position. + if (g_sci->getEngineState()->currentRoomNumber() == 530) + skipSignal = false; + break; + default: + break; + } + } + } + if (!skipSignal) { + if (!_jumpingToTick) { + _pSnd->setSignal(info.basic.param1); + debugC(4, kDebugLevelSound, "signal %04x", info.basic.param1); + } } } else { _loopTick = _position._playTick; diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h index 098fbc2ccb..5784dca1ab 100644 --- a/engines/sci/sound/midiparser_sci.h +++ b/engines/sci/sound/midiparser_sci.h @@ -60,7 +60,6 @@ public: bool loadMusic(byte *, uint32) { return false; } - bool jumpToOffset(uint32 offset); void sendInitCommands(); void unloadMusic(); void setMasterVolume(byte masterVolume); diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index fe017868b5..8c6d0d6431 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -518,25 +518,7 @@ void SciMusic::soundPlay(MusicEntry *pSnd) { pSnd->hold = -1; if (pSnd->status == kSoundStopped) - if (_soundVersion <= SCI_VERSION_0_LATE) { - // SCI0 sound subsystem seems to start at offset 0 - // Not starting at offset 0 for SCI0 games will result - // in glitches (e.g. the intro of LB1 Amiga gets stuck - bug - // #3297883). Refer to MusicEntry::setSignal() in sound/music.cpp. - pSnd->pMidiParser->jumpToOffset(0); - } else { - // SCI1 sound subsystem starts at offset 10 (and also sets loop offset to 0) - // At least in kq5/french&mac the first scene in the intro has - // a song that sets signal to 4 immediately on tick 0. Signal - // isn't set at that point by sierra sci and it would cause the - // castle daventry text to get immediately removed. - // Also Eco Quest 2 Gonzales Dances music (room 530) requires a signal - // to get set exactly at tick 0. We previously didn't handle signals - // on tick 0 for SCI1. Which then resulted in broken dance animations. - // See bug #3037267 - // FIXME: maybe also change looping logic to use offset instead of ticks - pSnd->pMidiParser->jumpToOffset(10); - } + pSnd->pMidiParser->jumpToTick(0); else { // Fast forward to the last position and perform associated events when loading pSnd->pMidiParser->jumpToTick(pSnd->ticker, true, true, true); -- cgit v1.2.3 From e24021e9acd2c6692d7c55bd5302030ca21497d0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 22 Sep 2013 15:39:47 -0400 Subject: TSAGE: Further bugfix and renaming for R2R Flub maze --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 43 +++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes1.h | 14 ++++---- 2 files changed, 29 insertions(+), 28 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 1caecc7087..a412c5efc6 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -13717,7 +13717,7 @@ bool Scene1950::Scrolls::startAction(CursorType action, Event &event) { return true; } -bool Scene1950::Actor5::startAction(CursorType action, Event &event) { +bool Scene1950::Gem::startAction(CursorType action, Event &event) { if ((action != CURSOR_USE) || (!R2_GLOBALS.getFlag(37))) return SceneActor::startAction(action, event); @@ -14007,7 +14007,7 @@ void Scene1950::WestExit::changeScene() { } } -void Scene1950::Exit7::changeScene() { +void Scene1950::ShaftExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -14017,7 +14017,7 @@ void Scene1950::Exit7::changeScene() { scene->setAction(&scene->_sequenceManager, scene, 1951, &R2_GLOBALS._player, NULL); } -void Scene1950::Exit8::changeScene() { +void Scene1950::DoorExit::changeScene() { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -14065,24 +14065,24 @@ void Scene1950::initArea() { _downExit._enabled = false; _southExit._enabled = false; _westExit._enabled = false; - _exit7._enabled = false; - _exit8._enabled = false; + _shaftExit._enabled = false; + _doorExit._enabled = false; _northExit._insideArea = false; _upExit._insideArea = false; _eastExit._insideArea = false; _downExit._insideArea = false; _southExit._insideArea = false; _westExit._insideArea = false; - _exit7._insideArea = false; - _exit8._insideArea = false; + _shaftExit._insideArea = false; + _doorExit._insideArea = false; _northExit._moving = false; _upExit._moving = false; _eastExit._moving = false; _downExit._moving = false; _southExit._moving = false; _westExit._moving = false; - _exit7._moving = false; - _exit8._moving = false; + _shaftExit._moving = false; + _doorExit._moving = false; _field412 = 0; switch (R2_GLOBALS._flubMazeArea - 1) { @@ -14321,9 +14321,9 @@ void Scene1950::initArea() { switch (R2_GLOBALS._flubMazeArea - 1) { case 0: - _exit7._enabled = true; + _shaftExit._enabled = true; if ((R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) && (R2_INVENTORY.getObjectScene(R2_SAPPHIRE_BLUE) == 1950)) - _exit8._enabled = true; + _doorExit._enabled = true; R2_GLOBALS._walkRegions.disableRegion(2); R2_GLOBALS._walkRegions.disableRegion(3); R2_GLOBALS._walkRegions.disableRegion(4); @@ -14927,7 +14927,8 @@ void Scene1950::enterArea() { _actor7.remove(); _scrolls.remove(); - _item1.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 2, NULL); + R2_GLOBALS._sceneItems.remove(&_background); + _background.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 2, NULL); } switch (R2_GLOBALS._flubMazeEntryDirection) { @@ -15150,11 +15151,11 @@ void Scene1950::postInit(SceneObjectList *OwnerList) { _westExit.setDetails(Rect(0, 95, 14, 147), EXITCURSOR_W, 1950); _westExit.setDest(Common::Point(7, 160)); - _exit7.setDetails(Rect(72, 54, 120, 128), EXITCURSOR_NW, 1950); - _exit7.setDest(Common::Point(120, 140)); + _shaftExit.setDetails(Rect(72, 54, 120, 128), EXITCURSOR_NW, 1950); + _shaftExit.setDest(Common::Point(120, 140)); - _exit8.setDetails(Rect(258, 60, 300, 145), EXITCURSOR_NE, 1950); - _exit8.setDest(Common::Point(268, 149)); + _doorExit.setDetails(Rect(258, 60, 300, 145), EXITCURSOR_NE, 1950); + _doorExit.setDest(Common::Point(268, 149)); R2_GLOBALS._player.postInit(); if ( (R2_INVENTORY.getObjectScene(R2_TANNER_MASK) == 0) && (R2_INVENTORY.getObjectScene(R2_PURE_GRAIN_ALCOHOL) == 0) @@ -15164,7 +15165,7 @@ void Scene1950::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setVisage(20); R2_GLOBALS._player._moveDiff = Common::Point(5, 3); - _item1.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 1, NULL); enterArea(); } @@ -15263,13 +15264,13 @@ void Scene1950::signal() { SceneItem::display(1950, 24, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_WALK); - _exit8._enabled = true; + _doorExit._enabled = true; break; case 1959: R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, 0); R2_GLOBALS._v56AAB = 0; R2_GLOBALS._player.enableControl(CURSOR_WALK); - _exit8._enabled = true; + _doorExit._enabled = true; break; case 1962: // No break on purpose @@ -15336,8 +15337,8 @@ void Scene1950::process(Event &event) { && (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0)) { event.handled = true; R2_GLOBALS._player.disableControl(); - _exit7._enabled = false; - _exit8._enabled = false; + _shaftExit._enabled = false; + _doorExit._enabled = false; _sceneMode = 1959; setAction(&_sequenceManager, this, 1959, &R2_GLOBALS._player, NULL); } diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 96c0ff7451..f72260bc00 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -1156,7 +1156,7 @@ class Scene1950 : public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor5 : public SceneActor { + class Gem : public SceneActor { public: virtual bool startAction(CursorType action, Event &event); }; @@ -1201,11 +1201,11 @@ class Scene1950 : public SceneExt { public: virtual void changeScene(); }; - class Exit7 : public SceneExit { + class ShaftExit : public SceneExit { public: virtual void changeScene(); }; - class Exit8 : public SceneExit { + class DoorExit : public SceneExit { public: virtual void changeScene(); }; @@ -1214,14 +1214,14 @@ private: void enterArea(); void doButtonPress(int indx); public: - NamedHotspot _item1; + NamedHotspot _background; Keypad _keypad; SceneActor _southDoorway; SceneObject _northDoorway; Door _door; Scrolls _scrolls; SceneActor _containmentField; - Actor5 _gem; + Gem _gem; SceneActor _cube; SceneActor _actor7; Vampire _vampire; @@ -1232,8 +1232,8 @@ public: DownExit _downExit; SouthExit _southExit; WestExit _westExit; - Exit7 _exit7; - Exit8 _exit8; + ShaftExit _shaftExit; + DoorExit _doorExit; SequenceManager _sequenceManager; int _field412; -- cgit v1.2.3 From d721e12d9e27ac5695f10962fbe512854544a400 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 22 Sep 2013 17:52:48 -0400 Subject: TSAGE: Bugfixes and renaming for R2R cell and surrounds --- engines/tsage/ringworld2/ringworld2_logic.cpp | 20 +- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 434 ++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes3.h | 90 +++-- 3 files changed, 277 insertions(+), 267 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 1b402b0d0c..ea083d00f8 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -267,10 +267,10 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { case 3255: return new Scene3255(); case 3260: - // Computer room + // ARM Base - Computer room return new Scene3260(); case 3275: - // Hall + // ARM Base - Hall return new Scene3275(); case 3350: // Cutscene - Ship landing @@ -1351,10 +1351,13 @@ void SceneArea::remove() { } void SceneArea::process(Event &event) { + Common::Point mousePos = event.mousePos; + mousePos.x += R2_GLOBALS._sceneManager._scene->_sceneBounds.left; + if (!R2_GLOBALS._insetUp && _enabled && R2_GLOBALS._events.isCursorVisible()) { CursorType cursor = R2_GLOBALS._events.getCursor(); - if (_bounds.contains(event.mousePos)) { + if (_bounds.contains(mousePos)) { // Cursor moving in bounded area if (cursor != _cursorNum) { _savedCursorNum = cursor; @@ -1362,7 +1365,7 @@ void SceneArea::process(Event &event) { R2_GLOBALS._events.setCursor(_cursorNum); } _insideArea = true; - } else if ((event.mousePos.y < 171) && _insideArea && (_cursorNum == cursor) && + } else if ((mousePos.y < 171) && _insideArea && (_cursorNum == cursor) && (_savedCursorNum != CURSOR_NONE)) { // Cursor moved outside bounded area R2_GLOBALS._events.setCursor(_savedCursorNum); @@ -1402,20 +1405,23 @@ void SceneExit::changeScene() { } void SceneExit::process(Event &event) { + Common::Point mousePos = event.mousePos; + mousePos.x += R2_GLOBALS._sceneManager._scene->_sceneBounds.left; + if (!R2_GLOBALS._insetUp) { SceneArea::process(event); if (_enabled) { if (event.eventType == EVENT_BUTTON_DOWN) { - if (!_bounds.contains(event.mousePos)) + if (!_bounds.contains(mousePos)) _moving = false; else if (!R2_GLOBALS._player._canWalk) { _moving = false; changeScene(); event.handled = true; } else { - Common::Point dest((_destPos.x == -1) ? event.mousePos.x : _destPos.x, - (_destPos.y == -1) ? event.mousePos.y : _destPos.y); + Common::Point dest((_destPos.x == -1) ? mousePos.x : _destPos.x, + (_destPos.y == -1) ? mousePos.y : _destPos.y); ADD_PLAYER_MOVER(dest.x, dest.y); _moving = true; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 3b83e96b7b..e70a67d817 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -374,7 +374,8 @@ void Scene3125::dispatch() { * Scene 3150 - Jail * *--------------------------------------------------------------------------*/ -bool Scene3150::Item5::startAction(CursorType action, Event &event) { + +bool Scene3150::LightFixture::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -384,16 +385,16 @@ bool Scene3150::Item5::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3154; - scene->setAction(&scene->_sequenceManager, scene, 3154, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3154, &R2_GLOBALS._player, &scene->_bulbOrWire, NULL); return true; case R2_SUPERCONDUCTOR_WIRE: if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && (R2_GLOBALS.getFlag(75))) { R2_GLOBALS._player.disableControl(); - scene->_actor3.postInit(); - scene->_actor3._effect = 3; - scene->_actor3._shade = 5; + scene->_bulbOrWire.postInit(); + scene->_bulbOrWire._effect = 3; + scene->_bulbOrWire._shade = 5; scene->_sceneMode = 3155; - scene->setAction(&scene->_sequenceManager, scene, 3155, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3155, &R2_GLOBALS._player, &scene->_bulbOrWire, NULL); } else { SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } @@ -404,39 +405,42 @@ bool Scene3150::Item5::startAction(CursorType action, Event &event) { } } -bool Scene3150::Item6::startAction(CursorType action, Event &event) { +bool Scene3150::Toilet::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; switch (action) { case R2_PILLOW: R2_GLOBALS._player.disableControl(); - scene->_actor4.postInit(); - scene->_actor4._effect = 6; - scene->_actor4._shade = 3; + scene->_water.postInit(); + scene->_water._effect = 6; + scene->_water._shade = 3; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3158; - scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_water, NULL); return true; case R2_FOOD_TRAY: - if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) && (R2_GLOBALS.getFlag(75))) { - scene->_actor5.postInit(); - scene->_actor5._effect = 6; - scene->_actor5._shade = 3; - scene->_actor5.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); + if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && + (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) + && (R2_GLOBALS.getFlag(75))) { + scene->_foodTray.postInit(); + scene->_foodTray._effect = 6; + scene->_foodTray._shade = 3; + scene->_foodTray.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3159; - scene->setAction(&scene->_sequenceManager, scene, 3159, &R2_GLOBALS._player, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3159, &R2_GLOBALS._player, &scene->_foodTray, NULL); } else { SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } + return true; default: return SceneHotspot::startAction(action, event); break; } } -bool Scene3150::Actor4::startAction(CursorType action, Event &event) { +bool Scene3150::Water::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -446,7 +450,7 @@ bool Scene3150::Actor4::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3151; - scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_water, NULL); return true; case R2_FOOD_TRAY: return false; @@ -456,15 +460,15 @@ bool Scene3150::Actor4::startAction(CursorType action, Event &event) { } } -bool Scene3150::Actor5::startAction(CursorType action, Event &event) { +bool Scene3150::FoodTray::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; if ((action != CURSOR_USE) || (R2_GLOBALS.getFlag(77))) - return SceneActor::startAction(action ,event); + return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3157; - scene->setAction(&scene->_sequenceManager, scene, 3157, &R2_GLOBALS._player, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3157, &R2_GLOBALS._player, &scene->_foodTray, NULL); return true; } @@ -480,7 +484,7 @@ bool Scene3150::Actor6::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, NULL); } else { scene->_sceneMode = 3153; - scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, &scene->_water, NULL); } } else { SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); @@ -496,20 +500,20 @@ bool Scene3150::Actor6::startAction(CursorType action, Event &event) { } } -bool Scene3150::Actor7::startAction(CursorType action, Event &event) { +bool Scene3150::AirVent::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; if ((action == R2_LASER_HACKSAW) && (!R2_GLOBALS.getFlag(80))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3160; - scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_actor7, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_airVent, NULL); return true; } return SceneActor::startAction(action, event); } -void Scene3150::Exit1::changeScene() { +void Scene3150::DoorExit::changeScene() { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -522,7 +526,7 @@ void Scene3150::Exit1::changeScene() { R2_GLOBALS._player.addMover(mover, &pt, scene); } -void Scene3150::Exit2::changeScene() { +void Scene3150::VentExit::changeScene() { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; _enabled = false; @@ -544,120 +548,120 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); if (R2_GLOBALS.getFlag(78)) { - _exit1.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); - _exit1.setDest(Common::Point(70, 125)); + _doorExit.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); + _doorExit.setDest(Common::Point(70, 125)); } if (R2_GLOBALS.getFlag(80)) { - _exit2.setDetails(Rect(249, 36, 279, 60), EXITCURSOR_NE, 3150); - _exit2.setDest(Common::Point(241, 106)); + _ventExit.setDetails(Rect(249, 36, 279, 60), EXITCURSOR_NE, 3150); + _ventExit.setDest(Common::Point(241, 106)); } R2_GLOBALS._player.postInit(); R2_GLOBALS._player.disableControl(); - _actor2.postInit(); - _actor2.setPosition(Common::Point(64, 139)); + _doorBars.postInit(); + _doorBars.setPosition(Common::Point(64, 139)); if (R2_GLOBALS.getFlag(78)) { - _actor2.setup(3151, 1, 5); - _actor2.fixPriority(125); + _doorBars.setup(3151, 1, 5); + _doorBars.fixPriority(125); } else { - _actor2.setup(3151, 1, 1); - _actor2.setDetails(3150, 8, -1, 9, 1, (SceneItem *)NULL); + _doorBars.setup(3151, 1, 1); + _doorBars.setDetails(3150, 8, -1, 9, 1, (SceneItem *)NULL); } if (R2_GLOBALS.getFlag(78)) { - _actor1.postInit(); - _actor1.setup(3154, 1, 16); - _actor1.setPosition(Common::Point(104, 129)); - _actor1._effect = 6; - _actor1._shade = 3; - _actor1.setDetails(3150, 24, -1, -1, -1, (SceneItem *)NULL); + _guard.postInit(); + _guard.setup(3154, 1, 16); + _guard.setPosition(Common::Point(104, 129)); + _guard._effect = 6; + _guard._shade = 3; + _guard.setDetails(3150, 24, -1, -1, -1, (SceneItem *)NULL); } - _actor7.postInit(); - _actor7.setup(3154, 5, 1); + _airVent.postInit(); + _airVent.setup(3154, 5, 1); if (R2_GLOBALS.getFlag(80)) - _actor7.setPosition(Common::Point(264, 108)); + _airVent.setPosition(Common::Point(264, 108)); else - _actor7.setPosition(Common::Point(264, 58)); - _actor7.fixPriority(50); - _actor7.setDetails(3150, 17, -1, 19, 1, (SceneItem *)NULL); + _airVent.setPosition(Common::Point(264, 58)); + _airVent.fixPriority(50); + _airVent.setDetails(3150, 17, -1, 19, 1, (SceneItem *)NULL); if (R2_INVENTORY.getObjectScene(R2_PILLOW) == 3150) { - _actor4.postInit(); + _water.postInit(); if (R2_GLOBALS.getFlag(75)) { if (R2_GLOBALS.getFlag(76)) { R2_GLOBALS._walkRegions.disableRegion(1); R2_GLOBALS._walkRegions.disableRegion(4); R2_GLOBALS._walkRegions.disableRegion(5); R2_GLOBALS._walkRegions.disableRegion(6); - _actor4.setup(3152, 4, 10); - _actor4.setDetails(3150, 14, -1, -1, 1, (SceneItem *)NULL); + _water.setup(3152, 4, 10); + _water.setDetails(3150, 14, -1, -1, 1, (SceneItem *)NULL); } else { - _actor4.setup(3152, 7, 4); - _actor4.setDetails(3150, 13, -1, -1, 1, (SceneItem *)NULL); + _water.setup(3152, 7, 4); + _water.setDetails(3150, 13, -1, -1, 1, (SceneItem *)NULL); } - _actor4.fixPriority(110); - _actor4.setPosition(Common::Point(83, 88)); - _actor4._effect = 6; - _actor4._shade = 3; + _water.fixPriority(110); + _water.setPosition(Common::Point(83, 88)); + _water._effect = 6; + _water._shade = 3; } else { - _actor4.setup(3152, 7, 3); - _actor4.setPosition(Common::Point(143, 70)); - _actor4.setDetails(3150, 15, -1, -1, 1, (SceneItem *)NULL); + _water.setup(3152, 7, 3); + _water.setPosition(Common::Point(143, 70)); + _water.setDetails(3150, 15, -1, -1, 1, (SceneItem *)NULL); } } if (R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) == 3150) { - _actor3.postInit(); - _actor3.setup(3152, 7, 1); - _actor3.setPosition(Common::Point(73, 83)); + _bulbOrWire.postInit(); + _bulbOrWire.setup(3152, 7, 1); + _bulbOrWire.setPosition(Common::Point(73, 83)); } if (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) { - _actor3.postInit(); - _actor3.setup(3152, 7, 3); - _actor3.setPosition(Common::Point(70, 55)); - _actor3.fixPriority(111); - _actor3._effect = 6; - _actor3._shade = 5; + _bulbOrWire.postInit(); + _bulbOrWire.setup(3152, 7, 3); + _bulbOrWire.setPosition(Common::Point(70, 55)); + _bulbOrWire.fixPriority(111); + _bulbOrWire._effect = 6; + _bulbOrWire._shade = 5; } if (R2_INVENTORY.getObjectScene(R2_FOOD_TRAY) == 3150) { - _actor5.postInit(); + _foodTray.postInit(); if (R2_GLOBALS.getFlag(77)) { - _actor5.setup(3152, 7, 8); - _actor5.setPosition(Common::Point(82, 92)); - _actor5.fixPriority(111); - _actor5._effect = 6; - _actor5._shade = 3; + _foodTray.setup(3152, 7, 8); + _foodTray.setPosition(Common::Point(82, 92)); + _foodTray.fixPriority(111); + _foodTray._effect = 6; + _foodTray._shade = 3; } else { - _actor5.setup(3152, 7, 7); - _actor5.setPosition(Common::Point(155, 79)); + _foodTray.setup(3152, 7, 7); + _foodTray.setPosition(Common::Point(155, 79)); } - _actor5.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); + _foodTray.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); } - _actor6.postInit(); - _actor6.setup(3152, 7, 6); - _actor6.setPosition(Common::Point(98, 73)); - _actor6.setDetails(3150, 43, -1, -1, 1, (SceneItem *)NULL); + _toiletFlush.postInit(); + _toiletFlush.setup(3152, 7, 6); + _toiletFlush.setPosition(Common::Point(98, 73)); + _toiletFlush.setDetails(3150, 43, -1, -1, 1, (SceneItem *)NULL); - _item2.setDetails(12, 3150, 10, -1, 12); - _item3.setDetails(Rect(186, 17, 210, 36), 3150, 6, -1, -1, 1, NULL); - _item4.setDetails(Rect(61, 21, 92, 41), 3150, 7, -1, -1, 1, NULL); - _item5.setDetails(Rect(63, 48, 78, 58), 3150, 6, -1, -1, 1, NULL); - _item6.setDetails(Rect(63, 81, 100, 95), 3150, 3, 4, -1, 1, NULL); - _item1.setDetails(Rect(0, 0, 200, 320), 3150, 0, 1, 2, 1, NULL); + _bed.setDetails(12, 3150, 10, -1, 12); + _lightFixture2.setDetails(Rect(186, 17, 210, 36), 3150, 6, -1, -1, 1, NULL); + _bars.setDetails(Rect(61, 21, 92, 41), 3150, 7, -1, -1, 1, NULL); + _lightFixture.setDetails(Rect(63, 48, 78, 58), 3150, 6, -1, -1, 1, NULL); + _toilet.setDetails(Rect(63, 81, 100, 95), 3150, 3, 4, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 200, 320), 3150, 0, 1, 2, 1, NULL); - switch (R2_GLOBALS._player._oldCharacterScene[3]) { + switch (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA]) { case 0: _sceneMode = 3150; - _actor1.postInit(); - _actor1._effect = 6; - _actor1._shade = 5; - setAction(&_sequenceManager, this, 3150, &R2_GLOBALS._player, &_actor1, &_actor2, NULL); + _guard.postInit(); + _guard._effect = 6; + _guard._shade = 5; + setAction(&_sequenceManager, this, 3150, &R2_GLOBALS._player, &_guard, &_doorBars, NULL); break; case 1200: _sceneMode = 3162; @@ -679,16 +683,16 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { if ((R2_GLOBALS._v56AA0 == 1) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2000) && (R2_GLOBALS._player._oldCharacterScene[R2_QUINN] == 3100)) { ++R2_GLOBALS._v56AA0; _sceneMode = 3156; - _actor1.postInit(); - _actor1._effect = 6; - _actor1._shade = 3; + _guard.postInit(); + _guard._effect = 6; + _guard._shade = 3; - _actor2.postInit(); - _actor5.postInit(); - _actor5._effect = 6; - _actor5._shade = 3; + _doorBars.postInit(); + _foodTray.postInit(); + _foodTray._effect = 6; + _foodTray._shade = 3; - setAction(&_sequenceManager, this, 3156, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor5, NULL); + setAction(&_sequenceManager, this, 3156, &R2_GLOBALS._player, &_guard, &_doorBars, &_foodTray, NULL); } else { if (R2_GLOBALS._v56AA0 != 2) ++R2_GLOBALS._v56AA0; @@ -713,20 +717,20 @@ void Scene3150::signal() { R2_GLOBALS._sceneManager.changeScene(1200); break; case 3151: - _actor1.remove(); + _guard.remove(); R2_INVENTORY.setObjectScene(R2_PILLOW, 3); R2_GLOBALS._player.enableControl(); break; case 3153: R2_GLOBALS.setFlag(76); - _actor4.setDetails(3150, 14, -1, -1, 3, (SceneItem *)NULL); - _actor1.postInit(); - _actor1.setDetails(3150, 24, -1, -1, 2, (SceneItem *)NULL); + _water.setDetails(3150, 14, -1, -1, 3, (SceneItem *)NULL); + _guard.postInit(); + _guard.setDetails(3150, 24, -1, -1, 2, (SceneItem *)NULL); _sceneMode = 3161; - setAction(&_sequenceManager, this, 3161, &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 3161, &_guard, &_doorBars, NULL); break; case 3154: - _actor3.remove(); + _bulbOrWire.remove(); R2_INVENTORY.setObjectScene(R2_LIGHT_BULB, 3); R2_GLOBALS._player.enableControl(); break; @@ -735,20 +739,20 @@ void Scene3150::signal() { R2_GLOBALS._player.enableControl(); break; case 3156: - _actor5.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); + _foodTray.setDetails(3150, 30, -1, -1, 2, (SceneItem *)NULL); R2_INVENTORY.setObjectScene(R2_FOOD_TRAY, 3150); R2_GLOBALS._player.enableControl(); break; case 3157: - _actor5.remove(); + _foodTray.remove(); R2_INVENTORY.setObjectScene(R2_FOOD_TRAY, 3); R2_GLOBALS._player.enableControl(); break; case 3158: R2_GLOBALS.setFlag(75); R2_INVENTORY.setObjectScene(R2_PILLOW, 3150); - _actor4.fixPriority(110); - _actor4.setDetails(3150, 13, -1, -1, 2, (SceneItem *)NULL); + _water.fixPriority(110); + _water.setDetails(3150, 13, -1, -1, 2, (SceneItem *)NULL); R2_GLOBALS._player.enableControl(); break; case 3159: @@ -762,9 +766,9 @@ void Scene3150::signal() { R2_GLOBALS._sceneManager.changeScene(1200); break; case 3161: - R2_GLOBALS._sceneItems.remove(&_actor2); - _exit1.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); - _exit1.setDest(Common::Point(70, 125)); + R2_GLOBALS._sceneItems.remove(&_doorBars); + _doorExit.setDetails(Rect(0, 135, 60, 168), EXITCURSOR_SW, 3275); + _doorExit.setDest(Common::Point(70, 125)); R2_GLOBALS._walkRegions.disableRegion(1); R2_GLOBALS._walkRegions.disableRegion(4); R2_GLOBALS._walkRegions.disableRegion(5); @@ -779,14 +783,14 @@ void Scene3150::signal() { } void Scene3150::dispatch() { - if (_actor5._position.x == 155) { - _actor5._effect = 0; - _actor5._shade = 0; + if (_foodTray._position.x == 155) { + _foodTray._effect = 0; + _foodTray._shade = 0; } - if (_actor1._visage == 3154) { - _actor1._effect = 0; - _actor1._shade = 0; + if (_guard._visage == 3154) { + _guard._effect = 0; + _guard._shade = 0; } Scene::dispatch(); @@ -796,6 +800,7 @@ void Scene3150::dispatch() { * Scene 3175 - Autopsy room * *--------------------------------------------------------------------------*/ + bool Scene3175::Item1::startAction(CursorType action, Event &event) { Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; @@ -1366,7 +1371,8 @@ void Scene3255::dispatch() { * Scene 3260 - Computer room * *--------------------------------------------------------------------------*/ -bool Scene3260::Actor13::startAction(CursorType action, Event &event) { + +bool Scene3260::Door::startAction(CursorType action, Event &event) { Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -1374,11 +1380,11 @@ bool Scene3260::Actor13::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3271; - scene->setAction(&scene->_sequenceManager, scene, 3271, &R2_GLOBALS._player, &scene->_actor13, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3271, &R2_GLOBALS._player, &scene->_door, NULL); return true; } -bool Scene3260::Actor14::startAction(CursorType action, Event &event) { +bool Scene3260::Toolbox::startAction(CursorType action, Event &event) { Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -1386,7 +1392,7 @@ bool Scene3260::Actor14::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3272; - scene->setAction(&scene->_sequenceManager, scene, 3272, &R2_GLOBALS._player, &scene->_actor14, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3272, &R2_GLOBALS._player, &scene->_toolbox, NULL); return true; } @@ -1403,53 +1409,53 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); R2_GLOBALS._sound1.play(285); - _actor13.postInit(); - _actor13.setup(3260, 6, 1); - _actor13.setPosition(Common::Point(40, 106)); - _actor13.setDetails(3260, 18, 1, -1, 1, (SceneItem *)NULL); + _door.postInit(); + _door.setup(3260, 6, 1); + _door.setPosition(Common::Point(40, 106)); + _door.setDetails(3260, 18, 1, -1, 1, (SceneItem *)NULL); if (R2_INVENTORY.getObjectScene(R2_TOOLBOX) == 3260) { - _actor14.postInit(); - _actor14.setup(3260, 7, 1); - _actor14.setPosition(Common::Point(202, 66)); - _actor14.setDetails(3260, 12, 1, -1, 1, (SceneItem *)NULL); + _toolbox.postInit(); + _toolbox.setup(3260, 7, 1); + _toolbox.setPosition(Common::Point(202, 66)); + _toolbox.setDetails(3260, 12, 1, -1, 1, (SceneItem *)NULL); } - _actor1.postInit(); - _actor1.setup(3260, 1, 1); - _actor1.setPosition(Common::Point(93, 73)); - _actor1.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor1.setAction(&_action1, &_actor1); - - _actor2.postInit(); - _actor2.setup(3260, 2, 1); - _actor2.setPosition(Common::Point(142, 63)); - _actor2.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor2.setAction(&_action2, &_actor2); - - _actor3.postInit(); - _actor3.setup(3260, 2, 1); - _actor3.setPosition(Common::Point(166, 54)); - _actor3.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor3.setAction(&_action3, &_actor3); - - _actor4.postInit(); - _actor4.setup(3260, 2, 1); - _actor4.setPosition(Common::Point(190, 46)); - _actor4.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor4.setAction(&_action4, &_actor4); - - _actor5.postInit(); - _actor5.setup(3260, 2, 1); - _actor5.setPosition(Common::Point(142, 39)); - _actor5.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor5.setAction(&_action5, &_actor5); - - _actor6.postInit(); - _actor6.setup(3260, 2, 1); - _actor6.setPosition(Common::Point(166, 30)); - _actor6.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); - _actor6.setAction(&_action6, &_actor6); + _sceeen1.postInit(); + _sceeen1.setup(3260, 1, 1); + _sceeen1.setPosition(Common::Point(93, 73)); + _sceeen1.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _sceeen1.setAction(&_action1, &_sceeen1); + + _screen2.postInit(); + _screen2.setup(3260, 2, 1); + _screen2.setPosition(Common::Point(142, 63)); + _screen2.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen2.setAction(&_action2, &_screen2); + + _screen3.postInit(); + _screen3.setup(3260, 2, 1); + _screen3.setPosition(Common::Point(166, 54)); + _screen3.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen3.setAction(&_action3, &_screen3); + + _screen4.postInit(); + _screen4.setup(3260, 2, 1); + _screen4.setPosition(Common::Point(190, 46)); + _screen4.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen4.setAction(&_action4, &_screen4); + + _screen5.postInit(); + _screen5.setup(3260, 2, 1); + _screen5.setPosition(Common::Point(142, 39)); + _screen5.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen5.setAction(&_action5, &_screen5); + + _screen6.postInit(); + _screen6.setup(3260, 2, 1); + _screen6.setPosition(Common::Point(166, 30)); + _screen6.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); + _screen6.setAction(&_action6, &_screen6); _actor7.postInit(); _actor7.setup(3260, 2, 1); @@ -1469,37 +1475,37 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { _actor9.setDetails(3260, 3, 1, 5, 1, (SceneItem *)NULL); _actor9.setAction(&_action9, &_actor9); - _actor10.postInit(); - _actor10.setup(3260, 3, 1); - _actor10.setPosition(Common::Point(265, 163)); - _actor10.fixPriority(180); - _actor10._numFrames = 10; - _actor10.setDetails(3260, 6, 1, 8, 1, (SceneItem *)NULL); - _actor10.animate(ANIM_MODE_2, NULL); - - _actor11.postInit(); - _actor11.setup(3260, 4, 1); - _actor11.setPosition(Common::Point(127, 108)); - _actor11.fixPriority(120); - _actor11.setAction(&_action11, &_actor11); - _actor11._numFrames = 15; - _actor11.setDetails(3260, 6, 1, 8, 1, (SceneItem *)NULL); - _actor11.animate(ANIM_MODE_2, NULL); - - _actor12.postInit(); - _actor12.setup(3260, 5, 1); - _actor12.setPosition(Common::Point(274, 65)); - _actor12.setAction(&_action12, &_actor12); - _actor12._numFrames = 5; - _actor12.setDetails(3260, 9, 1, 11, 1, (SceneItem *)NULL); - _actor12.animate(ANIM_MODE_2, NULL); + _securityConsole.postInit(); + _securityConsole.setup(3260, 3, 1); + _securityConsole.setPosition(Common::Point(265, 163)); + _securityConsole.fixPriority(180); + _securityConsole._numFrames = 10; + _securityConsole.setDetails(3260, 6, 1, 8, 1, (SceneItem *)NULL); + _securityConsole.animate(ANIM_MODE_2, NULL); + + _computerConsole.postInit(); + _computerConsole.setup(3260, 4, 1); + _computerConsole.setPosition(Common::Point(127, 108)); + _computerConsole.fixPriority(120); + _computerConsole.setAction(&_action11, &_computerConsole); + _computerConsole._numFrames = 15; + _computerConsole.setDetails(3260, 6, 1, 8, 1, (SceneItem *)NULL); + _computerConsole.animate(ANIM_MODE_2, NULL); + + _lightingConsole.postInit(); + _lightingConsole.setup(3260, 5, 1); + _lightingConsole.setPosition(Common::Point(274, 65)); + _lightingConsole.setAction(&_action12, &_lightingConsole); + _lightingConsole._numFrames = 5; + _lightingConsole.setDetails(3260, 9, 1, 11, 1, (SceneItem *)NULL); + _lightingConsole.animate(ANIM_MODE_2, NULL); _item1.setDetails(Rect(0, 0, 320, 200), 3260, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); if (R2_GLOBALS._player._oldCharacterScene[3] == 3275) { _sceneMode = 3270; - setAction(&_sequenceManager, this, 3270, &R2_GLOBALS._player, &_actor13, NULL); + setAction(&_sequenceManager, this, 3270, &R2_GLOBALS._player, &_door, NULL); } else { R2_GLOBALS._player.setup(30, 5, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -1522,15 +1528,15 @@ void Scene3260::signal() { break; case 3272: _sceneMode = 3273; - R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + R2_GLOBALS._events.setCursor(CURSOR_WALK); SceneItem::display(3260, 15, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); R2_GLOBALS._player.disableControl(); R2_INVENTORY.setObjectScene(R2_TOOLBOX, 3); R2_INVENTORY.setObjectScene(R2_LASER_HACKSAW, 3); - setAction(&_sequenceManager, this, 3273, &R2_GLOBALS._player, &_actor14, NULL); + setAction(&_sequenceManager, this, 3273, &R2_GLOBALS._player, &_toolbox, NULL); break; case 3273: - _actor4.remove(); + _screen4.remove(); R2_GLOBALS._player.enableControl(); break; default: @@ -1543,7 +1549,8 @@ void Scene3260::signal() { * Scene 3275 - Hall * *--------------------------------------------------------------------------*/ -bool Scene3275::Actor2::startAction(CursorType action, Event &event) { + +bool Scene3275::Door::startAction(CursorType action, Event &event) { Scene3275 *scene = (Scene3275 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -1551,11 +1558,11 @@ bool Scene3275::Actor2::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3275; - scene->setAction(&scene->_sequenceManager, scene, 3275, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3275, &R2_GLOBALS._player, &scene->_door, NULL); return true; } -void Scene3275::Exit1::changeScene() { +void Scene3275::CellExit::changeScene() { Scene3275 *scene = (Scene3275 *)R2_GLOBALS._sceneManager._scene; scene->_sceneMode = 0; @@ -1574,28 +1581,26 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sceneManager._previousScene = 3260; if (R2_GLOBALS._sceneManager._previousScene == 3150) - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); - else - g_globals->gfxManager()._bounds.moveTo(Common::Point(0, 0)); + _sceneBounds = Rect(160, 0, 480, 200); SceneExt::postInit(); - _exit1.setDetails(Rect(398, 60, 439, 118), SHADECURSOR_UP, 3150); - _exit1.setDest(Common::Point(418, 128)); + _cellExit.setDetails(Rect(398, 60, 439, 118), SHADECURSOR_UP, 3150); + _cellExit.setDest(Common::Point(418, 128)); _actor1.postInit(); _actor1.setup(3275, 1, 7); _actor1.setPosition(Common::Point(419, 119)); - _actor2.postInit(); - _actor2.setup(3275, 2, 1); - _actor2.setPosition(Common::Point(56, 118)); - _actor2.setDetails(3275, 3, 4, -1, 1, (SceneItem *)NULL); + _door.postInit(); + _door.setup(3275, 2, 1); + _door.setPosition(Common::Point(56, 118)); + _door.setDetails(3275, 3, 4, -1, 1, (SceneItem *)NULL); - _item2.setDetails(Rect(153, 58, 200, 120), 3275, 6, 7, 8, 1, NULL); - _item3.setDetails(Rect(275, 58, 331, 120), 3275, 6, 7, 8, 1, NULL); - _item4.setDetails(Rect(0, 66, 22, 127), 3275, 9, 10, 11, 1, NULL); - _item5.setDetails(Rect(457, 66, 480, 127), 3275, 9, 10, 11, 1, NULL); - _item1.setDetails(Rect(0, 0, 480, 200), 3275, 0, 1, 2, 1, NULL); + _emptyCell1.setDetails(Rect(153, 58, 200, 120), 3275, 6, 7, 8, 1, NULL); + _emptyCell2.setDetails(Rect(275, 58, 331, 120), 3275, 6, 7, 8, 1, NULL); + _securityBeams1.setDetails(Rect(0, 66, 22, 127), 3275, 9, 10, 11, 1, NULL); + _securityBeams2.setDetails(Rect(457, 66, 480, 127), 3275, 9, 10, 11, 1, NULL); + _background.setDetails(Rect(0, 0, 480, 200), 3275, 0, 1, 2, 1, NULL); R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; R2_GLOBALS._player.postInit(); @@ -1611,7 +1616,7 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.addMover(mover, &pt, this); } else if (R2_GLOBALS._player._oldCharacterScene[3] == 3260) { _sceneMode = 3276; - setAction(&_sequenceManager, this, 3276, &R2_GLOBALS._player, &_actor2, NULL); + setAction(&_sequenceManager, this, 3276, &R2_GLOBALS._player, &_door, NULL); } else { R2_GLOBALS._player.setup(30, 3, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -1640,6 +1645,7 @@ void Scene3275::signal() { * Scene 3350 - Cutscene - Ship landing * *--------------------------------------------------------------------------*/ + void Scene3350::postInit(SceneObjectList *OwnerList) { loadScene(3350); R2_GLOBALS._uiElements._active = false; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index f1203f96a1..6fcd69b68d 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -106,52 +106,51 @@ public: }; class Scene3150 : public SceneExt { - class Item5 : public NamedHotspot { + class LightFixture : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item6 : public NamedHotspot { + class Toilet : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class Water : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor5 : public SceneActor { + class FoodTray : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; class Actor6 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor7 : public SceneActor { + class AirVent : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class DoorExit : public SceneExit { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class VentExit : public SceneExit { public: virtual void changeScene(); }; public: - - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - Item5 _item5; - Item6 _item6; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - Actor4 _actor4; - Actor5 _actor5; - Actor6 _actor6; - Actor7 _actor7; - Exit1 _exit1; - Exit2 _exit2; + NamedHotspot _background; + NamedHotspot _bed; + NamedHotspot _lightFixture2; + NamedHotspot _bars; + LightFixture _lightFixture; + Toilet _toilet; + SceneActor _guard; + SceneActor _doorBars; + SceneActor _bulbOrWire; + Water _water; + FoodTray _foodTray; + Actor6 _toiletFlush; + AirVent _airVent; + DoorExit _doorExit; + VentExit _ventExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -309,10 +308,10 @@ public: }; class Scene3260 : public SceneExt { - class Actor13 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor14 : public SceneActor { + class Toolbox : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -321,22 +320,21 @@ class Scene3260 : public SceneExt { void signal(); }; public: - NamedHotspot _item1; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; - SceneActor _actor6; + SceneActor _sceeen1; + SceneActor _screen2; + SceneActor _screen3; + SceneActor _screen4; + SceneActor _screen5; + SceneActor _screen6; SceneActor _actor7; SceneActor _actor8; SceneActor _actor9; - SceneActor _actor10; - SceneActor _actor11; - SceneActor _actor12; - Actor13 _actor13; - Actor14 _actor14; + SceneActor _securityConsole; + SceneActor _computerConsole; + SceneActor _lightingConsole; + Door _door; + Toolbox _toolbox; Action1 _action1; Action1 _action2; Action1 _action3; @@ -357,23 +355,23 @@ public: }; class Scene3275 : public SceneExt { - class Actor2 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class CellExit : public SceneExit { public: virtual void changeScene(); }; public: - NamedHotspot _item1; - NamedHotspot _item2; - NamedHotspot _item3; - NamedHotspot _item4; - NamedHotspot _item5; + NamedHotspot _background; + NamedHotspot _emptyCell1; + NamedHotspot _emptyCell2; + NamedHotspot _securityBeams1; + NamedHotspot _securityBeams2; SceneActor _actor1; - Actor2 _actor2; - Exit1 _exit1; + Door _door; + CellExit _cellExit; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); -- cgit v1.2.3 From 455c286a6093a59359007581e810c68d93bf6045 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 22 Sep 2013 22:24:08 -0400 Subject: TSAGE: Cleanup and bugfixes for the R2R Vent Maze --- engines/tsage/globals.cpp | 11 +- engines/tsage/globals.h | 4 +- engines/tsage/ringworld2/ringworld2_logic.cpp | 4 +- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 137 +++++++++++------------- engines/tsage/ringworld2/ringworld2_scenes1.h | 2 +- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 10 +- engines/tsage/scenes.cpp | 7 +- 7 files changed, 87 insertions(+), 88 deletions(-) (limited to 'engines') diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index a5abb4e105..10ed45f7da 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -465,9 +465,8 @@ void Ringworld2Globals::reset() { _scene1925CurrLevel = 0; //_v56A9C _v56A9E = 0; _v56AA0 = 0; - _v56AA1 = 0; - _v56AA2 = 60; - _v56AA4 = 660; + _scientistConvIndex = 0; + _ventCellPos = Common::Point(60, 660); _v56AA6 = 1; _v56AA7 = 1; _v56AA8 = 1; @@ -531,8 +530,8 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_desertWrongDirCtr); s.syncAsSint16LE(_scene1925CurrLevel); // _v56A9C s.syncAsSint16LE(_v56A9E); - s.syncAsSint16LE(_v56AA2); - s.syncAsSint16LE(_v56AA4); + s.syncAsSint16LE(_ventCellPos.x); + s.syncAsSint16LE(_ventCellPos.y); s.syncAsSint16LE(_v56AAB); s.syncAsSint16LE(_scene180Mode); s.syncAsSint16LE(_v57709); @@ -559,7 +558,7 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsByte(_desertCorrectDirection); s.syncAsByte(_desertPreviousDirection); s.syncAsByte(_v56AA0); - s.syncAsByte(_v56AA1); + s.syncAsByte(_scientistConvIndex); s.syncAsByte(_v56AA6); s.syncAsByte(_v56AA7); s.syncAsByte(_v56AA8); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 3a8f61bf13..674b907f29 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -290,8 +290,8 @@ public: int _scene1925CurrLevel; //_v56A9C int _v56A9E; byte _v56AA0; - byte _v56AA1; - int _v56AA2; + byte _scientistConvIndex; + Common::Point _ventCellPos; int _v56AA4; byte _v56AA6; byte _v56AA7; diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index ea083d00f8..ccdaf2ce05 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -118,6 +118,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { case 1100: return new Scene1100(); case 1200: + // ARM Base - Air Ducts Maze return new Scene1200(); case 1337: case 1330: @@ -1504,7 +1505,7 @@ MazeUI::~MazeUI() { } void MazeUI::synchronize(Serializer &s) { - SavedObject::synchronize(s); + SceneObject::synchronize(s); s.syncAsSint16LE(_resNum); if (s.isLoading()) @@ -1516,7 +1517,6 @@ void MazeUI::synchronize(Serializer &s) { } void MazeUI::load(int resNum) { - postInit(); clear(); _resNum = resNum; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index a412c5efc6..e2e47ebeb1 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -1311,7 +1311,7 @@ void Scene1100::saveCharacter(int characterIndex) { *--------------------------------------------------------------------------*/ Scene1200::Scene1200() { - _field412 = 0; + _nextCrawlDirection = 0; _field414 = 0; _field416 = 0; _field418 = 0; @@ -1322,7 +1322,7 @@ Scene1200::Scene1200() { void Scene1200::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field412); + s.syncAsSint16LE(_nextCrawlDirection); s.syncAsSint16LE(_field414); s.syncAsSint16LE(_field416); s.syncAsSint16LE(_field418); @@ -1418,7 +1418,7 @@ bool Scene1200::LaserPanel::Jumper::startAction(CursorType action, Event &event) switch (R2_GLOBALS._v56AA7) { case 1: - setFrame2(1); + setFrame2(2); setPosition(Common::Point(152, 101)); break; case 2: @@ -1482,20 +1482,14 @@ void Scene1200::LaserPanel::remove() { Scene1200 *scene = (Scene1200 *)R2_GLOBALS._sceneManager._scene; scene->_field41A = 0; - warning("Unexpected _sceneAreas.remove() call"); -// scene->_sceneAreas.remove(&_jumper1); -// scene->_sceneAreas.remove(&_jumper2); -// scene->_sceneAreas.remove(&_jumper3); + scene->_sceneAreas.remove(&_jumper1); + scene->_sceneAreas.remove(&_jumper2); + scene->_sceneAreas.remove(&_jumper3); _jumper1.remove(); _jumper2.remove(); _jumper3.remove(); - // sub201EA - R2_GLOBALS._sceneItems.remove((SceneItem *)this); - _object1.remove(); - SceneArea::remove(); - R2_GLOBALS._insetUp--; - + ModalWindow::remove(); R2_GLOBALS._player._canWalk = true; } @@ -1506,7 +1500,7 @@ void Scene1200::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._sceneManager._previousScene < 3200) R2_GLOBALS._sound1.play(257); - _field412 = 1; + _nextCrawlDirection = CRAWL_EAST; _field414 = 0; _field416 = 0; _field418 = 0; @@ -1533,8 +1527,9 @@ void Scene1200::postInit(SceneObjectList *OwnerList) { _mazeUI.setDisplayBounds(Rect(110, 20, 210, 120)); + _mazeUI.postInit(); _mazeUI.load(1); - _mazeUI.setMazePosition(Common::Point(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4)); + _mazeUI.setMazePosition(R2_GLOBALS._ventCellPos); R2_GLOBALS._player.enableControl(); _item1.setDetails(Rect(0, 0, 320, 200), 1200, 0, 1, 2, 1, NULL); @@ -1790,7 +1785,7 @@ void Scene1200::process(Event &event) { return; if (event.eventType == EVENT_BUTTON_DOWN) { - Common::Point cellPos(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4); + Common::Point cellPos = R2_GLOBALS._ventCellPos; _mazeUI.pixelToCellXY(cellPos); int cellId = _mazeUI.getCellFromPixelXY(event.mousePos); @@ -1840,7 +1835,7 @@ void Scene1200::process(Event &event) { R2_GLOBALS._sceneManager.changeScene(3150); break; case 33: - if (R2_GLOBALS._v56AA1 >= 4) + if (R2_GLOBALS._scientistConvIndex >= 4) R2_GLOBALS._sceneManager.changeScene(3250); else SceneItem::display(1200, 6, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); @@ -1860,7 +1855,7 @@ void Scene1200::process(Event &event) { case 3: // It was your cell. SceneItem::display(1200, 8, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); - break; + break; case 9: R2_GLOBALS._sceneManager.changeScene(3240); break; @@ -1914,20 +1909,20 @@ void Scene1200::process(Event &event) { } switch (event.kbd.keycode) { - case Common::KEYCODE_1: - warning("FIXME: keycode = 0x4800"); + case Common::KEYCODE_KP8: + case Common::KEYCODE_UP: startCrawling(CRAWL_NORTH); break; - case Common::KEYCODE_2: - warning("FIXME: keycode = 0x4B00"); + case Common::KEYCODE_KP4: + case Common::KEYCODE_LEFT: startCrawling(CRAWL_WEST); break; - case Common::KEYCODE_3: - warning("FIXME: keycode = 0x4D00"); + case Common::KEYCODE_KP6: + case Common::KEYCODE_RIGHT: startCrawling(CRAWL_EAST); break; - case Common::KEYCODE_4: - warning("FIXME: keycode = 0x5000"); + case Common::KEYCODE_KP2: + case Common::KEYCODE_DOWN: startCrawling(CRAWL_SOUTH); break; default: @@ -1945,49 +1940,47 @@ void Scene1200::dispatch() { Scene::dispatch(); if (_fixupMaze) { - _mazeUI.setMazePosition(Common::Point(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4)); - - warning("_gfxManager.sub294AC(unk);"); - warning("tmpRect.sub14DF3();"); + _mazeUI.setMazePosition(R2_GLOBALS._ventCellPos); + //_mazeUI.draw(); _fixupMaze = false; } if (_field414 != 0) { tmpRect.set(110, 20, 210, 120); _field414--; - switch (_field412 - 1) { - case 0: - R2_GLOBALS._v56AA2 += 2; + + switch (_nextCrawlDirection) { + case CRAWL_EAST: + R2_GLOBALS._ventCellPos.x += 2; break; - case 1: - R2_GLOBALS._v56AA2 -= 2; + case CRAWL_WEST: + R2_GLOBALS._ventCellPos.x -= 2; break; - case 2: - R2_GLOBALS._v56AA4 += 2; + case CRAWL_SOUTH: + R2_GLOBALS._ventCellPos.y += 2; break; - case 3: - R2_GLOBALS._v56AA4 -= 2; + case CRAWL_NORTH: + R2_GLOBALS._ventCellPos.y -= 2; break; default: break; } - _mazeUI.setMazePosition(Common::Point(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4)); - debug("_gfxManager.sub294AC(unk);"); - debug("tmpRect.sub14DF3();"); + _mazeUI.setMazePosition(R2_GLOBALS._ventCellPos); + //_mazeUI.draw(); if (_field416 != 0) { - switch(_field412 - 1) { - case 0: + switch(_nextCrawlDirection) { + case CRAWL_EAST: R2_GLOBALS._player.setPosition(Common::Point(R2_GLOBALS._player._position.x - 2, R2_GLOBALS._player._position.y)); break; - case 1: + case CRAWL_WEST: R2_GLOBALS._player.setPosition(Common::Point(R2_GLOBALS._player._position.x + 2, R2_GLOBALS._player._position.y)); break; - case 2: + case CRAWL_SOUTH: R2_GLOBALS._player.setPosition(Common::Point(R2_GLOBALS._player._position.x, R2_GLOBALS._player._position.y - 2)); break; - case 3: + case CRAWL_NORTH: R2_GLOBALS._player.setPosition(Common::Point(R2_GLOBALS._player._position.x, R2_GLOBALS._player._position.y + 2)); break; default: @@ -2008,7 +2001,7 @@ void Scene1200::saveCharacter(int characterIndex) { } void Scene1200::startCrawling(CrawlDirection dir) { - Common::Point cellPos = Common::Point(R2_GLOBALS._v56AA2, R2_GLOBALS._v56AA4); + Common::Point cellPos = R2_GLOBALS._ventCellPos; _mazeUI.pixelToCellXY(cellPos); switch (dir) { @@ -2023,26 +2016,26 @@ void Scene1200::startCrawling(CrawlDirection dir) { _sceneMode = 1200; setAction(&_sequenceManager, this, 1200, &_actor1, NULL); } else if (_mazeUI.getCellFromPixelXY(Common::Point(200, 69)) == 36) { - switch (_field412 - 1) { - case 0: + switch (_nextCrawlDirection) { + case CRAWL_EAST: if (R2_GLOBALS._player._visage == 3155) _sceneMode = 15; else _sceneMode = 10; break; - case 1: + case CRAWL_WEST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 76; else _sceneMode = 75; break; - case 2: + case CRAWL_SOUTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 101; else _sceneMode = 100; break; - case 3: + case CRAWL_NORTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 111; else @@ -2052,7 +2045,7 @@ void Scene1200::startCrawling(CrawlDirection dir) { break; } R2_GLOBALS._player.disableControl(); - _field412 = 1; + _nextCrawlDirection = 1; signal(); } break; @@ -2067,26 +2060,26 @@ void Scene1200::startCrawling(CrawlDirection dir) { _sceneMode = 1201; setAction(&_sequenceManager, this, 1201, &_actor1, NULL); } else if (_mazeUI.getCellFromPixelXY(Common::Point(120, 69)) == 36) { - switch (_field412 - 1) { - case 0: + switch (_nextCrawlDirection) { + case CRAWL_EAST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 56; else _sceneMode = 55; break; - case 1: + case CRAWL_WEST: if (R2_GLOBALS._player._visage == 3155) _sceneMode = 25; else _sceneMode = 20; break; - case 2: + case CRAWL_SOUTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 91; else _sceneMode = 90; break; - case 3: + case CRAWL_NORTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 121; else @@ -2096,7 +2089,7 @@ void Scene1200::startCrawling(CrawlDirection dir) { break; } R2_GLOBALS._player.disableControl(); - _field412 = 2; + _nextCrawlDirection = 2; signal(); } break; @@ -2109,26 +2102,26 @@ void Scene1200::startCrawling(CrawlDirection dir) { _sceneMode = 1203; setAction(&_sequenceManager, this, 1203, &_actor1, NULL); } else if (_mazeUI.getCellFromPixelXY(Common::Point(160, 110)) == 36) { - switch (_field412 - 1) { - case 0: + switch (_nextCrawlDirection) { + case CRAWL_EAST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 51; else _sceneMode = 50; break; - case 1: + case CRAWL_WEST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 81; else _sceneMode = 80; break; - case 2: + case CRAWL_SOUTH: if (R2_GLOBALS._player._visage == 3155) _sceneMode = 35; else _sceneMode = 30; break; - case 3: + case CRAWL_NORTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 116; else @@ -2138,7 +2131,7 @@ void Scene1200::startCrawling(CrawlDirection dir) { break; } R2_GLOBALS._player.disableControl(); - _field412 = 3; + _nextCrawlDirection = 3; signal(); } break; @@ -2151,26 +2144,26 @@ void Scene1200::startCrawling(CrawlDirection dir) { _sceneMode = 1202; setAction(&_sequenceManager, this, 1202, &_actor1, NULL); } else if (_mazeUI.getCellFromPixelXY(Common::Point(160, 30)) == 36) { - switch (_field412 - 1) { - case 0: + switch (_nextCrawlDirection) { + case CRAWL_EAST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 61; else _sceneMode = 60; break; - case 1: + case CRAWL_WEST: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 71; else _sceneMode = 70; break; - case 2: + case CRAWL_SOUTH: if (R2_GLOBALS._player._visage == 3156) _sceneMode = 96; else _sceneMode = 95; break; - case 3: + case CRAWL_NORTH: if (R2_GLOBALS._player._visage == 3155) _sceneMode = 45; else @@ -2182,7 +2175,7 @@ void Scene1200::startCrawling(CrawlDirection dir) { break; } R2_GLOBALS._player.disableControl(); - _field412 = 4; + _nextCrawlDirection = 4; signal(); } break; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index f72260bc00..824df607b3 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -163,7 +163,7 @@ public: MazeUI _mazeUI; SequenceManager _sequenceManager; - int _field412; + int _nextCrawlDirection; int _field414; int _field416; int _field418; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index e70a67d817..a462b5c550 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -1065,6 +1065,7 @@ void Scene3240::signal() { * Scene 3245 - Cutscene : Discussions with Dr. Tomko * *--------------------------------------------------------------------------*/ + void Scene3245::postInit(SceneObjectList *OwnerList) { loadScene(3245); R2_GLOBALS._uiElements._active = false; @@ -1080,14 +1081,14 @@ void Scene3245::postInit(SceneObjectList *OwnerList) { _actor1.postInit(); _actor2.postInit(); - if (R2_GLOBALS._v56AA1 < 4) - ++R2_GLOBALS._v56AA1; + if (R2_GLOBALS._scientistConvIndex < 4) + ++R2_GLOBALS._scientistConvIndex; - if (R2_GLOBALS._v56AA1 >= 4) { + if (R2_GLOBALS._scientistConvIndex >= 4) { SceneItem::display(1200, 7, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); signal(); } else { - setAction(&_sequenceManager, this, 3244 + R2_GLOBALS._v56AA1, &_actor1, &_actor2, NULL); + setAction(&_sequenceManager, this, 3244 + R2_GLOBALS._scientistConvIndex, &_actor1, &_actor2, NULL); } } @@ -1099,6 +1100,7 @@ void Scene3245::signal() { * Scene 3250 - Room with large stasis field negator * *--------------------------------------------------------------------------*/ + bool Scene3250::Item::startAction(CursorType action, Event &event) { Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 23623b1900..58bb8c4a44 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -56,8 +56,13 @@ void SceneManager::setNewScene(int sceneNumber) { void SceneManager::checkScene() { if (_nextSceneNumber != -1) { + int nextSceneNumber = _nextSceneNumber; + sceneChange(); - _nextSceneNumber = -1; + + // Unless we've already switched to yet another scene, reset + if (_nextSceneNumber == nextSceneNumber) + _nextSceneNumber = -1; } g_globals->dispatchSounds(); -- cgit v1.2.3 From 974513856b6378230e056439aa2df356cee3cae7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 22 Sep 2013 23:14:58 -0400 Subject: TSAGE: Renaming and cleanup for R2R Autopsy and dormitory rooms --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 158 ++++++++++++------------ engines/tsage/ringworld2/ringworld2_scenes3.h | 61 +++++---- 2 files changed, 110 insertions(+), 109 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index a462b5c550..31eb1d34c6 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -206,6 +206,7 @@ void Scene3100::dispatch() { * Scene 3125 - Ghouls dormitory * *--------------------------------------------------------------------------*/ + Scene3125::Scene3125() { _field412 = 0; } @@ -216,7 +217,7 @@ void Scene3125::synchronize(Serializer &s) { s.syncAsSint16LE(_field412); } -bool Scene3125::Item1::startAction(CursorType action, Event &event) { +bool Scene3125::Background::startAction(CursorType action, Event &event) { Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -240,7 +241,7 @@ bool Scene3125::Item1::startAction(CursorType action, Event &event) { return true; } -bool Scene3125::Item2::startAction(CursorType action, Event &event) { +bool Scene3125::Table::startAction(CursorType action, Event &event) { Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -263,15 +264,17 @@ bool Scene3125::Item2::startAction(CursorType action, Event &event) { return true; } -bool Scene3125::Item3::startAction(CursorType action, Event &event) { +bool Scene3125::Computer::startAction(CursorType action, Event &event) { Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; switch (action) { case CURSOR_USE: R2_GLOBALS._player.disableControl(); - scene->_actor5.postInit(); + scene->_ghoul4.postInit(); scene->_sceneMode = 3126; - scene->setAction(&scene->_sequenceManager1, scene, 3126, &R2_GLOBALS._player, &scene->_actor2, &scene->_actor3, &scene->_actor4, &scene->_actor1, &scene->_actor5, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 3126, &R2_GLOBALS._player, + &scene->_ghoul1, &scene->_ghoul2, &scene->_ghoul3, &scene->_door, + &scene->_ghoul4, NULL); break; case CURSOR_LOOK: SceneItem::display(3125, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, -999); @@ -287,7 +290,7 @@ bool Scene3125::Item3::startAction(CursorType action, Event &event) { return true; } -bool Scene3125::Actor1::startAction(CursorType action, Event &event) { +bool Scene3125::Door::startAction(CursorType action, Event &event) { Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -295,7 +298,7 @@ bool Scene3125::Actor1::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3176; - scene->setAction(&scene->_sequenceManager1, scene, 3176, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager1, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); return true; } @@ -304,36 +307,36 @@ void Scene3125::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); _field412 = 0; - _actor1.postInit(); - _actor1.setup(3175, 1, 1); - _actor1.setPosition(Common::Point(35, 72)); - _actor1.setDetails(3125, 12, 13, -1, 1, (SceneItem *)NULL); + _door.postInit(); + _door.setup(3175, 1, 1); + _door.setPosition(Common::Point(35, 72)); + _door.setDetails(3125, 12, 13, -1, 1, (SceneItem *)NULL); - _actor2.postInit(); - _actor2.setup(3126, 4, 1); - _actor2.setPosition(Common::Point(71, 110)); - _actor2._numFrames = 20; + _ghoul1.postInit(); + _ghoul1.setup(3126, 4, 1); + _ghoul1.setPosition(Common::Point(71, 110)); + _ghoul1._numFrames = 20; - _actor3.postInit(); - _actor3.setup(3126, 1, 1); - _actor3.setPosition(Common::Point(215, 62)); - _actor3.fixPriority(71); + _ghoul2.postInit(); + _ghoul2.setup(3126, 1, 1); + _ghoul2.setPosition(Common::Point(215, 62)); + _ghoul2.fixPriority(71); - _actor4.postInit(); - _actor4.setup(3126, 1, 1); - _actor4.setPosition(Common::Point(171, 160)); - _actor4.fixPriority(201); + _ghoul3.postInit(); + _ghoul3.setup(3126, 1, 1); + _ghoul3.setPosition(Common::Point(171, 160)); + _ghoul3.fixPriority(201); - _item3.setDetails(12, 3125, 9, 13, -1); - _item2.setDetails(11, 3125, 15, 13, -1); - _item1.setDetails(Rect(0, 0, 320, 200), 3125, 0, 1, 2, 1, NULL); + _computer.setDetails(12, 3125, 9, 13, -1); + _table.setDetails(11, 3125, 15, 13, -1); + _background.setDetails(Rect(0, 0, 320, 200), 3125, 0, 1, 2, 1, NULL); R2_GLOBALS._sound1.play(262); R2_GLOBALS._player.postInit(); if (R2_GLOBALS._player._oldCharacterScene[3] == 3250) { _sceneMode = 3175; - setAction(&_sequenceManager1, this, 3175, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager1, this, 3175, &R2_GLOBALS._player, &_door, NULL); } else { R2_GLOBALS._player.setup(30, 5, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -363,7 +366,7 @@ void Scene3125::signal() { } void Scene3125::dispatch() { - if ((_sceneMode == 3126) && (_actor2._frame == 2) && (_field412 == 0)) { + if ((_sceneMode == 3126) && (_ghoul1._frame == 2) && (_field412 == 0)) { _field412 = 1; R2_GLOBALS._sound1.play(265); } @@ -830,7 +833,7 @@ bool Scene3175::Item1::startAction(CursorType action, Event &event) { return scene->display(action, event); } -bool Scene3175::Actor3::startAction(CursorType action, Event &event) { +bool Scene3175::Corpse::startAction(CursorType action, Event &event) { Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; switch (action) { @@ -859,14 +862,14 @@ bool Scene3175::Actor3::startAction(CursorType action, Event &event) { return scene->display(action, event); } -bool Scene3175::Actor1::startAction(CursorType action, Event &event) { +bool Scene3175::Door::startAction(CursorType action, Event &event) { Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; switch (action) { case CURSOR_USE: R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3176; - scene->setAction(&scene->_sequenceManager, scene, 3176, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); return true; break; case CURSOR_LOOK: @@ -887,23 +890,23 @@ void Scene3175::postInit(SceneObjectList *OwnerList) { loadScene(3175); SceneExt::postInit(); - _actor1.postInit(); - _actor1.setup(3175, 1, 1); - _actor1.setPosition(Common::Point(35, 72)); - _actor1.setDetails(3175, 9, 10, -1, 1, (SceneItem *)NULL); + _door.postInit(); + _door.setup(3175, 1, 1); + _door.setPosition(Common::Point(35, 72)); + _door.setDetails(3175, 9, 10, -1, 1, (SceneItem *)NULL); _actor2.postInit(); _actor2.setup(3175, 2, 1); _actor2.setPosition(Common::Point(87, 148)); - _actor3.postInit(); - _actor3.setup(3175, 3, 1); - _actor3.setPosition(Common::Point(199, 117)); - _actor3.setDetails(3175, 15, 16, 17, 1, (SceneItem *)NULL); + _corpse.postInit(); + _corpse.setup(3175, 3, 1); + _corpse.setPosition(Common::Point(199, 117)); + _corpse.setDetails(3175, 15, 16, 17, 1, (SceneItem *)NULL); _item2.setDetails(12, 3175, 3, 1, 5); _item3.setDetails(11, 3175, 6, 7, 8); - _item1.setDetails(Rect(0, 0, 320, 200), 3175, 0, 1, 2, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3175, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); @@ -914,7 +917,7 @@ void Scene3175::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(); } else { _sceneMode = 3175; - setAction(&_sequenceManager, this, 3175, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 3175, &R2_GLOBALS._player, &_door, NULL); } R2_GLOBALS._player._oldCharacterScene[3] = 3175; @@ -1130,7 +1133,7 @@ bool Scene3250::Item::startAction(CursorType action, Event &event) { return scene->display(action, event); } -bool Scene3250::Actor::startAction(CursorType action, Event &event) { +bool Scene3250::Door::startAction(CursorType action, Event &event) { Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -1141,15 +1144,15 @@ bool Scene3250::Actor::startAction(CursorType action, Event &event) { switch(_position.x) { case 25: scene->_sceneMode = 3262; - scene->setAction(&scene->_sequenceManager, scene, 3262, &R2_GLOBALS._player, &scene->_actor1, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3262, &R2_GLOBALS._player, &scene->_leftDoor, NULL); break; case 259: scene->_sceneMode = 3260; - scene->setAction(&scene->_sequenceManager, scene, 3260, &R2_GLOBALS._player, &scene->_actor2, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3260, &R2_GLOBALS._player, &scene->_topDoor, NULL); break; case 302: scene->_sceneMode = 3261; - scene->setAction(&scene->_sequenceManager, scene, 3261, &R2_GLOBALS._player, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3261, &R2_GLOBALS._player, &scene->_rightDoor, NULL); break; default: break; @@ -1166,28 +1169,28 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { } SceneExt::postInit(); - _actor1.postInit(); - _actor1.setup(3250, 6, 1); - _actor1.setPosition(Common::Point(25, 148)); - _actor1.fixPriority(10); - _actor1.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); - - _actor2.postInit(); - _actor2.setup(3250, 4, 1); - _actor2.setPosition(Common::Point(259, 126)); - _actor2.fixPriority(10); - _actor2.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); - - _actor3.postInit(); - _actor3.setup(3250, 5, 1); - _actor3.setPosition(Common::Point(302, 138)); - _actor3.fixPriority(10); - _actor3.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); - - _item3.setDetails(Rect(119, 111, 149, 168), 3250, 6, 7, 2, 1, NULL); - _item2.setDetails(Rect(58, 85, 231, 138), 3250, 12, 7, 2, 1, NULL); - _item4.setDetails(12, 3250, 3, 1, 2); - _item1.setDetails(Rect(0, 0, 320, 200), 3250, 0, 1, 2, 1, NULL); + _leftDoor.postInit(); + _leftDoor.setup(3250, 6, 1); + _leftDoor.setPosition(Common::Point(25, 148)); + _leftDoor.fixPriority(10); + _leftDoor.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); + + _topDoor.postInit(); + _topDoor.setup(3250, 4, 1); + _topDoor.setPosition(Common::Point(259, 126)); + _topDoor.fixPriority(10); + _topDoor.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); + + _rightDoor.postInit(); + _rightDoor.setup(3250, 5, 1); + _rightDoor.setPosition(Common::Point(302, 138)); + _rightDoor.fixPriority(10); + _rightDoor.setDetails(3250, 9, 10, -1, 1, (SceneItem *)NULL); + + _floodLights.setDetails(Rect(119, 111, 149, 168), 3250, 6, 7, 2, 1, NULL); + _tnuctipunShip.setDetails(Rect(58, 85, 231, 138), 3250, 12, 7, 2, 1, NULL); + _negator.setDetails(12, 3250, 3, 1, 2); + _background.setDetails(Rect(0, 0, 320, 200), 3250, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); @@ -1201,25 +1204,26 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { case 3125: if (R2_GLOBALS.getFlag(79)) { _sceneMode = 3254; - _actor5.postInit(); - _actor5._effect = 1; - _actor6.postInit(); - _actor6._effect = 1; - _actor7.postInit(); - _actor7._effect = 1; - setAction(&_sequenceManager, this, 3254, &R2_GLOBALS._player, &_actor3, &_actor5, &_actor6, &_actor7, &_actor1, NULL); + _ghoul1.postInit(); + _ghoul1._effect = 1; + _ghoul2.postInit(); + _ghoul2._effect = 1; + _ghoul3.postInit(); + _ghoul3._effect = 1; + setAction(&_sequenceManager, this, 3254, &R2_GLOBALS._player, &_rightDoor, + &_ghoul1, &_ghoul2, &_ghoul3, &_leftDoor, NULL); } else { _sceneMode = 3252; - setAction(&_sequenceManager, this, 3252, &R2_GLOBALS._player, &_actor3, NULL); + setAction(&_sequenceManager, this, 3252, &R2_GLOBALS._player, &_rightDoor, NULL); } break; case 3175: _sceneMode = 3251; - setAction(&_sequenceManager, this, 3251, &R2_GLOBALS._player, &_actor2, NULL); + setAction(&_sequenceManager, this, 3251, &R2_GLOBALS._player, &_topDoor, NULL); break; case 3255: _sceneMode = 3253; - setAction(&_sequenceManager, this, 3253, &R2_GLOBALS._player, &_actor1, NULL); + setAction(&_sequenceManager, this, 3253, &R2_GLOBALS._player, &_leftDoor, NULL); break; default: R2_GLOBALS._player.setup(31, 3, 1); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 6fcd69b68d..ae9439ff8b 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -67,33 +67,32 @@ public: }; class Scene3125 : public SceneExt { - class Item1 : public NamedHotspot { + class Background : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item2 : public Item1 { + class Table : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Item3 : public Item1 { + class Computer : public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; - class Actor1 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; public: - int _field412; - Item1 _item1; - Actor1 _actor1; - Item2 _item2; - Item3 _item3; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; + Background _background; + Door _door; + Table _table; + Computer _computer; + SceneActor _ghoul1; + SceneActor _ghoul2; + SceneActor _ghoul3; + SceneActor _ghoul4; SequenceManager _sequenceManager1; // Second sequence manager... Unused? SequenceManager _sequenceManager2; @@ -164,20 +163,19 @@ class Scene3175 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor1 : public Actor3 { + class Corpse : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; public: - - Item1 _item1; + Item1 _background; Item1 _item2; Item1 _item3; - Actor1 _actor1; + Door _door; SceneActor _actor2; - Actor3 _actor3; + Corpse _corpse; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -266,22 +264,21 @@ class Scene3250 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; public: - - Item _item1; - Item _item2; - Item _item3; - Item _item4; - Actor _actor1; - Actor _actor2; - Actor _actor3; - Actor _actor4; - SceneActor _actor5; - SceneActor _actor6; - SceneActor _actor7; + Item _background; + Item _tnuctipunShip; + Item _floodLights; + Item _negator; + Door _leftDoor; + Door _topDoor; + Door _rightDoor; + Door _actor4; + SceneActor _ghoul1; + SceneActor _ghoul2; + SceneActor _ghoul3; SequenceManager _sequenceManager; virtual void postInit(SceneObjectList *OwnerList = NULL); -- cgit v1.2.3 From 01b5f0ffdc815ca69c1a19fdca415302a30220df Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 22 Sep 2013 23:39:59 -0400 Subject: TSAGE: Further bugfixes for ARM base escape --- engines/tsage/ringworld2/ringworld2_logic.cpp | 1 + engines/tsage/ringworld2/ringworld2_scenes3.cpp | 72 +++++++++++++----------- engines/tsage/ringworld2/ringworld2_scenes3.h | 12 ++-- engines/tsage/ringworld2/ringworld2_speakers.cpp | 2 +- 4 files changed, 46 insertions(+), 41 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index ccdaf2ce05..11a20247ef 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -266,6 +266,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Room with large stasis field negator return new Scene3250(); case 3255: + // Guard Post return new Scene3255(); case 3260: // ARM Base - Computer room diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 31eb1d34c6..17d0110023 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -1269,9 +1269,10 @@ void Scene3250::dispatch() { } /*-------------------------------------------------------------------------- - * Scene 3255 - + * Scene 3255 - Guard Post * *--------------------------------------------------------------------------*/ + void Scene3255::postInit(SceneObjectList *OwnerList) { loadScene(3255); SceneExt::postInit(); @@ -1290,16 +1291,16 @@ void Scene3255::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound2.play(268); _sceneMode = 3257; _actor3.postInit(); - _actor4.postInit(); - _actor4._effect = 1; - setAction(&_sequenceManager, this, 3257, &R2_GLOBALS._player, &_actor4, &_actor3, NULL); + _quinn.postInit(); + _quinn._effect = 1; + setAction(&_sequenceManager, this, 3257, &R2_GLOBALS._player, &_quinn, &_actor3, NULL); } else { - _actor1.postInit(); - _actor1.setup(303, 1, 1); - _actor1.setPosition(Common::Point(208, 128)); - _actor2.postInit(); - _actor2.setup(3107, 3, 1); - _actor2.setPosition(Common::Point(230, 127)); + _teal.postInit(); + _teal.setup(303, 1, 1); + _teal.setPosition(Common::Point(208, 128)); + _guard.postInit(); + _guard.setup(3107, 3, 1); + _guard.setPosition(Common::Point(230, 127)); _sceneMode = 3255; setAction(&_sequenceManager, this, 3255, &R2_GLOBALS._player, NULL); } @@ -1310,10 +1311,11 @@ void Scene3255::signal() { switch (_sceneMode) { case 10: _sceneMode = 3258; - _actor5.postInit(); - _actor6.postInit(); - _actor7.postInit(); - setAction(&_sequenceManager, this, 3258, &R2_GLOBALS._player, &_actor4, &_actor3, &_actor5, &_actor6, &_actor7, NULL); + _ghoul1.postInit(); + _ghoul2.postInit(); + _ghoul3.postInit(); + setAction(&_sequenceManager, this, 3258, &R2_GLOBALS._player, &_quinn, + &_actor3, &_ghoul1, &_ghoul2, &_ghoul3, NULL); break; case 3256: R2_GLOBALS._sceneManager.changeScene(3250); @@ -1335,40 +1337,40 @@ void Scene3255::signal() { void Scene3255::dispatch() { if (R2_GLOBALS.getFlag(79)) { - if (_actor5._position.y >= 95) { - if (_actor5._position.y <= 110) - _actor5._shade = 6 - (_actor5._position.y - 95) / 3; + if (_ghoul1._position.y >= 95) { + if (_ghoul1._position.y <= 110) + _ghoul1._shade = 6 - (_ghoul1._position.y - 95) / 3; else - _actor5._effect = 1; + _ghoul1._effect = 1; } else { - _actor5._effect = 6; - _actor5._shade = 6; + _ghoul1._effect = 6; + _ghoul1._shade = 6; } - if (_actor6._position.y >= 95) { - if (_actor6._position.y <= 110) - _actor6._shade = 6 - (_actor6._position.y - 95) / 3; + if (_ghoul2._position.y >= 95) { + if (_ghoul2._position.y <= 110) + _ghoul2._shade = 6 - (_ghoul2._position.y - 95) / 3; else - _actor6._effect = 1; + _ghoul2._effect = 1; } else { - _actor6._effect = 6; - _actor6._shade = 6; + _ghoul2._effect = 6; + _ghoul2._shade = 6; } - if (_actor7._position.y >= 95) { - if (_actor7._position.y <= 110) - _actor7._shade = 6 - (_actor7._position.y - 95) / 3; + if (_ghoul3._position.y >= 95) { + if (_ghoul3._position.y <= 110) + _ghoul3._shade = 6 - (_ghoul3._position.y - 95) / 3; else - _actor7._effect = 1; + _ghoul3._effect = 1; } else { - _actor7._effect = 6; - _actor7._shade = 6; + _ghoul3._effect = 6; + _ghoul3._shade = 6; } } if ((R2_GLOBALS._player._position.x > 250) && (R2_GLOBALS._player._shade == 1)) { R2_GLOBALS._player._effect = 6; - _actor4._effect = 6; + _quinn._effect = 6; } Scene::dispatch(); } @@ -3587,12 +3589,14 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { loadScene(1050); R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._interfaceY = 200; + R2_GLOBALS._v5589E.set(0, 0, 320, 200); R2_GLOBALS._sound1.play(305); R2_GLOBALS._player._characterIndex = R2_QUINN; R2_GLOBALS._player._characterScene[R2_QUINN] = 3500; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3500; - R2_GLOBALS._player._characterScene[3] = 3500; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3500; _field1284 = 0; _field1282 = 0; _field1278 = 0; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index ae9439ff8b..96176d3d19 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -288,13 +288,13 @@ public: class Scene3255 : public SceneExt { public: - SceneActor _actor1; - SceneActor _actor2; + SceneActor _teal; + SceneActor _guard; SceneActor _actor3; - SceneActor _actor4; - SceneActor _actor5; - SceneActor _actor6; - SceneActor _actor7; + SceneActor _quinn; + SceneActor _ghoul1; + SceneActor _ghoul2; + SceneActor _ghoul3; SpeakerQuinn3255 _quinnSpeaker; SpeakerMiranda3255 _mirandaSpeaker; SequenceManager _sequenceManager; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 02687f102f..12feafc65b 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -1477,7 +1477,7 @@ void SpeakerQuinn3255::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor4; + _object2 = &scene->_quinn; _object2->hide(); _object1.postInit(); _object1._effect = _object2->_effect; -- cgit v1.2.3 From c0c3854fe2bcdd7ec986c26edcce1c2d93797a19 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Sun, 8 Sep 2013 18:03:53 +0200 Subject: WINTERMUTE: Match type of angle constant to struct in TransformStruct, silence warnings --- engines/wintermute/graphics/transform_struct.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/wintermute/graphics/transform_struct.h b/engines/wintermute/graphics/transform_struct.h index 702664a72d..2d98dc4599 100644 --- a/engines/wintermute/graphics/transform_struct.h +++ b/engines/wintermute/graphics/transform_struct.h @@ -55,7 +55,7 @@ public: Point32 _zoom; ///< Zoom; 100 = no zoom Point32 _hotspot; ///< Position of the hotspot - uint32 _angle; ///< Rotation angle, in degrees + int32 _angle; ///< Rotation angle, in degrees byte _flip; ///< Bitflag: see TransparentSurface::FLIP_XXX bool _alphaDisable; TSpriteBlendMode _blendMode; -- cgit v1.2.3 From b4161f54b6a7b99503ea2da1dab6e13523a504fe Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Tue, 27 Aug 2013 17:49:42 +0200 Subject: WINTERMUTE: Add support for additive/subtractive blending in TransparentSurface --- .../wintermute/graphics/transparent_surface.cpp | 575 +++++++++++++-------- engines/wintermute/graphics/transparent_surface.h | 91 +++- 2 files changed, 442 insertions(+), 224 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index cd200354f7..4ba74b01de 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -31,9 +31,262 @@ namespace Wintermute { +void doBlitOpaqueFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep); +void doBlitBinaryFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep); + +// These gather together various blendPixel functions for use with templates. + +class BlenderAdditive { +public: + static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); + static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); + static void blendPixel(byte *in, byte *out); + static void blendPixel(byte *in, byte *out, int colorMod); +}; + +class BlenderSubtractive { +public: + static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); + static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); + static void blendPixel(byte *in, byte *out); + static void blendPixel(byte *in, byte *out, int colorMod); +}; + +class BlenderNormal { +public: + static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb); + static void blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb); + static void blendPixel(byte *in, byte *out); + static void blendPixel(byte *in, byte *out, int colorMod); +}; + +/** + * Perform additive blending of a pixel, applying beforehand a given colormod. + * @param ina, inr, ing, inb: the input pixel, split into its components. + * @param *outa, *outr, *outg, *outb pointer to the output pixel. + * @param *outa, *outr, *outg, *outb pointer to the colormod components. + */ + +void BlenderAdditive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb) { + + + assert(!(*cr == 255 && *ca == 255 && *cb == 255 && *cg == 255)); + // Just use the faster, sans-colormod version + + if (*ca != 255) { + ina = (ina) * (*ca) >> 8; + } + + if (ina == 0) { + return; + } else { + if (*cb != 255) + *outb = MIN(*outb + ((inb * (*cb) * ina) >> 16), 255); + else + *outb = MIN(*outb + (inb * ina >> 8), 255); + + if (*cg != 255) + *outg = MIN(*outg + ((ing * (*cg) * ina) >> 16), 255); + else + *outg = MIN(*outg + (ing * ina >> 8), 255); + + if (*cr != 255) + *outr = MIN(*outr + ((inr * (*cr) * ina) >> 16), 255); + else + *outr = MIN(*outr + (inr * ina >> 8), 255); + } +} + +/** + * Perform subtractive blending of a pixel, applying beforehand a given colormod. + * @param ina, inr, ing, inb: the input pixel, split into its components. + * @param *outa, *outr, *outg, *outb pointer to the output pixel. + * @param *outa, *outr, *outg, *outb pointer to the colormod components. + */ + +void BlenderSubtractive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb) { + + assert(!(*cr == 255 && *ca == 255 && *cb == 255 && *cg == 255)); + // Just use the faster, sans-colormod version + + //if (*ca != 255) { + // ina = ina * (*ca) >> 8; + // } + + // As weird as it is, evidence suggests that alphamod is ignored when doing + // subtractive... + + // TODO if ina == 255 fast version + + if (ina == 0) { + return; + } else { + if (*cb != 255) + *outb = MAX(*outb - ((inb * (*cb) * (*outb) * ina) >> 24), 0); + else + *outb = MAX(*outb - (inb * (*outb) * ina >> 16), 0); + + if (*cg != 255) + *outg = MAX(*outg - ((ing * (*cg) * (*outg) * ina) >> 24), 0); + else + *outg = MAX(*outg - (ing * (*outg) * ina >> 16), 0); + + if (*cr != 255) + *outr = MAX(*outr - ((inr * (*cr) * (*outr) * ina) >> 24), 0); + else + *outr = MAX(*outr - (inr * (*outr) * ina >> 16), 0); + } +} + +/** + * Perform "regular" alphablending of a pixel, applying beforehand a given colormod. + * @param ina, inr, ing, inb: the input pixel, split into its components. + * @param *outa, *outr, *outg, *outb pointer to the output pixel. + * @param *outa, *outr, *outg, *outb pointer to the colormod components. + */ + +void BlenderNormal::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb) { + + assert(!(*cr == 255 && *ca == 255 && *cb == 255 && *cg == 255)); + // Just use the faster, sans-colormod version + + if (*ca != 255) { + ina = ina * (*ca) >> 8; + } + + if (ina == 0) { + return; + } else if (ina == 255) { + if (*cb != 255) + *outb = (inb * (*cb)) >> 8; + else + *outb = inb; + + if (*cr != 255) + *outr = (inr * (*cr)) >> 8; + else + *outr = inr; + + if (*cg != 255) + *outg = (ing * (*cg)) >> 8; + else + *outg = ing; + + *outa = ina; + + return; + + } else { + + *outa = 255; + *outb = (*outb * (255 - ina) >> 8); + *outr = (*outr * (255 - ina) >> 8); + *outg = (*outg * (255 - ina) >> 8); + + if (*cb == 0) + *outb = *outb; + else if (*cb != 255) + *outb = *outb + (inb * ina * (*cb) >> 16); + else + *outb = *outb + (inb * ina >> 8); + + if (*cr == 0) + *outr = *outr; + else if (*cr != 255) + *outr = *outr + (inr * ina * (*cr) >> 16); + else + *outr = *outr + (inr * ina >> 8); + + if (*cg == 0) + *outg = *outg; + else if (*cg != 255) + *outg = *outg + (ing * ina * (*cg) >> 16); + else + *outg = *outg + (ing * ina >> 8); + + return; + } +} + +/** + * Perform "regular" alphablending of a pixel. + * @param ina, inr, ing, inb: the input pixel, split into its components. + * @param *outa, *outr, *outg, *outb pointer to the output pixel. + */ + +void BlenderNormal::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb) { + + if (ina == 0) { + return; + } else if (ina == 255) { + *outb = inb; + *outg = ing; + *outr = inr; + *outa = ina; + return; + } else { + *outa = 255; + *outb = ((inb * ina) + *outb * (255 - ina)) >> 8; + *outg = ((ing * ina) + *outg * (255 - ina)) >> 8; + *outr = ((inr * ina) + *outr * (255 - ina)) >> 8; + } +} + +/** + * Perform subtractive blending of a pixel. + * @param ina, inr, ing, inb: the input pixel, split into its components. + * @param *outa, *outr, *outg, *outb pointer to the output pixel. + */ + +void BlenderSubtractive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb) { + + if (ina == 0) { + return; + } else if (ina == 255) { + *outa = *outa; + *outr = *outr - (inr * (*outr) >> 8); + *outg = *outg - (ing * (*outg) >> 8); + *outb = *outb - (inb * (*outb) >> 8); + return; + } else { + *outa = *outa; + *outb = MAX(*outb - ((inb * (*outb)) * ina >> 16), 0); + *outg = MAX(*outg - ((ing * (*outg)) * ina >> 16), 0); + *outr = MAX(*outr - ((inr * (*outr)) * ina >> 16), 0); + return; + } +} + +/** + * Perform additive blending of a pixel. + * @param ina, inr, ing, inb: the input pixel, split into its components. + * @param *outa, *outr, *outg, *outb pointer to the output pixel. + */ + +void BlenderAdditive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb) { + + if (ina == 0) { + return; + } else if (ina == 255) { + *outa = *outa; + *outr = MIN(*outr + inr, 255); + *outg = MIN(*outg + ing, 255); + *outb = MIN(*outb + inb, 255); + return; + } else { + *outa = *outa; + *outb = MIN((inb * ina >> 8) + *outb, 255); + *outg = MIN((ing * ina >> 8) + *outg, 255); + *outr = MIN((inr * ina >> 8) + *outr, 255); + return; + } +} #if ENABLE_BILINEAR void TransparentSurface::copyPixelBilinear(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst) { + + // TODO: Do some optimization on this. This is completely naive. + int srcW = srcRect.width(); int srcH = srcRect.height(); int dstW = dstRect.width(); @@ -106,20 +359,23 @@ void TransparentSurface::copyPixelBilinear(float projX, float projY, int dstX, i for (int c = 0; c < 4; c++) { dest[c] = (byte)( - ((float)Q11s[c]) * q11x * q11y + - ((float)Q21s[c]) * q21x * q21y + - ((float)Q12s[c]) * q12x * q12y + - ((float)Q22s[c]) * (1.0 - - q11x * q11y - - q21x * q21y - - q12x * q12y) - ); + ((float)Q11s[c]) * q11x * q11y + + ((float)Q21s[c]) * q21x * q21y + + ((float)Q12s[c]) * q12x * q12y + + ((float)Q22s[c]) * (1.0 - + q11x * q11y - + q21x * q21y - + q12x * q12y) + ); } } WRITE_UINT32((byte *)dst->getBasePtr(dstX + dstRect.left, dstY + dstRect.top), color); } #else void TransparentSurface::copyPixelNearestNeighbor(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst) { + + // TODO: Have the Rect arguments become completely useless at this point? + int srcW = srcRect.width(); int srcH = srcRect.height(); int dstW = dstRect.width(); @@ -157,21 +413,19 @@ TransparentSurface::TransparentSurface(const Surface &surf, bool copyData) : Sur } } -void doBlitOpaque(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep) { - byte *in, *out; - -#ifdef SCUMM_LITTLE_ENDIAN - const int aIndex = 0; -#else - const int aIndex = 3; -#endif +void doBlitOpaqueFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep) { +/** + * Optimized version of doBlit to be used w/opaque blitting (no alpha). + */ + byte *in; + byte *out; for (uint32 i = 0; i < height; i++) { out = outo; in = ino; memcpy(out, in, width * 4); for (uint32 j = 0; j < width; j++) { - out[aIndex] = 0xFF; + out[TransparentSurface::kAIndex] = 0xFF; out += 4; } outo += pitch; @@ -179,112 +433,111 @@ void doBlitOpaque(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pit } } -void doBlitBinary(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep) { - byte *in, *out; - -#ifdef SCUMM_LITTLE_ENDIAN - const int aIndex = 0; -#else - const int aIndex = 3; -#endif - const int aShift = 0;//img->format.aShift; +/** + * Optimized version of doBlit to be used w/binary blitting (blit or no-blit, no blending). + */ + +void doBlitBinaryFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep) { + + byte *in; + byte *out; for (uint32 i = 0; i < height; i++) { out = outo; in = ino; for (uint32 j = 0; j < width; j++) { uint32 pix = *(uint32 *)in; - int a = (pix >> aShift) & 0xff; - in += inStep; + int a = (pix >> TransparentSurface::kAShift) & 0xff; if (a == 0) { // Full transparency - out += 4; } else { // Full opacity (Any value not exactly 0 is Opaque here) *(uint32 *)out = pix; - out[aIndex] = 0xFF; - out += 4; + out[TransparentSurface::kAIndex] = 0xFF; } + out += 4; + in += inStep; } outo += pitch; ino += inoStep; } } -void doBlitAlpha(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep) { - byte *in, *out; +/** + * What we have here is a template method that calls blendPixel() from a different + * class - the one we call it with - thus performing a different type of blending. + * + * @param *ino a pointer to the input surface + * @param *outo a pointer to the output surface + * @param width width of the input surface + * @param height height of the input surface + * @param pitch pitch of the output surface - that is, width in bytes of every row, usually bpp * width of the TARGET surface (the area we are blitting to might be smaller, do the math) + * @inStep size in bytes to skip to address each pixel, usually bpp of the source surface + * @inoStep width in bytes of every row on the *input* surface / kind of like pitch + * @color colormod in 0xAARRGGBB format - 0xFFFFFFFF for no colormod + */ -#ifdef SCUMM_LITTLE_ENDIAN - const int aIndex = 0; - const int bIndex = 1; - const int gIndex = 2; - const int rIndex = 3; -#else - const int aIndex = 3; - const int bIndex = 2; - const int gIndex = 1; - const int rIndex = 0; -#endif +template +void doBlit(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep, uint32 color) { - const int bShift = 8;//img->format.bShift; - const int gShift = 16;//img->format.gShift; - const int rShift = 24;//img->format.rShift; - const int aShift = 0;//img->format.aShift; + byte *in; + byte *out; - const int bShiftTarget = 8;//target.format.bShift; - const int gShiftTarget = 16;//target.format.gShift; - const int rShiftTarget = 24;//target.format.rShift; + if (color == 0xffffffff) { - for (uint32 i = 0; i < height; i++) { - out = outo; - in = ino; - for (uint32 j = 0; j < width; j++) { - uint32 pix = *(uint32 *)in; - uint32 oPix = *(uint32 *) out; - int b = (pix >> bShift) & 0xff; - int g = (pix >> gShift) & 0xff; - int r = (pix >> rShift) & 0xff; - int a = (pix >> aShift) & 0xff; - int outb, outg, outr, outa; - in += inStep; + for (uint32 i = 0; i < height; i++) { + out = outo; + in = ino; + for (uint32 j = 0; j < width; j++) { - switch (a) { - case 0: // Full transparency - out += 4; - break; - case 255: // Full opacity - outb = b; - outg = g; - outr = r; - outa = a; - - out[aIndex] = outa; - out[bIndex] = outb; - out[gIndex] = outg; - out[rIndex] = outr; - out += 4; - break; - - default: // alpha blending - outa = 255; - outb = ((b * a) + ((oPix >> bShiftTarget) & 0xff) * (255-a)) >> 8; - outg = ((g * a) + ((oPix >> gShiftTarget) & 0xff) * (255-a)) >> 8; - outr = ((r * a) + ((oPix >> rShiftTarget) & 0xff) * (255-a)) >> 8; - - out[aIndex] = outa; - out[bIndex] = outb; - out[gIndex] = outg; - out[rIndex] = outr; - out += 4; + byte *outa = &out[TransparentSurface::kAIndex]; + byte *outr = &out[TransparentSurface::kRIndex]; + byte *outg = &out[TransparentSurface::kGIndex]; + byte *outb = &out[TransparentSurface::kBIndex]; + + Blender::blendPixel(in[TransparentSurface::kAIndex], + in[TransparentSurface::kRIndex], + in[TransparentSurface::kGIndex], + in[TransparentSurface::kBIndex], + outa, outr, outg, outb); + + in += inStep; + out += 4; } + outo += pitch; + ino += inoStep; + } + } else { + + byte ca = (color >> TransparentSurface::kAModShift) & 0xFF; + byte cr = (color >> TransparentSurface::kRModShift) & 0xFF; + byte cg = (color >> TransparentSurface::kGModShift) & 0xFF; + byte cb = (color >> TransparentSurface::kBModShift) & 0xFF; + + for (uint32 i = 0; i < height; i++) { + out = outo; + in = ino; + for (uint32 j = 0; j < width; j++) { + + byte *outa = &out[TransparentSurface::kAIndex]; + byte *outr = &out[TransparentSurface::kRIndex]; + byte *outg = &out[TransparentSurface::kGIndex]; + byte *outb = &out[TransparentSurface::kBIndex]; + + Blender::blendPixel(in[TransparentSurface::kAIndex], + in[TransparentSurface::kRIndex], + in[TransparentSurface::kGIndex], + in[TransparentSurface::kBIndex], + outa, outr, outg, outb, &ca, &cr, &cg, &cb); + in += inStep; + out += 4; + } + outo += pitch; + ino += inoStep; } - outo += pitch; - ino += inoStep; } } - -Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int posY, int flipping, Common::Rect *pPartRect, uint color, int width, int height) { - int ca = (color >> 24) & 0xff; +Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int posY, int flipping, Common::Rect *pPartRect, uint color, int width, int height, TSpriteBlendMode blendMode) { Common::Rect retSize; retSize.top = 0; @@ -292,13 +545,11 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p retSize.setWidth(0); retSize.setHeight(0); // Check if we need to draw anything at all + int ca = (color >> 24) & 0xff; + if (ca == 0) return retSize; - int cr = (color >> 16) & 0xff; - int cg = (color >> 8) & 0xff; - int cb = (color >> 0) & 0xff; - // Create an encapsulating surface for the data TransparentSurface srcImage(*this, false); // TODO: Is the data really in the screen format? @@ -325,11 +576,11 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p srcImage.h = pPartRect->height(); debug(6, "Blit(%d, %d, %d, [%d, %d, %d, %d], %08x, %d, %d)", posX, posY, flipping, - pPartRect->left, pPartRect->top, pPartRect->width(), pPartRect->height(), color, width, height); + pPartRect->left, pPartRect->top, pPartRect->width(), pPartRect->height(), color, width, height); } else { debug(6, "Blit(%d, %d, %d, [%d, %d, %d, %d], %08x, %d, %d)", posX, posY, flipping, 0, 0, - srcImage.w, srcImage.h, color, width, height); + srcImage.w, srcImage.h, color, width, height); } if (width == -1) @@ -385,117 +636,24 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p yp = img->h - 1; } - byte *ino = (byte *)img->getBasePtr(xp, yp); + byte *ino= (byte *)img->getBasePtr(xp, yp); byte *outo = (byte *)target.getBasePtr(posX, posY); - byte *in, *out; - -#ifdef SCUMM_LITTLE_ENDIAN - const int aIndex = 0; - const int bIndex = 1; - const int gIndex = 2; - const int rIndex = 3; -#else - const int aIndex = 3; - const int bIndex = 2; - const int gIndex = 1; - const int rIndex = 0; -#endif - const int bShift = 8;//img->format.bShift; - const int gShift = 16;//img->format.gShift; - const int rShift = 24;//img->format.rShift; - const int aShift = 0;//img->format.aShift; - - const int bShiftTarget = 8;//target.format.bShift; - const int gShiftTarget = 16;//target.format.gShift; - const int rShiftTarget = 24;//target.format.rShift; - - if (ca == 255 && cb == 255 && cg == 255 && cr == 255) { - if (_alphaMode == ALPHA_FULL) { - doBlitAlpha(ino, outo, img->w, img->h, target.pitch, inStep, inoStep); - } else if (_alphaMode == ALPHA_BINARY) { - doBlitBinary(ino, outo, img->w, img->h, target.pitch, inStep, inoStep); - } else if (_alphaMode == ALPHA_OPAQUE) { - doBlitOpaque(ino, outo, img->w, img->h, target.pitch, inStep, inoStep); - } + if (color == 0xFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_OPAQUE) { + doBlitOpaqueFast(ino, outo, img->w, img->h, target.pitch, inStep, inoStep); + } else if (color == 0xFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_BINARY) { + doBlitBinaryFast(ino, outo, img->w, img->h, target.pitch, inStep, inoStep); } else { - for (int i = 0; i < img->h; i++) { - out = outo; - in = ino; - for (int j = 0; j < img->w; j++) { - uint32 pix = *(uint32 *)in; - uint32 o_pix = *(uint32 *) out; - int b = (pix >> bShift) & 0xff; - int g = (pix >> gShift) & 0xff; - int r = (pix >> rShift) & 0xff; - int a = (pix >> aShift) & 0xff; - int outb, outg, outr, outa; - in += inStep; - - if (ca != 255) { - a = a * ca >> 8; - } - switch (a) { - case 0: // Full transparency - out += 4; - break; - case 255: // Full opacity - if (cb != 255) - outb = (b * cb) >> 8; - else - outb = b; - - if (cg != 255) - outg = (g * cg) >> 8; - else - outg = g; - - if (cr != 255) - outr = (r * cr) >> 8; - else - outr = r; - outa = a; - out[aIndex] = outa; - out[bIndex] = outb; - out[gIndex] = outg; - out[rIndex] = outr; - out += 4; - break; - - default: // alpha blending - outa = 255; - outb = ((o_pix >> bShiftTarget) & 0xff) * (255 - a); - outg = ((o_pix >> gShiftTarget) & 0xff) * (255 - a); - outr = ((o_pix >> rShiftTarget) & 0xff) * (255 - a); - if (cb == 0) - outb = outb >> 8; - else if (cb != 255) - outb = ((outb<<8) + b * a * cb) >> 16; - else - outb = (outb + b * a) >> 8; - if (cg == 0) - outg = outg >> 8; - else if (cg != 255) - outg = ((outg<<8) + g * a * cg) >> 16; - else - outg = (outg + g * a) >> 8; - if (cr == 0) - outr = outr >> 8; - else if (cr != 255) - outr = ((outr<<8) + r * a * cr) >> 16; - else - outr = (outr + r * a) >> 8; - out[aIndex] = outa; - out[bIndex] = outb; - out[gIndex] = outg; - out[rIndex] = outr; - out += 4; - } - } - outo += target.pitch; - ino += inoStep; + if (blendMode == BLEND_ADDITIVE) { + doBlit(ino, outo, img->w, img->h, target.pitch, inStep, inoStep, color); + } else if (blendMode == BLEND_SUBTRACTIVE) { + doBlit(ino, outo, img->w, img->h, target.pitch, inStep, inoStep, color); + } else { + assert(blendMode == BLEND_NORMAL); + doBlit(ino, outo, img->w, img->h, target.pitch, inStep, inoStep, color); } } + } retSize.setWidth(img->w); @@ -555,6 +713,7 @@ TransparentSurface *TransparentSurface::rotoscale(const TransformStruct &transfo } TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) const { + Common::Rect srcRect(0, 0, (int16)w, (int16)h); Common::Rect dstRect(0, 0, (int16)newWidth, (int16)newHeight); diff --git a/engines/wintermute/graphics/transparent_surface.h b/engines/wintermute/graphics/transparent_surface.h index 598aaa55d7..821b5c5943 100644 --- a/engines/wintermute/graphics/transparent_surface.h +++ b/engines/wintermute/graphics/transparent_surface.h @@ -54,8 +54,28 @@ struct TransparentSurface : public Graphics::Surface { void disableColorKey(); #if ENABLE_BILINEAR + /* + * Pick color from a point in source and copy it to a pixel in target. + * The point in the source can be a float - we have subpixel accuracy in the arguments. + * We do bilinear interpolation to estimate the color of the point even if the + * point is specuified w/subpixel accuracy. + * + * @param projX, projY, point in the source to pick color from. + * @param dstX, dstY destionation pixel + * @param *src, *dst pointer to the source and dest surfaces + */ static void copyPixelBilinear(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst); #else + /* + * Pick color from a point in source and copy it to a pixel in target. + * The point in the source can be a float - we have subpixel accuracy in the arguments. + * HOWEVER, this particular function just does nearest neighbor. + * Use copyPixelBilinear if you interpolation. + * + * @param projX, projY, point in the source to pick color from. + * @param dstX, dstY destionation pixel + * @param *src, *dst pointer to the source and dest surfaces + */ static void copyPixelNearestNeighbor(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst); #endif // Enums @@ -63,26 +83,50 @@ struct TransparentSurface : public Graphics::Surface { @brief The possible flipping parameters for the blit methode. */ enum FLIP_FLAGS { - /// The image will not be flipped. - FLIP_NONE = 0, - /// The image will be flipped at the horizontal axis. - FLIP_H = 1, - /// The image will be flipped at the vertical axis. - FLIP_V = 2, - /// The image will be flipped at the horizontal and vertical axis. - FLIP_HV = FLIP_H | FLIP_V, - /// The image will be flipped at the horizontal and vertical axis. - FLIP_VH = FLIP_H | FLIP_V + /// The image will not be flipped. + FLIP_NONE = 0, + /// The image will be flipped at the horizontal axis. + FLIP_H = 1, + /// The image will be flipped at the vertical axis. + FLIP_V = 2, + /// The image will be flipped at the horizontal and vertical axis. + FLIP_HV = FLIP_H | FLIP_V, + /// The image will be flipped at the horizontal and vertical axis. + FLIP_VH = FLIP_H | FLIP_V }; enum AlphaType { - ALPHA_OPAQUE = 0, - ALPHA_BINARY = 1, - ALPHA_FULL = 2 + ALPHA_OPAQUE = 0, + ALPHA_BINARY = 1, + ALPHA_FULL = 2 }; AlphaType _alphaMode; + #ifdef SCUMM_LITTLE_ENDIAN + static const int kAIndex = 0; + static const int kBIndex = 1; + static const int kGIndex = 2; + static const int kRIndex = 3; + #else + static const int kAIndex = 3; + static const int kBIndex = 2; + static const int kGIndex = 1; + static const int kRIndex = 0; + #endif + + static const int kBShift = 8;//img->format.bShift; + static const int kGShift = 16;//img->format.gShift; + static const int kRShift = 24;//img->format.rShift; + static const int kAShift = 0;//img->format.aShift; + + + static const int kBModShift = 0;//img->format.bShift; + static const int kGModShift = 8;//img->format.gShift; + static const int kRModShift = 16;//img->format.rShift; + static const int kAModShift = 24;//img->format.aShift; + + /** @brief renders the surface to another surface @param pDest a pointer to the target image. In most cases this is the framebuffer. @@ -115,10 +159,26 @@ struct TransparentSurface : public Graphics::Surface { int flipping = FLIP_NONE, Common::Rect *pPartRect = nullptr, uint color = BS_ARGB(255, 255, 255, 255), - int width = -1, int height = -1); + int width = -1, int height = -1, + TSpriteBlendMode blend = BLEND_NORMAL); void applyColorKey(uint8 r, uint8 g, uint8 b, bool overwriteAlpha = false); - + + /** + * @brief Scale function; this returns a transformed version of this surface after rotation and + * scaling. Please do not use this if angle != 0, use rotoscale. + * + * @param transform a TransformStruct wrapping the required info. @see TransformStruct + * + */ TransparentSurface *scale(uint16 newWidth, uint16 newHeight) const; + + /** + * @brief Rotoscale function; this returns a transformed version of this surface after rotation and + * scaling. Please do not use this if angle == 0, use plain old scaling function. + * + * @param transform a TransformStruct wrapping the required info. @see TransformStruct + * + */ TransparentSurface *rotoscale(const TransformStruct &transform) const; }; @@ -134,7 +194,6 @@ struct TransparentSurface : public Graphics::Surface { } };*/ - } // End of namespace Wintermute -- cgit v1.2.3 From d6c21f8c1e93842d7a1573fc72ce9528b6ed52b7 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Wed, 4 Sep 2013 17:44:49 +0200 Subject: WINTERMUTE: Pass blendMode to blit() in RenderTicket. --- engines/wintermute/base/gfx/osystem/render_ticket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/wintermute/base/gfx/osystem/render_ticket.cpp b/engines/wintermute/base/gfx/osystem/render_ticket.cpp index b1720c1b0b..d79d5bac4b 100644 --- a/engines/wintermute/base/gfx/osystem/render_ticket.cpp +++ b/engines/wintermute/base/gfx/osystem/render_ticket.cpp @@ -132,7 +132,7 @@ void RenderTicket::drawToSurface(Graphics::Surface *_targetSurface, Common::Rect src._alphaMode = _owner->getAlphaType(); } } - src.blit(*_targetSurface, dstRect->left, dstRect->top, _transform._flip, clipRect, _transform._rgbaMod, clipRect->width(), clipRect->height()); + src.blit(*_targetSurface, dstRect->left, dstRect->top, _transform._flip, clipRect, _transform._rgbaMod, clipRect->width(), clipRect->height(), _transform._blendMode); if (doDelete) { delete clipRect; } -- cgit v1.2.3 From f5fa2edd220fca94d6b45e5cbc922cbdd5ec22f5 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan SømaÌŠen Date: Mon, 23 Sep 2013 18:48:58 +0200 Subject: WINTERMUTE: Remove asserts in Blend-functions in TransparentSurface. --- engines/wintermute/graphics/transparent_surface.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index 4ba74b01de..411ff1f477 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -68,11 +68,6 @@ public: */ void BlenderAdditive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb) { - - - assert(!(*cr == 255 && *ca == 255 && *cb == 255 && *cg == 255)); - // Just use the faster, sans-colormod version - if (*ca != 255) { ina = (ina) * (*ca) >> 8; } @@ -105,10 +100,6 @@ void BlenderAdditive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *o */ void BlenderSubtractive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb) { - - assert(!(*cr == 255 && *ca == 255 && *cb == 255 && *cg == 255)); - // Just use the faster, sans-colormod version - //if (*ca != 255) { // ina = ina * (*ca) >> 8; // } @@ -146,10 +137,6 @@ void BlenderSubtractive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte */ void BlenderNormal::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *outa, byte *outr, byte *outg, byte *outb, byte *ca, byte *cr, byte *cg, byte *cb) { - - assert(!(*cr == 255 && *ca == 255 && *cb == 255 && *cg == 255)); - // Just use the faster, sans-colormod version - if (*ca != 255) { ina = ina * (*ca) >> 8; } -- cgit v1.2.3 From 8fe2fe8a15a6f3db61f7dbe101ef5edd64b51d46 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 23 Sep 2013 23:12:09 -0400 Subject: TSAGE: Renaming for R2R floating city walkways --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 432 ++++++++++++----------- engines/tsage/ringworld2/ringworld2_scenes3.h | 62 ++-- engines/tsage/ringworld2/ringworld2_speakers.cpp | 44 +-- 4 files changed, 276 insertions(+), 264 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index e2e47ebeb1..8f1905eeac 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -462,7 +462,7 @@ void Scene1000::dispatch() { _animationPlayer.remove(); if (_sceneMode == 52) - _endHandler = this; + _animationPlayer._endAction = this; } else { _animationPlayer.dispatch(); } diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 17d0110023..4ae95d625b 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -1041,6 +1041,7 @@ void Scene3230::signal() { * Scene 3240 - Cutscene : Teal monolog * *--------------------------------------------------------------------------*/ + void Scene3240::postInit(SceneObjectList *OwnerList) { loadScene(3240); R2_GLOBALS._uiElements._active = false; @@ -1656,8 +1657,9 @@ void Scene3275::signal() { void Scene3350::postInit(SceneObjectList *OwnerList) { loadScene(3350); - R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); + R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; R2_GLOBALS._sound2.play(310); _rotation = R2_GLOBALS._scenePalette.addRotation(176, 203, 1); @@ -1714,9 +1716,10 @@ void Scene3350::signal() { } /*-------------------------------------------------------------------------- - * Scene 3375 - + * Scene 3375 - Outer Walkway * *--------------------------------------------------------------------------*/ + Scene3375::Scene3375() { _field1488 = _field1492 = 0; for (int i = 0; i < 4; ++i) @@ -1736,9 +1739,9 @@ void Scene3375::subFC696(int sceneMode) { switch (sceneMode) { case 3379: R2_GLOBALS._player.setPosition(Common::Point(0, 155)); - _actor1.setPosition(Common::Point(-20, 163)); - _actor2.setPosition(Common::Point(-5, 150)); - _actor3.setPosition(Common::Point(-20, 152)); + _companion1.setPosition(Common::Point(-20, 163)); + _companion2.setPosition(Common::Point(-5, 150)); + _webbster.setPosition(Common::Point(-20, 152)); break; case 3380: ++R2_GLOBALS._v56A9E; @@ -1751,12 +1754,12 @@ void Scene3375::subFC696(int sceneMode) { R2_GLOBALS._player.setStrip(4); R2_GLOBALS._player.setPosition(Common::Point(148, 230)); - _actor1.setPosition(Common::Point(191, 274)); - _actor1._effect = 1; - _actor2.setPosition(Common::Point(124, 255)); - _actor2._effect = 1; - _actor3.setPosition(Common::Point(155, 245)); - _actor3._effect = 1; + _companion1.setPosition(Common::Point(191, 274)); + _companion1._effect = 1; + _companion2.setPosition(Common::Point(124, 255)); + _companion2._effect = 1; + _webbster.setPosition(Common::Point(155, 245)); + _webbster._effect = 1; break; case 3381: --R2_GLOBALS._v56A9E; @@ -1769,19 +1772,19 @@ void Scene3375::subFC696(int sceneMode) { R2_GLOBALS._player.setStrip(6); R2_GLOBALS._player.setPosition(Common::Point(201, 131)); - _actor1.setPosition(Common::Point(231, 127)); - _actor1._effect = 1; - _actor2.setPosition(Common::Point(231, 127)); - _actor2._effect = 1; - _actor3.setPosition(Common::Point(231, 127)); - _actor3._effect = 1; + _companion1.setPosition(Common::Point(231, 127)); + _companion1._effect = 1; + _companion2.setPosition(Common::Point(231, 127)); + _companion2._effect = 1; + _webbster.setPosition(Common::Point(231, 127)); + _webbster._effect = 1; break; default: R2_GLOBALS._player.setPosition(Common::Point(192, 155)); - _actor1.setPosition(Common::Point(138, 134)); - _actor2.setPosition(Common::Point(110, 139)); - _actor3.setPosition(Common::Point(125, 142)); + _companion1.setPosition(Common::Point(138, 134)); + _companion2.setPosition(Common::Point(110, 139)); + _webbster.setPosition(Common::Point(125, 142)); break; } @@ -1789,7 +1792,7 @@ void Scene3375::subFC696(int sceneMode) { R2_GLOBALS._sceneItems.remove(&_actor4); for (int i = 0; i <= 12; i++) R2_GLOBALS._sceneItems.remove(&_itemArray[i]); - R2_GLOBALS._sceneItems.remove(&_item1); + R2_GLOBALS._sceneItems.remove(&_background); _actor4.show(); _actor4.setDetails(3375, 9, 10, -1, 1, (SceneItem *)NULL); @@ -1797,7 +1800,7 @@ void Scene3375::subFC696(int sceneMode) { for (int i = 0; i <= 12; i++) _itemArray[i].setDetails(3375, 3, -1, -1); - _item1.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, -1, 1, NULL); } else { _actor4.hide(); R2_GLOBALS._sceneItems.remove(&_actor4); @@ -1806,10 +1809,10 @@ void Scene3375::subFC696(int sceneMode) { if (_sceneMode == 0) signal(); else - setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } -bool Scene3375::Actor1::startAction(CursorType action, Event &event) { +bool Scene3375::Companion2::startAction(CursorType action, Event &event) { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -1824,7 +1827,7 @@ bool Scene3375::Actor1::startAction(CursorType action, Event &event) { return true; } -bool Scene3375::Actor2::startAction(CursorType action, Event &event) { +bool Scene3375::Companion1::startAction(CursorType action, Event &event) { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -1839,7 +1842,7 @@ bool Scene3375::Actor2::startAction(CursorType action, Event &event) { return true; } -bool Scene3375::Actor3::startAction(CursorType action, Event &event) { +bool Scene3375::Webbster::startAction(CursorType action, Event &event) { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -1872,12 +1875,13 @@ bool Scene3375::Actor4::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3375; - scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_actor4, NULL); return true; } -void Scene3375::Exit1::changeScene() { +void Scene3375::LeftExit::changeScene() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -1891,17 +1895,17 @@ void Scene3375::Exit1::changeScene() { R2_GLOBALS._walkRegions.enableRegion(3); R2_GLOBALS._walkRegions.enableRegion(4); } - if (scene->_actor1._position.y != 163) { + if (scene->_companion1._position.y != 163) { R2_GLOBALS._player.setStrip(-1); - scene->_actor1.setStrip2(-1); - scene->_actor2.setStrip2(-1); - scene->_actor3.setStrip2(-1); - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); + scene->_companion1.setStrip2(-1); + scene->_companion2.setStrip2(-1); + scene->_webbster.setStrip2(-1); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); } else { R2_GLOBALS._player.setStrip2(2); - scene->_actor1.setStrip2(2); - scene->_actor2.setStrip2(2); - scene->_actor3.setStrip2(2); + scene->_companion1.setStrip2(2); + scene->_companion2.setStrip2(2); + scene->_webbster.setStrip2(2); R2_GLOBALS._sound2.play(314); Common::Point pt(50, 150); @@ -1910,7 +1914,7 @@ void Scene3375::Exit1::changeScene() { } } -void Scene3375::Exit2::changeScene() { +void Scene3375::DownExit::changeScene() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -1929,10 +1933,10 @@ void Scene3375::Exit2::changeScene() { R2_GLOBALS._walkRegions.enableRegion(3); R2_GLOBALS._walkRegions.enableRegion(4); } - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); } -void Scene3375::Exit3::changeScene() { +void Scene3375::RightExit::changeScene() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; _moving = false; @@ -1951,7 +1955,7 @@ void Scene3375::Exit3::changeScene() { R2_GLOBALS._walkRegions.enableRegion(3); R2_GLOBALS._walkRegions.enableRegion(4); } - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); } void Scene3375::postInit(SceneObjectList *OwnerList) { @@ -1974,7 +1978,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_QUINN] = 3375; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3375; - R2_GLOBALS._player._characterScene[3] = 3375; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3375; setZoomPercents(126, 55, 200, 167); R2_GLOBALS._player.postInit(); @@ -2010,16 +2014,16 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); + _companion1.postInit(); if (R2_GLOBALS._player._characterIndex == 2) { - _actor1._moveRate = 10; - _actor1._moveDiff = Common::Point(3, 2); + _companion1._moveRate = 10; + _companion1._moveDiff = Common::Point(3, 2); } else { - _actor1._moveRate = 7; - _actor1._moveDiff = Common::Point(5, 3); + _companion1._moveRate = 7; + _companion1._moveDiff = Common::Point(5, 3); } - _actor1.changeZoom(-1); - _actor1._effect = 1; + _companion1.changeZoom(-1); + _companion1._effect = 1; int tmpStrip, tmpVisage; if (R2_GLOBALS._sceneManager._previousScene == 3385) @@ -2032,13 +2036,13 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { else tmpVisage = 20; - _actor1.setup(tmpVisage, tmpStrip, 1); - _actor1.animate(ANIM_MODE_1, NULL); + _companion1.setup(tmpVisage, tmpStrip, 1); + _companion1.animate(ANIM_MODE_1, NULL); - _actor2.postInit(); - _actor2._moveDiff = Common::Point(3, 2); - _actor2.changeZoom(-1); - _actor2._effect = 1; + _companion2.postInit(); + _companion2._moveDiff = Common::Point(3, 2); + _companion2.changeZoom(-1); + _companion2._effect = 1; if (R2_GLOBALS._sceneManager._previousScene == 3385) tmpStrip = 1; else @@ -2049,25 +2053,25 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { else tmpVisage = 30; - _actor2.setup(tmpVisage, tmpStrip, 1); - _actor2.animate(ANIM_MODE_1, NULL); + _companion2.setup(tmpVisage, tmpStrip, 1); + _companion2.animate(ANIM_MODE_1, NULL); - _actor3.postInit(); - _actor3._moveRate = 7; - _actor3._moveDiff = Common::Point(5, 3); - _actor3.changeZoom(-1); - _actor3._effect = 1; + _webbster.postInit(); + _webbster._moveRate = 7; + _webbster._moveDiff = Common::Point(5, 3); + _webbster.changeZoom(-1); + _webbster._effect = 1; if (R2_GLOBALS._sceneManager._previousScene == 3385) tmpStrip = 1; else tmpStrip = 4; - _actor3.setup(40, tmpStrip, 1); - _actor3.animate(ANIM_MODE_1, NULL); + _webbster.setup(40, tmpStrip, 1); + _webbster.animate(ANIM_MODE_1, NULL); - _actor2.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); - _actor3.setDetails(3375, 21, -1, -1, 1, (SceneItem *)NULL); - _actor1.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); + _companion2.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); + _webbster.setDetails(3375, 21, -1, -1, 1, (SceneItem *)NULL); + _companion1.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); _actor4.postInit(); _actor4.setup(3375, 1, 1); @@ -2075,17 +2079,17 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { _actor4.fixPriority(140); _actor4.hide(); - _exit1.setDetails(Rect(0, 84, 24, 167), EXITCURSOR_W, 3375); - _exit1.setDest(Common::Point(65, 155)); - _exit2.setDetails(Rect(103, 152, 183, 170), SHADECURSOR_DOWN, 3375); - _exit2.setDest(Common::Point(158, 151)); - _exit3.setDetails(Rect(180, 75, 213, 132), EXITCURSOR_E, 3375); - _exit3.setDest(Common::Point(201, 131)); + _leftExit.setDetails(Rect(0, 84, 24, 167), EXITCURSOR_W, 3375); + _leftExit.setDest(Common::Point(65, 155)); + _downExit.setDetails(Rect(103, 152, 183, 170), SHADECURSOR_DOWN, 3375); + _downExit.setDest(Common::Point(158, 151)); + _rightExit.setDetails(Rect(180, 75, 213, 132), EXITCURSOR_E, 3375); + _rightExit.setDest(Common::Point(201, 131)); for (int i = 0; i <= 12; ++i) _itemArray[i].setDetails(i, 3375, 3, -1, -1); - _item1.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, 1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, 1, 1, NULL); if (R2_GLOBALS._sceneManager._previousScene == 3385) _sceneMode = 3379; @@ -2103,7 +2107,7 @@ void Scene3375::remove() { void Scene3375::signalCase3379() { switch (R2_GLOBALS._v56A9E) { case 0: - _exit1._enabled = true; + _leftExit._enabled = true; if (R2_GLOBALS._sceneManager._previousScene == 3385) R2_GLOBALS._walkRegions.disableRegion(1); else { @@ -2113,7 +2117,7 @@ void Scene3375::signalCase3379() { R2_GLOBALS._walkRegions.disableRegion(6); R2_GLOBALS._walkRegions.disableRegion(7); case 2: - _exit1._enabled = false; + _leftExit._enabled = false; R2_GLOBALS._walkRegions.disableRegion(2); R2_GLOBALS._walkRegions.disableRegion(3); R2_GLOBALS._walkRegions.disableRegion(5); @@ -2122,7 +2126,7 @@ void Scene3375::signalCase3379() { R2_GLOBALS._walkRegions.disableRegion(8); R2_GLOBALS._walkRegions.disableRegion(9); default: - _exit1._enabled = false; + _leftExit._enabled = false; R2_GLOBALS._walkRegions.disableRegion(2); R2_GLOBALS._walkRegions.disableRegion(3); R2_GLOBALS._walkRegions.disableRegion(5); @@ -2131,9 +2135,9 @@ void Scene3375::signalCase3379() { } R2_GLOBALS._sceneManager._previousScene = 3375; R2_GLOBALS._player._effect = 1; - _actor1._effect = 1; - _actor2._effect = 1; - _actor3._effect = 1; + _companion1._effect = 1; + _companion2._effect = 1; + _webbster._effect = 1; R2_GLOBALS._player.enableControl(CURSOR_WALK); } @@ -2150,27 +2154,27 @@ void Scene3375::signal() { case 3378: _sceneMode = _field1488; _field1488 = 0; - _actor1._effect = 6; - _actor1._shade = 4; - _actor2._effect = 6; - _actor2._shade = 4; - _actor3._effect = 6; - _actor3._shade = 4; + _companion1._effect = 6; + _companion1._shade = 4; + _companion2._effect = 6; + _companion2._shade = 4; + _webbster._effect = 6; + _webbster._shade = 4; subFC696(_sceneMode); break; case 3379: signalCase3379(); break; case 9999: - if (_actor1._position.y == 163) + if (_companion1._position.y == 163) R2_GLOBALS._player.setStrip(1); else R2_GLOBALS._player.setStrip(3); R2_GLOBALS._player.enableControl(CURSOR_TALK); default: - _actor1.setPriority(130); - _actor2.setPriority(132); - _actor3.setPriority(134); + _companion1.setPriority(130); + _companion2.setPriority(132); + _webbster.setPriority(134); signalCase3379(); break; } @@ -2182,28 +2186,29 @@ void Scene3375::dispatch() { else if ((R2_GLOBALS._player._position.y < 168) && (R2_GLOBALS._player._effect == 6)) R2_GLOBALS._player._effect = 1; - if ((_actor1._position.y >= 168) && (_actor1._effect == 1)) - _actor1._effect = 6; - else if ((_actor1._position.y < 168) && (_actor1._effect == 6)) - _actor1._effect = 1; + if ((_companion1._position.y >= 168) && (_companion1._effect == 1)) + _companion1._effect = 6; + else if ((_companion1._position.y < 168) && (_companion1._effect == 6)) + _companion1._effect = 1; - if ((_actor2._position.y >= 168) && (_actor2._effect == 1)) - _actor2._effect = 6; - else if ((_actor2._position.y < 168) && (_actor2._effect == 6)) - _actor2._effect = 1; + if ((_companion2._position.y >= 168) && (_companion2._effect == 1)) + _companion2._effect = 6; + else if ((_companion2._position.y < 168) && (_companion2._effect == 6)) + _companion2._effect = 1; - if ((_actor3._position.y >= 168) && (_actor3._effect == 1)) - _actor3._effect = 6; - else if ((_actor3._position.y < 168) && (_actor3._effect == 6)) - _actor3._effect = 1; + if ((_webbster._position.y >= 168) && (_webbster._effect == 1)) + _webbster._effect = 6; + else if ((_webbster._position.y < 168) && (_webbster._effect == 6)) + _webbster._effect = 1; Scene::dispatch(); } /*-------------------------------------------------------------------------- - * Scene 3385 - + * Scene 3385 - Corridor * *--------------------------------------------------------------------------*/ + Scene3385::Scene3385() { _field11B2 = 0; } @@ -2214,7 +2219,7 @@ void Scene3385::synchronize(Serializer &s) { s.syncAsSint16LE(_field11B2); } -bool Scene3385::Actor1::startAction(CursorType action, Event &event) { +bool Scene3385::Companion1::startAction(CursorType action, Event &event) { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -2229,7 +2234,7 @@ bool Scene3385::Actor1::startAction(CursorType action, Event &event) { return true; } -bool Scene3385::Actor2::startAction(CursorType action, Event &event) { +bool Scene3385::Companion2::startAction(CursorType action, Event &event) { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -2244,7 +2249,7 @@ bool Scene3385::Actor2::startAction(CursorType action, Event &event) { return true; } -bool Scene3385::Actor3::startAction(CursorType action, Event &event) { +bool Scene3385::Webbster::startAction(CursorType action, Event &event) { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -2256,7 +2261,7 @@ bool Scene3385::Actor3::startAction(CursorType action, Event &event) { return true; } -bool Scene3385::Actor4::startAction(CursorType action, Event &event) { +bool Scene3385::Door::startAction(CursorType action, Event &event) { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -2267,7 +2272,9 @@ bool Scene3385::Actor4::startAction(CursorType action, Event &event) { R2_GLOBALS._sound2.play(314); scene->_sceneMode = 3386; - scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, + NULL); return true; } @@ -2279,7 +2286,9 @@ void Scene3385::Exit1::changeScene() { scene->_sceneMode = 3387; if (R2_GLOBALS._sceneManager._previousScene == 3375) - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, NULL); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, + &scene->_webbster, NULL); else scene->signal(); } @@ -2336,73 +2345,73 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); + _companion1.postInit(); if (R2_GLOBALS._player._characterIndex == 2) { - _actor1._moveRate = 10; - _actor1._moveDiff = Common::Point(3, 2); + _companion1._moveRate = 10; + _companion1._moveDiff = Common::Point(3, 2); } else { - _actor1._moveRate = 7; - _actor1._moveDiff = Common::Point(5, 3); + _companion1._moveRate = 7; + _companion1._moveDiff = Common::Point(5, 3); } - _actor1.changeZoom(-1); - _actor1._effect = 1; + _companion1.changeZoom(-1); + _companion1._effect = 1; if (R2_GLOBALS._player._characterIndex == 2) - _actor1.setup(10, _field11B2, 1); + _companion1.setup(10, _field11B2, 1); else - _actor1.setup(20, _field11B2, 1); - _actor1.animate(ANIM_MODE_1, NULL); - _actor1.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); - - _actor2.postInit(); - _actor2._moveDiff = Common::Point(3, 2); - _actor2.changeZoom(-1); - _actor2._effect = 1; + _companion1.setup(20, _field11B2, 1); + _companion1.animate(ANIM_MODE_1, NULL); + _companion1.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); + + _companion2.postInit(); + _companion2._moveDiff = Common::Point(3, 2); + _companion2.changeZoom(-1); + _companion2._effect = 1; if (R2_GLOBALS._player._characterIndex == 3) - _actor2.setup(10, _field11B2, 1); + _companion2.setup(10, _field11B2, 1); else - _actor2.setup(30, _field11B2, 1); - _actor2.animate(ANIM_MODE_1, NULL); - _actor2.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); - - _actor3.postInit(); - _actor3._moveDiff = Common::Point(3, 2); - _actor3.changeZoom(-1); - _actor3._effect = 1; - _actor3.setup(40, _field11B2, 1); - _actor3.animate(ANIM_MODE_1, NULL); - _actor3.setDetails(3385, 15, -1, -1, 1, (SceneItem *) NULL); + _companion2.setup(30, _field11B2, 1); + _companion2.animate(ANIM_MODE_1, NULL); + _companion2.setDetails(3385, -1, -1, -1, 1, (SceneItem *) NULL); + + _webbster.postInit(); + _webbster._moveDiff = Common::Point(3, 2); + _webbster.changeZoom(-1); + _webbster._effect = 1; + _webbster.setup(40, _field11B2, 1); + _webbster.animate(ANIM_MODE_1, NULL); + _webbster.setDetails(3385, 15, -1, -1, 1, (SceneItem *) NULL); _exit1.setDetails(Rect(103, 152, 217, 170), SHADECURSOR_DOWN, 3395); _exit1.setDest(Common::Point(158, 151)); - _actor4.postInit(); - _actor4.setPosition(Common::Point(160, 100)); - _actor4.fixPriority(90); - _actor4.setDetails(3385, 3, 4, -1, 1, (SceneItem *) NULL); + _door.postInit(); + _door.setPosition(Common::Point(160, 100)); + _door.fixPriority(90); + _door.setDetails(3385, 3, 4, -1, 1, (SceneItem *) NULL); if (R2_GLOBALS._sceneManager._previousScene == 3375) { R2_GLOBALS._player.setPosition(Common::Point(158, 102)); - _actor1.setPosition(Common::Point(164, 100)); - _actor1.fixPriority(98); - _actor2.setPosition(Common::Point(150, 100)); - _actor2.fixPriority(97); - _actor3.setPosition(Common::Point(158, 100)); - _actor3.fixPriority(96); + _companion1.setPosition(Common::Point(164, 100)); + _companion1.fixPriority(98); + _companion2.setPosition(Common::Point(150, 100)); + _companion2.fixPriority(97); + _webbster.setPosition(Common::Point(158, 100)); + _webbster.fixPriority(96); _sceneMode = 3384; - _actor4.setup(3385, 1, 6); - _actor4.animate(ANIM_MODE_6, this); - setAction(&_action1, &_actor4); + _door.setup(3385, 1, 6); + _door.animate(ANIM_MODE_6, this); + setAction(&_action1, &_door); } else { R2_GLOBALS._player.setPosition(Common::Point(158, 230)); - _actor1.setPosition(Common::Point(191, 270)); - _actor2.setPosition(Common::Point(124, 255)); - _actor3.setPosition(Common::Point(155, 245)); - _actor4.setup(3385, 1, 1); + _companion1.setPosition(Common::Point(191, 270)); + _companion2.setPosition(Common::Point(124, 255)); + _webbster.setPosition(Common::Point(155, 245)); + _door.setup(3385, 1, 1); _sceneMode = 3385; - setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } - _item1.setDetails(Rect(0, 0, 320, 200), 3385, 0, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3385, 0, -1, -1, 1, NULL); R2_GLOBALS._v56A9E = 0; } @@ -2433,9 +2442,10 @@ void Scene3385::signal() { } /*-------------------------------------------------------------------------- - * Scene 3395 - + * Scene 3395 - Walkway * *--------------------------------------------------------------------------*/ + Scene3395::Scene3395() { _field142E = 0; } @@ -2446,7 +2456,7 @@ void Scene3395::synchronize(Serializer &s) { s.syncAsSint16LE(_field142E); } -bool Scene3395::Actor1::startAction(CursorType action, Event &event) { +bool Scene3395::Companion1::startAction(CursorType action, Event &event) { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -2461,7 +2471,7 @@ bool Scene3395::Actor1::startAction(CursorType action, Event &event) { return true; } -bool Scene3395::Actor2::startAction(CursorType action, Event &event) { +bool Scene3395::Companion2::startAction(CursorType action, Event &event) { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -2476,7 +2486,7 @@ bool Scene3395::Actor2::startAction(CursorType action, Event &event) { return true; } -bool Scene3395::Actor3::startAction(CursorType action, Event &event) { +bool Scene3395::Webbster::startAction(CursorType action, Event &event) { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_TALK) @@ -2488,7 +2498,7 @@ bool Scene3395::Actor3::startAction(CursorType action, Event &event) { return true; } -bool Scene3395::Actor4::startAction(CursorType action, Event &event) { +bool Scene3395::Door::startAction(CursorType action, Event &event) { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) @@ -2499,7 +2509,9 @@ bool Scene3395::Actor4::startAction(CursorType action, Event &event) { R2_GLOBALS._sound2.play(314); scene->_sceneMode = 3396; - scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, &scene->_actor1, &scene->_actor2, &scene->_actor3, &scene->_actor4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, + NULL); return true; } @@ -2556,77 +2568,77 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); + _companion1.postInit(); if (R2_GLOBALS._player._characterIndex == 2) { - _actor1._moveRate = 10; - _actor1._moveDiff = Common::Point(3, 2); + _companion1._moveRate = 10; + _companion1._moveDiff = Common::Point(3, 2); } else { - _actor1._moveRate = 7; - _actor1._moveDiff = Common::Point(5, 3); + _companion1._moveRate = 7; + _companion1._moveDiff = Common::Point(5, 3); } - _actor1.changeZoom(-1); - _actor1._effect = 1; + _companion1.changeZoom(-1); + _companion1._effect = 1; if (R2_GLOBALS._player._characterIndex == 2) - _actor1.setup(10, _field142E, 1); + _companion1.setup(10, _field142E, 1); else - _actor1.setup(20, _field142E, 1); - _actor1.animate(ANIM_MODE_1, NULL); - _actor1.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); - - _actor2.postInit(); - _actor2._moveDiff = Common::Point(3, 2); - _actor2.changeZoom(-1); - _actor2._effect = 1; - if (R2_GLOBALS._player._characterIndex == 3) - _actor2.setup(10, _field142E, 1); + _companion1.setup(20, _field142E, 1); + _companion1.animate(ANIM_MODE_1, NULL); + _companion1.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); + + _companion2.postInit(); + _companion2._moveDiff = Common::Point(3, 2); + _companion2.changeZoom(-1); + _companion2._effect = 1; + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) + _companion2.setup(10, _field142E, 1); else - _actor2.setup(30, _field142E, 1); - _actor2.animate(ANIM_MODE_1, NULL); - _actor2.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); + _companion2.setup(30, _field142E, 1); + _companion2.animate(ANIM_MODE_1, NULL); + _companion2.setDetails(3395, -1, -1, -1, 1, (SceneItem *) NULL); + + _webbster.postInit(); + _webbster._moveDiff = Common::Point(3, 2); + _webbster.changeZoom(-1); + _webbster._effect = 1; + _webbster.setup(40, _field142E, 1); + _webbster.animate(ANIM_MODE_1, NULL); + _webbster.setDetails(3395, 18, -1, -1, 1, (SceneItem *) NULL); - _actor3.postInit(); - _actor3._moveDiff = Common::Point(3, 2); - _actor3.changeZoom(-1); - _actor3._effect = 1; - _actor3.setup(40, _field142E, 1); - _actor3.animate(ANIM_MODE_1, NULL); - _actor3.setDetails(3385, 18, -1, -1, 1, (SceneItem *) NULL); - - _actor4.postInit(); - _actor4.setPosition(Common::Point(159, 50)); - _actor4.fixPriority(40); - _actor4.setDetails(3395, 6, 7, -1, 1, (SceneItem *) NULL); + _door.postInit(); + _door.setPosition(Common::Point(159, 50)); + _door.fixPriority(40); + _door.setDetails(3395, 6, 7, -1, 1, (SceneItem *) NULL); if (R2_GLOBALS._sceneManager._previousScene == 3385) { R2_GLOBALS._player.setPosition(Common::Point(158, 53)); - _actor1.setPosition(Common::Point(164, 51)); - _actor1.fixPriority(48); - _actor2.setPosition(Common::Point(150, 51)); - _actor2.fixPriority(47); - _actor3.setPosition(Common::Point(158, 51)); - _actor3.fixPriority(46); + _companion1.setPosition(Common::Point(164, 51)); + _companion1.fixPriority(48); + _companion2.setPosition(Common::Point(150, 51)); + _companion2.fixPriority(47); + _webbster.setPosition(Common::Point(158, 51)); + _webbster.fixPriority(46); _sceneMode = 3394; - _actor4.setup(3395, 1, 7); - _actor4.animate(ANIM_MODE_6, this); - setAction(&_action1, &_actor4); + _door.setup(3395, 1, 7); + _door.animate(ANIM_MODE_6, this); + setAction(&_action1, &_door); } else { R2_GLOBALS._player.setPosition(Common::Point(158, 200)); - _actor1.setPosition(Common::Point(191, 255)); - _actor2.setPosition(Common::Point(124, 240)); - _actor3.setPosition(Common::Point(155, 242)); - _actor4.setup(3395, 1, 1); + _companion1.setPosition(Common::Point(191, 255)); + _companion2.setPosition(Common::Point(124, 240)); + _webbster.setPosition(Common::Point(155, 242)); + _door.setup(3395, 1, 1); R2_GLOBALS._walkRegions.disableRegion(1); _sceneMode = 3395; - setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } for (int i = 0; i <= 12; i++) { - _itemArray[i].setDetails(i, 3995, 0, -1, -1); + _itemArray[i].setDetails(i, 3395, 0, -1, -1); } - _item1.setDetails(Rect(0, 0, 320, 200), 3395, 3, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, 320, 200), 3395, 3, -1, -1, 1, NULL); } void Scene3395::remove() { diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 96176d3d19..c37afa155d 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -395,28 +395,28 @@ public: }; class Scene3375 : public SceneExt { - class Actor1 : public SceneActor { + class Companion1 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Companion2 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Webbster : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; class Actor4 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Exit1 : public SceneExit { + class LeftExit : public SceneExit { public: virtual void changeScene(); }; - class Exit2 : public SceneExit { + class DownExit : public SceneExit { public: virtual void changeScene(); }; - class Exit3 : public SceneExit { + class RightExit : public SceneExit { public: virtual void changeScene(); }; @@ -429,15 +429,15 @@ public: SpeakerSeeker3375 _seekerSpeaker; SpeakerMiranda3375 _mirandaSpeaker; SpeakerWebbster3375 _webbsterSpeaker; - NamedHotspot _item1; + NamedHotspot _background; NamedHotspot _itemArray[13]; - Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; + Companion1 _companion1; + Companion2 _companion2; + Webbster _webbster; Actor4 _actor4; - Exit1 _exit1; - Exit2 _exit2; - Exit3 _exit3; + LeftExit _leftExit; + DownExit _downExit; + RightExit _rightExit; SequenceManager _sequenceManager; int _field1488; int _field148A[4]; @@ -452,16 +452,16 @@ public: }; class Scene3385 : public SceneExt { - class Actor1 : public SceneActor { + class Companion1 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Companion2 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Webbster : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -480,11 +480,11 @@ public: SpeakerSeeker3385 _seekerSpeaker; SpeakerMiranda3385 _mirandaSpeaker; SpeakerWebbster3385 _webbsterSpeaker; - NamedHotspot _item1; - Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; - Actor4 _actor4; + NamedHotspot _background; + Companion1 _companion1; + Companion2 _companion2; + Webbster _webbster; + Door _door; Exit1 _exit1; Action1 _action1; SequenceManager _sequenceManager; @@ -499,16 +499,16 @@ public: }; class Scene3395 : public SceneExt { - class Actor1 : public SceneActor { + class Companion1 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor2 : public SceneActor { + class Companion2 : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor3 : public SceneActor { + class Webbster : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -522,12 +522,12 @@ public: SpeakerSeeker3395 _seekerSpeaker; SpeakerMiranda3395 _mirandaSpeaker; SpeakerWebbster3395 _webbsterSpeaker; - NamedHotspot _item1; + NamedHotspot _background; NamedHotspot _itemArray[13]; - Actor1 _actor1; - Actor2 _actor2; - Actor3 _actor3; - Actor4 _actor4; + Companion1 _companion1; + Companion2 _companion2; + Webbster _webbster; + Door _door; Action1 _action1; SequenceManager _sequenceManager; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 12feafc65b..fb10fdcac9 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -630,7 +630,7 @@ void SpeakerMiranda3375::proc15() { if (R2_GLOBALS._player._characterIndex == 3) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -639,7 +639,7 @@ void SpeakerMiranda3375::proc15() { _object1._effect = 1; _object1.changeZoom(-1); - if (scene->_actor1._position.y != 163) + if (scene->_companion1._position.y != 163) R2_GLOBALS._player.setStrip(8); else R2_GLOBALS._player.setStrip(2); @@ -680,7 +680,7 @@ void SpeakerMiranda3385::proc15() { if (R2_GLOBALS._player._characterIndex == 3) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -729,7 +729,7 @@ void SpeakerMiranda3395::proc15() { if (R2_GLOBALS._player._characterIndex == 3) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -1503,9 +1503,9 @@ void SpeakerQuinn3375::proc15() { if (R2_GLOBALS._player._characterIndex == 1) _object2 = &R2_GLOBALS._player; else if (R2_GLOBALS._player._characterIndex == 2) - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -1514,7 +1514,7 @@ void SpeakerQuinn3375::proc15() { _object1._effect = 1; _object1.changeZoom(-1); - if (scene->_actor1._position.y != 163) + if (scene->_companion1._position.y != 163) R2_GLOBALS._player.setStrip(8); else R2_GLOBALS._player.setStrip(2); @@ -1554,9 +1554,9 @@ void SpeakerQuinn3385::proc15() { if (R2_GLOBALS._player._characterIndex == 1) _object2 = &R2_GLOBALS._player; else if (R2_GLOBALS._player._characterIndex == 2) - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -1609,9 +1609,9 @@ void SpeakerQuinn3395::proc15() { if (R2_GLOBALS._player._characterIndex == 1) _object2 = &R2_GLOBALS._player; else if (R2_GLOBALS._player._characterIndex == 2) - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -2215,10 +2215,10 @@ void SpeakerSeeker3375::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; _object2->hide(); _object1.postInit(); @@ -2227,7 +2227,7 @@ void SpeakerSeeker3375::proc15() { _object1._effect = 1; _object1.changeZoom(-1); - if (scene->_actor1._position.y != 163) + if (scene->_companion1._position.y != 163) R2_GLOBALS._player.setStrip(8); else R2_GLOBALS._player.setStrip(2); @@ -2264,10 +2264,10 @@ void SpeakerSeeker3385::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; _object2->hide(); _object1.postInit(); @@ -2313,10 +2313,10 @@ void SpeakerSeeker3395::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; _object2->hide(); _object1.postInit(); @@ -2918,7 +2918,7 @@ void SpeakerWebbster3375::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -2926,7 +2926,7 @@ void SpeakerWebbster3375::proc15() { _object1._effect = 1; _object1.changeZoom(-1); - if (scene->_actor1._position.y != 163) + if (scene->_companion1._position.y != 163) R2_GLOBALS._player.setStrip(8); else R2_GLOBALS._player.setStrip(2); @@ -2962,7 +2962,7 @@ void SpeakerWebbster3385::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -3006,7 +3006,7 @@ void SpeakerWebbster3395::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); -- cgit v1.2.3 From 3e59990a8eaa2234375a6f6cacaa19c195cd6369 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 24 Sep 2013 22:02:12 -0400 Subject: TSAGE: Bugfixes and renaming for R2R Circular Walkways --- engines/tsage/globals.cpp | 4 +- engines/tsage/globals.h | 2 +- engines/tsage/ringworld2/ringworld2_logic.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 128 +++++++++++++----------- engines/tsage/ringworld2/ringworld2_scenes3.h | 8 +- 5 files changed, 80 insertions(+), 64 deletions(-) (limited to 'engines') diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 10ed45f7da..0964db5497 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -463,7 +463,7 @@ void Ringworld2Globals::reset() { _desertWrongDirCtr = -1; _balloonAltitude = 5; _scene1925CurrLevel = 0; //_v56A9C - _v56A9E = 0; + _walkwaySceneNumber = 0; _v56AA0 = 0; _scientistConvIndex = 0; _ventCellPos = Common::Point(60, 660); @@ -529,7 +529,7 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_v566A6); s.syncAsSint16LE(_desertWrongDirCtr); s.syncAsSint16LE(_scene1925CurrLevel); // _v56A9C - s.syncAsSint16LE(_v56A9E); + s.syncAsSint16LE(_walkwaySceneNumber); s.syncAsSint16LE(_ventCellPos.x); s.syncAsSint16LE(_ventCellPos.y); s.syncAsSint16LE(_v56AAB); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 674b907f29..ad47f7f620 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -288,7 +288,7 @@ public: int _desertWrongDirCtr; byte _balloonAltitude; int _scene1925CurrLevel; //_v56A9C - int _v56A9E; + int _walkwaySceneNumber; byte _v56AA0; byte _scientistConvIndex; Common::Point _ventCellPos; diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 11a20247ef..4050c62a78 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -278,7 +278,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Cutscene - Ship landing return new Scene3350(); case 3375: - // Outer walkway + // Circular Walkway return new Scene3375(); case 3385: // Corridor diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 4ae95d625b..2188a487e5 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -1716,26 +1716,20 @@ void Scene3350::signal() { } /*-------------------------------------------------------------------------- - * Scene 3375 - Outer Walkway + * Scene 3375 - Circular Walkway * *--------------------------------------------------------------------------*/ -Scene3375::Scene3375() { - _field1488 = _field1492 = 0; - for (int i = 0; i < 4; ++i) - _field148A[i] = 0; -} - void Scene3375::synchronize(Serializer &s) { SceneExt::synchronize(s); s.syncAsSint16LE(_field1488); s.syncAsSint16LE(_field1492); for (int i = 0; i < 4; ++i) - s.syncAsSint16LE(_field148A[i]); + s.syncAsSint16LE(_sceneAreas[i]); } -void Scene3375::subFC696(int sceneMode) { +void Scene3375::enterArea(int sceneMode) { switch (sceneMode) { case 3379: R2_GLOBALS._player.setPosition(Common::Point(0, 155)); @@ -1744,11 +1738,11 @@ void Scene3375::subFC696(int sceneMode) { _webbster.setPosition(Common::Point(-20, 152)); break; case 3380: - ++R2_GLOBALS._v56A9E; - if (R2_GLOBALS._v56A9E >= 4) - R2_GLOBALS._v56A9E = 0; + ++R2_GLOBALS._walkwaySceneNumber; + if (R2_GLOBALS._walkwaySceneNumber >= 4) + R2_GLOBALS._walkwaySceneNumber = 0; - loadScene(_field148A[R2_GLOBALS._v56A9E]); + loadScene(_sceneAreas[R2_GLOBALS._walkwaySceneNumber]); R2_GLOBALS._uiElements.show(); R2_GLOBALS._player.setStrip(4); @@ -1762,11 +1756,11 @@ void Scene3375::subFC696(int sceneMode) { _webbster._effect = 1; break; case 3381: - --R2_GLOBALS._v56A9E; - if (R2_GLOBALS._v56A9E < 0) - R2_GLOBALS._v56A9E = 3; + --R2_GLOBALS._walkwaySceneNumber; + if (R2_GLOBALS._walkwaySceneNumber < 0) + R2_GLOBALS._walkwaySceneNumber = 3; - loadScene(_field148A[R2_GLOBALS._v56A9E]); + loadScene(_sceneAreas[R2_GLOBALS._walkwaySceneNumber]); R2_GLOBALS._uiElements.show(); R2_GLOBALS._player.setStrip(6); @@ -1788,22 +1782,22 @@ void Scene3375::subFC696(int sceneMode) { break; } - if (R2_GLOBALS._v56A9E == 2) { - R2_GLOBALS._sceneItems.remove(&_actor4); + if (R2_GLOBALS._walkwaySceneNumber == 2) { + R2_GLOBALS._sceneItems.remove(&_door); for (int i = 0; i <= 12; i++) R2_GLOBALS._sceneItems.remove(&_itemArray[i]); R2_GLOBALS._sceneItems.remove(&_background); - _actor4.show(); - _actor4.setDetails(3375, 9, 10, -1, 1, (SceneItem *)NULL); + _door.show(); + _door.setDetails(3375, 9, 10, -1, 1, (SceneItem *)NULL); for (int i = 0; i <= 12; i++) _itemArray[i].setDetails(3375, 3, -1, -1); _background.setDetails(Rect(0, 0, 320, 200), 3375, 0, -1, -1, 1, NULL); } else { - _actor4.hide(); - R2_GLOBALS._sceneItems.remove(&_actor4); + _door.hide(); + R2_GLOBALS._sceneItems.remove(&_door); } if (_sceneMode == 0) @@ -1854,13 +1848,13 @@ bool Scene3375::Webbster::startAction(CursorType action, Event &event) { return true; } -bool Scene3375::Actor4::startAction(CursorType action, Event &event) { +bool Scene3375::Door::startAction(CursorType action, Event &event) { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; if (action != CURSOR_USE) return SceneActor::startAction(action, event); - if (R2_GLOBALS._v56A9E != 0) { + if (R2_GLOBALS._walkwaySceneNumber != 0) { R2_GLOBALS._walkRegions.enableRegion(2); R2_GLOBALS._walkRegions.enableRegion(3); } else { @@ -1876,7 +1870,7 @@ bool Scene3375::Actor4::startAction(CursorType action, Event &event) { scene->_sceneMode = 3375; scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, - &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_actor4, NULL); + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); return true; } @@ -1887,7 +1881,7 @@ void Scene3375::LeftExit::changeScene() { _moving = false; R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3376; - if (R2_GLOBALS._v56A9E != 0) { + if (R2_GLOBALS._walkwaySceneNumber != 0) { R2_GLOBALS._walkRegions.enableRegion(2); R2_GLOBALS._walkRegions.enableRegion(3); } else { @@ -1896,7 +1890,7 @@ void Scene3375::LeftExit::changeScene() { R2_GLOBALS._walkRegions.enableRegion(4); } if (scene->_companion1._position.y != 163) { - R2_GLOBALS._player.setStrip(-1); + R2_GLOBALS._player.setStrip2(-1); scene->_companion1.setStrip2(-1); scene->_companion2.setStrip2(-1); scene->_webbster.setStrip2(-1); @@ -1925,7 +1919,7 @@ void Scene3375::DownExit::changeScene() { scene->_sceneMode = 3377; scene->_field1488 = 3381; - if (R2_GLOBALS._v56A9E != 0) { + if (R2_GLOBALS._walkwaySceneNumber != 0) { R2_GLOBALS._walkRegions.enableRegion(2); R2_GLOBALS._walkRegions.enableRegion(3); } else { @@ -1947,7 +1941,7 @@ void Scene3375::RightExit::changeScene() { scene->_sceneMode = 3378; scene->_field1488 = 3380; - if (R2_GLOBALS._v56A9E != 0) { + if (R2_GLOBALS._walkwaySceneNumber != 0) { R2_GLOBALS._walkRegions.enableRegion(2); R2_GLOBALS._walkRegions.enableRegion(3); } else { @@ -1958,13 +1952,17 @@ void Scene3375::RightExit::changeScene() { scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); } -void Scene3375::postInit(SceneObjectList *OwnerList) { - _field148A[0] = 3376; - _field148A[1] = 3377; - _field148A[2] = 3375; - _field148A[3] = 3378; +Scene3375::Scene3375() { + _field1488 = _field1492 = 0; + + _sceneAreas[0] = 3376; + _sceneAreas[1] = 3377; + _sceneAreas[2] = 3375; + _sceneAreas[3] = 3378; +} - loadScene(_field148A[R2_GLOBALS._v56A9E]); +void Scene3375::postInit(SceneObjectList *OwnerList) { + loadScene(_sceneAreas[R2_GLOBALS._walkwaySceneNumber]); SceneExt::postInit(); R2_GLOBALS._sound1.play(313); @@ -1983,7 +1981,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { setZoomPercents(126, 55, 200, 167); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player._moveDiff = Common::Point(5, 3); } else { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); @@ -1991,13 +1989,13 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.changeZoom(-1); switch (R2_GLOBALS._player._characterIndex) { - case 2: + case R2_SEEKER: if (R2_GLOBALS._sceneManager._previousScene == 3385) R2_GLOBALS._player.setup(20, 1, 1); else R2_GLOBALS._player.setup(20, 3, 1); break; - case 3: + case R2_MIRANDA: if (R2_GLOBALS._sceneManager._previousScene == 3385) R2_GLOBALS._player.setup(30, 1, 1); else @@ -2015,7 +2013,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.disableControl(); _companion1.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _companion1._moveRate = 10; _companion1._moveDiff = Common::Point(3, 2); } else { @@ -2031,7 +2029,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { else tmpStrip = 4; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) tmpVisage = 10; else tmpVisage = 20; @@ -2048,7 +2046,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { else tmpStrip = 8; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) tmpVisage = 10; else tmpVisage = 30; @@ -2073,11 +2071,11 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { _webbster.setDetails(3375, 21, -1, -1, 1, (SceneItem *)NULL); _companion1.setDetails(3375, -1, -1, -1, 1, (SceneItem *)NULL); - _actor4.postInit(); - _actor4.setup(3375, 1, 1); - _actor4.setPosition(Common::Point(254, 166)); - _actor4.fixPriority(140); - _actor4.hide(); + _door.postInit(); + _door.setup(3375, 1, 1); + _door.setPosition(Common::Point(254, 166)); + _door.fixPriority(140); + _door.hide(); _leftExit.setDetails(Rect(0, 84, 24, 167), EXITCURSOR_W, 3375); _leftExit.setDest(Common::Point(65, 155)); @@ -2096,7 +2094,7 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { else _sceneMode = 0; - subFC696(_sceneMode); + enterArea(_sceneMode); } void Scene3375::remove() { @@ -2105,17 +2103,30 @@ void Scene3375::remove() { } void Scene3375::signalCase3379() { - switch (R2_GLOBALS._v56A9E) { + switch (R2_GLOBALS._walkwaySceneNumber) { case 0: _leftExit._enabled = true; - if (R2_GLOBALS._sceneManager._previousScene == 3385) - R2_GLOBALS._walkRegions.disableRegion(1); - else { + if (R2_GLOBALS._sceneManager._previousScene == 3385) { + // WORKAROUND: The original disables the left entry region here for + // some reason. But there's also some walk issue even I leave it enabled. + // Instead, for now, add an extra walk into the properly enabled regions + _sceneMode = 1; + ADD_MOVER(R2_GLOBALS._player, 70, R2_GLOBALS._player._position.y); + R2_GLOBALS._sceneManager._previousScene = 3375; + R2_GLOBALS._player._effect = 1; + _companion1._effect = 1; + _companion2._effect = 1; + _webbster._effect = 1; + + return; + //R2_GLOBALS._walkRegions.disableRegion(1); + } else { R2_GLOBALS._walkRegions.disableRegion(3); R2_GLOBALS._walkRegions.disableRegion(4); } R2_GLOBALS._walkRegions.disableRegion(6); R2_GLOBALS._walkRegions.disableRegion(7); + break; case 2: _leftExit._enabled = false; R2_GLOBALS._walkRegions.disableRegion(2); @@ -2125,6 +2136,7 @@ void Scene3375::signalCase3379() { R2_GLOBALS._walkRegions.disableRegion(7); R2_GLOBALS._walkRegions.disableRegion(8); R2_GLOBALS._walkRegions.disableRegion(9); + break; default: _leftExit._enabled = false; R2_GLOBALS._walkRegions.disableRegion(2); @@ -2143,6 +2155,9 @@ void Scene3375::signalCase3379() { void Scene3375::signal() { switch (_sceneMode) { + case 1: + R2_GLOBALS._player.enableControl(); + break; case 3375: R2_GLOBALS._sceneManager.changeScene(3400); break; @@ -2160,7 +2175,7 @@ void Scene3375::signal() { _companion2._shade = 4; _webbster._effect = 6; _webbster._shade = 4; - subFC696(_sceneMode); + enterArea(_sceneMode); break; case 3379: signalCase3379(); @@ -2412,7 +2427,7 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { } _background.setDetails(Rect(0, 0, 320, 200), 3385, 0, -1, -1, 1, NULL); - R2_GLOBALS._v56A9E = 0; + R2_GLOBALS._walkwaySceneNumber = 0; } void Scene3385::remove() { @@ -2680,7 +2695,8 @@ void Scene3400::synchronize(Serializer &s) { void Scene3400::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); + _sceneBounds = Rect(160, 0, 480, 200); + loadScene(3400); _field157C = 0; R2_GLOBALS._v558B6.set(60, 0, 260, 200); @@ -4389,7 +4405,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._v558B6.set(60, 0, 260, 200); } else { R2_GLOBALS._scrollFollower = &_actor2; - g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0)); + _sceneBounds = Rect(160, 0, 480, 200); R2_GLOBALS._v558B6.set(25, 0, 260, 200); } diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index c37afa155d..82eafdcdc2 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -404,7 +404,7 @@ class Scene3375 : public SceneExt { class Webbster : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; - class Actor4 : public SceneActor { + class Door : public SceneActor { virtual bool startAction(CursorType action, Event &event); }; @@ -422,7 +422,7 @@ class Scene3375 : public SceneExt { }; void signalCase3379(); - void subFC696(int sceneMode); + void enterArea(int sceneMode); public: SpeakerQuinn3375 _quinnSpeaker; @@ -434,13 +434,13 @@ public: Companion1 _companion1; Companion2 _companion2; Webbster _webbster; - Actor4 _actor4; + Door _door; LeftExit _leftExit; DownExit _downExit; RightExit _rightExit; SequenceManager _sequenceManager; int _field1488; - int _field148A[4]; + int _sceneAreas[4]; int _field1492; Scene3375(); -- cgit v1.2.3 From 83b2507011c5005c5b060442f2bcdfdd3e840f0a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 24 Sep 2013 23:24:33 +0300 Subject: FULLPIPE: Prototyping for MctlCompound --- engines/fullpipe/motion.cpp | 18 ++++++++++++++++-- engines/fullpipe/motion.h | 34 ++++++++++++++++++++++++---------- 2 files changed, 40 insertions(+), 12 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 337c1817dd..42aae55361 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -74,14 +74,26 @@ bool MctlCompound::load(MfcArchive &file) { return true; } -void MctlCompound::addObject(StaticANIObject *obj) { +int MctlCompound::addObject(StaticANIObject *obj) { warning("STUB: MctlCompound::addObject()"); + + return 0; +} + +int MctlCompound::removeObject(StaticANIObject *obj) { + warning("STUB: MctlCompound::removeObject()"); + + return 0; } void MctlCompound::initMovGraph2() { warning("STUB: MctlCompound::initMovGraph2()"); } +void MctlCompound::freeItems() { + warning("STUB: MctlCompound::freeItems()"); +} + MessageQueue *MctlCompound::method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { warning("STUB: MctlCompound::method34()"); @@ -133,8 +145,10 @@ bool MovGraph::load(MfcArchive &file) { return true; } -void MovGraph::addObject(StaticANIObject *obj) { +int MovGraph::addObject(StaticANIObject *obj) { warning("STUB: MovGraph::addObject()"); + + return 0; } double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int flag) { diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index d666bc5cd4..733fa0839e 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -36,13 +36,25 @@ public: public: MotionController() : _isEnabled(true), _field_4(0) {} + virtual ~MotionController() {} virtual bool load(MfcArchive &file); - - void setEnabled() { _isEnabled = true; } - void clearEnabled() { _isEnabled = false; } - - virtual void addObject(StaticANIObject *obj) {} + virtual void methodC() {} + virtual void method10() {} + virtual void clearEnabled() { _isEnabled = false; } + virtual void setEnabled() { _isEnabled = true; } + virtual int addObject(StaticANIObject *obj) { return 0; } + virtual int removeObject(StaticANIObject *obj) { return 0; } virtual void freeItems() {} + virtual int method28() { return 0; } + virtual int method2C() { return 0; } + virtual int method30() { return 0; } + virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { return 0; } + virtual int changeCallback() { return 0; } + virtual int method3C() { return 0; } + virtual int method40() { return 0; } + virtual int method44() { return 0; } + virtual int method48() { return -1; } + virtual MessageQueue *method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { return 0; } }; class MctlCompoundArray : public Common::Array, public CObject { @@ -61,11 +73,13 @@ class MctlCompound : public MotionController { public: virtual bool load(MfcArchive &file); - virtual void addObject(StaticANIObject *obj); - void initMovGraph2(); + virtual int addObject(StaticANIObject *obj); + virtual int removeObject(StaticANIObject *obj); + virtual void freeItems(); + virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); + virtual MessageQueue *method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); - MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); - MessageQueue *method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); + void initMovGraph2(); }; class Unk2 : public CObject { @@ -170,7 +184,7 @@ class MovGraph : public MotionController { MovGraph(); virtual bool load(MfcArchive &file); - virtual void addObject(StaticANIObject *obj); + virtual int addObject(StaticANIObject *obj); double calcDistance(Common::Point *point, MovGraphLink *link, int flag); MovGraphNode *calcOffset(int ox, int oy); -- cgit v1.2.3 From 036c9fd6a9fc4218b9d21e7e5d1ec6964aca3b37 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 25 Sep 2013 09:35:07 +0300 Subject: FULLPIPE: Added MctlCompound object type --- engines/fullpipe/motion.h | 2 ++ engines/fullpipe/utils.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 733fa0839e..b0bfe92d1f 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -71,6 +71,8 @@ class MctlCompound : public MotionController { MctlCompoundArray _motionControllers; public: + MctlCompound() { _objtype = kObjTypeMctlCompound; } + virtual bool load(MfcArchive &file); virtual int addObject(StaticANIObject *obj); diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index 3223b9c76c..e593bd9f18 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -69,7 +69,8 @@ enum ObjType { kObjTypeObjstateCommand, kObjTypeStaticANIObject, kObjTypePictureObject, - kObjTypeMovGraph + kObjTypeMovGraph, + kObjTypeMctlCompound }; class CObject { -- cgit v1.2.3 From 008eb251df09e569781d6dcc28a273147bbd590a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 26 Sep 2013 00:07:31 +0300 Subject: FULLPIPE: Started implementation of MctlCompound::initMovGraph2() --- engines/fullpipe/motion.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 42aae55361..b63267c572 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -87,7 +87,29 @@ int MctlCompound::removeObject(StaticANIObject *obj) { } void MctlCompound::initMovGraph2() { - warning("STUB: MctlCompound::initMovGraph2()"); +#if 0 + if (_objtype != kObjTypeMctlCompound) + return; + + for (uint i = 0; i < _motionControllers.size(); i++) { + if (_motionControllers[i]->_motionControllerObj->_objtype != kObjTypeMovGraph) + continue; + + MovGraph *gr = (MovGraph *)_motionControllers[i]->_motionControllerObj; + + CMovGraph2 *newgr = new MovGraph2(); + + newgr->_links.push_back(gr->_links); + newgr->_nodes.push_back(gr->_nodes); + + gr->_links.clear(); + gr->_nodes.clear(); + + delete gr; + + _motionControllers[i]->_motionControllerObj = newgr; + } +#endif } void MctlCompound::freeItems() { -- cgit v1.2.3 From ade516a996fc99d161504456b374f476e2333641 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 26 Sep 2013 02:16:02 +0200 Subject: WINTERMUTE: Fix warning --- engines/wintermute/graphics/transform_struct.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/wintermute/graphics/transform_struct.h b/engines/wintermute/graphics/transform_struct.h index 2d98dc4599..90a4c1f846 100644 --- a/engines/wintermute/graphics/transform_struct.h +++ b/engines/wintermute/graphics/transform_struct.h @@ -40,7 +40,7 @@ const int32 kDefaultHotspotX = 0; const int32 kDefaultHotspotY = 0; const int32 kDefaultOffsetX = 0; const int32 kDefaultOffsetY = 0; -const uint32 kDefaultAngle = 0; +const int32 kDefaultAngle = 0; struct TransformStruct { private: -- cgit v1.2.3 From abfae92fa61c504c5e26f63f7f59d9643e2bfa95 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 25 Sep 2013 21:36:12 -0400 Subject: TSAGE: Renaming and bugfixes for R2R confrontation --- engines/tsage/core.cpp | 17 ++- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 139 ++++++++++++----------- engines/tsage/ringworld2/ringworld2_scenes3.h | 8 +- engines/tsage/ringworld2/ringworld2_speakers.cpp | 48 ++++---- 4 files changed, 109 insertions(+), 103 deletions(-) (limited to 'engines') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 029f9b5075..b0220b53e0 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2370,12 +2370,17 @@ void SceneObject::animate(AnimateMode animMode, ...) { case ANIM_MODE_8: case ANIM_MODE_9: - _field68 = va_arg(va, int); - _endAction = va_arg(va, Action *); - _frameChange = 1; - _endFrame = getFrameCount(); - if (_frame == _endFrame) - setFrame(getNewFrame()); + if (_animateMode == ANIM_MODE_9 && g_vm->getGameID() == GType_Ringworld2) { + _frameChange = -1; + _field2E = _position; + } else { + _field68 = va_arg(va, int); + _endAction = va_arg(va, Action *); + _frameChange = 1; + _endFrame = getFrameCount(); + if (_frame == _endFrame) + setFrame(getNewFrame()); + } break; } va_end(va); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 2188a487e5..d60b286f79 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -2680,9 +2680,10 @@ void Scene3395::signal() { } /*-------------------------------------------------------------------------- - * Scene 3400 - + * Scene 3400 - Confrontation * *--------------------------------------------------------------------------*/ + Scene3400::Scene3400() { _field157C = 0; } @@ -2722,16 +2723,16 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { _actor7.fixPriority(89); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player._moveDiff = Common::Point(5, 3); else R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.changeZoom(-1); R2_GLOBALS._player.setPosition(Common::Point(239, 64)); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setup(20, 5, 1); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) R2_GLOBALS._player.setup(30, 5, 1); else R2_GLOBALS._player.setup(10, 5, 1); @@ -2739,42 +2740,42 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.disableControl(); - _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { - _actor1._numFrames = 10; - _actor1._moveDiff = Common::Point(3, 2); + _companion1.postInit(); + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + _companion1._numFrames = 10; + _companion1._moveDiff = Common::Point(3, 2); } else { - _actor1._numFrames = 7; - _actor1._moveDiff = Common::Point(5, 3); + _companion1._numFrames = 7; + _companion1._moveDiff = Common::Point(5, 3); } - _actor1.changeZoom(-1); - _actor1._effect = 1; - _actor1.setPosition(Common::Point(247, 63)); + _companion1.changeZoom(-1); + _companion1._effect = 1; + _companion1.setPosition(Common::Point(247, 63)); if (R2_GLOBALS._player._characterIndex == 2) - _actor1.setup(10, 5, 1); + _companion1.setup(10, 5, 1); else - _actor1.setup(20, 5, 1); - _actor1.animate(ANIM_MODE_1, NULL); + _companion1.setup(20, 5, 1); + _companion1.animate(ANIM_MODE_1, NULL); - _actor2.postInit(); - _actor2._moveDiff = Common::Point(3, 2); - _actor2.changeZoom(-1); - _actor2._effect = 1; - _actor2.setPosition(Common::Point(225, 63)); + _companion2.postInit(); + _companion2._moveDiff = Common::Point(3, 2); + _companion2.changeZoom(-1); + _companion2._effect = 1; + _companion2.setPosition(Common::Point(225, 63)); if (R2_GLOBALS._player._characterIndex == 3) - _actor2.setup(10, 5, 1); + _companion2.setup(10, 5, 1); else - _actor2.setup(30, 5, 1); - _actor2.animate(ANIM_MODE_1, NULL); + _companion2.setup(30, 5, 1); + _companion2.animate(ANIM_MODE_1, NULL); - _actor3.postInit(); - _actor3._numFrames = 7; - _actor3._moveDiff = Common::Point(5, 3); - _actor3.changeZoom(-1); - _actor3._effect = 1; - _actor3.setPosition(Common::Point(235, 61)); - _actor3.setup(40, 3, 1); - _actor3.animate(ANIM_MODE_1, NULL); + _webbster.postInit(); + _webbster._numFrames = 7; + _webbster._moveDiff = Common::Point(5, 3); + _webbster.changeZoom(-1); + _webbster._effect = 1; + _webbster.setPosition(Common::Point(235, 61)); + _webbster.setup(40, 3, 1); + _webbster.animate(ANIM_MODE_1, NULL); _actor6.postInit(); _actor6.setup(3400, 1, 6); @@ -2784,7 +2785,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { R2_GLOBALS.clearFlag(71); _sceneMode = 3400; - setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } void Scene3400::remove() { @@ -2798,30 +2799,30 @@ void Scene3400::signal() { case 3305: { warning("STUB: sub_1D227()"); _tealSpeaker._object1.hide(); - _actor4.show(); - _actor4.setStrip(1); + _teal.show(); + _teal.setStrip(1); Common::Point pt(158, 190); NpcMover *mover = new NpcMover(); - _actor4.addMover(mover, &pt, this); + _teal.addMover(mover, &pt, this); _sceneMode = 3402; - setAction(&_sequenceManager, this, 3402, &R2_GLOBALS._player, &_actor1, &_actor2, &_actor3, NULL); + setAction(&_sequenceManager, this, 3402, &R2_GLOBALS._player, &_companion1, &_companion2, &_webbster, NULL); } break; case 3306: R2_GLOBALS._sound2.play(318); - _actor1.setStrip(2); + _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); - _actor2.setStrip(6); - _actor3.setStrip(3); - _actor4.setStrip(1); + _companion2.setStrip(6); + _webbster.setStrip(3); + _teal.setStrip(1); R2_INVENTORY.setObjectScene(R2_SAPPHIRE_BLUE, 0); _stripManager.start(3307, this); if (R2_GLOBALS._player._characterIndex == 2) { _sceneMode = 3400; - R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_actor4, &_actor8, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_actor8, NULL); } else { _sceneMode = 3408; - _actor1.setAction(&_sequenceManager, this, 3408, &_actor1, &_actor4, &_actor8, NULL); + _companion1.setAction(&_sequenceManager, this, 3408, &_companion1, &_teal, &_actor8, NULL); } break; case 3307: @@ -2837,63 +2838,63 @@ void Scene3400::signal() { break; case 3308: warning("STUB: sub_1D227()"); - _actor1.setStrip(2); + _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); - _actor2.setStrip(6); - _actor3.setStrip(3); - _actor4.setStrip(1); + _companion2.setStrip(6); + _webbster.setStrip(3); + _teal.setStrip(1); _sceneMode = 3403; if (R2_GLOBALS._player._characterIndex == 2) - setAction(&_sequenceManager, this, 3403, &R2_GLOBALS._player, &_actor3, &_actor7, NULL); + setAction(&_sequenceManager, this, 3403, &R2_GLOBALS._player, &_webbster, &_actor7, NULL); else - setAction(&_sequenceManager, this, 3403, &_actor1, &_actor3, &_actor7, NULL); + setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_actor7, NULL); break; case 3309: warning("STUB: sub_1D227()"); - _actor4.setStrip(1); + _teal.setStrip(1); _sceneMode = 3405; if (R2_GLOBALS._player._characterIndex == 3) setAction(&_sequenceManager, this, 3405, &R2_GLOBALS._player, &_actor7, NULL); else - setAction(&_sequenceManager, this, 3405, &_actor2, &_actor7, NULL); + setAction(&_sequenceManager, this, 3405, &_companion2, &_actor7, NULL); break; case 3310: warning("STUB: sub_1D227()"); - _actor4.setStrip(1); + _teal.setStrip(1); _sceneMode = 3406; if (R2_GLOBALS._player._characterIndex == 1) setAction(&_sequenceManager, this, 3406, &R2_GLOBALS._player, &_actor7, NULL); else if (R2_GLOBALS._player._characterIndex == 2) - setAction(&_sequenceManager, this, 3406, &_actor1, &_actor7, NULL); + setAction(&_sequenceManager, this, 3406, &_companion1, &_actor7, NULL); else if (R2_GLOBALS._player._characterIndex == 3) - setAction(&_sequenceManager, this, 3406, &_actor2, &_actor7, NULL); + setAction(&_sequenceManager, this, 3406, &_companion2, &_actor7, NULL); break; case 3311: warning("STUB: sub_1D227()"); _tealSpeaker._object1.hide(); - _actor4.show(); - _actor4.setStrip(1); + _teal.show(); + _teal.setStrip(1); _sceneMode = 3407; - setAction(&_sequenceManager, this, 3407, &_actor4, &_actor7, NULL); + setAction(&_sequenceManager, this, 3407, &_teal, &_actor7, NULL); break; case 3400: { _actor8.postInit(); _actor8.hide(); - _actor4.postInit(); - _actor4._numFrames = 7; - _actor4._moveDiff = Common::Point(3, 2); - _actor4.changeZoom(-1); - _actor4._effect = 1; - _actor4.setPosition(Common::Point(-15, 90)); - _actor4.setup(3402, 1, 1); - _actor4.animate(ANIM_MODE_1, NULL); + _teal.postInit(); + _teal._numFrames = 7; + _teal._moveDiff = Common::Point(3, 2); + _teal.changeZoom(-1); + _teal._effect = 1; + _teal.setPosition(Common::Point(-15, 90)); + _teal.setup(3402, 1, 1); + _teal.animate(ANIM_MODE_1, NULL); Common::Point pt1(115, 90); NpcMover *mover1 = new NpcMover(); - _actor4.addMover(mover1, &pt1, this); - R2_GLOBALS._scrollFollower = &_actor4; + _teal.addMover(mover1, &pt1, this); + R2_GLOBALS._scrollFollower = &_teal; Common::Point pt2(203, 76); NpcMover *mover2 = new NpcMover(); - _actor3.addMover(mover2, &pt2, NULL); + _webbster.addMover(mover2, &pt2, NULL); _sceneMode = 3401; } break; @@ -4611,7 +4612,7 @@ void Scene3600::remove() { void Scene3600::signal() { switch (_sceneMode) { case 3320: - warning("STUB: sub_1D227()"); + // TODO: warning("STUB: sub_1D227()"); R2_GLOBALS._walkRegions.disableRegion(14); R2_GLOBALS._scrollFollower = &_actor11; _tealSpeaker._object1.hide(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 82eafdcdc2..f9a4bf73ff 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -547,10 +547,10 @@ public: SpeakerMiranda3400 _mirandaSpeaker; SpeakerWebbster3400 _webbsterSpeaker; SpeakerTeal3400 _tealSpeaker; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; + SceneActor _companion1; + SceneActor _companion2; + SceneActor _webbster; + SceneActor _teal; SceneActor _actor5; SceneActor _actor6; SceneActor _actor7; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index fb10fdcac9..2cf5201c43 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -779,7 +779,7 @@ void SpeakerMiranda3400::proc15() { if (R2_GLOBALS._player._characterIndex == 3) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -801,12 +801,12 @@ void SpeakerMiranda3400::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4051, 5, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4050, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -1664,9 +1664,9 @@ void SpeakerQuinn3400::proc15() { if (R2_GLOBALS._player._characterIndex == 1) _object2 = &R2_GLOBALS._player; else if (R2_GLOBALS._player._characterIndex == 2) - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; else - _object2 = &scene->_actor2; + _object2 = &scene->_companion2; _object2->hide(); _object1.postInit(); @@ -1691,12 +1691,12 @@ void SpeakerQuinn3400::proc15() { case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4010, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4012, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -2365,7 +2365,7 @@ void SpeakerSeeker3400::proc15() { if (R2_GLOBALS._player._characterIndex == 2) _object2 = &R2_GLOBALS._player; else - _object2 = &scene->_actor1; + _object2 = &scene->_companion1; _object2->hide(); _object1.postInit(); @@ -2387,27 +2387,27 @@ void SpeakerSeeker3400::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4031, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4031, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4030, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 4: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4031, 7, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 5: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4033, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -2714,7 +2714,7 @@ void SpeakerTeal3400::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor4; + _object2 = &scene->_teal; _object2->hide(); _object1.postInit(); _object1._numFrames = 7; @@ -2731,8 +2731,8 @@ void SpeakerTeal3400::proc15() { if (scene ->_sceneMode == 3305) { R2_GLOBALS._player.setStrip(6); - scene->_actor1.setStrip(6); - scene->_actor2.setStrip(6); + scene->_companion1.setStrip(6); + scene->_companion2.setStrip(6); } switch (v) { @@ -2742,22 +2742,22 @@ void SpeakerTeal3400::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4107, 5, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4107, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4107, 7, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 4: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4107, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -3050,7 +3050,7 @@ void SpeakerWebbster3400::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_webbster; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -3071,17 +3071,17 @@ void SpeakerWebbster3400::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4110, 5, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4110, 7, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; _object1.setup(4110, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); -- cgit v1.2.3 From 916fa0ce84f3ded0c542ebc62c768615865cbdf7 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 10:11:02 +0300 Subject: TSAGE: Minor renaming for R2R Rename the R2R character indexes to the corresponding character enum (i.e. R2_NONE, R2_QUINN, R2_SEEKER, R2_MIRANDA) --- engines/tsage/globals.cpp | 2 +- engines/tsage/ringworld2/ringworld2_dialogs.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes0.cpp | 16 ++-- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes2.cpp | 106 +++++++++++----------- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 108 +++++++++++------------ engines/tsage/ringworld2/ringworld2_speakers.cpp | 54 ++++++------ 7 files changed, 145 insertions(+), 145 deletions(-) (limited to 'engines') diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 0964db5497..9bd7249902 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -503,7 +503,7 @@ void Ringworld2Globals::reset() { _player._characterIndex = R2_QUINN; _player._characterScene[R2_QUINN] = 100; _player._characterScene[R2_SEEKER] = 300; - _player._characterScene[3] = 300; + _player._characterScene[R2_MIRANDA] = 300; } void Ringworld2Globals::synchronize(Serializer &s) { diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp index 663697d94d..057d91a46e 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp +++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp @@ -235,7 +235,7 @@ void CharacterDialog::show() { scene->saveCharacter(oldCharacter); // Play the correctfrequency, if any, of the character being switched to's scanner device - if (R2_GLOBALS._player._characterScene[0] != 300) { + if (R2_GLOBALS._player._characterScene[R2_NONE] != 300) { switch (R2_GLOBALS._scannerFrequencies[R2_GLOBALS._player._characterIndex] - 1) { case 0: R2_GLOBALS._sound4.stop(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index de6e0aaf38..4eefa11de9 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -2805,12 +2805,12 @@ void Scene300::Action1::signal() { switch (_actionIndex) { case 0: - setAction(&scene->_sequenceManager2, this, 311, (R2_GLOBALS._player._characterIndex == 1) ? + setAction(&scene->_sequenceManager2, this, 311, (R2_GLOBALS._player._characterIndex == R2_QUINN) ? (SceneObject *)&R2_GLOBALS._player : (SceneObject *)&scene->_quinn); _actionIndex = 2; break; case 1: - setAction(&scene->_sequenceManager2, this, 312, (R2_GLOBALS._player._characterIndex == 1) ? + setAction(&scene->_sequenceManager2, this, 312, (R2_GLOBALS._player._characterIndex == R2_QUINN) ? (SceneObject *)&R2_GLOBALS._player : (SceneObject *)&scene->_quinn); _actionIndex = 0; break; @@ -2904,7 +2904,7 @@ bool Scene300::QuinnWorkstation::startAction(CursorType action, Event &event) { return true; case CURSOR_LOOK: - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { SceneItem::display2(300, 47); return true; } @@ -2927,7 +2927,7 @@ bool Scene300::MirandaWorkstation::startAction(CursorType action, Event &event) return true; case CURSOR_LOOK: - if (R2_GLOBALS._player._characterIndex == 3) { + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { SceneItem::display2(300, 47); return true; } @@ -2943,7 +2943,7 @@ bool Scene300::MirandaWorkstation::startAction(CursorType action, Event &event) bool Scene300::SeekerWorkstation::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_LOOK: - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { SceneItem::display2(300, 47); return true; } @@ -3452,8 +3452,8 @@ void Scene300::postInit(SceneObjectList *OwnerList) { case 3: if (R2_GLOBALS._sceneManager._previousScene == 1500) { - R2_GLOBALS._player._oldCharacterScene[3] = 3150; - R2_GLOBALS._player._characterScene[3] = 3150; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3150; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3150; R2_GLOBALS._player._effect = 0; R2_GLOBALS._player.setAction(NULL); R2_GLOBALS._player.disableControl(); @@ -4281,7 +4281,7 @@ void Scene325::consoleAction(int id) { break; case 11: - if (R2_GLOBALS.getFlag(57) && (R2_GLOBALS._player._characterIndex == 1) && !R2_GLOBALS.getFlag(25)) { + if (R2_GLOBALS.getFlag(57) && (R2_GLOBALS._player._characterIndex == R2_QUINN) && !R2_GLOBALS.getFlag(25)) { R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); _sceneMode = 13; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 8f1905eeac..29bef2ccb2 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -1520,7 +1520,7 @@ void Scene1200::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setup(3156, 1, 6); R2_GLOBALS._player.setPosition(Common::Point(160, 70)); R2_GLOBALS._player._numFrames = 10; - R2_GLOBALS._player._oldCharacterScene[3] = 1200; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 1200; _actor1.postInit(); _actor1.hide(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 01c5ae3fd6..a8e534d5cb 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -51,77 +51,77 @@ void Scene2000::initPlayer() { R2_GLOBALS._player.enableControl(); break; case 1: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2001; else _sceneMode = 2021; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 2: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2002; else _sceneMode = 2022; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 3: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2000; else _sceneMode = 2020; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 4: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2005; else _sceneMode = 2025; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 5: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2004; else _sceneMode = 2024; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 6: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2009; else _sceneMode = 2029; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 7: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2008; else _sceneMode = 2028; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 8: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2013; else _sceneMode = 2033; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 9: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2012; else _sceneMode = 2032; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 10: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2016; else _sceneMode = 2036; setAction(&_sequenceManager, this, _sceneMode, &R2_GLOBALS._player, NULL); break; case 11: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2038; else _sceneMode = 2040; @@ -137,7 +137,7 @@ void Scene2000::initPlayer() { if ((R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) && (R2_GLOBALS._spillLocation[R2_QUINN] == R2_GLOBALS._spillLocation[R2_SEEKER])) { _object1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object1.setup(20, 5, 1); _object1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -601,25 +601,25 @@ void Scene2000::SouthExit::changeScene() { switch (scene->_mazePlayerMode) { case 4: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2003, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2023, &R2_GLOBALS._player, NULL); break; case 6: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2007, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2027, &R2_GLOBALS._player, NULL); break; case 8: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2011, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2031, &R2_GLOBALS._player, NULL); break; case 11: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_sceneMode = 2039; else scene->_sceneMode = 2041; @@ -666,19 +666,19 @@ void Scene2000::NorthExit::changeScene() { switch (scene->_mazePlayerMode) { case 5: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2006, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2026, &R2_GLOBALS._player, NULL); break; case 7: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2010, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2030, &R2_GLOBALS._player, NULL); break; case 9: - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2014, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2034, &R2_GLOBALS._player, NULL); @@ -698,56 +698,56 @@ void Scene2000::DoorExit::changeScene() { switch (R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex]) { case 3: scene->_mazePlayerMode = 1; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2015, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2035, &R2_GLOBALS._player, NULL); break; case 4: scene->_mazePlayerMode = 7; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2017, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2037, &R2_GLOBALS._player, NULL); break; case 10: scene->_mazePlayerMode = 8; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2015, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2035, &R2_GLOBALS._player, NULL); break; case 12: scene->_mazePlayerMode = 3; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2017, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2037, &R2_GLOBALS._player, NULL); break; case 16: scene->_mazePlayerMode = 4; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2015, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2035, &R2_GLOBALS._player, NULL); break; case 21: scene->_mazePlayerMode = 5; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2015, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2035, &R2_GLOBALS._player, NULL); break; case 25: scene->_mazePlayerMode = 2; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2017, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2037, &R2_GLOBALS._player, NULL); break; case 34: scene->_mazePlayerMode = 6; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2017, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2037, &R2_GLOBALS._player, NULL); @@ -791,7 +791,7 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setup(2008, 3, 1); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1063,7 +1063,7 @@ void Scene2350::ExitUp::changeScene() { R2_GLOBALS._player.disableControl(CURSOR_CROSSHAIRS); scene->_sceneMode = 12; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager, scene, 2350, &R2_GLOBALS._player, NULL); else scene->setAction(&scene->_sequenceManager, scene, 2352, &R2_GLOBALS._player, NULL); @@ -1099,7 +1099,7 @@ void Scene2350::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setup(2008, 3, 1); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1109,7 +1109,7 @@ void Scene2350::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor2.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor2.setup(20, 5, 1); _actor2.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -1139,7 +1139,7 @@ void Scene2350::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 2000) { if (R2_GLOBALS._spillLocation[R2_GLOBALS._player._characterIndex] == 34) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _sceneMode = 2351; else _sceneMode = 2353; @@ -1392,7 +1392,7 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1402,7 +1402,7 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _pictographs1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _pictographs1.setup(20, 5, 1); _pictographs1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -1556,7 +1556,7 @@ void Scene2430::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1567,7 +1567,7 @@ void Scene2430::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 5, 1); _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -1657,7 +1657,7 @@ bool Scene2435::Astor::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_ARROW); - if ((R2_GLOBALS._player._characterIndex == 1) || (R2_GLOBALS.getFlag(82))) { + if ((R2_GLOBALS._player._characterIndex == R2_QUINN) || (R2_GLOBALS.getFlag(82))) { scene->_stripManager.start(605, scene); return true; } else if (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2) { @@ -1771,7 +1771,7 @@ void Scene2435::signal() { _sceneMode = 2436; R2_GLOBALS._player.setStrip(7); _companion.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _companion.setVisage(20); else _companion.setVisage(2008); @@ -1839,7 +1839,7 @@ void Scene2440::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -1849,7 +1849,7 @@ void Scene2440::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setPosition(Common::Point(210, 200)); if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 5, 1); _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -1927,7 +1927,7 @@ void Scene2445::signal() { bool Scene2450::Parker::startAction(CursorType action, Event &event) { Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == 1)) { + if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2452; scene->setAction(&scene->_sequenceManager, scene, 2452, &R2_GLOBALS._player, &scene->_parker, NULL); @@ -1945,7 +1945,7 @@ bool Scene2450::CareTaker::startAction(CursorType action, Event &event) { ++R2_GLOBALS._v565AE; scene->_sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->_stripManager.start(699 + (R2_GLOBALS._v565AE * 2), scene); else scene->_stripManager.start(700 + (R2_GLOBALS._v565AE * 2), scene); @@ -2017,7 +2017,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { break; case 2000: _sceneMode = 2451; - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS._player._characterScene[R2_SEEKER] == 2450) { _companion.postInit(); _companion.setup(20, 6, 1); @@ -2041,7 +2041,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { } break; case 2450: - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.postInit(); if (R2_GLOBALS.getFlag(61)) { R2_GLOBALS._player.setup(2008, 6, 1); @@ -2111,7 +2111,7 @@ void Scene2450::postInit(SceneObjectList *OwnerList) { break; default: R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS.getFlag(61)) { R2_GLOBALS._player.setup(2008, 3, 1); } else { @@ -2429,7 +2429,7 @@ void Scene2500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(11); R2_GLOBALS._player._moveDiff = Common::Point(2, 1); } else { @@ -2439,7 +2439,7 @@ void Scene2500::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(21, 3, 1); _actor1.setDetails(9002, 1, -1, -1, 1, (SceneItem *)NULL); } else { @@ -2568,7 +2568,7 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setup(2008, 3, 1); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -2578,7 +2578,7 @@ void Scene2525::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 5, 1); _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -2729,7 +2729,7 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -2740,7 +2740,7 @@ void Scene2530::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _actor1.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _actor1.setup(20, 5, 1); _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { @@ -2892,7 +2892,7 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.setVisage(2008); R2_GLOBALS._player._moveDiff = Common::Point(3, 2); } else { @@ -2903,7 +2903,7 @@ void Scene2535::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) { _companion.postInit(); - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _companion.setup(20, 5, 1); _companion.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL); } else { diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index d60b286f79..6898ede304 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -334,7 +334,7 @@ void Scene3125::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound1.play(262); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._oldCharacterScene[3] == 3250) { + if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3250) { _sceneMode = 3175; setAction(&_sequenceManager1, this, 3175, &R2_GLOBALS._player, &_door, NULL); } else { @@ -343,7 +343,7 @@ void Scene3125::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setPosition(Common::Point(89, 76)); R2_GLOBALS._player.enableControl(); } - R2_GLOBALS._player._oldCharacterScene[3] = 3125; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3125; } void Scene3125::signal() { @@ -545,7 +545,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { if (R2_GLOBALS._sceneManager._previousScene == -1) { R2_INVENTORY.setObjectScene(R2_ANCIENT_SCROLLS, 2000); R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 3100; - R2_GLOBALS._player._oldCharacterScene[3] = 0; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 0; R2_GLOBALS._player._characterIndex = R2_MIRANDA; } SceneExt::postInit(); @@ -708,7 +708,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { } } - R2_GLOBALS._player._oldCharacterScene[3] = 3150; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3150; } void Scene3150::signal() { @@ -910,7 +910,7 @@ void Scene3175::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._oldCharacterScene[3] == 3250) { + if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3250) { R2_GLOBALS._player.setup(30, 5, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); R2_GLOBALS._player.setPosition(Common::Point(126, 77)); @@ -920,7 +920,7 @@ void Scene3175::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 3175, &R2_GLOBALS._player, &_door, NULL); } - R2_GLOBALS._player._oldCharacterScene[3] = 3175; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3175; } void Scene3175::signal() { @@ -1165,7 +1165,7 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { loadScene(3250); if (R2_GLOBALS._sceneManager._previousScene == -1) { - R2_GLOBALS._player._oldCharacterScene[3] = 1200; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 1200; R2_GLOBALS._player._characterIndex = R2_MIRANDA; } @@ -1195,7 +1195,7 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.postInit(); - switch (R2_GLOBALS._player._oldCharacterScene[3]) { + switch (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA]) { case 1200: _sceneMode = 3250; _actor4.postInit(); @@ -1234,7 +1234,7 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { break; } - R2_GLOBALS._player._oldCharacterScene[3] = 3250; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3250; } void Scene3250::signal() { @@ -1305,7 +1305,7 @@ void Scene3255::postInit(SceneObjectList *OwnerList) { _sceneMode = 3255; setAction(&_sequenceManager, this, 3255, &R2_GLOBALS._player, NULL); } - R2_GLOBALS._player._oldCharacterScene[3] = 3255; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3255; } void Scene3255::signal() { @@ -1512,7 +1512,7 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { _item1.setDetails(Rect(0, 0, 320, 200), 3260, 0, 1, 2, 1, NULL); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._oldCharacterScene[3] == 3275) { + if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3275) { _sceneMode = 3270; setAction(&_sequenceManager, this, 3270, &R2_GLOBALS._player, &_door, NULL); } else { @@ -1522,7 +1522,7 @@ void Scene3260::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.enableControl(); } - R2_GLOBALS._player._oldCharacterScene[3] = 3260; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3260; } void Scene3260::remove() { @@ -1614,7 +1614,7 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; R2_GLOBALS._player.postInit(); R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._player._oldCharacterScene[3] == 3150) { + if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3150) { _sceneMode = 11; R2_GLOBALS._player.setup(30, 3, 1); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -1623,7 +1623,7 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { Common::Point pt(418, 128); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); - } else if (R2_GLOBALS._player._oldCharacterScene[3] == 3260) { + } else if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 3260) { _sceneMode = 3276; setAction(&_sequenceManager, this, 3276, &R2_GLOBALS._player, &_door, NULL); } else { @@ -1633,7 +1633,7 @@ void Scene3275::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.enableControl(); } - R2_GLOBALS._player._oldCharacterScene[3] = 3275; + R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3275; } void Scene3275::signal() { @@ -1813,7 +1813,7 @@ bool Scene3375::Companion2::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3304, scene); @@ -1828,7 +1828,7 @@ bool Scene3375::Companion1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3301, scene); @@ -2241,7 +2241,7 @@ bool Scene3385::Companion1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3304, scene); @@ -2256,7 +2256,7 @@ bool Scene3385::Companion2::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3301, scene); @@ -2333,7 +2333,7 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_QUINN] = 3385; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3385; - R2_GLOBALS._player._characterScene[3] = 3385; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3385; if (R2_GLOBALS._sceneManager._previousScene == 3375) _field11B2 = 3; @@ -2343,16 +2343,16 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { setZoomPercents(102, 40, 200, 160); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player._moveDiff = Common::Point(5, 3); else R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.changeZoom(-1); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setup(20, _field11B2, 1); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) R2_GLOBALS._player.setup(30, _field11B2, 1); else R2_GLOBALS._player.setup(10, _field11B2, 1); @@ -2361,7 +2361,7 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.disableControl(); _companion1.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _companion1._moveRate = 10; _companion1._moveDiff = Common::Point(3, 2); } else { @@ -2370,7 +2370,7 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { } _companion1.changeZoom(-1); _companion1._effect = 1; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _companion1.setup(10, _field11B2, 1); else _companion1.setup(20, _field11B2, 1); @@ -2381,7 +2381,7 @@ void Scene3385::postInit(SceneObjectList *OwnerList) { _companion2._moveDiff = Common::Point(3, 2); _companion2.changeZoom(-1); _companion2._effect = 1; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _companion2.setup(10, _field11B2, 1); else _companion2.setup(30, _field11B2, 1); @@ -2478,7 +2478,7 @@ bool Scene3395::Companion1::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3304, scene); @@ -2493,7 +2493,7 @@ bool Scene3395::Companion2::startAction(CursorType action, Event &event) { return SceneActor::startAction(action, event); scene->_sceneMode = 9999; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); else scene->_stripManager.start(3301, scene); @@ -2556,7 +2556,7 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_QUINN] = 3395; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3395; - R2_GLOBALS._player._characterScene[3] = 3395; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3395; if (R2_GLOBALS._sceneManager._previousScene == 3385) _field142E = 3; @@ -2566,16 +2566,16 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { setZoomPercents(51, 40, 200, 137); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player._moveDiff = Common::Point(5, 3); else R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.changeZoom(-1); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setup(20, _field142E, 1); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) R2_GLOBALS._player.setup(30, _field142E, 1); else R2_GLOBALS._player.setup(10, _field142E, 1); @@ -2584,7 +2584,7 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.disableControl(); _companion1.postInit(); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _companion1._moveRate = 10; _companion1._moveDiff = Common::Point(3, 2); } else { @@ -2593,7 +2593,7 @@ void Scene3395::postInit(SceneObjectList *OwnerList) { } _companion1.changeZoom(-1); _companion1._effect = 1; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _companion1.setup(10, _field142E, 1); else _companion1.setup(20, _field142E, 1); @@ -2715,7 +2715,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { setZoomPercents(51, 46, 180, 200); R2_GLOBALS._player._characterScene[R2_QUINN] = 3400; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3400; - R2_GLOBALS._player._characterScene[3] = 3400; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3400; _actor7.postInit(); _actor7.setup(3403, 1, 1); @@ -2751,7 +2751,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { _companion1.changeZoom(-1); _companion1._effect = 1; _companion1.setPosition(Common::Point(247, 63)); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _companion1.setup(10, 5, 1); else _companion1.setup(20, 5, 1); @@ -2762,7 +2762,7 @@ void Scene3400::postInit(SceneObjectList *OwnerList) { _companion2.changeZoom(-1); _companion2._effect = 1; _companion2.setPosition(Common::Point(225, 63)); - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _companion2.setup(10, 5, 1); else _companion2.setup(30, 5, 1); @@ -2817,7 +2817,7 @@ void Scene3400::signal() { _teal.setStrip(1); R2_INVENTORY.setObjectScene(R2_SAPPHIRE_BLUE, 0); _stripManager.start(3307, this); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _sceneMode = 3400; R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_actor8, NULL); } else { @@ -2844,7 +2844,7 @@ void Scene3400::signal() { _webbster.setStrip(3); _teal.setStrip(1); _sceneMode = 3403; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) setAction(&_sequenceManager, this, 3403, &R2_GLOBALS._player, &_webbster, &_actor7, NULL); else setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_actor7, NULL); @@ -2853,7 +2853,7 @@ void Scene3400::signal() { warning("STUB: sub_1D227()"); _teal.setStrip(1); _sceneMode = 3405; - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) setAction(&_sequenceManager, this, 3405, &R2_GLOBALS._player, &_actor7, NULL); else setAction(&_sequenceManager, this, 3405, &_companion2, &_actor7, NULL); @@ -2862,11 +2862,11 @@ void Scene3400::signal() { warning("STUB: sub_1D227()"); _teal.setStrip(1); _sceneMode = 3406; - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) setAction(&_sequenceManager, this, 3406, &R2_GLOBALS._player, &_actor7, NULL); - else if (R2_GLOBALS._player._characterIndex == 2) + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) setAction(&_sequenceManager, this, 3406, &_companion1, &_actor7, NULL); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) setAction(&_sequenceManager, this, 3406, &_companion2, &_actor7, NULL); break; case 3311: @@ -4338,9 +4338,9 @@ bool Scene3600::Item5::startAction(CursorType action, Event &event) { scene->_actor12.setStrip2(-1); scene->_actor4.setStrip2(-1); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player.setAction(&scene->_sequenceManager3, scene, 3611, &R2_GLOBALS._player, NULL); - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) R2_GLOBALS._player.setAction(&scene->_sequenceManager4, scene, 3612, &R2_GLOBALS._player, NULL); else R2_GLOBALS._player.setAction(&scene->_sequenceManager2, scene, 3610, &R2_GLOBALS._player, NULL); @@ -4425,7 +4425,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { setZoomPercents(142, 80, 167, 105); R2_GLOBALS._player._characterScene[R2_QUINN] = 3600; R2_GLOBALS._player._characterScene[R2_SEEKER] = 3600; - R2_GLOBALS._player._characterScene[3] = 3600; + R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3600; _item2.setDetails(33, 3600, 6, -1, -1); _item3.setDetails(Rect(3, 3, 22, 45), 3600, 9, -1, -1, 1, NULL); @@ -4499,7 +4499,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _actor12.setup(30, 5, 11); _actor12.animate(ANIM_MODE_1, NULL); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _actor10.setPosition(Common::Point(76, 148)); _actor11.setPosition(Common::Point(134, 148)); _actor12.setPosition(Common::Point(100, 148)); @@ -4507,7 +4507,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.setup(20, _actor11._strip, 1); R2_GLOBALS._player.setPosition(_actor11._position); _actor11.hide(); - } else if (R2_GLOBALS._player._characterIndex == 3) { + } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { _actor10.setPosition(Common::Point(110, 148)); _actor11.setPosition(Common::Point(76, 148)); _actor12.setPosition(Common::Point(134, 148)); @@ -4618,9 +4618,9 @@ void Scene3600::signal() { _tealSpeaker._object1.hide(); _actor5.show(); _actor5.setStrip(2); - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _sceneMode = 3602; - else if (R2_GLOBALS._player._characterIndex == 3) + else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _sceneMode = 3603; else _sceneMode = 3601; @@ -4727,12 +4727,12 @@ void Scene3600::signal() { _quinnSpeaker._displayMode = 2; _tealSpeaker._displayMode = 2; - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { R2_GLOBALS._player._moveDiff = Common::Point(5, 3); R2_GLOBALS._player.setup(20, _actor11._strip, 1); R2_GLOBALS._player.setPosition(_actor11._position); _actor11.hide(); - } else if (R2_GLOBALS._player._characterIndex == 3) { + } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { R2_GLOBALS._player._moveDiff = Common::Point(3, 2); R2_GLOBALS._player.setup(30, _actor12._strip, 1); R2_GLOBALS._player.setPosition(_actor12._position); @@ -4884,10 +4884,10 @@ void Scene3600::dispatch() { R2_GLOBALS._player.hide(); - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _actor11.setPosition(R2_GLOBALS._player._position); _actor11.show(); - } else if (R2_GLOBALS._player._characterIndex == 3) { + } else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { _actor12.setPosition(R2_GLOBALS._player._position); _actor12.show(); } else { diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 2cf5201c43..93f428547e 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -541,7 +541,7 @@ void SpeakerMiranda300::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) { + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { _object2 = &R2_GLOBALS._player; } else { Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; @@ -627,7 +627,7 @@ void SpeakerMiranda3375::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_companion2; @@ -677,7 +677,7 @@ void SpeakerMiranda3385::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_companion2; @@ -726,7 +726,7 @@ void SpeakerMiranda3395::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_companion2; @@ -776,7 +776,7 @@ void SpeakerMiranda3400::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_companion2; @@ -820,7 +820,7 @@ void SpeakerMiranda3600::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_actor12; @@ -1176,7 +1176,7 @@ void SpeakerQuinn300::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 3) { + if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 300); @@ -1272,7 +1272,7 @@ void SpeakerQuinn1100::proc15() { if (v == 0) return; - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 1100); @@ -1318,7 +1318,7 @@ void SpeakerQuinn2435::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); @@ -1345,7 +1345,7 @@ void SpeakerQuinn2450::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); @@ -1500,9 +1500,9 @@ void SpeakerQuinn3375::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; - else if (R2_GLOBALS._player._characterIndex == 2) + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &scene->_companion1; else _object2 = &scene->_companion2; @@ -1551,9 +1551,9 @@ void SpeakerQuinn3385::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; - else if (R2_GLOBALS._player._characterIndex == 2) + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &scene->_companion1; else _object2 = &scene->_companion2; @@ -1587,7 +1587,7 @@ void SpeakerQuinn3385::proc15() { break; case 1: ((SceneItem *)_action)->_sceneRegionId = 0; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object1.setup(4010, 3, 1); else _object1.setup(4010, 5, 1); @@ -1606,9 +1606,9 @@ void SpeakerQuinn3395::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; - else if (R2_GLOBALS._player._characterIndex == 2) + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &scene->_companion1; else _object2 = &scene->_companion2; @@ -1642,7 +1642,7 @@ void SpeakerQuinn3395::proc15() { break; case 1: ((SceneItem *)_action)->_sceneRegionId = 0; - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object1.setup(4010, 3, 1); else _object1.setup(4010, 5, 1); @@ -1661,9 +1661,9 @@ void SpeakerQuinn3400::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; - else if (R2_GLOBALS._player._characterIndex == 2) + else if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &scene->_companion1; else _object2 = &scene->_companion2; @@ -1710,7 +1710,7 @@ void SpeakerQuinn3600::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 1) + if (R2_GLOBALS._player._characterIndex == R2_QUINN) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_actor10; @@ -2072,7 +2072,7 @@ void SpeakerSeeker1100::proc15() { if (v == 0) return; - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 1100); @@ -2129,7 +2129,7 @@ void SpeakerSeeker1900::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 1900); @@ -2160,7 +2160,7 @@ void SpeakerSeeker2435::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 2435); @@ -2187,7 +2187,7 @@ void SpeakerSeeker2450::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _object2 = &R2_GLOBALS._player; } else { assert(R2_GLOBALS._sceneManager._sceneNumber == 2450); @@ -2362,7 +2362,7 @@ void SpeakerSeeker3400::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_companion1; @@ -2421,7 +2421,7 @@ void SpeakerSeeker3600::proc15() { int v = _speakerMode; if (!_object2) { - if (R2_GLOBALS._player._characterIndex == 2) + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) _object2 = &R2_GLOBALS._player; else _object2 = &scene->_actor11; -- cgit v1.2.3 From a5691e8dc85bb1f7aee237529983f6fbab61c89d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 10:43:53 +0300 Subject: NEVERHOOD: Expand the error thrown for broken resources in BLB archives The Russian translated versions of Neverhood have invalid unpacked sizes for some compressed resources. This helps in identifying their resource parameters more easily --- engines/neverhood/blbarchive.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/neverhood/blbarchive.cpp b/engines/neverhood/blbarchive.cpp index d730d75718..c743037e63 100644 --- a/engines/neverhood/blbarchive.cpp +++ b/engines/neverhood/blbarchive.cpp @@ -131,7 +131,8 @@ void BlbArchive::load(BlbArchiveEntry *entry, byte *buffer, uint32 size) { break; case 3: // DCL-compressed if (!Common::decompressDCL(&_fd, buffer, entry->diskSize, entry->size)) - error("BlbArchive::load() Error during decompression of %08X", entry->fileHash); + error("BlbArchive::load() Error during decompression of %08X (offset: %d, disk size: %d, size: %d)", + entry->fileHash, entry->offset, entry->diskSize, entry->size); break; default: error("BlbArchive::load() Unknown compression type %d", entry->comprType); -- cgit v1.2.3 From 9396958536c487554f79e5a54064c8d37d45fe15 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 10:54:30 +0300 Subject: NEVERHOOD: Add a patch system for broken resources in Russian versions Some translated resources in Russian versions have incorrect unpacked resource sizes. The original didn't perform checks for these, but we do, thus we'll need to patch the unpacked resource sizes for each case --- engines/neverhood/console.cpp | 2 +- engines/neverhood/detection.cpp | 8 ++++++++ engines/neverhood/neverhood.h | 2 ++ engines/neverhood/resource.cpp | 10 +++++----- engines/neverhood/resourceman.cpp | 35 ++++++++++++++++++++++++++++++++--- engines/neverhood/resourceman.h | 2 +- engines/neverhood/sound.cpp | 2 +- 7 files changed, 50 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/neverhood/console.cpp b/engines/neverhood/console.cpp index a2ceed8a2e..708c68746c 100644 --- a/engines/neverhood/console.cpp +++ b/engines/neverhood/console.cpp @@ -252,7 +252,7 @@ bool Console::Cmd_DumpResource(int argc, const char **argv) { if (!handle.isValid()) { DebugPrintf("Invalid resource hash\n"); } else { - _vm->_res->loadResource(handle); + _vm->_res->loadResource(handle, _vm->applyResourceFixes()); Common::DumpFile outFile; outFile.open(outFileName); outFile.write(handle.data(), handle.size()); diff --git a/engines/neverhood/detection.cpp b/engines/neverhood/detection.cpp index 3de087051a..96c87ab3ae 100644 --- a/engines/neverhood/detection.cpp +++ b/engines/neverhood/detection.cpp @@ -52,6 +52,10 @@ Common::Platform NeverhoodEngine::getPlatform() const { return _gameDescription->desc.platform; } +Common::Language NeverhoodEngine::getLanguage() const { + return _gameDescription->desc.language; +} + uint16 NeverhoodEngine::getVersion() const { return _gameDescription->version; } @@ -60,6 +64,10 @@ bool NeverhoodEngine::isDemo() const { return _gameDescription->desc.flags & ADGF_DEMO; } +bool NeverhoodEngine::applyResourceFixes() const { + return getLanguage() == Common::RU_RUS; +} + } static const PlainGameDescriptor neverhoodGames[] = { diff --git a/engines/neverhood/neverhood.h b/engines/neverhood/neverhood.h index 9b65f6740e..0561aa251e 100644 --- a/engines/neverhood/neverhood.h +++ b/engines/neverhood/neverhood.h @@ -72,8 +72,10 @@ public: uint32 getFeatures() const; uint16 getVersion() const; Common::Platform getPlatform() const; + Common::Language getLanguage() const; bool hasFeature(EngineFeature f) const; bool isDemo() const; + bool applyResourceFixes() const; Common::String getTargetName() { return _targetName; }; Common::RandomSource *_rnd; diff --git a/engines/neverhood/resource.cpp b/engines/neverhood/resource.cpp index a1a517f251..b45dbff3b9 100644 --- a/engines/neverhood/resource.cpp +++ b/engines/neverhood/resource.cpp @@ -53,7 +53,7 @@ bool SpriteResource::load(uint32 fileHash, bool doLoadPosition) { unload(); _vm->_res->queryResource(fileHash, _resourceHandle); if (_resourceHandle.isValid() && _resourceHandle.type() == kResTypeBitmap) { - _vm->_res->loadResource(_resourceHandle); + _vm->_res->loadResource(_resourceHandle, _vm->applyResourceFixes()); const byte *spriteData = _resourceHandle.data(); NPoint *position = doLoadPosition ? &_position : NULL; parseBitmapResource(spriteData, &_rle, &_dimensions, position, NULL, &_pixels); @@ -83,7 +83,7 @@ bool PaletteResource::load(uint32 fileHash) { _vm->_res->queryResource(fileHash, _resourceHandle); if (_resourceHandle.isValid() && (_resourceHandle.type() == kResTypeBitmap || _resourceHandle.type() == kResTypePalette)) { - _vm->_res->loadResource(_resourceHandle); + _vm->_res->loadResource(_resourceHandle, _vm->applyResourceFixes()); _palette = _resourceHandle.data(); // Check if the palette is stored in a bitmap if (_resourceHandle.type() == kResTypeBitmap) @@ -144,7 +144,7 @@ bool AnimResource::load(uint32 fileHash) { uint16 frameListStartOfs, frameCount; uint32 spriteDataOfs, paletteDataOfs; - _vm->_res->loadResource(_resourceHandle); + _vm->_res->loadResource(_resourceHandle, _vm->applyResourceFixes()); resourceData = _resourceHandle.data(); animListCount = READ_LE_UINT16(resourceData); @@ -323,7 +323,7 @@ void TextResource::load(uint32 fileHash) { unload(); _vm->_res->queryResource(fileHash, _resourceHandle); if (_resourceHandle.isValid() && _resourceHandle.type() == kResTypeText) { - _vm->_res->loadResource(_resourceHandle); + _vm->_res->loadResource(_resourceHandle, _vm->applyResourceFixes()); _textData = _resourceHandle.data(); _count = READ_LE_UINT32(_textData); } @@ -359,7 +359,7 @@ void DataResource::load(uint32 fileHash) { unload(); _vm->_res->queryResource(fileHash, _resourceHandle); if (_resourceHandle.isValid() && _resourceHandle.type() == kResTypeData) { - _vm->_res->loadResource(_resourceHandle); + _vm->_res->loadResource(_resourceHandle, _vm->applyResourceFixes()); data = _resourceHandle.data(); dataSize = _resourceHandle.size(); } diff --git a/engines/neverhood/resourceman.cpp b/engines/neverhood/resourceman.cpp index 37089a5bd6..518755a846 100644 --- a/engines/neverhood/resourceman.cpp +++ b/engines/neverhood/resourceman.cpp @@ -85,7 +85,25 @@ void ResourceMan::queryResource(uint32 fileHash, ResourceHandle &resourceHandle) resourceHandle._extData = firstEntry ? firstEntry->archiveEntry->extData : NULL; } -void ResourceMan::loadResource(ResourceHandle &resourceHandle) { +struct EntrySizeFix { + uint32 fileHash; + uint32 offset; + uint32 diskSize; + uint32 size; + uint32 fixedSize; +}; + +static const EntrySizeFix entrySizeFixes[] = { + // fileHash offset diskSize size fixedSize + // Fixes for the Russian "Dyadyushka Risech" version + // TODO + // Fixes for the Russian "Fargus" version + // TODO + // + { 0, 0, 0, 0, 0 } +}; + +void ResourceMan::loadResource(ResourceHandle &resourceHandle, bool applyResourceFixes) { resourceHandle._data = NULL; if (resourceHandle.isValid()) { const uint32 fileHash = resourceHandle.fileHash(); @@ -97,8 +115,19 @@ void ResourceMan::loadResource(ResourceHandle &resourceHandle) { if (resourceData->data != NULL) { resourceData->dataRefCount++; } else { - resourceData->data = new byte[resourceHandle._resourceFileEntry->archiveEntry->size]; - resourceHandle._resourceFileEntry->archive->load(resourceHandle._resourceFileEntry->archiveEntry, resourceData->data, 0); + BlbArchiveEntry *entry = resourceHandle._resourceFileEntry->archiveEntry; + + // Apply fixes for broken resources in Russian versions + if (applyResourceFixes) { + for (const EntrySizeFix *cur = entrySizeFixes; cur->fileHash > 0; ++cur) { + if (entry->fileHash == cur->fileHash && entry->offset == cur->offset && + entry->diskSize == cur->diskSize && entry->size == cur->size) + entry->size = cur->fixedSize; + } + } + + resourceData->data = new byte[entry->size]; + resourceHandle._resourceFileEntry->archive->load(entry, resourceData->data, 0); resourceData->dataRefCount = 1; } resourceHandle._data = resourceData->data; diff --git a/engines/neverhood/resourceman.h b/engines/neverhood/resourceman.h index 5a3697fe0d..29bf40a6b8 100644 --- a/engines/neverhood/resourceman.h +++ b/engines/neverhood/resourceman.h @@ -78,7 +78,7 @@ public: const ResourceFileEntry& getEntry(uint index) { return _entries[index]; } uint getEntryCount() { return _entries.size(); } void queryResource(uint32 fileHash, ResourceHandle &resourceHandle); - void loadResource(ResourceHandle &resourceHandle); + void loadResource(ResourceHandle &resourceHandle, bool applyResourceFixes); void unloadResource(ResourceHandle &resourceHandle); void purgeResources(); protected: diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp index 1fd09674a2..746dd17de0 100644 --- a/engines/neverhood/sound.cpp +++ b/engines/neverhood/sound.cpp @@ -577,7 +577,7 @@ AudioResourceManSoundItem::AudioResourceManSoundItem(NeverhoodEngine *vm, uint32 void AudioResourceManSoundItem::loadSound() { if (!_data && _resourceHandle.isValid() && (_resourceHandle.type() == kResTypeSound || _resourceHandle.type() == kResTypeMusic)) { - _vm->_res->loadResource(_resourceHandle); + _vm->_res->loadResource(_resourceHandle, _vm->applyResourceFixes()); _data = _resourceHandle.data(); } } -- cgit v1.2.3 From 40f1f3e0b13adafb775f5b930753f129aeaf9674 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 11:31:08 +0300 Subject: NEVERHOOD: Fix uninitialized class members in AnimatedSprite - CID 1022296 --- engines/neverhood/sprite.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines') diff --git a/engines/neverhood/sprite.cpp b/engines/neverhood/sprite.cpp index 3c158ff7e3..1a432461fb 100644 --- a/engines/neverhood/sprite.cpp +++ b/engines/neverhood/sprite.cpp @@ -211,6 +211,12 @@ void AnimatedSprite::init() { _replNewColor = 0; _animResource.setReplEnabled(false); _playBackwards = false; + _currAnimFileHash = 0; + _lastFrameIndex = 0; + _plLastFrameIndex = 0; + _plFirstFrameHash = 0; + _plLastFrameHash = 0; + _animStatus = 0; } void AnimatedSprite::update() { -- cgit v1.2.3 From 03911e65050127fc53f7d779987147876e90fe36 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 26 Sep 2013 22:58:46 +0300 Subject: SWORD25: Fix copy-paste error. CID 1004130 --- engines/sword25/gfx/animationresource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp index 621e20ad8c..8c09a545a0 100644 --- a/engines/sword25/gfx/animationresource.cpp +++ b/engines/sword25/gfx/animationresource.cpp @@ -188,7 +188,7 @@ bool AnimationResource::parserCallback_frame(ParserNode *node) { Common::String flipHString = node->values["fliph"]; if (!flipHString.empty()) { - if (!parseBooleanKey(flipVString, frame.flipV)) { + if (!parseBooleanKey(flipHString, frame.flipH)) { warning("Illegal fliph value (\"%s\") in tag in \"%s\". Assuming default (\"false\").", flipHString.c_str(), getFileName().c_str()); frame.flipH = false; -- cgit v1.2.3 From f61e9c1c02a5b9bc11f84ef1bd9569bddc2fdbe3 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 27 Sep 2013 00:26:32 +0200 Subject: SCI: script patch for sq1vga to fix gfx glitch when leaving Ulence Flats... --- engines/sci/engine/script_patches.cpp | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index abb7351d97..d2c3356d54 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -1467,6 +1467,32 @@ const SciScriptSignature sq4Signatures[] = { SCI_SIGNATUREENTRY_TERMINATOR }; +// =========================================================================== +// When you leave Ulence Flats, another timepod is supposed to appear. +// On fast machines, that timepod appears fully immediately and then +// starts to appear like it should be. That first appearance is caused +// by the scripts setting an invalid cel number and the machine being +// so fast that there is no time for another script to actually fix +// the cel number. On slower machines, the cel number gets fixed +// by the cycler and that's why only fast machines are affected. +// The same issue happens in Sierra SCI. +// We simply set the correct starting cel number to fix the bug. +// Responsible method: robotIntoShip::changeState(9) +const byte sq1vgaSignatureUlenceFlatsTimepodGfxGlitch[] = { + 8, + 0x39, 0x07, // pushi 07 (ship::cel) + 0x78, // push1 + 0x39, 0x0a, // pushi 0x0a (set ship::cel to 10) + 0x38, 0xa0, 0x00, // pushi 0x00a0 (ship::setLoop) + 0 +}; + +const uint16 sq1vgaPatchUlenceFlatsTimepodGfxGlitch[] = { + PATCH_ADDTOOFFSET | +3, + 0x39, 0x09, // pushi 0x09 (set ship::cel to 9) + PATCH_END +}; + const byte sq1vgaSignatureEgoShowsCard[] = { 25, 0x38, 0x46, 0x02, // push 0x246 (set up send frame to set timesShownID) @@ -1484,7 +1510,8 @@ const byte sq1vgaSignatureEgoShowsCard[] = { 0x36, // push (wrong, acc clobbered by class, above) 0x35, 0x03, // ldi 0x03 0x22, // lt? - 0}; + 0 +}; // Note that this script patch is merely a reordering of the // instructions in the original script. @@ -1504,13 +1531,14 @@ const uint16 sq1vgaPatchEgoShowsCard[] = { 0x4a, 0x06, // send 0x06 (set timesShownID) 0x35, 0x03, // ldi 0x03 0x22, // lt? - PATCH_END}; + PATCH_END +}; // script, description, magic DWORD, adjust const SciScriptSignature sq1vgaSignatures[] = { - { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70, - sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard }, + { 45, "Ulence Flats: timepod graphic glitch", 1, PATCH_MAGICDWORD( 0x07, 0x78, 0x39, 0x0a ), -1, sq1vgaSignatureUlenceFlatsTimepodGfxGlitch, sq1vgaPatchUlenceFlatsTimepodGfxGlitch }, + { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70, sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard }, SCI_SIGNATUREENTRY_TERMINATOR}; -- cgit v1.2.3 From f05e43fae615c1c40e53e9285507d13259ab88df Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 23:41:55 +0300 Subject: NEVERHOOD: Fix uninitialized members of the SoundMan class - CID 1022297 --- engines/neverhood/sound.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp index 746dd17de0..e9ebbadb7c 100644 --- a/engines/neverhood/sound.cpp +++ b/engines/neverhood/sound.cpp @@ -250,7 +250,9 @@ void SoundItem::update() { // SoundMan SoundMan::SoundMan(NeverhoodEngine *vm) - : _vm(vm), _soundIndex1(-1), _soundIndex2(-1), _soundIndex3(-1) { + : _vm(vm), _soundIndex1(-1), _soundIndex2(-1), _soundIndex3(-1), + _initialCountdown(0), _playOnceAfterCountdown(false), + _initialCountdown3(0), _playOnceAfterCountdown3(false) { } SoundMan::~SoundMan() { -- cgit v1.2.3 From b94165abe3e78d19f2f1873ca65503332ae2b125 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 23:43:54 +0300 Subject: NEVERHOOD: Fix uninitialized members of the AudioResourceManMusicItem class - CID 1022298 --- engines/neverhood/sound.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp index e9ebbadb7c..3ea45491a7 100644 --- a/engines/neverhood/sound.cpp +++ b/engines/neverhood/sound.cpp @@ -629,7 +629,8 @@ bool AudioResourceManSoundItem::isPlaying() { AudioResourceManMusicItem::AudioResourceManMusicItem(NeverhoodEngine *vm, uint32 fileHash) : _vm(vm), _fileHash(fileHash), _terminate(false), _canRestart(false), - _volume(100), _panning(50), _start(false), _isFadingIn(false), _isFadingOut(false), _isPlaying(false) { + _volume(100), _panning(50), _start(false), _isFadingIn(false), _isFadingOut(false), _isPlaying(false), + _fadeVolume(0), _fadeVolumeStep(0) { } -- cgit v1.2.3 From 871b4a83e2e3e1d907822770c05afdfadbafdca0 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 23:52:16 +0300 Subject: NEVERHOOD: Fix uninitialized members of the Screen class - CID 1022299 --- engines/neverhood/screen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/neverhood/screen.cpp b/engines/neverhood/screen.cpp index 4c8dd9add0..901ab73b39 100644 --- a/engines/neverhood/screen.cpp +++ b/engines/neverhood/screen.cpp @@ -27,7 +27,8 @@ namespace Neverhood { Screen::Screen(NeverhoodEngine *vm) : _vm(vm), _paletteData(NULL), _paletteChanged(false), _smackerDecoder(NULL), - _yOffset(0), _fullRefresh(false) { + _yOffset(0), _fullRefresh(false), _frameDelay(0), _savedSmackerDecoder(NULL), + _savedFrameDelay(0), _savedYOffset(0) { _ticks = _vm->_system->getMillis(); -- cgit v1.2.3 From 16b419847f49a500347487f38d50795cb6a13a63 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 23:54:23 +0300 Subject: NEVERHOOD: Fix uninitialized members of the Scene class and remove dead code - CID 1022300 --- engines/neverhood/scene.cpp | 3 +++ engines/neverhood/scene.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp index 0b2e9c6b75..9a7e87ac8d 100644 --- a/engines/neverhood/scene.cpp +++ b/engines/neverhood/scene.cpp @@ -50,6 +50,9 @@ Scene::Scene(NeverhoodEngine *vm, Module *parentModule) _smackerPlayer = NULL; _isMessageListBusy = false; _messageValue = -1; + _messageListStatus = 0; + _messageListCount = 0; + _messageListIndex = 0; _backgroundFileHash = _cursorFileHash = 0; diff --git a/engines/neverhood/scene.h b/engines/neverhood/scene.h index f60e291395..e6183199ce 100644 --- a/engines/neverhood/scene.h +++ b/engines/neverhood/scene.h @@ -204,8 +204,6 @@ protected: // Used for debugging uint32 _backgroundFileHash, _cursorFileHash; // for StaticScene and all Scene* classes - void (Entity::*_savedUpdateHandlerCb)(); - uint32 (Entity::*_savedMessageHandlerCb)(int messageNum, const MessageParam ¶m, Entity *sender); int _messageValue; uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); bool queryPositionSprite(int16 mouseX, int16 mouseY); -- cgit v1.2.3 From cfa6974d29e4f30c749f859242e54b59b555b67a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 26 Sep 2013 23:56:58 +0300 Subject: NEVERHOOD: Fix uninitialized members of the Palette class - CID 1022303, 1022304, 1022305, 1022306 --- engines/neverhood/palette.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines') diff --git a/engines/neverhood/palette.cpp b/engines/neverhood/palette.cpp index c381f46671..941bcc3cd3 100644 --- a/engines/neverhood/palette.cpp +++ b/engines/neverhood/palette.cpp @@ -66,6 +66,11 @@ void Palette::init() { _status = 0; _palette = new byte[1024]; _basePalette = new byte[1024]; + _palCounter = 0; + _fadeToR = 0; + _fadeToG = 0; + _fadeToB = 0; + _fadeStep = 0; } void Palette::usePalette() { -- cgit v1.2.3 From e925f8a9d888fe39a23d4b240976055cf9f2804d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 27 Sep 2013 00:02:20 +0300 Subject: NEVERHOOD: Fix uninitialized variable in AsScene2810Rope - CID 1022310 --- engines/neverhood/modules/module2800_sprites.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/neverhood/modules/module2800_sprites.cpp b/engines/neverhood/modules/module2800_sprites.cpp index 28e2657ee7..f7949b97c8 100644 --- a/engines/neverhood/modules/module2800_sprites.cpp +++ b/engines/neverhood/modules/module2800_sprites.cpp @@ -895,7 +895,7 @@ uint32 AsScene2809Spew::handleMessage(int messageNum, const MessageParam ¶m, } AsScene2810Rope::AsScene2810Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x) - : AnimatedSprite(vm, 1100) { + : AnimatedSprite(vm, 1100), _parentScene(parentScene) { createSurface(990, 68, 476); SetUpdateHandler(&AnimatedSprite::update); -- cgit v1.2.3 From 802abdcc34e82166ff0dead36c8ad679fa9f1318 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 27 Sep 2013 00:17:53 +0300 Subject: NEVERHOOD: Fix uninitialized variable in AsScene1002OutsideDoorBackground - CID 1022329 --- engines/neverhood/modules/module1000.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/neverhood/modules/module1000.cpp b/engines/neverhood/modules/module1000.cpp index 08fb88ad72..14ce5f4347 100644 --- a/engines/neverhood/modules/module1000.cpp +++ b/engines/neverhood/modules/module1000.cpp @@ -1012,7 +1012,7 @@ void AsScene1002VenusFlyTrap::swallowKlaymen() { } AsScene1002OutsideDoorBackground::AsScene1002OutsideDoorBackground(NeverhoodEngine *vm) - : AnimatedSprite(vm, 1200), _countdown(0) { + : AnimatedSprite(vm, 1200), _countdown(0), _isDoorClosed(true) { createSurface(850, 186, 212); _x = 320; -- cgit v1.2.3 From ba30e961b99ce4029e1f3e621bb2e4d0e63aab43 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 27 Sep 2013 00:20:14 +0300 Subject: NEVERHOOD: Remove unused variable - CID 1022328 --- engines/neverhood/modules/module1200.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines') diff --git a/engines/neverhood/modules/module1200.h b/engines/neverhood/modules/module1200.h index c97dc98986..e85273185e 100644 --- a/engines/neverhood/modules/module1200.h +++ b/engines/neverhood/modules/module1200.h @@ -155,8 +155,6 @@ protected: class SsScene1201Tnt : public StaticSprite { public: SsScene1201Tnt(NeverhoodEngine *vm, uint32 elemIndex, uint32 pointIndex, int16 clipY2); -protected: - uint32 _elemIndex; }; class Scene1201 : public Scene { -- cgit v1.2.3 From 78d9aea1989cf8d99dc83766b15aab6464ed0df0 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 27 Sep 2013 01:23:32 +0300 Subject: NEVERHOOD: Fix uninitialized variable in Scene1303 - CID 1022323 --- engines/neverhood/modules/module1300.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/neverhood/modules/module1300.cpp b/engines/neverhood/modules/module1300.cpp index c8a561af76..0b883b217b 100644 --- a/engines/neverhood/modules/module1300.cpp +++ b/engines/neverhood/modules/module1300.cpp @@ -630,7 +630,7 @@ void AsScene1303Balloon::stPopBalloon() { } Scene1303::Scene1303(NeverhoodEngine *vm, Module *parentModule) - : Scene(vm, parentModule) { + : Scene(vm, parentModule), _asBalloon(NULL) { SetMessageHandler(&Scene1303::handleMessage); -- cgit v1.2.3 From 2369f60a42ed63906a38d04c6a3c9243e10bfe44 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 27 Sep 2013 01:26:46 +0300 Subject: NEVERHOOD: Fix uninitialized member of the TextEditWidget class - CID 1022333 --- engines/neverhood/menumodule.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines') diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp index 362f5270e3..5ad2dd69d7 100644 --- a/engines/neverhood/menumodule.cpp +++ b/engines/neverhood/menumodule.cpp @@ -574,6 +574,7 @@ TextEditWidget::TextEditWidget(NeverhoodEngine *vm, int16 x, int16 y, GameStateM _maxVisibleChars = (_rect.x2 - _rect.x1) / _fontSurface->getCharWidth(); _cursorPos = 0; + _textLabelWidget = NULL; SetUpdateHandler(&TextEditWidget::update); SetMessageHandler(&TextEditWidget::handleMessage); -- cgit v1.2.3 From 3ac10f9254fa8e4b16e80ec23231b16d9e21e6b2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 26 Sep 2013 21:54:05 -0400 Subject: TSAGE: Further bugfixes for R2R Protector confrontation --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 105 +++++++++++++---------- engines/tsage/ringworld2/ringworld2_scenes3.h | 4 +- engines/tsage/ringworld2/ringworld2_speakers.cpp | 2 +- 3 files changed, 61 insertions(+), 50 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 6898ede304..224626b566 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -4229,9 +4229,10 @@ void Scene3500::dispatch() { } /*-------------------------------------------------------------------------- - * Scene 3600 - + * Scene 3600 - Cutscene - walking at gunpoint * *--------------------------------------------------------------------------*/ + Scene3600::Scene3600() { _field2548 = 0; _field254A = 0; @@ -4305,14 +4306,14 @@ void Scene3600::Action2::signal() { R2_GLOBALS._events.proc1(); R2_GLOBALS._player.enableControl(); _actionIndex = 3619; - scene->_actor13._state = 0; + scene->_protector._state = 0; // No break on purpose case 3619: { ++_actionIndex; - scene->_actor13.setup(3127, 2, 1); - scene->_actor13.animate(ANIM_MODE_1, NULL); + scene->_protector.setup(3127, 2, 1); + scene->_protector.animate(ANIM_MODE_1, NULL); NpcMover *mover = new NpcMover(); - scene->_actor13.addMover(mover, &scene->_actor13._field8A, scene); + scene->_protector.addMover(mover, &scene->_protector._field8A, scene); } break; default: @@ -4348,12 +4349,12 @@ bool Scene3600::Item5::startAction(CursorType action, Event &event) { return true; } -bool Scene3600::Actor13::startAction(CursorType action, Event &event) { +bool Scene3600::Protector::startAction(CursorType action, Event &event) { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; switch(action) { case CURSOR_TALK: - if (!_action) + if (_action) return SceneActor::startAction(action, event); scene->_protectorSpeaker._displayMode = 1; @@ -4380,6 +4381,7 @@ bool Scene3600::Actor13::startAction(CursorType action, Event &event) { R2_GLOBALS._sound3.play(43); else R2_GLOBALS._sound3.play(99); + if (_state != 0) { _state = 1; setup(3128, 1, 1); @@ -4532,14 +4534,14 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _actor5.setup(3601, 7, 5); if (!R2_GLOBALS.getFlag(71)) { - _actor13.postInit(); - _actor13._state = 0; - _actor13._field8A = Common::Point(226, 152); - _actor13._moveDiff = Common::Point(3, 2); - _actor13.setPosition(Common::Point(284, 152)); - _actor13.setup(3127, 2, 1); - _actor13.changeZoom(-1); - _actor13.setDetails(3600, 15, -1, 17, 1, (SceneItem *) NULL); + _protector.postInit(); + _protector._state = 0; + _protector._field8A = Common::Point(226, 152); + _protector._moveDiff = Common::Point(3, 2); + _protector.setPosition(Common::Point(284, 152)); + _protector.setup(3127, 2, 1); + _protector.changeZoom(-1); + _protector.setDetails(3600, 15, -1, 17, 1, (SceneItem *) NULL); } R2_GLOBALS._sound2.play(330); @@ -4576,9 +4578,8 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _actor5.setup(3403, 8, 11); _actor5.setPosition(Common::Point(403, 155)); - _actor12.setup(3403, 7, 1); - - _actor13.setPosition(Common::Point(405, 155)); + _protector.setup(3403, 7, 1); + _protector.setPosition(Common::Point(405, 155)); _actor2.postInit(); _actor2.setup(3600, 2, 1); @@ -4644,7 +4645,7 @@ void Scene3600::signal() { _tealSpeaker._displayMode = 7; R2_GLOBALS._scrollFollower = &_actor5; _sceneMode = 3605; - setAction(&_sequenceManager1, this, _sceneMode, &_actor5, &_actor13, &_actor2, NULL); + setAction(&_sequenceManager1, this, _sceneMode, &_actor5, &_protector, &_actor2, NULL); break; case 3323: if (_field254A == 0) @@ -4652,15 +4653,18 @@ void Scene3600::signal() { else { warning("STUB: sub_1D227()"); _protectorSpeaker.proc16(); - _actor13.show(); - _actor13.setup(3258, 6, 1); + _protector.show(); + _protector.setup(3258, 6, 1); + _sceneMode = 3607; - _actor13.setAction(&_sequenceManager1, this, _sceneMode, &_actor13, NULL); + _protector.setAction(&_sequenceManager1, this, _sceneMode, &_protector, NULL); + R2_GLOBALS._v558C2 = 1; _protectorSpeaker.proc16(); _protectorSpeaker._displayMode = 1; _quinnSpeaker._displayMode = 1; - _actor13.show(); + _protector.show(); + R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; R2_GLOBALS._walkRegions.enableRegion(17); R2_GLOBALS._walkRegions.enableRegion(18); @@ -4669,7 +4673,8 @@ void Scene3600::signal() { R2_GLOBALS._walkRegions.disableRegion(14); R2_GLOBALS._walkRegions.disableRegion(15); R2_GLOBALS._walkRegions.disableRegion(16); - _actor13.setAction(&_action1); + + _actor3.setAction(&_action1); } break; case 3324: @@ -4677,7 +4682,7 @@ void Scene3600::signal() { case 3607: g_globals->_events.setCursor(CURSOR_ARROW); R2_GLOBALS._player.enableControl(CURSOR_WALK); - _actor13.fixPriority(-1); + _protector.fixPriority(-1); _sceneMode = 3623; _field2548 = 1; break; @@ -4690,7 +4695,8 @@ void Scene3600::signal() { R2_GLOBALS._sound1.stop(); _actor1.hide(); _actor6.hide(); - g_globals->gfxManager()._bounds.moveTo(Common::Point(40, 0)); + + _sceneBounds = Rect(40, 0, SCREEN_WIDTH + 40, SCREEN_HEIGHT); setZoomPercents(142, 80, 167, 105); loadScene(3600); R2_GLOBALS._uiElements.show(); @@ -4706,17 +4712,17 @@ void Scene3600::signal() { _actor5.setPosition(Common::Point(298, 151)); - _actor13.postInit(); - _actor13._state = 0; - _actor13._field8A = Common::Point(226, 152); - _actor13._moveDiff = Common::Point(5, 3); - _actor13.setup(3403, 7, 1); - _actor13.setPosition(Common::Point(405, 155)); - _actor13.changeZoom(-1); - _actor13.addMover(NULL); - _actor13.animate(ANIM_MODE_NONE); - _actor13.hide(); - _actor13.setDetails(3600, 15, -1, 17, 5, &_item5); + _protector.postInit(); + _protector._state = 0; + _protector._field8A = Common::Point(226, 152); + _protector._moveDiff = Common::Point(5, 3); + _protector.setup(3403, 7, 1); + _protector.setPosition(Common::Point(405, 155)); + _protector.changeZoom(-1); + _protector.addMover(NULL); + _protector.animate(ANIM_MODE_NONE); + _protector.hide(); + _protector.setDetails(3600, 15, -1, 17, 5, &_item5); _actor2.setup(3600, 2, 1); _actor2.setPosition(Common::Point(403, 161)); @@ -4780,7 +4786,7 @@ void Scene3600::signal() { _actor4.hide(); _actor5.hide(); - g_globals->gfxManager()._bounds.moveTo(Common::Point(60, 0)); + _sceneBounds = Rect(60, 0, SCREEN_WIDTH + 60, SCREEN_HEIGHT); setZoomPercents(51, 46, 180, 200); loadScene(3400); @@ -4803,8 +4809,8 @@ void Scene3600::signal() { setAction(&_sequenceManager1, this, 3450, &_actor1, &_actor6, NULL); break; case 3605: - _actor13.setup(3258, 4, 1); - _actor13.setAction(&_sequenceManager1, this, 3606, &_actor5, &_actor13, &_actor2, NULL); + _protector.setup(3258, 4, 1); + _protector.setAction(&_sequenceManager1, this, 3606, &_actor5, &_protector, &_actor2, NULL); _sceneMode = 3323; _stripManager.start(3323, this); @@ -4812,12 +4818,13 @@ void Scene3600::signal() { case 3620: // No break on purpose case 3623: - if ((_actor13._position.x == 226) && (_actor13._position.y == 152) && (_action1._field1E != 0) && (_actor13._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { + if ((_protector._position.x == 226) && (_protector._position.y == 152) + && (_action1._field1E != 0) && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { R2_GLOBALS._sound2.stop(); R2_GLOBALS._sound2.play(331); R2_GLOBALS.setFlag(71); _sceneMode = 3626; - setAction(&_sequenceManager1, this, 3626, &_actor13, NULL); + setAction(&_sequenceManager1, this, 3626, &_protector, NULL); } break; case 3624: @@ -4834,7 +4841,7 @@ void Scene3600::signal() { R2_GLOBALS._sceneManager.changeScene(3700); break; case 3626: - _actor13.setPosition(Common::Point(0, 0)); + _protector.setPosition(Common::Point(0, 0)); _action1.setActionIndex(2); if (R2_GLOBALS._events.getCursor() > R2_LAST_INVENT) { R2_GLOBALS._events.setCursor(CURSOR_USE); @@ -4859,10 +4866,12 @@ void Scene3600::process(Event &event) { } void Scene3600::dispatch() { - if ((R2_GLOBALS._player.getRegionIndex() == 200) && (_action1._field1E != 0) && (_field254E == 0)){ + if ((R2_GLOBALS._player.getRegionIndex() == 200) && (_action1._field1E != 0) + && (_field254E == 0)) { R2_GLOBALS._sound2.fadeOut2(NULL); - if (_actor13._mover) - _actor13.addMover(NULL); + if (_protector._mover) + _protector.addMover(NULL); + if (R2_GLOBALS._player._action) R2_GLOBALS._player.setAction(NULL); if (R2_GLOBALS._player._mover) @@ -4900,7 +4909,7 @@ void Scene3600::dispatch() { _actor4.setAction(&_sequenceManager1, this, 3613, &_actor4, NULL); } - if ((_actor13.getRegionIndex() == 200) && (_action1._field1E != 0) && (_field254E == 0)){ + if ((_protector.getRegionIndex() == 200) && (_action1._field1E != 0) && (_field254E == 0)) { R2_GLOBALS._sound2.fadeOut2(NULL); _sceneMode = 3620; _field2550 = 1; @@ -4917,6 +4926,7 @@ void Scene3600::dispatch() { if (_actor4._mover) _actor4.addMover(NULL); } + Scene::dispatch(); } @@ -4924,6 +4934,7 @@ void Scene3600::dispatch() { * Scene 3700 - Cutscene - Teleport outside * *--------------------------------------------------------------------------*/ + void Scene3700::postInit(SceneObjectList *OwnerList) { loadScene(3700); R2_GLOBALS._uiElements._active = false; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index f9a4bf73ff..1d9041d153 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -704,7 +704,7 @@ class Scene3600 : public SceneExt { virtual bool startAction(CursorType action, Event &event); }; - class Actor13 : public SceneActorExt { + class Protector : public SceneActorExt { virtual bool startAction(CursorType action, Event &event); }; public: @@ -732,7 +732,7 @@ public: SceneActor _actor10; SceneActor _actor11; SceneActor _actor12; - Actor13 _actor13; + Protector _protector; SequenceManager _sequenceManager1; SequenceManager _sequenceManager2; SequenceManager _sequenceManager3; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 93f428547e..930ebe0d7b 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -1116,7 +1116,7 @@ void SpeakerProtector3600::proc15() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; if (!_object2) { - _object2 = &scene->_actor13; + _object2 = &scene->_protector; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); -- cgit v1.2.3 From 987bb6d454a89fb1b2469303d7cb6c65b88d16a3 Mon Sep 17 00:00:00 2001 From: Kirben Date: Fri, 27 Sep 2013 15:50:36 +1000 Subject: SCUMM: Add US Windows preview of Humongous Catalog. --- engines/scumm/scumm-md5.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h index 979573c5f5..ae80f306af 100644 --- a/engines/scumm/scumm-md5.h +++ b/engines/scumm/scumm-md5.h @@ -1,5 +1,5 @@ /* - This file was generated by the md5table tool on Thu Aug 15 12:47:39 2013 + This file was generated by the md5table tool on Fri Sep 27 05:44:12 2013 DO NOT EDIT MANUALLY! */ @@ -121,6 +121,7 @@ static const MD5Table md5table[] = { { "2723fea3dae0cb47768c424b145ae0e7", "tentacle", "Floppy", "Floppy", 7932, Common::EN_ANY, Common::kPlatformDOS }, { "27b2ef1653089fe5b897d9cc89ce784f", "balloon", "HE 80", "", -1, Common::RU_RUS, Common::kPlatformWindows }, { "27b3a4224ad63d5b04627595c1c1a025", "zak", "V2", "V2", -1, Common::IT_ITA, Common::kPlatformAmiga }, + { "288fb75b24389733c29fa107fe8d44e8", "catalog", "HE CUP", "Preview", 10795148, Common::EN_USA, Common::kPlatformUnknown }, { "28d24a33448fab6795850bc9f159a4a2", "atlantis", "FM-TOWNS", "Demo", 11170, Common::JA_JPN, Common::kPlatformFMTowns }, { "28ef68ee3ed76d7e2ee8ee13c15fbd5b", "loom", "EGA", "EGA", 5748, Common::EN_ANY, Common::kPlatformDOS }, { "28f07458f1b6c24e118a1ea056827701", "lost", "HE 99", "", -1, Common::NL_NLD, Common::kPlatformUnknown }, -- cgit v1.2.3 From 8053989dd13acc15ad911bf2511311f5cfa206ba Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 27 Sep 2013 11:07:25 +0300 Subject: SWORD25: Remove explictit #includes Makes Coverity happier. --- engines/sword25/util/lua/lcode.cpp | 2 -- engines/sword25/util/lua/ldebug.cpp | 5 ----- engines/sword25/util/lua/lfunc.cpp | 2 -- engines/sword25/util/lua/lgc.cpp | 2 -- engines/sword25/util/lua/llimits.h | 3 --- engines/sword25/util/lua/lmem.cpp | 2 -- engines/sword25/util/lua/lopcodes.cpp | 1 + engines/sword25/util/lua/lparser.cpp | 2 -- engines/sword25/util/lua/lstate.cpp | 2 -- engines/sword25/util/lua/lstring.cpp | 2 -- engines/sword25/util/lua/lstrlib.cpp | 6 ------ engines/sword25/util/lua/ltablib.cpp | 2 -- 12 files changed, 1 insertion(+), 30 deletions(-) (limited to 'engines') diff --git a/engines/sword25/util/lua/lcode.cpp b/engines/sword25/util/lua/lcode.cpp index ead780d359..93188b37e2 100644 --- a/engines/sword25/util/lua/lcode.cpp +++ b/engines/sword25/util/lua/lcode.cpp @@ -5,8 +5,6 @@ */ -#include - #define lcode_c #define LUA_CORE diff --git a/engines/sword25/util/lua/ldebug.cpp b/engines/sword25/util/lua/ldebug.cpp index e89ae9cad5..396c5df18b 100644 --- a/engines/sword25/util/lua/ldebug.cpp +++ b/engines/sword25/util/lua/ldebug.cpp @@ -5,11 +5,6 @@ */ -#include -#include -#include - - #define ldebug_c #define LUA_CORE diff --git a/engines/sword25/util/lua/lfunc.cpp b/engines/sword25/util/lua/lfunc.cpp index f8fa19e25a..95e616cc7e 100644 --- a/engines/sword25/util/lua/lfunc.cpp +++ b/engines/sword25/util/lua/lfunc.cpp @@ -5,8 +5,6 @@ */ -#include - #define lfunc_c #define LUA_CORE diff --git a/engines/sword25/util/lua/lgc.cpp b/engines/sword25/util/lua/lgc.cpp index 54f7b548dd..53f512280a 100644 --- a/engines/sword25/util/lua/lgc.cpp +++ b/engines/sword25/util/lua/lgc.cpp @@ -4,8 +4,6 @@ ** See Copyright Notice in lua.h */ -#include - #define lgc_c #define LUA_CORE diff --git a/engines/sword25/util/lua/llimits.h b/engines/sword25/util/lua/llimits.h index 0925231350..ce6dbc980c 100644 --- a/engines/sword25/util/lua/llimits.h +++ b/engines/sword25/util/lua/llimits.h @@ -8,9 +8,6 @@ #define llimits_h -#include -#include - #include "lua.h" diff --git a/engines/sword25/util/lua/lmem.cpp b/engines/sword25/util/lua/lmem.cpp index 004a467dc8..8cd220308c 100644 --- a/engines/sword25/util/lua/lmem.cpp +++ b/engines/sword25/util/lua/lmem.cpp @@ -5,8 +5,6 @@ */ -#include - #define lmem_c #define LUA_CORE diff --git a/engines/sword25/util/lua/lopcodes.cpp b/engines/sword25/util/lua/lopcodes.cpp index 255b2029e9..9d76862ae2 100644 --- a/engines/sword25/util/lua/lopcodes.cpp +++ b/engines/sword25/util/lua/lopcodes.cpp @@ -8,6 +8,7 @@ #define LUA_CORE +#include "lua.h" #include "lopcodes.h" diff --git a/engines/sword25/util/lua/lparser.cpp b/engines/sword25/util/lua/lparser.cpp index 03ea333315..0c88992e79 100644 --- a/engines/sword25/util/lua/lparser.cpp +++ b/engines/sword25/util/lua/lparser.cpp @@ -5,8 +5,6 @@ */ -#include - #define lparser_c #define LUA_CORE diff --git a/engines/sword25/util/lua/lstate.cpp b/engines/sword25/util/lua/lstate.cpp index 26bed7bec2..c0ea29de01 100644 --- a/engines/sword25/util/lua/lstate.cpp +++ b/engines/sword25/util/lua/lstate.cpp @@ -5,8 +5,6 @@ */ -#include - #define lstate_c #define LUA_CORE diff --git a/engines/sword25/util/lua/lstring.cpp b/engines/sword25/util/lua/lstring.cpp index 046b87ee1c..5cfc72539a 100644 --- a/engines/sword25/util/lua/lstring.cpp +++ b/engines/sword25/util/lua/lstring.cpp @@ -5,8 +5,6 @@ */ -#include - #define lstring_c #define LUA_CORE diff --git a/engines/sword25/util/lua/lstrlib.cpp b/engines/sword25/util/lua/lstrlib.cpp index ed68a2fa00..5da45e1fea 100644 --- a/engines/sword25/util/lua/lstrlib.cpp +++ b/engines/sword25/util/lua/lstrlib.cpp @@ -7,12 +7,6 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_ctype_h -#include -#include -#include -#include -#include - #define lstrlib_c #define LUA_LIB diff --git a/engines/sword25/util/lua/ltablib.cpp b/engines/sword25/util/lua/ltablib.cpp index 93be9e6077..064c33c005 100644 --- a/engines/sword25/util/lua/ltablib.cpp +++ b/engines/sword25/util/lua/ltablib.cpp @@ -5,8 +5,6 @@ */ -#include - #define ltablib_c #define LUA_LIB -- cgit v1.2.3 From 7990300c96eaca97e92ba209f513ddb673cf5d8d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 27 Sep 2013 22:16:15 +0300 Subject: FULLPIPE: Implemented MctlCompound::initMovGraph2() --- engines/fullpipe/motion.cpp | 96 ++++++++++++++++++++++++++++++++++++++++++--- engines/fullpipe/motion.h | 64 ++++++++++++++++++++---------- 2 files changed, 133 insertions(+), 27 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index b63267c572..5fd8d61263 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -68,7 +68,7 @@ bool MctlCompound::load(MfcArchive &file) { debug(6, "graphReact"); obj->_movGraphReactObj = (MovGraphReact *)file.readClass(); - _motionControllers.push_back(*obj); + _motionControllers.push_back(obj); } return true; @@ -87,7 +87,6 @@ int MctlCompound::removeObject(StaticANIObject *obj) { } void MctlCompound::initMovGraph2() { -#if 0 if (_objtype != kObjTypeMctlCompound) return; @@ -97,10 +96,10 @@ void MctlCompound::initMovGraph2() { MovGraph *gr = (MovGraph *)_motionControllers[i]->_motionControllerObj; - CMovGraph2 *newgr = new MovGraph2(); + MovGraph2 *newgr = new MovGraph2(); - newgr->_links.push_back(gr->_links); - newgr->_nodes.push_back(gr->_nodes); + newgr->_links = gr->_links; + newgr->_nodes = gr->_nodes; gr->_links.clear(); gr->_nodes.clear(); @@ -109,7 +108,6 @@ void MctlCompound::initMovGraph2() { _motionControllers[i]->_motionControllerObj = newgr; } -#endif } void MctlCompound::freeItems() { @@ -173,12 +171,98 @@ int MovGraph::addObject(StaticANIObject *obj) { return 0; } +int MovGraph::removeObject(StaticANIObject *obj) { + warning("STUB: MovGraph::removeObject()"); + + return 0; +} + +void MovGraph::freeItems() { + warning("STUB: MovGraph::freeItems()"); +} + +int MovGraph::method28() { + warning("STUB: MovGraph::method28()"); + + return 0; +} + +int MovGraph::method2C() { + warning("STUB: MovGraph::method2C()"); + + return 0; +} + +MessageQueue *MovGraph::method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { + warning("STUB: MovGraph::method34()"); + + return 0; +} + +int MovGraph::changeCallback() { + warning("STUB: MovGraph::changeCallback()"); + + return 0; +} + +int MovGraph::method3C() { + warning("STUB: MovGraph::method3C()"); + + return 0; +} + +int MovGraph::method44() { + warning("STUB: MovGraph::method44()"); + + return 0; +} + +MessageQueue *MovGraph::method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { + warning("STUB: MovGraph::method4C()"); + + return 0; +} + +int MovGraph::method50() { + warning("STUB: MovGraph::method50()"); + + return 0; +} + double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int flag) { warning("STUB: MovGraph::calcDistance()"); return 0; } +int MovGraph2::addObject(StaticANIObject *obj) { + warning("STUB: MovGraph2::addObject()"); + + return 0; +} + +int MovGraph2::removeObject(StaticANIObject *obj) { + warning("STUB: MovGraph2::removeObject()"); + + return 0; +} + +void MovGraph2::freeItems() { + warning("STUB: MovGraph2::freeItems()"); +} + +MessageQueue *MovGraph2::method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { + warning("STUB: MovGraph2::method34()"); + + return 0; +} + +MessageQueue *MovGraph2::method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { + warning("STUB: MovGraph2::method4C()"); + + return 0; +} + MovGraphNode *MovGraph::calcOffset(int ox, int oy) { warning("STUB: MovGraph::calcOffset()"); diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index b0bfe92d1f..2db3db6676 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -57,12 +57,31 @@ public: virtual MessageQueue *method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) { return 0; } }; -class MctlCompoundArray : public Common::Array, public CObject { +class MovGraphReact : public CObject { + // Empty +}; + +class MctlConnectionPointsArray : public Common::Array, public CObject { public: virtual bool load(MfcArchive &file); }; -class MctlConnectionPointsArray : public Common::Array, public CObject { +class MctlCompoundArrayItem : public CObject { + friend class MctlCompound; + + protected: + MotionController *_motionControllerObj; + MovGraphReact *_movGraphReactObj; + MctlConnectionPointsArray _connectionPoints; + int _field_20; + int _field_24; + int _field_28; + + public: + MctlCompoundArrayItem() : _movGraphReactObj(0) {} +}; + +class MctlCompoundArray : public Common::Array, public CObject { public: virtual bool load(MfcArchive &file); }; @@ -105,25 +124,6 @@ class MovGraphNode : public CObject { virtual bool load(MfcArchive &file); }; -class MovGraphReact : public CObject { - // Empty -}; - -class MctlCompoundArrayItem : public CObject { - friend class MctlCompound; - - protected: - MotionController *_motionControllerObj; - MovGraphReact *_movGraphReactObj; - MctlConnectionPointsArray _connectionPoints; - int _field_20; - int _field_24; - int _field_28; - - public: - MctlCompoundArrayItem() : _movGraphReactObj(0) {} -}; - class ReactParallel : public MovGraphReact { //CRgn _rgn; int _x1; @@ -187,11 +187,33 @@ class MovGraph : public MotionController { virtual bool load(MfcArchive &file); virtual int addObject(StaticANIObject *obj); + virtual int removeObject(StaticANIObject *obj); + virtual void freeItems(); + virtual int method28(); + virtual int method2C(); + virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); + virtual int changeCallback(); + virtual int method3C(); + virtual int method44(); + virtual MessageQueue *method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); + virtual int method50(); double calcDistance(Common::Point *point, MovGraphLink *link, int flag); MovGraphNode *calcOffset(int ox, int oy); }; +class MovGraph2 : public MovGraph { +public: + ObArray _items; + +public: + virtual int addObject(StaticANIObject *obj); + virtual int removeObject(StaticANIObject *obj); + virtual void freeItems(); + virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); + virtual MessageQueue *method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); +}; + class MctlConnectionPoint : public CObject { int _connectionX; int _connectionY; -- cgit v1.2.3 From 789c8bbfdbaf266dabfd480b6320414a4483eb0d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 27 Sep 2013 20:05:48 -0400 Subject: TSAGE: Bugfixes and renaming for R2R teleport outside --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 52 ++++++++--------- engines/tsage/ringworld2/ringworld2_scenes3.h | 10 ++-- engines/tsage/ringworld2/ringworld2_speakers.cpp | 71 ++++++++++++------------ 3 files changed, 68 insertions(+), 65 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 224626b566..c64665a839 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -4238,7 +4238,7 @@ Scene3600::Scene3600() { _field254A = 0; _field254C = 0; _field254E = 0; - _field2550 = false; + _ghoulTeleported = false; } void Scene3600::synchronize(Serializer &s) { SceneExt::synchronize(s); @@ -4247,7 +4247,7 @@ void Scene3600::synchronize(Serializer &s) { s.syncAsSint16LE(_field254A); s.syncAsSint16LE(_field254C); s.syncAsSint16LE(_field254E); - s.syncAsSint16LE(_field2550); + s.syncAsSint16LE(_ghoulTeleported); } Scene3600::Action3600::Action3600() { @@ -4277,8 +4277,8 @@ void Scene3600::Action3600::signal() { R2_GLOBALS._sound2.play(330, NULL, 0); R2_GLOBALS._sound2.fade(127, 5, 10, false, NULL); } + setDelay(1); - warning("TODO: Palette fader using parameter 2 = 256"); R2_GLOBALS._scenePalette.fade((const byte *)&scene->_palette1._palette, true, _field20); if (_field20 > 0) _field20 -= 2; @@ -4595,7 +4595,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { _field254E = 0; } _field254E = 0; - _field2550 = R2_GLOBALS.getFlag(71); + _ghoulTeleported = R2_GLOBALS.getFlag(71); R2_GLOBALS._sound1.play(326); _item1.setDetails(Rect(0, 0, 480, 200), 3600, 0, -1, -1, 1, NULL); @@ -4909,10 +4909,10 @@ void Scene3600::dispatch() { _actor4.setAction(&_sequenceManager1, this, 3613, &_actor4, NULL); } - if ((_protector.getRegionIndex() == 200) && (_action1._field1E != 0) && (_field254E == 0)) { + if ((_protector.getRegionIndex() == 200) && (_action1._field1E != 0) && !_ghoulTeleported) { R2_GLOBALS._sound2.fadeOut2(NULL); _sceneMode = 3620; - _field2550 = 1; + _ghoulTeleported = true; R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._mover) @@ -4937,8 +4937,9 @@ void Scene3600::dispatch() { void Scene3700::postInit(SceneObjectList *OwnerList) { loadScene(3700); - R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); + R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; _stripManager.setColors(60, 255); _stripManager.setFontNumber(3); @@ -4946,30 +4947,31 @@ void Scene3700::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_seekerSpeaker); _stripManager.addSpeaker(&_mirandaSpeaker); - _actor1.postInit(); - _actor1._moveDiff = Common::Point(3, 2); + _quinn.postInit(); + _quinn._moveDiff = Common::Point(3, 2); - _actor2.postInit(); - _actor2._numFrames = 7; - _actor2._moveDiff = Common::Point(5, 3); - _actor2.hide(); + _seeker.postInit(); + _seeker._numFrames = 7; + _seeker._moveDiff = Common::Point(5, 3); + _seeker.hide(); - _actor3.postInit(); - _actor3._moveDiff = Common::Point(3, 2); - _actor3.hide(); + _miranda.postInit(); + _miranda._moveDiff = Common::Point(3, 2); + _miranda.hide(); - _actor4.postInit(); - _actor4._numFrames = 7; - _actor4._moveDiff = Common::Point(5, 3); - _actor4.hide(); + _webbster.postInit(); + _webbster._numFrames = 7; + _webbster._moveDiff = Common::Point(5, 3); + _webbster.hide(); _actor5.postInit(); - R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.disableControl(); R2_GLOBALS._sound1.play(332); _sceneMode = 3700; - setAction(&_sequenceManager, this, 3700, &_actor1, &_actor2, &_actor3, &_actor4, &_actor5, NULL); + setAction(&_sequenceManager, this, 3700, &_quinn, &_seeker, &_miranda, + &_webbster, &_actor5, NULL); } void Scene3700::remove() { @@ -4984,11 +4986,11 @@ void Scene3700::signal() { case 3329: warning("STUB: sub_1D227()"); _sceneMode = 3701; - setAction(&_sequenceManager, this, 3701, &_actor2, &_actor3, &_actor4, NULL); + setAction(&_sequenceManager, this, 3701, &_seeker, &_miranda, &_webbster, NULL); break; case 3700: - _actor1.setup(10, 6, 1); - _actor2.setup(20, 5, 1); + _quinn.setup(10, 6, 1); + _seeker.setup(20, 5, 1); if (R2_GLOBALS.getFlag(71)) { _sceneMode = 3329; _stripManager.start(3329, this); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 1d9041d153..6c7a594b12 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -743,7 +743,7 @@ public: int _field254A; int _field254C; int _field254E; - bool _field2550; + bool _ghoulTeleported; Scene3600(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -759,10 +759,10 @@ public: SpeakerQuinn3700 _quinnSpeaker; SpeakerSeeker3700 _seekerSpeaker; SpeakerMiranda3700 _mirandaSpeaker; - SceneActor _actor1; - SceneActor _actor2; - SceneActor _actor3; - SceneActor _actor4; + SceneActor _quinn; + SceneActor _seeker; + SceneActor _miranda; + SceneActor _webbster; SceneActor _actor5; SequenceManager _sequenceManager; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 930ebe0d7b..a661d3ed44 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -866,7 +866,7 @@ void SpeakerMiranda3700::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor3; + _object2 = &scene->_miranda; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -886,25 +886,25 @@ void SpeakerMiranda3700::proc15() { break; case 1: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor1.setup(10, 6, 1); - scene->_actor2.setup(20, 5, 1); + scene->_quinn.setup(10, 6, 1); + scene->_seeker.setup(20, 5, 1); _object2->setup(30, 1, 1); - scene->_actor4.setup(40, 1, 1); + scene->_webbster.setup(40, 1, 1); _object1.setup(4050, 5, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor3.setup(30, 8, 1); + scene->_miranda.setup(30, 8, 1); _object1.setup(4052, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor2.setup(20, 1, 1); - scene->_actor3.setup(30, 1, 1); + scene->_seeker.setup(20, 1, 1); + scene->_miranda.setup(30, 1, 1); _object1.setup(4051, 7, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -1757,14 +1757,14 @@ void SpeakerQuinn3700::setText(const Common::String &msg) { switch (_speakerMode) { case 2: - scene->_actor3.setup(30, 1, 1); + scene->_miranda.setup(30, 1, 1); R2_GLOBALS._sound2.play(44); break; case 3: - scene->_actor3.setup(30, 1, 1); + scene->_miranda.setup(30, 1, 1); break; default: - scene->_actor3.setup(30, 7, 1); + scene->_miranda.setup(30, 7, 1); break; } VisualSpeaker::setText(msg); @@ -1776,7 +1776,7 @@ void SpeakerQuinn3700::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor1; + _object2 = &scene->_quinn; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -1797,24 +1797,24 @@ void SpeakerQuinn3700::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; R2_GLOBALS._sound2.stop(); - scene->_actor1.setup(10, 4, 1); - scene->_actor3.setup(30, 7, 1); + scene->_quinn.setup(10, 4, 1); + scene->_miranda.setup(30, 7, 1); _object1.setup(3701, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor2.setup(20, 1, 1); - scene->_actor3.setup(30, 1, 1); - _object1.setup(3701, 2, 1); - _object1.animate(ANIM_MODE_5, NULL); + scene->_seeker.setup(20, 1, 1); + scene->_miranda.setup(30, 1, 1); + _object1.setup(3702, 1, 1); + _object1.animate(ANIM_MODE_5, this); break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor1.setup(10, 2, 1); - scene->_actor3.setup(30, 1, 1); + scene->_quinn.setup(10, 2, 1); + scene->_miranda.setup(30, 1, 1); _object1.setup(4011, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); @@ -2467,10 +2467,11 @@ void SpeakerSeeker3700::setText(const Common::String &msg) { if (_speakerMode == 1) { R2_GLOBALS._sound2.play(44); - scene->_actor3.setup(30, 8, 1); + scene->_miranda.setup(30, 8, 1); } else { - scene->_actor3.setup(30, 2, 1); + scene->_miranda.setup(30, 2, 1); } + VisualSpeaker::setText(msg); } @@ -2480,7 +2481,7 @@ void SpeakerSeeker3700::proc15() { int v = _speakerMode; if (!_object2) { - _object2 = &scene->_actor2; + _object2 = &scene->_seeker; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); @@ -2501,19 +2502,19 @@ void SpeakerSeeker3700::proc15() { case 1: ((SceneItem *)_action)->_sceneRegionId = 0; R2_GLOBALS._sound2.stop(); - scene->_actor1.setup(10, 8, 1); - scene->_actor2.setup(20, 7, 1); - scene->_actor3.setup(30, 8, 1); + scene->_quinn.setup(10, 8, 1); + scene->_seeker.setup(20, 7, 1); + scene->_miranda.setup(30, 8, 1); _object1.setup(3701, 3, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; case 2: ((SceneItem *)_action)->_sceneRegionId = 0; - scene->_actor1.setup(10, 2, 1); - scene->_actor2.setup(20, 1, 1); - scene->_actor3.setup(30, 1, 1); + scene->_quinn.setup(10, 2, 1); + scene->_seeker.setup(20, 1, 1); + scene->_miranda.setup(30, 1, 1); _object1.setup(4031, 1, 1); - _object1.animate(ANIM_MODE_5, NULL); + _object1.animate(ANIM_MODE_5, this); break; default: signal(); -- cgit v1.2.3 From e07723e1d1e2343ae5c4b288e1eada8c59c0e262 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sat, 28 Sep 2013 01:33:43 +0100 Subject: TINSEL: Fix compilation on FreeBSD with C++-11 enabled. This is part of bug #3615056 and is due to NULL being defined as nullptr when C++-11 is enabled, which is not valid being assigned to a integer value. --- engines/tinsel/scene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp index 43654fc3af..043b18b8c5 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -186,7 +186,7 @@ static void SceneTinselProcess(CORO_PARAM, const void *param) { void SendSceneTinselProcess(TINSEL_EVENT event) { SCENE_STRUC *ss; - if (g_SceneHandle != (SCNHANDLE)NULL) { + if (g_SceneHandle != 0) { ss = (SCENE_STRUC *) FindChunk(g_SceneHandle, CHUNK_SCENE); if (ss->hSceneScript) { -- cgit v1.2.3 From 93c337524422cf93ea987abeb6fe44f088d9fe5b Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sat, 28 Sep 2013 01:37:15 +0100 Subject: TONY: Fix compilation on FreeBSD with C++-11 enabled. This is part of bug #3615056 and is due to NULL being defined as nullptr when C++-11 is enabled, which is not valid being assigned to a integer value. --- engines/tony/mpal/mpal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp index 5e6d44f0a3..7010c238b5 100644 --- a/engines/tony/mpal/mpal.cpp +++ b/engines/tony/mpal/mpal.cpp @@ -409,7 +409,7 @@ static uint32 *getSelectList(uint32 i) { sl[k++] = dialog->_choice[i]._select[j]._dwData; } - sl[k] = (uint32)NULL; + sl[k] = 0; return sl; } @@ -436,7 +436,7 @@ static uint32 *GetItemList(uint32 nLoc) { } } - il[j] = (uint32)NULL; + il[j] = 0; return il; } @@ -832,7 +832,7 @@ void LocationPollThread(CORO_PARAM, const void *param) { if (_ctx->k == 0) // We can remove this item from the list - _ctx->il[_ctx->i] = (uint32)NULL; + _ctx->il[_ctx->i] = 0; else _ctx->nRealItems++; } -- cgit v1.2.3 From d207dcfba64cefc8c3423878c8f20ee7752a862c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 11:21:13 +0300 Subject: FULLPIPE: Bug fix MctlCompound::load() --- engines/fullpipe/motion.cpp | 4 +++- engines/fullpipe/motion.h | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 5fd8d61263..5def3cb4a7 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -50,7 +50,9 @@ bool MctlCompound::load(MfcArchive &file) { for (int i = 0; i < count; i++) { debug(6, "CompoundArray[%d]", i); - MctlCompoundArrayItem *obj = (MctlCompoundArrayItem *)file.readClass(); + MctlCompoundArrayItem *obj = new MctlCompoundArrayItem(); + + obj->_motionControllerObj = (MotionController *)file.readClass(); int count1 = file.readUint32LE(); diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 2db3db6676..3e76f24c60 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -61,10 +61,7 @@ class MovGraphReact : public CObject { // Empty }; -class MctlConnectionPointsArray : public Common::Array, public CObject { - public: - virtual bool load(MfcArchive &file); -}; +typedef Common::Array MctlConnectionPointsArray; class MctlCompoundArrayItem : public CObject { friend class MctlCompound; -- cgit v1.2.3 From b22c7d28f7d757c56d998a2c5d286e3679ae9249 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 13:06:06 +0300 Subject: FULLPIPE: Implement MctlCompound::addObject() --- engines/fullpipe/motion.cpp | 15 +++++---------- engines/fullpipe/motion.h | 8 ++++---- 2 files changed, 9 insertions(+), 14 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 5def3cb4a7..66664b1de5 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -76,10 +76,9 @@ bool MctlCompound::load(MfcArchive &file) { return true; } -int MctlCompound::addObject(StaticANIObject *obj) { - warning("STUB: MctlCompound::addObject()"); - - return 0; +void MctlCompound::addObject(StaticANIObject *obj) { + for (uint i = 0; i < _motionControllers.size(); i++) + _motionControllers[i]->_motionControllerObj->addObject(obj); } int MctlCompound::removeObject(StaticANIObject *obj) { @@ -167,10 +166,8 @@ bool MovGraph::load(MfcArchive &file) { return true; } -int MovGraph::addObject(StaticANIObject *obj) { +void MovGraph::addObject(StaticANIObject *obj) { warning("STUB: MovGraph::addObject()"); - - return 0; } int MovGraph::removeObject(StaticANIObject *obj) { @@ -237,10 +234,8 @@ double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int flag return 0; } -int MovGraph2::addObject(StaticANIObject *obj) { +void MovGraph2::addObject(StaticANIObject *obj) { warning("STUB: MovGraph2::addObject()"); - - return 0; } int MovGraph2::removeObject(StaticANIObject *obj) { diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 3e76f24c60..0f91a99600 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -42,7 +42,7 @@ public: virtual void method10() {} virtual void clearEnabled() { _isEnabled = false; } virtual void setEnabled() { _isEnabled = true; } - virtual int addObject(StaticANIObject *obj) { return 0; } + virtual void addObject(StaticANIObject *obj) {} virtual int removeObject(StaticANIObject *obj) { return 0; } virtual void freeItems() {} virtual int method28() { return 0; } @@ -91,7 +91,7 @@ class MctlCompound : public MotionController { virtual bool load(MfcArchive &file); - virtual int addObject(StaticANIObject *obj); + virtual void addObject(StaticANIObject *obj); virtual int removeObject(StaticANIObject *obj); virtual void freeItems(); virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); @@ -183,7 +183,7 @@ class MovGraph : public MotionController { MovGraph(); virtual bool load(MfcArchive &file); - virtual int addObject(StaticANIObject *obj); + virtual void addObject(StaticANIObject *obj); virtual int removeObject(StaticANIObject *obj); virtual void freeItems(); virtual int method28(); @@ -204,7 +204,7 @@ public: ObArray _items; public: - virtual int addObject(StaticANIObject *obj); + virtual void addObject(StaticANIObject *obj); virtual int removeObject(StaticANIObject *obj); virtual void freeItems(); virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); -- cgit v1.2.3 From dd7995958dd5d1efd59f86c27384fd1b58dfa098 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 14:15:46 +0300 Subject: FULLPIPE: Implement MovGraph2::addObject() --- engines/fullpipe/motion.cpp | 33 +++++++++++++++++++++++++++++++-- engines/fullpipe/motion.h | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 61 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 66664b1de5..d2ece50aa2 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -27,6 +27,7 @@ #include "common/list.h" #include "fullpipe/objects.h" +#include "fullpipe/statics.h" #include "fullpipe/motion.h" #include "fullpipe/messages.h" #include "fullpipe/gameloader.h" @@ -234,8 +235,37 @@ double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int flag return 0; } +int MovGraph2::getItemIndexByGameObjectId(int objectId) { + for (uint i = 0; i < _items.size(); i++) + if (_items[i]->_objectId == objectId) + return i; + + return -1; +} + +bool MovGraph2::initDirections(StaticANIObject *obj, MovGraph2Item *item) { + warning("STUB: MovGraph2::initDirections()"); + + return false; +} + void MovGraph2::addObject(StaticANIObject *obj) { - warning("STUB: MovGraph2::addObject()"); + MovGraph::addObject(obj); + + int id = getItemIndexByGameObjectId(obj->_id); + + if (id >= 0) { + _items[id]->_obj = obj; + } else { + + MovGraph2Item *item = new MovGraph2Item; + + if (initDirections(obj, item)) { + _items.push_back(item); + } else { + delete item; + } + } } int MovGraph2::removeObject(StaticANIObject *obj) { @@ -266,7 +296,6 @@ MovGraphNode *MovGraph::calcOffset(int ox, int oy) { return 0; } - MovGraphLink::MovGraphLink() { _distance = 0; _angle = 0; diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 0f91a99600..7cc20e392c 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -101,10 +101,11 @@ class MctlCompound : public MotionController { }; class Unk2 : public CObject { +public: int _items; int _count; - public: +public: Unk2() : _items(0), _count(0) {} }; @@ -199,9 +200,32 @@ class MovGraph : public MotionController { MovGraphNode *calcOffset(int ox, int oy); }; +class Movement; + +struct MG2I { + int _movementId; + Movement *_movement; + int _mx; + int _my; +}; + +struct MovGraph2ItemSub { + int _staticsId2; + int _staticsId1; + MG2I _field_8[3]; + MG2I _field_38[4]; + MG2I _field_78[4]; +}; + +struct MovGraph2Item { + int _objectId; + StaticANIObject *_obj; + MovGraph2ItemSub _subItems[4]; +}; + class MovGraph2 : public MovGraph { public: - ObArray _items; + Common::Array _items; public: virtual void addObject(StaticANIObject *obj); @@ -209,9 +233,13 @@ public: virtual void freeItems(); virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); virtual MessageQueue *method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId); + + int getItemIndexByGameObjectId(int objectId); + bool initDirections(StaticANIObject *obj, MovGraph2Item *item); }; class MctlConnectionPoint : public CObject { +public: int _connectionX; int _connectionY; int _field_C; -- cgit v1.2.3 From ac1be668d93a2cd83d8f20ff3fb7f8541ec878d7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 15:59:46 +0300 Subject: FULLPIPE: Implement MovGraph2::initDirections() --- engines/fullpipe/motion.cpp | 128 ++++++++++++++++++++++++++++++++++++++++++- engines/fullpipe/motion.h | 8 +-- engines/fullpipe/statics.cpp | 6 ++ engines/fullpipe/statics.h | 2 + 4 files changed, 137 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index d2ece50aa2..a7726f3725 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -244,9 +244,132 @@ int MovGraph2::getItemIndexByGameObjectId(int objectId) { } bool MovGraph2::initDirections(StaticANIObject *obj, MovGraph2Item *item) { - warning("STUB: MovGraph2::initDirections()"); + item->_obj = obj; + item->_objectId = obj->_id; + + GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(obj->_objectName); + if (!var) + return false; + + var = var->getSubVarByName("Test_walk"); + + if (!var) + return false; + + GameVar *varD = 0; + Common::Point point; + + for (int dir = 0; dir < 4; dir++) { + switch (dir) { + case 0: + varD = var->getSubVarByName("Right"); + break; + case 1: + varD = var->getSubVarByName("Left"); + break; + case 2: + varD = var->getSubVarByName("Up"); + break; + case 3: + varD = var->getSubVarByName("Down"); + break; + } + + if (!varD) + return false; + + for (int act = 0; act < 3; act++) { + int idx; + + switch(act) { + case 0: + idx = varD->getSubVarAsInt("Start"); + break; + case 1: + idx = varD->getSubVarAsInt("Go"); + break; + case 2: + idx = varD->getSubVarAsInt("Stop"); + break; + } + + item->_subItems[dir]._walk[act]._movementId = idx; + + Movement *mov = obj->getMovementById(idx); + + item->_subItems[dir]._walk[act]._mov = mov; + if (mov) { + mov->calcSomeXY(point, 0); + item->_subItems[dir]._walk[act]._mx = point.x; + item->_subItems[dir]._walk[act]._my = point.y; + } + } - return false; + for (int act = 0; act < 4; act++) { + int idx; + + switch(act) { + case 0: + idx = varD->getSubVarAsInt("TurnR"); + break; + case 1: + idx = varD->getSubVarAsInt("TurnL"); + break; + case 2: + idx = varD->getSubVarAsInt("TurnU"); + break; + case 3: + idx = varD->getSubVarAsInt("TurnD"); + break; + } + + item->_subItems[dir]._turn[act]._movementId = idx; + + Movement *mov = obj->getMovementById(idx); + + item->_subItems[dir]._turn[act]._mov = mov; + if (mov) { + mov->calcSomeXY(point, 0); + item->_subItems[dir]._turn[act]._mx = point.x; + item->_subItems[dir]._turn[act]._my = point.y; + } + } + + for (int act = 0; act < 4; act++) { + int idx; + + switch(act) { + case 0: + idx = varD->getSubVarAsInt("TurnSR"); + break; + case 1: + idx = varD->getSubVarAsInt("TurnSL"); + break; + case 2: + idx = varD->getSubVarAsInt("TurnSU"); + break; + case 3: + idx = varD->getSubVarAsInt("TurnSD"); + break; + } + + item->_subItems[dir]._turnS[act]._movementId = idx; + + Movement *mov = obj->getMovementById(idx); + + item->_subItems[dir]._turnS[act]._mov = mov; + if (mov) { + mov->calcSomeXY(point, 0); + item->_subItems[dir]._turnS[act]._mx = point.x; + item->_subItems[dir]._turnS[act]._my = point.y; + } + } + + item->_subItems[dir]._staticsId1 = item->_subItems[dir]._walk[0]._mov->_staticsObj1->_staticsId; + item->_subItems[dir]._staticsId2 = item->_subItems[dir]._walk[0]._mov->_staticsObj2->_staticsId; + + } + return true; } void MovGraph2::addObject(StaticANIObject *obj) { @@ -257,7 +380,6 @@ void MovGraph2::addObject(StaticANIObject *obj) { if (id >= 0) { _items[id]->_obj = obj; } else { - MovGraph2Item *item = new MovGraph2Item; if (initDirections(obj, item)) { diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 7cc20e392c..99d8d3eb79 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -204,7 +204,7 @@ class Movement; struct MG2I { int _movementId; - Movement *_movement; + Movement *_mov; int _mx; int _my; }; @@ -212,9 +212,9 @@ struct MG2I { struct MovGraph2ItemSub { int _staticsId2; int _staticsId1; - MG2I _field_8[3]; - MG2I _field_38[4]; - MG2I _field_78[4]; + MG2I _walk[3]; + MG2I _turn[4]; + MG2I _turnS[4]; }; struct MovGraph2Item { diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index e33eb1139e..a7805395ad 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -1245,6 +1245,12 @@ Common::Point *Movement::getCurrDynamicPhaseXY(Common::Point &p) { return &p; } +Common::Point *Movement::calcSomeXY(Common::Point &p, int idx) { + warning("STUB: Movement::calcSomeXY()"); + + return &p; +} + void Movement::setAlpha(int alpha) { if (_currMovement) for (uint i = 0; i < _currMovement->_dynamicPhases.size(); i++) { diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 1767a5720e..2879edd8e1 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -140,6 +140,8 @@ class Movement : public GameObject { Common::Point *getCenter(Common::Point *p); Common::Point *getDimensionsOfPhase(Common::Point *p, int phaseIndex); + Common::Point *calcSomeXY(Common::Point &p, int idx); + void initStatics(StaticANIObject *ani); void updateCurrDynamicPhase(); -- cgit v1.2.3 From 68d446c919763132bcf4fb01f657557d55e71021 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 28 Sep 2013 09:57:51 -0400 Subject: TSAGE: Bugfixes and renaming for R2R title screen --- engines/tsage/ringworld2/ringworld2_logic.cpp | 14 +-- engines/tsage/ringworld2/ringworld2_logic.h | 2 +- engines/tsage/ringworld2/ringworld2_scenes0.cpp | 137 ++++++++++++----------- engines/tsage/ringworld2/ringworld2_scenes0.h | 8 +- engines/tsage/ringworld2/ringworld2_speakers.cpp | 82 +++++++++++++- engines/tsage/ringworld2/ringworld2_speakers.h | 17 ++- 6 files changed, 176 insertions(+), 84 deletions(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 4050c62a78..22ad35017c 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -38,8 +38,6 @@ namespace TsAGE { namespace Ringworld2 { Scene *Ringworld2Game::createScene(int sceneNumber) { - warning("Switching to scene %d", sceneNumber); - switch (sceneNumber) { /* Scene group #0 */ case 50: @@ -1118,10 +1116,10 @@ void Ringworld2Game::start() { if (slot >= 0) R2_GLOBALS._sceneHandler->_loadGameSlot = slot; else { - // Switch to the first game scene + // Switch to the first title screen R2_GLOBALS._events.setCursor(CURSOR_WALK); R2_GLOBALS._uiElements._active = true; - R2_GLOBALS._sceneManager.setNewScene(100); + R2_GLOBALS._sceneManager.setNewScene(180); } g_globals->_events.showCursor(); @@ -1132,7 +1130,7 @@ void Ringworld2Game::restart() { g_globals->_soundHandler.stop(); // Change to the first game scene - g_globals->_sceneManager.changeScene(100); + g_globals->_sceneManager.changeScene(180); } void Ringworld2Game::endGame(int resNum, int lineNum) { @@ -2087,7 +2085,7 @@ void AnimationPlayer::close() { _field38 = 0; if (g_globals != NULL) - R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr, 0); + R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr - 1, 0); } void AnimationPlayer::rleDecode(const byte *pSrc, byte *pDest, int size) { @@ -2133,13 +2131,13 @@ void AnimationPlayer::getSlices() { /*--------------------------------------------------------------------------*/ AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() { - _v = 0; + _isActive = false; _field3A = 0; } void AnimationPlayerExt::synchronize(Serializer &s) { AnimationPlayer::synchronize(s); - s.syncAsSint16LE(_v); + s.syncAsSint16LE(_isActive); } /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 57a30dcc13..a9fa0cfeea 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -441,7 +441,7 @@ public: class AnimationPlayerExt: public AnimationPlayer { public: - int _v; + bool _isActive; public: AnimationPlayerExt(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 4eefa11de9..4ca8eee5de 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -228,6 +228,7 @@ bool Scene100::Terminal::startAction(CursorType action, Event &event) { void Scene100::postInit(SceneObjectList *OwnerList) { loadScene(100); R2_GLOBALS._scenePalette.loadPalette(0); + R2_GLOBALS._scenePalette.setEntry(255, 255, 255, 255); SceneExt::postInit(); if (R2_GLOBALS._sceneManager._previousScene != 125) @@ -1480,14 +1481,14 @@ void Scene180::Action1::signal() { case 0: case 1: case 2: - scene->_object5.setStrip((_actionIndex == 1) ? 1 : 2); - scene->_object5.setFrame(1); - scene->_object5.animate(ANIM_MODE_5, this); + scene->_shipDisplay.setStrip((_actionIndex == 1) ? 1 : 2); + scene->_shipDisplay.setFrame(1); + scene->_shipDisplay.animate(ANIM_MODE_5, this); break; case 4: - scene->_object5.setStrip(3); - scene->_object5.setFrame(1); - scene->_object5.animate(ANIM_MODE_5, this); + scene->_shipDisplay.setStrip(3); + scene->_shipDisplay.setFrame(1); + scene->_shipDisplay.animate(ANIM_MODE_5, this); _actionIndex = 0; break; } @@ -1495,7 +1496,7 @@ void Scene180::Action1::signal() { /*--------------------------------------------------------------------------*/ -Scene180::Scene180(): SceneExt(), _webbsterSpeaker(27) { +Scene180::Scene180(): SceneExt() { _field412 = 0; _frameInc = 0; _frameNumber = R2_GLOBALS._events.getFrameNumber(); @@ -1562,7 +1563,7 @@ void Scene180::signal() { _field412 = 1; R2_GLOBALS._sceneManager._hasPalette = true; _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 1; @@ -1605,7 +1606,7 @@ void Scene180::signal() { case 5: _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 2; _animationPlayer.load(2); @@ -1648,9 +1649,9 @@ void Scene180::signal() { case 11: _field412 = 1; - _object4.postInit(); - _object5.postInit(); - setAction(&_sequenceManager, this, 4000, &_object4, &_object5, NULL); + _door.postInit(); + _shipDisplay.postInit(); + setAction(&_sequenceManager, this, 4000, &_door, &_shipDisplay, NULL); break; case 12: @@ -1666,37 +1667,37 @@ void Scene180::signal() { break; case 13: - setAction(&_sequenceManager, this, 4001, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4001, &_door, &_shipDisplay, NULL); break; case 15: - setAction(&_sequenceManager, this, 4002, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4002, &_door, &_shipDisplay, NULL); break; case 17: - setAction(&_sequenceManager, this, 4003, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4003, &_door, &_shipDisplay, NULL); break; case 19: - setAction(&_sequenceManager, this, 4004, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4004, &_door, &_shipDisplay, NULL); break; case 21: - setAction(&_sequenceManager, this, 4005, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4005, &_door, &_shipDisplay, NULL); break; case 23: - setAction(&_sequenceManager, this, 4006, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4006, &_door, &_shipDisplay, NULL); break; case 25: - setAction(&_sequenceManager, this, 4007, &_object4, &_object5, NULL); + setAction(&_sequenceManager, this, 4007, &_door, &_shipDisplay, NULL); break; case 27: _field412 = 0; - _object4.remove(); - _object5.remove(); + _door.remove(); + _shipDisplay.remove(); setSceneDelay(2); break; @@ -1710,7 +1711,7 @@ void Scene180::signal() { case 29: _field412 = 1; _animationPlayer._paletteMode = ANIMPALMODE_REPLACE_PALETTE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_42; R2_GLOBALS._scene180Mode = 3; _animationPlayer.load(3); @@ -1719,12 +1720,12 @@ void Scene180::signal() { case 31: R2_GLOBALS._sound2.play(7); - _object4.postInit(); - _object4.setVisage(76); - _object4.setStrip(1); - _object4.setFrame(1); - _object4.setPosition(Common::Point(288, 143)); - _object4.fixPriority(210); + _door.postInit(); + _door.setVisage(76); + _door.setStrip(1); + _door.setFrame(1); + _door.setPosition(Common::Point(288, 143)); + _door.fixPriority(210); loadScene(75); @@ -1739,68 +1740,71 @@ void Scene180::signal() { case 32: _field412 = 1; - _object2.postInit(); - _object2.setPosition(Common::Point(161, 97)); - _object2.hide(); + _teal.postInit(); + _teal.setPosition(Common::Point(161, 97)); + _teal.hide(); - _object3.postInit(); - _object3.setPosition(Common::Point(60, 96)); - _object3.hide(); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 11, this); + _webbser.postInit(); + _webbser.setPosition(Common::Point(60, 96)); + _webbser.hide(); + _stripManager.start(11, this); break; case 33: - _object2.hide(); + _teal.hide(); - _object3.setup(76, 4, 1); - _object3.setFrame(_object3.getFrameCount()); + _webbser.setup(76, 4, 1); + _webbser.setFrame(_webbser.getFrameCount()); - _object5.postInit(); - _object5.setup(75, 1, 1); - _object5.setPosition(Common::Point(221, 125)); - _object5.fixPriority(210); - _object5.setAction(&_action1); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 12, this); + _shipDisplay.postInit(); + _shipDisplay.setup(75, 1, 1); + _shipDisplay.setPosition(Common::Point(221, 125)); + _shipDisplay.fixPriority(210); + _shipDisplay.setAction(&_action1); + _stripManager.start(12, this); break; case 34: - _object2.hide(); - _object3.hide(); + _teal.hide(); + _webbser.hide(); - _object1.postInit(); - _object1.setup(76, 2, 1); - _object1.setPosition(Common::Point(287, 135)); - _object1.fixPriority(200); + _dutyOfficer.postInit(); + _dutyOfficer.setup(76, 2, 1); + _dutyOfficer.setPosition(Common::Point(287, 135)); + _dutyOfficer.fixPriority(200); _sound1.play(19); - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 5, this); + _door.animate(ANIM_MODE_5, this); break; case 35: - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 13, this); + _stripManager.start(13, this); break; case 36: - _object2.remove(); + _teal.remove(); _sound1.play(19); - - R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 6, this); + _door.animate(ANIM_MODE_6, this); break; case 37: _field412 = 0; - _object1.remove(); + _dutyOfficer.remove(); _palette.loadPalette(9998); R2_GLOBALS._scenePalette.addFader(_palette._palette, 256, 8, this); break; case 38: - _object4.remove(); - _object5.setAction(NULL); - _object5.remove(); - + _door.remove(); + _shipDisplay.setAction(NULL); + _shipDisplay.remove(); + + // TODO: Figure out why end action on sounds aren't firing. For now, I'm + // simply setting up a scene delay to ensure the signal() method gets + // called again after a brief delay + setSceneDelay(10); R2_GLOBALS._sound2.fadeOut2(NULL); - R2_GLOBALS._sound1.fadeOut2(NULL); + R2_GLOBALS._sound1.fadeOut2(NULL /* this */); break; case 39: @@ -1823,7 +1827,7 @@ void Scene180::signal() { case 41: _field412 = 1; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; break; case 42: @@ -1842,13 +1846,14 @@ void Scene180::signal() { break; case 45: - R2_GLOBALS._scenePalette.addFader(_animationPlayer._subData._palData, 256, 28, this); + _field412 = 1; + _stripManager.start(28, this); break; case 48: _field412 = 1; _animationPlayer._paletteMode = ANIMPALMODE_NONE; - _animationPlayer._v = 1; + _animationPlayer._isActive = true; _animationPlayer._objectMode = ANIMOBJMODE_1; R2_GLOBALS._scene180Mode = 15; _animationPlayer.load(15, NULL); @@ -1905,9 +1910,9 @@ void Scene180::dispatch() { } } - if (_animationPlayer._v) { + if (_animationPlayer._isActive) { if (_animationPlayer.isCompleted()) { - _animationPlayer._v = 0; + _animationPlayer._isActive = false; _animationPlayer.close(); _animationPlayer.remove(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index df0b4d8fc6..3153b86745 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -197,11 +197,11 @@ class Scene180: public SceneExt { private: void setSceneDelay(int v); public: - SpeakerWebbster _webbsterSpeaker; - SpeakerDutyOfficer _dutyOfficerSpeaker; - SpeakerTeal _tealSpeaker; + SpeakerWebbster180 _webbsterSpeaker; + SpeakerDutyOfficer180 _dutyOfficerSpeaker; + SpeakerTeal180 _tealSpeaker; SpeakerGameText _gameTextSpeaker; - SceneActor _object1, _object2, _object3, _object4, _object5; + SceneActor _dutyOfficer, _teal, _webbser, _door, _shipDisplay; ScenePalette _palette; SceneText _textList[20]; AnimationPlayerExt _animationPlayer; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index a661d3ed44..3091086980 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -2638,6 +2638,41 @@ SpeakerTealMode7::SpeakerTealMode7(): SpeakerTeal() { _displayMode = 7; } +void SpeakerTeal180::proc15() { + int v = _speakerMode; + + if (!_object2) { + Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; + _object2 = &scene->_teal; + _object2->hide(); + + _object1.postInit(); + _object1.setPosition(_object2->_position); + + if (_object2->_mover) + _object2->addMover(NULL); + } + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 5, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 2: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(77, 1, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerTeal300::proc15() { int v = _speakerMode; @@ -2890,6 +2925,47 @@ SpeakerWebbster::SpeakerWebbster(int color) { _numFrames = 0; } +void SpeakerWebbster180::proc15() { + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + + int v = _speakerMode; + + if (!_object2) { + _object2 = &scene->_webbster; + _object2->hide(); + _object1.postInit(); + _object1.setPosition(_object2->_position); + _object1._numFrames = 6; + + if (_object2->_mover) + _object2->addMover(NULL); + } + + switch (v) { + case 0: + _object1.animate(ANIM_MODE_2, NULL); + break; + case 1: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 7, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 2: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(76, 4, 1); + _object1.animate(ANIM_MODE_5, this); + break; + case 3: + ((SceneItem *)_action)->_sceneRegionId = 0; + _object1.setup(75, 6, 1); + _object1.animate(ANIM_MODE_5, this); + break; + default: + signal(); + break; + } +} + void SpeakerWebbster3240::proc15() { int v = _speakerMode; Scene3240 *scene = (Scene3240 *)R2_GLOBALS._sceneManager._scene; @@ -3092,7 +3168,7 @@ void SpeakerWebbster3400::proc15() { //---------------------------------------------------------------------------- -SpeakerDutyOfficer::SpeakerDutyOfficer(): VisualSpeaker() { +SpeakerDutyOfficer180::SpeakerDutyOfficer180(): VisualSpeaker() { _speakerName = "DUTYOFFICER"; _color1 = 5; _color2 = 0; @@ -3104,13 +3180,13 @@ SpeakerDutyOfficer::SpeakerDutyOfficer(): VisualSpeaker() { _numFrames = 0; } -void SpeakerDutyOfficer::proc15() { +void SpeakerDutyOfficer180::proc15() { Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; if (!_object2) { - _object2 = &scene->_object2; + _object2 = &scene->_dutyOfficer; _object2->hide(); _object1.postInit(); _object1.setPosition(_object2->_position); diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index 4dfb500f2d..1b87606381 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -547,6 +547,12 @@ public: virtual Common::String getClassName() { return "SpeakerTealMode7"; } }; +class SpeakerTeal180 : public SpeakerTeal { +public: + virtual Common::String getClassName() { return "SpeakerTeal180"; } + virtual void proc15(); +}; + class SpeakerTeal300 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal300"; } @@ -595,6 +601,13 @@ public: virtual Common::String getClassName() { return "SpeakerWebbster"; } }; +class SpeakerWebbster180 : public SpeakerWebbster { +public: + SpeakerWebbster180() : SpeakerWebbster(27) {} + virtual Common::String getClassName() { return "SpeakerWebbster180"; } + virtual void proc15(); +}; + class SpeakerWebbster2500 : public SpeakerWebbster { public: SpeakerWebbster2500() : SpeakerWebbster(27) {} @@ -641,9 +654,9 @@ public: virtual void proc15(); }; -class SpeakerDutyOfficer: public VisualSpeaker { +class SpeakerDutyOfficer180: public VisualSpeaker { public: - SpeakerDutyOfficer(); + SpeakerDutyOfficer180(); virtual Common::String getClassName() { return "SpeakerDutyOfficer"; } virtual void proc15(); -- cgit v1.2.3 From aeee6e624125af2569bf68cbe541b7bfce38291e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 17:31:12 +0300 Subject: FULLPIPE: Implement Movement::calcSomeXY() --- engines/fullpipe/statics.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index a7805395ad..0e9daadd45 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -1246,7 +1246,36 @@ Common::Point *Movement::getCurrDynamicPhaseXY(Common::Point &p) { } Common::Point *Movement::calcSomeXY(Common::Point &p, int idx) { - warning("STUB: Movement::calcSomeXY()"); + int oldox = _ox; + int oldoy = _oy; + int oldidx = _currDynamicPhaseIndex; + + int x = 0; + int y = 0; + + if (!idx) { + Common::Point point; + + _staticsObj1->getSomeXY(point); + int y1 = _my - point.y; + int x1 = _mx - point.x; + + setDynamicPhaseIndex(0); + + x = _currDynamicPhase->_someX + x1; + y = _currDynamicPhase->_someY + y1; + } + + setOXY(x, y); + + while (_currDynamicPhaseIndex != idx) + gotoNextFrame(0, 0); + + p.x = _ox; + p.y = _oy; + + setDynamicPhaseIndex(oldidx); + setOXY(oldox, oldoy); return &p; } -- cgit v1.2.3 From 7cf1f02fa1273b0149440c9dc0e822734e6290b1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 28 Sep 2013 12:57:47 -0400 Subject: TSAGE: Fix R2R restart game to match the original --- engines/tsage/ringworld2/ringworld2_logic.cpp | 14 +++++++++++++- engines/tsage/ringworld2/ringworld2_logic.h | 1 + engines/tsage/staticres.cpp | 1 + engines/tsage/staticres.h | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 22ad35017c..5e4e892f6b 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -1125,12 +1125,24 @@ void Ringworld2Game::start() { g_globals->_events.showCursor(); } +void Ringworld2Game::restartGame() { + if (MessageDialog::show(Ringworld2::R2_RESTART_MSG, CANCEL_BTN_STRING, YES_MSG) == 1) + restart(); +} + void Ringworld2Game::restart() { g_globals->_scenePalette.clearListeners(); g_globals->_soundHandler.stop(); + // Reset the globals + g_globals->reset(); + + // Clear save/load slots + g_globals->_sceneHandler->_saveGameSlot = -1; + g_globals->_sceneHandler->_loadGameSlot = -1; + // Change to the first game scene - g_globals->_sceneManager.changeScene(180); + g_globals->_sceneManager.changeScene(100); } void Ringworld2Game::endGame(int resNum, int lineNum) { diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index a9fa0cfeea..aeac2fdd6a 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -228,6 +228,7 @@ public: class Ringworld2Game: public Game { public: virtual void start(); + virtual void restartGame(); virtual void restart(); virtual void endGame(int resNum, int lineNum); diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index 2c5e8e57a0..662efa19b4 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -229,6 +229,7 @@ char const *const RESTORE_GAME = "Restore game"; char const *const SHOW_CREDITS = "Show credits"; char const *const PAUSE_GAME = "Pause game"; char const *const RESUME_PLAY = " Resume play "; +char const *const R2_RESTART_MSG = "Go to the beginning of game?"; char const *const F2 = "F2"; char const *const F3 = "F3"; char const *const F4 = "F4"; diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index b6c5d5e72a..7d97f2824d 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -182,6 +182,7 @@ extern char const *const RESTORE_GAME; extern char const *const SHOW_CREDITS; extern char const *const PAUSE_GAME; extern char const *const RESUME_PLAY; +extern char const *const R2_RESTART_MSG; extern char const *const F2; extern char const *const F3; extern char const *const F4; -- cgit v1.2.3 From 75f2dacade8f733719c8dbfc1caacd0bc9a232da Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 21:44:28 +0300 Subject: FULLPIPE: Fix compiler warning --- engines/fullpipe/scenes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 7bc8f68fa5..9fb8a95f53 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1348,7 +1348,7 @@ int MovGraph_messageHandler(ExCommand *cmd) { double sq = (ani->_oy - node->_y) * (ani->_oy - node->_y) + (ani->_ox - node->_x) * (ani->_ox - node->_x); int off = (node->_field_14 >> 16) & 0xFF; - double off2 = (link->_movGraphNode2->_field_14 >> 8) & 0xff - off; + double off2 = ((link->_movGraphNode2->_field_14 >> 8) & 0xff) - off; top = off + (int)(sqrt(sq) * off2 / link->_distance); } else { -- cgit v1.2.3 From 4552f5196b83b079fea4446604d8b2ca7d819bf7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 22:26:54 +0300 Subject: SWORD25: Fix Amiga compilation --- engines/sword25/kernel/inputpersistenceblock.cpp | 4 ++-- engines/sword25/kernel/inputpersistenceblock.h | 4 ++-- engines/sword25/kernel/outputpersistenceblock.cpp | 4 ++-- engines/sword25/kernel/outputpersistenceblock.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp index 0fe5d88b80..459cddf347 100644 --- a/engines/sword25/kernel/inputpersistenceblock.cpp +++ b/engines/sword25/kernel/inputpersistenceblock.cpp @@ -53,7 +53,7 @@ void InputPersistenceBlock::read(int16 &value) { value = static_cast(v); } -void InputPersistenceBlock::read(signed int &value) { +void InputPersistenceBlock::read(int32 &value) { if (checkMarker(SINT_MARKER)) { value = (int32)READ_LE_UINT32(_iter); _iter += 4; @@ -62,7 +62,7 @@ void InputPersistenceBlock::read(signed int &value) { } } -void InputPersistenceBlock::read(uint &value) { +void InputPersistenceBlock::read(uint32 &value) { if (checkMarker(UINT_MARKER)) { value = READ_LE_UINT32(_iter); _iter += 4; diff --git a/engines/sword25/kernel/inputpersistenceblock.h b/engines/sword25/kernel/inputpersistenceblock.h index 2518d7e32c..02a944ff1b 100644 --- a/engines/sword25/kernel/inputpersistenceblock.h +++ b/engines/sword25/kernel/inputpersistenceblock.h @@ -50,8 +50,8 @@ public: virtual ~InputPersistenceBlock(); void read(int16 &value); - void read(signed int &value); - void read(uint &value); + void read(int32 &value); + void read(uint32 &value); void read(float &value); void read(bool &value); void readString(Common::String &value); diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp index e29d956e5f..48d0ab3d53 100644 --- a/engines/sword25/kernel/outputpersistenceblock.cpp +++ b/engines/sword25/kernel/outputpersistenceblock.cpp @@ -41,13 +41,13 @@ OutputPersistenceBlock::OutputPersistenceBlock() { _data.reserve(INITIAL_BUFFER_SIZE); } -void OutputPersistenceBlock::write(signed int value) { +void OutputPersistenceBlock::write(int32 value) { writeMarker(SINT_MARKER); value = TO_LE_32(value); rawWrite(&value, sizeof(value)); } -void OutputPersistenceBlock::write(uint value) { +void OutputPersistenceBlock::write(uint32 value) { writeMarker(UINT_MARKER); value = TO_LE_32(value); rawWrite(&value, sizeof(value)); diff --git a/engines/sword25/kernel/outputpersistenceblock.h b/engines/sword25/kernel/outputpersistenceblock.h index 12351d22e2..17f018a106 100644 --- a/engines/sword25/kernel/outputpersistenceblock.h +++ b/engines/sword25/kernel/outputpersistenceblock.h @@ -41,8 +41,8 @@ class OutputPersistenceBlock : public PersistenceBlock { public: OutputPersistenceBlock(); - void write(signed int value); - void write(uint value); + void write(int32 value); + void write(uint32 value); void write(float value); void write(bool value); void writeString(const Common::String &string); -- cgit v1.2.3 From 08c010b8dff22b1f03301fb90f8d1efb7a9e7a1f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 22:58:10 +0300 Subject: SWORD25: Further fixes for Amiga compilation --- engines/sword25/gfx/animation.h | 12 ++++++------ engines/sword25/gfx/animationdescription.cpp | 2 +- engines/sword25/gfx/animationdescription.h | 8 ++++---- engines/sword25/gfx/animationtemplate.cpp | 4 ++-- engines/sword25/gfx/animationtemplateregistry.cpp | 2 +- engines/sword25/gfx/bitmap.h | 6 +++--- engines/sword25/kernel/objectregistry.h | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) (limited to 'engines') diff --git a/engines/sword25/gfx/animation.h b/engines/sword25/gfx/animation.h index 44255e3b64..ced1995ae9 100644 --- a/engines/sword25/gfx/animation.h +++ b/engines/sword25/gfx/animation.h @@ -159,18 +159,18 @@ private: BACKWARD }; - int _relX; - int _relY; + int32 _relX; + int32 _relY; float _scaleFactorX; float _scaleFactorY; - uint _modulationColor; - uint _currentFrame; - int _currentFrameTime; + uint32 _modulationColor; + uint32 _currentFrame; + int32 _currentFrameTime; bool _running; bool _finished; Direction _direction; AnimationResource *_animationResourcePtr; - uint _animationTemplateHandle; + uint32 _animationTemplateHandle; bool _framesLocked; ANIMATION_CALLBACK _loopPointCallback; diff --git a/engines/sword25/gfx/animationdescription.cpp b/engines/sword25/gfx/animationdescription.cpp index da0a660df9..0a23601f67 100644 --- a/engines/sword25/gfx/animationdescription.cpp +++ b/engines/sword25/gfx/animationdescription.cpp @@ -36,7 +36,7 @@ namespace Sword25 { bool AnimationDescription::persist(OutputPersistenceBlock &writer) { - writer.write(static_cast(_animationType)); + writer.write(static_cast(_animationType)); writer.write(_FPS); writer.write(_millisPerFrame); writer.write(_scalingAllowed); diff --git a/engines/sword25/gfx/animationdescription.h b/engines/sword25/gfx/animationdescription.h index 3b11686bb9..009d83dcc7 100644 --- a/engines/sword25/gfx/animationdescription.h +++ b/engines/sword25/gfx/animationdescription.h @@ -52,8 +52,8 @@ protected: public: struct Frame { // Die Hotspot-Angabe bezieht sich auf das ungeflippte Bild!! - int hotspotX; - int hotspotY; + int32 hotspotX; + int32 hotspotY; bool flipV; bool flipH; Common::String fileName; @@ -88,8 +88,8 @@ public: protected: Animation::ANIMATION_TYPES _animationType; - int _FPS; - int _millisPerFrame; + int32 _FPS; + int32 _millisPerFrame; bool _scalingAllowed; bool _alphaAllowed; bool _colorModulationAllowed; diff --git a/engines/sword25/gfx/animationtemplate.cpp b/engines/sword25/gfx/animationtemplate.cpp index 19924302b9..a1d2bf5d1a 100644 --- a/engines/sword25/gfx/animationtemplate.cpp +++ b/engines/sword25/gfx/animationtemplate.cpp @@ -181,7 +181,7 @@ bool AnimationTemplate::persist(OutputPersistenceBlock &writer) { Result &= AnimationDescription::persist(writer); // Frameanzahl schreiben. - writer.write(_frames.size()); + writer.write((uint32)_frames.size()); // Frames einzeln persistieren. Common::Array::const_iterator Iter = _frames.begin(); @@ -209,7 +209,7 @@ bool AnimationTemplate::unpersist(InputPersistenceBlock &reader) { result &= AnimationDescription::unpersist(reader); // Frameanzahl lesen. - uint frameCount; + uint32 frameCount; reader.read(frameCount); // Frames einzeln wieder herstellen. diff --git a/engines/sword25/gfx/animationtemplateregistry.cpp b/engines/sword25/gfx/animationtemplateregistry.cpp index 8184b49eba..7437e4b8d4 100644 --- a/engines/sword25/gfx/animationtemplateregistry.cpp +++ b/engines/sword25/gfx/animationtemplateregistry.cpp @@ -47,7 +47,7 @@ bool AnimationTemplateRegistry::persist(OutputPersistenceBlock &writer) { writer.write(_nextHandle); // Anzahl an BS_AnimationTemplates schreiben. - writer.write(_handle2PtrMap.size()); + writer.write((uint32)_handle2PtrMap.size()); // Alle BS_AnimationTemplates persistieren. HANDLE2PTR_MAP::const_iterator iter = _handle2PtrMap.begin(); diff --git a/engines/sword25/gfx/bitmap.h b/engines/sword25/gfx/bitmap.h index caa1238558..f22c5d7fc9 100644 --- a/engines/sword25/gfx/bitmap.h +++ b/engines/sword25/gfx/bitmap.h @@ -176,9 +176,9 @@ protected: bool _flipV; float _scaleFactorX; float _scaleFactorY; - uint _modulationColor; - int _originalWidth; - int _originalHeight; + uint32 _modulationColor; + int32 _originalWidth; + int32 _originalHeight; }; } // End of namespace Sword25 diff --git a/engines/sword25/kernel/objectregistry.h b/engines/sword25/kernel/objectregistry.h index d9a7c353f7..449b1b60a3 100644 --- a/engines/sword25/kernel/objectregistry.h +++ b/engines/sword25/kernel/objectregistry.h @@ -139,12 +139,12 @@ protected: } }; - typedef Common::HashMap HANDLE2PTR_MAP; - typedef Common::HashMap PTR2HANDLE_MAP; + typedef Common::HashMap HANDLE2PTR_MAP; + typedef Common::HashMap PTR2HANDLE_MAP; HANDLE2PTR_MAP _handle2PtrMap; PTR2HANDLE_MAP _ptr2HandleMap; - uint _nextHandle; + uint32 _nextHandle; T *findPtrByHandle(uint handle) { // Zum Handle gehörigen Pointer finden. -- cgit v1.2.3 From 9a1ddf0deef80fd598fe64e96f1180e265cbc124 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 23:17:02 +0300 Subject: SWORD25: More int <-> int32 corrections --- engines/sword25/gfx/animation.cpp | 20 ++++++++++---------- engines/sword25/gfx/animationdescription.cpp | 2 +- engines/sword25/gfx/renderobject.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'engines') diff --git a/engines/sword25/gfx/animation.cpp b/engines/sword25/gfx/animation.cpp index 1660c393c0..37207c967b 100644 --- a/engines/sword25/gfx/animation.cpp +++ b/engines/sword25/gfx/animation.cpp @@ -553,15 +553,15 @@ bool Animation::persist(OutputPersistenceBlock &writer) { writer.write(_currentFrameTime); writer.write(_running); writer.write(_finished); - writer.write(static_cast(_direction)); + writer.write(static_cast(_direction)); // Je nach Animationstyp entweder das Template oder die Ressource speichern. if (_animationResourcePtr) { - uint marker = 0; + uint32 marker = 0; writer.write(marker); writer.writeString(_animationResourcePtr->getFileName()); } else if (_animationTemplateHandle) { - uint marker = 1; + uint32 marker = 1; writer.write(marker); writer.write(_animationTemplateHandle); } else { @@ -574,13 +574,13 @@ bool Animation::persist(OutputPersistenceBlock &writer) { // The following is only there to for compatibility with older saves // resp. the original engine. - writer.write((uint)1); + writer.write((uint32)1); writer.writeString("LuaLoopPointCB"); writer.write(getHandle()); - writer.write((uint)1); + writer.write((uint32)1); writer.writeString("LuaActionCB"); writer.write(getHandle()); - writer.write((uint)1); + writer.write((uint32)1); writer.writeString("LuaDeleteCB"); writer.write(getHandle()); @@ -605,12 +605,12 @@ bool Animation::unpersist(InputPersistenceBlock &reader) { reader.read(_currentFrameTime); reader.read(_running); reader.read(_finished); - uint direction; + uint32 direction; reader.read(direction); _direction = static_cast(direction); // Animationstyp einlesen. - uint marker; + uint32 marker; reader.read(marker); if (marker == 0) { Common::String resourceFilename; @@ -629,9 +629,9 @@ bool Animation::unpersist(InputPersistenceBlock &reader) { // The following is only there to for compatibility with older saves // resp. the original engine. - uint callbackCount; + uint32 callbackCount; Common::String callbackFunctionName; - uint callbackData; + uint32 callbackData; // loop point callback reader.read(callbackCount); diff --git a/engines/sword25/gfx/animationdescription.cpp b/engines/sword25/gfx/animationdescription.cpp index 0a23601f67..164206bbc2 100644 --- a/engines/sword25/gfx/animationdescription.cpp +++ b/engines/sword25/gfx/animationdescription.cpp @@ -47,7 +47,7 @@ bool AnimationDescription::persist(OutputPersistenceBlock &writer) { } bool AnimationDescription::unpersist(InputPersistenceBlock &reader) { - uint animationType; + uint32 animationType; reader.read(animationType); _animationType = static_cast(animationType); reader.read(_FPS); diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h index 1116c3284c..d7857caddf 100644 --- a/engines/sword25/gfx/renderobject.h +++ b/engines/sword25/gfx/renderobject.h @@ -359,7 +359,7 @@ public: /** @brief Gibt das Handle des Objekte zurück. */ - uint getHandle() const { + uint32 getHandle() const { return _handle; } @@ -475,7 +475,7 @@ private: /// Ist true, wenn das Objekt in nächsten Frame neu gezeichnet werden soll bool _refreshForced; - uint _handle; + uint32 _handle; /** @brief Entfernt ein Objekt aus der Kinderliste. -- cgit v1.2.3 From 86550cdc3c19d7a75f634073b942440d72520dcd Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 23:28:19 +0300 Subject: SWORD25: Further fixes for Amiga --- engines/sword25/gfx/animationtemplateregistry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/sword25/gfx/animationtemplateregistry.cpp b/engines/sword25/gfx/animationtemplateregistry.cpp index 7437e4b8d4..4cefe24b18 100644 --- a/engines/sword25/gfx/animationtemplateregistry.cpp +++ b/engines/sword25/gfx/animationtemplateregistry.cpp @@ -77,13 +77,13 @@ bool AnimationTemplateRegistry::unpersist(InputPersistenceBlock &reader) { delete _handle2PtrMap.begin()->_value; // Anzahl an BS_AnimationTemplates einlesen. - uint animationTemplateCount; + uint32 animationTemplateCount; reader.read(animationTemplateCount); // Alle gespeicherten BS_AnimationTemplates wieder herstellen. for (uint i = 0; i < animationTemplateCount; ++i) { // Handle lesen. - uint handle; + uint32 handle; reader.read(handle); // BS_AnimationTemplate wieder herstellen. -- cgit v1.2.3 From 5cb881be12fdffc5f4073fd874723b306c27a347 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 23:44:48 +0300 Subject: SWORD25: More int->int32 fixes --- engines/sword25/gfx/panel.h | 2 +- engines/sword25/gfx/renderobject.cpp | 2 +- engines/sword25/gfx/renderobject.h | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'engines') diff --git a/engines/sword25/gfx/panel.h b/engines/sword25/gfx/panel.h index 74a93247b6..d372b4e0fc 100644 --- a/engines/sword25/gfx/panel.h +++ b/engines/sword25/gfx/panel.h @@ -64,7 +64,7 @@ protected: virtual bool doRender(RectangleList *updateRects); private: - uint _color; + uint32 _color; }; } // End of namespace Sword25 diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index 1dd6f4590f..dcbfe6462b 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -399,7 +399,7 @@ RenderObjectPtr RenderObject::addText(const Common::String &font, const Co bool RenderObject::persist(OutputPersistenceBlock &writer) { // Typ und Handle werden als erstes gespeichert, damit beim Laden ein Objekt vom richtigen Typ mit dem richtigen Handle erzeugt werden kann. - writer.write(static_cast(_type)); + writer.write(static_cast(_type)); writer.write(_handle); // Restliche Objekteigenschaften speichern. diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h index d7857caddf..92541e83a2 100644 --- a/engines/sword25/gfx/renderobject.h +++ b/engines/sword25/gfx/renderobject.h @@ -388,14 +388,14 @@ protected: typedef Common::List > RENDEROBJECT_LIST; typedef Common::List >::iterator RENDEROBJECT_ITER; - int _x; ///< Die X-Position des Objektes relativ zum Eltern-Objekt - int _y; ///< Die Y-Position des Objektes relativ zum Eltern-Objekt - int _z; ///< Der Z-Wert des Objektes relativ zum Eltern-Objekt - int _absoluteX; ///< Die absolute X-Position des Objektes - int _absoluteY; ///< Die absolute Y-Position des Objektes - int _absoluteZ; - int _width; ///< Die Breite des Objektes - int _height; ///< Die Höhe des Objektes + int32 _x; ///< Die X-Position des Objektes relativ zum Eltern-Objekt + int32 _y; ///< Die Y-Position des Objektes relativ zum Eltern-Objekt + int32 _z; ///< Der Z-Wert des Objektes relativ zum Eltern-Objekt + int32 _absoluteX; ///< Die absolute X-Position des Objektes + int32 _absoluteY; ///< Die absolute Y-Position des Objektes + int32 _absoluteZ; + int32 _width; ///< Die Breite des Objektes + int32 _height; ///< Die Höhe des Objektes bool _visible; ///< Ist true, wenn das Objekt sichtbar ist bool _childChanged; ///< Ist true, wenn sich ein Kinderobjekt verändert hat TYPES _type; ///< Der Objekttyp @@ -404,14 +404,14 @@ protected: // Kopien der Variablen, die für die Errechnung des Dirty-Rects und zur Bestimmung der Objektveränderung notwendig sind Common::Rect _oldBbox; - int _oldX; - int _oldY; - int _oldZ; + int32 _oldX; + int32 _oldY; + int32 _oldZ; bool _oldVisible; static int _nextGlobalVersion; - int _version; + int32 _version; // This should be set to true if the RenderObject is NOT alpha-blended to optimize drawing bool _isSolid; -- cgit v1.2.3 From 9220d331e2761a7f5a69a6a68617fce4b7fece18 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 23:57:39 +0300 Subject: SWORD25: Make Amiga compiler happier --- engines/sword25/gfx/panel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sword25/gfx/panel.cpp b/engines/sword25/gfx/panel.cpp index b9bb8b087d..9b7fe82914 100644 --- a/engines/sword25/gfx/panel.cpp +++ b/engines/sword25/gfx/panel.cpp @@ -104,7 +104,7 @@ bool Panel::unpersist(InputPersistenceBlock &reader) { result &= RenderObject::unpersist(reader); - uint color; + uint32 color; reader.read(color); setColor(color); -- cgit v1.2.3 From 03965ba855c510eecb0dfd653aef0cc9b67541dc Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 29 Sep 2013 00:45:43 +0100 Subject: SWORD25: Even more fixes for Amiga OS 4 compilation. --- engines/sword25/gfx/text.cpp | 6 +++--- engines/sword25/gfx/text.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index d4aaa90682..65add60e97 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -98,8 +98,8 @@ void Text::setText(const Common::String &text) { } } -void Text::setColor(uint modulationColor) { - uint newModulationColor = (modulationColor & 0x00ffffff) | (_modulationColor & 0xff000000); +void Text::setColor(uint32 modulationColor) { + uint32 newModulationColor = (modulationColor & 0x00ffffff) | (_modulationColor & 0xff000000); if (newModulationColor != _modulationColor) { _modulationColor = newModulationColor; forceRefresh(); @@ -108,7 +108,7 @@ void Text::setColor(uint modulationColor) { void Text::setAlpha(int alpha) { assert(alpha >= 0 && alpha < 256); - uint newModulationColor = (_modulationColor & 0x00ffffff) | alpha << 24; + uint32 newModulationColor = (_modulationColor & 0x00ffffff) | alpha << 24; if (newModulationColor != _modulationColor) { _modulationColor = newModulationColor; forceRefresh(); diff --git a/engines/sword25/gfx/text.h b/engines/sword25/gfx/text.h index 94e7a30865..e82c24d93c 100644 --- a/engines/sword25/gfx/text.h +++ b/engines/sword25/gfx/text.h @@ -100,7 +100,7 @@ public: @brief Setzt die Farbe des Textes. @param Color eine 24-Bit RGB Farbe, die die Farbe des Textes festlegt. */ - void setColor(uint modulationColor); + void setColor(uint32 modulationColor); /** @brief Gibt den Alphawert des Textes zurück. @@ -142,7 +142,7 @@ private: Text(RenderObjectPtr parentPtr); Text(InputPersistenceBlock &reader, RenderObjectPtr parentPtr, uint handle); - uint _modulationColor; + uint32 _modulationColor; Common::String _font; Common::String _text; bool _autoWrap; -- cgit v1.2.3 From 7e62442376be966369008bfb8c4f1b66786177e7 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 29 Sep 2013 02:33:02 +0100 Subject: SWORD25: And even more fixes for Amiga OS 4 compilation. --- engines/sword25/gfx/renderobject.cpp | 28 ++++++++++++++-------------- engines/sword25/gfx/renderobject.h | 8 ++++---- engines/sword25/gfx/renderobjectmanager.cpp | 8 ++++---- engines/sword25/gfx/text.cpp | 6 +++--- engines/sword25/gfx/text.h | 6 +++--- 5 files changed, 28 insertions(+), 28 deletions(-) (limited to 'engines') diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index dcbfe6462b..af12f61413 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -219,27 +219,27 @@ Common::Rect RenderObject::calcBoundingBox() const { return bbox; } -void RenderObject::calcAbsolutePos(int &x, int &y, int &z) const { +void RenderObject::calcAbsolutePos(int32 &x, int32 &y, int32 &z) const { x = calcAbsoluteX(); y = calcAbsoluteY(); z = calcAbsoluteZ(); } -int RenderObject::calcAbsoluteX() const { +int32 RenderObject::calcAbsoluteX() const { if (_parentPtr.isValid()) return _parentPtr->getAbsoluteX() + _x; else return _x; } -int RenderObject::calcAbsoluteY() const { +int32 RenderObject::calcAbsoluteY() const { if (_parentPtr.isValid()) return _parentPtr->getAbsoluteY() + _y; else return _y; } -int RenderObject::calcAbsoluteZ() const { +int32 RenderObject::calcAbsoluteZ() const { if (_parentPtr.isValid()) return _parentPtr->getAbsoluteZ() + _z; else @@ -417,10 +417,10 @@ bool RenderObject::persist(OutputPersistenceBlock &writer) { writer.write(_bbox.top); writer.write(_bbox.right); writer.write(_bbox.bottom); - writer.write(_oldBbox.left); - writer.write(_oldBbox.top); - writer.write(_oldBbox.right); - writer.write(_oldBbox.bottom); + writer.write((int32)_oldBbox.left); + writer.write((int32)_oldBbox.top); + writer.write((int32)_oldBbox.right); + writer.write((int32)_oldBbox.bottom); writer.write(_oldX); writer.write(_oldY); writer.write(_oldZ); @@ -455,7 +455,7 @@ bool RenderObject::unpersist(InputPersistenceBlock &reader) { reader.read(_oldY); reader.read(_oldZ); reader.read(_oldVisible); - uint parentHandle; + uint32 parentHandle; reader.read(parentHandle); _parentPtr = RenderObjectPtr(parentHandle); reader.read(_refreshForced); @@ -470,7 +470,7 @@ bool RenderObject::persistChildren(OutputPersistenceBlock &writer) { bool result = true; // Kinderanzahl speichern. - writer.write(_children.size()); + writer.write((uint32)_children.size()); // Rekursiv alle Kinder speichern. RENDEROBJECT_LIST::iterator it = _children.begin(); @@ -486,13 +486,13 @@ bool RenderObject::unpersistChildren(InputPersistenceBlock &reader) { bool result = true; // Kinderanzahl einlesen. - uint childrenCount; + uint32 childrenCount; reader.read(childrenCount); if (!reader.isGood()) return false; // Alle Kinder rekursiv wieder herstellen. - for (uint i = 0; i < childrenCount; ++i) { + for (uint32 i = 0; i < childrenCount; ++i) { if (!recreatePersistedRenderObject(reader).isValid()) return false; } @@ -504,8 +504,8 @@ RenderObjectPtr RenderObject::recreatePersistedRenderObject(InputP RenderObjectPtr result; // Typ und Handle auslesen. - uint type; - uint handle; + uint32 type; + uint32 handle; reader.read(type); reader.read(handle); if (!reader.isGood()) diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h index 92541e83a2..7fcd3a87a3 100644 --- a/engines/sword25/gfx/renderobject.h +++ b/engines/sword25/gfx/renderobject.h @@ -500,17 +500,17 @@ private: /** @brief Berechnet die absolute Position des Objektes. */ - void calcAbsolutePos(int &x, int &y, int &z) const; + void calcAbsolutePos(int32 &x, int32 &y, int32 &z) const; /** @brief Berechnet die absolute Position des Objektes auf der X-Achse. */ - int calcAbsoluteX() const; + int32 calcAbsoluteX() const; /** @brief Berechnet die absolute Position des Objektes. */ - int calcAbsoluteY() const; + int32 calcAbsoluteY() const; - int calcAbsoluteZ() const; + int32 calcAbsoluteZ() const; /** @brief Sortiert alle Kinderobjekte nach ihrem Renderang. diff --git a/engines/sword25/gfx/renderobjectmanager.cpp b/engines/sword25/gfx/renderobjectmanager.cpp index 77f944c9e0..57c8ec318f 100644 --- a/engines/sword25/gfx/renderobjectmanager.cpp +++ b/engines/sword25/gfx/renderobjectmanager.cpp @@ -171,7 +171,7 @@ bool RenderObjectManager::persist(OutputPersistenceBlock &writer) { writer.write(_frameStarted); // Referenzen auf die TimedRenderObjects persistieren. - writer.write(_timedRenderObjects.size()); + writer.write((uint32)_timedRenderObjects.size()); RenderObjectList::const_iterator iter = _timedRenderObjects.begin(); while (iter != _timedRenderObjects.end()) { writer.write((*iter)->getHandle()); @@ -200,10 +200,10 @@ bool RenderObjectManager::unpersist(InputPersistenceBlock &reader) { _timedRenderObjects.resize(0); // Referenzen auf die TimedRenderObjects wieder herstellen. - uint timedObjectCount; + uint32 timedObjectCount; reader.read(timedObjectCount); - for (uint i = 0; i < timedObjectCount; ++i) { - uint handle; + for (uint32 i = 0; i < timedObjectCount; ++i) { + uint32 handle; reader.read(handle); _timedRenderObjects.push_back(handle); } diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index 65add60e97..8c33fa8d61 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -45,7 +45,7 @@ namespace Sword25 { namespace { -const uint AUTO_WRAP_THRESHOLD_DEFAULT = 300; +const uint32 AUTO_WRAP_THRESHOLD_DEFAULT = 300; } Text::Text(RenderObjectPtr parentPtr) : @@ -123,7 +123,7 @@ void Text::setAutoWrap(bool autoWrap) { } } -void Text::setAutoWrapThreshold(uint autoWrapThreshold) { +void Text::setAutoWrapThreshold(uint32 autoWrapThreshold) { if (autoWrapThreshold != _autoWrapThreshold) { _autoWrapThreshold = autoWrapThreshold; updateFormat(); @@ -351,7 +351,7 @@ bool Text::unpersist(InputPersistenceBlock &reader) { reader.read(autoWrap); setAutoWrap(autoWrap); - uint autoWrapThreshold; + uint32 autoWrapThreshold; reader.read(autoWrapThreshold); setAutoWrapThreshold(autoWrapThreshold); diff --git a/engines/sword25/gfx/text.h b/engines/sword25/gfx/text.h index e82c24d93c..873eb33380 100644 --- a/engines/sword25/gfx/text.h +++ b/engines/sword25/gfx/text.h @@ -80,7 +80,7 @@ public: @remark Dieses Attribut wird mit dem Wert 300 initialisiert. @remark Eine automatische Formatierung wird nur vorgenommen, wenn diese durch einen Aufruf von SetAutoWrap() aktiviert wurde. */ - void setAutoWrapThreshold(uint autoWrapThreshold); + void setAutoWrapThreshold(uint32 autoWrapThreshold); /** @brief Gibt den dargestellten Text zurück. @@ -128,7 +128,7 @@ public: /** @brief Gibt die Längengrenze des Textes in Pixeln zurück, ab der eine automatische Formatierung vorgenommen wird. */ - uint getAutoWrapThreshold() const { + uint32 getAutoWrapThreshold() const { return _autoWrapThreshold; } @@ -146,7 +146,7 @@ private: Common::String _font; Common::String _text; bool _autoWrap; - uint _autoWrapThreshold; + uint32 _autoWrapThreshold; struct Line { Common::Rect bbox; -- cgit v1.2.3 From befa99ca7761370e9f11c425b459d410d371723f Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 29 Sep 2013 03:21:55 +0100 Subject: SWORD25: Some more fixes for Amiga OS 4 compilation. --- engines/sword25/gfx/renderobject.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index af12f61413..e9e11aae4e 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -413,10 +413,10 @@ bool RenderObject::persist(OutputPersistenceBlock &writer) { writer.write(_visible); writer.write(_childChanged); writer.write(_initSuccess); - writer.write(_bbox.left); - writer.write(_bbox.top); - writer.write(_bbox.right); - writer.write(_bbox.bottom); + writer.write((int32)_bbox.left); + writer.write((int32)_bbox.top); + writer.write((int32)_bbox.right); + writer.write((int32)_bbox.bottom); writer.write((int32)_oldBbox.left); writer.write((int32)_oldBbox.top); writer.write((int32)_oldBbox.right); -- cgit v1.2.3 From 2a2a5e51c6ae7ad77bcf16339982353a5b424b10 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 29 Sep 2013 09:30:23 +0300 Subject: SWORD25: Fix Amiga compilation --- engines/sword25/input/inputengine.cpp | 6 +++--- engines/sword25/kernel/inputpersistenceblock.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/sword25/input/inputengine.cpp b/engines/sword25/input/inputengine.cpp index bb9c2c8b40..57fb6dfc09 100644 --- a/engines/sword25/input/inputengine.cpp +++ b/engines/sword25/input/inputengine.cpp @@ -235,13 +235,13 @@ bool InputEngine::persist(OutputPersistenceBlock &writer) { // Write out the number of command callbacks and their names. // Note: We do this only for compatibility with older engines resp. // the original engine. - writer.write((uint)1); + writer.write((uint32)1); writer.writeString("LuaCommandCB"); // Write out the number of command callbacks and their names. // Note: We do this only for compatibility with older engines resp. // the original engine. - writer.write((uint)1); + writer.write((uint32)1); writer.writeString("LuaCharacterCB"); return true; @@ -253,7 +253,7 @@ bool InputEngine::unpersist(InputPersistenceBlock &reader) { // Read number of command callbacks and their names. // Note: We do this only for compatibility with older engines resp. // the original engine. - uint commandCallbackCount; + uint32 commandCallbackCount; reader.read(commandCallbackCount); assert(commandCallbackCount == 1); diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp index 459cddf347..aa3a759756 100644 --- a/engines/sword25/kernel/inputpersistenceblock.cpp +++ b/engines/sword25/kernel/inputpersistenceblock.cpp @@ -48,7 +48,7 @@ InputPersistenceBlock::~InputPersistenceBlock() { } void InputPersistenceBlock::read(int16 &value) { - signed int v; + int32 v; read(v); value = static_cast(v); } @@ -96,7 +96,7 @@ void InputPersistenceBlock::readString(Common::String &value) { value = ""; if (checkMarker(STRING_MARKER)) { - uint size; + uint32 size; read(size); if (checkBlockSize(size)) { @@ -108,7 +108,7 @@ void InputPersistenceBlock::readString(Common::String &value) { void InputPersistenceBlock::readByteArray(Common::Array &value) { if (checkMarker(BLOCK_MARKER)) { - uint size; + uint32 size; read(size); if (checkBlockSize(size)) { -- cgit v1.2.3 From 7a669b770f81cbb739f6d45884d898a83fff8a13 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 29 Sep 2013 09:45:16 +0300 Subject: SWORD25: Specifying int size to make Amiga happy --- engines/sword25/input/inputengine.cpp | 2 +- engines/sword25/kernel/outputpersistenceblock.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/sword25/input/inputengine.cpp b/engines/sword25/input/inputengine.cpp index 57fb6dfc09..0d1c449805 100644 --- a/engines/sword25/input/inputengine.cpp +++ b/engines/sword25/input/inputengine.cpp @@ -263,7 +263,7 @@ bool InputEngine::unpersist(InputPersistenceBlock &reader) { // Read number of character callbacks and their names. // Note: We do this only for compatibility with older engines resp. // the original engine. - uint characterCallbackCount; + uint32 characterCallbackCount; reader.read(characterCallbackCount); assert(characterCallbackCount == 1); diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp index 48d0ab3d53..53fb624767 100644 --- a/engines/sword25/kernel/outputpersistenceblock.cpp +++ b/engines/sword25/kernel/outputpersistenceblock.cpp @@ -74,14 +74,14 @@ void OutputPersistenceBlock::write(bool value) { void OutputPersistenceBlock::writeString(const Common::String &string) { writeMarker(STRING_MARKER); - write(string.size()); + write((uint32)string.size()); rawWrite(string.c_str(), string.size()); } void OutputPersistenceBlock::writeByteArray(Common::Array &value) { writeMarker(BLOCK_MARKER); - write((uint)value.size()); + write((uint32)value.size()); rawWrite(&value[0], value.size()); } -- cgit v1.2.3 From e6ba26ff0dc2bfdb4a748bf5811bfde2e16ab2b8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 29 Sep 2013 10:02:34 +0300 Subject: SWORD25: int -> int32 correctness --- engines/sword25/math/polygon.cpp | 8 ++++---- engines/sword25/math/polygon.h | 2 +- engines/sword25/math/region.cpp | 18 +++++++++--------- engines/sword25/math/regionregistry.cpp | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'engines') diff --git a/engines/sword25/math/polygon.cpp b/engines/sword25/math/polygon.cpp index 2e7836ff77..99d947df87 100644 --- a/engines/sword25/math/polygon.cpp +++ b/engines/sword25/math/polygon.cpp @@ -364,20 +364,20 @@ bool Polygon::isPointInPolygon(const Vertex &point, bool edgesBelongToPolygon) c bool Polygon::persist(OutputPersistenceBlock &writer) { writer.write(vertexCount); for (int i = 0; i < vertexCount; ++i) { - writer.write(vertices[i].x); - writer.write(vertices[i].y); + writer.write((int32)vertices[i].x); + writer.write((int32)vertices[i].y); } return true; } bool Polygon::unpersist(InputPersistenceBlock &reader) { - int storedvertexCount; + int32 storedvertexCount; reader.read(storedvertexCount); Common::Array storedvertices; for (int i = 0; i < storedvertexCount; ++i) { - int x, y; + int32 x, y; reader.read(x); reader.read(y); storedvertices.push_back(Vertex(x, y)); diff --git a/engines/sword25/math/polygon.h b/engines/sword25/math/polygon.h index ffdbf14f6b..f81e165621 100644 --- a/engines/sword25/math/polygon.h +++ b/engines/sword25/math/polygon.h @@ -169,7 +169,7 @@ public: // /// Specifies the number of Vertecies in the Vertecies array. - int vertexCount; + int32 vertexCount; /// COntains the Vertecies of the polygon Vertex *vertices; diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp index 7681ef6d9f..f391a577ab 100644 --- a/engines/sword25/math/region.cpp +++ b/engines/sword25/math/region.cpp @@ -299,22 +299,22 @@ bool Region::isLineOfSight(const Vertex &a, const Vertex &b) const { bool Region::persist(OutputPersistenceBlock &writer) { bool Result = true; - writer.write(static_cast(_type)); + writer.write(static_cast(_type)); writer.write(_valid); - writer.write(_position.x); - writer.write(_position.y); + writer.write((int32)_position.x); + writer.write((int32)_position.y); - writer.write(_polygons.size()); + writer.write((uint32)_polygons.size()); Common::Array::iterator It = _polygons.begin(); while (It != _polygons.end()) { Result &= It->persist(writer); ++It; } - writer.write(_boundingBox.left); - writer.write(_boundingBox.top); - writer.write(_boundingBox.right); - writer.write(_boundingBox.bottom); + writer.write((uint32)_boundingBox.left); + writer.write((uint32)_boundingBox.top); + writer.write((uint32)_boundingBox.right); + writer.write((uint32)_boundingBox.bottom); return Result; } @@ -325,7 +325,7 @@ bool Region::unpersist(InputPersistenceBlock &reader) { reader.read(_position.y); _polygons.clear(); - uint PolygonCount; + uint32 PolygonCount; reader.read(PolygonCount); for (uint i = 0; i < PolygonCount; ++i) { _polygons.push_back(Polygon(reader)); diff --git a/engines/sword25/math/regionregistry.cpp b/engines/sword25/math/regionregistry.cpp index 68c360a5ee..e4925f7baf 100644 --- a/engines/sword25/math/regionregistry.cpp +++ b/engines/sword25/math/regionregistry.cpp @@ -47,7 +47,7 @@ bool RegionRegistry::persist(OutputPersistenceBlock &writer) { writer.write(_nextHandle); // Number of regions to write - writer.write(_handle2PtrMap.size()); + writer.write((uint32)_handle2PtrMap.size()); // Persist all the BS_Regions HANDLE2PTR_MAP::const_iterator iter = _handle2PtrMap.begin(); @@ -76,13 +76,13 @@ bool RegionRegistry::unpersist(InputPersistenceBlock &reader) { delete _handle2PtrMap.begin()->_value; // read in the number of BS_Regions - uint regionCount; + uint32 regionCount; reader.read(regionCount); // Restore all the BS_Regions objects for (uint i = 0; i < regionCount; ++i) { // Handle read - uint handle; + uint32 handle; reader.read(handle); // BS_Region restore -- cgit v1.2.3 From 2333041fdf370670e02c51d93342839bbec676d4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 29 Sep 2013 10:15:24 +0300 Subject: SWORD25: Specify integer size --- engines/sword25/math/region.cpp | 2 +- engines/sword25/math/walkregion.cpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp index f391a577ab..b6ebaee23f 100644 --- a/engines/sword25/math/region.cpp +++ b/engines/sword25/math/region.cpp @@ -67,7 +67,7 @@ uint Region::create(REGION_TYPE type) { uint Region::create(InputPersistenceBlock &reader, uint handle) { // Read type - uint type; + uint32 type; reader.read(type); // Depending on the type, create a new BS_Region or BS_WalkRegion object diff --git a/engines/sword25/math/walkregion.cpp b/engines/sword25/math/walkregion.cpp index bace4d54bc..6c53446913 100644 --- a/engines/sword25/math/walkregion.cpp +++ b/engines/sword25/math/walkregion.cpp @@ -328,20 +328,20 @@ bool WalkRegion::persist(OutputPersistenceBlock &writer) { result &= Region::persist(writer); // Persist the nodes - writer.write(_nodes.size()); + writer.write((uint32)_nodes.size()); Common::Array::const_iterator it = _nodes.begin(); while (it != _nodes.end()) { - writer.write(it->x); - writer.write(it->y); + writer.write((int32)it->x); + writer.write((int32)it->y); ++it; } // Persist the visibility matrix - writer.write(_visibilityMatrix.size()); + writer.write((uint32)_visibilityMatrix.size()); Common::Array< Common::Array >::const_iterator rowIter = _visibilityMatrix.begin(); while (rowIter != _visibilityMatrix.end()) { - writer.write(rowIter->size()); - Common::Array::const_iterator colIter = rowIter->begin(); + writer.write((uint32)rowIter->size()); + Common::Array::const_iterator colIter = rowIter->begin(); while (colIter != rowIter->end()) { writer.write(*colIter); ++colIter; @@ -360,7 +360,7 @@ bool WalkRegion::unpersist(InputPersistenceBlock &reader) { // this point only the additional data from BS_WalkRegion needs to be loaded // Node load - uint nodeCount; + uint32 nodeCount; reader.read(nodeCount); _nodes.clear(); _nodes.resize(nodeCount); @@ -372,16 +372,16 @@ bool WalkRegion::unpersist(InputPersistenceBlock &reader) { } // Visibility matrix load - uint rowCount; + uint32 rowCount; reader.read(rowCount); _visibilityMatrix.clear(); _visibilityMatrix.resize(rowCount); Common::Array< Common::Array >::iterator rowIter = _visibilityMatrix.begin(); while (rowIter != _visibilityMatrix.end()) { - uint colCount; + uint32 colCount; reader.read(colCount); rowIter->resize(colCount); - Common::Array::iterator colIter = rowIter->begin(); + Common::Array::iterator colIter = rowIter->begin(); while (colIter != rowIter->end()) { reader.read(*colIter); ++colIter; -- cgit v1.2.3 From c73904c9788d8f7992c85de33cb505072aba7a2f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 29 Sep 2013 10:30:39 +0300 Subject: SWORD25: Fix compilation --- engines/sword25/math/walkregion.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/sword25/math/walkregion.cpp b/engines/sword25/math/walkregion.cpp index 6c53446913..0ba7e8ec3d 100644 --- a/engines/sword25/math/walkregion.cpp +++ b/engines/sword25/math/walkregion.cpp @@ -341,9 +341,9 @@ bool WalkRegion::persist(OutputPersistenceBlock &writer) { Common::Array< Common::Array >::const_iterator rowIter = _visibilityMatrix.begin(); while (rowIter != _visibilityMatrix.end()) { writer.write((uint32)rowIter->size()); - Common::Array::const_iterator colIter = rowIter->begin(); + Common::Array::const_iterator colIter = rowIter->begin(); while (colIter != rowIter->end()) { - writer.write(*colIter); + writer.write((int32)*colIter); ++colIter; } @@ -381,9 +381,11 @@ bool WalkRegion::unpersist(InputPersistenceBlock &reader) { uint32 colCount; reader.read(colCount); rowIter->resize(colCount); - Common::Array::iterator colIter = rowIter->begin(); + Common::Array::iterator colIter = rowIter->begin(); while (colIter != rowIter->end()) { - reader.read(*colIter); + int32 t; + reader.read(t); + *colIter = t; ++colIter; } -- cgit v1.2.3 From 118da760683ff8d19943c68a24fa5e3c5b1c923a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 29 Sep 2013 10:44:41 +0300 Subject: SWORD25: int -> int32 correctness --- engines/sword25/sfx/soundengine.cpp | 10 +++++----- engines/sword25/sfx/soundengine.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 61d53c89a7..d90849e449 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -339,7 +339,7 @@ bool SoundEngine::persist(OutputPersistenceBlock &writer) { _handles[i].type = kFreeHandle; writer.writeString(_handles[i].fileName); - writer.write((int)_handles[i].sndType); + writer.write(_handles[i].sndType); writer.write(_handles[i].volume); writer.write(_handles[i].pan); writer.write(_handles[i].loop); @@ -363,13 +363,13 @@ bool SoundEngine::unpersist(InputPersistenceBlock &reader) { reader.read(_handles[i].id); Common::String fileName; - int sndType; + int32 sndType; float volume; float pan; bool loop; - int loopStart; - int loopEnd; - uint layer; + int32 loopStart; + int32 loopEnd; + uint32 layer; reader.readString(fileName); reader.read(sndType); diff --git a/engines/sword25/sfx/soundengine.h b/engines/sword25/sfx/soundengine.h index 8132ec556e..8974ee69e5 100644 --- a/engines/sword25/sfx/soundengine.h +++ b/engines/sword25/sfx/soundengine.h @@ -67,13 +67,13 @@ struct SndHandle { uint32 id; Common::String fileName; - int sndType; + int32 sndType; float volume; float pan; bool loop; - int loopStart; - int loopEnd; - uint layer; + int32 loopStart; + int32 loopEnd; + uint32 layer; }; -- cgit v1.2.3 From 4591bd6eb6bd5b4dccaab67bbfb8875f7fffd2d4 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 29 Sep 2013 20:18:54 +0200 Subject: SWORD25: Fix alpha/colormod blitting This is a backport to sword25 of the wintermute commits e9cbda135bbc822009ff311cad6e420fb23cff82 and 2141ad285e0200f4773726a13504f960e382f13e Thanks to eriktorbjorn for noticing and testing. --- engines/sword25/gfx/image/renderedimage.cpp | 50 ++++++++++++----------------- 1 file changed, 21 insertions(+), 29 deletions(-) (limited to 'engines') diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index 346b46f3b4..b359fc6a3e 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -240,14 +240,6 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe int cg = (color >> 8) & 0xff; int cb = (color >> 0) & 0xff; - // Compensate for transparency. Since we're coming - // down to 255 alpha, we just compensate for the colors here - if (ca != 255) { - cr = cr * ca >> 8; - cg = cg * ca >> 8; - cb = cb * ca >> 8; - } - // Create an encapsulating surface for the data Graphics::Surface srcImage; // TODO: Is the data really in the screen format? @@ -400,52 +392,52 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe } else { #if defined(SCUMM_LITTLE_ENDIAN) pix = *(uint32 *)out; - int outb = (pix >> 0) & 0xff; - int outg = (pix >> 8) & 0xff; - int outr = (pix >> 16) & 0xff; + int outb = ((pix >> 0) & 0xff) * (255 - a); + int outg = ((pix >> 8) & 0xff) * (255 - a); + int outr = ((pix >> 16) & 0xff) * (255 - a); if (cb == 0) - outb = 0; + outb = outb >> 8; else if (cb != 255) - outb += ((b - outb) * a * cb) >> 16; + outb = ((outb << 8) + b * a * cb) >> 16; else - outb += ((b - outb) * a) >> 8; + outb = (outb + b * a) >> 8; if (cg == 0) - outg = 0; + outg = outg >> 8; else if (cg != 255) - outg += ((g - outg) * a * cg) >> 16; + outg = ((outg << 8) + g * a * cg) >> 16; else - outg += ((g - outg) * a) >> 8; + outg = (outg + g * a) >> 8; if (cr == 0) - outr = 0; + outr = outr >> 8; else if (cr != 255) - outr += ((r - outr) * a * cr) >> 16; + outr = ((outr << 8) + r * a * cr) >> 16; else - outr += ((r - outr) * a) >> 8; + outr = (outr + r * a) >> 8; *(uint32 *)out = (255 << 24) | (outr << 16) | (outg << 8) | outb; out += 4; #else *out = 255; out++; if (cr == 0) - *out = 0; + *out = (*out * (255-a)) >> 8; else if (cr != 255) - *out += ((r - *out) * a * cr) >> 16; + *out = (((*out * (255-a)) << 8) + r * a * cr) >> 16; else - *out += ((r - *out) * a) >> 8; + *out = ((*out * (255-a)) + r * a) >> 8; out++; if (cg == 0) - *out = 0; + *out = (*out * (255-a)) >> 8; else if (cg != 255) - *out += ((g - *out) * a * cg) >> 16; + *out = (((*out * (255-a)) << 8) + g * a * cg) >> 16; else - *out += ((g - *out) * a) >> 8; + *out = ((*out * (255-a)) + g * a) >> 8; out++; if (cb == 0) - *out = 0; + *out = (*out * (255-a)) >> 8; else if (cb != 255) - *out += ((b - *out) * a * cb) >> 16; + *out = (((*out * (255-a)) << 8) + b * a * cb) >> 16; else - *out += ((b - *out) * a) >> 8; + *out = ((*out * (255-a)) + b * a) >> 8; out++; #endif } -- cgit v1.2.3 From b2fe6232c264799b06705fde676854a7f94599c0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 29 Sep 2013 15:24:32 -0400 Subject: TSAGE: Implemented proper R2R object/player shading --- engines/tsage/core.cpp | 36 ++++++++++++++++++++------- engines/tsage/core.h | 5 +++- engines/tsage/ringworld2/ringworld2_logic.cpp | 10 ++++---- engines/tsage/ringworld2/ringworld2_scenes0.h | 2 -- 4 files changed, 36 insertions(+), 17 deletions(-) (limited to 'engines') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index b0220b53e0..f7fbb1daa1 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2066,8 +2066,8 @@ SceneObject::SceneObject() : SceneHotspot() { _visage = 0; _strip = 0; _frame = 0; - _effect = 0; - _shade = _shade2 = 0; + _effect = EFFECT_NONE; + _shade = _oldShade = 0; _linkedActor = NULL; _field8A = Common::Point(0, 0); @@ -2473,7 +2473,7 @@ void SceneObject::synchronize(Serializer &s) { if (g_vm->getGameID() == GType_Ringworld2) { s.syncAsSint16LE(_effect); s.syncAsSint16LE(_shade); - s.syncAsSint16LE(_shade2); + s.syncAsSint16LE(_oldShade); SYNC_POINTER(_linkedActor); } } @@ -2519,9 +2519,9 @@ void SceneObject::remove() { void SceneObject::dispatch() { if (g_vm->getGameID() == GType_Ringworld2) { - if (_shade != _shade2) + if (_shade != _oldShade) _flags |= OBJFLAG_PANES; - _shade2 = _shade; + _oldShade = _shade; } uint32 currTime = g_globals->_events.getFrameNumber(); @@ -2639,8 +2639,9 @@ void SceneObject::dispatch() { _linkedActor->setFrame(_frame); } - if ((_effect == 1) && (getRegionIndex() < 11)) - _shade = 0; + int regionIndex = getRegionIndex(); + if ((_effect == EFFECT_SHADED) && (regionIndex < 11)) + _shade = regionIndex; } } @@ -2669,7 +2670,24 @@ void SceneObject::removeObject() { GfxSurface SceneObject::getFrame() { _visageImages.setVisage(_visage, _strip); - return _visageImages.getFrame(_frame); + GfxSurface frame = _visageImages.getFrame(_frame); + + // If shading is needed, post apply the shadiing onto the frame + if ((g_vm->getGameID() == GType_Ringworld2) && (_shade >= 1)) { + Graphics::Surface s = frame.lockSurface(); + byte *p = (byte *)s.getPixels(); + byte *endP = p + s.w * s.h; + + while (p < endP) { + if (*p != frame._transColor) + *p = R2_GLOBALS._fadePaletteMap[_shade - 1][*p]; + ++p; + } + + frame.unlockSurface(); + } + + return frame; } void SceneObject::reposition() { @@ -3290,7 +3308,7 @@ void Player::postInit(SceneObjectList *OwnerList) { { _moveDiff.x = 3; _moveDiff.y = 2; - _effect = 1; + _effect = EFFECT_SHADED; _shade = 0; _linkedActor = NULL; diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 6156d13b34..2c88f6be79 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -466,6 +466,9 @@ enum AnimateMode {ANIM_MODE_NONE = 0, ANIM_MODE_1 = 1, ANIM_MODE_2 = 2, ANIM_MOD ANIM_MODE_9 = 9 }; +enum Effect { EFFECT_NONE = 0, EFFECT_SHADED = 1, EFFECT_2 = 2, EFFECT_3 = 3, + EFFECT_4 = 4, EFFECT_5 = 5 }; + class SceneObject; class Visage { @@ -550,7 +553,7 @@ public: // Ringworld 2 specific fields byte *_field9C; - int _shade, _shade2; + int _shade, _oldShade; int _effect; SceneObject *_linkedActor; public: diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 5e4e892f6b..b86b8283ed 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -1317,18 +1317,18 @@ GfxSurface SceneActor::getFrame() { // TODO: Proper effects handling switch (_effect) { - case 0: - case 5: + case EFFECT_NONE: + case EFFECT_5: // TODO: Figure out purpose of setting image flags to 64, and getting // scene priorities -1 or _shade break; - case 1: + case EFFECT_SHADED: // TODO: Transposing using R2_GLOBALS._pixelArrayMap break; - case 2: + case EFFECT_2: // No effect break; - case 4: + case EFFECT_4: break; default: // TODO: Default effect diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index 3153b86745..b735f7cc23 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -306,7 +306,6 @@ public: virtual void dispatch(); }; - class Scene250: public SceneExt { class Button: public SceneActor { public: @@ -477,7 +476,6 @@ public: virtual void dispatch(); }; - class Scene400: public SceneExt { /* Items */ class Terminal: public NamedHotspot { -- cgit v1.2.3 From 8989dd3b73543a13f0d8494350f9c004bc2e7310 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 29 Sep 2013 23:08:45 +0300 Subject: FULLPIPE: Implement MovGraph::calcDistance() --- engines/fullpipe/motion.cpp | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index a7726f3725..da0c614e72 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -230,9 +230,39 @@ int MovGraph::method50() { } double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int flag) { - warning("STUB: MovGraph::calcDistance()"); + int n1x = link->_movGraphNode1->_x; + int n1y = link->_movGraphNode1->_y; + int n2x = link->_movGraphNode2->_x; + int n2y = link->_movGraphNode2->_y; + double dist1x = (double)(point->x - n1x); + double dist1y = (double)(n1y - point->y); + double dist2x = (double)(n2x - n1x); + double dist2y = (double)(n2y - n1y); + double dist1 = sqrt(dist1y * dist1y + dist1x * dist1x); + double dist2 = ((double)(n1y - n2y) * dist1y + dist2x * dist1x) / link->_distance / dist1; + double distm = dist2 * dist1; + double res = sqrt(1.0 - dist2 * dist2) * dist1; + + if (dist2 <= 0.0 || distm >= link->_distance) { + if (flag) { + if (dist2 > 0.0) { + if (distm >= link->_distance) { + point->x = n2x; + point->y = n2y; + } + } else { + point->x = n1x; + point->y = n1y; + } + } else { + return -1.0; + } + } else { + point->x = n1x + (dist2x * distm / link->_distance); + point->y = n1y + (dist2y * distm / link->_distance); + } - return 0; + return res; } int MovGraph2::getItemIndexByGameObjectId(int objectId) { -- cgit v1.2.3 From 2242917dda89cfdf2dd9f15748b5bdb1b4bbe1c3 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 29 Sep 2013 22:27:24 +0200 Subject: WINTERMUTE: Do antialiased TT font rendering --- engines/wintermute/base/font/base_font_truetype.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'engines') diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp index b6f372f377..cc0b9d340a 100644 --- a/engines/wintermute/base/font/base_font_truetype.cpp +++ b/engines/wintermute/base/font/base_font_truetype.cpp @@ -286,6 +286,26 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width, BaseSurface *retSurface = _gameRef->_renderer->createSurface(); Graphics::Surface *convertedSurface = surface->convertTo(_gameRef->_renderer->getPixelFormat()); + + if (_deletableFont) { + // Reconstruct the alpha channel of the font. + + // Since we painted it with color 0xFFFFFFFF onto a black background, + // the alpha channel is gone, but the colour value of each pixel corresponds + // to its original alpha value. + + Graphics::PixelFormat format = _gameRef->_renderer->getPixelFormat(); + uint32 *pixels = (uint32 *)convertedSurface->getPixels(); + + // This is a Surface we created ourselves, so no emtpy space between rows. + for (int i = 0; i < surface->w * surface->h; ++i) { + uint8 a, r, g, b; + format.colorToRGB(*pixels, r, g, b); + a = r; + *pixels++ = format.ARGBToColor(a, r, g, b); + } + } + retSurface->putSurface(*convertedSurface, true); convertedSurface->free(); surface->free(); -- cgit v1.2.3 From 1c3202794ad71e59e9496b94ac51f102f8210b54 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 29 Sep 2013 22:49:01 +0200 Subject: WINTERMUTE: Fix typo in comment --- engines/wintermute/base/font/base_font_truetype.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp index cc0b9d340a..8e0eb8a004 100644 --- a/engines/wintermute/base/font/base_font_truetype.cpp +++ b/engines/wintermute/base/font/base_font_truetype.cpp @@ -291,13 +291,13 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width, // Reconstruct the alpha channel of the font. // Since we painted it with color 0xFFFFFFFF onto a black background, - // the alpha channel is gone, but the colour value of each pixel corresponds + // the alpha channel is gone, but the color value of each pixel corresponds // to its original alpha value. Graphics::PixelFormat format = _gameRef->_renderer->getPixelFormat(); uint32 *pixels = (uint32 *)convertedSurface->getPixels(); - // This is a Surface we created ourselves, so no emtpy space between rows. + // This is a Surface we created ourselves, so no empty space between rows. for (int i = 0; i < surface->w * surface->h; ++i) { uint8 a, r, g, b; format.colorToRGB(*pixels, r, g, b); -- cgit v1.2.3