[Scummvm-cvs-logs] SF.net SVN: scummvm:[46918] scummvm/trunk/engines/sci/engine
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Sun Jan 3 06:29:31 CET 2010
Revision: 46918
http://scummvm.svn.sourceforge.net/scummvm/?rev=46918&view=rev
Author: mthreepwood
Date: 2010-01-03 05:29:30 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
Implement kInPolygon for SCI32. GK1 now responds when you click on things.
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kernel.cpp
scummvm/trunk/engines/sci/engine/kernel.h
scummvm/trunk/engines/sci/engine/kernel32.cpp
scummvm/trunk/engines/sci/engine/kpathing.cpp
Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp 2010-01-03 04:46:00 UTC (rev 46917)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp 2010-01-03 05:29:30 UTC (rev 46918)
@@ -356,6 +356,7 @@
DEFUN("ListAllTrue", kListAllTrue, "li.*"),
DEFUN("ListIndexOf", kListIndexOf, "lo"),
DEFUN("OnMe", kOnMe, "iio.*"),
+ DEFUN("InPolygon", kInPolygon, "iio"),
// SCI2.1 Kernel Functions
DEFUN("Save", kSave, ".*"),
Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h 2010-01-03 04:46:00 UTC (rev 46917)
+++ scummvm/trunk/engines/sci/engine/kernel.h 2010-01-03 05:29:30 UTC (rev 46918)
@@ -411,6 +411,7 @@
reg_t kListFirstTrue(EngineState *s, int argc, reg_t *argv);
reg_t kListAllTrue(EngineState *s, int argc, reg_t *argv);
reg_t kOnMe(EngineState *s, int argc, reg_t *argv);
+reg_t kInPolygon(EngineState *s, int argc, reg_t *argv);
// SCI2.1 Kernel Functions
reg_t kSave(EngineState *s, int argc, reg_t *argv);
Modified: scummvm/trunk/engines/sci/engine/kernel32.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel32.cpp 2010-01-03 04:46:00 UTC (rev 46917)
+++ scummvm/trunk/engines/sci/engine/kernel32.cpp 2010-01-03 05:29:30 UTC (rev 46918)
@@ -791,6 +791,11 @@
return make_reg(0, nsRect.contains(x, y));
}
+reg_t kInPolygon(EngineState *s, int argc, reg_t *argv) {
+ // kAvoidPath already implements this
+ return kAvoidPath(s, argc, argv);
+}
+
} // End of namespace Sci
#endif // ENABLE_SCI32
Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp 2010-01-03 04:46:00 UTC (rev 46917)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp 2010-01-03 05:29:30 UTC (rev 46918)
@@ -1285,6 +1285,12 @@
reg_t points = GET_SEL32(segMan, polygon, points);
int size = GET_SEL32(segMan, polygon, size).toUint16();
+#ifdef ENABLE_SCI32
+ // SCI32 stores the actual points in the data property of points (in a new array)
+ if (segMan->isHeapObject(points))
+ points = GET_SEL32(segMan, points, data);
+#endif
+
if (size == 0) {
// If the polygon has no vertices, we skip it
return NULL;
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