aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2006-09-07 12:47:42 +0000
committerPaul Gilbert2006-09-07 12:47:42 +0000
commitfa8f6e528b48e3a1e9e2d550b36302794ffa73b2 (patch)
treec3e0314f5c5ccd04f16155c478b0816ddfde0135
parentd9b5129fb8620ec715e3aaa068cfd2a25e197fdd (diff)
downloadscummvm-rg350-fa8f6e528b48e3a1e9e2d550b36302794ffa73b2.tar.gz
scummvm-rg350-fa8f6e528b48e3a1e9e2d550b36302794ffa73b2.tar.bz2
scummvm-rg350-fa8f6e528b48e3a1e9e2d550b36302794ffa73b2.zip
Added method to store a list of English words needed by the game engine
svn-id: r23832
-rw-r--r--tools/create_lure/create_lure_dat.cpp51
-rw-r--r--tools/create_lure/create_lure_dat.h2
2 files changed, 52 insertions, 1 deletions
diff --git a/tools/create_lure/create_lure_dat.cpp b/tools/create_lure/create_lure_dat.cpp
index f22c536912..fbee699565 100644
--- a/tools/create_lure/create_lure_dat.cpp
+++ b/tools/create_lure/create_lure_dat.cpp
@@ -910,6 +910,47 @@ void read_room_exit_hotspots_data(byte *&data, uint16 &totalSize) {
totalSize += sizeof(uint16);
}
+void read_ratpouch_schedules(byte *&data, uint16 &totalSize) {
+ // TODO: Parse out the schedules Ratpouch has for each room
+ data = (byte *) malloc(1);
+ totalSize = 1;
+}
+
+#define NUM_TEXT_ENTRIES 40
+const char *text_strings[NUM_TEXT_ENTRIES] = {
+ "Get", NULL, "Push", "Pull", "Operate", "Open", "Close", "Lock", "Unlock", "Use",
+ "Give", "Talk to", "Tell", "Buy", "Look", "Look at", "Look through", "Ask", NULL,
+ "Drink", "Status", "Go to", "Return", "Bribe", "Examine",
+ "Credits", "Restart game", "Save game", "Restore game", "Quit", "Fast Text", "Slow Text",
+ "Sound on", "Sound off", "(nothing)", " for ", " to ", " on ", "and then", "finish"};
+
+
+void save_text_strings(byte *&data, uint16 &totalSize) {
+ int index;
+
+ // Calculate the total needed space
+ totalSize = sizeof(uint16);
+ for (index = 0; index < NUM_TEXT_ENTRIES; ++index) {
+ if (text_strings[index] != NULL)
+ totalSize += strlen(text_strings[index]);
+ ++totalSize;
+ }
+
+ // Duplicate the text strings list into a data buffer
+ data = (byte *) malloc(totalSize);
+ *((uint16 *) data) = TO_LE_16(NUM_TEXT_ENTRIES);
+ char *p = (char *) data + sizeof(uint16);
+
+ for (index = 0; index < NUM_TEXT_ENTRIES; ++index) {
+ if (text_strings[index] == NULL)
+ *p++ = '\0';
+ else {
+ strcpy(p, text_strings[index]);
+ p += strlen(p) + 1;
+ }
+ }
+}
+
void getEntry(uint8 entryIndex, uint16 &resourceId, byte *&data, uint16 &size)
{
resourceId = 0x3f01 + entryIndex;
@@ -1021,6 +1062,16 @@ void getEntry(uint8 entryIndex, uint16 &resourceId, byte *&data, uint16 &size)
read_room_exit_hotspots_data(data, size);
break;
+ case 21:
+ // Read in Ratpouch's room specific schedules
+ read_ratpouch_schedules(data, size);
+ break;
+
+ case 22:
+ // Set up the list of text strings used by the game
+ save_text_strings(data, size);
+ break;
+
default:
data = NULL;
size = 0;
diff --git a/tools/create_lure/create_lure_dat.h b/tools/create_lure/create_lure_dat.h
index 6348d5c506..c54b7b5b3b 100644
--- a/tools/create_lure/create_lure_dat.h
+++ b/tools/create_lure/create_lure_dat.h
@@ -27,7 +27,7 @@
#include "common/endian.h"
#define VERSION_MAJOR 1
-#define VERSION_MINOR 12
+#define VERSION_MINOR 13
#define ENGLISH_LURE
#define DATA_SEGMENT 0xac50