PRINCE: Inventory - left mouse button handling

This commit is contained in:
lukaslw 2014-06-09 00:57:08 +02:00
parent 3bf8d86a57
commit 98525c1145
5 changed files with 138 additions and 53 deletions

View file

@ -205,6 +205,27 @@ uint8 *Script::getRoomOffset(int locationNr) {
return &_data[_scriptInfo.rooms + locationNr * 64];
}
struct RE {
int16 _mob; // number of Mob, -1 for end of list
int32 _code; // offset of code in script
};
int Script::scanInvObjExamEvents(int mobMask) {
RE tempRE;
int i = 0;
do {
tempRE._mob = (int)READ_UINT16(&_data[_scriptInfo.invObjExam + i * 6]);
debug("mob: %d", tempRE._mob);
tempRE._code = (int)READ_UINT32(&_data[_scriptInfo.invObjExam + i * 6 + 2]);
debug("code: %d", tempRE._code);
if (tempRE._mob == mobMask) {
return tempRE._code;
}
i++;
} while (tempRE._mob != -1); //?? || i <= 1 or without this (no items there)
return -1; // or sth else?
}
void Script::installSingleBackAnim(Common::Array<BackgroundAnim> &_backanimList, int offset) {
BackgroundAnim newBackgroundAnim;