[Scummvm-cvs-logs] SF.net SVN: scummvm: [29239] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sun Oct 21 15:10:37 CEST 2007
Revision: 29239
http://scummvm.svn.sourceforge.net/scummvm/?rev=29239&view=rev
Author: peres001
Date: 2007-10-21 06:10:36 -0700 (Sun, 21 Oct 2007)
Log Message:
-----------
Added new debug level for inventory routines.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/inventory.cpp
scummvm/trunk/engines/parallaction/parallaction.cpp
scummvm/trunk/engines/parallaction/parallaction.h
Modified: scummvm/trunk/engines/parallaction/inventory.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/inventory.cpp 2007-10-21 13:09:53 UTC (rev 29238)
+++ scummvm/trunk/engines/parallaction/inventory.cpp 2007-10-21 13:10:36 UTC (rev 29239)
@@ -262,8 +262,12 @@
}
ItemPosition Inventory::addItem(ItemName name, uint32 value) {
- if (_numItems == INVENTORY_MAX_ITEMS)
+ debugC(1, kDebugInventory, "addItem(%i, %i)", name, value);
+
+ if (_numItems == INVENTORY_MAX_ITEMS) {
+ debugC(3, kDebugInventory, "addItem: inventory is full");
return -1;
+ }
// NOTE: items whose name == 0 aren't really inventory items,
// but the engine expects the inventory to accept them as valid.
@@ -277,6 +281,8 @@
_numItems++;
+ debugC(3, kDebugInventory, "addItem: done");
+
return _numItems;
}
@@ -294,8 +300,11 @@
}
void Inventory::removeItem(ItemName name) {
+ debugC(1, kDebugInventory, "removeItem(%i)", name);
+
ItemPosition pos = findItem(name);
if (pos == -1) {
+ debugC(3, kDebugInventory, "removeItem: can't find item, nothing to remove");
return;
}
@@ -307,9 +316,13 @@
_items[_numItems]._id = 0;
_items[_numItems]._index = 0;
+
+ debugC(3, kDebugInventory, "removeItem: item removed");
}
void Inventory::clear(bool keepVerbs) {
+ debugC(1, kDebugInventory, "clearInventory()");
+
uint first = (keepVerbs ? INVENTORY_FIRST_ITEM : 0);
for (uint16 slot = first; slot < _maxItems; slot++) {
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2007-10-21 13:09:53 UTC (rev 29238)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2007-10-21 13:10:36 UTC (rev 29239)
@@ -112,6 +112,7 @@
Common::addSpecialDebugLevel(kDebugInput, "input", "Input debug level");
Common::addSpecialDebugLevel(kDebugAudio, "audio", "Audio debug level");
Common::addSpecialDebugLevel(kDebugMenu, "menu", "Menu debug level");
+ Common::addSpecialDebugLevel(kDebugInventory, "inventory", "Inventory debug level");
syst->getEventManager()->registerRandomSource(_rnd, "parallaction");
}
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2007-10-21 13:09:53 UTC (rev 29238)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2007-10-21 13:10:36 UTC (rev 29239)
@@ -53,7 +53,8 @@
kDebugExec = 1 << 5,
kDebugInput = 1 << 6,
kDebugAudio = 1 << 7,
- kDebugMenu = 1 << 8
+ kDebugMenu = 1 << 8,
+ kDebugInventory = 1 << 9
};
enum {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list