fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

EFF subdirectories

Open ln-zookeeper opened this issue 10 years ago • 10 comments

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.

ln-zookeeper avatar Nov 18 '15 16:11 ln-zookeeper

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.

ln-zookeeper avatar Nov 11 '16 11:11 ln-zookeeper

Also, unit tests that check if this is actually working correctly would be nice.

asarium avatar Nov 18 '16 16:11 asarium

Latest comments should again be addressed now. Except, of course, no unit tests since I have absolutely zero experience and knowledge about them.

ln-zookeeper avatar Nov 20 '16 01:11 ln-zookeeper

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.

asarium avatar Nov 20 '16 10:11 asarium

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.

asarium avatar Nov 20 '16 11:11 asarium

Files from VP's should work correctly now.

ln-zookeeper avatar Dec 02 '16 19:12 ln-zookeeper

Given that we have APNGs, should this PR be closed?

MageKing17 avatar Jan 14 '19 10:01 MageKing17

Given that we have APNGs, should this PR be closed?

I would say yes?

wookieejedi avatar Jun 21 '21 02:06 wookieejedi

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.

chief1983 avatar Jun 21 '21 16:06 chief1983

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.

wookieejedi avatar Jun 21 '21 16:06 wookieejedi

Closing now that #4771 is merged.

wookieejedi avatar Nov 15 '22 13:11 wookieejedi