aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/inventory.cpp
diff options
context:
space:
mode:
authorArnaud Boutonné2011-02-03 18:25:38 +0000
committerArnaud Boutonné2011-02-03 18:25:38 +0000
commit935b3187982afb8a8c1aebded8b5ddc607e27f0f (patch)
tree96e092ef06cb439f25db0b91ab43be653c8756a6 /engines/hugo/inventory.cpp
parent38444a3712543f60f5daf8106ef3b2d66c6f9ab9 (diff)
downloadscummvm-rg350-935b3187982afb8a8c1aebded8b5ddc607e27f0f.tar.gz
scummvm-rg350-935b3187982afb8a8c1aebded8b5ddc607e27f0f.tar.bz2
scummvm-rg350-935b3187982afb8a8c1aebded8b5ddc607e27f0f.zip
HUGO: Suppress static variables (except one)
This also fixes the multiple-RTL related music bug reported by D. Gray svn-id: r55758
Diffstat (limited to 'engines/hugo/inventory.cpp')
-rw-r--r--engines/hugo/inventory.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/hugo/inventory.cpp b/engines/hugo/inventory.cpp
index 4d9da085ac..dfbf6fda6e 100644
--- a/engines/hugo/inventory.cpp
+++ b/engines/hugo/inventory.cpp
@@ -47,6 +47,7 @@ namespace Hugo {
static const int kMaxDisp = (kXPix / kInvDx); // Max icons displayable
InventoryHandler::InventoryHandler(HugoEngine *vm) : _vm(vm) {
+ _firstIconId = 0;
}
/**
@@ -100,8 +101,6 @@ void InventoryHandler::constructInventory(const int16 imageTotNumb, int displayN
int16 InventoryHandler::processInventory(const invact_t action, ...) {
debugC(1, kDebugInventory, "processInventory(invact_t action, ...)");
- static int16 firstIconId = 0; // Index of first icon to display
-
int16 imageNumb; // Total number of inventory items
int displayNumb; // Total number displayed/carried
// Compute total number and number displayed, i.e. number carried
@@ -118,15 +117,15 @@ int16 InventoryHandler::processInventory(const invact_t action, ...) {
switch (action) {
case kInventoryActionInit: // Initialize inventory display
- constructInventory(imageNumb, displayNumb, scrollFl, firstIconId);
+ constructInventory(imageNumb, displayNumb, scrollFl, _firstIconId);
break;
case kInventoryActionLeft: // Scroll left by one icon
- firstIconId = MAX(0, firstIconId - 1);
- constructInventory(imageNumb, displayNumb, scrollFl, firstIconId);
+ _firstIconId = MAX(0, _firstIconId - 1);
+ constructInventory(imageNumb, displayNumb, scrollFl, _firstIconId);
break;
case kInventoryActionRight: // Scroll right by one icon
- firstIconId = MIN(displayNumb, firstIconId + 1);
- constructInventory(imageNumb, displayNumb, scrollFl, firstIconId);
+ _firstIconId = MIN(displayNumb, _firstIconId + 1);
+ constructInventory(imageNumb, displayNumb, scrollFl, _firstIconId);
break;
case kInventoryActionGet: // Return object id under cursor
// Get cursor position from variable argument list
@@ -145,7 +144,7 @@ int16 InventoryHandler::processInventory(const invact_t action, ...) {
if (i == kMaxDisp - 1) // Right scroll button
objId = kRightArrow;
else // Adjust for scroll
- i += firstIconId - 1; // i is icon index
+ i += _firstIconId - 1; // i is icon index
}
}