[Scummvm-cvs-logs] SF.net SVN: scummvm:[45552] scummvm/trunk/engines/sci/engine
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Oct 30 23:55:36 CET 2009
Revision: 45552
http://scummvm.svn.sourceforge.net/scummvm/?rev=45552&view=rev
Author: thebluegr
Date: 2009-10-30 22:55:35 +0000 (Fri, 30 Oct 2009)
Log Message:
-----------
Some work on the kPortrait kernel function, used to show hires character portraits in the Windows CD version of KQ6
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kernel.cpp
scummvm/trunk/engines/sci/engine/kernel.h
scummvm/trunk/engines/sci/engine/kgraphics.cpp
Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp 2009-10-30 22:53:00 UTC (rev 45551)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp 2009-10-30 22:55:35 UTC (rev 45552)
@@ -334,6 +334,7 @@
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 @@
break;
case SCI_VERSION_1_1:
- // KQ6CD calls unimplemented function 0x26
- _kernelNames[0x26] = "Dummy";
+ _kernelNames[0x26] = "Portrait";
_kernelNames[0x71] = "PalVary";
_kernelNames[0x7c] = "Message";
break;
Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h 2009-10-30 22:53:00 UTC (rev 45551)
+++ scummvm/trunk/engines/sci/engine/kernel.h 2009-10-30 22:55:35 UTC (rev 45552)
@@ -274,6 +274,7 @@
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);
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-10-30 22:53:00 UTC (rev 45551)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-10-30 22:55:35 UTC (rev 45552)
@@ -197,7 +197,8 @@
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 @@
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 @@
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);
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