aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMatthew Hoops2011-02-06 00:05:27 +0000
committerMatthew Hoops2011-02-06 00:05:27 +0000
commit46404940b55dd07849548d185836b261c22dcf69 (patch)
tree28fe231e1fa7c90b6282cba0db839121558e3833 /engines/sci/engine
parent36b6d961c202f4a6c06b362159f41b06a2d18248 (diff)
downloadscummvm-rg350-46404940b55dd07849548d185836b261c22dcf69.tar.gz
scummvm-rg350-46404940b55dd07849548d185836b261c22dcf69.tar.bz2
scummvm-rg350-46404940b55dd07849548d185836b261c22dcf69.zip
SCI: Improve Mac SCI1.1+ cursor support
The scripts can pass a list of view id's from the DOS version that get remapped to CURS/crsr id's. GK1 cursors now work and Phantasmagoria uses the correct ones. svn-id: r55791
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kmisc.cpp78
1 files changed, 59 insertions, 19 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index b6e1aad679..6e961f72f3 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -31,6 +31,7 @@
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
#include "sci/engine/gc.h"
+#include "sci/graphics/cursor.h"
#include "sci/graphics/maciconbar.h"
#include "sci/console.h"
@@ -338,38 +339,77 @@ reg_t kMemory(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}
-// kIconBar is really a subop of kPlatform for SCI1.1 Mac
+#ifdef ENABLE_SCI32
+reg_t kGetConfig(EngineState *s, int argc, reg_t *argv) {
+ Common::String setting = s->_segMan->getString(argv[0]);
+ reg_t data = readSelector(s->_segMan, argv[1], SELECTOR(data));
+
+ warning("Get config setting %s", setting.c_str());
+ s->_segMan->strcpy(data, "");
+ return argv[1];
+}
+#endif
+
+// kIconBar is really a subop of kMacPlatform for SCI1.1 Mac
reg_t kIconBar(EngineState *s, int argc, reg_t *argv) {
+ // Mac versions use their own tertiary platform functions
+ // to handle the outside-of-the-screen icon bar.
+
// QFG1 Mac calls this function to load the Mac icon bar (of which
// the resources do exist), but the game completely ignores it and
// uses the standard icon bar for the game. We do the same.
if (!g_sci->hasMacIconBar())
return NULL_REG;
- // TODO...
-
- if (argv[0].toUint16() == 4 && argv[1].toUint16() == 0) {
- for (int i = 0; i < argv[2].toUint16(); i++)
- g_sci->_gfxMacIconBar->addIcon(argv[i + 3]);
+ switch (argv[0].toUint16()) {
+ case 0:
+ // Add the icons
+ for (int i = 0; i < argv[1].toUint16(); i++)
+ g_sci->_gfxMacIconBar->addIcon(argv[i + 2]);
- g_sci->_gfxMacIconBar->drawIcons();
+ g_sci->_gfxMacIconBar->drawIcons();
+ break;
+ case 2:
+ case 3:
+ case 4:
+ // TODO: Other calls seem to handle selecting/deselecting them
+ break;
+ default:
+ warning("Unknown kIconBar subop %d", argv[0].toUint16());
}
- // Other calls seem to handle selecting/deselecting them
-
return NULL_REG;
}
-#ifdef ENABLE_SCI32
-reg_t kGetConfig(EngineState *s, int argc, reg_t *argv) {
- Common::String setting = s->_segMan->getString(argv[0]);
- reg_t data = readSelector(s->_segMan, argv[1], SELECTOR(data));
+// kMacPlatform is really a subop of kPlatform for SCI1.1+ Mac
+reg_t kMacPlatform(EngineState *s, int argc, reg_t *argv) {
+ // Mac versions use their own secondary platform functions
+ // to do various things. Why didn't they just declare a new
+ // kernel function?
- warning("Get config setting %s", setting.c_str());
- s->_segMan->strcpy(data, "");
- return argv[1];
+ switch (argv[0].toUint16()) {
+ case 0:
+ // Set Mac cursor remap
+ g_sci->_gfxCursor->setMacCursorRemapList(argc - 1, argv + 1);
+ break;
+ case 1:
+ // Unknown
+ break;
+ case 2:
+ // Unknown
+ break;
+ case 3:
+ // Unknown
+ break;
+ case 4:
+ // Handle icon bar code
+ return kIconBar(s, argc - 1, argv + 1);
+ default:
+ warning("Unknown kMacPlatform subop %d", argv[0].toUint16());
+ }
+
+ return s->r_acc;
}
-#endif
enum kSciPlatforms {
kSciPlatformDOS = 1,
@@ -415,8 +455,8 @@ reg_t kPlatform(EngineState *s, int argc, reg_t *argv) {
warning("STUB: kPlatform(CDCheck)");
break;
case kPlatformUnk0:
- if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() == SCI_VERSION_1_1)
- return kIconBar(s, argc - 1, argv + 1);
+ if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_1_1 && argc > 1)
+ return kMacPlatform(s, argc - 1, argv + 1);
// Otherwise, fall through
case kPlatformGetPlatform:
return make_reg(0, (isWindows) ? kSciPlatformWindows : kSciPlatformDOS);