diff options
author | Strangerke | 2014-02-09 11:44:56 +0100 |
---|---|---|
committer | Strangerke | 2014-02-09 11:44:56 +0100 |
commit | c97ce839fd5c4a169d0f9f8c5ab99abb17aef9f3 (patch) | |
tree | a3d524884bc2765fb01855ffffa518dc004a79d8 /engines/hopkins | |
parent | d7c86f3913938298b94b2b44267856006f8206d0 (diff) | |
download | scummvm-rg350-c97ce839fd5c4a169d0f9f8c5ab99abb17aef9f3.tar.gz scummvm-rg350-c97ce839fd5c4a169d0f9f8c5ab99abb17aef9f3.tar.bz2 scummvm-rg350-c97ce839fd5c4a169d0f9f8c5ab99abb17aef9f3.zip |
HOPKINS: Reduce the scope of some variables
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/anim.cpp | 3 | ||||
-rw-r--r-- | engines/hopkins/computer.cpp | 12 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 6 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 5 |
4 files changed, 9 insertions, 17 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 2ec9cec009..238f27616e 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 f9e3ecafcd..c42474de64 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 a64e81fcc9..c47cf95152 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 d6b78086f8..5d8661c4ae 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) |