[Scummvm-cvs-logs] CVS: scummvm/bs2 build_display.cpp,1.22,1.23 console.cpp,1.9,1.10 interpreter.cpp,1.12,1.13 maketext.cpp,1.11,1.12 resman.cpp,1.41,1.42 router.cpp,1.14,1.15 speech.cpp,1.20,1.21 sword2.cpp,1.37,1.38 walker.cpp,1.5,1.6

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Tue Sep 23 23:41:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv11562

Modified Files:
	build_display.cpp console.cpp interpreter.cpp maketext.cpp 
	resman.cpp router.cpp speech.cpp sword2.cpp walker.cpp 
Log Message:
Replaced abs() with ABS and BOOL with bool, plus some minor cleanups.


Index: build_display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/build_display.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- build_display.cpp	21 Sep 2003 16:11:26 -0000	1.22
+++ build_display.cpp	24 Sep 2003 06:40:20 -0000	1.23
@@ -107,7 +107,7 @@
 // ---------------------------------------------------------------------------
 
 void Build_display(void) {	//Tony21Sept96
-	BOOL end;
+	bool end;
 #ifdef _SWORD2_DEBUG
 	uint8 pal[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0 };
 #endif

Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/console.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- console.cpp	9 Sep 2003 12:45:33 -0000	1.9
+++ console.cpp	24 Sep 2003 06:40:20 -0000	1.10
@@ -250,7 +250,7 @@
 
 	StartConsole();
 
-	while (TRUE)
+	while (1)
 	{
 		ServiceWindows();
 

Index: interpreter.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/interpreter.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- interpreter.cpp	21 Sep 2003 16:11:26 -0000	1.12
+++ interpreter.cpp	24 Sep 2003 06:40:20 -0000	1.13
@@ -424,7 +424,7 @@
 				*offset = ip;
 				return 2;
 			default:
-				ASSERT(FALSE);
+				ASSERT(false);
 			}
 			parameterReturnedFromMcodeFunction = retVal >> 3;
 			break;

Index: maketext.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/maketext.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- maketext.cpp	23 Sep 2003 06:23:29 -0000	1.11
+++ maketext.cpp	24 Sep 2003 06:40:20 -0000	1.12
@@ -152,9 +152,10 @@
 }
 
 uint16 AnalyseSentence(uint8 *sentence, uint16 maxWidth, uint32 fontRes, _lineInfo *line) {
-	uint16 pos = 0, wordWidth, wordLength, spaceNeeded, firstWord = TRUE;
+	uint16 pos = 0, wordWidth, wordLength, spaceNeeded;
 	uint16 lineNo = 0;
 	uint8 ch;
+	bool firstWord = true;
 
 	// joinWidth = how much extra space is needed to append a word to a
 	// line. NB. SPACE requires TWICE the 'char_spacing' to join a word
@@ -192,7 +193,7 @@
 
 			line[0].width = wordWidth;
 			line[0].length = wordLength;
-			firstWord = FALSE;
+			firstWord = false;
 		} else {
 			// see how much extra space this word will need to
 			// fit on current line (with a separating space

Index: resman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/resman.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- resman.cpp	23 Sep 2003 15:59:52 -0000	1.41
+++ resman.cpp	24 Sep 2003 06:40:21 -0000	1.42
@@ -1438,7 +1438,7 @@
 
 	do {
 		if (offNetwork == 1)
-			done = TRUE;
+			done = true;
 		else {
 			index = 0;
 			while (cdDrives[index] != 0 && !done && index < 24) {
@@ -1450,10 +1450,10 @@
 
 				if (!scumm_stricmp(sCDName,CD1_LABEL)) {
 					if (cd == CD1)
-						done = TRUE;
+						done = true;
 				} else if (!scumm_stricmp(sCDName,CD2_LABEL)) {
 					if (cd == CD2)
-						done = TRUE;
+						done = true;
 				}
 				index++;
 			}

Index: router.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/router.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- router.cpp	20 Sep 2003 15:34:53 -0000	1.14
+++ router.cpp	24 Sep 2003 06:40:22 -0000	1.15
@@ -877,7 +877,7 @@
 		stepX = stepX >> 19;	// quarter a step minimum
 		stepY = stepY >> 19;
 
-		if (abs(deltaX) >= abs(stepX) && abs(deltaY) >= abs(stepY)) {
+		if (ABS(deltaX) >= ABS(stepX) && ABS(deltaY) >= ABS(stepY)) {
 	 		modularPath[slidy].x = smoothPath[smooth].x;
 			modularPath[slidy].y = smoothPath[smooth].y;
 			modularPath[slidy].dir = smoothPath[smooth].dir;
@@ -1288,7 +1288,7 @@
 					lastErrorY = modularPath[p].y - walkAnim[stepCount - 7].y;
 
 					if (stepX == 0) {
-						if (3 * abs(lastErrorY) < abs(errorY)) {
+						if (3 * ABS(lastErrorY) < ABS(errorY)) {
 							// the last stop was
 							// closest
 							stepCount -= framesPerStep;
@@ -1298,7 +1298,7 @@
 							 	left = 0;
 						}
 					} else {
-						if (3 * abs(lastErrorX) < abs(errorX)) {
+						if (3 * ABS(lastErrorX) < ABS(errorX)) {
 							//the last stop was
 							// closest
 							stepCount -= framesPerStep;
@@ -1560,7 +1560,7 @@
 		stepX = stepX >> 16;
 		stepY = stepY >> 16;
 
-		if (abs(deltaX) >= abs(stepX) && abs(deltaY) >= abs(stepY)) {
+		if (ABS(deltaX) >= ABS(stepX) && ABS(deltaY) >= ABS(stepY)) {
 			modularPath[solid].x = smoothPath[smooth].x;
 			modularPath[solid].y = smoothPath[smooth].y;
 			modularPath[solid].dir = smoothPath[smooth].dir;
@@ -1954,10 +1954,10 @@
 					x2 = node[k].x;
 					y2 = node[k].y;
 
-					if (abs(x2 - x1) > 4.5 * abs(y2-y1))
-						distance = (8 * abs(x2 - x1) + 18 * abs(y2 - y1)) / (54 * 8) + 1;
+					if (ABS(x2 - x1) > 4.5 * ABS(y2-y1))
+						distance = (8 * ABS(x2 - x1) + 18 * ABS(y2 - y1)) / (54 * 8) + 1;
 					else
-						distance = (6 * abs(x2 - x1) + 36 * abs(y2 - y1)) / (36 * 14) + 1;
+						distance = (6 * ABS(x2 - x1) + 36 * ABS(y2 - y1)) / (36 * 14) + 1;
 
 					if (distance + node[i].dist < node[nnodes].dist && distance + node[i].dist < node[k].dist) {
 						if (NewCheck(0, x1, y1, x2, y2)) {

Index: speech.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/speech.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- speech.cpp	21 Sep 2003 16:11:26 -0000	1.20
+++ speech.cpp	24 Sep 2003 06:40:22 -0000	1.21
@@ -94,7 +94,6 @@
 int32 FN_i_speak(int32 *params);
 void LocateTalker(int32	*params);
 void Form_text(int32 *params);
-BOOL Is_anim_boxed(uint32 res);
 uint8 WantSpeechForLine(uint32 wavId);
 
 #ifdef _SWORD2_DEBUG
@@ -105,7 +104,7 @@
 	// params:	0 id
 	//		1 daves reference number
 
-	if (IN_SUBJECT==0) {
+	if (IN_SUBJECT == 0) {
 		// This is the start of the new subject list (James 07may97)
 		// Set the default repsonse id to zero in case we're never
 		// passed one

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- sword2.cpp	23 Sep 2003 16:38:37 -0000	1.37
+++ sword2.cpp	24 Sep 2003 06:40:22 -0000	1.38
@@ -323,7 +323,7 @@
 	InitialiseRenderCycle();
 	// Zdebug("RETURNED.");
 
-	while (TRUE) {
+	while (1) {
 		ServiceWindows();
 
 #ifdef _SWORD2_DEBUG

Index: walker.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/walker.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- walker.cpp	20 Sep 2003 12:43:11 -0000	1.5
+++ walker.cpp	24 Sep 2003 06:40:22 -0000	1.6
@@ -524,12 +524,12 @@
 
 	// Flat route
 
-	if (abs(deltaY) * diagonalx < abs(deltaX) * diagonaly / 2)
+	if (ABS(deltaY) * diagonalx < ABS(deltaX) * diagonaly / 2)
 		return (deltaX > 0) ? 2 : 6;
 
 	// Vertical route
 
-	if (abs(deltaY) * diagonalx / 2 > abs(deltaX) * diagonaly)
+	if (ABS(deltaY) * diagonalx / 2 > ABS(deltaX) * diagonaly)
 		return (deltaY > 0) ? 4 : 0;
 
 	// Diagonal route





More information about the Scummvm-git-logs mailing list