w23 / OpenSource

Load Source games maps as combined meshes correctly positioned relative to each other
Do What The F*ck You Want To Public License
154 stars 16 forks source link

Missing textures for Raising The Bar: Redux on Linux #82

Open w23 opened 12 months ago

w23 commented 12 months ago

https://www.moddb.com/mods/half-life-2-raising-the-bar-redux/downloads/raising-the-bar-redux-division-21-release

Some of the textures will be missing because of case mismatch between material names in BSP and on filesystem. E.g. BUILDING_TEMPLATE/BUILDING_TRAINSTATION_TRUSS_TEMPLATE001F_BETA vs materials/building_template/Building_Trainstation_Truss_Template001f_beta.vmt on disk.

FilesystemCollection needs to be able to open files by case insensitive names. However, it's not straightforward. Loading resources by name needs to be done as follows:

  1. Try to load with exact name through entire chain
  2. Try to load in "fallback" mode with case insensitive checks

Maybe add special something like dir_ncase config option for such dirs explicitly to simplify?

Finding files insensitively is dumb: opendir(), list all files, compare insensitively. Or make a tolower() hashmap, or whatever.