[Scummvm-cvs-logs] CVS: scummvm/scumm script_v2.cpp,2.103,2.104 verbs.cpp,1.47,1.48
James Brown
ender at users.sourceforge.net
Wed May 21 22:45:04 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv22253/scumm
Modified Files:
script_v2.cpp verbs.cpp
Log Message:
V2 Inventory scrolling, etc
Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.103
retrieving revision 2.104
diff -u -d -r2.103 -r2.104
--- script_v2.cpp 22 May 2003 00:51:42 -0000 2.103
+++ script_v2.cpp 22 May 2003 05:44:18 -0000 2.104
@@ -938,7 +938,7 @@
sentenceline.top = virtscr[2].topline;
sentenceline.bottom = virtscr[2].topline + 8;
sentenceline.left = 0;
- sentenceline.right = 200;
+ sentenceline.right = 319;
restoreBG(sentenceline);
drawString(2);
Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- verbs.cpp 21 May 2003 23:54:39 -0000 1.47
+++ verbs.cpp 22 May 2003 05:44:18 -0000 1.48
@@ -33,32 +33,52 @@
if ((y < virtscr[2].topline + 34) || !(_mouseButStat & MBS_LEFT_CLICK))
return;
+ if (x > 145 && x < 160) { // Inventory Arrows
+ if (y < virtscr[2].topline + 38) // Up arrow
+ _inventoryOffset-=2;
+ else if (y > virtscr[2].topline + 47) // Down arrow
+ _inventoryOffset+=2;
+
+ if (_inventoryOffset < 0)
+ _inventoryOffset = 0;
+
+ if (_inventoryOffset > (getInventoryCount(_scummVars[VAR_EGO])-2))
+ _inventoryOffset = (getInventoryCount(_scummVars[VAR_EGO])-2);
+
+ redrawV2Inventory();
+ }
+
object = ((y - virtscr[2].topline - 34) / 8) * 2;
if (x > 150)
object++;
- object = findInventory(_scummVars[VAR_EGO], object+1);
+ object = findInventory(_scummVars[VAR_EGO], object+1+_inventoryOffset);
if (object > 0) {
runInputScript(3, object, 0);
}
}
void Scumm::redrawV2Inventory() {
- int i, items = 0, curInventoryCount = 0;
+ int i, items = 0;
bool alternate = false;
int max_inv = getInventoryCount(_scummVars[VAR_EGO]);
+ ScummVM::Rect inventoryBox;
- if (!(_userState & 64))
- return;
+ // Clear on all invocations, so hiding works properly
+ inventoryBox.top = virtscr[2].topline + 32;
+ inventoryBox.bottom = virtscr[2].topline + virtscr[2].height;
+ inventoryBox.left = 0;
+ inventoryBox.right = 319;
+ restoreBG(inventoryBox);
- if (curInventoryCount > max_inv)
- curInventoryCount = max_inv;
+ if (!(_userState & 64)) // Don't draw inventory unless active
+ return;
_string[1].charset = 1;
_string[1].color = 5;
items = 0;
- for (i = curInventoryCount + 1; i <= max_inv; i++) {
+ for (i = _inventoryOffset + 1; i <= max_inv; i++) {
int obj = findInventory(_scummVars[VAR_EGO], i);
if ((obj == 0) || (items == 4)) break;
@@ -76,7 +96,7 @@
alternate = !alternate;
}
- if (curInventoryCount > 0) { // Draw Up Arrow
+ if (_inventoryOffset > 0) { // Draw Up Arrow
_string[1].xpos = 145;
_string[1].ypos = virtscr[2].topline + 32;
_messagePtr = (const byte *)"\1\2";
More information about the Scummvm-git-logs
mailing list