diff options
author | James Brown | 2003-05-21 09:29:24 +0000 |
---|---|---|
committer | James Brown | 2003-05-21 09:29:24 +0000 |
commit | 0c0cb618769afe273f9935ae4404d6a4ca08723d (patch) | |
tree | 85544f6d88ec93cc8d37fd1ba21504b9c5b208a4 /scumm | |
parent | 0096df9737affd13269693a9f54659299771e252 (diff) | |
download | scummvm-rg350-0c0cb618769afe273f9935ae4404d6a4ca08723d.tar.gz scummvm-rg350-0c0cb618769afe273f9935ae4404d6a4ca08723d.tar.bz2 scummvm-rg350-0c0cb618769afe273f9935ae4404d6a4ca08723d.zip |
Move stuff around
svn-id: r7775
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/script_v2.cpp | 49 | ||||
-rw-r--r-- | scumm/scumm.h | 2 | ||||
-rw-r--r-- | scumm/verbs.cpp | 45 |
3 files changed, 49 insertions, 47 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index cabbd0e959..38fbc860c5 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -1186,53 +1186,7 @@ void Scumm_v2::o2_pickupObject() { clearDrawObjectQueue(); runHook(1); - // FIXME: Ender Quick Hack to allow further Zak testing. - // In reality, we should probably stuff the inventory into verbs - // as later games do. Easier hotspot tracking :) - if (!(_userState & 64)) - return; -{ - int i, items = 0, curInventoryCount = 0; - bool alternate = false; - - if (curInventoryCount > _maxInventoryItems) - curInventoryCount = _maxInventoryItems; - - for (i = curInventoryCount + 1; i <= _maxInventoryItems; i++) { - if (_inventory[i] != 0) { - _string[1].charset = 1; - _string[1].ypos = virtscr[2].topline + 34 + (8*(items / 2)); - _string[1].color = 5; - _messagePtr = getObjOrActorName(_inventory[i]); - - if (alternate) - _string[1].xpos = 200; - else - _string[1].xpos = 0; - drawString(1); - - items++; - alternate = !alternate; - } - if (items == 4) - break; - } - - //if (curInventoryCount > 0) { // Draw Up Arrow - _string[1].xpos = 145; - _string[1].ypos = virtscr[2].topline + 32; - _messagePtr = (byte*)strdup("U"); - drawString(1); - //} - - //if (items == 4) { // Draw Down Arrow - _string[1].xpos = 145; - _string[1].ypos = virtscr[2].topline + 47; - _messagePtr = (byte*)strdup("D"); - drawString(1); - //} - -} + redrawV2Inventory(); } void Scumm_v2::o2_setObjectName() { @@ -1282,6 +1236,7 @@ void Scumm_v2::o2_cursorCommand() { // TODO: Define the magic numbers if (a2 & 4) { // Userface _userState = a2 & (32 | 64 | 128); + redrawV2Inventory(); } if (a2 & 1) { // Freeze diff --git a/scumm/scumm.h b/scumm/scumm.h index 864e1ca244..be7fe62064 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -713,6 +713,8 @@ protected: void runObjectScript(int script, int entry, bool freezeResistant, bool recursive, int *vars); void setVerbObject(uint room, uint object, uint verb); + void redrawV2Inventory(); + public: /* Should be in Actor class */ Actor *derefActor(int id); diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index 004abbde70..74a4b80a29 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -27,6 +27,51 @@ #include "scumm.h" #include "verbs.h" +void Scumm::redrawV2Inventory() { + int i, items = 0, curInventoryCount = 0; + bool alternate = false; + + if (!(_userState & 64)) + return; + + if (curInventoryCount > _maxInventoryItems) + curInventoryCount = _maxInventoryItems; + + for (i = curInventoryCount + 1; i <= _maxInventoryItems; i++) { + if (_inventory[i] != 0) { + _string[1].charset = 1; + _string[1].ypos = virtscr[2].topline + 34 + (8*(items / 2)); + _string[1].color = 5; + _messagePtr = getObjOrActorName(_inventory[i]); + + if (alternate) + _string[1].xpos = 200; + else + _string[1].xpos = 0; + + drawString(1); + + items++; + alternate = !alternate; + } + if (items == 4) + break; + } + + if (curInventoryCount > 0) { // Draw Up Arrow + _string[1].xpos = 145; + _string[1].ypos = virtscr[2].topline + 32; + _messagePtr = (byte*)strdup("U"); + drawString(1); + } + + if (items == 4) { // Draw Down Arrow + _string[1].xpos = 145; + _string[1].ypos = virtscr[2].topline + 47; + _messagePtr = (byte*)strdup("D"); + drawString(1); + } +} void Scumm::redrawVerbs() { int i; int verb = (_cursor.state > 0 ? checkMouseOver(_mouse.x, _mouse.y) : 0); |