[Scummvm-cvs-logs] scummvm master -> 243ea1fa290a919d5f0a07094782465f0ba08d7e

bluegr md5 at scummvm.org
Wed Jul 4 01:23:35 CEST 2012


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d74d211479 SCI: Mark the SetScroll and SetHotRectangles kernel functions as unused
dc1a097e50 SCI: Make the debug message in kSetShowStyle more verbose
5d3e22ae4f SCI: Some cleanup of the warnings in the SCI32 plane manipulation code
243ea1fa29 SCI: Add a check for invalid clip rectangles


Commit: d74d211479660eee0d9c63f10ddd1191340fdb02
    https://github.com/scummvm/scummvm/commit/d74d211479660eee0d9c63f10ddd1191340fdb02
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-07-03T16:21:08-07:00

Commit Message:
SCI: Mark the SetScroll and SetHotRectangles kernel functions as unused

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 114cd58..04b221d 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -520,7 +520,6 @@ static SciKernelMapEntry s_kernelMap[] = {
 
 	// SCI2 unmapped functions - TODO!
 
-	// SetScroll - called by script 64909, Styler::doit()
 	// PalCycle - called by Game::newRoom. Related to RemapColors.
 
 	// SCI2 Empty functions
@@ -561,6 +560,11 @@ static SciKernelMapEntry s_kernelMap[] = {
 	{ MAP_DUMMY(InputText),        SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
 	{ MAP_DUMMY(TextWidth),        SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
 	{ MAP_DUMMY(PointSize),        SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
+	// SetScroll is called by script 64909, Styler::doit(), but it doesn't seem to
+	// be used at all (plus, it was then changed to a dummy function in SCI3).
+	// Since this is most likely unused, and we got no test case, error out when
+	// it is called in order to find an actual call to it.
+	{ MAP_DUMMY(SetScroll),        SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
 
 	// SCI2.1 Kernel Functions
 	{ MAP_CALL(CD),                SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
@@ -620,6 +624,8 @@ static SciKernelMapEntry s_kernelMap[] = {
 	{ MAP_DUMMY(WinDLL),            SIG_EVERYWHERE,           "(.*)",                 NULL,            NULL },
 	{ MAP_DUMMY(DeletePic),         SIG_EVERYWHERE,           "(.*)",                 NULL,            NULL },
 	{ MAP_DUMMY(GetSierraProfileString), SIG_EVERYWHERE,      "(.*)",                 NULL,            NULL },
+	// SetHotRectangles is used by Phantasmagoria 1, script 64981 (a debug script)
+	{ MAP_DUMMY(SetHotRectangles),  SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },
 
 	// Unused / debug functions in the in-between SCI2.1 interpreters
 	{ MAP_DUMMY(PreloadResource),   SIG_EVERYWHERE,           "(.*)",                 NULL,            NULL },
@@ -633,7 +639,6 @@ static SciKernelMapEntry s_kernelMap[] = {
 	// SetPalStyleRange - 2 integer parameters, start and end. All styles from start-end
 	//   (inclusive) are set to 0
 	// MorphOn - used by SQ6, script 900, the datacorder reprogramming puzzle (from room 270)
-	// SetHotRectangles - used by Phantasmagoria 1
 
 	// SCI3 Kernel Functions
 	{ MAP_CALL(PlayDuck),         SIG_EVERYWHERE,           "(.*)",                  NULL,            NULL },


Commit: dc1a097e508fc4cd323314fd5dde4dfe648f7c64
    https://github.com/scummvm/scummvm/commit/dc1a097e508fc4cd323314fd5dde4dfe648f7c64
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-07-03T16:21:09-07:00

Commit Message:
SCI: Make the debug message in kSetShowStyle more verbose

Changed paths:
    engines/sci/engine/kgraphics32.cpp



diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index 14ea409..072d4df 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -224,12 +224,12 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
 	// tables inside graphics/transitions.cpp
 	uint16 showStyle = argv[0].toUint16();	// 0 - 15
 	reg_t planeObj = argv[1];	// the affected plane
-	//uint16 seconds = argv[2].toUint16();	// seconds that the transition lasts
-	//uint16 backColor =  argv[3].toUint16();	// target back color(?). When fading out, it's 0x0000. When fading in, it's 0xffff
-	//int16 priority = argv[4].toSint16();	// always 0xc8 (200) when fading in/out
-	//uint16 animate = argv[5].toUint16();	// boolean, animate or not while the transition lasts
-	//uint16 refFrame = argv[6].toUint16();	// refFrame, always 0 when fading in/out
-#if 0
+	Common::String planeObjName = s->_segMan->getObjectName(planeObj);
+	uint16 seconds = argv[2].toUint16();	// seconds that the transition lasts
+	uint16 backColor =  argv[3].toUint16();	// target back color(?). When fading out, it's 0x0000. When fading in, it's 0xffff
+	int16 priority = argv[4].toSint16();	// always 0xc8 (200) when fading in/out
+	uint16 animate = argv[5].toUint16();	// boolean, animate or not while the transition lasts
+	uint16 refFrame = argv[6].toUint16();	// refFrame, always 0 when fading in/out
 	int16 divisions;
 
 	// If the game has the pFadeArray selector, another parameter is used here,
@@ -241,7 +241,7 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
 	} else {
 		divisions = (argc >= 8) ? argv[7].toSint16() : -1;	// divisions (transition steps?)
 	}
-#endif
+
 	if (showStyle > 15) {
 		warning("kSetShowStyle: Illegal style %d for plane %04x:%04x", showStyle, PRINT_REG(planeObj));
 		return s->r_acc;
@@ -257,18 +257,29 @@ reg_t kSetShowStyle(EngineState *s, int argc, reg_t *argv) {
 
 	// TODO: Check if the plane is in the list of planes to draw
 
+	Common::String effectName = "unknown";
+
 	switch (showStyle) {
-	//case 0:	// no transition, perhaps? (like in the previous SCI versions)
+	case 0:		// no transition / show
+		effectName = "show";
+		break;
 	case 13:	// fade out
+		effectName = "fade out";
 		// TODO
+		break;
 	case 14:	// fade in
+		effectName = "fade in";
 		// TODO
+		break;
 	default:
-		// TODO: This is all a stub/skeleton, thus we're invoking kStub() for now
-		kStub(s, argc, argv);
+		// TODO
 		break;
 	}
 
+	warning("kSetShowStyle: effect %d (%s) - plane: %04x:%04x (%s), sec: %d, "
+			"back: %d, prio: %d, animate: %d, ref frame: %d, divisions: %d",
+			showStyle, effectName.c_str(), PRINT_REG(planeObj), planeObjName.c_str(),
+			seconds, backColor, priority, animate, refFrame, divisions);
 	return s->r_acc;
 }
 


Commit: 5d3e22ae4f5fcf6c7717eb9e50767b3fbb5a10f8
    https://github.com/scummvm/scummvm/commit/5d3e22ae4f5fcf6c7717eb9e50767b3fbb5a10f8
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-07-03T16:21:11-07:00

Commit Message:
SCI: Some cleanup of the warnings in the SCI32 plane manipulation code

Changed paths:
    engines/sci/graphics/frameout.cpp



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 5703579..4504600 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -326,8 +326,10 @@ void GfxFrameout::deletePlaneLine(reg_t object, reg_t hunkId) {
 
 void GfxFrameout::kernelAddScreenItem(reg_t object) {
 	// Ignore invalid items
-	if (!_segMan->isObject(object))
+	if (!_segMan->isObject(object)) {
+		warning("kernelAddScreenItem: Attempt to add an invalid object (%04x:%04x)", PRINT_REG(object));
 		return;
+	}
 
 	FrameoutEntry *itemEntry = new FrameoutEntry();
 	memset(itemEntry, 0, sizeof(FrameoutEntry));
@@ -341,8 +343,10 @@ void GfxFrameout::kernelAddScreenItem(reg_t object) {
 
 void GfxFrameout::kernelUpdateScreenItem(reg_t object) {
 	// Ignore invalid items
-	if (!_segMan->isObject(object))
+	if (!_segMan->isObject(object)) {
+		warning("kernelUpdateScreenItem: Attempt to update an invalid object (%04x:%04x)", PRINT_REG(object));
 		return;
+	}
 
 	FrameoutEntry *itemEntry = findScreenItem(object);
 	if (!itemEntry) {
@@ -372,10 +376,9 @@ void GfxFrameout::kernelUpdateScreenItem(reg_t object) {
 
 void GfxFrameout::kernelDeleteScreenItem(reg_t object) {
 	FrameoutEntry *itemEntry = findScreenItem(object);
-	if (!itemEntry) {
-		warning("kernelDeleteScreenItem: invalid object %04x:%04x", PRINT_REG(object));
+	// If the item could not be found, it may already have been deleted
+	if (!itemEntry)
 		return;
-	}
 
 	_screenItems.remove(itemEntry);
 	delete itemEntry;


Commit: 243ea1fa290a919d5f0a07094782465f0ba08d7e
    https://github.com/scummvm/scummvm/commit/243ea1fa290a919d5f0a07094782465f0ba08d7e
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-07-03T16:21:13-07:00

Commit Message:
SCI: Add a check for invalid clip rectangles

Happens in QFG4, when starting a battle

Changed paths:
    engines/sci/graphics/frameout.cpp



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 4504600..5b857fe 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -722,6 +722,9 @@ void GfxFrameout::kernelFrameout() {
 					translatedClipRect = clipRect;
 					translatedClipRect.translate(it->upscaledPlaneRect.left, it->upscaledPlaneRect.top);
 				} else {
+					// QFG4 passes invalid rectangles when a battle is starting
+					if (!clipRect.isValidRect())
+						continue;
 					clipRect.clip(it->planeClipRect);
 					translatedClipRect = clipRect;
 					translatedClipRect.translate(it->planeRect.left, it->planeRect.top);






More information about the Scummvm-git-logs mailing list