[Scummvm-cvs-logs] SF.net SVN: scummvm: [28887] scummvm/trunk/engines

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Sep 10 15:17:20 CEST 2007


Revision: 28887
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28887&view=rev
Author:   fingolfin
Date:     2007-09-10 06:17:20 -0700 (Mon, 10 Sep 2007)

Log Message:
-----------
Lots of source code formatting corrections

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/actor.cpp
    scummvm/trunk/engines/cruise/background.cpp
    scummvm/trunk/engines/cruise/backgroundIncrust.cpp
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/ctp.cpp
    scummvm/trunk/engines/cruise/decompiler.cpp
    scummvm/trunk/engines/cruise/font.cpp
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/gfxModule.cpp
    scummvm/trunk/engines/cruise/linker.cpp
    scummvm/trunk/engines/cruise/mainDraw.cpp
    scummvm/trunk/engines/cruise/menu.cpp
    scummvm/trunk/engines/cruise/overlay.cpp
    scummvm/trunk/engines/cruise/script.cpp
    scummvm/trunk/engines/lure/detection.cpp
    scummvm/trunk/engines/lure/fights.cpp
    scummvm/trunk/engines/lure/intro.cpp
    scummvm/trunk/engines/lure/lure.cpp
    scummvm/trunk/engines/lure/menu.cpp
    scummvm/trunk/engines/lure/res.cpp
    scummvm/trunk/engines/lure/screen.cpp
    scummvm/trunk/engines/lure/sound.cpp
    scummvm/trunk/engines/parallaction/staticres.cpp
    scummvm/trunk/engines/queen/cutaway.cpp
    scummvm/trunk/engines/saga/font.cpp
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/saga.cpp
    scummvm/trunk/engines/saga/sndres.cpp
    scummvm/trunk/engines/scumm/charset.cpp
    scummvm/trunk/engines/scumm/file_nes.cpp
    scummvm/trunk/engines/scumm/player_v2a.cpp
    scummvm/trunk/engines/sword1/logic.cpp
    scummvm/trunk/engines/sword1/router.cpp

Modified: scummvm/trunk/engines/cruise/actor.cpp
===================================================================
--- scummvm/trunk/engines/cruise/actor.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/actor.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -471,8 +471,7 @@
 	(*nclick)++;
 	ctpVar19 = ctpVar11;
 
-	if (*nclick == 2)	// second point
-	{
+	if (*nclick == 2) {	// second point
 		x1 = table_ptselect[0][0];
 		y1 = table_ptselect[0][1];
 		x2 = table_ptselect[1][0];
@@ -858,26 +857,18 @@
 								currentActor->phase = ANIM_PHASE_MOVE;
 						}
 
-						if ((currentActor->counter >=
-							0)
-						    && ((currentActor->phase ==
-							    ANIM_PHASE_STATIC_END)
-							|| (currentActor->
-							    phase ==
-							    ANIM_PHASE_STATIC)))
+						if ((currentActor->counter >= 0)
+						    && ((currentActor->phase == ANIM_PHASE_STATIC_END)
+							|| (currentActor->phase == ANIM_PHASE_STATIC)))
 						{
 							int newA;
 							int inc = 1;
-							int t_inc =
-							    currentActor->
-							    startDirection - 1;
+							int t_inc = currentActor->startDirection - 1;
 
 							if (t_inc < 0)
 								t_inc = 3;
 
-							if (currentActor->
-							    nextDirection ==
-							    t_inc)
+							if (currentActor->nextDirection == t_inc)
 								inc = -1;
 
 							if (inc > 0)

Modified: scummvm/trunk/engines/cruise/background.cpp
===================================================================
--- scummvm/trunk/engines/cruise/background.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/background.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -98,8 +98,7 @@
 			backgroundPtrtable[idx] =
 			    (uint8 *) mallocAndZero(320 * 200 /*64000 */ );
 		}
-/*		else
-		{
+/*		else {
 			backgroundPtrtable[idx] = hwMemAddr[idx];
 		} */
 	}

Modified: scummvm/trunk/engines/cruise/backgroundIncrust.cpp
===================================================================
--- scummvm/trunk/engines/cruise/backgroundIncrust.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/backgroundIncrust.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -113,8 +113,7 @@
 	newElement->ptr = NULL;
 	strcpy(newElement->name, filesDatabase[params.fileIdx].subData.name);
 
-	if (filesDatabase[params.fileIdx].subData.resourceType == 4)	// sprite
-	{
+	if (filesDatabase[params.fileIdx].subData.resourceType == 4) {	// sprite
 		int width = filesDatabase[params.fileIdx].width;
 		int height = filesDatabase[params.fileIdx].height;
 
@@ -125,8 +124,7 @@
 		    newElement->Y, newElement->X, (char *)backgroundPtr,
 		    (char *)filesDatabase[params.fileIdx].subData.ptr);
 		//   ASSERT(0);
-	} else			// poly
-	{
+	} else {			// poly
 		/* if(param4 == 1)
 		 * {
 		 * int var_A;

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -627,192 +627,98 @@
 	cellStruct *currentObject = cellHead.prev;
 
 	while (currentObject) {
-		if (currentObject->overlay >= 0) {
-			if (overlayTable[currentObject->overlay].alreadyLoaded) {
-				if (currentObject->type == 4
-				    || currentObject->type == 1
-				    || currentObject->type == 9
-				    || currentObject->type == 3) {
-					strcpy(objectName,
-					    getObjectName(currentObject->idx,
-						overlayTable[currentObject->
-						    overlay].ovlData->
-						specialString2));
+		if (currentObject->overlay >= 0 && overlayTable[currentObject->overlay].alreadyLoaded
+		     && (currentObject->type == 4 || currentObject->type == 1
+			  || currentObject->type == 9 || currentObject->type == 3)) {
+			strcpy(objectName,
+				getObjectName(currentObject->idx,
+					overlayTable[currentObject->overlay].ovlData->specialString2));
 
-					if (strlen(objectName)) {
-						if (currentObject->freeze == 0) {
-							var_2 =
-							    currentObject->idx;
-							var_4 =
-							    currentObject->
-							    overlay;
-							var_14 =
-							    currentObject->
-							    followObjectIdx;
-							var_16 =
-							    currentObject->
-							    followObjectOverlayIdx;
+			if (strlen(objectName)) {
+				if (currentObject->freeze == 0) {
+					var_2 = currentObject->idx;
+					var_4 = currentObject->overlay;
+					var_14 = currentObject->followObjectIdx;
+					var_16 = currentObject->followObjectOverlayIdx;
 
-							getMultipleObjectParam
-							    (currentObject->
-							    overlay,
-							    currentObject->idx,
-							    &params);
+					getMultipleObjectParam(currentObject->overlay, currentObject->idx, &params);
 
-							var_10 = 0;
-							var_E = 0;
-							var_C = 0;
+					var_10 = 0;
+					var_E = 0;
+					var_C = 0;
 
-							if ((var_4 != var_16)
-							    && (var_2 !=
-								var_14)) {
-								getMultipleObjectParam
-								    (var_16,
-								    var_14,
-								    &params);
+					if ((var_4 != var_16)
+						&& (var_2 != var_14)) {
+						getMultipleObjectParam
+							(var_16, var_14, &params);
 
-								var_C =
-								    params.X;
-								var_E =
-								    params.Y;
-								var_10 =
-								    params.
-								    fileIdx;
-							}
+						var_C = params.X;
+						var_E = params.Y;
+						var_10 = params.fileIdx;
+					}
 
-							if (params.var5 >= 0
-							    && params.
-							    fileIdx >= 0) {
-								if (currentObject->type == 3) {
-									assert
-									    (0);
+					if (params.var5 >= 0 && params.fileIdx >= 0) {
+						if (currentObject->type == 3) {
+							assert(0);
 
-									var_2 =
-									    params.
-									    scale;
-									var_A =
-									    params.
-									    X +
-									    var_C;
+							var_2 = params.scale;
+							var_A = params.X + var_C;
 
-									// TODO: this var3 is stupid, investigate...
-									if ((var_A <= mouseX) && (var_A + params.fileIdx >= mouseX) && (mouseY >= params.Y + var_E) && (params.Y + var_E + var2 >= mouseY)) {
-										*outX
-										    =
-										    var_16;
-										*outY
-										    =
-										    var_14;
+							// TODO: this var3 is stupid, investigate...
+							if ((var_A <= mouseX) && (var_A + params.fileIdx >= mouseX) && (mouseY >= params.Y + var_E) && (params.Y + var_E + var2 >= mouseY)) {
+								*outX = var_16;
+								*outY = var_14;
 
-										return
-										    (currentObject->
-										    type);
-									}
-								} else
-								    if
-								    (currentObject->
-								    type == 4
-								    ||
-								    currentObject->
-								    type == 1
-								    ||
-								    currentObject->
-								    type ==
-								    9) {
-									int si;
-									int var_8;
-									int di;
+								return (currentObject->type);
+							}
+						} else if (currentObject->type == 4 ||
+							currentObject->type == 1 ||
+							currentObject->type == 9) {
+							int si;
+							int var_8;
+							int di;
 
-									var_A =
-									    params.
-									    X +
-									    var_C;
-									var_6 =
-									    params.
-									    Y +
-									    var_E;
+							var_A = params.X + var_C;
+							var_6 = params.Y + var_E;
 
-									di = params.fileIdx;
+							di = params.fileIdx;
 
-									if (di
-									    <
-									    0)
-									{
-										di += var_10;
-									}
+							if (di < 0) {
+								di += var_10;
+							}
 
-/*                  if((filesDatabase[di].subData.resourceType == 8) && (filesDatabase[di].subData.ptr))
-                  {
-                    assert(0);
-                  }
-                  else */
-									{
-										var_4
-										    =
-										    filesDatabase
-										    [di].
-										    resType;
+/*		                  if((filesDatabase[di].subData.resourceType == 8) && (filesDatabase[di].subData.ptr)) {
+								assert(0);
+							}
+*/
+							{
+								var_4 = filesDatabase[di].resType;
 
+								if (var_4 == 1) {
+									var_C = filesDatabase[di].widthInColumn / 2;
+								} else {
+									var_C = filesDatabase[di].width;
+								}
+
+								var_8 = filesDatabase[di].height;
+
+								var_2 = mouseX - var_A;
+								si = mouseY - var_6;
+
+								if (var_2 > 0 && var_C > var_2 && si > 0 && var_8 >= si) {
+									if (filesDatabase[di].subData.ptr) {
 										if (var_4 == 1) {
-											var_C
-											    =
-											    filesDatabase
-											    [di].
-											    widthInColumn
-											    /
-											    2;
 										} else {
-											var_C
-											    =
-											    filesDatabase
-											    [di].
-											    width;
 										}
 
-										var_8
-										    =
-										    filesDatabase
-										    [di].
-										    height;
+										printf("should compare to mask in getCursorFromObject...\n");
 
-										var_2
-										    =
-										    mouseX
-										    -
-										    var_A;
-										si = mouseY - var_6;
+										*outX = var_16;
+										*outY = var_14;
 
-										if (var_2 > 0) {
-											if (var_C > var_2) {
-												if (si > 0) {
-													if (var_8 >= si) {
-														if (filesDatabase[di].subData.ptr) {
-															if (var_4 == 1) {
-															} else {
-															}
+										printf("Selected: %s\n", objectName);
 
-															printf
-															    ("should compare to mask in getCursorFromObject...\n");
-
-															*outX
-															    =
-															    var_16;
-															*outY
-															    =
-															    var_14;
-
-															printf
-															    ("Selected: %s\n",
-															    objectName);
-
-															return
-															    currentObject->
-															    type;
-														}
-													}
-												}
-											}
-										}
+										return currentObject->type;
 									}
 								}
 							}
@@ -878,52 +784,22 @@
 	menuStruct *pMenu;
 
 	pMenu = createMenu(X, Y, "Inventaire");
-
 	menuTable[1] = pMenu;
 
-	if (pMenu) {
-		numObjectInInventory = 0;
+	if (pMenu && numOfLoadedOverlay > 1) {
+		for (int i = 1; i < numOfLoadedOverlay; i++) {
+			ovlDataStruct *pOvlData = overlayTable[i].ovlData;
 
-		if (numOfLoadedOverlay > 1) {
-			int i;
+			if (pOvlData && pOvlData->objDataTable && pOvlData->numObjData) {
+				for (int j = 0; j < pOvlData->numObjData; j++) {
+					if (buildInventorySub1(i, j) != 3) {
+						int16 returnVar;
 
-			for (i = 1; i < numOfLoadedOverlay; i++) {
-				ovlDataStruct *pOvlData =
-				    overlayTable[i].ovlData;
+						getSingleObjectParam(i, j, 5, &returnVar);
 
-				if (pOvlData && pOvlData->objDataTable) {
-					int var_2;
-
-					var_2 = 0;
-
-					if (pOvlData->numObjData) {
-						int j;
-
-						for (j = 0;
-						    j < pOvlData->numObjData;
-						    j++) {
-							if (buildInventorySub1
-							    (i, j) != 3) {
-								int16
-								    returnVar;
-
-								getSingleObjectParam
-								    (i, j, 5,
-								    &returnVar);
-
-								if (returnVar <
-								    -1) {
-									addSelectableMenuEntry
-									    (i,
-									    j,
-									    pMenu,
-									    1,
-									    -1,
-									    getObjectName
-									    (j, pOvlData->specialString2));
-									numObjectInInventory++;
-								}
-							}
+						if (returnVar < -1) {
+							addSelectableMenuEntry(i, j, pMenu, 1, -1, getObjectName(j, pOvlData->specialString2));
+							numObjectInInventory++;
 						}
 					}
 				}
@@ -1014,12 +890,9 @@
 					    var_34->stringNameOffset);
 
 					if (var_2 == param0) {
-						if (param1 ==
-						    var_34->stringNameOffset) {
+						if (param1 == var_34->stringNameOffset) {
 							if (pObject) {
-								if (pObject->
-								    type !=
-								    3) {
+								if (pObject->type != 3) {
 									char var_214[80];
 									char var_1C4[80];
 									char var_174[80];
@@ -1027,110 +900,52 @@
 									char var_D4[80];
 									char var_84[80];
 
-									ovlDataStruct
-									    *var_12;
-									ovlDataStruct
-									    *var_22;
+									ovlDataStruct *var_12;
+									ovlDataStruct *var_22;
 
 									int var_E = var_34->varIdx;
-									int cx
-									    =
-									    var_34->
-									    stringIdx;
+									int cx = var_34->stringIdx;
 									int var_C = var_34->procIdx;
 
-									int di
-									    =
-									    var_E;
+									int di = var_E;
 									if (var_E == 0)
 										di = var_1E;
 
-									var_2 =
-									    cx;
-									if (cx
-									    ==
-									    0)
-										var_2
-										    =
-										    var_1E;
+									var_2 = cx;
+									if (cx == 0)
+										var_2 = var_1E;
 
 									if (var_C == 0)
-										var_C
-										    =
-										    var_1E;
+										var_C = var_1E;
 
-									var_12
-									    =
-									    NULL;
-									var_22
-									    =
-									    NULL;
+									var_12 = NULL;
+									var_22 = NULL;
 
-									var_214
-									    [0]
-									    =
-									    0;
-									var_1C4
-									    [0]
-									    =
-									    0;
-									var_174
-									    [0]
-									    =
-									    0;
-									var_124
-									    [0]
-									    =
-									    0;
-									var_D4
-									    [0]
-									    =
-									    0;
-									var_84
-									    [0]
-									    =
-									    0;
+									var_214[0] = 0;
+									var_1C4[0] = 0;
+									var_174[0] = 0;
+									var_124[0] = 0;
+									var_D4[0] = 0;
+									var_84[0] = 0;
 
-									if (di
-									    >
-									    0)
-									{
-										var_22
-										    =
-										    overlayTable
-										    [di].
-										    ovlData;
+									if (di > 0) {
+										var_22 = overlayTable[di].ovlData;
 									}
 
 									if (var_2 > 0) {
-										var_12
-										    =
-										    overlayTable
-										    [var_2].
-										    ovlData;
+										var_12 = overlayTable[var_2].ovlData;
 									}
 
 									if (var_12) {
 										if (var_34->stringNameOffset) {
-											var_30
-											    =
-											    var_34->
-											    field_1A;
+											var_30 = var_34->field_1A;
 											if (var_28) {
 												if (var_12->specialString2) {
 													if (var_30 == -1 || var_30 == returnVar) {
 														char *ptrName = getObjectName(var_34->stringNameOffset, var_12->specialString2);
 
-														menuTable
-														    [0]
-														    =
-														    createMenu
-														    (x,
-														    y,
-														    ptrName);
-														var_28
-														    =
-														    0;
+														menuTable[0] = createMenu(x, y, ptrName);
+														var_28 = 0;
 													}
 												}
 											}
@@ -1138,8 +953,7 @@
 									}
 
 									if (var_22) {
-										if (true /*var_34->varNameOffset>=0 */ )	// FIXME: This check is always true since varNameOffset is unsigned
-										{
+										if (true /*var_34->varNameOffset>=0 */ ) {	// FIXME: This check is always true since varNameOffset is unsigned
 											if (var_22->specialString1) {
 												char *ptr = getObjectName(var_34->varNameOffset, var_22->specialString1);
 
@@ -1289,8 +1103,7 @@
 				ASSERT(0);
 			}
 
-			if (var38 == 0)	// are we in inventory mode ?
-			{
+			if (var38 == 0) {	// are we in inventory mode ?
 				if (menuTable[0] == 0) {
 					int X;
 					int Y;

Modified: scummvm/trunk/engines/cruise/ctp.cpp
===================================================================
--- scummvm/trunk/engines/cruise/ctp.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/ctp.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -66,16 +66,14 @@
 	short int *cur_ctp_routeCoords = (short int *)ctp_routeCoords;	// coordinates table
 	int8 *cur_ctp_routes = (int8 *) ctp_routes;
 
-	for (i = 0; i < coordCount; i++)	// for i < ctp_routeCoordCount
-	{
+	for (i = 0; i < coordCount; i++) {	// for i < ctp_routeCoordCount
 		int varX = cur_ctp_routeCoords[0];	// x
 		int varY = cur_ctp_routeCoords[1];	// y 
 
 		int di = 0;
 		int var4Offset = 2;
 
-		while (*(int16 *) cur_ctp_routes > di)	// while (coordCount > counter++)
-		{
+		while (*(int16 *) cur_ctp_routes > di) {	// while (coordCount > counter++)
 			int idx = *(int16 *) (cur_ctp_routes + var4Offset);
 			ptr[offset + idx] =
 			    ctpProc2(varX, varY, ctp_routeCoords[idx][0],
@@ -189,8 +187,7 @@
 
 	ASSERT(boxIdx <= 15);
 
-	if (_walkboxTable[boxIdx * 40] > 0)	// is walkbox used ?
-	{
+	if (_walkboxTable[boxIdx * 40] > 0) {	// is walkbox used ?
 		getWalkBoxCenter(boxIdx, _walkboxTable);
 
 		currentWalkBoxCenterYBis = currentWalkBoxCenterY;

Modified: scummvm/trunk/engines/cruise/decompiler.cpp
===================================================================
--- scummvm/trunk/engines/cruise/decompiler.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/decompiler.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -136,52 +136,47 @@
 
 void resolveDecompShort(char *buffer) {
 	ovlData3Struct *data3Ptr = currentScript;
+	int i;
 
-	{
-		int i;
+	importScriptStruct *importEntry =
+		(importScriptStruct *) (data3Ptr->dataPtr +
+		data3Ptr->offsetToImportData);
 
-		importScriptStruct *importEntry =
-		    (importScriptStruct *) (data3Ptr->dataPtr +
-		    data3Ptr->offsetToImportData);
-
-		for (i = 0; i < data3Ptr->numImport; i++) {
-			switch (importEntry->type) {
-			case 20:	// script
-			case 30:
-			case 40:
-			case 50:
-				{
-					if (importEntry->offset == currentDecompScriptPtr->var4 - 3)	// param1
-					{
-						sprintf(buffer,
-						    data3Ptr->dataPtr +
-						    data3Ptr->
-						    offsetToImportName +
-						    importEntry->offsetToName);
-						return;
-					}
-					if (importEntry->offset == currentDecompScriptPtr->var4 - 6)	// param2
-					{
-						sprintf(buffer, "linkedIdx");
-						return;
-					}
-					break;
+	for (i = 0; i < data3Ptr->numImport; i++) {
+		switch (importEntry->type) {
+		case 20:	// script
+		case 30:
+		case 40:
+		case 50:
+			{
+				if (importEntry->offset == currentDecompScriptPtr->var4 - 3) {	// param1
+					sprintf(buffer,
+						data3Ptr->dataPtr +
+						data3Ptr->
+						offsetToImportName +
+						importEntry->offsetToName);
+					return;
 				}
-			default:
-				{
-					if (importEntry->offset ==
-					    currentDecompScriptPtr->var4 - 4) {
-						sprintf(buffer,
-						    data3Ptr->dataPtr +
-						    data3Ptr->
-						    offsetToImportName +
-						    importEntry->offsetToName);
-						return;
-					}
+				if (importEntry->offset == currentDecompScriptPtr->var4 - 6) {	// param2
+					sprintf(buffer, "linkedIdx");
+					return;
 				}
+				break;
 			}
-			importEntry++;
+		default:
+			{
+				if (importEntry->offset ==
+					currentDecompScriptPtr->var4 - 4) {
+					sprintf(buffer,
+						data3Ptr->dataPtr +
+						data3Ptr->
+						offsetToImportName +
+						importEntry->offsetToName);
+					return;
+				}
+			}
 		}
+		importEntry++;
 	}
 
 	buffer[0] = 0;
@@ -190,31 +185,28 @@
 
 void resolveDecompChar(char *buffer) {
 	ovlData3Struct *data3Ptr = currentScript;
+	int i;
 
-	{
-		int i;
+	importScriptStruct *importEntry =
+		(importScriptStruct *) (data3Ptr->dataPtr +
+		data3Ptr->offsetToImportData);
 
-		importScriptStruct *importEntry =
-		    (importScriptStruct *) (data3Ptr->dataPtr +
-		    data3Ptr->offsetToImportData);
-
-		for (i = 0; i < data3Ptr->numImport; i++) {
-			switch (importEntry->type) {
-			default:
-				{
-					if (importEntry->offset ==
-					    currentDecompScriptPtr->var4 - 2) {
-						sprintf(buffer,
-						    data3Ptr->dataPtr +
-						    data3Ptr->
-						    offsetToImportName +
-						    importEntry->offsetToName);
-						return;
-					}
+	for (i = 0; i < data3Ptr->numImport; i++) {
+		switch (importEntry->type) {
+		default:
+			{
+				if (importEntry->offset ==
+					currentDecompScriptPtr->var4 - 2) {
+					sprintf(buffer,
+						data3Ptr->dataPtr +
+						data3Ptr->
+						offsetToImportName +
+						importEntry->offsetToName);
+					return;
 				}
 			}
-			importEntry++;
 		}
+		importEntry++;
 	}
 
 	buffer[0] = 0;
@@ -342,16 +334,14 @@
 
 		for (i = 0; i < currentDecompOvl->numExport; i++) {
 			if (varIdx == currentDecompOvl->exportDataPtr[i].idx) {
-				if (((currentDecompOvl->exportDataPtr[i].var4 & 0xF0) == 0) && varType != 0x20)	// var
-				{
+				if (((currentDecompOvl->exportDataPtr[i].var4 & 0xF0) == 0) && varType != 0x20) {	// var
 					strcpy(outputName,
 					    currentDecompOvl->exportNamesPtr +
 					    currentDecompOvl->exportDataPtr[i].
 					    offsetToName);
 					return;
 				}
-				if ((currentDecompOvl->exportDataPtr[i].var4) == 20 && varType == 0x20)	// script
-				{
+				if ((currentDecompOvl->exportDataPtr[i].var4) == 20 && varType == 0x20) {	// script
 					strcpy(outputName,
 					    currentDecompOvl->exportNamesPtr +
 					    currentDecompOvl->exportDataPtr[i].
@@ -722,13 +712,11 @@
   if(!pop)
     si = 1;
 
-  if(pop<0)
-  {
+  if(pop<0) {
     si |= 4;
   }
 
-  if(pop>0)
-  {
+  if(pop>0) {
     si |= 2;
   }
 
@@ -1435,7 +1423,7 @@
 }
 
 void generateIndentation(void) {
-	int i;
+	int i, j;
 
 	for (i = 0; i < positionInDecompileLineTable; i++) {
 		if (decompileLineTable[i].type != 0) {
@@ -1449,37 +1437,25 @@
 			gotoStatement = strchr(gotoStatement, ' ') + 1;
 
 			destLine = atoi(gotoStatement);
+			destLineIdx = -1;
 
-			{
-				int j;
+			for (j = 0; j < positionInDecompileLineTable; j++) {
+				if (decompileLineTable[j].lineOffset == destLine) {
+					destLineIdx = j;
+					break;
+				}
+			}
 
-				destLineIdx = -1;
+			assert(destLineIdx != -1);
 
-				for (j = 0; j < positionInDecompileLineTable;
-				    j++) {
-					if (decompileLineTable[j].lineOffset ==
-					    destLine) {
-						destLineIdx = j;
-						break;
-					}
+			if (destLineIdx > i) {
+				for (j = i + 1; j < destLineIdx; j++) {
+					decompileLineTable[j].indent++;
 				}
 
-				assert(destLineIdx != -1);
-
-				if (destLineIdx > i) {
-					int j;
-
-					for (j = i + 1; j < destLineIdx; j++) {
-						decompileLineTable[j].indent++;
-					}
-
-					if (strstr(decompileLineTable
-						[destLineIdx - 1].line,
-						"goto") ==
-					    decompileLineTable[destLineIdx -
-						1].line) {
-						//decompileLineTable[destLineIdx-1].pendingElse = 1;
-					}
+				if (strstr(decompileLineTable[destLineIdx - 1].line, "goto") ==
+					decompileLineTable[destLineIdx - 1].line) {
+					//decompileLineTable[destLineIdx-1].pendingElse = 1;
 				}
 			}
 		}

Modified: scummvm/trunk/engines/cruise/font.cpp
===================================================================
--- scummvm/trunk/engines/cruise/font.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/font.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -253,8 +253,7 @@
 	outBufferPtr += heightOff * width * 2;	// param2 = height , param6 = width
 	outBufferPtr += drawPosPixel_X;	// param1 = drawPosPixel_X
 
-	for (i = 0; i < height; i++)	// y++
-	{
+	for (i = 0; i < height; i++) {	// y++
 		uint16 currentColor1 =
 		    (*(fontPtr_Data) << 8) | *(fontPtr_Data + 1);
 		uint16 currentColor2 =

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/function.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -1006,8 +1006,7 @@
 	return pNewElement;
 }
 
-int removeAnimation(actorStruct * pHead, int overlay, int objIdx, int objType)
-{
+int removeAnimation(actorStruct * pHead, int overlay, int objIdx, int objType) {
 	actorStruct* pl;
 	actorStruct* pl2;
 	actorStruct* pl3;
@@ -1019,14 +1018,12 @@
 	pl2 = pl;
 	pl = pl2->next;
 
-	while(pl)
-	{
+	while (pl) {
 		pl2 = pl;
 
-		if(((pl->overlayNumber == overlay) || (overlay == -1)) &&
+		if (((pl->overlayNumber == overlay) || (overlay == -1)) &&
 			((pl->idx == objIdx) || (objIdx == -1)) &&
-			((pl->type == objType) || (objType == -1)))
-		{
+			((pl->type == objType) || (objType == -1))) {
 			pl->type = -1;
 		}
 
@@ -1037,29 +1034,25 @@
 	pl2 = pl;
 	pl = pl2->next;
 
-	while(pl)
-	{
-		if(pl->type == -1)
-		{
+	while (pl) {
+		if (pl->type == -1) {
 			pl4 = pl->next;
 			pl2->next = pl4;
 			pl3 = pl4;
 
-			if(pl3 == NULL)
+			if (pl3 == NULL)
 				pl3 = pHead;
 
 			pl3->prev = pl->prev;
 
 			dir = pl->startDirection;
 
-			if(pl->idx >= 0)
+			if (pl->idx >= 0)
 				freePerso(pl->idx);
 
 			free(pl);
 			pl = pl4;
-		}
-		else
-		{
+		} else {
 			pl2 = pl;
 			pl = pl2->next;
 		}

Modified: scummvm/trunk/engines/cruise/gfxModule.cpp
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/gfxModule.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -526,10 +526,8 @@
 		int i;
 		int j;
 
-		for(i=x;i<height+x;i++)
-		{
-			for(j=y;j<width*16+y;j++)
-			{
+		for(i=x;i<height+x;i++) {
+			for(j=y;j<width*16+y;j++) {
 				if(i>=0&&i<200&&j>=0&&j<320)
 					destPtr[i*320+j] = *(sourcePtr++);
 			}

Modified: scummvm/trunk/engines/cruise/linker.cpp
===================================================================
--- scummvm/trunk/engines/cruise/linker.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/linker.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -186,70 +186,36 @@
 								int temp =
 								    ptrImportData->
 								    offset;
-								if (out1)	//is sub function... (ie  'invent.livre:s')
-								{
+								if (out1) {	//is sub function... (ie  'invent.livre:s')
 									uint8 *ptr = ptrData + temp;
 
-									*(ptr +
-									    1)
-									    =
-									    out2;
-									*(int16
-									    *)
-									    (ptr
-									    +
-									    2)
-									    =
-									    ptrDest2->
-									    idx;
+									*(ptr + 1) = out2;
+									*(int16 *)(ptr + 2) = ptrDest2->idx;
 
-									flipShort
-									    (
-									    (int16
-										*)
-									    (ptr + 2));
+									flipShort((int16 *)(ptr + 2));
 								} else {
-									if (param2 == 20 || param2 == 30 || param2 == 40 || param2 == 50)	// this patch a double push
-									{
-										uint8
-										    *
-										    ptr
-										    =
-										    ptrData
-										    +
-										    temp;
+									if (param2 == 20 || param2 == 30 || param2 == 40 || param2 == 50) {	// this patch a double push
+										uint8 *ptr = ptrData + temp;
 
 										*(ptr + 1) = 0;
 										*(ptr + 2) = out2;	// update the overlay number
 
-										*(int16 *) (ptr + 4) = ptrDest2->idx;
+										*(int16 *)(ptr + 4) = ptrDest2->idx;
 
-										flipShort
-										    (
-										    (int16
-											*)
-										    (ptr + 4));
+										flipShort((int16 *)(ptr + 4));
 									} else {
 										int var_4 = ptrDest2->var4;
 
 										if (var_4 & 1) {
-											param2
-											    =
-											    8;
+											param2 = 8;
 										} else {
-											param2
-											    =
-											    16;
+											param2 = 16;
 										}
 
 										if (var_4 >= 0 && var_4 <= 3) {
-											param2
-											    |=
-											    5;
+											param2 |= 5;
 										} else {
-											param2
-											    |=
-											    6;
+											param2 |= 6;
 										}
 
 										*(ptrData + temp) = param2;

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -24,7 +24,8 @@
  */
 
 #include "cruise/cruise_main.h"
-#include "polys.h"
+#include "cruise/polys.h"
+#include "common/util.h"
 
 namespace Cruise {
 
@@ -131,8 +132,7 @@
 
 		newFileIndex += fileIndex;
 
-		if (true /*newFileIndex >= 0 */ )	// FIXME: comparison is always true due to limited range of data type
-		{
+		if (true /*newFileIndex >= 0 */ ) {	// FIXME: comparison is always true due to limited range of data type
 			if (filesDatabase[newFileIndex].resType == 0
 			    && filesDatabase[newFileIndex].subData.ptr) {
 				dataPtr =
@@ -180,8 +180,7 @@
 	int lowerBorder;
 	m_flipLeftRight = 0;
 
-	if (scale < 0)		// flip left right
-	{
+	if (scale < 0) {		// flip left right
 		m_flipLeftRight = 1;
 		scale = -scale;
 	}
@@ -208,11 +207,8 @@
 
 	upperBorder = (upscaleValue(upperBorder, scale) + 0x8000) >> 16;
 
-	if (upperBorder < lowerBorder)	// exchange borders if lower > upper
-	{
-		int temp = upperBorder;
-		upperBorder = lowerBorder;
-		lowerBorder = temp;
+	if (upperBorder < lowerBorder) {	// exchange borders if lower > upper
+		SWAP(upperBorder, lowerBorder);
 	}
 
 	sizeTable[0] = lowerBorder;	// left
@@ -231,11 +227,8 @@
 	upperBorder -= *(dataPtr + 4);
 	upperBorder = (upscaleValue(upperBorder, scale) + 0x8000) >> 16;
 
-	if (upperBorder < lowerBorder)	// exchange borders if lower > upper
-	{
-		int temp = upperBorder;
-		upperBorder = lowerBorder;
-		lowerBorder = temp;
+	if (upperBorder < lowerBorder) {	// exchange borders if lower > upper
+		SWAP(upperBorder, lowerBorder);
 	}
 
 	sizeTable[2] = lowerBorder;	// bottom
@@ -397,8 +390,7 @@
 		m_flipLeftRight = 1;
 	}
 
-	if (scale < 0x180)	// If scale is smaller than 384
-	{
+	if (scale < 0x180) {	// If scale is smaller than 384
 		m_useSmallScale = 1;
 		m_scaleValue = scale << 1;	// double scale
 	} else {
@@ -448,8 +440,7 @@
 		x = *(dataPointer++) - m_first_X;
 		y = *(dataPointer++) - m_first_Y;
 
-		if (m_useSmallScale)	// shrink all coordinates by factor 2 if a scale smaller than 384 is used
-		{
+		if (m_useSmallScale) {	// shrink all coordinates by factor 2 if a scale smaller than 384 is used
 			x >>= 1;
 			y >>= 1;
 		}
@@ -502,8 +493,7 @@
 	do {
 		int linesToDraw = *dataPointer++;
 
-		if (linesToDraw > 1)	// if value not zero
-		{
+		if (linesToDraw > 1) {	// if value not zero
 			uint16 minimumScale;
 
 			m_color = *dataPointer;	// color
@@ -514,8 +504,7 @@
 
 			flipShort(&minimumScale);
 
-			if (minimumScale > scale)	// if the scale is too small, for the model to be drawn ...
-			{
+			if (minimumScale > scale) {	// if the scale is too small, for the model to be drawn ...
 				dataPointer += linesToDraw;	// ... skip ahead
 			} else {
 				if (m_flipLeftRight) {
@@ -913,13 +902,10 @@
 			}
 
 			if ((params.var5 >= 0) && (objZ2 >= 0) && filesDatabase[objZ2].subData.ptr) {
-				if (filesDatabase[objZ2].subData.resourceType == 8)	// Poly
-				{
+				if (filesDatabase[objZ2].subData.resourceType == 8) {	// Poly
 					mainDrawPolygons(objZ2, currentObjPtr, objX2, params.scale, objY2, (char *)gfxModuleData.pPage10, (char *)filesDatabase[objZ2].subData.ptr);	// poly
-				} else if (filesDatabase[objZ2].subData.resourceType == 6)	// sound
-				{
-				} else if (filesDatabase[objZ2].resType == 1)	//(num plan == 1)
-				{
+				} else if (filesDatabase[objZ2].subData.resourceType == 6) {	// sound
+				} else if (filesDatabase[objZ2].resType == 1) {	//(num plan == 1)
 				} else if (filesDatabase[objZ2].subData.resourceType == 4) {
 					objX1 = filesDatabase[objZ2].width;	// width
 					spriteHeight = filesDatabase[objZ2].height;	// height
@@ -953,12 +939,10 @@
 								change = false;
 								currentObjPtr->animStep = 0;
 
-								if (currentObjPtr->animType)	// should we resume the script ?
-								{
+								if (currentObjPtr->animType) {	// should we resume the script ?
 									if (currentObjPtr->parentType == 20) {
 										changeScriptParamInList(currentObjPtr->parentOverlay, currentObjPtr->parent, &procHead, 0, -1);
-									}
-									else if(currentObjPtr->parentType == 30) {
+									} else if (currentObjPtr->parentType == 30) {
 										changeScriptParamInList(currentObjPtr->parentOverlay, currentObjPtr->parent, &relHead,  0, -1);
 									}
 								}

Modified: scummvm/trunk/engines/cruise/menu.cpp
===================================================================
--- scummvm/trunk/engines/cruise/menu.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/menu.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -221,8 +221,7 @@
 			freeStuff2();
 		}
 /*
-    if(currentMenu)
-    {
+    if(currentMenu) {
       freeMenu(currentMenu);
       currentMenu = 0;
       var37 = 0;
@@ -230,8 +229,7 @@
       main9 = -1;
     }
 
-    if(inventoryMenu)
-    {
+    if(inventoryMenu) {
       freeMenu(inventoryMenu);
       inventoryMenu = 0;
       var37 = 0;
@@ -239,8 +237,7 @@
       main9 = -1;
     }*/
 
-/*    if(mouseVar2)
-    {
+/*    if(mouseVar2) {
       free3(mouseVar2);
     } */
 

Modified: scummvm/trunk/engines/cruise/overlay.cpp
===================================================================
--- scummvm/trunk/engines/cruise/overlay.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/overlay.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -375,8 +375,7 @@
 		if (!ovlData->ptr8) {
 /*      releaseScript(scriptIdx,scriptName);
 
-      if(freeIsNeeded)
-      {
+      if(freeIsNeeded) {
         freePtr(unpackedBuffer);
       } */
 
@@ -396,8 +395,7 @@
 		if (!ovlData->objDataTable) {
 /*      releaseScript(scriptIdx,scriptName);
 
-      if(freeIsNeeded)
-      {
+      if(freeIsNeeded) {
         freePtr(unpackedBuffer);
       } */
 
@@ -457,8 +455,7 @@
 		if (!ovlData->objData2WorkTable) {
 /*      releaseScript(scriptIdx,scriptName);
 
-      if(freeIsNeeded)
-      {
+      if(freeIsNeeded) {
         freePtr(unpackedBuffer);
       } */
 
@@ -474,8 +471,7 @@
 		if (!ovlData->objData2SourceTable) {
 /*      releaseScript(scriptIdx,scriptName);
 
-      if(freeIsNeeded)
-      {
+      if(freeIsNeeded) {
         freePtr(unpackedBuffer);
       } */
 
@@ -501,8 +497,7 @@
 		}
 	}
 
-/*  if(freeIsNeeded)
-  {
+/*  if(freeIsNeeded) {
     freePtr(unpackedBuffer);
   } */
 
@@ -701,14 +696,12 @@
 	if (!ovlDataPtr)
 		return -4;
 /*
-  if(overlayTable[overlayIdx].var1E)
-  {
+  if(overlayTable[overlayIdx].var1E) {
     free(overlayTable[overlayIdx].var1E);
     overlayTable[overlayIdx].var1E = NULL;
   }
 
-  if(overlayTable[overlayIdx].var16)
-  {
+  if(overlayTable[overlayIdx].var16) {
     free(overlayTable[overlayIdx].var16);
     overlayTable[overlayIdx].var16 = NULL;
   } */

Modified: scummvm/trunk/engines/cruise/script.cpp
===================================================================
--- scummvm/trunk/engines/cruise/script.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/cruise/script.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -73,8 +73,7 @@
 
 			if (!byte2) {
 				ptr = scriptDataPtrTable[var_E] + short1;
-			} else	// TODO: 
-			{
+			} else	{ // TODO:
 				if (!overlayTable[byte2].alreadyLoaded) {
 					return (-7);
 				}
@@ -145,8 +144,7 @@
 
 			if (!byte2) {
 				ptr = scriptDataPtrTable[var_E] + var_12;
-			} else	// TODO: 
-			{
+			} else	{ // TODO:
 				if (!overlayTable[byte2].alreadyLoaded) {
 					return (-7);
 				}
@@ -635,8 +633,7 @@
 
 	oldTail = scriptHandlePtr;
 
-	while (oldTail->nextScriptPtr)	// go to the end of the list
-	{
+	while (oldTail->nextScriptPtr) {	// go to the end of the list
 		oldTail = oldTail->nextScriptPtr;
 	}
 
@@ -660,8 +657,7 @@
 	tempPtr->scriptNumber = param;
 	tempPtr->overlayNumber = overlayNumber;
 
-	if (scriptType == 20)	// Obj or not ?
-	{
+	if (scriptType == 20) {	// Obj or not ?
 		tempPtr->sysKey = useArg3Neg;
 	} else {
 		tempPtr->sysKey = 1;

Modified: scummvm/trunk/engines/lure/detection.cpp
===================================================================
--- scummvm/trunk/engines/lure/detection.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/lure/detection.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -152,8 +152,7 @@
 			"Lure of the Temptress executable. See the documentation for creating it.",
 			SUPPORT_FILENAME);
 
-	for (uint8 fileNum = 1; fileNum <= 4; ++fileNum)
-	{
+	for (uint8 fileNum = 1; fileNum <= 4; ++fileNum) {
 		char sFilename[10];
 		sprintf(sFilename, "disk%d.vga", fileNum);
 

Modified: scummvm/trunk/engines/lure/fights.cpp
===================================================================
--- scummvm/trunk/engines/lure/fights.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/lure/fights.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -335,8 +335,7 @@
 			return;
 		}
 
-		switch (moveValue)
-		{
+		switch (moveValue) {
 		case 0xFFFA:
 			// Walk left
 			if ((fighter.fwmove_number == 5) || (fighter.fwmove_number == 10)) {

Modified: scummvm/trunk/engines/lure/intro.cpp
===================================================================
--- scummvm/trunk/engines/lure/intro.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/lure/intro.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -80,8 +80,7 @@
 
 	PaletteCollection coll(0x32);
 	const AnimRecord *curr_anim = anim_screens;
-	for (; curr_anim->resourceId; ++curr_anim)
-	{
+	for (; curr_anim->resourceId; ++curr_anim) {
 		bool fadeIn = curr_anim == anim_screens;
 		anim = new AnimationSequence(_screen, _system, curr_anim->resourceId, 
 			coll.getPalette(curr_anim->paletteIndex), fadeIn);

Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/lure/lure.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -169,8 +169,7 @@
 	// Check for header
 	char buffer[5];
 	f->read(buffer, 5);
-	if (memcmp(buffer, "lure", 5) != 0)
-	{
+	if (memcmp(buffer, "lure", 5) != 0) {
 		warning(FAILED_MSG, slotNumber);
 		delete f;
 		return false;
@@ -179,8 +178,7 @@
 	// Check language version 
 	uint8 language = f->readByte();
 	uint8 version = f->readByte();
-	if ((language != _language) || (version != LURE_DAT_MINOR))
-	{
+	if ((language != _language) || (version != LURE_DAT_MINOR)) {
 		warning("loadGame: Failed to load slot %d - incorrect version", slotNumber);
 		delete f;
 		return false;

Modified: scummvm/trunk/engines/lure/menu.cpp
===================================================================
--- scummvm/trunk/engines/lure/menu.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/lure/menu.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -106,8 +106,7 @@
 		while (events.pollEvent()) {
 			if (events.quitFlag) return MENUITEM_NONE;
 
-			if (mouse.y() < MENUBAR_Y_SIZE)
-			{
+			if (mouse.y() < MENUBAR_Y_SIZE) {
 				MenuRecord *p = getMenuAt(mouse.x());
 
 				if (_selectedMenu != p) {

Modified: scummvm/trunk/engines/lure/res.cpp
===================================================================
--- scummvm/trunk/engines/lure/res.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/lure/res.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -657,8 +657,7 @@
 	error("Unknown talk entry offset %d requested", offset);
 }
 
-void Resources::saveToStream(Common::WriteStream *stream)
-{
+void Resources::saveToStream(Common::WriteStream *stream) {
 	_hotspotData.saveToStream(stream);
 	_activeHotspots.saveToStream(stream);
 	_fieldList.saveToStream(stream);

Modified: scummvm/trunk/engines/lure/screen.cpp
===================================================================
--- scummvm/trunk/engines/lure/screen.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/lure/screen.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -95,8 +95,7 @@
 		byte *pFinal = p->data();
 		byte *pCurrent = _palette->data();
 
-		for (int palCtr = 0; palCtr < p->numEntries() * PALETTE_FADE_INC_SIZE; ++palCtr, ++pCurrent, ++pFinal)
-		{
+		for (int palCtr = 0; palCtr < p->numEntries() * PALETTE_FADE_INC_SIZE; ++palCtr, ++pCurrent, ++pFinal) {
 			if (palCtr % PALETTE_FADE_INC_SIZE == (PALETTE_FADE_INC_SIZE - 1)) continue;
 			bool isDifferent = *pCurrent < *pFinal;
 

Modified: scummvm/trunk/engines/lure/sound.cpp
===================================================================
--- scummvm/trunk/engines/lure/sound.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/lure/sound.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -131,8 +131,7 @@
 	if (soundIndex == 6)
 		// Chinese torture
 		addSound(6);
-	else
-	{
+	else {
 		SoundDescResource &descEntry = soundDescs()[soundIndex];
 		SoundDescResource *rec = findSound(descEntry.soundNumber);
 		if (rec == NULL)

Modified: scummvm/trunk/engines/parallaction/staticres.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/staticres.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/parallaction/staticres.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -50,8 +50,7 @@
 };
 
 
-byte _amigaTopazFont[2600] =
-{
+byte _amigaTopazFont[2600] = {
   0x00, 0x00, 0x03, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x79, 0x00, 0x00, 0x03, 0xe9, 0x00, 0x00, 0x02, 0x79,
   0x70, 0xff, 0x4e, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,

Modified: scummvm/trunk/engines/queen/cutaway.cpp
===================================================================
--- scummvm/trunk/engines/queen/cutaway.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/queen/cutaway.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -181,8 +181,7 @@
 	debug(6, "_talkTo = %i", _talkTo);
 }
 
-const byte *Cutaway::getCutawayObject(const byte *ptr, CutawayObject &object)
-{
+const byte *Cutaway::getCutawayObject(const byte *ptr, CutawayObject &object) {
 	const byte *oldPtr = ptr;
 
 	object.objectNumber = (int16)READ_BE_INT16(ptr); ptr += 2;
@@ -216,8 +215,7 @@
 	return ptr;
 }
 
-void Cutaway::dumpCutawayObject(int index, CutawayObject &object)
-{
+void Cutaway::dumpCutawayObject(int index, CutawayObject &object) {
 	debug(6, "----- CutawayObject[%i] -----", index);
 
 	const char *objectNumberStr;

Modified: scummvm/trunk/engines/saga/font.cpp
===================================================================
--- scummvm/trunk/engines/saga/font.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/saga/font.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -632,8 +632,7 @@
 
 	// The demo version of IHNM has 3 font types (like ITE), not 6 (like the full version of IHNM)
 	if (_vm->getGameType() == GType_ITE || _vm->getGameId() == GID_IHNM_DEMO) {
-		switch (font)
-		{
+		switch (font) {
 		case (kKnownFontSmall):
 			fontId = kSmallFont;
 			break;
@@ -655,8 +654,7 @@
 			break;
 		}
 	} else if (_vm->getGameType() == GType_IHNM && _vm->getGameId() != GID_IHNM_DEMO) {
-		switch (font)
-		{
+		switch (font) {
 		case (kKnownFontSmall):
 			fontId = kSmallFont;
 			break;

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/saga/interface.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -608,8 +608,7 @@
 				return true;
 			}
 		}
-		if (ascii == 15) // ctrl-o
-		{
+		if (ascii == 15) { // ctrl-o
 			if (_saveReminderState > 0) {
 				setMode(kPanelOption);
 				return true;

Modified: scummvm/trunk/engines/saga/saga.cpp
===================================================================
--- scummvm/trunk/engines/saga/saga.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/saga/saga.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -452,8 +452,7 @@
 			error("SagaEngine::KnownColor2ColorId unknown color %i", knownColor);
 		}
 	} else if (getGameType() == GType_IHNM) {
-		switch (knownColor)
-		{
+		switch (knownColor) {
 		case(kKnownColorTransparent):
 			colorId = kITEColorTransBlack;
 			break;

Modified: scummvm/trunk/engines/saga/sndres.cpp
===================================================================
--- scummvm/trunk/engines/saga/sndres.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/saga/sndres.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -101,8 +101,7 @@
 	}
 }
 
-void SndRes::setVoiceBank(int serial)
-{
+void SndRes::setVoiceBank(int serial) {
 	if (_voiceSerial == serial) return;
 
 	_voiceSerial = serial;

Modified: scummvm/trunk/engines/scumm/charset.cpp
===================================================================
--- scummvm/trunk/engines/scumm/charset.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/scumm/charset.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -1226,8 +1226,7 @@
 	return spacing;
 }
 
-void CharsetRendererV3::setColor(byte color)
-{
+void CharsetRendererV3::setColor(byte color) {
 	bool useShadow = false;
 	_color = color;
 

Modified: scummvm/trunk/engines/scumm/file_nes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/file_nes.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/scumm/file_nes.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -948,8 +948,7 @@
 		for (i = 1; i < 8; i++)
 			reslen += write_byte(output, 0);
 
-		for (j = 0; j < 4; j++)
-		{
+		for (j = 0; j < 4; j++) {
 			reslen += write_byte(output,' ');
 			for (i = 1; (val = fileReadByte()); i++)
 				reslen += write_byte(output, val);

Modified: scummvm/trunk/engines/scumm/player_v2a.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_v2a.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/scumm/player_v2a.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -35,14 +35,12 @@
 static uint32 CRCtable[256];
 
 
-static void	InitCRC (void)
-{
+static void	InitCRC (void) {
 	const uint32 poly = 0xEDB88320;
 	int i, j;
 	uint32 n;
 
-	for (i = 0; i < 256; i++)
-	{
+	for (i = 0; i < 256; i++) {
 		n = i;
 		for (j = 0; j < 8; j++)
 			n = (n & 1) ? ((n >> 1) ^ poly) : (n >> 1);
@@ -50,8 +48,7 @@
 	}
 }
 
-static uint32 GetCRC (byte *data, int len)
-{
+static uint32 GetCRC (byte *data, int len) {
 	uint32 CRC = 0xFFFFFFFF;
 	int i;
 	for (i = 0; i < len; i++)
@@ -1113,8 +1110,7 @@
 	}
 	virtual bool update() {
 		assert(_id);
-		if (_curfreq >= _freq2)
-		{
+		if (_curfreq >= _freq2) {
 			_mod->setChannelFreq(_id, BASE_FREQUENCY / _curfreq);
 			_curfreq -= _bendrate;
 			if (--_bendctr)
@@ -1122,9 +1118,7 @@
 			_bendrate--;
 			if (_bendrate < 2)
 				_bendrate = 2;
-		}
-		else
-		{
+		} else {
 			if (!--_holdctr)
 				return false;
 		}
@@ -1160,15 +1154,12 @@
 	}
 	virtual bool update() {
 		assert(_id);
-		if (!_loop)
-		{
+		if (!_loop) {
 			_vol--;
 			if (_vol)
 				_mod->setChannelVol(_id, _vol);
 			else	return false;
-		}
-		else if (!--_loop)
-		{
+		} else if (!--_loop) {
 			_mod->stopChannel(_id);
 			char *tmp_data = (char *)malloc(_size2);
 			memcpy(tmp_data, _data + _offset2, _size2);

Modified: scummvm/trunk/engines/sword1/logic.cpp
===================================================================
--- scummvm/trunk/engines/sword1/logic.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/sword1/logic.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -317,8 +317,7 @@
 	}
 	compact->o_walk_pc++;
 
-	if	(route[compact->o_walk_pc].frame == 512)					//end of sequence
-	{
+	if	(route[compact->o_walk_pc].frame == 512) {					//end of sequence
 		compact->o_logic = LOGIC_script;
 		if (((_scriptVars[GEORGE_WALKING] == 2) || (_scriptVars[GEORGE_WALKING] == 1)) &&
 			(id == PLAYER)) {

Modified: scummvm/trunk/engines/sword1/router.cpp
===================================================================
--- scummvm/trunk/engines/sword1/router.cpp	2007-09-10 13:16:06 UTC (rev 28886)
+++ scummvm/trunk/engines/sword1/router.cpp	2007-09-10 13:17:20 UTC (rev 28887)
@@ -130,8 +130,7 @@
 	slowInFrames = 0;
 	slowOutFrames = 0;
 
-	if (megaId == GEORGE)
-	{
+	if (megaId == GEORGE) {
 		turnFramesLeft = 3 * _framesPerChar + NO_DIRECTIONS + 2 * SLOW_IN + 4 * SLOW_OUT;
 		turnFramesRight = 3 * _framesPerChar + NO_DIRECTIONS + 2 * SLOW_IN + 4 * SLOW_OUT + NO_DIRECTIONS;
 		walkFramesLeft = _framesPerChar + NO_DIRECTIONS;
@@ -703,8 +702,7 @@
 	// TURN TO START THE WALK
 	//****************************************************************************
 	// rotate if we need to
-	if (lastDir != currentDir)
-	{
+	if (lastDir != currentDir) {
 		// get the direction to turn
 		turnDir = currentDir - lastDir;
 		if ( turnDir < 0)
@@ -717,10 +715,8 @@
 
 		// rotate to new walk direction
 		// for george and nico put in a head turn at the start
-		if ((megaId == GEORGE) || (megaId == NICO))
-		{
-			if ( turnDir < 0)	// new frames for turn frames	29oct95jps
-			{
+		if ((megaId == GEORGE) || (megaId == NICO)) {
+			if ( turnDir < 0) {	// new frames for turn frames	29oct95jps
 				module =	turnFramesLeft + lastDir;
 			} else {
 				module =	turnFramesRight + lastDir;
@@ -734,11 +730,9 @@
 		}
 
 		// rotate till were facing new dir then go back 45 degrees
-		while (lastDir != currentDir)
-		{
+		while (lastDir != currentDir) {
 			lastDir += turnDir;
-			if ( turnDir < 0)	// new frames for turn frames	29oct95jps
-			{
+			if ( turnDir < 0) {	// new frames for turn frames	29oct95jps
 				if ( lastDir < 0)
 						lastDir += NO_DIRECTIONS;
 				module =	turnFramesLeft + lastDir;
@@ -774,8 +768,7 @@
 	lastDir = 99;// this ensures that we don't put in turn frames for the start
 	currentDir = 99;// this ensures that we don't put in turn frames for the start
 	do {
-		while (_modularPath[p].num == 0)
-		{
+		while (_modularPath[p].num == 0) {
 			p = p + 1;
 			if (currentDir != 99)
 				lastRealDir = currentDir;
@@ -784,8 +777,7 @@
 		}
 		//calculate	average amount to lose in each step on the way to the next _node
 		currentDir = _modularPath[p].dir;
-		if (currentDir < NO_DIRECTIONS)
-		{
+		if (currentDir < NO_DIRECTIONS) {
 			module =	currentDir * _framesPerStep * 2 + left;
 			if (left == 0)
 				left = _framesPerStep;
@@ -814,22 +806,18 @@
 			errorX = errorX * stepX;
 			errorY = _modularPath[p].y -	moduleY;
 			errorY = errorY * stepY;
-			if ((errorX < 0) || (errorY < 0))
-			{
+			if ((errorX < 0) || (errorY < 0)) {
 				_modularPath[p].num = 0;	// the end of the path
 				// okay those last steps took us past our target but do we want to scoot or moonwalk
 				frames = stepCount - lastCount;
 				errorX = _modularPath[p].x - walkAnim[stepCount-1].x;
 				errorY = _modularPath[p].y - walkAnim[stepCount-1].y;
 
-				if (frames > _framesPerStep)
-				{
+				if (frames > _framesPerStep) {
 					lastErrorX = _modularPath[p].x - walkAnim[stepCount-7].x;
 					lastErrorY = _modularPath[p].y - walkAnim[stepCount-7].y;
-					if (stepX==0)
-					{
-						if (3*ABS(lastErrorY) < ABS(errorY)) //the last stop was closest
-						{
+					if (stepX==0) {
+						if (3*ABS(lastErrorY) < ABS(errorY)) { //the last stop was closest
 							stepCount -= _framesPerStep;
 							if (left == 0)
 								left = _framesPerStep;
@@ -837,8 +825,7 @@
 								left = 0;
 						}
 					} else {
-						if (3*ABS(lastErrorX) < ABS(errorX)) //the last stop was closest
-						{
+						if (3*ABS(lastErrorX) < ABS(errorX)) { //the last stop was closest
 							stepCount -= _framesPerStep;
 							if (left == 0)
 								left = _framesPerStep;
@@ -850,8 +837,7 @@
 				errorX = _modularPath[p].x - walkAnim[stepCount-1].x;
 				errorY = _modularPath[p].y - walkAnim[stepCount-1].y;
 				// okay we've reached the end but we still have an error
-				if (errorX != 0)
-				{
+				if (errorX != 0) {
 					frameCount = 0;
 					frames = stepCount - lastCount;
 					do {
@@ -859,8 +845,7 @@
 						walkAnim[lastCount + frameCount - 1].x +=	errorX*frameCount/frames;
 					} while (frameCount<frames);
 				}
-				if (errorY != 0)
-				{
+				if (errorY != 0) {
 					frameCount = 0;
 					frames = stepCount - lastCount;
 					do {
@@ -874,25 +859,20 @@
 				if (currentDir != 99)
 					lastRealDir = currentDir;
 				// check each turn condition in turn
-				if (((lastDir != 99) && (currentDir != 99)) && (megaId == GEORGE)) // only for george
-				{
+				if (((lastDir != 99) && (currentDir != 99)) && (megaId == GEORGE)) { // only for george
 					lastDir = currentDir - lastDir;//1 and -7 going right -1 and 7 going left
-					if (((lastDir == -1) || (lastDir == 7)) || ((lastDir == -2) || (lastDir == 6)))
-					{
+					if (((lastDir == -1) || (lastDir == 7)) || ((lastDir == -2) || (lastDir == 6))) {
 						// turn at the end of the last walk
 						frame = lastCount - _framesPerStep;
-						do
-						{
+						do {
 							walkAnim[frame].frame += 104;//turning left
 							frame += 1;
 						} while (frame < lastCount );
 					}
-					if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6)))
-					{
+					if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) {
 						// turn at the end of the current walk
 						frame = lastCount - _framesPerStep;
-						do
-						{
+						do {
 							walkAnim[frame].frame += 200; //was 60 now 116
 							frame += 1;
 						} while (frame < lastCount );
@@ -912,8 +892,7 @@
 
 
 
-	if (lastRealDir == 99)
-	{
+	if (lastRealDir == 99) {
 		error("SlidyWalkAnimatorlast direction error\n");
 	}
 	//****************************************************************************
@@ -924,8 +903,7 @@
 	// We've done the walk now put in any turns at the end
 
 
-	if (_targetDir == NO_DIRECTIONS)	// stand in the last direction
-	{
+	if (_targetDir == NO_DIRECTIONS) {	// stand in the last direction
 		module =	standFrames + lastRealDir;
 		_targetDir =	lastRealDir;
 		walkAnim[stepCount].frame = module;
@@ -935,10 +913,8 @@
 		walkAnim[stepCount].y = moduleY;
 		stepCount += 1;
 	}
-	if (_targetDir == 9)
-	{
-		if (stepCount == 0)
-		{
+	if (_targetDir == 9) {
+		if (stepCount == 0) {
 			module =	_framesPerChar + lastRealDir;
 			walkAnim[stepCount].frame = module;
 			walkAnim[stepCount].step = 0;
@@ -947,8 +923,7 @@
 			walkAnim[stepCount].y = moduleY;
 			stepCount += 1;
 		}
-	} else if (_targetDir != lastRealDir) // rotate to _targetDir
-	{
+	} else if (_targetDir != lastRealDir) { // rotate to _targetDir
 		// rotate to target direction
 		turnDir = _targetDir - lastRealDir;
 		if ( turnDir < 0)
@@ -961,10 +936,8 @@
 
 		// rotate to target direction
 		// for george and nico put in a head turn at the start
-		if ((megaId == GEORGE) || (megaId == NICO))
-		{
-			if ( turnDir < 0)	// new frames for turn frames	29oct95jps
-			{
+		if ((megaId == GEORGE) || (megaId == NICO)) {
+			if ( turnDir < 0) {	// new frames for turn frames	29oct95jps
 				module =	turnFramesLeft + lastDir;
 			} else {
 				module =	turnFramesRight + lastDir;
@@ -978,11 +951,9 @@
 		}
 
 		// rotate if we need to
-		while (lastRealDir != _targetDir)
-		{
+		while (lastRealDir != _targetDir) {
 			lastRealDir += turnDir;
-			if ( turnDir < 0)	// new frames for turn frames	29oct95jps
-			{
+			if ( turnDir < 0) {	// new frames for turn frames	29oct95jps
 				if ( lastRealDir < 0)
 						lastRealDir += NO_DIRECTIONS;
 				module =	turnFramesLeft + lastRealDir;
@@ -1000,8 +971,7 @@
 		}
 		module =	standFrames + lastRealDir;
 		walkAnim[stepCount-1].frame = module;
-	} else // just stand at the end
-	{
+	} else { // just stand at the end
 		module =	standFrames + lastRealDir;
 		walkAnim[stepCount].frame = module;
 		walkAnim[stepCount].step = 0;
@@ -1150,8 +1120,7 @@
 	// TURN TO START THE WALK
 	//****************************************************************************
 	// rotate if we need to
-	if (lastDir != currentDir)
-	{
+	if (lastDir != currentDir) {
 		// get the direction to turn
 		turnDir = currentDir - lastDir;
 		if ( turnDir < 0)
@@ -1164,10 +1133,8 @@
 
 		// rotate to new walk direction
 		// for george and nico put in a head turn at the start
-		if ((megaId == GEORGE) || (megaId == NICO))
-		{
-			if ( turnDir < 0)	// new frames for turn frames	29oct95jps
-			{
+		if ((megaId == GEORGE) || (megaId == NICO)) {
+			if ( turnDir < 0) {	// new frames for turn frames	29oct95jps
 				module =	turnFramesLeft + lastDir;
 			} else {
 				module =	turnFramesRight + lastDir;
@@ -1181,11 +1148,9 @@
 		}
 
 		// rotate till were facing new dir then go back 45 degrees
-		while (lastDir != currentDir)
-		{
+		while (lastDir != currentDir) {
 			lastDir += turnDir;
-			if ( turnDir < 0)	// new frames for turn frames	29oct95jps
-			{
+			if ( turnDir < 0) {	// new frames for turn frames	29oct95jps
 				if ( lastDir < 0)
 					lastDir += NO_DIRECTIONS;
 				module =	turnFramesLeft + lastDir;
@@ -1882,8 +1847,7 @@
 // * THE SETUP ROUTINES
 // ****************************************************************************
 
-int32 Router::LoadWalkResources(Object *megaObject, int32 x, int32 y, int32 dir)
-{
+int32 Router::LoadWalkResources(Object *megaObject, int32 x, int32 y, int32 dir) {
 	WalkGridHeader	floorHeader;
 	int32 	i;
 	uint8  *fPolygrid;
@@ -1915,8 +1879,7 @@
 	fPolygrid += sizeof(WalkGridHeader);
 	_nBars = _resMan->getUint32(floorHeader.numBars);
 
-	if (_nBars >= O_GRID_SIZE)
-	{
+	if (_nBars >= O_GRID_SIZE) {
 		#ifdef DEBUG												//check for id > number in file,
 		error("RouteFinder Error too many _bars %d", _nBars);
 		#endif
@@ -1925,8 +1888,7 @@
 
 	_nNodes = _resMan->getUint32(floorHeader.numNodes)+1;	//array starts at 0	begins at a start _node has nnodes nodes and a target _node
 
-	if (_nNodes >= O_GRID_SIZE)
-	{
+	if (_nNodes >= O_GRID_SIZE) {
 		#ifdef DEBUG												//check for id > number in file,
 			error("RouteFinder Error too many nodes %d", _nNodes);
 		#endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list