ZVISION: Add stubs for the hires VOB MPEG2 videos of ZGI DVD

VOB file handling is based on clone2727's work. The lowres videos are
played for now, until AC3 sound handling is implemented
This commit is contained in:
Filippos Karapetis 2015-01-07 11:39:02 +02:00
parent e4969a98f8
commit 4ffaf4df37
5 changed files with 45 additions and 3 deletions

View File

@ -59,6 +59,7 @@ namespace ZVision {
#define GAMEOPTION_DOUBLE_FPS GUIO_GAMEOPTIONS2
#define GAMEOPTION_ENABLE_VENUS GUIO_GAMEOPTIONS3
#define GAMEOPTION_DISABLE_ANIM_WHILE_TURNING GUIO_GAMEOPTIONS4
#define GAMEOPTION_USE_HIRES_MPEG_MOVIES GUIO_GAMEOPTIONS5
static const ZVisionGameDescription gameDescriptions[] = {
@ -113,7 +114,7 @@ static const ZVisionGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING)
GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING, GAMEOPTION_USE_HIRES_MPEG_MOVIES)
},
GID_GRANDINQUISITOR
},
@ -186,6 +187,16 @@ static const ADExtraGuiOptionsMap optionsList[] = {
}
},
{
GAMEOPTION_USE_HIRES_MPEG_MOVIES,
{
_s("Use the hires MPEG movies"),
_s("Use the hires MPEG movies of the DVD version, instead of the lowres AVI ones"),
"mpegmovies",
true
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};

View File

@ -913,6 +913,19 @@ bool ActionStreamVideo::execute() {
Video::VideoDecoder *decoder;
Common::Rect destRect = Common::Rect(_x1, _y1, _x2 + 1, _y2 + 1);
#ifdef USE_MPEG2
Common::String hiresFileName = _fileName;
hiresFileName.setChar('d', hiresFileName.size() - 8);
hiresFileName.setChar('v', hiresFileName.size() - 3);
hiresFileName.setChar('o', hiresFileName.size() - 2);
hiresFileName.setChar('b', hiresFileName.size() - 1);
if (_engine->getScriptManager()->getStateValue(StateKey_MPEGMovies) == 1 &&_engine->getSearchManager()->hasFile(hiresFileName))
// TODO: Enable once VOB + AC3 support is implemented
//_fileName = hiresFileName;
warning("The hires videos of the DVD version of ZGI aren't supported yet, using lowres");
#endif
Common::String subname = _fileName;
subname.setChar('s', subname.size() - 3);
subname.setChar('u', subname.size() - 2);

View File

@ -87,6 +87,7 @@ enum StateKey {
StateKey_JapanFonts = 75,
StateKey_ExecScopeStyle = 76,
StateKey_Brightness = 77,
StateKey_MPEGMovies = 78,
StateKey_EF9_R = 91,
StateKey_EF9_G = 92,
StateKey_EF9_B = 93,

View File

@ -23,6 +23,11 @@
#include "common/scummsys.h"
#include "common/system.h"
#include "video/video_decoder.h"
// TODO: Enable once VOB + AC3 support is implemented
#if 0
//#ifdef USE_MPEG2
#include "video/mpegps_decoder.h"
#endif
#include "engines/util.h"
#include "graphics/surface.h"
@ -45,6 +50,12 @@ Video::VideoDecoder *ZVision::loadAnimation(const Common::String &fileName) {
animation = new RLFDecoder();
else if (tmpFileName.hasSuffix(".avi"))
animation = new ZorkAVIDecoder();
// TODO: Enable once VOB + AC3 support is implemented
#if 0
//#ifdef USE_MPEG2
else if (tmpFileName.hasSuffix(".vob"))
animation = new Video::MPEGPSDecoder();
#endif
else
error("Unknown suffix for animation %s", fileName.c_str());

View File

@ -52,7 +52,7 @@
namespace ZVision {
#define ZVISION_SETTINGS_KEYS_COUNT 11
#define ZVISION_SETTINGS_KEYS_COUNT 12
struct zvisionIniSettings {
const char *name;
@ -73,7 +73,8 @@ struct zvisionIniSettings {
{"panarotatespeed", StateKey_RotateSpeed, 540, false, true}, // checked by universe.scr
{"noanimwhileturning", StateKey_NoTurnAnim, -1, false, true}, // toggle playing animations during pana rotation
{"venusenabled", StateKey_VenusEnable, -1, true, true},
{"subtitles", StateKey_Subtitles, -1, true, true}
{"subtitles", StateKey_Subtitles, -1, true, true},
{"mpegmovies", StateKey_MPEGMovies, -1, true, true} // Zork: Grand Inquisitor DVD hi-res MPEG movies (0 = normal, 1 = hires, 2 = disable option)
};
ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc)
@ -230,6 +231,11 @@ void ZVision::initialize() {
loadSettings();
#ifndef USE_MPEG2
// libmpeg2 not loaded, disable the MPEG2 movies option
_scriptManager->setStateValue(StateKey_MPEGMovies, 2);
#endif
// Create debugger console. It requires GFX to be initialized
_console = new Console(this);
_doubleFPS = ConfMan.getBool("doublefps");