diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/detection_tables.h | 18 | ||||
-rw-r--r-- | engines/mohawk/myst.cpp | 44 | ||||
-rw-r--r-- | engines/mohawk/myst_graphics.cpp | 136 | ||||
-rw-r--r-- | engines/mohawk/myst_graphics.h | 15 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/intro.cpp | 25 |
5 files changed, 43 insertions, 195 deletions
diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 5acc1bb179..55814af1c3 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -204,24 +204,6 @@ static const MohawkGameDescription gameDescriptions[] = { }, // Myst Masterpiece Edition - // English Windows - // From clone2727 - { - { - "myst", - "Masterpiece Edition", - AD_ENTRY1("MYST.DAT", "c4cae9f143b5947262e6cb2397e1617e"), - Common::EN_ANY, - Common::kPlatformMacintosh, - ADGF_UNSTABLE, - GUIO1(GUIO_NOASPECT) - }, - GType_MYST, - GF_ME, - 0, - }, - - // Myst Masterpiece Edition // German Windows // From DrMcCoy (Included in "Myst: Die Trilogie") { diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 0efd412bd0..9c0e642203 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -98,11 +98,6 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription _view.soundListVolume = NULL; _view.scriptResCount = 0; _view.scriptResources = NULL; - - if ((getFeatures() & GF_ME) && getPlatform() == Common::kPlatformMacintosh) { - const Common::FSNode gameDataDir(ConfMan.get("path")); - SearchMan.addSubDirectoryMatching(gameDataDir, "CD Data"); - } } MohawkEngine_Myst::~MohawkEngine_Myst() { @@ -205,11 +200,6 @@ static const char *mystFiles[] = { // qtw/myst/libelev.mov: libup.mov is basically the same with sound Common::String MohawkEngine_Myst::wrapMovieFilename(const Common::String &movieName, uint16 stack) { - // The Macintosh release of Myst ME stores its videos in a different folder - // WORKAROUND: The gear rotation videos are not in the CD Data folder. See above comments. - if ((getFeatures() & GF_ME) && getPlatform() == Common::kPlatformMacintosh && !movieName.matchString("cl1wg?")) - return Common::String("CD Data/m/") + movieName + ".mov"; - Common::String prefix; switch (stack) { @@ -498,52 +488,32 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS if (!_mhk[0]->openFile(mystFiles[_curStack])) error("Could not open %s", mystFiles[_curStack]); - if (getPlatform() == Common::kPlatformMacintosh) - _gfx->loadExternalPictureFile(_curStack); - _runExitScript = false; // Clear the resource cache and the image cache _cache.clear(); _gfx->clearCache(); - // Play Flyby Entry Movie on Masterpiece Edition. The Macintosh version is currently hooked - // up to the Cinepak versions of the video (the 'c' suffix) until the SVQ1 decoder is completed. + // Play Flyby Entry Movie on Masterpiece Edition. const char *flyby = 0; if (getFeatures() & GF_ME) { switch (_curStack) { case kSeleniticStack: - if (getPlatform() == Common::kPlatformMacintosh) - flyby = "FLY_SEc"; - else - flyby = "selenitic flyby"; + flyby = "selenitic flyby"; break; case kStoneshipStack: - if (getPlatform() == Common::kPlatformMacintosh) - flyby = "FLY_STc"; - else - flyby = "stoneship flyby"; + flyby = "stoneship flyby"; break; // Myst Flyby Movie not used in Original Masterpiece Edition Engine case kMystStack: - if (_tweaksEnabled) { - if (getPlatform() == Common::kPlatformMacintosh) - flyby = "FLY_MYc"; - else - flyby = "myst flyby"; - } + if (_tweaksEnabled) + flyby = "myst flyby"; break; case kMechanicalStack: - if (getPlatform() == Common::kPlatformMacintosh) - flyby = "FLY_MEc"; - else - flyby = "mech age flyby"; + flyby = "mech age flyby"; break; case kChannelwoodStack: - if (getPlatform() == Common::kPlatformMacintosh) - flyby = "FLY_CHc"; - else - flyby = "channelwood flyby"; + flyby = "channelwood flyby"; break; default: break; diff --git a/engines/mohawk/myst_graphics.cpp b/engines/mohawk/myst_graphics.cpp index ae80dd5538..2df0f7e6ba 100644 --- a/engines/mohawk/myst_graphics.cpp +++ b/engines/mohawk/myst_graphics.cpp @@ -49,8 +49,6 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) { if (_pixelFormat.bytesPerPixel == 1) error("Myst requires greater than 256 colors to run"); - _pictureFile.entries = NULL; - // Initialize our buffer _backBuffer = new Graphics::Surface(); _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat); @@ -61,122 +59,50 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) { MystGraphics::~MystGraphics() { delete _bmpDecoder; - delete[] _pictureFile.entries; _backBuffer->free(); delete _backBuffer; } -static const char *s_picFileNames[] = { - "CHpics", - "", - "", - "DUpics", - "INpics", - "", - "MEpics", - "MYpics", - "SEpics", - "", - "", - "STpics" -}; - -void MystGraphics::loadExternalPictureFile(uint16 stack) { - if (_vm->getPlatform() != Common::kPlatformMacintosh) - return; - - if (_pictureFile.picFile.isOpen()) - _pictureFile.picFile.close(); - delete[] _pictureFile.entries; - - if (!scumm_stricmp(s_picFileNames[stack], "")) - return; - - if (!_pictureFile.picFile.open(s_picFileNames[stack])) - error ("Could not open external picture file \'%s\'", s_picFileNames[stack]); - - _pictureFile.pictureCount = _pictureFile.picFile.readUint32BE(); - _pictureFile.entries = new PictureFile::PictureEntry[_pictureFile.pictureCount]; - - for (uint32 i = 0; i < _pictureFile.pictureCount; i++) { - _pictureFile.entries[i].offset = _pictureFile.picFile.readUint32BE(); - _pictureFile.entries[i].size = _pictureFile.picFile.readUint32BE(); - _pictureFile.entries[i].id = _pictureFile.picFile.readUint16BE(); - _pictureFile.entries[i].type = _pictureFile.picFile.readUint16BE(); - _pictureFile.entries[i].width = _pictureFile.picFile.readUint16BE(); - _pictureFile.entries[i].height = _pictureFile.picFile.readUint16BE(); +MohawkSurface *MystGraphics::decodeImage(uint16 id) { + // We need to grab the image from the current stack archive, however, we don't know + // if it's a PICT or WDIB resource. If it's Myst ME it's most likely a PICT, and if it's + // original it's definitely a WDIB. However, Myst ME throws us another curve ball in + // that PICT resources can contain WDIB's instead of PICT's. + Common::SeekableReadStream *dataStream = NULL; + + if (_vm->getFeatures() & GF_ME && _vm->hasResource(ID_PICT, id)) { + // The PICT resource exists. However, it could still contain a MystBitmap + // instead of a PICT image... + dataStream = _vm->getResource(ID_PICT, id); + } else { + // No PICT, so the WDIB must exist. Let's go grab it. + dataStream = _vm->getResource(ID_WDIB, id); } -} -MohawkSurface *MystGraphics::decodeImage(uint16 id) { - MohawkSurface *mhkSurface = 0; + bool isPict = false; - // Myst ME uses JPEG/PICT images instead of compressed Windows Bitmaps for room images, - // though there are a few weird ones that use that format. For further nonsense with images, - // the Macintosh version stores images in external "picture files." We check them before - // going to check for a PICT resource. - if (_vm->getFeatures() & GF_ME && _vm->getPlatform() == Common::kPlatformMacintosh && _pictureFile.picFile.isOpen()) { - for (uint32 i = 0; i < _pictureFile.pictureCount; i++) - if (_pictureFile.entries[i].id == id) { - if (_pictureFile.entries[i].type == 0) { - Graphics::JPEGDecoder jpeg; - Common::SeekableSubReadStream subStream(&_pictureFile.picFile, _pictureFile.entries[i].offset, _pictureFile.entries[i].offset + _pictureFile.entries[i].size); - - if (!jpeg.loadStream(subStream)) - error("Could not decode Myst ME Mac JPEG"); - - mhkSurface = new MohawkSurface(jpeg.getSurface()->convertTo(_pixelFormat)); - } else if (_pictureFile.entries[i].type == 1) { - Graphics::PICTDecoder pict; - Common::SeekableSubReadStream subStream(&_pictureFile.picFile, _pictureFile.entries[i].offset, _pictureFile.entries[i].offset + _pictureFile.entries[i].size); - - if (!pict.loadStream(subStream)) - error("Could not decode Myst ME Mac PICT"); - - mhkSurface = new MohawkSurface(pict.getSurface()->convertTo(_pixelFormat)); - } else - error ("Unknown Picture File type %d", _pictureFile.entries[i].type); - break; - } + if (_vm->getFeatures() & GF_ME) { + // Here we detect whether it's really a PICT or a WDIB. Since a MystBitmap + // would be compressed, there's no way to detect for the BM without a hack. + // So, we search for the PICT version opcode for detection. + dataStream->seek(512 + 10); // 512 byte pict header + isPict = (dataStream->readUint32BE() == 0x001102FF); + dataStream->seek(0); } - // We're not using the external Mac files, so it's time to delve into the main Mohawk - // archives. However, we still don't know if it's a PICT or WDIB resource. If it's Myst - // ME it's most likely a PICT, and if it's original it's definitely a WDIB. However, - // Myst ME throws us another curve ball in that PICT resources can contain WDIB's instead - // of PICT's. - if (!mhkSurface) { - bool isPict = false; - Common::SeekableReadStream *dataStream = NULL; - - if (_vm->getFeatures() & GF_ME && _vm->hasResource(ID_PICT, id)) { - // The PICT resource exists. However, it could still contain a MystBitmap - // instead of a PICT image... - dataStream = _vm->getResource(ID_PICT, id); - } else // No PICT, so the WDIB must exist. Let's go grab it. - dataStream = _vm->getResource(ID_WDIB, id); - - if (_vm->getFeatures() & GF_ME) { - // Here we detect whether it's really a PICT or a WDIB. Since a MystBitmap - // would be compressed, there's no way to detect for the BM without a hack. - // So, we search for the PICT version opcode for detection. - dataStream->seek(512 + 10); // 512 byte pict header - isPict = (dataStream->readUint32BE() == 0x001102FF); - dataStream->seek(0); - } + MohawkSurface *mhkSurface = 0; - if (isPict) { - Graphics::PICTDecoder pict; + if (isPict) { + Graphics::PICTDecoder pict; - if (!pict.loadStream(*dataStream)) - error("Could not decode Myst ME PICT"); + if (!pict.loadStream(*dataStream)) + error("Could not decode Myst ME PICT"); - mhkSurface = new MohawkSurface(pict.getSurface()->convertTo(_pixelFormat)); - } else { - mhkSurface = _bmpDecoder->decodeImage(dataStream); - mhkSurface->convertToTrueColor(); - } + mhkSurface = new MohawkSurface(pict.getSurface()->convertTo(_pixelFormat)); + } else { + mhkSurface = _bmpDecoder->decodeImage(dataStream); + mhkSurface->convertToTrueColor(); } assert(mhkSurface); diff --git a/engines/mohawk/myst_graphics.h b/engines/mohawk/myst_graphics.h index 20fd46c5b9..de8fe521e6 100644 --- a/engines/mohawk/myst_graphics.h +++ b/engines/mohawk/myst_graphics.h @@ -43,7 +43,6 @@ public: MystGraphics(MohawkEngine_Myst*); ~MystGraphics(); - void loadExternalPictureFile(uint16 stack); void copyImageSectionToScreen(uint16 image, Common::Rect src, Common::Rect dest); void copyImageSectionToBackBuffer(uint16 image, Common::Rect src, Common::Rect dest); void copyImageToScreen(uint16 image, Common::Rect dest); @@ -66,20 +65,6 @@ private: MohawkEngine_Myst *_vm; MystBitmap *_bmpDecoder; - struct PictureFile { - uint32 pictureCount; - struct PictureEntry { - uint32 offset; - uint32 size; - uint16 id; - uint16 type; - uint16 width; - uint16 height; - } *entries; - - Common::File picFile; - } _pictureFile; - Graphics::Surface *_backBuffer; Graphics::PixelFormat _pixelFormat; Common::Rect _viewport; diff --git a/engines/mohawk/myst_stacks/intro.cpp b/engines/mohawk/myst_stacks/intro.cpp index a5f608dbbf..545b97d956 100644 --- a/engines/mohawk/myst_stacks/intro.cpp +++ b/engines/mohawk/myst_stacks/intro.cpp @@ -100,12 +100,8 @@ void Intro::introMovies_run() { switch (_introStep) { case 0: - // Play the Mattel (or UbiSoft) logo in the Myst ME Mac version - if ((_vm->getFeatures() & GF_ME) && _vm->getPlatform() == Common::kPlatformMacintosh) { - _vm->_video->playMovie(_vm->wrapMovieFilename("mattel", kIntroStack)); - _introStep = 1; - } else - _introStep = 2; + _introStep = 1; + _vm->_video->playMovie(_vm->wrapMovieFilename("broder", kIntroStack)); break; case 1: if (!_vm->_video->isVideoPlaying()) @@ -113,10 +109,7 @@ void Intro::introMovies_run() { break; case 2: _introStep = 3; - if ((_vm->getFeatures() & GF_ME) && _vm->getPlatform() == Common::kPlatformMacintosh) - _vm->_video->playMovie(_vm->wrapMovieFilename("presto", kIntroStack)); - else - _vm->_video->playMovie(_vm->wrapMovieFilename("broder", kIntroStack)); + _vm->_video->playMovie(_vm->wrapMovieFilename("cyanlogo", kIntroStack)); break; case 3: if (!_vm->_video->isVideoPlaying()) @@ -124,21 +117,13 @@ void Intro::introMovies_run() { break; case 4: _introStep = 5; - _vm->_video->playMovie(_vm->wrapMovieFilename("cyanlogo", kIntroStack)); - break; - case 5: - if (!_vm->_video->isVideoPlaying()) - _introStep = 6; - break; - case 6: - _introStep = 7; if (!(_vm->getFeatures() & GF_DEMO)) // The demo doesn't have the intro video _vm->_video->playMovie(_vm->wrapMovieFilename("intro", kIntroStack)); break; - case 7: + case 5: if (!_vm->_video->isVideoPlaying()) - _introStep = 8; + _introStep = 6; break; default: if (_vm->getFeatures() & GF_DEMO) |