From 999cf71dcf4ac9466915edd55a9c91094db1a99c Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Fri, 16 Mar 2018 15:53:20 +0100 Subject: [PATCH] SCI: Add game option for enabling/disabling LarryScale in LSL7 All other SCI games continue using the default scaler. --- common/gui_options.cpp | 1 + common/gui_options.h | 1 + engines/sci/detection.cpp | 10 ++++++++++ engines/sci/detection_tables.h | 5 +++-- engines/sci/graphics/celobj32.cpp | 3 ++- engines/sci/sci.h | 1 + 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/common/gui_options.cpp b/common/gui_options.cpp index 18e02c10770..6f340bf88fc 100644 --- a/common/gui_options.cpp +++ b/common/gui_options.cpp @@ -84,6 +84,7 @@ const struct GameOpt { // "gameOption10" would be invalid here because it contains "gameOption1" { GUIO_GAMEOPTIONS10, "gameOptionA" }, { GUIO_GAMEOPTIONS11, "gameOptionB" }, + { GUIO_GAMEOPTIONS12, "gameOptionC" }, { GUIO_NONE, 0 } }; diff --git a/common/gui_options.h b/common/gui_options.h index 0813ff12160..14d4cb9175c 100644 --- a/common/gui_options.h +++ b/common/gui_options.h @@ -76,6 +76,7 @@ #define GUIO_GAMEOPTIONS9 "\060" #define GUIO_GAMEOPTIONS10 "\061" #define GUIO_GAMEOPTIONS11 "\062" +#define GUIO_GAMEOPTIONS12 "\063" #define GUIO0() (GUIO_NONE) #define GUIO1(a) (a) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index aa7a63d2249..36496e828b5 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -436,6 +436,16 @@ static const ADExtraGuiOptionsMap optionsList[] = { }, #endif + { + GAMEOPTION_LARRYSCALE, + { + _s("Use high-quality \"LarryScale\" cel scaling"), + _s("Use special cartoon scaler for drawing character sprites"), + "enable_larryscale", + true + } + }, + { GAMEOPTION_PREFER_DIGITAL_SFX, { diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index e9fba208e42..b908d5b964b 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -2733,11 +2733,12 @@ static const struct ADGameDescription SciGameDescriptions[] = { #define GUIO_LSL7_DEMO GUIO3(GUIO_NOASPECT, \ GUIO_NOMIDI, \ GUIO_NOLAUNCHLOAD) -#define GUIO_LSL7 GUIO5(GUIO_NOASPECT, \ +#define GUIO_LSL7 GUIO6(GUIO_NOASPECT, \ GUIO_NOMIDI, \ GAMEOPTION_ENABLE_BLACK_LINED_VIDEO, \ GAMEOPTION_ORIGINAL_SAVELOAD, \ - GAMEOPTION_HQ_VIDEO) + GAMEOPTION_HQ_VIDEO, \ + GAMEOPTION_LARRYSCALE) // Larry 7 - English DOS Demo (provided by richiefs in bug report #2670691) // SCI interpreter version 2.100.002 diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp index fbf8f81d077..f11c75ab2b6 100644 --- a/engines/sci/graphics/celobj32.cpp +++ b/engines/sci/graphics/celobj32.cpp @@ -32,6 +32,7 @@ #include "sci/engine/workarounds.h" #include "sci/util.h" #include "graphics/larryScale.h" +#include "common/config-manager.h" namespace Sci { #pragma mark CelScaler @@ -201,7 +202,7 @@ struct SCALER_Scale { const CelScalerTable &table = CelObj::_scaler->getScalerTable(scaleX, scaleY); - const bool useLarryScale = true; + const bool useLarryScale = ConfMan.getBool("enable_larryscale"); if (useLarryScale) { // LarryScale is an alternative, high-quality cel scaler implemented // for ScummVM. Due to the nature of smooth upscaling, it does *not* diff --git a/engines/sci/sci.h b/engines/sci/sci.h index faa153221a4..6245d186c69 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -58,6 +58,7 @@ namespace Sci { #define GAMEOPTION_ENABLE_BLACK_LINED_VIDEO GUIO_GAMEOPTIONS9 #define GAMEOPTION_HQ_VIDEO GUIO_GAMEOPTIONS10 #define GAMEOPTION_ENABLE_CENSORING GUIO_GAMEOPTIONS11 +#define GAMEOPTION_LARRYSCALE GUIO_GAMEOPTIONS12 struct EngineState; class Vocabulary;