[Scummvm-cvs-logs] scummvm master -> 51184eab9d24567fed0e3064aa445be0bf21a9d8

Strangerke Strangerke at scummvm.org
Tue Jun 10 07:27:03 CEST 2014


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

Summary:
51184eab9d CRUISE: Remove some useless variables, use a boolean for a variable


Commit: 51184eab9d24567fed0e3064aa445be0bf21a9d8
    https://github.com/scummvm/scummvm/commit/51184eab9d24567fed0e3064aa445be0bf21a9d8
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-06-10T07:25:35+02:00

Commit Message:
CRUISE: Remove some useless variables, use a boolean for a variable

Changed paths:
    engines/cruise/cruise_main.cpp
    engines/cruise/function.cpp
    engines/cruise/mainDraw.cpp
    engines/cruise/mainDraw.h
    engines/cruise/menu.cpp
    engines/cruise/saveload.cpp
    engines/cruise/vars.cpp
    engines/cruise/vars.h



diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index cab3e41..2de8d27 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -1157,7 +1157,7 @@ void callSubRelation(menuElementSubStruct *pMenuElement, int nOvl, int nObj) {
 						createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), masterScreen, 0, 0);
 					}
 
-					userWait = 1;
+					userWait = true;
 					autoOvl = ovlIdx;
 					autoMsg = pHeader->id;
 
@@ -1186,7 +1186,7 @@ void callSubRelation(menuElementSubStruct *pMenuElement, int nOvl, int nObj) {
 
 							pTrack->flag = 1;
 							autoTrack = true;
-							userWait = 0;
+							userWait = false;
 							userEnabled = 0;
 							freezeCell(&cellHead, ovlIdx, pHeader->id, 5, -1, 0, 9998);
 						}
@@ -1303,7 +1303,7 @@ void callRelation(menuElementSubStruct *pMenuElement, int nObj2) {
 					createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), masterScreen, 0, 0);
 				}
 
-				userWait = 1;
+				userWait = true;
 				autoOvl = ovlIdx;
 				autoMsg = pHeader->id;
 
@@ -1334,7 +1334,7 @@ void callRelation(menuElementSubStruct *pMenuElement, int nObj2) {
 						pTrack->flag = 1;
 
 						autoTrack = true;
-						userWait = 0;
+						userWait = false;
 						userEnabled = 0;
 						freezeCell(&cellHead, ovlIdx, pHeader->id, 5, -1, 0, 9998);
 					}
@@ -1455,7 +1455,7 @@ int CruiseEngine::processInput() {
 	if (userWait) {
 		// Check for left mouse button click or Space to end user waiting
 		if ((keyboardCode == Common::KEYCODE_SPACE) || (button == CRS_MB_LEFT))
-			userWait = 0;
+			userWait = false;
 
 		keyboardCode = Common::KEYCODE_INVALID;
 		return 0;
@@ -1772,9 +1772,7 @@ void CruiseEngine::mainLoop() {
 	currentActiveMenu = -1;
 	autoMsg = -1;
 	linkedRelation = 0;
-	main21 = 0;
-	main22 = 0;
-	userWait = 0;
+	userWait = false;
 	autoTrack = false;
 
 	initAllData();
@@ -1857,7 +1855,7 @@ void CruiseEngine::mainLoop() {
 
 //      readKeyboard();
 
-		bool isUserWait = userWait != 0;
+		bool isUserWait = userWait;
 		// WORKAROUND: This prevents hotspots responding during
 		// delays i.e. Menu opening if you click fast on another
 		// hotspot after trying to open a locked door, which
@@ -1938,7 +1936,7 @@ void CruiseEngine::mainLoop() {
 			mainDraw(userWait);
 			flipScreen();
 
-			if (userWait == 1) {
+			if (userWait) {
 				// Waiting for press - original wait loop has been integrated into the
 				// main event loop
 				continue;
@@ -1953,7 +1951,7 @@ void CruiseEngine::mainLoop() {
 						char* pText = getText(autoMsg, autoOvl);
 
 						if (strlen(pText))
-							userWait = 1;
+							userWait = true;
 					}
 
 					changeScriptParamInList(-1, -1, &relHead, 9998, 0);
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index c530074..3f794c4 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -1832,7 +1832,7 @@ int16 Op_ThemeReset() {
 }
 
 int16 Op_UserWait() {
-	userWait = 1;
+	userWait = true;
 	if (currentScriptPtr->type == scriptType_PROC) {
 		changeScriptParamInList(currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, &procHead, -1, 9999);
 	} else if (currentScriptPtr->type == scriptType_REL) {
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index 98e7e66..5777b84 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -1377,7 +1377,7 @@ int getValueFromObjectQuerry(objectParamsQuery *params, int idx) {
 	return 0;
 }
 
-void mainDraw(int16 param) {
+void mainDraw(bool waitFl) {
 	uint8 *bgPtr;
 	cellStruct *currentObjPtr;
 	int16 currentObjIdx;
@@ -1461,7 +1461,7 @@ void mainDraw(int16 param) {
 			}
 
 			// automatic animation process
-			if (currentObjPtr->animStep && !param) {
+			if (currentObjPtr->animStep && !waitFl) {
 				if (currentObjPtr->animCounter <= 0) {
 
 					bool change = true;
diff --git a/engines/cruise/mainDraw.h b/engines/cruise/mainDraw.h
index bb71b97..1af403f 100644
--- a/engines/cruise/mainDraw.h
+++ b/engines/cruise/mainDraw.h
@@ -33,7 +33,7 @@ extern int m_color;
 int upscaleValue(int value, int scale);
 
 void pixel(int x, int y, char color);
-void mainDraw(int16 param);
+void mainDraw(bool waitFl);
 void flipScreen();
 void buildPolyModel(int X, int Y, int scale, char *ptr2, char *destBuffer, char *dataPtr);
 void drawSprite(int width, int height, cellStruct *currentObjPtr, const uint8 *dataIn, int ys, int xs, uint8 *output, const uint8 *dataBuf);
diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp
index c72192f..cf0b872 100644
--- a/engines/cruise/menu.cpp
+++ b/engines/cruise/menu.cpp
@@ -160,7 +160,7 @@ int processMenu(menuStruct *pMenu) {
 	int si;
 	currentActiveMenu = 0;
 
-	mainDraw(1);
+	mainDraw(true);
 	flipScreen();
 
 	di = 0;
@@ -179,7 +179,7 @@ int processMenu(menuStruct *pMenu) {
 			di = 1;
 		}
 
-		mainDraw(1);
+		mainDraw(true);
 		flipScreen();
 
 		manageEvents();
@@ -190,7 +190,7 @@ int processMenu(menuStruct *pMenu) {
 
 	currentActiveMenu = -1;
 
-	mainDraw(1);
+	mainDraw(true);
 	flipScreen();
 
 	if (mouseButton & 1) {
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index 8e64faa..a62648d 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -947,7 +947,7 @@ Common::Error loadSavegameData(int saveGameIdx) {
 	// to finish
 
 	changeCursor(CURSOR_NORMAL);
-	mainDraw(1);
+	mainDraw(true);
 	flipScreen();
 
 	return Common::kNoError;
diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp
index 9a59c8a..e9b6896 100644
--- a/engines/cruise/vars.cpp
+++ b/engines/cruise/vars.cpp
@@ -53,9 +53,7 @@ char nextOverlay[38];
 int16 currentActiveMenu;
 int16 autoMsg;
 menuElementSubStruct* linkedRelation;
-int16 main21;
-int16 main22;
-int16 userWait;
+bool userWait;
 int16 autoTrack;
 
 int16 currentDiskNumber = 1;
diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h
index fe3f7d6..e7c687d 100644
--- a/engines/cruise/vars.h
+++ b/engines/cruise/vars.h
@@ -156,9 +156,7 @@ extern char nextOverlay[38];
 extern int16 currentActiveMenu;
 extern int16 autoMsg;
 extern menuElementSubStruct* linkedRelation;
-extern int16 main21;
-extern int16 main22;
-extern int16 userWait;
+extern bool userWait;
 extern int16 autoTrack;
 
 extern int16 currentDiskNumber;






More information about the Scummvm-git-logs mailing list