diff options
Diffstat (limited to 'engines/tony/game.cpp')
-rw-r--r-- | engines/tony/game.cpp | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp index 2bcfdc7fc2..42ace987b4 100644 --- a/engines/tony/game.cpp +++ b/engines/tony/game.cpp @@ -34,7 +34,6 @@ #include "tony/mpal/memory.h" #include "tony/mpal/mpal.h" #include "tony/mpal/mpalutils.h" -#include "tony/custom.h" #include "tony/game.h" #include "tony/gfxengine.h" #include "tony/tony.h" @@ -288,9 +287,7 @@ RMOptionScreen::RMOptionScreen() { _buttonSave_ArrowRight = NULL; _bEditSaveName = false; - int i; - - for (i = 0; i < 6; i++) { + for (int i = 0; i < 6; i++) { _curThumb[i] = NULL; _buttonSave_States[i] = NULL; } @@ -501,9 +498,7 @@ void RMOptionScreen::refreshAll(CORO_PARAM) { } void RMOptionScreen::refreshThumbnails() { - int i; - - for (i = 0; i < 6; i++) { + for (int i = 0; i < 6; i++) { if (_curThumb[i]) delete _curThumb[i]; @@ -691,9 +686,7 @@ void RMOptionScreen::closeState() { _buttonExit = NULL; if (_nState == MENULOAD || _nState == MENUSAVE) { - int i; - - for (i = 0; i < 6; i++) { + for (int i = 0; i < 6; i++) { if (_curThumb[i] != NULL) { delete _curThumb[i]; _curThumb[i] = NULL; @@ -981,7 +974,7 @@ void RMOptionScreen::doFrame(CORO_PARAM, RMInput *input) { CORO_BEGIN_CODE(_ctx); - // If it is fully open, do nothing + // If it is not fully open, do nothing if (_fadeStep != 6) return; @@ -1343,9 +1336,7 @@ void RMOptionScreen::removeThis(CORO_PARAM, bool &result) { bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, Common::String &name, byte &diff) { - Common::String buf; char namebuf[256]; - int i; Common::InSaveFile *f; char id[4]; @@ -1355,7 +1346,7 @@ bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, Com diff = 10; // Get the savegame filename for the given slot - buf = g_vm->getSaveStateFileName(nState); + Common::String buf = g_vm->getSaveStateFileName(nState); // Try and open the savegame f = g_system->getSavefileManager()->openForLoading(buf); @@ -1410,9 +1401,9 @@ bool RMOptionScreen::loadThumbnailFromSaveState(int nState, byte *lpDestBuf, Com return true; } - i = f->readByte(); - f->read(namebuf, i); - namebuf[i] = '\0'; + int bufSize = f->readByte(); + f->read(namebuf, bufSize); + namebuf[bufSize] = '\0'; name = namebuf; delete f; @@ -1436,9 +1427,7 @@ RMPointer::~RMPointer() { } void RMPointer::init() { - int i; - - for (i = 0; i < 5; i++) { + for (int i = 0; i < 5; i++) { RMResRaw res(RES_P_GO + i); _pointer[i] = new RMGfxSourceBuffer8RLEByteAA; @@ -1446,7 +1435,7 @@ void RMPointer::init() { _pointer[i]->loadPaletteWA(RES_P_PAL); } - for (i = 0; i < 5; i++) { + for (int i = 0; i < 5; i++) { RMRes res(RES_P_PAP1 + i); Common::SeekableReadStream *ds = res.getReadStream(); _specialPointer[i] = new RMItem; @@ -1467,9 +1456,7 @@ void RMPointer::init() { } void RMPointer::close() { - int i; - - for (i = 0; i < 5; i++) { + for (int i = 0; i < 5; i++) { if (_pointer[i] != NULL) { delete _pointer[i]; _pointer[i] = NULL; |