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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Jan 16 03:43:41 CET 2009


Revision: 35870
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35870&view=rev
Author:   fingolfin
Date:     2009-01-16 02:43:41 +0000 (Fri, 16 Jan 2009)

Log Message:
-----------
Code formatting fixes, automatically performed by astyle

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/actor.cpp
    scummvm/trunk/engines/cruise/background.cpp
    scummvm/trunk/engines/cruise/backgroundIncrust.cpp
    scummvm/trunk/engines/cruise/cell.cpp
    scummvm/trunk/engines/cruise/cell.h
    scummvm/trunk/engines/cruise/cruise.cpp
    scummvm/trunk/engines/cruise/cruise.h
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/ctp.cpp
    scummvm/trunk/engines/cruise/dataLoader.cpp
    scummvm/trunk/engines/cruise/decompiler.cpp
    scummvm/trunk/engines/cruise/delphine-unpack.cpp
    scummvm/trunk/engines/cruise/detection.cpp
    scummvm/trunk/engines/cruise/font.cpp
    scummvm/trunk/engines/cruise/font.h
    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/menu.h
    scummvm/trunk/engines/cruise/mouse.cpp
    scummvm/trunk/engines/cruise/mouse.h
    scummvm/trunk/engines/cruise/object.cpp
    scummvm/trunk/engines/cruise/overlay.cpp
    scummvm/trunk/engines/cruise/overlay.h
    scummvm/trunk/engines/cruise/perso.cpp
    scummvm/trunk/engines/cruise/saveload.cpp
    scummvm/trunk/engines/cruise/script.cpp
    scummvm/trunk/engines/cruise/various.cpp
    scummvm/trunk/engines/cruise/vars.h
    scummvm/trunk/engines/cruise/volume.cpp

Modified: scummvm/trunk/engines/cruise/actor.cpp
===================================================================
--- scummvm/trunk/engines/cruise/actor.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/actor.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -32,8 +32,8 @@
 
 	while (pCurrentEntry) {
 		if ((pCurrentEntry->overlayNumber == overlayIdx || overlayIdx == -1) &&
-			(pCurrentEntry->idx == param1 || param1 == -1) &&
-			(pCurrentEntry->type == param2 || param2 == -1)) {
+		        (pCurrentEntry->idx == param1 || param1 == -1) &&
+		        (pCurrentEntry->type == param2 || param2 == -1)) {
 			if (pCurrentEntry->pathId != -2) {
 				return 0;
 			}
@@ -50,9 +50,9 @@
 
 	while (pCurrentEntry) {
 		if ((pCurrentEntry->overlayNumber == overlayIdx
-			|| overlayIdx == -1) && (pCurrentEntry->idx == objIdx
-			|| objIdx == -1) && (pCurrentEntry->type == type
-			|| type == -1)) {
+		        || overlayIdx == -1) && (pCurrentEntry->idx == objIdx
+		                                 || objIdx == -1) && (pCurrentEntry->type == type
+		                                                      || type == -1)) {
 			return pCurrentEntry;
 		}
 
@@ -71,10 +71,10 @@
 	int16* polygone = (int16*)polyStruct0;
 	int16* next;
 
-	while ((next = *(int16**)polygone) != (int16 *) -1) {
-		polygone+=sizeof(uint16*);
+	while ((next = *(int16**)polygone) != (int16 *) - 1) {
+		polygone += sizeof(uint16*);
 
-		int16* tableau = polygone+2;
+		int16* tableau = polygone + 2;
 
 		x_min = *tableau++;
 		x_max = *tableau++;
@@ -85,12 +85,12 @@
 
 		if (walkboxState[computedVar14] == 0 && ((x >= x_min && x <= x_max) && (y >= y_min && y <= y_max))) {
 			// click was in given box
-			int u = y-y_min;
-			tableau+=u*2;
+			int u = y - y_min;
+			tableau += u * 2;
 			x_min = *tableau++;
 			x_max = *tableau++;
 
-			if ( (x>=x_min && x<=x_max) ) {
+			if ((x >= x_min && x <= x_max)) {
 				flag_obstacle = walkboxColor[computedVar14];
 
 				return;
@@ -483,7 +483,7 @@
 			polyStruct0 = polyStructExp;
 
 			poly2(x2, y2, ctp_routeCoords[select_noeud[1]][0],
-			    ctp_routeCoords[select_noeud[1]][1]);
+			      ctp_routeCoords[select_noeud[1]][1]);
 
 			solution0[1][0] = table_ptselect[1][0] = X;
 			solution0[1][1] = table_ptselect[1][1] = Y;
@@ -526,8 +526,8 @@
 				}
 				polyStruct0 = polyStructExp;
 				poly2(x2, y2,
-				    ctp_routeCoords[select_noeud[1]][0],
-				    ctp_routeCoords[select_noeud[1]][1]);
+				      ctp_routeCoords[select_noeud[1]][0],
+				      ctp_routeCoords[select_noeud[1]][1]);
 				solution0[i + 1][0] = table_ptselect[1][0] = X;
 				solution0[i + 1][1] = table_ptselect[1][1] = Y;
 				solution0[i + 2][0] = -1;
@@ -536,7 +536,7 @@
 					return;
 				}
 
-	/****** COUPE LE CHEMIN ******/
+				/****** COUPE LE CHEMIN ******/
 
 				i++;
 				d = 0;
@@ -588,8 +588,7 @@
 		}
 	}
 
-	if (!flagCt)
-	{
+	if (!flagCt) {
 		int i;
 		int16 *ptr;
 
@@ -638,7 +637,7 @@
 		return (-1);
 	}
 
-/******* cherche le premier noeud ******/
+	/******* cherche le premier noeud ******/
 
 	getPixel(x, y);
 
@@ -658,7 +657,7 @@
 
 	flag_aff_chemin = 0;
 
-/******* cherche le deuxieme noeud ******/
+	/******* cherche le deuxieme noeud ******/
 
 	num = 0;
 	while (num < NUM_PERSONS && persoTable[num] != NULL)
@@ -719,28 +718,28 @@
 	{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0},	/* dos         */
 	{13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0},	/* droite      */
 	{25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 0},	/* face        */
-	{-13, -14, -15, -16, -17, -18, -19, -20, -21, -22, -23, -24, 0}	/* gauche      */
+	{ -13, -14, -15, -16, -17, -18, -19, -20, -21, -22, -23, -24, 0}	/* gauche      */
 };
 
 int raoul_end[][13] = {
 	{37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},	/* stat dos    */
 	{38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},	/* stat droite */
 	{39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},	/* stat face   */
-	{-38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}	/* stat gauche */
+	{ -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}	/* stat gauche */
 };
 
 int raoul_stat[][13] = {
 	{53, 54, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0},	/* ret dos-dr  */
 	{59, 60, 62, 63, 78, 0, 0, 0, 0, 0, 0, 0, 0},	/* ret dr-face */
-	{-78, -63, -62, -60, -59, 0, 0, 0, 0, 0, 0, 0, 0},	/* ret face-ga */
-	{-57, -56, -55, -54, -53, 0, 0, 0, 0, 0, 0, 0, 0}	/* ret ga-dos  */
+	{ -78, -63, -62, -60, -59, 0, 0, 0, 0, 0, 0, 0, 0},	/* ret face-ga */
+	{ -57, -56, -55, -54, -53, 0, 0, 0, 0, 0, 0, 0, 0}	/* ret ga-dos  */
 };
 
 int raoul_invstat[][13] = {
-	{-53, -54, -55, -56, -57, 0, 0, 0, 0, 0, 0, 0, 0},	/* ret dos-dr  */
+	{ -53, -54, -55, -56, -57, 0, 0, 0, 0, 0, 0, 0, 0},	/* ret dos-dr  */
 	{57, 56, 55, 54, 53, 0, 0, 0, 0, 0, 0, 0, 0},	/* ret ga-dos  */
 	{78, 63, 62, 60, 59, 0, 0, 0, 0, 0, 0, 0, 0},	/* ret face-ga */
-	{-59, -60, -62, -63, -78, 0, 0, 0, 0, 0, 0, 0, 0}	/* ret dr-face */
+	{ -59, -60, -62, -63, -78, 0, 0, 0, 0, 0, 0, 0, 0}	/* ret dr-face */
 
 };
 
@@ -787,287 +786,283 @@
 					currentActor->counter = -1;
 				}
 			} else
-			    if ((currentActor->type == 1) && (currentActor->x_dest != -1) && (currentActor->y_dest != -1)) {
-				// track animation
-				currentActor->pathId = computePathfinding(returnVar2, params.X, params.Y, currentActor->x_dest, currentActor->y_dest, currentActor->stepX, currentActor->stepY, currentActor->pathId);
+				if ((currentActor->type == 1) && (currentActor->x_dest != -1) && (currentActor->y_dest != -1)) {
+					// track animation
+					currentActor->pathId = computePathfinding(returnVar2, params.X, params.Y, currentActor->x_dest, currentActor->y_dest, currentActor->stepX, currentActor->stepY, currentActor->pathId);
 
-				currentActor->x_dest = -1;
-				currentActor->y_dest = -1;
+					currentActor->x_dest = -1;
+					currentActor->y_dest = -1;
 
-				if (currentActor->pathId == -1) {
-					if ((currentActor->endDirection != -1) && (currentActor->endDirection != currentActor->startDirection)) {
-						currentActor->phase = ANIM_PHASE_STATIC_END;
-						currentActor->nextDirection = currentActor->endDirection;
-						currentActor->endDirection = -1;
-						currentActor->counter = 0;
+					if (currentActor->pathId == -1) {
+						if ((currentActor->endDirection != -1) && (currentActor->endDirection != currentActor->startDirection)) {
+							currentActor->phase = ANIM_PHASE_STATIC_END;
+							currentActor->nextDirection = currentActor->endDirection;
+							currentActor->endDirection = -1;
+							currentActor->counter = 0;
+						} else {
+							currentActor->pathId = -2;
+							currentActor->flag = 0;
+							currentActor->endDirection = -1;
+							currentActor->phase = ANIM_PHASE_WAIT;
+						}
 					} else {
-						currentActor->pathId = -2;
-						currentActor->flag = 0;
-						currentActor->endDirection = -1;
-						currentActor->phase = ANIM_PHASE_WAIT;
+						currentActor->phase = ANIM_PHASE_STATIC;
+						currentActor->counter = -1;
 					}
-				} else {
-					currentActor->phase = ANIM_PHASE_STATIC;
-					currentActor->counter = -1;
 				}
-			}
 
 			animationStart = false;
 
 			if ((currentActor->pathId >= 0) || (currentActor->phase == ANIM_PHASE_STATIC_END)) {
 				switch (currentActor->phase) {
 				case ANIM_PHASE_STATIC_END:
-				case ANIM_PHASE_STATIC:
-					{
-						if ((currentActor->counter == -1) && (currentActor->phase == ANIM_PHASE_STATIC)) {
-							affiche_chemin(currentActor->pathId, returnVar2);
+				case ANIM_PHASE_STATIC: {
+					if ((currentActor->counter == -1) && (currentActor->phase == ANIM_PHASE_STATIC)) {
+						affiche_chemin(currentActor->pathId, returnVar2);
 
-							if (returnVar2[0] == -1) {
-								currentActor->pathId = -2;
-								currentActor->flag = 0;
-								currentActor->endDirection = -1;
-								currentActor->phase = ANIM_PHASE_WAIT;
-								break;
-							}
-
-							currentActor->x = returnVar2[0];
-							currentActor->y = returnVar2[1];
-							currentActor->nextDirection = returnVar2[2];
-							currentActor->poly = returnVar2[4];
-							currentActor->counter = 0;
-
-							if (currentActor->startDirection == currentActor->nextDirection)
-								currentActor->phase = ANIM_PHASE_MOVE;
+						if (returnVar2[0] == -1) {
+							currentActor->pathId = -2;
+							currentActor->flag = 0;
+							currentActor->endDirection = -1;
+							currentActor->phase = ANIM_PHASE_WAIT;
+							break;
 						}
 
-						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;
+						currentActor->x = returnVar2[0];
+						currentActor->y = returnVar2[1];
+						currentActor->nextDirection = returnVar2[2];
+						currentActor->poly = returnVar2[4];
+						currentActor->counter = 0;
 
-							if (t_inc < 0)
-								t_inc = 3;
+						if (currentActor->startDirection == currentActor->nextDirection)
+							currentActor->phase = ANIM_PHASE_MOVE;
+					}
 
-							if (currentActor->nextDirection == t_inc)
-								inc = -1;
+					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;
 
-							if (inc > 0)
-								newA =
-								    raoul_stat
-								    [currentActor->
-								    startDirection]
-								    [currentActor->
-								    counter++];
-							else
-								newA =
-								    raoul_invstat
-								    [currentActor->
-								    startDirection]
-								    [currentActor->
-								    counter++];
+						if (t_inc < 0)
+							t_inc = 3;
 
-							if (newA == 0) {
-								currentActor->
-								    startDirection
-								    =
-								    currentActor->
-								    startDirection
-								    + inc;
+						if (currentActor->nextDirection == t_inc)
+							inc = -1;
 
-								if (currentActor->startDirection > 3)
-									currentActor->
-									    startDirection
-									    =
-									    0;
+						if (inc > 0)
+							newA =
+							    raoul_stat
+							    [currentActor->
+							     startDirection]
+							    [currentActor->
+							     counter++];
+						else
+							newA =
+							    raoul_invstat
+							    [currentActor->
+							     startDirection]
+							    [currentActor->
+							     counter++];
 
-								if (currentActor->startDirection < 0)
-									currentActor->
-									    startDirection
-									    =
-									    3;
+						if (newA == 0) {
+							currentActor->
+							startDirection
+							=
+							    currentActor->
+							    startDirection
+							    + inc;
 
+							if (currentActor->startDirection > 3)
 								currentActor->
-								    counter =
+								startDirection
+								=
 								    0;
 
-								if (currentActor->startDirection == currentActor->nextDirection) {
-									if (currentActor->phase == ANIM_PHASE_STATIC)
-										currentActor->
-										    phase
-										    =
-										    ANIM_PHASE_MOVE;
-									else
-										currentActor->
-										    phase
-										    =
-										    ANIM_PHASE_END;
-								} else {
-									newA =
-									    raoul_stat
-									    [currentActor->
-									    startDirection]
-									    [currentActor->
-									    counter++];
+							if (currentActor->startDirection < 0)
+								currentActor->
+								startDirection
+								=
+								    3;
 
-									if (inc
-									    ==
-									    -1)
-										newA = -newA;
+							currentActor->
+							counter =
+							    0;
 
-									set_anim
-									    (currentActor->
-									    overlayNumber,
-									    currentActor->
-									    idx,
-									    currentActor->
-									    start,
-									    params.
-									    X,
-									    params.
-									    Y,
-									    newA,
-									    currentActor->
-									    poly);
-									break;
-								}
+							if (currentActor->startDirection == currentActor->nextDirection) {
+								if (currentActor->phase == ANIM_PHASE_STATIC)
+									currentActor->
+									phase
+									=
+									    ANIM_PHASE_MOVE;
+								else
+									currentActor->
+									phase
+									=
+									    ANIM_PHASE_END;
 							} else {
+								newA =
+								    raoul_stat
+								    [currentActor->
+								     startDirection]
+								    [currentActor->
+								     counter++];
+
+								if (inc
+								        ==
+								        -1)
+									newA = -newA;
+
 								set_anim
-								    (currentActor->
-								    overlayNumber,
-								    currentActor->
-								    idx,
-								    currentActor->
-								    start,
-								    params.X,
-								    params.Y,
-								    newA,
-								    currentActor->
-								    poly);
+								(currentActor->
+								 overlayNumber,
+								 currentActor->
+								 idx,
+								 currentActor->
+								 start,
+								 params.
+								 X,
+								 params.
+								 Y,
+								 newA,
+								 currentActor->
+								 poly);
 								break;
 							}
+						} else {
+							set_anim
+							(currentActor->
+							 overlayNumber,
+							 currentActor->
+							 idx,
+							 currentActor->
+							 start,
+							 params.X,
+							 params.Y,
+							 newA,
+							 currentActor->
+							 poly);
+							break;
 						}
-						break;
 					}
-				case ANIM_PHASE_MOVE:
-					{
-						if (currentActor->counter >= 1) {
-							affiche_chemin
-							    (currentActor->
-							    pathId,
-							    returnVar2);
-							if (returnVar2[0] ==
-							    -1) {
-								if ((currentActor->endDirection == -1) || (currentActor->endDirection == currentActor->nextDirection)) {
-									currentActor->
-									    phase
-									    =
-									    ANIM_PHASE_END;
-								} else {
-									currentActor->
-									    phase
-									    =
-									    ANIM_PHASE_STATIC_END;
-									currentActor->
-									    nextDirection
-									    =
-									    currentActor->
-									    endDirection;
-								}
+					break;
+				}
+				case ANIM_PHASE_MOVE: {
+					if (currentActor->counter >= 1) {
+						affiche_chemin
+						(currentActor->
+						 pathId,
+						 returnVar2);
+						if (returnVar2[0] ==
+						        -1) {
+							if ((currentActor->endDirection == -1) || (currentActor->endDirection == currentActor->nextDirection)) {
 								currentActor->
-								    counter =
-								    0;
-								break;
+								phase
+								=
+								    ANIM_PHASE_END;
 							} else {
 								currentActor->
-								    x =
-								    returnVar2
-								    [0];
+								phase
+								=
+								    ANIM_PHASE_STATIC_END;
 								currentActor->
-								    y =
-								    returnVar2
-								    [1];
-								currentActor->
-								    nextDirection
-								    =
-								    returnVar2
-								    [2];
-								currentActor->
-								    poly =
-								    returnVar2
-								    [4];
-
-								/*
-								 * if (pl->next_dir!=pl->start_dir)
-								 * {
-								 * pl->phase=PHASE_STATIC;
-								 * pl->cnt=0;
-								 * break;
-								 * }
-								 */
+								nextDirection
+								=
+								    currentActor->
+								    endDirection;
 							}
+							currentActor->
+							counter =
+							    0;
+							break;
+						} else {
+							currentActor->
+							x =
+							    returnVar2
+							    [0];
+							currentActor->
+							y =
+							    returnVar2
+							    [1];
+							currentActor->
+							nextDirection
+							=
+							    returnVar2
+							    [2];
+							currentActor->
+							poly =
+							    returnVar2
+							    [4];
+
+							/*
+							 * if (pl->next_dir!=pl->start_dir)
+							 * {
+							 * pl->phase=PHASE_STATIC;
+							 * pl->cnt=0;
+							 * break;
+							 * }
+							 */
 						}
+					}
 
-						if (currentActor->phase ==
-						    ANIM_PHASE_MOVE) {
-							int newA;
+					if (currentActor->phase ==
+					        ANIM_PHASE_MOVE) {
+						int newA;
 
-							currentActor->
-							    startDirection =
-							    currentActor->
-							    nextDirection;
+						currentActor->
+						startDirection =
+						    currentActor->
+						    nextDirection;
 
+						newA =
+						    raoul_move
+						    [currentActor->
+						     startDirection]
+						    [currentActor->
+						     counter++];
+						if (!newA) {
+							currentActor->
+							counter =
+							    0;
 							newA =
 							    raoul_move
 							    [currentActor->
-							    startDirection]
+							     startDirection]
 							    [currentActor->
-							    counter++];
-							if (!newA) {
-								currentActor->
-								    counter =
-								    0;
-								newA =
-								    raoul_move
-								    [currentActor->
-								    startDirection]
-								    [currentActor->
-								    counter++];
-							}
-							set_anim(currentActor->
-							    overlayNumber,
-							    currentActor->idx,
-							    currentActor->
-							    start,
-							    currentActor->x,
-							    currentActor->y,
-							    newA,
-							    currentActor->
-							    poly);
-							break;
+							     counter++];
 						}
-
+						set_anim(currentActor->
+						         overlayNumber,
+						         currentActor->idx,
+						         currentActor->
+						         start,
+						         currentActor->x,
+						         currentActor->y,
+						         newA,
+						         currentActor->
+						         poly);
 						break;
 					}
-				case ANIM_PHASE_END:
-					{
-						int newA = raoul_end[currentActor->startDirection][0];
 
-						set_anim(currentActor->overlayNumber, currentActor->idx, currentActor->start, currentActor->x, currentActor->y, newA, currentActor->poly);
+					break;
+				}
+				case ANIM_PHASE_END: {
+					int newA = raoul_end[currentActor->startDirection][0];
 
-						currentActor->pathId = -2;
-						currentActor->phase = ANIM_PHASE_WAIT;
-						currentActor->flag = 0;
-						currentActor->endDirection = -1;
-						break;
-					}
-				default:
-					{
-						printf("Unimplemented currentActor->phase=%d in processAnimation()\n", currentActor->phase);
-						// exit(1);
-					}
+					set_anim(currentActor->overlayNumber, currentActor->idx, currentActor->start, currentActor->x, currentActor->y, newA, currentActor->poly);
+
+					currentActor->pathId = -2;
+					currentActor->phase = ANIM_PHASE_WAIT;
+					currentActor->flag = 0;
+					currentActor->endDirection = -1;
+					break;
 				}
+				default: {
+					printf("Unimplemented currentActor->phase=%d in processAnimation()\n", currentActor->phase);
+					// exit(1);
+				}
+				}
 			}
 		}
 		currentActor = nextActor;

Modified: scummvm/trunk/engines/cruise/background.cpp
===================================================================
--- scummvm/trunk/engines/cruise/background.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/background.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -41,7 +41,7 @@
 short int cvtPalette[0x20];
 
 int loadMEN(uint8 **ptr) {
-	char *localPtr = (char *)*ptr;
+	char *localPtr = (char *) * ptr;
 
 	if (!strcmp(localPtr, "MEN")) {
 		localPtr += 4;
@@ -62,7 +62,7 @@
 int CVTLoaded;
 
 int loadCVT(uint8 **ptr) {
-	char *localPtr = (char *)*ptr;
+	char *localPtr = (char *) * ptr;
 
 	if (!strcmp(localPtr, "CVT")) {
 		int i;
@@ -128,57 +128,53 @@
 	}
 
 	if (!strcmp((char*)ptr, "PAL")) {
-		memcpy(palScreen[idx], ptr+4, 256*3);
+		memcpy(palScreen[idx], ptr + 4, 256*3);
 		gfxModuleData_setPal256(palScreen[idx]);
 	} else {
 		int mode = ptr2[1];
 		ptr2 += 2;
 		// read palette
-		switch(mode)
-		{
+		switch (mode) {
 		case 0:
-		case 4: // color on 3 bit
-			{
-				uint16 oldPalette[32];
+		case 4: { // color on 3 bit
+			uint16 oldPalette[32];
 
-				memcpy(oldPalette, ptr2, 0x20);
-				ptr2 += 0x20;
-				flipGen(oldPalette, 0x20);
+			memcpy(oldPalette, ptr2, 0x20);
+			ptr2 += 0x20;
+			flipGen(oldPalette, 0x20);
 
-				for(unsigned long int i=0; i<32; i++) {
-					gfxModuleData_convertOldPalColor(oldPalette[i], &palScreen[idx][i*3]);
-				}
+			for (unsigned long int i = 0; i < 32; i++) {
+				gfxModuleData_convertOldPalColor(oldPalette[i], &palScreen[idx][i*3]);
+			}
 
-				// duplicate the palette
-				for(unsigned long int i=1; i<8; i++) {
-					memcpy(&palScreen[idx][32*i*3], &palScreen[idx][0], 32*3);
-				}
-
-				break;
+			// duplicate the palette
+			for (unsigned long int i = 1; i < 8; i++) {
+				memcpy(&palScreen[idx][32*i*3], &palScreen[idx][0], 32*3);
 			}
-		case 5: // color on 4 bit
-			{
-				for(unsigned long int i=0; i<32; i++)
-				{
-					uint8* inPtr = ptr2 + i * 2;
-					uint8* outPtr = palScreen[idx] +i * 3;
 
-					outPtr[2] = ((inPtr[1])&0x0F) * 17;
-					outPtr[1] = (((inPtr[1])&0xF0) >> 4) * 17;
-					outPtr[0] = ((inPtr[0])&0x0F) * 17;
-				}
-				ptr2 += 2*32;
+			break;
+		}
+		case 5: { // color on 4 bit
+			for (unsigned long int i = 0; i < 32; i++) {
+				uint8* inPtr = ptr2 + i * 2;
+				uint8* outPtr = palScreen[idx] + i * 3;
 
-				// duplicate the palette
-				for(unsigned long int i=1; i<8; i++) {
-					memcpy(&palScreen[idx][32*i*3], &palScreen[idx][0], 32*3);
-				}
+				outPtr[2] = ((inPtr[1]) & 0x0F) * 17;
+				outPtr[1] = (((inPtr[1]) & 0xF0) >> 4) * 17;
+				outPtr[0] = ((inPtr[0]) & 0x0F) * 17;
+			}
+			ptr2 += 2 * 32;
 
-				break;
+			// duplicate the palette
+			for (unsigned long int i = 1; i < 8; i++) {
+				memcpy(&palScreen[idx][32*i*3], &palScreen[idx][0], 32*3);
 			}
+
+			break;
+		}
 		case 8:
 			memcpy(palScreen[idx], ptr2, 256*3);
-			ptr2 += 256*3;
+			ptr2 += 256 * 3;
 			break;
 
 		default:
@@ -190,8 +186,7 @@
 		// read image data
 		gfxModuleData_gfxClearFrameBuffer(backgroundPtrtable[idx]);
 
-		switch(mode)
-		{
+		switch (mode) {
 		case 0:
 		case 4:
 			convertGfxFromMode4(ptr2, 320, 200, backgroundPtrtable[idx]);
@@ -202,7 +197,7 @@
 			break;
 		case 8:
 			memcpy(backgroundPtrtable[idx], ptr2, 320 * 200);
-			ptr2 += 320*200;
+			ptr2 += 320 * 200;
 			break;
 		}
 

Modified: scummvm/trunk/engines/cruise/backgroundIncrust.cpp
===================================================================
--- scummvm/trunk/engines/cruise/backgroundIncrust.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/backgroundIncrust.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -43,33 +43,29 @@
 	buildPolyModel(X, Y, scale, ptr2, destBuffer, dataPtr);
 }
 
-void backupBackground(backgroundIncrustStruct *pIncrust, int X, int Y, int width, int height, uint8* pBackground)
-{
+void backupBackground(backgroundIncrustStruct *pIncrust, int X, int Y, int width, int height, uint8* pBackground) {
 	pIncrust->saveWidth = width;
 	pIncrust->saveHeight = height;
-	pIncrust->saveSize = width*height;
+	pIncrust->saveSize = width * height;
 	pIncrust->savedX = X;
 	pIncrust->savedY = Y;
 
-	pIncrust->ptr = (uint8*)malloc(width*height);
-	for(int i=0; i<height; i++)
-	{
-		for(int j=0; j<width; j++)
-		{
+	pIncrust->ptr = (uint8*)malloc(width * height);
+	for (int i = 0; i < height; i++) {
+		for (int j = 0; j < width; j++) {
 			pIncrust->ptr[i*width+j] = pBackground[(i+Y)*320+j+X];
 		}
 	}
 }
 
-void restoreBackground(backgroundIncrustStruct *pIncrust)
-{
-	if(pIncrust->type != 1)
+void restoreBackground(backgroundIncrustStruct *pIncrust) {
+	if (pIncrust->type != 1)
 		return;
-	if(pIncrust->ptr == NULL)
+	if (pIncrust->ptr == NULL)
 		return;
 
 	uint8* pBackground = backgroundPtrtable[pIncrust->backgroundIdx];
-	if(pBackground == NULL)
+	if (pBackground == NULL)
 		return;
 
 	int X = pIncrust->savedX;
@@ -77,10 +73,8 @@
 	int width = pIncrust->saveWidth;
 	int height = pIncrust->saveHeight;
 
-	for(int i=0; i<height; i++)
-	{
-		for(int j=0; j<width; j++)
-		{
+	for (int i = 0; i < height; i++) {
+		for (int j = 0; j < width; j++) {
 			pBackground[(i+Y)*320+j+X] = pIncrust->ptr[i*width+j];
 		}
 	}
@@ -154,7 +148,7 @@
 		int width = filesDatabase[params.fileIdx].width;
 		int height = filesDatabase[params.fileIdx].height;
 
-		if(saveBuffer == 1) {
+		if (saveBuffer == 1) {
 			backupBackground(newElement, newElement->X, newElement->Y, width, height, backgroundPtr);
 		}
 
@@ -174,10 +168,10 @@
 			// this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2)
 			getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame);
 
-			int width = (sizeTable[1]+2) - (sizeTable[0]-2) + 1;
-			int height = sizeTable[3]-sizeTable[2]+1;
+			int width = (sizeTable[1] + 2) - (sizeTable[0] - 2) + 1;
+			int height = sizeTable[3] - sizeTable[2] + 1;
 
-			backupBackground(newElement, sizeTable[0]-2, sizeTable[2], width, height, backgroundPtr);
+			backupBackground(newElement, sizeTable[0] - 2, sizeTable[2], width, height, backgroundPtr);
 		}
 
 		addBackgroundIncrustSub1(params.fileIdx, newElement->X, newElement->Y, NULL, params.scale, (char *)backgroundPtr, (char *)filesDatabase[params.fileIdx].subData.ptr);
@@ -190,7 +184,7 @@
 	int count = 0;
 
 	backgroundIncrustStruct *pl = backgroundIncrustHead.next;
-	while(pl) {
+	while (pl) {
 		count++;
 		pl = pl->next;
 	}
@@ -198,7 +192,7 @@
 	currentSaveFile.writeSint16LE(count);
 
 	pl = backgroundIncrustHead.next;
-	while(pl) {
+	while (pl) {
 		char dummy[4] = {0, 0, 0, 0};
 		currentSaveFile.write(dummy, 2);
 		currentSaveFile.write(dummy, 2);
@@ -214,7 +208,7 @@
 		currentSaveFile.writeSint16LE(pl->scriptNumber);
 		currentSaveFile.writeSint16LE(pl->scriptOverlayIdx);
 		currentSaveFile.write(dummy, 4);
-		currentSaveFile.writeSint16LE(pl->saveWidth/2);
+		currentSaveFile.writeSint16LE(pl->saveWidth / 2);
 		currentSaveFile.writeSint16LE(pl->saveHeight);
 		currentSaveFile.writeSint16LE(pl->saveSize);
 		currentSaveFile.writeSint16LE(pl->savedX);
@@ -261,7 +255,7 @@
 		pl2->scriptNumber = currentSaveFile.readSint16LE();
 		pl2->scriptOverlayIdx = currentSaveFile.readSint16LE();
 		currentSaveFile.skip(4);
-		pl2->saveWidth = currentSaveFile.readSint16LE()*2;
+		pl2->saveWidth = currentSaveFile.readSint16LE() * 2;
 		pl2->saveHeight = currentSaveFile.readSint16LE();
 		pl2->saveSize = currentSaveFile.readUint16LE();
 		pl2->savedX = currentSaveFile.readSint16LE();
@@ -301,26 +295,23 @@
 
 	backgroundIncrustStruct* pl = pHead->next;
 
-	while(pl) {
+	while (pl) {
 		backgroundIncrustStruct* pl2 = pl->next;
 
 		bool bLoad = false;
 		int frame = pl->field_E;
 		//int screen = pl->backgroundIdx;
 
-		if((filesDatabase[frame].subData.ptr == NULL) || (strcmp(pl->name, filesDatabase[frame].subData.name))) {
+		if ((filesDatabase[frame].subData.ptr == NULL) || (strcmp(pl->name, filesDatabase[frame].subData.name))) {
 			frame = 257 - 1;
-			if(loadFile( pl->name, frame, pl->spriteId ) >= 0) {
+			if (loadFile(pl->name, frame, pl->spriteId) >= 0) {
 				bLoad = true;
-			}
-			else
-			{
+			} else {
 				frame = -1;
 			}
 		}
 
-		if( frame >= -1 )
-		{
+		if (frame >= -1) {
 			if (filesDatabase[frame].subData.resourceType == 4) {	// sprite
 				int width = filesDatabase[frame].width;
 				int height = filesDatabase[frame].height;
@@ -411,8 +402,7 @@
 	}
 }
 
-void unmergeBackgroundIncrust(backgroundIncrustStruct * pHead, int ovl, int idx)
-{
+void unmergeBackgroundIncrust(backgroundIncrustStruct * pHead, int ovl, int idx) {
 	backgroundIncrustStruct *pl;
 	backgroundIncrustStruct *pl2;
 
@@ -426,12 +416,11 @@
 	pl2 = pl;
 	pl = pl2->next;
 
-	while(pl)
-	{
+	while (pl) {
 		pl2 = pl;
-		if((pl->overlayIdx == ovl) || (ovl == -1))
-			if((pl->objectIdx == idx) || (idx == -1))
-				if((pl->X == x) && (pl->Y == y))
+		if ((pl->overlayIdx == ovl) || (ovl == -1))
+			if ((pl->objectIdx == idx) || (idx == -1))
+				if ((pl->X == x) && (pl->Y == y))
 					restoreBackground(pl);
 
 		pl = pl2->next;

Modified: scummvm/trunk/engines/cruise/cell.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cell.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/cell.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -37,19 +37,19 @@
 }
 
 void freeMessageList(cellStruct *objPtr) {
-/*	if (objPtr) {
-		 if (objPtr->next)
-		 free(objPtr->next);
+	/*	if (objPtr) {
+			 if (objPtr->next)
+			 free(objPtr->next);
 
-		free(objPtr);
-	} */
+			free(objPtr);
+		} */
 }
 void saveCell(Common::OutSaveFile& currentSaveFile) {
 
 	int count = 0;
 	cellStruct *t = cellHead.next;
 
-	while(t) {
+	while (t) {
 		count++;
 		t = t->next;
 	}
@@ -57,7 +57,7 @@
 	currentSaveFile.writeSint16LE(count);
 
 	t = cellHead.next;
-	while(t) {
+	while (t) {
 		char dummy[2] = { 0, 0};
 
 		currentSaveFile.write(dummy, 2);
@@ -176,9 +176,9 @@
 
 	if (currentHead2) {
 		if ((currentHead2->overlay == overlayIdx) &&
-		    (currentHead2->backgroundPlane == backgroundPlane) &&
-		    (currentHead2->idx == objIdx) &&
-		    (currentHead2->type == type))
+		        (currentHead2->backgroundPlane == backgroundPlane) &&
+		        (currentHead2->idx == objIdx) &&
+		        (currentHead2->type == type))
 
 			return NULL;
 	}
@@ -276,15 +276,15 @@
 	}
 }
 
-void removeCell(cellStruct *objPtr, int ovlNumber, int objectIdx, int objType, int backgroundPlane ) {
+void removeCell(cellStruct *objPtr, int ovlNumber, int objectIdx, int objType, int backgroundPlane) {
 	cellStruct *currentObj = objPtr->next;
 	cellStruct *previous;
 
 	while (currentObj) {
 		if (((currentObj->overlay == ovlNumber) || (ovlNumber == -1)) &&
-		    ((currentObj->idx == objectIdx) || (objectIdx == -1)) &&
-		    ((currentObj->type == objType) || (objType == -1)) &&
-		    ((currentObj->backgroundPlane == backgroundPlane) || (backgroundPlane == -1))) {
+		        ((currentObj->idx == objectIdx) || (objectIdx == -1)) &&
+		        ((currentObj->type == objType) || (objType == -1)) &&
+		        ((currentObj->backgroundPlane == backgroundPlane) || (backgroundPlane == -1))) {
 			currentObj->type = -1;
 		}
 
@@ -339,7 +339,7 @@
 	}
 }
 
-void freezeCell(cellStruct * pObject, int overlayIdx, int objIdx, int objType, int backgroundPlane, int oldFreeze, int newFreeze ) {
+void freezeCell(cellStruct * pObject, int overlayIdx, int objIdx, int objType, int backgroundPlane, int oldFreeze, int newFreeze) {
 	while (pObject) {
 		if ((pObject->overlay == overlayIdx) || (overlayIdx == -1)) {
 			if ((pObject->idx == objIdx) || (objIdx == -1)) {
@@ -358,7 +358,7 @@
 }
 
 void sortCells(int16 ovlIdx, int16 ovjIdx, cellStruct *objPtr) {
-	cellStruct *pl,*pl2,*pl3,*pl4,*plz,*pllast;
+	cellStruct *pl, *pl2, *pl3, *pl4, *plz, *pllast;
 	cellStruct prov;
 	int16 newz, objz, sobjz;
 
@@ -423,9 +423,9 @@
 		plz->next = pl2;
 		pllast->next = pl4;
 
-		if(plz != objPtr)
+		if (plz != objPtr)
 			pl2->prev = plz;
-		if(!pl4)
+		if (!pl4)
 			objPtr->prev = pllast;
 		else
 			pl4->prev = pllast;

Modified: scummvm/trunk/engines/cruise/cell.h
===================================================================
--- scummvm/trunk/engines/cruise/cell.h	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/cell.h	2009-01-16 02:43:41 UTC (rev 35870)
@@ -69,8 +69,8 @@
 void saveCell(Common::OutSaveFile& currentSaveFile);
 cellStruct *addCell(cellStruct *pHead, int16 overlayIdx, int16 objIdx, int16 type, int16 backgroundPlane, int16 scriptOverlay, int16 scriptNumber, int16 scriptType);
 void createTextObject(cellStruct *pObject, int overlayIdx, int messageIdx, int x, int y, int width, int16 color, int backgroundPlane, int parentOvl, int parentIdx);
-void removeCell(cellStruct *objPtr, int ovlNumber, int objectIdx, int objType, int backgroundPlane );
-void freezeCell(cellStruct * pObject, int overlayIdx, int objIdx, int objType, int backgroundPlane, int oldFreeze, int newFreeze );
+void removeCell(cellStruct *objPtr, int ovlNumber, int objectIdx, int objType, int backgroundPlane);
+void freezeCell(cellStruct * pObject, int overlayIdx, int objIdx, int objType, int backgroundPlane, int oldFreeze, int newFreeze);
 void sortCells(int16 param1, int16 param2, cellStruct *objPtr);
 void linkCell(cellStruct *pHead, int ovl, int obj, int type, int ovl2, int obj2);
 

Modified: scummvm/trunk/engines/cruise/cruise.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/cruise.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -51,13 +51,13 @@
 #endif
 
 	Common::addSpecialDebugLevel(kCruiseDebugScript, "Script",
-	    "Script debug level");
+	                             "Script debug level");
 
 	// Setup mixer
 	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType,
-	    ConfMan.getInt("sfx_volume"));
+	                              ConfMan.getInt("sfx_volume"));
 	_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType,
-	    ConfMan.getInt("music_volume"));
+	                              ConfMan.getInt("music_volume"));
 
 	g_cruise = this;
 

Modified: scummvm/trunk/engines/cruise/cruise.h
===================================================================
--- scummvm/trunk/engines/cruise/cruise.h	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/cruise.h	2009-01-16 02:43:41 UTC (rev 35870)
@@ -41,39 +41,39 @@
 
 struct CRUISEGameDescription;
 
-class CruiseEngine:public Engine {
+class CruiseEngine: public Engine {
 
-protected:
-	// Engine APIs
-	virtual Common::Error init();
-	virtual Common::Error go();
+	protected:
+		// Engine APIs
+		virtual Common::Error init();
+		virtual Common::Error go();
 
-	void shutdown();
+		void shutdown();
 
-	bool initGame();
+		bool initGame();
 
-public:
-	CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc);
-	virtual ~ CruiseEngine();
+	public:
+		CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc);
+		virtual ~ CruiseEngine();
 
-	int getGameType() const;
-	uint32 getFeatures() const;
-	Common::Language getLanguage() const;
-	Common::Platform getPlatform() const;
+		int getGameType() const;
+		uint32 getFeatures() const;
+		Common::Language getLanguage() const;
+		Common::Platform getPlatform() const;
 
-	bool loadSaveDirectory(void);
-	void makeSystemMenu(void);
+		bool loadSaveDirectory(void);
+		void makeSystemMenu(void);
 
-	const CRUISEGameDescription *_gameDescription;
+		const CRUISEGameDescription *_gameDescription;
 
-	Common::RandomSource _rnd;
+		Common::RandomSource _rnd;
 
-private:
-	void initialize(void);
-	bool makeLoad(char *saveName);
-	void mainLoop(int bootScriptIdx);
+	private:
+		void initialize(void);
+		bool makeLoad(char *saveName);
+		void mainLoop(int bootScriptIdx);
 
-	bool _preLoad;
+		bool _preLoad;
 };
 
 extern CruiseEngine *g_cruise;

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -167,10 +167,10 @@
 	pScriptInstance = pScriptInstance->nextScriptPtr;
 	while (pScriptInstance) {
 		if ((pScriptInstance->overlayNumber == param1) || (param1 == -1))
-		    if ((pScriptInstance->scriptNumber == param2) || (param2 == -1))
+			if ((pScriptInstance->scriptNumber == param2) || (param2 == -1))
 				if ((pScriptInstance->freeze == oldFreeze) || (oldFreeze == -1)) {
 					pScriptInstance->freeze = newValue;
-		}
+				}
 
 		pScriptInstance = pScriptInstance->nextScriptPtr;
 	}
@@ -247,12 +247,12 @@
 }
 
 void scriptFunc2(int scriptNumber, scriptInstanceStruct * scriptHandle,
-	    int param, int param2) {
+                 int param, int param2) {
 	if (scriptHandle->nextScriptPtr) {
 		if (scriptNumber == scriptHandle->nextScriptPtr->overlayNumber
-		    || scriptNumber != -1) {
+		        || scriptNumber != -1) {
 			if (param2 == scriptHandle->nextScriptPtr->scriptNumber
-			    || param2 != -1) {
+			        || param2 != -1) {
 				scriptHandle->nextScriptPtr->sysKey = param;
 			}
 		}
@@ -272,33 +272,19 @@
 
 	switch (param) {
 	case 0:
-		{
-			return (dataPtr);
-		}
+		return (dataPtr);
 	case 1:
-		{
-			return (dataPtr + ptr->offsetToSubData3);	// strings
-		}
+		return (dataPtr + ptr->offsetToSubData3);	// strings
 	case 2:
-		{
-			return (dataPtr + ptr->offsetToSubData2);
-		}
+		return (dataPtr + ptr->offsetToSubData2);
 	case 3:
-		{
-			return (dataPtr + ptr->offsetToImportData);	// import data
-		}
+		return (dataPtr + ptr->offsetToImportData);	// import data
 	case 4:
-		{
-			return (dataPtr + ptr->offsetToImportName);	// import names
-		}
+		return (dataPtr + ptr->offsetToImportName);	// import names
 	case 5:
-		{
-			return (dataPtr + ptr->offsetToSubData5);
-		}
+		return (dataPtr + ptr->offsetToSubData5);
 	default:
-		{
-			return (NULL);
-		}
+		return NULL;
 	}
 }
 
@@ -601,13 +587,12 @@
 	return (0);
 }
 
-bool testMask(int x, int y, unsigned char* pData, int stride)
-{
-	unsigned char* ptr = y * stride + x/8 + pData;
+bool testMask(int x, int y, unsigned char* pData, int stride) {
+	unsigned char* ptr = y * stride + x / 8 + pData;
 
 	unsigned char bitToTest = 0x80 >> (x & 7);
 
-	if((*ptr) & bitToTest)
+	if ((*ptr) & bitToTest)
 		return true;
 	return false;
 }
@@ -682,7 +667,7 @@
 
 								offset += j;
 
-								if (offset >= 0 ) {
+								if (offset >= 0) {
 									if (filesDatabase[offset].resType == 0 && filesDatabase[offset].subData.ptr) {
 										dataPtr = (int16 *)filesDatabase[offset].subData.ptr;
 									}
@@ -712,7 +697,7 @@
 							int offsetY = mouseY - y;
 
 							if ((offsetX >= 0) && (offsetX < nWidth) && (offsetY >= 0) && (offsetY <= nHeight) && filesDatabase[j].subData.ptr) {
-								if(testMask(offsetX, offsetY, filesDatabase[j].subData.ptrMask, filesDatabase[j].width/8)) {
+								if (testMask(offsetX, offsetY, filesDatabase[j].subData.ptrMask, filesDatabase[j].width / 8)) {
 									*outObjOvl = linkedObjOvl;
 									*outObjIdx = linkedObjIdx;
 									return currentObject->type;
@@ -725,7 +710,7 @@
 						int width = params.fileIdx;
 						int height = params.scale;
 
-						if ((mouseX >= x) && (mouseX <= x+width) && (mouseY >= y) && (mouseY <= y+height)) {
+						if ((mouseX >= x) && (mouseX <= x + width) && (mouseY >= y) && (mouseY <= y + height)) {
 							*outObjOvl = linkedObjOvl;
 							*outObjIdx = linkedObjIdx;
 
@@ -769,9 +754,8 @@
 	int i = 0;
 //	int j = 0;
 
-	while (i < index)
-	{
-		ptr += strlen(ptr)+1;
+	while (i < index) {
+		ptr += strlen(ptr) + 1;
 		i++;
 	}
 	return ptr;
@@ -793,7 +777,7 @@
 	pMenu = createMenu(X, Y, "Inventaire");
 	menuTable[1] = pMenu;
 
-	if(pMenu == NULL)
+	if (pMenu == NULL)
 		return;
 
 	int numObjectInInventory = 0;
@@ -801,7 +785,7 @@
 		ovlDataStruct *pOvlData = overlayTable[i].ovlData;
 
 		if (overlayTable[i].alreadyLoaded) {
-			if(overlayTable[i].ovlData->arrayObject) {
+			if (overlayTable[i].ovlData->arrayObject) {
 				for (int j = 0; j < pOvlData->numObj; j++) {
 					if (getObjectClass(i, j) != 3) {
 						int16 returnVar;
@@ -872,7 +856,7 @@
 		if (overlayTable[j].alreadyLoaded) {
 			int idHeader = overlayTable[j].ovlData->numMsgRelHeader;
 
-			for (int i=0; i<idHeader; i++) {
+			for (int i = 0; i < idHeader; i++) {
 				linkDataStruct* ptrHead = &overlayTable[j].ovlData->arrayMsgRelHeader[i];
 				int thisOvl = ptrHead->obj1Overlay;
 
@@ -884,21 +868,21 @@
 
 				getSingleObjectParam(thisOvl, ptrHead->obj1Number, 5, &objectState2);
 
-				if (pObject && (pObject->_class == THEME) && (objectState2 <-1)) {
+				if (pObject && (pObject->_class == THEME) && (objectState2 < -1)) {
 
 					thisOvl = ptrHead->obj2Overlay;
 					if (!thisOvl) {
 						thisOvl = j;
 					}
 
-					if((thisOvl==objOvl) && (ptrHead->obj2Number==objIdx)) {
+					if ((thisOvl == objOvl) && (ptrHead->obj2Number == objIdx)) {
 						int verbeOvl = ptrHead->verbOverlay;
 						int obj1Ovl = ptrHead->obj1Overlay;
 						int obj2Ovl = ptrHead->obj2Overlay;
 
-						if (!verbeOvl) verbeOvl=j;
-						if (!obj1Ovl)  obj1Ovl=j;
-						if (!obj2Ovl)  obj2Ovl=j;
+						if (!verbeOvl) verbeOvl = j;
+						if (!obj1Ovl)  obj1Ovl = j;
+						if (!obj2Ovl)  obj2Ovl = j;
 
 						char verbe_name[80];
 						char obj1_name[80];
@@ -907,12 +891,12 @@
 						char r_obj1_name[80];
 						char r_obj2_name[80];
 
-						verbe_name[0]	=0;
-						obj1_name[0]	=0;
-						obj2_name[0]	=0;
-						r_verbe_name[0] =0;
-						r_obj1_name[0]	=0;
-						r_obj2_name[0]	=0;
+						verbe_name[0]	= 0;
+						obj1_name[0]	= 0;
+						obj2_name[0]	= 0;
+						r_verbe_name[0] = 0;
+						r_obj1_name[0]	= 0;
+						r_obj2_name[0]	= 0;
 
 						ovlDataStruct *ovl2 = NULL;
 						ovlDataStruct *ovl3 = NULL;
@@ -934,9 +918,9 @@
 							testState2 = ptrHead->obj2OldState;
 						}
 
-						if ((ovl4) && (ptrHead->verbNumber>=0) &&
-							((testState1 == -1) || (testState1 == objectState2)) &&
-							((testState2 == -1) || (testState2 == objectState)) ) {
+						if ((ovl4) && (ptrHead->verbNumber >= 0) &&
+						        ((testState1 == -1) || (testState1 == objectState2)) &&
+						        ((testState2 == -1) || (testState2 == objectState))) {
 							if (ovl2->nameVerbGlob) {
 								const char *ptr = getObjectName(ptrHead->verbNumber, ovl2->nameVerbGlob);
 								strcpy(verbe_name, ptr);
@@ -947,7 +931,7 @@
 									found = true;
 									int color;
 
-									if(objectState2==-2)
+									if (objectState2 == -2)
 										color = subColor;
 									else
 										color = -1;
@@ -979,7 +963,7 @@
 		if (overlayTable[j].alreadyLoaded) {
 			int idHeader = overlayTable[j].ovlData->numMsgRelHeader;
 
-			for (int i=0; i<idHeader; i++) {
+			for (int i = 0; i < idHeader; i++) {
 				linkDataStruct* ptrHead = &overlayTable[j].ovlData->arrayMsgRelHeader[i];
 				int thisOvl = ptrHead->obj1Overlay;
 
@@ -996,9 +980,9 @@
 					int obj1Ovl = ptrHead->obj1Overlay;
 					int obj2Ovl = ptrHead->obj2Overlay;
 
-					if (!verbeOvl) verbeOvl=j;
-					if (!obj1Ovl)  obj1Ovl=j;
-					if (!obj2Ovl)  obj2Ovl=j;
+					if (!verbeOvl) verbeOvl = j;
+					if (!obj1Ovl)  obj1Ovl = j;
+					if (!obj2Ovl)  obj2Ovl = j;
 
 					char verbe_name[80];
 					char obj1_name[80];
@@ -1007,12 +991,12 @@
 					char r_obj1_name[80];
 					char r_obj2_name[80];
 
-					verbe_name[0]	=0;
-					obj1_name[0]	=0;
-					obj2_name[0]	=0;
-					r_verbe_name[0] =0;
-					r_obj1_name[0]	=0;
-					r_obj2_name[0]	=0;
+					verbe_name[0]	= 0;
+					obj1_name[0]	= 0;
+					obj2_name[0]	= 0;
+					r_verbe_name[0] = 0;
+					r_obj1_name[0]	= 0;
+					r_obj2_name[0]	= 0;
 
 					ovlDataStruct *ovl2 = NULL;
 					ovlDataStruct *ovl3 = NULL;
@@ -1037,24 +1021,19 @@
 							first = false;
 						}
 					}
-					if ((ovl2) && (ptrHead->verbNumber>=0)) {
+					if ((ovl2) && (ptrHead->verbNumber >= 0)) {
 						if (ovl2->nameVerbGlob) {
 							const char *ptr = getObjectName(ptrHead->verbNumber, ovl2->nameVerbGlob);
 							strcpy(verbe_name, ptr);
 
-							if ( (!first) && ((testState==-1) || (testState==objectState))) {
-								if (!strlen(verbe_name))
-								{
-									if(currentScriptPtr)
-									{
+							if ((!first) && ((testState == -1) || (testState == objectState))) {
+								if (!strlen(verbe_name)) {
+									if (currentScriptPtr) {
 										attacheNewScriptToTail(&relHead, j, ptrHead->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
-									}
-									else
-									{
+									} else {
 										attacheNewScriptToTail(&relHead, j, ptrHead->id, 30, 0, 0, scriptType_REL);
 									}
-								}
-								else if (ovl2->nameVerbGlob) {
+								} else if (ovl2->nameVerbGlob) {
 									found = true;
 									ptr = getObjectName(ptrHead->verbNumber, ovl2->nameVerbGlob);
 									addSelectableMenuEntry(j, i, menuTable[0], 1, -1, ptr);
@@ -1123,12 +1102,9 @@
 
 			if ((pHeader->obj2OldState == -1) || (params.state == pHeader->obj2OldState)) {
 				if (pHeader->type == 30) { // REL
-					if(currentScriptPtr)
-					{
+					if (currentScriptPtr) {
 						attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
-					}
-					else
-					{
+					} else {
 						attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, 0, 0, scriptType_REL);
 					}
 
@@ -1177,10 +1153,10 @@
 	int bestColorResult = -1;
 	int bestColorIdx = -1;
 
-	for(unsigned long int i=0; i<256; i++) {
+	for (unsigned long int i = 0; i < 256; i++) {
 		int colorResult = (workpal[i*3+0] + workpal[i*3+1] + workpal[i*3+2]) / 256;
 
-		if(colorResult > bestColorResult) {
+		if (colorResult > bestColorResult) {
 			bestColorIdx = i;
 			bestColorResult =  colorResult;
 		}
@@ -1203,12 +1179,9 @@
 		if (pHeader->obj2Number == nObj2) {
 			// REL
 			if (pHeader->type == 30) {
-				if(currentScriptPtr)
-				{
+				if (currentScriptPtr) {
 					attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
-				}
-				else
-				{
+				} else {
 					attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, 0, 0, scriptType_REL);
 				}
 
@@ -1256,7 +1229,7 @@
 					getMultipleObjectParam(obj1Ovl, pHeader->obj1Number, &params);
 
 					if (narratorOvl > 0) {
-						if ((pHeader->trackX !=-1) && (pHeader->trackY != -1) && (pHeader->trackX != 9999) && (pHeader->trackY != 9999)) {
+						if ((pHeader->trackX != -1) && (pHeader->trackY != -1) && (pHeader->trackX != 9999) && (pHeader->trackY != 9999)) {
 							x = pHeader->trackX - 100;
 							y = pHeader->trackY - 150;
 						} else {
@@ -1274,12 +1247,9 @@
 					}
 				}
 
-				if(currentScriptPtr)
-				{
+				if (currentScriptPtr) {
 					createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), masterScreen, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
-				}
-				else
-				{
+				} else {
 					createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), masterScreen, 0, 0);
 				}
 
@@ -1329,12 +1299,12 @@
 }
 
 void closeAllMenu(void) {
-	if(menuTable[0]) {
+	if (menuTable[0]) {
 		freeMenu(menuTable[0]);
 		menuTable[0] = NULL;
 	}
 
-	if(menuTable[1]) {
+	if (menuTable[1]) {
 		freeMenu(menuTable[1]);
 		menuTable[1] = NULL;
 	}
@@ -1394,7 +1364,7 @@
 
 	if (dialogueEnabled) {
 
-		if( menuDown || selectDown || linkedRelation ) {
+		if (menuDown || selectDown || linkedRelation) {
 			closeAllMenu();
 			menuDown = 0;
 			selectDown = 0;
@@ -1402,26 +1372,23 @@
 			changeCursor(CURSOR_NORMAL);
 		}
 
-		if((menuTable[0]==NULL) && (!buttonDown)) {
+		if ((menuTable[0] == NULL) && (!buttonDown)) {
 			int dialogFound = createDialog(dialogueOvl, dialogueObj, xdial, 0);
 
-			if(menuTable[0]) {
-				if(dialogFound) {
+			if (menuTable[0]) {
+				if (dialogFound) {
 					currentActiveMenu = 0;
-				}
-				else {
+				} else {
 					freeMenu(menuTable[0]);
 					menuTable[0] = NULL;
 					currentActiveMenu = -1;
 				}
-			}
-			else {
+			} else {
 				menuDown = 0;
 			}
-		}
-		else {
-			if((button & 1) && (buttonDown == 0)) {
-				if(menuTable[0]) {
+		} else {
+			if ((button & 1) && (buttonDown == 0)) {
+				if (menuTable[0]) {
 					callRelation(getSelectedEntryInMenu(menuTable[0]), dialogueObj);
 
 					freeMenu(menuTable[0]);
@@ -1429,7 +1396,7 @@
 
 					if (linkedMsgList) {
 						ASSERT(0);
-				//					freeMsgList(linkedMsgList);
+						//					freeMsgList(linkedMsgList);
 					}
 
 					linkedMsgList = NULL;
@@ -1471,10 +1438,10 @@
 				linkedRelation = NULL;
 				changeCursor(CURSOR_NORMAL);
 			} else { // call sub relation when clicking in inventory
-				if(menuTable[0] && menuTable[1]) {
+				if (menuTable[0] && menuTable[1]) {
 					menuElementSubStruct * p0 = getSelectedEntryInMenu(menuTable[1]);
 
-					if(p0)
+					if (p0)
 						callSubRelation(linkedRelation, p0->ovlIdx, p0->header);
 
 					closeAllMenu();
@@ -1516,7 +1483,7 @@
 							animationStart = true;
 							buttonDown = 0;
 						}
-					}else {
+					} else {
 						// No object found, we move the character to the cursor
 						aniX = mouseX;
 						aniY = mouseY;
@@ -1601,41 +1568,41 @@
 	Common::EventManager * eventMan = g_system->getEventManager();
 	while (eventMan->pollEvent(event)) {
 		switch (event.type) {
-			case Common::EVENT_LBUTTONDOWN:
-				currentMouseButton |= 1;
-				break;
-			case Common::EVENT_LBUTTONUP:
-				currentMouseButton &= ~1;
-				break;
-			case Common::EVENT_RBUTTONDOWN:
-				currentMouseButton |= 2;
-				break;
-			case Common::EVENT_RBUTTONUP:
-				currentMouseButton &= ~2;
-				break;
-			case Common::EVENT_MOUSEMOVE:
-				currentMouseX = event.mouse.x;
-				currentMouseY = event.mouse.y;
-				break;
+		case Common::EVENT_LBUTTONDOWN:
+			currentMouseButton |= 1;
+			break;
+		case Common::EVENT_LBUTTONUP:
+			currentMouseButton &= ~1;
+			break;
+		case Common::EVENT_RBUTTONDOWN:
+			currentMouseButton |= 2;
+			break;
+		case Common::EVENT_RBUTTONUP:
+			currentMouseButton &= ~2;
+			break;
+		case Common::EVENT_MOUSEMOVE:
+			currentMouseX = event.mouse.x;
+			currentMouseY = event.mouse.y;
+			break;
 		case Common::EVENT_QUIT:
 			g_system->quit();
 			break;
 		case Common::EVENT_KEYUP:
 			switch (event.kbd.keycode) {
-				case 27: // ESC
-					currentMouseButton &= ~4;
-					break;
-				default:
-					break;
+			case 27: // ESC
+				currentMouseButton &= ~4;
+				break;
+			default:
+				break;
 			}
 			break;
-	    case Common::EVENT_KEYDOWN:
+		case Common::EVENT_KEYDOWN:
 			switch (event.kbd.keycode) {
-				case 27: // ESC
-					currentMouseButton |= 4;
-					break;
-				default:
-					break;
+			case 27: // ESC
+				currentMouseButton |= 4;
+				break;
+			default:
+				break;
 			}
 
 			/*
@@ -1792,18 +1759,19 @@
 
 			if (cmdLine[0]) {
 				ASSERT(0);
-/*        redrawStrings(0,&cmdLine,8);
+				/*        redrawStrings(0,&cmdLine,8);
 
-        waitForPlayerInput();
+				        waitForPlayerInput();
 
-        cmdLine = 0; */
+				        cmdLine = 0; */
 			}
 
 			if (displayOn) {
 				if (doFade)
 					PCFadeFlag = 0;
 
-				/*if (!PCFadeFlag)*/ {
+				/*if (!PCFadeFlag)*/
+				{
 					mainDraw(0);
 					flipScreen();
 				}
@@ -1851,7 +1819,7 @@
 
 					do {
 						getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
-					}while(mouseButton);
+					} while (mouseButton);
 
 					while (!mouseButton) {
 						manageScripts(&relHead);
@@ -1895,7 +1863,7 @@
 						userEnabled = false;
 					}
 				} else if (autoMsg != -1) {
-					removeCell(&cellHead, autoOvl, autoMsg, 5, masterScreen );
+					removeCell(&cellHead, autoOvl, autoMsg, 5, masterScreen);
 					autoMsg = -1;
 				}
 			}

Modified: scummvm/trunk/engines/cruise/ctp.cpp
===================================================================
--- scummvm/trunk/engines/cruise/ctp.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/ctp.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -58,11 +58,11 @@
 
 // this function process path finding coordinates
 void computeAllDistance(int16 table[][10], short int coordCount) {
-	for(int i=0; i<coordCount; i++) {
+	for (int i = 0; i < coordCount; i++) {
 		int x1 = ctp_routeCoords[i][0];
 		int y1 = ctp_routeCoords[i][1];
 
-		for(int j=0; j<ctp_routes[i][0]; j++) {
+		for (int j = 0; j < ctp_routes[i][0]; j++) {
 			int p = ctp_routes[i][j+1];
 
 			int x2 = ctp_routeCoords[p][0];
@@ -79,7 +79,7 @@
 	int maxX = -1;
 	int maxY = -1;
 
-	for(int i=0; i< table[n][0]; i++) {
+	for (int i = 0; i < table[n][0]; i++) {
 		int x = table[n][i*2+1];
 		int y = table[n][i*2+2];
 
@@ -101,7 +101,7 @@
 }
 
 // ax dx bx
-void renderCTPWalkBox(int16 *walkboxData, int hotPointX, int hotPointY, int X, int Y, int scale ) {
+void renderCTPWalkBox(int16 *walkboxData, int hotPointX, int hotPointY, int X, int Y, int scale) {
 	int numPoints;
 	int i;
 	int16 *destination;
@@ -117,8 +117,8 @@
 		int pointX = *(walkboxData++);
 		int pointY = *(walkboxData++);
 
-		int scaledX =((upscaleValue(pointX, scale) + 0x8000) >> 16) + startX;
-		int scaledY =((upscaleValue(pointY, scale) + 0x8000) >> 16) + startX;
+		int scaledX = ((upscaleValue(pointX, scale) + 0x8000) >> 16) + startX;
+		int scaledY = ((upscaleValue(pointY, scale) + 0x8000) >> 16) + startX;
 
 		*(destination++) = scaledX;
 		*(destination++) = scaledY;
@@ -139,7 +139,7 @@
 	int minX = 1000;
 	int maxX = -1;
 
-	if(table[num][0] < 1)
+	if (table[num][0] < 1)
 		return;
 
 	getWalkBoxCenter(num, table);
@@ -147,7 +147,7 @@
 	currentWalkBoxCenterXBis = currentWalkBoxCenterX;
 	currentWalkBoxCenterYBis = currentWalkBoxCenterY;
 
-	renderCTPWalkBox(&table[num][0], currentWalkBoxCenterX, currentWalkBoxCenterY,  currentWalkBoxCenterX, currentWalkBoxCenterY, z + 0x200 );
+	renderCTPWalkBox(&table[num][0], currentWalkBoxCenterX, currentWalkBoxCenterY,  currentWalkBoxCenterX, currentWalkBoxCenterY, z + 0x200);
 
 	int16* a1;
 	int16* a2;
@@ -158,16 +158,16 @@
 	int16* XArray = XMIN_XMAX;
 	int minY = *XArray++;
 
-	int i=0;
+	int i = 0;
 
-	while( *XArray >= 0 ) {
+	while (*XArray >= 0) {
 		int x1 = *XArray++;
 		int x2 = *XArray++;
 
-		if(x1<minX)
+		if (x1 < minX)
 			minX = x1;
 
-		if(x2>maxX)
+		if (x2 > maxX)
 			maxX = x2;
 
 		*a2++ = x1;
@@ -178,18 +178,18 @@
 
 	adrStructPoly = (uint8*)a2;
 
-	*(uint16**)a2 = (uint16*)-1; //chained list terminator
+	*(uint16**)a2 = (uint16*) - 1; //chained list terminator
 
-	a1+=sizeof(int16*);
-	*a1++=num;
-	*a1++=walkboxColor[num];
-	*a1++=minX;
-	*a1++=maxX;
-	*a1++=minY;
-	*a1++=minY+i+2;
+	a1 += sizeof(int16*);
+	*a1++ = num;
+	*a1++ = walkboxColor[num];
+	*a1++ = minX;
+	*a1++ = maxX;
+	*a1++ = minY;
+	*a1++ = minY + i + 2;
 }
 
-int getNode(int nodeResult[2], int nodeId){
+int getNode(int nodeResult[2], int nodeId) {
 	if (nodeId < 0 || nodeId >= ctp_routeCoordCount)
 		return -1;
 
@@ -205,10 +205,10 @@
 
 	int oldColor = walkboxColor[nodeIdx];
 
-	if(nodeColor == -1)
+	if (nodeColor == -1)
 		return
 
-	walkboxColor[nodeIdx] = nodeColor;
+		    walkboxColor[nodeIdx] = nodeColor;
 
 	return oldColor;
 }
@@ -219,10 +219,10 @@
 
 	int oldState = walkboxState[nodeIdx];
 
-	if(nodeState == -1)
+	if (nodeState == -1)
 		return
 
-	walkboxState[nodeIdx] = nodeState;
+		    walkboxState[nodeIdx] = nodeState;
 
 	return oldState;
 }
@@ -232,7 +232,7 @@
 	char fileType[5];	// string2
 	short int segementSizeTable[7];	// tempTable
 
-	if ( !loadCtFromSave) {
+	if (!loadCtFromSave) {
 		for (int i = 0; i < 10; i++) {
 			persoTable[i] = NULL;
 		}
@@ -257,14 +257,14 @@
 	ctp_routeCoordCount = readB16(dataPointer); // get the number of nods
 	dataPointer += 2;
 
-	for(int i=0; i<7; i++) {
+	for (int i = 0; i < 7; i++) {
 		segementSizeTable[i] = readB16(dataPointer);
 		dataPointer += 2;
 	}
 
 	// get the path-finding coordinates
-	ASSERT((segementSizeTable[0]%4) == 0);
-	for(int i=0; i<segementSizeTable[0]/4; i++) {
+	ASSERT((segementSizeTable[0] % 4) == 0);
+	for (int i = 0; i < segementSizeTable[0] / 4; i++) {
 		ctp_routeCoords[i][0] = readB16(dataPointer);
 		dataPointer += 2;
 		ctp_routeCoords[i][1] = readB16(dataPointer);
@@ -272,18 +272,18 @@
 	}
 
 	// get the path-finding line informations (indexing the routeCoords array)
-	ASSERT((segementSizeTable[1]%20) == 0);
-	for(int i=0; i<segementSizeTable[1]/20; i++) {
-		for(int j=0; j<10; j++) {
+	ASSERT((segementSizeTable[1] % 20) == 0);
+	for (int i = 0; i < segementSizeTable[1] / 20; i++) {
+		for (int j = 0; j < 10; j++) {
 			ctp_routes[i][j] = readB16(dataPointer);
 			dataPointer += 2;
 		}
 	}
 
 	// read polygons
-	ASSERT((segementSizeTable[2]%80) == 0);
-	for(int i=0; i<segementSizeTable[2]/80; i++) {
-		for(int j=0; j<40; j++) {
+	ASSERT((segementSizeTable[2] % 80) == 0);
+	for (int i = 0; i < segementSizeTable[2] / 80; i++) {
+		for (int j = 0; j < 40; j++) {
 			ctp_walkboxTable[i][j] = readB16(dataPointer);
 			dataPointer += 2;
 		}
@@ -297,14 +297,14 @@
 		// get the walkbox type
 		// Type: 0x00 - non walkable, 0x01 - walkable, 0x02 - exit zone
 		ASSERT((segementSizeTable[3] % 2) == 0);
-		for(int i=0; i<segementSizeTable[3]/2; i++) {
+		for (int i = 0; i < segementSizeTable[3] / 2; i++) {
 			walkboxColor[i] = readB16(dataPointer);
 			dataPointer += 2;
 		}
 
 		// change indicator, walkbox type can change, i.e. blocked by object (values are either 0x00 or 0x01)
 		ASSERT((segementSizeTable[4] % 2) == 0);
-		for(int i=0; i<segementSizeTable[4]/2; i++) {
+		for (int i = 0; i < segementSizeTable[4] / 2; i++) {
 			walkboxState[i] = readB16(dataPointer);
 			dataPointer += 2;
 		}
@@ -312,14 +312,14 @@
 
 	//
 	ASSERT((segementSizeTable[5] % 2) == 0);
-	for(int i=0; i<segementSizeTable[5]/2; i++) {
+	for (int i = 0; i < segementSizeTable[5] / 2; i++) {
 		walkboxColorIndex[i] = readB16(dataPointer);
 		dataPointer += 2;
 	}
 
 	//
 	ASSERT((segementSizeTable[6] % 2) == 0);
-	for(int i=0; i<segementSizeTable[6]/2; i++) {
+	for (int i = 0; i < segementSizeTable[6] / 2; i++) {
 		walkboxZoom[i] = readB16(dataPointer);
 		dataPointer += 2;
 	}
@@ -335,26 +335,26 @@
 
 	ptr = (uint8 *) polyStruct;
 
-	for(int i= numberOfWalkboxes-1; i >=0; i--) {
-		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, 0 );
+	for (int i = numberOfWalkboxes - 1; i >= 0; i--) {
+		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, 0);
 	}
 
 	polyStructExp = adrStructPoly += sizeof(int16 *);
 
-	for(int i= numberOfWalkboxes-1; i >=0; i--) {
-		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, walkboxZoom[i] * 20 );
+	for (int i = numberOfWalkboxes - 1; i >= 0; i--) {
+		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, walkboxZoom[i] * 20);
 	}
 
 	int ctSize = (adrStructPoly - ptr) + sizeof(int16 *); // for now, the +sizeof(int16 *) is a safe zone
 	adrStructPoly = polyStructNorm = polyStruct = (uint8 *) malloc(ctSize);
 
-	for(int i= numberOfWalkboxes-1; i >=0; i--) {
+	for (int i = numberOfWalkboxes - 1; i >= 0; i--) {
 		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, 0);
 	}
 
 	polyStructExp = adrStructPoly += sizeof(int16 *);
 
-	for(int i= numberOfWalkboxes-1; i >=0; i--) {
+	for (int i = numberOfWalkboxes - 1; i >= 0; i--) {
 		makeCtStruct(adrStructPoly, ctp_walkboxTable, i, walkboxZoom[i] * 20);
 	}
 

Modified: scummvm/trunk/engines/cruise/dataLoader.cpp
===================================================================
--- scummvm/trunk/engines/cruise/dataLoader.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/dataLoader.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -115,14 +115,14 @@
 
 	uint8 *buffer = (uint8 *) malloc(spriteSize);
 
-	for(int line = 0; line < pCurrentFileEntry->height; line++) {
+	for (int line = 0; line < pCurrentFileEntry->height; line++) {
 		uint8 p0;
 		uint8 p1;
 		uint8 p2;
 		uint8 p3;
 		uint8 p4;
 
-		for(int x = 0; x < pCurrentFileEntry->widthInColumn; x++) {
+		for (int x = 0; x < pCurrentFileEntry->widthInColumn; x++) {
 			int bit = 7 - (x % 8);
 			int col = x / 8;
 
@@ -236,14 +236,13 @@
 }
 
 int getNumMaxEntiresInSet(uint8 *ptr) {
-	uint16 numEntries = *(uint16 *) (ptr + 4);
+	uint16 numEntries = *(uint16 *)(ptr + 4);
 	flipShort(&numEntries);
 
 	return numEntries;
 }
 
-int loadFile(const char* name, int idx, int destIdx)
-{
+int loadFile(const char* name, int idx, int destIdx) {
 	uint8 *ptr = NULL;
 	fileTypeEnum fileType;
 
@@ -252,32 +251,28 @@
 	loadFileSub1(&ptr, name, NULL);
 
 	switch (fileType) {
-	case type_SET:
-		{
+	case type_SET: {
 
-			int numMaxEntriesInSet = getNumMaxEntiresInSet(ptr);
+		int numMaxEntriesInSet = getNumMaxEntiresInSet(ptr);
 
-			if (idx > numMaxEntriesInSet) {
-				return 0;	// exit if limit is reached
-			}
-			return loadSetEntry(name, ptr, idx, destIdx );
-
-			break;
+		if (idx > numMaxEntriesInSet) {
+			return 0;	// exit if limit is reached
 		}
-	case type_FNT:
-		{
-			return loadFNTSub(ptr, idx);
-			break;
-		}
-	case type_UNK:
-		{
-			break;
-		}
-	case type_SPL:
-		{
-			break;
-		}
+		return loadSetEntry(name, ptr, idx, destIdx);
+
+		break;
 	}
+	case type_FNT: {
+		return loadFNTSub(ptr, idx);
+		break;
+	}
+	case type_UNK: {
+		break;
+	}
+	case type_SPL: {
+		break;
+	}
+	}
 	return -1;
 }
 
@@ -290,34 +285,30 @@
 	loadFileSub1(&ptr, name, NULL);
 
 	switch (fileType) {
-	case type_SET:
-		{
-			int i;
-			int numMaxEntriesInSet = getNumMaxEntiresInSet(ptr);
+	case type_SET: {
+		int i;
+		int numMaxEntriesInSet = getNumMaxEntiresInSet(ptr);
 
-			for (i = 0; i < numIdx; i++) {
-				if ((startIdx + i) > numMaxEntriesInSet) {
-					return 0;	// exit if limit is reached
-				}
-				loadSetEntry(name, ptr, startIdx + i, currentEntryIdx + i );
+		for (i = 0; i < numIdx; i++) {
+			if ((startIdx + i) > numMaxEntriesInSet) {
+				return 0;	// exit if limit is reached
 			}
-
-			break;
+			loadSetEntry(name, ptr, startIdx + i, currentEntryIdx + i);
 		}
-	case type_FNT:
-		{
-			loadFNTSub(ptr, startIdx);
-			break;
-		}
-	case type_UNK:
-		{
-			break;
-		}
-	case type_SPL:
-		{
-			break;
-		}
+
+		break;
 	}
+	case type_FNT: {
+		loadFNTSub(ptr, startIdx);
+		break;
+	}
+	case type_UNK: {
+		break;
+	}
+	case type_SPL: {
+		break;
+	}
+	}
 	return 0;
 }
 
@@ -329,37 +320,33 @@
 
 	loadFileSub1(&ptr, name, NULL);
 
-	if(ptr == NULL)
+	if (ptr == NULL)
 		return 0;
 
 	switch (fileType) {
-	case type_SET:
-		{
-			int i;
-			int numMaxEntriesInSet;
+	case type_SET: {
+		int i;
+		int numMaxEntriesInSet;
 
-			numMaxEntriesInSet = getNumMaxEntiresInSet(ptr);	// get maximum number of sprites/animations in SET file
+		numMaxEntriesInSet = getNumMaxEntiresInSet(ptr);	// get maximum number of sprites/animations in SET file
 
-			for (i = 0; i < numMaxEntriesInSet; i++) {
-				loadSetEntry(name, ptr, i, startIdx + i);
-			}
-
-			break;
+		for (i = 0; i < numMaxEntriesInSet; i++) {
+			loadSetEntry(name, ptr, i, startIdx + i);
 		}
-	case type_FNT:
-		{
-			loadFNTSub(ptr, startIdx);
-			break;
-		}
-	case type_UNK:
-		{
-			break;
-		}
-	case type_SPL:
-		{
-			break;
-		}
+
+		break;
 	}
+	case type_FNT: {
+		loadFNTSub(ptr, startIdx);
+		break;
+	}
+	case type_UNK: {
+		break;
+	}
+	case type_SPL: {
+		break;
+	}
+	}
 
 	return 0;
 }
@@ -395,12 +382,12 @@
 		destPtr = filesDatabase[fileIndex].subData.ptr;
 
 		flipLong((int32 *) destPtr);
-		flipLong((int32 *) (destPtr + 4));
+		flipLong((int32 *)(destPtr + 4));
 		flipGen(destPtr + 8, 6);
 
 		currentPtr = destPtr + 14;
 
-		for (i = 0; i < *(int16 *) (destPtr + 8); i++) {
+		for (i = 0; i < *(int16 *)(destPtr + 8); i++) {
 			flipLong((int32 *) currentPtr);
 			currentPtr += 4;
 
@@ -466,85 +453,73 @@
 		ptr5 += resourceSize;
 
 		switch (localBuffer.type) {
-		case 0: // polygon
-			{
-				filesDatabase[fileIndex].subData.resourceType = 8;
-				filesDatabase[fileIndex].subData.index = currentEntryIdx;
-				break;
-			}
-		case 1:
-			{
-				filesDatabase[fileIndex].width = filesDatabase[fileIndex].widthInColumn * 8;
-				filesDatabase[fileIndex].subData.resourceType = 2;
-				decodeGfxFormat1(&filesDatabase[fileIndex]);
-				filesDatabase[fileIndex].subData.index = currentEntryIdx;
-				filesDatabase[fileIndex].subData.transparency = 0;
-				break;
-			}
-		case 4:
-			{
-				filesDatabase[fileIndex].width = filesDatabase[fileIndex].widthInColumn * 2;
-				filesDatabase[fileIndex].subData.resourceType = 4;
-				decodeGfxFormat4(&filesDatabase[fileIndex]);
-				filesDatabase[fileIndex].subData.index = currentEntryIdx;
-				filesDatabase[fileIndex].subData.transparency = localBuffer.transparency % 0x10;
-				break;
-			}
-		case 5:
-			{
-				filesDatabase[fileIndex].subData.resourceType = 4;
-				decodeGfxFormat5(&filesDatabase[fileIndex]);
-				filesDatabase[fileIndex].width = filesDatabase[fileIndex].widthInColumn;
-				filesDatabase[fileIndex].subData.index = currentEntryIdx;
-				filesDatabase[fileIndex].subData.transparency = localBuffer.transparency;
-				break;
-			}
-		case 8:
-			{
-				filesDatabase[fileIndex].subData.resourceType = 4;
-				filesDatabase[fileIndex].width = filesDatabase[fileIndex].widthInColumn;
-				filesDatabase[fileIndex].subData.index = currentEntryIdx;
-				filesDatabase[fileIndex].subData.transparency = localBuffer.transparency;
-				break;
-			}
-		default:
-			{
-				printf("Unsuported gfx loading type: %d\n", localBuffer.type);
-				break;
-			}
+		case 0: { // polygon
+			filesDatabase[fileIndex].subData.resourceType = 8;
+			filesDatabase[fileIndex].subData.index = currentEntryIdx;
+			break;
 		}
+		case 1: {
+			filesDatabase[fileIndex].width = filesDatabase[fileIndex].widthInColumn * 8;
+			filesDatabase[fileIndex].subData.resourceType = 2;
+			decodeGfxFormat1(&filesDatabase[fileIndex]);
+			filesDatabase[fileIndex].subData.index = currentEntryIdx;
+			filesDatabase[fileIndex].subData.transparency = 0;
+			break;
+		}
+		case 4: {
+			filesDatabase[fileIndex].width = filesDatabase[fileIndex].widthInColumn * 2;
+			filesDatabase[fileIndex].subData.resourceType = 4;
+			decodeGfxFormat4(&filesDatabase[fileIndex]);
+			filesDatabase[fileIndex].subData.index = currentEntryIdx;
+			filesDatabase[fileIndex].subData.transparency = localBuffer.transparency % 0x10;
+			break;
+		}
+		case 5: {
+			filesDatabase[fileIndex].subData.resourceType = 4;
+			decodeGfxFormat5(&filesDatabase[fileIndex]);
+			filesDatabase[fileIndex].width = filesDatabase[fileIndex].widthInColumn;
+			filesDatabase[fileIndex].subData.index = currentEntryIdx;
+			filesDatabase[fileIndex].subData.transparency = localBuffer.transparency;
+			break;
+		}
+		case 8: {
+			filesDatabase[fileIndex].subData.resourceType = 4;
+			filesDatabase[fileIndex].width = filesDatabase[fileIndex].widthInColumn;
+			filesDatabase[fileIndex].subData.index = currentEntryIdx;
+			filesDatabase[fileIndex].subData.transparency = localBuffer.transparency;
+			break;
+		}
+		default: {
+			printf("Unsuported gfx loading type: %d\n", localBuffer.type);
+			break;
+		}
+		}
 
 		strcpy(filesDatabase[fileIndex].subData.name, name);
 
 		// create the mask
-		switch(localBuffer.type)
-		{
+		switch (localBuffer.type) {
 		case 1:
 		case 4:
 		case 5:
-		case 8:
-			{
-				int maskX;
-				int maskY;
+		case 8: {
+			int maskX;
+			int maskY;
 
-				memset(filesDatabase[fileIndex].subData.ptrMask, 0, filesDatabase[fileIndex].width/8 * filesDatabase[fileIndex].height);
+			memset(filesDatabase[fileIndex].subData.ptrMask, 0, filesDatabase[fileIndex].width / 8 * filesDatabase[fileIndex].height);
 
-				for(maskY=0; maskY<filesDatabase[fileIndex].height; maskY++)
-				{
-					for(maskX=0; maskX<filesDatabase[fileIndex].width; maskX++)
-					{
-						if(*(filesDatabase[fileIndex].subData.ptr + filesDatabase[fileIndex].width * maskY + maskX) != filesDatabase[fileIndex].subData.transparency)
-						{
-							*(filesDatabase[fileIndex].subData.ptrMask + filesDatabase[fileIndex].width/8 * maskY + maskX / 8) |= 0x80 >> (maskX&7);
-						}
+			for (maskY = 0; maskY < filesDatabase[fileIndex].height; maskY++) {
+				for (maskX = 0; maskX < filesDatabase[fileIndex].width; maskX++) {
+					if (*(filesDatabase[fileIndex].subData.ptr + filesDatabase[fileIndex].width * maskY + maskX) != filesDatabase[fileIndex].subData.transparency) {
+						*(filesDatabase[fileIndex].subData.ptrMask + filesDatabase[fileIndex].width / 8 * maskY + maskX / 8) |= 0x80 >> (maskX & 7);
 					}
 				}
-				break;
 			}
-		default:
-			{
-			}
+			break;
 		}
+		default: {
+		}
+		}
 	}
 
 	// TODO: free

Modified: scummvm/trunk/engines/cruise/decompiler.cpp
===================================================================
--- scummvm/trunk/engines/cruise/decompiler.cpp	2009-01-16 01:48:55 UTC (rev 35869)
+++ scummvm/trunk/engines/cruise/decompiler.cpp	2009-01-16 02:43:41 UTC (rev 35870)
@@ -84,25 +84,22 @@
 
 uint8 *getStringNameFromIdx(uint16 stringTypeIdx, char *offset) {
 	switch (stringTypeIdx & 7) {
-	case 2:
-		{
-			sprintf(stringName, "\"%s\"",
-			    currentScript->dataPtr +
-			    currentScript->offsetToSubData3 + atoi(offset));
-			break;
-		}
-	case 5:
-		{
-			sprintf(stringName, "vars[%s]", offset);
-			break;
-		}
-	default:
-		{
-			sprintf(stringName, "string[%d][%s]",
-			    stringTypeIdx & 7, offset);
-			break;
-		}
+	case 2: {
+		sprintf(stringName, "\"%s\"",
+		        currentScript->dataPtr +
+		        currentScript->offsetToSubData3 + atoi(offset));
+		break;
 	}
+	case 5: {
+		sprintf(stringName, "vars[%s]", offset);
+		break;
+	}
+	default: {
+		sprintf(stringName, "string[%d][%s]",
+		        stringTypeIdx & 7, offset);
+		break;
+	}
+	}
 
 	return stringName;
 }
@@ -118,7 +115,7 @@
 		return messageIdxString;
 	} else {
 		return currentDecompOvl->stringTable[atoi(messageIdxString)].
-		    string;
+		       string;
 	}
 }
 
@@ -139,43 +136,41 @@
 	int i;
 
 	importScriptStruct *importEntry =
-		(importScriptStruct *) (data3Ptr->dataPtr +
-		data3Ptr->offsetToImportData);
+	    (importScriptStruct *)(data3Ptr->dataPtr +
+	                           data3Ptr->offsetToImportData);
 
 	for (i = 0; i < data3Ptr->numRelocGlob; 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;
+		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;
 		}
+		default: {
+			if (importEntry->offset ==
+			        currentDecompScriptPtr->var4 - 4) {
+				sprintf(buffer,
+				        data3Ptr->dataPtr +
+				        data3Ptr->
+				        offsetToImportName +
+				        importEntry->offsetToName);
+				return;
+			}
+		}
+		}
 		importEntry++;
 	}
 
@@ -188,24 +183,23 @@
 	int i;
 
 	importScriptStruct *importEntry =
-		(importScriptStruct *) (data3Ptr->dataPtr +
-		data3Ptr->offsetToImportData);
+	    (importScriptStruct *)(data3Ptr->dataPtr +
+	                           data3Ptr->offsetToImportData);
 
 	for (i = 0; i < data3Ptr->numRelocGlob; i++) {
 		switch (importEntry->type) {
-		default:
-			{
-				if (importEntry->offset ==
-					currentDecompScriptPtr->var4 - 2) {
-					sprintf(buffer,
-						data3Ptr->dataPtr +
-						data3Ptr->
-						offsetToImportName +
-						importEntry->offsetToName);
-					return;
-				}
+		default: {
+			if (importEntry->offset ==
+			        currentDecompScriptPtr->var4 - 2) {
+				sprintf(buffer,
+				        data3Ptr->dataPtr +
+				        data3Ptr->
+				        offsetToImportName +
+				        importEntry->offsetToName);
+				return;
 			}
 		}
+		}
 		importEntry++;
 	}
 
@@ -250,7 +244,7 @@
 
 void getShortFromDecompScript(char *buffer) {
 	short int var =
-	    *(int16 *) (currentDecompScript + currentDecompScriptPtr->var4);
+	    *(int16 *)(currentDecompScript + currentDecompScriptPtr->var4);
 
 	currentDecompScriptPtr->var4 = currentDecompScriptPtr->var4 + 2;
 
@@ -268,7 +262,7 @@
 
 short int getShortFromDecompScriptReal(void) {
 	short int var =
-	    *(int16 *) (currentDecompScript + currentDecompScriptPtr->var4);
+	    *(int16 *)(currentDecompScript + currentDecompScriptPtr->var4);
 
 	currentDecompScriptPtr->var4 = currentDecompScriptPtr->var4 + 2;
 
@@ -289,7 +283,7 @@
 	 * fprintf(fHandle,"\n"); */
 
 	struct decompileLineStruct *pLineStruct =
-	    &decompileLineTable[positionInDecompileLineTable++];
+				    &decompileLineTable[positionInDecompileLineTable++];
 
 	pLineStruct->lineOffset = currentLineIdx;
 	pLineStruct->indent = 0;
@@ -314,14 +308,14 @@
 }
 
 void resolveVarName(char *ovlIdxString, int varType, char *varIdxString,
-	    char *outputName) {
+                    char *outputName) {
 	int varIdx = atoi(varIdxString);
 
 	strcpy(outputName, "");
 
 	if (varType == 2) {
 		strcpy(outputName, getStringNameFromIdx(varType,
-			varIdxString));
+		                                        varIdxString));
 		return;
 	}
 	if (varType == 1) {
@@ -336,22 +330,22 @@
 			if (varIdx == currentDecompOvl->arraySymbGlob[i].idx) {
 				if (((currentDecompOvl->arraySymbGlob[i].var4 & 0xF0) == 0) && varType != 0x20) {	// var
 					strcpy(outputName,
-					    currentDecompOvl->arrayNameSymbGlob +
-					    currentDecompOvl->arraySymbGlob[i].
-					    offsetToName);
+					       currentDecompOvl->arrayNameSymbGlob +
+					       currentDecompOvl->arraySymbGlob[i].
+					       offsetToName);
 					return;
 				}
 				if ((currentDecompOvl->arraySymbGlob[i].var4) == 20 && varType == 0x20) {	// script
 					strcpy(outputName,
-					    currentDecompOvl->arrayNameSymbGlob +
-					    currentDecompOvl->arraySymbGlob[i].
-					    offsetToName);
+					       currentDecompOvl->arrayNameSymbGlob +
+					       currentDecompOvl->arraySymbGlob[i].
+					       offsetToName);
 					return;
 				}
 			}
 		}
 		sprintf(outputName, "ovl(%s).[%d][%s]", ovlIdxString, varType,
-		    varIdxString);
+		        varIdxString);
 	} else {
 		strcpy(outputName, ovlIdxString);
 	}
@@ -359,206 +353,192 @@
 
 int decompLoadVar(void) {
 	switch (currentScriptOpcodeType) {
-	case 0:
-		{
-			char buffer[256];
+	case 0: {
+		char buffer[256];
 
-			getShortFromDecompScript(buffer);
+		getShortFromDecompScript(buffer);
 
-			pushDecomp(buffer);
+		pushDecomp(buffer);
 
-			return (0);
-		}
-		// string
-	case 1:
-		{
-			char buffer1[256];
-			char buffer2[256];
-			char buffer3[256];
-			char varName[256];
+		return (0);
+	}
+	// string
+	case 1: {
+		char buffer1[256];
+		char buffer2[256];
+		char buffer3[256];
+		char varName[256];
 
-			getByteFromDecompScript(buffer1);
-			getByteFromDecompScript(buffer2);
+		getByteFromDecompScript(buffer1);
+		getByteFromDecompScript(buffer2);
 
-			getShortFromDecompScript(buffer3);
+		getShortFromDecompScript(buffer3);
 
-			resolveVarName(buffer2, atoi(buffer1) & 7, buffer3,
-			    varName);
+		resolveVarName(buffer2, atoi(buffer1) & 7, buffer3,
+		               varName);
 
-			pushDecomp("%s", varName);
-			return (0);
-		}
-	case 2:
-		{
-			char buffer1[256];
-			char buffer2[256];
-			char buffer3[256];
-			char varName[256];
+		pushDecomp("%s", varName);
+		return (0);
+	}
+	case 2: {
+		char buffer1[256];
+		char buffer2[256];
+		char buffer3[256];
+		char varName[256];
 
-			getByteFromDecompScript(buffer1);
-			getByteFromDecompScript(buffer2);
+		getByteFromDecompScript(buffer1);
+		getByteFromDecompScript(buffer2);
 
-			getShortFromDecompScript(buffer3);
+		getShortFromDecompScript(buffer3);
 
-			resolveVarName(buffer2, atoi(buffer1) & 7, buffer3,
-			    varName);
+		resolveVarName(buffer2, atoi(buffer1) & 7, buffer3,
+		               varName);
 
-			pushDecomp("%s", varName);
-			return (0);
-		}
-	case 5:
-		{
-			char buffer1[256];
-			char buffer2[256];
-			char buffer3[256];
-			char varName[256];
+		pushDecomp("%s", varName);
+		return (0);
+	}
+	case 5: {
+		char buffer1[256];
+		char buffer2[256];
+		char buffer3[256];
+		char varName[256];
 
-			getByteFromDecompScript(buffer1);
-			getByteFromDecompScript(buffer2);
+		getByteFromDecompScript(buffer1);
+		getByteFromDecompScript(buffer2);
 
-			getShortFromDecompScript(buffer3);
+		getShortFromDecompScript(buffer3);
 
-			resolveVarName(buffer2, atoi(buffer1) & 7, buffer3,
-			    varName);
+		resolveVarName(buffer2, atoi(buffer1) & 7, buffer3,
+		               varName);
 
-			pushDecomp("%s[%s]", varName, decompSaveOpcodeVar);
-			return (0);
-		}
-	default:
-		{
-			printf("Unsupported type %d in opcodeType0\n",
-			    currentScriptOpcodeType);
-			failed = 1;
-		}
+		pushDecomp("%s[%s]", varName, decompSaveOpcodeVar);
+		return (0);
 	}
+	default: {
+		printf("Unsupported type %d in opcodeType0\n",
+		       currentScriptOpcodeType);
+		failed = 1;
+	}
+	}
 }
 
 int decompSaveVar(void) {
 //      int var = popVar();
 
 	switch (currentScriptOpcodeType) {
-	case 0:
-		{
-			addDecomp(popDecomp());
-			return (0);
-		}
-		// modify string
-	case 1:
-		{
-			char buffer1[256];
-			char buffer2[256];
-			char buffer3[256];
-			char varName[256];
-			uint8 type;
+	case 0: {
+		addDecomp(popDecomp());
+		return (0);
+	}
+	// modify string
+	case 1: {
+		char buffer1[256];
+		char buffer2[256];
+		char buffer3[256];
+		char varName[256];
+		uint8 type;
 
-			getByteFromDecompScript(buffer1);
-			getByteFromDecompScript(buffer2);
+		getByteFromDecompScript(buffer1);
+		getByteFromDecompScript(buffer2);
 
-			getShortFromDecompScript(buffer3);
+		getShortFromDecompScript(buffer3);
 
-			type = atoi(buffer1) & 7;
+		type = atoi(buffer1) & 7;
 
-			resolveVarName(buffer2, type, buffer3, varName);
+		resolveVarName(buffer2, type, buffer3, varName);
 
-			addDecomp("%s = %s", varName, popDecomp());
-			break;
-		}
-	case 2:
-		{
-			char buffer1[256];
-			char buffer2[256];
-			char buffer3[256];
+		addDecomp("%s = %s", varName, popDecomp());
+		break;
+	}
+	case 2: {
+		char buffer1[256];
+		char buffer2[256];
+		char buffer3[256];
 
-			getByteFromDecompScript(buffer1);
-			getByteFromDecompScript(buffer2);
+		getByteFromDecompScript(buffer1);
+		getByteFromDecompScript(buffer2);
 
-			getShortFromDecompScript(buffer3);
+		getShortFromDecompScript(buffer3);
 
-			addDecomp("ovl(%s).setVar(%s,%s) = %s", buffer2,
-			    buffer1, buffer3, popDecomp());
-			break;
-		}
-	case 4:
-		{
-			strcpy(decompSaveOpcodeVar, popDecomp());
-			break;
-		}
-	case 5:
-		{
-			char buffer1[256];
-			char buffer2[256];
-			char buffer3[256];
-			char varName[256];
-			uint8 type;
+		addDecomp("ovl(%s).setVar(%s,%s) = %s", buffer2,
+		          buffer1, buffer3, popDecomp());
+		break;
+	}
+	case 4: {
+		strcpy(decompSaveOpcodeVar, popDecomp());
+		break;
+	}
+	case 5: {
+		char buffer1[256];
+		char buffer2[256];
+		char buffer3[256];
+		char varName[256];
+		uint8 type;
 
-			getByteFromDecompScript(buffer1);
-			getByteFromDecompScript(buffer2);
+		getByteFromDecompScript(buffer1);
+		getByteFromDecompScript(buffer2);
 
-			getShortFromDecompScript(buffer3);
+		getShortFromDecompScript(buffer3);
 
-			type = atoi(buffer1) & 7;
+		type = atoi(buffer1) & 7;
 
-			resolveVarName(buffer2, type, buffer3, varName);
+		resolveVarName(buffer2, type, buffer3, varName);
 
-			addDecomp("%s[%s] = %s", varName, decompSaveOpcodeVar,
-			    popDecomp());
-			break;
-		}
-	default:
-		{
-			printf("Unsupported type %d in opcodeType1\n",
-			    currentScriptOpcodeType);
-			failed = 1;
-		}
+		addDecomp("%s[%s] = %s", varName, decompSaveOpcodeVar,
+		          popDecomp());
+		break;
 	}
+	default: {
+		printf("Unsupported type %d in opcodeType1\n",
+		       currentScriptOpcodeType);
+		failed = 1;
+	}
+	}
 
 	return (0);
 }
 
 int decompOpcodeType2(void) {
 	switch (currentScriptOpcodeType) {
-	case 1:
-		{
-			char buffer3[256];
-			char varName[256];
-			int byte1 = getByteFromDecompScriptReal();
-			int byte2 = getByteFromDecompScriptReal();
-			getShortFromDecompScript(buffer3);
+	case 1: {
+		char buffer3[256];
+		char varName[256];
+		int byte1 = getByteFromDecompScriptReal();
+		int byte2 = getByteFromDecompScriptReal();
+		getShortFromDecompScript(buffer3);
 
-			resolveVarName("0", byte1 & 7, buffer3, varName);
+		resolveVarName("0", byte1 & 7, buffer3, varName);
 
-			pushDecomp(varName);
+		pushDecomp(varName);
 
-			break;
-		}
-	case 5:
-		{
-			int byte1 = getByteFromDecompScriptReal();
-			int byte2 = getByteFromDecompScriptReal();
-			short int short1 = getShortFromDecompScriptReal();
+		break;
+	}
+	case 5: {
+		int byte1 = getByteFromDecompScriptReal();
+		int byte2 = getByteFromDecompScriptReal();
+		short int short1 = getShortFromDecompScriptReal();
 
-			int8 *ptr = scriptDataPtrTable[byte1 & 7] + short1;
+		int8 *ptr = scriptDataPtrTable[byte1 & 7] + short1;
 
-			if ((byte1 & 7) == 2) {
-				pushDecomp("\"%s\"[%s]", ptr,
-				    decompSaveOpcodeVar);
-			} else if ((byte1 & 7) == 5) {
-				pushDecomp("freeString[%d][%s]", short1,
-				    decompSaveOpcodeVar);
-			} else {
-				printf("Unsupported type %d in opcodeType2\n",
-				    byte1 & 7);
-				failed = 1;
-			}
-			break;
-		}
-	default:
-		{
+		if ((byte1 & 7) == 2) {
+			pushDecomp("\"%s\"[%s]", ptr,
+			           decompSaveOpcodeVar);
+		} else if ((byte1 & 7) == 5) {
+			pushDecomp("freeString[%d][%s]", short1,
+			           decompSaveOpcodeVar);
+		} else {
 			printf("Unsupported type %d in opcodeType2\n",
-			    currentScriptOpcodeType);
+			       byte1 & 7);
 			failed = 1;
 		}
+		break;
 	}
+	default: {
+		printf("Unsupported type %d in opcodeType2\n",
+		       currentScriptOpcodeType);
+		failed = 1;
+	}
+	}
 	return (0);
 }
 
@@ -567,58 +547,50 @@
 	char *param2 = popDecomp();
 
 	switch (currentScriptOpcodeType) {
-	case 0:
-		{
-			sprintf(tempbuffer, "%s+%s", param1, param2);
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 1:
-		{
-			sprintf(tempbuffer, "%s/%s", param1, param2);
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 2:
-		{
-			sprintf(tempbuffer, "%s-%s", param1, param2);
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 3:
-		{
-			sprintf(tempbuffer, "%s*%s", param1, param2);
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 4:
-		{
-			sprintf(tempbuffer, "%s\%%s", param1, param2);
-			pushDecomp(tempbuffer);
-			break;
-		}
+	case 0: {
+		sprintf(tempbuffer, "%s+%s", param1, param2);
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 1: {
+		sprintf(tempbuffer, "%s/%s", param1, param2);
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 2: {
+		sprintf(tempbuffer, "%s-%s", param1, param2);
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 3: {
+		sprintf(tempbuffer, "%s*%s", param1, param2);
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 4: {
+		sprintf(tempbuffer, "%s\%%s", param1, param2);
+		pushDecomp(tempbuffer);
+		break;
+	}
 	case 5:
-	case 7:
-		{
-			sprintf(tempbuffer, "%s|%s", param1, param2);
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 6:
-		{
-			sprintf(tempbuffer, "%s&%s", param1, param2);
-			pushDecomp(tempbuffer);
-			break;
-		}
+	case 7: {
+		sprintf(tempbuffer, "%s|%s", param1, param2);
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 6: {
+		sprintf(tempbuffer, "%s&%s", param1, param2);
+		pushDecomp(tempbuffer);
+		break;
+	}
 
-	default:
-		{
-			sprintf(tempbuffer, "decompMath(%d,%s,%s)",
-			    currentScriptOpcodeType, param1, param2);
-			pushDecomp(tempbuffer);
-			break;
-		}
+	default: {
+		sprintf(tempbuffer, "decompMath(%d,%s,%s)",
+		        currentScriptOpcodeType, param1, param2);
+		pushDecomp(tempbuffer);
+		break;
 	}
+	}
 	return (0);
 }
 
@@ -640,61 +612,53 @@
 	short int offset = getShortFromDecompScriptReal();
 
 	switch (currentScriptOpcodeType) {
-	case 0:
-		{
-			currentLineType = 1;
-			addDecomp("test '!(bitMask & 1)' and goto %d",
-			    offset + oldOffset);
-			break;
-		}
-	case 1:
-		{
-			currentLineType = 1;
-			addDecomp("test '(bitMask & 1)' and goto %d",
-			    offset + oldOffset);
-			break;
-		}
-	case 2:
-		{
-			currentLineType = 1;
-			addDecomp("test '(bitMask & 2)' and goto %d",
-			    offset + oldOffset);
-			break;
-		}
-	case 3:
-		{
-			currentLineType = 1;
-			addDecomp("test '(bitMask & 3)' and goto %d",
-			    offset + oldOffset);
-			break;
-		}
-	case 4:
-		{
-			currentLineType = 1;
-			addDecomp("test '(bitMask & 4)' and goto %d",
-			    offset + oldOffset);
-			break;
-		}
-	case 5:
-		{
-			currentLineType = 1;
-			addDecomp("test '(bitMask & 5)' and goto %d",
-			    offset + oldOffset);
-			break;
-		}
-	case 6:
-		{
-			currentLineType = 2;
-			addDecomp("test 'never' and goto %d",
-			    offset + oldOffset);
-			break;
-		}
-	case 7:
-		{
-			currentLineType = 3;
-			addDecomp("goto %d", offset + oldOffset);
-			break;
-		}
+	case 0: {
+		currentLineType = 1;
+		addDecomp("test '!(bitMask & 1)' and goto %d",
+		          offset + oldOffset);
+		break;
+	}
+	case 1: {
+		currentLineType = 1;
+		addDecomp("test '(bitMask & 1)' and goto %d",
+		          offset + oldOffset);
+		break;
+	}
+	case 2: {
+		currentLineType = 1;
+		addDecomp("test '(bitMask & 2)' and goto %d",
+		          offset + oldOffset);
+		break;
+	}
+	case 3: {
+		currentLineType = 1;
+		addDecomp("test '(bitMask & 3)' and goto %d",
+		          offset + oldOffset);
+		break;
+	}
+	case 4: {
+		currentLineType = 1;
+		addDecomp("test '(bitMask & 4)' and goto %d",
+		          offset + oldOffset);
+		break;
+	}
+	case 5: {
+		currentLineType = 1;
+		addDecomp("test '(bitMask & 5)' and goto %d",
+		          offset + oldOffset);
+		break;
+	}
+	case 6: {
+		currentLineType = 2;
+		addDecomp("test 'never' and goto %d",
+		          offset + oldOffset);
+		break;
+	}
+	case 7: {
+		currentLineType = 3;
+		addDecomp("goto %d", offset + oldOffset);
+		break;
+	}
 
 	}
 
@@ -708,20 +672,20 @@
 
 	addDecomp("sign(%s)", param);
 
-/*
-  if (!pop)
-    si = 1;
+	/*
+	  if (!pop)
+	    si = 1;
 
-  if (pop<0) {
-    si |= 4;
-  }
+	  if (pop<0) {
+	    si |= 4;
+	  }
 
-  if (pop>0) {
-    si |= 2;
-  }
+	  if (pop>0) {
+	    si |= 2;
+	  }
 
-  currentScriptPtr->bitMask = si;
-*/
+	  currentScriptPtr->bitMask = si;
+	*/
 
 	return 0;
 }
@@ -748,661 +712,571 @@
 	currentScriptOpcodeType = getByteFromDecompScriptReal();
 //    addDecomp("OP_%X", currentScriptOpcodeType);
 	switch (currentScriptOpcodeType) {
-	case 0x1:
-		{
-			pushDecomp("_setdoFade()");
-			break;
-		}
-	case 0x2:
-		{
-			pushDecomp("_prepareFade()");
-			break;
-		}
-	case 0x3:
-		{
-			sprintf(tempbuffer, "_loadBackground(%s,%s)",
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x4:
-		{
-			sprintf(tempbuffer, "_loadFullBundle(%s,%s)",
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x5:
-		{
-			sprintf(tempbuffer, "_addCell(%s,%s,%s)", popDecomp(),
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x6:
-		{
-			unsigned long int numArg = atoi(popDecomp());
-			char *ovlStr;
-			char *idxStr;
-			int i;
-			char functionName[100];
+	case 0x1: {
+		pushDecomp("_setdoFade()");
+		break;
+	}
+	case 0x2: {
+		pushDecomp("_prepareFade()");
+		break;
+	}
+	case 0x3: {
+		sprintf(tempbuffer, "_loadBackground(%s,%s)",
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x4: {
+		sprintf(tempbuffer, "_loadFullBundle(%s,%s)",
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x5: {
+		sprintf(tempbuffer, "_addCell(%s,%s,%s)", popDecomp(),
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x6: {
+		unsigned long int numArg = atoi(popDecomp());
+		char *ovlStr;
+		char *idxStr;
+		int i;
+		char functionName[100];
 
-			idxStr = popDecomp();
-			ovlStr = popDecomp();
+		idxStr = popDecomp();
+		ovlStr = popDecomp();
 
-			resolveVarName(ovlStr, 0x20, idxStr, functionName);
+		resolveVarName(ovlStr, 0x20, idxStr, functionName);
 
-			sprintf(tempbuffer, "_startASync(%s", functionName);
+		sprintf(tempbuffer, "_startASync(%s", functionName);
 
-			for (i = 0; i < numArg; i++) {
-				strcatuint8(tempbuffer, ",");
-				strcatuint8(tempbuffer, popDecomp());
-			}
-
-			strcatuint8(tempbuffer, ")");
-
-			pushDecomp(tempbuffer);
-			break;
+		for (i = 0; i < numArg; i++) {
+			strcatuint8(tempbuffer, ",");
+			strcatuint8(tempbuffer, popDecomp());
 		}
-	case 0x7:
-		{
-			char *var1;
-			char *objIdxStr;
-			char *ovlStr;
-			char varName[256];
-			int i;
 
-			var1 = popDecomp();
-			objIdxStr = popDecomp();
-			ovlStr = popDecomp();
+		strcatuint8(tempbuffer, ")");
 
-			sprintf(tempbuffer,
-			    "_createObjectFromOvlData(ovl:%s,dataIdx:%s,%s)",
-			    ovlStr, objIdxStr, var1);
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x8:
-		{
-			sprintf(tempbuffer, "_removeCell(%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x9:
-		{
-			pushDecomp("_freeobjectList()");
-			break;
-		}
-	case 0xA:
-		{
-			sprintf(tempbuffer, "_removeScript(ovl(%s),%s)",
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0xB:
-		{
-			sprintf(tempbuffer, "_resetFilesEntries(%s,%s)",
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0xC:
-		{
-			sprintf(tempbuffer, "_loadOverlay(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0xD:
-		{
-			sprintf(tempbuffer, "_palManipulation(%s,%s,%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp(), popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0xE:
-		{
-			sprintf(tempbuffer, "_playSample(%s,%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x10:
-		{
-			sprintf(tempbuffer, "_releaseScript2(%s)",
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x11:
-		{
-			sprintf(tempbuffer, "_getOverlayIdx(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x13:
-		{
-			sprintf(tempbuffer,
-			    "_displayMessage(%s,\"%s\",%s,%s,%s,%s)",
-			    popDecomp(), resolveMessage(popDecomp()),
-			    popDecomp(), popDecomp(), popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x14:
-		{
-			sprintf(tempbuffer, "_removeObject(ovl(%s),%s)",
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x15:
-		{
-			pushDecomp("_pauseScript()");
-			break;
-		}
-	case 0x16:
-		{
-			sprintf(tempbuffer,
-			    "_Op_FreezeCell(%s,%s,%s,%s,%s,%s)", popDecomp(),
-			    popDecomp(), popDecomp(), popDecomp(), popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x17:
-		{
-			sprintf(tempbuffer, "_loadCtp(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x18:
-		{
-			sprintf(tempbuffer,
-			    "_Op_AddAnimation(%s,%s,%s,%s,%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp(), popDecomp(),
-			    popDecomp(), popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x19:
-		{
-			sprintf(tempbuffer, "_Op_RemoveAnimation(%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x1A:
-		{
-			sprintf(tempbuffer, "_setupScaleFormula(%s,%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x1E:
-		{
-			sprintf(tempbuffer, "_Op_TrackAnim(%s,%s,%s,%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp(), popDecomp(),
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x21:
-		{
-			sprintf(tempbuffer, "_isActorLoaded(%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x22:
-		{
-			sprintf(tempbuffer, "_computeScale(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x23:
-		{
-			sprintf(tempbuffer, "_convertToScale(%s,%s)",
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x24:
-		{
-			sprintf(tempbuffer, "_op_24(%s,%s,%s,%s)", popDecomp(),
-			    popDecomp(), popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x27:
-		{
-			sprintf(tempbuffer, "_getWalkBoxCollision(%s,%s)",
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x28:
-		{
-			sprintf(tempbuffer, "_changeSaveAllowedState(%s)",
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x29:
-		{
-			pushDecomp("_freeAllPerso()");
-			break;
-		}
-	case 0x2B:
-		{
-			sprintf(tempbuffer, "_getProcIdx(%s,%s)", popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x2C:
-		{
-			sprintf(tempbuffer, "_setObjectPosition(%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x2E:
-		{
-			sprintf(tempbuffer, "_releaseScript(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x2F:
-		{
-			sprintf(tempbuffer, "_addBackgroundIncrust(%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x30:
-		{
-			sprintf(tempbuffer, "_removeBackgroundIncrust(%s,%s)",
-			    popDecomp(), popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x31:
-		{
-			sprintf(tempbuffer, "_op_31(%s,%s)", popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x32:
-		{
-			pushDecomp("_freeBackgroundInscrustList()");
-			break;
-		}
-	case 0x35:
-		{
-			sprintf(tempbuffer, "_op35(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x37:
-		{
-			sprintf(tempbuffer, "_op37(%s,%s)", popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x38:
-		{
-			sprintf(tempbuffer, "_removeBackground(%s)",
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x39:
-		{
-			sprintf(tempbuffer, "_SetActiveBackgroundPlane(%s)",
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x3A:
-		{
-			sprintf(tempbuffer, "_setVar49(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x3B:
-		{
-			pushDecomp("_op3B()");
-			break;
-		}
-	case 0x3C:
-		{
-			sprintf(tempbuffer, "_rand(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x3D:
-		{
-			sprintf(tempbuffer, "_loadMusic(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x3E:
-		{
-			pushDecomp("_op_3E()");
-			break;
-		}
-	case 0x3F:
-		{
-			pushDecomp("_op_3F()");
-			break;
-		}
-	case 0x40:
-		{
-			pushDecomp("_op_40()");
-			break;
-		}
-	case 0x41:
-		{
-			sprintf(tempbuffer, "_isFileLoaded2(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x45:
-		{
-			pushDecomp("_stopSound()");
-			break;
-		}
-	case 0x49:
-		{
-			sprintf(tempbuffer, "_op49(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x54:
-		{
-			sprintf(tempbuffer, "_setFontVar(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x56:
-		{
-			sprintf(tempbuffer, "_changeCutSceneState(%s)",
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x57:
-		{
-			pushDecomp("_getMouseX()");
-			break;
-		}
-	case 0x58:
-		{
-			pushDecomp("_getMouseY()");
-			break;
-		}
-	case 0x59:
-		{
-			pushDecomp("_getMouse3()");
-			break;
-		}
-	case 0x5A:
-		{
-			sprintf(tempbuffer, "_isFileLoaded(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x5B:
-		{
-			pushDecomp("_regenerateBackgroundIncrust()");
-			break;
-		}
-	case 0x5C:
-		{
-			sprintf(tempbuffer, "_Op_AddCellC(%s,%s)", popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x5E:
-		{
-			sprintf(tempbuffer, "_Op_AddCellE(%s)", popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x60:
-		{
-			sprintf(tempbuffer, "_op_60(%s,%s,%s,%s,%s)",
-			    popDecomp(), popDecomp(), popDecomp(), popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x61:
-		{
-			sprintf(tempbuffer, "_op61(%s,%s)", popDecomp(),
-			    popDecomp());
-			pushDecomp(tempbuffer);
-			break;
-		}
-	case 0x62:
-		{
-			pushDecomp("_pauseCallingScript()");
-			break;
-		}
-	case 0x63:
-		{
-			pushDecomp("_resumeScript()");
-			break;
-		}
-	case 0x64:
-		{
-			unsigned long int numArg = atoi(popDecomp());
-			char *ovlStr;
-			char *idxStr;
-			int i;
-			char functionName[256];
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x7: {
+		char *var1;
+		char *objIdxStr;
+		char *ovlStr;
+		char varName[256];
+		int i;
 
-			idxStr = popDecomp();
-			ovlStr = popDecomp();
+		var1 = popDecomp();
+		objIdxStr = popDecomp();
+		ovlStr = popDecomp();
 
-			resolveVarName(ovlStr, 0x20, idxStr, functionName);
+		sprintf(tempbuffer,
+		        "_createObjectFromOvlData(ovl:%s,dataIdx:%s,%s)",
+		        ovlStr, objIdxStr, var1);
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x8: {
+		sprintf(tempbuffer, "_removeCell(%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x9: {
+		pushDecomp("_freeobjectList()");
+		break;
+	}
+	case 0xA: {
+		sprintf(tempbuffer, "_removeScript(ovl(%s),%s)",
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0xB: {
+		sprintf(tempbuffer, "_resetFilesEntries(%s,%s)",
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0xC: {
+		sprintf(tempbuffer, "_loadOverlay(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0xD: {
+		sprintf(tempbuffer, "_palManipulation(%s,%s,%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp(), popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0xE: {
+		sprintf(tempbuffer, "_playSample(%s,%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x10: {
+		sprintf(tempbuffer, "_releaseScript2(%s)",
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x11: {
+		sprintf(tempbuffer, "_getOverlayIdx(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x13: {
+		sprintf(tempbuffer,
+		        "_displayMessage(%s,\"%s\",%s,%s,%s,%s)",
+		        popDecomp(), resolveMessage(popDecomp()),
+		        popDecomp(), popDecomp(), popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x14: {
+		sprintf(tempbuffer, "_removeObject(ovl(%s),%s)",
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x15: {
+		pushDecomp("_pauseScript()");
+		break;
+	}
+	case 0x16: {
+		sprintf(tempbuffer,
+		        "_Op_FreezeCell(%s,%s,%s,%s,%s,%s)", popDecomp(),
+		        popDecomp(), popDecomp(), popDecomp(), popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x17: {
+		sprintf(tempbuffer, "_loadCtp(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x18: {
+		sprintf(tempbuffer,
+		        "_Op_AddAnimation(%s,%s,%s,%s,%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp(), popDecomp(),
+		        popDecomp(), popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x19: {
+		sprintf(tempbuffer, "_Op_RemoveAnimation(%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x1A: {
+		sprintf(tempbuffer, "_setupScaleFormula(%s,%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x1E: {
+		sprintf(tempbuffer, "_Op_TrackAnim(%s,%s,%s,%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp(), popDecomp(),
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x21: {
+		sprintf(tempbuffer, "_isActorLoaded(%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x22: {
+		sprintf(tempbuffer, "_computeScale(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x23: {
+		sprintf(tempbuffer, "_convertToScale(%s,%s)",
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x24: {
+		sprintf(tempbuffer, "_op_24(%s,%s,%s,%s)", popDecomp(),
+		        popDecomp(), popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x27: {
+		sprintf(tempbuffer, "_getWalkBoxCollision(%s,%s)",
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x28: {
+		sprintf(tempbuffer, "_changeSaveAllowedState(%s)",
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x29: {
+		pushDecomp("_freeAllPerso()");
+		break;
+	}
+	case 0x2B: {
+		sprintf(tempbuffer, "_getProcIdx(%s,%s)", popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x2C: {
+		sprintf(tempbuffer, "_setObjectPosition(%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x2E: {
+		sprintf(tempbuffer, "_releaseScript(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x2F: {
+		sprintf(tempbuffer, "_addBackgroundIncrust(%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x30: {
+		sprintf(tempbuffer, "_removeBackgroundIncrust(%s,%s)",
+		        popDecomp(), popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x31: {
+		sprintf(tempbuffer, "_op_31(%s,%s)", popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x32: {
+		pushDecomp("_freeBackgroundInscrustList()");
+		break;
+	}
+	case 0x35: {
+		sprintf(tempbuffer, "_op35(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x37: {
+		sprintf(tempbuffer, "_op37(%s,%s)", popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x38: {
+		sprintf(tempbuffer, "_removeBackground(%s)",
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x39: {
+		sprintf(tempbuffer, "_SetActiveBackgroundPlane(%s)",
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x3A: {
+		sprintf(tempbuffer, "_setVar49(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x3B: {
+		pushDecomp("_op3B()");
+		break;
+	}
+	case 0x3C: {
+		sprintf(tempbuffer, "_rand(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x3D: {
+		sprintf(tempbuffer, "_loadMusic(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x3E: {
+		pushDecomp("_op_3E()");
+		break;
+	}
+	case 0x3F: {
+		pushDecomp("_op_3F()");
+		break;
+	}
+	case 0x40: {
+		pushDecomp("_op_40()");
+		break;
+	}
+	case 0x41: {
+		sprintf(tempbuffer, "_isFileLoaded2(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x45: {
+		pushDecomp("_stopSound()");
+		break;
+	}
+	case 0x49: {
+		sprintf(tempbuffer, "_op49(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x54: {
+		sprintf(tempbuffer, "_setFontVar(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x56: {
+		sprintf(tempbuffer, "_changeCutSceneState(%s)",
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x57: {
+		pushDecomp("_getMouseX()");
+		break;
+	}
+	case 0x58: {
+		pushDecomp("_getMouseY()");
+		break;
+	}
+	case 0x59: {
+		pushDecomp("_getMouse3()");
+		break;
+	}
+	case 0x5A: {
+		sprintf(tempbuffer, "_isFileLoaded(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x5B: {
+		pushDecomp("_regenerateBackgroundIncrust()");
+		break;
+	}
+	case 0x5C: {
+		sprintf(tempbuffer, "_Op_AddCellC(%s,%s)", popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x5E: {
+		sprintf(tempbuffer, "_Op_AddCellE(%s)", popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x60: {
+		sprintf(tempbuffer, "_op_60(%s,%s,%s,%s,%s)",
+		        popDecomp(), popDecomp(), popDecomp(), popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x61: {
+		sprintf(tempbuffer, "_op61(%s,%s)", popDecomp(),
+		        popDecomp());
+		pushDecomp(tempbuffer);
+		break;
+	}
+	case 0x62: {
+		pushDecomp("_pauseCallingScript()");
+		break;
+	}
+	case 0x63: {
+		pushDecomp("_resumeScript()");
+		break;
+	}
+	case 0x64: {
+		unsigned long int numArg = atoi(popDecomp());
+		char *ovlStr;
+		char *idxStr;
+		int i;
+		char functionName[256];
 
-			sprintf(tempbuffer, "%s(", functionName);
+		idxStr = popDecomp();
+		ovlStr = popDecomp();
 
-			for (i = 0; i < numArg; i++) {
-				if (i)

@@ Diff output truncated at 100000 characters. @@

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