aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorStrangerke2014-03-15 10:43:06 +0100
committerStrangerke2014-03-15 10:43:06 +0100
commita2380c7576964135db3493d828479c0f9ba06e67 (patch)
tree86149cae929e4d7fd305a5923453d7923f02d418 /engines/voyeur
parentf73901ca9adcab29d5e8d1d4c7dca36d16806b93 (diff)
downloadscummvm-rg350-a2380c7576964135db3493d828479c0f9ba06e67.tar.gz
scummvm-rg350-a2380c7576964135db3493d828479c0f9ba06e67.tar.bz2
scummvm-rg350-a2380c7576964135db3493d828479c0f9ba06e67.zip
VOYEUR: Move the initialization of vm to the constructor of BoltFilesState
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/files.cpp14
-rw-r--r--engines/voyeur/files.h23
2 files changed, 22 insertions, 15 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp
index 0a8a423604..8071267b42 100644
--- a/engines/voyeur/files.cpp
+++ b/engines/voyeur/files.cpp
@@ -29,7 +29,7 @@ namespace Voyeur {
#define BOLT_GROUP_SIZE 16
-BoltFilesState::BoltFilesState() {
+BoltFilesState::BoltFilesState(VoyeurEngine *vm) : _vm(vm) {
_curLibPtr = NULL;
_curGroupPtr = NULL;
_curMemberPtr = NULL;
@@ -174,20 +174,24 @@ void BoltFilesState::nextBlock() {
FilesManager::FilesManager(VoyeurEngine *vm) {
_curLibPtr = nullptr;
- _boltFilesState._vm = vm;
+ _boltFilesState = new BoltFilesState(vm);
+}
+
+FilesManager::~FilesManager() {
+ delete _boltFilesState;
}
bool FilesManager::openBoltLib(const Common::String &filename, BoltFile *&boltFile) {
if (boltFile != NULL) {
- _boltFilesState._curLibPtr = boltFile;
+ _boltFilesState->_curLibPtr = boltFile;
return true;
}
// Create the bolt file interface object and load the index
if (filename == "bvoy.blt")
- boltFile = _boltFilesState._curLibPtr = new BVoyBoltFile(_boltFilesState);
+ boltFile = _boltFilesState->_curLibPtr = new BVoyBoltFile(*_boltFilesState);
else if (filename == "stampblt.blt")
- boltFile = _boltFilesState._curLibPtr = new StampBoltFile(_boltFilesState);
+ boltFile = _boltFilesState->_curLibPtr = new StampBoltFile(*_boltFilesState);
else
error("Unknown bolt file specified");
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index 0e736c9c08..49c0b2c8a4 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -82,7 +82,7 @@ public:
byte *_boltPageFrame;
public:
- BoltFilesState();
+ BoltFilesState(VoyeurEngine *vm);
byte *decompress(byte *buf, int size, int mode);
void nextBlock();
@@ -204,10 +204,11 @@ public:
class FilesManager {
public:
- BoltFilesState _boltFilesState;
+ BoltFilesState *_boltFilesState;
BoltFile *_curLibPtr;
public:
FilesManager(VoyeurEngine *vm);
+ ~FilesManager();
bool openBoltLib(const Common::String &filename, BoltFile *&boltFile);
byte *fload(const Common::String &filename, int *size);
@@ -230,7 +231,16 @@ public:
virtual ~RectResource() {}
};
-enum DisplayFlag { DISPFLAG_1 = 1, DISPFLAG_2 = 2, DISPFLAG_4 = 4, DISPFLAG_8 = 8,
+/* bvoy.blt resource types */
+
+enum PictureFlag {
+ PICFLAG_2 = 2, PICFLAG_PIC_OFFSET = 8, PICFLAG_CLEAR_SCREEN = 0x10,
+ PICFLAG_20 = 0x20, PICFLAG_HFLIP = 0x40, PICFLAG_VFLIP = 0x80, PICFLAG_100 = 0x100,
+ PICFLAG_CLEAR_SCREEN00 = 0x1000
+};
+
+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,
@@ -267,13 +277,6 @@ public:
bool clipRect(Common::Rect &rect);
};
-/* bvoy.blt resource types */
-
-enum PictureFlag { PICFLAG_2 = 2, PICFLAG_PIC_OFFSET = 8, PICFLAG_CLEAR_SCREEN = 0x10,
- PICFLAG_20 = 0x20, PICFLAG_HFLIP = 0x40, PICFLAG_VFLIP = 0x80, PICFLAG_100 = 0x100,
- PICFLAG_CLEAR_SCREEN00 = 0x1000
-};
-
class PictureResource: public DisplayResource {
private:
/**