diff options
author | Paul Gilbert | 2013-05-27 23:01:15 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-05-27 23:01:15 -0400 |
commit | 83524863d744c71eb5083fc4f9ce32d576f7810d (patch) | |
tree | 2c131359cfdb09919008b7c9ab919c9973375b87 /engines/voyeur | |
parent | ab4f798f5bedeec7520c15f8b5b64efda469d95f (diff) | |
download | scummvm-rg350-83524863d744c71eb5083fc4f9ce32d576f7810d.tar.gz scummvm-rg350-83524863d744c71eb5083fc4f9ce32d576f7810d.tar.bz2 scummvm-rg350-83524863d744c71eb5083fc4f9ce32d576f7810d.zip |
VOYEUR: Implemented remaining Bolt init methods
Diffstat (limited to 'engines/voyeur')
-rw-r--r-- | engines/voyeur/events.cpp | 9 | ||||
-rw-r--r-- | engines/voyeur/events.h | 4 | ||||
-rw-r--r-- | engines/voyeur/files.cpp | 56 | ||||
-rw-r--r-- | engines/voyeur/files.h | 32 |
4 files changed, 94 insertions, 7 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index 2fb41475e7..f84c97879a 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -25,6 +25,10 @@ namespace Voyeur { +EventsManager::EventsManager() { + _cycleStatus = 0; +} + void EventsManager::resetMouse() { // No implementation } @@ -40,4 +44,9 @@ void EventsManager::mainVoyeurIntFunc() { } +void EventsManager::vStopCycle() { + _cycleIntNode._flags = 1; + _cycleStatus &= 2; +} + } // End of namespace Voyeur diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h index 0acdc73908..a3696a9568 100644 --- a/engines/voyeur/events.h +++ b/engines/voyeur/events.h @@ -40,12 +40,14 @@ public: IntNode _cycleIntNode; IntNode _evintnode; IntNode _mainIntNode; + int _cycleStatus; public: - EventsManager() {} + EventsManager(); void setVm(VoyeurEngine *vm) { _vm = vm; } void resetMouse(); void startMainClockInt(); + void vStopCycle(); }; } // End of namespace Voyeur diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 811bdf600b..74c2f17103 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -365,11 +365,16 @@ void BoltFile::sInitPic() { } void BoltFile::vInitCMap() { - error("TODO: vInitCMap not implemented"); + initDefault(); + _state._curMemberPtr->_cMapResource = new CMapResource( + _state, _state._curMemberPtr->_data); } void BoltFile::vInitCycl() { - error("TODO: vInitCycl not implemented"); + initDefault(); + _state._vm->_eventsManager.vStopCycle(); + _state._curMemberPtr->_vInitCyclResource = new VInitCyclResource( + _state, _state._curMemberPtr->_data); } void BoltFile::initViewPort() { @@ -385,11 +390,13 @@ void BoltFile::initViewPortList() { } void BoltFile::initFontInfo() { - error("TODO: initFontInfo not implemented"); + initDefault(); + _state._curMemberPtr->_fontResource = new FontResource( + _state, _state._curMemberPtr->_data); } void BoltFile::initSoundMap() { - error("TODO: initSoundMap not implemented"); + initDefault(); } /*------------------------------------------------------------------------*/ @@ -422,6 +429,10 @@ BoltEntry::BoltEntry(Common::SeekableReadStream *f): _file(f) { _data = NULL; _picResource = NULL; _viewPortResource = NULL; + _viewPortListResource = NULL; + _fontResource = NULL; + _cMapResource = NULL; + _vInitCyclResource = NULL; byte buffer[16]; _file->read(&buffer[0], 16); @@ -438,6 +449,9 @@ BoltEntry::~BoltEntry() { delete _picResource; delete _viewPortResource; delete _viewPortListResource; + delete _fontResource; + delete _cMapResource; + delete _vInitCyclResource; } void BoltEntry::load() { @@ -561,8 +575,9 @@ ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src) { /*------------------------------------------------------------------------*/ ViewPortListResource::ViewPortListResource(BoltFilesState &state, const byte *src) { - uint32 *idP = (uint32 *)&src[0]; - uint count = READ_LE_UINT32(idP++); + uint count = READ_LE_UINT16(src); + + uint32 *idP = (uint32 *)&src[8]; for (uint i = 0; i < count; ++i, ++idP) { uint32 id = READ_LE_UINT32(idP); @@ -574,4 +589,33 @@ ViewPortListResource::ViewPortListResource(BoltFilesState &state, const byte *sr state._curLibPtr->resolveIt(READ_LE_UINT32(&src[4]), &_field4); } +/*------------------------------------------------------------------------*/ + +FontResource::FontResource(BoltFilesState &state, const byte *src) { + state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0xC), &_fieldC); +} + +/*------------------------------------------------------------------------*/ + +CMapResource::CMapResource(BoltFilesState &state, const byte *src) { + _start = READ_LE_UINT16(src + 2); + _end = READ_LE_UINT16(src + 4); + + int count = _end - _start; + _palette = new byte[count * 3]; + Common::copy(src + 6, src + 6 + 3 * count, _palette); +} + +CMapResource::~CMapResource() { + delete[] _palette; +} + +/*------------------------------------------------------------------------*/ + +VInitCyclResource::VInitCyclResource(BoltFilesState &state, const byte *src) { + for (int i = 0; i < 4; ++i) { + state._curLibPtr->resolveIt(READ_LE_UINT32(src + 8 + i * 4), &_ptr[i]); + } +} + } // End of namespace Voyeur diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 47ef5a1f46..eb0c313c3b 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -37,6 +37,9 @@ class BoltEntry; class PictureResource; class ViewPortResource; class ViewPortListResource; +class FontResource; +class CMapResource; +class VInitCyclResource; #define DECOMPRESS_SIZE 0x7000 @@ -163,6 +166,9 @@ public: PictureResource *_picResource; ViewPortResource *_viewPortResource; ViewPortListResource *_viewPortListResource; + FontResource *_fontResource; + CMapResource *_cMapResource; + VInitCyclResource *_vInitCyclResource; public: BoltEntry(Common::SeekableReadStream *f); virtual ~BoltEntry(); @@ -231,6 +237,32 @@ public: virtual ~ViewPortListResource() {} }; +class FontResource { +public: + byte *_fieldC; + + FontResource(BoltFilesState &state, const byte *src); + virtual ~FontResource() {} +}; + +class CMapResource { +public: + int _start; + int _end; + byte *_palette; +public: + CMapResource(BoltFilesState &state, const byte *src); + virtual ~CMapResource(); +}; + +class VInitCyclResource { +public: + byte *_ptr[4]; +public: + VInitCyclResource(BoltFilesState &state, const byte *src); + virtual ~VInitCyclResource() {} +}; + } // End of namespace Voyeur #endif /* VOYEUR_FILES_H */ |