From 266806d8925330ec0d9e020fafffd74a2cb272e6 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 17 Feb 2011 13:13:30 -0500 Subject: SCI: Fix Mac icon bar palettes The Mac icon bar uses a palette from the executable and keeps those entries in the palette constantly. In addition, we're now performing gamma correction on the Mac-based colors so that they are in the same gamma as SCI. The color matching now works with this and using the same color finding as the Mac Palette Manager. --- engines/sci/sci.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'engines/sci/sci.cpp') diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index c69e35df6d..7147b17b82 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -261,6 +261,9 @@ Common::Error SciEngine::run() { syncSoundSettings(); syncIngameAudioOptions(); + // Load our Mac executable here for icon bar palettes and high-res fonts + loadMacExecutable(); + // Initialize all graphics related subsystems initGraphics(); @@ -857,4 +860,34 @@ void SciEngine::syncIngameAudioOptions() { } } +void SciEngine::loadMacExecutable() { + if (getPlatform() != Common::kPlatformMacintosh || getSciVersion() < SCI_VERSION_1_EARLY || getSciVersion() > SCI_VERSION_1_1) + return; + + Common::String filename; + + switch (getGameId()) { + case GID_KQ6: + filename = "King's Quest VI"; + break; + case GID_FREDDYPHARKAS: + filename = "Freddy Pharkas"; + break; + default: + break; + } + + if (filename.empty()) + return; + + if (!_macExecutable.open(filename) || !_macExecutable.hasResFork()) { + // KQ6/Freddy require the executable to load their icon bar palettes + if (hasMacIconBar()) + error("Could not load Mac resource fork '%s'", filename.c_str()); + + // TODO: Show some sort of warning dialog saying they can't get any + // high-res Mac fonts, when we get to that point ;) + } +} + } // End of namespace Sci -- cgit v1.2.3