EFF subdirectories
This allows animation frames of eff animations to be located in a subdirectory. This is useful for de-cluttering the effects directory in particular.
Usage and limitations as per http://www.hard-light.net/forums/index.php?topic=88139.0
Before merging, this needs testing in different mod environments: VP's, multiple mods, replacing anims from retail or other mods, and so on. I've pretty much only tested this in a development setting, as in a single mod as a bare directory, no VP's.
Notes:
I'm not sure about the original rationale behind the changes to the bm_unlock()/bm_unload() calls in bmpman.cpp; I'm sure they were intended as bugfixes, but I don't recall the specifics. I included them now because they've been like this in FotG for a long time without problems, but I'll have to split those into a separate commit or remove entirely before merging.
The above feedback is now addressed as best I could. I ended up keeping the default value as an empty string literal instead of NULL because the latter would have then required adding a whole lot of NULL checks all over the place and that would have gotten messy and probably more bug-prone too.
In the past year the added APNG support may have rendered this maybe not quite as vital as before, but I think it's still a worthwhile feature since it can be used with any image format and allows existing animations to be compartmentalized more easily than converting them to APNG.
Also, unit tests that check if this is actually working correctly would be nice.
Latest comments should again be addressed now. Except, of course, no unit tests since I have absolutely zero experience and knowledge about them.
I can write the unit tests, it should be relatively easy to do.
Have you tested this with VPs? I know that the cfile code does some indexing when loading a VP but I don't know if that includes all subdirectories or only the ones that are in the pathtypes.
I have added unit tests for testing the function: https://github.com/ln-zookeeper/fs2open.github.com/pull/3
However, I discovered that the function does not support VP files properly. The reason for this is that cf_find_file_location returns the path to the VP file if the requested file has been found in it which screws up where the subdirectory lookup searches for the other files.
Files from VP's should work correctly now.
Given that we have APNGs, should this PR be closed?
Given that we have APNGs, should this PR be closed?
I would say yes?
Are there not still performance advantages to using EFFs of DDS files vs APNGs? As long as there are reasons to still use EFFs going forward, and therefore a use for this feature, it would still be nice to see merged at some point, I would think.
Are there not still performance advantages to using EFFs of DDS files vs APNGs? As long as there are reasons to still use EFFs going forward, and therefore a use for this feature, it would still be nice to see merged at some point, I would think.
Ah that's a good point, especially since DDS images can be mipmapped and loaded faster.
Closing now that #4771 is merged.