aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-02-28 23:39:35 +0100
committerStrangerke2014-02-28 23:39:35 +0100
commitc456b0e0e3f22333c0267692fe939b648e7a96c1 (patch)
tree31a981352f37916d8f76dae6a14fbd663363faa0
parent460645393e7333427f67d0a567edbd60d9b69b7b (diff)
downloadscummvm-rg350-c456b0e0e3f22333c0267692fe939b648e7a96c1.tar.gz
scummvm-rg350-c456b0e0e3f22333c0267692fe939b648e7a96c1.tar.bz2
scummvm-rg350-c456b0e0e3f22333c0267692fe939b648e7a96c1.zip
TOON: Reduce the scope of some more variables.
-rw-r--r--engines/toon/detection.cpp3
-rw-r--r--engines/toon/toon.cpp11
2 files changed, 5 insertions, 9 deletions
diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp
index 7c6eae6c63..4f82514213 100644
--- a/engines/toon/detection.cpp
+++ b/engines/toon/detection.cpp
@@ -179,10 +179,9 @@ SaveStateList ToonMetaEngine::listSaves(const char *target) const {
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
SaveStateList saveList;
- int slotNum = 0;
for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
// Obtain the last 3 digits of the filename, since they correspond to the save slot
- slotNum = atoi(filename->c_str() + filename->size() - 3);
+ int slotNum = atoi(filename->c_str() + filename->size() - 3);
if (slotNum >= 0 && slotNum <= 99) {
Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 3671422a8e..14e7d104d2 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -634,7 +634,6 @@ bool ToonEngine::showMainmenu(bool &loadedGame) {
bool doExit = false;
bool exitGame = false;
- int clickingOn, clickRelease;
int menuMask = MAINMENUMASK_BASE;
Common::SeekableReadStream *mainmenuMusicFile = NULL;
AudioStreamInstance *mainmenuMusic = NULL;
@@ -644,8 +643,8 @@ bool ToonEngine::showMainmenu(bool &loadedGame) {
dirtyAllScreen();
while (!doExit) {
- clickingOn = MAINMENUHOTSPOT_NONE;
- clickRelease = false;
+ int clickingOn = MAINMENUHOTSPOT_NONE;
+ int clickRelease = false;
if (!musicPlaying) {
mainmenuMusicFile = resources()->openFile("BR091013.MUS");
@@ -4617,15 +4616,13 @@ void ToonEngine::unloadToonDat() {
}
char **ToonEngine::loadTextsVariants(Common::File &in) {
- int numTexts;
- int entryLen;
int len;
char **res = 0;
char *pos = 0;
for (int varnt = 0; varnt < _numVariant; varnt++) {
- numTexts = in.readUint16BE();
- entryLen = in.readUint16BE();
+ int numTexts = in.readUint16BE();
+ int entryLen = in.readUint16BE();
pos = (char *)malloc(entryLen);
if (varnt == _gameVariant) {
res = (char **)malloc(sizeof(char *) * numTexts);