diff options
author | Martin Kiewitz | 2010-08-05 07:49:19 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-08-05 07:49:19 +0000 |
commit | 1b6925765469de2e96bfa44f5b0c739309f982cf (patch) | |
tree | b9062519105e8164f4accbac739cc9d7543c3930 /engines | |
parent | 8e6d2eb5a37a0887ec569699118486cbf78ab5f5 (diff) | |
download | scummvm-rg350-1b6925765469de2e96bfa44f5b0c739309f982cf.tar.gz scummvm-rg350-1b6925765469de2e96bfa44f5b0c739309f982cf.tar.bz2 scummvm-rg350-1b6925765469de2e96bfa44f5b0c739309f982cf.zip |
SCI: changing hoyle 4 workaround
fixing hoyle 4 detection entry (not a demo)
adding direct selector fix, maybe we should replace this later with a script patch
adding detailed comment about the issue
svn-id: r51753
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/detection_tables.h | 2 | ||||
-rw-r--r-- | engines/sci/engine/selector.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/selector.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/ports.cpp | 35 |
4 files changed, 32 insertions, 8 deletions
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 9007e18eba..0614eff6e6 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -807,7 +807,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "2b577c975cc8d8d43f61b6a756129fe3", 4352}, {"resource.000", 0, "43e2c15ce436aab611a462ad0603e12d", 2000132}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, + Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, // Jones in the Fast Lane EGA - English DOS // SCI interpreter version 1.000.172 (not 100% sure FIXME) diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp index f5eb9eb73a..f99a41e088 100644 --- a/engines/sci/engine/selector.cpp +++ b/engines/sci/engine/selector.cpp @@ -164,6 +164,7 @@ void Kernel::mapSelectors() { FIND_SELECTOR(vanishingX); FIND_SELECTOR(vanishingY); FIND_SELECTOR(iconIndex); + FIND_SELECTOR(port); #ifdef ENABLE_SCI32 FIND_SELECTOR(data); diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h index 661290f58c..00e795c1b9 100644 --- a/engines/sci/engine/selector.h +++ b/engines/sci/engine/selector.h @@ -127,6 +127,8 @@ struct SelectorCache { // SCI1.1 Mac icon bar selectors Selector iconIndex; ///< Used to index icon bar objects + Selector port; // used by a hoyle 4 workaround + #ifdef ENABLE_SCI32 Selector data; // Used by Array()/String() Selector picture; // Used to hold the picture ID for SCI32 pictures diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index 0c97f5d29b..2e4eb85cb8 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -27,7 +27,9 @@ #include "sci/sci.h" #include "sci/engine/features.h" +#include "sci/engine/kernel.h" #include "sci/engine/state.h" +#include "sci/engine/selector.h" #include "sci/graphics/screen.h" #include "sci/graphics/paint16.h" #include "sci/graphics/animate.h" @@ -183,13 +185,8 @@ void GfxPorts::kernelSetActive(uint16 portId) { Port *newPort = getPortById(portId); if (newPort) setPort(newPort); - else { - if (g_sci->getGameId() == GID_HOYLE4 && portId == 3) { - // Hoyle 4 attempts to set invalid port ID 3 when closing the options dialog (bug #3039305) - } else { - error("GfxPorts::kernelSetActive was requested to set invalid port id %d", portId); - } - } + else + error("GfxPorts::kernelSetActive was requested to set invalid port id %d", portId); } }; } @@ -232,6 +229,30 @@ void GfxPorts::kernelDisposeWindow(uint16 windowId, bool reanimate) { removeWindow(wnd, reanimate); else error("GfxPorts::kernelDisposeWindow: Request to dispose invalid port id %d", windowId); + + if ((g_sci->getGameId() == GID_HOYLE4) && (!g_sci->isDemo())) { + // WORKAROUND: hoyle 4 has a broken User::handleEvent implementation + // first of all iconbar is always set and always gets called with + // events checking if event got claimed got removed inside that code + // and it will call handleEvent on gameObj afterwards. Iconbar windows + // are handled inside iconbar as well including disposing + // e.g. iconOK::doit, script 14) and claimed isn't even set. gameObj + // handleEvent calling will result in coordinate adjust with a now + // invalid port. + // We fix this by adjusting the port variable to be global + // again when hoyle4 is disposing windows. + // TODO: maybe this could get implemented as script patch somehow + // although this could get quite tricky to implement (script 996) + // IconBar::handleEvent (script 937) + // maybe inside export 8 of script 0, which is called by iconOK + // and iconReplay + // or inside GameControls::hide (script 978) which is called to + // actually remove the window + reg_t eventObject = _segMan->findObjectByName("uEvt"); + if (!eventObject.isNull()) { + //writeSelectorValue(_segMan, eventObject, SELECTOR(port), 0); + } + } } int16 GfxPorts::isFrontWindow(Window *pWnd) { |