diff options
author | Eugene Sandulenko | 2013-07-12 09:03:02 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2013-09-06 14:48:17 +0300 |
commit | 56cb726ebc4446dfab6e625502a1589253deae4f (patch) | |
tree | 6dee12b157920237bf19c5ba08e4e734bc73f55a /engines | |
parent | f18e318f788d126b6c39232afaf0012ef401d55d (diff) | |
download | scummvm-rg350-56cb726ebc4446dfab6e625502a1589253deae4f.tar.gz scummvm-rg350-56cb726ebc4446dfab6e625502a1589253deae4f.tar.bz2 scummvm-rg350-56cb726ebc4446dfab6e625502a1589253deae4f.zip |
FULLPIPE: Added lots of debug output, Picture::setAOIDs() implementation
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/gfx.cpp | 19 | ||||
-rw-r--r-- | engines/fullpipe/inventory.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/motion.cpp | 15 | ||||
-rw-r--r-- | engines/fullpipe/scene.cpp | 6 | ||||
-rw-r--r-- | engines/fullpipe/sound.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 26 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 8 | ||||
-rw-r--r-- | engines/fullpipe/utils.cpp | 10 | ||||
-rw-r--r-- | engines/fullpipe/utils.h | 7 |
11 files changed, 93 insertions, 8 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 23a93cf3f9..c826d21ec5 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -47,7 +47,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _rnd = new Common::RandomSource("fullpipe"); _gameProjectVersion = 0; - _gameProjectValue = 0; + _pictureScale = 8; _scrollSpeed = 0; _currSoundListCount = 0; diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index d6b38f2d7e..88c9587004 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -78,7 +78,7 @@ public: bool loadGam(const char *fname); int _gameProjectVersion; - int _gameProjectValue; + int _pictureScale; int _scrollSpeed; int _currSoundListCount; bool _soundEnabled; diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index b06968e77f..460452d630 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -29,6 +29,8 @@ namespace Fullpipe { void Bitmap::load(Common::ReadStream *s) { + debug(5, "Bitmap::load()"); + x = s->readUint32LE(); y = s->readUint32LE(); width = s->readUint32LE(); @@ -54,6 +56,7 @@ Background::Background() { } bool Background::load(MfcArchive &file) { + debug(5, "Background::load()"); _stringObj = file.readPascalString(); int count = file.readUint16LE(); @@ -132,6 +135,7 @@ PictureObject::PictureObject() { } bool PictureObject::load(MfcArchive &file, bool bigPicture) { + debug(5, "PictureObject::load()"); GameObject::load(file); if (bigPicture) @@ -170,6 +174,7 @@ GameObject::GameObject() { } bool GameObject::load(MfcArchive &file) { + debug(5, "GameObject::load()"); _field_4 = 0; _flags = 0; _field_20 = 0; @@ -205,6 +210,7 @@ Picture::Picture() { } bool Picture::load(MfcArchive &file) { + debug(5, "Picture::load()"); MemoryObject::load(file); _x = file.readUint32LE(); @@ -240,6 +246,17 @@ bool Picture::load(MfcArchive &file) { } void Picture::setAOIDs() { + int w = (g_fullpipe->_pictureScale + _width - 1) / g_fullpipe->_pictureScale; + int h = (g_fullpipe->_pictureScale + _height - 1) / g_fullpipe->_pictureScale; + + _memoryObject2->_rows = (byte **)malloc(w * sizeof(int *)); + + int pitch = 2 * h; + byte *ptr = _memoryObject2->getData(); + for (int i = 0; i < w; i++) { + _memoryObject2->_rows[i] = ptr; + ptr += pitch; + } warning("STUB: Picture::setAOIDs()"); } @@ -268,6 +285,7 @@ BigPicture::BigPicture() { } bool BigPicture::load(MfcArchive &file) { + debug(5, "BigPicture::load()"); Picture::load(file); return true; @@ -280,6 +298,7 @@ Shadows::Shadows() { } bool Shadows::load(MfcArchive &file) { + debug(5, "Shadows::load()"); _sceneId = file.readUint32LE(); _staticAniObjectId = file.readUint32LE(); _movementId = file.readUint32LE(); diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp index 47f3b0d4be..3ca6ce6aa4 100644 --- a/engines/fullpipe/inventory.cpp +++ b/engines/fullpipe/inventory.cpp @@ -27,6 +27,8 @@ namespace Fullpipe { bool CInventory::load(MfcArchive &file) { + debug(5, "CInventory::load()"); + _sceneId = file.readUint16LE(); int numInvs = file.readUint32LE(); diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 4acf568328..097ef34209 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -34,11 +34,14 @@ namespace Fullpipe { bool CMotionController::load(MfcArchive &file) { // Is originally empty file.readClass(); + debug(5, "CMotionController::load()"); return true; } bool CMctlCompound::load(MfcArchive &file) { + debug(5, "CMctlCompound::load()"); + int count = file.readUint32LE(); debug(6, "CMctlCompound::count = %d", count); @@ -70,6 +73,8 @@ bool CMctlCompound::load(MfcArchive &file) { } bool CMctlCompoundArray::load(MfcArchive &file) { + debug(5, "CMctlCompoundArray::load()"); + int count = file.readUint32LE(); debug(0, "CMctlCompoundArray::count = %d", count); @@ -88,6 +93,8 @@ CMovGraph::CMovGraph() { } bool CMovGraph::load(MfcArchive &file) { + debug(5, "CMovGraph::load()"); + _links.load(file); _nodes.load(file); @@ -106,6 +113,8 @@ CMovGraphLink::CMovGraphLink() { } bool CMovGraphLink::load(MfcArchive &file) { + debug(5, "CMovGraphLink::load()"); + _dwordArray1.load(file); _dwordArray2.load(file); @@ -128,6 +137,8 @@ bool CMovGraphLink::load(MfcArchive &file) { } bool CMovGraphNode::load(MfcArchive &file) { + debug(5, "CMovGraphNode::load()"); + _field_14 = file.readUint32LE(); _x = file.readUint32LE(); _y = file.readUint32LE(); @@ -147,6 +158,8 @@ CReactParallel::CReactParallel() { } bool CReactParallel::load(MfcArchive &file) { + debug(5, "CReactParallel::load()"); + _x1 = file.readUint32LE(); _y1 = file.readUint32LE(); _x2 = file.readUint32LE(); @@ -192,6 +205,8 @@ CReactPolygonal::CReactPolygonal() { } bool CReactPolygonal::load(MfcArchive &file) { + debug(5, "CReactPolygonal::load()"); + _field_C = file.readUint32LE(); _field_10 = file.readUint32LE(); _pointCount = file.readUint32LE(); diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 4d8f9617f0..e6a1a9b76d 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -49,6 +49,8 @@ Scene *FullpipeEngine::accessScene(int sceneId) { } bool SceneTagList::load(MfcArchive &file) { + debug(5, "SceneTagList::load()"); + int numEntries = file.readUint16LE(); for (int i = 0; i < numEntries; i++) { @@ -66,6 +68,8 @@ SceneTag::SceneTag() { } bool SceneTag::load(MfcArchive &file) { + debug(5, "SceneTag::load()"); + _field_4 = 0; _scene = 0; @@ -113,6 +117,8 @@ Scene::Scene() { } bool Scene::load(MfcArchive &file) { + debug(5, "Scene::load()"); + Background::load(file); _sceneId = file.readUint16LE(); diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index bdbc8da762..43b8e11f8f 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -34,6 +34,8 @@ SoundList::SoundList() { } bool SoundList::load(MfcArchive &file, char *fname) { + debug(5, "SoundList::load()"); + _soundItemsCount = file.readUint32LE(); _soundItems = (Sound **)calloc(_soundItemsCount, sizeof(Sound *)); @@ -75,6 +77,8 @@ Sound::Sound() { bool Sound::load(MfcArchive &file, NGIArchive *archive) { + debug(5, "Sound::load()"); + MemoryObject::load(file); _id = file.readUint32LE(); diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 47952babfe..02e297055f 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -144,6 +144,8 @@ CGameLoader::~CGameLoader() { } bool CGameLoader::load(MfcArchive &file) { + debug(5, "CGameLoader::load()"); + _gameName = file.readPascalString(); debug(6, "_gameName: %s", _gameName); @@ -229,18 +231,20 @@ GameProject::GameProject() { } bool GameProject::load(MfcArchive &file) { + debug(5, "GameProject::load()"); + _field_4 = 0; _headerFilename = 0; _field_10 = 12; g_fullpipe->_gameProjectVersion = file.readUint32LE(); - g_fullpipe->_gameProjectValue = file.readUint16LE(); + g_fullpipe->_pictureScale = file.readUint16LE(); g_fullpipe->_scrollSpeed = file.readUint32LE(); _headerFilename = file.readPascalString(); debug(1, "_gameProjectVersion = %d", g_fullpipe->_gameProjectVersion); - debug(1, "_gameProjectValue = %d", g_fullpipe->_gameProjectValue); + debug(1, "_pictureScale = %d", g_fullpipe->_pictureScale); debug(1, "_scrollSpeed = %d", g_fullpipe->_scrollSpeed); debug(1, "_headerFilename = %s", _headerFilename); @@ -264,6 +268,8 @@ GameProject::~GameProject() { } bool CInteractionController::load(MfcArchive &file) { + debug(5, "CInteractionController::load()"); + return _interactions.load(file); } @@ -288,6 +294,8 @@ CInteraction::CInteraction() { } bool CInteraction::load(MfcArchive &file) { + debug(5, "CInteraction::load()"); + _objectId1 = file.readUint16LE(); _objectId2 = file.readUint16LE(); _staticsId1 = file.readUint16LE(); @@ -316,6 +324,8 @@ MessageQueue::MessageQueue() { } bool MessageQueue::load(MfcArchive &file) { + debug(5, "MessageQueue::load()"); + _dataId = file.readUint16LE(); int count = file.readUint16LE(); @@ -346,6 +356,8 @@ ExCommand::ExCommand() { } bool ExCommand::load(MfcArchive &file) { + debug(5, "ExCommand::load()"); + _msg._parentId = file.readUint16LE(); _msg._messageKind = file.readUint32LE(); _msg._x = file.readUint32LE(); @@ -393,6 +405,8 @@ CObjstateCommand::CObjstateCommand() { } bool CObjstateCommand::load(MfcArchive &file) { + debug(5, "CObjStateCommand::load()"); + _cmd.load(file); _value = file.readUint32LE(); @@ -403,6 +417,8 @@ bool CObjstateCommand::load(MfcArchive &file) { } bool PreloadItems::load(MfcArchive &file) { + debug(5, "PreloadItems::load()"); + int count = file.readCount(); resize(count); @@ -564,6 +580,8 @@ Sc2::Sc2() { } bool Sc2::load(MfcArchive &file) { + debug(5, "Sc2::load()"); + _sceneId = file.readUint16LE(); _motionController = (CMotionController *)file.readClass(); @@ -617,6 +635,8 @@ bool Sc2::load(MfcArchive &file) { } bool PicAniInfo::load(MfcArchive &file) { + debug(5, "PicAniInfo::load()"); + type = file.readUint32LE(); objectId = file.readUint16LE(); field_6 = file.readUint16LE(); @@ -637,6 +657,8 @@ bool PicAniInfo::load(MfcArchive &file) { } bool EntranceInfo::load(MfcArchive &file) { + debug(5, "EntranceInfo::load()"); + sceneId = file.readUint32LE(); field_4 = file.readUint32LE(); messageQueueId = file.readUint32LE(); diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index f59342e3e9..f51bc17017 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -47,6 +47,8 @@ StaticANIObject::StaticANIObject() { } bool StaticANIObject::load(MfcArchive &file) { + debug(5, "StaticANIObject::load()"); + GameObject::load(file); int count = file.readUint16LE(); @@ -128,6 +130,8 @@ Statics::Statics() { } bool Statics::load(MfcArchive &file) { + debug(5, "Statics::load()"); + DynamicPhase::load(file); _staticsId = file.readUint16LE(); @@ -279,6 +283,8 @@ DynamicPhase::DynamicPhase() { } bool DynamicPhase::load(MfcArchive &file) { + debug(5, "DynamicPhase::load()"); + StaticPhase::load(file); _field_7C = file.readUint16LE(); @@ -309,6 +315,8 @@ StaticPhase::StaticPhase() { } bool StaticPhase::load(MfcArchive &file) { + debug(5, "StaticPhase::load()"); + Picture::load(file); _initialCountdown = file.readUint16LE(); diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index be1bcd38a6..9227d3dc2c 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -43,6 +43,7 @@ bool CObject::loadFile(const char *fname) { } bool CObList::load(MfcArchive &file) { + debug(5, "CObList::load()"); int count = file.readCount(); debug(9, "CObList::count: %d:", count); @@ -58,6 +59,7 @@ bool CObList::load(MfcArchive &file) { } bool CObArray::load(MfcArchive &file) { + debug(5, "CObArray::load()"); int count = file.readCount(); resize(count); @@ -72,6 +74,7 @@ bool CObArray::load(MfcArchive &file) { } bool CDWordArray::load(MfcArchive &file) { + debug(5, "CWordArray::load()"); int count = file.readCount(); debug(9, "CDWordArray::count: %d", count); @@ -117,6 +120,7 @@ MemoryObject::MemoryObject() { } bool MemoryObject::load(MfcArchive &file) { + debug(5, "MemoryObject::load()"); _filename = file.readPascalString(); if (g_fullpipe->_currArchive) { @@ -128,6 +132,7 @@ bool MemoryObject::load(MfcArchive &file) { } void MemoryObject::loadFile(char *filename) { + debug(0, "MemoryObject::loadFile(<%s>)", filename); if (!_data) { Common::SeekableReadStream *s = g_fullpipe->_currArchive->createReadStreamForMember(filename); @@ -145,7 +150,7 @@ void MemoryObject::loadFile(char *filename) { } } -void *MemoryObject::getData() { +byte *MemoryObject::getData() { load(); if (_field_14 || _flags & 1) { @@ -156,10 +161,11 @@ void *MemoryObject::getData() { } MemoryObject2::MemoryObject2() { - _data2 = 0; + _rows = 0; } bool MemoryObject2::load(MfcArchive &file) { + debug(5, "MemoryObject2::load()"); MemoryObject::load(file); _flags |= 1; diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index c12d857be9..7314eadb60 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -99,11 +99,14 @@ class MemoryObject : CObject { virtual bool load(MfcArchive &file); void loadFile(char *filename); void load() { loadFile(_filename); } - void *getData(); + byte *getData(); }; class MemoryObject2 : public MemoryObject { - void *_data2; + friend class Picture; + + protected: + byte **_rows; public: MemoryObject2(); |