Introduces wrappers around memory allocation functions in `memory.h`
that should be used instead of the standard C ones.
These never return NULL and, with the exception of `mem_realloc()`,
zero-initialize the allocated memory like `calloc()` does.
All allocations made with the memory.h API must be deallocated with
`mem_free()`. Although standard `free()` will work on some platforms,
it's not portable (currently it won't work on Windows). Likewise,
`mem_free()` must not be used to free foreign allocations.
The standard C allocation functions are now diagnosed as deprecated.
They are, however, available with the `libc_` prefix in case interfacing
with foreign APIs is required. So far they are only used to implement
`memory.h`.
Perhaps the most important change is the introduction of the `ALLOC()`,
`ALLOC_ARRAY()`, and `ALLOC_FLEX()` macros. They take a type as a
parameter, and allocate enough memory with the correct alignment for
that type. That includes overaligned types as well. In most
circumstances you should prefer to use these macros. See the `memory.h`
header for some usage examples.
* lasers: new SDF-based renderer (WIP)
* lasers: tweak sdf_apply shader
* lasers: fix incorrect rendering at 'unlucky' resolutions
* lasers: optimize rendering of multiple lasers
Try to coalesce render passes as much as possible
* lasers: fix warning
* lasers: move rendering into a new file
* lasers: correct "time" coordinate mapping for texturing
* lasers: wrote a novel about laser rendering [skip ci]
* lasers: fux tpyo
* remove references to old laser shape shaders
* lasers: fix some rendering edge cases
`process_boss()` will no longer automatically start the next attack
after the current one ends. Instead, it will set the current attack to
NULL and signal the next attack's `initiated` event. The attack starts
when the event handler calls the `BEGIN_BOSS_ATTACK()` macro. This
allows the attack task to arbitrarily delay the attack phase activation.
Note that `BEGIN_BOSS_ATTACK()` still waits for the `started` event,
which is signaled after `BEGIN_BOSS_ATTACK()` plus an inherent attack
delay (ATTACK_START_DELAY etc.) For regular attacks that don't wish to
delay `BEGIN_BOSS_ATTACK()`, this change is effectively invisible.
Remove 45 degree uv rotation from the shader as it's not needed anymore.
Bring back the stretched perspective, because the background was
designed with it in mind, and looks wrong otherwise.
this means glm_mat_proj_perspective is no longer meant to be called by the stage code. The parameters are set to sensible defaults of the pbr stages.
I found that the old stages use STAGE3D_DEFAULT_ASPECT which is somehow stretched. I did not change the behavior but added a FIXME comment to lines that should at some point just be deleted to use the correct default aspect.
I did not fix the extra stage code to avoid conflicts.
* stage1: attempt to make Easy easier; misc tweaks
* stage1: buff health of boss nons
* stage1: use new enemy spawners
* stage1: Normal balance; some Easy tweaks
* stage1: tweak Hard version of Perfect Freeze
* stage1: simplify a common_charge
This replaces SDL_mixer with an internal streaming and mixing system,
relying only on basic SDL audio support. It's also a partial refactor of
the audio API, most notably BGM-related. The BGM metadata resource type
is gone, as well as the `.bgm` files. The metadata is now stored inside
the `.opus` files directly, using standard Opus tags.