mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-07 16:31:32 +00:00
Merge branch 'iku'
This commit is contained in:
commit
c4fa87cae1
3 changed files with 18 additions and 13 deletions
|
@ -14,13 +14,14 @@ if test "x$mingw" != xyes -a "x$enable_xmms" == xyes; then
|
||||||
fi
|
fi
|
||||||
AC_SUBST(CD_CFLAGS)
|
AC_SUBST(CD_CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
CDTYPE=""
|
||||||
CD_CFLAGS=""
|
CD_CFLAGS=""
|
||||||
|
CD_PLUGIN_TARGETS=""
|
||||||
if test "x$HAVE_VORBIS" = xyes; then
|
if test "x$HAVE_VORBIS" = xyes; then
|
||||||
CD_PLUGIN_TARGETS="cd_file.la"
|
CDTYPE=" OGG"
|
||||||
else
|
CD_PLUGIN_TARGETS="cd_file.la"
|
||||||
CD_PLUGIN_TARGETS=""
|
|
||||||
fi
|
fi
|
||||||
unset CDTYPE
|
|
||||||
|
|
||||||
AC_MSG_CHECKING(for CD audio support)
|
AC_MSG_CHECKING(for CD audio support)
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ QF_maGiC_VALUE
|
||||||
CDTYPE="$CDTYPE WIN32"
|
CDTYPE="$CDTYPE WIN32"
|
||||||
CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_win.la"
|
CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_win.la"
|
||||||
)
|
)
|
||||||
if test "$CDTYPE"; then
|
if test "x$CDTYPE" != "x"; then
|
||||||
AC_MSG_RESULT([$CDTYPE])
|
AC_MSG_RESULT([$CDTYPE])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
|
|
|
@ -95,7 +95,7 @@ VISIBLE int
|
||||||
CDAudio_Init (void)
|
CDAudio_Init (void)
|
||||||
{
|
{
|
||||||
PI_RegisterPlugins (cd_plugin_list);
|
PI_RegisterPlugins (cd_plugin_list);
|
||||||
cd_plugin = Cvar_Get ("cd_plugin", "file", CVAR_ROM, NULL,
|
cd_plugin = Cvar_Get ("cd_plugin", "sdl", CVAR_ROM, NULL,
|
||||||
"CD Plugin to use");
|
"CD Plugin to use");
|
||||||
|
|
||||||
if (COM_CheckParm ("-nocdaudio"))
|
if (COM_CheckParm ("-nocdaudio"))
|
||||||
|
|
|
@ -75,14 +75,16 @@ static snd_output_funcs_t *snd_output_funcs;
|
||||||
static void
|
static void
|
||||||
s_xfer_paint_buffer (int endtime)
|
s_xfer_paint_buffer (int endtime)
|
||||||
{
|
{
|
||||||
int count, out_idx, out_mask, step, val;
|
int count, out_idx, out_max, step, val;
|
||||||
float snd_vol;
|
float snd_vol;
|
||||||
float *p;
|
float *p;
|
||||||
|
|
||||||
p = (float *) snd_paintbuffer;
|
p = (float *) snd_paintbuffer;
|
||||||
count = (endtime - snd_paintedtime) * snd_shm->channels;
|
count = (endtime - snd_paintedtime) * snd_shm->channels;
|
||||||
out_mask = (snd_shm->frames * snd_shm->channels) - 1;
|
out_max = (snd_shm->frames * snd_shm->channels) - 1;
|
||||||
out_idx = (snd_paintedtime * snd_shm->channels) & out_mask;
|
out_idx = snd_paintedtime * snd_shm->channels;
|
||||||
|
while (out_idx > out_max)
|
||||||
|
out_idx -= out_max + 1;
|
||||||
step = 3 - snd_shm->channels;
|
step = 3 - snd_shm->channels;
|
||||||
snd_vol = snd_volume->value;
|
snd_vol = snd_volume->value;
|
||||||
|
|
||||||
|
@ -96,8 +98,9 @@ s_xfer_paint_buffer (int endtime)
|
||||||
val = 0x7fff;
|
val = 0x7fff;
|
||||||
else if (val < -0x8000)
|
else if (val < -0x8000)
|
||||||
val = -0x8000;
|
val = -0x8000;
|
||||||
out[out_idx] = val;
|
out[out_idx++] = val;
|
||||||
out_idx = (out_idx + 1) & out_mask;
|
if (out_idx > out_max)
|
||||||
|
out_idx = 0;
|
||||||
}
|
}
|
||||||
} else if (snd_shm->samplebits == 8) {
|
} else if (snd_shm->samplebits == 8) {
|
||||||
unsigned char *out = (unsigned char *) snd_shm->buffer;
|
unsigned char *out = (unsigned char *) snd_shm->buffer;
|
||||||
|
@ -109,8 +112,9 @@ s_xfer_paint_buffer (int endtime)
|
||||||
val = 0x7f;
|
val = 0x7f;
|
||||||
else if (val < -0x80)
|
else if (val < -0x80)
|
||||||
val = -0x80;
|
val = -0x80;
|
||||||
out[out_idx] = val + 0x80;
|
out[out_idx++] = val + 0x80;
|
||||||
out_idx = (out_idx + 1) & out_mask;
|
if (out_idx > out_max)
|
||||||
|
out_idx = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue