mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 16:51:08 +00:00
the majority of raptor's sgi build patch. I'll look at the last two bits
(server.c and vid_sdl.c) later.
This commit is contained in:
parent
119731e90e
commit
26d7463be7
16 changed files with 152 additions and 103 deletions
|
@ -133,7 +133,7 @@ AC_HEADER_STDC
|
||||||
AC_HEADER_MAJOR
|
AC_HEADER_MAJOR
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_CHECK_HEADERS(
|
AC_CHECK_HEADERS(
|
||||||
alsa/asoundlib.h \
|
alloca.h alsa/asoundlib.h \
|
||||||
arpa/inet.h asm/io.h assert.h conio.h ctype.h ddraw.h dinput.h \
|
arpa/inet.h asm/io.h assert.h conio.h ctype.h ddraw.h dinput.h \
|
||||||
direct.h dirent.h dlfcn.h dmedia/audio.h dmedia/cdaudio.h dpmi.h \
|
direct.h dirent.h dlfcn.h dmedia/audio.h dmedia/cdaudio.h dpmi.h \
|
||||||
dsound.h errno.h execinfo.h fcntl.h io.h libc.h limits.h linux/cdrom.h \
|
dsound.h errno.h execinfo.h fcntl.h io.h libc.h limits.h linux/cdrom.h \
|
||||||
|
|
|
@ -56,12 +56,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These may be underscored... */
|
/* These may be underscored... */
|
||||||
#if defined(HAVE__SNPRINTF)
|
#if defined(HAVE__SNPRINTF) && !defined(HAVE_SNPRINTF)
|
||||||
# undef snprintf
|
# undef snprintf
|
||||||
# define snprintf Q_snprintfz
|
# define snprintf Q_snprintfz
|
||||||
# define need_qstring_h
|
# define need_qstring_h
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE__VSNPRINTF)
|
#if defined(HAVE__VSNPRINTF) && !defined(HAVE_VSNPRINTF)
|
||||||
# undef vsnprintf
|
# undef vsnprintf
|
||||||
# define vsnprintf Q_vsnprintfz
|
# define vsnprintf Q_vsnprintfz
|
||||||
# define need_qstring_h
|
# define need_qstring_h
|
||||||
|
|
|
@ -33,14 +33,26 @@ static const char rcsid[] =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <dmedia/cdaudio.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <dmedia/cdaudio.h>
|
||||||
|
|
||||||
|
|
||||||
#include "QF/cdaudio.h"
|
#include "QF/cdaudio.h"
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
#include "QF/sound.h"
|
#include "QF/sound.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
|
#include "QF/plugin.h"
|
||||||
|
#include "compat.h"
|
||||||
|
#include "QF/cvar.h"
|
||||||
|
|
||||||
|
static plugin_t plugin_info;
|
||||||
|
static plugin_data_t plugin_info_data;
|
||||||
|
static plugin_funcs_t plugin_info_funcs;
|
||||||
|
static general_data_t plugin_info_general_data;
|
||||||
|
static general_funcs_t plugin_info_general_funcs;
|
||||||
|
|
||||||
|
static cd_funcs_t plugin_info_cd_funcs;
|
||||||
|
|
||||||
static qboolean initialized = false;
|
static qboolean initialized = false;
|
||||||
static qboolean enabled = true;
|
static qboolean enabled = true;
|
||||||
|
@ -53,19 +65,20 @@ static char cd_dev[64] = "/dev/cdrom";
|
||||||
|
|
||||||
static CDPLAYER *cdp = NULL;
|
static CDPLAYER *cdp = NULL;
|
||||||
|
|
||||||
|
void I_SGI_Stop (void);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pCDAudio_Eject (void)
|
I_SGI_Eject (void)
|
||||||
{
|
{
|
||||||
if (cdp == NULL || !enabled)
|
if (cdp == NULL || !enabled)
|
||||||
return; // no cd init'd
|
return; // no cd init'd
|
||||||
|
|
||||||
if (CDeject (cdp) == 0)
|
if (CDeject (cdp) == 0)
|
||||||
Sys_DPrintf ("CDAudio_Eject: CDeject failed\n");
|
Sys_DPrintf ("I_SGI_Eject: CDeject failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pCDAudio_GetState (void)
|
I_SGI_GetState (void)
|
||||||
{
|
{
|
||||||
CDSTATUS cds;
|
CDSTATUS cds;
|
||||||
|
|
||||||
|
@ -81,7 +94,7 @@ pCDAudio_GetState (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pCDAudio_MaxTrack (void)
|
I_SGI_MaxTrack (void)
|
||||||
{
|
{
|
||||||
CDSTATUS cds;
|
CDSTATUS cds;
|
||||||
|
|
||||||
|
@ -89,7 +102,7 @@ pCDAudio_MaxTrack (void)
|
||||||
return -1; // no cd init'd
|
return -1; // no cd init'd
|
||||||
|
|
||||||
if (CDgetstatus (cdp, &cds) == 0) {
|
if (CDgetstatus (cdp, &cds) == 0) {
|
||||||
Sys_DPrintf ("CDAudio_MaxTrack: CDgetstatus failed\n");
|
Sys_DPrintf ("I_SGI_MaxTrack: CDgetstatus failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,9 +110,9 @@ pCDAudio_MaxTrack (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pCDAudio_Pause (void)
|
I_SGI_Pause (void)
|
||||||
{
|
{
|
||||||
if (cdp == NULL || !enabled || CDAudio_GetState () != CD_PLAYING)
|
if (cdp == NULL || !enabled || I_SGI_GetState () != CD_PLAYING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CDtogglepause (cdp) == 0)
|
if (CDtogglepause (cdp) == 0)
|
||||||
|
@ -107,15 +120,15 @@ pCDAudio_Pause (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pCDAudio_Play (int track, qboolean looping)
|
I_SGI_Play (int track, qboolean looping)
|
||||||
{
|
{
|
||||||
int maxtrack = CDAudio_MaxTrack ();
|
int maxtrack = I_SGI_MaxTrack ();
|
||||||
|
|
||||||
if (!initialized || !enabled)
|
if (!initialized || !enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* cd == audio cd? */
|
/* cd == audio cd? */
|
||||||
if (CDAudio_GetState () != CD_READY) {
|
if (I_SGI_GetState () != CD_READY) {
|
||||||
Sys_Printf ("CDAudio_Play: CD in player not an audio CD.\n");
|
Sys_Printf ("CDAudio_Play: CD in player not an audio CD.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -133,7 +146,7 @@ pCDAudio_Play (int track, qboolean looping)
|
||||||
track = remap[track];
|
track = remap[track];
|
||||||
|
|
||||||
if (track < 1 || track > maxtrack) {
|
if (track < 1 || track > maxtrack) {
|
||||||
CDAudio_Stop ();
|
I_SGI_Stop ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// don't try to play a non-audio track
|
// don't try to play a non-audio track
|
||||||
|
@ -152,11 +165,11 @@ pCDAudio_Play (int track, qboolean looping)
|
||||||
not audio\n", track); return; }
|
not audio\n", track); return; }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (CDAudio_GetState () == CD_PLAYING) {
|
if (I_SGI_GetState () == CD_PLAYING) {
|
||||||
if (playTrack == track)
|
if (playTrack == track)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CDAudio_Stop ();
|
I_SGI_Stop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CDplaytrack (cdp, track, cdvolume == 0.0 ? 0 : 1) == 0) {
|
if (CDplaytrack (cdp, track, cdvolume == 0.0 ? 0 : 1) == 0) {
|
||||||
|
@ -169,9 +182,9 @@ pCDAudio_Play (int track, qboolean looping)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pCDAudio_Resume (void)
|
I_SGI_Resume (void)
|
||||||
{
|
{
|
||||||
if (cdp == NULL || !enabled || CDAudio_GetState () != CD_PAUSED)
|
if (cdp == NULL || !enabled || I_SGI_GetState () != CD_PAUSED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CDtogglepause (cdp) == 0)
|
if (CDtogglepause (cdp) == 0)
|
||||||
|
@ -179,29 +192,29 @@ pCDAudio_Resume (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pCDAudio_Shutdown (void)
|
I_SGI_Shutdown (void)
|
||||||
{
|
{
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CDAudio_Stop ();
|
I_SGI_Stop ();
|
||||||
CDclose (cdp);
|
CDclose (cdp);
|
||||||
cdp = NULL;
|
cdp = NULL;
|
||||||
initialized = false;
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pCDAudio_Stop (void)
|
I_SGI_Stop (void)
|
||||||
{
|
{
|
||||||
if (cdp == NULL || !enabled || CDAudio_GetState () != CD_PLAYING)
|
if (cdp == NULL || !enabled || I_SGI_GetState () != CD_PLAYING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CDstop (cdp) == 0)
|
if (CDstop (cdp) == 0)
|
||||||
Sys_DPrintf ("CDAudio_Stop: CDStop failed (%d)\n", errno);
|
Sys_DPrintf ("I_SGI_Stop: CDStop failed (%d)\n", errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pCDAudio_Update (void)
|
I_SGI_Update (void)
|
||||||
{
|
{
|
||||||
if (!initialized || !enabled)
|
if (!initialized || !enabled)
|
||||||
return;
|
return;
|
||||||
|
@ -218,15 +231,15 @@ pCDAudio_Update (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CDAudio_GetState () != CD_PLAYING &&
|
if (I_SGI_GetState () != CD_PLAYING &&
|
||||||
CDAudio_GetState () != CD_PAUSED && playLooping)
|
I_SGI_GetState () != CD_PAUSED && playLooping)
|
||||||
CDAudio_Play (playTrack, true);
|
CDAudio_Play (playTrack, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pCD_f (void)
|
I_SGI_f (void)
|
||||||
{
|
{
|
||||||
char *command;
|
const char *command;
|
||||||
int ret;
|
int ret;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
@ -241,14 +254,14 @@ pCD_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strequal (command, "off")) {
|
if (strequal (command, "off")) {
|
||||||
CDAudio_Stop ();
|
I_SGI_Stop ();
|
||||||
enabled = false;
|
enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strequal (command, "reset")) {
|
if (strequal (command, "reset")) {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
CDAudio_Stop ();
|
I_SGI_Stop ();
|
||||||
|
|
||||||
for (n = 0; n < 100; n++)
|
for (n = 0; n < 100; n++)
|
||||||
remap[n] = n;
|
remap[n] = n;
|
||||||
|
@ -283,7 +296,7 @@ pCD_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strequal (command, "stop")) {
|
if (strequal (command, "stop")) {
|
||||||
CDAudio_Stop ();
|
I_SGI_Stop ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,17 +311,17 @@ pCD_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strequal (command, "eject")) {
|
if (strequal (command, "eject")) {
|
||||||
CDAudio_Stop ();
|
I_SGI_Stop ();
|
||||||
CDAudio_Eject ();
|
I_SGI_Eject ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strequal (command, "info")) {
|
if (strequal (command, "info")) {
|
||||||
Sys_Printf ("%u tracks\n", CDAudio_MaxTrack ());
|
Sys_Printf ("%u tracks\n", I_SGI_MaxTrack ());
|
||||||
if (CDAudio_GetState () == CD_PLAYING)
|
if (I_SGI_GetState () == CD_PLAYING)
|
||||||
Sys_Printf ("Currently %s track %u\n",
|
Sys_Printf ("Currently %s track %u\n",
|
||||||
playLooping ? "looping" : "playing", playTrack);
|
playLooping ? "looping" : "playing", playTrack);
|
||||||
else if (CDAudio_GetState () == CD_PAUSED)
|
else if (I_SGI_GetState () == CD_PAUSED)
|
||||||
Sys_Printf ("Paused %s track %u\n",
|
Sys_Printf ("Paused %s track %u\n",
|
||||||
playLooping ? "looping" : "playing", playTrack);
|
playLooping ? "looping" : "playing", playTrack);
|
||||||
|
|
||||||
|
@ -317,13 +330,13 @@ pCD_f (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static void
|
||||||
pCDAudio_Init (void)
|
I_SGI_Init (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (COM_CheckParm ("-nocdaudio"))
|
if (COM_CheckParm ("-nocdaudio"))
|
||||||
return -1;
|
return ;
|
||||||
|
|
||||||
if ((i = COM_CheckParm ("-cddev")) != 0 && i < com_argc - 1) {
|
if ((i = COM_CheckParm ("-cddev")) != 0 && i < com_argc - 1) {
|
||||||
strncpy (cd_dev, com_argv[i + 1], sizeof (cd_dev));
|
strncpy (cd_dev, com_argv[i + 1], sizeof (cd_dev));
|
||||||
|
@ -335,7 +348,7 @@ pCDAudio_Init (void)
|
||||||
if (cdp == NULL) {
|
if (cdp == NULL) {
|
||||||
Sys_Printf ("CDAudio_Init: open of \"%s\" failed (%i)\n",
|
Sys_Printf ("CDAudio_Init: open of \"%s\" failed (%i)\n",
|
||||||
cd_dev, errno);
|
cd_dev, errno);
|
||||||
return -1;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 100; i++)
|
for (i = 0; i < 100; i++)
|
||||||
|
@ -346,5 +359,37 @@ pCDAudio_Init (void)
|
||||||
|
|
||||||
Sys_Printf ("CD Audio Initialized\n");
|
Sys_Printf ("CD Audio Initialized\n");
|
||||||
|
|
||||||
return 0;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QFPLUGIN plugin_t *
|
||||||
|
cd_sgi_PluginInfo (void)
|
||||||
|
{
|
||||||
|
plugin_info.type = qfp_cd;
|
||||||
|
plugin_info.api_version = QFPLUGIN_VERSION;
|
||||||
|
plugin_info.plugin_version = "0.1";
|
||||||
|
plugin_info.description = "SGI (CD) Audio output"
|
||||||
|
"Copyright (C) 2001 contributors of the QuakeForge project\n"
|
||||||
|
"Please see the file \"AUTHORS\" for a list of contributors\n";
|
||||||
|
plugin_info.functions = &plugin_info_funcs;
|
||||||
|
plugin_info.data = &plugin_info_data;
|
||||||
|
|
||||||
|
plugin_info_data.general = &plugin_info_general_data;
|
||||||
|
// plugin_info_data.cd = &plugin_info_cd_data;
|
||||||
|
plugin_info_data.input = NULL;
|
||||||
|
|
||||||
|
plugin_info_funcs.general = &plugin_info_general_funcs;
|
||||||
|
plugin_info_funcs.cd = &plugin_info_cd_funcs;
|
||||||
|
plugin_info_funcs.input = NULL;
|
||||||
|
plugin_info_general_funcs.p_Init = I_SGI_Init;
|
||||||
|
plugin_info_general_funcs.p_Shutdown = I_SGI_Shutdown;
|
||||||
|
|
||||||
|
plugin_info_cd_funcs.pCDAudio_Pause = I_SGI_Pause;
|
||||||
|
plugin_info_cd_funcs.pCDAudio_Play = I_SGI_Play;
|
||||||
|
plugin_info_cd_funcs.pCDAudio_Resume = I_SGI_Resume;
|
||||||
|
plugin_info_cd_funcs.pCDAudio_Update = I_SGI_Update;
|
||||||
|
plugin_info_cd_funcs.pCD_f = I_SGI_f;
|
||||||
|
|
||||||
|
return &plugin_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,9 @@ static const char rcsid[] =
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <sys/types.h>
|
||||||
#include <dmedia/audio.h>
|
#include <dmedia/audio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "QF/plugin.h"
|
#include "QF/plugin.h"
|
||||||
#include "QF/qargs.h"
|
#include "QF/qargs.h"
|
||||||
|
@ -57,8 +59,8 @@ static plugin_data_t plugin_info_data;
|
||||||
static plugin_funcs_t plugin_info_funcs;
|
static plugin_funcs_t plugin_info_funcs;
|
||||||
static general_data_t plugin_info_general_data;
|
static general_data_t plugin_info_general_data;
|
||||||
static general_funcs_t plugin_info_general_funcs;
|
static general_funcs_t plugin_info_general_funcs;
|
||||||
static sound_data_t plugin_info_sound_data;
|
static snd_output_data_t plugin_info_snd_output_data;
|
||||||
static sound_funcs_t plugin_info_sound_funcs;
|
static snd_output_funcs_t plugin_info_snd_output_funcs;
|
||||||
|
|
||||||
|
|
||||||
static qboolean
|
static qboolean
|
||||||
|
@ -257,6 +259,11 @@ SNDDMA_Init (void)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
SNDDMA_Init_Cvars (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SNDDMA_GetDMAPos (void)
|
SNDDMA_GetDMAPos (void)
|
||||||
{
|
{
|
||||||
|
@ -333,46 +340,36 @@ SNDDMA_UnblockSound (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
QFPLUGIN plugin_t *
|
QFPLUGIN plugin_t *
|
||||||
snd_output_sgi_PluginInfo (void) {
|
snd_output_sgi_PluginInfo (void)
|
||||||
plugin_info.type = qfp_sound;
|
{
|
||||||
|
plugin_info.type = qfp_snd_output;
|
||||||
plugin_info.api_version = QFPLUGIN_VERSION;
|
plugin_info.api_version = QFPLUGIN_VERSION;
|
||||||
plugin_info.plugin_version = "0.1";
|
plugin_info.plugin_version = "0.1";
|
||||||
plugin_info.description = "SGI digital output";
|
plugin_info.description = "SGI IRIX digital output";
|
||||||
plugin_info.copyright = "Copyright (C) 1996-1997 id Software, Inc.\n"
|
plugin_info.copyright = "Copyright (C) 1996-1997 id Software, Inc.\n"
|
||||||
"Copyright (C) 1999,2000,2001 contributors of the QuakeForge "
|
"Copyright (C) 1999,2000,2001 contributors of the QuakeForge "
|
||||||
"project\n"
|
"project\n"
|
||||||
"Please see the file \"AUTHORS\" for a list of contributors";
|
"Please see the file \"AUTHORS\" for a list of contributors";
|
||||||
plugin_info.functions = &plugin_info_funcs;
|
plugin_info.functions = &plugin_info_funcs;
|
||||||
plugin_info.data = &plugin_info_data;
|
plugin_info.data = &plugin_info_data;
|
||||||
|
|
||||||
plugin_info_data.general = &plugin_info_general_data;
|
plugin_info_data.general = &plugin_info_general_data;
|
||||||
plugin_info_data.input = NULL;
|
plugin_info_data.input = NULL;
|
||||||
plugin_info_data.sound = &plugin_info_sound_data;
|
plugin_info_data.snd_output = &plugin_info_snd_output_data;
|
||||||
|
|
||||||
plugin_info_funcs.general = &plugin_info_general_funcs;
|
plugin_info_funcs.general = &plugin_info_general_funcs;
|
||||||
plugin_info_funcs.input = NULL;
|
plugin_info_funcs.input = NULL;
|
||||||
plugin_info_funcs.sound = &plugin_info_sound_funcs;
|
plugin_info_funcs.snd_output = &plugin_info_snd_output_funcs;
|
||||||
|
|
||||||
plugin_info_general_funcs.p_Init = SND_Init;
|
plugin_info_general_funcs.p_Init = SNDDMA_Init_Cvars;
|
||||||
plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
|
plugin_info_general_funcs.p_Shutdown = NULL;
|
||||||
|
plugin_info_snd_output_funcs.pS_O_Init = SNDDMA_Init;
|
||||||
|
plugin_info_snd_output_funcs.pS_O_Shutdown = SNDDMA_Shutdown;
|
||||||
|
plugin_info_snd_output_funcs.pS_O_GetDMAPos = SNDDMA_GetDMAPos;
|
||||||
|
plugin_info_snd_output_funcs.pS_O_Submit = SNDDMA_Submit;
|
||||||
|
plugin_info_snd_output_funcs.pS_O_BlockSound = SNDDMA_BlockSound;
|
||||||
|
plugin_info_snd_output_funcs.pS_O_UnblockSound = SNDDMA_UnblockSound;
|
||||||
|
|
||||||
plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
|
return &plugin_info;
|
||||||
plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
|
|
||||||
plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
|
|
||||||
plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
|
|
||||||
plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
|
|
||||||
plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
|
|
||||||
plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
|
|
||||||
plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
|
|
||||||
plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
|
|
||||||
plugin_info_sound_funcs.pS_Update = SND_Update;
|
|
||||||
plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
|
|
||||||
plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
|
|
||||||
plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
|
|
||||||
plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
|
|
||||||
plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
|
|
||||||
plugin_info_sound_funcs.pS_BlockSound = SND_BlockSound;
|
|
||||||
plugin_info_sound_funcs.pS_UnblockSound = SND_UnblockSound;
|
|
||||||
|
|
||||||
return &plugin_info;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ GIB_Interpret_Inst (const char *inst)
|
||||||
buffer = malloc (strlen (inst) + 1);
|
buffer = malloc (strlen (inst) + 1);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
while (isspace (inst[i]))
|
while (isspace ((unsigned char) inst[i]))
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
for (n = 0; i <= strlen (inst); i++) {
|
for (n = 0; i <= strlen (inst); i++) {
|
||||||
|
@ -158,7 +158,7 @@ GIB_Interpret_Inst (const char *inst)
|
||||||
strncpy (gib_argv[0], buffer3, i);
|
strncpy (gib_argv[0], buffer3, i);
|
||||||
gib_argv[0][i] = 0;
|
gib_argv[0][i] = 0;
|
||||||
for (n = 0;; n++) {
|
for (n = 0;; n++) {
|
||||||
for (; isspace (buffer3[i]); i++);
|
for (; isspace ((int) buffer3[i]); i++);
|
||||||
if (buffer3[i] == 0)
|
if (buffer3[i] == 0)
|
||||||
break;
|
break;
|
||||||
if ((len = GIB_Get_Arg (buffer3 + i)) < 0)
|
if ((len = GIB_Get_Arg (buffer3 + i)) < 0)
|
||||||
|
|
|
@ -58,7 +58,7 @@ static gib_module_t *gibmodules;
|
||||||
void
|
void
|
||||||
GIB_Module_Load (const char *name, VFile *f)
|
GIB_Module_Load (const char *name, VFile *f)
|
||||||
{
|
{
|
||||||
char line[1024];
|
unsigned char line[1024];
|
||||||
int namelen, nameofs;
|
int namelen, nameofs;
|
||||||
gib_module_t *newmod;
|
gib_module_t *newmod;
|
||||||
gib_sub_t *newsub;
|
gib_sub_t *newsub;
|
||||||
|
|
|
@ -40,7 +40,6 @@ static const char rcsid[] =
|
||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "compat.h"
|
|
||||||
#include "QF/model.h"
|
#include "QF/model.h"
|
||||||
#include "QF/qendian.h"
|
#include "QF/qendian.h"
|
||||||
#include "QF/skin.h"
|
#include "QF/skin.h"
|
||||||
|
@ -51,6 +50,8 @@ static const char rcsid[] =
|
||||||
#include "QF/vid.h"
|
#include "QF/vid.h"
|
||||||
#include "QF/GL/qf_textures.h"
|
#include "QF/GL/qf_textures.h"
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
byte player_8bit_texels[320 * 200];
|
byte player_8bit_texels[320 * 200];
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ static const char rcsid[] =
|
||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "compat.h"
|
|
||||||
#include "QF/crc.h"
|
#include "QF/crc.h"
|
||||||
#include "QF/model.h"
|
#include "QF/model.h"
|
||||||
#include "QF/msg.h"
|
#include "QF/msg.h"
|
||||||
|
@ -51,6 +50,7 @@ static const char rcsid[] =
|
||||||
#include "d_iface.h"
|
#include "d_iface.h"
|
||||||
#include "r_local.h"
|
#include "r_local.h"
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ALIAS MODELS
|
ALIAS MODELS
|
||||||
|
|
|
@ -105,7 +105,7 @@ PL_SkipSpace (pldata_t *pl)
|
||||||
while (pl->pos < pl->end) {
|
while (pl->pos < pl->end) {
|
||||||
char c = pl->ptr[pl->pos];
|
char c = pl->ptr[pl->pos];
|
||||||
|
|
||||||
if (!isspace (c)) {
|
if (!isspace ((byte) c)) {
|
||||||
if (c == '/' && pl->pos < pl->end - 1) { // check for comments
|
if (c == '/' && pl->pos < pl->end - 1) { // check for comments
|
||||||
if (pl->ptr[pl->pos + 1] == '/') {
|
if (pl->ptr[pl->pos + 1] == '/') {
|
||||||
pl->pos += 2;
|
pl->pos += 2;
|
||||||
|
@ -178,7 +178,7 @@ PL_ParseQuotedString (pldata_t *pl)
|
||||||
hex = true;
|
hex = true;
|
||||||
shrink++;
|
shrink++;
|
||||||
escaped++;
|
escaped++;
|
||||||
} else if (hex && isxdigit (c)) {
|
} else if (hex && isxdigit ((byte) c)) {
|
||||||
shrink++;
|
shrink++;
|
||||||
escaped++;
|
escaped++;
|
||||||
} else if (c >= '0' && c <= '7') {
|
} else if (c >= '0' && c <= '7') {
|
||||||
|
@ -235,7 +235,7 @@ PL_ParseQuotedString (pldata_t *pl)
|
||||||
if (escaped == 2 && c == 'x') {
|
if (escaped == 2 && c == 'x') {
|
||||||
hex = true;
|
hex = true;
|
||||||
escaped++;
|
escaped++;
|
||||||
} else if (hex && isxdigit (c)) {
|
} else if (hex && isxdigit ((byte) c)) {
|
||||||
chars[k] <<= 4;
|
chars[k] <<= 4;
|
||||||
chars[k] |= char2num (c);
|
chars[k] |= char2num (c);
|
||||||
escaped++;
|
escaped++;
|
||||||
|
@ -301,7 +301,7 @@ PL_ParseUnquotedString (pldata_t *pl)
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
while (pl->pos < pl->end) {
|
while (pl->pos < pl->end) {
|
||||||
if (!isalnum (pl->ptr[pl->pos]) && pl->ptr[pl->pos] != '_')
|
if (!isalnum ((byte) pl->ptr[pl->pos]) && pl->ptr[pl->pos] != '_')
|
||||||
break;
|
break;
|
||||||
pl->pos++;
|
pl->pos++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,9 @@ static const char rcsid[] =
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
|
#ifdef IRIX
|
||||||
|
#define _vsnprintf vsnprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Q_strcasestr
|
Q_strcasestr
|
||||||
|
@ -67,7 +70,7 @@ Q_strnlen (const char *s, size_t maxlen)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE__VSNPRINTF
|
#if defined(HAVE__VSNPRINTF) && !defined(HAVE_VSNPRINTF)
|
||||||
size_t
|
size_t
|
||||||
Q_snprintfz (char *dest, size_t size, const char *fmt, ...)
|
Q_snprintfz (char *dest, size_t size, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,15 +50,13 @@ static const char rcsid[] =
|
||||||
#include <QF/cvar.h>
|
#include <QF/cvar.h>
|
||||||
#include <QF/console.h>
|
#include <QF/console.h>
|
||||||
#include <QF/sys.h>
|
#include <QF/sys.h>
|
||||||
#include <QF/GL/extensions.h>
|
|
||||||
#include <QF/GL/funcs.h>
|
#include <QF/GL/funcs.h>
|
||||||
#include <QF/GL/types.h>
|
|
||||||
|
|
||||||
#include "r_cvar.h"
|
#include "r_cvar.h"
|
||||||
|
|
||||||
// First we need to get all the function pointers declared.
|
// First we need to get all the function pointers declared.
|
||||||
#define QFGL_NEED(ret, name, args) \
|
#define QFGL_NEED(ret, name, args) \
|
||||||
ret (GLAPIENTRY * qf##name) args = NULL;
|
ret (GLAPIENTRY * qf##name) args
|
||||||
#include "QF/GL/qf_funcs_list.h"
|
#include "QF/GL/qf_funcs_list.h"
|
||||||
#undef QFGL_NEED
|
#undef QFGL_NEED
|
||||||
|
|
||||||
|
@ -124,7 +122,7 @@ GLF_Init (void)
|
||||||
libgl_handle = QFGL_LoadLibrary ();
|
libgl_handle = QFGL_LoadLibrary ();
|
||||||
|
|
||||||
#define QFGL_NEED(ret, name, args) \
|
#define QFGL_NEED(ret, name, args) \
|
||||||
qf##name = QFGL_ProcAddress (libgl_handle, #name, true);
|
qf##name = QFGL_ProcAddress (libgl_handle, #name, true)
|
||||||
#include "QF/GL/qf_funcs_list.h"
|
#include "QF/GL/qf_funcs_list.h"
|
||||||
#undef QFGL_NEED
|
#undef QFGL_NEED
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,12 @@ static const char rcsid[] =
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_ALLOCA_H
|
||||||
|
# include <alloca.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
|
@ -52,6 +56,8 @@ static const char rcsid[] =
|
||||||
#include "r_shared.h"
|
#include "r_shared.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
#define BOX_WIDTH 2056
|
#define BOX_WIDTH 2056
|
||||||
|
|
||||||
/* cube face to sky texture offset conversion */
|
/* cube face to sky texture offset conversion */
|
||||||
|
|
|
@ -39,6 +39,9 @@ static const char rcsid[] =
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_ALLOCA_H
|
||||||
|
# include <alloca.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -31,12 +31,7 @@ static const char rcsid[] =
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include "QF/qtypes.h"
|
||||||
|
|
||||||
#include "QF/sys.h"
|
|
||||||
|
|
||||||
#include "compat.h"
|
|
||||||
#include "host.h"
|
|
||||||
|
|
||||||
|
|
||||||
qboolean
|
qboolean
|
||||||
|
|
|
@ -43,6 +43,7 @@ static const char rcsid[] =
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# define INET6
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
|
|
@ -416,9 +416,9 @@ Team_F_Skins (char *args)
|
||||||
{
|
{
|
||||||
int totalfb, l;
|
int totalfb, l;
|
||||||
|
|
||||||
while(isspace(*args))
|
while(isspace((byte) *args))
|
||||||
args++;
|
args++;
|
||||||
for (l = 0;args[l] && !isspace(args[l]);l++);
|
for (l = 0;args[l] && !isspace((byte) args[l]);l++);
|
||||||
|
|
||||||
if (l == 0) {
|
if (l == 0) {
|
||||||
totalfb = Skin_FbPercent (0);
|
totalfb = Skin_FbPercent (0);
|
||||||
|
@ -453,12 +453,12 @@ Team_ParseChat (const char *string)
|
||||||
if (!(s = strchr(string, ':')))
|
if (!(s = strchr(string, ':')))
|
||||||
return;
|
return;
|
||||||
s++;
|
s++;
|
||||||
while (isspace(*s))
|
while (isspace((byte) *s))
|
||||||
s++;
|
s++;
|
||||||
|
|
||||||
for (i = 0; f_replies[i].name; i++) {
|
for (i = 0; f_replies[i].name; i++) {
|
||||||
if (!strncmp(f_replies[i].name, s, strlen(f_replies[i].name)) && cl_freply->value) {
|
if (!strncmp(f_replies[i].name, s, strlen(f_replies[i].name)) && cl_freply->value) {
|
||||||
while (*s && !isspace(*s))
|
while (*s && !isspace((byte) *s))
|
||||||
s++;
|
s++;
|
||||||
Cbuf_AddText(f_replies[i].func(s));
|
Cbuf_AddText(f_replies[i].func(s));
|
||||||
f_replies[i].lasttime = realtime;
|
f_replies[i].lasttime = realtime;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue