This introduces a new mechanism for handling bit flags. Instead of using an int (or two, or three) to write bits into, this uses the std::bitset in a wrapper class that accepts an enum class as input. This means that certain classes of errors we've had a few of in the engine, where a coder used the wrong set of flags or checked them against the wrong variable (SF_STEALTH vs SIF_STEALTH, for example) can now be detected at a compiler level rather than not at all.
If a required argument is invalid, ade_get_args() returns 0, but it wasn't making sure va_end(vl) got called first, leading to potential memory corruption (probably not a huge issue in actual usage because most people try not to release scripts that throw errors).
This allows to use standard TrueType Fonts for text rendering in FSO. It uses the NanoVG library which provides the ability of drawing 2D shapes. This library is used for most 2D operations now and can also be used directly by using the PathRenderer class.
This expands the existing system which only worked on Windows to all
supported platforms.
If the MSVC debug runtime is not present then its behavior is emulated
by adding a header to each allocated memory block.
This seems preferable to storing an entire mc_info object on every weapon, when the vast majority of projectiles (by the very nature of the fact that they still exist) won't have collided with anything.
On the other hand, I'm not wild about allocating and freeing memory every time a weapon collides with a ship or debris. If anyone has a better solution, I'm all ears.
Main use case is headanis where only one is played at a time and
caching the frames merely increases memory use & fragmentation, leading
to malloc errors with heavy apng use
The APNG changes required some additional work. A cursor now owns the
bitmap handle that will be used for the cursor. This is required in
order to support variable FPS cursors.
Use unique_ptr for safer pointer management
Simplify frame delay calcs when looping
Ensure animated cursor times don't lose precision
Switch Error to an Assertion
Fix LUA documentation formatting
Handle total_time directly requested from bm_load_animation
Make generic_anims request total_time directly
Move png-vs-apng check to apng class
Remove redundancy in apng exception messages
Update comments
Fix silly issue preventing getFrame() from working
Remove infinite loop when calculating frame num
Convert more animations to use new frame calc function
Reorder precendence of static image vs animation loading
i.e. load animations 1st if requested, then load still images
if the animation failed to load or if animations weren't requested
i.e. apngs (pre)loaded into bmpman slots
handles apng variable frame delays
Includes new lua function (getFrames) to find the current frame for
apngs. Also uses new function to correctly display apngs for mission
loading animations, ship thrusters & engine glows.