aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-06-06 13:03:09 -0500
committerrichiesams2013-08-04 13:30:32 -0500
commit0303850bf7089637b34ae487855bca866d57b580 (patch)
treee21055cdb6cba7fa7ef5622c13b73760e37c0f81 /engines
parentd0b341e6ca7010641c362bb36ebfc3d225955056 (diff)
downloadscummvm-rg350-0303850bf7089637b34ae487855bca866d57b580.tar.gz
scummvm-rg350-0303850bf7089637b34ae487855bca866d57b580.tar.bz2
scummvm-rg350-0303850bf7089637b34ae487855bca866d57b580.zip
ZVISION: Allow detection to go off inner directory
Game detection needs to be off an actual resource, but all the resources are in subdirectories. This updates the code to search for the specific subdirectory.
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/detection.cpp9
-rw-r--r--engines/zvision/zvision.cpp60
2 files changed, 41 insertions, 28 deletions
diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp
index 345138b724..f8ed6a749b 100644
--- a/engines/zvision/detection.cpp
+++ b/engines/zvision/detection.cpp
@@ -68,7 +68,7 @@ static const ZVisionGameDescription gameDescriptions[] = {
0,
AD_ENTRY1s("CSCR.ZFS", "88226e51a205d2e50c67a5237f3bd5f2", 2397741),
Common::EN_ANY,
- Common::kPlatformWindows,
+ Common::kPlatformDOS,
ADGF_NO_FLAGS,
GUIO1(GUIO_NONE)
},
@@ -79,6 +79,11 @@ static const ZVisionGameDescription gameDescriptions[] = {
} // End of namespace ZVision
+static const char *directoryGlobs[] = {
+ "znemscr",
+ 0
+};
+
static const ExtraGuiOption ZVisionExtraGuiOption = {
_s("Use original save/load screens"),
_s("Use the original save/load screens, instead of the ScummVM ones"),
@@ -89,6 +94,8 @@ static const ExtraGuiOption ZVisionExtraGuiOption = {
class ZVisionMetaEngine : public AdvancedMetaEngine {
public:
ZVisionMetaEngine() : AdvancedMetaEngine(ZVision::gameDescriptions, sizeof(ZVision::ZVisionGameDescription), zVisionGames) {
+ _maxScanDepth = 2;
+ _directoryGlobs = directoryGlobs;
_singleid = "zvision";
}
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 0e553e6287..d291cabc70 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -35,17 +35,11 @@ ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc) : Engine
// However this is the place to specify all default directories
const Common::FSNode gameDataDir(ConfMan.get("path"));
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/asylum");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/castle");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/conserv");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/endgame");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/global");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/global/venus");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/global2");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/global3");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/monast");
- SearchMan.addSubDirectoryMatching(gameDataDir, "zassets/temple");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "data1");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "data2");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "data3");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "znemmx");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "znemscr");
// Here is the right place to set up the engine specific debug channels
//DebugMan.addDebugChannel(kZVisionDebugExample, "example", "this is just an example for a engine specific debug channel");
@@ -160,10 +154,18 @@ Common::Error ZVision::run() {
// This test will show up if --debugflags=example or --debugflags=example2 or both of them and -d3 are specified on the commandline
//debugC(3, kZVisionDebugExample | kZVisionDebugExample2, "Example debug call two");
+ Common::File file;
+
+ if (file.open("ADLIB.MDI")) {
+ file.close();
+ }
+
+
+
#if 1
// Video test
Video::VideoDecoder *videoDecoder = new ZorkAVIDecoder();
- if (videoDecoder && videoDecoder->loadFile(/*"TD9EAZ1C.AVI"*/"T000A11C.AVI")) {
+ if (videoDecoder && videoDecoder->loadFile("ZASSETS/TEMPLE/T000A11C.AVI")) {
Common::List<Graphics::PixelFormat> formats;
formats.push_back(videoDecoder->getPixelFormat());
initGraphics(640, 480, true, formats);
@@ -176,29 +178,33 @@ Common::Error ZVision::run() {
#if 1
// Image test
- f.open("CB8EB11C.TGA");
+ if (f.open("zassets/castle/CB8EB11C.TGA")) {
+ Graphics::TGADecoder tga;
+ if (!tga.loadStream(f))
+ error("Error while reading TGA image");
+ f.close();
- Graphics::TGADecoder tga;
- if (!tga.loadStream(f))
- error("Error while reading TGA image");
- f.close();
+ const Graphics::Surface *tgaSurface = tga.getSurface();
- const Graphics::Surface *tgaSurface = tga.getSurface();
+ Graphics::Surface *screen = g_system->lockScreen();
+ for (uint16 y = 0; y < tgaSurface->h; y++)
+ memcpy(screen->getBasePtr(0, y), tgaSurface->getBasePtr(0, y), tgaSurface->pitch);
+ g_system->unlockScreen();
- Graphics::Surface *screen = g_system->lockScreen();
- for (uint16 y = 0; y < tgaSurface->h; y++)
- memcpy(screen->getBasePtr(0, y), tgaSurface->getBasePtr(0, y), tgaSurface->pitch);
- g_system->unlockScreen();
+ tga.destroy();
+ }
- tga.destroy();
+
#endif
#if 1
// Sound test
- f.open("C000H9TC.RAW");
- Audio::SeekableAudioStream *audioStream = makeRawZorkStream(&f, 22050, DisposeAfterUse::YES);
- Audio::SoundHandle handle;
- g_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream);
+ if (f.open("zassets/castle/C000H9TC.RAW")) {
+ Audio::SeekableAudioStream *audioStream = makeRawZorkStream(&f, 22050, DisposeAfterUse::YES);
+ Audio::SoundHandle handle;
+ g_system->getMixer()->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream);
+ }
+
#endif
// Main loop