Skip to content

Commit

Permalink
ACCESS: MM - Make RMOUSE game-specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jan 2, 2015
1 parent f11032e commit 56754c2
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion engines/access/amazon/amazon_logic.cpp
Expand Up @@ -1591,7 +1591,7 @@ void River::moveCanoe() {
moveCanoe2();
} else {
if (events._leftButton && pt.y >= 140) {
if (pt.x < RMOUSE[8][0]) {
if (pt.x < _vm->_room->_rMouse[8][0]) {
// Disk icon wasn't clicked
_vm->_scripts->printString(BAR_MESSAGE);
} else {
Expand Down
7 changes: 6 additions & 1 deletion engines/access/amazon/amazon_resources.cpp
Expand Up @@ -2406,6 +2406,11 @@ const int CAST_END_OBJ1[4][4] = {
{ 3, 103, 1300, 10 }
};

} // End of namespace Amazon
const int RMOUSE[10][2] = {
{ 0, 35 }, { 0, 0 }, { 36, 70 }, { 71, 106 }, { 107, 141 },
{ 142, 177 }, { 178, 212 }, { 213, 248 }, { 249, 283 }, { 284, 318 }
};


} // End of namespace Amazon
} // End of namespace Access
4 changes: 2 additions & 2 deletions engines/access/amazon/amazon_resources.h
Expand Up @@ -138,11 +138,11 @@ extern const int HELP1COORDS[2][4];
extern const int RIVER1OBJ[23][4];

extern const int CAST_END_OBJ[26][4];

extern const int CAST_END_OBJ1[4][4];

} // End of namespace Amazon
extern const int RMOUSE[10][2];

} // End of namespace Amazon
} // End of namespace Access

#endif /* ACCESS_AMAZON_RESOURCES_H */
6 changes: 5 additions & 1 deletion engines/access/martian/martian_resources.cpp
Expand Up @@ -753,6 +753,10 @@ const byte ICON_DATA[] = {
0x00, 0x2D, 0x3A
};

} // End of namespace Martian
const int RMOUSE[10][2] = {
{ 7, 36 }, { 38, 68 }, { 70, 99 }, { 102, 125 }, { 128, 152 },
{ 155, 185 }, { 188, 216 }, { 219, 260 }, { 263, 293 }, { 295, 214 }
};

} // End of namespace Martian
} // End of namespace Access
5 changes: 4 additions & 1 deletion engines/access/martian/martian_resources.h
Expand Up @@ -52,8 +52,11 @@ extern const int SIDEOFFD[];

extern const byte CREDIT_DATA[];
extern const byte ICON_DATA[];
} // End of namespace Martian


extern const int RMOUSE[10][2];

} // End of namespace Martian
} // End of namespace Access

#endif /* ACCESS_MARTIAN_RESOURCES_H */
5 changes: 0 additions & 5 deletions engines/access/resources.cpp
Expand Up @@ -59,11 +59,6 @@ const int DIAGOFFULY[] = { 3, 3, 1, 2, 2, 1, 1, 1, 0 };
const int DIAGOFFDLX[] = { 4, 5, 3, 3, 5, 4, 6, 1, 0 };
const int DIAGOFFDLY[] = { 2, 2, 1, 2, 3, 1, 2, 1, 0 };

const int RMOUSE[10][2] = {
{ 0, 35 }, { 0, 0 }, { 36, 70 }, { 71, 106 }, { 107, 141 },
{ 142, 177 }, { 178, 212 }, { 213, 248 }, { 249, 283 }, { 284, 318 }
};

const char *const LOOK_MESSAGE = "LOOKING THERE REVEALS NOTHING OF INTEREST.";
const char *const GET_MESSAGE = "YOU CAN'T TAKE THAT.";
const char *const OPEN_MESSAGE = "THAT DOESN'T OPEN.";
Expand Down
2 changes: 0 additions & 2 deletions engines/access/resources.h
Expand Up @@ -42,8 +42,6 @@ extern const int DIAGOFFULY[];
extern const int DIAGOFFDLX[];
extern const int DIAGOFFDLY[];

extern const int RMOUSE[10][2];

extern const char *const GENERAL_MESSAGES[];

extern const int INVCOORDS[][4];
Expand Down
23 changes: 20 additions & 3 deletions engines/access/room.cpp
Expand Up @@ -38,6 +38,23 @@ Room::Room(AccessEngine *vm) : Manager(vm) {
_selectCommand = 0;
_conFlag = false;
_selectCommand = -1;

switch (vm->getGameID()) {
case GType_Amazon:
for (int i = 0; i < 10; i++) {
_rMouse[i][0] = Amazon::RMOUSE[i][0];
_rMouse[i][1] = Amazon::RMOUSE[i][1];
}
break;
case GType_MartianMemorandum:
for (int i = 0; i < 10; i++) {
_rMouse[i][0] = Martian::RMOUSE[i][0];
_rMouse[i][1] = Martian::RMOUSE[i][1];
}
break;
default:
error("Game not supported");
}
}

Room::~Room() {
Expand Down Expand Up @@ -464,8 +481,8 @@ void Room::doCommands() {
if (_vm->_events->_mouseRow >= 22) {
// Mouse in user interface area
for (commandId = 0; commandId < 10; ++commandId) {
if (_vm->_events->_mousePos.x >= RMOUSE[commandId][0] &&
_vm->_events->_mousePos.x < RMOUSE[commandId][1])
if (_vm->_events->_mousePos.x >= _rMouse[commandId][0] &&
_vm->_events->_mousePos.x < _rMouse[commandId][1])
break;
}
if (commandId < 10)
Expand Down Expand Up @@ -564,7 +581,7 @@ void Room::executeCommand(int commandId) {

// Draw the button as selected
_vm->_screen->plotImage(spr, _selectCommand + 2,
Common::Point(RMOUSE[_selectCommand][0], 176));
Common::Point(_rMouse[_selectCommand][0], (_vm->getGameID() == GType_MartianMemorandum) ? 184 : 176));

_vm->_screen->restoreScreen();
_vm->_boxSelect = true;
Expand Down
1 change: 1 addition & 0 deletions engines/access/room.h
Expand Up @@ -129,6 +129,7 @@ class Room : public Manager {
int _tileSize;
int _selectCommand;
bool _conFlag;
int _rMouse[10][2];
public:
Room(AccessEngine *vm);

Expand Down

0 comments on commit 56754c2

Please sign in to comment.