aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorLe Philousophe2019-06-23 08:58:24 +0200
committerLe Philousophe2019-07-05 07:40:29 +0200
commitc24304a78b8f04b36be28877e29135341a2953e4 (patch)
treeedaf67e53b58e4fd70ecefec3ab5ee2ec746bd15 /engines
parent2ac6d005bbbf03c2c4ab9591e6904df572af7993 (diff)
downloadscummvm-rg350-c24304a78b8f04b36be28877e29135341a2953e4.tar.gz
scummvm-rg350-c24304a78b8f04b36be28877e29135341a2953e4.tar.bz2
scummvm-rg350-c24304a78b8f04b36be28877e29135341a2953e4.zip
CRYOMNI3D: Remove detection leftover and add flags
That will let us adapt from different packaging across Versailles editions.
Diffstat (limited to 'engines')
-rw-r--r--engines/cryomni3d/cryomni3d.h6
-rw-r--r--engines/cryomni3d/detection.cpp5
-rw-r--r--engines/cryomni3d/detection_tables.h21
-rw-r--r--engines/cryomni3d/versailles/dialogs_manager.cpp6
-rw-r--r--engines/cryomni3d/versailles/dialogs_manager.h5
-rw-r--r--engines/cryomni3d/versailles/engine.cpp31
6 files changed, 38 insertions, 36 deletions
diff --git a/engines/cryomni3d/cryomni3d.h b/engines/cryomni3d/cryomni3d.h
index d1855a80e4..95f3b54efc 100644
--- a/engines/cryomni3d/cryomni3d.h
+++ b/engines/cryomni3d/cryomni3d.h
@@ -65,6 +65,11 @@ enum CryOmni3DGameType {
GType_VERSAILLES
};
+enum CryOmni3DGameFeatures {
+ GF_VERSAILLES_NUMERICFONTS = (1 << 0), // Fonts are font01.crf, ...
+ GF_VERSAILLES_AUDIOPADDING = (1 << 1), // Audio files have underscore padding before extension
+};
+
struct CryOmni3DGameDescription;
// Engine Debug Flags
@@ -93,7 +98,6 @@ public:
const CryOmni3DGameDescription *_gameDescription;
const char *getGameId() const;
uint32 getFeatures() const;
- const char *getAppName() const;
uint16 getVersion() const;
Common::Platform getPlatform() const;
uint8 getGameType() const;
diff --git a/engines/cryomni3d/detection.cpp b/engines/cryomni3d/detection.cpp
index 10a7b496fb..5928776a2c 100644
--- a/engines/cryomni3d/detection.cpp
+++ b/engines/cryomni3d/detection.cpp
@@ -41,7 +41,6 @@ struct CryOmni3DGameDescription {
uint8 gameType;
uint32 features;
- const char *appName;
};
const char *CryOmni3DEngine::getGameId() const {
@@ -56,10 +55,6 @@ Common::Platform CryOmni3DEngine::getPlatform() const {
return _gameDescription->desc.platform;
}
-const char *CryOmni3DEngine::getAppName() const {
- return _gameDescription->appName;
-}
-
uint8 CryOmni3DEngine::getGameType() const {
return _gameDescription->gameType;
}
diff --git a/engines/cryomni3d/detection_tables.h b/engines/cryomni3d/detection_tables.h
index 8d56594329..7593234d11 100644
--- a/engines/cryomni3d/detection_tables.h
+++ b/engines/cryomni3d/detection_tables.h
@@ -26,7 +26,7 @@ namespace CryOmni3D {
static const CryOmni3DGameDescription gameDescriptions[] = {
// Versailles 1685
- // French Windows 95
+ // French Windows 95 from hybrid Win95/DOS CD
// From lePhilousophe
{
{
@@ -39,12 +39,11 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES
},
GType_VERSAILLES,
- 0,
- 0,
+ GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING,
},
// Versailles 1685
- // French Windows 95 compressed
+ // French Windows 95 compressed from hybrid Win95/DOS CD
// From lePhilousophe
{
{
@@ -57,12 +56,11 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES
},
GType_VERSAILLES,
- 0,
- 0,
+ GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING,
},
// Versailles 1685
- // French DOS
+ // French DOS from hybrid Win95/DOS CD
// From lePhilousophe
{
{
@@ -75,8 +73,7 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES
},
GType_VERSAILLES,
- 0,
- 0,
+ GF_VERSAILLES_NUMERICFONTS | GF_VERSAILLES_AUDIOPADDING,
},
// Versailles 1685
@@ -93,11 +90,10 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
GUI_OPTIONS_VERSAILLES
},
GType_VERSAILLES,
- 0,
- 0,
+ GF_VERSAILLES_AUDIOPADDING,
},
- { AD_TABLE_END_MARKER, 0, 0, 0 }
+ { AD_TABLE_END_MARKER, 0, 0 }
};
//////////////////////////////
@@ -117,7 +113,6 @@ static const CryOmni3DGameDescription fallbackDescs[] = {
},
GType_VERSAILLES,
0,
- 0
},
};
diff --git a/engines/cryomni3d/versailles/dialogs_manager.cpp b/engines/cryomni3d/versailles/dialogs_manager.cpp
index 1ec751ad9f..d7290c9049 100644
--- a/engines/cryomni3d/versailles/dialogs_manager.cpp
+++ b/engines/cryomni3d/versailles/dialogs_manager.cpp
@@ -93,8 +93,10 @@ void Versailles_DialogsManager::playDialog(const Common::String &video, const Co
Common::String videoFName(_engine->prepareFileName(video, "hnm"));
Common::String soundFName(sound);
- while (soundFName.size() < 8) {
- soundFName += '_';
+ if (_padAudioFileName) {
+ while (soundFName.size() < 8) {
+ soundFName += '_';
+ }
}
soundFName = _engine->prepareFileName(soundFName, "wav");
diff --git a/engines/cryomni3d/versailles/dialogs_manager.h b/engines/cryomni3d/versailles/dialogs_manager.h
index 9c41fc4cef..55d45ace36 100644
--- a/engines/cryomni3d/versailles/dialogs_manager.h
+++ b/engines/cryomni3d/versailles/dialogs_manager.h
@@ -37,7 +37,9 @@ class CryOmni3DEngine_Versailles;
class Versailles_DialogsManager : public DialogsManager {
public:
- Versailles_DialogsManager(CryOmni3DEngine_Versailles *engine) : _engine(engine) { }
+ Versailles_DialogsManager(CryOmni3DEngine_Versailles *engine,
+ bool padAudioFileName) : _engine(engine),
+ _padAudioFileName(padAudioFileName) { }
// This overload will hide the base one and this is what we want
bool play(const Common::String &sequence);
@@ -56,6 +58,7 @@ protected:
private:
CryOmni3DEngine_Versailles *_engine;
Common::HashMap<Common::String, ShowCallback> _shows;
+ bool _padAudioFileName;
void loadFrame(const Common::String &video);
diff --git a/engines/cryomni3d/versailles/engine.cpp b/engines/cryomni3d/versailles/engine.cpp
index e27991507d..98a34e31d5 100644
--- a/engines/cryomni3d/versailles/engine.cpp
+++ b/engines/cryomni3d/versailles/engine.cpp
@@ -53,7 +53,8 @@ CryOmni3DEngine_Versailles::CryOmni3DEngine_Versailles(OSystem *syst,
_mainPalette(nullptr), _cursorPalette(nullptr), _transparentPaletteMap(nullptr),
_currentPlace(nullptr), _currentWarpImage(nullptr), _fixedImage(nullptr),
_transitionAnimateWarp(true), _forceRedrawWarp(false), _forcePaletteUpdate(false),
- _fadedPalette(false), _loadedSave(uint(-1)), _dialogsMan(this),
+ _fadedPalette(false), _loadedSave(uint(-1)), _dialogsMan(this,
+ getFeatures() & GF_VERSAILLES_AUDIOPADDING),
_musicVolumeFactor(1.), _musicCurrentFile(nullptr),
_countingDown(false), _countdownNextEvent(0) {
}
@@ -302,7 +303,21 @@ void CryOmni3DEngine_Versailles::setupFonts() {
Common::Array<Common::String> fonts;
// Explainations below are based on original binaries, debug is not used in this engine
- if (getPlatform() == Common::kPlatformMacintosh) {
+ // 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
+ if (getFeatures() & GF_VERSAILLES_NUMERICFONTS) {
+ fonts.push_back("font01.CRF"); // 0: Doc titles
+ 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("font04.CRF"); // 3: Menu title, options messages boxes buttons
+ fonts.push_back("font05.CRF"); // 4: T2 in credits, text in docs
+ fonts.push_back("font06.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
+ fonts.push_back("font07.CRF"); // 6: T5 in credits, doc subtitle
+ fonts.push_back("font08.CRF"); // 7: dialogs texts
+ fonts.push_back("font09.CRF"); // 8: unused
+ fonts.push_back("font10.CRF"); // 9: Warp messages texts
+ fonts.push_back("font11.CRF"); // 10: debug
+ } else {
fonts.push_back("garamB18.CRF"); // 0: Doc titles
fonts.push_back("garamB22.CRF"); // 1: Menu and T0 in credits
//fonts.push_back("geneva15.CRF");
@@ -332,18 +347,6 @@ void CryOmni3DEngine_Versailles::setupFonts() {
// This file isn't even loaded by MacOS executable
//fonts.push_back("garamB20.CRF");
- } else {
- fonts.push_back("font01.CRF"); // 0: Doc titles
- 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("font04.CRF"); // 3: Menu title, options messages boxes buttons
- fonts.push_back("font05.CRF"); // 4: T2 in credits, text in docs
- fonts.push_back("font06.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
- fonts.push_back("font07.CRF"); // 6: T5 in credits, doc subtitle
- fonts.push_back("font08.CRF"); // 7: dialogs texts
- fonts.push_back("font09.CRF"); // 8: unused
- fonts.push_back("font10.CRF"); // 9: Warp messages texts
- fonts.push_back("font11.CRF"); // 10: debug
}
_fontManager.loadFonts(fonts);