[Scummvm-cvs-logs] scummvm master -> 6419a0da5ea501581b7571e679203638757d6338

wjp wjp at usecode.org
Fri Oct 10 14:03:25 CEST 2014


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

Summary:
bdc20cf1c9 PRINCE: Fix a few compile errors
6419a0da5e PRINCE: Fix a few warnings


Commit: bdc20cf1c992622d1767ec25ad06ffa15b6fc791
    https://github.com/scummvm/scummvm/commit/bdc20cf1c992622d1767ec25ad06ffa15b6fc791
Author: Willem Jan Palenstijn (Willem.Jan.Palenstijn at cwi.nl)
Date: 2014-10-10T14:02:33+02:00

Commit Message:
PRINCE: Fix a few compile errors

Changed paths:
    engines/prince/debugger.cpp



diff --git a/engines/prince/debugger.cpp b/engines/prince/debugger.cpp
index 481ea69..fc216e0 100644
--- a/engines/prince/debugger.cpp
+++ b/engines/prince/debugger.cpp
@@ -28,15 +28,15 @@
 namespace Prince {
 
 Debugger::Debugger(PrinceEngine *vm, InterpreterFlags *flags) : GUI::Debugger(), _vm(vm), _locationNr(0), _flags(flags) {
-	DCmd_Register("continue",		WRAP_METHOD(Debugger, Cmd_Exit));
-	DCmd_Register("level",			WRAP_METHOD(Debugger, Cmd_DebugLevel));
-	DCmd_Register("setflag",		WRAP_METHOD(Debugger, Cmd_SetFlag));
-	DCmd_Register("getflag",		WRAP_METHOD(Debugger, Cmd_GetFlag));
-	DCmd_Register("clearflag",		WRAP_METHOD(Debugger, Cmd_ClearFlag));
-	DCmd_Register("viewflc",		WRAP_METHOD(Debugger, Cmd_ViewFlc));
-	DCmd_Register("initroom",		WRAP_METHOD(Debugger, Cmd_InitRoom));
-	DCmd_Register("changecursor",	WRAP_METHOD(Debugger, Cmd_ChangeCursor));
-	DCmd_Register("additem",		WRAP_METHOD(Debugger, Cmd_AddItem));
+	registerCmd("continue",		WRAP_METHOD(Debugger, cmdExit));
+	registerCmd("level",			WRAP_METHOD(Debugger, Cmd_DebugLevel));
+	registerCmd("setflag",		WRAP_METHOD(Debugger, Cmd_SetFlag));
+	registerCmd("getflag",		WRAP_METHOD(Debugger, Cmd_GetFlag));
+	registerCmd("clearflag",		WRAP_METHOD(Debugger, Cmd_ClearFlag));
+	registerCmd("viewflc",		WRAP_METHOD(Debugger, Cmd_ViewFlc));
+	registerCmd("initroom",		WRAP_METHOD(Debugger, Cmd_InitRoom));
+	registerCmd("changecursor",	WRAP_METHOD(Debugger, Cmd_ChangeCursor));
+	registerCmd("additem",		WRAP_METHOD(Debugger, Cmd_AddItem));
 }
 
 static int strToInt(const char *s) {
@@ -57,15 +57,15 @@ static int strToInt(const char *s) {
 
 bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
 	if (argc == 1) {
-		DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel);
+		debugPrintf("Debugging is currently set at level %d\n", gDebugLevel);
 	} else { // set level
 		gDebugLevel = atoi(argv[1]);
 		if (0 <= gDebugLevel && gDebugLevel < 11) {
-			DebugPrintf("Debug level set to level %d\n", gDebugLevel);
+			debugPrintf("Debug level set to level %d\n", gDebugLevel);
 		} else if (gDebugLevel < 0) {
-			DebugPrintf("Debugging is now disabled\n");
+			debugPrintf("Debugging is now disabled\n");
 		} else
-			DebugPrintf("Not a valid debug level (0 - 10)\n");
+			debugPrintf("Not a valid debug level (0 - 10)\n");
 	}
 
 	return true;
@@ -77,7 +77,7 @@ bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
 bool Debugger::Cmd_SetFlag(int argc, const char **argv) {
 	// Check for a flag to set
 	if (argc != 3) {
-		DebugPrintf("Usage: %s <flag number> <value>\n", argv[0]);
+		debugPrintf("Usage: %s <flag number> <value>\n", argv[0]);
 		return true;
 	}
 
@@ -93,12 +93,12 @@ bool Debugger::Cmd_SetFlag(int argc, const char **argv) {
 bool Debugger::Cmd_GetFlag(int argc, const char **argv) {
 	// Check for an flag to display
 	if (argc != 2) {
-		DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+		debugPrintf("Usage: %s <flag number>\n", argv[0]);
 		return true;
 	}
 
 	int flagNum = strToInt(argv[1]);
-	DebugPrintf("Value: %d\n", _flags->getFlagValue((Flags::Id)flagNum));
+	debugPrintf("Value: %d\n", _flags->getFlagValue((Flags::Id)flagNum));
 	return true;
 }
 
@@ -108,7 +108,7 @@ bool Debugger::Cmd_GetFlag(int argc, const char **argv) {
 bool Debugger::Cmd_ClearFlag(int argc, const char **argv) {
 	// Check for a flag to clear
 	if (argc != 2) {
-		DebugPrintf("Usage: %s <flag number>\n", argv[0]);
+		debugPrintf("Usage: %s <flag number>\n", argv[0]);
 		return true;
 	}
 
@@ -123,7 +123,7 @@ bool Debugger::Cmd_ClearFlag(int argc, const char **argv) {
 bool Debugger::Cmd_ViewFlc(int argc, const char **argv) {
 	// Check for a flag to clear
 	if (argc != 2) {
-		DebugPrintf("Usage: %s <anim number>\n", argv[0]);
+		debugPrintf("Usage: %s <anim number>\n", argv[0]);
 		return true;
 	}
 
@@ -135,7 +135,7 @@ bool Debugger::Cmd_ViewFlc(int argc, const char **argv) {
 bool Debugger::Cmd_InitRoom(int argc, const char **argv) {
 	// Check for a flag to clear
 	if (argc != 2) {
-		DebugPrintf("Usage: %s <anim number>\n", argv[0]);
+		debugPrintf("Usage: %s <anim number>\n", argv[0]);
 		return true;
 	}
 
@@ -146,7 +146,7 @@ bool Debugger::Cmd_InitRoom(int argc, const char **argv) {
 bool Debugger::Cmd_ChangeCursor(int argc, const char **argv) {
 	// Check for a flag to clear
 	if (argc != 2) {
-		DebugPrintf("Usage: %s <curId>\n", argv[0]);
+		debugPrintf("Usage: %s <curId>\n", argv[0]);
 		return true;
 	}
 
@@ -157,7 +157,7 @@ bool Debugger::Cmd_ChangeCursor(int argc, const char **argv) {
 
 bool Debugger::Cmd_AddItem(int argc, const char **argv) {
 	if (argc != 2) {
-		DebugPrintf("Usage: %s <itemId>\n", argv[0]);
+		debugPrintf("Usage: %s <itemId>\n", argv[0]);
 		return true;
 	}
 	if (!strcmp(argv[1], "map")) {


Commit: 6419a0da5ea501581b7571e679203638757d6338
    https://github.com/scummvm/scummvm/commit/6419a0da5ea501581b7571e679203638757d6338
Author: Willem Jan Palenstijn (Willem.Jan.Palenstijn at cwi.nl)
Date: 2014-10-10T14:02:33+02:00

Commit Message:
PRINCE: Fix a few warnings

Changed paths:
    engines/prince/graphics.cpp
    engines/prince/mob.h



diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp
index cd4b62f..91ba699 100644
--- a/engines/prince/graphics.cpp
+++ b/engines/prince/graphics.cpp
@@ -79,7 +79,7 @@ void GraphicsMan::change() {
 
 void GraphicsMan::draw(Graphics::Surface *screen, const Graphics::Surface *s) {
 	uint16 w = MIN(screen->w, s->w);
-	byte *src = (byte *)s->getBasePtr(0, 0);
+	const byte *src = (const byte *)s->getBasePtr(0, 0);
 	byte *dst = (byte *)screen->getBasePtr(0, 0);
 	for (uint y = 0; y < s->h; y++) {
 		if (y < screen->h) {
@@ -93,11 +93,11 @@ void GraphicsMan::draw(Graphics::Surface *screen, const Graphics::Surface *s) {
 
 // Black (value = 0) as a primary transparent color, fix for FLC animations
 void GraphicsMan::drawTransparentSurface(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s, int secondTransColor) {
-	byte *src1 = (byte *)s->getBasePtr(0, 0);
+	const byte *src1 = (const byte *)s->getBasePtr(0, 0);
 	byte *dst1 = (byte *)screen->getBasePtr(posX, posY);
 	for (int y = 0; y < s->h; y++) {
 		if (y + posY < screen->h && y + posY >= 0) {
-			byte *src2 = src1;
+			const byte *src2 = src1;
 			byte *dst2 = dst1;
 			for (int x = 0; x < s->w; x++, src2++, dst2++) {
 				if (*src2 && *src2 != secondTransColor) {
@@ -118,11 +118,11 @@ void GraphicsMan::drawTransparentSurface(Graphics::Surface *screen, int32 posX,
  * and kShadowColor (191) as a transparent color.
  */
 void GraphicsMan::drawAsShadowSurface(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s, byte *shadowTable) {
-	byte *src1 = (byte *)s->getBasePtr(0, 0);
+	const byte *src1 = (const byte *)s->getBasePtr(0, 0);
 	byte *dst1 = (byte *)screen->getBasePtr(posX, posY);
 	for (int y = 0; y < s->h; y++) {
 		if (y + posY < screen->h && y + posY >= 0) {
-			byte *src2 = src1;
+			const byte *src2 = src1;
 			byte *dst2 = dst1;
 			for (int x = 0; x < s->w; x++, src2++, dst2++) {
 				if (*src2 == kShadowColor) {
@@ -142,7 +142,7 @@ void GraphicsMan::drawAsShadowSurface(Graphics::Surface *screen, int32 posX, int
  * use black (0) as a transparent color.
  */
 void GraphicsMan::drawTransparentWithBlendSurface(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s) {
-	byte *src1 = (byte *)s->getBasePtr(0, 0);
+	const byte *src1 = (const byte *)s->getBasePtr(0, 0);
 	byte *dst1 = (byte *)screen->getBasePtr(posX, posY);
 	byte *blendTable = (byte *)malloc(256);
 	for (int i = 0; i < 256; i++) {
@@ -150,7 +150,7 @@ void GraphicsMan::drawTransparentWithBlendSurface(Graphics::Surface *screen, int
 	}
 	for (int y = 0; y < s->h; y++) {
 		if (y + posY < screen->h && y + posY >= 0) {
-			byte *src2 = src1;
+			const byte *src2 = src1;
 			byte *dst2 = dst1;
 			for (int x = 0; x < s->w; x++, src2++, dst2++) {
 				if (*src2) {
diff --git a/engines/prince/mob.h b/engines/prince/mob.h
index ecf0eb4..cc60e36 100644
--- a/engines/prince/mob.h
+++ b/engines/prince/mob.h
@@ -44,7 +44,7 @@ public:
 		kMobVisible = 0,
 		kMobExamX = 14,
 		kMobExamY = 16,
-		kMobExamDir = 18,
+		kMobExamDir = 18
 	};
 
 	void setData(AttrId dataId, uint16 value);






More information about the Scummvm-git-logs mailing list