CRYOMNI3D: Fix fonts used by various versions

Italian versions of the game use a different set of fonts than others.
Until now, 4 sets have been found.
This commit is contained in:
Le Philousophe 2019-09-28 15:33:17 +02:00
parent ea1f8a93ff
commit 739ad793f6
4 changed files with 67 additions and 22 deletions

View file

@ -68,8 +68,14 @@ enum CryOmni3DGameType {
}; };
enum CryOmni3DGameFeatures { enum CryOmni3DGameFeatures {
GF_VERSAILLES_NUMERICFONTS = (1 << 0), // Fonts are font01.crf, ... GF_VERSAILLES_FONTS_MASK = (3 << 0), // Fonts flag mask
GF_VERSAILLES_AUDIOPADDING = (1 << 1) // Audio files have underscore padding before extension GF_VERSAILLES_FONTS_NUMERIC = (0 << 0), // Fonts are font01.crf, ...
GF_VERSAILLES_FONTS_SET_A = (1 << 0), // Fonts are for French Macintosh (development version)
GF_VERSAILLES_FONTS_SET_B = (2 << 0), // Standard set (Helvet12 is used for debugging docs)
GF_VERSAILLES_FONTS_SET_C = (3 << 0), // Fonts for Italian version (Helvet12 is used for docs texts)
GF_VERSAILLES_AUDIOPADDING_NO = (0 << 2), // Audio files have underscore padding before extension
GF_VERSAILLES_AUDIOPADDING_YES = (1 << 2) // Audio files have underscore padding before extension
}; };
struct CryOmni3DGameDescription; struct CryOmni3DGameDescription;

View file

@ -213,6 +213,8 @@ ADDetectedGame CryOmni3DMetaEngine::fallbackDetectVersailles(const Common::FSNod
} }
// Determine language // Determine language
// Use fonts set C as helvet12 contains more characters than fruitL
uint8 fontsSet = GF_VERSAILLES_FONTS_SET_B;
node = root.getChild("GTO").getChild("DIALOG1.GTO"); node = root.getChild("GTO").getChild("DIALOG1.GTO");
if (node.getChild("DIALOG1.GTO").exists()) { if (node.getChild("DIALOG1.GTO").exists()) {
s_fallbackDesc.desc.language = Common::FR_FRA; s_fallbackDesc.desc.language = Common::FR_FRA;
@ -224,6 +226,7 @@ ADDetectedGame CryOmni3DMetaEngine::fallbackDetectVersailles(const Common::FSNod
s_fallbackDesc.desc.language = Common::ES_ESP; s_fallbackDesc.desc.language = Common::ES_ESP;
} else if (node.getChild("DIALOG1.ITA").exists()) { } else if (node.getChild("DIALOG1.ITA").exists()) {
s_fallbackDesc.desc.language = Common::IT_ITA; s_fallbackDesc.desc.language = Common::IT_ITA;
fontsSet = GF_VERSAILLES_FONTS_SET_C;
} }
// Determine game flags // Determine game flags
@ -233,7 +236,9 @@ ADDetectedGame CryOmni3DMetaEngine::fallbackDetectVersailles(const Common::FSNod
// Add file to report to let developers set appropriate game flags // Add file to report to let developers set appropriate game flags
addUnknownFile(node, game); addUnknownFile(node, game);
s_fallbackDesc.features |= GF_VERSAILLES_NUMERICFONTS; s_fallbackDesc.features |= GF_VERSAILLES_FONTS_NUMERIC;
} else {
s_fallbackDesc.features |= fontsSet;
} }
node = root.getChild("DIAL").getChild("VOIX").getChild("ALI001__.WAV"); node = root.getChild("DIAL").getChild("VOIX").getChild("ALI001__.WAV");
@ -241,7 +246,9 @@ ADDetectedGame CryOmni3DMetaEngine::fallbackDetectVersailles(const Common::FSNod
// Add file to report to let developers set appropriate game flags // Add file to report to let developers set appropriate game flags
addUnknownFile(node, game); addUnknownFile(node, game);
s_fallbackDesc.features |= GF_VERSAILLES_AUDIOPADDING; s_fallbackDesc.features |= GF_VERSAILLES_AUDIOPADDING_YES;
} else {
s_fallbackDesc.features |= GF_VERSAILLES_AUDIOPADDING_NO;
} }
return game; return game;

View file

@ -39,7 +39,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -56,7 +56,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -73,7 +73,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -90,7 +90,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_SET_B | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -107,7 +107,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_SET_A | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -124,7 +124,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_NO,
}, },
// Versailles 1685 // Versailles 1685
@ -141,7 +141,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_NO,
}, },
// Versailles 1685 // Versailles 1685
@ -158,7 +158,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_SET_B | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -175,7 +175,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_NO,
}, },
// Versailles 1685 // Versailles 1685
@ -192,7 +192,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_NO,
}, },
// Versailles 1685 // Versailles 1685
@ -209,7 +209,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_SET_C | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -226,7 +226,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_SET_B | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -243,7 +243,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -260,7 +260,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
// Versailles 1685 // Versailles 1685
@ -277,7 +277,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES GUI_OPTIONS_VERSAILLES
}, },
GType_VERSAILLES, GType_VERSAILLES,
GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING, GF_VERSAILLES_FONTS_NUMERIC | GF_VERSAILLES_AUDIOPADDING_YES,
}, },
{ AD_TABLE_END_MARKER, 0, 0 } { AD_TABLE_END_MARKER, 0, 0 }

View file

@ -54,7 +54,7 @@ CryOmni3DEngine_Versailles::CryOmni3DEngine_Versailles(OSystem *syst,
_currentPlace(nullptr), _currentWarpImage(nullptr), _fixedImage(nullptr), _currentPlace(nullptr), _currentWarpImage(nullptr), _fixedImage(nullptr),
_transitionAnimateWarp(true), _forceRedrawWarp(false), _forcePaletteUpdate(false), _transitionAnimateWarp(true), _forceRedrawWarp(false), _forcePaletteUpdate(false),
_fadedPalette(false), _loadedSave(uint(-1)), _dialogsMan(this, _fadedPalette(false), _loadedSave(uint(-1)), _dialogsMan(this,
getFeatures() & GF_VERSAILLES_AUDIOPADDING), getFeatures() & GF_VERSAILLES_AUDIOPADDING_YES),
_musicVolumeFactor(1.), _musicCurrentFile(nullptr), _musicVolumeFactor(1.), _musicCurrentFile(nullptr),
_countingDown(false), _countdownNextEvent(0) { _countingDown(false), _countdownNextEvent(0) {
} }
@ -308,7 +308,9 @@ void CryOmni3DEngine_Versailles::setupFonts() {
// Explainations below are based on original binaries, debug is not used in this engine // Explainations below are based on original binaries, debug is not used in this engine
// Fonts loaded are not always the same: FR Mac and EN DOS don't use the same font for debug doc/unused // Fonts loaded are not always the same: FR Mac and EN DOS don't use the same font for debug doc/unused
// The important is that the loaded one is present in all versions // The important is that the loaded one is present in all versions
if (getFeatures() & GF_VERSAILLES_NUMERICFONTS) { uint8 fontsSet = getFeatures() & GF_VERSAILLES_FONTS_MASK;
switch (fontsSet) {
case GF_VERSAILLES_FONTS_NUMERIC:
fonts.push_back("font01.CRF"); // 0: Doc titles fonts.push_back("font01.CRF"); // 0: Doc titles
fonts.push_back("font02.CRF"); // 1: Menu and T0 in credits fonts.push_back("font02.CRF"); // 1: Menu and T0 in credits
fonts.push_back("font03.CRF"); // 2: T1 and T3 in credits fonts.push_back("font03.CRF"); // 2: T1 and T3 in credits
@ -320,7 +322,8 @@ void CryOmni3DEngine_Versailles::setupFonts() {
fonts.push_back("font09.CRF"); // 8: unused fonts.push_back("font09.CRF"); // 8: unused
fonts.push_back("font10.CRF"); // 9: Warp messages texts fonts.push_back("font10.CRF"); // 9: Warp messages texts
fonts.push_back("font11.CRF"); // 10: debug fonts.push_back("font11.CRF"); // 10: debug
} else { break;
case GF_VERSAILLES_FONTS_SET_A:
fonts.push_back("garamB18.CRF"); // 0: Doc titles fonts.push_back("garamB18.CRF"); // 0: Doc titles
fonts.push_back("garamB22.CRF"); // 1: Menu and T0 in credits fonts.push_back("garamB22.CRF"); // 1: Menu and T0 in credits
//fonts.push_back("geneva15.CRF"); //fonts.push_back("geneva15.CRF");
@ -350,6 +353,35 @@ void CryOmni3DEngine_Versailles::setupFonts() {
// This file isn't even loaded by MacOS executable // This file isn't even loaded by MacOS executable
//fonts.push_back("garamB20.CRF"); //fonts.push_back("garamB20.CRF");
break;
case GF_VERSAILLES_FONTS_SET_B:
fonts.push_back("garamB18.CRF"); // 0: Doc titles
fonts.push_back("garamB22.CRF"); // 1: Menu and T0 in credits
fonts.push_back("geneva14.CRF"); // 2: T1 and T3 in credits
fonts.push_back("geneva13.CRF"); // 3: Menu title, options messages boxes buttons
fonts.push_back("geneva12.CRF"); // 4: T2 in credits, text in docs
fonts.push_back("geneva10.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
fonts.push_back("geneva9.CRF"); // 6: T5 in credits, doc subtitle
fonts.push_back("helvet16.CRF"); // 7: dialogs texts
fonts.push_back("helvet12.CRF"); // 8: debug doc
fonts.push_back("fruitL18.CRF"); // 9: Warp messages texts
fonts.push_back("MPW12.CRF"); // 10: debug
break;
case GF_VERSAILLES_FONTS_SET_C:
fonts.push_back("garamB18.CRF"); // 0: Doc titles
fonts.push_back("garamB22.CRF"); // 1: Menu and T0 in credits
fonts.push_back("geneva14.CRF"); // 2: T1 and T3 in credits
fonts.push_back("geneva13.CRF"); // 3: Menu title, options messages boxes buttons
fonts.push_back("helvet12.CRF"); // 4: T2 in credits, text in docs
fonts.push_back("geneva10.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
fonts.push_back("geneva9.CRF"); // 6: T5 in credits, doc subtitle
fonts.push_back("helvet16.CRF"); // 7: dialogs texts
fonts.push_back("helvet12.CRF"); // 8: debug doc
fonts.push_back("fruitL18.CRF"); // 9: Warp messages texts
fonts.push_back("MPW12.CRF"); // 10: debug
break;
default:
error("Font set invalid");
} }
_fontManager.loadFonts(fonts); _fontManager.loadFonts(fonts);