aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2015-01-18 15:26:05 +0100
committerStrangerke2015-01-18 15:26:05 +0100
commitb1477438bbc440e6bc240adc19029e7d2817da33 (patch)
tree2fd3d7e33dd932a65c60aa983e845ab122a33833 /engines
parentc4e8460ba2a82560a29f32a08f31580befba78c1 (diff)
downloadscummvm-rg350-b1477438bbc440e6bc240adc19029e7d2817da33.tar.gz
scummvm-rg350-b1477438bbc440e6bc240adc19029e7d2817da33.tar.bz2
scummvm-rg350-b1477438bbc440e6bc240adc19029e7d2817da33.zip
ACCESS: MM - Implement displayInv
Diffstat (limited to 'engines')
-rw-r--r--engines/access/bubble_box.cpp2
-rw-r--r--engines/access/bubble_box.h2
-rw-r--r--engines/access/inventory.cpp29
-rw-r--r--engines/access/inventory.h1
-rw-r--r--engines/access/martian/martian_resources.cpp23
-rw-r--r--engines/access/martian/martian_resources.h3
-rw-r--r--engines/access/room.cpp99
-rw-r--r--engines/access/scripts.h2
8 files changed, 112 insertions, 49 deletions
diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp
index 21e2501694..97bdbedc06 100644
--- a/engines/access/bubble_box.cpp
+++ b/engines/access/bubble_box.cpp
@@ -713,7 +713,7 @@ int BubbleBox::doBox_v1(int item, int box, int &btnSelected) {
return retval_;
}
-void BubbleBox::getList(const char *data[], int *flags) {
+void BubbleBox::getList(const char *const data[], int *flags) {
int srcIdx = 0;
int destIdx = 0;
while (data[srcIdx]) {
diff --git a/engines/access/bubble_box.h b/engines/access/bubble_box.h
index dd6a043a55..065e0ef82a 100644
--- a/engines/access/bubble_box.h
+++ b/engines/access/bubble_box.h
@@ -98,7 +98,7 @@ public:
void doBox(int item, int box);
int doBox_v1(int item, int box, int &btnSelected);
- void getList(const char *data[], int *flags);
+ void getList(const char *const data[], int *flags);
void SETCURSORPOS(int posX, int posY);
void PRINTSTR(Common::String msg);
};
diff --git a/engines/access/inventory.cpp b/engines/access/inventory.cpp
index 8db62a45fc..781650b614 100644
--- a/engines/access/inventory.cpp
+++ b/engines/access/inventory.cpp
@@ -70,7 +70,7 @@ InventoryManager::InventoryManager(AccessEngine *vm) : Manager(vm) {
case GType_MartianMemorandum:
names = Martian::INVENTORY_NAMES;
combineP = &Martian::COMBO_TABLE[0][0];
- _inv.resize(54);
+ _inv.resize(55);
break;
default:
error("Unknown game");
@@ -208,6 +208,33 @@ int InventoryManager::newDisplayInv() {
return result;
}
+int InventoryManager::displayInv() {
+ warning("TODO: displayInv");
+ int *inv = (int *) malloc (Martian::INVENTORY_SIZE * sizeof(int));
+
+ for (int i = 0; i < Martian::INVENTORY_SIZE; i++)
+ inv[i] = _inv[i]._value;
+ _vm->_events->forceSetCursor(CURSOR_CROSSHAIRS);
+ _vm->_invBox->getList(Martian::INVENTORY_NAMES, inv);
+
+ int btnSelected = 0;
+ int boxX = _vm->_invBox->doBox_v1(_startInvItem, _startInvBox, btnSelected);
+ _startInvItem = _vm->BOXDATASTART;
+ _startInvBox= _vm->BOXSELECTY;
+
+ if (boxX == -1)
+ btnSelected = 2;
+
+ if (btnSelected != 2)
+ _vm->_useItem = _vm->_invBox->_tempListIdx[boxX];
+ else
+ _vm->_useItem = -1;
+
+
+ free(inv);
+ return 0;
+}
+
void InventoryManager::savedFields() {
Screen &screen = *_vm->_screen;
Room &room = *_vm->_room;
diff --git a/engines/access/inventory.h b/engines/access/inventory.h
index 6a9390eda9..1d88bf4555 100644
--- a/engines/access/inventory.h
+++ b/engines/access/inventory.h
@@ -128,6 +128,7 @@ public:
void refreshInventory();
int newDisplayInv();
+ int displayInv();
/**
* Synchronize savegame data
diff --git a/engines/access/martian/martian_resources.cpp b/engines/access/martian/martian_resources.cpp
index 09e16c156d..5e07cd7db5 100644
--- a/engines/access/martian/martian_resources.cpp
+++ b/engines/access/martian/martian_resources.cpp
@@ -188,17 +188,19 @@ const int TRAVEL_POS[][2] = {
{ -1, 21 }
};
+const int INVENTORY_SIZE = 55;
const char *const INVENTORY_NAMES[] = {
- "CAMERA", "LENS", "PHOTOS", "MAIL", "GUN", "CASH", "COMLINK", "AMMO",
- "LOCKPICK KIT", "EARRING", "RECIEPTS", "PAPER", "LADDER", "BOOTS",
- "DOCUMENTS", "KNIFE", "DAGGER", "KEYS", "ROCK", "LOG", "SHOVEL",
- "STONE", "REMOTE CONTROL", "FOOD AND WATER", "DOOR CARD KEY",
+ "CAMERA", "LENS", "PHOTOS", "MAIL", "GUN",
+ "CASH", "COMLINK", "AMMO", "LOCKPICK KIT", "EARRING",
+ "RECIEPTS", "PAPER", "LADDER", "BOOTS", "DOCUMENTS",
+ "KNIFE", "DAGGER", "KEYS", "ROCK", "LOG",
+ "SHOVEL", "STONE", "REMOTE CONTROL", "FOOD AND WATER", "DOOR CARD KEY",
"FLASHLIGHT", "INTERLOCK KEY", "TOOLS", "REBREATHER", "JET PACK",
- "ROD", "HCL2", "SAFE CARD KEY", "TUNING FORK", "STONE", "ROSE",
- "KEY", "NOTE", "ALLEN WRENCH", "HOVER BOARD", "BLUE PRINTS",
- "LETTER", "MEMORANDUM", "MARKERS", "FILM", "ANDRETTI FILM",
- "GLASSES", "AMULET", "FACIAL KIT", "CAT FOOD", "MONKEY WRENCH",
- "BIG DICK CARD", "BRA", "BOLT"
+ "ROD", "HCL2", "SAFE CARD KEY", "TUNING FORK", "STONE",
+ "ROSE", "KEY", "NOTE", "ALLEN WRENCH", "HOVER BOARD",
+ "BLUE PRINTS", "LETTER", "MEMORANDUM", "MARKERS", "FILM",
+ "ANDRETTI FILM", "GLASSES", "AMULET", "FACIAL KIT", "CAT FOOD",
+ "MONKEY WRENCH", "BIG DICK CARD", "BRA", "BOLT", nullptr
};
const byte ROOM_TABLE1[] = {
@@ -807,7 +809,7 @@ const int RMOUSE[10][2] = {
{ 155, 185 }, { 188, 216 }, { 219, 260 }, { 263, 293 }, { 295, 214 }
};
-const char *TRAVDATA[] = {
+const char *const TRAVDATA[] = {
"GALACTIC PICTURES", "TERRAFORM", "WASHROOM", "MR. BIG", "ALEXIS' HOME",
"JOHNNY FEDORA", "JUNKYARD IN", "TEX'S OFFICE", "MURDER SCENE", "PLAZA HOTEL",
"RESTAURANT", "GIFT SHOP", "LOVE SCENE", "RICK LOGAN", "HUT",
@@ -832,7 +834,6 @@ const char *const ASKTBL[] = {
"LARRRY HAMMOND", nullptr
};
-
byte HELP[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
diff --git a/engines/access/martian/martian_resources.h b/engines/access/martian/martian_resources.h
index fc9150d973..fb147ac149 100644
--- a/engines/access/martian/martian_resources.h
+++ b/engines/access/martian/martian_resources.h
@@ -35,6 +35,7 @@ extern const byte *const CURSORS[4];
extern const int TRAVEL_POS[][2];
+extern const int INVENTORY_SIZE;
extern const char *const INVENTORY_NAMES[];
extern const byte *const ROOM_TABLE[];
@@ -57,7 +58,7 @@ extern const int RMOUSE[10][2];
extern byte HELP[];
extern const char *const ASKTBL[];
-extern const char *TRAVDATA[];
+extern const char *const TRAVDATA[];
extern const byte DEATH_SCREENS[];
extern const char *const DEATHMESSAGE[];
diff --git a/engines/access/room.cpp b/engines/access/room.cpp
index fa0c0c4510..669ee26dc6 100644
--- a/engines/access/room.cpp
+++ b/engines/access/room.cpp
@@ -515,9 +515,6 @@ void Room::cycleCommand(int incr) {
}
void Room::handleCommand(int commandId) {
- if (commandId == 1)
- --commandId;
-
if (commandId == 9) {
_vm->_events->debounceLeft();
_vm->_canSaveLoad = true;
@@ -536,39 +533,75 @@ void Room::executeCommand(int commandId) {
EventsManager &events = *_vm->_events;
_selectCommand = commandId;
- switch (commandId) {
- case 0:
- events.forceSetCursor(CURSOR_LOOK);
- break;
- case 2:
- events.forceSetCursor(CURSOR_USE);
- break;
- case 3:
- events.forceSetCursor(CURSOR_TAKE);
- break;
- case 4:
- events.setCursor(CURSOR_ARROW);
- if (_vm->_inventory->newDisplayInv() == 2) {
- commandOff();
+ if (_vm->getGameID() == GType_MartianMemorandum) {
+ switch (commandId) {
+ case 4:
+ events.setCursor(CURSOR_ARROW);
+ if (_vm->_inventory->displayInv() == 2) {
+ commandOff();
+ return;
+ }
+ if (_vm->_useItem == 39) {
+ if (_vm->_player->_roomNumber == 23)
+ _vm->_currentMan = 1;
+ commandOff();
+ return;
+ } else if (_vm->_useItem == 6) {
+ _vm->_flags[3] = 2;
+ _vm->_scripts->converse1(24);
+
+ _conFlag = true;
+ while (_conFlag && !_vm->shouldQuitOrRestart()) {
+ _conFlag = false;
+ _vm->_scripts->executeScript();
+ }
+
+ _vm->_boxSelect = true;
+ }
+ break;
+ case 7:
+ walkCursor();
return;
+ default:
+ // No set cursor in MM. Forcing to CROSSHAIRS
+ events.setCursor(CURSOR_CROSSHAIRS);
+ break;
+ }
+ } else {
+ switch (commandId) {
+ case 0:
+ case 1:
+ events.forceSetCursor(CURSOR_LOOK);
+ break;
+ case 2:
+ events.forceSetCursor(CURSOR_USE);
+ break;
+ case 3:
+ events.forceSetCursor(CURSOR_TAKE);
+ break;
+ case 4:
+ events.setCursor(CURSOR_ARROW);
+ if (_vm->_inventory->newDisplayInv() == 2) {
+ commandOff();
+ return;
+ }
+ break;
+ case 5:
+ events.forceSetCursor(CURSOR_CLIMB);
+ break;
+ case 6:
+ events.forceSetCursor(CURSOR_TALK);
+ break;
+ case 7:
+ walkCursor();
+ return;
+ case 8:
+ events.forceSetCursor(CURSOR_HELP);
+ break;
+ default:
+ break;
}
- break;
- case 5:
- events.forceSetCursor(CURSOR_CLIMB);
- break;
- case 6:
- events.forceSetCursor(CURSOR_TALK);
- break;
- case 7:
- walkCursor();
- return;
- case 8:
- events.forceSetCursor(CURSOR_HELP);
- break;
- default:
- break;
}
-
// Draw the default toolbar menu at the bottom of the screen
roomMenu();
_vm->_screen->saveScreen();
diff --git a/engines/access/scripts.h b/engines/access/scripts.h
index ba052036ca..a9f8becda2 100644
--- a/engines/access/scripts.h
+++ b/engines/access/scripts.h
@@ -44,7 +44,6 @@ private:
void charLoop();
void printWatch();
- void converse1(int val);
protected:
Common::SeekableReadStream *_data;
@@ -172,6 +171,7 @@ public:
// Script commands that need to be public
void cmdFreeSound();
void cmdRetPos();
+ void converse1(int val);
};
} // End of namespace Access