From 42ac19e8042d12949d21a2b9650f8f12ca76493d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 28 May 2019 21:41:58 +0300 Subject: STARTREK: Start reading text from RDF files, instead of hardcoding it Rooms DEMON0 and DEMON5 have been partially adapted to the new logic. This isn't yet fully functional, for the following reasons: - We only read the main text block. There are also some others which are not handled yet. The unhandled blocks have been kept in text.cpp - We load text in dictionaries, splitting the strings in look and talk. However, there's a third category (look with a talker), which isn't handled yet - Text is loaded per-room, but there are enhancements where text and samples are loaded from other rooms. These need to be refactored --- engines/startrek/room.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'engines/startrek/room.h') diff --git a/engines/startrek/room.h b/engines/startrek/room.h index 33c46ce7d6..8f39b6b33e 100644 --- a/engines/startrek/room.h +++ b/engines/startrek/room.h @@ -26,6 +26,7 @@ #include "common/rect.h" #include "common/ptr.h" #include "common/str.h" +#include "common/hashmap.h" #include "startrek/action.h" #include "startrek/awaymission.h" @@ -36,7 +37,6 @@ using Common::SharedPtr; - namespace StarTrek { class StarTrekEngine; @@ -143,6 +143,8 @@ public: */ Common::Point getSpawnPosition(int crewmanIndex); + int showText(TextRef speaker, TextRef text, bool fromRDF = false); + public: byte *_rdfData; @@ -154,7 +156,10 @@ private: int _numRoomActions; int _roomIndex; // ie. for DEMON2, this is 2 + Common::HashMap _lookMessages; + Common::HashMap _talkMessages; + void loadRoomMessages(); int findFunctionPointer(int action, void (Room::*funcPtr)()); @@ -181,9 +186,8 @@ private: * Cmd 0x03 */ int showRoomSpecificText(const char **textAddr); - int showText(const TextRef *text); - int showText(TextRef speaker, TextRef text); - int showText(TextRef text); + int showText(const TextRef *text, bool fromRDF = false); + int showText(TextRef text, bool fromRDF = false); /** * Cmd 0x04 */ -- cgit v1.2.3