aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/core')
-rw-r--r--engines/titanic/core/game_object.cpp22
-rw-r--r--engines/titanic/core/game_object.h10
-rw-r--r--engines/titanic/core/mail_man.cpp18
-rw-r--r--engines/titanic/core/mail_man.h10
4 files changed, 30 insertions, 30 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; }
};