aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel
diff options
context:
space:
mode:
authorMax Horn2009-10-26 10:40:51 +0000
committerMax Horn2009-10-26 10:40:51 +0000
commit9065dca09aeb046d2e4b76a3edf82b9b8360a7e4 (patch)
tree594e1c848a0255eb1e6401427038d2ab5c456702 /engines/tinsel
parentd19a831d290190ca37a42018c5590f28b4fae746 (diff)
downloadscummvm-rg350-9065dca09aeb046d2e4b76a3edf82b9b8360a7e4.tar.gz
scummvm-rg350-9065dca09aeb046d2e4b76a3edf82b9b8360a7e4.tar.bz2
scummvm-rg350-9065dca09aeb046d2e4b76a3edf82b9b8360a7e4.zip
TINSEL: cleanup
svn-id: r45400
Diffstat (limited to 'engines/tinsel')
-rw-r--r--engines/tinsel/dialogs.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index df508aaa24..36f7017c99 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -1263,31 +1263,29 @@ static void DumpObjArray(void) {
* Convert item ID number to pointer to item's compiled data
* i.e. Image data and Glitter code.
*/
-INV_OBJECT *GetInvObject(int num) {
- INV_OBJECT *retval = invObjects;
+INV_OBJECT *GetInvObject(int id) {
+ INV_OBJECT *pObject = invObjects;
- for (int i = 0; i < numObjects; i++, retval++) {
- if (retval->id == num)
- return retval;
+ for (int i = 0; i < numObjects; i++, pObject++) {
+ if (pObject->id == id)
+ return pObject;
}
- error("Trying to manipulate undefined inventory icon");
+ error("GetInvObject(%d): Trying to manipulate undefined inventory icon", id);
}
/**
* Convert item ID number to index.
*/
int GetObjectIndex(int id) {
- int i; // Loop counter
- INV_OBJECT *pObject;
+ INV_OBJECT *pObject = invObjects;
- for (i = 0, pObject = invObjects; i < numObjects; i++, pObject++) {
+ for (int i = 0; i < numObjects; i++, pObject++) {
if (pObject->id == id)
- break;
+ return i;
}
- assert(i < numObjects);
- return i;
+ error("GetObjectIndex(%d): Trying to manipulate undefined inventory icon", id);
}
/**