[Scummvm-cvs-logs] scummvm master -> 26140afaed2313453b69157a39f3f87dc56558aa
bluegr
md5 at scummvm.org
Sun Oct 9 18:26:05 CEST 2011
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
69d08a7192 SCI21: Moved kRobot() together with the other video functions
a6884d7d69 SCI2+: Added info for the extra parameter used in kGetSaveDir in SCI32
d2bdcf8051 SCI: Removed the old kDoAvoider code
1dcad17988 SCI32: Documented the extra 2 params in kCreateTextBitmap(0)
26140afaed SCI32: Marked/updated several unused/still not needed kernel functions
Commit: 69d08a7192addd59b80b80bfbf18ad012db9043f
https://github.com/scummvm/scummvm/commit/69d08a7192addd59b80b80bfbf18ad012db9043f
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-09T09:16:02-07:00
Commit Message:
SCI21: Moved kRobot() together with the other video functions
Changed paths:
engines/sci/engine/kgraphics.cpp
engines/sci/engine/kvideo.cpp
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index ec0b4a8..a91b9e8 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -51,7 +51,6 @@
#ifdef ENABLE_SCI32
#include "sci/graphics/text32.h"
#include "sci/graphics/frameout.h"
-#include "sci/video/robot_decoder.h"
#endif
namespace Sci {
@@ -1413,50 +1412,6 @@ reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
-reg_t kRobot(EngineState *s, int argc, reg_t *argv) {
-
- int16 subop = argv[0].toUint16();
-
- switch (subop) {
- case 0: { // init
- int id = argv[1].toUint16();
- reg_t obj = argv[2];
- int16 flag = argv[3].toSint16();
- int16 x = argv[4].toUint16();
- int16 y = argv[5].toUint16();
- warning("kRobot(init), id %d, obj %04x:%04x, flag %d, x=%d, y=%d", id, PRINT_REG(obj), flag, x, y);
- g_sci->_robotDecoder->load(id);
- g_sci->_robotDecoder->setPos(x, y);
- }
- break;
- case 1: // LSL6 hires (startup)
- // TODO
- return NULL_REG; // an integer is expected
- case 4: { // start - we don't really have a use for this one
- //int id = argv[1].toUint16();
- //warning("kRobot(start), id %d", id);
- }
- break;
- case 7: // unknown, called e.g. by Phantasmagoria
- warning("kRobot(%d)", subop);
- break;
- case 8: // sync
- if ((uint32)g_sci->_robotDecoder->getCurFrame() != g_sci->_robotDecoder->getFrameCount() - 1) {
- writeSelector(s->_segMan, argv[1], SELECTOR(signal), NULL_REG);
- } else {
- g_sci->_robotDecoder->close();
- // Signal the engine scripts that the video is done
- writeSelector(s->_segMan, argv[1], SELECTOR(signal), SIGNAL_REG);
- }
- break;
- default:
- warning("kRobot(%d)", subop);
- break;
- }
-
- return s->r_acc;
-}
-
reg_t kGetWindowsOption(EngineState *s, int argc, reg_t *argv) {
uint16 windowsOption = argv[0].toUint16();
switch (windowsOption) {
diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp
index 6d810d5..13c18be 100644
--- a/engines/sci/engine/kvideo.cpp
+++ b/engines/sci/engine/kvideo.cpp
@@ -21,6 +21,7 @@
*/
#include "engines/util.h"
+#include "sci/engine/kernel.h"
#include "sci/engine/state.h"
#include "sci/graphics/helpers.h"
#include "sci/graphics/cursor.h"
@@ -39,6 +40,7 @@
#include "sci/video/seq_decoder.h"
#ifdef ENABLE_SCI32
#include "video/coktel_decoder.h"
+#include "sci/video/robot_decoder.h"
#endif
namespace Sci {
@@ -230,6 +232,50 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) {
#ifdef ENABLE_SCI32
+reg_t kRobot(EngineState *s, int argc, reg_t *argv) {
+
+ int16 subop = argv[0].toUint16();
+
+ switch (subop) {
+ case 0: { // init
+ int id = argv[1].toUint16();
+ reg_t obj = argv[2];
+ int16 flag = argv[3].toSint16();
+ int16 x = argv[4].toUint16();
+ int16 y = argv[5].toUint16();
+ warning("kRobot(init), id %d, obj %04x:%04x, flag %d, x=%d, y=%d", id, PRINT_REG(obj), flag, x, y);
+ g_sci->_robotDecoder->load(id);
+ g_sci->_robotDecoder->setPos(x, y);
+ }
+ break;
+ case 1: // LSL6 hires (startup)
+ // TODO
+ return NULL_REG; // an integer is expected
+ case 4: { // start - we don't really have a use for this one
+ //int id = argv[1].toUint16();
+ //warning("kRobot(start), id %d", id);
+ }
+ break;
+ case 7: // unknown, called e.g. by Phantasmagoria
+ warning("kRobot(%d)", subop);
+ break;
+ case 8: // sync
+ if ((uint32)g_sci->_robotDecoder->getCurFrame() != g_sci->_robotDecoder->getFrameCount() - 1) {
+ writeSelector(s->_segMan, argv[1], SELECTOR(signal), NULL_REG);
+ } else {
+ g_sci->_robotDecoder->close();
+ // Signal the engine scripts that the video is done
+ writeSelector(s->_segMan, argv[1], SELECTOR(signal), SIGNAL_REG);
+ }
+ break;
+ default:
+ warning("kRobot(%d)", subop);
+ break;
+ }
+
+ return s->r_acc;
+}
+
reg_t kPlayVMD(EngineState *s, int argc, reg_t *argv) {
uint16 operation = argv[0].toUint16();
Video::VideoDecoder *videoDecoder = 0;
Commit: a6884d7d691834f4e6b4c271f96d06a974cffbfc
https://github.com/scummvm/scummvm/commit/a6884d7d691834f4e6b4c271f96d06a974cffbfc
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-09T09:16:03-07:00
Commit Message:
SCI2+: Added info for the extra parameter used in kGetSaveDir in SCI32
The warning can be safely removed, as the parameter is a string that
should not be set
Changed paths:
engines/sci/engine/kfile.cpp
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 0c73125..06af6e0 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -365,9 +365,12 @@ reg_t kDeviceInfo(EngineState *s, int argc, reg_t *argv) {
reg_t kGetSaveDir(EngineState *s, int argc, reg_t *argv) {
#ifdef ENABLE_SCI32
- // TODO: SCI32 uses a parameter here.
- if (argc > 0)
- warning("kGetSaveDir called with %d parameter(s): %04x:%04x", argc, PRINT_REG(argv[0]));
+ // SCI32 uses a parameter here. It is used to modify a string, stored in a
+ // global variable, so that game scripts store the save directory. We
+ // don't really set a save game directory, thus not setting the string to
+ // anything is the correct thing to do here.
+ //if (argc > 0)
+ // warning("kGetSaveDir called with %d parameter(s): %04x:%04x", argc, PRINT_REG(argv[0]));
#endif
return s->_segMan->getSaveDirPtr();
}
Commit: d2bdcf8051d782ccd9d2d01f4dab4f0b9c5172ec
https://github.com/scummvm/scummvm/commit/d2bdcf8051d782ccd9d2d01f4dab4f0b9c5172ec
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-09T09:16:04-07:00
Commit Message:
SCI: Removed the old kDoAvoider code
Changed paths:
engines/sci/engine/kmovement.cpp
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index 14f7db4..649a142 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -505,116 +505,6 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) {
}
writeSelectorValue(segMan, avoider, SELECTOR(heading), avoiderHeading);
return s->r_acc;
-
-#if 0
- reg_t client, looper, mover;
- int angle;
- int dx, dy;
- int destx, desty;
-
- s->r_acc = SIGNAL_REG;
-
- if (!s->_segMan->isHeapObject(avoider)) {
- error("DoAvoider() where avoider %04x:%04x is not an object", PRINT_REG(avoider));
- return NULL_REG;
- }
-
- client = readSelector(segMan, avoider, SELECTOR(client));
-
- if (!s->_segMan->isHeapObject(client)) {
- error("DoAvoider() where client %04x:%04x is not an object", PRINT_REG(client));
- return NULL_REG;
- }
-
- looper = readSelector(segMan, client, SELECTOR(looper));
- mover = readSelector(segMan, client, SELECTOR(mover));
-
- if (!s->_segMan->isHeapObject(mover)) {
- if (mover.segment) {
- error("DoAvoider() where mover %04x:%04x is not an object", PRINT_REG(mover));
- }
- return s->r_acc;
- }
-
- destx = readSelectorValue(segMan, mover, SELECTOR(x));
- desty = readSelectorValue(segMan, mover, SELECTOR(y));
-
- debugC(kDebugLevelBresen, "Doing avoider %04x:%04x (dest=%d,%d)", PRINT_REG(avoider), destx, desty);
-
- invokeSelector(s, mover, SELECTOR(doit), argc, argv);
-
- mover = readSelector(segMan, client, SELECTOR(mover));
- if (!mover.segment) // Mover has been disposed?
- return s->r_acc; // Return gracefully.
-
- invokeSelector(s, client, SELECTOR(isBlocked), argc, argv);
-
- dx = destx - readSelectorValue(segMan, client, SELECTOR(x));
- dy = desty - readSelectorValue(segMan, client, SELECTOR(y));
- angle = getAngle(dx, dy);
-
- debugC(kDebugLevelBresen, "Movement (%d,%d), angle %d is %sblocked", dx, dy, angle, (s->r_acc.offset) ? " " : "not ");
-
- if (s->r_acc.offset) { // isBlocked() returned non-zero
- int rotation = (g_sci->getRNG().getRandomBit() == 1) ? 45 : (360 - 45); // Clockwise/counterclockwise
- int oldx = readSelectorValue(segMan, client, SELECTOR(x));
- int oldy = readSelectorValue(segMan, client, SELECTOR(y));
- int xstep = readSelectorValue(segMan, client, SELECTOR(xStep));
- int ystep = readSelectorValue(segMan, client, SELECTOR(yStep));
- int moves;
-
- debugC(kDebugLevelBresen, " avoider %04x:%04x", PRINT_REG(avoider));
-
- for (moves = 0; moves < 8; moves++) {
- int move_x = (int)(sin(angle * M_PI / 180.0) * (xstep));
- int move_y = (int)(-cos(angle * M_PI / 180.0) * (ystep));
-
- writeSelectorValue(segMan, client, SELECTOR(x), oldx + move_x);
- writeSelectorValue(segMan, client, SELECTOR(y), oldy + move_y);
-
- debugC(kDebugLevelBresen, "Pos (%d,%d): Trying angle %d; delta=(%d,%d)", oldx, oldy, angle, move_x, move_y);
-
- invokeSelector(s, client, SELECTOR(canBeHere), argc, argv);
-
- writeSelectorValue(segMan, client, SELECTOR(x), oldx);
- writeSelectorValue(segMan, client, SELECTOR(y), oldy);
-
- if (s->r_acc.offset) { // We can be here
- debugC(kDebugLevelBresen, "Success");
- writeSelectorValue(segMan, client, SELECTOR(heading), angle);
-
- return make_reg(0, angle);
- }
-
- angle += rotation;
-
- if (angle > 360)
- angle -= 360;
- }
-
- error("DoAvoider failed for avoider %04x:%04x", PRINT_REG(avoider));
- } else {
- int heading = readSelectorValue(segMan, client, SELECTOR(heading));
-
- if (heading == -1)
- return s->r_acc; // No change
-
- writeSelectorValue(segMan, client, SELECTOR(heading), angle);
-
- s->r_acc = make_reg(0, angle);
-
- if (looper.segment) {
- reg_t params[2] = { make_reg(0, angle), client };
- invokeSelector(s, looper, SELECTOR(doit), argc, argv, 2, params);
- return s->r_acc;
- } else {
- // No looper? Fall back to DirLoop
- kDirLoopWorker(client, (uint16)angle, s, argc, argv);
- }
- }
-
- return s->r_acc;
-#endif
}
} // End of namespace Sci
Commit: 1dcad179888fbcbb0e92838cc52efd00a6ab672a
https://github.com/scummvm/scummvm/commit/1dcad179888fbcbb0e92838cc52efd00a6ab672a
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-09T09:16:05-07:00
Commit Message:
SCI32: Documented the extra 2 params in kCreateTextBitmap(0)
Changed paths:
engines/sci/engine/kgraphics.cpp
engines/sci/graphics/text32.cpp
engines/sci/graphics/text32.h
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index a91b9e8..e3a41fe 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1389,13 +1389,14 @@ reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) {
debugC(kDebugLevelStrings, "kCreateTextBitmap case 0 (%04x:%04x, %04x:%04x, %04x:%04x)",
PRINT_REG(argv[1]), PRINT_REG(argv[2]), PRINT_REG(argv[3]));
debugC(kDebugLevelStrings, "%s", text.c_str());
- // TODO: arguments 1 and 2
- g_sci->_gfxText32->createTextBitmap(object);
+ uint16 maxWidth = argv[1].toUint16(); // nsRight - nsLeft + 1
+ uint16 maxHeight = argv[2].toUint16(); // nsBottom - nsTop + 1
+ g_sci->_gfxText32->createTextBitmap(object, maxWidth, maxHeight);
break;
}
case 1: {
if (argc != 2) {
- warning("kCreateTextBitmap(0): expected 2 arguments, got %i", argc);
+ warning("kCreateTextBitmap(1): expected 2 arguments, got %i", argc);
return NULL_REG;
}
reg_t object = argv[1];
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index 82740c0..6ec1261 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -56,7 +56,7 @@ void GfxText32::purgeCache() {
_textCache.clear();
}
-void GfxText32::createTextBitmap(reg_t textObject) {
+void GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxHeight) {
if (_textCache.size() >= MAX_CACHED_TEXTS)
purgeCache();
@@ -70,7 +70,7 @@ void GfxText32::createTextBitmap(reg_t textObject) {
_textCache.erase(textId);
}
- _textCache[textId] = createTextEntry(textObject);
+ _textCache[textId] = createTextEntry(textObject, maxWidth, maxHeight);
}
// TODO: Finish this!
@@ -133,9 +133,11 @@ TextEntry *GfxText32::getTextEntry(reg_t textObject) {
}
// TODO: Finish this! Currently buggy.
-TextEntry *GfxText32::createTextEntry(reg_t textObject) {
+TextEntry *GfxText32::createTextEntry(reg_t textObject, uint16 maxWidth, uint16 maxHeight) {
reg_t stringObject = readSelector(_segMan, textObject, SELECTOR(text));
+ // TODO: maxWidth, maxHeight (if > 0)
+
// The object in the text selector of the item can be either a raw string
// or a Str object. In the latter case, we need to access the object's data
// selector to get the raw string.
@@ -174,10 +176,9 @@ TextEntry *GfxText32::createTextEntry(reg_t textObject) {
memset(newEntry->surface, 0, newEntry->width * newEntry->height);
newEntry->text = _segMan->getString(stringObject);
- int16 maxTextWidth, charCount;
+ int16 maxTextWidth = 0, charCount = 0;
uint16 curX = 0, curY = 0;
- maxTextWidth = 0;
while (*text) {
charCount = GetLongest(text, planeRect.width(), font);
if (charCount == 0)
diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h
index 7f70afc..620bcfc 100644
--- a/engines/sci/graphics/text32.h
+++ b/engines/sci/graphics/text32.h
@@ -51,7 +51,7 @@ class GfxText32 {
public:
GfxText32(SegManager *segMan, GfxCache *fonts, GfxScreen *screen);
~GfxText32();
- void createTextBitmap(reg_t textObject);
+ void createTextBitmap(reg_t textObject, uint16 maxWidth = 0, uint16 maxHeight = 0);
void drawTextBitmap(reg_t textObject, uint16 textX, uint16 textY, uint16 planeWidth);
int16 GetLongest(const char *text, int16 maxWidth, GfxFont *font);
TextEntry *getTextEntry(reg_t textObject);
@@ -59,7 +59,7 @@ public:
void kernelTextSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight);
private:
- TextEntry *createTextEntry(reg_t textObject);
+ TextEntry *createTextEntry(reg_t textObject, uint16 maxWidth, uint16 maxHeight);
int16 Size(Common::Rect &rect, const char *text, GuiResourceId fontId, int16 maxWidth);
void Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight, bool restoreFont);
void StringWidth(const char *str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight);
Commit: 26140afaed2313453b69157a39f3f87dc56558aa
https://github.com/scummvm/scummvm/commit/26140afaed2313453b69157a39f3f87dc56558aa
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-09T09:16:06-07:00
Commit Message:
SCI32: Marked/updated several unused/still not needed kernel functions
Changed paths:
engines/sci/engine/kernel_tables.h
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index d3adcac..2ed5e6c 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -500,18 +500,47 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(UpdateScreenItem), SIG_EVERYWHERE, "o", NULL, NULL },
// SCI2 unmapped functions - TODO!
- // SetScroll
- // AddMagnify // most probably similar to the SCI1.1 functions. We need a test case
- // DeleteMagnify
- // EditText
+
+ // SetScroll - called by script 64909, Styler::doit()
// DisposeTextBitmap
- // VibrateMouse - used in QFG4 floppy
- // PalCycle
- // ObjectIntersect - used in QFG4 floppy
- // MakeSaveCatName - used in the Save/Load dialog of GK1CD (SRDialog, script 64990)
- // MakeSaveFileName - used in the Save/Load dialog of GK1CD (SRDialog, script 64990)
+ // PalCycle - called by Game::newRoom. Related to RemapColors.
+ // VibrateMouse - used in QFG4
+ // ObjectIntersect - used in QFG4
+
+ // SCI2 Empty functions
+
+ // Debug function used to track resources
+ { MAP_EMPTY(ResourceTrack), SIG_EVERYWHERE, "(.*)", NULL, NULL },
+
+ // SCI2 functions that are used in the original save/load menus. Marked as dummy, so
+ // that the engine errors out on purpose. TODO: Implement once the original save/load
+ // menus are implemented.
+
+ // Creates the name of the save catalogue/directory to save into.
+ // TODO: Implement once the original save/load menus are implemented.
+ { MAP_DUMMY(MakeSaveCatName), SIG_EVERYWHERE, "(.*)", NULL, NULL },
+
+ // Creates the name of the save file to save into
+ // TODO: Implement once the original save/load menus are implemented.
+ { MAP_DUMMY(MakeSaveFileName), SIG_EVERYWHERE, "(.*)", NULL, NULL },
+
+ // Used for edit boxes in save/load dialogs. It's a rewritten version of kEditControl,
+ // but it handles events on its own, using an internal loop, instead of using SCI
+ // scripts for event management like kEditControl does. Called by script 64914,
+ // DEdit::hilite().
+ // TODO: Implement once the original save/load menus are implemented.
+ { MAP_DUMMY(EditText), SIG_EVERYWHERE, "o", NULL, NULL },
// Unused / debug SCI2 unused functions, always mapped to kDummy
+
+ // AddMagnify/DeleteMagnify are both called by script 64979 (the Magnifier
+ // object) in GK1 only. There is also an associated empty magnifier view
+ // (view 1), however, it doesn't seem to be used anywhere, as all the
+ // magnifier closeups (e.g. in scene 470) are normal views. Thus, these
+ // are marked as dummy, so if they're ever used the engine will error out.
+ { MAP_DUMMY(AddMagnify), SIG_EVERYWHERE, "(.*)", NULL, NULL },
+ { MAP_DUMMY(DeleteMagnify), SIG_EVERYWHERE, "(.*)", NULL, NULL },
+
{ MAP_DUMMY(InspectObject), SIG_EVERYWHERE, "(.*)", NULL, NULL },
// Profiler (same as SCI0-SCI1.1)
// Record (same as SCI0-SCI1.1)
@@ -771,7 +800,7 @@ static const char *const sci2_default_knames[] = {
/*0x0d*/ "CelWide",
/*0x0e*/ "CelHigh",
/*0x0f*/ "GetHighPlanePri",
- /*0x10*/ "GetHighItemPri",
+ /*0x10*/ "GetHighItemPri", // unused function
/*0x11*/ "ShakeScreen",
/*0x12*/ "OnMe",
/*0x13*/ "ShowMovie",
@@ -785,7 +814,7 @@ static const char *const sci2_default_knames[] = {
/*0x1b*/ "UpdatePlane",
/*0x1c*/ "RepaintPlane",
/*0x1d*/ "SetShowStyle",
- /*0x1e*/ "ShowStylePercent",
+ /*0x1e*/ "ShowStylePercent", // unused function
/*0x1f*/ "SetScroll",
/*0x20*/ "AddMagnify",
/*0x21*/ "DeleteMagnify",
@@ -799,7 +828,7 @@ static const char *const sci2_default_knames[] = {
/*0x29*/ "Dummy",
/*0x2a*/ "SetQuitStr",
/*0x2b*/ "EditText",
- /*0x2c*/ "InputText",
+ /*0x2c*/ "InputText", // unused function
/*0x2d*/ "CreateTextBitmap",
/*0x2e*/ "DisposeTextBitmap",
/*0x2f*/ "GetEvent",
@@ -965,9 +994,9 @@ static const char *const sci21_default_knames[] = {
/*0x2a*/ "UpdatePlane",
/*0x2b*/ "RepaintPlane",
/*0x2c*/ "GetHighPlanePri",
- /*0x2d*/ "GetHighItemPri",
+ /*0x2d*/ "GetHighItemPri", // unused function
/*0x2e*/ "SetShowStyle",
- /*0x2f*/ "ShowStylePercent",
+ /*0x2f*/ "ShowStylePercent", // unused function
/*0x30*/ "SetScroll",
/*0x31*/ "MovePlaneItems",
/*0x32*/ "ShakeScreen",
More information about the Scummvm-git-logs
mailing list