dalerank / Akhenaten

An open source re-implementation of Pharaoh (1999) in the Julius/Augustus engine
GNU Affero General Public License v3.0
166 stars 11 forks source link

Fix sound access case sensitivity #150

Closed kamaradclimber closed 1 month ago

kamaradclimber commented 1 month ago

On case sensitive filesystems (on Linux at least), access to sound was broken for some assets.

This commit fixes all errors similar to:

Sound: cant find audio AUDIO/Wavs/DOCK1.wav that happen when opening the game

This is related to #144

dalerank commented 1 month ago

Thanks, I think it better to use sequence for foldersv(wavs, Wavs) when files can be found and WAV, wav, MP3, mp3 for extension because original files has different case Another way - when start first time on any system convert all files in those folder to lower case

dalerank commented 1 month ago

Yet another way create list of files from those folders and look for real path in stricmp mode before start game collect all files from Wavs, Sound etc when try open wavs/sound.wav -> looking in this list and return Wavs/SOUND.wav real path open file with real path it much better than hardcode path in configs @kamaradclimber can you create this work?

kamaradclimber commented 1 month ago

Thanks for your feedback. I agree it would be better to avoid hardcode paths. However, I assume the assets are not changing (and have not changed since the release of the game) so do we really need to make the code robust to case change?

dalerank commented 1 month ago

hm, it make sense. ok, aproved