diff options
-rw-r--r-- | engines/voyeur/events.cpp | 22 | ||||
-rw-r--r-- | engines/voyeur/events.h | 91 | ||||
-rw-r--r-- | engines/voyeur/game.cpp | 106 | ||||
-rw-r--r-- | engines/voyeur/game.h | 144 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 1 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 3 | ||||
-rw-r--r-- | engines/voyeur/module.mk | 4 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 59 | ||||
-rw-r--r-- | engines/voyeur/voyeur.h | 11 | ||||
-rw-r--r-- | engines/voyeur/voyeur_game.cpp | 36 |
10 files changed, 209 insertions, 268 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index 56b7afd377..2c534b666b 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -22,6 +22,7 @@ #include "voyeur/events.h" #include "voyeur/voyeur.h" +#include "common/events.h" #include "graphics/cursorman.h" #include "graphics/palette.h" @@ -43,6 +44,27 @@ IntNode::IntNode(uint16 curTime, uint16 timeReset, uint16 flags) { /*------------------------------------------------------------------------*/ +IntData::IntData() { + _field9 = false; + _flipWait = false; + _hasPalette = false; + field16 = 0; + field1A = 0; + field1E = 0; + field22 = 0; + field24 = 0; + field26 = 0; + field2A = 0; + field38 = 0; + field3B = 0; + field3D = 0; + _palStartIndex = 0; + _palEndIndex = 0; + _palette = NULL; +} + +/*------------------------------------------------------------------------*/ + EventsManager::EventsManager(): _intPtr(_gameData), _fadeIntNode(0, 0, 3), _cycleIntNode(0, 0, 3) { _cycleStatus = 0; diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h index 0b78bc2dd8..efc7ac4c47 100644 --- a/engines/voyeur/events.h +++ b/engines/voyeur/events.h @@ -27,7 +27,6 @@ #include "common/list.h" #include "graphics/surface.h" #include "voyeur/files.h" -#include "voyeur/game.h" namespace Voyeur { @@ -51,6 +50,96 @@ public: IntNode(uint16 curTime, uint16 timeReset, uint16 flags); }; +class Event { +public: + int _hours; + int _minutes; + int _seconds; + int _type; + int _data1; + int _data2; + byte *_data; +}; + +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: + bool _field9; + bool _flipWait; + int field16; + int field1A; + int field1E; + int field22; + int field24; + int field26; + int field2A; + bool _hasPalette; + int field38; + int field3B; + int field3D; + int _palStartIndex; + int _palEndIndex; + byte *_palette; +public: + IntData(); + + void audioInit(); +}; + class EventsManager { private: VoyeurEngine *_vm; diff --git a/engines/voyeur/game.cpp b/engines/voyeur/game.cpp deleted file mode 100644 index 85ea5df50a..0000000000 --- a/engines/voyeur/game.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* 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" -#include "voyeur/voyeur.h" - -namespace Voyeur { - -IntData::IntData() { - _field9 = false; - _flipWait = false; - _hasPalette = false; - field16 = 0; - field1A = 0; - field1E = 0; - field22 = 0; - field24 = 0; - field26 = 0; - field2A = 0; - field38 = 0; - field3B = 0; - field3D = 0; - _palStartIndex = 0; - _palEndIndex = 0; - _palette = NULL; -} - -void IntData::audioInit() { - -} - -/*------------------------------------------------------------------------*/ - -Game::Game() { - _iForceDeath = -1; -} - -void Game::doTransitionCard(const Common::String &time, const Common::String &location) { - _vm->_graphicsManager.setColor(128, 16, 16, 16); - _vm->_graphicsManager.setColor(224, 220, 220, 220); - _vm->_eventsManager._intPtr.field38 = true; - _vm->_eventsManager._intPtr._hasPalette = true; - - (*_vm->_graphicsManager._vPort)->setupViewPort(); - (*_vm->_graphicsManager._vPort)->fillPic(128); - _vm->_graphicsManager.flipPage(); - _vm->_eventsManager.sWaitFlip(); - - (*_vm->_graphicsManager._vPort)->_parent->_flags |= DISPFLAG_8; - _vm->_graphicsManager.flipPage(); - _vm->_eventsManager.sWaitFlip(); - (*_vm->_graphicsManager._vPort)->fillPic(128); - - FontInfoResource &fi = *_vm->_graphicsManager._fontPtr; - fi._curFont = _vm->_bVoy->boltEntry(257)._fontResource; - fi._foreColor = 224; - fi._fontSaveBack = 0; - fi._pos = Common::Point(0, 116); - fi._justify = ALIGN_CENTRE; - fi._justifyWidth = 384; - fi._justifyHeight = 120; - - (*_vm->_graphicsManager._vPort)->drawText(time); - - if (!location.empty()) { - fi._pos = Common::Point(0, 138); - fi._justify = ALIGN_CENTRE; - fi._justifyWidth = 384; - fi._justifyHeight = 140; - - (*_vm->_graphicsManager._vPort)->drawText(location); - } - - (*_vm->_graphicsManager._vPort)->_parent->_flags |= DISPFLAG_8; - _vm->_graphicsManager.flipPage(); - _vm->_eventsManager.sWaitFlip(); -} - -void Game::addVideoEventStart() { - -} - -void Game::playStamp() { - -} - -} // End of namespace Voyeur diff --git a/engines/voyeur/game.h b/engines/voyeur/game.h deleted file mode 100644 index cb7f62db57..0000000000 --- a/engines/voyeur/game.h +++ /dev/null @@ -1,144 +0,0 @@ -/* 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" -#include "common/str.h" - -namespace Voyeur { - -class VoyeurEngine; - -class Event { -public: - int _hours; - int _minutes; - int _seconds; - int _type; - int _data1; - int _data2; - byte *_data; -}; - -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: - bool _field9; - bool _flipWait; - int field16; - int field1A; - int field1E; - int field22; - int field24; - int field26; - int field2A; - bool _hasPalette; - int field38; - int field3B; - int field3D; - int _palStartIndex; - int _palEndIndex; - byte *_palette; -public: - IntData(); - - void audioInit(); -}; - -class Game { -private: - VoyeurEngine *_vm; -public: - int _v2A098; - int _v2A0A6; - int _v2A0A4; - int _v2A09A; - int _iForceDeath; -public: - Game(); - void setVm(VoyeurEngine *vm) { _vm = vm; } - - void doTransitionCard(const Common::String &time, const Common::String &location); - void addVideoEventStart(); - void playStamp(); -}; - -} // End of namespace Voyeur - -#endif /* VOYEUR_GAME_H */ diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index 2ee385f1f7..dc62336c25 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -21,7 +21,6 @@ */ #include "voyeur/graphics.h" -#include "voyeur/game.h" #include "voyeur/voyeur.h" #include "engines/util.h" #include "graphics/palette.h" diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index 23a29657f1..518ec1a459 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -23,10 +23,9 @@ #ifndef VOYEUR_GRAPHICS_H #define VOYEUR_GRAPHICS_H -//#include "voyeur/files.h" -#include "voyeur/game.h" #include "common/scummsys.h" #include "common/array.h" +#include "common/rect.h" #include "graphics/surface.h" namespace Voyeur { diff --git a/engines/voyeur/module.mk b/engines/voyeur/module.mk index 40efce40ee..1562624fbb 100644 --- a/engines/voyeur/module.mk +++ b/engines/voyeur/module.mk @@ -5,13 +5,13 @@ MODULE_OBJS := \ debugger.o \ detection.o \ events.o \ - game.o \ files.o \ graphics.o \ sound.o \ staticres.o \ utils.o \ - voyeur.o + voyeur.o \ + voyeur_game.o # This module can be built as a plugin ifeq ($(ENABLE_VOYEUR), DYNAMIC_PLUGIN) diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 4df5ebef28..eaae6c8290 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -39,6 +39,7 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc) Common::Point(1, 1), 1, 0, 0) { DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level"); _bVoy = NULL; + _iForceDeath = -1; initialiseManagers(); } @@ -86,10 +87,10 @@ Common::Error VoyeurEngine::run() { _eventsManager.resetMouse(); if (doHeadTitle()) { - if (_game._iForceDeath >= 1 && _game._iForceDeath <= 4) + if (_iForceDeath >= 1 && _iForceDeath <= 4) _voy._eCursorOff[58] |= 0x80; - _game.playStamp(); + playStamp(); } //doHeadTitle(); @@ -106,7 +107,6 @@ void VoyeurEngine::initialiseManagers() { _debugger.setVm(this); _eventsManager.setVm(this); _filesManager.setVm(this); - _game.setVm(this); _graphicsManager.setVm(this); _soundManager.setVm(this); @@ -175,7 +175,7 @@ bool VoyeurEngine::doHeadTitle() { // Opening if (!_voy._incriminate) { doOpening(); - _game.doTransitionCard("Saturday Afternoon", "Player's Apartment"); + doTransitionCard("Saturday Afternoon", "Player's Apartment"); _eventsManager.delay(90); } else { _voy._incriminate = false; @@ -479,15 +479,15 @@ void VoyeurEngine::doOpening() { byte *whTable = _bVoy->memberAddr(0x217); int frmaeIndex = 0; int creditShow = 1; - _game._v2A098 = 1; + _v2A098 = 1; _voy._eCursorOff[52] = 0; _voy._RTVNum = 0; _voy._eCursorOff[50] = _voy._RTVNum; - _game._v2A0A6 = 4; - _game._v2A0A4 = 0; + _v2A0A6 = 4; + _v2A0A4 = 0; _voy._eCursorOff[58] = 16; - _game._v2A09A = -1; - _game.addVideoEventStart(); + _v2A09A = -1; + addVideoEventStart(); _voy._eCursorOff[58] &= ~1; for (int i = 0; i < 256; ++i) @@ -545,4 +545,45 @@ void VoyeurEngine::playRL2Video(const Common::String &filename) { } } +void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::String &location) { + _graphicsManager.setColor(128, 16, 16, 16); + _graphicsManager.setColor(224, 220, 220, 220); + _eventsManager._intPtr.field38 = true; + _eventsManager._intPtr._hasPalette = true; + + (*_graphicsManager._vPort)->setupViewPort(); + (*_graphicsManager._vPort)->fillPic(128); + _graphicsManager.flipPage(); + _eventsManager.sWaitFlip(); + + (*_graphicsManager._vPort)->_parent->_flags |= DISPFLAG_8; + _graphicsManager.flipPage(); + _eventsManager.sWaitFlip(); + (*_graphicsManager._vPort)->fillPic(128); + + FontInfoResource &fi = *_graphicsManager._fontPtr; + fi._curFont = _bVoy->boltEntry(257)._fontResource; + fi._foreColor = 224; + fi._fontSaveBack = 0; + fi._pos = Common::Point(0, 116); + fi._justify = ALIGN_CENTRE; + fi._justifyWidth = 384; + fi._justifyHeight = 120; + + (*_graphicsManager._vPort)->drawText(time); + + if (!location.empty()) { + fi._pos = Common::Point(0, 138); + fi._justify = ALIGN_CENTRE; + fi._justifyWidth = 384; + fi._justifyHeight = 140; + + (*_graphicsManager._vPort)->drawText(location); + } + + (*_graphicsManager._vPort)->_parent->_flags |= DISPFLAG_8; + _graphicsManager.flipPage(); + _eventsManager.sWaitFlip(); +} + } // End of namespace Voyeur diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index f698aae702..9306fb55e5 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -26,7 +26,6 @@ #include "voyeur/debugger.h" #include "voyeur/events.h" #include "voyeur/files.h" -#include "voyeur/game.h" #include "voyeur/graphics.h" #include "voyeur/sound.h" #include "common/scummsys.h" @@ -64,9 +63,13 @@ class VoyeurEngine : public Engine { private: const VoyeurGameDescription *_gameDescription; Common::RandomSource _randomSource; - Common::Array<int> _resolves; FontInfoResource _defaultFontInfo; + int _iForceDeath; + int _v2A098; + int _v2A0A6; + int _v2A0A4; + int _v2A09A; void ESP_Init(); void initialiseManagers(); @@ -74,12 +77,14 @@ private: void initBolt(); void vInitInterrupts(); void initInput(); + void addVideoEventStart(); bool doHeadTitle(); void showConversionScreen(); bool doLock(); void showTitleScreen(); void doOpening(); + void playStamp(); protected: // Engine APIs virtual Common::Error run(); @@ -89,7 +94,6 @@ public: Debugger _debugger; EventsManager _eventsManager; FilesManager _filesManager; - Game _game; GraphicsManager _graphicsManager; SoundManager _soundManager; SVoy _voy; @@ -112,6 +116,7 @@ public: virtual Common::Error saveGameState(int slot, const Common::String &desc); void playRL2Video(const Common::String &filename); + void doTransitionCard(const Common::String &time, const Common::String &location); }; } // End of namespace Voyeur diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp new file mode 100644 index 0000000000..bc7fa6fe20 --- /dev/null +++ b/engines/voyeur/voyeur_game.cpp @@ -0,0 +1,36 @@ +/* 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/voyeur.h" + +namespace Voyeur { + +void VoyeurEngine::addVideoEventStart() { + +} + + +void VoyeurEngine::playStamp() { + +} + +} // End of namespace Voyeur |