Merge commit '852f2a6343518919e5ca8d3c1bbcab9f493e3cd8'

This commit is contained in:
2024-01-17 17:02:59 +01:00
1244 changed files with 50102 additions and 28146 deletions

View File

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
/* This provides the default mixing callback for the SDL audio routines */
// This provides the default mixing callback for the SDL audio routines
#include "SDL_sysaudio.h"
@ -77,12 +77,12 @@ static const Uint8 mix8[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
/* The volume ranges from 0 - 128 */
// The volume ranges from 0 - 128
#define ADJUST_VOLUME(type, s, v) ((s) = (type)(((s) * (v)) / SDL_MIX_MAXVOLUME))
#define ADJUST_VOLUME_U8(s, v) ((s) = (Uint8)(((((s) - 128) * (v)) / SDL_MIX_MAXVOLUME) + 128))
/* !!! FIXME: this needs some SIMD magic. */
// !!! FIXME: this needs some SIMD magic.
int SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
Uint32 len, int volume)
@ -237,7 +237,7 @@ int SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
float *dst32 = (float *)dst;
float src1, src2;
double dst_sample;
/* !!! FIXME: are these right? */
// !!! FIXME: are these right?
const double max_audioval = 3.402823466e+38F;
const double min_audioval = -3.402823466e+38F;
@ -265,7 +265,7 @@ int SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
float *dst32 = (float *)dst;
float src1, src2;
double dst_sample;
/* !!! FIXME: are these right? */
// !!! FIXME: are these right?
const double max_audioval = 3.402823466e+38F;
const double min_audioval = -3.402823466e+38F;
@ -285,7 +285,7 @@ int SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
}
} break;
default: /* If this happens... FIXME! */
default: // If this happens... FIXME!
return SDL_SetError("SDL_MixAudioFormat(): unknown audio format");
}