mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
big protototype cleanup. Now, except for a few cases, all non-static
prototypes are in headers files.
This commit is contained in:
parent
43fa6a4002
commit
ca4b3acd6c
102 changed files with 826 additions and 946 deletions
|
@ -236,7 +236,13 @@ typedef void (GLAPIENTRY *QF_glTexCoordPointerEXT) (GLint size, GLenum type, GLs
|
|||
typedef void (GLAPIENTRY *QF_glVertexPointerEXT) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
|
||||
|
||||
// 3Dfx
|
||||
typedef long FxI32;
|
||||
typedef FxI32 GrScreenResolution_t;
|
||||
typedef FxI32 GrDitherMode_t;
|
||||
typedef FxI32 GrScreenRefresh_t;
|
||||
|
||||
typedef void (GLAPIENTRY *QF_gl3DfxSetPaletteEXT) (GLuint *pal);
|
||||
typedef void (GLAPIENTRY * QF_3DfxSetDitherModeEXT) (GrDitherMode_t mode);
|
||||
|
||||
// GLX 1.3
|
||||
typedef void *(GLAPIENTRY *QF_glXGetProcAddressARB) (const GLubyte *procName);
|
||||
|
|
|
@ -39,4 +39,6 @@ void R_DrawBrushModel (struct entity_s *e);
|
|||
void R_DrawWorld (void);
|
||||
void R_RenderBrushPoly (msurface_t *fa);
|
||||
|
||||
void EmitWaterPolys (msurface_t *fa);
|
||||
|
||||
#endif // __QF_GL_rsurf_h
|
||||
|
|
|
@ -55,6 +55,8 @@ void Draw_AltString (int x, int y, const char *str);
|
|||
qpic_t *Draw_PicFromWad (const char *name);
|
||||
qpic_t *Draw_CachePic (const char *path, qboolean alpha);
|
||||
|
||||
void Draw_ClearCache (void);
|
||||
|
||||
void GL_Set2D (void);
|
||||
void GL_FlushText (void);
|
||||
|
||||
|
|
|
@ -452,6 +452,13 @@ void Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr, void *_m,
|
|||
void Mod_FinalizeAliasModel (model_t *m, aliashdr_t *hdr);
|
||||
void Mod_SpriteLoadTexture (mspriteframe_t *pspriteframe, int framenum);
|
||||
|
||||
void Mod_LoadBrushModel (model_t *mod, void *buffer);
|
||||
void Mod_LoadAliasModel (model_t *mod, void *buffer,
|
||||
cache_allocator_t allocator);
|
||||
void Mod_LoadSpriteModel (model_t *mod, void *buffer);
|
||||
void Mod_SubdivideSurface (msurface_t *fa);
|
||||
|
||||
void Mod_Print (void);
|
||||
|
||||
extern struct cvar_s *gl_mesh_cache;
|
||||
extern struct cvar_s *gl_subdivide_size;
|
||||
|
|
|
@ -196,4 +196,9 @@ void R_LineGraph (int x, int y, int *h_vals, int count);
|
|||
struct progs_s;
|
||||
void R_Progs_Init (struct progs_s *pr);
|
||||
|
||||
void R_DrawAliasModel (entity_t *e);
|
||||
void R_DrawSpriteModel (entity_t *e);
|
||||
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
#endif // __render_h
|
||||
|
|
|
@ -158,6 +158,10 @@ void SND_LocalSound (const char *s);
|
|||
void SND_BlockSound (void);
|
||||
void SND_UnblockSound (void);
|
||||
|
||||
void SND_ResampleSfx (sfxcache_t *sc, byte * data);
|
||||
sfxcache_t *SND_GetCache (long samples, int rate, int inwidth, int channels,
|
||||
sfx_t *sfx, cache_allocator_t allocator);
|
||||
|
||||
void SND_InitScaletable (void);
|
||||
// picks a channel based on priorities, empty slots, number of channels
|
||||
channel_t *SND_PickChannel(int entnum, int entchannel);
|
||||
|
@ -234,4 +238,12 @@ void S_AmbientOn (void);
|
|||
|
||||
extern struct model_s **snd_worldmodel;
|
||||
|
||||
void SND_CallbackLoad (void *object, cache_allocator_t allocator);
|
||||
sfxcache_t *SND_LoadOgg (QFile *file, sfx_t *sfx, cache_allocator_t allocator);
|
||||
wavinfo_t SND_GetWavinfo (const char *name, byte * wav, int wavlength);
|
||||
|
||||
void SND_WriteLinearBlastStereo16 (void);
|
||||
void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count);
|
||||
void SND_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int count);
|
||||
|
||||
#endif // _SOUND_H
|
||||
|
|
|
@ -143,4 +143,6 @@ void GL_Pre_Init (void);
|
|||
|
||||
void VID_MakeColormaps (int fullbrights, byte *pal);
|
||||
|
||||
void VGA_UpdatePlanarScreen (void *srcbuffer);
|
||||
|
||||
#endif // __vid_h_
|
||||
|
|
|
@ -138,6 +138,8 @@ void *Cache_Check (cache_user_t *c);
|
|||
// if present, otherwise returns NULL
|
||||
|
||||
void Cache_Free (cache_user_t *c);
|
||||
void Cache_FreeLow (int new_low_hunk);
|
||||
void Cache_FreeHigh (int new_high_hunk);
|
||||
|
||||
void *Cache_Alloc (cache_user_t *c, int size, const char *name);
|
||||
// Returns NULL if all purgable data was tossed and there still
|
||||
|
|
|
@ -119,4 +119,11 @@ extern float d_scalemip[3];
|
|||
|
||||
extern void (*d_drawspans) (espan_t *pspan);
|
||||
|
||||
void D_RasterizeAliasPolySmooth (void);
|
||||
void D_PolysetCalcGradients (int skinwidth);
|
||||
void D_PolysetScanLeftEdge (int height);
|
||||
struct spanpackage_s;
|
||||
void D_PolysetDrawSpans8 (struct spanpackage_s * pspanpackage);
|
||||
void D_DrawTurbulent8Span (void);
|
||||
|
||||
#endif // _D_LOCAL_H
|
||||
|
|
|
@ -82,3 +82,13 @@ extern int yyparse(void);
|
|||
extern void Die(const char *fmt, ...) __attribute__ ((noreturn));
|
||||
extern void AddVideoMode(const struct VideoMode *vmode);
|
||||
extern void makeRGBA(struct VideoMode *vmode, const char* opt);
|
||||
|
||||
void ConvertFromVideoMode(const struct VideoMode *vmode,
|
||||
struct fb_var_screeninfo *var);
|
||||
void ConvertToVideoMode(const struct fb_var_screeninfo *var,
|
||||
struct VideoMode *vmode);
|
||||
struct VideoMode *FindVideoMode(const char *name);
|
||||
extern struct VideoMode *VideoModes;
|
||||
int fbset_main (int argc, const char *argv[]);
|
||||
void ReadModeDB (void);
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@ void R_PushDlights (const vec3_t entorigin);
|
|||
struct cvar_s;
|
||||
void R_MaxDlightsCheck (struct cvar_s *var);
|
||||
void R_Particles_Init_Cvars (void);
|
||||
void R_InitBubble (void);
|
||||
|
||||
void R_InitParticles (void);
|
||||
inline void R_ClearParticles (void);
|
||||
|
|
|
@ -341,4 +341,38 @@ void R_LowFPPrecision (void);
|
|||
void R_HighFPPrecision (void);
|
||||
void R_SetFPCW (void);
|
||||
|
||||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out);
|
||||
|
||||
void R_AliasSetUpTransform (int trivial_accept);
|
||||
void R_AliasTransformVector (vec3_t in, vec3_t out);
|
||||
void R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
||||
trivertx_t *pverts, stvert_t *pstverts);
|
||||
void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts);
|
||||
|
||||
void R_GenerateSpans (void);
|
||||
|
||||
void R_InitVars (void);
|
||||
|
||||
void R_LoadSky_f (void);
|
||||
|
||||
void R_DrawSurfaceBlock_mip0 (void);
|
||||
void R_DrawSurfaceBlock_mip1 (void);
|
||||
void R_DrawSurfaceBlock_mip2 (void);
|
||||
void R_DrawSurfaceBlock_mip3 (void);
|
||||
void R_DrawSurfaceBlock16_mip0 (void);
|
||||
void R_DrawSurfaceBlock16_mip1 (void);
|
||||
void R_DrawSurfaceBlock16_mip2 (void);
|
||||
void R_DrawSurfaceBlock16_mip3 (void);
|
||||
void R_DrawSurfaceBlock32_mip0 (void);
|
||||
void R_DrawSurfaceBlock32_mip1 (void);
|
||||
void R_DrawSurfaceBlock32_mip2 (void);
|
||||
void R_DrawSurfaceBlock32_mip3 (void);
|
||||
|
||||
#endif // _R_LOCAL_H
|
||||
|
|
|
@ -52,4 +52,9 @@ void Sbar_IntermissionOverlay (void);
|
|||
|
||||
void Sbar_FinaleOverlay (void);
|
||||
|
||||
void Sbar_LogFrags (void);
|
||||
void Sbar_TeamOverlay (void);
|
||||
void Sbar_DeathmatchOverlay (int start);
|
||||
void Sbar_MiniDeathmatchOverlay (void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -113,5 +113,8 @@ struct edict_s *SV_TestPlayerPosition (struct edict_s *ent,
|
|||
int SV_HullPointContents (hull_t *hull, int num, const vec3_t p);
|
||||
hull_t *SV_HullForEntity (struct edict_s *ent, const vec3_t mins,
|
||||
const vec3_t maxs, vec3_t offset);
|
||||
qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
|
||||
const vec3_t p1, const vec3_t p2,
|
||||
trace_t *trace);
|
||||
|
||||
#endif // __world_h
|
||||
|
|
|
@ -65,8 +65,6 @@ static char cd_dev[64] = "/dev/cdrom";
|
|||
|
||||
static CDPLAYER *cdp = NULL;
|
||||
|
||||
void I_SGI_Stop (void);
|
||||
|
||||
static void
|
||||
I_SGI_Eject (void)
|
||||
{
|
||||
|
|
|
@ -49,20 +49,6 @@ static const char rcsid[] =
|
|||
#include "QF/sound.h"
|
||||
#include "QF/plugin.h"
|
||||
|
||||
void SND_Play (void);
|
||||
void SND_PlayVol (void);
|
||||
void SND_SoundList (void);
|
||||
void SND_StopAllSounds (qboolean clear);
|
||||
void SND_StopAllSoundsC (void);
|
||||
void SND_Update_ (void);
|
||||
|
||||
sfx_t *SND_PrecacheSound (const char *name);
|
||||
void SND_ClearBuffer (void);
|
||||
void SND_PaintChannels (int endtime);
|
||||
void SND_CallbackLoad (void *object, cache_allocator_t allocator);
|
||||
|
||||
void SND_Init_Cvars ();
|
||||
|
||||
// Internal sound data & structures ===========================================
|
||||
|
||||
int snd_blocked = 0;
|
||||
|
@ -167,130 +153,6 @@ SND_Startup (void)
|
|||
sound_started = 1;
|
||||
}
|
||||
|
||||
void
|
||||
SND_Init (void)
|
||||
{
|
||||
Sys_Printf ("\nSound Initialization\n");
|
||||
|
||||
Cmd_AddCommand ("play", SND_Play,
|
||||
"Play selected sound effect (play pathto/sound.wav)");
|
||||
Cmd_AddCommand ("playvol", SND_PlayVol, "Play selected sound effect at "
|
||||
"selected volume (playvol pathto/sound.wav num");
|
||||
Cmd_AddCommand ("stopsound", SND_StopAllSoundsC,
|
||||
"Stops all sounds currently being played");
|
||||
Cmd_AddCommand ("soundlist", SND_SoundList,
|
||||
"Reports a list of sounds in the cache");
|
||||
Cmd_AddCommand ("soundinfo", SND_SoundInfo_f,
|
||||
"Report information on the sound system");
|
||||
|
||||
SND_Init_Cvars ();
|
||||
|
||||
if (COM_CheckParm ("-nosound"))
|
||||
return;
|
||||
|
||||
if (COM_CheckParm ("-simsound"))
|
||||
fakedma = true;
|
||||
|
||||
// FIXME
|
||||
// if (host_parms.memsize < 0x800000) {
|
||||
// Cvar_Set (snd_loadas8bit, "1");
|
||||
// Sys_Printf ("loading all sounds as 8bit\n");
|
||||
// }
|
||||
|
||||
snd_initialized = true;
|
||||
|
||||
SND_Startup ();
|
||||
|
||||
if (sound_started == 0) // sound startup failed? Bail out.
|
||||
return;
|
||||
|
||||
SND_InitScaletable ();
|
||||
|
||||
known_sfx = Hunk_AllocName (MAX_SFX * sizeof (sfx_t), "sfx_t");
|
||||
|
||||
num_sfx = 0;
|
||||
|
||||
// create a piece of DMA memory
|
||||
if (fakedma) {
|
||||
shm = (void *) Hunk_AllocName (sizeof (*shm), "shm");
|
||||
shm->splitbuffer = 0;
|
||||
shm->samplebits = 16;
|
||||
shm->speed = 22050;
|
||||
shm->channels = 2;
|
||||
shm->samples = 32768;
|
||||
shm->samplepos = 0;
|
||||
shm->soundalive = true;
|
||||
shm->gamealive = true;
|
||||
shm->submission_chunk = 1;
|
||||
shm->buffer = Hunk_AllocName (1 << 16, "shmbuf");
|
||||
}
|
||||
// Sys_Printf ("Sound sampling rate: %i\n", shm->speed);
|
||||
|
||||
// provides a tick sound until washed clean
|
||||
|
||||
// if (shm->buffer)
|
||||
// shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging
|
||||
|
||||
ambient_sfx[AMBIENT_WATER] = SND_PrecacheSound ("ambience/water1.wav");
|
||||
ambient_sfx[AMBIENT_SKY] = SND_PrecacheSound ("ambience/wind2.wav");
|
||||
|
||||
SND_StopAllSounds (true);
|
||||
}
|
||||
|
||||
void
|
||||
SND_Init_Cvars (void)
|
||||
{
|
||||
ambient_fade = Cvar_Get ("ambient_fade", "100", CVAR_NONE, NULL,
|
||||
"How quickly ambient sounds fade in or out");
|
||||
ambient_level = Cvar_Get ("ambient_level", "0.3", CVAR_NONE, NULL,
|
||||
"Ambient sounds' volume");
|
||||
nosound = Cvar_Get ("nosound", "0", CVAR_NONE, NULL,
|
||||
"Set to turn sound off");
|
||||
precache = Cvar_Get ("precache", "1", CVAR_NONE, NULL,
|
||||
"Toggle the use of a precache");
|
||||
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
|
||||
"Volume of CD music");
|
||||
volume = Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL,
|
||||
"Set the volume for sound playback");
|
||||
snd_interp = Cvar_Get ("snd_interp", "1", CVAR_ARCHIVE, NULL,
|
||||
"control sample interpolation");
|
||||
snd_loadas8bit = Cvar_Get ("snd_loadas8bit", "0", CVAR_NONE, NULL,
|
||||
"Toggles loading sounds as 8-bit samples");
|
||||
snd_mixahead = Cvar_Get ("snd_mixahead", "0.1", CVAR_ARCHIVE, NULL,
|
||||
"Delay time for sounds");
|
||||
snd_noextraupdate = Cvar_Get ("snd_noextraupdate", "0", CVAR_NONE, NULL,
|
||||
"Toggles the correct value display in "
|
||||
"host_speeds. Usually messes up sound "
|
||||
"playback when in effect");
|
||||
snd_phasesep = Cvar_Get ("snd_phasesep", "0.0", CVAR_ARCHIVE, NULL,
|
||||
"max stereo phase separation in ms. 0.6 is for "
|
||||
"20cm head");
|
||||
snd_show = Cvar_Get ("snd_show", "0", CVAR_NONE, NULL,
|
||||
"Toggles display of sounds currently being played");
|
||||
snd_volumesep = Cvar_Get ("snd_volumesep", "1.0", CVAR_ARCHIVE, NULL,
|
||||
"max stereo volume separation. 1.0 is max");
|
||||
}
|
||||
|
||||
// Shutdown sound engine ======================================================
|
||||
void
|
||||
SND_Shutdown (void)
|
||||
{
|
||||
|
||||
if (!sound_started)
|
||||
return;
|
||||
|
||||
if (shm)
|
||||
shm->gamealive = 0;
|
||||
|
||||
sound_started = 0;
|
||||
|
||||
if (!fakedma) {
|
||||
S_O_Shutdown ();
|
||||
}
|
||||
|
||||
shm = 0;
|
||||
}
|
||||
|
||||
// Load a sound ===============================================================
|
||||
sfx_t *
|
||||
SND_FindName (const char *name)
|
||||
|
@ -672,6 +534,67 @@ SND_UpdateAmbientSounds (void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
SND_GetSoundtime (void)
|
||||
{
|
||||
int fullsamples, samplepos;
|
||||
static int buffers, oldsamplepos;
|
||||
|
||||
fullsamples = shm->samples / shm->channels;
|
||||
|
||||
// it is possible to miscount buffers if it has wrapped twice between
|
||||
// calls to SND_Update. Oh well.
|
||||
samplepos = S_O_GetDMAPos ();
|
||||
|
||||
if (samplepos < oldsamplepos) {
|
||||
buffers++; // buffer wrapped
|
||||
|
||||
if (paintedtime > 0x40000000) { // time to chop things off to avoid
|
||||
// 32 bit limits
|
||||
buffers = 0;
|
||||
paintedtime = fullsamples;
|
||||
SND_StopAllSounds (true);
|
||||
}
|
||||
}
|
||||
oldsamplepos = samplepos;
|
||||
|
||||
soundtime = buffers * fullsamples + samplepos / shm->channels;
|
||||
}
|
||||
|
||||
void
|
||||
SND_Update_ (void)
|
||||
{
|
||||
int samps;
|
||||
unsigned int endtime;
|
||||
|
||||
if (!sound_started || (snd_blocked > 0))
|
||||
return;
|
||||
|
||||
// Updates DMA time
|
||||
SND_GetSoundtime ();
|
||||
|
||||
// check to make sure that we haven't overshot
|
||||
if (paintedtime < soundtime) {
|
||||
// Sys_Printf ("S_Update_ : overflow\n");
|
||||
paintedtime = soundtime;
|
||||
}
|
||||
// mix ahead of current position
|
||||
endtime = soundtime + snd_mixahead->value * shm->speed;
|
||||
samps = shm->samples >> (shm->channels - 1);
|
||||
if (endtime - soundtime > samps)
|
||||
endtime = soundtime + samps;
|
||||
|
||||
#if 0
|
||||
#ifdef _WIN32
|
||||
if (pDSBuf)
|
||||
DSOUND_Restore ();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SND_PaintChannels (endtime);
|
||||
S_O_Submit ();
|
||||
}
|
||||
|
||||
/*
|
||||
SND_Update
|
||||
|
||||
|
@ -756,33 +679,6 @@ SND_Update (const vec3_t origin, const vec3_t forward, const vec3_t right,
|
|||
SND_Update_ ();
|
||||
}
|
||||
|
||||
void
|
||||
SND_GetSoundtime (void)
|
||||
{
|
||||
int fullsamples, samplepos;
|
||||
static int buffers, oldsamplepos;
|
||||
|
||||
fullsamples = shm->samples / shm->channels;
|
||||
|
||||
// it is possible to miscount buffers if it has wrapped twice between
|
||||
// calls to SND_Update. Oh well.
|
||||
samplepos = S_O_GetDMAPos ();
|
||||
|
||||
if (samplepos < oldsamplepos) {
|
||||
buffers++; // buffer wrapped
|
||||
|
||||
if (paintedtime > 0x40000000) { // time to chop things off to avoid
|
||||
// 32 bit limits
|
||||
buffers = 0;
|
||||
paintedtime = fullsamples;
|
||||
SND_StopAllSounds (true);
|
||||
}
|
||||
}
|
||||
oldsamplepos = samplepos;
|
||||
|
||||
soundtime = buffers * fullsamples + samplepos / shm->channels;
|
||||
}
|
||||
|
||||
void
|
||||
SND_ExtraUpdate (void)
|
||||
{
|
||||
|
@ -791,40 +687,6 @@ SND_ExtraUpdate (void)
|
|||
SND_Update_ ();
|
||||
}
|
||||
|
||||
void
|
||||
SND_Update_ (void)
|
||||
{
|
||||
int samps;
|
||||
unsigned int endtime;
|
||||
|
||||
if (!sound_started || (snd_blocked > 0))
|
||||
return;
|
||||
|
||||
// Updates DMA time
|
||||
SND_GetSoundtime ();
|
||||
|
||||
// check to make sure that we haven't overshot
|
||||
if (paintedtime < soundtime) {
|
||||
// Sys_Printf ("S_Update_ : overflow\n");
|
||||
paintedtime = soundtime;
|
||||
}
|
||||
// mix ahead of current position
|
||||
endtime = soundtime + snd_mixahead->value * shm->speed;
|
||||
samps = shm->samples >> (shm->channels - 1);
|
||||
if (endtime - soundtime > samps)
|
||||
endtime = soundtime + samps;
|
||||
|
||||
#if 0
|
||||
#ifdef _WIN32
|
||||
if (pDSBuf)
|
||||
DSOUND_Restore ();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SND_PaintChannels (endtime);
|
||||
S_O_Submit ();
|
||||
}
|
||||
|
||||
/* console functions */
|
||||
|
||||
void
|
||||
|
@ -966,6 +828,130 @@ SND_UnblockSound (void)
|
|||
S_O_UnblockSound ();
|
||||
}
|
||||
|
||||
void
|
||||
SND_Init_Cvars (void)
|
||||
{
|
||||
ambient_fade = Cvar_Get ("ambient_fade", "100", CVAR_NONE, NULL,
|
||||
"How quickly ambient sounds fade in or out");
|
||||
ambient_level = Cvar_Get ("ambient_level", "0.3", CVAR_NONE, NULL,
|
||||
"Ambient sounds' volume");
|
||||
nosound = Cvar_Get ("nosound", "0", CVAR_NONE, NULL,
|
||||
"Set to turn sound off");
|
||||
precache = Cvar_Get ("precache", "1", CVAR_NONE, NULL,
|
||||
"Toggle the use of a precache");
|
||||
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
|
||||
"Volume of CD music");
|
||||
volume = Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL,
|
||||
"Set the volume for sound playback");
|
||||
snd_interp = Cvar_Get ("snd_interp", "1", CVAR_ARCHIVE, NULL,
|
||||
"control sample interpolation");
|
||||
snd_loadas8bit = Cvar_Get ("snd_loadas8bit", "0", CVAR_NONE, NULL,
|
||||
"Toggles loading sounds as 8-bit samples");
|
||||
snd_mixahead = Cvar_Get ("snd_mixahead", "0.1", CVAR_ARCHIVE, NULL,
|
||||
"Delay time for sounds");
|
||||
snd_noextraupdate = Cvar_Get ("snd_noextraupdate", "0", CVAR_NONE, NULL,
|
||||
"Toggles the correct value display in "
|
||||
"host_speeds. Usually messes up sound "
|
||||
"playback when in effect");
|
||||
snd_phasesep = Cvar_Get ("snd_phasesep", "0.0", CVAR_ARCHIVE, NULL,
|
||||
"max stereo phase separation in ms. 0.6 is for "
|
||||
"20cm head");
|
||||
snd_show = Cvar_Get ("snd_show", "0", CVAR_NONE, NULL,
|
||||
"Toggles display of sounds currently being played");
|
||||
snd_volumesep = Cvar_Get ("snd_volumesep", "1.0", CVAR_ARCHIVE, NULL,
|
||||
"max stereo volume separation. 1.0 is max");
|
||||
}
|
||||
|
||||
void
|
||||
SND_Init (void)
|
||||
{
|
||||
Sys_Printf ("\nSound Initialization\n");
|
||||
|
||||
Cmd_AddCommand ("play", SND_Play,
|
||||
"Play selected sound effect (play pathto/sound.wav)");
|
||||
Cmd_AddCommand ("playvol", SND_PlayVol, "Play selected sound effect at "
|
||||
"selected volume (playvol pathto/sound.wav num");
|
||||
Cmd_AddCommand ("stopsound", SND_StopAllSoundsC,
|
||||
"Stops all sounds currently being played");
|
||||
Cmd_AddCommand ("soundlist", SND_SoundList,
|
||||
"Reports a list of sounds in the cache");
|
||||
Cmd_AddCommand ("soundinfo", SND_SoundInfo_f,
|
||||
"Report information on the sound system");
|
||||
|
||||
SND_Init_Cvars ();
|
||||
|
||||
if (COM_CheckParm ("-nosound"))
|
||||
return;
|
||||
|
||||
if (COM_CheckParm ("-simsound"))
|
||||
fakedma = true;
|
||||
|
||||
// FIXME
|
||||
// if (host_parms.memsize < 0x800000) {
|
||||
// Cvar_Set (snd_loadas8bit, "1");
|
||||
// Sys_Printf ("loading all sounds as 8bit\n");
|
||||
// }
|
||||
|
||||
snd_initialized = true;
|
||||
|
||||
SND_Startup ();
|
||||
|
||||
if (sound_started == 0) // sound startup failed? Bail out.
|
||||
return;
|
||||
|
||||
SND_InitScaletable ();
|
||||
|
||||
known_sfx = Hunk_AllocName (MAX_SFX * sizeof (sfx_t), "sfx_t");
|
||||
|
||||
num_sfx = 0;
|
||||
|
||||
// create a piece of DMA memory
|
||||
if (fakedma) {
|
||||
shm = (void *) Hunk_AllocName (sizeof (*shm), "shm");
|
||||
shm->splitbuffer = 0;
|
||||
shm->samplebits = 16;
|
||||
shm->speed = 22050;
|
||||
shm->channels = 2;
|
||||
shm->samples = 32768;
|
||||
shm->samplepos = 0;
|
||||
shm->soundalive = true;
|
||||
shm->gamealive = true;
|
||||
shm->submission_chunk = 1;
|
||||
shm->buffer = Hunk_AllocName (1 << 16, "shmbuf");
|
||||
}
|
||||
// Sys_Printf ("Sound sampling rate: %i\n", shm->speed);
|
||||
|
||||
// provides a tick sound until washed clean
|
||||
|
||||
// if (shm->buffer)
|
||||
// shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging
|
||||
|
||||
ambient_sfx[AMBIENT_WATER] = SND_PrecacheSound ("ambience/water1.wav");
|
||||
ambient_sfx[AMBIENT_SKY] = SND_PrecacheSound ("ambience/wind2.wav");
|
||||
|
||||
SND_StopAllSounds (true);
|
||||
}
|
||||
|
||||
// Shutdown sound engine ======================================================
|
||||
void
|
||||
SND_Shutdown (void)
|
||||
{
|
||||
|
||||
if (!sound_started)
|
||||
return;
|
||||
|
||||
if (shm)
|
||||
shm->gamealive = 0;
|
||||
|
||||
sound_started = 0;
|
||||
|
||||
if (!fakedma) {
|
||||
S_O_Shutdown ();
|
||||
}
|
||||
|
||||
shm = 0;
|
||||
}
|
||||
|
||||
QFPLUGIN plugin_t *
|
||||
PLUGIN_INFO(snd_render, default) (void)
|
||||
{
|
||||
|
@ -1014,4 +1000,3 @@ PLUGIN_INFO(snd_render, default) (void)
|
|||
|
||||
return &plugin_info;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,11 +45,6 @@ static const char rcsid[] =
|
|||
|
||||
int cache_full_cycle;
|
||||
|
||||
byte *SND_Alloc (int size);
|
||||
wavinfo_t SND_GetWavinfo (const char *name, byte * wav, int wavlength);
|
||||
sfxcache_t *SND_LoadSound (sfx_t *sfx, cache_allocator_t allocator);
|
||||
sfxcache_t *SND_LoadOgg (QFile *file, sfx_t *sfx, cache_allocator_t allocator);
|
||||
|
||||
sfxcache_t *
|
||||
SND_GetCache (long samples, int rate, int inwidth, int channels,
|
||||
sfx_t *sfx, cache_allocator_t allocator)
|
||||
|
|
|
@ -53,8 +53,6 @@ int snd_scaletable[32][256];
|
|||
int *snd_p, snd_linear_count, snd_vol;
|
||||
short *snd_out;
|
||||
|
||||
void SND_WriteLinearBlastStereo16 (void);
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
void
|
||||
SND_WriteLinearBlastStereo16 (void)
|
||||
|
@ -206,9 +204,6 @@ SND_TransferPaintBuffer (int endtime)
|
|||
|
||||
/* CHANNEL MIXING */
|
||||
|
||||
void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int endtime);
|
||||
void SND_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int endtime);
|
||||
|
||||
void
|
||||
SND_PaintChannels (int endtime)
|
||||
{
|
||||
|
|
|
@ -51,11 +51,6 @@ general_funcs_t plugin_info_general_funcs;
|
|||
sound_data_t plugin_info_sound_data;
|
||||
sound_funcs_t plugin_info_sound_funcs;
|
||||
|
||||
void SND_Init_Cvars (void);
|
||||
|
||||
|
||||
|
||||
|
||||
void
|
||||
SND_Init (void)
|
||||
{
|
||||
|
|
|
@ -50,10 +50,6 @@ static const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
#include "QF/quakeio.h"
|
||||
|
||||
//FIXME should be in header
|
||||
void SND_ResampleSfx (sfxcache_t *sc, byte * data);
|
||||
sfxcache_t *SND_GetCache (long samples, int rate, int inwidth, int channels,
|
||||
sfx_t *sfx, cache_allocator_t allocator);
|
||||
|
||||
static size_t
|
||||
read_func (void *ptr, size_t size, size_t nmemb, void *datasource)
|
||||
|
|
|
@ -99,8 +99,6 @@ const char *pr_type_name[ev_type_count] = {
|
|||
"array",
|
||||
};
|
||||
|
||||
ddef_t *ED_FieldAtOfs (progs_t *pr, int ofs);
|
||||
|
||||
/*
|
||||
ED_ClearEdict
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ static const char rcsid[] =
|
|||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/model.h"
|
||||
#include "QF/qendian.h"
|
||||
#include "QF/quakefs.h"
|
||||
|
@ -158,3 +159,133 @@ Mod_LoadLighting (lump_t *l)
|
|||
for (i = 0; i < l->filelen ; i++)
|
||||
*out++ = gammatable[*in++];
|
||||
}
|
||||
|
||||
msurface_t *warpface;
|
||||
|
||||
|
||||
void
|
||||
BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
float *v;
|
||||
int i, j;
|
||||
|
||||
mins[0] = mins[1] = mins[2] = 9999;
|
||||
maxs[0] = maxs[1] = maxs[2] = -9999;
|
||||
v = verts;
|
||||
for (i = 0; i < numverts; i++)
|
||||
for (j = 0; j < 3; j++, v++) {
|
||||
if (*v < mins[j])
|
||||
mins[j] = *v;
|
||||
if (*v > maxs[j])
|
||||
maxs[j] = *v;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SubdividePolygon (int numverts, float *verts)
|
||||
{
|
||||
float frac, m, s, t;
|
||||
float dist[64];
|
||||
float *v;
|
||||
int b, f, i, j, k;
|
||||
glpoly_t *poly;
|
||||
vec3_t mins, maxs;
|
||||
vec3_t front[64], back[64];
|
||||
|
||||
if (numverts > 60)
|
||||
Sys_Error ("numverts = %i", numverts);
|
||||
|
||||
BoundPoly (numverts, verts, mins, maxs);
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
m = (mins[i] + maxs[i]) * 0.5;
|
||||
m = gl_subdivide_size->value * floor (m / gl_subdivide_size->value +
|
||||
0.5);
|
||||
if (maxs[i] - m < 8)
|
||||
continue;
|
||||
if (m - mins[i] < 8)
|
||||
continue;
|
||||
|
||||
// cut it
|
||||
v = verts + i;
|
||||
for (j = 0; j < numverts; j++, v += 3)
|
||||
dist[j] = *v - m;
|
||||
|
||||
// wrap cases
|
||||
dist[j] = dist[0];
|
||||
v -= i;
|
||||
VectorCopy (verts, v);
|
||||
|
||||
f = b = 0;
|
||||
v = verts;
|
||||
for (j = 0; j < numverts; j++, v += 3) {
|
||||
if (dist[j] >= 0) {
|
||||
VectorCopy (v, front[f]);
|
||||
f++;
|
||||
}
|
||||
if (dist[j] <= 0) {
|
||||
VectorCopy (v, back[b]);
|
||||
b++;
|
||||
}
|
||||
if (dist[j] == 0 || dist[j + 1] == 0)
|
||||
continue;
|
||||
if ((dist[j] > 0) != (dist[j + 1] > 0)) {
|
||||
// clip point
|
||||
frac = dist[j] / (dist[j] - dist[j + 1]);
|
||||
for (k = 0; k < 3; k++)
|
||||
front[f][k] = back[b][k] = v[k] + frac * (v[3 + k] - v[k]);
|
||||
f++;
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
SubdividePolygon (f, front[0]);
|
||||
SubdividePolygon (b, back[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
poly = Hunk_Alloc (sizeof (glpoly_t) + (numverts - 4) * VERTEXSIZE *
|
||||
sizeof (float));
|
||||
poly->next = warpface->polys;
|
||||
warpface->polys = poly;
|
||||
poly->numverts = numverts;
|
||||
for (i = 0; i < numverts; i++, verts += 3) {
|
||||
VectorCopy (verts, poly->verts[i]);
|
||||
s = DotProduct (verts, warpface->texinfo->vecs[0]);
|
||||
t = DotProduct (verts, warpface->texinfo->vecs[1]);
|
||||
poly->verts[i][3] = s;
|
||||
poly->verts[i][4] = t;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Mod_SubdivideSurface
|
||||
|
||||
Breaks a polygon up along axial 64 unit
|
||||
boundaries so that turbulent and sky warps
|
||||
can be done reasonably.
|
||||
*/
|
||||
void
|
||||
Mod_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
float *vec;
|
||||
int lindex, numverts, i;
|
||||
vec3_t verts[64];
|
||||
|
||||
warpface = fa;
|
||||
|
||||
// convert edges back to a normal polygon
|
||||
numverts = 0;
|
||||
for (i = 0; i < fa->numedges; i++) {
|
||||
lindex = loadmodel->surfedges[fa->firstedge + i];
|
||||
|
||||
if (lindex > 0)
|
||||
vec = loadmodel->vertexes[loadmodel->edges[lindex].v[0]].position;
|
||||
else
|
||||
vec = loadmodel->vertexes[loadmodel->edges[-lindex].v[1]].position;
|
||||
VectorCopy (vec, verts[numverts]);
|
||||
numverts++;
|
||||
}
|
||||
|
||||
SubdividePolygon (numverts, verts[0]);
|
||||
}
|
||||
|
|
|
@ -55,10 +55,6 @@ byte mod_novis[MAX_MAP_LEAFS / 8];
|
|||
|
||||
cvar_t *gl_sky_divide;
|
||||
|
||||
void GL_SubdivideSurface (msurface_t *fa);
|
||||
void R_InitSky (struct texture_s *mt);
|
||||
|
||||
|
||||
mleaf_t *
|
||||
Mod_PointInLeaf (const vec3_t p, model_t *model)
|
||||
{
|
||||
|
@ -300,7 +296,7 @@ Mod_LoadVertexes (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -322,7 +318,7 @@ Mod_LoadSubmodels (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -352,7 +348,7 @@ Mod_LoadEdges (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName ((count + 1) * sizeof (*out), loadname);
|
||||
|
||||
|
@ -375,7 +371,7 @@ Mod_LoadTexinfo (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -477,7 +473,7 @@ Mod_LoadFaces (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -517,7 +513,7 @@ Mod_LoadFaces (lump_t *l)
|
|||
if (!strncmp (out->texinfo->texture->name, "sky", 3)) { // sky
|
||||
out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED);
|
||||
if (gl_sky_divide && gl_sky_divide->int_val)
|
||||
GL_SubdivideSurface (out);
|
||||
Mod_SubdivideSurface (out);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -529,7 +525,7 @@ Mod_LoadFaces (lump_t *l)
|
|||
out->extents[i] = 16384;
|
||||
out->texturemins[i] = -8192;
|
||||
}
|
||||
GL_SubdivideSurface (out); // cut up polygon for warps
|
||||
Mod_SubdivideSurface (out); // cut up polygon for warps
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -554,7 +550,7 @@ Mod_LoadNodes (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -595,7 +591,7 @@ Mod_LoadLeafs (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -649,7 +645,7 @@ Mod_LoadClipnodes (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -739,7 +735,7 @@ Mod_LoadMarksurfaces (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -762,7 +758,7 @@ Mod_LoadSurfedges (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
|
@ -782,7 +778,7 @@ Mod_LoadPlanes (lump_t *l)
|
|||
|
||||
in = (void *) (mod_base + l->fileofs);
|
||||
if (l->filelen % sizeof (*in))
|
||||
Sys_Error ("MOD_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
Sys_Error ("Mod_LoadBmodel: funny lump size in %s", loadmodel->name);
|
||||
count = l->filelen / sizeof (*in);
|
||||
out = Hunk_AllocName (count * 2 * sizeof (*out), loadname);
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ int mod_lightmap_bytes = 1;
|
|||
|
||||
|
||||
void
|
||||
GL_SubdivideSurface (msurface_t *fa)
|
||||
Mod_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -48,14 +48,6 @@ static const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
|
||||
void Mod_LoadAliasModel (model_t *mod, void *buf,
|
||||
cache_allocator_t allocator);
|
||||
void Mod_LoadSpriteModel (model_t *mod, void *buf);
|
||||
void Mod_LoadBrushModel (model_t *mod, void *buf);
|
||||
model_t * Mod_RealLoadModel (model_t *mod, qboolean crash,
|
||||
cache_allocator_t allocator);
|
||||
void Mod_CallbackLoad (void *object, cache_allocator_t allocator);
|
||||
|
||||
model_t *loadmodel;
|
||||
char loadname[32]; // for hunk tags
|
||||
|
||||
|
@ -68,6 +60,7 @@ texture_t *r_notexture_mip;
|
|||
cvar_t *gl_mesh_cache;
|
||||
cvar_t *gl_subdivide_size;
|
||||
|
||||
static void Mod_CallbackLoad (void *object, cache_allocator_t allocator);
|
||||
|
||||
void
|
||||
Mod_Init (void)
|
||||
|
@ -147,24 +140,6 @@ Mod_FindName (const char *name)
|
|||
return mod;
|
||||
}
|
||||
|
||||
/*
|
||||
Mod_LoadModel
|
||||
|
||||
Loads a model into the cache
|
||||
*/
|
||||
model_t *
|
||||
Mod_LoadModel (model_t *mod, qboolean crash)
|
||||
{
|
||||
if (!mod->needload) {
|
||||
if (mod->type == mod_alias) {
|
||||
if (Cache_Check (&mod->cache))
|
||||
return mod;
|
||||
} else
|
||||
return mod; // not cached at all
|
||||
}
|
||||
return Mod_RealLoadModel (mod, crash, Cache_Alloc);
|
||||
}
|
||||
|
||||
model_t *
|
||||
Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
|
||||
{
|
||||
|
@ -231,12 +206,30 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
|
|||
return mod;
|
||||
}
|
||||
|
||||
/*
|
||||
Mod_LoadModel
|
||||
|
||||
Loads a model into the cache
|
||||
*/
|
||||
model_t *
|
||||
Mod_LoadModel (model_t *mod, qboolean crash)
|
||||
{
|
||||
if (!mod->needload) {
|
||||
if (mod->type == mod_alias) {
|
||||
if (Cache_Check (&mod->cache))
|
||||
return mod;
|
||||
} else
|
||||
return mod; // not cached at all
|
||||
}
|
||||
return Mod_RealLoadModel (mod, crash, Cache_Alloc);
|
||||
}
|
||||
|
||||
/*
|
||||
Mod_CallbackLoad
|
||||
|
||||
Callback used to load model automatically
|
||||
*/
|
||||
void
|
||||
static void
|
||||
Mod_CallbackLoad (void *object, cache_allocator_t allocator)
|
||||
{
|
||||
if (((model_t *)object)->type != mod_alias)
|
||||
|
|
|
@ -315,28 +315,32 @@ BSP_New (void)
|
|||
return calloc (1, sizeof (bsp_t));
|
||||
}
|
||||
|
||||
void BSP_AddPlane (bsp_t *bsp, dplane_t *plane)
|
||||
void
|
||||
BSP_AddPlane (bsp_t *bsp, dplane_t *plane)
|
||||
{
|
||||
bsp->planes = realloc (bsp->planes,
|
||||
(bsp->numplanes + 1) * sizeof (dplane_t));
|
||||
bsp->planes[bsp->numplanes++] = *plane;
|
||||
}
|
||||
|
||||
void BSP_AddLeaf (bsp_t *bsp, dleaf_t *leaf)
|
||||
void
|
||||
BSP_AddLeaf (bsp_t *bsp, dleaf_t *leaf)
|
||||
{
|
||||
bsp->leafs = realloc (bsp->leafs,
|
||||
(bsp->numleafs + 1) * sizeof (dleaf_t));
|
||||
bsp->leafs[bsp->numleafs++] = *leaf;
|
||||
}
|
||||
|
||||
void BSP_AddVertex (bsp_t *bsp, dvertex_t *vertex)
|
||||
void
|
||||
BSP_AddVertex (bsp_t *bsp, dvertex_t *vertex)
|
||||
{
|
||||
bsp->vertexes = realloc (bsp->vertexes,
|
||||
(bsp->numvertexes + 1) * sizeof (dvertex_t));
|
||||
bsp->vertexes[bsp->numvertexes++] = *vertex;
|
||||
}
|
||||
|
||||
void BSP_AddNode (bsp_t *bsp, dnode_t *node)
|
||||
void
|
||||
BSP_AddNode (bsp_t *bsp, dnode_t *node)
|
||||
{
|
||||
bsp->nodes = realloc (bsp->nodes,
|
||||
(bsp->numnodes + 1) * sizeof (dnode_t));
|
||||
|
@ -351,21 +355,24 @@ BSP_AddTexinfo (bsp_t *bsp, texinfo_t *texinfo)
|
|||
bsp->texinfo[bsp->numtexinfo++] = *texinfo;
|
||||
}
|
||||
|
||||
void BSP_AddFace (bsp_t *bsp, dface_t *face)
|
||||
void
|
||||
BSP_AddFace (bsp_t *bsp, dface_t *face)
|
||||
{
|
||||
bsp->faces = realloc (bsp->faces,
|
||||
(bsp->numfaces + 1) * sizeof (dface_t));
|
||||
bsp->faces[bsp->numfaces++] = *face;
|
||||
}
|
||||
|
||||
void BSP_AddClipnode (bsp_t *bsp, dclipnode_t *clipnode)
|
||||
void
|
||||
BSP_AddClipnode (bsp_t *bsp, dclipnode_t *clipnode)
|
||||
{
|
||||
bsp->clipnodes = realloc (bsp->clipnodes,
|
||||
(bsp->numclipnodes + 1) * sizeof (dclipnode_t));
|
||||
bsp->clipnodes[bsp->numclipnodes++] = *clipnode;
|
||||
}
|
||||
|
||||
void BSP_AddMarkSurface (bsp_t *bsp, unsigned short marksurface)
|
||||
void
|
||||
BSP_AddMarkSurface (bsp_t *bsp, unsigned short marksurface)
|
||||
{
|
||||
bsp->marksurfaces = realloc (bsp->marksurfaces,
|
||||
(bsp->nummarksurfaces + 1)
|
||||
|
@ -373,49 +380,56 @@ void BSP_AddMarkSurface (bsp_t *bsp, unsigned short marksurface)
|
|||
bsp->marksurfaces[bsp->nummarksurfaces++] = marksurface;
|
||||
}
|
||||
|
||||
void BSP_AddSurfEdge (bsp_t *bsp, int surfedge)
|
||||
void
|
||||
BSP_AddSurfEdge (bsp_t *bsp, int surfedge)
|
||||
{
|
||||
bsp->surfedges = realloc (bsp->surfedges,
|
||||
(bsp->numsurfedges + 1) * sizeof (int));
|
||||
bsp->surfedges[bsp->numsurfedges++] = surfedge;
|
||||
}
|
||||
|
||||
void BSP_AddEdge (bsp_t *bsp, dedge_t *edge)
|
||||
void
|
||||
BSP_AddEdge (bsp_t *bsp, dedge_t *edge)
|
||||
{
|
||||
bsp->edges = realloc (bsp->edges,
|
||||
(bsp->numedges + 1) * sizeof (dedge_t));
|
||||
bsp->edges[bsp->numedges++] = *edge;
|
||||
}
|
||||
|
||||
void BSP_AddModel (bsp_t *bsp, dmodel_t *model)
|
||||
void
|
||||
BSP_AddModel (bsp_t *bsp, dmodel_t *model)
|
||||
{
|
||||
bsp->models = realloc (bsp->models,
|
||||
(bsp->nummodels + 1) * sizeof (dmodel_t));
|
||||
bsp->models[bsp->nummodels++] = *model;
|
||||
}
|
||||
|
||||
void BSP_AddLighting (bsp_t *bsp, byte *lightdata, int lightdatasize)
|
||||
void
|
||||
BSP_AddLighting (bsp_t *bsp, byte *lightdata, int lightdatasize)
|
||||
{
|
||||
bsp->lightdatasize = lightdatasize;
|
||||
bsp->lightdata = malloc (lightdatasize);
|
||||
memcpy (bsp->lightdata, lightdata, lightdatasize);
|
||||
}
|
||||
|
||||
void BSP_AddVisibility (bsp_t *bsp, byte *visdata, int visdatasize)
|
||||
void
|
||||
BSP_AddVisibility (bsp_t *bsp, byte *visdata, int visdatasize)
|
||||
{
|
||||
bsp->visdatasize = visdatasize;
|
||||
bsp->visdata = malloc (visdatasize);
|
||||
memcpy (bsp->visdata, visdata, visdatasize);
|
||||
}
|
||||
|
||||
void BSP_AddEntities (bsp_t *bsp, char *entdata, int entdatasize)
|
||||
void
|
||||
BSP_AddEntities (bsp_t *bsp, char *entdata, int entdatasize)
|
||||
{
|
||||
bsp->entdatasize = entdatasize;
|
||||
bsp->entdata = malloc (entdatasize);
|
||||
memcpy (bsp->entdata, entdata, entdatasize);
|
||||
}
|
||||
|
||||
void BSP_AddTextures (bsp_t *bsp, byte *texdata, int texdatasize)
|
||||
void
|
||||
BSP_AddTextures (bsp_t *bsp, byte *texdata, int texdatasize)
|
||||
{
|
||||
bsp->texdatasize = texdatasize;
|
||||
bsp->texdata = malloc (texdatasize);
|
||||
|
|
|
@ -64,7 +64,8 @@ functable_t functable[] =
|
|||
{"", 0, 0}
|
||||
};
|
||||
|
||||
token *EXP_NewToken (void)
|
||||
token
|
||||
*EXP_NewToken (void)
|
||||
{
|
||||
token *new;
|
||||
|
||||
|
@ -77,7 +78,8 @@ token *EXP_NewToken (void)
|
|||
}
|
||||
|
||||
/*
|
||||
int EXP_FindIndexByFunc (opfunc func)
|
||||
int
|
||||
EXP_FindIndexByFunc (opfunc func)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; optable[i].func; i++)
|
||||
|
@ -87,7 +89,8 @@ int EXP_FindIndexByFunc (opfunc func)
|
|||
}
|
||||
*/
|
||||
|
||||
optable_t *EXP_FindOpByStr (const char *str)
|
||||
optable_t *
|
||||
EXP_FindOpByStr (const char *str)
|
||||
{
|
||||
int i, len, fi;
|
||||
|
||||
|
@ -102,7 +105,8 @@ optable_t *EXP_FindOpByStr (const char *str)
|
|||
return 0;
|
||||
}
|
||||
|
||||
functable_t *EXP_FindFuncByStr (const char *str)
|
||||
functable_t *
|
||||
EXP_FindFuncByStr (const char *str)
|
||||
{
|
||||
int i, len, fi;
|
||||
|
||||
|
@ -117,7 +121,8 @@ functable_t *EXP_FindFuncByStr (const char *str)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int EXP_ContainsCommas (token *chain)
|
||||
int
|
||||
EXP_ContainsCommas (token *chain)
|
||||
{
|
||||
token *cur;
|
||||
int paren = 0;
|
||||
|
@ -134,7 +139,8 @@ int EXP_ContainsCommas (token *chain)
|
|||
return -1; // We should never get here
|
||||
}
|
||||
|
||||
int EXP_DoFunction (token *chain)
|
||||
int
|
||||
EXP_DoFunction (token *chain)
|
||||
{
|
||||
token *cur, *temp;
|
||||
double *oplist = 0;
|
||||
|
@ -169,7 +175,8 @@ int EXP_DoFunction (token *chain)
|
|||
return -2; // We shouldn't get here
|
||||
}
|
||||
|
||||
int EXP_DoUnary (token *chain)
|
||||
int
|
||||
EXP_DoUnary (token *chain)
|
||||
{
|
||||
if (chain->generic.next->generic.type == TOKEN_OP)
|
||||
EXP_DoUnary (chain->generic.next);
|
||||
|
@ -180,7 +187,8 @@ int EXP_DoUnary (token *chain)
|
|||
return 0;
|
||||
}
|
||||
|
||||
token *EXP_ParseString (char *str)
|
||||
token *
|
||||
EXP_ParseString (char *str)
|
||||
{
|
||||
char buf[256];
|
||||
|
||||
|
@ -292,7 +300,8 @@ token *EXP_ParseString (char *str)
|
|||
return chain;
|
||||
}
|
||||
|
||||
exp_error_t EXP_SimplifyTokens (token *chain)
|
||||
exp_error_t
|
||||
EXP_SimplifyTokens (token *chain)
|
||||
{
|
||||
exp_error_t res;
|
||||
int i;
|
||||
|
@ -354,14 +363,16 @@ exp_error_t EXP_SimplifyTokens (token *chain)
|
|||
return EXP_E_NORMAL;
|
||||
}
|
||||
|
||||
void EXP_RemoveToken (token *tok)
|
||||
void
|
||||
EXP_RemoveToken (token *tok)
|
||||
{
|
||||
tok->generic.prev->generic.next = tok->generic.next;
|
||||
tok->generic.next->generic.prev = tok->generic.prev;
|
||||
free(tok);
|
||||
}
|
||||
|
||||
void EXP_DestroyTokens (token *chain)
|
||||
void
|
||||
EXP_DestroyTokens (token *chain)
|
||||
{
|
||||
token *temp;
|
||||
for (;chain; chain = temp)
|
||||
|
@ -371,7 +382,8 @@ void EXP_DestroyTokens (token *chain)
|
|||
}
|
||||
}
|
||||
|
||||
double EXP_Evaluate (char *str)
|
||||
double
|
||||
EXP_Evaluate (char *str)
|
||||
{
|
||||
token *chain;
|
||||
double res;
|
||||
|
@ -405,7 +417,8 @@ double EXP_Evaluate (char *str)
|
|||
return res;
|
||||
}
|
||||
|
||||
void EXP_InsertTokenAfter (token *spot, token *new)
|
||||
void
|
||||
EXP_InsertTokenAfter (token *spot, token *new)
|
||||
{
|
||||
spot->generic.next->generic.prev = new;
|
||||
new->generic.next = spot->generic.next;
|
||||
|
@ -414,7 +427,8 @@ void EXP_InsertTokenAfter (token *spot, token *new)
|
|||
}
|
||||
|
||||
|
||||
exp_error_t EXP_Validate (token *chain)
|
||||
exp_error_t
|
||||
EXP_Validate (token *chain)
|
||||
{
|
||||
token *cur, *new;
|
||||
int paren = 0;
|
||||
|
@ -463,7 +477,8 @@ exp_error_t EXP_Validate (token *chain)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void EXP_PrintTokens (token *chain)
|
||||
void
|
||||
EXP_PrintTokens (token *chain)
|
||||
{
|
||||
for (; chain; chain = chain->generic.next)
|
||||
switch (chain->generic.type)
|
||||
|
|
|
@ -43,7 +43,8 @@ static const char rcsid[] =
|
|||
#include "QF/hash.h"
|
||||
#include "QF/gib_buffer.h"
|
||||
|
||||
void GIB_Buffer_Construct (struct cbuf_s *cbuf)
|
||||
void
|
||||
GIB_Buffer_Construct (struct cbuf_s *cbuf)
|
||||
{
|
||||
cbuf->data = calloc (1, sizeof (gib_buffer_data_t));
|
||||
GIB_DATA (cbuf)->arg_composite = dstring_newstr ();
|
||||
|
@ -51,7 +52,8 @@ void GIB_Buffer_Construct (struct cbuf_s *cbuf)
|
|||
GIB_DATA (cbuf)->ret.retval = dstring_newstr ();
|
||||
}
|
||||
|
||||
void GIB_Buffer_Destruct (struct cbuf_s *cbuf)
|
||||
void
|
||||
GIB_Buffer_Destruct (struct cbuf_s *cbuf)
|
||||
{
|
||||
dstring_delete (GIB_DATA (cbuf)->arg_composite);
|
||||
dstring_delete (GIB_DATA (cbuf)->current_token);
|
||||
|
|
|
@ -51,9 +51,7 @@ static const char rcsid[] =
|
|||
|
||||
// Interpreter structure and prototypes
|
||||
|
||||
void GIB_Parse_Extract_Line (cbuf_t *cbuf);
|
||||
void GIB_Parse_Tokenize_Line (cbuf_t *cbuf);
|
||||
void GIB_Parse_Execute_Line (cbuf_t *cbuf);
|
||||
static void GIB_Parse_Execute_Line (cbuf_t *cbuf);
|
||||
|
||||
cbuf_interpreter_t gib_interp = {
|
||||
GIB_Parse_Extract_Line,
|
||||
|
@ -508,7 +506,8 @@ FILTER_ERROR:
|
|||
Assignment to a local/global variable
|
||||
Normal quake console commands
|
||||
*/
|
||||
void GIB_Parse_Execute_Line (cbuf_t *cbuf)
|
||||
static void
|
||||
GIB_Parse_Execute_Line (cbuf_t *cbuf)
|
||||
{
|
||||
cbuf_args_t *args = cbuf->args;
|
||||
gib_builtin_t *b;
|
||||
|
|
|
@ -48,8 +48,6 @@ static const char rcsid[] =
|
|||
|
||||
#include "exp.h"
|
||||
|
||||
int GIB_Process_Variables_All (struct dstring_s *token);
|
||||
|
||||
int
|
||||
GIB_Process_Index (dstring_t *index, unsigned int pos, int *i1, int *i2)
|
||||
{
|
||||
|
|
|
@ -21,105 +21,129 @@
|
|||
|
||||
#include <math.h>
|
||||
|
||||
double OP_Not (double op1, double op2)
|
||||
double
|
||||
OP_Not (double op1, double op2)
|
||||
{
|
||||
return !op1;
|
||||
}
|
||||
|
||||
double OP_Negate (double op1, double op2)
|
||||
double
|
||||
OP_Negate (double op1, double op2)
|
||||
{
|
||||
return -op1;
|
||||
}
|
||||
|
||||
double OP_Add (double op1, double op2)
|
||||
double
|
||||
OP_Add (double op1, double op2)
|
||||
{
|
||||
return op1 + op2;
|
||||
}
|
||||
|
||||
double OP_Sub (double op1, double op2)
|
||||
double
|
||||
OP_Sub (double op1, double op2)
|
||||
{
|
||||
return op1 - op2;
|
||||
}
|
||||
|
||||
double OP_Mult (double op1, double op2)
|
||||
double
|
||||
OP_Mult (double op1, double op2)
|
||||
{
|
||||
return op1 * op2;
|
||||
}
|
||||
|
||||
double OP_Div (double op1, double op2)
|
||||
double
|
||||
OP_Div (double op1, double op2)
|
||||
{
|
||||
return op1 / op2;
|
||||
}
|
||||
|
||||
double OP_Exp (double op1, double op2)
|
||||
double
|
||||
OP_Exp (double op1, double op2)
|
||||
{
|
||||
return pow(op1, op2);
|
||||
}
|
||||
|
||||
double OP_Eq (double op1, double op2)
|
||||
double
|
||||
OP_Eq (double op1, double op2)
|
||||
{
|
||||
return op1 == op2;
|
||||
}
|
||||
|
||||
double OP_Neq (double op1, double op2)
|
||||
double
|
||||
OP_Neq (double op1, double op2)
|
||||
{
|
||||
return op1 != op2;
|
||||
}
|
||||
|
||||
double OP_Or (double op1, double op2)
|
||||
double
|
||||
OP_Or (double op1, double op2)
|
||||
{
|
||||
return op1 || op2;
|
||||
}
|
||||
|
||||
double OP_And (double op1, double op2)
|
||||
double
|
||||
OP_And (double op1, double op2)
|
||||
{
|
||||
return op1 && op2;
|
||||
}
|
||||
double OP_GreaterThan (double op1, double op2)
|
||||
|
||||
double
|
||||
OP_GreaterThan (double op1, double op2)
|
||||
{
|
||||
return op1 > op2;
|
||||
}
|
||||
|
||||
double OP_LessThan (double op1, double op2)
|
||||
double
|
||||
OP_LessThan (double op1, double op2)
|
||||
{
|
||||
return op1 < op2;
|
||||
}
|
||||
double OP_GreaterThanEqual (double op1, double op2)
|
||||
|
||||
double
|
||||
OP_GreaterThanEqual (double op1, double op2)
|
||||
{
|
||||
return op1 >= op2;
|
||||
}
|
||||
double OP_LessThanEqual (double op1, double op2)
|
||||
|
||||
double
|
||||
OP_LessThanEqual (double op1, double op2)
|
||||
{
|
||||
return op1 <= op2;
|
||||
}
|
||||
|
||||
|
||||
double Func_Sin (double *oplist, unsigned int numops)
|
||||
double
|
||||
Func_Sin (double *oplist, unsigned int numops)
|
||||
{
|
||||
return sin (oplist[0]);
|
||||
}
|
||||
|
||||
double Func_Cos (double *oplist, unsigned int numops)
|
||||
double
|
||||
Func_Cos (double *oplist, unsigned int numops)
|
||||
{
|
||||
return cos (oplist[0]);
|
||||
}
|
||||
|
||||
double Func_Tan (double *oplist, unsigned int numops)
|
||||
double
|
||||
Func_Tan (double *oplist, unsigned int numops)
|
||||
{
|
||||
return tan (oplist[0]);
|
||||
}
|
||||
|
||||
double Func_Asin (double *oplist, unsigned int numops)
|
||||
double
|
||||
Func_Asin (double *oplist, unsigned int numops)
|
||||
{
|
||||
return asin (oplist[0]);
|
||||
}
|
||||
|
||||
double Func_Acos (double *oplist, unsigned int numops)
|
||||
double
|
||||
Func_Acos (double *oplist, unsigned int numops)
|
||||
{
|
||||
return acos (oplist[0]);
|
||||
}
|
||||
|
||||
double Func_Atan (double *oplist, unsigned int numops)
|
||||
double
|
||||
Func_Atan (double *oplist, unsigned int numops)
|
||||
{
|
||||
return atan (oplist[0]);
|
||||
}
|
||||
|
|
|
@ -47,9 +47,6 @@ int wad_numlumps;
|
|||
lumpinfo_t *wad_lumps;
|
||||
byte *wad_base;
|
||||
|
||||
void SwapPic (qpic_t *pic);
|
||||
|
||||
|
||||
/*
|
||||
W_CleanupName
|
||||
|
||||
|
|
|
@ -67,9 +67,6 @@ static const char rcsid[] =
|
|||
|
||||
#define MINFRAGMENT 64
|
||||
|
||||
void Cache_FreeLow (int new_low_hunk);
|
||||
void Cache_FreeHigh (int new_high_hunk);
|
||||
|
||||
/*
|
||||
ZONE MEMORY ALLOCATION
|
||||
|
||||
|
@ -316,9 +313,6 @@ int hunk_tempmark;
|
|||
|
||||
qboolean hunk_tempactive;
|
||||
|
||||
void R_FreeTextures (void);
|
||||
|
||||
|
||||
/*
|
||||
Hunk_Check
|
||||
|
||||
|
@ -564,14 +558,14 @@ typedef struct cache_system_s {
|
|||
struct cache_system_s *lru_prev, *lru_next; // for LRU flushing
|
||||
} cache_system_t;
|
||||
|
||||
cache_system_t *Cache_TryAlloc (int size, qboolean nobottom);
|
||||
void Cache_RealFree (cache_user_t *c);
|
||||
void *Cache_RealCheck (cache_user_t *c);
|
||||
void *Cache_RealAlloc (cache_user_t *c, int size, const char *name);
|
||||
cache_system_t cache_head;
|
||||
int cache_writelock;
|
||||
|
||||
void Cache_Profile (void);
|
||||
static void *Cache_RealCheck (cache_user_t *c);
|
||||
static cache_system_t *Cache_TryAlloc (int size, qboolean nobottom);
|
||||
static void Cache_RealFree (cache_user_t *c);
|
||||
static void Cache_Profile (void);
|
||||
static void *Cache_RealAlloc (cache_user_t *c, int size, const char *name);
|
||||
|
||||
#define CACHE_WRITE_LOCK { if (cache_writelock) \
|
||||
Sys_Error ("Cache double-locked!"); \
|
||||
|
@ -699,7 +693,7 @@ Cache_FreeLRU ()
|
|||
Looks for a free block of memory between the high and low hunk marks
|
||||
Size should already include the header and padding
|
||||
*/
|
||||
cache_system_t *
|
||||
static cache_system_t *
|
||||
Cache_TryAlloc (int size, qboolean nobottom)
|
||||
{
|
||||
#ifndef MMAPPED_CACHE
|
||||
|
@ -865,7 +859,7 @@ Cache_Free (cache_user_t *c)
|
|||
CACHE_WRITE_UNLOCK;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
Cache_RealFree (cache_user_t *c)
|
||||
{
|
||||
cache_system_t *cs;
|
||||
|
@ -891,7 +885,7 @@ Cache_RealFree (cache_user_t *c)
|
|||
#endif
|
||||
}
|
||||
|
||||
void *
|
||||
void *
|
||||
Cache_Check (cache_user_t *c)
|
||||
{
|
||||
void *mem;
|
||||
|
@ -902,7 +896,7 @@ Cache_Check (cache_user_t *c)
|
|||
return mem;
|
||||
}
|
||||
|
||||
void *
|
||||
static void *
|
||||
Cache_RealCheck (cache_user_t *c)
|
||||
{
|
||||
cache_system_t *cs;
|
||||
|
@ -930,7 +924,7 @@ Cache_Alloc (cache_user_t *c, int size, const char *name)
|
|||
return mem;
|
||||
}
|
||||
|
||||
void *
|
||||
static void *
|
||||
Cache_RealAlloc (cache_user_t *c, int size, const char *name)
|
||||
{
|
||||
cache_system_t *cs;
|
||||
|
@ -960,7 +954,7 @@ Cache_RealAlloc (cache_user_t *c, int size, const char *name)
|
|||
return Cache_RealCheck (c);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
Cache_Profile (void)
|
||||
{
|
||||
cache_system_t *cs;
|
||||
|
|
|
@ -53,7 +53,7 @@ float bubble_sintable[33], bubble_costable[33];
|
|||
|
||||
|
||||
void
|
||||
R_InitBubble ()
|
||||
R_InitBubble (void)
|
||||
{
|
||||
float a;
|
||||
float *bub_sin, *bub_cos;
|
||||
|
|
|
@ -101,10 +101,6 @@ int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
|||
vec3_t shadecolor; // Ender (Extend) Colormod
|
||||
float modelalpha; // Ender (Extend) Alpha
|
||||
|
||||
void R_MarkLeaves (void);
|
||||
void R_DrawAliasModel (entity_t *e);
|
||||
void R_DrawSpriteModel (entity_t *e);
|
||||
|
||||
|
||||
void
|
||||
glrmain_init (void)
|
||||
|
|
|
@ -62,10 +62,6 @@ static const char rcsid[] =
|
|||
|
||||
int r_init = 0;
|
||||
|
||||
qboolean VID_Is8bit (void);
|
||||
void R_InitBubble (void);
|
||||
|
||||
|
||||
/*
|
||||
R_Envmap_f
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ static const char rcsid[] =
|
|||
#include "QF/GL/funcs.h"
|
||||
#include "QF/GL/qf_lightmap.h"
|
||||
#include "QF/GL/qf_rmain.h"
|
||||
#include "QF/GL/qf_rsurf.h"
|
||||
#include "QF/GL/qf_sky.h"
|
||||
#include "QF/GL/qf_textures.h"
|
||||
#include "QF/GL/qf_vid.h"
|
||||
|
@ -90,8 +91,6 @@ extern qboolean lightmap_modified[MAX_LIGHTMAPS];
|
|||
extern glpoly_t *lightmap_polys[MAX_LIGHTMAPS];
|
||||
extern glRect_t lightmap_rectchange[MAX_LIGHTMAPS];
|
||||
|
||||
void EmitWaterPolys (msurface_t *fa);
|
||||
|
||||
|
||||
/*
|
||||
R_TextureAnimation
|
||||
|
|
|
@ -139,8 +139,6 @@ float scr_disabled_time;
|
|||
|
||||
qboolean block_drawing;
|
||||
|
||||
void SCR_ScreenShot_f (void);
|
||||
|
||||
/* CENTER PRINTING */
|
||||
|
||||
char scr_centerstring[1024];
|
||||
|
@ -347,22 +345,6 @@ SCR_SizeDown_f (void)
|
|||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
void
|
||||
SCR_Init (void)
|
||||
{
|
||||
// register our commands
|
||||
Cmd_AddCommand ("screenshot", SCR_ScreenShot_f, "Take a screenshot, "
|
||||
"saves as qfxxx.tga in the current directory");
|
||||
Cmd_AddCommand ("sizeup", SCR_SizeUp_f, "Increases the screen size");
|
||||
Cmd_AddCommand ("sizedown", SCR_SizeDown_f, "Decreases the screen size");
|
||||
|
||||
scr_ram = Draw_PicFromWad ("ram");
|
||||
scr_net = Draw_PicFromWad ("net");
|
||||
scr_turtle = Draw_PicFromWad ("turtle");
|
||||
|
||||
scr_initialized = true;
|
||||
}
|
||||
|
||||
void
|
||||
SCR_DrawRam (void)
|
||||
{
|
||||
|
@ -862,3 +844,19 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs)
|
|||
GL_FlushText ();
|
||||
qfglFlush ();
|
||||
}
|
||||
|
||||
void
|
||||
SCR_Init (void)
|
||||
{
|
||||
// register our commands
|
||||
Cmd_AddCommand ("screenshot", SCR_ScreenShot_f, "Take a screenshot, "
|
||||
"saves as qfxxx.tga in the current directory");
|
||||
Cmd_AddCommand ("sizeup", SCR_SizeUp_f, "Increases the screen size");
|
||||
Cmd_AddCommand ("sizedown", SCR_SizeDown_f, "Decreases the screen size");
|
||||
|
||||
scr_ram = Draw_PicFromWad ("ram");
|
||||
scr_net = Draw_PicFromWad ("net");
|
||||
scr_turtle = Draw_PicFromWad ("turtle");
|
||||
|
||||
scr_initialized = true;
|
||||
}
|
||||
|
|
|
@ -40,136 +40,6 @@ static const char rcsid[] =
|
|||
#include "QF/GL/defines.h"
|
||||
#include "QF/GL/funcs.h"
|
||||
|
||||
msurface_t *warpface;
|
||||
|
||||
|
||||
void
|
||||
BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
float *v;
|
||||
int i, j;
|
||||
|
||||
mins[0] = mins[1] = mins[2] = 9999;
|
||||
maxs[0] = maxs[1] = maxs[2] = -9999;
|
||||
v = verts;
|
||||
for (i = 0; i < numverts; i++)
|
||||
for (j = 0; j < 3; j++, v++) {
|
||||
if (*v < mins[j])
|
||||
mins[j] = *v;
|
||||
if (*v > maxs[j])
|
||||
maxs[j] = *v;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SubdividePolygon (int numverts, float *verts)
|
||||
{
|
||||
float frac, m, s, t;
|
||||
float dist[64];
|
||||
float *v;
|
||||
int b, f, i, j, k;
|
||||
glpoly_t *poly;
|
||||
vec3_t mins, maxs;
|
||||
vec3_t front[64], back[64];
|
||||
|
||||
if (numverts > 60)
|
||||
Sys_Error ("numverts = %i", numverts);
|
||||
|
||||
BoundPoly (numverts, verts, mins, maxs);
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
m = (mins[i] + maxs[i]) * 0.5;
|
||||
m = gl_subdivide_size->value * floor (m / gl_subdivide_size->value +
|
||||
0.5);
|
||||
if (maxs[i] - m < 8)
|
||||
continue;
|
||||
if (m - mins[i] < 8)
|
||||
continue;
|
||||
|
||||
// cut it
|
||||
v = verts + i;
|
||||
for (j = 0; j < numverts; j++, v += 3)
|
||||
dist[j] = *v - m;
|
||||
|
||||
// wrap cases
|
||||
dist[j] = dist[0];
|
||||
v -= i;
|
||||
VectorCopy (verts, v);
|
||||
|
||||
f = b = 0;
|
||||
v = verts;
|
||||
for (j = 0; j < numverts; j++, v += 3) {
|
||||
if (dist[j] >= 0) {
|
||||
VectorCopy (v, front[f]);
|
||||
f++;
|
||||
}
|
||||
if (dist[j] <= 0) {
|
||||
VectorCopy (v, back[b]);
|
||||
b++;
|
||||
}
|
||||
if (dist[j] == 0 || dist[j + 1] == 0)
|
||||
continue;
|
||||
if ((dist[j] > 0) != (dist[j + 1] > 0)) {
|
||||
// clip point
|
||||
frac = dist[j] / (dist[j] - dist[j + 1]);
|
||||
for (k = 0; k < 3; k++)
|
||||
front[f][k] = back[b][k] = v[k] + frac * (v[3 + k] - v[k]);
|
||||
f++;
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
SubdividePolygon (f, front[0]);
|
||||
SubdividePolygon (b, back[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
poly = Hunk_Alloc (sizeof (glpoly_t) + (numverts - 4) * VERTEXSIZE *
|
||||
sizeof (float));
|
||||
poly->next = warpface->polys;
|
||||
warpface->polys = poly;
|
||||
poly->numverts = numverts;
|
||||
for (i = 0; i < numverts; i++, verts += 3) {
|
||||
VectorCopy (verts, poly->verts[i]);
|
||||
s = DotProduct (verts, warpface->texinfo->vecs[0]);
|
||||
t = DotProduct (verts, warpface->texinfo->vecs[1]);
|
||||
poly->verts[i][3] = s;
|
||||
poly->verts[i][4] = t;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GL_SubdivideSurface
|
||||
|
||||
Breaks a polygon up along axial 64 unit
|
||||
boundaries so that turbulent and sky warps
|
||||
can be done reasonably.
|
||||
*/
|
||||
void
|
||||
GL_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
float *vec;
|
||||
int lindex, numverts, i;
|
||||
vec3_t verts[64];
|
||||
|
||||
warpface = fa;
|
||||
|
||||
// convert edges back to a normal polygon
|
||||
numverts = 0;
|
||||
for (i = 0; i < fa->numedges; i++) {
|
||||
lindex = loadmodel->surfedges[fa->firstedge + i];
|
||||
|
||||
if (lindex > 0)
|
||||
vec = loadmodel->vertexes[loadmodel->edges[lindex].v[0]].position;
|
||||
else
|
||||
vec = loadmodel->vertexes[loadmodel->edges[-lindex].v[1]].position;
|
||||
VectorCopy (vec, verts[numverts]);
|
||||
numverts++;
|
||||
}
|
||||
|
||||
SubdividePolygon (numverts, verts[0]);
|
||||
}
|
||||
|
||||
// speed up sin calculations - Ed
|
||||
float turbsin[] = {
|
||||
# include "gl_warp_sin.h"
|
||||
|
|
|
@ -42,7 +42,7 @@ static const char rcsid[] =
|
|||
#define DPS_MAXSPANS MAXHEIGHT+1 // +1 for spanpackage marking end
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct {
|
||||
typedef struct spanpackage_s {
|
||||
void *pdest;
|
||||
short *pz;
|
||||
int count;
|
||||
|
@ -118,15 +118,6 @@ byte *skintable[MAX_LBM_HEIGHT];
|
|||
int skinwidth;
|
||||
byte *skinstart;
|
||||
|
||||
void D_PolysetDrawSpans8 (spanpackage_t * pspanpackage);
|
||||
void D_PolysetCalcGradients (int skinwidth);
|
||||
void D_DrawSubdiv (void);
|
||||
void D_DrawNonSubdiv (void);
|
||||
void D_PolysetRecursiveTriangle (int *p1, int *p2, int *p3);
|
||||
void D_PolysetSetEdgeTable (void);
|
||||
void D_RasterizeAliasPolySmooth (void);
|
||||
void D_PolysetScanLeftEdge (int height);
|
||||
|
||||
#ifdef PIC
|
||||
#undef USE_INTEL_ASM //XXX asm pic hack
|
||||
#endif
|
||||
|
|
|
@ -42,9 +42,6 @@ fixed16_t r_turb_s, r_turb_t, r_turb_sstep, r_turb_tstep;
|
|||
int *r_turb_turb;
|
||||
int r_turb_spancount;
|
||||
|
||||
void D_DrawTurbulent8Span (void);
|
||||
|
||||
|
||||
/*
|
||||
D_WarpScreen
|
||||
|
||||
|
|
|
@ -133,8 +133,6 @@ qboolean scr_skipupdate;
|
|||
|
||||
qboolean block_drawing;
|
||||
|
||||
void SCR_ScreenShot_f (void);
|
||||
|
||||
/*
|
||||
CENTER PRINTING
|
||||
*/
|
||||
|
@ -399,23 +397,6 @@ SCR_SizeDown_f (void)
|
|||
|
||||
//============================================================================
|
||||
|
||||
void
|
||||
SCR_Init (void)
|
||||
{
|
||||
// register our commands
|
||||
Cmd_AddCommand ("screenshot", SCR_ScreenShot_f, "Take a screenshot and "
|
||||
"write it as qfxxx.tga in the current directory");
|
||||
Cmd_AddCommand ("sizeup", SCR_SizeUp_f, "Increase the size of the screen");
|
||||
Cmd_AddCommand ("sizedown", SCR_SizeDown_f, "Decrease the size of the "
|
||||
"screen");
|
||||
|
||||
scr_ram = Draw_PicFromWad ("ram");
|
||||
scr_net = Draw_PicFromWad ("net");
|
||||
scr_turtle = Draw_PicFromWad ("turtle");
|
||||
|
||||
scr_initialized = true;
|
||||
}
|
||||
|
||||
void
|
||||
SCR_DrawRam (void)
|
||||
{
|
||||
|
@ -907,3 +888,20 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs)
|
|||
VID_Update (&vrect);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SCR_Init (void)
|
||||
{
|
||||
// register our commands
|
||||
Cmd_AddCommand ("screenshot", SCR_ScreenShot_f, "Take a screenshot and "
|
||||
"write it as qfxxx.tga in the current directory");
|
||||
Cmd_AddCommand ("sizeup", SCR_SizeUp_f, "Increase the size of the screen");
|
||||
Cmd_AddCommand ("sizedown", SCR_SizeDown_f, "Decrease the size of the "
|
||||
"screen");
|
||||
|
||||
scr_ram = Draw_PicFromWad ("ram");
|
||||
scr_net = Draw_PicFromWad ("net");
|
||||
scr_turtle = Draw_PicFromWad ("turtle");
|
||||
|
||||
scr_initialized = true;
|
||||
}
|
||||
|
|
|
@ -39,17 +39,6 @@ static const char rcsid[] =
|
|||
static finalvert_t fv[2][8];
|
||||
static auxvert_t av[8];
|
||||
|
||||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
|
||||
|
||||
/*
|
||||
R_Alias_clip_z
|
||||
|
||||
|
|
|
@ -89,14 +89,6 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
|||
#include "anorms.h"
|
||||
};
|
||||
|
||||
void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv,
|
||||
stvert_t *pstverts);
|
||||
void R_AliasSetUpTransform (int trivial_accept);
|
||||
void R_AliasTransformVector (vec3_t in, vec3_t out);
|
||||
void R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
||||
trivertx_t *pverts, stvert_t *pstverts);
|
||||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
|
||||
qboolean
|
||||
R_AliasCheckBBox (void)
|
||||
{
|
||||
|
|
|
@ -79,13 +79,6 @@ edge_t edge_sentinel;
|
|||
|
||||
float fv;
|
||||
|
||||
void R_GenerateSpans (void);
|
||||
void R_GenerateSpansBackward (void);
|
||||
void R_LeadingEdge (edge_t *edge);
|
||||
void R_LeadingEdgeBackwards (edge_t *edge);
|
||||
void R_TrailingEdge (surf_t *surf, edge_t *edge);
|
||||
|
||||
|
||||
void
|
||||
R_DrawCulledPolys (void)
|
||||
{
|
||||
|
|
|
@ -138,11 +138,6 @@ int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
|||
float dp_time1, dp_time2, db_time1, db_time2, rw_time1, rw_time2;
|
||||
float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
|
||||
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
void R_LoadSky_f (void);
|
||||
void R_InitVars (void);
|
||||
|
||||
void
|
||||
R_Init (void)
|
||||
{
|
||||
|
|
|
@ -51,11 +51,6 @@ int r_lightwidth;
|
|||
int r_numhblocks, r_numvblocks;
|
||||
unsigned char *r_source, *r_sourcemax;
|
||||
|
||||
void R_DrawSurfaceBlock_mip0 (void);
|
||||
void R_DrawSurfaceBlock_mip1 (void);
|
||||
void R_DrawSurfaceBlock_mip2 (void);
|
||||
void R_DrawSurfaceBlock_mip3 (void);
|
||||
|
||||
static void (*surfmiptable[4]) (void) = {
|
||||
R_DrawSurfaceBlock_mip0, R_DrawSurfaceBlock_mip1,
|
||||
R_DrawSurfaceBlock_mip2, R_DrawSurfaceBlock_mip3};
|
||||
|
|
|
@ -115,26 +115,53 @@ static adivtab_t adivtab[32 * 32] = {
|
|||
#include "adivtab.h"
|
||||
};
|
||||
|
||||
void D_PolysetDrawSpans (spanpackage_t * pspanpackage);
|
||||
void D_PolysetCalcGradients (int skinwidth);
|
||||
void D_DrawNonSubdiv (void);
|
||||
void D_PolysetSetEdgeTable (void);
|
||||
void D_RasterizeAliasPolySmooth (void);
|
||||
void D_PolysetScanLeftEdge (int height);
|
||||
|
||||
|
||||
void
|
||||
D_PolysetDraw (void)
|
||||
D_PolysetSetEdgeTable (void)
|
||||
{
|
||||
spanpackage_t spans[DPS_MAXSPANS + 1 +
|
||||
((CACHE_SIZE - 1) / sizeof (spanpackage_t)) + 1];
|
||||
int edgetableindex;
|
||||
|
||||
// one extra because of cache line pretouching
|
||||
// assume the vertices are already in top to bottom order
|
||||
edgetableindex = 0;
|
||||
|
||||
a_spans = (spanpackage_t *)
|
||||
(((long) &spans[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
// determine which edges are right & left, and the order in which
|
||||
// to rasterize them
|
||||
if (r_p0[1] >= r_p1[1]) {
|
||||
if (r_p0[1] == r_p1[1]) {
|
||||
if (r_p0[1] < r_p2[1])
|
||||
pedgetable = &edgetables[2];
|
||||
else
|
||||
pedgetable = &edgetables[5];
|
||||
|
||||
D_DrawNonSubdiv ();
|
||||
return;
|
||||
} else {
|
||||
edgetableindex = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (r_p0[1] == r_p2[1]) {
|
||||
if (edgetableindex)
|
||||
pedgetable = &edgetables[8];
|
||||
else
|
||||
pedgetable = &edgetables[9];
|
||||
|
||||
return;
|
||||
} else if (r_p1[1] == r_p2[1]) {
|
||||
if (edgetableindex)
|
||||
pedgetable = &edgetables[10];
|
||||
else
|
||||
pedgetable = &edgetables[11];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (r_p0[1] > r_p2[1])
|
||||
edgetableindex += 2;
|
||||
|
||||
if (r_p1[1] > r_p2[1])
|
||||
edgetableindex += 4;
|
||||
|
||||
pedgetable = &edgetables[edgetableindex];
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -196,6 +223,20 @@ D_DrawNonSubdiv (void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
D_PolysetDraw (void)
|
||||
{
|
||||
spanpackage_t spans[DPS_MAXSPANS + 1 +
|
||||
((CACHE_SIZE - 1) / sizeof (spanpackage_t)) + 1];
|
||||
|
||||
// one extra because of cache line pretouching
|
||||
|
||||
a_spans = (spanpackage_t *)
|
||||
(((long) &spans[0] + CACHE_SIZE - 1) & ~(CACHE_SIZE - 1));
|
||||
|
||||
D_DrawNonSubdiv ();
|
||||
}
|
||||
|
||||
void
|
||||
D_PolysetScanLeftEdge (int height)
|
||||
{
|
||||
|
@ -756,52 +797,3 @@ D_RasterizeAliasPolySmooth (void)
|
|||
D_PolysetDrawSpans (pstart);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
D_PolysetSetEdgeTable (void)
|
||||
{
|
||||
int edgetableindex;
|
||||
|
||||
// assume the vertices are already in top to bottom order
|
||||
edgetableindex = 0;
|
||||
|
||||
// determine which edges are right & left, and the order in which
|
||||
// to rasterize them
|
||||
if (r_p0[1] >= r_p1[1]) {
|
||||
if (r_p0[1] == r_p1[1]) {
|
||||
if (r_p0[1] < r_p2[1])
|
||||
pedgetable = &edgetables[2];
|
||||
else
|
||||
pedgetable = &edgetables[5];
|
||||
|
||||
return;
|
||||
} else {
|
||||
edgetableindex = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (r_p0[1] == r_p2[1]) {
|
||||
if (edgetableindex)
|
||||
pedgetable = &edgetables[8];
|
||||
else
|
||||
pedgetable = &edgetables[9];
|
||||
|
||||
return;
|
||||
} else if (r_p1[1] == r_p2[1]) {
|
||||
if (edgetableindex)
|
||||
pedgetable = &edgetables[10];
|
||||
else
|
||||
pedgetable = &edgetables[11];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (r_p0[1] > r_p2[1])
|
||||
edgetableindex += 2;
|
||||
|
||||
if (r_p1[1] > r_p2[1])
|
||||
edgetableindex += 4;
|
||||
|
||||
pedgetable = &edgetables[edgetableindex];
|
||||
}
|
||||
|
|
|
@ -45,10 +45,6 @@ fixed16_t r_turb_s, r_turb_t, r_turb_sstep, r_turb_tstep;
|
|||
int *r_turb_turb;
|
||||
int r_turb_spancount;
|
||||
|
||||
void D_DrawTurbulentSpan (void);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
D_WarpScreen
|
||||
|
||||
|
|
|
@ -133,8 +133,6 @@ qboolean scr_skipupdate;
|
|||
|
||||
qboolean block_drawing;
|
||||
|
||||
void SCR_ScreenShot_f (void);
|
||||
|
||||
/*
|
||||
CENTER PRINTING
|
||||
*/
|
||||
|
@ -466,23 +464,6 @@ SCR_SizeDown_f (void)
|
|||
|
||||
//============================================================================
|
||||
|
||||
void
|
||||
SCR_Init (void)
|
||||
{
|
||||
// register our commands
|
||||
Cmd_AddCommand ("screenshot", SCR_ScreenShot_f, "Take a screenshot and "
|
||||
"write it as qfxxx.tga in the current directory");
|
||||
Cmd_AddCommand ("sizeup", SCR_SizeUp_f, "Increase the size of the screen");
|
||||
Cmd_AddCommand ("sizedown", SCR_SizeDown_f, "Decrease the size of the "
|
||||
"screen");
|
||||
|
||||
scr_ram = Draw_PicFromWad ("ram");
|
||||
scr_net = Draw_PicFromWad ("net");
|
||||
scr_turtle = Draw_PicFromWad ("turtle");
|
||||
|
||||
scr_initialized = true;
|
||||
}
|
||||
|
||||
void
|
||||
SCR_DrawRam (void)
|
||||
{
|
||||
|
@ -925,3 +906,20 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs)
|
|||
VID_Update (&vrect);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SCR_Init (void)
|
||||
{
|
||||
// register our commands
|
||||
Cmd_AddCommand ("screenshot", SCR_ScreenShot_f, "Take a screenshot and "
|
||||
"write it as qfxxx.tga in the current directory");
|
||||
Cmd_AddCommand ("sizeup", SCR_SizeUp_f, "Increase the size of the screen");
|
||||
Cmd_AddCommand ("sizedown", SCR_SizeDown_f, "Decrease the size of the "
|
||||
"screen");
|
||||
|
||||
scr_ram = Draw_PicFromWad ("ram");
|
||||
scr_net = Draw_PicFromWad ("net");
|
||||
scr_turtle = Draw_PicFromWad ("turtle");
|
||||
|
||||
scr_initialized = true;
|
||||
}
|
||||
|
|
|
@ -39,17 +39,6 @@ static const char rcsid[] =
|
|||
static finalvert_t fv[2][8];
|
||||
static auxvert_t av[8];
|
||||
|
||||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
finalvert_t *out);
|
||||
|
||||
|
||||
/*
|
||||
R_Alias_clip_z
|
||||
|
||||
|
|
|
@ -89,15 +89,6 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
|||
#include "anorms.h"
|
||||
};
|
||||
|
||||
void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv,
|
||||
stvert_t *pstverts);
|
||||
void R_AliasSetUpTransform (int trivial_accept);
|
||||
void R_AliasTransformVector (vec3_t in, vec3_t out);
|
||||
void R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
||||
trivertx_t *pverts, stvert_t *pstverts);
|
||||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
|
||||
|
||||
qboolean
|
||||
R_AliasCheckBBox (void)
|
||||
{
|
||||
|
|
|
@ -79,13 +79,6 @@ edge_t edge_sentinel;
|
|||
|
||||
float fv;
|
||||
|
||||
void R_GenerateSpans (void);
|
||||
void R_GenerateSpansBackward (void);
|
||||
void R_LeadingEdge (edge_t *edge);
|
||||
void R_LeadingEdgeBackwards (edge_t *edge);
|
||||
void R_TrailingEdge (surf_t *surf, edge_t *edge);
|
||||
|
||||
|
||||
void
|
||||
R_DrawCulledPolys (void)
|
||||
{
|
||||
|
|
|
@ -135,11 +135,6 @@ int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
|||
float dp_time1, dp_time2, db_time1, db_time2, rw_time1, rw_time2;
|
||||
float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
|
||||
|
||||
void R_LoadSky_f (void);
|
||||
void R_MarkLeaves (void);
|
||||
void CreatePassages (void);
|
||||
void SetVisibilityByPassages (void);
|
||||
|
||||
cvar_t *r_draworder;
|
||||
|
||||
|
||||
|
|
|
@ -52,19 +52,6 @@ int r_lightwidth;
|
|||
int r_numhblocks, r_numvblocks;
|
||||
byte *r_source, *r_sourcemax;
|
||||
|
||||
void R_DrawSurfaceBlock8_mip0 (void);
|
||||
void R_DrawSurfaceBlock8_mip1 (void);
|
||||
void R_DrawSurfaceBlock8_mip2 (void);
|
||||
void R_DrawSurfaceBlock8_mip3 (void);
|
||||
void R_DrawSurfaceBlock16_mip0 (void);
|
||||
void R_DrawSurfaceBlock16_mip1 (void);
|
||||
void R_DrawSurfaceBlock16_mip2 (void);
|
||||
void R_DrawSurfaceBlock16_mip3 (void);
|
||||
void R_DrawSurfaceBlock32_mip0 (void);
|
||||
void R_DrawSurfaceBlock32_mip1 (void);
|
||||
void R_DrawSurfaceBlock32_mip2 (void);
|
||||
void R_DrawSurfaceBlock32_mip3 (void);
|
||||
|
||||
static void (*surfmiptable8[4]) (void) = {
|
||||
R_DrawSurfaceBlock8_mip0,
|
||||
R_DrawSurfaceBlock8_mip1,
|
||||
|
|
|
@ -189,24 +189,18 @@ struct VideoMode Current;
|
|||
|
||||
/* Function Prototypes */
|
||||
|
||||
int OpenFrameBuffer(const char *name);
|
||||
void CloseFrameBuffer(int fh);
|
||||
int GetVarScreenInfo(int fh, struct fb_var_screeninfo *var);
|
||||
int SetVarScreenInfo(int fh, struct fb_var_screeninfo *var);
|
||||
int GetFixScreenInfo(int fh, struct fb_fix_screeninfo *fix);
|
||||
void ConvertFromVideoMode(const struct VideoMode *vmode,
|
||||
struct fb_var_screeninfo *var);
|
||||
void ConvertToVideoMode(const struct fb_var_screeninfo *var,
|
||||
struct VideoMode *vmode);
|
||||
static int OpenFrameBuffer(const char *name);
|
||||
static void CloseFrameBuffer(int fh);
|
||||
static int GetVarScreenInfo(int fh, struct fb_var_screeninfo *var);
|
||||
static int SetVarScreenInfo(int fh, struct fb_var_screeninfo *var);
|
||||
static int GetFixScreenInfo(int fh, struct fb_fix_screeninfo *fix);
|
||||
static int atoboolean(const char *var);
|
||||
void ReadModeDB(void);
|
||||
struct VideoMode *FindVideoMode(const char *name);
|
||||
static void ModifyVideoMode(struct VideoMode *vmode);
|
||||
static void DisplayVModeInfo(struct VideoMode *vmode);
|
||||
static void DisplayFBInfo(struct fb_fix_screeninfo *fix);
|
||||
static int FillScanRates(struct VideoMode *vmode);
|
||||
static void Usage(void);
|
||||
int main(int argc, char *argv[]);
|
||||
|
||||
|
||||
#define Die Sys_Printf
|
||||
|
|
|
@ -58,8 +58,6 @@ HRESULT (WINAPI * pDirectInputCreate) (HINSTANCE hinst, DWORD dwVersion,
|
|||
LPDIRECTINPUT * lplpDirectInput,
|
||||
LPUNKNOWN punkOuter);
|
||||
|
||||
void VID_UpdateWindowStatus (int window_x, int window_y);
|
||||
|
||||
extern qboolean win_canalttab;
|
||||
extern DEVMODE win_gdevmode;
|
||||
|
||||
|
|
|
@ -112,11 +112,6 @@ int joy_id;
|
|||
DWORD joy_flags;
|
||||
DWORD joy_numbuttons;
|
||||
|
||||
void JOY_AdvancedUpdate_f (void);
|
||||
int JOY_StartupJoystick (void);
|
||||
PDWORD RawValuePointer (int axis);
|
||||
|
||||
|
||||
qboolean
|
||||
_JOY_Read (void)
|
||||
{
|
||||
|
|
|
@ -73,11 +73,6 @@ static const char rcsid[] =
|
|||
|
||||
typedef struct tfxMesaContext *fxMesaContext;
|
||||
|
||||
typedef long FxI32;
|
||||
typedef FxI32 GrScreenResolution_t;
|
||||
typedef FxI32 GrDitherMode_t;
|
||||
typedef FxI32 GrScreenRefresh_t;
|
||||
|
||||
#define GR_REFRESH_75Hz 0x3
|
||||
|
||||
#define GR_DITHER_2x2 0x1
|
||||
|
@ -101,9 +96,6 @@ void (* qf_fxMesaSwapBuffers) (void);
|
|||
fxMesaContext (* qf_fxMesaCreateContext) (GLuint win, GrScreenResolution_t, GrScreenRefresh_t, const GLint attribList[]);
|
||||
void (* qf_fxMesaMakeCurrent) (fxMesaContext ctx);
|
||||
|
||||
// FIXME!!!!! This belongs in include/qfgl_ext.h -- deek
|
||||
typedef void (GLAPIENTRY * QF_3DfxSetDitherModeEXT) (GrDitherMode_t mode);
|
||||
|
||||
static fxMesaContext fc = NULL;
|
||||
|
||||
int VID_options_items = 0;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
vid_ext.c
|
||||
|
||||
|
@ -134,12 +133,6 @@ static int totalvidmem;
|
|||
static byte *ppal;
|
||||
qboolean vsync_exists, de_exists;
|
||||
|
||||
qboolean VID_ExtraGetModeInfo (int modenum);
|
||||
int VID_ExtraInitMode (viddef_t *vid, vmode_t * pcurrentmode);
|
||||
void VID_ExtraSwapBuffers (viddef_t *vid, vmode_t * pcurrentmode,
|
||||
|
||||
vrect_t *rects);
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
|
|
|
@ -75,15 +75,6 @@ static const char rcsid[] =
|
|||
|
||||
#include "fbset.h"
|
||||
|
||||
void ConvertFromVideoMode(const struct VideoMode *vmode,
|
||||
struct fb_var_screeninfo *var);
|
||||
void ConvertToVideoMode(const struct fb_var_screeninfo *var,
|
||||
struct VideoMode *vmode);
|
||||
struct VideoMode *FindVideoMode(const char *name);
|
||||
extern struct VideoMode *VideoModes;
|
||||
int fbset_main (int argc, const char *argv[]);
|
||||
void ReadModeDB (void);
|
||||
|
||||
static struct VideoMode current_mode;
|
||||
static char current_name[32];
|
||||
static int num_modes;
|
||||
|
@ -204,9 +195,6 @@ VID_NumModes_f (void)
|
|||
Con_Printf ("%d modes\n", VID_NumModes ());
|
||||
}
|
||||
|
||||
int VID_SetMode (const char *name, unsigned char *palette);
|
||||
|
||||
|
||||
static void
|
||||
VID_fbset_f (void)
|
||||
{
|
||||
|
|
|
@ -63,9 +63,6 @@ static const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
|
||||
void VGA_UpdatePlanarScreen (void *srcbuffer);
|
||||
|
||||
|
||||
static int num_modes, current_mode;
|
||||
static vga_modeinfo *modes;
|
||||
|
||||
|
|
|
@ -82,9 +82,6 @@ static const char rcsid[] =
|
|||
static Colormap x_cmap;
|
||||
static GC x_gc;
|
||||
|
||||
int XShmQueryExtension (Display *);
|
||||
int XShmGetEventBase (Display *);
|
||||
|
||||
static qboolean doShm;
|
||||
static XShmSegmentInfo x_shminfo[2];
|
||||
|
||||
|
|
|
@ -322,6 +322,7 @@ int CL_ReadFromServer (void);
|
|||
void CL_WriteToServer (usercmd_t *cmd);
|
||||
void CL_BaseMove (usercmd_t *cmd);
|
||||
|
||||
float CL_KeyState (kbutton_t *key);
|
||||
|
||||
// cl_demo.c
|
||||
void CL_StopPlayback (void);
|
||||
|
|
|
@ -40,9 +40,6 @@ static const char rcsid[] =
|
|||
#include "QF/keys.h"
|
||||
#include "QF/input.h"
|
||||
|
||||
float CL_KeyState (kbutton_t *key);
|
||||
qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
|
||||
vec3_t p1, vec3_t p2, trace_t *trace);
|
||||
|
||||
vec3_t camera_origin = {0,0,0};
|
||||
vec3_t camera_angles = {0,0,0};
|
||||
|
|
|
@ -54,7 +54,7 @@ static const char rcsid[] =
|
|||
char demoname[1024];
|
||||
int timedemo_count;
|
||||
|
||||
void CL_FinishTimeDemo (void);
|
||||
static void CL_FinishTimeDemo (void);
|
||||
|
||||
cvar_t *demo_gzip;
|
||||
cvar_t *demo_speed;
|
||||
|
@ -360,7 +360,7 @@ CL_StartTimeDemo (void)
|
|||
cls.td_lastframe = -1; // get a new message this frame
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
CL_FinishTimeDemo (void)
|
||||
{
|
||||
int frames;
|
||||
|
|
|
@ -218,7 +218,8 @@ CL_KeepaliveMessage (void)
|
|||
SZ_Clear (&cls.message);
|
||||
}
|
||||
|
||||
void CL_NewMap (const char *mapname)
|
||||
void
|
||||
CL_NewMap (const char *mapname)
|
||||
{
|
||||
char *name = malloc (strlen (mapname) + 4 + 1);
|
||||
|
||||
|
|
|
@ -38,8 +38,7 @@ static const char rcsid[] =
|
|||
#include "QF/quakefs.h"
|
||||
|
||||
#include "game.h"
|
||||
|
||||
void Cvar_Info (struct cvar_s *var);
|
||||
#include "server.h"
|
||||
|
||||
cvar_t *registered;
|
||||
cvar_t *cmdline;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
conproc.c
|
||||
|
||||
|
|
|
@ -52,9 +52,6 @@ static const char rcsid[] =
|
|||
|
||||
int current_skill;
|
||||
|
||||
void Mod_Print (void);
|
||||
|
||||
|
||||
void
|
||||
Host_Quit_f (void)
|
||||
{
|
||||
|
|
|
@ -59,8 +59,6 @@ int locations_alloced = 0;
|
|||
int locations_count = 0;
|
||||
int location_blocks = 0;
|
||||
|
||||
void locs_more (void);
|
||||
|
||||
int
|
||||
locs_nearest (const vec3_t loc)
|
||||
{
|
||||
|
@ -89,6 +87,24 @@ locs_find (const vec3_t target)
|
|||
return locations[i];
|
||||
}
|
||||
|
||||
void
|
||||
locs_more (void)
|
||||
{
|
||||
size_t size;
|
||||
|
||||
location_blocks++;
|
||||
locations_alloced += LOCATION_BLOCK;
|
||||
size = (sizeof (location_t *) * LOCATION_BLOCK * location_blocks);
|
||||
|
||||
if (locations)
|
||||
locations = realloc (locations, size);
|
||||
else
|
||||
locations = malloc (size);
|
||||
|
||||
if (!locations)
|
||||
Sys_Error ("ERROR! Can not alloc memory for location block!");
|
||||
}
|
||||
|
||||
void
|
||||
locs_add (const vec3_t location, const char *name)
|
||||
{
|
||||
|
@ -174,24 +190,6 @@ locs_reset (void)
|
|||
locations = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
locs_more (void)
|
||||
{
|
||||
size_t size;
|
||||
|
||||
location_blocks++;
|
||||
locations_alloced += LOCATION_BLOCK;
|
||||
size = (sizeof (location_t *) * LOCATION_BLOCK * location_blocks);
|
||||
|
||||
if (locations)
|
||||
locations = realloc (locations, size);
|
||||
else
|
||||
locations = malloc (size);
|
||||
|
||||
if (!locations)
|
||||
Sys_Error ("ERROR! Can not alloc memory for location block!");
|
||||
}
|
||||
|
||||
void
|
||||
locs_save (const char *filename, qboolean gz)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
mplib.c
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
mplpc.c
|
||||
|
||||
|
|
|
@ -90,10 +90,6 @@ qpic_t *hsb_items[2]; // MED 01/04/97 added hipnotic items array
|
|||
qboolean headsup;
|
||||
qboolean sbar_centered;
|
||||
|
||||
void Sbar_MiniDeathmatchOverlay (void);
|
||||
void Sbar_DeathmatchOverlay (void);
|
||||
|
||||
|
||||
int
|
||||
Sbar_ColorForMap (int m)
|
||||
{
|
||||
|
@ -392,7 +388,7 @@ Sbar_DrawScoreboard (void)
|
|||
{
|
||||
Sbar_SoloScoreboard ();
|
||||
if (cl.gametype == GAME_DEATHMATCH)
|
||||
Sbar_DeathmatchOverlay ();
|
||||
Sbar_DeathmatchOverlay (0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -905,7 +901,7 @@ Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
|
|||
|
||||
|
||||
void
|
||||
Sbar_DeathmatchOverlay (void)
|
||||
Sbar_DeathmatchOverlay (int start)
|
||||
{
|
||||
qpic_t *pic;
|
||||
int i, k, l;
|
||||
|
@ -1045,7 +1041,7 @@ Sbar_IntermissionOverlay (void)
|
|||
scr_fullupdate = 0;
|
||||
|
||||
if (cl.gametype == GAME_DEATHMATCH) {
|
||||
Sbar_DeathmatchOverlay ();
|
||||
Sbar_DeathmatchOverlay (0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,16 +37,13 @@ static const char rcsid[] =
|
|||
|
||||
int mod_lightmap_bytes = 1;
|
||||
|
||||
void Mod_LoadBrushModel (model_t *mod, void *buffer);
|
||||
|
||||
|
||||
void
|
||||
Mod_LoadLighting (lump_t *l)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Mod_LoadAliasModel (model_t *mod, void *buf)
|
||||
Mod_LoadAliasModel (model_t *mod, void *buf, cache_allocator_t allocator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -76,6 +73,6 @@ Mod_LoadExternalTextures (model_t *mod)
|
|||
}
|
||||
|
||||
void
|
||||
GL_SubdivideSurface (msurface_t *fa)
|
||||
Mod_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ int CL_ReadFromServer (void);
|
|||
void CL_WriteToServer (usercmd_t *cmd);
|
||||
void CL_BaseMove (usercmd_t *cmd);
|
||||
|
||||
float CL_KeyState (kbutton_t *key);
|
||||
|
||||
extern kbutton_t in_left, in_right, in_forward, in_back;
|
||||
extern kbutton_t in_lookup, in_lookdown, in_moveleft, in_moveright;
|
||||
extern kbutton_t in_use, in_jump, in_attack;
|
||||
|
|
|
@ -364,6 +364,8 @@ void V_PrepBlend (void);
|
|||
void CL_Cmd_ForwardToServer (void);
|
||||
void CL_Cmd_Init (void);
|
||||
|
||||
void CL_RSShot_f (void);
|
||||
|
||||
#define RSSHOT_WIDTH 320
|
||||
#define RSSHOT_HEIGHT 200
|
||||
|
||||
|
|
|
@ -137,6 +137,8 @@ int Net_Log_Init (const char **sound_precache);
|
|||
void Log_Incoming_Packet (const char *p, int len);
|
||||
void Log_Outgoing_Packet (const char *p, int len);
|
||||
void Net_LogStop (void);
|
||||
void Analyze_Client_Packet (const byte * data, int len);
|
||||
void Analyze_Server_Packet (const byte * data, int len);
|
||||
|
||||
extern struct cvar_s *net_packetlog;
|
||||
|
||||
|
|
|
@ -114,6 +114,10 @@ extern int watertype;
|
|||
extern vec3_t player_mins;
|
||||
extern vec3_t player_maxs;
|
||||
|
||||
void PM_Accelerate (vec3_t wishdir, float wishspeed, float accel);
|
||||
void PM_CategorizePosition (void);
|
||||
void PM_InitBoxHull (void);
|
||||
|
||||
void PlayerMove (void);
|
||||
void Pmove_Init (void);
|
||||
void Pmove_Init_Cvars (void);
|
||||
|
|
|
@ -458,6 +458,7 @@ void SV_FinalMessage (const char *message);
|
|||
void SV_DropClient (client_t *drop);
|
||||
int SV_CalcPing (client_t *cl);
|
||||
void SV_FullClientUpdate (client_t *client, sizebuf_t *buf);
|
||||
void SV_FullClientUpdateToClient (client_t *client, client_t *cl);
|
||||
|
||||
int SV_ModelIndex (const char *name);
|
||||
|
||||
|
|
|
@ -127,5 +127,6 @@ void SV_Stop (int reason);
|
|||
void DemoSetMsgBuf (demobuf_t * prev, demobuf_t * cur);
|
||||
void Demo_Init (void);
|
||||
void SV_DemoPings (void);
|
||||
void SV_WriteDemoMessage (sizebuf_t *msg, int type, int to, float time);
|
||||
|
||||
#endif//__sv_demo_h
|
||||
|
|
|
@ -68,8 +68,6 @@ static const char rcsid[] =
|
|||
#include "QF/mathlib.h"
|
||||
#include "world.h"
|
||||
|
||||
float CL_KeyState (kbutton_t *key);
|
||||
|
||||
vec3_t camera_origin = {0,0,0};
|
||||
vec3_t camera_angles = {0,0,0};
|
||||
vec3_t player_origin = {0,0,0};
|
||||
|
|
|
@ -78,9 +78,9 @@ int timedemo_runs;
|
|||
td_stats_t *timedemo_data;
|
||||
|
||||
|
||||
void CL_FinishTimeDemo (void);
|
||||
void CL_TimeFrames_Reset (void);
|
||||
void CL_TimeFrames_DumpLog (void);
|
||||
static void CL_FinishTimeDemo (void);
|
||||
static void CL_TimeFrames_Reset (void);
|
||||
static void CL_TimeFrames_DumpLog (void);
|
||||
|
||||
cvar_t *demo_speed;
|
||||
cvar_t *demo_gzip;
|
||||
|
@ -945,7 +945,7 @@ sqr (double x)
|
|||
return x * x;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
CL_FinishTimeDemo (void)
|
||||
{
|
||||
float time;
|
||||
|
@ -1042,7 +1042,7 @@ CL_Demo_Init (void)
|
|||
"< 1 slow-mo, > 1 timelapse");
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
CL_TimeFrames_Reset (void)
|
||||
{
|
||||
cl_timeframes_index = 0;
|
||||
|
@ -1067,7 +1067,8 @@ CL_TimeFrames_AddTimestamp (void)
|
|||
return;
|
||||
}
|
||||
|
||||
void CL_TimeFrames_DumpLog (void)
|
||||
static void
|
||||
CL_TimeFrames_DumpLog (void)
|
||||
{
|
||||
char e_path[MAX_OSPATH];
|
||||
char *filename = "timeframes.txt";
|
||||
|
|
|
@ -112,8 +112,6 @@ static plugin_list_t client_plugin_list[] = {
|
|||
CLIENT_PLUGIN_LIST
|
||||
};
|
||||
|
||||
void CL_RemoveQFInfoKeys ();
|
||||
|
||||
// we need to declare some mouse variables here, because the menu system
|
||||
// references them even when on a unix system.
|
||||
|
||||
|
@ -217,8 +215,6 @@ int fps_count;
|
|||
|
||||
jmp_buf host_abort;
|
||||
|
||||
void Master_Connect_f (void);
|
||||
|
||||
char *server_version = NULL; // version of server we connected to
|
||||
|
||||
char emodel_name[] = "emodel";
|
||||
|
@ -227,8 +223,6 @@ char prespawn_name[] = "prespawn %i 0 %i";
|
|||
char modellist_name[] = "modellist %i %i";
|
||||
char soundlist_name[] = "soundlist %i %i";
|
||||
|
||||
void CL_RSShot_f (void);
|
||||
|
||||
extern cvar_t *cl_showscoresuid;
|
||||
|
||||
|
||||
|
@ -442,6 +436,14 @@ CL_StopCshifts (void)
|
|||
cl.stats[i] = 0;
|
||||
}
|
||||
|
||||
void
|
||||
CL_RemoveQFInfoKeys (void)
|
||||
{
|
||||
Info_RemoveKey (cls.userinfo, "*cap");
|
||||
Info_RemoveKey (cls.userinfo, "*qf_version");
|
||||
Info_RemoveKey (cls.userinfo, "*qsg_version");
|
||||
}
|
||||
|
||||
/*
|
||||
CL_Disconnect
|
||||
|
||||
|
@ -658,14 +660,6 @@ CL_AddQFInfoKeys (void)
|
|||
Info_SetValueForStarKey (cls.userinfo, "*qsg_version", QW_QSG_VERSION, 0);
|
||||
}
|
||||
|
||||
void
|
||||
CL_RemoveQFInfoKeys (void)
|
||||
{
|
||||
Info_RemoveKey (cls.userinfo, "*cap");
|
||||
Info_RemoveKey (cls.userinfo, "*qf_version");
|
||||
Info_RemoveKey (cls.userinfo, "*qsg_version");
|
||||
}
|
||||
|
||||
/*
|
||||
CL_FullInfo_f
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ static const char rcsid[] =
|
|||
#include "QF/cmd.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/draw.h"
|
||||
#include "QF/hash.h"
|
||||
#include "QF/msg.h"
|
||||
#include "QF/quakeio.h"
|
||||
|
@ -252,7 +253,8 @@ CL_CheckOrDownloadFile (const char *filename)
|
|||
return false;
|
||||
}
|
||||
|
||||
void CL_NewMap (const char *mapname)
|
||||
void
|
||||
CL_NewMap (const char *mapname)
|
||||
{
|
||||
char *name = malloc (strlen (mapname) + 4 + 1);
|
||||
|
||||
|
@ -611,8 +613,21 @@ CL_StopUpload (void)
|
|||
|
||||
// SERVER CONNECTING MESSAGES =================================================
|
||||
|
||||
void Draw_ClearCache (void);
|
||||
void CL_ClearBaselines (void); // LordHavoc: BIG BUG-FIX!
|
||||
// LordHavoc: BIG BUG-FIX! Clear baselines each time it connects...
|
||||
void
|
||||
CL_ClearBaselines (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
memset (cl_baselines, 0, sizeof (cl_baselines));
|
||||
for (i = 0; i < MAX_EDICTS; i++) {
|
||||
cl_baselines[i].colormod = 255;
|
||||
cl_baselines[i].alpha = 255;
|
||||
cl_baselines[i].scale = 16;
|
||||
cl_baselines[i].glow_size = 0;
|
||||
cl_baselines[i].glow_color = 254;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CL_ParseServerData (void)
|
||||
|
@ -718,22 +733,6 @@ CL_ParseServerData (void)
|
|||
CL_ClearBaselines ();
|
||||
}
|
||||
|
||||
// LordHavoc: BIG BUG-FIX! Clear baselines each time it connects...
|
||||
void
|
||||
CL_ClearBaselines (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
memset (cl_baselines, 0, sizeof (cl_baselines));
|
||||
for (i = 0; i < MAX_EDICTS; i++) {
|
||||
cl_baselines[i].colormod = 255;
|
||||
cl_baselines[i].alpha = 255;
|
||||
cl_baselines[i].scale = 16;
|
||||
cl_baselines[i].glow_size = 0;
|
||||
cl_baselines[i].glow_color = 254;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CL_ParseSoundlist (void)
|
||||
{
|
||||
|
@ -1196,8 +1195,6 @@ CL_MuzzleFlash (void)
|
|||
|
||||
int received_framecount;
|
||||
|
||||
void Sbar_LogFrags(void);
|
||||
|
||||
void
|
||||
CL_ParseServerMessage (void)
|
||||
{
|
||||
|
|
|
@ -365,7 +365,8 @@ gettoklen (char *str, int req, char delim)
|
|||
return len;
|
||||
}
|
||||
|
||||
void timepassed (double time1, double *time2)
|
||||
void
|
||||
timepassed (double time1, double *time2)
|
||||
{
|
||||
*time2 -= time1;
|
||||
}
|
||||
|
@ -648,7 +649,8 @@ SL_LoadF (QFile *f, server_entry_t *start)
|
|||
}
|
||||
}
|
||||
|
||||
void SL_Init (void)
|
||||
void
|
||||
SL_Init (void)
|
||||
{
|
||||
char e_path[MAX_OSPATH];
|
||||
QFile *servlist;
|
||||
|
|
|
@ -45,9 +45,6 @@ int static_registered = 1; // only for startup check, then set
|
|||
|
||||
qboolean com_modified; // set true if using non-id files
|
||||
|
||||
void COM_Path_f (void);
|
||||
|
||||
|
||||
/*
|
||||
COM_CheckRegistered
|
||||
|
||||
|
|
|
@ -403,7 +403,8 @@ CF_EOF (int desc)
|
|||
cfquota returns the number of characters left in the quota, or
|
||||
<= 0 if it's met or (somehow) exceeded.
|
||||
*/
|
||||
int CF_Quota()
|
||||
int
|
||||
CF_Quota()
|
||||
{
|
||||
return cf_maxsize - cf_cursize;
|
||||
}
|
||||
|
|
|
@ -59,8 +59,6 @@ int locations_alloced = 0;
|
|||
int locations_count = 0;
|
||||
int location_blocks = 0;
|
||||
|
||||
void locs_more (void);
|
||||
|
||||
int
|
||||
locs_nearest (const vec3_t loc)
|
||||
{
|
||||
|
@ -90,6 +88,24 @@ locs_find (const vec3_t target)
|
|||
return locations[i];
|
||||
}
|
||||
|
||||
void
|
||||
locs_more (void)
|
||||
{
|
||||
size_t size;
|
||||
|
||||
location_blocks++;
|
||||
locations_alloced += LOCATION_BLOCK;
|
||||
size = (sizeof (location_t *) * LOCATION_BLOCK * location_blocks);
|
||||
|
||||
if (locations)
|
||||
locations = realloc (locations, size);
|
||||
else
|
||||
locations = malloc (size);
|
||||
|
||||
if (!locations)
|
||||
Sys_Error ("ERROR! Can not alloc memory for location block!");
|
||||
}
|
||||
|
||||
void
|
||||
locs_add (const vec3_t location, const char *name)
|
||||
{
|
||||
|
@ -174,24 +190,6 @@ locs_reset (void)
|
|||
locations = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
locs_more (void)
|
||||
{
|
||||
size_t size;
|
||||
|
||||
location_blocks++;
|
||||
locations_alloced += LOCATION_BLOCK;
|
||||
size = (sizeof (location_t *) * LOCATION_BLOCK * location_blocks);
|
||||
|
||||
if (locations)
|
||||
locations = realloc (locations, size);
|
||||
else
|
||||
locations = malloc (size);
|
||||
|
||||
if (!locations)
|
||||
Sys_Error ("ERROR! Can not alloc memory for location block!");
|
||||
}
|
||||
|
||||
void
|
||||
locs_save (const char *filename, qboolean gz)
|
||||
{
|
||||
|
|
|
@ -227,7 +227,7 @@ Netchan_CanReliable (netchan_t *chan)
|
|||
return Netchan_CanPacket (chan);
|
||||
}
|
||||
|
||||
qboolean ServerPaused (void);
|
||||
qboolean ServerPaused (void); //FIXME
|
||||
|
||||
/*
|
||||
Netchan_Transmit
|
||||
|
|
|
@ -62,14 +62,6 @@ static const char rcsid[] =
|
|||
cvar_t *net_packetlog;
|
||||
cvar_t *net_loglevel;
|
||||
|
||||
int Net_LogStart (const char *fname);
|
||||
|
||||
void Analyze_Server_Packet (const byte * data, int len);
|
||||
void Analyze_Client_Packet (const byte * data, int len);
|
||||
void Parse_Server_Packet (void);
|
||||
void Parse_Client_Packet (void);
|
||||
void Net_LogStop (void);
|
||||
|
||||
// note: this is SUPPOSED to be duplicate, like many others
|
||||
const char *svc_string[] = {
|
||||
"svc_bad",
|
||||
|
@ -381,19 +373,6 @@ Log_Delta(int bits)
|
|||
return;
|
||||
}
|
||||
|
||||
void
|
||||
Analyze_Server_Packet (const byte * data, int len)
|
||||
{
|
||||
if (!Net_PacketLog)
|
||||
Net_PacketLog = _stdout;
|
||||
packet.message->data = (byte*)data;
|
||||
packet.message->cursize = len;
|
||||
MSG_BeginReading (&packet);
|
||||
Parse_Server_Packet ();
|
||||
if (Net_PacketLog == _stdout)
|
||||
Net_PacketLog = NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Parse_Server_Packet ()
|
||||
|
@ -826,14 +805,14 @@ Parse_Server_Packet ()
|
|||
}
|
||||
|
||||
void
|
||||
Analyze_Client_Packet (const byte * data, int len)
|
||||
Analyze_Server_Packet (const byte * data, int len)
|
||||
{
|
||||
if (!Net_PacketLog)
|
||||
Net_PacketLog = _stdout;
|
||||
packet.message->data = (byte*)data;
|
||||
packet.message->cursize = len;
|
||||
MSG_BeginReading (&packet);
|
||||
Parse_Client_Packet ();
|
||||
Parse_Server_Packet ();
|
||||
if (Net_PacketLog == _stdout)
|
||||
Net_PacketLog = NULL;
|
||||
}
|
||||
|
@ -931,6 +910,19 @@ Parse_Client_Packet (void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Analyze_Client_Packet (const byte * data, int len)
|
||||
{
|
||||
if (!Net_PacketLog)
|
||||
Net_PacketLog = _stdout;
|
||||
packet.message->data = (byte*)data;
|
||||
packet.message->cursize = len;
|
||||
MSG_BeginReading (&packet);
|
||||
Parse_Client_Packet ();
|
||||
if (Net_PacketLog == _stdout)
|
||||
Net_PacketLog = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
Net_PacketLog_f (cvar_t *var)
|
||||
{
|
||||
|
|
|
@ -56,10 +56,6 @@ vec3_t forward, right, up;
|
|||
vec3_t player_mins = { -16, -16, -24 };
|
||||
vec3_t player_maxs = { 16, 16, 32 };
|
||||
|
||||
void PM_InitBoxHull (void);
|
||||
void PM_CategorizePosition (void);
|
||||
|
||||
|
||||
void
|
||||
Pmove_Init (void)
|
||||
{
|
||||
|
@ -215,8 +211,6 @@ PM_FlyMove (void)
|
|||
return blocked;
|
||||
}
|
||||
|
||||
void PM_Accelerate (vec3_t, float, float);
|
||||
|
||||
/*
|
||||
PM_FlymodeMove
|
||||
|
||||
|
|
|
@ -85,10 +85,6 @@ qboolean sb_showteamscores;
|
|||
|
||||
int sb_lines; // scan lines to draw
|
||||
|
||||
void Sbar_DeathmatchOverlay (int start);
|
||||
void Sbar_TeamOverlay (void);
|
||||
void Sbar_MiniDeathmatchOverlay (void);
|
||||
|
||||
static qboolean largegame = false;
|
||||
|
||||
cvar_t *cl_showscoresuid;
|
||||
|
|
|
@ -79,8 +79,6 @@ cvar_t *sv_ondemoremove;
|
|||
cvar_t *sv_demotxt;
|
||||
cvar_t *serverdemo;
|
||||
|
||||
void SV_WriteDemoMessage (sizebuf_t *msg, int type, int to, float time);
|
||||
|
||||
int (*dwrite) (QFile * file, const void *buf, int count);
|
||||
|
||||
static dbuffer_t *demobuffer;
|
||||
|
|
|
@ -197,10 +197,6 @@ int pr_gc_count = 0;
|
|||
|
||||
int sv_net_initialized;
|
||||
|
||||
void SV_AcceptClient (netadr_t adr, int userid, char *userinfo);
|
||||
void Master_Shutdown (void);
|
||||
|
||||
|
||||
const char *client_info_filters[] = { // Info keys needed by client
|
||||
"name",
|
||||
"topcolor",
|
||||
|
@ -225,6 +221,28 @@ ServerPaused (void)
|
|||
return sv.paused;
|
||||
}
|
||||
|
||||
/*
|
||||
Master_Shutdown
|
||||
|
||||
Informs all masters that this server is going down
|
||||
*/
|
||||
void
|
||||
Master_Shutdown (void)
|
||||
{
|
||||
char string[2048];
|
||||
int i;
|
||||
|
||||
snprintf (string, sizeof (string), "%c\n", S2M_SHUTDOWN);
|
||||
|
||||
// send to group master
|
||||
for (i = 0; i < MAX_MASTERS; i++)
|
||||
if (master_adr[i].port) {
|
||||
SV_Printf ("Sending heartbeat to %s\n",
|
||||
NET_AdrToString (master_adr[i]));
|
||||
NET_SendPacket (strlen (string), string, master_adr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
SV_Shutdown
|
||||
|
||||
|
@ -2244,28 +2262,6 @@ Master_Heartbeat (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Master_Shutdown
|
||||
|
||||
Informs all masters that this server is going down
|
||||
*/
|
||||
void
|
||||
Master_Shutdown (void)
|
||||
{
|
||||
char string[2048];
|
||||
int i;
|
||||
|
||||
snprintf (string, sizeof (string), "%c\n", S2M_SHUTDOWN);
|
||||
|
||||
// send to group master
|
||||
for (i = 0; i < MAX_MASTERS; i++)
|
||||
if (master_adr[i].port) {
|
||||
SV_Printf ("Sending heartbeat to %s\n",
|
||||
NET_AdrToString (master_adr[i]));
|
||||
NET_SendPacket (strlen (string), string, master_adr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline qboolean
|
||||
iswhitespace (char c)
|
||||
{
|
||||
|
|
|
@ -37,16 +37,13 @@ static const char rcsid[] =
|
|||
|
||||
int mod_lightmap_bytes = 1;
|
||||
|
||||
void Mod_LoadBrushModel (model_t *mod, void *buffer);
|
||||
|
||||
|
||||
void
|
||||
Mod_LoadLighting (lump_t *l)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Mod_LoadAliasModel (model_t *mod, void *buf)
|
||||
Mod_LoadAliasModel (model_t *mod, void *buf, cache_allocator_t allocator)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -76,6 +73,6 @@ Mod_LoadExternalTextures (model_t *mod)
|
|||
}
|
||||
|
||||
void
|
||||
GL_SubdivideSurface (msurface_t *fa)
|
||||
Mod_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1197,8 +1197,6 @@ PF_WriteEntity (progs_t *pr)
|
|||
MSG_WriteShort (WriteDest (pr), P_EDICTNUM (pr, 1));
|
||||
}
|
||||
|
||||
int SV_ModelIndex (const char *name);
|
||||
|
||||
void
|
||||
PF_makestatic (progs_t *pr)
|
||||
{
|
||||
|
|
|
@ -847,7 +847,6 @@ SV_SendClientMessages (void)
|
|||
// if the reliable message overflowed, drop the client
|
||||
if (c->netchan.message.overflowed) {
|
||||
int i;
|
||||
extern void Analyze_Server_Packet (byte *data, int len);
|
||||
byte *data = Hunk_TempAlloc (MAX_MSGLEN + 8);
|
||||
|
||||
memset (data, 0, 8);
|
||||
|
|
|
@ -92,9 +92,6 @@ cvar_t *sv_timekick_interval;
|
|||
cvar_t *sv_timecheck_fuzz;
|
||||
cvar_t *sv_timecheck_decay;
|
||||
|
||||
void SV_FullClientUpdateToClient (client_t *client, client_t *cl);
|
||||
|
||||
|
||||
// USER STRINGCMD EXECUTION host_client and sv_player will be valid.
|
||||
|
||||
/*
|
||||
|
|
|
@ -462,7 +462,8 @@ qfo_read (QFile *file)
|
|||
return qfo;
|
||||
}
|
||||
|
||||
qfo_t *qfo_open (const char *filename)
|
||||
qfo_t *
|
||||
qfo_open (const char *filename)
|
||||
{
|
||||
qfo_t *qfo;
|
||||
QFile *file;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue