mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 08:04:57 +01:00
fix(files): data named in another case is found on Linux, folders included
The parser and the loaders lowercase every name they read, while the data made on Windows has files and folders named in any case (scenery/Braniewo, textures/siec_trakcyjna_ph/.../STS_*.tga, sounds/sip/Gorki.wav). FileCased matched the file name only, so a folder in another case wasn't found. - FileCased walks every part of the path on Linux, the folder listings kept by their lowercase and read again once the folder changed; Windows as it was - FileExists finds the file in any case on Linux, and the variant with names and extensions gives back the name as it's on the disk, so textures, materials, sounds, station announcements and scripts open that name - models, sound captions, timetables and nodebank previews open the file as it's named on the disk; the texture format is told by the extension in any case
This commit is contained in:
@@ -277,6 +277,15 @@ bool TTrainParameters::LoadTTfile(std::string const &scnpath, int iPlus, double
|
||||
// Ra 2014-09: ustalić zasady wyznaczenia pierwotnego pliku przy przesuniętych rozkładach
|
||||
// (kolejny pociąg dostaje numer +2)
|
||||
fin.open(s.c_str()); // otwieranie pliku
|
||||
if (false == fin.is_open())
|
||||
{
|
||||
// the name of the train comes in lowercase, the file can be named in another case
|
||||
if (auto const cased{FileCased(s)}; false == cased.empty())
|
||||
{
|
||||
fin.clear();
|
||||
fin.open(cased);
|
||||
}
|
||||
}
|
||||
replace_slashes(s);
|
||||
|
||||
if (!fin.is_open())
|
||||
|
||||
Reference in New Issue
Block a user