OpenXcom Forum

Contributions => Programming => Topic started by: sir_nacnud on September 13, 2010, 06:05:51 am

Title: Fixed PCK resources failing to load when lowercase
Post by: sir_nacnud on September 13, 2010, 06:05:51 am
On Linux, basebits.pck and graphs.pck were failing to load due to the file extensions being lower case.

The problem was SurfaceSet::loadPck() was assuming uppercase file extensions.  I added a call to insensitive() before trying to open these files.  In order for this to work, I moved insensitive() out of ResourcePack and in to it's own file called Util.  Seems to me insensitive() is a utility function and doesn't really belong in ResourcePack.

Title: Re: Fixed PCK resources failing to load when lowercase
Post by: SupSuper on September 14, 2010, 06:40:19 pm
Thanks for pointing me to the issue.

I'm not a big fan of generic Util classes though so I fixed it slightly differently. Even if the function is kinda generic, it's only really used in the ResourcePack class, which is the only place where casing matters because it's where X-Com files are loaded, so it might as well stay there.