2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2006-02-11 12:54:56 +00:00
|
|
|
*
|
|
|
|
* 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$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-07-23 15:32:14 +00:00
|
|
|
#ifndef LURE_RESSTRUCT_H
|
|
|
|
#define LURE_RESSTRUCT_H
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
#include "lure/luredefs.h"
|
|
|
|
#include "common/list.h"
|
2006-10-02 12:48:56 +00:00
|
|
|
#include "common/file.h"
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
namespace Lure {
|
|
|
|
|
2006-04-11 10:43:53 +00:00
|
|
|
using namespace Common;
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
/* Structure definitions */
|
|
|
|
/* */
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
|
2006-07-23 16:13:26 +00:00
|
|
|
#include "common/pack-start.h" // START STRUCT PACKING
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-02-19 04:15:33 +00:00
|
|
|
struct VersionStructure {
|
|
|
|
uint16 id;
|
|
|
|
byte vMajor;
|
|
|
|
byte vMinor;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-19 04:15:33 +00:00
|
|
|
|
|
|
|
struct FileEntry {
|
|
|
|
uint16 id;
|
|
|
|
byte unused;
|
|
|
|
byte sizeExtension;
|
|
|
|
uint16 size;
|
|
|
|
uint16 offset;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-19 04:15:33 +00:00
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
struct HotspotResource {
|
|
|
|
uint16 hotspotId;
|
|
|
|
uint16 nameId;
|
|
|
|
uint16 descId;
|
|
|
|
uint16 descId2;
|
|
|
|
uint32 actions;
|
|
|
|
uint16 actionsOffset;
|
|
|
|
uint16 roomNumber;
|
|
|
|
byte layer;
|
|
|
|
byte scriptLoadFlag;
|
|
|
|
uint16 loadOffset;
|
2006-02-19 04:15:33 +00:00
|
|
|
uint16 startX;
|
|
|
|
uint16 startY;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 width;
|
|
|
|
uint16 height;
|
2006-02-19 04:15:33 +00:00
|
|
|
uint16 widthCopy;
|
|
|
|
uint16 heightCopy;
|
2006-04-11 10:43:53 +00:00
|
|
|
uint16 yCorrection;
|
2006-04-29 11:15:03 +00:00
|
|
|
int16 walkX;
|
|
|
|
uint16 walkY;
|
2006-02-19 04:15:33 +00:00
|
|
|
int8 talkX;
|
|
|
|
int8 talkY;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 colourOffset;
|
|
|
|
uint16 animRecordId;
|
2007-04-29 11:30:29 +00:00
|
|
|
uint16 hotspotScriptOffset;
|
|
|
|
uint16 talkScriptOffset;
|
2007-09-23 22:17:57 +00:00
|
|
|
uint16 tickProcId;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 tickTimeout;
|
2007-04-29 11:30:29 +00:00
|
|
|
uint16 tickScriptOffset;
|
2006-05-23 12:37:43 +00:00
|
|
|
uint16 npcSchedule;
|
2006-07-08 08:36:32 +00:00
|
|
|
uint16 characterMode;
|
|
|
|
uint16 delayCtr;
|
2006-07-23 13:19:33 +00:00
|
|
|
byte flags2;
|
|
|
|
byte hdrFlags;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
struct HotspotAnimResource {
|
|
|
|
uint16 animRecordId;
|
|
|
|
uint16 animId;
|
|
|
|
uint16 flags;
|
|
|
|
uint16 upOffset;
|
|
|
|
uint16 downOffset;
|
|
|
|
uint16 leftOffset;
|
|
|
|
uint16 rightOffset;
|
|
|
|
uint8 upFrame;
|
|
|
|
uint8 downFrame;
|
|
|
|
uint8 leftFrame;
|
|
|
|
uint8 rightFrame;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
struct MovementResource {
|
|
|
|
uint16 frameNumber;
|
|
|
|
int16 xChange;
|
|
|
|
int16 yChange;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-05-23 12:37:43 +00:00
|
|
|
struct RoomRect {
|
|
|
|
int16 xs, xe;
|
|
|
|
int16 ys, ye;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
struct RoomResource {
|
|
|
|
uint16 roomNumber;
|
2006-08-27 11:38:55 +00:00
|
|
|
uint8 hdrFlags;
|
|
|
|
uint8 unused;
|
|
|
|
uint32 actions;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 descId;
|
|
|
|
uint16 numLayers;
|
|
|
|
uint16 layers[4];
|
|
|
|
uint16 sequenceOffset;
|
2006-02-19 04:15:33 +00:00
|
|
|
int16 clippingXStart;
|
|
|
|
int16 clippingXEnd;
|
2007-06-22 12:36:04 +00:00
|
|
|
uint32 exitTime;
|
|
|
|
uint8 areaFlag;
|
2006-05-23 12:37:43 +00:00
|
|
|
RoomRect walkBounds;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 numExits;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
struct RoomExitResource {
|
|
|
|
int16 xs, xe, ys, ye;
|
|
|
|
uint16 sequenceOffset;
|
|
|
|
uint8 newRoom;
|
|
|
|
uint8 direction;
|
|
|
|
int16 newRoomX, newRoomY;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
struct HotspotOverrideResource {
|
|
|
|
uint16 hotspotId;
|
|
|
|
int16 xs, xe, ys, ye;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-02-19 04:15:33 +00:00
|
|
|
struct RoomExitHotspotResource {
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 hotspotId;
|
|
|
|
int16 xs, xe;
|
|
|
|
int16 ys, ye;
|
|
|
|
uint16 cursorNum;
|
|
|
|
uint16 destRoomNumber;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-02-19 04:15:33 +00:00
|
|
|
struct RoomExitJoinResource {
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 hotspot1Id;
|
|
|
|
byte h1CurrentFrame;
|
|
|
|
byte h1DestFrame;
|
2006-04-11 10:43:53 +00:00
|
|
|
uint8 h1OpenSound;
|
|
|
|
uint8 h1CloseSound;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 hotspot2Id;
|
|
|
|
byte h2CurrentFrame;
|
|
|
|
byte h2DestFrame;
|
2006-04-11 10:43:53 +00:00
|
|
|
uint8 h2OpenSound;
|
|
|
|
uint8 h2CloseSound;
|
2006-02-11 12:54:56 +00:00
|
|
|
byte blocked;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-02-19 04:15:33 +00:00
|
|
|
struct HotspotActionResource {
|
2006-02-11 12:54:56 +00:00
|
|
|
byte action;
|
|
|
|
uint16 sequenceOffset;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-02-19 04:15:33 +00:00
|
|
|
struct TalkHeaderResource {
|
|
|
|
uint16 hotspotId;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 offset;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-02-19 04:15:33 +00:00
|
|
|
struct TalkDataHeaderResource {
|
|
|
|
uint16 recordId;
|
|
|
|
uint16 listOffset;
|
|
|
|
uint16 responsesOffset;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-19 04:15:33 +00:00
|
|
|
|
|
|
|
struct TalkDataResource {
|
|
|
|
uint16 preSequenceId;
|
|
|
|
uint16 descId;
|
|
|
|
uint16 postSequenceId;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-19 04:15:33 +00:00
|
|
|
|
|
|
|
struct TalkResponseResource {
|
|
|
|
uint16 sequenceId1;
|
|
|
|
uint16 sequenceId2;
|
|
|
|
uint16 sequenceId3;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2006-04-11 10:43:53 +00:00
|
|
|
struct RoomExitCoordinateResource {
|
|
|
|
int16 x;
|
|
|
|
int16 y;
|
|
|
|
uint16 roomNumber;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-04-11 10:43:53 +00:00
|
|
|
|
|
|
|
#define ROOM_EXIT_COORDINATES_NUM_ENTRIES 6
|
|
|
|
#define ROOM_EXIT_COORDINATES_NUM_ROOMS 52
|
|
|
|
|
|
|
|
struct RoomExitCoordinateEntryResource {
|
|
|
|
uint8 roomIndex[ROOM_EXIT_COORDINATES_NUM_ROOMS];
|
2007-06-22 12:36:04 +00:00
|
|
|
RoomExitCoordinateResource entries[ROOM_EXIT_COORDINATES_NUM_ENTRIES];
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-04-11 10:43:53 +00:00
|
|
|
|
2006-05-23 12:37:43 +00:00
|
|
|
#define MAX_SCHEDULE_ENTRY_PARAMS 5
|
|
|
|
|
|
|
|
struct CharacterScheduleResource {
|
|
|
|
uint16 action;
|
|
|
|
uint16 params[MAX_SCHEDULE_ENTRY_PARAMS];
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-05-23 12:37:43 +00:00
|
|
|
|
|
|
|
struct RoomExitIndexedHotspotResource {
|
|
|
|
uint8 roomNumber;
|
|
|
|
uint8 hotspotIndex;
|
|
|
|
uint16 hotspotId;
|
2007-07-01 18:18:43 +00:00
|
|
|
} PACKED_STRUCT;
|
2006-05-23 12:37:43 +00:00
|
|
|
|
2007-08-12 11:16:43 +00:00
|
|
|
enum SoundDescFlags {SF_IN_USE = 1, SF_RESTORE = 2};
|
|
|
|
|
|
|
|
// In desc entry, numChannels: bits 0-1 # roland, bits 2-3 #adlib, bits 4-5 #internal
|
|
|
|
|
|
|
|
struct SoundDescResource {
|
|
|
|
uint8 soundNumber;
|
|
|
|
uint8 channel;
|
|
|
|
uint8 numChannels;
|
|
|
|
uint8 flags;
|
|
|
|
uint8 volume;
|
|
|
|
} PACKED_STRUCT;
|
|
|
|
|
2006-07-23 16:13:26 +00:00
|
|
|
#include "common/pack-end.h" // END STRUCT PACKING
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2007-02-09 17:47:55 +00:00
|
|
|
/**
|
|
|
|
* Class template for a derived list that destroys the contained
|
|
|
|
* object when the record containing it is destroyed. It's not
|
|
|
|
* perfect, since the underlying list doesn't have virtual
|
|
|
|
* methods, but it's sufficient for my usage.
|
|
|
|
*/
|
2006-02-11 12:54:56 +00:00
|
|
|
template <class T>
|
|
|
|
class ManagedList: public Common::List<T> {
|
2006-03-09 13:54:36 +00:00
|
|
|
typedef typename Common::List<T> Common_List;
|
2006-02-11 12:54:56 +00:00
|
|
|
public:
|
|
|
|
~ManagedList() {
|
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void clear() {
|
2007-09-16 04:03:50 +00:00
|
|
|
typename Common_List::iterator i = Common_List::begin();
|
|
|
|
while (i != Common_List::end()) {
|
|
|
|
T v = *i;
|
|
|
|
i = Common_List::erase(i);
|
|
|
|
delete v;
|
|
|
|
}
|
2006-02-11 12:54:56 +00:00
|
|
|
}
|
|
|
|
|
2007-09-16 04:03:50 +00:00
|
|
|
typename Common_List::iterator erase(typename Common_List::iterator pos) {
|
|
|
|
T obj = *pos;
|
|
|
|
typename Common_List::iterator result = Common_List::erase(pos);
|
|
|
|
delete obj;
|
|
|
|
return result;
|
2006-02-11 12:54:56 +00:00
|
|
|
}
|
|
|
|
|
2007-09-16 04:03:50 +00:00
|
|
|
typename Common_List::iterator erase(typename Common_List::iterator first,
|
|
|
|
typename Common_List::iterator last) {
|
|
|
|
|
|
|
|
while (first != last)
|
|
|
|
erase(first++);
|
|
|
|
|
|
|
|
return last;
|
2006-02-11 12:54:56 +00:00
|
|
|
}
|
2007-09-23 22:17:57 +00:00
|
|
|
|
|
|
|
T operator[](int index) {
|
|
|
|
typename Common_List::iterator i = Common_List::begin();
|
|
|
|
while (index-- > 0)
|
|
|
|
++i;
|
|
|
|
return *i;
|
|
|
|
}
|
2006-02-11 12:54:56 +00:00
|
|
|
};
|
|
|
|
|
2007-02-09 17:47:55 +00:00
|
|
|
/** Enumeration used for direction facings */
|
2006-02-11 12:54:56 +00:00
|
|
|
enum Direction {UP, DOWN, LEFT, RIGHT, NO_DIRECTION};
|
|
|
|
|
|
|
|
// Support classes to hold loaded resources
|
|
|
|
|
|
|
|
class RoomExitHotspotData {
|
|
|
|
public:
|
2006-02-19 04:15:33 +00:00
|
|
|
RoomExitHotspotData(RoomExitHotspotResource *rec);
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
uint16 hotspotId;
|
|
|
|
int16 xs, xe;
|
|
|
|
int16 ys, ye;
|
|
|
|
uint16 cursorNum;
|
|
|
|
uint16 destRoomNumber;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef ManagedList<RoomExitHotspotData *> RoomExitHotspotList;
|
|
|
|
|
|
|
|
class RoomExitData {
|
|
|
|
public:
|
|
|
|
RoomExitData(RoomExitResource *rec);
|
|
|
|
bool insideRect(int16 xp, int16 yp);
|
|
|
|
|
|
|
|
int16 xs, xe, ys, ye;
|
|
|
|
uint16 sequenceOffset;
|
|
|
|
Direction direction;
|
|
|
|
uint8 roomNumber;
|
|
|
|
uint16 x, y;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RoomExitList: public ManagedList<RoomExitData *> {
|
|
|
|
public:
|
|
|
|
RoomExitData *checkExits(int16 xp, int16 yp);
|
|
|
|
};
|
|
|
|
|
2006-04-11 10:43:53 +00:00
|
|
|
#define ROOM_PATHS_WIDTH 40
|
|
|
|
#define ROOM_PATHS_HEIGHT 24
|
|
|
|
#define ROOM_PATHS_SIZE (ROOM_PATHS_WIDTH / 8 * ROOM_PATHS_HEIGHT)
|
|
|
|
#define DECODED_PATHS_WIDTH 42
|
|
|
|
#define DECODED_PATHS_HEIGHT 26
|
|
|
|
|
|
|
|
typedef uint16 RoomPathsDecompressedData[DECODED_PATHS_WIDTH * DECODED_PATHS_HEIGHT];
|
|
|
|
|
|
|
|
class RoomPathsData {
|
|
|
|
private:
|
|
|
|
byte _data[ROOM_PATHS_HEIGHT * ROOM_PATHS_WIDTH];
|
|
|
|
public:
|
2007-04-26 19:08:53 +00:00
|
|
|
RoomPathsData() {}
|
2006-04-11 10:43:53 +00:00
|
|
|
RoomPathsData(byte *srcData) { load(srcData); }
|
|
|
|
|
|
|
|
void load(byte *srcData) {
|
|
|
|
memcpy(_data, srcData, ROOM_PATHS_SIZE);
|
|
|
|
}
|
2007-05-20 07:25:53 +00:00
|
|
|
const byte *data() { return _data; }
|
2006-04-11 10:43:53 +00:00
|
|
|
bool isOccupied(int x, int y);
|
2007-05-05 01:00:01 +00:00
|
|
|
bool isOccupied(int x, int y, int width);
|
2006-04-11 10:43:53 +00:00
|
|
|
void setOccupied(int x, int y, int width);
|
|
|
|
void clearOccupied(int x, int y, int width);
|
|
|
|
void decompress(RoomPathsDecompressedData &dataOut, int characterWidth);
|
|
|
|
};
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
#define MAX_NUM_LAYERS 4
|
|
|
|
|
|
|
|
class RoomData {
|
|
|
|
public:
|
2006-04-11 10:43:53 +00:00
|
|
|
RoomData(RoomResource *rec, MemoryBlock *pathData);
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
uint16 roomNumber;
|
2006-08-27 11:38:55 +00:00
|
|
|
uint8 hdrFlags;
|
|
|
|
uint8 flags;
|
|
|
|
uint32 actions;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 descId;
|
|
|
|
uint16 numLayers;
|
|
|
|
uint16 layers[MAX_NUM_LAYERS];
|
|
|
|
uint16 sequenceOffset;
|
2006-02-19 04:15:33 +00:00
|
|
|
int16 clippingXStart;
|
|
|
|
int16 clippingXEnd;
|
2007-06-22 12:36:04 +00:00
|
|
|
uint8 areaFlag;
|
|
|
|
uint32 exitTime;
|
2006-05-23 12:37:43 +00:00
|
|
|
Common::Rect walkBounds;
|
2006-02-11 12:54:56 +00:00
|
|
|
RoomExitHotspotList exitHotspots;
|
|
|
|
RoomExitList exits;
|
2006-04-11 10:43:53 +00:00
|
|
|
RoomPathsData paths;
|
2006-02-11 12:54:56 +00:00
|
|
|
};
|
|
|
|
|
2007-05-20 07:25:53 +00:00
|
|
|
class RoomDataList: public ManagedList<RoomData *> {
|
|
|
|
public:
|
|
|
|
void saveToStream(WriteStream *stream);
|
|
|
|
void loadFromStream(ReadStream *stream);
|
|
|
|
};
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2007-08-12 11:16:43 +00:00
|
|
|
struct RoomExitJoinStruct {
|
|
|
|
uint16 hotspotId;
|
|
|
|
byte currentFrame;
|
|
|
|
byte destFrame;
|
|
|
|
uint8 openSound;
|
|
|
|
uint8 closeSound;
|
|
|
|
};
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
class RoomExitJoinData {
|
|
|
|
public:
|
2006-02-19 04:15:33 +00:00
|
|
|
RoomExitJoinData(RoomExitJoinResource *rec);
|
2006-02-11 12:54:56 +00:00
|
|
|
|
2007-08-12 11:16:43 +00:00
|
|
|
RoomExitJoinStruct hotspots[2];
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
byte blocked;
|
|
|
|
};
|
|
|
|
|
2007-05-07 12:10:32 +00:00
|
|
|
class RoomExitJoinList: public ManagedList<RoomExitJoinData *> {
|
|
|
|
public:
|
|
|
|
void saveToStream(WriteStream *stream);
|
|
|
|
void loadFromStream(ReadStream *stream);
|
|
|
|
};
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
class HotspotActionData {
|
|
|
|
public:
|
2006-02-19 04:15:33 +00:00
|
|
|
HotspotActionData(HotspotActionResource *rec);
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
Action action;
|
|
|
|
uint16 sequenceOffset;
|
|
|
|
};
|
|
|
|
|
|
|
|
class HotspotActionList: public ManagedList<HotspotActionData *> {
|
|
|
|
public:
|
|
|
|
uint16 recordId;
|
|
|
|
|
|
|
|
HotspotActionList(uint16 id, byte *data);
|
|
|
|
uint16 getActionOffset(Action action);
|
|
|
|
};
|
|
|
|
|
|
|
|
class HotspotActionSet: public ManagedList<HotspotActionList *> {
|
|
|
|
public:
|
|
|
|
HotspotActionList *getActions(uint16 recordId);
|
|
|
|
};
|
|
|
|
|
2006-07-08 08:36:32 +00:00
|
|
|
enum CharacterMode {CHARMODE_NONE, CHARMODE_HESITATE, CHARMODE_IDLE, CHARMODE_PAUSED,
|
2007-04-14 11:00:29 +00:00
|
|
|
CHARMODE_WAIT_FOR_PLAYER, CHARMODE_CONVERSING, CHARMODE_PLAYER_WAIT,
|
|
|
|
CHARMODE_WAIT_FOR_INTERACT, CHARMODE_INTERACTING, CHARMODE_SPECIAL_PLAYER};
|
2006-07-08 08:36:32 +00:00
|
|
|
|
|
|
|
enum BlockedState {BS_NONE, BS_INITIAL, BS_FINAL};
|
2006-05-29 08:12:07 +00:00
|
|
|
|
2007-01-31 02:28:04 +00:00
|
|
|
enum VariantBool {VB_INITIAL, VB_FALSE, VB_TRUE};
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
class HotspotData {
|
|
|
|
public:
|
|
|
|
HotspotData(HotspotResource *rec);
|
|
|
|
|
|
|
|
uint16 hotspotId;
|
|
|
|
uint16 nameId;
|
|
|
|
uint16 descId;
|
|
|
|
uint16 descId2;
|
|
|
|
uint32 actions;
|
|
|
|
uint16 actionsOffset;
|
|
|
|
byte flags;
|
|
|
|
uint16 roomNumber;
|
|
|
|
byte layer;
|
|
|
|
byte scriptLoadFlag;
|
|
|
|
uint16 loadOffset;
|
|
|
|
int16 startX;
|
|
|
|
int16 startY;
|
|
|
|
uint16 width;
|
|
|
|
uint16 height;
|
2006-02-19 04:15:33 +00:00
|
|
|
uint16 widthCopy;
|
|
|
|
uint16 heightCopy;
|
2006-04-11 10:43:53 +00:00
|
|
|
uint16 yCorrection;
|
2006-04-29 11:15:03 +00:00
|
|
|
int16 walkX;
|
|
|
|
uint16 walkY;
|
2006-02-19 04:15:33 +00:00
|
|
|
int8 talkX;
|
|
|
|
int8 talkY;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 colourOffset;
|
|
|
|
uint16 animRecordId;
|
2007-04-29 11:30:29 +00:00
|
|
|
uint16 hotspotScriptOffset;
|
|
|
|
uint16 talkScriptOffset;
|
2007-09-23 22:17:57 +00:00
|
|
|
uint16 tickProcId;
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 tickTimeout;
|
2007-04-29 11:30:29 +00:00
|
|
|
uint16 tickScriptOffset;
|
2006-05-29 08:12:07 +00:00
|
|
|
uint16 npcSchedule;
|
|
|
|
CharacterMode characterMode;
|
2006-07-08 08:36:32 +00:00
|
|
|
uint16 delayCtr;
|
2006-07-23 13:19:33 +00:00
|
|
|
uint8 flags2;
|
|
|
|
uint8 headerFlags;
|
2006-07-08 08:36:32 +00:00
|
|
|
|
|
|
|
// Runtime fields
|
|
|
|
uint16 actionCtr;
|
|
|
|
BlockedState blockedState;
|
2007-02-09 10:58:06 +00:00
|
|
|
bool blockedFlag;
|
2007-01-31 02:28:04 +00:00
|
|
|
VariantBool coveredFlag;
|
2006-07-08 08:36:32 +00:00
|
|
|
uint16 talkMessageId;
|
2006-08-07 13:26:30 +00:00
|
|
|
uint16 talkDestCharacterId;
|
2006-07-08 08:36:32 +00:00
|
|
|
uint16 talkCountdown;
|
|
|
|
uint16 pauseCtr;
|
2007-04-19 06:46:56 +00:00
|
|
|
uint16 useHotspotId;
|
|
|
|
uint16 talkGate;
|
2006-08-27 11:38:55 +00:00
|
|
|
uint16 actionHotspotId;
|
2007-02-26 02:50:23 +00:00
|
|
|
uint16 talkOverride;
|
2007-08-05 02:56:51 +00:00
|
|
|
uint16 scriptHotspotId;
|
2007-04-19 06:46:56 +00:00
|
|
|
|
2006-04-11 10:43:53 +00:00
|
|
|
void enable() { flags |= 0x80; }
|
|
|
|
void disable() { flags &= 0x7F; }
|
2006-04-29 11:15:03 +00:00
|
|
|
Direction nonVisualDirection() { return (Direction) scriptLoadFlag; }
|
2006-10-02 12:48:56 +00:00
|
|
|
void saveToStream(WriteStream *stream);
|
|
|
|
void loadFromStream(ReadStream *stream);
|
2006-02-11 12:54:56 +00:00
|
|
|
};
|
|
|
|
|
2006-10-02 12:48:56 +00:00
|
|
|
class HotspotDataList: public ManagedList<HotspotData *> {
|
|
|
|
public:
|
|
|
|
void saveToStream(WriteStream *stream);
|
|
|
|
void loadFromStream(ReadStream *stream);
|
|
|
|
};
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
class HotspotOverrideData {
|
|
|
|
public:
|
|
|
|
HotspotOverrideData(HotspotOverrideResource *rec);
|
|
|
|
|
|
|
|
uint16 hotspotId;
|
|
|
|
int16 xs, xe, ys, ye;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef ManagedList<HotspotOverrideData *> HotspotOverrideList;
|
|
|
|
|
|
|
|
class MovementData {
|
|
|
|
public:
|
|
|
|
MovementData(MovementResource *);
|
|
|
|
|
|
|
|
uint16 frameNumber;
|
|
|
|
int16 xChange;
|
|
|
|
int16 yChange;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MovementDataList: public ManagedList<MovementData *> {
|
|
|
|
public:
|
|
|
|
bool getFrame(uint16 currentFrame, int16 &xChange, int16 &yChange,
|
|
|
|
uint16 &nextFrame);
|
|
|
|
};
|
|
|
|
|
|
|
|
class HotspotAnimData {
|
|
|
|
public:
|
|
|
|
HotspotAnimData(HotspotAnimResource *rec);
|
|
|
|
|
|
|
|
uint16 animRecordId;
|
|
|
|
uint16 animId;
|
|
|
|
uint16 flags;
|
|
|
|
uint8 upFrame;
|
|
|
|
uint8 downFrame;
|
|
|
|
uint8 leftFrame;
|
|
|
|
uint8 rightFrame;
|
|
|
|
|
|
|
|
MovementDataList leftFrames, rightFrames;
|
|
|
|
MovementDataList upFrames, downFrames;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef ManagedList<HotspotAnimData *> HotspotAnimList;
|
|
|
|
|
2006-02-19 04:15:33 +00:00
|
|
|
// Talk header list
|
|
|
|
|
|
|
|
class TalkHeaderData {
|
|
|
|
private:
|
|
|
|
uint16 *_data;
|
|
|
|
int _numEntries;
|
|
|
|
public:
|
|
|
|
TalkHeaderData(uint16 charId, uint16 *entries);
|
|
|
|
~TalkHeaderData();
|
|
|
|
|
|
|
|
uint16 characterId;
|
|
|
|
uint16 getEntry(int index);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef ManagedList<TalkHeaderData *> TalkHeaderList;
|
|
|
|
|
|
|
|
class TalkEntryData {
|
|
|
|
public:
|
|
|
|
TalkEntryData(TalkDataResource *rec);
|
|
|
|
|
|
|
|
uint16 preSequenceId;
|
|
|
|
uint16 descId;
|
|
|
|
uint16 postSequenceId;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef ManagedList<TalkEntryData *> TalkEntryList;
|
|
|
|
|
2006-04-11 10:43:53 +00:00
|
|
|
class TalkData {
|
2006-02-19 04:15:33 +00:00
|
|
|
public:
|
|
|
|
TalkData(uint16 id);
|
|
|
|
~TalkData();
|
|
|
|
|
|
|
|
uint16 recordId;
|
|
|
|
TalkEntryList entries;
|
|
|
|
TalkEntryList responses;
|
|
|
|
|
|
|
|
TalkEntryData *getResponse(int index);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef ManagedList<TalkData *> TalkDataList;
|
|
|
|
|
2006-04-11 10:43:53 +00:00
|
|
|
struct RoomExitCoordinateData {
|
|
|
|
int16 x;
|
|
|
|
int16 y;
|
|
|
|
uint16 roomNumber;
|
2006-05-23 12:37:43 +00:00
|
|
|
byte hotspotIndexId;
|
2006-04-11 10:43:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class RoomExitCoordinates {
|
|
|
|
private:
|
|
|
|
RoomExitCoordinateData _entries[ROOM_EXIT_COORDINATES_NUM_ENTRIES];
|
|
|
|
uint8 _roomIndex[ROOM_EXIT_COORDINATES_NUM_ROOMS];
|
|
|
|
public:
|
|
|
|
RoomExitCoordinates(RoomExitCoordinateEntryResource *rec);
|
|
|
|
RoomExitCoordinateData &getData(uint16 destRoomNumber);
|
|
|
|
};
|
|
|
|
|
|
|
|
class RoomExitCoordinatesList: public ManagedList<RoomExitCoordinates *> {
|
|
|
|
public:
|
|
|
|
RoomExitCoordinates &getEntry(uint16 roomNumber);
|
|
|
|
};
|
|
|
|
|
2006-05-23 12:37:43 +00:00
|
|
|
class RoomExitIndexedHotspotData {
|
|
|
|
public:
|
|
|
|
RoomExitIndexedHotspotData(RoomExitIndexedHotspotResource *rec);
|
|
|
|
|
|
|
|
uint16 roomNumber;
|
|
|
|
uint8 hotspotIndex;
|
|
|
|
uint16 hotspotId;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RoomExitIndexedHotspotList: public ManagedList<RoomExitIndexedHotspotData *> {
|
|
|
|
public:
|
|
|
|
uint16 getHotspot(uint16 roomNumber, uint8 hotspotIndexId);
|
|
|
|
};
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
// The following classes hold any sequence offsets that are being delayed
|
|
|
|
|
|
|
|
class SequenceDelayData {
|
2007-05-28 11:36:08 +00:00
|
|
|
private:
|
|
|
|
SequenceDelayData() {};
|
2006-02-11 12:54:56 +00:00
|
|
|
public:
|
2006-07-08 08:36:32 +00:00
|
|
|
SequenceDelayData(uint16 delay, uint16 seqOffset, bool canClearFlag);
|
2007-05-28 11:36:08 +00:00
|
|
|
static SequenceDelayData *load(uint32 delay, uint16 seqOffset, bool canClearFlag);
|
2006-07-08 08:36:32 +00:00
|
|
|
|
|
|
|
uint32 timeoutCtr;
|
|
|
|
uint16 sequenceOffset;
|
|
|
|
bool canClear;
|
2006-02-11 12:54:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SequenceDelayList: public ManagedList<SequenceDelayData *> {
|
|
|
|
public:
|
2006-07-08 08:36:32 +00:00
|
|
|
void add(uint16 delay, uint16 seqOffset, bool canClear);
|
2006-02-11 12:54:56 +00:00
|
|
|
void tick();
|
2007-05-28 11:36:08 +00:00
|
|
|
void clear(bool forceClear = false);
|
|
|
|
|
|
|
|
void saveToStream(WriteStream *stream);
|
|
|
|
void loadFromStream(ReadStream *stream);
|
2006-02-11 12:54:56 +00:00
|
|
|
};
|
|
|
|
|
2006-05-23 12:37:43 +00:00
|
|
|
// The following classes holds the data for NPC schedules
|
|
|
|
|
2007-09-08 11:18:35 +00:00
|
|
|
extern const int actionNumParams[NPC_JUMP_ADDRESS+1];
|
2006-05-23 12:37:43 +00:00
|
|
|
|
|
|
|
class CharacterScheduleSet;
|
|
|
|
|
|
|
|
class CharacterScheduleEntry {
|
|
|
|
private:
|
|
|
|
CharacterScheduleSet *_parent;
|
|
|
|
Action _action;
|
2006-08-27 11:38:55 +00:00
|
|
|
uint16 _params[MAX_TELL_COMMANDS * 3];
|
|
|
|
int _numParams;
|
2006-05-23 12:37:43 +00:00
|
|
|
public:
|
|
|
|
CharacterScheduleEntry() { _action = NONE; _parent = NULL; }
|
|
|
|
CharacterScheduleEntry(Action theAction, ...);
|
|
|
|
CharacterScheduleEntry(CharacterScheduleSet *parentSet,
|
|
|
|
CharacterScheduleResource *&rec);
|
|
|
|
|
|
|
|
Action action() { return _action; }
|
2006-08-27 11:38:55 +00:00
|
|
|
int numParams() { return _numParams; }
|
2006-05-23 12:37:43 +00:00
|
|
|
uint16 param(int index);
|
|
|
|
void setDetails(Action theAction, ...);
|
2006-08-27 11:38:55 +00:00
|
|
|
void setDetails2(Action theAction, int numParamEntries, uint16 *paramList);
|
2006-05-23 12:37:43 +00:00
|
|
|
CharacterScheduleEntry *next();
|
|
|
|
CharacterScheduleSet *parent() { return _parent; }
|
|
|
|
uint16 id();
|
|
|
|
};
|
|
|
|
|
|
|
|
class CharacterScheduleSet: public ManagedList<CharacterScheduleEntry *> {
|
|
|
|
private:
|
|
|
|
uint16 _id;
|
|
|
|
public:
|
|
|
|
CharacterScheduleSet(CharacterScheduleResource *rec, uint16 setId);
|
|
|
|
uint16 getId(CharacterScheduleEntry *rec);
|
|
|
|
uint16 id() { return _id; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class CharacterScheduleList: public ManagedList<CharacterScheduleSet *> {
|
|
|
|
public:
|
|
|
|
CharacterScheduleEntry *getEntry(uint16 id, CharacterScheduleSet *currentSet = NULL);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef List<uint16> CharacterScheduleOffsets;
|
|
|
|
|
2007-02-22 06:29:09 +00:00
|
|
|
// The follow classes are used to store the NPC schedule Ids for the random actions a follower can do in each room
|
|
|
|
|
|
|
|
enum RandomActionType {REPEATABLE, REPEAT_ONCE, REPEAT_ONCE_DONE};
|
|
|
|
|
|
|
|
class RandomActionSet {
|
|
|
|
private:
|
|
|
|
uint16 _roomNumber;
|
|
|
|
int _numActions;
|
|
|
|
RandomActionType *_types;
|
|
|
|
uint16 *_ids;
|
|
|
|
public:
|
|
|
|
RandomActionSet(uint16 *&offset);
|
|
|
|
~RandomActionSet();
|
|
|
|
|
|
|
|
uint16 roomNumber() { return _roomNumber; }
|
|
|
|
int numActions() { return _numActions; }
|
2007-02-26 02:50:23 +00:00
|
|
|
void getEntry(int index, RandomActionType &actionType, uint16 &id) {
|
2007-02-22 06:29:09 +00:00
|
|
|
assert((index >= 0) && (index < _numActions));
|
|
|
|
actionType = _types[index];
|
|
|
|
id = _ids[index];
|
|
|
|
}
|
2007-02-26 02:50:23 +00:00
|
|
|
void setDone(int index) {
|
2007-02-22 06:29:09 +00:00
|
|
|
assert((index >= 0) && (index < _numActions));
|
|
|
|
assert(_types[index] == REPEAT_ONCE);
|
|
|
|
_types[index] = REPEAT_ONCE_DONE;
|
|
|
|
}
|
2007-02-26 02:50:23 +00:00
|
|
|
void saveToStream(Common::WriteStream *stream);
|
|
|
|
void loadFromStream(Common::ReadStream *stream);
|
2007-02-22 06:29:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class RandomActionList: public ManagedList<RandomActionSet *> {
|
|
|
|
public:
|
|
|
|
RandomActionSet *getRoom(uint16 roomNumber);
|
|
|
|
void saveToStream(Common::WriteStream *stream);
|
|
|
|
void loadFromStream(Common::ReadStream *stream);
|
|
|
|
};
|
|
|
|
|
2006-07-08 08:36:32 +00:00
|
|
|
class PausedCharacter {
|
|
|
|
public:
|
|
|
|
PausedCharacter(uint16 SrcCharId, uint16 DestCharId);
|
|
|
|
|
|
|
|
uint16 srcCharId;
|
|
|
|
uint16 destCharId;
|
|
|
|
uint16 counter;
|
|
|
|
HotspotData *charHotspot;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Hotspot;
|
|
|
|
|
|
|
|
class PausedCharacterList: public ManagedList<PausedCharacter *> {
|
|
|
|
public:
|
|
|
|
void reset(uint16 hotspotId);
|
|
|
|
void countdown();
|
|
|
|
void scan(Hotspot &h);
|
|
|
|
int check(uint16 charId, int numImpinging, uint16 *impingingList);
|
|
|
|
};
|
|
|
|
|
2007-04-14 03:48:24 +00:00
|
|
|
struct ServeEntry {
|
|
|
|
uint16 hotspotId;
|
|
|
|
uint8 serveFlags;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NUM_SERVE_CUSTOMERS 4
|
|
|
|
|
|
|
|
enum BarmanGraphicType {BG_RANDOM = 0, BG_BEER = 1, BG_EXTRA1 = 2, BG_EXTRA2 = 3};
|
|
|
|
|
|
|
|
struct BarEntry {
|
|
|
|
uint16 roomNumber;
|
|
|
|
uint16 barmanId;
|
|
|
|
ServeEntry customers[NUM_SERVE_CUSTOMERS];
|
2007-09-08 11:18:35 +00:00
|
|
|
const uint16 *graphics[4];
|
2007-04-14 03:48:24 +00:00
|
|
|
uint16 gridLine;
|
|
|
|
ServeEntry *currentCustomer;
|
|
|
|
};
|
|
|
|
|
|
|
|
class BarmanLists {
|
2007-09-08 11:18:35 +00:00
|
|
|
BarEntry _barList[3];
|
2007-04-14 03:48:24 +00:00
|
|
|
public:
|
2007-09-08 11:18:35 +00:00
|
|
|
BarmanLists();
|
|
|
|
|
2007-04-14 03:48:24 +00:00
|
|
|
BarEntry &getDetails(uint16 roomNumber);
|
|
|
|
void saveToStream(Common::WriteStream *stream);
|
|
|
|
void loadFromStream(Common::ReadStream *stream);
|
|
|
|
};
|
|
|
|
|
|
|
|
enum BarmanAction {WALK_AROUND = 1, POLISH_BAR = 2, WAIT = 3, WAIT_DIALOG = 4, SERVE_BEER = 5};
|
|
|
|
|
2007-05-28 11:36:08 +00:00
|
|
|
struct RoomTranslationRecord {
|
|
|
|
uint8 srcRoom;
|
|
|
|
uint8 destRoom;
|
|
|
|
};
|
|
|
|
|
2007-09-08 11:18:35 +00:00
|
|
|
extern const RoomTranslationRecord roomTranslations[];
|
2007-05-28 11:36:08 +00:00
|
|
|
|
2006-09-07 11:21:20 +00:00
|
|
|
enum StringEnum {S_CREDITS = 25, S_RESTART_GAME = 26, S_SAVE_GAME = 27, S_RESTORE_GAME = 28,
|
|
|
|
S_QUIT = 29, S_FAST_TEXT = 30, S_SLOW_TEXT = 31, S_SOUND_ON = 32, S_SOUND_OFF = 33,
|
2007-09-23 22:17:57 +00:00
|
|
|
S_NOTHING = 34, S_FOR = 35, S_TO = 36, S_ON = 37, S_AND_THEN = 38, S_FINISH = 39,
|
|
|
|
S_CONFIRM_YN = 40, S_ARTICLE_LIST = 41};
|
2006-09-07 11:21:20 +00:00
|
|
|
|
|
|
|
class StringList {
|
|
|
|
private:
|
|
|
|
MemoryBlock *_data;
|
|
|
|
int _numEntries;
|
|
|
|
char **_entries;
|
|
|
|
public:
|
|
|
|
StringList() { _numEntries = 0; }
|
|
|
|
~StringList() { clear(); }
|
|
|
|
|
|
|
|
void load(MemoryBlock *data);
|
|
|
|
void clear();
|
|
|
|
int count() { return _numEntries; }
|
|
|
|
const char *getString(int index) {
|
|
|
|
if ((index < 0) || (index >= _numEntries)) error("Invalid index specified to String List");
|
|
|
|
return _entries[index];
|
|
|
|
}
|
|
|
|
const char *getString(Action action) { return getString((int) action - 1); }
|
|
|
|
const char *getString(StringEnum sEnum) { return getString((int) sEnum); }
|
|
|
|
};
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
// The following class holds the field list used by the script engine as
|
|
|
|
// well as miscellaneous fields used by the game.
|
|
|
|
|
2006-04-11 10:43:53 +00:00
|
|
|
#define NUM_VALUE_FIELDS 90
|
2006-02-11 12:54:56 +00:00
|
|
|
|
|
|
|
enum FieldName {
|
|
|
|
ROOM_NUMBER = 0,
|
|
|
|
CHARACTER_HOTSPOT_ID = 1,
|
|
|
|
USE_HOTSPOT_ID = 2,
|
|
|
|
ACTIVE_HOTSPOT_ID = 3,
|
|
|
|
SEQUENCE_RESULT = 4,
|
|
|
|
GENERAL = 5,
|
2006-07-08 08:36:32 +00:00
|
|
|
GIVE_TALK_INDEX = 6,
|
2006-02-11 12:54:56 +00:00
|
|
|
NEW_ROOM_NUMBER = 7,
|
2006-02-19 04:15:33 +00:00
|
|
|
OLD_ROOM_NUMBER = 8,
|
|
|
|
CELL_DOOR_STATE = 9,
|
2006-02-11 12:54:56 +00:00
|
|
|
TORCH_HIDE = 10,
|
|
|
|
PRISONER_DEAD = 15,
|
|
|
|
BOTTLE_FILLED = 18,
|
2006-02-19 04:15:33 +00:00
|
|
|
TALK_INDEX = 19,
|
2006-11-05 08:22:33 +00:00
|
|
|
SACK_CUT = 20,
|
2007-08-12 11:16:43 +00:00
|
|
|
ROOM_EXIT_ANIMATION = 76,
|
|
|
|
AREA_FLAG = 82
|
2006-02-11 12:54:56 +00:00
|
|
|
};
|
|
|
|
|
2006-07-08 08:36:32 +00:00
|
|
|
enum GameFlags {
|
|
|
|
GAMEFLAG_1 = 1,
|
|
|
|
GAMEFLAG_2 = 2,
|
|
|
|
GAMEFLAG_4 = 4,
|
|
|
|
GAMEFLAG_8 = 8,
|
|
|
|
GAMEFLAG_10 = 0x10,
|
|
|
|
GAMEFLAG_20 = 0x20,
|
|
|
|
GAMEFLAG_40 = 0x40,
|
|
|
|
GAMEFLAG_FAST_TEXTSPEED = 0x80
|
|
|
|
};
|
|
|
|
|
2006-04-29 11:15:03 +00:00
|
|
|
struct PlayerNewPosition {
|
|
|
|
Point position;
|
|
|
|
uint16 roomNumber;
|
|
|
|
};
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
class ValueTableData {
|
|
|
|
private:
|
|
|
|
uint16 _numGroats;
|
2006-04-11 10:43:53 +00:00
|
|
|
PlayerNewPosition _playerNewPos;
|
2006-07-08 08:36:32 +00:00
|
|
|
uint8 _flags;
|
2006-07-30 12:09:51 +00:00
|
|
|
uint8 _hdrFlagMask;
|
2006-04-11 10:43:53 +00:00
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 _fieldList[NUM_VALUE_FIELDS];
|
|
|
|
bool isKnownField(uint16 fieldIndex);
|
|
|
|
public:
|
|
|
|
ValueTableData();
|
2007-08-25 06:08:02 +00:00
|
|
|
void reset();
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 getField(uint16 fieldIndex);
|
|
|
|
uint16 getField(FieldName fieldName);
|
|
|
|
|
|
|
|
void setField(uint16 fieldIndex, uint16 value);
|
|
|
|
void setField(FieldName fieldName, uint16 value);
|
2006-07-08 08:36:32 +00:00
|
|
|
int size() { return NUM_VALUE_FIELDS; }
|
|
|
|
|
2006-02-11 12:54:56 +00:00
|
|
|
uint16 &numGroats() { return _numGroats; }
|
2006-07-08 08:36:32 +00:00
|
|
|
uint8 &flags() { return _flags; }
|
2006-07-30 12:09:51 +00:00
|
|
|
uint8 &hdrFlagMask() { return _hdrFlagMask; }
|
2006-04-11 10:43:53 +00:00
|
|
|
PlayerNewPosition &playerNewPos() { return _playerNewPos; }
|
2006-10-02 12:48:56 +00:00
|
|
|
|
|
|
|
void saveToStream(Common::WriteStream *stream);
|
|
|
|
void loadFromStream(Common::ReadStream *stream);
|
2006-02-11 12:54:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Lure
|
|
|
|
|
|
|
|
#endif
|