wip sw renderer...bsp is borked, also lots of other things
This commit is contained in:
parent
415d424057
commit
71787869e0
58 changed files with 8151 additions and 1261 deletions
|
|
@ -9,6 +9,11 @@
|
|||
|
||||
#define VOICE_SCALE 0.15f
|
||||
|
||||
static inline f32 sanitize_audio(f32 x) {
|
||||
union { f32 f; u32 u; } conv = { .f = x };
|
||||
return ((conv.u & 0x7F800000) == 0x7F800000) ? 0.0f : x;
|
||||
}
|
||||
|
||||
typedef enum envelope_state {
|
||||
ENV_ATTACK = 0,
|
||||
ENV_DECAY,
|
||||
|
|
@ -716,8 +721,8 @@ void pxl8_sfx_mixer_process(pxl8_sfx_mixer* mixer) {
|
|||
left = fmaxf(-1.0f, fminf(1.0f, left));
|
||||
right = fmaxf(-1.0f, fminf(1.0f, right));
|
||||
|
||||
if (!isfinite(left)) left = 0.0f;
|
||||
if (!isfinite(right)) right = 0.0f;
|
||||
left = sanitize_audio(left);
|
||||
right = sanitize_audio(right);
|
||||
|
||||
mixer->output_buffer[i * 2] = left;
|
||||
mixer->output_buffer[i * 2 + 1] = right;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue