[Scummvm-cvs-logs] scummvm master -> 3f2469c33ed6017d3c385fbbfd01a4e690987fbc

csnover csnover at users.noreply.github.com
Mon Mar 14 05:39:01 CET 2016


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

Summary:
3f2469c33e SCI32: Implement kCelInfo


Commit: 3f2469c33ed6017d3c385fbbfd01a4e690987fbc
    https://github.com/scummvm/scummvm/commit/3f2469c33ed6017d3c385fbbfd01a4e690987fbc
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-03-13T23:38:26-05:00

Commit Message:
SCI32: Implement kCelInfo

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



diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index 6e45944..b4d8a07 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -330,24 +330,27 @@ reg_t kCelInfo(EngineState *s, int argc, reg_t *argv) {
 	// Used by Shivers 1, room 23601 to determine what blocks on the red door puzzle board
 	// are occupied by pieces already
 
-	switch (argv[0].toUint16()) {	// subops 0 - 4
-		// 0 - return the view
-		// 1 - return the loop
-		// 2, 3 - nop
-		case 4: {
-			GuiResourceId viewId = argv[1].toSint16();
-			int16 loopNo = argv[2].toSint16();
-			int16 celNo = argv[3].toSint16();
-			int16 x = argv[4].toUint16();
-			int16 y = argv[5].toUint16();
-			byte color = g_sci->_gfxCache->kernelViewGetColorAtCoordinate(viewId, loopNo, celNo, x, y);
-			return make_reg(0, color);
-		}
-		default: {
-			kStub(s, argc, argv);
-			return s->r_acc;
-		}
+	CelObjView view(argv[1].toUint16(), argv[2].toSint16(), argv[3].toSint16());
+
+	int16 result = 0;
+
+	switch (argv[0].toUint16()) {
+	case 0:
+		result = view._displace.x;
+		break;
+	case 1:
+		result = view._displace.y;
+		break;
+	case 2:
+	case 3:
+		// null operation
+		break;
+	case 4:
+		result = view.readPixel(argv[4].toSint16(), argv[5].toSint16(), view._mirrorX);
+		break;
 	}
+
+	return make_reg(0, result);
 }
 
 reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) {






More information about the Scummvm-git-logs mailing list