polymod icon indicating copy to clipboard operation
polymod copied to clipboard

Case-insensitive ZIP loading

Open NotHyper-474 opened this issue 8 months ago • 1 comments

This mod shows an interesting problem that is, the modder might not care enough for the letter case of the files, which may cause inconsistent behavior not only in case-sensitive platforms (like Linux) but also when trying to load their mod as a ZIP.

This PR aims to solve at least the ZIP part. I might look into the Linux issue later.

NotHyper-474 avatar Mar 06 '25 02:03 NotHyper-474

This code seems good but I wonder if the behavior could be made optional (via a compilation flag or similar) since some applications may expect case-sensitive asset loading. Or maybe we could do the opposite and ensure case-sensitive asset loading on Windows.

EliteMasterEric avatar Apr 08 '25 01:04 EliteMasterEric

Done. Now you need to set a POLYMOD_ZIP_INSENSITIVE define to enable it, (although maybe it should be enabled by default?) also it needs #208 to work properly.

Or maybe we could do the opposite and ensure case-sensitive asset loading on Windows.

Definitely would break a mod or two (I know for sure QT: Rewired would be among these as it has a couple of vocals that don't load on Linux). Personally I'm more inclined towards ensuring case-insensitive loading on Linux instead, but up to you.

NotHyper-474 avatar Apr 10 '25 01:04 NotHyper-474

No idea why but hxcpp is now imploding with this code image

Edit: Fixed it, turns out both the getter and the variable needed to have the same exact type...

NotHyper-474 avatar Jul 02 '25 20:07 NotHyper-474