aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/room.h
diff options
context:
space:
mode:
authorFilippos Karapetis2019-05-28 21:41:58 +0300
committerFilippos Karapetis2019-05-28 21:41:58 +0300
commit42ac19e8042d12949d21a2b9650f8f12ca76493d (patch)
tree3e0762b27142aa682973967526e792fcc95cfffb /engines/startrek/room.h
parent310377033f334779dc39261c9cd20a295bb1cc04 (diff)
downloadscummvm-rg350-42ac19e8042d12949d21a2b9650f8f12ca76493d.tar.gz
scummvm-rg350-42ac19e8042d12949d21a2b9650f8f12ca76493d.tar.bz2
scummvm-rg350-42ac19e8042d12949d21a2b9650f8f12ca76493d.zip
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
Diffstat (limited to 'engines/startrek/room.h')
-rw-r--r--engines/startrek/room.h12
1 files changed, 8 insertions, 4 deletions
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<int, Common::String> _lookMessages;
+ Common::HashMap<int, Common::String> _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
*/