aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-30 22:55:35 +0000
committerFilippos Karapetis2009-10-30 22:55:35 +0000
commit86cafd561f8777fc06913dda10e3fe561ecf137e (patch)
tree263cabd62b8526cfd6245946f6ce298edadb0cfa /engines
parent1c158c52a1217225cfa4aadb289a537287eec6a2 (diff)
downloadscummvm-rg350-86cafd561f8777fc06913dda10e3fe561ecf137e.tar.gz
scummvm-rg350-86cafd561f8777fc06913dda10e3fe561ecf137e.tar.bz2
scummvm-rg350-86cafd561f8777fc06913dda10e3fe561ecf137e.zip
Some work on the kPortrait kernel function, used to show hires character portraits in the Windows CD version of KQ6
svn-id: r45552
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kernel.cpp4
-rw-r--r--engines/sci/engine/kernel.h1
-rw-r--r--engines/sci/engine/kgraphics.cpp53
3 files changed, 55 insertions, 3 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index a7c6527bc4..9766043b8e 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -334,6 +334,7 @@ SciKernelFunction kfunct_mappers[] = {
DEFUN("Platform", kPlatform, "i*"),
DEFUN("TextColors", kTextColors, ".*"),
DEFUN("TextFonts", kTextFonts, ".*"),
+ DEFUN("Portrait", kPortrait, ".*"),
// its a stub, but its needed for Pharkas to work
DEFUN("PalVary", kPalVary, "ii*"),
@@ -702,8 +703,7 @@ void Kernel::setDefaultKernelNames() {
break;
case SCI_VERSION_1_1:
- // KQ6CD calls unimplemented function 0x26
- _kernelNames[0x26] = "Dummy";
+ _kernelNames[0x26] = "Portrait";
_kernelNames[0x71] = "PalVary";
_kernelNames[0x7c] = "Message";
break;
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 77f5c372b4..15e7489aff 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -274,6 +274,7 @@ reg_t kLock(EngineState *s, int argc, reg_t *argv);
reg_t kPalette(EngineState *s, int argc, reg_t *argv);
reg_t kPalVary(EngineState *s, int argc, reg_t *argv);
reg_t kAssertPalette(EngineState *s, int argc, reg_t *argv);
+reg_t kPortrait(EngineState *s, int argc, reg_t *argv);
reg_t kNumCels(EngineState *s, int argc, reg_t *argv);
reg_t kNumLoops(EngineState *s, int argc, reg_t *argv);
reg_t kDrawCel(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 0fe1d40e38..9b88ad1bda 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -197,7 +197,8 @@ enum {
K_GRAPH_FILL_BOX_ANY = 11,
K_GRAPH_UPDATE_BOX = 12,
K_GRAPH_REDRAW_BOX = 13,
- K_GRAPH_ADJUST_PRIORITY = 14
+ K_GRAPH_ADJUST_PRIORITY = 14,
+ K_GRAPH_SAVE_UNSCALED_BOX = 15 // KQ6CD Windows version
};
reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
@@ -271,6 +272,11 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
s->priority_last = argv[2].toSint16() - 10;
break;
+ case K_GRAPH_SAVE_UNSCALED_BOX:
+ // Save an area given in unscaled coordinates, so that a hires control will be drawn over it
+ // TODO
+ break;
+
default:
error("Unsupported kGraph() operation %04x", argv[0].toSint16());
}
@@ -621,6 +627,51 @@ reg_t kAssertPalette(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}
+// Used to show hires character portraits in the Windows CD version of KQ6
+reg_t kPortrait(EngineState *s, int argc, reg_t *argv) {
+ uint16 operation = argv[0].toUint16();
+
+ switch (operation) {
+ case 0: // load resource (the corresponding .BIN file from the ACTORS directory)
+ {
+ Common::String resName = s->_segMan->getString(argv[1]);
+ warning("kPortrait, load portrait %s", resName.c_str());
+ // TODO
+ }
+ break;
+ case 1: // show portrait
+ {
+ Common::String resName = s->_segMan->getString(argv[1]);
+
+ // Show the portrait and sync the sound resource (like kDoSync)
+ /*
+ Common::Point portraitPos = Common::Point(argv[2].toUint16(), argv[3].toUint16());
+ uint resourceNum = argv[4].toUint16() & 0xff;
+ uint noun = argv[5].toUint16() & 0xff;
+ uint verb = argv[6].toUint16() & 0xff;
+ uint cond = argv[7].toUint16() & 0xff;
+ uint seq = argv[8].toUint16() & 0xff;
+ // argv[9] is usually 0
+ */
+
+ warning("kPortrait, show portrait %s", resName.c_str());
+ // TODO
+ }
+ break;
+ case 2: // unload resource
+ {
+ uint16 portraitId = argv[1].toUint16();
+ warning("kPortrait, unload portrait ID %d", portraitId);
+ // TODO
+ }
+ break;
+ default:
+ warning("kPortrait(%d), not implemented (argc = %d)", operation, argc);
+ }
+
+ return NULL_REG;
+}
+
void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
SegManager *segMan = s->_segMan;
int16 type = GET_SEL32V(segMan, controlObject, type);