Author Topic: Fixed PCK resources failing to load when lowercase  (Read 7619 times)

Offline sir_nacnud

  • Captain
  • ***
  • Posts: 54
    • View Profile
Fixed PCK resources failing to load when lowercase
« 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.


Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Fixed PCK resources failing to load when lowercase
« Reply #1 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.