[Scummvm-git-logs] scummvm master -> 52999549333f3df90b6c867ead4df42b0c375208
lephilousophe
noreply at scummvm.org
Sun Apr 2 15:06:54 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4c55d7ae3f CRYOMNI3D: Completely rework file accesses
5299954933 CRYOMNI3D: Fix directory globs
Commit: 4c55d7ae3f3159abcd8df0cd6c61661073919dfe
https://github.com/scummvm/scummvm/commit/4c55d7ae3f3159abcd8df0cd6c61661073919dfe
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-04-02T17:05:27+02:00
Commit Message:
CRYOMNI3D: Completely rework file accesses
The previous assumption that all files were identical is wrong.
Use full paths to make it work properly.
Changed paths:
engines/cryomni3d/cryomni3d.cpp
engines/cryomni3d/cryomni3d.h
engines/cryomni3d/dialogs_manager.cpp
engines/cryomni3d/dialogs_manager.h
engines/cryomni3d/fixed_image.cpp
engines/cryomni3d/fixed_image.h
engines/cryomni3d/font_manager.cpp
engines/cryomni3d/font_manager.h
engines/cryomni3d/fonts/cryoextfont.cpp
engines/cryomni3d/fonts/cryoextfont.h
engines/cryomni3d/fonts/cryofont.cpp
engines/cryomni3d/fonts/cryofont.h
engines/cryomni3d/versailles/dialogs.cpp
engines/cryomni3d/versailles/dialogs_manager.cpp
engines/cryomni3d/versailles/documentation.cpp
engines/cryomni3d/versailles/documentation.h
engines/cryomni3d/versailles/engine.cpp
engines/cryomni3d/versailles/engine.h
engines/cryomni3d/versailles/logic.cpp
engines/cryomni3d/versailles/menus.cpp
engines/cryomni3d/versailles/music.cpp
engines/cryomni3d/versailles/saveload.cpp
diff --git a/engines/cryomni3d/cryomni3d.cpp b/engines/cryomni3d/cryomni3d.cpp
index 3a4d0ab8f11..fb9649a0d65 100644
--- a/engines/cryomni3d/cryomni3d.cpp
+++ b/engines/cryomni3d/cryomni3d.cpp
@@ -96,45 +96,8 @@ DATSeekableStream *CryOmni3DEngine::getStaticData(uint32 gameId, uint16 version)
return gameStream;
}
-Common::String CryOmni3DEngine::prepareFileName(const Common::String &baseName,
- const char *const *extensions) const {
- Common::String fname(baseName);
-
- int lastDotPos = fname.size() - 1;
- for (; lastDotPos >= 0; --lastDotPos) {
- if (fname[lastDotPos] == '.') {
- break;
- }
- }
-
- int extBegin;
- if (lastDotPos > -1) {
- extBegin = lastDotPos + 1;
- fname.erase(extBegin);
- } else {
- fname += ".";
- extBegin = fname.size();
- }
-
- while (*extensions != nullptr) {
- fname += *extensions;
- debug("Trying file %s", fname.c_str());
- if (Common::File::exists(fname)) {
- return fname;
- }
- fname.erase(extBegin);
- extensions++;
- }
- fname.deleteLastChar();
- warning("Failed to find file %s/%s", baseName.c_str(), fname.c_str());
- return baseName;
-}
-
-void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::SoundType soundType,
+void CryOmni3DEngine::playHNM(const Common::Path &filepath, Audio::Mixer::SoundType soundType,
HNMCallback beforeDraw, HNMCallback afterDraw) {
- const char *const extensions[] = { "hns", "hnm", "ubb", nullptr };
- Common::String fname(prepareFileName(filename, extensions));
-
Graphics::PixelFormat screenFormat = g_system->getScreenFormat();
byte *currentPalette = nullptr;
if (screenFormat.bytesPerPixel == 1) {
@@ -146,8 +109,8 @@ void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::Soun
Video::VideoDecoder *videoDecoder = new Video::HNMDecoder(screenFormat, false, currentPalette);
videoDecoder->setSoundType(soundType);
- if (!videoDecoder->loadFile(fname)) {
- warning("Failed to open movie file %s/%s", filename.c_str(), fname.c_str());
+ if (!videoDecoder->loadFile(filepath)) {
+ warning("Failed to open movie file %s", filepath.toString().c_str());
delete videoDecoder;
return;
}
@@ -200,20 +163,18 @@ void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::Soun
delete videoDecoder;
}
-Image::ImageDecoder *CryOmni3DEngine::loadHLZ(const Common::String &filename) {
- Common::String fname(prepareFileName(filename, "hlz"));
-
+Image::ImageDecoder *CryOmni3DEngine::loadHLZ(const Common::Path &filepath) {
Common::File file;
- if (!file.open(fname)) {
- warning("Failed to open hlz file %s/%s", filename.c_str(), fname.c_str());
+ if (!file.open(filepath)) {
+ warning("Failed to open hlz file %s", filepath.toString().c_str());
return nullptr;
}
Image::ImageDecoder *imageDecoder = new Image::HLZFileDecoder();
if (!imageDecoder->loadStream(file)) {
- warning("Failed to open hlz file %s", fname.c_str());
+ warning("Failed to load hlz file %s", filepath.toString().c_str());
delete imageDecoder;
imageDecoder = nullptr;
return nullptr;
@@ -222,8 +183,8 @@ Image::ImageDecoder *CryOmni3DEngine::loadHLZ(const Common::String &filename) {
return imageDecoder;
}
-bool CryOmni3DEngine::displayHLZ(const Common::String &filename, uint32 timeout) {
- Image::ImageDecoder *imageDecoder = loadHLZ(filename);
+bool CryOmni3DEngine::displayHLZ(const Common::Path &filepath, uint32 timeout) {
+ Image::ImageDecoder *imageDecoder = loadHLZ(filepath);
if (!imageDecoder) {
return false;
diff --git a/engines/cryomni3d/cryomni3d.h b/engines/cryomni3d/cryomni3d.h
index bd34cf1603f..56f118827a4 100644
--- a/engines/cryomni3d/cryomni3d.h
+++ b/engines/cryomni3d/cryomni3d.h
@@ -104,7 +104,7 @@ private:
void pauseEngineIntern(bool) override;
public:
- Image::ImageDecoder *loadHLZ(const Common::String &filename);
+ Image::ImageDecoder *loadHLZ(const Common::Path &filepath);
void fillSurface(byte color);
/* We use CursorMan because it avoids problems with cursors in GMM */
@@ -112,10 +112,10 @@ public:
void setCursor(uint cursorId) const;
bool showMouse(bool visible) { return CursorMan.showMouse(visible); }
typedef void (CryOmni3DEngine::*HNMCallback)(uint frameNum);
- void playHNM(const Common::String &filename,
+ void playHNM(const Common::Path &filepath,
Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType,
HNMCallback beforeDraw = nullptr, HNMCallback afterDraw = nullptr);
- bool displayHLZ(const Common::String &filename, uint32 timeout = uint(-1));
+ bool displayHLZ(const Common::Path &filepath, uint32 timeout = uint(-1));
bool pollEvents();
Common::Point getMousePos();
@@ -129,13 +129,6 @@ public:
void setAutoRepeatClick(uint millis);
DragStatus getDragStatus() { return _dragStatus; }
- Common::String prepareFileName(const Common::String &baseName, const char *extension) const {
- const char *const extensions[] = { extension, nullptr };
- return prepareFileName(baseName, extensions);
- }
- virtual Common::String prepareFileName(const Common::String &baseName,
- const char *const *extensions) const;
-
virtual bool displayToolbar(const Graphics::Surface *original) = 0;
virtual bool hasPlaceDocumentation() = 0;
virtual bool displayPlaceDocumentation() = 0;
diff --git a/engines/cryomni3d/dialogs_manager.cpp b/engines/cryomni3d/dialogs_manager.cpp
index fb3a38d5b3b..9911ef510a1 100644
--- a/engines/cryomni3d/dialogs_manager.cpp
+++ b/engines/cryomni3d/dialogs_manager.cpp
@@ -30,10 +30,10 @@ DialogsManager::~DialogsManager() {
delete[] _gtoBuffer;
}
-void DialogsManager::loadGTO(const Common::String >oFileName) {
+void DialogsManager::loadGTO(const Common::Path >oFilePath) {
Common::File gtoFile;
- if (!gtoFile.open(gtoFileName)) {
- error("Can't open GTO file '%s'", gtoFileName.c_str());
+ if (!gtoFile.open(gtoFilePath)) {
+ error("Can't open GTO file '%s'", gtoFilePath.toString().c_str());
}
_labels.clear();
diff --git a/engines/cryomni3d/dialogs_manager.h b/engines/cryomni3d/dialogs_manager.h
index 6c084bcf73c..a303ccf1a0a 100644
--- a/engines/cryomni3d/dialogs_manager.h
+++ b/engines/cryomni3d/dialogs_manager.h
@@ -48,7 +48,7 @@ public:
virtual ~DialogsManager();
void init(uint arraySize, const Common::String &endOfConversationText) { _dialogsVariables.resize(arraySize); _endOfConversationText = endOfConversationText; }
- void loadGTO(const Common::String >oFile);
+ void loadGTO(const Common::Path >oFilePath);
void setupVariable(uint id, const Common::String &variable) { _dialogsVariables[id] = DialogVariable(variable, 'N'); }
void reinitVariables();
diff --git a/engines/cryomni3d/fixed_image.cpp b/engines/cryomni3d/fixed_image.cpp
index 5575da3d45c..66111ce21d2 100644
--- a/engines/cryomni3d/fixed_image.cpp
+++ b/engines/cryomni3d/fixed_image.cpp
@@ -69,7 +69,7 @@ void ZonFixedImage::run(const CallbackFunctor *callback) {
}
// Just pass a const char * for zone because it's for workarounds and constructing a null String at almost each load call is inefficient
-void ZonFixedImage::load(const Common::String &image, const char *zone) {
+void ZonFixedImage::load(const Common::Path &image, const char *zone) {
_imageSurface = nullptr;
delete _imageDecoder;
_imageDecoder = nullptr;
@@ -80,8 +80,8 @@ void ZonFixedImage::load(const Common::String &image, const char *zone) {
}
_imageSurface = _imageDecoder->getSurface();
- const Common::String &zoneFName = zone == nullptr ? image : zone;
- loadZones(zoneFName);
+ Common::Path zonePath(zone ? image.getParent().appendComponent(zone) : image);
+ loadZones(zonePath);
#if 0
// This is not correct but to debug zones I think it's OK
@@ -115,14 +115,20 @@ void ZonFixedImage::display() const {
g_system->updateScreen();
}
-void ZonFixedImage::loadZones(const Common::String &image) {
+void ZonFixedImage::loadZones(const Common::Path &image) {
_zones.clear();
- Common::String fname(_engine.prepareFileName(image, "zon"));
+ Common::String fname(image.getLastComponent().toString());
+ int lastDotPos = fname.findLastOf('.');
+ assert(lastDotPos > -1);
+ fname.erase(lastDotPos + 1);
+ fname += "zon";
+
+ Common::Path zonPath = image.getParent().appendComponent(fname);
Common::File zonFile;
- if (!zonFile.open(fname)) {
- error("Can't open ZON file '%s'", fname.c_str());
+ if (!zonFile.open(zonPath)) {
+ error("Can't open ZON file '%s'", zonPath.toString().c_str());
}
int32 zonesNumber = zonFile.size() / 26;
diff --git a/engines/cryomni3d/fixed_image.h b/engines/cryomni3d/fixed_image.h
index 1dae068fe25..8bc76b1c2ce 100644
--- a/engines/cryomni3d/fixed_image.h
+++ b/engines/cryomni3d/fixed_image.h
@@ -68,7 +68,7 @@ public:
void display() const;
/* These functions and attributes are used in image handler */
- void load(const Common::String &image, const char *zone = nullptr);
+ void load(const Common::Path &image, const char *zone = nullptr);
void manage();
void updateSurface(const Graphics::Surface *newSurface);
const Graphics::Surface *surface() const { return _imageSurface; }
@@ -109,7 +109,7 @@ protected:
bool valid;
};
- void loadZones(const Common::String &image);
+ void loadZones(const Common::Path &image);
void handleMouseZones(const Common::Array<Zone>::const_iterator ¤tZone);
Image::ImageDecoder *_imageDecoder;
diff --git a/engines/cryomni3d/font_manager.cpp b/engines/cryomni3d/font_manager.cpp
index 88b5edabfb4..cad06f5aafa 100644
--- a/engines/cryomni3d/font_manager.cpp
+++ b/engines/cryomni3d/font_manager.cpp
@@ -54,7 +54,7 @@ FontManager::~FontManager() {
}
}
-void FontManager::loadFonts(const Common::Array<Common::String> &fontFiles,
+void FontManager::loadFonts(const Common::Array<Common::Path> &fontFiles,
Common::CodePage codepage) {
assert(codepage != Common::kCodePageInvalid);
_codepage = codepage;
@@ -66,9 +66,10 @@ void FontManager::loadFonts(const Common::Array<Common::String> &fontFiles,
_fonts.clear();
_fonts.reserve(fontFiles.size());
- Common::HashMap<Common::String, Graphics::Font *> fontsCache;
+ Common::HashMap<Common::Path, Graphics::Font *,
+ Common::Path::IgnoreCaseAndMac_Hash, Common::Path::IgnoreCaseAndMac_EqualsTo> fontsCache;
- for (Common::Array<Common::String>::const_iterator it = fontFiles.begin(); it != fontFiles.end();
+ for (Common::Array<Common::Path>::const_iterator it = fontFiles.begin(); it != fontFiles.end();
it++) {
Graphics::Font *fontEntry = nullptr;
if (fontsCache.tryGetVal(*it, fontEntry)) {
@@ -93,7 +94,7 @@ void FontManager::loadFonts(const Common::Array<Common::String> &fontFiles,
}
}
-void FontManager::loadTTFList(const Common::String &ttfList, Common::CodePage codepage) {
+void FontManager::loadTTFList(const Common::Path &ttfList, Common::CodePage codepage) {
#ifdef USE_FREETYPE2
assert(codepage != Common::kCodePageInvalid);
_codepage = codepage;
@@ -107,9 +108,11 @@ void FontManager::loadTTFList(const Common::String &ttfList, Common::CodePage co
Common::File list;
if (!list.open(ttfList)) {
- error("can't open file %s", ttfList.c_str());
+ error("can't open file %s", ttfList.toString().c_str());
}
+ Common::Path ttfParentDir(ttfList.getParent());
+
Common::String line = list.readLine();
uint32 num = atoi(line.c_str());
@@ -141,6 +144,7 @@ void FontManager::loadTTFList(const Common::String &ttfList, Common::CodePage co
Common::Array<Common::String> fontFiles;
fontFiles.push_back(fontFile);
+ fontFiles.push_back(ttfParentDir.appendComponent(fontFile).toString());
// Use 96 dpi as it's the default under Windows
Graphics::Font *font = Graphics::findTTFace(fontFiles, uniFontFace, bold, italic, -(int)size,
diff --git a/engines/cryomni3d/font_manager.h b/engines/cryomni3d/font_manager.h
index b91ca06315f..5a36c7163a7 100644
--- a/engines/cryomni3d/font_manager.h
+++ b/engines/cryomni3d/font_manager.h
@@ -41,8 +41,8 @@ public:
FontManager();
virtual ~FontManager();
- void loadFonts(const Common::Array<Common::String> &fontFiles, Common::CodePage codepage);
- void loadTTFList(const Common::String &listFile, Common::CodePage codepage);
+ void loadFonts(const Common::Array<Common::Path> &fontFiles, Common::CodePage codepage);
+ void loadTTFList(const Common::Path &listFile, Common::CodePage codepage);
void setCurrentFont(int currentFont);
uint getCurrentFont() { return _currentFontId; }
void setTransparentBackground(bool transparent) { _transparentBackground = transparent; }
diff --git a/engines/cryomni3d/fonts/cryoextfont.cpp b/engines/cryomni3d/fonts/cryoextfont.cpp
index d6767a14006..7bc8d132b63 100644
--- a/engines/cryomni3d/fonts/cryoextfont.cpp
+++ b/engines/cryomni3d/fonts/cryoextfont.cpp
@@ -31,7 +31,7 @@ CryoExtFont::~CryoExtFont() {
delete _crf;
}
-void CryoExtFont::load(const Common::String &fontFile, Common::CodePage codepage) {
+void CryoExtFont::load(const Common::Path &fontFile, Common::CodePage codepage) {
// For now only CP950 is supported
assert(codepage == Common::kWindows950);
@@ -40,7 +40,7 @@ void CryoExtFont::load(const Common::String &fontFile, Common::CodePage codepage
Common::File *crf = new Common::File();
if (!crf->open(fontFile)) {
- error("can't open file %s", fontFile.c_str());
+ error("can't open file %s", fontFile.toString().c_str());
}
_crf = crf;
@@ -63,16 +63,16 @@ void CryoExtFont::load(const Common::String &fontFile, Common::CodePage codepage
_crf->read(_comment, sizeof(_comment));
//debug("Comment %s", _comment);
- Common::String offsetsFile = fontFile;
+ Common::String offsetsFile = fontFile.getLastComponent().toString();
offsetsFile.setChar('I', offsetsFile.size() - 1);
- loadOffsets(offsetsFile);
+ loadOffsets(fontFile.getParent().appendComponent(offsetsFile));
}
-void CryoExtFont::loadOffsets(const Common::String &offsetsFile) {
+void CryoExtFont::loadOffsets(const Common::Path &offsetsFile) {
Common::File cri;
if (!cri.open(offsetsFile)) {
- error("can't open file %s", offsetsFile.c_str());
+ error("can't open file %s", offsetsFile.toString().c_str());
}
uint32 counts = cri.size() / sizeof(uint32);
diff --git a/engines/cryomni3d/fonts/cryoextfont.h b/engines/cryomni3d/fonts/cryoextfont.h
index a8d72d7bd44..dc3316eb448 100644
--- a/engines/cryomni3d/fonts/cryoextfont.h
+++ b/engines/cryomni3d/fonts/cryoextfont.h
@@ -38,7 +38,7 @@ public:
CryoExtFont() : _height(0), _maxAdvance(0), _crf(nullptr), _codepage(Common::kCodePageInvalid) { }
virtual ~CryoExtFont();
- void load(const Common::String &fontFile, Common::CodePage encoding);
+ void load(const Common::Path &fontFile, Common::CodePage encoding);
virtual int getFontHeight() const { return _height; }
virtual int getMaxCharWidth() const { return _maxAdvance; }
@@ -50,7 +50,7 @@ public:
virtual void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const;
private:
- void loadOffsets(const Common::String &offsetsFile);
+ void loadOffsets(const Common::Path &offsetsFile);
void assureCached(uint32 chr) const;
uint32 mapGlyph(uint32 chr) const;
diff --git a/engines/cryomni3d/fonts/cryofont.cpp b/engines/cryomni3d/fonts/cryofont.cpp
index 06c2dc26924..fa53c92ce4e 100644
--- a/engines/cryomni3d/fonts/cryofont.cpp
+++ b/engines/cryomni3d/fonts/cryofont.cpp
@@ -27,11 +27,11 @@
namespace CryOmni3D {
-void CryoFont::load(const Common::String &fontFile) {
+void CryoFont::load(const Common::Path &fontFile) {
Common::File crf;
if (!crf.open(fontFile)) {
- error("can't open file %s", fontFile.c_str());
+ error("can't open file %s", fontFile.toString().c_str());
}
byte magic[8];
diff --git a/engines/cryomni3d/fonts/cryofont.h b/engines/cryomni3d/fonts/cryofont.h
index cdfb2c0174c..32dd0346db0 100644
--- a/engines/cryomni3d/fonts/cryofont.h
+++ b/engines/cryomni3d/fonts/cryofont.h
@@ -37,7 +37,7 @@ class CryoFont : public Graphics::Font {
public:
CryoFont() : _height(0), _maxAdvance(0) { }
- void load(const Common::String &fontFile);
+ void load(const Common::Path &fontFile);
virtual int getFontHeight() const { return _height; }
virtual int getMaxCharWidth() const { return _maxAdvance; }
diff --git a/engines/cryomni3d/versailles/dialogs.cpp b/engines/cryomni3d/versailles/dialogs.cpp
index db39ea56002..50ceb144611 100644
--- a/engines/cryomni3d/versailles/dialogs.cpp
+++ b/engines/cryomni3d/versailles/dialogs.cpp
@@ -33,7 +33,7 @@ bool CryOmni3DEngine_Versailles::preprocessDialog(const Common::String &sequence
}
if (_currentLevel == 1 && _currentPlaceId == 3) {
- playInGameVideo("11D_LEB1");
+ playInGameAnimVideo("11D_LEB1");
}
_dialogsMan["{JOUEUR-VU-MEMORANDUM-DANS-LUSTRE-DU-SALON-DE-LA-GUERRE}"] = 'N';
@@ -119,7 +119,7 @@ void CryOmni3DEngine_Versailles::postprocessDialog(const Common::String &sequenc
}
if (!_gameVariables[GameVariables::kGotMedalsSolution] &&
_dialogsMan["MONSIEUR-DONNE-SOLUTION-MEDAILLES"] == 'Y') {
- playInGameVideo("32M_MR2");
+ playInGameAnimVideo("32M_MR2");
_gameVariables[GameVariables::kGotMedalsSolution] = 1;
}
if (!_gameVariables[GameVariables::kDecipherScore] &&
@@ -293,7 +293,7 @@ void CryOmni3DEngine_Versailles::dialogShowBontempsGivesKey() {
}
void CryOmni3DEngine_Versailles::dialogShowDuMaineLeaves() {
- playInGameVideo("62S_DUC1");
+ playInGameAnimVideo("62S_DUC1");
_inventory.removeByNameID(144);
setPlaceState(19, 1);
}
@@ -312,7 +312,7 @@ void CryOmni3DEngine_Versailles::dialogShowLeBrunGives() {
}
void CryOmni3DEngine_Versailles::dialogShowLeBrunLeave() {
- playInGameVideo("11D_LEB3");
+ playInGameAnimVideo("11D_LEB3");
setGameTime(2, 1);
}
diff --git a/engines/cryomni3d/versailles/dialogs_manager.cpp b/engines/cryomni3d/versailles/dialogs_manager.cpp
index 2a7f83083a3..4d9393196db 100644
--- a/engines/cryomni3d/versailles/dialogs_manager.cpp
+++ b/engines/cryomni3d/versailles/dialogs_manager.cpp
@@ -93,28 +93,27 @@ void Versailles_DialogsManager::executeShow(const Common::String &show) {
void Versailles_DialogsManager::playDialog(const Common::String &video, const Common::String &sound,
const Common::String &text, const SubtitlesSettings &settings) {
- // Don't look for HNS file here
- Common::String videoFName(_engine->prepareFileName(video, "hnm"));
Common::String soundFName(sound);
-
if (_padAudioFileName) {
while (soundFName.size() < 8) {
soundFName += '_';
}
}
- soundFName = _engine->prepareFileName(soundFName, "wav");
+
+ Common::Path videoPath(_engine->getFilePath(kFileTypeDialAnim, video));
+ Common::Path soundPath(_engine->getFilePath(kFileTypeDialSound, soundFName));
Video::HNMDecoder *videoDecoder = new Video::HNMDecoder(g_system->getScreenFormat(), true);
- if (!videoDecoder->loadFile(videoFName)) {
- warning("Failed to open movie file %s/%s", video.c_str(), videoFName.c_str());
+ if (!videoDecoder->loadFile(videoPath)) {
+ warning("Failed to open movie file %s/%s", video.c_str(), videoPath.toString().c_str());
delete videoDecoder;
return;
}
Common::File *audioFile = new Common::File();
- if (!audioFile->open(soundFName)) {
- warning("Failed to open sound file %s/%s", sound.c_str(), soundFName.c_str());
+ if (!audioFile->open(soundPath)) {
+ warning("Failed to open sound file %s/%s", sound.c_str(), soundPath.toString().c_str());
delete videoDecoder;
delete audioFile;
return;
@@ -353,12 +352,12 @@ uint Versailles_DialogsManager::askPlayerQuestions(const Common::String &video,
}
void Versailles_DialogsManager::loadFrame(const Common::String &video) {
- Common::String videoFName(_engine->prepareFileName(video, "hnm"));
+ Common::Path videoPath(_engine->getFilePath(kFileTypeDialAnim, video));
Video::HNMDecoder *videoDecoder = new Video::HNMDecoder(g_system->getScreenFormat());
- if (!videoDecoder->loadFile(videoFName)) {
- warning("Failed to open movie file %s/%s", video.c_str(), videoFName.c_str());
+ if (!videoDecoder->loadFile(videoPath)) {
+ warning("Failed to open movie file %s/%s", video.c_str(), videoPath.toString().c_str());
delete videoDecoder;
return;
}
diff --git a/engines/cryomni3d/versailles/documentation.cpp b/engines/cryomni3d/versailles/documentation.cpp
index cabfd323226..11225a3f641 100644
--- a/engines/cryomni3d/versailles/documentation.cpp
+++ b/engines/cryomni3d/versailles/documentation.cpp
@@ -81,14 +81,14 @@ const Versailles_Documentation::TimelineEntry Versailles_Documentation::kTimelin
};
void Versailles_Documentation::init(const Sprites *sprites, FontManager *fontManager,
- const Common::StringArray *messages, CryOmni3DEngine *engine,
- const Common::String &allDocsFileName, const Common::String &linksDocsFileName) {
+ const Common::StringArray *messages, CryOmni3DEngine_Versailles *engine,
+ const Common::Path &allDocsFilePath, const Common::Path &linksDocsFilePath) {
_sprites = sprites;
_fontManager = fontManager;
_messages = messages;
_engine = engine;
- _allDocsFileName = allDocsFileName;
- _linksDocsFileName = linksDocsFileName;
+ _allDocsFilePath = allDocsFilePath;
+ _linksDocsFilePath = linksDocsFilePath;
// Japanese version of Versailles handles records attributes with multilines
_multilineAttributes = (_engine->getLanguage() == Common::JA_JPN);
@@ -96,8 +96,8 @@ void Versailles_Documentation::init(const Sprites *sprites, FontManager *fontMan
// Build list of records
Common::File allDocsFile;
- if (!allDocsFile.open(_allDocsFileName)) {
- error("Can't open %s", _allDocsFileName.c_str());
+ if (!allDocsFile.open(_allDocsFilePath)) {
+ error("Can't open %s", _allDocsFilePath.toString().c_str());
}
uint allDocsSize = allDocsFile.size();
@@ -283,7 +283,7 @@ Common::String Versailles_Documentation::docAreaHandleSummary() {
Image::BitmapDecoder bmpDecoder;
Common::File file;
- Image::ImageDecoder *imageDecoder = _engine->loadHLZ("SOM1.HLZ");
+ Image::ImageDecoder *imageDecoder = _engine->loadHLZ(_engine->getFilePath(kFileTypeDocBg, "SOM1.HLZ"));
if (!imageDecoder) {
return "";
}
@@ -294,7 +294,7 @@ Common::String Versailles_Documentation::docAreaHandleSummary() {
// No BMP to load
continue;
}
- if (!file.open(categories[i].bmp)) {
+ if (!file.open(_engine->getFilePath(kFileTypeSpriteBmp, categories[i].bmp))) {
error("Failed to open BMP file: %s", categories[i].bmp);
}
if (!bmpDecoder.loadStream(file)) {
@@ -428,7 +428,7 @@ Common::String Versailles_Documentation::docAreaHandleSummary() {
}
Common::String Versailles_Documentation::docAreaHandleTimeline() {
- Image::ImageDecoder *imageDecoder = _engine->loadHLZ("chrono1.HLZ");
+ Image::ImageDecoder *imageDecoder = _engine->loadHLZ(_engine->getFilePath(kFileTypeDocBg, "chrono1.HLZ"));
if (!imageDecoder) {
return "";
}
@@ -913,7 +913,7 @@ Common::String Versailles_Documentation::docAreaHandleGeneralMap() {
Image::BitmapDecoder bmpDecoder;
Common::File file;
- Image::ImageDecoder *imageDecoder = _engine->loadHLZ("PLANGR.HLZ");
+ Image::ImageDecoder *imageDecoder = _engine->loadHLZ(_engine->getFilePath(kFileTypeDocBg, "PLANGR.HLZ"));
if (!imageDecoder) {
return "";
}
@@ -921,7 +921,7 @@ Common::String Versailles_Documentation::docAreaHandleGeneralMap() {
for (uint i = 0; i < ARRAYSIZE(areas); i++) {
if (areas[i].bmp) {
- if (!file.open(areas[i].bmp)) {
+ if (!file.open(_engine->getFilePath(kFileTypeSpriteBmp, areas[i].bmp))) {
error("Failed to open BMP file: %s", areas[i].bmp);
}
if (!bmpDecoder.loadStream(file)) {
@@ -1167,7 +1167,7 @@ Common::String Versailles_Documentation::docAreaHandleCastleMap() {
boxes.setupBox(ARRAYSIZE(areas), 639 - _sprites->getCursor(105).getWidth(),
479 - _sprites->getCursor(105).getHeight(), 640, 480);
- Image::ImageDecoder *imageDecoder = _engine->loadHLZ("PLAN.HLZ");
+ Image::ImageDecoder *imageDecoder = _engine->loadHLZ(_engine->getFilePath(kFileTypeDocBg, "PLAN.HLZ"));
if (!imageDecoder) {
return "";
}
@@ -1464,15 +1464,13 @@ void Versailles_Documentation::drawRecordData(Graphics::ManagedSurface &surface,
} else {
background = _currentRecord;
}
- background = _engine->prepareFileName(background, "hlz");
- Common::File backgroundFl;
- if (!backgroundFl.open(background)) {
+ Common::Path backgroundPath = _engine->getFilePath(kFileTypeDocBg, background);
+ if (!Common::File::exists(backgroundPath)) {
background = _currentMapLayout ? "pas_fonP.hlz" : "pas_fond.hlz";
- } else {
- backgroundFl.close();
+ backgroundPath = _engine->getFilePath(kFileTypeDocBg, background);
}
- Image::ImageDecoder *imageDecoder = _engine->loadHLZ(background);
+ Image::ImageDecoder *imageDecoder = _engine->loadHLZ(backgroundPath);
const Graphics::Surface *bgFrame = imageDecoder->getSurface();
_engine->setupPalette(imageDecoder->getPalette(), imageDecoder->getPaletteStartIndex(),
@@ -1973,8 +1971,8 @@ Common::String Versailles_Documentation::getRecordTitle(const Common::String &re
const RecordInfo &recordInfo = it->_value;
Common::File allDocsFile;
- if (!allDocsFile.open(_allDocsFileName)) {
- error("Can't open %s", _allDocsFileName.c_str());
+ if (!allDocsFile.open(_allDocsFilePath)) {
+ error("Can't open %s", _allDocsFilePath.toString().c_str());
}
allDocsFile.seek(recordInfo.position);
@@ -2002,8 +2000,8 @@ Common::String Versailles_Documentation::getRecordData(const Common::String &rec
const RecordInfo &recordInfo = it->_value;
Common::File allDocsFile;
- if (!allDocsFile.open(_allDocsFileName)) {
- error("Can't open %s", _allDocsFileName.c_str());
+ if (!allDocsFile.open(_allDocsFilePath)) {
+ error("Can't open %s", _allDocsFilePath.toString().c_str());
}
allDocsFile.seek(recordInfo.position);
@@ -2056,8 +2054,8 @@ void Versailles_Documentation::loadLinksFile() {
}
Common::File linksFile;
- if (!linksFile.open(_linksDocsFileName)) {
- error("Can't open links file: %s", _linksDocsFileName.c_str());
+ if (!linksFile.open(_linksDocsFilePath)) {
+ error("Can't open links file: %s", _linksDocsFilePath.toString().c_str());
}
_linksSize = linksFile.size();
diff --git a/engines/cryomni3d/versailles/documentation.h b/engines/cryomni3d/versailles/documentation.h
index 4e2993ae8e3..645dd7434db 100644
--- a/engines/cryomni3d/versailles/documentation.h
+++ b/engines/cryomni3d/versailles/documentation.h
@@ -33,9 +33,9 @@ class FontManager;
class MouseBoxes;
class Sprites;
-class CryOmni3DEngine;
-
namespace Versailles {
+class CryOmni3DEngine_Versailles;
+
class Versailles_Documentation {
public:
Versailles_Documentation() : _engine(nullptr), _fontManager(nullptr), _sprites(nullptr),
@@ -44,8 +44,8 @@ public:
~Versailles_Documentation() { delete [] _linksData; }
void init(const Sprites *sprites, FontManager *fontManager, const Common::StringArray *messages,
- CryOmni3DEngine *engine, const Common::String &allDocsFileName,
- const Common::String &linksDocsFileName);
+ CryOmni3DEngine_Versailles *engine, const Common::Path &allDocsFilePath,
+ const Common::Path &linksDocsFilePath);
void handleDocArea();
void handleDocInGame(const Common::String &record);
@@ -110,12 +110,12 @@ private:
void loadLinksFile();
void getLinks(const Common::String &record, Common::Array<LinkInfo> &links);
- Common::String _allDocsFileName;
- Common::String _linksDocsFileName;
+ Common::Path _allDocsFilePath;
+ Common::Path _linksDocsFilePath;
static const uint kPopupMenuMargin = 5;
- CryOmni3DEngine *_engine;
+ CryOmni3DEngine_Versailles *_engine;
FontManager *_fontManager;
const Sprites *_sprites;
const Common::StringArray *_messages;
diff --git a/engines/cryomni3d/versailles/engine.cpp b/engines/cryomni3d/versailles/engine.cpp
index f79e2aa9c30..dcea51f0167 100644
--- a/engines/cryomni3d/versailles/engine.cpp
+++ b/engines/cryomni3d/versailles/engine.cpp
@@ -79,10 +79,36 @@ bool CryOmni3DEngine_Versailles::hasFeature(EngineFeature f) const {
}
void CryOmni3DEngine_Versailles::initializePath(const Common::FSNode &gamePath) {
- // All files are named uniquely so just add the main directory with a large enough depth and in flat mode
- // That should do it
- SearchMan.setIgnoreClashes(true);
- SearchMan.addDirectory(gamePath.getPath(), gamePath, 0, 5, true);
+ // This works if the user has installed the game as required in the Wiki
+ SearchMan.addDirectory(gamePath.getPath(), gamePath, 0, 4, false);
+
+ // CDs/DVD path
+ SearchMan.addSubDirectoryMatching(gamePath, "datas_v", 0, 4, false);
+
+ // If user has copied CDs in different directories
+ SearchMan.addSubDirectoryMatching(gamePath, "datas_v1", 0, 4, false);
+ SearchMan.addSubDirectoryMatching(gamePath, "datas_v2", 0, 4, false);
+
+ // Default hard-drive path location on CD
+ if (getPlatform() == Common::kPlatformMacintosh) {
+ switch (getLanguage()) {
+ case Common::DE_DEU:
+ SearchMan.addSubDirectoryMatching(gamePath, "versailles ordner/datav_hd", 0, 3, false);
+ break;
+ case Common::EN_ANY:
+ SearchMan.addSubDirectoryMatching(gamePath, "versailles folder/datav_hd", 0, 3, false);
+ break;
+ case Common::FR_FRA:
+ SearchMan.addSubDirectoryMatching(gamePath, "dossier versailles/datav_hd", 0, 3, false);
+ break;
+ default:
+ // We don't know any other variant but don't error out
+ break;
+ }
+ } else {
+ SearchMan.addSubDirectoryMatching(gamePath, "install/data", 0, 3, false);
+ SearchMan.addSubDirectoryMatching(gamePath, "install/datas_v", 0, 3, false);
+ }
}
Common::Error CryOmni3DEngine_Versailles::run() {
@@ -96,7 +122,7 @@ Common::Error CryOmni3DEngine_Versailles::run() {
_gameVariables.resize(GameVariables::kMax);
_omni3dMan.init(75. / 180. * M_PI);
- _dialogsMan.loadGTO(_localizedFilenames[LocalizedFilenames::kDialogs]);
+ _dialogsMan.loadGTO(getFilePath(kFileTypeGTO, _localizedFilenames[LocalizedFilenames::kDialogs]));
setupDialogVariables();
setupDialogShows();
@@ -130,10 +156,10 @@ Common::Error CryOmni3DEngine_Versailles::run() {
// Documentation is needed by noone at init time, let's do it last
initDocPeopleRecord();
_docManager.init(&_sprites, &_fontManager, &_messages, this,
- _localizedFilenames[LocalizedFilenames::kAllDocs],
- getFeatures() & GF_VERSAILLES_LINK_LOCALIZED ?
+ getFilePath(kFileTypeText, _localizedFilenames[LocalizedFilenames::kAllDocs]),
+ getFilePath(kFileTypeText, getFeatures() & GF_VERSAILLES_LINK_LOCALIZED ?
_localizedFilenames[LocalizedFilenames::kLinksDocs] :
- "lien_doc.txt");
+ "lien_doc.txt"));
_countdownSurface.create(40, 15, Graphics::PixelFormat::createFormatCLUT8());
@@ -256,47 +282,231 @@ bool CryOmni3DEngine_Versailles::shouldAbort() {
return _isPlaying && _abortCommand != kAbortNoAbort;
}
-Common::String CryOmni3DEngine_Versailles::prepareFileName(const Common::String &baseName,
- const char *const *extensions) const {
+static bool checkFilePath(const Common::Path &basePath, Common::String &baseName, const char * const *extensions, Common::Path &fullPath) {
+ if (!extensions) {
+ fullPath = basePath.appendComponent(baseName);
+ debug(3, "Trying file %s", fullPath.toString().c_str());
+ return Common::File::exists(fullPath);
+ }
+
+ int extBegin = baseName.size();
+ while (*extensions != nullptr) {
+ baseName += *extensions;
+ fullPath = basePath.appendComponent(baseName);
+ debug(3, "Trying file %s", fullPath.toString().c_str());
+ if (Common::File::exists(fullPath)) {
+ return true;
+ }
+ baseName.erase(extBegin);
+ extensions++;
+ }
+
+ return false;
+}
+
+Common::Path CryOmni3DEngine_Versailles::getFilePath(FileType fileType,
+ const Common::String &baseName) const {
+ const char **extensions = nullptr;
+ bool hasLevel = false;
+ const char *baseDir = nullptr;
+
+ switch (fileType) {
+ case kFileTypeAnimacti:
+ case kFileTypeDialAnim:
+ case kFileTypeWarpHNM: {
+ static const char *extensions_[] = { "hnm", nullptr };
+ extensions = extensions_;
+ break;
+ }
+ case kFileTypeTransScene: {
+ static const char *extensions_[] = { "hns", "hnm", nullptr };
+ extensions = extensions_;
+ break;
+ }
+ case kFileTypeDocBg:
+ case kFileTypeFixedImg:
+ case kFileTypeMenu:
+ case kFileTypeObject:
+ case kFileTypeTransSceneI:
+ case kFileTypeWarpCyclo: {
+ static const char *extensions_[] = { "hlz", nullptr };
+ extensions = extensions_;
+ break;
+ }
+ case kFileTypeDialSound:
+ case kFileTypeMusic:
+ case kFileTypeSound: {
+ static const char *extensions_[] = { "wav", nullptr };
+ extensions = extensions_;
+ break;
+ }
+ case kFileTypeFont:
+ case kFileTypeGTO:
+ case kFileTypeSaveGameVisit:
+ case kFileTypeSprite:
+ case kFileTypeSpriteBmp:
+ case kFileTypeText:
+ case kFileTypeWAM:
+ break;
+ default:
+ error("Invalid file type");
+ }
+
+ switch (fileType) {
+ case kFileTypeAnimacti:
+ baseDir = "animacti/level%d";
+ hasLevel = true;
+ break;
+ case kFileTypeDocBg:
+ baseDir = "basedoc/fonds";
+ break;
+ case kFileTypeDialAnim:
+ baseDir = "dial/flc_dial";
+ break;
+ case kFileTypeDialSound:
+ baseDir = "dial/voix";
+ break;
+ case kFileTypeFixedImg:
+ baseDir = "img_fix/level%d";
+ hasLevel = true;
+ break;
+ case kFileTypeFont:
+ baseDir = "fonts";
+ break;
+ case kFileTypeGTO:
+ baseDir = "gto";
+ break;
+ case kFileTypeMenu:
+ baseDir = "menu";
+ break;
+ case kFileTypeMusic:
+ baseDir = "music";
+ break;
+ case kFileTypeObject:
+ baseDir = "objets";
+ break;
+ case kFileTypeSaveGameVisit:
+ baseDir = "savegame/visite";
+ break;
+ case kFileTypeTransSceneI:
+ case kFileTypeTransScene:
+ baseDir = "sc_trans";
+ break;
+ case kFileTypeSound:
+ baseDir = "sound";
+ break;
+ case kFileTypeSprite:
+ baseDir = "spr8col";
+ break;
+ case kFileTypeSpriteBmp:
+ baseDir = "spr8col/bmpOK";
+ break;
+ case kFileTypeText:
+ baseDir = "textes";
+ break;
+ case kFileTypeWAM:
+ baseDir = "wam";
+ break;
+ case kFileTypeWarpCyclo:
+ baseDir = "warp/level%d/cyclo";
+ hasLevel = true;
+ break;
+ case kFileTypeWarpHNM:
+ baseDir = "warp/level%d/hnm";
+ hasLevel = true;
+ break;
+ default:
+ error("Invalid file type");
+ }
+
Common::String baseName_(baseName);
- if (getPlatform() != Common::kPlatformMacintosh) {
- // Replace dashes by underscores for PC versions
+ if ((getPlatform() != Common::kPlatformMacintosh) ||
+ (getLanguage() != Common::FR_FRA)) {
+ // Replace dashes by underscores for all versions except Mac FR
char *p = baseName_.begin();
while ((p = strchr(p, '-')) != nullptr) {
*p = '_';
p++;
}
}
- return CryOmni3DEngine::prepareFileName(baseName_, extensions);
+
+ if (extensions) {
+ // We will rewrite the extension: strip the provided one
+ // or append the extension dot
+ int lastDotPos = baseName_.findLastOf('.');
+ if (lastDotPos > -1) {
+ baseName_.erase(lastDotPos + 1);
+ } else {
+ baseName_ += ".";
+ }
+ }
+
+ // We are ready, build path and check
+ Common::Path basePath;
+ if (hasLevel) {
+ basePath = Common::String::format(baseDir, _currentLevel);
+ } else {
+ basePath = baseDir;
+ }
+
+ Common::Path fullPath;
+ if (checkFilePath(basePath, baseName_, extensions, fullPath)) {
+ return fullPath;
+ }
+
+ if (!hasLevel) {
+ warning("Failed to find file %s in %s", baseName.c_str(), baseDir);
+ return baseName;
+ }
+
+ assert(baseName_.size() > 0);
+ if (baseName_[0] < '1' ||
+ baseName_[0] > '7' ||
+ uint(baseName_[0] - '0') == _currentLevel) {
+ warning("Failed to find file %s in %s (level %d)", baseName.c_str(), baseDir, _currentLevel);
+ return baseName;
+ }
+
+ int fileLevel = baseName_[0] - '0';
+ basePath = Common::String::format(baseDir, fileLevel);
+
+ if (checkFilePath(basePath, baseName_, extensions, fullPath)) {
+ return fullPath;
+ }
+
+ warning("Failed to find file %s in %s (levels %d and %d)", baseName.c_str(), baseDir, _currentLevel, fileLevel);
+ return baseName;
}
void CryOmni3DEngine_Versailles::setupFonts() {
- Common::Array<Common::String> fonts;
+ Common::Array<Common::Path> fonts;
// 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
// The important is that the loaded one is present in all versions
+#define ADD_FONT(f) fonts.push_back(getFilePath(kFileTypeFont, f))
+
if (getLanguage() == Common::ZH_TWN) {
- fonts.push_back("tw13.CRF"); // 0: Doc titles
- fonts.push_back("tw18.CRF"); // 1: Menu and T0 in credits
- fonts.push_back("tw13.CRF"); // 2: T1 and T3 in credits
- fonts.push_back("tw12.CRF"); // 3: Menu title, options messages boxes buttons
- fonts.push_back("tw12.CRF"); // 4: T2 in credits, text in docs
- fonts.push_back("tw12.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
- fonts.push_back("tw12.CRF"); // 6: T5 in credits, doc subtitle
- fonts.push_back("tw12.CRF"); // 7: dialogs texts
- fonts.push_back("tw12.CRF"); // 8: unused
- fonts.push_back("tw12.CRF"); // 9: Warp messages texts
- fonts.push_back("tw12.CRF"); // 10: debug
+ ADD_FONT("tw13.CRF"); // 0: Doc titles
+ ADD_FONT("tw18.CRF"); // 1: Menu and T0 in credits
+ ADD_FONT("tw13.CRF"); // 2: T1 and T3 in credits
+ ADD_FONT("tw12.CRF"); // 3: Menu title, options messages boxes buttons
+ ADD_FONT("tw12.CRF"); // 4: T2 in credits, text in docs
+ ADD_FONT("tw12.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
+ ADD_FONT("tw12.CRF"); // 6: T5 in credits, doc subtitle
+ ADD_FONT("tw12.CRF"); // 7: dialogs texts
+ ADD_FONT("tw12.CRF"); // 8: unused
+ ADD_FONT("tw12.CRF"); // 9: Warp messages texts
+ ADD_FONT("tw12.CRF"); // 10: debug
_fontManager.loadFonts(fonts, Common::kWindows950);
return;
} else if (getLanguage() == Common::JA_JPN) {
- _fontManager.loadTTFList("FONTS_JP.LST", Common::kWindows932);
+ _fontManager.loadTTFList(getFilePath(kFileTypeFont, "FONTS_JP.LST"), Common::kWindows932);
return;
} else if (getLanguage() == Common::KO_KOR) {
- _fontManager.loadTTFList("FONTS_KR.LST", Common::kWindows949);
+ _fontManager.loadTTFList(getFilePath(kFileTypeFont, "FONTS_KR.LST"), Common::kWindows949);
return;
}
@@ -304,79 +514,81 @@ void CryOmni3DEngine_Versailles::setupFonts() {
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("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
+ ADD_FONT("font01.CRF"); // 0: Doc titles
+ ADD_FONT("font02.CRF"); // 1: Menu and T0 in credits
+ ADD_FONT("font03.CRF"); // 2: T1 and T3 in credits
+ ADD_FONT("font04.CRF"); // 3: Menu title, options messages boxes buttons
+ ADD_FONT("font05.CRF"); // 4: T2 in credits, text in docs
+ ADD_FONT("font06.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
+ ADD_FONT("font07.CRF"); // 6: T5 in credits, doc subtitle
+ ADD_FONT("font08.CRF"); // 7: dialogs texts
+ ADD_FONT("font09.CRF"); // 8: unused
+ ADD_FONT("font10.CRF"); // 9: Warp messages texts
+ ADD_FONT("font11.CRF"); // 10: debug
break;
case GF_VERSAILLES_FONTS_SET_A:
- fonts.push_back("garamB18.CRF"); // 0: Doc titles
- fonts.push_back("garamB22.CRF"); // 1: Menu and T0 in credits
- //fonts.push_back("geneva15.CRF");
- fonts.push_back("geneva14.CRF"); // 3: T1 and T3 in credits
- fonts.push_back("geneva13.CRF"); // 4: Menu title, options messages boxes buttons
- fonts.push_back("geneva12.CRF"); // 5: T2 in credits, text in docs
- fonts.push_back("geneva10.CRF"); // 6: objects description in toolbar, options messages boxes text, T4 in credits
- fonts.push_back("geneva9.CRF"); // 7: T5 in credits, doc subtitle
- //fonts.push_back("helvet24.CRF");
- fonts.push_back("helvet16.CRF"); // 9: dialogs texts
- //fonts.push_back("helvet14.CRF");
- //fonts.push_back("helvet13.CRF");
- //fonts.push_back("helvet12.CRF");
- //fonts.push_back("helvet11.CRF");
- //fonts.push_back("helvet9.CRF");
- //fonts.push_back("fruitL9.CRF");
- fonts.push_back("fruitL10.CRF"); // 16: debug doc
- //fonts.push_back("fruitL11.CRF");
- //fonts.push_back("fruitL12.CRF");
- //fonts.push_back("fruitL13.CRF");
- //fonts.push_back("fruitL14.CRF");
- //fonts.push_back("fruitL16.CRF");
- fonts.push_back("fruitL18.CRF"); // 22: Warp messages texts
- //fonts.push_back("arial11.CRF");
- fonts.push_back("MPW12.CRF"); // 24: debug
- //fonts.push_back("MPW9.CRF");
+ ADD_FONT("garamB18.CRF"); // 0: Doc titles
+ ADD_FONT("garamB22.CRF"); // 1: Menu and T0 in credits
+ //ADD_FONT("geneva15.CRF");
+ ADD_FONT("geneva14.CRF"); // 3: T1 and T3 in credits
+ ADD_FONT("geneva13.CRF"); // 4: Menu title, options messages boxes buttons
+ ADD_FONT("geneva12.CRF"); // 5: T2 in credits, text in docs
+ ADD_FONT("geneva10.CRF"); // 6: objects description in toolbar, options messages boxes text, T4 in credits
+ ADD_FONT("geneva9.CRF"); // 7: T5 in credits, doc subtitle
+ //ADD_FONT("helvet24.CRF");
+ ADD_FONT("helvet16.CRF"); // 9: dialogs texts
+ //ADD_FONT("helvet14.CRF");
+ //ADD_FONT("helvet13.CRF");
+ //ADD_FONT("helvet12.CRF");
+ //ADD_FONT("helvet11.CRF");
+ //ADD_FONT("helvet9.CRF");
+ //ADD_FONT("fruitL9.CRF");
+ ADD_FONT("fruitL10.CRF"); // 16: debug doc
+ //ADD_FONT("fruitL11.CRF");
+ //ADD_FONT("fruitL12.CRF");
+ //ADD_FONT("fruitL13.CRF");
+ //ADD_FONT("fruitL14.CRF");
+ //ADD_FONT("fruitL16.CRF");
+ ADD_FONT("fruitL18.CRF"); // 22: Warp messages texts
+ //ADD_FONT("arial11.CRF");
+ ADD_FONT("MPW12.CRF"); // 24: debug
+ //ADD_FONT("MPW9.CRF");
// This file isn't even loaded by MacOS executable
- //fonts.push_back("garamB20.CRF");
+ //ADD_FONT("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
+ ADD_FONT("garamB18.CRF"); // 0: Doc titles
+ ADD_FONT("garamB22.CRF"); // 1: Menu and T0 in credits
+ ADD_FONT("geneva14.CRF"); // 2: T1 and T3 in credits
+ ADD_FONT("geneva13.CRF"); // 3: Menu title, options messages boxes buttons
+ ADD_FONT("geneva12.CRF"); // 4: T2 in credits, text in docs
+ ADD_FONT("geneva10.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
+ ADD_FONT("geneva9.CRF"); // 6: T5 in credits, doc subtitle
+ ADD_FONT("helvet16.CRF"); // 7: dialogs texts
+ ADD_FONT("helvet12.CRF"); // 8: debug doc
+ ADD_FONT("fruitL18.CRF"); // 9: Warp messages texts
+ ADD_FONT("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
+ ADD_FONT("garamB18.CRF"); // 0: Doc titles
+ ADD_FONT("garamB22.CRF"); // 1: Menu and T0 in credits
+ ADD_FONT("geneva14.CRF"); // 2: T1 and T3 in credits
+ ADD_FONT("geneva13.CRF"); // 3: Menu title, options messages boxes buttons
+ ADD_FONT("helvet12.CRF"); // 4: T2 in credits, text in docs
+ ADD_FONT("geneva10.CRF"); // 5: objects description in toolbar, options messages boxes text, T4 in credits
+ ADD_FONT("geneva9.CRF"); // 6: T5 in credits, doc subtitle
+ ADD_FONT("helvet16.CRF"); // 7: dialogs texts
+ ADD_FONT("helvet12.CRF"); // 8: debug doc
+ ADD_FONT("fruitL18.CRF"); // 9: Warp messages texts
+ ADD_FONT("MPW12.CRF"); // 10: debug
break;
default:
error("Font set invalid");
}
+#undef ADD_FONT
+
// Use a SBCS codepage as a placeholder, we won't convert characters anyway
_fontManager.loadFonts(fonts, Common::kWindows1250);
}
@@ -384,9 +596,9 @@ void CryOmni3DEngine_Versailles::setupFonts() {
void CryOmni3DEngine_Versailles::setupSprites() {
Common::File file;
- Common::String fName = getLanguage() == Common::ZH_TWN ? "allsprtw.bin" : "all_spr.bin";
+ Common::String fName = (getLanguage() == Common::ZH_TWN ? "allsprtw.bin" : "all_spr.bin");
- if (!file.open(fName)) {
+ if (!file.open(getFilePath(kFileTypeSprite, fName))) {
error("Failed to open all_spr.bin file");
}
_sprites.loadSprites(file);
@@ -423,7 +635,7 @@ void CryOmni3DEngine_Versailles::loadCursorsPalette() {
Common::File file;
- if (!file.open("bou1_cA.bmp")) {
+ if (!file.open(getFilePath(kFileTypeSpriteBmp, "bou1_cA.bmp"))) {
error("Failed to open BMP file");
}
@@ -661,10 +873,11 @@ void CryOmni3DEngine_Versailles::playTransitionEndLevel(int level) {
// In original game the HNM player just doesn't render the cursor
bool cursorWasVisible = showMouse(false);
- if (level == -2) {
- if (getLanguage() == Common::DE_DEU && Common::File::exists("RAVENSBG.HLZ")) {
+ if (level == -2 && getLanguage() == Common::DE_DEU) {
+ Common::Path ravensbgPath(getFilePath(kFileTypeTransSceneI, "RAVENSBG"));
+ if (Common::File::exists(ravensbgPath)) {
// Display one more copyright
- if (displayHLZ("RAVENSBG", 5000)) {
+ if (displayHLZ(ravensbgPath, 5000)) {
clearKeys();
fadeOutPalette();
if (shouldAbort()) {
@@ -691,10 +904,11 @@ void CryOmni3DEngine_Versailles::playTransitionEndLevel(int level) {
return;
}
- if (level == -2) {
- if (getLanguage() == Common::JA_JPN && Common::File::exists("jvclogo.hnm")) {
+ if (level == -2 && getLanguage() == Common::JA_JPN) {
+ Common::Path jvcPath(getFilePath(kFileTypeTransScene, "jvclogo.hnm"));
+ if (Common::File::exists(jvcPath)) {
// Display one more copyright
- playHNM("jvclogo.hnm", Audio::Mixer::kMusicSoundType);
+ playHNM(jvcPath, Audio::Mixer::kMusicSoundType);
clearKeys();
if (shouldAbort()) {
return;
@@ -771,9 +985,9 @@ void CryOmni3DEngine_Versailles::initNewLevel(int level) {
void CryOmni3DEngine_Versailles::setupLevelWarps(int level) {
Common::File wamFile;
- Common::String wamFName = Common::String::format("level%d.wam", level);
- if (!wamFile.open(wamFName)) {
- error("Can't open WAM file '%s'", wamFName.c_str());
+ Common::Path wamPath = getFilePath(kFileTypeWAM, Common::String::format("level%d.wam", level));
+ if (!wamFile.open(wamPath)) {
+ error("Can't open WAM file '%s'", wamPath.toString().c_str());
}
_wam.loadStream(wamFile);
@@ -945,9 +1159,9 @@ void CryOmni3DEngine_Versailles::doGameOver() {
fillSurface(0);
// This test is not really relevant because it's for 2CDs edition but let's follow the code
if (_currentLevel < 4) {
- playInGameVideo("1gameove");
+ playInGameAnimVideo("1gameove");
} else {
- playInGameVideo("4gameove");
+ playInGameAnimVideo("4gameove");
}
fillSurface(0);
_abortCommand = kAbortGameOver;
@@ -977,7 +1191,7 @@ void CryOmni3DEngine_Versailles::doPlaceChange() {
delete _currentWarpImage;
}
debug("Loading warp %s", warpFile.c_str());
- _currentWarpImage = loadHLZ(warpFile);
+ _currentWarpImage = loadHLZ(getFilePath(kFileTypeWarpCyclo, warpFile));
if (!_currentWarpImage) {
error("Can't load warp %s", warpFile.c_str());
}
@@ -1053,7 +1267,7 @@ void CryOmni3DEngine_Versailles::executeTransition(uint nextPlaceId) {
} else if (animation != "") {
_fadedPalette = false;
// Normally transitions don't overwrite the cursors colors and game doesn't restore palette
- playInGameVideo(animation, false);
+ playInGameVideo(getFilePath(kFileTypeWarpHNM, animation), false);
}
_omni3dMan.setAlpha(transition->dstAlpha);
@@ -1095,7 +1309,7 @@ void CryOmni3DEngine_Versailles::executeTransition(uint nextPlaceId) {
} else if (animation != "") {
_fadedPalette = false;
// Normally transitions don't overwrite the cursors colors and game doesn't restore palette
- playInGameVideo(animation, false);
+ playInGameVideo(getFilePath(kFileTypeWarpHNM, animation), false);
}
_nextPlaceId = nextNextPlaceId;
@@ -1500,7 +1714,7 @@ void CryOmni3DEngine_Versailles::collectObject(Object *obj, const ZonFixedImage
void CryOmni3DEngine_Versailles::displayObject(const Common::String &imgName,
DisplayObjectHook hook) {
- Image::ImageDecoder *imageDecoder = loadHLZ(imgName);
+ Image::ImageDecoder *imageDecoder = loadHLZ(getFilePath(kFileTypeObject, imgName));
if (!imageDecoder) {
error("Can't display object");
}
@@ -1621,7 +1835,7 @@ uint CryOmni3DEngine_Versailles::getFakeTransition(uint actionId) const {
return 0;
}
-void CryOmni3DEngine_Versailles::playInGameVideo(const Common::String &filename,
+void CryOmni3DEngine_Versailles::playInGameVideo(const Common::Path &filename,
bool restoreCursorPalette) {
if (!_isPlaying) {
return;
@@ -1653,7 +1867,7 @@ void CryOmni3DEngine_Versailles::playSubtitledVideo(const Common::String &filena
it->_value.size() == 0) {
// No subtitle, don't try to handle them frame by frame
// Videos are like music because if you mute music in game it will mute videos soundtracks
- playHNM(filename, Audio::Mixer::kMusicSoundType);
+ playHNM(getFilePath(kFileTypeTransScene, filename), Audio::Mixer::kMusicSoundType);
return;
}
@@ -1673,7 +1887,7 @@ void CryOmni3DEngine_Versailles::playSubtitledVideo(const Common::String &filena
_fontManager.setCharSpacing(1);
// Videos are like music because if you mute music in game it will mute videos soundtracks
- playHNM(filename, Audio::Mixer::kMusicSoundType,
+ playHNM(getFilePath(kFileTypeTransScene, filename), Audio::Mixer::kMusicSoundType,
static_cast<HNMCallback>(&CryOmni3DEngine_Versailles::drawVideoSubtitles), nullptr);
clearKeys();
@@ -1726,13 +1940,13 @@ void CryOmni3DEngine_Versailles::loadBMPs(const char *pattern, Graphics::Surface
Common::File file;
for (uint i = 0; i < count; i++) {
- Common::String bmp = Common::String::format(pattern, i);
+ Common::Path bmp = getFilePath(kFileTypeSpriteBmp, Common::String::format(pattern, i));
if (!file.open(bmp)) {
- error("Failed to open BMP file: %s", bmp.c_str());
+ error("Failed to open BMP file: %s", bmp.toString().c_str());
}
if (!bmpDecoder.loadStream(file)) {
- error("Failed to load BMP file: %s", bmp.c_str());
+ error("Failed to load BMP file: %s", bmp.toString().c_str());
}
bmps[i].copyFrom(*bmpDecoder.getSurface());
bmpDecoder.destroy();
diff --git a/engines/cryomni3d/versailles/engine.h b/engines/cryomni3d/versailles/engine.h
index 7640ec94d67..adc029cf70a 100644
--- a/engines/cryomni3d/versailles/engine.h
+++ b/engines/cryomni3d/versailles/engine.h
@@ -179,6 +179,29 @@ struct LocalizedFilenames {
};
};
+enum FileType {
+ kFileTypeAnimacti,
+ kFileTypeDocBg,
+ kFileTypeDialAnim,
+ kFileTypeDialSound,
+ kFileTypeFont,
+ kFileTypeGTO,
+ kFileTypeFixedImg,
+ kFileTypeMenu,
+ kFileTypeMusic,
+ kFileTypeObject,
+ kFileTypeSaveGameVisit,
+ kFileTypeTransScene,
+ kFileTypeTransSceneI,
+ kFileTypeSound,
+ kFileTypeSprite,
+ kFileTypeSpriteBmp,
+ kFileTypeText,
+ kFileTypeWAM,
+ kFileTypeWarpCyclo,
+ kFileTypeWarpHNM
+};
+
struct PlaceState {
typedef void (CryOmni3DEngine_Versailles::*InitFunc)();
typedef bool (CryOmni3DEngine_Versailles::*FilterEventFunc)(uint *event);
@@ -240,12 +263,7 @@ public:
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::String getSaveStateName(int slot) const override;
- Common::String prepareFileName(const Common::String &baseName, const char *extension) const {
- const char *const extensions[] = { extension, nullptr };
- return prepareFileName(baseName, extensions);
- }
- Common::String prepareFileName(const Common::String &baseName,
- const char *const *extensions) const override;
+ Common::Path getFilePath(FileType fileType, const Common::String &baseName) const;
void setupPalette(const byte *colors, uint start, uint num) override { setupPalette(colors, start, num, true); }
void makeTranslucent(Graphics::Surface &dst, const Graphics::Surface &src) const override;
@@ -346,7 +364,10 @@ private:
bool showSubtitles() const;
- void playInGameVideo(const Common::String &filename, bool restoreCursorPalette = true);
+ void playInGameAnimVideo(const Common::String &filename) {
+ playInGameVideo(getFilePath(kFileTypeAnimacti, filename));
+ }
+ void playInGameVideo(const Common::Path &filename, bool restoreCursorPalette = true);
void playSubtitledVideo(const Common::String &filename);
void loadBMPs(const char *pattern, Graphics::Surface *bmps, uint count);
diff --git a/engines/cryomni3d/versailles/logic.cpp b/engines/cryomni3d/versailles/logic.cpp
index cee28b17168..45fb610e79a 100644
--- a/engines/cryomni3d/versailles/logic.cpp
+++ b/engines/cryomni3d/versailles/logic.cpp
@@ -326,11 +326,11 @@ static const char *kImagesPaintings[] = {
"30N_1.GIF", // 23: 43090
"30N_2.GIF", // 24: 43091
"30N_3.GIF", // 25: 43092
- "30O_1.GIF", // 26: 43100
- "30O_2.GIF", // 27: 43101
- "30O_31.GIF", // 28: 43102
- "30O_32.GIF", // 29: 43103
- "30O_33.GIF", // 30: 43104
+ "30O-1.GIF", // 26: 43100
+ "30O-2.GIF", // 27: 43101
+ "30O-31.GIF", // 28: 43102
+ "30O-32.GIF", // 29: 43103
+ "30O-33.GIF", // 30: 43104
"30M_1.GIF", // 31: 43130
"30M_2.GIF", // 32: 43131
"30M_3.GIF", // 33: 43132
@@ -462,10 +462,13 @@ void CryOmni3DEngine_Versailles::setupImgScripts() {
#undef SET_SCRIPT_BY_ID
}
+#define FIMG_LOAD(img) fimg->load(getFilePath(kFileTypeFixedImg, img))
+#define FIMG_LOADz(img, zon) fimg->load(getFilePath(kFileTypeFixedImg, img), zon)
+
// Generic handler for dumb fixed images
template<uint ID>
void CryOmni3DEngine_Versailles::genericDumbImage(ZonFixedImage *fimg) {
- fimg->load(kImagesPaintings[ID]);
+ FIMG_LOAD(kImagesPaintings[ID]);
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -487,7 +490,7 @@ void CryOmni3DEngine_Versailles::genericDumbImage(ZonFixedImage *fimg) {
// Generic handler for paintings fixed images
template<uint ID>
void CryOmni3DEngine_Versailles::genericPainting(ZonFixedImage *fimg) {
- fimg->load(kImagesPaintings[ID]);
+ FIMG_LOAD(kImagesPaintings[ID]);
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -502,7 +505,7 @@ void CryOmni3DEngine_Versailles::genericPainting(ZonFixedImage *fimg) {
#define IMG_CB(name) void CryOmni3DEngine_Versailles::img_ ## name(ZonFixedImage *fimg)
IMG_CB(31101) {
- fimg->load("21F_11.GIF");
+ FIMG_LOAD("21F_11.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -527,7 +530,7 @@ IMG_CB(31101) {
}
IMG_CB(31101b) {
- fimg->load("21F_10.GIF");
+ FIMG_LOAD("21F_10.GIF");
if (_inventory.inInventoryByNameID(103)) {
fimg->disableZone(1);
}
@@ -546,7 +549,7 @@ IMG_CB(31101b) {
}
IMG_CB(31142) {
- fimg->load("10D2_4.GIF");
+ FIMG_LOAD("10D2_4.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -562,7 +565,7 @@ IMG_CB(31142) {
}
IMG_CB(31142b) {
- fimg->load("11D2_2.GIF");
+ FIMG_LOAD("11D2_2.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -590,7 +593,7 @@ IMG_CB(31142b) {
}
IMG_CB(31142c) {
- fimg->load("11D2_21.GIF");
+ FIMG_LOAD("11D2_21.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -613,7 +616,7 @@ IMG_CB(31142c) {
}
IMG_CB(31142d) {
- fimg->load("11D2_22.GIF");
+ FIMG_LOAD("11D2_22.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -632,7 +635,7 @@ IMG_CB(31142d) {
}
IMG_CB(31143) {
- fimg->load("10D2_3.GIF");
+ FIMG_LOAD("10D2_3.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -648,7 +651,7 @@ IMG_CB(31143) {
}
IMG_CB(31143b) {
- fimg->load("11D2_1.GIF");
+ FIMG_LOAD("11D2_1.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -676,7 +679,7 @@ IMG_CB(31143b) {
}
IMG_CB(31143c) {
- fimg->load("11D2_11.GIF");
+ FIMG_LOAD("11D2_11.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -698,7 +701,7 @@ IMG_CB(31143c) {
}
IMG_CB(31143d) {
- fimg->load("11D2_12.GIF");
+ FIMG_LOAD("11D2_12.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -729,7 +732,7 @@ IMG_CB(32120) {
return;
}
- fimg->load("23I_10.GIF");
+ FIMG_LOAD("23I_10.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -782,7 +785,7 @@ IMG_CB(32120) {
_gameVariables[GameVariables::kBrushColor] == 1) {
// Gold brush used on sketch
_gameVariables[GameVariables::kSketchState] = 3;
- playInGameVideo("23I_11");
+ playInGameAnimVideo("23I_11");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -797,7 +800,7 @@ IMG_CB(32120) {
_gameVariables[GameVariables::kBrushColor] == 2) {
// Red brush used on sketch
_gameVariables[GameVariables::kSketchState] = 4;
- playInGameVideo("23I_12");
+ playInGameAnimVideo("23I_12");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -815,7 +818,7 @@ IMG_CB(32120) {
}
IMG_CB(32120b) {
- fimg->load("23I_11.GIF");
+ FIMG_LOAD("23I_11.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneUse) {
@@ -833,7 +836,7 @@ IMG_CB(32120b) {
}
IMG_CB(32120c) {
- fimg->load("23I_12.GIF");
+ FIMG_LOAD("23I_12.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneUse) {
@@ -851,7 +854,7 @@ IMG_CB(32120c) {
}
IMG_CB(32201) {
- fimg->load("21E_41.GIF");
+ FIMG_LOAD("21E_41.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -868,7 +871,7 @@ IMG_CB(32201) {
}
IMG_CB(32202) {
- fimg->load("21E_42.GIF");
+ FIMG_LOAD("21E_42.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -879,7 +882,7 @@ IMG_CB(32202) {
}
IMG_CB(32203) {
- fimg->load("21E_43.GIF");
+ FIMG_LOAD("21E_43.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -896,7 +899,7 @@ IMG_CB(32203) {
}
IMG_CB(32204) {
- fimg->load("21E_44.GIF");
+ FIMG_LOAD("21E_44.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -919,7 +922,7 @@ IMG_CB(32204) {
}
IMG_CB(32204b) {
- fimg->load("21E_45.GIF");
+ FIMG_LOAD("21E_45.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -930,7 +933,7 @@ IMG_CB(32204b) {
}
IMG_CB(34131) {
- fimg->load("43ZA_1.GIF");
+ FIMG_LOAD("43ZA_1.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -941,7 +944,7 @@ IMG_CB(34131) {
}
IMG_CB(34132) {
- fimg->load("43ZB_2.GIF");
+ FIMG_LOAD("43ZB_2.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -952,7 +955,7 @@ IMG_CB(34132) {
}
IMG_CB(34172) {
- playInGameVideo("43X3_10");
+ playInGameAnimVideo("43X3_10");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -961,7 +964,7 @@ IMG_CB(34172) {
}
IMG_CB(34173) {
- fimg->load("43X3_2.GIF");
+ FIMG_LOAD("43X3_2.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -971,7 +974,7 @@ IMG_CB(34173) {
if (fimg->_zoneUse) {
// WORKAROUND: The video doesn't exist there is only a fixed image unused in original game. We will use it.
/*
- playInGameVideo("43X3_21");
+ playInGameAnimVideo("43X3_21");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -993,7 +996,7 @@ IMG_CB(34173) {
// see what happens. You just get the reminder and see the empty drawer.
IMG_CB(34173b) {
// 43X3_21 doesn't have a ZON file, use the one of 43X3_22
- fimg->load("43X3_21.GIF", "43X3_22.ZON");
+ FIMG_LOADz("43X3_21.GIF", "43X3_22.ZON");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1015,7 +1018,7 @@ IMG_CB(34173b) {
}
IMG_CB(34173c) {
- fimg->load("43X3_22.GIF");
+ FIMG_LOAD("43X3_22.GIF");
// WORKAROUND: Drawer is empty, just disable the use zone
fimg->disableZone(0);
while (1) {
@@ -1028,7 +1031,7 @@ IMG_CB(34173c) {
}
IMG_CB(34174) {
- fimg->load("43X3_42.GIF");
+ FIMG_LOAD("43X3_42.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1048,7 +1051,7 @@ IMG_CB(34174) {
IMG_CB(34174b) {
// Door is open but safe is closed
- fimg->load("43X3_40.GIF");
+ FIMG_LOAD("43X3_40.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1112,14 +1115,14 @@ IMG_CB(34174c) {
return;
}
- playInGameVideo("cofouv");
+ playInGameAnimVideo("cofouv");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
}
// Safe has both blueprints
- fimg->load("43X3_30.GIF");
+ FIMG_LOAD("43X3_30.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1155,7 +1158,7 @@ IMG_CB(34174c) {
IMG_CB(34174d) {
// Safe has only blueprint 2
- fimg->load("43X3_43.GIF");
+ FIMG_LOAD("43X3_43.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1178,7 +1181,7 @@ IMG_CB(34174d) {
IMG_CB(34174e) {
// Safe has only blueprint 1
- fimg->load("43X3_41.GIF");
+ FIMG_LOAD("43X3_41.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1202,7 +1205,7 @@ IMG_CB(34174e) {
IMG_CB(34174f) {
// Safe is empty
- fimg->load("43X3_45.GIF");
+ FIMG_LOAD("43X3_45.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1232,7 +1235,7 @@ bool CryOmni3DEngine_Versailles::handleSafe(ZonFixedImage *fimg) {
safeDigits[i] = rnd.getRandomNumber(9);
}
- fimg->load("43x3_cof.GIF");
+ FIMG_LOAD("43x3_cof.GIF");
const Graphics::Surface *fimgSurface = fimg->surface();
tempSurf.create(fimgSurface->w, fimgSurface->h, fimgSurface->format);
tempSurf.blitFrom(*fimgSurface);
@@ -1249,7 +1252,7 @@ bool CryOmni3DEngine_Versailles::handleSafe(ZonFixedImage *fimg) {
// Safe handle
// Animate handle
- playInGameVideo("43x3_poi");
+ playInGameAnimVideo("43x3_poi");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1323,7 +1326,7 @@ bool CryOmni3DEngine_Versailles::checkSafeDigits(unsigned char (&safeDigits)[kSa
}
IMG_CB(41202) {
- fimg->load("10E_20.GIF");
+ FIMG_LOAD("10E_20.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1349,7 +1352,7 @@ IMG_CB(41202) {
}
IMG_CB(41202b) {
- fimg->load("10E_21.GIF");
+ FIMG_LOAD("10E_21.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -1379,7 +1382,7 @@ IMG_CB(41202b) {
}
IMG_CB(41801) {
- fimg->load("12E2_10.GIF");
+ FIMG_LOAD("12E2_10.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1414,7 +1417,7 @@ IMG_CB(41801) {
} else {
// Display trunk with paper in it
// Animate opening
- playInGameVideo("12E2_11");
+ playInGameAnimVideo("12E2_11");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1432,7 +1435,7 @@ IMG_CB(41801) {
}
IMG_CB(41801b) {
- fimg->load("12E2_11.GIF");
+ FIMG_LOAD("12E2_11.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -1440,7 +1443,7 @@ IMG_CB(41801b) {
}
if (fimg->_zoneLow) {
// Animate closing
- playInGameVideo("12E2_13");
+ playInGameAnimVideo("12E2_13");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1465,7 +1468,7 @@ IMG_CB(41801b) {
}
IMG_CB(41801c) {
- fimg->load("12E2_12.GIF");
+ FIMG_LOAD("12E2_12.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -1473,7 +1476,7 @@ IMG_CB(41801c) {
}
if (fimg->_zoneLow) {
// Animate closing
- playInGameVideo("12E2_13");
+ playInGameAnimVideo("12E2_13");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1515,7 +1518,7 @@ IMG_CB(41802) {
}
// There we have paper on table and ink is in its inkpot
- fimg->load("12E2_20.GIF");
+ FIMG_LOAD("12E2_20.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1547,7 +1550,7 @@ IMG_CB(41802) {
if (fimg->_usedObject && fimg->_currentZone == 0) {
uint objID = fimg->_usedObject->idOBJ();
if (objID == 100) {
- playInGameVideo("12E2_24");
+ playInGameAnimVideo("12E2_24");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1559,7 +1562,7 @@ IMG_CB(41802) {
setGameTime(3, 1);
} else if (objID == 96) {
// Lampoon about arts
- playInGameVideo("PAP-BRUL");
+ playInGameAnimVideo("PAP-BRUL");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1572,7 +1575,7 @@ IMG_CB(41802) {
IMG_CB(41802b) {
// There we have paper on table with ink on it
- fimg->load("12E2_21.GIF");
+ FIMG_LOAD("12E2_21.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1594,7 +1597,7 @@ IMG_CB(41802b) {
if (fimg->_usedObject && fimg->_currentZone == 0) {
uint objID = fimg->_usedObject->idOBJ();
if (objID == 100) {
- playInGameVideo("12E2_24");
+ playInGameAnimVideo("12E2_24");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1606,7 +1609,7 @@ IMG_CB(41802b) {
setGameTime(3, 1);
} else if (objID == 96) {
// Lampoon about arts
- playInGameVideo("PAP-BRUL");
+ playInGameAnimVideo("PAP-BRUL");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1619,7 +1622,7 @@ IMG_CB(41802b) {
IMG_CB(41802c) {
// There we have ink in inkpot and without paper
- fimg->load("12E2_22.GIF");
+ FIMG_LOAD("12E2_22.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1639,7 +1642,7 @@ IMG_CB(41802c) {
if (fimg->_usedObject && fimg->_currentZone == 0) {
uint objID = fimg->_usedObject->idOBJ();
if (objID == 100) {
- playInGameVideo("12E2_24");
+ playInGameAnimVideo("12E2_24");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1651,7 +1654,7 @@ IMG_CB(41802c) {
setGameTime(3, 1);
} else if (objID == 96) {
// Lampoon about arts
- playInGameVideo("PAP-BRUL");
+ playInGameAnimVideo("PAP-BRUL");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1664,7 +1667,7 @@ IMG_CB(41802c) {
IMG_CB(41802d) {
// There we have ink directly on table
- fimg->load("12E2_23.GIF");
+ FIMG_LOAD("12E2_23.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1674,7 +1677,7 @@ IMG_CB(41802d) {
if (fimg->_usedObject && fimg->_currentZone == 0) {
uint objID = fimg->_usedObject->idOBJ();
if (objID == 100) {
- playInGameVideo("12E2_24");
+ playInGameAnimVideo("12E2_24");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1686,7 +1689,7 @@ IMG_CB(41802d) {
setGameTime(3, 1);
} else if (objID == 96) {
// Lampoon about arts
- playInGameVideo("PAP-BRUL");
+ playInGameAnimVideo("PAP-BRUL");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1708,7 +1711,7 @@ IMG_CB(43143) {
return;
}
- fimg->load("30L_31.GIF");
+ FIMG_LOAD("30L_31.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1720,7 +1723,7 @@ IMG_CB(43143) {
}
IMG_CB(43143b) {
- fimg->load("30L_3101.GIF");
+ FIMG_LOAD("30L_3101.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1747,7 +1750,7 @@ IMG_CB(43143b) {
}
IMG_CB(43145) {
- fimg->load("30L_50.GIF");
+ FIMG_LOAD("30L_50.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1756,7 +1759,7 @@ IMG_CB(43145) {
}
if (fimg->_zoneUse) {
if (fimg->_currentZone == 0) {
- playInGameVideo("30L_51");
+ playInGameAnimVideo("30L_51");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1768,7 +1771,7 @@ IMG_CB(43145) {
fimg->changeCallback(functor);
break;
} else if (fimg->_currentZone == 1) {
- playInGameVideo("30L_52");
+ playInGameAnimVideo("30L_52");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1785,7 +1788,7 @@ IMG_CB(43145) {
}
IMG_CB(43145b) {
- fimg->load("30L_51.GIF");
+ FIMG_LOAD("30L_51.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -1815,7 +1818,7 @@ IMG_CB(43145b) {
}
IMG_CB(43145c) {
- fimg->load("30L_52.GIF");
+ FIMG_LOAD("30L_52.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -1839,7 +1842,7 @@ IMG_CB(43145c) {
}
IMG_CB(43146) {
- fimg->load("30L_40.GIF");
+ FIMG_LOAD("30L_40.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1848,7 +1851,7 @@ IMG_CB(43146) {
}
if (fimg->_zoneUse) {
if (fimg->_currentZone == 0) {
- playInGameVideo("30L_41");
+ playInGameAnimVideo("30L_41");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1860,7 +1863,7 @@ IMG_CB(43146) {
fimg->changeCallback(functor);
break;
} else if (fimg->_currentZone == 1) {
- playInGameVideo("30L_42");
+ playInGameAnimVideo("30L_42");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -1877,7 +1880,7 @@ IMG_CB(43146) {
}
IMG_CB(43146b) {
- fimg->load("30L_41.GIF");
+ FIMG_LOAD("30L_41.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -1901,7 +1904,7 @@ IMG_CB(43146b) {
}
IMG_CB(43146c) {
- fimg->load("30L_42.GIF");
+ FIMG_LOAD("30L_42.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -1948,7 +1951,7 @@ IMG_CB(43160) {
}
// There we have charcoal and paper on table
- fimg->load("31I01.GIF");
+ FIMG_LOAD("31I01.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -1981,7 +1984,7 @@ IMG_CB(43160) {
IMG_CB(43160b) {
// There we have paper on table but without charcoal
- fimg->load("31I02.GIF");
+ FIMG_LOAD("31I02.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -2002,7 +2005,7 @@ IMG_CB(43160b) {
IMG_CB(43160c) {
// There we have charcoal on table but without paper
- fimg->load("31I03.GIF");
+ FIMG_LOAD("31I03.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -2023,7 +2026,7 @@ IMG_CB(43160c) {
IMG_CB(43160d) {
// There we have neither charcoal nor paper on table
- fimg->load("31I04.GIF");
+ FIMG_LOAD("31I04.GIF");
setPlaceState(16, 1);
while (1) {
fimg->manage();
@@ -2035,7 +2038,7 @@ IMG_CB(43160d) {
}
IMG_CB(43190) {
- fimg->load("31L1_20.GIF");
+ FIMG_LOAD("31L1_20.GIF");
if (_gameVariables[GameVariables::kCollectScore]) {
fimg->disableZone(0);
}
@@ -2046,7 +2049,7 @@ IMG_CB(43190) {
break;
}
if (fimg->_zoneUse) {
- playInGameVideo("31L1_2A");
+ playInGameAnimVideo("31L1_2A");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -2061,7 +2064,7 @@ IMG_CB(43190) {
}
IMG_CB(43190b) {
- fimg->load("31L1_20B.GIF");
+ FIMG_LOAD("31L1_20B.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2069,7 +2072,7 @@ IMG_CB(43190b) {
break;
}
if (fimg->_zoneUse) {
- playInGameVideo("31L1_2B");
+ playInGameAnimVideo("31L1_2B");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -2084,7 +2087,7 @@ IMG_CB(43190b) {
}
IMG_CB(43190c) {
- fimg->load("31L1_20C.GIF");
+ FIMG_LOAD("31L1_20C.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2092,7 +2095,7 @@ IMG_CB(43190c) {
break;
}
if (fimg->_zoneUse) {
- playInGameVideo("31L1_2C");
+ playInGameAnimVideo("31L1_2C");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -2107,7 +2110,7 @@ IMG_CB(43190c) {
}
IMG_CB(43190d) {
- fimg->load("31L1_20D.GIF");
+ FIMG_LOAD("31L1_20D.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2115,7 +2118,7 @@ IMG_CB(43190d) {
break;
}
if (fimg->_zoneUse) {
- playInGameVideo("31L1_2D");
+ playInGameAnimVideo("31L1_2D");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -2130,7 +2133,7 @@ IMG_CB(43190d) {
}
IMG_CB(43190e) {
- fimg->load("31L1_20E.GIF");
+ FIMG_LOAD("31L1_20E.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2148,7 +2151,7 @@ IMG_CB(43190e) {
}
IMG_CB(43190f) {
- fimg->load("31L1_22.GIF");
+ FIMG_LOAD("31L1_22.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -2175,7 +2178,7 @@ IMG_CB(44071) {
}
// There we have a full plate
- fimg->load("41B_bboy.GIF");
+ FIMG_LOAD("41B_bboy.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2198,7 +2201,7 @@ IMG_CB(44071) {
IMG_CB(44071b) {
// There we have less food on plate
- fimg->load("41B_bbo2.GIF");
+ FIMG_LOAD("41B_bbo2.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2236,7 +2239,7 @@ IMG_CB(44161) {
}
// There we have blueprints, quill and epigraph on desk
- fimg->load("42X2_20.GIF");
+ FIMG_LOAD("42X2_20.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2266,7 +2269,7 @@ IMG_CB(44161) {
IMG_CB(44161b) {
// There we have blueprints and epigraph on desk.
- fimg->load("42X2_10.GIF");
+ FIMG_LOAD("42X2_10.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2301,7 +2304,7 @@ IMG_CB(44161b) {
IMG_CB(44161c) {
// There we have no quill nor epigraph anymore
- fimg->load("42X2_11.GIF");
+ FIMG_LOAD("42X2_11.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2321,7 +2324,7 @@ IMG_CB(44161c) {
IMG_CB(44161d) {
// Look at blueprints
- fimg->load("VAU1.GIF");
+ FIMG_LOAD("VAU1.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2341,7 +2344,7 @@ IMG_CB(44161d) {
IMG_CB(44161e) {
// Look at blueprints
- fimg->load("VAUB22.GIF");
+ FIMG_LOAD("VAUB22.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2367,7 +2370,7 @@ IMG_CB(44161e) {
IMG_CB(44161f) {
// Look at blueprints result
- fimg->load("VAU.GIF");
+ FIMG_LOAD("VAU.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2385,7 +2388,7 @@ bool CryOmni3DEngine_Versailles::handleEpigraph(ZonFixedImage *fimg) {
loadBMPs("bomb_%02d.bmp", bmpLetters, 28);
- fimg->load("EPIL.GIF");
+ FIMG_LOAD("EPIL.GIF");
const Graphics::Surface *fimgSurface = fimg->surface();
tempSurf.create(fimgSurface->w, fimgSurface->h, fimgSurface->format);
// No need to customize image yet
@@ -2460,7 +2463,7 @@ void CryOmni3DEngine_Versailles::drawEpigraphLetters(Graphics::ManagedSurface &s
}
IMG_CB(45130) {
- fimg->load("52M2.GIF");
+ FIMG_LOAD("52M2.GIF");
_dialogsMan["{JOUEUR-VU-PLANS-SALON-DIANE}"] = 'Y';
while (1) {
fimg->manage();
@@ -2472,7 +2475,7 @@ IMG_CB(45130) {
}
IMG_CB(45270) {
- fimg->load("51A4_11.GIF");
+ FIMG_LOAD("51A4_11.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2507,7 +2510,7 @@ IMG_CB(45270) {
}
IMG_CB(45270b) {
- fimg->load("51A4_22.GIF");
+ FIMG_LOAD("51A4_22.GIF");
if (!_gameVariables[GameVariables::kCollectSmallKey3]) {
// Collected small key 3
collectObject(135, fimg);
@@ -2531,7 +2534,7 @@ IMG_CB(45270b) {
}
IMG_CB(45270c) {
- fimg->load("51A4_32.GIF");
+ FIMG_LOAD("51A4_32.GIF");
if (!_gameVariables[GameVariables::kCollectEngraving]) {
// Collected engraving
collectObject(134, fimg);
@@ -2555,7 +2558,7 @@ IMG_CB(45270c) {
}
IMG_CB(45270d) {
- fimg->load("51A4_12.GIF");
+ FIMG_LOAD("51A4_12.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2575,7 +2578,7 @@ IMG_CB(45270d) {
IMG_CB(45280) {
if (_gameVariables[GameVariables::kOpenedCurtain]) {
- fimg->load("53I_LUST.GIF");
+ FIMG_LOAD("53I_LUST.GIF");
_gameVariables[GameVariables::kSeenMemorandum] = 1;
while (1) {
fimg->manage();
@@ -2599,7 +2602,7 @@ IMG_CB(88001) {
return;
}
- fimg->load("33P_10.GIF");
+ FIMG_LOAD("33P_10.GIF");
if (_inventory.inInventoryByNameID(121)) {
fimg->disableZone(0);
}
@@ -2613,7 +2616,7 @@ IMG_CB(88001) {
!_inventory.inInventoryByNameID(121)) {
// Open the drawer
- playInGameVideo("33P_10");
+ playInGameAnimVideo("33P_10");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -2631,7 +2634,7 @@ IMG_CB(88001) {
IMG_CB(88001b) {
_gameVariables[GameVariables::kMedalsDrawerStatus] = 2;
- fimg->load("33P_12.GIF");
+ FIMG_LOAD("33P_12.GIF");
while (1) {
fimg->manage();
if (fimg->_exit) {
@@ -2665,7 +2668,7 @@ IMG_CB(88001c) {
// Paper is laid on the medals
_gameVariables[GameVariables::kMedalsDrawerStatus] = 3;
- fimg->load("33P_13.GIF");
+ FIMG_LOAD("33P_13.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2678,7 +2681,7 @@ IMG_CB(88001c) {
// Use charcoal on paper and medals
_inventory.removeByNameID(113);
- playInGameVideo("33P_14");
+ playInGameAnimVideo("33P_14");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -2697,7 +2700,7 @@ IMG_CB(88001c) {
}
IMG_CB(88002) {
- fimg->load("53Z1c_10.GIF");
+ FIMG_LOAD("53Z1c_10.GIF");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -2746,7 +2749,7 @@ IMG_CB(88003) {
return;
}
- fimg->load("70Z_10.GIF");
+ FIMG_LOAD("70Z_10.GIF");
// Draw countdown there and not in fixed image class directly
Graphics::ManagedSurface tempSurf;
@@ -2789,7 +2792,7 @@ IMG_CB(88003) {
}
IMG_CB(88003b) {
- fimg->load("70Z_11.GIF");
+ FIMG_LOAD("70Z_11.GIF");
// Draw countdown there and not in fixed image class directly
Graphics::ManagedSurface tempSurf;
@@ -2824,7 +2827,7 @@ IMG_CB(88003b) {
}
IMG_CB(88003c) {
- fimg->load("70Z_12.GIF");
+ FIMG_LOAD("70Z_12.GIF");
// Draw countdown there and not in fixed image class directly
Graphics::ManagedSurface tempSurf;
@@ -2859,7 +2862,7 @@ IMG_CB(88003c) {
}
IMG_CB(88003d) {
- fimg->load("70Z_13.GIF");
+ FIMG_LOAD("70Z_13.GIF");
// Draw countdown there and not in fixed image class directly
Graphics::ManagedSurface tempSurf;
@@ -2894,7 +2897,7 @@ IMG_CB(88003d) {
}
IMG_CB(88003e) {
- fimg->load("70Z_14.GIF");
+ FIMG_LOAD("70Z_14.GIF");
// Draw countdown there and not in fixed image class directly
Graphics::ManagedSurface tempSurf;
@@ -2929,7 +2932,7 @@ IMG_CB(88003e) {
}
IMG_CB(88003f) {
- fimg->load("70Z_15.GIF");
+ FIMG_LOAD("70Z_15.GIF");
// Draw countdown there and not in fixed image class directly
Graphics::ManagedSurface tempSurf;
@@ -2947,7 +2950,7 @@ IMG_CB(88003f) {
}
if (fimg->_zoneUse) {
if (handleBomb(fimg)) {
- playInGameVideo("COFFRE");
+ playInGameAnimVideo("COFFRE");
_forcePaletteUpdate = true;
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
@@ -3004,9 +3007,9 @@ bool CryOmni3DEngine_Versailles::handleBomb(ZonFixedImage *fimg) {
}
if (bombPasswordLength <= kBombPasswordSmallLength) {
- fimg->load("70z_16.GIF");
+ FIMG_LOAD("70z_16.GIF");
} else {
- fimg->load("70z_17.GIF");
+ FIMG_LOAD("70z_17.GIF");
}
const Graphics::Surface *fimgSurface = fimg->surface();
tempSurf.create(fimgSurface->w, fimgSurface->h, fimgSurface->format);
@@ -3241,7 +3244,7 @@ void CryOmni3DEngine_Versailles::drawBombLetters(Graphics::ManagedSurface &surfa
}
IMG_CB(88004) {
- fimg->load("31j31.gif");
+ FIMG_LOAD("31j31.gif");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -3260,12 +3263,12 @@ IMG_CB(88004) {
IMG_CB(88004b) {
// Open the toilets
- playInGameVideo("31j32");
+ playInGameAnimVideo("31j32");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
}
- fimg->load("31j32.gif");
+ FIMG_LOAD("31j32.gif");
while (1) {
fimg->manage();
if (fimg->_exit || fimg->_zoneLow) {
@@ -3282,7 +3285,7 @@ IMG_CB(88004b) {
}
if (!shouldAbort()) {
// Close the toilets
- playInGameVideo("31j32b");
+ playInGameAnimVideo("31j32b");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
_nextPlaceId = _currentPlaceId;
@@ -3290,6 +3293,8 @@ IMG_CB(88004b) {
}
}
+#undef FIMG_LOAD
+#undef FIMG_LOADz
#undef IMG_CB
// Init place and filter event
@@ -3330,7 +3335,7 @@ FILTER_EVENT(1, 2) {
INIT_PLACE(1, 3) {
if (!_gameVariables[GameVariables::kHasPlayedLebrun]) {
Common::File *audioFile = new Common::File();
- if (!audioFile->open(_localizedFilenames[LocalizedFilenames::kLeb001])) {
+ if (!audioFile->open(getFilePath(kFileTypeSound, _localizedFilenames[LocalizedFilenames::kLeb001]))) {
warning("Failed to open sound file %s", _localizedFilenames[LocalizedFilenames::kLeb001].c_str());
delete audioFile;
return;
@@ -3387,7 +3392,7 @@ FILTER_EVENT(1, 14) {
// Open the curtain
uint fakePlaceId = getFakeTransition(*event);
fakeTransition(fakePlaceId);
- playInGameVideo("10D2_1");
+ playInGameAnimVideo("10D2_1");
setPlaceState(14, 1);
// setPlaceState will force reload
// Don't pass the event as we try to avoid implementing use
@@ -3430,7 +3435,7 @@ FILTER_EVENT(1, 14) {
uint fakePlaceId = getFakeTransition(*event);
fakeTransition(fakePlaceId);
- playInGameVideo(video);
+ playInGameAnimVideo(video);
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
@@ -3487,7 +3492,7 @@ FILTER_EVENT(2, 1) {
callback = &CryOmni3DEngine_Versailles::img_31101b;
}
- playInGameVideo(video);
+ playInGameAnimVideo(video);
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
@@ -3567,7 +3572,7 @@ FILTER_EVENT(2, 2) {
uint fakePlaceId = getFakeTransition(*event);
fakeTransition(fakePlaceId);
- playInGameVideo(video);
+ playInGameAnimVideo(video);
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
@@ -3796,11 +3801,11 @@ FILTER_EVENT(3, 10) {
} else if (*event == 21) {
if (_dialogsMan["SUISSE-VU-AUTORISATION"] == 'Y') {
fakeTransition(*event);
- playInGameVideo("33O_SUIP");
- playInGameVideo("33O_P");
+ playInGameAnimVideo("33O_SUIP");
+ playInGameAnimVideo("33O_P");
executeSeeAction(88001);
if (!shouldAbort()) {
- playInGameVideo("33P_O");
+ playInGameAnimVideo("33P_O");
}
_forcePaletteUpdate = true;
// Force reload of the place
@@ -3891,13 +3896,13 @@ FILTER_EVENT(3, 18) {
_transitionAnimateWarp = false;
if (_placeStates[22].state) {
- playInGameVideo("31J1_L2");
+ playInGameAnimVideo("31J1_L2");
} else if (_gameVariables[GameVariables::kAlreadyWent3_19]) {
- playInGameVideo("31J1_L1");
+ playInGameAnimVideo("31J1_L1");
} else {
- playInGameVideo("31J1_L0");
- playInGameVideo("31L1_AL2");
- playInGameVideo("31L1_AL3");
+ playInGameAnimVideo("31J1_L0");
+ playInGameAnimVideo("31L1_AL2");
+ playInGameAnimVideo("31L1_AL3");
_gameVariables[GameVariables::kAlreadyWent3_19] = 1;
_gameVariables[GameVariables::kCabinetDrawerStatus] = 1;
}
@@ -3934,7 +3939,7 @@ FILTER_EVENT(3_5, 20) {
}
fakeTransition(*event);
- playInGameVideo("31j31");
+ playInGameAnimVideo("31j31");
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
@@ -4132,7 +4137,7 @@ FILTER_EVENT(4, 12_13_14) {
error("BUG: Shouldn't be here");
}
- playInGameVideo(video);
+ playInGameAnimVideo(video);
// Force reload of the place
if (_nextPlaceId == uint(-1)) {
@@ -4177,7 +4182,7 @@ FILTER_EVENT(4, 16) {
if (idOBJ == 124) {
_inventory.removeByNameID(124);
- playInGameVideo("41X2_CR1");
+ playInGameAnimVideo("41X2_CR1");
setGameTime(2, 4);
}
_inventory.deselectObject();
@@ -4528,7 +4533,7 @@ FILTER_EVENT(5, 33) {
uint fakePlaceId = getFakeTransition(*event);
fakeTransition(fakePlaceId);
- playInGameVideo("LUSTRE");
+ playInGameAnimVideo("LUSTRE");
// setPlaceState will force reload
setPlaceState(33, 1);
@@ -4547,7 +4552,7 @@ FILTER_EVENT(5, 34) {
if (*event == 35) {
fakeTransition(*event);
- playInGameVideo("53z1c_10");
+ playInGameAnimVideo("53z1c_10");
executeSeeAction(88002);
@@ -4744,7 +4749,7 @@ FILTER_EVENT(7, 20) {
if (*event == 21) {
fakeTransition(*event);
- playInGameVideo("70z_10");
+ playInGameAnimVideo("70z_10");
executeSeeAction(88003);
diff --git a/engines/cryomni3d/versailles/menus.cpp b/engines/cryomni3d/versailles/menus.cpp
index 620e13ac37d..d79e40001f9 100644
--- a/engines/cryomni3d/versailles/menus.cpp
+++ b/engines/cryomni3d/versailles/menus.cpp
@@ -127,7 +127,7 @@ uint CryOmni3DEngine_Versailles::displayOptions() {
byte volumeForeColor = 243;
Graphics::ManagedSurface optionsSurface;
- Image::ImageDecoder *imageDecoder = loadHLZ("option.hlz");
+ Image::ImageDecoder *imageDecoder = loadHLZ(getFilePath(kFileTypeMenu, "option.hlz"));
const Graphics::Surface *bgFrame = imageDecoder->getSurface();
optionsSurface.create(bgFrame->w, bgFrame->h, bgFrame->format);
@@ -300,9 +300,10 @@ uint CryOmni3DEngine_Versailles::displayOptions() {
// Finished dragging
_mixer->stopID(SoundIds::kOrgue);
do {
+ Common::Path orguePath(getFilePath(kFileTypeSound, "ORGUE.WAV"));
Common::File *audioFile = new Common::File();
- if (!audioFile->open("ORGUE.WAV")) {
- warning("Failed to open sound file %s", "ORGUE.WAV");
+ if (!audioFile->open(orguePath)) {
+ warning("Failed to open sound file %s", orguePath.toString().c_str());
delete audioFile;
break;
}
@@ -1001,7 +1002,7 @@ void CryOmni3DEngine_Versailles::displayCredits() {
waitMouseRelease();
Graphics::ManagedSurface creditsSurface;
- Image::ImageDecoder *imageDecoder = loadHLZ("credits.hlz");
+ Image::ImageDecoder *imageDecoder = loadHLZ(getFilePath(kFileTypeMenu, "credits.hlz"));
if (!imageDecoder) {
return;
}
@@ -1025,8 +1026,9 @@ void CryOmni3DEngine_Versailles::displayCredits() {
_fontManager.setCharSpacing(1);
_fontManager.setSurface(&creditsSurface);
+ Common::Path creditsPath(getFilePath(kFileTypeText, _localizedFilenames[LocalizedFilenames::kCredits]));
Common::File creditsFile;
- if (!creditsFile.open(_localizedFilenames[LocalizedFilenames::kCredits])) {
+ if (!creditsFile.open(creditsPath)) {
warning("Failed to open credits file: %s",
_localizedFilenames[LocalizedFilenames::kCredits].c_str());
delete imageDecoder;
diff --git a/engines/cryomni3d/versailles/music.cpp b/engines/cryomni3d/versailles/music.cpp
index f6b4fb64ca5..a02dd878f1f 100644
--- a/engines/cryomni3d/versailles/music.cpp
+++ b/engines/cryomni3d/versailles/music.cpp
@@ -67,11 +67,11 @@ void CryOmni3DEngine_Versailles::musicUpdate() {
// New file, stop the old one first
musicStop();
- Common::String musicFName(prepareFileName(musicBName, "wav"));
+ Common::Path musicPath(getFilePath(kFileTypeMusic, musicBName));
Common::File *musicFile = new Common::File();
- if (!musicFile->open(musicFName)) {
- warning("Failed to open music file %s/%s", musicBName, musicFName.c_str());
+ if (!musicFile->open(musicPath)) {
+ warning("Failed to open music file %s/%s", musicBName, musicPath.toString().c_str());
delete musicFile;
return;
}
@@ -81,7 +81,7 @@ void CryOmni3DEngine_Versailles::musicUpdate() {
musicFile = nullptr;
if (!musicDecoder) {
- warning("Failed to decode music file %s/%s", musicBName, musicFName.c_str());
+ warning("Failed to decode music file %s/%s", musicBName, musicPath.toString().c_str());
return;
}
diff --git a/engines/cryomni3d/versailles/saveload.cpp b/engines/cryomni3d/versailles/saveload.cpp
index 246ad69d1de..b48d6037f45 100644
--- a/engines/cryomni3d/versailles/saveload.cpp
+++ b/engines/cryomni3d/versailles/saveload.cpp
@@ -49,7 +49,7 @@ Common::String CryOmni3DEngine_Versailles::getSaveStateName(int slot) const {
}
bool CryOmni3DEngine_Versailles::canVisit() const {
- return Common::File::exists("game0001.sav");
+ return Common::File::exists(getFilePath(kFileTypeSaveGameVisit, "game0001.sav"));
}
void CryOmni3DEngine_Versailles::getSavesList(bool visit, Common::StringArray &saveNames,
@@ -73,11 +73,9 @@ void CryOmni3DEngine_Versailles::getSavesList(bool visit, Common::StringArray &s
if (visit) {
// Add bootstrap visit
- if (Common::File::exists("game0001.sav")) {
- Common::File visitFile;
- if (!visitFile.open("game0001.sav")) {
- error("Can't load visit file");
- }
+ Common::Path visitPath(getFilePath(kFileTypeSaveGameVisit, "game0001.sav"));
+ Common::File visitFile;
+ if (visitFile.open(visitPath)) {
visitFile.read(saveName, kSaveDescriptionLen);
saveNames.push_back(saveName);
} else {
@@ -233,7 +231,7 @@ bool CryOmni3DEngine_Versailles::loadGame(bool visit, uint saveNum) {
if (visit && saveNum == 1) {
// Load bootstrap visit
Common::File *visitFile = new Common::File();
- if (!visitFile->open("game0001.sav")) {
+ if (!visitFile->open(getFilePath(kFileTypeSaveGameVisit, "game0001.sav"))) {
delete visitFile;
error("Can't load visit file");
}
Commit: 52999549333f3df90b6c867ead4df42b0c375208
https://github.com/scummvm/scummvm/commit/52999549333f3df90b6c867ead4df42b0c375208
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-04-02T17:05:27+02:00
Commit Message:
CRYOMNI3D: Fix directory globs
They are not globs anymore since 2564ce272a8f5c1c0510764af0a51bc64122c03c.
This fixes Versailles Mac detection.
Changed paths:
engines/cryomni3d/detection_tables.h
diff --git a/engines/cryomni3d/detection_tables.h b/engines/cryomni3d/detection_tables.h
index 5c1d3f74810..d7390130fb7 100644
--- a/engines/cryomni3d/detection_tables.h
+++ b/engines/cryomni3d/detection_tables.h
@@ -592,7 +592,9 @@ static const char *directoryGlobs[] = {
/* Mac Setup */
/* Versailles Folder/DATAV_HD/TEXTES/LIEN_DOC.TXT
* Versailles Folder/Versailles */
- "*Versailles*",
+ "Versailles Ordner",
+ "Versailles Folder",
+ "Dossier Versailles",
"DATAV_HD",
/* lien_doc.* */
"TEXTES",
More information about the Scummvm-git-logs
mailing list