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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Tue Mar 3 10:00:49 CET 2009


Revision: 39086
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39086&view=rev
Author:   dreammaster
Date:     2009-03-03 09:00:49 +0000 (Tue, 03 Mar 2009)

Log Message:
-----------
Formatting fixes

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/actor.cpp
    scummvm/trunk/engines/cruise/font.cpp
    scummvm/trunk/engines/cruise/font.h
    scummvm/trunk/engines/cruise/menu.cpp

Modified: scummvm/trunk/engines/cruise/actor.cpp
===================================================================
--- scummvm/trunk/engines/cruise/actor.cpp	2009-03-03 03:21:46 UTC (rev 39085)
+++ scummvm/trunk/engines/cruise/actor.cpp	2009-03-03 09:00:49 UTC (rev 39086)
@@ -577,7 +577,9 @@
 	}
 }
 
-//computePathfinding(returnVar2, params.X, params.Y, aniX, aniY, currentActor->stepX, currentActor->stepY);
+/**
+ * Computes a path for an actor to walk between a given source and destination position
+ */
 int16 computePathfinding(int16 *pSolution, int16 x, int16 y, int16 destX, int16 destY, int16 stepX, int16 stepY, int16 oldPathId) {
 	persoStruct *perso;
 	int num;
@@ -721,6 +723,9 @@
 	setObjectPosition(ovl, obj, 5, state);
 }
 
+/**
+ * Handles the processing of any active actors to allow for handling movement
+ */
 void processAnimation(void) {
 	objectParamsQuery params;
 	int16 returnVar2[5];
@@ -793,11 +798,16 @@
 			animationStart = false;
 
 			if ((currentActor->pathId >= 0) || (currentActor->phase == ANIM_PHASE_STATIC_END)) {
+
+				// Main switch statement for handling various phases of movement
+				// IMPORTANT: This switch relies on falling through cases in certain circumstances
+				// , so 'break' statements should *not* be used at the end of case areas
 				switch (currentActor->phase) {
-				// In-place (on the spot) animationos
 				case ANIM_PHASE_STATIC_END:
 				case ANIM_PHASE_STATIC: 
 				{
+					// In-place (on the spot) animationos
+
 					if ((currentActor->counter == -1) && (currentActor->phase == ANIM_PHASE_STATIC)) {
 						affiche_chemin(currentActor->pathId, returnVar2);
 
@@ -871,8 +881,10 @@
 					}
 				}
 
-				// Walk animations
-				case ANIM_PHASE_MOVE: {
+				case ANIM_PHASE_MOVE:
+				{
+					// Walk animations
+
 					if (currentActor->counter >= 1) {
 						affiche_chemin(currentActor->pathId, returnVar2);
 
@@ -908,8 +920,11 @@
 						break;
 					}
 				}
+
 				case ANIM_PHASE_END:
 				{
+					// End of walk animation
+
 					int newA = actor_end[currentActor->startDirection][0];
 
 					set_anim(currentActor->overlayNumber, currentActor->idx, currentActor->start,
@@ -928,6 +943,7 @@
 				}
 			}
 		}
+
 		currentActor = nextActor;
 	}
 }

Modified: scummvm/trunk/engines/cruise/font.cpp
===================================================================
--- scummvm/trunk/engines/cruise/font.cpp	2009-03-03 03:21:46 UTC (rev 39085)
+++ scummvm/trunk/engines/cruise/font.cpp	2009-03-03 09:00:49 UTC (rev 39086)
@@ -445,4 +445,13 @@
 	return generatedGfxEntry;
 }
 
+void freeGfx(gfxEntryStruct *pGfx) {
+	if (pGfx->imagePtr) {
+		free(pGfx->imagePtr);
+	}
+
+	free(pGfx);
+}
+
+
 } // End of namespace Cruise

Modified: scummvm/trunk/engines/cruise/font.h
===================================================================
--- scummvm/trunk/engines/cruise/font.h	2009-03-03 03:21:46 UTC (rev 39085)
+++ scummvm/trunk/engines/cruise/font.h	2009-03-03 09:00:49 UTC (rev 39086)
@@ -70,6 +70,7 @@
 gfxEntryStruct *renderText(int inRightBorder_X, const char *string);
 void drawString(int32 x, int32 y, const char *string, uint8 * buffer, uint8 fontColour,
                 int32 inRightBorder_X);
+void freeGfx(gfxEntryStruct *pGfx);
 
 } // End of namespace Cruise
 

Modified: scummvm/trunk/engines/cruise/menu.cpp
===================================================================
--- scummvm/trunk/engines/cruise/menu.cpp	2009-03-03 03:21:46 UTC (rev 39085)
+++ scummvm/trunk/engines/cruise/menu.cpp	2009-03-03 09:00:49 UTC (rev 39086)
@@ -273,14 +273,6 @@
 	return 0;
 }
 
-void freeGfx(gfxEntryStruct *pGfx) {
-	if (pGfx->imagePtr) {
-		free(pGfx->imagePtr);
-	}
-
-	free(pGfx);
-}
-
 void freeMenu(menuStruct *pMenu) {
 	menuElementStruct *pElement = pMenu->ptrNextElement;
 


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