2013-05-20 02:45:54 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VOYEUR_FILES_H
|
|
|
|
#define VOYEUR_FILES_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/file.h"
|
2013-05-25 19:36:57 +00:00
|
|
|
#include "common/rect.h"
|
2013-05-20 02:45:54 +00:00
|
|
|
#include "common/str.h"
|
2013-05-30 03:21:07 +00:00
|
|
|
#include "voyeur/graphics.h"
|
2013-05-20 02:45:54 +00:00
|
|
|
|
|
|
|
namespace Voyeur {
|
|
|
|
|
|
|
|
class VoyeurEngine;
|
2013-05-25 13:58:03 +00:00
|
|
|
class BoltFile;
|
2013-05-20 02:45:54 +00:00
|
|
|
class BoltGroup;
|
|
|
|
class BoltEntry;
|
2013-05-25 19:36:57 +00:00
|
|
|
class PictureResource;
|
2013-05-26 03:30:48 +00:00
|
|
|
class ViewPortResource;
|
2013-05-27 02:18:54 +00:00
|
|
|
class ViewPortListResource;
|
2013-05-28 03:01:15 +00:00
|
|
|
class FontResource;
|
|
|
|
class CMapResource;
|
|
|
|
class VInitCyclResource;
|
2013-12-08 15:40:26 +00:00
|
|
|
class PtrResource;
|
|
|
|
class ControlResource;
|
2013-12-08 21:51:50 +00:00
|
|
|
class ThreadResource;
|
2013-05-26 03:30:48 +00:00
|
|
|
|
2013-05-22 03:15:43 +00:00
|
|
|
#define DECOMPRESS_SIZE 0x7000
|
2013-05-20 02:45:54 +00:00
|
|
|
|
2013-05-26 03:30:48 +00:00
|
|
|
class ResolveEntry {
|
|
|
|
public:
|
|
|
|
uint32 _id;
|
|
|
|
byte **_p;
|
|
|
|
|
|
|
|
ResolveEntry(uint32 id, byte **p) { _id = id; _p = p; }
|
|
|
|
};
|
|
|
|
|
2013-05-25 19:36:57 +00:00
|
|
|
class BoltFilesState {
|
|
|
|
public:
|
2013-05-26 00:51:53 +00:00
|
|
|
VoyeurEngine *_vm;
|
2013-05-25 19:36:57 +00:00
|
|
|
BoltFile *_curLibPtr;
|
|
|
|
BoltGroup *_curGroupPtr;
|
|
|
|
BoltEntry *_curMemberPtr;
|
|
|
|
byte *_curMemInfoPtr;
|
|
|
|
int _fromGroupFlag;
|
|
|
|
byte _xorMask;
|
|
|
|
bool _encrypt;
|
|
|
|
int _curFilePosition;
|
|
|
|
int _bufferEnd;
|
|
|
|
int _bufferBegin;
|
|
|
|
int _bytesLeft;
|
|
|
|
int _bufSize;
|
|
|
|
byte *_bufStart;
|
|
|
|
byte *_bufPos;
|
|
|
|
byte _decompressBuf[DECOMPRESS_SIZE];
|
|
|
|
int _historyIndex;
|
|
|
|
byte _historyBuffer[0x200];
|
|
|
|
int _runLength;
|
|
|
|
int _decompState;
|
|
|
|
int _runType;
|
|
|
|
int _runValue;
|
|
|
|
int _runOffset;
|
2013-05-26 00:51:53 +00:00
|
|
|
Common::File *_curFd;
|
2013-05-26 03:30:48 +00:00
|
|
|
Common::Array<ResolveEntry> _resolves;
|
2013-05-26 00:51:53 +00:00
|
|
|
|
|
|
|
byte *_boltPageFrame;
|
|
|
|
int _sImageShift;
|
|
|
|
bool _SVGAReset;
|
2013-05-25 19:36:57 +00:00
|
|
|
public:
|
|
|
|
BoltFilesState();
|
|
|
|
|
|
|
|
byte *decompress(byte *buf, int size, int mode);
|
|
|
|
void nextBlock();
|
2013-05-26 00:51:53 +00:00
|
|
|
|
|
|
|
void EMSGetFrameAddr(byte **pageFrame) {} // TODO: Maybe?
|
|
|
|
bool EMSAllocatePages(uint *planeSize) { return false; } // TODO: Maybe?
|
|
|
|
void EMSMapPageHandle(int planeSize, int idx1, int idx2) {} // TODO: Maybe?
|
2013-05-25 19:36:57 +00:00
|
|
|
};
|
|
|
|
|
2013-05-20 02:45:54 +00:00
|
|
|
class BoltFile {
|
|
|
|
private:
|
|
|
|
Common::Array<BoltGroup> _groups;
|
2013-12-08 01:44:28 +00:00
|
|
|
protected:
|
|
|
|
BoltFilesState &_state;
|
2013-05-22 02:07:17 +00:00
|
|
|
|
2013-12-08 01:44:28 +00:00
|
|
|
virtual void initResource(int resType) = 0;
|
2013-05-25 13:58:03 +00:00
|
|
|
void initDefault();
|
2013-05-20 02:45:54 +00:00
|
|
|
private:
|
2013-05-26 03:30:48 +00:00
|
|
|
void resolveAll();
|
2013-05-21 01:18:40 +00:00
|
|
|
byte *getBoltMember(uint32 id);
|
2013-05-20 02:45:54 +00:00
|
|
|
|
2013-05-26 03:30:48 +00:00
|
|
|
void termType() {} // TODO
|
|
|
|
void initMem(int id) {} // TODO
|
|
|
|
void termMem() {} // TODO
|
|
|
|
void initGro() {} // TODO
|
|
|
|
void termGro() {} // TODO
|
2013-12-15 22:51:47 +00:00
|
|
|
public:
|
|
|
|
Common::File _file;
|
2013-05-21 01:18:40 +00:00
|
|
|
public:
|
2013-12-08 01:44:28 +00:00
|
|
|
BoltFile(const Common::String &filename, BoltFilesState &state);
|
2013-12-14 16:07:01 +00:00
|
|
|
virtual ~BoltFile();
|
2013-05-21 01:18:40 +00:00
|
|
|
|
2013-12-15 20:08:25 +00:00
|
|
|
BoltGroup *getBoltGroup(uint16 id, bool process = true);
|
|
|
|
void freeBoltGroup(uint16 id, bool freeEntries = true);
|
2013-12-08 21:51:50 +00:00
|
|
|
void freeBoltMember(uint32 id);
|
2013-05-21 01:18:40 +00:00
|
|
|
byte *memberAddr(uint32 id);
|
2013-05-26 03:30:48 +00:00
|
|
|
byte *memberAddrOffset(uint32 id);
|
|
|
|
void resolveIt(uint32 id, byte **p);
|
2013-05-30 03:21:07 +00:00
|
|
|
void resolveFunction(uint32 id, GraphicMethodPtr *fn);
|
2013-05-29 03:57:16 +00:00
|
|
|
|
2013-06-15 15:39:28 +00:00
|
|
|
BoltEntry &boltEntry(uint16 id);
|
|
|
|
BoltEntry &getBoltEntryFromLong(uint32 id);
|
2013-06-13 02:13:52 +00:00
|
|
|
PictureResource *getPictureResource(uint32 id);
|
2013-06-06 01:28:51 +00:00
|
|
|
CMapResource *getCMapResource(uint32 id);
|
2013-05-20 02:45:54 +00:00
|
|
|
};
|
|
|
|
|
2013-12-08 01:44:28 +00:00
|
|
|
class BVoyBoltFile: public BoltFile {
|
|
|
|
private:
|
|
|
|
// initType method table
|
|
|
|
void sInitPic();
|
|
|
|
void vInitCMap();
|
|
|
|
void vInitCycl();
|
|
|
|
void initViewPort();
|
|
|
|
void initViewPortList();
|
|
|
|
void initFontInfo();
|
|
|
|
void initFont();
|
|
|
|
void initSoundMap();
|
|
|
|
protected:
|
|
|
|
virtual void initResource(int resType);
|
|
|
|
public:
|
|
|
|
BVoyBoltFile(BoltFilesState &state);
|
|
|
|
};
|
|
|
|
|
|
|
|
class StampBoltFile: public BoltFile {
|
2013-12-08 15:40:26 +00:00
|
|
|
private:
|
2013-12-08 21:51:50 +00:00
|
|
|
void initThread();
|
2013-12-08 15:40:26 +00:00
|
|
|
void initPtr();
|
|
|
|
void initControl();
|
2013-12-08 01:44:28 +00:00
|
|
|
protected:
|
|
|
|
virtual void initResource(int resType);
|
|
|
|
public:
|
|
|
|
StampBoltFile(BoltFilesState &state);
|
|
|
|
};
|
|
|
|
|
2013-05-20 02:45:54 +00:00
|
|
|
class BoltGroup {
|
|
|
|
private:
|
|
|
|
Common::SeekableReadStream *_file;
|
|
|
|
public:
|
2013-05-22 02:07:17 +00:00
|
|
|
byte _loaded;
|
|
|
|
bool _processed;
|
2013-05-20 02:45:54 +00:00
|
|
|
bool _callInitGro;
|
2013-06-06 01:28:51 +00:00
|
|
|
int _termGroIndex;
|
2013-05-20 02:45:54 +00:00
|
|
|
int _count;
|
|
|
|
int _fileOffset;
|
|
|
|
Common::Array<BoltEntry> _entries;
|
|
|
|
public:
|
|
|
|
BoltGroup(Common::SeekableReadStream *f);
|
2013-06-08 19:49:44 +00:00
|
|
|
virtual ~BoltGroup();
|
2013-05-20 02:45:54 +00:00
|
|
|
|
|
|
|
void load();
|
2013-06-08 19:49:44 +00:00
|
|
|
void unload();
|
2013-05-20 02:45:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class BoltEntry {
|
|
|
|
private:
|
|
|
|
Common::SeekableReadStream *_file;
|
|
|
|
public:
|
2013-05-21 01:18:40 +00:00
|
|
|
byte _mode;
|
|
|
|
byte _field1;
|
2013-05-25 13:58:03 +00:00
|
|
|
byte _initMethod;
|
2013-05-20 02:45:54 +00:00
|
|
|
int _fileOffset;
|
2013-05-21 01:18:40 +00:00
|
|
|
byte _xorMask;
|
|
|
|
int _size;
|
|
|
|
byte *_data;
|
2013-05-25 19:36:57 +00:00
|
|
|
|
2013-12-08 15:40:26 +00:00
|
|
|
// bvoy.blt resource types
|
2013-05-25 19:36:57 +00:00
|
|
|
PictureResource *_picResource;
|
2013-05-26 03:30:48 +00:00
|
|
|
ViewPortResource *_viewPortResource;
|
2013-05-27 02:18:54 +00:00
|
|
|
ViewPortListResource *_viewPortListResource;
|
2013-05-28 03:01:15 +00:00
|
|
|
FontResource *_fontResource;
|
2013-06-15 15:39:28 +00:00
|
|
|
FontInfoResource *_fontInfoResource;
|
2013-05-28 03:01:15 +00:00
|
|
|
CMapResource *_cMapResource;
|
|
|
|
VInitCyclResource *_vInitCyclResource;
|
2013-12-08 15:40:26 +00:00
|
|
|
|
|
|
|
// stampblt.blt resource types
|
|
|
|
PtrResource *_ptrResource;
|
|
|
|
ControlResource *_controlResource;
|
2013-12-08 21:51:50 +00:00
|
|
|
ThreadResource *_threadResource;
|
2013-05-20 02:45:54 +00:00
|
|
|
public:
|
|
|
|
BoltEntry(Common::SeekableReadStream *f);
|
2013-05-21 01:18:40 +00:00
|
|
|
virtual ~BoltEntry();
|
2013-05-20 02:45:54 +00:00
|
|
|
|
|
|
|
void load();
|
2013-05-29 02:39:32 +00:00
|
|
|
bool hasResource() const;
|
2013-05-20 02:45:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class FilesManager {
|
|
|
|
private:
|
|
|
|
int _decompressSize;
|
|
|
|
public:
|
2013-05-25 19:36:57 +00:00
|
|
|
BoltFilesState _boltFilesState;
|
2013-05-20 02:45:54 +00:00
|
|
|
BoltFile *_curLibPtr;
|
|
|
|
public:
|
|
|
|
FilesManager();
|
2013-05-26 00:51:53 +00:00
|
|
|
void setVm(VoyeurEngine *vm) { _boltFilesState._vm = vm; }
|
2013-05-20 02:45:54 +00:00
|
|
|
|
2013-05-21 01:18:40 +00:00
|
|
|
bool openBoltLib(const Common::String &filename, BoltFile *&boltFile);
|
2013-06-11 01:29:12 +00:00
|
|
|
byte *fload(const Common::String &filename, int *size = NULL);
|
2013-05-20 02:45:54 +00:00
|
|
|
};
|
|
|
|
|
2013-06-18 02:41:58 +00:00
|
|
|
enum DisplayFlag { DISPFLAG_1 = 1, DISPFLAG_2 = 2, DISPFLAG_4 = 4, DISPFLAG_8 = 8,
|
|
|
|
DISPFLAG_10 = 0x10, DISPFLAG_20 = 0x20, DISPFLAG_40 = 0x40, DISPFLAG_80 = 0x80,
|
|
|
|
DISPFLAG_100 = 0x100, DISPFLAG_200 = 0x200, DISPFLAG_400 = 0x400,
|
|
|
|
DISPFLAG_800 = 0x800, DISPFLAG_1000 = 0x1000, DISPFLAG_2000 = 0x2000,
|
2013-06-21 04:18:19 +00:00
|
|
|
DISPFLAG_4000 = 0x4000, DISPFLAG_VIEWPORT = 0x8000, DISPFLAG_CURSOR = 0x10000 };
|
2013-06-18 02:41:58 +00:00
|
|
|
|
2013-06-01 01:03:16 +00:00
|
|
|
class DisplayResource {
|
2013-05-30 03:21:07 +00:00
|
|
|
public:
|
2013-06-21 04:18:19 +00:00
|
|
|
uint32 _flags;
|
2013-06-01 01:03:16 +00:00
|
|
|
};
|
|
|
|
|
2013-12-08 15:40:26 +00:00
|
|
|
/* bvoy.blt resource types */
|
|
|
|
|
2013-12-15 20:08:25 +00:00
|
|
|
enum PictureFlag { PICFLAG_8 = 8, PICFLAG_10 = 0x10, PICFLAG_20 = 0x20,
|
|
|
|
PICFLAG_40 = 0x40, PICFLAG_80 = 0x80, PICFLAG_1000 = 0x1000 };
|
|
|
|
|
2013-06-01 01:03:16 +00:00
|
|
|
class PictureResource: public DisplayResource {
|
|
|
|
public:
|
2013-05-25 19:36:57 +00:00
|
|
|
byte _select;
|
|
|
|
byte _pick;
|
|
|
|
byte _onOff;
|
|
|
|
byte _depth;
|
2013-05-30 03:21:07 +00:00
|
|
|
Common::Rect _bounds;
|
2013-05-25 19:36:57 +00:00
|
|
|
uint32 _maskData;
|
2013-05-26 00:51:53 +00:00
|
|
|
uint _planeSize;
|
2013-05-25 19:36:57 +00:00
|
|
|
|
|
|
|
byte *_imgData;
|
|
|
|
public:
|
|
|
|
PictureResource(BoltFilesState &state, const byte *src);
|
2013-06-16 13:03:03 +00:00
|
|
|
PictureResource(int flags, int select, int pick, int onOff, int depth,
|
|
|
|
const Common::Rect &bounds, int maskData, byte *imgData, int planeSize);
|
2013-06-08 21:51:41 +00:00
|
|
|
PictureResource();
|
2013-05-25 19:36:57 +00:00
|
|
|
virtual ~PictureResource();
|
|
|
|
};
|
|
|
|
|
2013-05-29 02:39:32 +00:00
|
|
|
typedef void (ViewPortResource::*ViewPortMethodPtr)();
|
|
|
|
|
2013-06-01 01:03:16 +00:00
|
|
|
class ViewPortResource: public DisplayResource {
|
2013-05-29 02:39:32 +00:00
|
|
|
private:
|
|
|
|
BoltFilesState &_state;
|
|
|
|
private:
|
2013-05-30 03:21:07 +00:00
|
|
|
void setupViewPort(PictureResource *page, Common::Rect *clipRect, ViewPortSetupPtr setupFn,
|
|
|
|
ViewPortAddPtr addFn, ViewPortRestorePtr restoreFn);
|
2013-05-26 03:30:48 +00:00
|
|
|
public:
|
2013-06-17 01:20:42 +00:00
|
|
|
ViewPortResource *_parent;
|
2013-06-01 01:31:33 +00:00
|
|
|
int _pageCount;
|
|
|
|
int _pageIndex;
|
|
|
|
int _lastPage;
|
2013-05-30 03:21:07 +00:00
|
|
|
Common::Rect _bounds;
|
2013-05-29 02:39:32 +00:00
|
|
|
int _field18;
|
2013-06-01 01:31:33 +00:00
|
|
|
PictureResource *_currentPic;
|
2013-05-30 03:21:07 +00:00
|
|
|
PictureResource *_activePage;
|
2013-06-01 01:31:33 +00:00
|
|
|
PictureResource *_pages[2];
|
2013-05-26 03:30:48 +00:00
|
|
|
byte *_field30;
|
2013-06-01 17:01:09 +00:00
|
|
|
|
|
|
|
// Rect lists and counts. Note that _rectListCount values of '-1' seem to have
|
|
|
|
// special significance, which is why I'm not making them redundant in favour
|
|
|
|
// of the arrays' .size() method
|
2013-06-01 16:35:50 +00:00
|
|
|
Common::Array<Common::Rect> *_rectListPtr[3];
|
|
|
|
int _rectListCount[3];
|
2013-06-01 17:01:09 +00:00
|
|
|
|
2013-05-30 03:21:07 +00:00
|
|
|
Common::Rect _clipRect;
|
2013-05-26 03:30:48 +00:00
|
|
|
byte *_field7A;
|
2013-05-30 03:21:07 +00:00
|
|
|
GraphicMethodPtr _fn1;
|
|
|
|
ViewPortSetupPtr _setupFn;
|
|
|
|
ViewPortAddPtr _addFn;
|
|
|
|
ViewPortRestorePtr _restoreFn;
|
2013-06-15 02:01:59 +00:00
|
|
|
PictureResource _fontChar;
|
|
|
|
Common::Rect _fontRect;
|
2013-05-26 03:30:48 +00:00
|
|
|
public:
|
|
|
|
ViewPortResource(BoltFilesState &state, const byte *src);
|
2013-06-01 16:35:50 +00:00
|
|
|
virtual ~ViewPortResource();
|
2013-05-29 02:39:32 +00:00
|
|
|
|
|
|
|
void setupViewPort();
|
2013-12-11 05:11:02 +00:00
|
|
|
void setupViewPort(PictureResource *pic);
|
2013-06-15 02:01:59 +00:00
|
|
|
int drawText(const Common::String &msg);
|
|
|
|
int textWidth(const Common::String &msg);
|
|
|
|
void addSaveRect(int pageIndex, const Common::Rect &r);
|
|
|
|
void sFillBox(int width);
|
2013-06-23 18:55:27 +00:00
|
|
|
void fillPic(byte onOff = 0);
|
2013-05-26 03:30:48 +00:00
|
|
|
};
|
|
|
|
|
2013-06-08 02:07:57 +00:00
|
|
|
class ViewPortPalEntry {
|
|
|
|
public:
|
|
|
|
uint16 _rEntry, _gEntry, _bEntry;
|
2013-06-08 14:31:37 +00:00
|
|
|
uint16 _rChange, _gChange, _bChange;
|
|
|
|
uint16 _palIndex;
|
2013-06-08 02:07:57 +00:00
|
|
|
public:
|
|
|
|
ViewPortPalEntry(const byte *src);
|
|
|
|
};
|
|
|
|
|
2013-05-27 02:18:54 +00:00
|
|
|
class ViewPortListResource {
|
|
|
|
public:
|
2013-06-08 02:07:57 +00:00
|
|
|
Common::Array<ViewPortPalEntry> _palette;
|
2013-05-29 02:39:32 +00:00
|
|
|
Common::Array<ViewPortResource *> _entries;
|
2013-06-11 01:46:19 +00:00
|
|
|
int _palIndex;
|
2013-05-27 02:18:54 +00:00
|
|
|
|
|
|
|
ViewPortListResource(BoltFilesState &state, const byte *src);
|
|
|
|
virtual ~ViewPortListResource() {}
|
|
|
|
};
|
|
|
|
|
2013-05-28 03:01:15 +00:00
|
|
|
class FontResource {
|
|
|
|
public:
|
2013-06-15 02:01:59 +00:00
|
|
|
int _minChar, _maxChar;
|
|
|
|
int field2;
|
|
|
|
int _padding;
|
|
|
|
int _fontHeight;
|
2013-06-19 04:16:51 +00:00
|
|
|
int _topPadding;
|
2013-06-15 02:01:59 +00:00
|
|
|
int *_charWidth;
|
2013-12-04 03:17:04 +00:00
|
|
|
byte *_charOffsets;
|
|
|
|
byte *_charImages;
|
2013-06-15 02:01:59 +00:00
|
|
|
|
|
|
|
FontResource(BoltFilesState &state, byte *src);
|
|
|
|
virtual ~FontResource();
|
2013-05-28 03:01:15 +00:00
|
|
|
};
|
|
|
|
|
2013-06-15 15:39:28 +00:00
|
|
|
enum FontJustify { ALIGN_LEFT = 0, ALIGN_CENTRE = 1, ALIGN_RIGHT = 2 };
|
|
|
|
|
|
|
|
class FontInfoResource {
|
|
|
|
public:
|
|
|
|
FontResource *_curFont;
|
|
|
|
byte _picFlags;
|
|
|
|
byte _picSelect;
|
|
|
|
byte _picPick;
|
|
|
|
byte _picOnOff;
|
|
|
|
byte _fontFlags;
|
|
|
|
FontJustify _justify;
|
|
|
|
int _fontSaveBack;
|
|
|
|
Common::Point _pos;
|
|
|
|
int _justifyWidth;
|
|
|
|
int _justifyHeight;
|
|
|
|
Common::Point _shadow;
|
|
|
|
int _foreColor;
|
|
|
|
int _backColor;
|
|
|
|
int _shadowColor;
|
|
|
|
public:
|
|
|
|
FontInfoResource(BoltFilesState &state, const byte *src);
|
|
|
|
FontInfoResource();
|
|
|
|
FontInfoResource(byte picFlags, byte picSelect, byte picPick, byte picOnOff, byte fontFlags,
|
|
|
|
FontJustify justify, int fontSaveBack, const Common::Point &pos, int justifyWidth,
|
|
|
|
int justifyHeight, const Common::Point &shadow, int foreColor, int backColor,
|
|
|
|
int shadowColor);
|
|
|
|
};
|
|
|
|
|
2013-05-28 03:01:15 +00:00
|
|
|
class CMapResource {
|
2013-06-06 01:28:51 +00:00
|
|
|
private:
|
|
|
|
VoyeurEngine *_vm;
|
2013-05-28 03:01:15 +00:00
|
|
|
public:
|
2013-06-06 01:28:51 +00:00
|
|
|
int _steps;
|
|
|
|
int _fadeStatus;
|
2013-05-28 03:01:15 +00:00
|
|
|
int _start;
|
|
|
|
int _end;
|
2013-06-06 01:28:51 +00:00
|
|
|
byte *_entries;
|
2013-05-28 03:01:15 +00:00
|
|
|
public:
|
|
|
|
CMapResource(BoltFilesState &state, const byte *src);
|
|
|
|
virtual ~CMapResource();
|
2013-06-06 01:28:51 +00:00
|
|
|
|
|
|
|
void startFade();
|
2013-05-28 03:01:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class VInitCyclResource {
|
|
|
|
public:
|
|
|
|
byte *_ptr[4];
|
|
|
|
public:
|
|
|
|
VInitCyclResource(BoltFilesState &state, const byte *src);
|
|
|
|
virtual ~VInitCyclResource() {}
|
|
|
|
};
|
|
|
|
|
2013-12-08 15:40:26 +00:00
|
|
|
/* stampblt.blt resources */
|
|
|
|
|
|
|
|
class PtrResource {
|
|
|
|
public:
|
|
|
|
Common::Array<BoltEntry *> _entries;
|
|
|
|
|
|
|
|
PtrResource(BoltFilesState &state, const byte *src);
|
|
|
|
virtual ~PtrResource() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
class ControlResource {
|
|
|
|
public:
|
2013-12-08 21:51:50 +00:00
|
|
|
int _memberIds[8];
|
|
|
|
byte *_entries[8];
|
2013-12-08 15:40:26 +00:00
|
|
|
byte *_ptr;
|
|
|
|
|
|
|
|
ControlResource(BoltFilesState &state, const byte *src);
|
|
|
|
virtual ~ControlResource() {}
|
|
|
|
};
|
|
|
|
|
2013-12-08 21:51:50 +00:00
|
|
|
class ThreadResource {
|
|
|
|
public:
|
2013-12-09 00:25:40 +00:00
|
|
|
static int _stampFlags;
|
|
|
|
static int _useCount[8];
|
2013-12-09 03:57:11 +00:00
|
|
|
static byte *_threadDataPtr;
|
2013-12-12 02:46:06 +00:00
|
|
|
static CMapResource *_cmd14Pal;
|
2013-12-09 00:25:40 +00:00
|
|
|
static void initUseCount();
|
|
|
|
static void unloadAllStacks(VoyeurEngine *vm);
|
2013-12-14 16:39:15 +00:00
|
|
|
static int _currentMouseX;
|
|
|
|
static int _currentMouseY;
|
2013-12-16 00:01:44 +00:00
|
|
|
static int _doAptPosX;
|
|
|
|
static int _doAptPosY;
|
2013-12-14 16:39:15 +00:00
|
|
|
|
|
|
|
static void init();
|
2013-12-09 03:57:11 +00:00
|
|
|
private:
|
|
|
|
bool getStateInfo();
|
|
|
|
byte *getDataOffset();
|
|
|
|
void getButtonsText();
|
2013-12-10 03:22:32 +00:00
|
|
|
void getButtonsFlags();
|
|
|
|
void getField1CE();
|
|
|
|
void performOpenCard();
|
2013-12-09 04:44:06 +00:00
|
|
|
const byte *getRecordOffset(const byte *p);
|
|
|
|
const byte *getNextRecord(const byte *p);
|
2013-12-12 13:51:13 +00:00
|
|
|
const byte *getSTAMPCard(int cardId);
|
|
|
|
int getStateFromID(uint32 id);
|
|
|
|
uint32 getSID(int sid);
|
2013-12-10 03:22:32 +00:00
|
|
|
void cardAction(const byte *p);
|
2013-12-12 13:51:13 +00:00
|
|
|
void doSTAMPCardAction();
|
2013-12-10 14:19:54 +00:00
|
|
|
void addAudioEventStart();
|
2013-12-11 01:47:05 +00:00
|
|
|
void addAudioEventEnd();
|
2013-12-11 05:11:02 +00:00
|
|
|
void addVideoEventEnd();
|
2013-12-12 13:51:13 +00:00
|
|
|
bool goToStateID(int stackId, int sceneId);
|
|
|
|
bool goToState(int stackId, int sceneId);
|
|
|
|
const byte *cardPerform(const byte *card);
|
2013-12-13 04:56:54 +00:00
|
|
|
bool cardPerform2(const byte *p, int cardCmdId);
|
2013-12-12 13:51:13 +00:00
|
|
|
void savePrevious();
|
2013-12-13 04:56:54 +00:00
|
|
|
void setButtonFlag(int idx, byte bits);
|
|
|
|
void clearButtonFlag(int idx, byte bits);
|
2013-12-15 03:27:16 +00:00
|
|
|
void loadTheApt();
|
|
|
|
void freeTheApt();
|
|
|
|
void doAptAnim(int mode);
|
2013-12-09 00:25:40 +00:00
|
|
|
public:
|
|
|
|
VoyeurEngine *_vm;
|
|
|
|
|
2013-12-09 03:57:11 +00:00
|
|
|
int _threadId;
|
2013-12-08 21:51:50 +00:00
|
|
|
int _controlIndex;
|
|
|
|
int _field4, _field6;
|
2013-12-09 03:57:11 +00:00
|
|
|
byte _flags;
|
|
|
|
int _field9;
|
2013-12-13 04:56:54 +00:00
|
|
|
int _fieldA[8];
|
|
|
|
int _field2A[8];
|
2013-12-08 21:51:50 +00:00
|
|
|
int _field3A;
|
|
|
|
int _field3E;
|
2013-12-09 03:57:11 +00:00
|
|
|
int _field40;
|
|
|
|
int _field42;
|
2013-12-10 14:19:54 +00:00
|
|
|
int _parseCount;
|
2013-12-09 03:57:11 +00:00
|
|
|
uint32 _field46;
|
|
|
|
byte *_field4A;
|
2013-12-13 04:56:54 +00:00
|
|
|
byte _buttonFlags[64];
|
2013-12-10 03:22:32 +00:00
|
|
|
const byte *_field8E[64];
|
|
|
|
byte _field18E[64];
|
|
|
|
const byte *_field1CE[48];
|
2013-12-08 21:51:50 +00:00
|
|
|
byte *_ctlPtr;
|
2013-12-09 03:57:11 +00:00
|
|
|
byte *_field28E;
|
2013-12-08 21:51:50 +00:00
|
|
|
public:
|
|
|
|
ThreadResource(BoltFilesState &state, const byte *src);
|
|
|
|
virtual ~ThreadResource() {}
|
2013-12-09 00:25:40 +00:00
|
|
|
|
2013-12-10 03:22:32 +00:00
|
|
|
void initThreadStruct(int idx, int id);
|
2013-12-09 00:25:40 +00:00
|
|
|
bool loadAStack(int idx);
|
|
|
|
void unloadAStack(int idx);
|
2013-12-09 03:57:11 +00:00
|
|
|
bool doState();
|
2013-12-10 03:22:32 +00:00
|
|
|
|
2013-12-12 13:51:13 +00:00
|
|
|
bool chooseSTAMPButton(int buttonId);
|
2013-12-10 03:22:32 +00:00
|
|
|
void parsePlayCommands();
|
|
|
|
int doInterface();
|
|
|
|
void doRoom();
|
|
|
|
int doApt();
|
|
|
|
void doTapePlaying();
|
|
|
|
void checkForMurder();
|
|
|
|
void checkForIncriminate();
|
|
|
|
|
2013-12-08 21:51:50 +00:00
|
|
|
};
|
|
|
|
|
2013-05-20 02:45:54 +00:00
|
|
|
} // End of namespace Voyeur
|
|
|
|
|
2013-05-23 13:13:28 +00:00
|
|
|
#endif /* VOYEUR_FILES_H */
|