[Scummvm-cvs-logs] scummvm master -> c97ce839fd5c4a169d0f9f8c5ab99abb17aef9f3

Strangerke Strangerke at scummvm.org
Sun Feb 9 11:46:24 CET 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:
c97ce839fd HOPKINS: Reduce the scope of some variables


Commit: c97ce839fd5c4a169d0f9f8c5ab99abb17aef9f3
    https://github.com/scummvm/scummvm/commit/c97ce839fd5c4a169d0f9f8c5ab99abb17aef9f3
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-02-09T02:44:56-08:00

Commit Message:
HOPKINS: Reduce the scope of some variables

Changed paths:
    engines/hopkins/anim.cpp
    engines/hopkins/computer.cpp
    engines/hopkins/graphics.cpp
    engines/hopkins/hopkins.cpp



diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 2ec9cec..238f276 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -668,7 +668,6 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
  */
 void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl) {
 	byte *screenP;
-	int frameNumber;
 	Common::File f;
 
 	if (_vm->shouldQuit())
@@ -708,7 +707,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
 
 	if (!_vm->_events->_escKeyFl) {
 		_vm->_events->_rateCounter = 0;
-		frameNumber = 0;
+		int frameNumber = 0;
 		while (!_vm->shouldQuit()) {
 			_vm->_soundMan->playAnimSound(frameNumber++);
 
diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp
index f9e3eca..c42474d 100644
--- a/engines/hopkins/computer.cpp
+++ b/engines/hopkins/computer.cpp
@@ -675,15 +675,12 @@ void ComputerManager::displayBricks() {
 	_breakoutSpeed = 1;
 	int16 *level = _breakoutLevel;
 
-	int cellLeft;
-	int cellTop;
-	int cellType;
 	for (int levelIdx = 0; ; levelIdx += 6) {
-		cellLeft = (int16)FROM_LE_16(level[levelIdx]);
+		int cellLeft = (int16)FROM_LE_16(level[levelIdx]);
 		if (cellLeft == -1)
 			break;
-		cellTop = FROM_LE_16(level[levelIdx + 1]);
-		cellType = FROM_LE_16(level[levelIdx + 4]);
+		int cellTop = FROM_LE_16(level[levelIdx + 1]);
+		int cellType = FROM_LE_16(level[levelIdx + 4]);
 
 		if (cellType <= 6)
 			++_breakoutBrickNbr;
@@ -833,7 +830,6 @@ int ComputerManager::displayHiscores() {
 	_vm->_graphicsMan->setColorPercentage(254, 0, 0, 0);
 
 	int yp;
-	int xp;
 	// Loop for displaying the scores
 	for (int scoreIndex = 0; scoreIndex <= 5; scoreIndex++) {
 		yp = 19 * scoreIndex;
@@ -853,7 +849,7 @@ int ComputerManager::displayHiscores() {
 	int buttonIndex = 0;
 	do {
 		_vm->_events->refreshEvents();
-		xp = _vm->_events->getMouseX();
+		int xp = _vm->_events->getMouseX();
 		yp = _vm->_events->getMouseY();
 
 		if (_vm->_events->getMouseButton() == 1 && ABS(xp - 79) <= 33 && ABS(yp - 396) <= 13)
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index a64e81f..c47cf95 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -439,9 +439,7 @@ void GraphicsManager::display8BitRect(const byte *surface, int xs, int ys, int w
 }
 
 void GraphicsManager::displayScaled8BitRect(const byte *surface, int xp, int yp, int width, int height, int destX, int destY) {
-	int xCtr;
 	const byte *palette;
-	int savedXCount;
 	byte *loopDestP;
 	const byte *loopSrcP;
 	int yCtr;
@@ -454,10 +452,10 @@ void GraphicsManager::displayScaled8BitRect(const byte *surface, int xp, int yp,
 
 	do {
 		yCtr = yCount;
-		xCtr = xCount;
+		int xCtr = xCount;
 		loopSrcP = srcP;
 		loopDestP = destP;
-		savedXCount = xCount;
+		int savedXCount = xCount;
 		palette = _palettePixels;
 
 		do {
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index d6b7808..5d8661c 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -2860,7 +2860,6 @@ void HopkinsEngine::syncSoundSettings() {
 }
 
 bool HopkinsEngine::displayAdultDisclaimer() {
-	int xp, yp;
 	int buttonIndex;
 
 	_graphicsMan->_minX = 0;
@@ -2880,8 +2879,8 @@ bool HopkinsEngine::displayAdultDisclaimer() {
 	_events->_mouseSpriteId = 0;
 
 	do {
-		xp = _events->getMouseX();
-		yp = _events->getMouseY();
+		int xp = _events->getMouseX();
+		int yp = _events->getMouseY();
 
 		buttonIndex = 0;
 		if (xp >= 37 && xp <= 169 && yp >= 406 && yp <= 445)






More information about the Scummvm-git-logs mailing list