[Scummvm-cvs-logs] SF.net SVN: scummvm:[51753] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Thu Aug 5 09:49:19 CEST 2010
Revision: 51753
http://scummvm.svn.sourceforge.net/scummvm/?rev=51753&view=rev
Author: m_kiewitz
Date: 2010-08-05 07:49:19 +0000 (Thu, 05 Aug 2010)
Log Message:
-----------
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
Modified Paths:
--------------
scummvm/trunk/engines/sci/detection_tables.h
scummvm/trunk/engines/sci/engine/selector.cpp
scummvm/trunk/engines/sci/engine/selector.h
scummvm/trunk/engines/sci/graphics/ports.cpp
Modified: scummvm/trunk/engines/sci/detection_tables.h
===================================================================
--- scummvm/trunk/engines/sci/detection_tables.h 2010-08-05 06:20:44 UTC (rev 51752)
+++ scummvm/trunk/engines/sci/detection_tables.h 2010-08-05 07:49:19 UTC (rev 51753)
@@ -807,7 +807,7 @@
{"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)
Modified: scummvm/trunk/engines/sci/engine/selector.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/selector.cpp 2010-08-05 06:20:44 UTC (rev 51752)
+++ scummvm/trunk/engines/sci/engine/selector.cpp 2010-08-05 07:49:19 UTC (rev 51753)
@@ -164,6 +164,7 @@
FIND_SELECTOR(vanishingX);
FIND_SELECTOR(vanishingY);
FIND_SELECTOR(iconIndex);
+ FIND_SELECTOR(port);
#ifdef ENABLE_SCI32
FIND_SELECTOR(data);
Modified: scummvm/trunk/engines/sci/engine/selector.h
===================================================================
--- scummvm/trunk/engines/sci/engine/selector.h 2010-08-05 06:20:44 UTC (rev 51752)
+++ scummvm/trunk/engines/sci/engine/selector.h 2010-08-05 07:49:19 UTC (rev 51753)
@@ -127,6 +127,8 @@
// 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
Modified: scummvm/trunk/engines/sci/graphics/ports.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/ports.cpp 2010-08-05 06:20:44 UTC (rev 51752)
+++ scummvm/trunk/engines/sci/graphics/ports.cpp 2010-08-05 07:49:19 UTC (rev 51753)
@@ -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 @@
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 @@
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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list