aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/configure.engines6
-rw-r--r--engines/fullpipe/behavior.cpp20
-rw-r--r--engines/fullpipe/behavior.h10
-rw-r--r--engines/fullpipe/fullpipe.cpp12
-rw-r--r--engines/fullpipe/fullpipe.h24
-rw-r--r--engines/fullpipe/gameloader.cpp50
-rw-r--r--engines/fullpipe/gameloader.h30
-rw-r--r--engines/fullpipe/gfx.cpp4
-rw-r--r--engines/fullpipe/gfx.h6
-rw-r--r--engines/fullpipe/init.cpp2
-rw-r--r--engines/fullpipe/input.cpp16
-rw-r--r--engines/fullpipe/input.h6
-rw-r--r--engines/fullpipe/interaction.cpp40
-rw-r--r--engines/fullpipe/interaction.h10
-rw-r--r--engines/fullpipe/inventory.cpp50
-rw-r--r--engines/fullpipe/inventory.h8
-rw-r--r--engines/fullpipe/messages.cpp10
-rw-r--r--engines/fullpipe/messages.h5
-rw-r--r--engines/fullpipe/modal.cpp20
-rw-r--r--engines/fullpipe/modal.h12
-rw-r--r--engines/fullpipe/motion.cpp415
-rw-r--r--engines/fullpipe/motion.h177
-rw-r--r--engines/fullpipe/objects.h22
-rw-r--r--engines/fullpipe/scene.cpp29
-rw-r--r--engines/fullpipe/scene.h13
-rw-r--r--engines/fullpipe/scenes.cpp92
-rw-r--r--engines/fullpipe/scenes.h6
-rw-r--r--engines/fullpipe/sound.cpp2
-rw-r--r--engines/fullpipe/sound.h1
-rw-r--r--engines/fullpipe/stateloader.cpp50
-rw-r--r--engines/fullpipe/statics.cpp56
-rw-r--r--engines/fullpipe/statics.h16
-rw-r--r--engines/fullpipe/utils.cpp92
-rw-r--r--engines/fullpipe/utils.h15
-rw-r--r--engines/groovie/roq.cpp20
-rw-r--r--engines/neverhood/blbarchive.cpp3
-rw-r--r--engines/neverhood/console.cpp2
-rw-r--r--engines/neverhood/detection.cpp8
-rw-r--r--engines/neverhood/gamemodule.cpp2
-rw-r--r--engines/neverhood/menumodule.cpp12
-rw-r--r--engines/neverhood/menumodule.h1
-rw-r--r--engines/neverhood/module.mk1
-rw-r--r--engines/neverhood/modules/module1000.cpp2
-rw-r--r--engines/neverhood/modules/module1200.h2
-rw-r--r--engines/neverhood/modules/module1300.cpp2
-rw-r--r--engines/neverhood/modules/module2400.h1
-rw-r--r--engines/neverhood/modules/module2800.cpp1012
-rw-r--r--engines/neverhood/modules/module2800.h236
-rw-r--r--engines/neverhood/modules/module2800_sprites.cpp1020
-rw-r--r--engines/neverhood/modules/module2800_sprites.h268
-rw-r--r--engines/neverhood/neverhood.cpp1
-rw-r--r--engines/neverhood/neverhood.h5
-rw-r--r--engines/neverhood/palette.cpp5
-rw-r--r--engines/neverhood/resource.cpp10
-rw-r--r--engines/neverhood/resourceman.cpp35
-rw-r--r--engines/neverhood/resourceman.h2
-rw-r--r--engines/neverhood/scene.cpp3
-rw-r--r--engines/neverhood/scene.h2
-rw-r--r--engines/neverhood/screen.cpp3
-rw-r--r--engines/neverhood/sound.cpp45
-rw-r--r--engines/neverhood/sound.h2
-rw-r--r--engines/neverhood/sprite.cpp6
-rw-r--r--engines/sci/detection_tables.h11
-rw-r--r--engines/sci/engine/savegame.cpp5
-rw-r--r--engines/sci/engine/savegame.h3
-rw-r--r--engines/sci/engine/script_patches.cpp274
-rw-r--r--engines/sci/graphics/screen.cpp14
-rw-r--r--engines/sci/sound/midiparser_sci.cpp285
-rw-r--r--engines/sci/sound/midiparser_sci.h6
-rw-r--r--engines/sci/sound/music.cpp5
-rw-r--r--engines/sci/sound/music.h3
-rw-r--r--engines/sci/sound/soundcmd.cpp7
-rw-r--r--engines/scumm/scumm-md5.h3
-rw-r--r--engines/sword25/gfx/animation.cpp20
-rw-r--r--engines/sword25/gfx/animation.h12
-rw-r--r--engines/sword25/gfx/animationdescription.cpp4
-rw-r--r--engines/sword25/gfx/animationdescription.h8
-rw-r--r--engines/sword25/gfx/animationresource.cpp2
-rw-r--r--engines/sword25/gfx/animationtemplate.cpp4
-rw-r--r--engines/sword25/gfx/animationtemplateregistry.cpp6
-rw-r--r--engines/sword25/gfx/bitmap.h6
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp50
-rw-r--r--engines/sword25/gfx/panel.cpp2
-rw-r--r--engines/sword25/gfx/panel.h2
-rw-r--r--engines/sword25/gfx/renderobject.cpp38
-rw-r--r--engines/sword25/gfx/renderobject.h36
-rw-r--r--engines/sword25/gfx/renderobjectmanager.cpp8
-rw-r--r--engines/sword25/gfx/text.cpp12
-rw-r--r--engines/sword25/gfx/text.h10
-rw-r--r--engines/sword25/input/inputengine.cpp8
-rw-r--r--engines/sword25/kernel/inputpersistenceblock.cpp10
-rw-r--r--engines/sword25/kernel/inputpersistenceblock.h4
-rw-r--r--engines/sword25/kernel/objectregistry.h6
-rw-r--r--engines/sword25/kernel/outputpersistenceblock.cpp8
-rw-r--r--engines/sword25/kernel/outputpersistenceblock.h4
-rw-r--r--engines/sword25/math/polygon.cpp8
-rw-r--r--engines/sword25/math/polygon.h2
-rw-r--r--engines/sword25/math/region.cpp20
-rw-r--r--engines/sword25/math/regionregistry.cpp6
-rw-r--r--engines/sword25/math/walkregion.cpp22
-rw-r--r--engines/sword25/sfx/soundengine.cpp10
-rw-r--r--engines/sword25/sfx/soundengine.h8
-rw-r--r--engines/sword25/util/lua/lcode.cpp2
-rw-r--r--engines/sword25/util/lua/ldebug.cpp5
-rw-r--r--engines/sword25/util/lua/lfunc.cpp2
-rw-r--r--engines/sword25/util/lua/lgc.cpp2
-rw-r--r--engines/sword25/util/lua/llimits.h3
-rw-r--r--engines/sword25/util/lua/lmem.cpp2
-rw-r--r--engines/sword25/util/lua/lopcodes.cpp1
-rw-r--r--engines/sword25/util/lua/lparser.cpp2
-rw-r--r--engines/sword25/util/lua/lstate.cpp2
-rw-r--r--engines/sword25/util/lua/lstring.cpp2
-rw-r--r--engines/sword25/util/lua/lstrlib.cpp6
-rw-r--r--engines/sword25/util/lua/ltablib.cpp2
-rw-r--r--engines/tinsel/scene.cpp2
-rw-r--r--engines/tony/mpal/mpal.cpp6
-rw-r--r--engines/tsage/core.cpp55
-rw-r--r--engines/tsage/core.h5
-rw-r--r--engines/tsage/events.cpp5
-rw-r--r--engines/tsage/events.h1
-rw-r--r--engines/tsage/globals.cpp75
-rw-r--r--engines/tsage/globals.h18
-rw-r--r--engines/tsage/ringworld2/ringworld2_dialogs.cpp2
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp286
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.h105
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.cpp181
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.h10
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp1402
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.h137
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes2.cpp702
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes2.h109
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes3.cpp1811
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes3.h256
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.cpp311
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.h17
-rw-r--r--engines/tsage/scenes.cpp15
-rw-r--r--engines/tsage/staticres.cpp1
-rw-r--r--engines/tsage/staticres.h1
-rw-r--r--engines/wintermute/base/base_sub_frame.cpp2
-rw-r--r--engines/wintermute/base/font/base_font_truetype.cpp20
-rw-r--r--engines/wintermute/base/gfx/base_surface.h4
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp10
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.h4
-rw-r--r--engines/wintermute/base/gfx/osystem/render_ticket.cpp2
-rw-r--r--engines/wintermute/graphics/transform_struct.cpp13
-rw-r--r--engines/wintermute/graphics/transform_struct.h9
-rw-r--r--engines/wintermute/graphics/transparent_surface.cpp562
-rw-r--r--engines/wintermute/graphics/transparent_surface.h91
148 files changed, 6298 insertions, 4953 deletions
diff --git a/engines/configure.engines b/engines/configure.engines
index 8ef4e66dc3..db8e341ee0 100644
--- a/engines/configure.engines
+++ b/engines/configure.engines
@@ -13,10 +13,10 @@ 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
+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"
@@ -52,5 +52,5 @@ 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"
add_engine zvision "ZVision" no
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 6a4a587ff7..5e1af1227c 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;
@@ -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;
@@ -360,7 +360,7 @@ void FullpipeEngine::updateScreen() {
_modalObject->update();
} else {
_modalObject->saveload();
- CBaseModalObject *tmp = _modalObject->_parentObj;
+ BaseModalObject *tmp = _modalObject->_parentObj;
delete _modalObject;
@@ -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 348ac2c9c5..6872dd8356 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -44,11 +44,11 @@ enum FullpipeGameFeatures {
};
class BehaviorManager;
-class CBaseModalObject;
-class CGameLoader;
-class CGameVar;
-class CInputController;
-class CInventory2;
+class BaseModalObject;
+class GameLoader;
+class GameVar;
+class InputController;
+class Inventory2;
struct CursorInfo;
struct EntranceInfo;
class ExCommand;
@@ -98,12 +98,12 @@ public:
Graphics::Surface _backgroundSurface;
- CGameLoader *_gameLoader;
+ GameLoader *_gameLoader;
GameProject *_gameProject;
bool loadGam(const char *fname, int scene = 0);
- CGameVar *getGameLoaderGameVar();
- CInputController *getGameLoaderInputController();
+ GameVar *getGameLoaderGameVar();
+ InputController *getGameLoaderInputController();
int _gameProjectVersion;
int _pictureScale;
@@ -124,7 +124,7 @@ public:
StaticANIObject *_aniMan2;
byte *_globalPalette;
- CInputController *_inputController;
+ InputController *_inputController;
bool _inputDisabled;
int _currentCheat;
@@ -190,14 +190,14 @@ public:
int32 _mapTable[200];
Scene *_inventoryScene;
- CInventory2 *_inventory;
+ Inventory2 *_inventory;
int _currSelectedInventoryItemId;
int32 _updateTicks;
int32 _lastInputTicks;
int32 _lastButtonUpTicks;
- CBaseModalObject *_modalObject;
+ BaseModalObject *_modalObject;
int (*_updateScreenCallback)();
int (*_updateCursorCallback)();
@@ -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 2a8f64dac9..f8ede5cff2 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -31,25 +31,25 @@
namespace Fullpipe {
-CInventory2 *getGameLoaderInventory() {
+Inventory2 *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;
}
-CInteractionController *getGameLoaderInteractionController() {
+InteractionController *getGameLoaderInteractionController() {
return g_fullpipe->_gameLoader->_interactionController;
}
-CGameLoader::CGameLoader() {
- _interactionController = new CInteractionController();
- _inputController = new CInputController();
+GameLoader::GameLoader() {
+ _interactionController = new InteractionController();
+ _inputController = new InputController();
_gameProject = 0;
_gameName = 0;
@@ -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);
@@ -124,12 +124,12 @@ bool CGameLoader::load(MfcArchive &file) {
_field_FA = file.readUint16LE();
_field_F8 = file.readUint16LE();
- _gameVar = (CGameVar *)file.readClass();
+ _gameVar = (GameVar *)file.readClass();
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);
@@ -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);
@@ -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);
@@ -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);
@@ -496,14 +496,14 @@ bool PreloadItems::load(MfcArchive &file) {
return true;
}
-CGameVar *FullpipeEngine::getGameLoaderGameVar() {
+GameVar *FullpipeEngine::getGameLoaderGameVar() {
if (_gameLoader)
return _gameLoader->_gameVar;
else
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 2f1f57a5e2..4f5462671d 100644
--- a/engines/fullpipe/gameloader.h
+++ b/engines/fullpipe/gameloader.h
@@ -30,17 +30,17 @@
namespace Fullpipe {
class SceneTag;
-class CMctlCompound;
-class CInputController;
-class CInteractionController;
-class CMotionController;
+class MctlCompound;
+class InputController;
+class InteractionController;
+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;
@@ -72,10 +72,10 @@ class PreloadItems : public Common::Array<PreloadItem *>, 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);
@@ -90,9 +90,9 @@ class CGameLoader : public CObject {
void saveScenePicAniInfos(int sceneId);
GameProject *_gameProject;
- CInteractionController *_interactionController;
- CInputController *_inputController;
- CInventory2 _inventory;
+ InteractionController *_interactionController;
+ InputController *_inputController;
+ Inventory2 _inventory;
Sc2Array _sc2array;
void *_sceneSwitcher;
bool (*_preloadCallback)(const PreloadItem &pre, int flag);
@@ -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;
@@ -108,9 +108,9 @@ class CGameLoader : public CObject {
int _preloadEntranceId;
};
-CInventory2 *getGameLoaderInventory();
-CInteractionController *getGameLoaderInteractionController();
-CMctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId);
+Inventory2 *getGameLoaderInventory();
+InteractionController *getGameLoaderInteractionController();
+MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId);
} // End of namespace Fullpipe
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/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/input.cpp b/engines/fullpipe/input.cpp
index c4af54ddc3..ee826fd359 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;
@@ -165,7 +165,6 @@ void FullpipeEngine::defHandleKeyDown(int key) {
return;
}
- warning("%d %d", _currentCheat, _currentCheatPos);
if (toupper(key) != input_cheats[_currentCheat][_currentCheatPos]) {
_currentCheat = -1;
@@ -173,7 +172,6 @@ void FullpipeEngine::defHandleKeyDown(int key) {
}
_currentCheatPos++;
- warning("%d %d", _currentCheat, _currentCheatPos);
if (!input_cheats[_currentCheat][_currentCheatPos]) {
switch (_currentCheat) {
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<CursorInfo *> 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);
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index dcc7e90145..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();
- for (CObList::iterator i = intC->_interactions.begin(); i != intC->_interactions.end(); ++i) {
- CInteraction *intr = (CInteraction *)*i;
+ InteractionController *intC = getGameLoaderInteractionController();
+ for (ObList::iterator i = intC->_interactions.begin(); i != intC->_interactions.end(); ++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,16 +104,16 @@ 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;
MessageQueue *mq;
ExCommand *ex;
- for (CObList::iterator i = _interactions.begin(); i != _interactions.end(); ++i) {
- CInteraction *cinter = (CInteraction *)*i;
+ for (ObList::iterator i = _interactions.begin(); i != _interactions.end(); ++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 28a03fb496..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,15 +53,15 @@ 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:
- CObList _interactions;
+ ObList _interactions;
int16 _field_20;
bool _flag24;
@@ -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/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<InventoryPoolItem *> 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<InventoryIcon *> 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);
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 36fd1399ce..b5f2cb8303 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;
@@ -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) {
@@ -222,6 +225,7 @@ MessageQueue::MessageQueue(MessageQueue *src, int parId, int field_38) {
g_fullpipe->_globalMessageQueueList->addMessageQueue(this);
_isFinished = 0;
+ _flag1 = 0;
}
MessageQueue::~MessageQueue() {
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index 7ba9126d46..6b72364323 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);
};
@@ -99,7 +99,6 @@ class MessageQueue : public CObject {
int _flags;
char *_queueName;
int16 _dataId;
- int16 _field_12;
CObject *_field_14;
Common::List<ExCommand *> _exCommands;
int _counter;
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/motion.cpp b/engines/fullpipe/motion.cpp
index 514dde5185..da0c614e72 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -27,35 +27,40 @@
#include "common/list.h"
#include "fullpipe/objects.h"
+#include "fullpipe/statics.h"
#include "fullpipe/motion.h"
+#include "fullpipe/messages.h"
+#include "fullpipe/gameloader.h"
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 = new MctlCompoundArrayItem();
+
+ obj->_motionControllerObj = (MotionController *)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);
}
@@ -64,57 +69,97 @@ 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);
+ _motionControllers.push_back(obj);
}
return true;
}
-void CMctlCompound::addObject(StaticANIObject *obj) {
- warning("STUB: CMctlCompound::addObject()");
+void MctlCompound::addObject(StaticANIObject *obj) {
+ for (uint i = 0; i < _motionControllers.size(); i++)
+ _motionControllers[i]->_motionControllerObj->addObject(obj);
}
-void CMctlCompound::initMovGraph2() {
- warning("STUB: CMctlCompound::initMovGraph2()");
+int MctlCompound::removeObject(StaticANIObject *obj) {
+ warning("STUB: MctlCompound::removeObject()");
+
+ return 0;
+}
+
+void MctlCompound::initMovGraph2() {
+ 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;
+
+ MovGraph2 *newgr = new MovGraph2();
+
+ newgr->_links = gr->_links;
+ newgr->_nodes = gr->_nodes;
+
+ gr->_links.clear();
+ gr->_nodes.clear();
+
+ delete gr;
+
+ _motionControllers[i]->_motionControllerObj = newgr;
+ }
}
-MessageQueue *CMctlCompound::method34(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId) {
- warning("STUB: CMctlCompound::method34()");
+void MctlCompound::freeItems() {
+ warning("STUB: MctlCompound::freeItems()");
+}
+
+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;
}
-CMovGraph::CMovGraph() {
- warning("STUB: CMovGraph::CMovGraph()");
+int MovGraph_messageHandler(ExCommand *cmd);
+
+int MovGraphCallback(int a1, int a2, int a3) {
+ warning("STUB: MovgraphCallback");
+
+ return 0;
+}
+
+MovGraph::MovGraph() {
_itemsCount = 0;
_items = 0;
- //_callback1 = CMovGraphCallback1; // TODO
+ _callback1 = MovGraphCallback;
_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);
@@ -122,11 +167,288 @@ 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()");
+}
+
+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) {
+ 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 res;
+}
+
+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) {
+ 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;
+ }
+ }
+
+ 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) {
+ 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) {
+ warning("STUB: MovGraph2::removeObject()");
+
+ return 0;
+}
+
+void MovGraph2::freeItems() {
+ warning("STUB: MovGraph2::freeItems()");
}
-CMovGraphLink::CMovGraphLink() {
+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()");
+
+ return 0;
+}
+
+MovGraphLink::MovGraphLink() {
_distance = 0;
_angle = 0;
_flags = 0x10000000;
@@ -138,8 +460,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);
@@ -147,23 +469,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();
@@ -173,7 +495,7 @@ bool CMovGraphNode::load(MfcArchive &file) {
return true;
}
-CReactParallel::CReactParallel() {
+ReactParallel::ReactParallel() {
_x1 = 0;
_x2 = 0;
_dy = 0;
@@ -183,8 +505,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();
@@ -198,7 +520,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++)
@@ -223,15 +545,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();
@@ -254,7 +576,7 @@ bool CReactPolygonal::load(MfcArchive &file) {
return true;
}
-void CReactPolygonal::createRegion() {
+void ReactPolygonal::createRegion() {
if (_points) {
// GdiObject::Attach(_rgn, CreatePolygonRgn(_points, _pointCount, 2);
@@ -262,7 +584,10 @@ void CReactPolygonal::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;
}
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index 85a52918f0..99d8d3eb79 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -29,54 +29,88 @@ 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 {
- public:
+class MotionController : public CObject {
+public:
int _field_4;
bool _isEnabled;
- public:
- CMotionController() : _isEnabled(true) {}
+public:
+ MotionController() : _isEnabled(true), _field_4(0) {}
+ virtual ~MotionController() {}
virtual bool load(MfcArchive &file);
-
- void setEnabled() { _isEnabled = true; }
- void clearEnabled() { _isEnabled = false; }
-
+ virtual void methodC() {}
+ virtual void method10() {}
+ virtual void clearEnabled() { _isEnabled = false; }
+ virtual void setEnabled() { _isEnabled = true; }
virtual void addObject(StaticANIObject *obj) {}
+ 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 MovGraphReact : public CObject {
+ // Empty
};
-class CMctlCompoundArray : public Common::Array<CObject>, public CObject {
+typedef Common::Array<CObject> MctlConnectionPointsArray;
+
+class MctlCompoundArrayItem : public CObject {
+ friend class MctlCompound;
+
+ protected:
+ MotionController *_motionControllerObj;
+ MovGraphReact *_movGraphReactObj;
+ MctlConnectionPointsArray _connectionPoints;
+ int _field_20;
+ int _field_24;
+ int _field_28;
+
public:
- virtual bool load(MfcArchive &file);
+ MctlCompoundArrayItem() : _movGraphReactObj(0) {}
};
-class CMctlConnectionPointsArray : public Common::Array<CObject>, public CObject {
+class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
-class CMctlCompound : public CMotionController {
- CMctlCompoundArray _motionControllers;
+class MctlCompound : public MotionController {
+ MctlCompoundArray _motionControllers;
public:
+ MctlCompound() { _objtype = kObjTypeMctlCompound; }
+
virtual bool load(MfcArchive &file);
virtual void addObject(StaticANIObject *obj);
- void initMovGraph2();
+ 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 {
+public:
int _items;
int _count;
- public:
+public:
Unk2() : _items(0), _count(0) {}
};
-class CMovGraphNode : public CObject {
+class MovGraphNode : public CObject {
+ public:
int _x;
int _y;
int _distance;
@@ -84,30 +118,11 @@ 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 {
- // Empty
-};
-
-class CMctlCompoundArrayItem : public CObject {
- friend class CMctlCompound;
-
- protected:
- CMotionController *_motionControllerObj;
- CMovGraphReact *_movGraphReactObj;
- CMctlConnectionPointsArray _connectionPoints;
- int _field_20;
- int _field_24;
- int _field_28;
-
- public:
- CMctlCompoundArrayItem() : _movGraphReactObj(0) {}
-};
-
-class CReactParallel : public CMovGraphReact {
+class ReactParallel : public MovGraphReact {
//CRgn _rgn;
int _x1;
int _y1;
@@ -118,12 +133,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;
@@ -131,32 +146,34 @@ class CReactPolygonal : public CMovGraphReact {
Common::Point **_points;
public:
- CReactPolygonal();
+ ReactPolygonal();
virtual bool load(MfcArchive &file);
void createRegion();
};
-class CMovGraphLink : public CObject {
- CMovGraphNode *_movGraphNode1;
- CMovGraphNode *_movGraphNode2;
- CDWordArray _dwordArray1;
- CDWordArray _dwordArray2;
+class MovGraphLink : public CObject {
+ public:
+ MovGraphNode *_movGraphNode1;
+ MovGraphNode *_movGraphNode2;
+ DWordArray _dwordArray1;
+ DWordArray _dwordArray2;
int _flags;
int _field_38;
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 {
- CObList _nodes;
- CObList _links;
+class MovGraph : public MotionController {
+ public:
+ ObList _nodes;
+ ObList _links;
int _field_44;
int _items;
int _itemsCount;
@@ -164,13 +181,65 @@ class CMovGraph : public CMotionController {
Unk2 _unk2;
public:
- CMovGraph();
+ MovGraph();
virtual bool load(MfcArchive &file);
virtual void 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 Movement;
+
+struct MG2I {
+ int _movementId;
+ Movement *_mov;
+ int _mx;
+ int _my;
+};
+
+struct MovGraph2ItemSub {
+ int _staticsId2;
+ int _staticsId1;
+ MG2I _walk[3];
+ MG2I _turn[4];
+ MG2I _turnS[4];
+};
+
+struct MovGraph2Item {
+ int _objectId;
+ StaticANIObject *_obj;
+ MovGraph2ItemSub _subItems[4];
+};
+
+class MovGraph2 : public MovGraph {
+public:
+ Common::Array<MovGraph2Item *> _items;
+
+public:
+ 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);
+ virtual MessageQueue *method4C(StaticANIObject *subj, int xpos, int ypos, int flag, int staticsId);
+
+ int getItemIndexByGameObjectId(int objectId);
+ bool initDirections(StaticANIObject *obj, MovGraph2Item *item);
};
-class CMctlConnectionPoint : public CObject {
+class MctlConnectionPoint : public CObject {
+public:
int _connectionX;
int _connectionY;
int _field_C;
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 6ac062fb37..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) {
@@ -259,7 +260,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 +274,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;
@@ -327,7 +328,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];
}
@@ -371,16 +372,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 +398,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 +406,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 +422,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)
@@ -441,7 +442,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 +454,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 +527,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..db0da5db31 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;
@@ -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);
@@ -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 {
@@ -88,7 +88,6 @@ class SceneTag : public CObject {
char *_tag;
Scene *_scene;
int16 _sceneId;
- int16 _field_12;
public:
SceneTag();
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index f6620a2fc7..9fb8a95f53 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);
@@ -137,21 +137,17 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_aniMan->_statics = _aniMan->getStaticsById(ST_MAN_EMPTY);
_aniMan->setOXY(0, 0);
- if (_aniMan) {
- _aniMan2 = _aniMan;
- CMctlCompound *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();
- 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);
}
@@ -657,7 +653,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);
@@ -731,6 +727,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 +766,6 @@ int global_messageHandler1(ExCommand *cmd) {
cmd->_messageKind = 0;
break;
default:
- g_fullpipe->defHandleKeyDown(cmd->_keyCode);
break;
}
break;
@@ -1075,7 +1072,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);
}
@@ -1312,6 +1309,63 @@ int global_messageHandler4(ExCommand *cmd) {
return 1;
}
+int MovGraph_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;
+
+ MovGraph *gr = (MovGraph *)getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId);
+
+ MovGraphLink *link = 0;
+ double mindistance = 1.0e10;
+ Common::Point point;
+
+ for (ObList::iterator i = gr->_links.begin(); i != gr->_links.end(); ++i) {
+ point.x = ani->_ox;
+ point.y = ani->_oy;
+
+ double dst = gr->calcDistance(&point, (MovGraphLink *)(*i), 0);
+ if (dst >= 0.0 && dst < mindistance) {
+ mindistance = dst;
+ link = (MovGraphLink *)(*i);
+ }
+ }
+
+ int top;
+
+ if (link) {
+ 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;
+ 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();
@@ -1325,7 +1379,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);
@@ -1348,7 +1402,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) {
@@ -1358,7 +1412,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/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;
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 4c58d564dd..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;
@@ -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();
}
@@ -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 ac80e809c1..0e9daadd45 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;
@@ -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;
@@ -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;
@@ -1242,6 +1245,41 @@ Common::Point *Movement::getCurrDynamicPhaseXY(Common::Point &p) {
return &p;
}
+Common::Point *Movement::calcSomeXY(Common::Point &p, int idx) {
+ 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;
+}
+
void Movement::setAlpha(int alpha) {
if (_currMovement)
for (uint i = 0; i < _currMovement->_dynamicPhases.size(); i++) {
@@ -1553,7 +1591,7 @@ bool Movement::gotoPrevFrame() {
_currDynamicPhaseIndex--;
if (_currDynamicPhaseIndex < 0)
- _currDynamicPhaseIndex = _currMovement->_dynamicPhases.size() - 1;
+ _currDynamicPhaseIndex = _dynamicPhases.size() - 1;
}
updateCurrDynamicPhase();
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 03d87c8e32..2879edd8e1 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; }
@@ -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;
@@ -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();
@@ -172,9 +174,9 @@ class StaticANIObject : public GameObject {
int _initialCounter;
int _callback1;
void (*_callback2)(int *);
- CPtrList _movements;
- CPtrList _staticsList;
- CStepArray _stepArray;
+ PtrList _movements;
+ PtrList _staticsList;
+ StepArray _stepArray;
int16 _field_96;
int _messageQueueId;
int _messageNum;
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index ee73aeaa64..3304a93667 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);
@@ -262,34 +262,34 @@ double MfcArchive::readDouble() {
enum {
kNullObject,
- kCInteraction,
+ kInteraction,
kMessageQueue,
kExCommand,
- kCObjstateCommand,
- kCGameVar,
- kCMctlCompound,
- kCMovGraph,
- kCMovGraphLink,
- kCMovGraphNode,
- kCReactParallel,
- kCReactPolygonal
+ kObjstateCommand,
+ kGameVar,
+ kMctlCompound,
+ kMovGraph,
+ kMovGraphLink,
+ kMovGraphNode,
+ kReactParallel,
+ kReactPolygonal
};
const struct {
const char *name;
int id;
} classMap[] = {
- { "CInteraction", kCInteraction },
+ { "CInteraction", kInteraction },
{ "MessageQueue", kMessageQueue },
{ "ExCommand", kExCommand },
- { "CObjstateCommand", kCObjstateCommand },
- { "CGameVar", kCGameVar },
- { "CMctlCompound", kCMctlCompound },
- { "CMovGraph", kCMovGraph },
- { "CMovGraphLink", kCMovGraphLink },
- { "CMovGraphNode", kCMovGraphNode },
- { "CReactParallel", kCReactParallel },
- { "CReactPolygonal", kCReactPolygonal },
+ { "CObjstateCommand", kObjstateCommand },
+ { "CGameVar", kGameVar },
+ { "CMctlCompound", kMctlCompound },
+ { "CMovGraph", kMovGraph },
+ { "CMovGraphLink", kMovGraphLink },
+ { "CMovGraphNode", kMovGraphNode },
+ { "CReactParallel", kReactParallel },
+ { "CReactPolygonal", kReactPolygonal },
{ 0, 0 }
};
@@ -306,28 +306,28 @@ 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:
return new ExCommand();
- case kCObjstateCommand:
- 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 kObjstateCommand:
+ return new ObjstateCommand();
+ case kGameVar:
+ return new GameVar();
+ 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);
}
@@ -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..e593bd9f18 100644
--- a/engines/fullpipe/utils.h
+++ b/engines/fullpipe/utils.h
@@ -68,7 +68,9 @@ enum ObjType {
kObjTypeDefault,
kObjTypeObjstateCommand,
kObjTypeStaticANIObject,
- kObjTypePictureObject
+ kObjTypePictureObject,
+ kObjTypeMovGraph,
+ kObjTypeMctlCompound
};
class CObject {
@@ -82,7 +84,7 @@ class CObject {
bool loadFile(const char *fname);
};
-class CObList : public Common::List<CObject *>, public CObject {
+class ObList : public Common::List<CObject *>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
@@ -97,9 +99,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;
@@ -134,17 +133,17 @@ class MemoryObject2 : public MemoryObject {
void copyData(byte *src, int dataSize);
};
-class CObArray : public Common::Array<CObject>, public CObject {
+class ObArray : public Common::Array<CObject>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
-class CDWordArray : public Common::Array<int32>, public CObject {
+class DWordArray : public Common::Array<int32>, public CObject {
public:
virtual bool load(MfcArchive &file);
};
-typedef Common::Array<void *> CPtrList;
+typedef Common::Array<void *> PtrList;
char *genFileName(int superId, int sceneId, const char *ext);
byte *transCyrillic(byte *s);
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index f9a938bfd4..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"
@@ -435,19 +436,20 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
warning("Groovie::ROQ: JPEG frame (unfinished)");
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();
+ jpg->setOutputColorSpace(Graphics::JPEGDecoder::kColorSpaceYUV);
+ 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();
- for (int i = 0; i < _currBuf->w * _currBuf->h; i++) {
- *ptr++ = *y++;
- *ptr++ = *u++;
- *ptr++ = *v++;
- }
+ memcpy(ptr, src, _currBuf->w * _currBuf->h * srcSurf->format.bytesPerPixel);
delete jpg;
+
+ _file->seek(startPos + blockHeader.size);
return true;
}
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);
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/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/menumodule.cpp b/engines/neverhood/menumodule.cpp
index 7bf64a4602..5ad2dd69d7 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:
@@ -353,11 +354,11 @@ 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
- // 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<MenuButton>(this, buttonIndex,
@@ -573,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);
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 &param, Entity *sender);
};
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/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;
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 {
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);
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 1c0f9fc9fb..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 {
@@ -294,30 +295,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 +314,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);
@@ -687,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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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) {
@@ -1350,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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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) {
@@ -1892,34 +1328,6 @@ uint32 Scene2805::handleMessage(int messageNum, const MessageParam &param, 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 &param, 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) {
@@ -2111,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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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) {
@@ -2466,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 &param, 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) {
@@ -2613,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 &param, 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) {
@@ -2862,101 +1953,6 @@ uint32 Scene2810::handleMessage(int messageNum, const MessageParam &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, Entity *sender);
- uint32 hmPulled(int messageNum, const MessageParam &param, Entity *sender);
-};
-
-class AsScene2803TestTubeOne : public AnimatedSprite {
-public:
- AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2);
-protected:
- uint32 _fileHash1, _fileHash2;
- uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
-};
-
-class AsScene2803Rope : public AnimatedSprite {
-public:
- AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x);
-protected:
- Scene *_parentScene;
- uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
- uint32 hmReleased(int messageNum, const MessageParam &param, 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 &param, Entity *sender);
-};
-
-class SsScene2804LightCoil : public StaticSprite {
-public:
- SsScene2804LightCoil(NeverhoodEngine *vm);
-protected:
- uint32 handleMessage(int messageNum, const MessageParam &param, 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 &param, 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 &param, 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 &param, Entity *sender);
- void show();
- void hide();
- void stBeaming();
- uint32 hmBeaming(int messageNum, const MessageParam &param, Entity *sender);
-};
-
-class AsScene2804BeamTarget : public AnimatedSprite {
-public:
- AsScene2804BeamTarget(NeverhoodEngine *vm);
-protected:
- uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
-};
+class SsScene2804Flash;
+class AsScene2804Crystal;
class Scene2804 : public Scene {
public:
@@ -284,13 +160,6 @@ protected:
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
};
-class AsScene2806Spew : public AnimatedSprite {
-public:
- AsScene2806Spew(NeverhoodEngine *vm);
-protected:
- uint32 handleMessage(int messageNum, const MessageParam &param, 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 &param, 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 &param, 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 &param, 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 &param, Entity *sender);
- uint32 hmActivating(int messageNum, const MessageParam &param, 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 &param, 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 &param, 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 &param, 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 &param, Entity *sender);
-};
-
-class AsScene2812Rope : public AnimatedSprite {
-public:
- AsScene2812Rope(NeverhoodEngine *vm, Scene *parentScene);
-protected:
- Scene *_parentScene;
- uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
- uint32 hmRopingDown(int messageNum, const MessageParam &param, Entity *sender);
- void stRopingDown();
-};
-
-class AsScene2812TrapDoor : public AnimatedSprite {
-public:
- AsScene2812TrapDoor(NeverhoodEngine *vm);
-protected:
- uint32 handleMessage(int messageNum, const MessageParam &param, 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..f7949b97c8
--- /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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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), _parentScene(parentScene) {
+
+ 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, 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 &param, Entity *sender);
+ uint32 hmPulled(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class AsScene2803TestTubeOne : public AnimatedSprite {
+public:
+ AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2);
+protected:
+ uint32 _fileHash1, _fileHash2;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class AsScene2803Rope : public AnimatedSprite {
+public:
+ AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x);
+protected:
+ Scene *_parentScene;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ uint32 hmReleased(int messageNum, const MessageParam &param, 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 &param, Entity *sender);
+};
+
+class SsScene2804LightCoil : public StaticSprite {
+public:
+ SsScene2804LightCoil(NeverhoodEngine *vm);
+protected:
+ uint32 handleMessage(int messageNum, const MessageParam &param, 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 &param, 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 &param, 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 &param, Entity *sender);
+ void show();
+ void hide();
+ void stBeaming();
+ uint32 hmBeaming(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class AsScene2804BeamTarget : public AnimatedSprite {
+public:
+ AsScene2804BeamTarget(NeverhoodEngine *vm);
+protected:
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class AsScene2806Spew : public AnimatedSprite {
+public:
+ AsScene2806Spew(NeverhoodEngine *vm);
+protected:
+ uint32 handleMessage(int messageNum, const MessageParam &param, 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 &param, 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 &param, 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 &param, Entity *sender);
+ uint32 hmActivating(int messageNum, const MessageParam &param, 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 &param, 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 &param, Entity *sender);
+};
+
+class AsScene2810Rope : public AnimatedSprite {
+public:
+ AsScene2810Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x);
+protected:
+ Scene *_parentScene;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class AsScene2812Winch : public AnimatedSprite {
+public:
+ AsScene2812Winch(NeverhoodEngine *vm);
+ virtual ~AsScene2812Winch();
+protected:
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class AsScene2812Rope : public AnimatedSprite {
+public:
+ AsScene2812Rope(NeverhoodEngine *vm, Scene *parentScene);
+protected:
+ Scene *_parentScene;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ uint32 hmRopingDown(int messageNum, const MessageParam &param, Entity *sender);
+ void stRopingDown();
+};
+
+class AsScene2812TrapDoor : public AnimatedSprite {
+public:
+ AsScene2812TrapDoor(NeverhoodEngine *vm);
+protected:
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+} // End of namespace Neverhood
+
+#endif /* NEVERHOOD_MODULES_MODULE2800_SPRITES_H */
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..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;
@@ -135,9 +137,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;
};
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() {
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/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 &param, Entity *sender);
int _messageValue;
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
bool queryPositionSprite(int16 mouseX, int16 mouseY);
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();
diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp
index c3bc3501b5..3ea45491a7 100644
--- a/engines/neverhood/sound.cpp
+++ b/engines/neverhood/sound.cpp
@@ -250,13 +250,26 @@ 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() {
+ 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 +278,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;
}
@@ -573,7 +579,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();
}
}
@@ -623,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) {
}
@@ -724,6 +731,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 +749,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);
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() {
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 92e77cead9..d0a0db2a3b 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 (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", "", {
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index c8076ec819..c60b50a964 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) // FE 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/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index d4dddb6faf..d2c3356d54 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -59,6 +59,58 @@ struct SciScriptSignature {
// - 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
// but the call is wrong, so not only do we get an error message the script
@@ -742,6 +794,48 @@ const SciScriptSignature longbowSignatures[] = {
};
// ===========================================================================
+// 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
// available temp space resulting in temp space corruption
@@ -868,6 +962,68 @@ const SciScriptSignature mothergoose256Signatures[] = {
};
// ===========================================================================
+// 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
// the main User::doit also calls kGetEvent it's pure luck, where the event
@@ -995,14 +1151,75 @@ const uint16 qfg1vgaPatchMoveToCastleGate[] = {
PATCH_END
};
+// Typo in the original Sierra scripts
+// 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
+ 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
+};
+
+// 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)
+ 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 },
- { 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 },
+ { 96, "funny room script bug fixed", 1, PATCH_MAGICDWORD(0x35, 0x01, 0xa3, 0x4e), -10, qfg1vgaSignatureFunnyRoomFix, qfg1vgaPatchFunnyRoomFix },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1250,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)
@@ -1267,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.
@@ -1287,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};
@@ -1389,6 +1634,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;
@@ -1420,12 +1668,18 @@ 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;
case GID_MOTHERGOOSE256:
signatureTable = mothergoose256Signatures;
break;
+ case GID_PQ1:
+ signatureTable = pq1vgaSignatures;
+ break;
case GID_QFG1VGA:
signatureTable = qfg1vgaSignatures;
break;
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<int16>(startPoint.x, 0, maxWidth);
+ int16 top = CLIP<int16>(startPoint.y, 0, maxHeight);
+ int16 right = CLIP<int16>(endPoint.x, 0, maxWidth);
+ int16 bottom = CLIP<int16>(endPoint.y, 0, maxHeight);
+
//set_drawing_flag
byte drawMask = getDrawingMask(color, priority, control);
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 7640c5f314..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"
@@ -53,11 +56,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 +438,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 +459,79 @@ 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) {
+ 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:
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 +548,43 @@ 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 (!_pSnd->inFastForward) {
- _signalSet = true;
- _signalToSet = info.basic.param1;
+ 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 + 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 +606,48 @@ 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;
+ jumpToTick(_loopTick, false, false);
+ // Done with this event.
+ return;
}
- break;
+ return;
case kUpdateCue:
- if (!_pSnd->inFastForward) {
- _dataincAdd = true;
+ if (!_jumpingToTick) {
+ 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;
+ 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,93 +662,49 @@ 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) {
+ jumpToTick(_loopTick);
+
+ // 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).
- assert(_loopTick + info.delta < _position._playTick);
-
- 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];
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..40236c8445 100644
--- a/engines/sci/sound/music.h
+++ b/engines/sci/sound/music.h
@@ -65,12 +65,11 @@ 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;
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..e36c5705ab 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<int>(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<int>(readSelectorValue(_segMan, obj, SELECTOR(vol)), 0, 255);
if (objVol != musicSlot->volume)
_music->soundSetVolume(musicSlot, objVol);
- uint32 objPrio = readSelectorValue(_segMan, obj, SELECTOR(priority));
+ int16 objPrio = readSelectorValue(_segMan, obj, SELECTOR(priority));
if (objPrio != musicSlot->priority)
_music->soundSetPriority(musicSlot, objPrio);
return acc;
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 },
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<uint>(_direction));
+ writer.write(static_cast<uint32>(_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>(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/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..164206bbc2 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<uint>(_animationType));
+ writer.write(static_cast<uint32>(_animationType));
writer.write(_FPS);
writer.write(_millisPerFrame);
writer.write(_scalingAllowed);
@@ -47,7 +47,7 @@ bool AnimationDescription::persist(OutputPersistenceBlock &writer) {
}
bool AnimationDescription::unpersist(InputPersistenceBlock &reader) {
- uint animationType;
+ uint32 animationType;
reader.read(animationType);
_animationType = static_cast<Animation::ANIMATION_TYPES>(animationType);
reader.read(_FPS);
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/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 <frame> tag in \"%s\". Assuming default (\"false\").",
flipHString.c_str(), getFileName().c_str());
frame.flipH = false;
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 Frame>::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..4cefe24b18 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();
@@ -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.
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/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
}
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);
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..e9e11aae4e 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
@@ -399,7 +399,7 @@ RenderObjectPtr<Text> 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<uint>(_type));
+ writer.write(static_cast<uint32>(_type));
writer.write(_handle);
// Restliche Objekteigenschaften speichern.
@@ -413,14 +413,14 @@ 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(_oldBbox.left);
- writer.write(_oldBbox.top);
- writer.write(_oldBbox.right);
- writer.write(_oldBbox.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);
+ 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<RenderObject>(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> RenderObject::recreatePersistedRenderObject(InputP
RenderObjectPtr<RenderObject> 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 1116c3284c..7fcd3a87a3 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;
}
@@ -388,14 +388,14 @@ protected:
typedef Common::List<RenderObjectPtr<RenderObject> > RENDEROBJECT_LIST;
typedef Common::List<RenderObjectPtr<RenderObject> >::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;
@@ -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.
@@ -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 d4aaa90682..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<RenderObject> parentPtr) :
@@ -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();
@@ -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 94e7a30865..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.
@@ -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.
@@ -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;
}
@@ -142,11 +142,11 @@ private:
Text(RenderObjectPtr<RenderObject> parentPtr);
Text(InputPersistenceBlock &reader, RenderObjectPtr<RenderObject> parentPtr, uint handle);
- uint _modulationColor;
+ uint32 _modulationColor;
Common::String _font;
Common::String _text;
bool _autoWrap;
- uint _autoWrapThreshold;
+ uint32 _autoWrapThreshold;
struct Line {
Common::Rect bbox;
diff --git a/engines/sword25/input/inputengine.cpp b/engines/sword25/input/inputengine.cpp
index bb9c2c8b40..0d1c449805 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);
@@ -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/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp
index 0fe5d88b80..aa3a759756 100644
--- a/engines/sword25/kernel/inputpersistenceblock.cpp
+++ b/engines/sword25/kernel/inputpersistenceblock.cpp
@@ -48,12 +48,12 @@ InputPersistenceBlock::~InputPersistenceBlock() {
}
void InputPersistenceBlock::read(int16 &value) {
- signed int v;
+ int32 v;
read(v);
value = static_cast<int16>(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;
@@ -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<byte> &value) {
if (checkMarker(BLOCK_MARKER)) {
- uint size;
+ uint32 size;
read(size);
if (checkBlockSize(size)) {
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/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<uint, T *> HANDLE2PTR_MAP;
- typedef Common::HashMap<T *, uint, ClassPointer_Hash, ClassPointer_EqualTo> PTR2HANDLE_MAP;
+ typedef Common::HashMap<uint32, T *> HANDLE2PTR_MAP;
+ typedef Common::HashMap<T *, uint32, ClassPointer_Hash, ClassPointer_EqualTo> PTR2HANDLE_MAP;
HANDLE2PTR_MAP _handle2PtrMap;
PTR2HANDLE_MAP _ptr2HandleMap;
- uint _nextHandle;
+ uint32 _nextHandle;
T *findPtrByHandle(uint handle) {
// Zum Handle gehörigen Pointer finden.
diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp
index e29d956e5f..53fb624767 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));
@@ -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<byte> &value) {
writeMarker(BLOCK_MARKER);
- write((uint)value.size());
+ write((uint32)value.size());
rawWrite(&value[0], value.size());
}
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);
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<Vertex> 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..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
@@ -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<uint>(_type));
+ writer.write(static_cast<uint32>(_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<Polygon>::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
diff --git a/engines/sword25/math/walkregion.cpp b/engines/sword25/math/walkregion.cpp
index bace4d54bc..0ba7e8ec3d 100644
--- a/engines/sword25/math/walkregion.cpp
+++ b/engines/sword25/math/walkregion.cpp
@@ -328,22 +328,22 @@ bool WalkRegion::persist(OutputPersistenceBlock &writer) {
result &= Region::persist(writer);
// Persist the nodes
- writer.write(_nodes.size());
+ writer.write((uint32)_nodes.size());
Common::Array<Vertex>::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<int> >::const_iterator rowIter = _visibilityMatrix.begin();
while (rowIter != _visibilityMatrix.end()) {
- writer.write(rowIter->size());
+ writer.write((uint32)rowIter->size());
Common::Array<int>::const_iterator colIter = rowIter->begin();
while (colIter != rowIter->end()) {
- writer.write(*colIter);
+ writer.write((int32)*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,18 +372,20 @@ bool WalkRegion::unpersist(InputPersistenceBlock &reader) {
}
// Visibility matrix load
- uint rowCount;
+ uint32 rowCount;
reader.read(rowCount);
_visibilityMatrix.clear();
_visibilityMatrix.resize(rowCount);
Common::Array< Common::Array<int> >::iterator rowIter = _visibilityMatrix.begin();
while (rowIter != _visibilityMatrix.end()) {
- uint colCount;
+ uint32 colCount;
reader.read(colCount);
rowIter->resize(colCount);
Common::Array<int>::iterator colIter = rowIter->begin();
while (colIter != rowIter->end()) {
- reader.read(*colIter);
+ int32 t;
+ reader.read(t);
+ *colIter = t;
++colIter;
}
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;
};
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 <stdlib.h>
-
#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 <stdarg.h>
-#include <stddef.h>
-#include <string.h>
-
-
#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 <stddef.h>
-
#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 <string.h>
-
#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 <limits.h>
-#include <stddef.h>
-
#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 <stddef.h>
-
#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 <string.h>
-
#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 <stddef.h>
-
#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 <string.h>
-
#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 <ctype.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#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 <stddef.h>
-
#define ltablib_c
#define LUA_LIB
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) {
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++;
}
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index fbbf982c28..f7fbb1daa1 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<PaletteModifier *>::iterator i = tempPalette._listeners.begin(); i != tempPalette._listeners.end(); ++i)
@@ -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);
@@ -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);
@@ -2468,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);
}
}
@@ -2514,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();
@@ -2634,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;
}
}
@@ -2664,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() {
@@ -3285,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/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/globals.cpp b/engines/tsage/globals.cpp
index 7068c2fa1a..9bd7249902 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -427,34 +427,34 @@ 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]._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;
- _v566A4 = 1;
- _v566A5 = 0;
+ _flubMazeArea = 1;
+ _flubMazeEntryDirection = 0;
_desertStepsRemaining = 5;
_desertCorrectDirection = 0;
_desertPreviousDirection = 0;
@@ -463,11 +463,10 @@ void Ringworld2Globals::reset() {
_desertWrongDirCtr = -1;
_balloonAltitude = 5;
_scene1925CurrLevel = 0; //_v56A9C
- _v56A9E = 0;
+ _walkwaySceneNumber = 0;
_v56AA0 = 0;
- _v56AA1 = 0;
- _v56AA2 = 60;
- _v56AA4 = 660;
+ _scientistConvIndex = 0;
+ _ventCellPos = Common::Point(60, 660);
_v56AA6 = 1;
_v56AA7 = 1;
_v56AA8 = 1;
@@ -504,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) {
@@ -530,9 +529,9 @@ void Ringworld2Globals::synchronize(Serializer &s) {
s.syncAsSint16LE(_v566A6);
s.syncAsSint16LE(_desertWrongDirCtr);
s.syncAsSint16LE(_scene1925CurrLevel); // _v56A9C
- s.syncAsSint16LE(_v56A9E);
- s.syncAsSint16LE(_v56AA2);
- s.syncAsSint16LE(_v56AA4);
+ s.syncAsSint16LE(_walkwaySceneNumber);
+ s.syncAsSint16LE(_ventCellPos.x);
+ s.syncAsSint16LE(_ventCellPos.y);
s.syncAsSint16LE(_v56AAB);
s.syncAsSint16LE(_scene180Mode);
s.syncAsSint16LE(_v57709);
@@ -553,13 +552,13 @@ 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);
s.syncAsByte(_v56AA0);
- s.syncAsByte(_v56AA1);
+ s.syncAsByte(_scientistConvIndex);
s.syncAsByte(_v56AA6);
s.syncAsByte(_v56AA7);
s.syncAsByte(_v56AA8);
@@ -580,6 +579,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]._shotsRequired);
+ 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 0684076b1e..ad47f7f620 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -244,6 +244,12 @@ namespace Ringworld2 {
class ScannerDialog;
+struct VampireData {
+ bool _isAlive;
+ int _shotsRequired;
+ Common::Point _position;
+};
+
class Ringworld2Globals: public TsAGE2Globals {
public:
ASoundExt _sound1, _sound2, _sound3, _sound4;
@@ -270,9 +276,9 @@ public:
int _v5657C;
byte _v565AE;
byte _spillLocation[14];
- int _v56613[76];
- byte _v566A4;
- byte _v566A5;
+ VampireData _vampireData[18];
+ byte _flubMazeArea;
+ byte _flubMazeEntryDirection;
int _v566A6;
byte _landerSuitNumber;
byte _desertStepsRemaining;
@@ -282,10 +288,10 @@ public:
int _desertWrongDirCtr;
byte _balloonAltitude;
int _scene1925CurrLevel; //_v56A9C
- int _v56A9E;
+ int _walkwaySceneNumber;
byte _v56AA0;
- byte _v56AA1;
- int _v56AA2;
+ byte _scientistConvIndex;
+ Common::Point _ventCellPos;
int _v56AA4;
byte _v56AA6;
byte _v56AA7;
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_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 013abfa4a4..b86b8283ed 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:
@@ -118,6 +116,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:
@@ -162,10 +161,13 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
// Spill Mountains Elevator Exit
return new Scene1900();
case 1925:
+ // 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 */
//
@@ -215,13 +217,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
@@ -262,18 +264,19 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
// Room with large stasis field negator
return new Scene3250();
case 3255:
+ // Guard Post
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
return new Scene3350();
case 3375:
- // Outer walkway
+ // Circular Walkway
return new Scene3375();
case 3385:
// Corridor
@@ -297,6 +300,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
// Desert
return new Scene3800();
case 3900:
+ // Forest Entrance
return new Scene3900();
default:
error("Unknown scene number - %d", sceneNumber);
@@ -375,6 +379,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) {
@@ -777,116 +785,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() {
@@ -1060,7 +1067,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);
}
@@ -1109,19 +1116,31 @@ 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();
}
+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(100);
}
@@ -1298,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
@@ -1344,10 +1363,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;
@@ -1355,7 +1377,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);
@@ -1395,20 +1417,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;
@@ -1491,7 +1516,7 @@ MazeUI::~MazeUI() {
}
void MazeUI::synchronize(Serializer &s) {
- SavedObject::synchronize(s);
+ SceneObject::synchronize(s);
s.syncAsSint16LE(_resNum);
if (s.isLoading())
@@ -1503,7 +1528,6 @@ void MazeUI::synchronize(Serializer &s) {
}
void MazeUI::load(int resNum) {
- postInit();
clear();
_resNum = resNum;
@@ -2073,7 +2097,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) {
@@ -2119,19 +2143,19 @@ 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);
}
/*--------------------------------------------------------------------------*/
ModalWindow::ModalWindow() {
- _field20 = 0;
+ _insetCount = 0;
}
void ModalWindow::remove() {
@@ -2146,11 +2170,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();
@@ -2182,7 +2206,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 c7e36fc5f0..aeac2fdd6a 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();
@@ -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);
@@ -441,7 +442,7 @@ public:
class AnimationPlayerExt: public AnimationPlayer {
public:
- int _v;
+ bool _isActive;
public:
AnimationPlayerExt();
@@ -451,7 +452,7 @@ public:
class ModalWindow: public SceneArea {
public:
SceneActor _object1;
- byte _field20;
+ int _insetCount;
public:
ModalWindow();
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index 40e17b6ed9..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();
@@ -2805,12 +2810,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 +2909,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 +2932,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 +2948,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 +3457,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 +4286,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;
@@ -5172,7 +5177,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;
@@ -5225,7 +5230,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 +5244,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 +5762,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 +5912,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 +5937,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 +5956,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_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h
index df0b4d8fc6..b735f7cc23 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;
@@ -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 {
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 0941f09677..29bef2ccb2 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)
@@ -462,7 +462,7 @@ void Scene1000::dispatch() {
_animationPlayer.remove();
if (_sceneMode == 52)
- _endHandler = this;
+ _animationPlayer._endAction = this;
} else {
_animationPlayer.dispatch();
}
@@ -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;
@@ -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;
@@ -1526,15 +1520,16 @@ 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();
_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;
@@ -7877,7 +7870,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 +7948,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 +9004,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 +9026,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 +9085,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 +9242,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 +10396,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 +10421,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 +10434,7 @@ void Scene1700::enterArea() {
_westExit._enabled = true;
} else {
- R2_GLOBALS._walkRegions.enableRegion(1);
+ R2_GLOBALS._walkRegions.disableRegion(1);
_westExit._enabled = false;
}
@@ -10587,11 +10580,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 +10623,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 +10648,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 +10695,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 +10723,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;
@@ -11301,7 +11294,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;
@@ -11390,7 +11383,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 +11400,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 +11420,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 +11436,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) {
@@ -11497,7 +11490,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)) {
@@ -11586,7 +11579,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,14 +11589,14 @@ 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.
// 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);
@@ -11636,14 +11629,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 +11901,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 +12160,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 +12222,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,10 +12323,10 @@ 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_ARROW);
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
break;
case 1875:
R2_INVENTORY.setObjectScene(R2_AIRBAG, 1850);
@@ -12376,7 +12369,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:
@@ -12396,7 +12389,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 +12690,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 +12701,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);
@@ -12813,7 +12806,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 +12815,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);
@@ -12897,12 +12890,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);
@@ -12917,9 +12910,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 +12928,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)
@@ -12950,12 +12944,12 @@ bool Scene1925::Hotspot2::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);
@@ -13057,7 +13051,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);
}
@@ -13066,7 +13060,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);
}
@@ -13092,7 +13086,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 +13095,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;
@@ -13136,11 +13130,11 @@ 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);
- _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);
@@ -13148,7 +13142,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;
}
@@ -13237,24 +13231,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) {
@@ -13265,10 +13260,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:
@@ -13283,9 +13278,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:
@@ -13294,7 +13289,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)
@@ -13305,7 +13300,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;
@@ -13322,23 +13317,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);
@@ -13357,7 +13352,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;
@@ -13371,7 +13366,7 @@ void Scene1945::ExitUp::changeScene() {
}
}
-void Scene1945::Exit2::changeScene() {
+void Scene1945::CorridorExit::changeScene() {
Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene;
_moving = false;
@@ -13380,7 +13375,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;
@@ -13402,21 +13397,21 @@ 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);
- _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);
+ _corridorExit._enabled = false;
+ _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);
@@ -13427,7 +13422,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) {
@@ -13450,10 +13445,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);
}
@@ -13466,8 +13461,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;
@@ -13476,27 +13471,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;
@@ -13504,17 +13499,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;
@@ -13523,20 +13518,20 @@ void Scene1945::signal() {
return;
case 1948:
R2_GLOBALS._sound1.play(220);
- _exit2._enabled = true;
- R2_GLOBALS._sceneItems.remove(&_actor3);
+ _corridorExit._enabled = true;
+ R2_GLOBALS._sceneItems.remove(&_gunpowder);
R2_GLOBALS.clearFlag(42);
- R2_GLOBALS.clearFlag(43);
- _fieldEAA = 1940;
+ R2_GLOBALS.setFlag(43);
+ _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;
@@ -13549,114 +13544,93 @@ void Scene1945::signal() {
}
/*--------------------------------------------------------------------------
- * Scene 1950 -
+ * Scene 1950 - Flup Tube Corridor Maze
*
*--------------------------------------------------------------------------*/
-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);
-}
-
-Scene1950::Scene1950() {
- _field412 = 0;
- _field414 = 0;
- _field416 = 0;
- _field418 = Common::Point(0, 0);
- _field41C = 0;
+ s.syncAsSint16LE(_buttonIndex);
}
-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(_field41C);
-}
-
-Scene1950::Area1::Actor10::Actor10() {
- _fieldA4 = 0;
- _fieldA6 = 0;
- _fieldA8 = 0;
+Scene1950::KeypadWindow::KeypadButton::KeypadButton() {
+ _buttonIndex = 0;
+ _pressed = false;
+ _toggled = false;
}
-void Scene1950::Area1::Actor10::synchronize(Serializer &s) {
+void Scene1950::KeypadWindow::KeypadButton::synchronize(Serializer &s) {
SceneActor::synchronize(s);
- s.syncAsSint16LE(_fieldA4);
- s.syncAsSint16LE(_fieldA6);
- s.syncAsSint16LE(_fieldA8);
+ s.syncAsSint16LE(_buttonIndex);
+ s.syncAsSint16LE(_pressed);
+ s.syncAsSint16LE(_toggled);
}
-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;
- _fieldA6 = 0;
- _fieldA8 = 0;
+ _buttonIndex = indx;
+ _pressed = false;
+ _toggled = false;
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) {
- if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos)) && (_fieldA6 == 0)) {
+void Scene1950::KeypadWindow::KeypadButton::process(Event &event) {
+ 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(_fieldA4);
+ scene->doButtonPress(_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
- 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);
- R2_GLOBALS._player.disableControl(CURSOR_ARROW);
- scene->_exit3._enabled = true;
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ scene->_eastExit._enabled = true;
if (!R2_GLOBALS.getFlag(37)) {
if (R2_GLOBALS.getFlag(36)) {
@@ -13669,62 +13643,31 @@ 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();
- _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;
- //
+ ModalWindow::proc12(visage, stripFrameNum, frameNum, posX, posY);
- _areaActor.fixPriority(248);
- scene->_exit3._enabled = false;
+ _object1.fixPriority(248);
+ 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);
@@ -13741,7 +13684,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);
@@ -13750,11 +13693,11 @@ 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;
}
-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);
@@ -13767,7 +13710,7 @@ bool Scene1950::Actor3::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);
@@ -13780,69 +13723,70 @@ bool Scene1950::Actor5::startAction(CursorType action, Event &event) {
return true;
}
-Scene1950::Actor8::Actor8() {
- _fieldA4 = 0;
- _fieldA6 = 0;
+/*--------------------------------------------------------------------------*/
+
+Scene1950::Vampire::Vampire() {
_fieldA8 = 0;
_fieldAA = 0;
- _fieldAC = 0;
+ _vampireMode = 0;
_fieldAE = 0;
_fieldAF = 0;
}
-void Scene1950::Actor8::synchronize(Serializer &s) {
+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);
}
-void Scene1950::Actor8::signal() {
+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._v566A5 == 3)
+ if (R2_GLOBALS._flubMazeEntryDirection == 3)
setStrip(2);
else
setStrip(1);
NpcMover *mover = new NpcMover();
- R2_GLOBALS._player.addMover(mover, &scene->_field418, this);
+ addMover(mover, &scene->_field418, scene);
}
break;
case 20: {
- _fieldAC = 19;
+ // Non fatal shot
+ _vampireMode = 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._vampireData[scene->_vampireIndex - 1]._shotsRequired--;
- if (R2_GLOBALS._v566A5 == 3)
- _fieldA4 = _position.x + 10;
+ if (R2_GLOBALS._flubMazeEntryDirection == 3)
+ _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._v566A5 == 3)
+ if (R2_GLOBALS._flubMazeEntryDirection == 3)
setStrip(2);
else
setStrip(1);
animate(ANIM_MODE_2, NULL);
- Common::Point pt(_fieldA4, _fieldA6);
+ Common::Point pt = _deadPosition;
PlayerMover *mover = new PlayerMover();
addMover(mover, &pt, this);
@@ -13850,15 +13794,16 @@ void Scene1950::Actor8::signal() {
}
break;
case 21:
+ // Fatal shot
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);
@@ -13868,47 +13813,47 @@ 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._vampireData[scene->_vampireIndex - 1]._isAlive = false;
+ 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;
_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);
} else {
- R2_GLOBALS._player.enableControl(CURSOR_ARROW);
+ 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;
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);
- scene->_sceneMode = R2_GLOBALS._v566A5;
+ scene->_sceneMode = R2_GLOBALS._flubMazeEntryDirection;
scene->setAction(&scene->_sequenceManager, scene, 1960, &R2_GLOBALS._player, NULL);
break;
default:
@@ -13916,21 +13861,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._vampireData[scene->_vampireIndex - 1]._isAlive ||
+ (action != R2_PHOTON_STUNNER))
return SceneActor::startAction(action, event);
R2_GLOBALS._player.disableControl();
- if (R2_GLOBALS._v56613[((scene->_field41C - 1) * 4) + 1] <= 1)
- _fieldAC = 21;
+ if (R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._shotsRequired <= 1)
+ _vampireMode = 21;
else
- _fieldAC = 20;
+ _vampireMode = 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);
@@ -13940,12 +13886,14 @@ 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_ARROW);
- R2_GLOBALS._v566A5 = 1;
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ R2_GLOBALS._flubMazeEntryDirection = 1;
scene->_sceneMode = 11;
Common::Point pt(160, 127);
@@ -13953,12 +13901,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_ARROW);
- R2_GLOBALS._v566A5 = 2;
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ R2_GLOBALS._flubMazeEntryDirection = 2;
scene->_sceneMode = 12;
if (scene->_field412 == 0) {
@@ -13974,12 +13922,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_ARROW);
- R2_GLOBALS._v566A5 = 3;
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ R2_GLOBALS._flubMazeEntryDirection = 3;
scene->_sceneMode = 13;
if (scene->_field416 != 0)
@@ -13990,12 +13938,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_ARROW);
- R2_GLOBALS._v566A5 = 4;
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ R2_GLOBALS._flubMazeEntryDirection = 4;
scene->_sceneMode = 14;
if (R2_GLOBALS.getFlag(36))
@@ -14004,12 +13952,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_ARROW);
- R2_GLOBALS._v566A5 = 5;
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ R2_GLOBALS._flubMazeEntryDirection = 5;
scene->_sceneMode = 15;
Common::Point pt(160, 213);
@@ -14017,13 +13965,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_ARROW);
- R2_GLOBALS._v566A5 = 5;
- if (R2_GLOBALS._v566A4 == 2) {
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ 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);
@@ -14050,28 +14000,28 @@ void Scene1950::Exit6::changeScene() {
}
}
-void Scene1950::Exit7::changeScene() {
+void Scene1950::ShaftExit::changeScene() {
Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene;
_enabled = false;
- R2_GLOBALS._player.disableControl(CURSOR_ARROW);
- R2_GLOBALS._v566A5 = 0;
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ R2_GLOBALS._flubMazeEntryDirection = 0;
scene->_sceneMode = 1951;
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;
- R2_GLOBALS._player.disableControl(CURSOR_ARROW);
- R2_GLOBALS._v566A5 = 3;
+ R2_GLOBALS._player.disableControl(CURSOR_WALK);
+ 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();
@@ -14080,33 +14030,55 @@ void Scene1950::Exit8::changeScene() {
}
}
-void Scene1950::subBDC1E() {
- _exit1._enabled = false;
- _exit2._enabled = false;
- _exit3._enabled = false;
- _exit4._enabled = false;
- _exit5._enabled = false;
- _exit6._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;
- _exit7._insideArea = false;
- _exit8._insideArea = false;
- _exit1._moving = false;
- _exit2._moving = false;
- _exit3._moving = false;
- _exit4._moving = false;
- _exit5._moving = false;
- _exit6._moving = false;
- _exit7._moving = false;
- _exit8._moving = false;
+/*--------------------------------------------------------------------------*/
+
+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;
+ _eastExit._enabled = false;
+ _downExit._enabled = false;
+ _southExit._enabled = false;
+ _westExit._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;
+ _shaftExit._insideArea = false;
+ _doorExit._insideArea = false;
+ _northExit._moving = false;
+ _upExit._moving = false;
+ _eastExit._moving = false;
+ _downExit._moving = false;
+ _southExit._moving = false;
+ _westExit._moving = false;
+ _shaftExit._moving = false;
+ _doorExit._moving = false;
_field412 = 0;
- switch (R2_GLOBALS._v566A4 - 1) {
+
+ switch (R2_GLOBALS._flubMazeArea - 1) {
case 0:
loadScene(1948);
break;
@@ -14337,19 +14309,19 @@ void Scene1950::subBDC1E() {
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;
+ _shaftExit._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);
+ _doorExit._enabled = true;
+ 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
@@ -14414,8 +14386,8 @@ void Scene1950::subBDC1E() {
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
@@ -14466,9 +14438,9 @@ void Scene1950::subBDC1E() {
case 100:
// No break on purpose
case 104:
- _exit6._enabled = true;
- R2_GLOBALS._walkRegions.enableRegion(6);
- R2_GLOBALS._walkRegions.enableRegion(9);
+ _westExit._enabled = true;
+ R2_GLOBALS._walkRegions.disableRegion(6);
+ R2_GLOBALS._walkRegions.disableRegion(9);
break;
case 5:
// No break on purpose
@@ -14517,25 +14489,25 @@ void Scene1950::subBDC1E() {
case 99:
// No break on purpose
case 101:
- _exit3._enabled = true;
- R2_GLOBALS._walkRegions.enableRegion(1);
- R2_GLOBALS._walkRegions.enableRegion(7);
- R2_GLOBALS._walkRegions.enableRegion(13);
+ _eastExit._enabled = true;
+ 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;
}
- _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:
@@ -14573,17 +14545,17 @@ void Scene1950::subBDC1E() {
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);
- R2_GLOBALS._walkRegions.enableRegion(3);
- R2_GLOBALS._walkRegions.enableRegion(4);
+ _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;
case 7:
// No break on purpose
@@ -14622,44 +14594,45 @@ void Scene1950::subBDC1E() {
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);
- R2_GLOBALS._walkRegions.enableRegion(3);
- R2_GLOBALS._walkRegions.enableRegion(4);
+ _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:
@@ -14703,7 +14676,8 @@ void Scene1950::subBDC1E() {
case 60:
// No break on purpose
case 63:
- _exit2._enabled = true;
+ _upExit._enabled = true;
+ break;
case 54:
// No break on purpose
case 61:
@@ -14711,7 +14685,7 @@ void Scene1950::subBDC1E() {
case 62:
// No break on purpose
case 65:
- _exit2._enabled = true;
+ _upExit._enabled = true;
// No break on purpose
case 35:
// No break on purpose
@@ -14756,136 +14730,141 @@ void Scene1950::subBDC1E() {
case 98:
// 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);
+ _downExit._enabled = true;
+ 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;
}
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();
- _actor3.remove();
+ _vampire.remove();
+ _door.remove();
+ _scrolls.remove();
_field416 = 0;
- _field41C = 0;
+ _vampireIndex = 0;
- switch (R2_GLOBALS._v566A4) {
+ // Certain areas have a vampire in them
+ 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._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);
+ _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);
+ // Start the vampire
+ _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)) {
- _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);
+ 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);
+ _door.setPosition(Common::Point(278, 155));
+ _door.fixPriority(100);
+ _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.enableRegion(1);
- R2_GLOBALS._walkRegions.enableRegion(5);
- R2_GLOBALS._walkRegions.enableRegion(6);
- R2_GLOBALS._walkRegions.enableRegion(7);
-
- _actor6.postInit();
- _actor6.setVisage(1970);
- _actor6.setStrip(1);
+ R2_GLOBALS._walkRegions.disableRegion(1);
+ R2_GLOBALS._walkRegions.disableRegion(5);
+ R2_GLOBALS._walkRegions.disableRegion(6);
+ R2_GLOBALS._walkRegions.disableRegion(7);
+
+ _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);
@@ -14895,67 +14874,68 @@ void Scene1950::subBE59B() {
_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();
- _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 {
- _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);
-
- _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);
+ _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);
+
+ _gem.setPosition(Common::Point(192, 109));
+ _gem.setDetails(1950, 9, 7, 8, 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();
- _actor5.remove();
+ _cube.remove();
+ _containmentField.remove();
+ _gem.remove();
_actor7.remove();
- _actor3.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._v566A5) {
+ switch (R2_GLOBALS._flubMazeEntryDirection) {
case 0:
_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);
}
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();
@@ -14963,30 +14943,31 @@ void Scene1950::subBE59B() {
}
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);
@@ -14995,7 +14976,7 @@ void Scene1950::subBE59B() {
}
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);
@@ -15009,7 +14990,7 @@ void Scene1950::subBE59B() {
}
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();
@@ -15017,9 +14998,10 @@ void Scene1950::subBE59B() {
}
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));
@@ -15029,16 +15011,16 @@ void Scene1950::subBE59B() {
}
} 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);
@@ -15051,65 +15033,74 @@ void Scene1950::subBE59B() {
}
}
-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 (_area1._arrActor1[si]._fieldA8 == 0) {
- _area1._arrActor1[si].setFrame(2);
- _area1._arrActor1[si]._fieldA8 = 1;
+ int prevIndex = indx - 1;
+ if ((indx / 4) == (prevIndex / 4)) {
+ if (prevIndex < 0)
+ prevIndex = 3;
} else {
- _area1._arrActor1[si].setFrame(1);
- _area1._arrActor1[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;
+ }
+
+ prevIndex = indx + 1;
+ if ((indx / 4) == (prevIndex / 4)) {
+ if (prevIndex > 15)
+ prevIndex = 12;
+ } else {
+ prevIndex -= 4;
+ }
- if (_area1._arrActor1[si]._fieldA8 == 0) {
- _area1._arrActor1[si].setFrame(2);
- _area1._arrActor1[si]._fieldA8 = 1;
+ assert(prevIndex >= 0 && prevIndex < 16);
+ if (!_KeypadWindow._buttons[prevIndex]._toggled) {
+ _KeypadWindow._buttons[prevIndex].setFrame(2);
+ _KeypadWindow._buttons[prevIndex]._toggled = true;
} else {
- _area1._arrActor1[si].setFrame(1);
- _area1._arrActor1[si]._fieldA8 = 0;
+ _KeypadWindow._buttons[prevIndex].setFrame(1);
+ _KeypadWindow._buttons[prevIndex]._toggled = false;
}
- si = indx - 4;
- if (si < 0)
- si += 16;
+ prevIndex = indx - 4;
+ if (prevIndex < 0)
+ prevIndex += 16;
- if (_area1._arrActor1[si]._fieldA8 == 0) {
- _area1._arrActor1[si].setFrame(2);
- _area1._arrActor1[si]._fieldA8 = 1;
+ assert(prevIndex >= 0 && prevIndex < 16);
+ if (!_KeypadWindow._buttons[prevIndex]._toggled) {
+ _KeypadWindow._buttons[prevIndex].setFrame(2);
+ _KeypadWindow._buttons[prevIndex]._toggled = true;
} else {
- _area1._arrActor1[si].setFrame(1);
- _area1._arrActor1[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 (_area1._arrActor1[si]._fieldA8 == 0) {
- _area1._arrActor1[si].setFrame(2);
- _area1._arrActor1[si]._fieldA8 = 1;
+ assert(prevIndex >= 0 && prevIndex < 16);
+ if (!_KeypadWindow._buttons[prevIndex]._toggled) {
+ _KeypadWindow._buttons[prevIndex].setFrame(2);
+ _KeypadWindow._buttons[prevIndex]._toggled = true;
} else {
- _area1._arrActor1[si].setFrame(1);
- _area1._arrActor1[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 (_area1._arrActor1[si]._fieldA8 != 0)
+ for (prevIndex = 0; prevIndex < 16; prevIndex++) {
+ if (_KeypadWindow._buttons[prevIndex]._toggled)
++cpt;
}
@@ -15119,9 +15110,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);
}
}
@@ -15129,37 +15118,37 @@ 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;
- subBDC1E();
+ 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));
+ _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)
@@ -15169,9 +15158,9 @@ 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);
- subBE59B();
+ enterArea();
}
void Scene1950::remove() {
@@ -15183,45 +15172,50 @@ void Scene1950::remove() {
void Scene1950::signal() {
switch (_sceneMode) {
case 11:
- R2_GLOBALS._v566A4 += 7;
- subBDC1E();
- subBE59B();
+ R2_GLOBALS._flubMazeArea += 7;
+ initArea();
+ enterArea();
break;
case 12:
- R2_GLOBALS._v566A4 += 35;
- subBDC1E();
- subBE59B();
+ // 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;
- subBDC1E();
- subBE59B();
+ // Moving east within the Flub maze
+ ++R2_GLOBALS._flubMazeArea;
+ initArea();
+ enterArea();
break;
case 14:
- R2_GLOBALS._v566A4 += 221;
- subBDC1E();
- subBE59B();
+ // Moving down a ladder within the Flub maze
+ R2_GLOBALS._flubMazeArea -= 35;
+ initArea();
+ enterArea();
break;
case 15:
- R2_GLOBALS._v566A4 += 249;
- subBDC1E();
- subBE59B();
+ R2_GLOBALS._flubMazeArea -= 7;
+ initArea();
+ enterArea();
break;
case 16:
+ // Moving west within the Flub maze
// No break on purpose
case 1961:
- --R2_GLOBALS._v566A4;
- subBDC1E();
- subBE59B();
+ --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_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);
@@ -15230,14 +15224,14 @@ 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_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);
@@ -15246,14 +15240,14 @@ 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:
- _area1.remove();
+ _KeypadWindow.remove();
_sceneMode = 1966;
- _actor6.setFrame(3);
- setAction(&_sequenceManager, this, 1966, &_actor4, &_actor5, NULL);
+ _cube.setFrame(3);
+ setAction(&_sequenceManager, this, 1966, &_containmentField, &_gem, NULL);
break;
case 1951:
R2_GLOBALS._sound1.fadeOut2(NULL);
@@ -15262,31 +15256,31 @@ 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);
- _exit8._enabled = true;
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
+ _doorExit._enabled = true;
break;
case 1959:
R2_INVENTORY.setObjectScene(R2_SOAKED_FACEMASK, 0);
R2_GLOBALS._v56AAB = 0;
- R2_GLOBALS._player.enableControl(CURSOR_ARROW);
- _exit8._enabled = true;
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
+ _doorExit._enabled = true;
break;
case 1962:
// 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
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:
- _actor4.remove();
+ _containmentField.remove();
if (R2_GLOBALS.getFlag(36)) {
_sceneMode = 1964;
setAction(&_sequenceManager, this, 1964, &R2_GLOBALS._player, NULL);
@@ -15294,11 +15288,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
@@ -15311,9 +15306,9 @@ void Scene1950::signal() {
}
break;
case 1968:
- R2_GLOBALS._player.disableControl();
+ R2_GLOBALS._player.enableControl();
R2_INVENTORY.setObjectScene(R2_ANCIENT_SCROLLS, 2);
- _actor3.setFrame(2);
+ _scrolls.setFrame(2);
if (R2_GLOBALS.getFlag(36))
R2_GLOBALS._player.setVisage(20);
else
@@ -15322,24 +15317,25 @@ 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;
- _exit8._enabled = false;
+ _shaftExit._enabled = false;
+ _doorExit._enabled = false;
_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 82895c7ab0..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;
@@ -1011,11 +1011,11 @@ public:
};
class Scene1925 : public SceneExt {
- class Hotspot2 : public NamedHotspot {
+ class Button : public NamedHotspot {
public:
virtual bool startAction(CursorType action, Event &event);
};
- class Hotspot3 : public NamedHotspot {
+ class Ladder : public NamedHotspot {
public:
virtual bool startAction(CursorType action, Event &event);
};
@@ -1038,8 +1038,8 @@ class Scene1925 : public SceneExt {
};
public:
NamedHotspot _item1;
- Hotspot2 _item2;
- Hotspot3 _item3;
+ Button _button;
+ 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);
};
@@ -1078,26 +1078,26 @@ class Scene1945 : public SceneExt {
public:
virtual void changeScene();
};
- class Exit2 : public SceneExit {
+ class CorridorExit : public SceneExit {
public:
virtual void changeScene();
};
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;
+ CorridorExit _corridorExit;
SequenceManager _sequenceManager1;
SequenceManager _sequenceManager2;
- int _fieldEAA;
- int _fieldEAC;
- CursorType _fieldEAE;
+ int _nextSceneMode1;
+ int _nextSceneMode2;
+ CursorType _lampUsed;
Scene1945();
void synchronize(Serializer &s);
@@ -1108,15 +1108,16 @@ public:
};
class Scene1950 : public SceneExt {
- class Area1: public SceneArea {
+ /* Windows */
+ class KeypadWindow: public ModalWindow {
public:
- class Actor10 : public SceneActor {
+ class KeypadButton : public SceneActor {
public:
- int _fieldA4;
- int _fieldA6;
- int _fieldA8;
+ int _buttonIndex;
+ bool _pressed;
+ bool _toggled;
- Actor10();
+ KeypadButton();
void synchronize(Serializer &s);
void init(int indx);
@@ -1125,30 +1126,29 @@ 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);
};
- class Actor2 : public SceneActor {
+ /* Actors */
+ class Door : public SceneActor {
public:
virtual bool startAction(CursorType action, Event &event);
};
- class Actor3 : public SceneActor {
+ class Scrolls : public SceneActor {
public:
virtual bool startAction(CursorType action, Event &event);
};
@@ -1156,94 +1156,95 @@ 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);
};
- class Actor8 : public SceneActor {
+ class Vampire : public SceneActor {
public:
- int _fieldA4;
- int _fieldA6;
+ Common::Point _deadPosition;
int _fieldA8;
int _fieldAA;
- int _fieldAC;
+ int _vampireMode;
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();
};
- class Exit7 : public SceneExit {
+ class ShaftExit : public SceneExit {
public:
virtual void changeScene();
};
- class Exit8 : public SceneExit {
+ class DoorExit : public SceneExit {
public:
virtual void changeScene();
};
+private:
+ void initArea();
+ void enterArea();
+ void doButtonPress(int indx);
public:
- NamedHotspot _item1;
- Hotspot2 _item2;
- SceneActor _actor1;
- BackgroundSceneObject _object1;
- Actor2 _actor2;
- Actor3 _actor3;
- SceneActor _actor4;
- Actor5 _actor5;
- SceneActor _actor6;
+ NamedHotspot _background;
+ Keypad _keypad;
+ SceneActor _southDoorway;
+ SceneObject _northDoorway;
+ Door _door;
+ Scrolls _scrolls;
+ SceneActor _containmentField;
+ Gem _gem;
+ SceneActor _cube;
SceneActor _actor7;
- Actor8 _actor8;
- Area1 _area1;
- Exit1 _exit1;
- Exit2 _exit2;
- Exit3 _exit3;
- Exit4 _exit4;
- Exit5 _exit5;
- Exit6 _exit6;
- Exit7 _exit7;
- Exit8 _exit8;
+ Vampire _vampire;
+ KeypadWindow _KeypadWindow;
+ NorthExit _northExit;
+ UpExit _upExit;
+ EastExit _eastExit;
+ DownExit _downExit;
+ SouthExit _southExit;
+ WestExit _westExit;
+ ShaftExit _shaftExit;
+ DoorExit _doorExit;
SequenceManager _sequenceManager;
int _field412;
int _field414;
int _field416;
Common::Point _field418;
- int _field41C;
+ int _vampireIndex;
Scene1950();
void synchronize(Serializer &s);
- void subBDC1E();
- void subBE59B();
- void subBF4B4(int indx);
virtual void postInit(SceneObjectList *OwnerList = NULL);
virtual void remove();
virtual void signal();
diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp
index 3eac2bffe1..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 {
@@ -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)
@@ -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 {
@@ -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);
}
@@ -1069,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);
@@ -1105,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 {
@@ -1115,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 {
@@ -1145,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;
@@ -1280,94 +1274,94 @@ 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) {
- R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS);
- R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS);
- return NamedHotspot::startAction(R2_STEPPING_DISKS, event);
+ } else if (action == R2_CURSOR_ROPE) {
+ R2_GLOBALS._events.setCursor(CURSOR_USE);
+ R2_GLOBALS._player.enableControl(CURSOR_USE);
+ return NamedHotspot::startAction(CURSOR_USE, event);
} else
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) {
- R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS);
- R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS);
- return NamedHotspot::startAction(R2_STEPPING_DISKS, event);
+ } else if (action == R2_CURSOR_ROPE) {
+ R2_GLOBALS._events.setCursor(CURSOR_USE);
+ R2_GLOBALS._player.enableControl(CURSOR_USE);
+ return NamedHotspot::startAction(CURSOR_USE, event);
} else
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(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) {
- R2_GLOBALS._events.setCursor(R2_GUNPOWDER);
+bool Scene2425::Rope::startAction(CursorType action, Event &event) {
+ if (action == CURSOR_USE) {
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER) {
+ 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(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);
}
}
@@ -1398,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 {
@@ -1407,39 +1401,39 @@ void Scene2425::postInit(SceneObjectList *OwnerList) {
}
if (R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) {
- _actor2.postInit();
- if (R2_GLOBALS._player._characterIndex == 1) {
- _actor2.setup(20, 5, 1);
- _actor2.setDetails(9002, 0, 4, 3, 1, (SceneItem *)NULL);
+ _pictographs1.postInit();
+ if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
+ _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 +1454,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 +1477,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);
@@ -1503,27 +1497,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,23 +1540,23 @@ 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();
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 {
@@ -1573,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 {
@@ -1581,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);
@@ -1618,12 +1612,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;
@@ -1663,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) {
@@ -1726,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);
@@ -1777,14 +1771,14 @@ 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);
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);
@@ -1803,13 +1797,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,17 +1829,17 @@ 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();
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 {
@@ -1855,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 {
@@ -1898,7 +1892,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:
@@ -1933,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);
@@ -1951,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);
@@ -1965,7 +1959,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();
@@ -2023,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);
@@ -2047,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);
@@ -2117,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 {
@@ -2223,18 +2217,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 +2236,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 +2271,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 +2307,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 +2379,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;
@@ -2436,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 {
@@ -2446,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 {
@@ -2507,6 +2500,7 @@ void Scene2500::signal() {
* Scene 2525 - Furnace room
*
*--------------------------------------------------------------------------*/
+
bool Scene2525::Item5::startAction(CursorType action, Event &event) {
Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene;
@@ -2520,16 +2514,16 @@ 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)
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);
+ 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 +2552,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();
@@ -2574,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 {
@@ -2584,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 {
@@ -2593,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);
@@ -2629,7 +2623,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,16 +2641,17 @@ void Scene2525::signal() {
* Scene 2530 - Spill Mountains: Well
*
*--------------------------------------------------------------------------*/
-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)
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);
+ 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);
}
@@ -2664,29 +2659,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);
}
}
@@ -2714,27 +2709,27 @@ 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);
- 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 {
@@ -2745,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 {
@@ -2753,13 +2748,13 @@ 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);
_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();
@@ -2782,7 +2777,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
@@ -2830,7 +2826,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);
@@ -2876,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))) {
@@ -2896,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 {
@@ -2907,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 {
@@ -2915,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);
@@ -2945,13 +2941,13 @@ 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;
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();
@@ -3022,11 +3018,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 +3045,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 +3181,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 +3465,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 +3499,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 +3535,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 +3584,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 +3704,10 @@ void Scene2700::process(Event &event) {
}
/*--------------------------------------------------------------------------
- * Scene 2750 - Forest Maze
+ * Scene 2750 - Inner Forest
*
*--------------------------------------------------------------------------*/
+
Scene2750::Scene2750(): SceneExt() {
_field412 = _field414 = _field416 = 0;
}
@@ -3929,11 +3931,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 +3943,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 +3961,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 +4096,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 +4161,10 @@ void Scene2750::process(Event &event) {
}
/*--------------------------------------------------------------------------
- * Scene 2800 - Exiting forest
+ * Scene 2800 - Guard post
*
*--------------------------------------------------------------------------*/
+
Scene2800::Scene2800(): SceneExt() {
_field412 = 0;
}
@@ -4172,7 +4175,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))) {
@@ -4184,12 +4187,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 +4203,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 +4274,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 +4359,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 +4374,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 +4443,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);
@@ -4462,7 +4465,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);
@@ -4480,7 +4483,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 +4494,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 +4502,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);
@@ -4508,7 +4512,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);
@@ -4525,7 +4529,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..f90126b5a1 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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -626,12 +627,12 @@ public:
};
class Scene2800 : public SceneExt {
- class Item2 : public NamedHotspot {
+ class Outpost : public NamedHotspot {
public:
virtual bool startAction(CursorType action, Event &event);
};
- class Actor1 : public SceneActor {
+ class Guard : public SceneActor {
virtual bool startAction(CursorType action, Event &event);
};
@@ -651,8 +652,8 @@ public:
SpeakerNej2800 _nejSpeaker;
SpeakerGuard2800 _guardSpeaker;
NamedHotspot _item1;
- Item2 _item2;
- Actor1 _actor1;
+ Outpost _outpost;
+ 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..c64665a839 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;
}
}
@@ -205,6 +206,7 @@ void Scene3100::dispatch() {
* Scene 3125 - Ghouls dormitory
*
*--------------------------------------------------------------------------*/
+
Scene3125::Scene3125() {
_field412 = 0;
}
@@ -215,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) {
@@ -239,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) {
@@ -262,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);
@@ -286,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)
@@ -294,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;
}
@@ -303,43 +307,43 @@ 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) {
+ if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 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);
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() {
@@ -362,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);
}
@@ -373,7 +377,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) {
@@ -383,16 +388,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);
}
@@ -403,39 +408,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) {
@@ -445,7 +453,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;
@@ -455,15 +463,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;
}
@@ -479,7 +487,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);
@@ -495,20 +503,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;
@@ -521,7 +529,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;
@@ -537,126 +545,126 @@ 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();
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.enableRegion(1);
- R2_GLOBALS._walkRegions.enableRegion(4);
- R2_GLOBALS._walkRegions.enableRegion(5);
- R2_GLOBALS._walkRegions.enableRegion(6);
- _actor4.setup(3152, 4, 10);
- _actor4.setDetails(3150, 14, -1, -1, 1, (SceneItem *)NULL);
+ R2_GLOBALS._walkRegions.disableRegion(1);
+ R2_GLOBALS._walkRegions.disableRegion(4);
+ R2_GLOBALS._walkRegions.disableRegion(5);
+ R2_GLOBALS._walkRegions.disableRegion(6);
+ _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);
-
- _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);
-
- switch (R2_GLOBALS._player._oldCharacterScene[3]) {
+ _toiletFlush.postInit();
+ _toiletFlush.setup(3152, 7, 6);
+ _toiletFlush.setPosition(Common::Point(98, 73));
+ _toiletFlush.setDetails(3150, 43, -1, -1, 1, (SceneItem *)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[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;
@@ -678,16 +686,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;
@@ -700,7 +708,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) {
}
}
- R2_GLOBALS._player._oldCharacterScene[3] = 3150;
+ R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3150;
}
void Scene3150::signal() {
@@ -712,20 +720,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;
@@ -734,20 +742,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:
@@ -761,13 +769,13 @@ 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._walkRegions.enableRegion(1);
- R2_GLOBALS._walkRegions.enableRegion(4);
- R2_GLOBALS._walkRegions.enableRegion(5);
- R2_GLOBALS._walkRegions.enableRegion(6);
+ 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);
+ R2_GLOBALS._walkRegions.disableRegion(6);
R2_GLOBALS.setFlag(78);
R2_GLOBALS._player.enableControl();
break;
@@ -778,14 +786,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();
@@ -795,6 +803,7 @@ void Scene3150::dispatch() {
* Scene 3175 - Autopsy room
*
*--------------------------------------------------------------------------*/
+
bool Scene3175::Item1::startAction(CursorType action, Event &event) {
Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene;
@@ -824,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) {
@@ -853,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:
@@ -881,37 +890,37 @@ 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();
- 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));
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;
+ R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3175;
}
void Scene3175::signal() {
@@ -1032,6 +1041,7 @@ void Scene3230::signal() {
* Scene 3240 - Cutscene : Teal monolog
*
*--------------------------------------------------------------------------*/
+
void Scene3240::postInit(SceneObjectList *OwnerList) {
loadScene(3240);
R2_GLOBALS._uiElements._active = false;
@@ -1059,6 +1069,7 @@ void Scene3240::signal() {
* Scene 3245 - Cutscene : Discussions with Dr. Tomko
*
*--------------------------------------------------------------------------*/
+
void Scene3245::postInit(SceneObjectList *OwnerList) {
loadScene(3245);
R2_GLOBALS._uiElements._active = false;
@@ -1074,14 +1085,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);
}
}
@@ -1093,6 +1104,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;
@@ -1122,7 +1134,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)
@@ -1133,15 +1145,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;
@@ -1153,37 +1165,37 @@ 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;
}
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();
- switch (R2_GLOBALS._player._oldCharacterScene[3]) {
+ switch (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA]) {
case 1200:
_sceneMode = 3250;
_actor4.postInit();
@@ -1193,25 +1205,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);
@@ -1221,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() {
@@ -1257,9 +1270,10 @@ void Scene3250::dispatch() {
}
/*--------------------------------------------------------------------------
- * Scene 3255 -
+ * Scene 3255 - Guard Post
*
*--------------------------------------------------------------------------*/
+
void Scene3255::postInit(SceneObjectList *OwnerList) {
loadScene(3255);
SceneExt::postInit();
@@ -1278,30 +1292,31 @@ 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);
}
- R2_GLOBALS._player._oldCharacterScene[3] = 3255;
+ R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] = 3255;
}
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);
@@ -1323,40 +1338,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();
}
@@ -1365,7 +1380,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)
@@ -1373,11 +1389,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)
@@ -1385,7 +1401,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;
}
@@ -1402,53 +1418,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);
@@ -1468,37 +1484,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) {
+ if (R2_GLOBALS._player._oldCharacterScene[R2_MIRANDA] == 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);
@@ -1506,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() {
@@ -1521,15 +1537,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:
@@ -1542,7 +1558,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)
@@ -1550,11 +1567,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;
@@ -1573,33 +1590,31 @@ 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();
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);
@@ -1608,9 +1623,9 @@ 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, &_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);
@@ -1618,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() {
@@ -1639,10 +1654,12 @@ void Scene3275::signal() {
* Scene 3350 - Cutscene - Ship landing
*
*--------------------------------------------------------------------------*/
+
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);
@@ -1699,14 +1716,9 @@ void Scene3350::signal() {
}
/*--------------------------------------------------------------------------
- * Scene 3375 -
+ * 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);
@@ -1714,94 +1726,94 @@ void Scene3375::synchronize(Serializer &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));
- _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;
- 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);
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;
- 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);
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;
}
- 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(&_item1);
+ 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);
- _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);
+ _door.hide();
+ R2_GLOBALS._sceneItems.remove(&_door);
}
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)
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);
@@ -1809,14 +1821,14 @@ 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)
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);
@@ -1824,7 +1836,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)
@@ -1836,57 +1848,58 @@ bool Scene3375::Actor3::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) {
- R2_GLOBALS._walkRegions.disableRegion(2);
- R2_GLOBALS._walkRegions.disableRegion(3);
+ if (R2_GLOBALS._walkwaySceneNumber != 0) {
+ 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);
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->_door, NULL);
return true;
}
-void Scene3375::Exit1::changeScene() {
+void Scene3375::LeftExit::changeScene() {
Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene;
_moving = false;
R2_GLOBALS._player.disableControl(CURSOR_ARROW);
scene->_sceneMode = 3376;
- if (R2_GLOBALS._v56A9E != 0) {
- R2_GLOBALS._walkRegions.disableRegion(2);
- R2_GLOBALS._walkRegions.disableRegion(3);
+ if (R2_GLOBALS._walkwaySceneNumber != 0) {
+ 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);
- 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);
+ if (scene->_companion1._position.y != 163) {
+ R2_GLOBALS._player.setStrip2(-1);
+ 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);
@@ -1895,7 +1908,7 @@ void Scene3375::Exit1::changeScene() {
}
}
-void Scene3375::Exit2::changeScene() {
+void Scene3375::DownExit::changeScene() {
Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene;
_moving = false;
@@ -1906,18 +1919,18 @@ void Scene3375::Exit2::changeScene() {
scene->_sceneMode = 3377;
scene->_field1488 = 3381;
- if (R2_GLOBALS._v56A9E != 0) {
- R2_GLOBALS._walkRegions.disableRegion(2);
- R2_GLOBALS._walkRegions.disableRegion(3);
+ if (R2_GLOBALS._walkwaySceneNumber != 0) {
+ 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);
+ 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;
@@ -1928,24 +1941,28 @@ void Scene3375::Exit3::changeScene() {
scene->_sceneMode = 3378;
scene->_field1488 = 3380;
- if (R2_GLOBALS._v56A9E != 0) {
- R2_GLOBALS._walkRegions.disableRegion(2);
- R2_GLOBALS._walkRegions.disableRegion(3);
+ if (R2_GLOBALS._walkwaySceneNumber != 0) {
+ 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);
+ 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);
@@ -1959,12 +1976,12 @@ 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();
- 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);
@@ -1972,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
@@ -1995,16 +2012,16 @@ void Scene3375::postInit(SceneObjectList *OwnerList) {
R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
R2_GLOBALS._player.disableControl();
- _actor1.postInit();
- if (R2_GLOBALS._player._characterIndex == 2) {
- _actor1._moveRate = 10;
- _actor1._moveDiff = Common::Point(3, 2);
+ _companion1.postInit();
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER) {
+ _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)
@@ -2012,72 +2029,72 @@ 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;
- _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
tmpStrip = 8;
- if (R2_GLOBALS._player._characterIndex == 3)
+ if (R2_GLOBALS._player._characterIndex == R2_MIRANDA)
tmpVisage = 10;
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);
- _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();
- _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;
else
_sceneMode = 0;
- subFC696(_sceneMode);
+ enterArea(_sceneMode);
}
void Scene3375::remove() {
@@ -2086,44 +2103,61 @@ void Scene3375::remove() {
}
void Scene3375::signalCase3379() {
- switch (R2_GLOBALS._v56A9E) {
+ switch (R2_GLOBALS._walkwaySceneNumber) {
case 0:
- _exit1._enabled = true;
- if (R2_GLOBALS._sceneManager._previousScene == 3385)
- R2_GLOBALS._walkRegions.enableRegion(1);
- else {
- R2_GLOBALS._walkRegions.enableRegion(3);
- R2_GLOBALS._walkRegions.enableRegion(4);
+ _leftExit._enabled = true;
+ 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.enableRegion(6);
- R2_GLOBALS._walkRegions.enableRegion(7);
+ R2_GLOBALS._walkRegions.disableRegion(6);
+ R2_GLOBALS._walkRegions.disableRegion(7);
+ break;
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);
+ _leftExit._enabled = false;
+ 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);
+ break;
default:
- _exit1._enabled = false;
- R2_GLOBALS._walkRegions.enableRegion(2);
- R2_GLOBALS._walkRegions.enableRegion(3);
- R2_GLOBALS._walkRegions.enableRegion(5);
- R2_GLOBALS._walkRegions.enableRegion(6);
+ _leftExit._enabled = false;
+ 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;
R2_GLOBALS._player._effect = 1;
- _actor1._effect = 1;
- _actor2._effect = 1;
- _actor3._effect = 1;
- R2_GLOBALS._player.enableControl(CURSOR_ARROW);
+ _companion1._effect = 1;
+ _companion2._effect = 1;
+ _webbster._effect = 1;
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
}
void Scene3375::signal() {
switch (_sceneMode) {
+ case 1:
+ R2_GLOBALS._player.enableControl();
+ break;
case 3375:
R2_GLOBALS._sceneManager.changeScene(3400);
break;
@@ -2135,27 +2169,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;
- subFC696(_sceneMode);
+ _companion1._effect = 6;
+ _companion1._shade = 4;
+ _companion2._effect = 6;
+ _companion2._shade = 4;
+ _webbster._effect = 6;
+ _webbster._shade = 4;
+ enterArea(_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;
}
@@ -2167,28 +2201,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;
}
@@ -2199,14 +2234,14 @@ 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)
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);
@@ -2214,14 +2249,14 @@ 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)
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);
@@ -2229,7 +2264,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)
@@ -2241,7 +2276,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)
@@ -2252,7 +2287,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;
}
@@ -2264,7 +2301,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();
}
@@ -2294,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;
@@ -2304,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);
@@ -2321,74 +2360,74 @@ void Scene3385::postInit(SceneObjectList *OwnerList) {
R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
R2_GLOBALS._player.disableControl();
- _actor1.postInit();
- if (R2_GLOBALS._player._characterIndex == 2) {
- _actor1._moveRate = 10;
- _actor1._moveDiff = Common::Point(3, 2);
+ _companion1.postInit();
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER) {
+ _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;
- if (R2_GLOBALS._player._characterIndex == 2)
- _actor1.setup(10, _field11B2, 1);
+ _companion1.changeZoom(-1);
+ _companion1._effect = 1;
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ _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;
- if (R2_GLOBALS._player._characterIndex == 3)
- _actor2.setup(10, _field11B2, 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 == R2_MIRANDA)
+ _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);
- R2_GLOBALS._v56A9E = 0;
+ _background.setDetails(Rect(0, 0, 320, 200), 3385, 0, -1, -1, 1, NULL);
+ R2_GLOBALS._walkwaySceneNumber = 0;
}
void Scene3385::remove() {
@@ -2412,15 +2451,16 @@ void Scene3385::signal() {
R2_GLOBALS._player.enableControl(CURSOR_TALK);
break;
default:
- R2_GLOBALS._player.enableControl(CURSOR_ARROW);
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
break;
}
}
/*--------------------------------------------------------------------------
- * Scene 3395 -
+ * Scene 3395 - Walkway
*
*--------------------------------------------------------------------------*/
+
Scene3395::Scene3395() {
_field142E = 0;
}
@@ -2431,14 +2471,14 @@ 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)
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);
@@ -2446,14 +2486,14 @@ 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)
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);
@@ -2461,7 +2501,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)
@@ -2473,7 +2513,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)
@@ -2484,7 +2524,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;
}
@@ -2514,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;
@@ -2524,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);
@@ -2541,77 +2583,77 @@ void Scene3395::postInit(SceneObjectList *OwnerList) {
R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
R2_GLOBALS._player.disableControl();
- _actor1.postInit();
- if (R2_GLOBALS._player._characterIndex == 2) {
- _actor1._moveRate = 10;
- _actor1._moveDiff = Common::Point(3, 2);
+ _companion1.postInit();
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER) {
+ _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;
- if (R2_GLOBALS._player._characterIndex == 2)
- _actor1.setup(10, _field142E, 1);
+ _companion1.changeZoom(-1);
+ _companion1._effect = 1;
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ _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);
-
- _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);
+ _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);
+
+ _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.enableRegion(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() {
@@ -2632,15 +2674,16 @@ void Scene3395::signal() {
R2_GLOBALS._player.enableControl(CURSOR_TALK);
break;
default:
- R2_GLOBALS._player.enableControl(CURSOR_ARROW);
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
break;
}
}
/*--------------------------------------------------------------------------
- * Scene 3400 -
+ * Scene 3400 - Confrontation
*
*--------------------------------------------------------------------------*/
+
Scene3400::Scene3400() {
_field157C = 0;
}
@@ -2653,7 +2696,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);
@@ -2671,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);
@@ -2679,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);
@@ -2696,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));
- if (R2_GLOBALS._player._characterIndex == 2)
- _actor1.setup(10, 5, 1);
+ _companion1.changeZoom(-1);
+ _companion1._effect = 1;
+ _companion1.setPosition(Common::Point(247, 63));
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ _companion1.setup(10, 5, 1);
else
- _actor1.setup(20, 5, 1);
- _actor1.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));
- if (R2_GLOBALS._player._characterIndex == 3)
- _actor2.setup(10, 5, 1);
+ _companion1.setup(20, 5, 1);
+ _companion1.animate(ANIM_MODE_1, NULL);
+
+ _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 == R2_MIRANDA)
+ _companion2.setup(10, 5, 1);
else
- _actor2.setup(30, 5, 1);
- _actor2.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);
+ _companion2.setup(30, 5, 1);
+ _companion2.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);
@@ -2741,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() {
@@ -2755,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) {
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER) {
_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:
@@ -2794,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);
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ 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)
+ if (R2_GLOBALS._player._characterIndex == R2_MIRANDA)
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)
+ if (R2_GLOBALS._player._characterIndex == R2_QUINN)
setAction(&_sequenceManager, this, 3406, &R2_GLOBALS._player, &_actor7, NULL);
- else if (R2_GLOBALS._player._characterIndex == 2)
- setAction(&_sequenceManager, this, 3406, &_actor1, &_actor7, NULL);
- else if (R2_GLOBALS._player._characterIndex == 3)
- setAction(&_sequenceManager, this, 3406, &_actor2, &_actor7, NULL);
+ else if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ setAction(&_sequenceManager, this, 3406, &_companion1, &_actor7, NULL);
+ else if (R2_GLOBALS._player._characterIndex == R2_MIRANDA)
+ 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;
@@ -3574,12 +3618,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;
@@ -4183,15 +4229,16 @@ void Scene3500::dispatch() {
}
/*--------------------------------------------------------------------------
- * Scene 3600 -
+ * Scene 3600 - Cutscene - walking at gunpoint
*
*--------------------------------------------------------------------------*/
+
Scene3600::Scene3600() {
_field2548 = 0;
_field254A = 0;
_field254C = 0;
_field254E = 0;
- _field2550 = false;
+ _ghoulTeleported = false;
}
void Scene3600::synchronize(Serializer &s) {
SceneExt::synchronize(s);
@@ -4200,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() {
@@ -4230,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;
@@ -4259,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:
@@ -4282,8 +4329,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;
@@ -4292,9 +4339,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);
@@ -4302,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;
@@ -4334,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);
@@ -4360,7 +4408,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);
}
@@ -4379,7 +4427,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);
@@ -4438,11 +4486,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);
@@ -4453,7 +4501,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));
@@ -4461,7 +4509,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));
@@ -4486,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);
@@ -4511,13 +4559,13 @@ 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;
- 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));
@@ -4530,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);
@@ -4548,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);
@@ -4566,15 +4613,15 @@ void Scene3600::remove() {
void Scene3600::signal() {
switch (_sceneMode) {
case 3320:
- warning("STUB: sub_1D227()");
- R2_GLOBALS._walkRegions.enableRegion(14);
+ // TODO: warning("STUB: sub_1D227()");
+ R2_GLOBALS._walkRegions.disableRegion(14);
R2_GLOBALS._scrollFollower = &_actor11;
_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;
@@ -4598,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)
@@ -4606,45 +4653,50 @@ 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.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);
- _actor13.setAction(&_action1);
+ 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);
+
+ _actor3.setAction(&_action1);
}
break;
case 3324:
// No break on purpose
case 3607:
g_globals->_events.setCursor(CURSOR_ARROW);
- R2_GLOBALS._player.enableControl(CURSOR_ARROW);
- _actor13.fixPriority(-1);
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
+ _protector.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:
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();
@@ -4660,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));
@@ -4681,12 +4733,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);
@@ -4712,8 +4764,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;
@@ -4722,8 +4774,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();
@@ -4734,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);
@@ -4757,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);
@@ -4766,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:
@@ -4788,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);
@@ -4813,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)
@@ -4825,8 +4880,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;
@@ -4838,10 +4893,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 {
@@ -4854,10 +4909,10 @@ 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) && !_ghoulTeleported) {
R2_GLOBALS._sound2.fadeOut2(NULL);
_sceneMode = 3620;
- _field2550 = 1;
+ _ghoulTeleported = true;
R2_GLOBALS._player.disableControl();
if (R2_GLOBALS._player._mover)
@@ -4871,6 +4926,7 @@ void Scene3600::dispatch() {
if (_actor4._mover)
_actor4.addMover(NULL);
}
+
Scene::dispatch();
}
@@ -4878,10 +4934,12 @@ void Scene3600::dispatch() {
* Scene 3700 - Cutscene - Teleport outside
*
*--------------------------------------------------------------------------*/
+
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);
@@ -4889,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() {
@@ -4927,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);
@@ -5188,7 +5247,7 @@ void Scene3800::enterArea() {
break;
}
default:
- R2_GLOBALS._player.enableControl(CURSOR_ARROW);
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
break;
}
break;
@@ -5344,7 +5403,7 @@ void Scene3800::process(Event &event) {
}
/*--------------------------------------------------------------------------
- * Scene 3900 -
+ * Scene 3900 - Forest Entrance
*
*--------------------------------------------------------------------------*/
@@ -5554,7 +5613,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 +5644,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..6c7a594b12 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;
@@ -68,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;
@@ -107,52 +105,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);
@@ -166,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);
@@ -268,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);
@@ -293,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;
@@ -310,10 +305,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);
};
@@ -322,22 +317,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;
@@ -358,23 +352,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);
@@ -401,52 +395,52 @@ 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 {
+ class Door : 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();
};
void signalCase3379();
- void subFC696(int sceneMode);
+ void enterArea(int sceneMode);
public:
SpeakerQuinn3375 _quinnSpeaker;
SpeakerSeeker3375 _seekerSpeaker;
SpeakerMiranda3375 _mirandaSpeaker;
SpeakerWebbster3375 _webbsterSpeaker;
- NamedHotspot _item1;
+ NamedHotspot _background;
NamedHotspot _itemArray[13];
- Actor1 _actor1;
- Actor2 _actor2;
- Actor3 _actor3;
- Actor4 _actor4;
- Exit1 _exit1;
- Exit2 _exit2;
- Exit3 _exit3;
+ Companion1 _companion1;
+ Companion2 _companion2;
+ Webbster _webbster;
+ Door _door;
+ LeftExit _leftExit;
+ DownExit _downExit;
+ RightExit _rightExit;
SequenceManager _sequenceManager;
int _field1488;
- int _field148A[4];
+ int _sceneAreas[4];
int _field1492;
Scene3375();
@@ -458,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);
};
@@ -486,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;
@@ -505,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);
};
@@ -528,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;
@@ -553,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;
@@ -710,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:
@@ -738,7 +732,7 @@ public:
SceneActor _actor10;
SceneActor _actor11;
SceneActor _actor12;
- Actor13 _actor13;
+ Protector _protector;
SequenceManager _sequenceManager1;
SequenceManager _sequenceManager2;
SequenceManager _sequenceManager3;
@@ -749,7 +743,7 @@ public:
int _field254A;
int _field254C;
int _field254E;
- bool _field2550;
+ bool _ghoulTeleported;
Scene3600();
virtual void postInit(SceneObjectList *OwnerList = NULL);
@@ -765,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 e908fb4412..3091086980 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);
@@ -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,10 +627,10 @@ 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->_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);
@@ -677,10 +677,10 @@ 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->_actor2;
+ _object2 = &scene->_companion2;
_object2->hide();
_object1.postInit();
@@ -726,10 +726,10 @@ 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->_actor2;
+ _object2 = &scene->_companion2;
_object2->hide();
_object1.postInit();
@@ -776,10 +776,10 @@ 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->_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();
@@ -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;
@@ -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();
@@ -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);
@@ -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);
@@ -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);
@@ -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;
@@ -1500,12 +1500,12 @@ 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)
- _object2 = &scene->_actor1;
+ else if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ _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);
@@ -1551,12 +1551,12 @@ 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)
- _object2 = &scene->_actor1;
+ else if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ _object2 = &scene->_companion1;
else
- _object2 = &scene->_actor2;
+ _object2 = &scene->_companion2;
_object2->hide();
_object1.postInit();
@@ -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,12 +1606,12 @@ 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)
- _object2 = &scene->_actor1;
+ else if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ _object2 = &scene->_companion1;
else
- _object2 = &scene->_actor2;
+ _object2 = &scene->_companion2;
_object2->hide();
_object1.postInit();
@@ -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,12 +1661,12 @@ 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)
- _object2 = &scene->_actor1;
+ else if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
+ _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();
@@ -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;
@@ -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();
@@ -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);
@@ -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();
@@ -2362,10 +2362,10 @@ 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->_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();
@@ -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;
@@ -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();
@@ -2637,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;
@@ -2714,7 +2750,7 @@ void SpeakerTeal3400::proc15() {
int v = _speakerMode;
if (!_object2) {
- _object2 = &scene->_actor4;
+ _object2 = &scene->_teal;
_object2->hide();
_object1.postInit();
_object1._numFrames = 7;
@@ -2731,8 +2767,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 +2778,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();
@@ -2889,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;
@@ -2918,7 +2995,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 +3003,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 +3039,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 +3083,7 @@ void SpeakerWebbster3395::proc15() {
int v = _speakerMode;
if (!_object2) {
- _object2 = &scene->_actor3;
+ _object2 = &scene->_webbster;
_object2->hide();
_object1.postInit();
_object1.setPosition(_object2->_position);
@@ -3050,7 +3127,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 +3148,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();
@@ -3091,7 +3168,7 @@ void SpeakerWebbster3400::proc15() {
//----------------------------------------------------------------------------
-SpeakerDutyOfficer::SpeakerDutyOfficer(): VisualSpeaker() {
+SpeakerDutyOfficer180::SpeakerDutyOfficer180(): VisualSpeaker() {
_speakerName = "DUTYOFFICER";
_color1 = 5;
_color2 = 0;
@@ -3103,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();
diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp
index 774a5277dc..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();
@@ -247,6 +252,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);
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;
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);
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index b6f372f377..8e0eb8a004 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 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 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);
+ a = r;
+ *pixels++ = format.ARGBToColor(a, r, g, b);
+ }
+ }
+
retSurface->putSurface(*convertedSurface, true);
convertedSurface->free();
surface->free();
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;
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;
}
diff --git a/engines/wintermute/graphics/transform_struct.cpp b/engines/wintermute/graphics/transform_struct.cpp
index 8edbf765b5..643c6b413f 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((int32)(zoomX / 100.0 * kDefaultZoomX),
+ (int32)(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..90a4c1f846 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 int32 kDefaultAngle = 0;
struct TransformStruct {
private:
@@ -48,13 +48,14 @@ 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();
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;
diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp
index cd200354f7..411ff1f477 100644
--- a/engines/wintermute/graphics/transparent_surface.cpp
+++ b/engines/wintermute/graphics/transparent_surface.cpp
@@ -31,9 +31,249 @@
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) {
+ 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) {
+ //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) {
+ 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 +346,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 +400,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 +420,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<class Blender>
+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++) {
+
+ byte *outa = &out[TransparentSurface::kAIndex];
+ byte *outr = &out[TransparentSurface::kRIndex];
+ byte *outg = &out[TransparentSurface::kGIndex];
+ byte *outb = &out[TransparentSurface::kBIndex];
- 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;
+ 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 +532,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 +563,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 +623,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<BlenderAdditive>(ino, outo, img->w, img->h, target.pitch, inStep, inoStep, color);
+ } else if (blendMode == BLEND_SUBTRACTIVE) {
+ doBlit<BlenderSubtractive>(ino, outo, img->w, img->h, target.pitch, inStep, inoStep, color);
+ } else {
+ assert(blendMode == BLEND_NORMAL);
+ doBlit<BlenderNormal>(ino, outo, img->w, img->h, target.pitch, inStep, inoStep, color);
}
}
+
}
retSize.setWidth(img->w);
@@ -555,6 +700,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