18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 15:04:58 +01:00

fix(files): the banks keep the names asked for, only the opening takes the case of the disk

The textures, materials and sounds are kept by the names they're asked for.
Given back as named on the disk, a file in another case missed the bank and
was loaded again on every request.

- FileExists with names and extensions finds the file in any case but gives
  back the name asked for; FileOnDisk gives the file to open, used where
  textures, sounds and scripts are opened
- FileExists of a single name is a plain check again, the places checking
  it and opening the same name stay as they were
- the texture format is told by the extension asked for again
- a folder changed shortly before it was read is read again for a name
  missing from it, the time of a change being as coarse as the clock of the
  file system; a listing cut short isn't kept
This commit is contained in:
maj00r
2026-11-13 15:47:52 +01:00
parent d0a3694657
commit afbc84c6bc
6 changed files with 55 additions and 47 deletions

View File

@@ -35,7 +35,8 @@ decoded_sound decode_sound( std::string const &File ) {
SF_INFO si;
si.format = 0;
SNDFILE *sf = sf_open(File.c_str(), SFM_READ, &si);
// the file as it's named on the disk, the name of the buffer is in lowercase
SNDFILE *sf = sf_open(FileOnDisk(File).c_str(), SFM_READ, &si);
if (sf == nullptr)
throw std::runtime_error("sound: sf_open failed");