From 25f0db3eb6bb2000368fc95acd3e7d9703891d32 Mon Sep 17 00:00:00 2001 From: elasota <1137273+elasota@users.noreply.github.com> Date: Wed, 4 Sep 2024 00:06:30 -0400 Subject: [PATCH] VCRUISE: Add fast video decoder option --- engines/vcruise/detection.h | 1 + engines/vcruise/detection_tables.h | 48 +++++++++++++++--------------- engines/vcruise/metaengine.cpp | 11 +++++++ engines/vcruise/runtime.cpp | 4 +++ 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/engines/vcruise/detection.h b/engines/vcruise/detection.h index 47f682a5497..cf490062508 100644 --- a/engines/vcruise/detection.h +++ b/engines/vcruise/detection.h @@ -65,6 +65,7 @@ struct VCruiseGameDescription { #define GAMEOPTION_INCREASE_DRAG_DISTANCE GUIO_GAMEOPTIONS4 #define GAMEOPTION_USE_4BIT_GRAPHICS GUIO_GAMEOPTIONS5 #define GAMEOPTION_PRELOAD_SOUNDS GUIO_GAMEOPTIONS6 +#define GAMEOPTION_FAST_VIDEO_DECODER GUIO_GAMEOPTIONS7 } // End of namespace VCruise diff --git a/engines/vcruise/detection_tables.h b/engines/vcruise/detection_tables.h index 43f398a1f32..9877b04aabd 100644 --- a/engines/vcruise/detection_tables.h +++ b/engines/vcruise/detection_tables.h @@ -180,7 +180,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, ADGF_CD | VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::EN_GRB, @@ -194,7 +194,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::DE_DEU, @@ -209,7 +209,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::EN_GRB, @@ -222,7 +222,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::EN_GRB, @@ -235,7 +235,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::EN_GRB, @@ -248,7 +248,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::PL_POL, @@ -261,7 +261,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::DE_DEU, @@ -274,7 +274,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_GENTEE_PACKAGE, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::DE_DEU, @@ -289,7 +289,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::EN_GRB, @@ -303,7 +303,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::DE_DEU, @@ -317,7 +317,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::ES_ESP, @@ -331,7 +331,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::FR_FRA, @@ -345,7 +345,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::HU_HUN, @@ -359,7 +359,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::IT_ITA, @@ -373,7 +373,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::PL_POL, @@ -387,7 +387,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::RU_RUS, @@ -404,7 +404,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::EN_GRB, @@ -419,7 +419,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::DE_DEU, @@ -434,7 +434,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::ES_ESP, @@ -449,7 +449,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::FR_FRA, @@ -464,7 +464,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::HU_HUN, @@ -479,7 +479,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::IT_ITA, @@ -494,7 +494,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::PL_POL, @@ -509,7 +509,7 @@ static const VCruiseGameDescription gameDescriptions[] = { Common::UNK_LANG, Common::kPlatformWindows, VCRUISE_GF_WANT_OGG_VORBIS | VCRUISE_GF_NEED_JPEG | VCRUISE_GF_STEAM_LANGUAGES, - GUIO0() + GUIO1(GAMEOPTION_FAST_VIDEO_DECODER) }, GID_SCHIZM, Common::RU_RUS, diff --git a/engines/vcruise/metaengine.cpp b/engines/vcruise/metaengine.cpp index ae3b7eac247..3c22e374f56 100644 --- a/engines/vcruise/metaengine.cpp +++ b/engines/vcruise/metaengine.cpp @@ -102,6 +102,17 @@ static const ADExtraGuiOptionsMap optionsList[] = { 0 } }, + { + GAMEOPTION_FAST_VIDEO_DECODER, + { + _s("Faster video decoder (lower quality)"), + _s("Reduce video decoding CPU usage at the cost of quality."), + "vcruise_fast_video_decoder", + false, + 0, + 0 + } + }, AD_EXTRA_GUI_OPTIONS_TERMINATOR }; diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp index dd7ac2582a7..b9cc8925901 100644 --- a/engines/vcruise/runtime.cpp +++ b/engines/vcruise/runtime.cpp @@ -4624,6 +4624,10 @@ void Runtime::changeAnimation(const AnimationDef &animDef, uint initialFrame, bo if (aviFile->open(aviFileName)) { _animDecoder.reset(new Video::AVIDecoder()); + + if (ConfMan.hasKey("vcruise_fast_video_decoder") && ConfMan.getBool("vcruise_fast_video_decoder")) + _animDecoder->setVideoCodecAccuracy(Image::CodecAccuracy::Fast); + if (!_animDecoder->loadStream(aviFile)) { warning("Animation file %i could not be loaded", animFile); return;