diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/core/game_object.cpp | 22 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 10 | ||||
-rw-r--r-- | engines/titanic/core/mail_man.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/core/mail_man.h | 10 | ||||
-rw-r--r-- | engines/titanic/game/chev_code.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/messages/messages.h | 2 | ||||
-rw-r--r-- | engines/titanic/npcs/succubus.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_drag_chev.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_rooms.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_rooms_glyphs.cpp | 2 |
10 files changed, 41 insertions, 40 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 3b9b9f1b46..fc25abc98e 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -64,7 +64,7 @@ CGameObject::CGameObject(): CNamedItem() { _field48 = 0xF0; _field4C = 0xFF; _isMail = false; - _id = 0; + _destRoomFlags = 0; _roomFlags = 0; _visible = true; _field60 = 0; @@ -120,7 +120,7 @@ void CGameObject::save(SimpleFile *file, int indent) { file->writeNumberLine(_fieldB8, indent + 1); file->writeNumberLine(_visible, indent + 1); file->writeNumberLine(_isMail, indent + 1); - file->writeNumberLine(_id, indent + 1); + file->writeNumberLine(_destRoomFlags, indent + 1); file->writeNumberLine(_roomFlags, indent + 1); if (_surface) { @@ -175,7 +175,7 @@ void CGameObject::load(SimpleFile *file) { _fieldB8 = file->readNumber(); _visible = file->readNumber() != 0; _isMail = file->readNumber(); - _id = file->readNumber(); + _destRoomFlags = file->readNumber(); _roomFlags = file->readNumber(); resourceKey.load(file); @@ -1434,27 +1434,27 @@ void CGameObject::addMail(int mailId) { } } -void CGameObject::setMailId(int mailId) { +void CGameObject::setMailDest(uint roomFlags) { CMailMan *mailMan = getMailMan(); if (mailMan) { makeDirty(); - mailMan->setMailId(this, mailId); + mailMan->setMailDest(this, roomFlags); } } -bool CGameObject::mailExists(int id) const { - return findMail(id) != nullptr; +bool CGameObject::mailExists(uint roomFlags) const { + return findMail(roomFlags) != nullptr; } -CGameObject *CGameObject::findMail(int id) const { +CGameObject *CGameObject::findMail(uint roomFlags) const { CMailMan *mailMan = getMailMan(); - return mailMan ? mailMan->findMail(id) : nullptr; + return mailMan ? mailMan->findMail(roomFlags) : nullptr; } -void CGameObject::removeMail(int id, int v) { +void CGameObject::removeMail(uint destRoomFlags, uint newRoomFlags) { CMailMan *mailMan = getMailMan(); if (mailMan) - mailMan->removeMail(id, v); + mailMan->removeMail(destRoomFlags, newRoomFlags); } void CGameObject::resetMail() { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 237450ee2f..8affbd114a 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -486,12 +486,12 @@ protected: /** * Returns true if a mail with a specified Id exists */ - bool mailExists(int id) const; + bool mailExists(uint roomFlags) const; /** * Returns a specified mail, if one exists */ - CGameObject *findMail(int id) const; + CGameObject *findMail(uint roomFlags) const; /** * Resets the Mail Man value @@ -570,7 +570,7 @@ protected: public: Rect _bounds; bool _isMail; - int _id; + uint _destRoomFlags; uint _roomFlags; int _field60; CursorId _cursorId; @@ -729,7 +729,7 @@ public: /** * Sets the mail identifier for an object */ - void setMailId(int mailId); + void setMailDest(uint roomFlags); /** * Returns true if there's an attached surface which has a frame @@ -799,7 +799,7 @@ public: /** * Remove an object from the mail list */ - void removeMail(int id, int v); + void removeMail(uint destRoomFlags, uint newRoomFlags); /** * Return the full Id of the current view in a diff --git a/engines/titanic/core/mail_man.cpp b/engines/titanic/core/mail_man.cpp index 11e17fc4e5..851e52694d 100644 --- a/engines/titanic/core/mail_man.cpp +++ b/engines/titanic/core/mail_man.cpp @@ -47,32 +47,32 @@ CGameObject *CMailMan::getNextObject(CGameObject *prior) const { return dynamic_cast<CGameObject *>(prior->getNextSibling()); } -void CMailMan::addMail(CGameObject *obj, int id) { +void CMailMan::addMail(CGameObject *obj, uint destRoomFlags) { obj->detach(); obj->addUnder(this); - setMailId(obj, id); + setMailDest(obj, destRoomFlags); } -void CMailMan::setMailId(CGameObject *obj, int id) { - obj->_id = id; +void CMailMan::setMailDest(CGameObject *obj, uint roomFlags) { + obj->_destRoomFlags = roomFlags; obj->_roomFlags = 0; obj->_isMail = true; } -CGameObject *CMailMan::findMail(int id) const { +CGameObject *CMailMan::findMail(uint roomFlags) const { for (CGameObject *obj = getFirstObject(); obj; obj = getNextObject(obj)) { - if (obj->_isMail && obj->_id == id) + if (obj->_isMail && obj->_destRoomFlags == roomFlags) return obj; } return nullptr; } -void CMailMan::removeMail(int id, int roomFlags) { +void CMailMan::removeMail(uint destRoomFlags, uint newRoomFlags) { for (CGameObject *obj = getFirstObject(); obj; obj = getNextObject(obj)) { - if (obj->_isMail && obj->_id == id) { + if (obj->_isMail && obj->_destRoomFlags == destRoomFlags) { obj->_isMail = false; - obj->_roomFlags = roomFlags; + obj->_roomFlags = newRoomFlags; break; } } diff --git a/engines/titanic/core/mail_man.h b/engines/titanic/core/mail_man.h index 4c63cdfa13..0a8d5fa90a 100644 --- a/engines/titanic/core/mail_man.h +++ b/engines/titanic/core/mail_man.h @@ -58,22 +58,22 @@ public: /** * Add an object to the mail list */ - void addMail(CGameObject *obj, int id); + void addMail(CGameObject *obj, uint destRoomFlags); /** - * Sets the mail identifier for an object + * Sets the mail destination for an object */ - static void setMailId(CGameObject *obj, int id); + static void setMailDest(CGameObject *obj, uint roomFlags); /** * Scan the mail list for a specified item */ - CGameObject *findMail(int id) const; + CGameObject *findMail(uint roomFlags) const; /** * Remove a mail item */ - void removeMail(int id, int v); + void removeMail(uint destRoomFlags, uint newRoomFlags); void resetValue() { _value = 0; } }; diff --git a/engines/titanic/game/chev_code.cpp b/engines/titanic/game/chev_code.cpp index 9381e1563a..119d82efc0 100644 --- a/engines/titanic/game/chev_code.cpp +++ b/engines/titanic/game/chev_code.cpp @@ -94,8 +94,8 @@ bool CChevCode::SetChevFloorBits(CSetChevFloorBits *msg) { bool CChevCode::SetChevRoomBits(CSetChevRoomBits *msg) { _chevCode &= ~0xff; - if (msg->_roomNum > 0 && msg->_roomNum < 128) - _chevCode |= msg->_roomNum * 2; + if (msg->_roomFlags > 0 && msg->_roomFlags < 128) + _chevCode |= msg->_roomFlags * 2; return true; } diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h index fbe504700b..a40477a702 100644 --- a/engines/titanic/messages/messages.h +++ b/engines/titanic/messages/messages.h @@ -310,7 +310,7 @@ MESSAGE1(CSetChevFloorBits, int, floorNum, 0); MESSAGE1(CSetChevLiftBits, int, liftNum, 0); MESSAGE2(CSetChevPanelBitMsg, int, value1, 0, int, value2, 0); MESSAGE1(CSetChevPanelButtonsMsg, int, chevCode, 0); -MESSAGE1(CSetChevRoomBits, int, roomNum, 0); +MESSAGE1(CSetChevRoomBits, int, roomFlags, 0); MESSAGE1(CSetFrameMsg, int, frameNumber, 0); MESSAGE0(CSetMusicControlsMsg); MESSAGE2(CSetVarMsg, CString, varName, "", int, value, 0); diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp index cb73eba490..574e999b33 100644 --- a/engines/titanic/npcs/succubus.cpp +++ b/engines/titanic/npcs/succubus.cpp @@ -378,7 +378,8 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { if (!pet) return true; - CGameObject *mailObject = findMail(pet->getRoomFlags()); + uint destRoomFlags = pet->getRoomFlags(); + CGameObject *mailObject = findMail(destRoomFlags); if (!mailObject) { switch (getRandomNumber(2)) { case 0: @@ -415,7 +416,7 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { if (_isFeathers) { _field19C = 0; - removeMail(roomFlags, roomFlags); + removeMail(destRoomFlags, roomFlags); pet->phonographAction(""); if (_startFrame2 >= 0) { @@ -609,7 +610,7 @@ bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { if (msg->_endFrame == _endFrame4) { if (pet && _mailP) { - _mailP->setMailId(petRoomFlags); + _mailP->setMailDest(petRoomFlags); } _field188 = 1; @@ -726,7 +727,7 @@ bool CSuccUBus::SUBTransition(CSUBTransition *msg) { bool CSuccUBus::SetChevRoomBits(CSetChevRoomBits *msg) { if (_enabled) { - _roomFlags = msg->_roomNum; + _roomFlags = msg->_roomFlags; playSound("z#98.wav", 100); } diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp index 4fe64283ff..957fe5295c 100644 --- a/engines/titanic/pet_control/pet_drag_chev.cpp +++ b/engines/titanic/pet_control/pet_drag_chev.cpp @@ -57,7 +57,7 @@ bool CPetDragChev::MouseDragEndMsg(CMouseDragEndMsg *msg) { CSuccUBus *succubus = dynamic_cast<CSuccUBus *>(msg->_dropTarget); if (succubus) { - CSetChevRoomBits chevMsg(_id); + CSetChevRoomBits chevMsg(_destRoomFlags); chevMsg.execute(succubus); } else { CPetControl *petControl = getPetControl(); diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp index 6930ecab9d..ebf8381eed 100644 --- a/engines/titanic/pet_control/pet_rooms.cpp +++ b/engines/titanic/pet_control/pet_rooms.cpp @@ -101,7 +101,7 @@ bool CPetRooms::checkDragEnd(CGameObject *item) { if (!item->_isMail) return false; - uint roomFlags = item->_id; + uint roomFlags = item->_destRoomFlags; CPetRoomsGlyph *glyph = _glyphs.findGlyphByFlags(roomFlags); if (glyph) { if (_glyphs.findGlyphByFlags(0)) { diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp index f38ed28a80..e911759f25 100644 --- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp +++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp @@ -123,7 +123,7 @@ bool CPetRoomsGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) { CGameObject *chevron = petControl->getHiddenObject("3PetChevron"); if (chevron) { - chevron->_id = _roomFlags; + chevron->_destRoomFlags = _roomFlags; chevron->_isMail = _mailFlag != 0; petControl->removeFromInventory(chevron, false, false); chevron->loadSurface(); |