aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorPaul Gilbert2013-05-23 23:13:28 +1000
committerPaul Gilbert2013-05-23 23:13:28 +1000
commit0d26e515fb89a2a61c16eb3bb5b2e9f544dc4aff (patch)
tree42774a469a775252157f0a2f14c890121cb1b959 /engines/voyeur
parent71d2b5008de98bd94fc439cdda7ba8f8f13e760e (diff)
downloadscummvm-rg350-0d26e515fb89a2a61c16eb3bb5b2e9f544dc4aff.tar.gz
scummvm-rg350-0d26e515fb89a2a61c16eb3bb5b2e9f544dc4aff.tar.bz2
scummvm-rg350-0d26e515fb89a2a61c16eb3bb5b2e9f544dc4aff.zip
VOYEUR: Start of work on general initialisation
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/events.h3
-rw-r--r--engines/voyeur/files.h2
-rw-r--r--engines/voyeur/game.cpp31
-rw-r--r--engines/voyeur/game.h109
-rw-r--r--engines/voyeur/graphics.cpp47
-rw-r--r--engines/voyeur/graphics.h36
-rw-r--r--engines/voyeur/module.mk1
-rw-r--r--engines/voyeur/voyeur.cpp19
-rw-r--r--engines/voyeur/voyeur.h75
9 files changed, 249 insertions, 74 deletions
diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h
index 5715591c52..1588cac35d 100644
--- a/engines/voyeur/events.h
+++ b/engines/voyeur/events.h
@@ -24,7 +24,6 @@
#define VOYEUR_EVENTS_H
#include "common/scummsys.h"
-#include "common/events.h"
namespace Voyeur {
@@ -42,4 +41,4 @@ public:
} // End of namespace Voyeur
-#endif /* VOYEUR_VOYEUR_H */
+#endif /* VOYEUR_EVENTS_H */
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index ed20528a5f..1503ddf15a 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -133,4 +133,4 @@ public:
} // End of namespace Voyeur
-#endif /* VOYEUR_VOYEUR_H */
+#endif /* VOYEUR_FILES_H */
diff --git a/engines/voyeur/game.cpp b/engines/voyeur/game.cpp
new file mode 100644
index 0000000000..3d80b6004f
--- /dev/null
+++ b/engines/voyeur/game.cpp
@@ -0,0 +1,31 @@
+/* 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.
+ *
+ */
+
+#include "voyeur/game.h"
+
+namespace Voyeur {
+
+void IntData::audioInit() {
+
+}
+
+} // End of namespace Voyeur
diff --git a/engines/voyeur/game.h b/engines/voyeur/game.h
new file mode 100644
index 0000000000..44d8c05c88
--- /dev/null
+++ b/engines/voyeur/game.h
@@ -0,0 +1,109 @@
+/* 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_GAME_H
+#define VOYEUR_GAME_H
+
+#include "common/scummsys.h"
+#include "common/events.h"
+
+namespace Voyeur {
+
+class VoyeurEngine;
+
+class Event {
+public:
+ int _hours;
+ int _minutes;
+ int _seconds;
+ int _type;
+ int _data1;
+ int _data2;
+ int _data3;
+ int _data4;
+};
+
+class SVoy {
+public:
+ int _delaySecs;
+ int _RTANum;
+ int _RTVNum;
+ int _switchBGNum;
+ int _group;
+ int _resolvePtr;
+ int _seconds;
+ int _minutes;
+ int _hours;
+ int _morning;
+ int _timeChangeFlag;
+ int _totalSeconds;
+ int _gameSeconds;
+ int _vCursorOn[160];
+ int _vCursorOff[160];
+ int _aCursorOn[60];
+ int _aCursorOff[60];
+ int _eCursorOn[60];
+ int _eCursorOff[60];
+ int _timeStart;
+ int _duration;
+ int _vidStart;
+ int _doApt;
+ int _function;
+ int _anim;
+ int _level;
+ int _levelDone;
+ int _flags;
+ int _evGroup;
+ byte *_evPicPtrs[6];
+ byte *_evCmPtrs[6];
+ int _audioTime;
+ int _phones[5];
+ int _numPhonesUsed;
+ int _evidence[20];
+ int _computerNum;
+ int _computerBut;
+ int _computerOn;
+ int _computerOff;
+ int _dead;
+ int _deadTime;
+ int _eventCnt;
+ Event _eventTable[1000];
+ int _curICF0;
+ int _curICF1;
+ int _fadeICF0;
+ int _fadeICF1;
+ int _fadeFunc;
+ int _lastInplay;
+ int _incriminate;
+ int _policeEvent;
+};
+
+class IntData {
+public:
+ byte *_colors;
+public:
+ void audioInit();
+};
+
+} // End of namespace Voyeur
+
+#endif /* VOYEUR_GAME_H */
diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp
index 4763a2d551..311199c045 100644
--- a/engines/voyeur/graphics.cpp
+++ b/engines/voyeur/graphics.cpp
@@ -21,6 +21,8 @@
*/
#include "voyeur/graphics.h"
+#include "engines/util.h"
+#include "graphics/surface.h"
namespace Voyeur {
@@ -28,4 +30,49 @@ GraphicsManager::GraphicsManager() {
_palFlag = false;
}
+void GraphicsManager::sInitGraphics() {
+ initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, false);
+}
+
+void GraphicsManager::addFadeInt() {
+ _fadeIntNode._intFunc = fadeIntFunc;
+ _fadeIntNode._flags = 0;
+ _fadeIntNode._curTime = 0;
+ _fadeIntNode._timeReset = 1;
+
+ addIntNode(&_fadeIntNode);
+}
+
+void GraphicsManager::vInitColor() {
+ _fadeIntNode._intFunc = vDoFadeInt;
+ _cycleIntNode._intFunc = vDoCycleInt;
+
+}
+
+void GraphicsManager::addIntNode(IntNode *node) {
+
+}
+
+void GraphicsManager::fadeIntFunc() {
+
+}
+
+void GraphicsManager::vDoFadeInt() {
+
+}
+
+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 bac4787cc7..7589e8f1ec 100644
--- a/engines/voyeur/graphics.h
+++ b/engines/voyeur/graphics.h
@@ -24,19 +24,51 @@
#define VOYEUR_GRAPHICS_H
#include "common/scummsys.h"
+#include "common/array.h"
#include "graphics/surface.h"
namespace Voyeur {
+#define SCREEN_WIDTH 320
+#define SCREEN_HEIGHT 200
+#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 GraphicsManager {
+private:
+ static void fadeIntFunc();
+ static void vDoFadeInt();
+ static void vDoCycleInt();
+ void addIntNode(IntNode *node);
public:
bool _palFlag;
+ IntNode _fadeIntNode;
+ IntNode _cycleIntNode;
+ IntNode _evintnode;
+ IntNode _mainintnode;
+ byte _VGAColors[PALETTE_SIZE];
+ Common::Array<byte *> _colorChain;
public:
GraphicsManager();
+ void sInitGraphics();
- void addFadeInt() { } // TODO;
+ void addFadeInt();
+ void vInitColor();
};
} // End of namespace Voyeur
-#endif /* VOYEUR_VOYEUR_H */
+#endif /* VOYEUR_GRAPHICS_H */
diff --git a/engines/voyeur/module.mk b/engines/voyeur/module.mk
index 24984cd8d3..b13c414b92 100644
--- a/engines/voyeur/module.mk
+++ b/engines/voyeur/module.mk
@@ -3,6 +3,7 @@ MODULE := engines/voyeur
MODULE_OBJS := \
detection.o \
events.o \
+ game.o \
files.o \
graphics.o \
voyeur.o
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index d20a916b35..99671f647a 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -21,6 +21,7 @@
*/
#include "voyeur/voyeur.h"
+#include "voyeur/graphics.h"
#include "common/scummsys.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
@@ -74,8 +75,8 @@ Common::Error VoyeurEngine::saveGameState(int slot, const Common::String &desc)
Common::Error VoyeurEngine::run() {
ESP_Init();
-
globalInitBolt();
+
_eventManager.resetMouse();
//doHeadTitle();
@@ -96,6 +97,8 @@ void VoyeurEngine::ESP_Init() {
}
void VoyeurEngine::globalInitBolt() {
+ initBolt();
+
_filesManager.openBoltLib("bvoy.blt", _bVoyBoltFile);
_bVoyBoltFile->getBoltGroup(0x10000);
_bVoyBoltFile->getBoltGroup(0x10100);
@@ -115,4 +118,18 @@ void VoyeurEngine::globalInitBolt() {
_graphicsManager.addFadeInt();
}
+void VoyeurEngine::initBolt() {
+ vInitInterrupts();
+ _graphicsManager.sInitGraphics();
+ _graphicsManager.vInitColor();
+ initInput();
+}
+
+void VoyeurEngine::vInitInterrupts() {
+ _intPtr._colors = &_graphicsManager._VGAColors[0];
+}
+
+void VoyeurEngine::initInput() {
+}
+
} // End of namespace Voyeur
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index a930c5d0c6..e2092b3b9b 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -25,6 +25,7 @@
#include "voyeur/events.h"
#include "voyeur/files.h"
+#include "voyeur/game.h"
#include "voyeur/graphics.h"
#include "common/scummsys.h"
#include "common/system.h"
@@ -48,8 +49,7 @@ namespace Voyeur {
#define DEBUG_INTERMEDIATE 2
#define DEBUG_DETAILED 3
-#define SCREEN_WIDTH 320
-#define SCREEN_HEIGHT 200
+#define MAX_RESOLVE 1000
enum VoyeurDebugChannels {
kDebugPath = 1 << 0
@@ -57,72 +57,6 @@ enum VoyeurDebugChannels {
struct VoyeurGameDescription;
-class Event {
-public:
- int _hours;
- int _minutes;
- int _seconds;
- int _type;
- int _data1;
- int _data2;
- int _data3;
- int _data4;
-};
-
-class SVoy {
-public:
- int _delaySecs;
- int _RTANum;
- int _RTVNum;
- int _switchBGNum;
- int _group;
- int _resolvePtr;
- int _seconds;
- int _minutes;
- int _hours;
- int _morning;
- int _timeChangeFlag;
- int _totalSeconds;
- int _gameSeconds;
- int _vCursorOn[160];
- int _vCursorOff[160];
- int _aCursorOn[60];
- int _aCursorOff[60];
- int _eCursorOn[60];
- int _eCursorOff[60];
- int _timeStart;
- int _duration;
- int _vidStart;
- int _doApt;
- int _function;
- int _anim;
- int _level;
- int _levelDone;
- int _flags;
- int _evGroup;
- byte *_evPicPtrs[6];
- byte *_evCmPtrs[6];
- int _audioTime;
- int _phones[5];
- int _numPhonesUsed;
- int _evidence[20];
- int _computerNum;
- int _computerBut;
- int _computerOn;
- int _computerOff;
- int _dead;
- int _deadTime;
- int _eventCnt;
- Event _eventTable[1000];
- int _curICF0;
- int _curICF1;
- int _fadeICF0;
- int _fadeICF1;
- int _fadeFunc;
- int _lastInplay;
- int _incriminate;
- int _policeEvent;
-};
class VoyeurEngine : public Engine {
private:
@@ -135,10 +69,15 @@ private:
BoltFile *_bVoyBoltFile;
byte *_fontPtr;
SVoy _voy;
+ Common::Array<int> _resolves;
+ IntData _intPtr;
void ESP_Init();
void initialiseManagers();
void globalInitBolt();
+ void initBolt();
+ void vInitInterrupts();
+ void initInput();
protected:
// Engine APIs
virtual Common::Error run();