[Scummvm-cvs-logs] SF.net SVN: scummvm: [23832] scummvm/trunk/tools/create_lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Thu Sep 7 14:47:50 CEST 2006
Revision: 23832
http://svn.sourceforge.net/scummvm/?rev=23832&view=rev
Author: dreammaster
Date: 2006-09-07 05:47:42 -0700 (Thu, 07 Sep 2006)
Log Message:
-----------
Added method to store a list of English words needed by the game engine
Modified Paths:
--------------
scummvm/trunk/tools/create_lure/create_lure_dat.cpp
scummvm/trunk/tools/create_lure/create_lure_dat.h
Modified: scummvm/trunk/tools/create_lure/create_lure_dat.cpp
===================================================================
--- scummvm/trunk/tools/create_lure/create_lure_dat.cpp 2006-09-07 11:21:20 UTC (rev 23831)
+++ scummvm/trunk/tools/create_lure/create_lure_dat.cpp 2006-09-07 12:47:42 UTC (rev 23832)
@@ -910,6 +910,47 @@
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 @@
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;
Modified: scummvm/trunk/tools/create_lure/create_lure_dat.h
===================================================================
--- scummvm/trunk/tools/create_lure/create_lure_dat.h 2006-09-07 11:21:20 UTC (rev 23831)
+++ scummvm/trunk/tools/create_lure/create_lure_dat.h 2006-09-07 12:47:42 UTC (rev 23832)
@@ -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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list