From 6024c2abcbee034f627ea2e40d583dcaef4fc778 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 31 Oct 2020 12:23:49 +0200 Subject: [PATCH] SCI: Hook up the custom palette mods functionality Originally from e66ea0827a30e9c860a9f42e81a9acc0acc067bf, this part has been added separately because of the major changes in the detection code since the original commit was written. --- engines/sci/detection.cpp | 13 ++++++++- engines/sci/detection.h | 1 + engines/sci/detection_tables.h | 50 ++++++++++++++++++---------------- engines/sci/module.mk | 1 + 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index d19352a9b19..e4742d47043 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -273,6 +273,17 @@ static const ADExtraGuiOptionsMap optionsList[] = { false } }, + + // SCI16 games: use custom per-resource palettes to improve visuals + { + GAMEOPTION_PALETTE_MODS, + { + _s("Use per-resource modified palettes"), + _s("Use custom per-resource palettes to improve visuals"), + "palette_mods", + false + } + }, AD_EXTRA_GUI_OPTIONS_TERMINATOR }; @@ -479,7 +490,7 @@ ADDetectedGame SciMetaEngineDetection::fallbackDetect(const FileMap &allFiles, c } else { static bool warn = true; if (warn) { - warning("Engine plugin for Sci not present. Fallback detection is disabled."); + warning("Engine plugin for SCI not present. Fallback detection is disabled."); warn = false; } } diff --git a/engines/sci/detection.h b/engines/sci/detection.h index 5cb118347c5..806e821def3 100644 --- a/engines/sci/detection.h +++ b/engines/sci/detection.h @@ -41,6 +41,7 @@ namespace Sci { #define GAMEOPTION_LARRYSCALE GUIO_GAMEOPTIONS12 #define GAMEOPTION_UPSCALE_VIDEOS GUIO_GAMEOPTIONS13 #define GAMEOPTION_RGB_RENDERING GUIO_GAMEOPTIONS14 +#define GAMEOPTION_PALETTE_MODS GUIO_GAMEOPTIONS15 enum SciGameId { GID_ASTROCHICKEN, diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 97bd2abe549..270fbfafb05 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -24,9 +24,11 @@ namespace Sci { #define GUIO_STD16 GUIO5(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_MIDI_MODE, GAMEOPTION_RGB_RENDERING) #define GUIO_STD16_UNDITHER GUIO6(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_MIDI_MODE, GAMEOPTION_RGB_RENDERING) +#define GUIO_STD16_PALETTEMODS GUIO7(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_MIDI_MODE, GAMEOPTION_RGB_RENDERING, GAMEOPTION_PALETTE_MODS) #define GUIO_STD16_SPEECH GUIO4(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_MIDI_MODE, GAMEOPTION_RGB_RENDERING) #define GUIO_STD16_MAC GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_MIDI_MODE, GAMEOPTION_RGB_RENDERING) #define GUIO_STD16_MAC_UNDITHER GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_MIDI_MODE, GAMEOPTION_RGB_RENDERING) +#define GUIO_STD16_MAC_PALETTEMODS GUIO6(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_MIDI_MODE, GAMEOPTION_RGB_RENDERING, GAMEOPTION_PALETTE_MODS) #define FANMADE_L(name, resMapMd5, resMapSize, resMd5, resSize, resVol, lang) \ {"sci-fanmade", name, { \ @@ -2410,7 +2412,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.003", 0, "a0d4a625311d307257da7fc43d00459d", 570356}, {"resource.004", 0, "a0d4a625311d307257da7fc43d00459d", 717844}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_STD16_PALETTEMODS }, // Larry 2 - English Atari ST // Game version 1.001.006 @@ -2421,7 +2423,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "4a24443a25e2b1492462a52809605dc2", 406698}, {"resource.003", 0, "4a24443a25e2b1492462a52809605dc2", 592433}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO_STD16_PALETTEMODS }, // Larry 2 - English DOS Non-Interactive Demo // Executable scanning reports "x.yyy.zzz" @@ -2430,7 +2432,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "03dba704bb77da55a91ad27b5a3cac09", 528}, {"resource.001", 0, "9f5520f0297206928df0b0b36493cd33", 127532}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO_STD16_PALETTEMODS }, // Larry 2 - English DOS // SCI interpreter version 0.000.409 @@ -2443,7 +2445,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.005", 0, "4a24443a25e2b1492462a52809605dc2", 277732}, {"resource.006", 0, "4a24443a25e2b1492462a52809605dc2", 345683}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Larry 2 - English DOS // SCI interpreter version 0.000.343 @@ -2458,7 +2460,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { //{"resource.006", 0, "96033f57accfca903750413fd09193c8", 345818}, {"resource.006", 0, "96033f57accfca903750413fd09193c8", -1}, // 345818 or 208739 AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Larry 2 - English DOS (supplied by ssburnout in bug report #3049193) // 1.000.011 3x3.5" (label: Int. #0.000.343) @@ -2468,7 +2470,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "96033f57accfca903750413fd09193c8", 407014}, {"resource.003", 0, "96033f57accfca903750413fd09193c8", 592834}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Larry 2 - English DOS (supplied by ssburnout in bug report #3049193) // 1.002.000 3x3.5" (label: INT#0.000.409) @@ -2478,7 +2480,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "4a24443a25e2b1492462a52809605dc2", 406935}, {"resource.003", 0, "4a24443a25e2b1492462a52809605dc2", 592533}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Larry 2 - English Atari ST (Kixx) // Game version 1.002.000 @@ -2489,7 +2491,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "4a24443a25e2b1492462a52809605dc2", 406935}, {"resource.003", 0, "4a24443a25e2b1492462a52809605dc2", 592533}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO_STD16_PALETTEMODS }, // Larry 2 - Polish DOS (from Polish Leisure Suit Larry Collection, official release) // Game version 1.002.000 @@ -2510,7 +2512,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"font.007", 0, "29afa8f8d5a211b15885b8f4d90cc2ee", 4029}, {"font.999", 0, "54801847b35893632a131171b9cebc15", 1368}, AD_LISTEND}, - Common::PL_POL, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::PL_POL, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Larry 3 - English Amiga (from www.back2roots.org) // Executable scanning reports "1.002.032" @@ -4817,7 +4819,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 746496}, {"resource.004", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 761984}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English Atari ST // Game version 1.0Q 1989-27-03 17:00 @@ -4829,7 +4831,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 720227}, {"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 688524}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - German Amiga (also includes english language) // Executable scanning reports "1.004.006" @@ -4842,7 +4844,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.004", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 545053}, {"resource.005", 0, "6d8f34090503ce937e7dbef6cb6cdb6a", 687507}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO_STD16_UNDITHER }, + Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English DOS Non-Interactive Demo // SCI interpreter version 0.000.453 @@ -4850,7 +4852,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.map", 0, "ec66ac2b1ce58b2575ba00b65058de1a", 612}, {"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 180245}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English DOS (provided by richiefs in bug report #2670691) // SCI interpreter version 0.000.453 @@ -4860,7 +4862,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 720244}, {"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 688367}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English DOS (from the Space Quest Collection) // Executable scanning reports "0.000.685", VERSION file reports "1.018" @@ -4870,7 +4872,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 715777}, {"resource.003", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 703370}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - Hebrew DOS (from the Space Quest Collection) // Executable scanning reports "0.000.685", VERSION file reports "1.018" @@ -4882,7 +4884,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.003", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 703370}, {"PATCHES/font.000", 0, "6fab182f1c071d1ed47be27776964baf", 3334}, AD_LISTEND}, - Common::HE_ISR, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::HE_ISR, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English DOS 6 x 360k Floppy (from misterhands, bug report Trac #10677 and goodoldgeorge, bug report Trac #10636) @@ -4894,7 +4896,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.003", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 330305}, {"resource.004", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 325779}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO6(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_MIDI_MODE, GAMEOPTION_RGB_RENDERING) }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English DOS (from telanus, bug report Trac#9626) // Game version 1.0P 1989-03-22 @@ -4908,7 +4910,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.005", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 328162}, {"resource.006", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 356560}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English DOS (from darksoul42, bug report Trac#10245) // Game version 1.0P 1989-03-22 @@ -4919,7 +4921,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 720133}, {"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 688294}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English DOS (from abevi, bug report #2612718) {"sq3", "", { @@ -4931,7 +4933,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.005", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 328278}, {"resource.006", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 356702}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformDOS, 0, GUIO_STD16_PALETTEMODS }, // Space Quest 3 - English Mac (from Fingolfin) {"sq3", "", { @@ -4940,7 +4942,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "0d8dfe42683b46f3131823233a91ce6a", 794072}, {"resource.003", 0, "0d8dfe42683b46f3131823233a91ce6a", 776536}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformMacintosh, ADGF_UNSTABLE, GUIO_STD16_MAC_UNDITHER }, + Common::EN_ANY, Common::kPlatformMacintosh, ADGF_UNSTABLE, GUIO_STD16_MAC_PALETTEMODS }, // Space Quest 3 - German DOS (from Tobis87, also includes english language) // SCI interpreter version 0.000.453 (?) @@ -4954,7 +4956,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.006", 0, "9107c2aa5398e28b5c5406df13491f85", 320643}, {"resource.007", 0, "9107c2aa5398e28b5c5406df13491f85", 344287}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO_STD16_MAC_UNDITHER }, + Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO_STD16_MAC_PALETTEMODS }, // Space Quest 3 v1.052 - German DOS (supplied by markcoolio in bug report #2723860, also includes english language) // Executable scanning reports "S.old.114" @@ -4964,7 +4966,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.002", 0, "9107c2aa5398e28b5c5406df13491f85", 596768}, {"resource.003", 0, "9107c2aa5398e28b5c5406df13491f85", 693573}, AD_LISTEND}, - Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO_STD16_UNDITHER }, + Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO_STD16_PALETTEMODS }, // Space Quest 3 v1.1 (game says 0.016) - English Mac (supplied by misterhands in bug report #6484) // Executable scanning reports "0.024" @@ -4975,7 +4977,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.003", 0, "0d8dfe42683b46f3131823233a91ce6a", 776554}, {"resource.004", 0, "0d8dfe42683b46f3131823233a91ce6a", 787066}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformMacintosh, ADGF_UNSTABLE, GUIO_STD16_UNDITHER }, + Common::EN_ANY, Common::kPlatformMacintosh, ADGF_UNSTABLE, GUIO_STD16_PALETTEMODS }, // Space Quest 4 - English Amiga // Executable scanning reports "1.004.024" diff --git a/engines/sci/module.mk b/engines/sci/module.mk index 4e2724cede5..3c158970226 100644 --- a/engines/sci/module.mk +++ b/engines/sci/module.mk @@ -60,6 +60,7 @@ MODULE_OBJS := \ graphics/ports.o \ graphics/remap.o \ graphics/scifont.o \ + graphics/scifx.o \ graphics/screen.o \ graphics/text16.o \ graphics/transitions.o \