diff options
Diffstat (limited to 'engines/lure/res_struct.cpp')
-rw-r--r-- | engines/lure/res_struct.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 01f29b14ce..e94b55b2e4 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -28,11 +28,6 @@ namespace Lure { -const char *actionList[] = {NULL, "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"}; - const Action sortedActions[] = {ASK, BRIBE, BUY, CLOSE, DRINK, EXAMINE, GET, GIVE, GO_TO, LOCK, LOOK, LOOK_AT, LOOK_THROUGH, OPEN, OPERATE, PULL, PUSH, RETURN, STATUS, TALK_TO, TELL, UNLOCK, USE, NONE}; @@ -810,6 +805,31 @@ int PausedCharacterList::check(uint16 charId, int numImpinging, uint16 *impingin return result; } +// String list resource class + +void StringList::load(MemoryBlock *data) { + _data = Memory::allocate(data->size()); + _data->copyFrom(data); + + _numEntries = READ_LE_UINT16(_data->data()); + char *p = (char *) _data->data() + sizeof(uint16); + + _entries = (char **) Memory::alloc(_numEntries * sizeof(char *)); + + for (int index = 0; index < _numEntries; ++index) { + _entries[index] = p; + p += strlen(p) + 1; + } +} + +void StringList::clear() { + if (_numEntries != 0) { + Memory::dealloc(_entries); + delete _data; + _numEntries = 0; + } +} + // Field list and miscellaneous variables ValueTableData::ValueTableData() { |