aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kgraphics32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/kgraphics32.cpp')
-rw-r--r--engines/sci/engine/kgraphics32.cpp55
1 files changed, 43 insertions, 12 deletions
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index 8b3afeef99..cd735d1233 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -323,19 +323,29 @@ reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) {
uint16 op = argv[0].toUint16();
switch (op) {
case 0: // Init
+ // TODO: Init reads the nsLeft, nsTop, nsRight, nsBottom,
+ // borderColor, fore, back, mode, font, plane selectors
+ // from the window in argv[1].
g_sci->_gfxFrameout->initScrollText(argv[2].toUint16()); // maxItems
g_sci->_gfxFrameout->clearScrollTexts();
return argv[1]; // kWindow
case 1: // Show message, called by ScrollableWindow::addString
case 14: // Modify message, called by ScrollableWindow::modifyString
- // 5 or 6 parameters
- // Seems to be called with 5 parameters when the narrator speaks, and
- // with 6 when Roger speaks
+ // TODO: The parameters in Modify are shifted by one: the first
+ // argument is the handle of the text to modify. The others
+ // are as Add.
{
Common::String text = s->_segMan->getString(argv[2]);
- uint16 x = 0;//argv[3].toUint16(); // TODO: can't be x (values are all wrong)
- uint16 y = 0;//argv[4].toUint16(); // TODO: can't be y (values are all wrong)
- // TODO: argv[5] is an optional unknown parameter (an integer set to 0)
+ uint16 x = 0;
+ uint16 y = 0;
+ // TODO: argv[3] is font
+ // TODO: argv[4] is color
+ // TODO: argv[5] is alignment (0 = left, 1 = center, 2 = right)
+ // font,color,alignment may also be -1. (Maybe same as previous?)
+ // TODO: argv[6] is an optional bool, defaulting to true if not present.
+ // If true, the old contents are scrolled out of view.
+ // TODO: Return a handle of the inserted text. (Used for modify/insert)
+ // This handle looks like it should also be usable by kString.
g_sci->_gfxFrameout->addScrollTextEntry(text, kWindow, x, y, (op == 14));
}
break;
@@ -363,22 +373,27 @@ reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) {
g_sci->_gfxFrameout->lastScrollText();
break;
case 9: // Resize, called by ScrollableWindow::resize and ScrollerWindow::resize
- // TODO
+ // TODO: This reads the nsLeft, nsTop, nsRight, nsBottom
+ // selectors from the SCI object passed in argv[2].
kStub(s, argc, argv);
break;
case 10: // Where, called by ScrollableWindow::where
- // TODO
- // argv[2] is an unknown integer
+ // TODO:
+ // Gives the current relative scroll location as a fraction
+ // with argv[2] as the denominator. (Return value is the numerator.)
// Silenced the warnings because of the high amount of console spam
//kStub(s, argc, argv);
break;
case 11: // Go, called by ScrollableWindow::scrollTo
- // 2 extra parameters here
- // TODO
+ // TODO:
+ // Two arguments provide a fraction: argv[2] is num., argv[3] is denom.
+ // Scrolls to the relative location given by the fraction.
kStub(s, argc, argv);
break;
case 12: // Insert, called by ScrollableWindow::insertString
- // 3 extra parameters here
+ // 5 extra parameters here:
+ // handle of insert location (new string takes that position).
+ // text, font, color, alignment
// TODO
kStub(s, argc, argv);
break;
@@ -668,6 +683,22 @@ reg_t kSetScroll(EngineState *s, int argc, reg_t *argv) {
return kStub(s, argc, argv);
}
+reg_t kPalVaryUnknown(EngineState *s, int argc, reg_t *argv) {
+ // TODO: Unknown (seems to be SCI32 exclusive)
+ return kStub(s, argc, argv);
+}
+
+reg_t kPalVaryUnknown2(EngineState *s, int argc, reg_t *argv) {
+ // TODO: Unknown (seems to be SCI32 exclusive)
+ // It seems to be related to the day/night palette effects in QFG4, and
+ // accepts a palette resource ID. It is triggered right when the night
+ // effect is initially applied (when exiting the caves).
+ // In QFG4, there are two scene palettes: 790 for night, and 791 for day.
+ // Initially, the game starts at night time, but this is called with the
+ // ID of the day time palette (i.e. 791).
+ return kStub(s, argc, argv);
+}
+
reg_t kPalCycle(EngineState *s, int argc, reg_t *argv) {
// Examples: GK1 room 480 (Bayou ritual), LSL6 room 100 (title screen)