aboutsummaryrefslogtreecommitdiff
path: root/lure/strings.h
diff options
context:
space:
mode:
authorTravis Howell2006-02-11 12:54:56 +0000
committerTravis Howell2006-02-11 12:54:56 +0000
commit6703dc7fa1cd517a96d4f1955ca1794967d2a920 (patch)
treecd3e2ee3053e8a7ffc6ac05c1109bcb5ac1040c5 /lure/strings.h
parentcbb2ca005c8385a25fcf7195319ca909d0f7124b (diff)
downloadscummvm-rg350-6703dc7fa1cd517a96d4f1955ca1794967d2a920.tar.gz
scummvm-rg350-6703dc7fa1cd517a96d4f1955ca1794967d2a920.tar.bz2
scummvm-rg350-6703dc7fa1cd517a96d4f1955ca1794967d2a920.zip
Add patch #1374870 - New Lure of the Temptress module
svn-id: r20536
Diffstat (limited to 'lure/strings.h')
-rw-r--r--lure/strings.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/lure/strings.h b/lure/strings.h
new file mode 100644
index 0000000000..03c1da2440
--- /dev/null
+++ b/lure/strings.h
@@ -0,0 +1,67 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2005-2006 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef __lure_strings_h__
+#define __lure_strings_h__
+
+#include "lure/luredefs.h"
+#include "lure/memory.h"
+
+namespace Lure {
+
+class CharacterEntry {
+public:
+ uint8 _numBits;
+ uint32 _sequence;
+ char _ascii;
+
+ CharacterEntry(uint8 numBits, uint32 sequence, char ascii): _numBits(numBits),
+ _sequence(sequence), _ascii(ascii) {};
+};
+
+#define MAX_NUM_CHARS 218
+
+class StringData {
+private:
+ MemoryBlock *_strings[3];
+ MemoryBlock *_names;
+ CharacterEntry *_chars[MAX_NUM_CHARS];
+ uint8 _numChars;
+ byte *_srcPos;
+ byte _bitMask;
+
+ void add(const char *sequence, char ascii);
+ void initPosition(uint16 stringId);
+ char readCharacter();
+ byte readBit();
+public:
+ StringData();
+ ~StringData();
+ static StringData &getReference();
+
+ void getString(uint16 stringId, char *dest, const char *hotspotName, const char *actionName);
+ char *getName(uint8 nameIndex);
+};
+
+} // namespace Lure
+
+#endif