aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-02-28 22:47:36 +0100
committerStrangerke2014-02-28 22:47:36 +0100
commitf358ec74f7ac4575e5450fd468a46aba2190da91 (patch)
tree3b8817bd90c8b3a0587dae3efc57d972cd72af14
parentd35f470bf6290eb9ab5a86321b223ae3f1cb48fa (diff)
downloadscummvm-rg350-f358ec74f7ac4575e5450fd468a46aba2190da91.tar.gz
scummvm-rg350-f358ec74f7ac4575e5450fd468a46aba2190da91.tar.bz2
scummvm-rg350-f358ec74f7ac4575e5450fd468a46aba2190da91.zip
TONY: Reduce the scope of some more variables
-rw-r--r--engines/tony/inventory.cpp7
-rw-r--r--engines/tony/mpal/loadmpc.cpp4
-rw-r--r--engines/tony/mpal/mpal.cpp6
3 files changed, 5 insertions, 12 deletions
diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp
index 1ffc0a4cf4..974be8b04d 100644
--- a/engines/tony/inventory.cpp
+++ b/engines/tony/inventory.cpp
@@ -457,8 +457,6 @@ bool RMInventory::rightRelease(const RMPoint &mpos, RMTonyAction &curAction) {
#define INVSPEED 20
void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpos, bool bCanOpen) {
- bool bNeedRedraw = false;
-
if (_state != CLOSED) {
// Clean up the OT list
g_system->lockMutex(_csModifyInterface);
@@ -466,6 +464,8 @@ void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
// DoFrame makes all the objects currently in the inventory be displayed
// @@@ Maybe we should do all takeable objects? Please does not help
+ bool bNeedRedraw = false;
+
for (int i = 0; i < _nInv; i++) {
if (_items[_inv[i]]._icon.doFrame(this, false) && (i >= _curPos && i <= _curPos + 7))
bNeedRedraw = true;
@@ -698,9 +698,8 @@ int RMInventory::loadState(byte *state) {
state += 4;
}
- int x;
for (int i = 0; i < 256; i++) {
- x = READ_LE_UINT32(state);
+ int x = READ_LE_UINT32(state);
state += 4;
if (i < _nItems) {
diff --git a/engines/tony/mpal/loadmpc.cpp b/engines/tony/mpal/loadmpc.cpp
index 8f63b07ca0..8d030f1e52 100644
--- a/engines/tony/mpal/loadmpc.cpp
+++ b/engines/tony/mpal/loadmpc.cpp
@@ -138,8 +138,6 @@ static void FreeScript(LpMpalScript lpmsScript) {
* @returns Pointer to the buffer after the item, or NULL on failure.
*/
static const byte *parseDialog(const byte *lpBuf, LpMpalDialog lpmdDialog) {
- byte *lpLock;
-
lpmdDialog->_nObj = READ_LE_UINT32(lpBuf);
lpBuf += 4;
@@ -155,7 +153,7 @@ static const byte *parseDialog(const byte *lpBuf, LpMpalDialog lpmdDialog) {
lpmdDialog->_periodNums[i] = READ_LE_UINT16(lpBuf);
lpBuf += 2;
lpmdDialog->_periods[i] = globalAllocate(GMEM_MOVEABLE | GMEM_ZEROINIT, *lpBuf + 1);
- lpLock = (byte *)globalLock(lpmdDialog->_periods[i]);
+ byte *lpLock = (byte *)globalLock(lpmdDialog->_periods[i]);
Common::copy(lpBuf + 1, lpBuf + 1 + *lpBuf, lpLock);
globalUnlock(lpmdDialog->_periods[i]);
lpBuf += (*lpBuf) + 1;
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index 3084fd89af..305f89765b 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -1718,7 +1718,6 @@ uint32 mpalQueryDWORD(uint16 wQueryType, ...) {
* method that returns a pointer or handle.
*/
MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...) {
- char *n;
Common::String buf;
va_list v;
va_start(v, wQueryType);
@@ -1796,12 +1795,9 @@ MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...) {
error("mpalQuery(MPQ_ITEM_IS_ACTIVE, uint32 nItem) used incorrect variant");
} else if (wQueryType == MPQ_ITEM_NAME) {
- /*
- * uint32 mpalQuery(MPQ_ITEM_NAME, uint32 nItem, char *lpszName);
- */
lockVar();
int x = GETARG(uint32);
- n = GETARG(char *);
+ char *n = GETARG(char *);
buf = Common::String::format("Status.%u", x);
if (varGetValue(buf.c_str()) <= 0)
n[0] = '\0';