aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/voyeur/game.cpp13
-rw-r--r--engines/voyeur/game.h15
-rw-r--r--engines/voyeur/graphics.cpp22
-rw-r--r--engines/voyeur/graphics.h28
-rw-r--r--engines/voyeur/voyeur.cpp1
-rw-r--r--engines/voyeur/voyeur.h4
6 files changed, 46 insertions, 37 deletions
diff --git a/engines/voyeur/game.cpp b/engines/voyeur/game.cpp
index 3d80b6004f..26e5d3113b 100644
--- a/engines/voyeur/game.cpp
+++ b/engines/voyeur/game.cpp
@@ -28,4 +28,17 @@ void IntData::audioInit() {
}
+void IntData::addIntNode(IntNode *node) {
+ _intNodes.push_back(node);
+}
+
+/*------------------------------------------------------------------------*/
+
+IntNode::IntNode() {
+ _intFunc = NULL;
+ _curTime = 0;
+ _timeReset = 0;
+ _flags = 0;
+}
+
} // End of namespace Voyeur
diff --git a/engines/voyeur/game.h b/engines/voyeur/game.h
index 44d8c05c88..99f97fd9d1 100644
--- a/engines/voyeur/game.h
+++ b/engines/voyeur/game.h
@@ -97,11 +97,26 @@ public:
int _policeEvent;
};
+typedef void (*IntFuncPtr)();
+
+class IntNode {
+public:
+ IntFuncPtr _intFunc;
+ uint32 _curTime;
+ uint32 _timeReset;
+ uint32 _flags;
+public:
+ IntNode();
+};
+
class IntData {
public:
byte *_colors;
+ Common::List<IntNode *> _intNodes;
public:
void audioInit();
+ void addIntNode(IntNode *node);
+
};
} // End of namespace Voyeur
diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp
index 311199c045..4b1e05c9ff 100644
--- a/engines/voyeur/graphics.cpp
+++ b/engines/voyeur/graphics.cpp
@@ -21,6 +21,8 @@
*/
#include "voyeur/graphics.h"
+#include "voyeur/game.h"
+#include "voyeur/voyeur.h"
#include "engines/util.h"
#include "graphics/surface.h"
@@ -39,18 +41,14 @@ void GraphicsManager::addFadeInt() {
_fadeIntNode._flags = 0;
_fadeIntNode._curTime = 0;
_fadeIntNode._timeReset = 1;
-
- addIntNode(&_fadeIntNode);
+
+ _vm->_intPtr.addIntNode(&_fadeIntNode);
}
void GraphicsManager::vInitColor() {
_fadeIntNode._intFunc = vDoFadeInt;
_cycleIntNode._intFunc = vDoCycleInt;
-
-}
-
-void GraphicsManager::addIntNode(IntNode *node) {
-
+ // TODO: more
}
void GraphicsManager::fadeIntFunc() {
@@ -65,14 +63,4 @@ void GraphicsManager::vDoCycleInt() {
}
-/*------------------------------------------------------------------------*/
-
-IntNode::IntNode() {
- _nextNode = NULL;
- _intFunc = NULL;
- _curTime = 0;
- _timeReset = 0;
- _flags = 0;
-}
-
} // End of namespace Voyeur
diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h
index 7589e8f1ec..d92a6b6268 100644
--- a/engines/voyeur/graphics.h
+++ b/engines/voyeur/graphics.h
@@ -23,6 +23,7 @@
#ifndef VOYEUR_GRAPHICS_H
#define VOYEUR_GRAPHICS_H
+#include "voyeur/game.h"
#include "common/scummsys.h"
#include "common/array.h"
#include "graphics/surface.h"
@@ -34,26 +35,11 @@ namespace Voyeur {
#define PALETTE_COUNT 256
#define PALETTE_SIZE (256 * 3)
-typedef void (*IntFuncPtr)();
-
-class IntNode {
-public:
- IntNode *_nextNode;
- IntFuncPtr _intFunc;
- uint32 _curTime;
- uint32 _timeReset;
- uint32 _flags;
-public:
- IntNode();
-};
+class VoyeurEngine;
class GraphicsManager {
-private:
- static void fadeIntFunc();
- static void vDoFadeInt();
- static void vDoCycleInt();
- void addIntNode(IntNode *node);
public:
+ VoyeurEngine *_vm;
bool _palFlag;
IntNode _fadeIntNode;
IntNode _cycleIntNode;
@@ -61,12 +47,18 @@ public:
IntNode _mainintnode;
byte _VGAColors[PALETTE_SIZE];
Common::Array<byte *> _colorChain;
+private:
+ static void fadeIntFunc();
+ static void vDoFadeInt();
+ static void vDoCycleInt();
+ void addIntNode(IntNode *node);
public:
GraphicsManager();
+ void setVm(VoyeurEngine *vm) { _vm = vm; }
void sInitGraphics();
- void addFadeInt();
void vInitColor();
+ void addFadeInt();
};
} // End of namespace Voyeur
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 99671f647a..ac1105e4c7 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -91,6 +91,7 @@ int VoyeurEngine::getRandomNumber(int maxNumber) {
void VoyeurEngine::initialiseManagers() {
_eventManager.setVm(this);
+ _graphicsManager.setVm(this);
}
void VoyeurEngine::ESP_Init() {
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index e2092b3b9b..6676b1c742 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -70,7 +70,6 @@ private:
byte *_fontPtr;
SVoy _voy;
Common::Array<int> _resolves;
- IntData _intPtr;
void ESP_Init();
void initialiseManagers();
@@ -82,7 +81,8 @@ protected:
// Engine APIs
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
-
+public:
+ IntData _intPtr;
public:
VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc);
virtual ~VoyeurEngine();