1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-10-06 09:07:19 +02:00

Fix problem with case sensivity of sfx files name

This commit is contained in:
Filip Gawin 2018-08-15 00:35:22 +02:00
parent ed24fe71aa
commit 37a677802d
3 changed files with 8 additions and 7 deletions

View File

@ -6,9 +6,9 @@
#include "rw/debug.hpp"
bool LoaderSDT::load(const rwfs::path& path) {
const auto sdtName = path.string() + ".SDT";
const auto rawName = path.string() + ".RAW";
bool LoaderSDT::load(const rwfs::path& sdtPath, const rwfs::path& rawPath) {
const auto sdtName = sdtPath.string();
const auto rawName = rawPath.string();
FILE* fp = fopen(sdtName.c_str(), "rb");
if (fp) {
@ -29,7 +29,7 @@ bool LoaderSDT::load(const rwfs::path& path) {
m_archive = rawName;
return true;
} else {
RW_ERROR("Error cannot find " << path);
RW_ERROR("Error cannot open " << sdtName);
return false;
}
}

View File

@ -62,8 +62,7 @@ public:
~LoaderSDT() = default;
/// Load the structure of the archive
/// Omit the extension in filename
bool load(const rwfs::path& path);
bool load(const rwfs::path& sdtPath, const rwfs::path& rawPath);
/// Load a file from the archive to memory and pass a pointer to it
/// Warning: Returns nullptr if by any reason it can't load the file

View File

@ -29,7 +29,9 @@ Sound& SoundManager::getSoundRef(const std::string& name) {
}
SoundManager::SoundManager(GameWorld* engine) : _engine(engine) {
sdt.load(_engine->data->getDataPath() / "audio/sfx");
auto sdtPath = _engine->data->index.findFilePath("audio/sfx.SDT");
auto rawPath = _engine->data->index.findFilePath("audio/sfx.RAW");
sdt.load(sdtPath, rawPath);
initializeOpenAL();
initializeAVCodec();