aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-02-09 20:22:59 +0100
committerStrangerke2014-02-09 20:22:59 +0100
commit7e0bf95a31a909ff17aaf786af734eda77a48129 (patch)
treec16f9e206d24d155b4231f8b4215b39c9d060de5
parent5cc2315b38561f525c3925256f3e44437a634763 (diff)
downloadscummvm-rg350-7e0bf95a31a909ff17aaf786af734eda77a48129.tar.gz
scummvm-rg350-7e0bf95a31a909ff17aaf786af734eda77a48129.tar.bz2
scummvm-rg350-7e0bf95a31a909ff17aaf786af734eda77a48129.zip
MORTEVIELLE: Reduce the scope of some variables
-rw-r--r--engines/mortevielle/dialogs.cpp4
-rw-r--r--engines/mortevielle/mouse.cpp8
-rw-r--r--engines/mortevielle/sound.cpp3
-rw-r--r--engines/mortevielle/utils.cpp2
4 files changed, 7 insertions, 10 deletions
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 09a4227cc0..1ab2af7008 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -292,7 +292,7 @@ bool DialogManager::showKnowledgeCheck() {
Common::String choiceArray[15];
- int currChoice, prevChoice;
+ int currChoice;
int correctCount = 0;
for (int indx = 0; indx < 10; ++indx) {
@@ -317,7 +317,7 @@ bool DialogManager::showKnowledgeCheck() {
int optionPosY = 35;
int maxLength = 0;
- prevChoice = 1;
+ int prevChoice = 1;
for (int j = firstOption; j <= lastOption; ++j, ++prevChoice) {
tmpStr = _vm->getString(j);
if ((int) tmpStr.size() > maxLength)
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 2077a4cdc5..d71934ad1a 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -97,15 +97,13 @@ void MouseHandler::getMousePosition(int &x, int &y, bool &click) {
* @remarks Originally called 'mov_mouse'
*/
void MouseHandler::moveMouse(bool &funct, char &key) {
- bool p_key;
- char in1, in2;
int cx, cy;
bool click;
// Set defaults and check pending events
funct = false;
key = '\377';
- p_key = _vm->keyPressed();
+ bool p_key = _vm->keyPressed();
// If mouse button clicked, return it
if (_vm->getMouseClick())
@@ -116,7 +114,7 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
if (_vm->shouldQuit())
return;
- in1 = _vm->getChar();
+ char in1 = _vm->getChar();
getMousePosition(cx, cy, click);
switch (toupper(in1)) {
case '4':
@@ -160,7 +158,7 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
p_key = _vm->keyPressed();
if (p_key) {
- in2 = _vm->getChar();
+ char in2 = _vm->getChar();
if ((in2 >= ';') && (in2 <= 'D')) {
funct = true;
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index db1f7578f1..1270eeb63e 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -91,13 +91,12 @@ int SoundManager::decodeMusic(const byte *PSrc, byte *PDest, int size) {
static const int tab[16] = { -96, -72, -48, -32, -20, -12, -8, -4, 0, 4, 8, 12, 20, 32, 48, 72 };
uint seed = 128;
- int v;
int decompSize = 0;
int skipSize = 0;
for (int idx1 = 0; idx1 < size; ++idx1) {
byte srcByte = *PSrc++;
- v = tab[srcByte >> 4];
+ int v = tab[srcByte >> 4];
seed += v;
*PDest++ = seed & 0xff;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 29c9be2e0c..d24585a677 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -258,7 +258,6 @@ void MortevielleEngine::handleAction() {
clearVerbBar();
- bool handledOpcodeFl = false;
_controlMenu = 0;
if (!_keyPressedEsc) {
_menu->drawMenu();
@@ -319,6 +318,7 @@ void MortevielleEngine::handleAction() {
_menuOpcode = _currMenu;
if ((_currMenu == MENU_ACTION) || (_currMenu == MENU_SELF))
_menuOpcode = _currAction;
+ bool handledOpcodeFl = false;
if (!_anyone) {
if ((_heroSearching) || (_obpart)) {
if (_mouse->_pos.y < 12)