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

sev at users.sourceforge.net sev at users.sourceforge.net
Wed May 13 13:59:49 CEST 2009


Revision: 40521
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40521&view=rev
Author:   sev
Date:     2009-05-13 11:59:49 +0000 (Wed, 13 May 2009)

Log Message:
-----------
Normalized types for several variables. Formatting

Modified Paths:
--------------
    scummvm/trunk/engines/drascula/drascula.cpp
    scummvm/trunk/engines/drascula/drascula.h
    scummvm/trunk/engines/drascula/graphics.cpp
    scummvm/trunk/engines/drascula/interface.cpp
    scummvm/trunk/engines/drascula/objects.cpp
    scummvm/trunk/engines/drascula/rooms.cpp
    scummvm/trunk/engines/drascula/saveload.cpp

Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp	2009-05-13 11:43:24 UTC (rev 40520)
+++ scummvm/trunk/engines/drascula/drascula.cpp	2009-05-13 11:59:49 UTC (rev 40521)
@@ -186,24 +186,40 @@
 		memset(VGA, 0, 64000);
 
 		takeObject = 0;
-		menuBar = 0; menuScreen = 0; hasName = 0;
+		_menuBar = false;
+		_menuScreen = false;
+		_hasName = false;
 		frame_y = 0;
-		curX = -1; characterMoved = 0; trackProtagonist = 3; num_frame = 0; hare_se_ve = 1;
+		curX = -1;
+		characterMoved = 0;
+		trackProtagonist = 3;
+		num_frame = 0;
+		hare_se_ve = 1;
 		checkFlags = 1;
 		doBreak = 0;
 		walkToObject = 0;
-		stepX = STEP_X; stepY = STEP_Y;
-		curHeight = CHARACTER_HEIGHT; curWidth = CHARACTER_WIDTH; feetHeight = FEET_HEIGHT;
-		talkHeight = TALK_HEIGHT; talkWidth = TALK_WIDTH;
+
+		stepX = STEP_X;
+		stepY = STEP_Y;
+
+		curHeight = CHARACTER_HEIGHT;
+		curWidth = CHARACTER_WIDTH;
+		feetHeight = FEET_HEIGHT;
+
+		talkHeight = TALK_HEIGHT;
+		talkWidth = TALK_WIDTH;
+
 		hasAnswer = 0;
 		savedTime = 0;
 		breakOut = 0;
-		vonBraunX = 120; trackVonBraun = 1; vonBraunHasMoved = 0;
+		vonBraunX = 120;
+		trackVonBraun = 1;
+		vonBraunHasMoved = 0;
 		framesWithoutAction = 0;
 		term_int = 0;
 		musicStopped = 0;
 		selectionMade = 0;
-		UsingMem = 0;
+		_useMemForArj = false;
 		globalSpeed = 0;
 		curExcuseLook = 0;
 		curExcuseAction = 0;
@@ -467,14 +483,14 @@
 		updateEvents();
 #endif
 
-		if (menuScreen == 0 && takeObject == 1)
+		if (!_menuScreen && takeObject == 1)
 			checkObjects();
 
 #ifdef _WIN32_WCE
 		if (rightMouseButton)
-			if (menuScreen) {
+			if (_menuScreen) {
 #else
-		if (rightMouseButton == 1 && menuScreen == 1) {
+		if (rightMouseButton == 1 && _menuScreen) {
 #endif
 			delay(100);
 			if (currentChapter == 2)
@@ -482,7 +498,7 @@
 			else
 				loadPic(99, backSurface);
 			setPalette((byte *)&gamePalette);
-			menuScreen = 0;
+			_menuScreen = false;
 #ifndef _WIN32_WCE
 			// FIXME: This call here is in hope that it will catch the rightmouseup event so the
 			// next if block won't be executed. This too is not a good coding practice. I've recoded it
@@ -498,7 +514,7 @@
 		// Do not show the inventory screen in chapter 5, if the right mouse button is clicked
 		// while the plug (object 16) is held
 		// Fixes bug #2059621 - "DRASCULA: Plug bug"
-		if (rightMouseButton == 1 && menuScreen == 0 &&
+		if (rightMouseButton == 1 && !_menuScreen &&
 			!(currentChapter == 5 && pickedObject == 16)) {
 #endif
 			delay(100);
@@ -513,14 +529,14 @@
 				loadPic("iconsp.alg", backSurface);
 			else
 				loadPic("icons.alg", backSurface);
-			menuScreen = 1;
+			_menuScreen = true;
 #ifndef _WIN32_WCE
 			updateEvents();
 #endif
 			selectVerb(kVerbNone);
 		}
 
-		if (leftMouseButton == 1 && menuBar == 1) {
+		if (leftMouseButton == 1 && _menuBar) {
 			delay(100);
 			selectVerbFromBar();
 		} else if (leftMouseButton == 1 && takeObject == 0) {
@@ -532,20 +548,20 @@
 				return true;
 		}
 
-		menuBar = (mouseY < 24 && menuScreen == 0) ? 1 : 0;
+		_menuBar = (mouseY < 24 && !_menuScreen) ? true : false;
 
 		Common::KeyCode key = getScan();
-		if (key == Common::KEYCODE_F1 && menuScreen == 0) {
+		if (key == Common::KEYCODE_F1 && !_menuScreen) {
 			selectVerb(kVerbLook);
-		} else if (key == Common::KEYCODE_F2 && menuScreen == 0) {
+		} else if (key == Common::KEYCODE_F2 && !_menuScreen) {
 			selectVerb(kVerbPick);
-		} else if (key == Common::KEYCODE_F3 && menuScreen == 0) {
+		} else if (key == Common::KEYCODE_F3 && !_menuScreen) {
 			selectVerb(kVerbOpen);
-		} else if (key == Common::KEYCODE_F4 && menuScreen == 0) {
+		} else if (key == Common::KEYCODE_F4 && !_menuScreen) {
 			selectVerb(kVerbClose);
-		} else if (key == Common::KEYCODE_F5 && menuScreen == 0) {
+		} else if (key == Common::KEYCODE_F5 && !_menuScreen) {
 			selectVerb(kVerbTalk);
-		} else if (key == Common::KEYCODE_F6 && menuScreen == 0) {
+		} else if (key == Common::KEYCODE_F6 && !_menuScreen) {
 			selectVerb(kVerbMove);
 		} else if (key == Common::KEYCODE_F9) {
 			volumeControls();
@@ -629,7 +645,7 @@
 bool DrasculaEngine::verify1() {
 	int l;
 
-	if (menuScreen == 1)
+	if (_menuScreen)
 		removeObject();
 	else {
 		for (l = 0; l < numRoomObjs; l++) {
@@ -672,11 +688,11 @@
 bool DrasculaEngine::verify2() {
 	int l;
 
-	if (menuScreen == 1) {
+	if (_menuScreen) {
 		if (pickupObject())
 			return true;
 	} else {
-		if (!strcmp(textName, "hacker") && hasName == 1) {
+		if (!strcmp(textName, "hacker") && _hasName) {
 			if (checkAction(50))
 				return true;
 		} else {

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2009-05-13 11:43:24 UTC (rev 40520)
+++ scummvm/trunk/engines/drascula/drascula.h	2009-05-13 11:59:49 UTC (rev 40521)
@@ -381,7 +381,7 @@
 	int x1[40], y1[40], x2[40], y2[40];
 	int takeObject, pickedObject;
 	bool _subtitlesDisabled;
-	int menuBar, menuScreen, hasName;
+	bool _menuBar, _menuScreen, _hasName;
 	char textName[20];
 	int curExcuseLook;
 	int curExcuseAction;
@@ -538,7 +538,7 @@
 	byte *TryInMem();
 	int playFrameSSN();
 
-	int UsingMem;
+	bool _useMemForArj;
 	byte CHUNK;
 	byte CMP, dacSSN[768];
 	int FrameSSN;

Modified: scummvm/trunk/engines/drascula/graphics.cpp
===================================================================
--- scummvm/trunk/engines/drascula/graphics.cpp	2009-05-13 11:43:24 UTC (rev 40520)
+++ scummvm/trunk/engines/drascula/graphics.cpp	2009-05-13 11:59:49 UTC (rev 40521)
@@ -73,16 +73,16 @@
 	moveCharacters();
 	updateRefresh();
 
-	if (!strcmp(textName, "hacker") && hasName == 1) {
-		if (_color != kColorRed && menuScreen == 0)
+	if (!strcmp(textName, "hacker") && _hasName) {
+		if (_color != kColorRed && !_menuScreen)
 			color_abc(kColorRed);
-	} else if (menuScreen == 0 && _color != kColorLightGreen)
+	} else if (!_menuScreen && _color != kColorLightGreen)
 		color_abc(kColorLightGreen);
-	if (hasName == 1 && menuScreen == 0)
+	if (_hasName && !_menuScreen)
 		centerText(textName, mouseX, mouseY);
-	if (menuScreen == 1)
+	if (_menuScreen)
 		showMenu();
-	else if (menuBar == 1)
+	else if (_menuBar)
 		clearMenu();
 }
 
@@ -449,7 +449,7 @@
 	// Open file
 	globalSpeed = 1000 / vel;
 	FrameSSN = 0;
-	UsingMem = 0;
+	_useMemForArj = false;
 	_arj.open(filefli);
 	mSession = TryInMem();
 	LastFrame = _system->getMillis();
@@ -459,7 +459,7 @@
 			term_int = 1;
 	}
 
-	if (UsingMem)
+	if (_useMemForArj)
 		free(memPtr);
 	else
 		_arj.close();
@@ -470,7 +470,7 @@
 	uint32 length;
 	byte *BufferSSN;
 
-	if (!UsingMem)
+	if (!_useMemForArj)
 		CHUNK = _arj.readByte();
 	else {
 		memcpy(&CHUNK, mSession, 1);
@@ -479,7 +479,7 @@
 
 	switch (CHUNK) {
 	case kFrameSetPal:
-		if (!UsingMem) {
+		if (!_useMemForArj) {
 			for (int i = 0; i < 256; i++) {
 				dacSSN[i * 3 + 0] = _arj.readByte();
 				dacSSN[i * 3 + 1] = _arj.readByte();
@@ -495,7 +495,7 @@
 		waitFrameSSN();
 		break;
 	case kFrameInit:
-		if (!UsingMem) {
+		if (!_useMemForArj) {
 			CMP = _arj.readByte();
 			length = _arj.readUint32LE();
 		} else {
@@ -506,7 +506,7 @@
 		}
 		if (CMP == kFrameCmpRle) {
 			BufferSSN = (byte *)malloc(length);
-			if (!UsingMem) {
+			if (!_useMemForArj) {
 				_arj.read(BufferSSN, length);
 			} else {
 				memcpy(BufferSSN, mSession, length);
@@ -525,7 +525,7 @@
 		} else {
 			if (CMP == kFrameCmpOff) {
 				BufferSSN = (byte *)malloc(length);
-				if (!UsingMem) {
+				if (!_useMemForArj) {
 					_arj.read(BufferSSN, length);
 				} else {
 					memcpy(BufferSSN, mSession, length);
@@ -565,7 +565,7 @@
 	if (memPtr == NULL)
 		return NULL;
 	_arj.read(memPtr, length);
-	UsingMem = 1;
+	_useMemForArj = true;
 	_arj.close();
 
 	return memPtr;

Modified: scummvm/trunk/engines/drascula/interface.cpp
===================================================================
--- scummvm/trunk/engines/drascula/interface.cpp	2009-05-13 11:43:24 UTC (rev 40520)
+++ scummvm/trunk/engines/drascula/interface.cpp	2009-05-13 11:59:49 UTC (rev 40521)
@@ -65,7 +65,7 @@
 }
 
 void DrasculaEngine::selectVerb(int verb) {
-	int c = (menuScreen == 1) ? 0 : 171;
+	int c = _menuScreen ? 0 : 171;
 
 	if (currentChapter == 5) {
 		if (takeObject == 1 && pickedObject != 16)
@@ -84,7 +84,7 @@
 		pickedObject = verb;
 	} else {
 		takeObject = 0;
-		hasName = 0;
+		_hasName = false;
 	}
 }
 
@@ -203,14 +203,14 @@
 }
 
 void DrasculaEngine::showMap() {
-	hasName = 0;
+	_hasName = false;
 
 	for (int l = 0; l < numRoomObjs; l++) {
 		if (mouseX > x1[l] && mouseY > y1[l]
 				&& mouseX < x2[l] && mouseY < y2[l]
 				&& visible[l] == 1) {
 			strcpy(textName, objName[l]);
-			hasName = 1;
+			_hasName = true;
 		}
 	}
 }

Modified: scummvm/trunk/engines/drascula/objects.cpp
===================================================================
--- scummvm/trunk/engines/drascula/objects.cpp	2009-05-13 11:43:24 UTC (rev 40520)
+++ scummvm/trunk/engines/drascula/objects.cpp	2009-05-13 11:59:49 UTC (rev 40521)
@@ -45,10 +45,10 @@
 
 void DrasculaEngine::chooseObject(int object) {
 	if (currentChapter == 5) {
-		if (takeObject == 1 && menuScreen == 0 && pickedObject != 16)
+		if (takeObject == 1 && !_menuScreen && pickedObject != 16)
 			addObject(pickedObject);
 	} else {
-		if (takeObject == 1 && menuScreen == 0)
+		if (takeObject == 1 && !_menuScreen)
 			addObject(pickedObject);
 	}
 	for (int i = 0; i < OBJHEIGHT; i++)
@@ -115,7 +115,7 @@
 				&& mouseX < x2[l] && mouseY < y2[l]
 				&& visible[l] == 1 && isDoor[l] == 0) {
 			strcpy(textName, objName[l]);
-			hasName = 1;
+			_hasName = true;
 			veo = 1;
 		}
 	}
@@ -124,13 +124,13 @@
 			&& mouseX < curX + curWidth - 2 && mouseY < curY + curHeight - 2) {
 		if (currentChapter == 2 || veo == 0) {
 			strcpy(textName, "hacker");
-			hasName = 1;
+			_hasName = true;
 			veo = 1;
 		}
 	}
 
 	if (veo == 0)
-		hasName = 0;
+		_hasName = false;
 }
 
 void DrasculaEngine::removeObject() {

Modified: scummvm/trunk/engines/drascula/rooms.cpp
===================================================================
--- scummvm/trunk/engines/drascula/rooms.cpp	2009-05-13 11:43:24 UTC (rev 40520)
+++ scummvm/trunk/engines/drascula/rooms.cpp	2009-05-13 11:59:49 UTC (rev 40521)
@@ -1502,11 +1502,11 @@
 
 	hasAnswer = 1;
 
-	if (menuScreen == 1 && roomParse(200, fl)) {
+	if (_menuScreen && roomParse(200, fl)) {
 		;
-	} else if (menuScreen != 1 && roomParse(201, fl)) {
+	} else if (!_menuScreen && roomParse(201, fl)) {
 		;
-	} else if (menuScreen == 1) {
+	} else if (_menuScreen) {
 		if (currentChapter == 1) {
 			hasAnswer = 0;
 		} else if (currentChapter == 2) {
@@ -1607,7 +1607,7 @@
 		room(roomNumber, fl);
 	}
 
-	if (hasAnswer == 0 && (hasName == 1 || menuScreen == 1))
+	if (hasAnswer == 0 && (_hasName || _menuScreen))
 		room(0, -1);
 
 	showCursor();
@@ -1646,7 +1646,7 @@
 	char buffer[256];
 	int palLevel = 0;
 
-	hasName = 0;
+	_hasName = false;
 
 	strcpy(currentData, fileName);
 

Modified: scummvm/trunk/engines/drascula/saveload.cpp
===================================================================
--- scummvm/trunk/engines/drascula/saveload.cpp	2009-05-13 11:43:24 UTC (rev 40520)
+++ scummvm/trunk/engines/drascula/saveload.cpp	2009-05-13 11:59:49 UTC (rev 40521)
@@ -190,7 +190,7 @@
 	Common::InSaveFile *sav;
 
 	previousMusic = roomMusic;
-	menuScreen = 0;
+	_menuScreen = false;
 	if (currentChapter != 1)
 		clearRoom();
 


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