From 11a72a5e0e6500294204a985419a83a49331dece Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 11 Oct 2017 14:17:03 -0400 Subject: TITANIC: Add missing strings for Floor & Room # to titanic.dat --- engines/titanic/room_flags.cpp | 13 +++++++++++++ engines/titanic/room_flags.h | 28 +++++++++++----------------- engines/titanic/support/files_manager.cpp | 2 +- engines/titanic/support/strings.h | 2 ++ 4 files changed, 27 insertions(+), 18 deletions(-) (limited to 'engines/titanic') diff --git a/engines/titanic/room_flags.cpp b/engines/titanic/room_flags.cpp index a28a4bd68c..8ca1a9e07d 100644 --- a/engines/titanic/room_flags.cpp +++ b/engines/titanic/room_flags.cpp @@ -22,6 +22,7 @@ #include "titanic/room_flags.h" #include "titanic/titanic.h" +#include "titanic/support/strings.h" namespace Titanic { @@ -440,6 +441,18 @@ void CRoomFlags::changeClass(PassengerClass newClassNum) { setRoomBits(roomNum); } +CString CRoomFlags::getElevatorDesc() const { + return CString::format(g_vm->_strings[ELEVATOR_NUM].c_str(), getElevatorNum()); +} + +CString CRoomFlags::getFloorDesc() const { + return CString::format(g_vm->_strings[FLOOR_NUM].c_str(), getFloorNum()); +} + +CString CRoomFlags::getRoomNumDesc() const { + return CString::format(g_vm->_strings[ROOM_NUM].c_str(), getRoomNum()); +} + bool CRoomFlags::compareClassElevator(uint flags1, uint flags2) { CRoomFlags f1(flags1); CRoomFlags f2(flags2); diff --git a/engines/titanic/room_flags.h b/engines/titanic/room_flags.h index 3ce86bbddd..95b65330cf 100644 --- a/engines/titanic/room_flags.h +++ b/engines/titanic/room_flags.h @@ -123,13 +123,6 @@ public: */ uint getElevatorNum() const { return getElevatorBits() + 1; } - /** - * Get a description for the elevator number - */ - CString getElevatorDesc() const { - return CString::format("Elevator %d", getElevatorNum()); - } - /** * Gets the bits for the passenger class */ @@ -167,13 +160,6 @@ public: */ uint getFloorNum() const; - /** - * Get a description for the floor number - */ - CString getFloorDesc() const { - return CString::format("Floor %d", getFloorNum()); - } - /** * Sets the bits for the room number */ @@ -189,12 +175,20 @@ public: */ uint getRoomNum() const { return getRoomBits(); } + /** + * Get a description for the elevator number + */ + CString getElevatorDesc() const; + + /** + * Get a description for the floor number + */ + CString getFloorDesc() const; + /** * Gets a string for the room number */ - CString getRoomNumDesc() const { - return CString::format("Room %d", getRoomNum()); - } + CString getRoomNumDesc() const; bool getBit0() const; diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp index ce4d0d049f..9a07b68e35 100644 --- a/engines/titanic/support/files_manager.cpp +++ b/engines/titanic/support/files_manager.cpp @@ -50,7 +50,7 @@ bool CFilesManager::loadResourceIndex() { return false; } - if (_version != 4) { + if (_version != 5) { g_vm->GUIError("titanic.dat is out of date"); return false; } diff --git a/engines/titanic/support/strings.h b/engines/titanic/support/strings.h index 1213285b99..0fa807d85f 100644 --- a/engines/titanic/support/strings.h +++ b/engines/titanic/support/strings.h @@ -169,6 +169,8 @@ enum StringId { SAVED_CHEVRON, CURRENT_LOCATION, ELEVATOR_NUM, + FLOOR_NUM, + ROOM_NUM, SHIFT_CLICK_TO_EDIT, A_HOT, A_COLD, -- cgit v1.2.3