diff options
author | Paul Gilbert | 2013-06-10 21:29:12 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-06-10 21:29:12 -0400 |
commit | 7bf4d492538fefa73787f687913f1b905af8f808 (patch) | |
tree | 20318b76133cf2bab724b52eaf0f483a6afcad63 /engines/voyeur | |
parent | 54c470d36ff9d739644bb93df7e693d162eedbd1 (diff) | |
download | scummvm-rg350-7bf4d492538fefa73787f687913f1b905af8f808.tar.gz scummvm-rg350-7bf4d492538fefa73787f687913f1b905af8f808.tar.bz2 scummvm-rg350-7bf4d492538fefa73787f687913f1b905af8f808.zip |
VOYEUR: Starting to implement code for the lock screen
Diffstat (limited to 'engines/voyeur')
-rw-r--r-- | engines/voyeur/files.cpp | 19 | ||||
-rw-r--r-- | engines/voyeur/files.h | 1 | ||||
-rw-r--r-- | engines/voyeur/game.cpp | 3 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 17 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 22 | ||||
-rw-r--r-- | engines/voyeur/module.mk | 1 | ||||
-rw-r--r-- | engines/voyeur/utils.cpp | 31 | ||||
-rw-r--r-- | engines/voyeur/utils.h | 37 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 101 | ||||
-rw-r--r-- | engines/voyeur/voyeur.h | 6 |
10 files changed, 198 insertions, 40 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 02d7c7a25b..bdbf05c633 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -191,6 +191,25 @@ bool FilesManager::openBoltLib(const Common::String &filename, BoltFile *&boltFi return true; } +byte *FilesManager::fload(const Common::String &filename, int *size) { + Common::File f; + int filesize; + byte *data = NULL; + + if (f.open(filename)) { + // Read in the file + filesize = f.size(); + data = new byte[filesize]; + f.read(data, filesize); + } else { + filesize = 0; + } + + if (size) + *size = filesize; + return data; +} + /*------------------------------------------------------------------------*/ const BoltMethodPtr BoltFile::_fnInitType[25] = { diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index df29924fa3..d1b3a09ac4 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -195,6 +195,7 @@ public: void setVm(VoyeurEngine *vm) { _boltFilesState._vm = vm; } bool openBoltLib(const Common::String &filename, BoltFile *&boltFile); + byte *fload(const Common::String &filename, int *size = NULL); }; class DisplayResource { diff --git a/engines/voyeur/game.cpp b/engines/voyeur/game.cpp index e1ad8592f0..9d71fbf653 100644 --- a/engines/voyeur/game.cpp +++ b/engines/voyeur/game.cpp @@ -21,6 +21,7 @@ */ #include "voyeur/game.h" +#include "voyeur/voyeur.h" namespace Voyeur { @@ -47,4 +48,6 @@ void IntData::audioInit() { } +/*------------------------------------------------------------------------*/ + } // End of namespace Voyeur diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index e579d7f2ff..0f077d5074 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -29,6 +29,23 @@ namespace Voyeur { +FontInfo::FontInfo() { + _curFont = NULL; + _picFlags = 3; + _picSelect = 0xff; + _picPick = 0xff; + _picOnOff = 0; + _fontFlags = 0; + _justify = 0; + _fontSaveBack = 0; + _justifyWidth = 1; + _justifyHeight = 1; + _shadow = Common::Point(1, 1); + _foreColor = 1; + _backColor = 0; + _shadowColor = 0; +} + GraphicsManager::GraphicsManager() { _SVGAPage = 0; _SVGAMode = 0; diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index 5d0b00d35c..2e65089af6 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -42,6 +42,28 @@ class DisplayResource; class PictureResource; class ViewPortResource; class ViewPortListResource; +class FontResource; + +class FontInfo { +public: + FontResource *_curFont; + byte _picFlags; + byte _picSelect; + byte _picPick; + byte _picOnOff; + byte _fontFlags; + byte _justify; + int _fontSaveBack; + Common::Point _pos; + int _justifyWidth; + int _justifyHeight; + Common::Point _shadow; + int _foreColor; + int _backColor; + int _shadowColor; +public: + FontInfo(); +}; typedef void (GraphicsManager::*GraphicMethodPtr)(); typedef void (GraphicsManager::*ViewPortSetupPtr)(ViewPortResource *); diff --git a/engines/voyeur/module.mk b/engines/voyeur/module.mk index bbe3d2e5e9..3e9cbe436a 100644 --- a/engines/voyeur/module.mk +++ b/engines/voyeur/module.mk @@ -7,6 +7,7 @@ MODULE_OBJS := \ game.o \ files.o \ graphics.o \ + utils.o \ voyeur.o # This module can be built as a plugin diff --git a/engines/voyeur/utils.cpp b/engines/voyeur/utils.cpp new file mode 100644 index 0000000000..4ddfd71f6d --- /dev/null +++ b/engines/voyeur/utils.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/utils.h" + +namespace Voyeur { + +void LockClass::getSysData() { + +} + +} // End of namespace Voyeur diff --git a/engines/voyeur/utils.h b/engines/voyeur/utils.h new file mode 100644 index 0000000000..9aed6b3ef4 --- /dev/null +++ b/engines/voyeur/utils.h @@ -0,0 +1,37 @@ +/* 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_UTILS_H +#define VOYEUR_UTILS_H + +#include "common/scummsys.h" + +namespace Voyeur { + +class LockClass { +public: + void getSysData(); +}; + +} // End of namespace Voyeur + +#endif /* VOYEUR_UTILS_H */ diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 93bb7a664a..5c3c42c46f 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -144,45 +144,70 @@ void VoyeurEngine::doHeadTitle() { _eventsManager.startMainClockInt(); // Show starting screen - if (_bVoy->getBoltGroup(0x10500)) { - _graphicsManager._backgroundPage = _bVoy->getBoltEntry(0x5020000)._picResource; - (*_graphicsManager._vPort)->setupViewPort(); - (*_graphicsManager._vPort)->_flags |= 8; - - _graphicsManager.flipPage(); - _eventsManager.sWaitFlip(); - - // Immediate palette load to show the initial screen - CMapResource *cMap = _bVoy->getCMapResource(0x5030000); - assert(cMap); - cMap->_steps = 0; - cMap->startFade(); - - // Wait briefly - _eventsManager.delay(150); - if (shouldQuit()) - return; - - // Fade out the screen - cMap = _bVoy->getCMapResource(0x5040000); - cMap->_steps = 30; - cMap->startFade(); - if (shouldQuit()) - return; - - (*_graphicsManager._vPort)->_flags |= 8; - _graphicsManager.flipPage(); - _eventsManager.sWaitFlip(); - - while (!shouldQuit() && (_eventsManager._fadeStatus & 1)) - _eventsManager.delay(1); - - _graphicsManager.screenReset(); - _bVoy->freeBoltGroup(0x10500); - - if (shouldQuit()) - return; + if (_bVoy->getBoltGroup(0x10500)) + showConversionScreen(); + if (shouldQuit()) + return; + + doLock(); + + // TODO +} + +void VoyeurEngine::showConversionScreen() { + _graphicsManager._backgroundPage = _bVoy->getBoltEntry(0x5020000)._picResource; + (*_graphicsManager._vPort)->setupViewPort(); + (*_graphicsManager._vPort)->_flags |= 8; + + _graphicsManager.flipPage(); + _eventsManager.sWaitFlip(); + + // Immediate palette load to show the initial screen + CMapResource *cMap = _bVoy->getCMapResource(0x5030000); + assert(cMap); + cMap->_steps = 0; + cMap->startFade(); + + // Wait briefly + _eventsManager.delay(150); + if (shouldQuit()) + return; + + // Fade out the screen + cMap = _bVoy->getCMapResource(0x5040000); + cMap->_steps = 30; + cMap->startFade(); + if (shouldQuit()) + return; + + (*_graphicsManager._vPort)->_flags |= 8; + _graphicsManager.flipPage(); + _eventsManager.sWaitFlip(); + + while (!shouldQuit() && (_eventsManager._fadeStatus & 1)) + _eventsManager.delay(1); + + _graphicsManager.screenReset(); + _bVoy->freeBoltGroup(0x10500); +} + +bool VoyeurEngine::doLock() { + int var12 = 0; + int var14 = 0; + int di = 1; + int wrongSize; + byte *buttonVoc = _filesManager.fload("button.voc"); + byte *wrongVoc = _filesManager.fload("wrong.voc", &wrongSize); + bool result = false; + + if (_bVoy->getBoltGroup(0x10700)) { + } + + delete[] buttonVoc; + delete[] wrongVoc; + + return result; } } // End of namespace Voyeur diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index 346d7fbc13..0b74208fa4 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -75,6 +75,10 @@ private: void initBolt(); void vInitInterrupts(); void initInput(); + + void doHeadTitle(); + void showConversionScreen(); + bool doLock(); protected: // Engine APIs virtual Common::Error run(); @@ -101,8 +105,6 @@ public: virtual bool canSaveGameStateCurrently(); virtual Common::Error loadGameState(int slot); virtual Common::Error saveGameState(int slot, const Common::String &desc); - - void doHeadTitle(); }; } // End of namespace Voyeur |