aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-02-17 13:13:30 -0500
committerMatthew Hoops2011-02-17 13:38:23 -0500
commit266806d8925330ec0d9e020fafffd74a2cb272e6 (patch)
treed53d8b4365d819573093fb89262947e62f98d8d7 /engines/sci/sci.cpp
parentb5d1c669158951d4ea1633d3c10c58729d28fda5 (diff)
downloadscummvm-rg350-266806d8925330ec0d9e020fafffd74a2cb272e6.tar.gz
scummvm-rg350-266806d8925330ec0d9e020fafffd74a2cb272e6.tar.bz2
scummvm-rg350-266806d8925330ec0d9e020fafffd74a2cb272e6.zip
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.
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp33
1 files changed, 33 insertions, 0 deletions
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