diff options
author | Paul Gilbert | 2017-01-22 11:08:04 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-01-22 11:08:04 -0500 |
commit | 54c6f27a60e0068385a94ebab321f305db65387c (patch) | |
tree | 8e1f8e927eef321e569b2a43d2db01af39d209aa /engines/titanic/core | |
parent | 92ec3a470a8df2fab6aae5caab5105a617a37818 (diff) | |
download | scummvm-rg350-54c6f27a60e0068385a94ebab321f305db65387c.tar.gz scummvm-rg350-54c6f27a60e0068385a94ebab321f305db65387c.tar.bz2 scummvm-rg350-54c6f27a60e0068385a94ebab321f305db65387c.zip |
TITANIC: Added RoomFlagsComparison enum
Diffstat (limited to 'engines/titanic/core')
-rw-r--r-- | engines/titanic/core/game_object.cpp | 14 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 8 |
2 files changed, 13 insertions, 9 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index beee255c2d..af7020532c 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -960,14 +960,14 @@ CGameObject *CGameObject::getMailManNextObject(CGameObject *prior) const { return mailMan ? mailMan->getNextObject(prior) : nullptr; } -CGameObject *CGameObject::findMailByFlags(int mode, uint roomFlags) { +CGameObject *CGameObject::findMailByFlags(RoomFlagsComparison compareType, uint roomFlags) { CMailMan *mailMan = getMailMan(); if (!mailMan) return nullptr; for (CGameObject *obj = mailMan->getFirstObject(); obj; obj = mailMan->getNextObject(obj)) { - if (compareRoomFlags(mode, roomFlags, obj->_roomFlags)) + if (compareRoomFlags(compareType, roomFlags, obj->_roomFlags)) return obj; } @@ -1413,15 +1413,15 @@ Common::SeekableReadStream *CGameObject::getResource(const CString &name) { return g_vm->_filesManager->getResource(name); } -bool CGameObject::compareRoomFlags(int mode, uint flags1, uint flags2) { - switch (mode) { - case 1: +bool CGameObject::compareRoomFlags(RoomFlagsComparison compareType, uint flags1, uint flags2) { + switch (compareType) { + case RFC_LOCATION: return CRoomFlags::compareLocation(flags1, flags2); - case 2: + case RFC_CLASS_ELEVATOR: return CRoomFlags::compareClassElevator(flags1, flags2); - case 3: + case RFC_TITANIA: return CRoomFlags::isTitania(flags1, flags2); default: diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 629c6a038d..30b3321128 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -41,6 +41,7 @@ namespace Titanic { enum Find { FIND_GLOBAL = 1, FIND_ROOM = 2, FIND_PET = 4, FIND_MAILMAN = 8 }; enum Found { FOUND_NONE = 0, FOUND_GLOBAL = 1, FOUND_ROOM = 2, FOUND_PET = 3, FOUND_MAILMAN = 4 }; +enum RoomFlagsComparison { RFC_LOCATION = 1, RFC_CLASS_ELEVATOR = 2, RFC_TITANIA = 3 }; class CDontSaveFileItem; class CMailMan; @@ -337,7 +338,7 @@ protected: /** * Find mail by room flags */ - CGameObject *findMailByFlags(int mode, uint roomFlags); + CGameObject *findMailByFlags(RoomFlagsComparison compareType, uint roomFlags); /** * Find next mail from a given prior one @@ -712,7 +713,10 @@ public: */ CGameObject *getDraggingObject() const; - bool compareRoomFlags(int mode, uint flags1, uint flags2); + /** + * Compares two sets of room flags together + */ + static bool compareRoomFlags(RoomFlagsComparison compareType, uint flags1, uint flags2); /*--- Text display methods ---*/ |