fs_offset_t videofile_ix_master_video_start_offset;
fs_offset_t videofile_ix_movistart;
fs_offset_t position;
- qboolean canseek;
+ qbool canseek;
sizebuf_t riffbuffer;
unsigned char riffbufferdata[128];
sizebuf_t riffindexbuffer;
FS_Seek(cls.capturevideo.videofile, 0, SEEK_END); // return value doesn't matter here
}
-static void SCR_CaptureVideo_RIFF_Finish(qboolean final)
+static void SCR_CaptureVideo_RIFF_Finish(qbool final)
{
LOAD_FORMATSPECIFIC_AVI();
// close the "movi" list
static dllhandle_t og_dll = NULL, vo_dll = NULL, ve_dll = NULL, th_dll = NULL;
-static qboolean SCR_CaptureVideo_Ogg_OpenLibrary(void)
+static qbool SCR_CaptureVideo_Ogg_OpenLibrary(void)
{
const char* dllnames_og [] =
{
Cvar_RegisterVariable(&cl_capturevideo_ogg_vorbis_quality);
}
-qboolean SCR_CaptureVideo_Ogg_Available(void)
+qbool SCR_CaptureVideo_Ogg_Available(void)
{
return og_dll && th_dll && vo_dll && ve_dll;
}
void SCR_CaptureVideo_Ogg_Init(void);
-qboolean SCR_CaptureVideo_Ogg_Available(void);
+qbool SCR_CaptureVideo_Ogg_Available(void);
void SCR_CaptureVideo_Ogg_BeginVideo(void);
void SCR_CaptureVideo_Ogg_CloseDLL(void);
{CVAR_CLIENT, "music_playlist_sampleposition9", "-1", "resume position for track, -1 restarts every time"},
};
-static qboolean wasPlaying = false;
-static qboolean initialized = false;
-static qboolean enabled = false;
+static qbool wasPlaying = false;
+static qbool initialized = false;
+static qbool enabled = false;
static float cdvolume;
typedef char filename_t[MAX_QPATH];
#ifdef MAXTRACKS
#endif
static int faketrack = -1;
-static qboolean cdPlaying = false;
-static qboolean cdPlayLooping = false;
+static qbool cdPlaying = false;
+static qbool cdPlayLooping = false;
static unsigned char cdPlayTrack;
static void CDAudio_Eject (void)
// Helper for CDAudio_Play, the "cd" command, and the music_playlist system.
// Does _not_ act as NOP when a playlist is active, simply because this is used
// _by_ playlist code. So beware when calling this.
-static void CDAudio_Play_byName (const char *trackname, qboolean looping, qboolean tryreal, float startposition)
+static void CDAudio_Play_byName (const char *trackname, qbool looping, qbool tryreal, float startposition)
{
unsigned int track;
sfx_t* sfx;
CDAudio_Pause ();
}
-void CDAudio_Play (int track, qboolean looping)
+void CDAudio_Play (int track, qbool looping)
{
char buf[20];
if (music_playlist_index.integer >= 0)
music_playlist_playing = 0; // not playing
}
-static void CDAudio_StartPlaylist(qboolean resume)
+static void CDAudio_StartPlaylist(qbool resume)
{
const char *list;
const char *t;
extern cvar_t cdaudioinitialized;
int CDAudio_Init(void);
-void CDAudio_Play(int track, qboolean looping);
+void CDAudio_Play(int track, qbool looping);
void CDAudio_Stop(void);
void CDAudio_Pause(void);
void CDAudio_Resume(void);
CL_Move
==================
*/
-trace_t CL_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities)
+trace_t CL_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities)
{
prvm_prog_t *prog = CLVM_prog;
int i, bodysupercontents;
CL_TraceLine
==================
*/
-trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities, qboolean hitsurfaces)
+trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities, qbool hitsurfaces)
{
prvm_prog_t *prog = CLVM_prog;
int i, bodysupercontents;
CL_Move
==================
*/
-trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities)
+trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities)
{
prvm_prog_t *prog = CLVM_prog;
vec3_t hullmins, hullmaxs;
int i, bodysupercontents;
int passedictprog;
- qboolean pointtrace;
+ qbool pointtrace;
prvm_edict_t *traceowner, *touch;
trace_t trace;
// temporary storage because prvm_vec_t may need conversion
void CL_LinkEdict(prvm_edict_t *ent);
int CL_GenericHitSuperContentsMask(const prvm_edict_t *edict);
-trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities);
-trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities, qboolean hitsurfaces);
-trace_t CL_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities);
+trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities);
+trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities, qbool hitsurfaces);
+trace_t CL_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities);
trace_t CL_Cache_TraceLineSurfaces(const vec3_t start, const vec3_t end, int type, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
#define CL_PointSuperContents(point) (CL_TracePoint((point), sv_gameplayfix_swiminbmodels.integer ? MOVE_NOMONSTERS : MOVE_WORLDONLY, NULL, 0, 0, 0, true, false, NULL, false).startsupercontents)
{
char name[MAX_QPATH];
int c;
- qboolean neg = false;
+ qbool neg = false;
qfile_t *f;
if (Cmd_Argc(cmd) != 2)
Mem_Free(d);
}
-void EntityFrameQW_CL_ReadFrame(qboolean delta)
+void EntityFrameQW_CL_ReadFrame(qbool delta)
{
- qboolean invalid = false;
+ qbool invalid = false;
int number, oldsnapindex, newsnapindex, oldindex, newindex, oldnum, newnum;
entity_t *ent;
entityframeqw_database_t *d;
float CL_KeyState (kbutton_t *key)
{
float val;
- qboolean impulsedown, impulseup, down;
+ qbool impulsedown, impulseup, down;
impulsedown = (key->state & 2) != 0;
impulseup = (key->state & 4) != 0;
{-0.125, 0.125, -0.125}, { 0.125, 0.125, -0.125},
};
-static qboolean CL_ClientMovement_Unstick(cl_clientmovement_state_t *s)
+static qbool CL_ClientMovement_Unstick(cl_clientmovement_state_t *s)
{
int i;
vec3_t neworigin;
{
// apply air speed limit
vec_t accel, wishspeed0, wishspeed2, accelqw, strafity;
- qboolean accelerating;
+ qbool accelerating;
accelqw = cl.movevars_airaccel_qw;
wishspeed0 = wishspeed;
unsigned char data[1024];
double packettime;
int msecdelta;
- qboolean quemove;
- qboolean important;
+ qbool quemove;
+ qbool important;
// if playing a demo, do nothing
if (!cls.netcon)
extern cvar_t cl_topcolor;
extern cvar_t cl_bottomcolor;
-void CL_SetInfo(const char *key, const char *value, qboolean send, qboolean allowstarkey, qboolean allowmodel, qboolean quiet)
+void CL_SetInfo(const char *key, const char *value, qbool send, qbool allowstarkey, qbool allowmodel, qbool quiet)
{
int i;
- qboolean fail = false;
+ qbool fail = false;
char vabuf[1024];
if (!allowstarkey && key[0] == '*')
fail = true;
}
// note this is a recursive function, recursionlimit should be 32 or so on the initial call
-static void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolate)
+static void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qbool interpolate)
{
const matrix4x4_t *matrix;
matrix4x4_t blendmatrix, tempmatrix, matrix2;
cvar_t cl_nettimesyncboundtolerance = {CVAR_CLIENT | CVAR_SAVE, "cl_nettimesyncboundtolerance", "0.25", "how much error is tolerated by bounding check, as a fraction of frametime, 0.25 = up to 25% margin of error tolerated, 1 = use only new time, 0 = use only old time (same effect as setting cl_nettimesyncfactor to 1)"};
cvar_t cl_iplog_name = {CVAR_CLIENT | CVAR_SAVE, "cl_iplog_name", "darkplaces_iplog.txt", "name of iplog file containing player addresses for iplog_list command and automatic ip logging when parsing status command"};
-static qboolean QW_CL_CheckOrDownloadFile(const char *filename);
+static qbool QW_CL_CheckOrDownloadFile(const char *filename);
static void QW_CL_RequestNextDownload(void);
static void QW_CL_NextUpload_f(cmd_state_t *cmd);
-//static qboolean QW_CL_IsUploading(void);
+//static qbool QW_CL_IsUploading(void);
static void QW_CL_StopUpload_f(cmd_state_t *cmd);
/*
*/
static unsigned char olddata[NET_MAXMESSAGE];
-void CL_KeepaliveMessage (qboolean readmessages)
+void CL_KeepaliveMessage (qbool readmessages)
{
static double lastdirtytime = 0;
- static qboolean recursive = false;
+ static qbool recursive = false;
double dirtytime;
double deltatime;
static double countdownmsg = 0;
static double countdownupdate = 0;
sizebuf_t old;
- qboolean thisrecursive;
+ qbool thisrecursive;
thisrecursive = recursive;
recursive = true;
void CL_ParseEntityLump(char *entdata)
{
- qboolean loadedsky = false;
+ qbool loadedsky = false;
const char *data;
char key[128], value[MAX_INPUTLINE];
FOG_clear(); // LadyHavoc: no fog until set
}
}
-static qboolean QW_CL_CheckOrDownloadFile(const char *filename)
+static qbool QW_CL_CheckOrDownloadFile(const char *filename)
{
qfile_t *file;
char vabuf[1024];
}
#if 0
-qboolean QW_CL_IsUploading(void)
+qbool QW_CL_IsUploading(void)
{
return cls.qw_uploaddata != NULL;
}
#define LOADPROGRESSWEIGHT_WORLDMODEL 30.0
#define LOADPROGRESSWEIGHT_WORLDMODEL_INIT 2.0
-static void CL_BeginDownloads(qboolean aborteddownload)
+static void CL_BeginDownloads(qbool aborteddownload)
{
char vabuf[1024];
// quakeworld works differently
}
cl_iplog_item_t;
-static qboolean cl_iplog_loaded = false;
+static qbool cl_iplog_loaded = false;
static int cl_iplog_numitems = 0;
static int cl_iplog_maxitems = 0;
static cl_iplog_item_t *cl_iplog_items;
static void CL_IPLog_Load(void);
-static void CL_IPLog_Add(const char *address, const char *name, qboolean checkexisting, qboolean addtofile)
+static void CL_IPLog_Add(const char *address, const char *name, qbool checkexisting, qbool addtofile)
{
int i;
size_t sz_name, sz_address;
}
// look for anything interesting like player IP addresses or ping reports
-static qboolean CL_ExaminePrintString(const char *text)
+static qbool CL_ExaminePrintString(const char *text)
{
int len;
const char *t;
if (cl.parsingtextmode == CL_PARSETEXTMODE_PING)
{
// if anything goes wrong, we'll assume this is not a ping report
- qboolean expected = cl.parsingtextexpectingpingforscores != 0;
+ qbool expected = cl.parsingtextexpectingpingforscores != 0;
cl.parsingtextexpectingpingforscores = 0;
cl.parsingtextmode = CL_PARSETEXTMODE_NONE;
t = text;
unsigned char cmdlog[32];
const char *cmdlogname[32], *temp;
int cmdindex, cmdcount = 0;
- qboolean qwplayerupdatereceived;
- qboolean strip_pqc;
+ qbool qwplayerupdatereceived;
+ qbool strip_pqc;
char vabuf[1024];
// LadyHavoc: moved demo message writing from before the packet parse to
float lightradiusfade;
float lighttime;
float lightcolor[3];
- qboolean lightshadow;
+ qbool lightshadow;
int lightcubemapnum;
float lightcorona[2];
unsigned int staincolor[2]; // note: 0x808080 = neutral (particle's own color), these are modding factors for the particle's original color!
0.0f, //float lightradiusfade;
16777216.0f, //float lighttime;
{1.0f, 1.0f, 1.0f}, //float lightcolor[3];
- true, //qboolean lightshadow;
+ true, //qbool lightshadow;
0, //int lightcubemapnum;
{1.0f, 0.25f}, //float lightcorona[2];
{(unsigned int)-1, (unsigned int)-1}, //unsigned int staincolor[2]; // note: 0x808080 = neutral (particle's own color), these are modding factors for the particle's original color!
// stainsize: size of the stain as factor for palpha
// angle: base rotation of the particle geometry around its center normal
// spin: rotation speed of the particle geometry around its center normal
-particle_t *CL_NewParticle(const vec3_t sortorigin, unsigned short ptypeindex, int pcolor1, int pcolor2, int ptex, float psize, float psizeincrease, float palpha, float palphafade, float pgravity, float pbounce, float px, float py, float pz, float pvx, float pvy, float pvz, float pairfriction, float pliquidfriction, float originjitter, float velocityjitter, qboolean pqualityreduction, float lifetime, float stretch, pblend_t blendmode, porientation_t orientation, int staincolor1, int staincolor2, int staintex, float stainalpha, float stainsize, float angle, float spin, float tint[4])
+particle_t *CL_NewParticle(const vec3_t sortorigin, unsigned short ptypeindex, int pcolor1, int pcolor2, int ptex, float psize, float psizeincrease, float palpha, float palphafade, float pgravity, float pbounce, float px, float py, float pz, float pvx, float pvy, float pvz, float pairfriction, float pliquidfriction, float originjitter, float velocityjitter, qbool pqualityreduction, float lifetime, float stretch, pblend_t blendmode, porientation_t orientation, int staincolor1, int staincolor2, int staintex, float stainalpha, float stainsize, float angle, float spin, float tint[4])
{
int l1, l2, r, g, b;
particle_t *part;
static void CL_Sparks(const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, float sparkcount);
static void CL_Smoke(const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, float smokecount);
-static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles, float tintmins[4], float tintmaxs[4], float fade, qboolean wanttrail);
-static void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles, qboolean wanttrail)
+static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade, qbool wanttrail);
+static void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, qbool wanttrail)
{
vec3_t center;
matrix4x4_t lightmatrix;
else
{
static double bloodaccumulator = 0;
- qboolean immediatebloodstain = (cl_decals_newsystem_immediatebloodstain.integer >= 1);
+ qbool immediatebloodstain = (cl_decals_newsystem_immediatebloodstain.integer >= 1);
//CL_NewParticle(center, pt_alphastatic, 0x4f0000,0x7f0000, tex_particle, 2.5, 0, 256, 256, 0, 0, lhrandom(originmins[0], originmaxs[0]), lhrandom(originmins[1], originmaxs[1]), lhrandom(originmins[2], originmaxs[2]), 0, 0, 0, 1, 4, 0, 0, true, 0, 1, PBLEND_ALPHA, PARTICLE_BILLBOARD, NULL);
bloodaccumulator += count * 0.333 * cl_particles_quality.value;
for (;bloodaccumulator > 0;bloodaccumulator--)
// this is also called on point effects with spawndlight = true and
// spawnparticles = true
-static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles, float tintmins[4], float tintmaxs[4], float fade, qboolean wanttrail)
+static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade, qbool wanttrail)
{
- qboolean found = false;
+ qbool found = false;
char vabuf[1024];
if (effectnameindex < 1 || effectnameindex >= MAX_PARTICLEEFFECTNAME || !particleeffectname[effectnameindex][0])
{
vec3_t up;
vec_t traillen;
vec_t trailstep;
- qboolean underwater;
- qboolean immediatebloodstain;
+ qbool underwater;
+ qbool immediatebloodstain;
particle_t *part;
float avgtint[4], tint[4], tintlerp;
// note this runs multiple effects with the same name, each one spawns only one kind of particle, so some effects need more than one
{
if ((info->effectnameindex == effectnameindex) && (info->flags & PARTICLEEFFECT_DEFINED))
{
- qboolean definedastrail = info->trailspacing > 0;
+ qbool definedastrail = info->trailspacing > 0;
- qboolean drawastrail = wanttrail;
+ qbool drawastrail = wanttrail;
if (cl_particles_forcetraileffects.integer)
drawastrail = drawastrail || definedastrail;
CL_ParticleEffect_Fallback(effectnameindex, pcount, originmins, originmaxs, velocitymins, velocitymaxs, ent, palettecolor, spawndlight, spawnparticles, wanttrail);
}
-void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles, float tintmins[4], float tintmaxs[4], float fade)
+void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade)
{
CL_NewParticlesFromEffectinfo(effectnameindex, pcount, originmins, originmaxs, velocitymins, velocitymaxs, ent, palettecolor, spawndlight, spawnparticles, tintmins, tintmaxs, fade, true);
}
-void CL_ParticleBox(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles, float tintmins[4], float tintmaxs[4], float fade)
+void CL_ParticleBox(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade)
{
CL_NewParticlesFromEffectinfo(effectnameindex, pcount, originmins, originmaxs, velocitymins, velocitymaxs, ent, palettecolor, spawndlight, spawnparticles, tintmins, tintmaxs, fade, false);
}
float palpha, spintime, spinrad, spincos, spinsin, spinm1, spinm2, spinm3, spinm4;
vec4_t colormultiplier;
float minparticledist_start, minparticledist_end;
- qboolean dofade;
+ qbool dofade;
RSurf_ActiveModelEntity(r_refdef.scene.worldentity, false, false, false);
float drawdist2;
int hitent;
trace_t trace;
- qboolean update;
+ qbool update;
frametime = bound(0, cl.time - cl.particles_updatetime, 1);
cl.particles_updatetime = bound(cl.time - 1, cl.particles_updatetime + frametime, cl.time + 1);
int jpeg_supported = false;
-qboolean scr_initialized; // ready to draw
+qbool scr_initialized; // ready to draw
float scr_con_current;
int scr_con_margin_bottom;
static void R_Envmap_f(cmd_state_t *cmd);
// backend
-void R_ClearScreen(qboolean fogcolor);
+void R_ClearScreen(qbool fogcolor);
/*
===============================================================================
con_vislines = 0;
}
-qboolean scr_loading = false;
+qbool scr_loading = false;
/*
===============
================
*/
-void SCR_BeginLoadingPlaque (qboolean startup)
+void SCR_BeginLoadingPlaque (qbool startup)
{
scr_loading = true;
SCR_UpdateLoadingScreen(false, startup);
char filename[MAX_QPATH];
unsigned char *buffer1;
unsigned char *buffer2;
- qboolean jpeg = (scr_screenshot_jpeg.integer != 0);
- qboolean png = (scr_screenshot_png.integer != 0) && !jpeg;
+ qbool jpeg = (scr_screenshot_jpeg.integer != 0);
+ qbool png = (scr_screenshot_png.integer != 0) && !jpeg;
char vabuf[1024];
if (Cmd_Argc(cmd) == 2)
{
float angles[3];
const char *name;
- qboolean flipx, flipy, flipdiagonaly;
+ qbool flipx, flipy, flipdiagonaly;
}
envmapinfo[12] =
{
// buffer1: 4*w*h
// buffer2: 3*w*h (or 4*w*h if screenshotting alpha too)
-qboolean SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *buffer2, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg, qboolean png, qboolean gammacorrect, qboolean keep_alpha)
+qbool SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *buffer2, int x, int y, int width, int height, qbool flipx, qbool flipy, qbool flipdiagonal, qbool jpeg, qbool png, qbool gammacorrect, qbool keep_alpha)
{
int indices[4] = {0,1,2,3}; // BGRA
- qboolean ret;
+ qbool ret;
GL_ReadPixelsBGRA(x, y, width, height, buffer1);
}
}
-void R_ClearScreen(qboolean fogcolor)
+void R_ClearScreen(qbool fogcolor)
{
float clearcolor[4];
if (scr_screenshot_alpha.integer)
}
loadingscreenstack_t;
static loadingscreenstack_t *loadingscreenstack = NULL;
-static qboolean loadingscreendone = false;
-static qboolean loadingscreencleared = false;
+static qbool loadingscreendone = false;
+static qbool loadingscreencleared = false;
static float loadingscreenheight = 0;
rtexture_t *loadingscreentexture = NULL;
static float loadingscreentexture_vertex3f[12];
SCR_UpdateLoadingScreenIfShown();
}
-void SCR_PopLoadingScreen (qboolean redraw)
+void SCR_PopLoadingScreen (qbool redraw)
{
loadingscreenstack_t *s = loadingscreenstack;
SCR_UpdateLoadingScreenIfShown();
}
-void SCR_ClearLoadingScreen (qboolean redraw)
+void SCR_ClearLoadingScreen (qbool redraw)
{
while(loadingscreenstack)
SCR_PopLoadingScreen(redraw && !loadingscreenstack->prev);
static float loadingscreenpic_vertex3f[12];
static float loadingscreenpic_texcoord2f[8];
-static void SCR_DrawLoadingScreen_SharedSetup (qboolean clear)
+static void SCR_DrawLoadingScreen_SharedSetup (qbool clear)
{
r_viewport_t viewport;
float x, y, w, h, sw, sh, f;
static void SCR_UpdateVars(void);
-void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
+void SCR_UpdateLoadingScreen (qbool clear, qbool startup)
{
keydest_t old_key_dest;
int old_key_consoleactive;
key_consoleactive = old_key_consoleactive;
}
-qboolean R_Stereo_ColorMasking(void)
+qbool R_Stereo_ColorMasking(void)
{
return r_stereo_redblue.integer || r_stereo_redgreen.integer || r_stereo_redcyan.integer;
}
-qboolean R_Stereo_Active(void)
+qbool R_Stereo_Active(void)
{
return (vid.stereobuffer || r_stereo_sidebyside.integer || r_stereo_horizontal.integer || r_stereo_vertical.integer || R_Stereo_ColorMasking());
}
void CL_Screen_Shutdown(void);
void CL_UpdateScreen(void);
-qboolean R_Stereo_Active(void);
-qboolean R_Stereo_ColorMasking(void);
+qbool R_Stereo_Active(void);
+qbool R_Stereo_ColorMasking(void);
#endif
return NULL;
}
-static qboolean OpenStream( clvideo_t * video )
+static qbool OpenStream( clvideo_t * video )
{
const char *errorstring;
}
}
-static qboolean WakeVideo( clvideo_t * video )
+static qbool WakeVideo( clvideo_t * video )
{
if( !video->suspended )
return true;
return 0;
}
-static int CL_DrawVideo_DisplaySubtitleLine(void *passthrough, const char *line, size_t length, float width, qboolean isContinuation)
+static int CL_DrawVideo_DisplaySubtitleLine(void *passthrough, const char *line, size_t length, float width, qbool isContinuation)
{
cl_video_subtitle_info_t *si = (cl_video_subtitle_info_t *) passthrough;
CL_RestartVideo( cl_videos );
}
-void CL_Video_KeyEvent( int key, int ascii, qboolean down )
+void CL_Video_KeyEvent( int key, int ascii, qbool down )
{
// only react to up events, to allow the user to delay the abortion point if it suddenly becomes interesting..
if( !down ) {
// used to determine whether the video's resources should be freed or not
double lasttime;
// when lasttime - realtime > THRESHOLD, all but the stream is freed
- qboolean suspended;
+ qbool suspended;
char filename[MAX_QPATH];
} clvideo_t;
// new function used for fullscreen videos
// TODO: Andreas Kirsch: move this subsystem somewhere else (preferably host) since the cl_video system shouldnt do such work like managing key events..
-void CL_Video_KeyEvent( int key, int ascii, qboolean down );
+void CL_Video_KeyEvent( int key, int ascii, qbool down );
#endif
Con_Printf(CON_ERROR "LibAvcodec panic: %s\n", message);
}
-qboolean LibAvW_OpenLibrary(void)
+qbool LibAvW_OpenLibrary(void)
{
int errorcode;
void libavw_close(void *stream);
void *LibAvW_OpenVideo(clvideo_t *video, char *filename, const char **errorstring);
-qboolean LibAvW_OpenLibrary(void);
+qbool LibAvW_OpenLibrary(void);
void LibAvW_CloseLibrary(void);
\ No newline at end of file
/// this is R_GetCubemap(rtlight->cubemapname)
rtexture_t *currentcubemap;
/// set by R_Shadow_PrepareLight to decide whether R_Shadow_DrawLight should draw it
- qboolean draw;
+ qbool draw;
/// set by R_Shadow_PrepareLight to indicate whether R_Shadow_DrawShadowMaps should do anything
- qboolean castshadows;
+ qbool castshadows;
/// these fields are set by R_Shadow_PrepareLight for later drawing
int cached_numlightentities;
int cached_numlightentities_noselfshadow;
float render_rtlight_diffuse[3];
float render_rtlight_specular[3];
// ignore lightmap and use fixed lighting settings on this entity (e.g. FULLBRIGHT)
- qboolean render_modellight_forced;
+ qbool render_modellight_forced;
// do not process per pixel lights on this entity at all (like MATERIALFLAG_NORTLIGHT)
- qboolean render_rtlight_disabled;
+ qbool render_rtlight_disabled;
// use the 3D lightmap from q3bsp on this entity
- qboolean render_lightgrid;
+ qbool render_lightgrid;
// storage of decals on this entity
// (note: if allowdecals is set, be sure to call R_DecalSystem_Reset on removal!)
vec_t lerpdeltatime; // lerp
float muzzleflash; // muzzleflash intensity, fades over time
float trail_time; // residual error accumulation for particle trail spawning (to keep spacing across frames)
- qboolean trail_allowed; // set to false by teleports, true by update code, prevents bad lerps
+ qbool trail_allowed; // set to false by teleports, true by update code, prevents bad lerps
}
entity_persistent_t;
int buttons;
int impulse;
unsigned int sequence;
- qboolean applied; // if false we're still accumulating a move
- qboolean predicted; // if true the sequence should be sent as 0
+ qbool applied; // if false we're still accumulating a move
+ qbool predicted; // if true the sequence should be sent as 0
// derived properties
double frametime;
- qboolean canjump;
- qboolean jump;
- qboolean crouch;
+ qbool canjump;
+ qbool jump;
+ qbool crouch;
} usercmd_t;
typedef struct lightstyle_s
double framerate;
int framestep;
int framestepframe;
- qboolean active;
- qboolean realtime;
- qboolean error;
+ qbool active;
+ qbool realtime;
+ qbool error;
int soundrate;
int soundchannels;
int frame;
// demo recording info must be here, because record is started before
// entering a map (and clearing client_state_t)
- qboolean demorecording;
+ qbool demorecording;
fs_offset_t demo_lastcsprogssize;
int demo_lastcsprogscrc;
- qboolean demoplayback;
- qboolean demostarting; // set if currently starting a demo, to stop -demo from quitting when switching to another demo
- qboolean timedemo;
+ qbool demoplayback;
+ qbool demostarting; // set if currently starting a demo, to stop -demo from quitting when switching to another demo
+ qbool timedemo;
// -1 = use normal cd track
int forcetrack;
qfile_t *demofile;
double td_onesecondavgfps;
int td_onesecondavgcount;
// LadyHavoc: pausedemo
- qboolean demopaused;
+ qbool demopaused;
// sound mixer statistics for showsound display
cl_soundstats_t soundstats;
- qboolean connect_trying;
+ qbool connect_trying;
int connect_remainingtries;
double connect_nextsendtime;
lhnetsocket_t *connect_mysocket;
double qw_downloadspeedtime;
int qw_downloadspeedcount;
int qw_downloadspeedrate;
- qboolean qw_download_deflate;
+ qbool qw_download_deflate;
// current file upload buffer (for uploading screenshots to server)
unsigned char *qw_uploaddata;
//[515]: csqc
typedef struct
{
- qboolean drawworld;
- qboolean drawenginesbar;
- qboolean drawcrosshair;
+ qbool drawworld;
+ qbool drawenginesbar;
+ qbool drawcrosshair;
}csqc_vidvars_t;
typedef enum
{
pblend_t blendmode;
porientation_t orientation;
- qboolean lighting;
+ qbool lighting;
}
particletype_t;
typedef struct showlmp_s
{
- qboolean isactive;
+ qbool isactive;
float x;
float y;
char label[32];
// this is used primarily by teleporters, and when spectating players
// special checking of the old fixangle[1] is used to differentiate
// between teleporting and spectating
- qboolean fixangle[2];
+ qbool fixangle[2];
// client movement simulation
// these fields are only updated by CL_ClientMovement (called by CL_SendMove after parsing each network packet)
// set by CL_ClientMovement_Replay functions
- qboolean movement_predicted;
+ qbool movement_predicted;
// if true the CL_ClientMovement_Replay function will update origin, etc
- qboolean movement_replay;
+ qbool movement_replay;
// simulated data (this is valid even if cl.movement is false)
vec3_t movement_origin;
vec3_t movement_velocity;
// whether the replay should allow a jump at the first sequence
- qboolean movement_replay_canjump;
+ qbool movement_replay_canjump;
// previous gun angles (for leaning effects)
vec3_t gunangles_prev;
// pitch drifting vars
float idealpitch;
float pitchvel;
- qboolean nodrift;
+ qbool nodrift;
float driftmove;
double laststop;
//[515]: added for csqc purposes
float sensitivityscale;
csqc_vidvars_t csqc_vidvars; //[515]: these parms must be set to true by default
- qboolean csqc_wantsmousemove;
+ qbool csqc_wantsmousemove;
struct model_s *csqc_model_precache[MAX_MODELS];
// local amount for smoothing stepups
//float crouch;
// sent by server
- qboolean paused;
- qboolean onground;
- qboolean inwater;
+ qbool paused;
+ qbool onground;
+ qbool inwater;
// used by bob
- qboolean oldonground;
+ qbool oldonground;
double lastongroundtime;
double hitgroundtime;
float bob2_smooth;
sfx_t *sfx_ric3;
sfx_t *sfx_r_exp3;
// indicates that the file "sound/misc/talk2.wav" was found (for use by team chat messages)
- qboolean foundteamchatsound;
+ qbool foundteamchatsound;
// refresh related state
int loadsound_current;
int downloadsound_current;
int loadsound_total;
- qboolean downloadcsqc;
- qboolean loadcsqc;
- qboolean loadbegun;
- qboolean loadfinished;
+ qbool downloadcsqc;
+ qbool loadcsqc;
+ qbool loadbegun;
+ qbool loadfinished;
// quakeworld stuff
// unused: indicates whether the player is spectating
// use cl.scores[cl.playerentity-1].qw_spectator instead
- //qboolean qw_spectator;
+ //qbool qw_spectator;
// last time an input packet was sent
double lastpackettime;
// csqc stuff:
// server entity number corresponding to a clientside entity
unsigned short csqc_server2csqcentitynumber[MAX_EDICTS];
- qboolean csqc_loaded;
+ qbool csqc_loaded;
vec3_t csqc_vieworigin;
vec3_t csqc_viewangles;
vec3_t csqc_vieworiginfromengine;
vec3_t csqc_viewanglesfromengine;
matrix4x4_t csqc_viewmodelmatrixfromengine;
- qboolean csqc_usecsqclistener;
+ qbool csqc_usecsqclistener;
matrix4x4_t csqc_listenermatrix;
char csqc_printtextbuf[MAX_INPUTLINE];
void CL_ClearState (void);
void CL_ExpandEntities(int num);
void CL_ExpandCSQCRenderEntities(int num);
-void CL_SetInfo(const char *key, const char *value, qboolean send, qboolean allowstarkey, qboolean allowmodel, qboolean quiet);
+void CL_SetInfo(const char *key, const char *value, qbool send, qbool allowstarkey, qbool allowmodel, qbool quiet);
void CL_UpdateWorld (void);
void CL_Parse_ErrorCleanUp(void);
void QW_CL_StartUpload(unsigned char *data, int size);
extern cvar_t qport;
-void CL_KeepaliveMessage(qboolean readmessages); // call this during loading of large content
+void CL_KeepaliveMessage(qbool readmessages); // call this during loading of large content
//
// view
void CL_Particles_Clear(void);
void CL_Particles_Init(void);
void CL_Particles_Shutdown(void);
-particle_t *CL_NewParticle(const vec3_t sortorigin, unsigned short ptypeindex, int pcolor1, int pcolor2, int ptex, float psize, float psizeincrease, float palpha, float palphafade, float pgravity, float pbounce, float px, float py, float pz, float pvx, float pvy, float pvz, float pairfriction, float pliquidfriction, float originjitter, float velocityjitter, qboolean pqualityreduction, float lifetime, float stretch, pblend_t blendmode, porientation_t orientation, int staincolor1, int staincolor2, int staintex, float stainalpha, float stainsize, float angle, float spin, float tint[4]);
+particle_t *CL_NewParticle(const vec3_t sortorigin, unsigned short ptypeindex, int pcolor1, int pcolor2, int ptex, float psize, float psizeincrease, float palpha, float palphafade, float pgravity, float pbounce, float px, float py, float pz, float pvx, float pvy, float pvz, float pairfriction, float pliquidfriction, float originjitter, float velocityjitter, qbool pqualityreduction, float lifetime, float stretch, pblend_t blendmode, porientation_t orientation, int staincolor1, int staincolor2, int staintex, float stainalpha, float stainsize, float angle, float spin, float tint[4]);
typedef enum effectnameindex_s
{
int CL_ParticleEffectIndexForName(const char *name);
const char *CL_ParticleEffectNameForIndex(int i);
void CL_ParticleEffect(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor);
-void CL_ParticleTrail(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles, float tintmins[4], float tintmaxs[4], float fade);
-void CL_ParticleBox(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles, float tintmins[4], float tintmaxs[4], float fade);
+void CL_ParticleTrail(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade);
+void CL_ParticleBox(int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade);
void CL_ParseParticleEffect (void);
void CL_ParticleCube (const vec3_t mins, const vec3_t maxs, const vec3_t dir, int count, int colorbase, vec_t gravity, vec_t randomvel);
void CL_ParticleRain (const vec3_t mins, const vec3_t maxs, const vec3_t dir, int count, int colorbase, int type);
#include "cl_screen.h"
-extern qboolean sb_showscores;
+extern qbool sb_showscores;
float RSurf_FogVertex(const vec3_t p);
float RSurf_FogPoint(const vec3_t p);
vec3_t up;
int numfrustumplanes;
mplane_t frustum[6];
- qboolean useclipplane;
- qboolean usecustompvs; // uses r_refdef.viewcache.pvsbits as-is rather than computing it
+ qbool useclipplane;
+ qbool usecustompvs; // uses r_refdef.viewcache.pvsbits as-is rather than computing it
mplane_t clipplane;
float frustum_x, frustum_y;
vec3_t frustumcorner[4];
float colorscale;
// whether to call R_ClearScreen before rendering stuff
- qboolean clear;
+ qbool clear;
// if true, don't clear or do any post process effects (bloom, etc)
- qboolean isoverlay;
+ qbool isoverlay;
// if true, this is the MAIN view (which is, after CSQC, copied into the scene for use e.g. by r_speeds 1, showtex, prydon cursor)
- qboolean ismain;
+ qbool ismain;
// whether to draw r_showtris and such, this is only true for the main
// view render, all secondary renders (mirrors, portals, cameras,
// distortion effects, etc) omit such debugging information
- qboolean showdebug;
+ qbool showdebug;
// these define which values to use in GL_CullFace calls to request frontface or backface culling
int cullface_front;
unsigned char *world_leafvisible;
unsigned char *world_surfacevisible;
// if true, the view is currently in a leaf without pvs data
- qboolean world_novis;
+ qbool world_novis;
}
r_refdef_viewcache_t;
// maybe also refactor some of the functions to support different setting sources (ie. fogenabled, etc.) for different scenes
typedef struct r_refdef_scene_s {
// whether to call S_ExtraUpdate during render to reduce sound chop
- qboolean extraupdate;
+ qbool extraupdate;
// (client gameworld) time for rendering time based effects
double time;
entity_render_t *tempentities;
int numtempentities;
int maxtempentities;
- qboolean expandtempentities;
+ qbool expandtempentities;
// renderable dynamic lights
rtlight_t *lights[MAX_DLIGHTS];
// see CL_UpdateEntityShading
float lightmapintensity;
- qboolean rtworld;
- qboolean rtworldshadows;
- qboolean rtdlight;
- qboolean rtdlightshadows;
+ qbool rtworld;
+ qbool rtworldshadows;
+ qbool rtdlight;
+ qbool rtdlightshadows;
} r_refdef_scene_t;
typedef struct r_refdef_s
float fogplane[4];
float fogplaneviewdist;
- qboolean fogplaneviewabove;
+ qbool fogplaneviewabove;
float fogheightfade;
float fogcolor[3];
float fogrange;
float fog_end;
float fog_height;
float fog_fadedepth;
- qboolean fogenabled;
- qboolean oldgl_fogenable;
+ qbool fogenabled;
+ qbool oldgl_fogenable;
// new flexible texture height fog (overrides normal fog)
char fog_height_texturename[64]; // note: must be 64 for the sscanf code
int draw2dstage; // 0 = no, 1 = yes, other value = needs setting up again
// true during envmap command capture
- qboolean envmap;
+ qbool envmap;
// whether to draw world lights realtime, dlights realtime, and their shadows
float polygonfactor;
vec3_t mins;
vec3_t maxs;
// currently on the ground
- qboolean onground;
+ qbool onground;
// currently crouching
- qboolean crouched;
+ qbool crouched;
// what kind of water (SUPERCONTENTS_LAVA for instance)
int watertype;
// how deep
void V_DriftPitch(void);
void V_FadeViewFlashs(void);
void V_CalcViewBlend(void);
-void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewangles, qboolean teleported, qboolean clonground, qboolean clcmdjump, float clstatsviewheight, qboolean cldead, qboolean clintermission, const vec3_t clvelocity);
+void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewangles, qbool teleported, qbool clonground, qbool clcmdjump, float clstatsviewheight, qbool cldead, qbool clintermission, const vec3_t clvelocity);
void V_CalcRefdef(void);
void V_MakeViewIsometric(void);
void V_MakeViewIsometric(void);
int pflags = PFLAGS_CORONA | PFLAGS_FULLDYNAMIC;
float coronaintensity = 1;
float coronasizescale = 0.25;
- qboolean castshadow = true;
+ qbool castshadow = true;
float ambientscale = 0;
float diffusescale = 1;
float specularscale = 1;
vec3_t origin_from, origin_to, dir_from, dir_to;
float count;
int flags;
- qboolean istrail;
+ qbool istrail;
float tintmins[4], tintmaxs[4], fade;
VM_SAFEPARMCOUNTRANGE(7, 8, VM_CL_boxparticles);
return 1;
}
-void CL_GetEntityMatrix (prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatrix)
+void CL_GetEntityMatrix (prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qbool viewmatrix)
{
float scale;
float pitchsign = 1;
typedef struct vmparticletheme_s
{
unsigned short typeindex;
- qboolean initialized;
+ qbool initialized;
pblend_t blendmode;
porientation_t orientation;
int color1;
float liquidfriction;
float originjitter;
float velocityjitter;
- qboolean qualityreduction;
+ qbool qualityreduction;
float lifetime;
float stretch;
int staincolor1;
typedef struct vmparticlespawner_s
{
mempool_t *pool;
- qboolean initialized;
- qboolean verified;
+ qbool initialized;
+ qbool verified;
vmparticletheme_t *themes;
int max_themes;
}vmparticlespawner_t;
// --blub
static void VM_CL_R_RenderScene (prvm_prog_t *prog)
{
- qboolean ismain = r_refdef.view.ismain;
+ qbool ismain = r_refdef.view.ismain;
double t = Sys_DirtyTime();
VM_SAFEPARMCOUNT(0, VM_CL_R_RenderScene);
{
const char *texname;
int drawflags;
- qboolean draw2d;
+ qbool draw2d;
dp_model_t *mod;
VM_SAFEPARMCOUNTRANGE(2, 3, VM_CL_R_PolygonBegin);
static void VM_CL_R_PolygonEnd (prvm_prog_t *prog)
{
int i;
- qboolean hascolor;
- qboolean hasalpha;
+ qbool hascolor;
+ qbool hasalpha;
int e0 = 0, e1 = 0, e2 = 0;
float *o;
dp_model_t *mod = prog->polygonbegin_model;
=============
*/
-static qboolean CL_CheckBottom (prvm_edict_t *ent)
+static qbool CL_CheckBottom (prvm_edict_t *ent)
{
prvm_prog_t *prog = CLVM_prog;
vec3_t mins, maxs, start, stop;
possible, no move is done and false is returned
=============
*/
-static qboolean CL_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace)
+static qbool CL_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool noenemy, qbool settrace)
{
prvm_prog_t *prog = CLVM_prog;
float dz;
vec3_t move;
mfunction_t *oldf;
int oldself;
- qboolean settrace;
+ qbool settrace;
VM_SAFEPARMCOUNTRANGE(2, 3, VM_CL_walkmove);
matrix4x4_t entrendermatrix;
vec3_t clviewangles;
vec3_t clvelocity;
- qboolean teleported;
- qboolean clonground;
- qboolean clcmdjump;
- qboolean cldead;
- qboolean clintermission;
+ qbool teleported;
+ qbool clonground;
+ qbool clcmdjump;
+ qbool cldead;
+ qbool clintermission;
float clstatsviewheight;
prvm_edict_t *ent;
int flags;
// we only run the +whatever commandline arguments once
-qboolean host_stuffcmdsrun = false;
+qbool host_stuffcmdsrun = false;
//=============================================================================
Returns true if command is complete
============
*/
-static qboolean Cbuf_ParseText(char **start, size_t *size)
+static qbool Cbuf_ParseText(char **start, size_t *size)
{
int i = 0;
- qboolean quotes = false;
- qboolean comment = false; // Does not imply end because we might be starting the line with a comment.
- qboolean escaped = false;
- qboolean end = false; // Reached the end of a valid command
+ qbool quotes = false;
+ qbool comment = false; // Does not imply end because we might be starting the line with a comment.
+ qbool escaped = false;
+ qbool end = false; // Reached the end of a valid command
char *offset = NULL; // Non-NULL if valid command. Used by the caller to know where to start copying.
size_t cmdsize = 0; // Non-zero if valid command. Basically bytes to copy for the caller.
static void Cbuf_LinkCreate(cmd_state_t *cmd, llist_t *head, cmd_input_t *existing, const char *text)
{
char *in = (char *)&text[0];
- qboolean complete;
+ qbool complete;
cbuf_t *cbuf = cmd->cbuf;
size_t totalsize = 0, newsize = 0;
cmd_input_t *current = NULL;
Cbuf_Execute
============
*/
-static qboolean Cmd_PreprocessString(cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias );
+static qbool Cmd_PreprocessString(cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias );
void Cbuf_Execute (cbuf_t *cbuf)
{
cmd_input_t *current;
{
char *f;
size_t filenameLen = strlen(filename);
- qboolean isdefaultcfg =
+ qbool isdefaultcfg =
!strcmp(filename, "default.cfg") ||
(filenameLen >= 12 && !strcmp(filename + filenameLen - 12, "/default.cfg"));
=============================================================================
*/
-static const char *Cmd_GetDirectCvarValue(cmd_state_t *cmd, const char *varname, cmd_alias_t *alias, qboolean *is_multiple)
+static const char *Cmd_GetDirectCvarValue(cmd_state_t *cmd, const char *varname, cmd_alias_t *alias, qbool *is_multiple)
{
cvar_t *cvar;
long argno;
return NULL;
}
-qboolean Cmd_QuoteString(char *out, size_t outlen, const char *in, const char *quoteset, qboolean putquotes)
+qbool Cmd_QuoteString(char *out, size_t outlen, const char *in, const char *quoteset, qbool putquotes)
{
- qboolean quote_quot = !!strchr(quoteset, '"');
- qboolean quote_backslash = !!strchr(quoteset, '\\');
- qboolean quote_dollar = !!strchr(quoteset, '$');
+ qbool quote_quot = !!strchr(quoteset, '"');
+ qbool quote_backslash = !!strchr(quoteset, '\\');
+ qbool quote_dollar = !!strchr(quoteset, '$');
if(putquotes)
{
static char varval[MAX_INPUTLINE]; // cmd_mutex
const char *varstr = NULL;
char *varfunc;
- qboolean required = false;
- qboolean optional = false;
+ qbool required = false;
+ qbool optional = false;
static char asis[] = "asis"; // just to suppress const char warnings
if(varlen >= MAX_INPUTLINE)
varstr = Cmd_GetDirectCvarValue(cmd, Cmd_GetDirectCvarValue(cmd, varname + 1, alias, NULL), alias, NULL);
else
{
- qboolean is_multiple = false;
+ qbool is_multiple = false;
// Exception: $* and $n- don't use the quoted form by default
varstr = Cmd_GetDirectCvarValue(cmd, varname, alias, &is_multiple);
if(is_multiple)
Preprocesses strings and replaces $*, $param#, $cvar accordingly. Also strips comments.
*/
-static qboolean Cmd_PreprocessString(cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias ) {
+static qbool Cmd_PreprocessString(cmd_state_t *cmd, const char *intext, char *outtext, unsigned maxoutlen, cmd_alias_t *alias ) {
const char *in;
size_t eat, varlen;
unsigned outlen;
{
static char buffer[ MAX_INPUTLINE ]; // cmd_mutex
static char buffer2[ MAX_INPUTLINE ]; // cmd_mutex
- qboolean ret = Cmd_PreprocessString( cmd, alias->value, buffer, sizeof(buffer) - 2, alias );
+ qbool ret = Cmd_PreprocessString( cmd, alias->value, buffer, sizeof(buffer) - 2, alias );
if(!ret)
return;
// insert at start of command buffer, so that aliases execute in order
const char *partial;
size_t len;
int count;
- qboolean ispattern;
+ qbool ispattern;
if (Cmd_Argc(cmd) > 1)
{
cmd_alias_t *alias;
const char *partial;
int count;
- qboolean ispattern;
+ qbool ispattern;
char vabuf[1024];
if (Cmd_Argc(cmd) > 1)
cmd_function_t *prev, *current;
cmd_state_t *cmd;
xcommand_t save = NULL;
- qboolean auto_add = false;
+ qbool auto_add = false;
int i;
for (i = 0; i < 3; i++)
}
}
-static int Cmd_Compare(const char *s1, const char *s2, size_t len, qboolean casesensitive)
+static int Cmd_Compare(const char *s1, const char *s2, size_t len, qbool casesensitive)
{
if(len)
return (casesensitive ? strncmp(s1, s2, len) : strncasecmp(s1, s2, len));
return (casesensitive ? strcmp(s1, s2) : strcasecmp(s1, s2));
}
-cmd_function_t *Cmd_GetCommand(cmd_state_t *cmd, const char *partial, size_t len, qboolean casesensitive)
+cmd_function_t *Cmd_GetCommand(cmd_state_t *cmd, const char *partial, size_t len, qbool casesensitive)
{
cmd_function_t *func = NULL;
Cmd_Exists
============
*/
-qboolean Cmd_Exists (cmd_state_t *cmd, const char *cmd_name)
+qbool Cmd_Exists (cmd_state_t *cmd, const char *cmd_name)
{
if(Cmd_GetCommand(cmd, cmd_name, 0, true))
return true;
FIXME: lookupnoadd the token to speed search?
============
*/
-void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qboolean lockmutex)
+void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qbool lockmutex)
{
int oldpos;
cmd_function_t *func;
struct cmd_alias_s *next;
char name[MAX_ALIAS_NAME];
char *value;
- qboolean initstate; // indicates this command existed at init
+ qbool initstate; // indicates this command existed at init
char *initialvalue; // backup copy of value at init
} cmd_alias_t;
const char *name;
const char *description;
xcommand_t function;
- qboolean csqcfunc;
- qboolean autofunc;
- qboolean initstate; // indicates this command existed at init
+ qbool csqcfunc;
+ qbool autofunc;
+ qbool initstate; // indicates this command existed at init
} cmd_function_t;
typedef struct cmddeferred_s
double delay;
size_t size;
char text[MAX_INPUTLINE];
- qboolean pending;
+ qbool pending;
} cmd_input_t;
typedef struct cbuf_s
llist_t start;
llist_t deferred;
llist_t free;
- qboolean wait;
+ qbool wait;
size_t maxsize;
size_t size;
char tokenizebuffer[CMD_TOKENIZELENGTH];
// uses cmddefs_null
extern cmd_state_t cmd_serverfromclient;
-extern qboolean host_stuffcmdsrun;
+extern qbool host_stuffcmdsrun;
void Cbuf_Lock(cbuf_t *cbuf);
void Cbuf_Unlock(cbuf_t *cbuf);
// register commands and functions to call for them.
// The cmd_name is referenced later, so it should not be in temp memory
-cmd_function_t *Cmd_GetCommand(cmd_state_t *cmd, const char *partial, size_t len, qboolean casesensitive);
+cmd_function_t *Cmd_GetCommand(cmd_state_t *cmd, const char *partial, size_t len, qbool casesensitive);
/// used by the cvar code to check for cvar / command name overlap
-qboolean Cmd_Exists (cmd_state_t *cmd, const char *cmd_name);
+qbool Cmd_Exists (cmd_state_t *cmd, const char *cmd_name);
/// attempts to match a partial command for automatic command line completion
/// returns NULL if nothing fits
/// Parses a single line of text into arguments and tries to execute it.
/// The text can come from the command buffer, a remote client, or stdin.
-void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qboolean lockmutex);
+void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qbool lockmutex);
/// quotes a string so that it can be used as a command argument again;
/// quoteset is a string that contains one or more of ", \, $ and specifies
/// "\"\\$"). Returns true on success, and false on overrun (in which case out
/// will contain a part of the quoted string). If putquotes is set, the
/// enclosing quote marks are also put.
-qboolean Cmd_QuoteString(char *out, size_t outlen, const char *in, const char *quoteset, qboolean putquotes);
+qbool Cmd_QuoteString(char *out, size_t outlen, const char *in, const char *quoteset, qbool putquotes);
void Cmd_ClearCSQCCommands (cmd_state_t *cmd);
}
}
-qboolean Collision_PointInsideBrushFloat(const vec3_t point, const colbrushf_t *brush)
+qbool Collision_PointInsideBrushFloat(const vec3_t point, const colbrushf_t *brush)
{
int nplane;
const colplanef_t *plane;
typedef struct collision_cachedtrace_s
{
- qboolean valid;
+ qbool valid;
collision_cachedtrace_parameters_t p;
trace_t result;
}
static unsigned int *collision_cachedtrace_arrayhashindex;
static unsigned int *collision_cachedtrace_arraynext;
static unsigned char *collision_cachedtrace_arrayused;
-static qboolean collision_cachedtrace_rebuildhash;
+static qbool collision_cachedtrace_rebuildhash;
-void Collision_Cache_Reset(qboolean resetlimits)
+void Collision_Cache_Reset(qbool resetlimits)
{
if (collision_cachedtrace_hash)
Mem_Free(collision_cachedtrace_hash);
Collision_ClipExtendFinish(&extendtraceinfo);
}
-void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t tstart, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qboolean hitsurfaces)
+void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const frameblend_t *frameblend, const skeleton_t *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t tstart, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces)
{
vec3_t starttransformed, endtransformed;
extendtraceinfo_t extendtraceinfo;
Matrix4x4_TransformPositivePlane(matrix, trace->plane.normal[0], trace->plane.normal[1], trace->plane.normal[2], trace->plane.dist, trace->plane.normal_and_dist);
}
-void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstart, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qboolean hitsurfaces)
+void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstart, const vec3_t tend, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces)
{
extendtraceinfo_t extendtraceinfo;
Collision_ClipExtendPrepare(&extendtraceinfo, trace, tstart, tend, extend);
VectorCopy(start, trace->endpos);
}
-void Collision_CombineTraces(trace_t *cliptrace, const trace_t *trace, void *touch, qboolean isbmodel)
+void Collision_CombineTraces(trace_t *cliptrace, const trace_t *trace, void *touch, qbool isbmodel)
{
// take the 'best' answers from the new trace and combine with existing data
if (trace->allsolid)
void Collision_ClipTrace_Box(trace_t *trace, const vec3_t cmins, const vec3_t cmaxs, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, int boxsupercontents, int boxq3surfaceflags, const texture_t *boxtexture);
void Collision_ClipTrace_Point(trace_t *trace, const vec3_t cmins, const vec3_t cmaxs, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, int boxsupercontents, int boxq3surfaceflags, const texture_t *boxtexture);
-void Collision_Cache_Reset(qboolean resetlimits);
+void Collision_Cache_Reset(qbool resetlimits);
void Collision_Cache_Init(mempool_t *mempool);
void Collision_Cache_NewFrame(void);
void Collision_TraceLineBrushFloat(trace_t *trace, const vec3_t linestart, const vec3_t lineend, const colbrushf_t *thatbrush_start, const colbrushf_t *thatbrush_end);
void Collision_TraceLineTriangleMeshFloat(trace_t *trace, const vec3_t linestart, const vec3_t lineend, int numtriangles, const int *element3i, const float *vertex3f, int stride, float *bbox6f, int supercontents, int q3surfaceflags, const texture_t *texture, const vec3_t segmentmins, const vec3_t segmentmaxs);
void Collision_TracePointBrushFloat(trace_t *trace, const vec3_t point, const colbrushf_t *thatbrush);
-qboolean Collision_PointInsideBrushFloat(const vec3_t point, const colbrushf_t *brush);
+qbool Collision_PointInsideBrushFloat(const vec3_t point, const colbrushf_t *brush);
void Collision_BrushForBox(colboxbrushf_t *boxbrush, const vec3_t mins, const vec3_t maxs, int supercontents, int q3surfaceflags, const texture_t *texture);
struct frameblend_s;
struct skeleton_s;
void Collision_ClipToGenericEntity(trace_t *trace, dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend);
-void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qboolean hitsurfaces);
+void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces);
void Collision_ClipPointToGenericEntity(trace_t *trace, dp_model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, const vec3_t bodymins, const vec3_t bodymaxs, int bodysupercontents, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
// like above but does not do a transform and does nothing if model is NULL
void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend);
-void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qboolean hitsurfaces);
+void Collision_ClipLineToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitsurfaces);
void Collision_ClipPointToWorld(trace_t *trace, dp_model_t *model, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
// caching surface trace for renderer (NOT THREAD SAFE)
void Collision_Cache_ClipLineToGenericEntitySurfaces(trace_t *trace, dp_model_t *model, matrix4x4_t *matrix, matrix4x4_t *inversematrix, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
// combines data from two traces:
// merges contents flags, startsolid, allsolid, inwater
// updates fraction, endpos, plane and surface info if new fraction is shorter
-void Collision_CombineTraces(trace_t *cliptrace, const trace_t *trace, void *touch, qboolean isbmodel);
+void Collision_CombineTraces(trace_t *cliptrace, const trace_t *trace, void *touch, qbool isbmodel);
// this enables rather large debugging spew!
// settings:
__List_Splice(list, head->prev, head);
}
-qboolean List_IsFirst(llist_t *list, llist_t *start)
+qbool List_IsFirst(llist_t *list, llist_t *start)
{
return list->prev == start;
}
-qboolean List_IsLast(llist_t *list, llist_t *start)
+qbool List_IsLast(llist_t *list, llist_t *start)
{
return list->next == start;
}
-qboolean List_IsEmpty(const llist_t *list)
+qbool List_IsEmpty(const llist_t *list)
{
return list->next == list;
}
\ No newline at end of file
void List_Rotate_To_Front(llist_t *list, llist_t *head);
void List_Splice(const llist_t *list, llist_t *head);
void List_Splice_Tail(const llist_t *list, llist_t *head);
-qboolean List_IsFirst(llist_t *list, llist_t *start);
-qboolean List_IsLast(llist_t *list, llist_t *start);
-qboolean List_IsEmpty(const llist_t *list);
\ No newline at end of file
+qbool List_IsFirst(llist_t *list, llist_t *start);
+qbool List_IsLast(llist_t *list, llist_t *start);
+qbool List_IsEmpty(const llist_t *list);
\ No newline at end of file
// If it fits, append it. Continue.
// If it doesn't fit, output current line, advance to next line. Append the word. This is a continuation. Continue.
- qboolean isContinuation = false;
+ qbool isContinuation = false;
float spaceWidth;
const char *startOfLine = string;
const char *cursor = string;
return result;
/*
- qboolean isContinuation = false;
+ qbool isContinuation = false;
float currentWordSpace = 0;
const char *currentWord = 0;
float minReserve = 0;
Parse a token out of a string
==============
*/
-int COM_ParseToken_Simple(const char **datapointer, qboolean returnnewline, qboolean parsebackslash, qboolean parsecomments)
+int COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments)
{
int len;
int c;
Parse a token out of a string
==============
*/
-int COM_ParseToken_QuakeC(const char **datapointer, qboolean returnnewline)
+int COM_ParseToken_QuakeC(const char **datapointer, qbool returnnewline)
{
int len;
int c;
Parse a token out of a string
==============
*/
-int COM_ParseToken_VM_Tokenize(const char **datapointer, qboolean returnnewline)
+int COM_ParseToken_VM_Tokenize(const char **datapointer, qbool returnnewline)
{
int len;
int c;
============
*/
size_t
-COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid)
+COM_StringLengthNoColors(const char *s, size_t size_s, qbool *valid)
{
const char *end = size_s ? (s + size_s) : NULL;
size_t len = 0;
all characters until the zero terminator.
============
*/
-qboolean
-COM_StringDecolorize(const char *in, size_t size_in, char *out, size_t size_out, qboolean escape_carets)
+qbool
+COM_StringDecolorize(const char *in, size_t size_in, char *out, size_t size_out, qbool escape_carets)
{
#define APPEND(ch) do { if(--size_out) { *out++ = (ch); } else { *out++ = 0; return false; } } while(0)
const char *end = size_in ? (in + size_in) : NULL;
typedef struct sizebuf_s
{
- qboolean allowoverflow; ///< if false, do a Sys_Error
- qboolean overflowed; ///< set to true if the buffer size failed
+ qbool allowoverflow; ///< if false, do a Sys_Error
+ qbool overflowed; ///< set to true if the buffer size failed
unsigned char *data;
int maxsize;
int cursize;
int readcount;
- qboolean badread; // set if a read goes beyond end of message
+ qbool badread; // set if a read goes beyond end of message
} sizebuf_t;
void SZ_Clear (sizebuf_t *buf);
//============================================================================
typedef float (*COM_WordWidthFunc_t) (void *passthrough, const char *w, size_t *length, float maxWidth); // length is updated to the longest fitting string into maxWidth; if maxWidth < 0, all characters are used and length is used as is
-typedef int (*COM_LineProcessorFunc) (void *passthrough, const char *line, size_t length, float width, qboolean isContination);
+typedef int (*COM_LineProcessorFunc) (void *passthrough, const char *line, size_t length, float width, qbool isContination);
int COM_Wordwrap(const char *string, size_t length, float continuationSize, float maxWidth, COM_WordWidthFunc_t wordWidth, void *passthroughCW, COM_LineProcessorFunc processLine, void *passthroughPL);
extern char com_token[MAX_INPUTLINE];
-int COM_ParseToken_Simple(const char **datapointer, qboolean returnnewline, qboolean parsebackslash, qboolean parsecomments);
-int COM_ParseToken_QuakeC(const char **datapointer, qboolean returnnewline);
-int COM_ParseToken_VM_Tokenize(const char **datapointer, qboolean returnnewline);
+int COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments);
+int COM_ParseToken_QuakeC(const char **datapointer, qbool returnnewline);
+int COM_ParseToken_VM_Tokenize(const char **datapointer, qbool returnnewline);
int COM_ParseToken_Console(const char **datapointer);
void COM_Init (void);
int COM_ReadAndTokenizeLine(const char **text, char **argv, int maxargc, char *tokenbuf, int tokenbufsize, const char *commentprefix);
-size_t COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid);
-qboolean COM_StringDecolorize(const char *in, size_t size_in, char *out, size_t size_out, qboolean escape_carets);
+size_t COM_StringLengthNoColors(const char *s, size_t size_s, qbool *valid);
+qbool COM_StringDecolorize(const char *in, size_t size_in, char *out, size_t size_out, qbool escape_carets);
void COM_ToLowerString (const char *in, char *out, size_t size_out);
void COM_ToUpperString (const char *in, char *out, size_t size_out);
} stringlist_t;
int matchpattern(const char *in, const char *pattern, int caseinsensitive);
-int matchpattern_with_separator(const char *in, const char *pattern, int caseinsensitive, const char *separators, qboolean wildcard_least_one);
+int matchpattern_with_separator(const char *in, const char *pattern, int caseinsensitive, const char *separators, qbool wildcard_least_one);
void stringlistinit(stringlist_t *list);
void stringlistfreecontents(stringlist_t *list);
void stringlistappend(stringlist_t *list, const char *text);
-void stringlistsort(stringlist_t *list, qboolean uniq);
+void stringlistsort(stringlist_t *list, qbool uniq);
void listdirectory(stringlist_t *list, const char *basepath, const char *path);
char *InfoString_GetValue(const char *buffer, const char *key, char *value, size_t valuelength);
int con_linewidth;
int con_vislines;
-qboolean con_initialized;
+qbool con_initialized;
// used for server replies to rcon command
lhnetsocket_t *rcon_redirect_sock = NULL;
lhnetaddress_t *rcon_redirect_dest = NULL;
int rcon_redirect_bufferpos = 0;
char rcon_redirect_buffer[1400];
-qboolean rcon_redirect_proquakeprotocol = false;
+qbool rcon_redirect_proquakeprotocol = false;
// generic functions for console buffers
lhnetaddress_t log_dest_addr;
lhnetsocket_t *log_dest_socket;
const char *s = log_dest_udp.string;
- qboolean have_opened_temp_sockets = false;
+ qbool have_opened_temp_sockets = false;
if(s) if(log_dest_buffer_pos > 5)
{
++log_dest_buffer_appending;
*/
void Log_ConPrint (const char *msg)
{
- static qboolean inprogress = false;
+ static qbool inprogress = false;
// don't allow feedback loops with memory error reports
if (inprogress)
}
}
-void Con_Rcon_Redirect_Init(lhnetsocket_t *sock, lhnetaddress_t *dest, qboolean proquakeprotocol)
+void Con_Rcon_Redirect_Init(lhnetsocket_t *sock, lhnetaddress_t *dest, qbool proquakeprotocol)
{
rcon_redirect_sock = sock;
rcon_redirect_dest = dest;
*/
extern cvar_t timestamps;
extern cvar_t timeformat;
-extern qboolean sys_nostdout;
+extern qbool sys_nostdout;
void Con_MaskPrint(int additionalmask, const char *msg)
{
static int mask = 0;
Modified by EvilTypeGuy eviltypeguy@qeradiant.com
================
*/
-static void Con_DrawInput(qboolean is_console, float x, float v, float inputsize)
+static void Con_DrawInput(qbool is_console, float x, float v, float inputsize)
{
int y, i, col_out, linepos, text_start, prefix_start;
char text[MAX_INPUTLINE + 5 + 9 + 1]; // space for ^xRGB, "say_team:" and \0
}
}
-static int Con_CountLineFunc(void *passthrough, const char *line, size_t length, float width, qboolean isContinuation)
+static int Con_CountLineFunc(void *passthrough, const char *line, size_t length, float width, qbool isContinuation)
{
(void) passthrough;
(void) line;
return 1;
}
-static int Con_DisplayLineFunc(void *passthrough, const char *line, size_t length, float width, qboolean isContinuation)
+static int Con_DisplayLineFunc(void *passthrough, const char *line, size_t length, float width, qbool isContinuation)
{
con_text_info_t *ti = (con_text_info_t *) passthrough;
//LadyHavoc: rewrote bsp type detection, rewrote message extraction to do proper worldspawn parsing
//LadyHavoc: added .ent file loading, and redesigned error handling to still try the .ent file even if the map format is not recognized, this also eliminated one goto
//LadyHavoc: FIXME: man this GetMapList is STILL ugly code even after my cleanups...
-qboolean GetMapList (const char *s, char *completedname, int completednamebufferlength)
+qbool GetMapList (const char *s, char *completedname, int completednamebufferlength)
{
fssearch_t *t;
char message[1024];
// if A contains a non-alphanumeric, B must contain it as well though!
while(a_len)
{
- qboolean alnum_a, alnum_b;
+ qbool alnum_a, alnum_b;
if(tolower(*a) == tolower(*b))
{
Count the number of possible nicks to complete
*/
-static int Nicks_CompleteCountPossible(char *line, int pos, char *s, qboolean isCon)
+static int Nicks_CompleteCountPossible(char *line, int pos, char *s, qbool isCon)
{
char name[MAX_SCOREBOARDNAME];
int i, p;
*/
static int Nicks_AddLastColor(char *buffer, int pos)
{
- qboolean quote_added = false;
+ qbool quote_added = false;
int match;
int color = STRING_COLOR_DEFAULT + '0';
char r = 0, g = 0, b = 0;
Enhanced to tab-complete map names by [515]
*/
-int Con_CompleteCommandLine(cmd_state_t *cmd, qboolean is_console)
+int Con_CompleteCommandLine(cmd_state_t *cmd, qbool is_console)
{
const char *text = "";
char *s;
//
extern int con_totallines;
extern int con_backscroll;
-extern qboolean con_initialized;
+extern qbool con_initialized;
-void Con_Rcon_Redirect_Init(lhnetsocket_t *sock, lhnetaddress_t *dest, qboolean proquakeprotocol);
+void Con_Rcon_Redirect_Init(lhnetsocket_t *sock, lhnetaddress_t *dest, qbool proquakeprotocol);
void Con_Rcon_Redirect_End(void);
void Con_Rcon_Redirect_Abort(void);
void Con_ClearNotify (void);
void Con_ToggleConsole_f(cmd_state_t *cmd);
-qboolean GetMapList (const char *s, char *completedname, int completednamebufferlength);
+qbool GetMapList (const char *s, char *completedname, int completednamebufferlength);
/// wrapper function to attempt to either complete the command line
/// or to list possible matches grouped by type
/// (i.e. will display possible variables, aliases, commands
/// that match what they've typed so far)
-int Con_CompleteCommandLine(cmd_state_t *cmd, qboolean is_console);
+int Con_CompleteCommandLine(cmd_state_t *cmd, qbool is_console);
/// Generic libs/util/console.c function to display a list
/// formatted in columns on the console
typedef struct conbuffer_s
{
- qboolean active;
+ qbool active;
int textsize;
char *text;
int maxlines;
// end of d0_blind_id interface
static dllhandle_t d0_blind_id_dll = NULL;
-static qboolean Crypto_OpenLibrary (void)
+static qbool Crypto_OpenLibrary (void)
{
const char* dllnames [] =
{
// end of d0_blind_id interface
static dllhandle_t d0_rijndael_dll = NULL;
-static qboolean Crypto_Rijndael_OpenLibrary (void)
+static qbool Crypto_Rijndael_OpenLibrary (void)
{
const char* dllnames [] =
{
qd0_blind_id_util_sha256((char *) out, (const char *) in, n);
}
-static size_t Crypto_LoadFile(const char *path, char *buf, size_t nmax, qboolean inuserdir)
+static size_t Crypto_LoadFile(const char *path, char *buf, size_t nmax, qbool inuserdir)
{
char vabuf[1024];
qfile_t *f = NULL;
return (size_t) n;
}
-static qboolean PutWithNul(char **data, size_t *len, const char *str)
+static qbool PutWithNul(char **data, size_t *len, const char *str)
{
// invariant: data points to insertion point
size_t l = strlen(str);
}
// d0si reading
-static qboolean Crypto_AddPrivateKey(d0_blind_id_t *pk, char *buf, size_t len)
+static qbool Crypto_AddPrivateKey(d0_blind_id_t *pk, char *buf, size_t len)
{
const char *p[1];
size_t l[1];
#define MAX_PUBKEYS 16
static d0_blind_id_t *pubkeys[MAX_PUBKEYS];
static char pubkeys_fp64[MAX_PUBKEYS][FP64_SIZE+1];
-static qboolean pubkeys_havepriv[MAX_PUBKEYS];
-static qboolean pubkeys_havesig[MAX_PUBKEYS];
+static qbool pubkeys_havepriv[MAX_PUBKEYS];
+static qbool pubkeys_havesig[MAX_PUBKEYS];
static char pubkeys_priv_fp64[MAX_PUBKEYS][FP64_SIZE+1];
static char challenge_append[1400];
static size_t challenge_append_length;
int next_step;
char challenge[2048];
char wantserver_idfp[FP64_SIZE+1];
- qboolean wantserver_aes;
- qboolean wantserver_issigned;
+ qbool wantserver_aes;
+ qbool wantserver_issigned;
int cdata_id;
}
crypto_data_t;
#define MAKE_CDATA if(!crypto->data) crypto->data = Z_Malloc(sizeof(crypto_data_t))
#define CLEAR_CDATA if(crypto->data) { if(CDATA->id) qd0_blind_id_free(CDATA->id); Z_Free(crypto->data); } crypto->data = NULL
-static crypto_t *Crypto_ServerFindInstance(lhnetaddress_t *peeraddress, qboolean allow_create)
+static crypto_t *Crypto_ServerFindInstance(lhnetaddress_t *peeraddress, qbool allow_create)
{
crypto_t *crypto;
int i, best;
return crypto;
}
-qboolean Crypto_FinishInstance(crypto_t *out, crypto_t *crypto)
+qbool Crypto_FinishInstance(crypto_t *out, crypto_t *crypto)
{
// no check needed here (returned pointers are only used in prefilled fields)
if(!crypto || !crypto->authenticated)
int keyid;
char idfp[FP64_SIZE+1];
int aeslevel;
- qboolean issigned;
+ qbool issigned;
}
crypto_storedhostkey_t;
static crypto_storedhostkey_t *crypto_storedhostkey_hashtable[CRYPTO_HOSTKEY_HASHSIZE];
}
}
-static qboolean Crypto_ClearHostKey(lhnetaddress_t *peeraddress)
+static qbool Crypto_ClearHostKey(lhnetaddress_t *peeraddress)
{
char buf[128];
int hashindex;
crypto_storedhostkey_t **hkp;
- qboolean found = false;
+ qbool found = false;
LHNETADDRESS_ToString(peeraddress, buf, sizeof(buf), 1);
hashindex = CRC_Block((const unsigned char *) buf, strlen(buf)) % CRYPTO_HOSTKEY_HASHSIZE;
return found;
}
-static void Crypto_StoreHostKey(lhnetaddress_t *peeraddress, const char *keystring, qboolean complain)
+static void Crypto_StoreHostKey(lhnetaddress_t *peeraddress, const char *keystring, qbool complain)
{
char buf[128];
int hashindex;
int keyid;
char idfp[FP64_SIZE+1];
int aeslevel;
- qboolean issigned;
+ qbool issigned;
if(!d0_blind_id_dll)
return;
{
// id@key
const char *idstart, *idend, *keystart, *keyend;
- qboolean thisissigned = true;
+ qbool thisissigned = true;
++keystring; // skip the space
idstart = keystring;
while(*keystring && *keystring != ' ' && *keystring != '@')
crypto_storedhostkey_hashtable[hashindex] = hk;
}
-qboolean Crypto_RetrieveHostKey(lhnetaddress_t *peeraddress, int *keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, int *aeslevel, qboolean *issigned)
+qbool Crypto_RetrieveHostKey(lhnetaddress_t *peeraddress, int *keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, int *aeslevel, qbool *issigned)
{
char buf[128];
int hashindex;
return true;
}
-int Crypto_RetrieveLocalKey(int keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, qboolean *issigned) // return value: -1 if more to come, +1 if valid, 0 if end of list
+int Crypto_RetrieveLocalKey(int keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, qbool *issigned) // return value: -1 if more to come, +1 if valid, 0 if end of list
{
if(keyid < 0 || keyid >= MAX_PUBKEYS)
return 0;
challenge_append_length = p - challenge_append;
}
-static qboolean Crypto_SavePubKeyTextFile(int i)
+static qbool Crypto_SavePubKeyTextFile(int i)
{
qfile_t *f;
char vabuf[1024];
}
// end
-qboolean Crypto_Available(void)
+qbool Crypto_Available(void)
{
if(!d0_blind_id_dll)
return false;
}
// network protocol
-qboolean Crypto_ServerAppendToChallenge(const char *data_in, size_t len_in, char *data_out, size_t *len_out, size_t maxlen_out)
+qbool Crypto_ServerAppendToChallenge(const char *data_in, size_t len_in, char *data_out, size_t *len_out, size_t maxlen_out)
{
// cheap op, all is precomputed
if(!d0_blind_id_dll)
double t = 0;
static double complain_time = 0;
const char *cnt;
- qboolean do_time = false;
- qboolean do_reject = false;
+ qbool do_time = false;
+ qbool do_reject = false;
char infostringvalue[MAX_INPUTLINE];
if(crypto_servercpupercent.value > 0 || crypto_servercpumaxtime.value > 0)
if(len_in > 5 && !memcmp(data_in, "d0pk\\", 5))
const char *p;
int i;
int clientid = -1, serverid = -1, wantserverid = -1;
- qboolean server_can_auth = true;
+ qbool server_can_auth = true;
char wantserver_idfp[FP64_SIZE+1];
int wantserver_aeslevel = 0;
- qboolean wantserver_issigned = false;
+ qbool wantserver_issigned = false;
// Must check the source IP here, if we want to prevent other servers' replies from falsely advancing the crypto state, preventing successful connect to the real server.
if (net_sourceaddresscheck.integer && LHNETADDRESS_Compare(peeraddress, &cls.connect_address))
unsigned char dhkey[DHKEY_SIZE]; // shared key, not NUL terminated
char client_idfp[FP64_SIZE+1];
char client_keyfp[FP64_SIZE+1];
- qboolean client_issigned;
+ qbool client_issigned;
char server_idfp[FP64_SIZE+1];
char server_keyfp[FP64_SIZE+1];
- qboolean server_issigned;
- qboolean authenticated;
- qboolean use_aes;
+ qbool server_issigned;
+ qbool authenticated;
+ qbool use_aes;
void *data;
}
crypto_t;
void Crypto_Init_Commands(void);
void Crypto_LoadKeys(void); // NOTE: when this is called, the SV_LockThreadMutex MUST be active
void Crypto_Shutdown(void);
-qboolean Crypto_Available(void);
+qbool Crypto_Available(void);
void sha256(unsigned char *out, const unsigned char *in, int n); // may ONLY be called if Crypto_Available()
const void *Crypto_EncryptPacket(crypto_t *crypto, const void *data_src, size_t len_src, void *data_dst, size_t *len_dst, size_t len);
const void *Crypto_DecryptPacket(crypto_t *crypto, const void *data_src, size_t len_src, void *data_dst, size_t *len_dst, size_t len);
// if len_out is nonzero, the packet is to be sent to the client
-qboolean Crypto_ServerAppendToChallenge(const char *data_in, size_t len_in, char *data_out, size_t *len_out, size_t maxlen);
+qbool Crypto_ServerAppendToChallenge(const char *data_in, size_t len_in, char *data_out, size_t *len_out, size_t maxlen);
crypto_t *Crypto_ServerGetInstance(lhnetaddress_t *peeraddress);
-qboolean Crypto_FinishInstance(crypto_t *out, crypto_t *in); // also clears allocated memory, and frees the instance received by ServerGetInstance
+qbool Crypto_FinishInstance(crypto_t *out, crypto_t *in); // also clears allocated memory, and frees the instance received by ServerGetInstance
const char *Crypto_GetInfoResponseDataString(void);
// retrieves a host key for an address (can be exposed to menuqc, or used by the engine to look up stored keys e.g. for server bookmarking)
// pointers may be NULL
-qboolean Crypto_RetrieveHostKey(lhnetaddress_t *peeraddress, int *keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, int *aeslevel, qboolean *issigned);
-int Crypto_RetrieveLocalKey(int keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, qboolean *issigned); // return value: -1 if more to come, +1 if valid, 0 if end of list
+qbool Crypto_RetrieveHostKey(lhnetaddress_t *peeraddress, int *keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, int *aeslevel, qbool *issigned);
+int Crypto_RetrieveLocalKey(int keyid, char *keyfp, size_t keyfplen, char *idfp, size_t idfplen, qbool *issigned); // return value: -1 if more to come, +1 if valid, 0 if end of list
size_t Crypto_SignData(const void *data, size_t datasize, int keyid, void *signed_data, size_t signed_size);
size_t Crypto_SignDataDetached(const void *data, size_t datasize, int keyid, void *signed_data, size_t signed_size);
}
extern cvar_t cl_noplayershadow;
-qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
+qbool CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
{
prvm_prog_t *prog = CLVM_prog;
int renderflags;
// 1 = keyup, key, character (EXT_CSQC)
// 2 = mousemove relative, x, y (EXT_CSQC)
// 3 = mousemove absolute, x, y (DP_CSQC)
-qboolean CL_VM_InputEvent (int eventtype, float x, float y)
+qbool CL_VM_InputEvent (int eventtype, float x, float y)
{
prvm_prog_t *prog = CLVM_prog;
- qboolean r;
+ qbool r;
if(!cl.csqc_loaded)
return false;
extern r_refdef_view_t csqc_original_r_refdef_view;
extern r_refdef_view_t csqc_main_r_refdef_view;
-qboolean CL_VM_UpdateView (double frametime)
+qbool CL_VM_UpdateView (double frametime)
{
prvm_prog_t *prog = CLVM_prog;
vec3_t emptyvector;
return true;
}
-qboolean CL_VM_ConsoleCommand (const char *text)
+qbool CL_VM_ConsoleCommand (const char *text)
{
prvm_prog_t *prog = CLVM_prog;
int restorevm_tempstringsbuf_cursize;
- qboolean r = false;
+ qbool r = false;
if(!cl.csqc_loaded)
return false;
CSQC_BEGIN
return r;
}
-qboolean CL_VM_Parse_TempEntity (void)
+qbool CL_VM_Parse_TempEntity (void)
{
prvm_prog_t *prog = CLVM_prog;
int t;
- qboolean r = false;
+ qbool r = false;
if(!cl.csqc_loaded)
return false;
CSQC_BEGIN
CSQC_END
}
}
-qboolean CL_VM_Event_Sound(int sound_num, float fvolume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed)
+qbool CL_VM_Event_Sound(int sound_num, float fvolume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed)
{
prvm_prog_t *prog = CLVM_prog;
- qboolean r = false;
+ qbool r = false;
if(cl.csqc_loaded)
{
CSQC_BEGIN
Con_Printf("touch :%3i\n", solid);
}
-static qboolean CLVM_load_edict(prvm_prog_t *prog, prvm_edict_t *ent)
+static qbool CLVM_load_edict(prvm_prog_t *prog, prvm_edict_t *ent)
{
return true;
}
// returns true if the packet is valid, false if end of file is reached
// used for dumping the CSQC download into demo files
-qboolean MakeDownloadPacket(const char *filename, unsigned char *data, size_t len, int crc, int cnt, sizebuf_t *buf, int protocol)
+qbool MakeDownloadPacket(const char *filename, unsigned char *data, size_t len, int crc, int cnt, sizebuf_t *buf, int protocol)
{
int packetsize = buf->maxsize - 7; // byte short long
int npackets = ((int)len + packetsize - 1) / (packetsize);
cl.csqc_loaded = false;
}
-qboolean CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out)
+qbool CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out)
{
prvm_prog_t *prog = CLVM_prog;
prvm_edict_t *ed;
dp_model_t *mod;
matrix4x4_t matrix;
- qboolean r = 0;
+ qbool r = 0;
CSQC_BEGIN;
return r;
}
-qboolean CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clipplane, vec3_t visorigin)
+qbool CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clipplane, vec3_t visorigin)
{
prvm_prog_t *prog = CLVM_prog;
- qboolean ret = false;
+ qbool ret = false;
prvm_edict_t *ed;
vec3_t forward, left, up, origin, ang;
matrix4x4_t mat, matq;
void CL_VM_PreventInformationLeaks(void);
-qboolean MakeDownloadPacket(const char *filename, unsigned char *data, size_t len, int crc, int cnt, sizebuf_t *buf, int protocol);
+qbool MakeDownloadPacket(const char *filename, unsigned char *data, size_t len, int crc, int cnt, sizebuf_t *buf, int protocol);
-qboolean CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out);
+qbool CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out);
-qboolean CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clipplane, vec3_t visorigin);
+qbool CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clipplane, vec3_t visorigin);
void CL_VM_Init(void);
void CL_VM_ShutDown(void);
void CL_VM_UpdateIntermissionState(int intermission);
void CL_VM_UpdateShowingScoresState(int showingscores);
-qboolean CL_VM_InputEvent(int eventtype, float x, float y);
-qboolean CL_VM_ConsoleCommand(const char *text);
+qbool CL_VM_InputEvent(int eventtype, float x, float y);
+qbool CL_VM_ConsoleCommand(const char *text);
void CL_VM_UpdateDmgGlobals(int dmg_take, int dmg_save, vec3_t dmg_origin);
void CL_VM_UpdateIntermissionState(int intermission);
-qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed);
-qboolean CL_VM_Parse_TempEntity(void);
+qbool CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos, int flags, float speed);
+qbool CL_VM_Parse_TempEntity(void);
void CL_VM_Parse_StuffCmd(const char *msg);
void CL_VM_Parse_CenterPrint(const char *msg);
int CL_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent);
int CL_GetTagMatrix(prvm_prog_t *prog, matrix4x4_t *out, prvm_edict_t *ent, int tagindex, prvm_vec_t *shadingorigin);
-void CL_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatrix);
+void CL_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qbool viewmatrix);
void QW_CL_StartUpload(unsigned char *data, int size);
void CSQC_UpdateNetworkTimes(double newtime, double oldtime);
void CSQC_RelinkCSQCEntities(void);
void CSQC_Predraw(prvm_edict_t *ed);
void CSQC_Think(prvm_edict_t *ed);
-qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum);//csprogs.c
+qbool CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum);//csprogs.c
void CSQC_R_RecalcView(void);
dp_model_t *CL_GetModelByIndex(int modelindex);
{
for (x=0; x<width; x+=2)
{
- qboolean found = true;
+ qbool found = true;
for (j=0; j<numcomponents; j++)
if (fabs(*(vertex+j) - *(vertices+j)) > 0.05)
// div0: this is notably smaller than the smallest radiant grid
struct {int id1,id2;} commonverts[8];
int i, j, k, side1, side2, *tess1, *tess2;
int dist1 = 0, dist2 = 0;
- qboolean modified = false;
+ qbool modified = false;
// Potential paired vertices (corners of the first patch)
commonverts[0].id1 = 0;
return buf;
}
-void Cvar_PrintHelp(cvar_t *cvar, const char *name, qboolean full)
+void Cvar_PrintHelp(cvar_t *cvar, const char *name, qbool full)
{
// Aliases are purple, cvars are yellow
if (strcmp(cvar->name, name))
}
// check if a cvar is held by some progs
-static qboolean Cvar_IsAutoCvar(cvar_t *var)
+static qbool Cvar_IsAutoCvar(cvar_t *var)
{
int i;
prvm_prog_t *prog;
extern cvar_t sv_disablenotify;
static void Cvar_SetQuick_Internal (cvar_t *var, const char *value)
{
- qboolean changed;
+ qbool changed;
size_t valuelen;
changed = strcmp(var->string, value) != 0;
return cvar;
}
-qboolean Cvar_Readonly (cvar_t *var, const char *cmd_name)
+qbool Cvar_Readonly (cvar_t *var, const char *cmd_name)
{
if (var->flags & CVAR_READONLY)
{
Handles variable inspection and changing from the console
============
*/
-qboolean Cvar_Command (cmd_state_t *cmd)
+qbool Cvar_Command (cmd_state_t *cmd)
{
cvar_state_t *cvars = cmd->cvars;
cvar_t *v;
cvar_t *cvar;
const char *partial;
int count;
- qboolean ispattern;
+ qbool ispattern;
char vabuf[1024];
if (Cmd_Argc(cmd) > 1)
char *buf, *p, *q;
int n, i;
cvar_t *var;
- qboolean verify;
+ qbool verify;
if(Cmd_Argc(cmd) != 2)
{
Con_Printf("Usage: %s length to plant rubbish\n", Cmd_Argv(cmd, 0));
const char *defstring;
void (*callback)(struct cvar_s *var);
- qboolean ignore_callback;
+ qbool ignore_callback;
char **aliases;
int aliasindex;
// values at init (for Cvar_RestoreInitState)
- qboolean initstate; // indicates this existed at init
+ qbool initstate; // indicates this existed at init
int initflags;
const char *initstring;
const char *initdescription;
/// archive elements set.
void Cvar_RegisterVariable(cvar_t *variable);
-qboolean Cvar_Readonly (cvar_t *var, const char *cmd_name);
+qbool Cvar_Readonly (cvar_t *var, const char *cmd_name);
/// equivelant to "<name> <variable>" typed at the console
void Cvar_Set (cvar_state_t *cvars, const char *var_name, const char *value);
// attempts to match a partial variable name for command line completion
// returns NULL if nothing fits
-void Cvar_PrintHelp(cvar_t *cvar, const char *name, qboolean full);
+void Cvar_PrintHelp(cvar_t *cvar, const char *name, qbool full);
void Cvar_CompleteCvarPrint (cvar_state_t *cvars, const char *partial, int neededflags);
-qboolean Cvar_Command (cmd_state_t *cmd);
+qbool Cvar_Command (cmd_state_t *cmd);
// called by Cmd_ExecuteString when Cmd_Argv(cmd, 0) doesn't match a known
// command. Returns true if the command was a variable reference that
// was handled. (print or change)
// the color is tinted by the provided base color
// if r_textshadow is not zero, an additional instance of the text is drawn first at an offset with an inverted shade of gray (black text produces a white shadow, brightly colored text produces a black shadow)
extern float DrawQ_Color[4];
-float DrawQ_String(float x, float y, const char *text, size_t maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qboolean ignorecolorcodes, const dp_font_t *fnt);
-float DrawQ_String_Scale(float x, float y, const char *text, size_t maxlen, float sizex, float sizey, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qboolean ignorecolorcodes, const dp_font_t *fnt);
-float DrawQ_TextWidth(const char *text, size_t maxlen, float w, float h, qboolean ignorecolorcodes, const dp_font_t *fnt);
-float DrawQ_TextWidth_UntilWidth(const char *text, size_t *maxlen, float w, float h, qboolean ignorecolorcodes, const dp_font_t *fnt, float maxWidth);
-float DrawQ_TextWidth_UntilWidth_TrackColors(const char *text, size_t *maxlen, float w, float h, int *outcolor, qboolean ignorecolorcodes, const dp_font_t *fnt, float maxwidth);
-float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *maxlen, float w, float h, float sw, float sh, int *outcolor, qboolean ignorecolorcodes, const dp_font_t *fnt, float maxwidth);
+float DrawQ_String(float x, float y, const char *text, size_t maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt);
+float DrawQ_String_Scale(float x, float y, const char *text, size_t maxlen, float sizex, float sizey, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt);
+float DrawQ_TextWidth(const char *text, size_t maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt);
+float DrawQ_TextWidth_UntilWidth(const char *text, size_t *maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt, float maxWidth);
+float DrawQ_TextWidth_UntilWidth_TrackColors(const char *text, size_t *maxlen, float w, float h, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt, float maxwidth);
+float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *maxlen, float w, float h, float sw, float sh, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt, float maxwidth);
// draw a very fancy pic (per corner texcoord/color control), the order is tl, tr, bl, br
void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height, float s1, float t1, float r1, float g1, float b1, float a1, float s2, float t2, float r2, float g2, float b2, float a2, float s3, float t3, float r3, float g3, float b3, float a3, float s4, float t4, float r4, float g4, float b4, float a4, int flags);
// set the clipping area
const char *Draw_GetPicName(cachepic_t *pic);
int Draw_GetPicWidth(cachepic_t *pic);
int Draw_GetPicHeight(cachepic_t *pic);
-qboolean Draw_IsPicLoaded(cachepic_t *pic);
+qbool Draw_IsPicLoaded(cachepic_t *pic);
rtexture_t *Draw_GetPicTexture(cachepic_t *pic);
extern rtexturepool_t *drawtexturepool; // used by ft2.c
// wildcard_least_one: if true * matches 1 or more characters
// if false * matches 0 or more characters
-int matchpattern_with_separator(const char *in, const char *pattern, int caseinsensitive, const char *separators, qboolean wildcard_least_one)
+int matchpattern_with_separator(const char *in, const char *pattern, int caseinsensitive, const char *separators, qbool wildcard_least_one)
{
int c1, c2;
while (*pattern)
return strcasecmp(*(const char **)a, *(const char **)b);
}
-void stringlistsort(stringlist_t *list, qboolean uniq)
+void stringlistsort(stringlist_t *list, qbool uniq)
{
int i, j;
if(list->numstrings < 1)
filedesc_t handle;
int ignorecase; ///< PK3 ignores case
int numfiles;
- qboolean vpack;
+ qbool vpack;
packfile_t *files;
} pack_t;
//@}
void FS_Ls_f(cmd_state_t *cmd);
void FS_Which_f(cmd_state_t *cmd);
-static searchpath_t *FS_FindFile (const char *name, int* index, qboolean quiet);
+static searchpath_t *FS_FindFile (const char *name, int* index, qbool quiet);
static packfile_t* FS_AddFileToPack (const char* name, pack_t* pack,
fs_offset_t offset, fs_offset_t packsize,
fs_offset_t realsize, int flags);
Try to load the Zlib DLL
====================
*/
-static qboolean PK3_OpenLibrary (void)
+static qbool PK3_OpenLibrary (void)
{
#ifdef LINK_TO_ZLIB
return true;
See if zlib is available
====================
*/
-qboolean FS_HasZlib(void)
+qbool FS_HasZlib(void)
{
#ifdef LINK_TO_ZLIB
return true;
Extract the end of the central directory from a PK3 package
====================
*/
-static qboolean PK3_GetEndOfCentralDir (const char *packfile, filedesc_t packhandle, pk3_endOfCentralDir_t *eocd)
+static qbool PK3_GetEndOfCentralDir (const char *packfile, filedesc_t packhandle, pk3_endOfCentralDir_t *eocd)
{
fs_offset_t filesize, maxsize;
unsigned char *buffer, *ptr;
Create a package entry associated with a PK3 file
====================
*/
-static pack_t *FS_LoadPackPK3FromFD (const char *packfile, filedesc_t packhandle, qboolean silent)
+static pack_t *FS_LoadPackPK3FromFD (const char *packfile, filedesc_t packhandle, qbool silent)
{
pk3_endOfCentralDir_t eocd;
pack_t *pack;
return pack;
}
-static filedesc_t FS_SysOpenFiledesc(const char *filepath, const char *mode, qboolean nonblocking);
+static filedesc_t FS_SysOpenFiledesc(const char *filepath, const char *mode, qbool nonblocking);
static pack_t *FS_LoadPackPK3 (const char *packfile)
{
filedesc_t packhandle;
Find where the true file data offset is
====================
*/
-static qboolean PK3_GetTrueFileOffset (packfile_t *pfile, pack_t *pack)
+static qbool PK3_GetTrueFileOffset (packfile_t *pfile, pack_t *pack)
{
unsigned char buffer [ZIP_LOCAL_CHUNK_BASE_SIZE];
fs_offset_t count;
* plain directories.
*
*/
-static qboolean FS_AddPack_Fullpath(const char *pakfile, const char *shortname, qboolean *already_loaded, qboolean keep_plain_dirs)
+static qbool FS_AddPack_Fullpath(const char *pakfile, const char *shortname, qbool *already_loaded, qbool keep_plain_dirs)
{
searchpath_t *search;
pack_t *pak = NULL;
* If keep_plain_dirs is set, the pack will be added AFTER the first sequence of
* plain directories.
*/
-qboolean FS_AddPack(const char *pakfile, qboolean *already_loaded, qboolean keep_plain_dirs)
+qbool FS_AddPack(const char *pakfile, qbool *already_loaded, qbool keep_plain_dirs)
{
char fullpath[MAX_OSPATH];
int index;
void FS_Rescan (void)
{
int i;
- qboolean fs_modified = false;
- qboolean reset = false;
+ qbool fs_modified = false;
+ qbool reset = false;
char gamedirbuf[MAX_INPUTLINE];
char vabuf[1024];
FS_ChangeGameDirs
================
*/
-extern qboolean vid_opened;
-qboolean FS_ChangeGameDirs(int numgamedirs, char gamedirs[][MAX_QPATH], qboolean complain, qboolean failmissing)
+extern qbool vid_opened;
+qbool FS_ChangeGameDirs(int numgamedirs, char gamedirs[][MAX_QPATH], qbool complain, qbool failmissing)
{
int i;
const char *p;
static const char *FS_SysCheckGameDir(const char *gamedir, char *buf, size_t buflength)
{
- qboolean success;
+ qbool success;
qfile_t *f;
stringlist_t list;
fs_offset_t n;
Thread_DestroyMutex(fs_mutex);
}
-static filedesc_t FS_SysOpenFiledesc(const char *filepath, const char *mode, qboolean nonblocking)
+static filedesc_t FS_SysOpenFiledesc(const char *filepath, const char *mode, qbool nonblocking)
{
filedesc_t handle = FILEDESC_INVALID;
int mod, opt;
unsigned int ind;
- qboolean dolock = false;
+ qbool dolock = false;
// Parse the mode string
switch (mode[0])
return handle;
}
-int FS_SysOpenFD(const char *filepath, const char *mode, qboolean nonblocking)
+int FS_SysOpenFD(const char *filepath, const char *mode, qbool nonblocking)
{
#ifdef USE_RWOPS
return -1;
Internal function used to create a qfile_t and open the relevant non-packed file on disk
====================
*/
-qfile_t* FS_SysOpen (const char* filepath, const char* mode, qboolean nonblocking)
+qfile_t* FS_SysOpen (const char* filepath, const char* mode, qbool nonblocking)
{
qfile_t* file;
or are just not a good idea for a mod to be using.
====================
*/
-int FS_CheckNastyPath (const char *path, qboolean isgamedir)
+int FS_CheckNastyPath (const char *path, qbool isgamedir)
{
// all: never allow an empty path, as for gamedir it would access the parent directory and a non-gamedir path it is just useless
if (!path[0])
and the file index in the package if relevant
====================
*/
-static searchpath_t *FS_FindFile (const char *name, int* index, qboolean quiet)
+static searchpath_t *FS_FindFile (const char *name, int* index, qbool quiet)
{
searchpath_t *search;
pack_t *pak;
Look for a file in the search paths and open it in read-only mode
===========
*/
-static qfile_t *FS_OpenReadFile (const char *filename, qboolean quiet, qboolean nonblocking, int symlinkLevels)
+static qfile_t *FS_OpenReadFile (const char *filename, qbool quiet, qbool nonblocking, int symlinkLevels)
{
searchpath_t *search;
int pack_ind;
Used for savegame scanning in menu, and all file writing.
====================
*/
-qfile_t* FS_OpenRealFile (const char* filepath, const char* mode, qboolean quiet)
+qfile_t* FS_OpenRealFile (const char* filepath, const char* mode, qbool quiet)
{
char real_path [MAX_OSPATH];
Open a file. The syntax is the same as fopen
====================
*/
-qfile_t* FS_OpenVirtualFile (const char* filepath, qboolean quiet)
+qfile_t* FS_OpenVirtualFile (const char* filepath, qbool quiet)
{
qfile_t *result = NULL;
if (FS_CheckNastyPath(filepath, false))
Open a file. The syntax is the same as fopen
====================
*/
-qfile_t* FS_FileFromData (const unsigned char *data, const size_t size, qboolean quiet)
+qfile_t* FS_FileFromData (const unsigned char *data, const size_t size, qbool quiet)
{
qfile_t* file;
file = (qfile_t *)Mem_Alloc (fs_mempool, sizeof (*file));
Always appends a 0 byte.
============
*/
-static unsigned char *FS_LoadAndCloseQFile (qfile_t *file, const char *path, mempool_t *pool, qboolean quiet, fs_offset_t *filesizepointer)
+static unsigned char *FS_LoadAndCloseQFile (qfile_t *file, const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
{
unsigned char *buf = NULL;
fs_offset_t filesize = 0;
Always appends a 0 byte.
============
*/
-unsigned char *FS_LoadFile (const char *path, mempool_t *pool, qboolean quiet, fs_offset_t *filesizepointer)
+unsigned char *FS_LoadFile (const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
{
qfile_t *file = FS_OpenVirtualFile(path, quiet);
return FS_LoadAndCloseQFile(file, path, pool, quiet, filesizepointer);
Always appends a 0 byte.
============
*/
-unsigned char *FS_SysLoadFile (const char *path, mempool_t *pool, qboolean quiet, fs_offset_t *filesizepointer)
+unsigned char *FS_SysLoadFile (const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
{
qfile_t *file = FS_SysOpen(path, "rb", false);
return FS_LoadAndCloseQFile(file, path, pool, quiet, filesizepointer);
The filename will be prefixed by the current game directory
============
*/
-qboolean FS_WriteFileInBlocks (const char *filename, const void *const *data, const fs_offset_t *len, size_t count)
+qbool FS_WriteFileInBlocks (const char *filename, const void *const *data, const fs_offset_t *len, size_t count)
{
qfile_t *file;
size_t i;
return true;
}
-qboolean FS_WriteFile (const char *filename, const void *data, fs_offset_t len)
+qbool FS_WriteFile (const char *filename, const void *data, fs_offset_t len)
{
return FS_WriteFileInBlocks(filename, &data, &len, 1);
}
Look for a file in the packages and in the filesystem
==================
*/
-qboolean FS_FileExists (const char *filename)
+qbool FS_FileExists (const char *filename)
{
return (FS_FindFile (filename, NULL, true) != NULL);
}
#endif
}
-qboolean FS_SysFileExists (const char *path)
+qbool FS_SysFileExists (const char *path)
{
return FS_SysFileType (path) != FS_FILETYPE_NONE;
}
If it is found, this file should NOT be downloaded.
====================
*/
-qboolean FS_IsRegisteredQuakePack(const char *name)
+qbool FS_IsRegisteredQuakePack(const char *name)
{
searchpath_t *search;
pack_t *pak;
// IMPORTANT: the file path is automatically prefixed by the current game directory for
// each file created by FS_WriteFile, or opened in "write" or "append" mode by FS_OpenRealFile
-qboolean FS_AddPack(const char *pakfile, qboolean *already_loaded, qboolean keep_plain_dirs); // already_loaded may be NULL if caller does not care
+qbool FS_AddPack(const char *pakfile, qbool *already_loaded, qbool keep_plain_dirs); // already_loaded may be NULL if caller does not care
const char *FS_WhichPack(const char *filename);
void FS_CreatePath (char *path);
-int FS_SysOpenFD(const char *filepath, const char *mode, qboolean nonblocking); // uses absolute path
-qfile_t* FS_SysOpen (const char* filepath, const char* mode, qboolean nonblocking); // uses absolute path
-qfile_t* FS_OpenRealFile (const char* filepath, const char* mode, qboolean quiet);
-qfile_t* FS_OpenVirtualFile (const char* filepath, qboolean quiet);
-qfile_t* FS_FileFromData (const unsigned char *data, const size_t size, qboolean quiet);
+int FS_SysOpenFD(const char *filepath, const char *mode, qbool nonblocking); // uses absolute path
+qfile_t* FS_SysOpen (const char* filepath, const char* mode, qbool nonblocking); // uses absolute path
+qfile_t* FS_OpenRealFile (const char* filepath, const char* mode, qbool quiet);
+qfile_t* FS_OpenVirtualFile (const char* filepath, qbool quiet);
+qfile_t* FS_FileFromData (const unsigned char *data, const size_t size, qbool quiet);
int FS_Close (qfile_t* file);
void FS_RemoveOnClose(qfile_t* file);
fs_offset_t FS_Write (qfile_t* file, const void* data, size_t datasize);
void FS_Purge (qfile_t* file);
const char *FS_FileWithoutPath (const char *in);
const char *FS_FileExtension (const char *in);
-int FS_CheckNastyPath (const char *path, qboolean isgamedir);
+int FS_CheckNastyPath (const char *path, qbool isgamedir);
extern const char *const fs_checkgamedir_missing; // "(missing)"
const char *FS_CheckGameDir(const char *gamedir); // returns NULL if nasty, fs_checkgamedir_missing (exact pointer) if missing
extern gamedir_t *fs_all_gamedirs; // terminated by entry with empty name
extern int fs_all_gamedirs_count;
-qboolean FS_ChangeGameDirs(int numgamedirs, char gamedirs[][MAX_QPATH], qboolean complain, qboolean failmissing);
-qboolean FS_IsRegisteredQuakePack(const char *name);
+qbool FS_ChangeGameDirs(int numgamedirs, char gamedirs[][MAX_QPATH], qbool complain, qbool failmissing);
+qbool FS_IsRegisteredQuakePack(const char *name);
int FS_CRCFile(const char *filename, size_t *filesizepointer);
void FS_Rescan(void);
fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet, const char *packfile);
void FS_FreeSearch(fssearch_t *search);
-unsigned char *FS_LoadFile (const char *path, mempool_t *pool, qboolean quiet, fs_offset_t *filesizepointer);
-unsigned char *FS_SysLoadFile (const char *path, mempool_t *pool, qboolean quiet, fs_offset_t *filesizepointer);
-qboolean FS_WriteFileInBlocks (const char *filename, const void *const *data, const fs_offset_t *len, size_t count);
-qboolean FS_WriteFile (const char *filename, const void *data, fs_offset_t len);
+unsigned char *FS_LoadFile (const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer);
+unsigned char *FS_SysLoadFile (const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer);
+qbool FS_WriteFileInBlocks (const char *filename, const void *const *data, const fs_offset_t *len, size_t count);
+qbool FS_WriteFile (const char *filename, const void *data, fs_offset_t len);
// ------ Other functions ------ //
int FS_FileType (const char *filename); // the file can be into a package
int FS_SysFileType (const char *filename); // only look for files outside of packages
-qboolean FS_FileExists (const char *filename); // the file can be into a package
-qboolean FS_SysFileExists (const char *filename); // only look for files outside of packages
+qbool FS_FileExists (const char *filename); // the file can be into a package
+qbool FS_SysFileExists (const char *filename); // only look for files outside of packages
unsigned char *FS_Deflate(const unsigned char *data, size_t size, size_t *deflated_size, int level, mempool_t *mempool);
unsigned char *FS_Inflate(const unsigned char *data, size_t size, size_t *inflated_size, mempool_t *mempool);
-qboolean FS_HasZlib(void);
+qbool FS_HasZlib(void);
void FS_Init_SelfPack(void);
void FS_Init(void);
fontfilecache_t;
#define MAX_FONTFILES 8
static fontfilecache_t fontfiles[MAX_FONTFILES];
-static const unsigned char *fontfilecache_LoadFile(const char *path, qboolean quiet, fs_offset_t *filesizepointer)
+static const unsigned char *fontfilecache_LoadFile(const char *path, qbool quiet, fs_offset_t *filesizepointer)
{
int i;
unsigned char *buf;
Try to load the FreeType2 DLL
====================
*/
-qboolean Font_OpenLibrary (void)
+qbool Font_OpenLibrary (void)
{
#ifndef DP_FREETYPE_STATIC
const char* dllnames [] =
return (ft2_font_t *)Mem_Alloc(font_mempool, sizeof(ft2_font_t));
}
-static qboolean Font_Attach(ft2_font_t *font, ft2_attachment_t *attachment)
+static qbool Font_Attach(ft2_font_t *font, ft2_attachment_t *attachment)
{
ft2_attachment_t *na;
return floor(val / snapwidth + 0.5f) * snapwidth;
}
-static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *settings, ft2_font_t *font);
-static qboolean Font_LoadSize(ft2_font_t *font, float size, qboolean check_only);
-qboolean Font_LoadFont(const char *name, dp_font_t *dpfnt)
+static qbool Font_LoadFile(const char *name, int _face, ft2_settings_t *settings, ft2_font_t *font);
+static qbool Font_LoadSize(ft2_font_t *font, float size, qbool check_only);
+qbool Font_LoadFont(const char *name, dp_font_t *dpfnt)
{
int s, count, i;
ft2_font_t *ft2, *fbfont, *fb;
return true;
}
-static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *settings, ft2_font_t *font)
+static qbool Font_LoadFile(const char *name, int _face, ft2_settings_t *settings, ft2_font_t *font)
{
size_t namelen;
char filename[MAX_QPATH];
{
int needed, x, y;
float gausstable[2*POSTPROCESS_MAXRADIUS+1];
- qboolean need_gauss = (!pp.buf || pp.blur != fnt->settings->blur || pp.shadowz != fnt->settings->shadowz);
- qboolean need_circle = (!pp.buf || pp.outline != fnt->settings->outline || pp.shadowx != fnt->settings->shadowx || pp.shadowy != fnt->settings->shadowy);
+ qbool need_gauss = (!pp.buf || pp.blur != fnt->settings->blur || pp.shadowz != fnt->settings->shadowz);
+ qbool need_circle = (!pp.buf || pp.outline != fnt->settings->outline || pp.shadowx != fnt->settings->shadowx || pp.shadowy != fnt->settings->shadowy);
pp.blur = fnt->settings->blur;
pp.outline = fnt->settings->outline;
pp.shadowx = fnt->settings->shadowx;
}
static float Font_SearchSize(ft2_font_t *font, FT_Face fontface, float size);
-static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _ch, ft2_font_map_t **outmap);
-static qboolean Font_LoadSize(ft2_font_t *font, float size, qboolean check_only)
+static qbool Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _ch, ft2_font_map_t **outmap);
+static qbool Font_LoadSize(ft2_font_t *font, float size, qbool check_only)
{
int map_index;
ft2_font_map_t *fmap, temp;
return font->font_maps[index];
}
-static qboolean Font_SetSize(ft2_font_t *font, float w, float h)
+static qbool Font_SetSize(ft2_font_t *font, float w, float h)
{
if (font->currenth == h &&
((!w && (!font->currentw || font->currentw == font->currenth)) || // check if w==h when w is not set
return true;
}
-qboolean Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h, Uchar left, Uchar right, float *outx, float *outy)
+qbool Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h, Uchar left, Uchar right, float *outx, float *outy)
{
ft2_font_map_t *fmap;
if (!font->has_kerning || !r_font_kerning.integer)
}
}
-qboolean Font_GetKerningForSize(ft2_font_t *font, float w, float h, Uchar left, Uchar right, float *outx, float *outy)
+qbool Font_GetKerningForSize(ft2_font_t *font, float w, float h, Uchar left, Uchar right, float *outx, float *outy)
{
return Font_GetKerningForMap(font, Font_IndexForSize(font, h, NULL, NULL), w, h, left, right, outx, outy);
}
}
}
-static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _ch, ft2_font_map_t **outmap)
+static qbool Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _ch, ft2_font_map_t **outmap)
{
char map_identifier[MAX_QPATH];
unsigned long mapidx = _ch / FONT_CHARS_PER_MAP;
return true;
}
-qboolean Font_LoadMapForIndex(ft2_font_t *font, int map_index, Uchar _ch, ft2_font_map_t **outmap)
+qbool Font_LoadMapForIndex(ft2_font_t *font, int map_index, Uchar _ch, ft2_font_map_t **outmap)
{
if (map_index < 0 || map_index >= MAX_FONT_SIZES)
return false;
typedef struct ft2_font_s
{
char name[64];
- qboolean has_kerning;
+ qbool has_kerning;
// last requested size loaded using Font_SetSize
float currentw;
float currenth;
float ascend;
float descend;
- qboolean image_font; // only fallbacks are freetype fonts
+ qbool image_font; // only fallbacks are freetype fonts
// TODO: clean this up and do not expose everything.
void Font_CloseLibrary(void);
void Font_Init(void);
-qboolean Font_OpenLibrary(void);
+qbool Font_OpenLibrary(void);
ft2_font_t* Font_Alloc(void);
void Font_UnloadFont(ft2_font_t *font);
// IndexForSize suggests to change the width and height if a font size is in a reasonable range
// in such a case, *outw and *outh are set to 12, which is often a good alternative size
int Font_IndexForSize(ft2_font_t *font, float size, float *outw, float *outh);
ft2_font_map_t *Font_MapForIndex(ft2_font_t *font, int index);
-qboolean Font_LoadFont(const char *name, dp_font_t *dpfnt);
-qboolean Font_GetKerningForSize(ft2_font_t *font, float w, float h, Uchar left, Uchar right, float *outx, float *outy);
-qboolean Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h, Uchar left, Uchar right, float *outx, float *outy);
+qbool Font_LoadFont(const char *name, dp_font_t *dpfnt);
+qbool Font_GetKerningForSize(ft2_font_t *font, float w, float h, Uchar left, Uchar right, float *outx, float *outy);
+qbool Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h, Uchar left, Uchar right, float *outx, float *outy);
float Font_VirtualToRealSize(float sz);
float Font_SnapTo(float val, float snapwidth);
// since this is used on a font_map_t, let's name it FontMap_*
typedef struct glyph_slot_s
{
- qboolean image;
+ qbool image;
// we keep the quad coords here only currently
// if you need other info, make Font_LoadMapForIndex fill it into this slot
float txmin; // texture coordinate in [0,1]
int glyphSize;
cachepic_t *pic;
- qboolean static_tex;
+ qbool static_tex;
glyph_slot_t glyphs[FONT_CHARS_PER_MAP];
// contains the kerning information for the first 256 characters
fs_offset_t size;
};
-//qboolean Font_LoadMapForIndex(ft2_font_t *font, Uchar _ch, ft2_font_map_t **outmap);
-qboolean Font_LoadMapForIndex(ft2_font_t *font, int map_index, Uchar _ch, ft2_font_map_t **outmap);
+//qbool Font_LoadMapForIndex(ft2_font_t *font, Uchar _ch, ft2_font_map_t **outmap);
+qbool Font_LoadMapForIndex(ft2_font_t *font, int map_index, Uchar _ch, ft2_font_map_t **outmap);
void font_start(void);
void font_shutdown(void);
cvar_t gl_polyblend = {CVAR_CLIENT | CVAR_SAVE, "gl_polyblend", "1", "tints view while underwater, hurt, etc"};
cvar_t v_flipped = {CVAR_CLIENT, "v_flipped", "0", "mirror the screen (poor man's left handed mode)"};
-qboolean v_flipped_state = false;
+qbool v_flipped_state = false;
r_viewport_t gl_viewport;
matrix4x4_t gl_modelmatrix;
matrix4x4_t gl_modelviewprojectionmatrix;
float gl_modelview16f[16];
float gl_modelviewprojection16f[16];
-qboolean gl_modelmatrixchanged;
+qbool gl_modelmatrixchanged;
#ifdef DEBUGGL
int gl_errornumber = 0;
int cullfaceenable;
int blendfunc1;
int blendfunc2;
- qboolean blend;
+ qbool blend;
GLboolean depthmask;
int colormask; // stored as bottom 4 bits: r g b a (3 2 1 0 order)
int depthtest;
int depthfunc;
float depthrange[2];
float polygonoffset[2];
- qboolean alphatocoverage;
+ qbool alphatocoverage;
int scissortest;
unsigned int unit;
gltextureunit_t units[MAX_TEXTUREUNITS];
int uniformbufferobject;
int framebufferobject;
int defaultframebufferobject; // deal with platforms that use a non-zero default fbo
- qboolean pointer_color_enabled;
+ qbool pointer_color_enabled;
// GL3.2 Core requires that we have a GL_VERTEX_ARRAY_OBJECT, but... just one.
unsigned int defaultvao;
memexpandablearray_t meshbufferarray;
- qboolean active;
+ qbool active;
}
gl_state_t;
R_RegisterModule("GL_Backend", gl_backend_start, gl_backend_shutdown, gl_backend_newmap, gl_backend_devicelost, gl_backend_devicerestored);
}
-void GL_SetMirrorState(qboolean state);
+void GL_SetMirrorState(qbool state);
void R_Viewport_TransformToScreen(const r_viewport_t *v, const vec4_t in, vec4_t out)
{
{3, 7}, // XY, +Z
};
-qboolean R_ScissorForBBox(const float *mins, const float *maxs, int *scissor)
+qbool R_ScissorForBBox(const float *mins, const float *maxs, int *scissor)
{
int i, ix1, iy1, ix2, iy2;
float x1, y1, x2, y2;
{
if (gl_state.blendfunc1 != blendfunc1 || gl_state.blendfunc2 != blendfunc2)
{
- qboolean blendenable;
+ qbool blendenable;
gl_state.blendfunc1 = blendfunc1;
gl_state.blendfunc2 = blendfunc2;
blendenable = (gl_state.blendfunc1 != GL_ONE || gl_state.blendfunc2 != GL_ZERO);
}
}
-void R_SetStencil(qboolean enable, int writemask, int fail, int zfail, int zpass, int compare, int comparereference, int comparemask)
+void R_SetStencil(qbool enable, int writemask, int fail, int zfail, int zpass, int compare, int comparereference, int comparemask)
{
switch (vid.renderpath)
{
}
}
-void GL_SetMirrorState(qboolean state)
+void GL_SetMirrorState(qbool state)
{
if (v_flipped_state != state)
{
}
}
-void GL_AlphaToCoverage(qboolean state)
+void GL_AlphaToCoverage(qbool state)
{
if (gl_state.alphatocoverage != state)
{
}
}
-static qboolean GL_Backend_CompileShader(int programobject, GLenum shadertypeenum, const char *shadertype, int numstrings, const char **strings)
+static qbool GL_Backend_CompileShader(int programobject, GLenum shadertypeenum, const char *shadertype, int numstrings, const char **strings)
{
int shaderobject;
int shadercompiled;
R_Mesh_SetRenderTargets(0, NULL, NULL, NULL, NULL, NULL);
}
-r_meshbuffer_t *R_Mesh_CreateMeshBuffer(const void *data, size_t size, const char *name, qboolean isindexbuffer, qboolean isuniformbuffer, qboolean isdynamic, qboolean isindex16)
+r_meshbuffer_t *R_Mesh_CreateMeshBuffer(const void *data, size_t size, const char *name, qbool isindexbuffer, qbool isuniformbuffer, qbool isdynamic, qbool isindex16)
{
r_meshbuffer_t *buffer;
buffer = (r_meshbuffer_t *)Mem_ExpandableArray_AllocRecord(&gl_state.meshbufferarray);
return buffer;
}
-void R_Mesh_UpdateMeshBuffer(r_meshbuffer_t *buffer, const void *data, size_t size, qboolean subdata, size_t offset)
+void R_Mesh_UpdateMeshBuffer(r_meshbuffer_t *buffer, const void *data, size_t size, qbool subdata, size_t offset)
{
if (!buffer)
return;
}
static const char *buffertypename[R_BUFFERDATA_COUNT] = {"vertex", "index16", "index32", "uniform"};
-void GL_Mesh_ListVBOs(qboolean printeach)
+void GL_Mesh_ListVBOs(qbool printeach)
{
int i, endindex;
int type;
R_Mesh_TexCoordPointer(7, 4, GL_UNSIGNED_BYTE, sizeof(unsigned char[4]), NULL , NULL , 0 );
}
-void GL_BlendEquationSubtract(qboolean negated)
+void GL_BlendEquationSubtract(qbool negated)
{
CHECKGLERROR
if(negated)
extern matrix4x4_t gl_modelviewprojectionmatrix;
extern float gl_modelview16f[16];
extern float gl_modelviewprojection16f[16];
-extern qboolean gl_modelmatrixchanged;
+extern qbool gl_modelmatrixchanged;
#define POLYGONELEMENTS_MAXPOINTS 258
extern int polygonelement3i[(POLYGONELEMENTS_MAXPOINTS-2)*3];
extern unsigned short quadelement3s[QUADELEMENTS_MAXQUADS*6];
void R_Viewport_TransformToScreen(const r_viewport_t *v, const vec4_t in, vec4_t out);
-qboolean R_ScissorForBBox(const float *mins, const float *maxs, int *scissor);
+qbool R_ScissorForBBox(const float *mins, const float *maxs, int *scissor);
void R_Viewport_InitOrtho(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, float x1, float y1, float x2, float y2, float zNear, float zFar, const float *nearplane);
void R_Viewport_InitOrtho3D(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, float frustumx, float frustumy, float nearclip, float farclip, const float *nearplane);
void R_Viewport_InitPerspective(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, float frustumx, float frustumy, float zNear, float zFar, const float *nearplane);
void GL_Finish(void);
void GL_BlendFunc(int blendfunc1, int blendfunc2);
-void GL_BlendEquationSubtract(qboolean negated);
+void GL_BlendEquationSubtract(qbool negated);
void GL_DepthMask(int state);
void GL_DepthTest(int state);
void GL_DepthFunc(int state);
void GL_DepthRange(float nearfrac, float farfrac);
-void R_SetStencil(qboolean enable, int writemask, int fail, int zfail, int zpass, int compare, int comparereference, int comparemask);
+void R_SetStencil(qbool enable, int writemask, int fail, int zfail, int zpass, int compare, int comparereference, int comparemask);
void GL_PolygonOffset(float planeoffset, float depthoffset);
void GL_CullFace(int state);
-void GL_AlphaToCoverage(qboolean state);
+void GL_AlphaToCoverage(qbool state);
void GL_ColorMask(int r, int g, int b, int a);
void GL_Color(float cr, float cg, float cb, float ca);
void GL_ActiveTexture(unsigned int num);
// vertex buffer and index buffer creation/updating/freeing
-r_meshbuffer_t *R_Mesh_CreateMeshBuffer(const void *data, size_t size, const char *name, qboolean isindexbuffer, qboolean isuniformbuffer, qboolean isdynamic, qboolean isindex16);
-void R_Mesh_UpdateMeshBuffer(r_meshbuffer_t *buffer, const void *data, size_t size, qboolean subdata, size_t offset);
+r_meshbuffer_t *R_Mesh_CreateMeshBuffer(const void *data, size_t size, const char *name, qbool isindexbuffer, qbool isuniformbuffer, qbool isdynamic, qbool isindex16);
+void R_Mesh_UpdateMeshBuffer(r_meshbuffer_t *buffer, const void *data, size_t size, qbool subdata, size_t offset);
void R_Mesh_DestroyMeshBuffer(r_meshbuffer_t *buffer);
-void GL_Mesh_ListVBOs(qboolean printeach);
+void GL_Mesh_ListVBOs(qbool printeach);
void R_Mesh_PrepareVertices_Vertex3f(int numvertices, const float *vertex3f, const r_meshbuffer_t *buffer, int bufferoffset);
void R_Mesh_PrepareVertices_Generic_Arrays(int numvertices, const float *vertex3f, const float *color4f, const float *texcoord2f);
void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtriangles, const int *element3i, const r_meshbuffer_t *element3i_indexbuffer, int element3i_bufferoffset, const unsigned short *element3s, const r_meshbuffer_t *element3s_indexbuffer, int element3s_bufferoffset);
// saves a section of the rendered frame to a .tga or .jpg file
-qboolean SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *buffer2, int x, int y, int width, int height, qboolean flipx, qboolean flipy, qboolean flipdiagonal, qboolean jpeg, qboolean png, qboolean gammacorrect, qboolean keep_alpha);
+qbool SCR_ScreenShot(char *filename, unsigned char *buffer1, unsigned char *buffer2, int x, int y, int width, int height, qbool flipx, qbool flipy, qbool flipdiagonal, qbool jpeg, qbool png, qbool gammacorrect, qbool keep_alpha);
// used by R_Envmap_f and internally in backend, clears the frame
-void R_ClearScreen(qboolean fogcolor);
+void R_ClearScreen(qbool fogcolor);
#endif
return pic->height;
}
-qboolean Draw_IsPicLoaded(cachepic_t *pic)
+qbool Draw_IsPicLoaded(cachepic_t *pic)
{
if (pic == NULL)
return false;
static float snap_to_pixel_x(float x, float roundUpAt);
extern int con_linewidth; // to force rewrapping
-void LoadFont(qboolean override, const char *name, dp_font_t *fnt, float scale, float voffset)
+void LoadFont(qbool override, const char *name, dp_font_t *fnt, float scale, float voffset)
{
int i, ch;
float maxwidth;
}
extern cvar_t developer_font;
-dp_font_t *FindFont(const char *title, qboolean allocate_new)
+dp_font_t *FindFont(const char *title, qbool allocate_new)
{
int i, oldsize;
R_ResetViewRendering2D_Common(0, NULL, NULL, 0, 0, vid.width, vid.height, vid_conwidth.integer, vid_conheight.integer);
}
-qboolean r_draw2d_force = false;
+qbool r_draw2d_force = false;
void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, float red, float green, float blue, float alpha, int flags)
{
#define STRING_COLORS_COUNT (sizeof(string_colors) / sizeof(vec4_t))
-static void DrawQ_GetTextColor(float color[4], int colorindex, float r, float g, float b, float a, qboolean shadow)
+static void DrawQ_GetTextColor(float color[4], int colorindex, float r, float g, float b, float a, qbool shadow)
{
float C = r_textcontrast.value;
float B = r_textbrightness.value;
}
// NOTE: this function always draws exactly one character if maxwidth <= 0
-float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *maxlen, float w, float h, float sw, float sh, int *outcolor, qboolean ignorecolorcodes, const dp_font_t *fnt, float maxwidth)
+float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *maxlen, float w, float h, float sw, float sh, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt, float maxwidth)
{
const char *text_start = text;
int colorindex;
//ft2_font_map_t *prevmap = NULL;
ft2_font_t *ft2 = fnt->ft2;
// float ftbase_x;
- qboolean snap = true;
- qboolean least_one = false;
+ qbool snap = true;
+ qbool least_one = false;
float dw; // display w
//float dh; // display h
const float *width_of;
}
float DrawQ_Color[4];
-float DrawQ_String_Scale(float startx, float starty, const char *text, size_t maxlen, float w, float h, float sw, float sh, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qboolean ignorecolorcodes, const dp_font_t *fnt)
+float DrawQ_String_Scale(float startx, float starty, const char *text, size_t maxlen, float w, float h, float sw, float sh, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt)
{
int shadow, colorindex = STRING_COLOR_DEFAULT;
size_t i;
const char *text_start = text;
float kx, ky;
ft2_font_t *ft2 = fnt->ft2;
- qboolean snap = true;
+ qbool snap = true;
float pix_x, pix_y;
size_t bytes_left;
float dw, dh;
return x;
}
-float DrawQ_String(float startx, float starty, const char *text, size_t maxlen, float w, float h, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qboolean ignorecolorcodes, const dp_font_t *fnt)
+float DrawQ_String(float startx, float starty, const char *text, size_t maxlen, float w, float h, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt)
{
return DrawQ_String_Scale(startx, starty, text, maxlen, w, h, 1, 1, basered, basegreen, baseblue, basealpha, flags, outcolor, ignorecolorcodes, fnt);
}
-float DrawQ_TextWidth_UntilWidth_TrackColors(const char *text, size_t *maxlen, float w, float h, int *outcolor, qboolean ignorecolorcodes, const dp_font_t *fnt, float maxwidth)
+float DrawQ_TextWidth_UntilWidth_TrackColors(const char *text, size_t *maxlen, float w, float h, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt, float maxwidth)
{
return DrawQ_TextWidth_UntilWidth_TrackColors_Scale(text, maxlen, w, h, 1, 1, outcolor, ignorecolorcodes, fnt, maxwidth);
}
-float DrawQ_TextWidth(const char *text, size_t maxlen, float w, float h, qboolean ignorecolorcodes, const dp_font_t *fnt)
+float DrawQ_TextWidth(const char *text, size_t maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt)
{
return DrawQ_TextWidth_UntilWidth(text, &maxlen, w, h, ignorecolorcodes, fnt, 1000000000);
}
-float DrawQ_TextWidth_UntilWidth(const char *text, size_t *maxlen, float w, float h, qboolean ignorecolorcodes, const dp_font_t *fnt, float maxWidth)
+float DrawQ_TextWidth_UntilWidth(const char *text, size_t *maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt, float maxWidth)
{
return DrawQ_TextWidth_UntilWidth_TrackColors(text, maxlen, w, h, NULL, ignorecolorcodes, fnt, maxWidth);
}
#if 0
// not used
// no ^xrgb management
-static int DrawQ_BuildColoredText(char *output2c, size_t maxoutchars, const char *text, int maxreadchars, qboolean ignorecolorcodes, int *outcolor)
+static int DrawQ_BuildColoredText(char *output2c, size_t maxoutchars, const char *text, int maxreadchars, qbool ignorecolorcodes, int *outcolor)
{
int color, numchars = 0;
char *outputend2c = output2c + maxoutchars - 2;
int r_textureframe = 0; ///< used only by R_GetCurrentTexture, incremented per view and per UI render
-static qboolean r_loadnormalmap;
-static qboolean r_loadgloss;
-qboolean r_loadfog;
-static qboolean r_loaddds;
-static qboolean r_savedds;
-static qboolean r_gpuskeletal;
+static qbool r_loadnormalmap;
+static qbool r_loadgloss;
+qbool r_loadfog;
+static qbool r_loaddds;
+static qbool r_savedds;
+static qbool r_gpuskeletal;
//
// screen size info
extern cvar_t v_glslgamma_2d;
-extern qboolean v_flipped_state;
+extern qbool v_flipped_state;
r_framebufferstate_t r_fb;
uint64_t permutation;
/// indicates if we have tried compiling this permutation already
- qboolean compiled;
+ qbool compiled;
/// 0 if compilation failed
int program;
// texture units assigned to each detected uniform
static unsigned int r_compileshader_staticparms[(SHADERSTATICPARMS_COUNT + 0x1F) >> 5] = {0};
#define R_COMPILESHADER_STATICPARM_ENABLE(p) r_compileshader_staticparms[(p) >> 5] |= (1 << ((p) & 0x1F))
-extern qboolean r_shadow_shadowmapsampler;
+extern qbool r_shadow_shadowmapsampler;
extern int r_shadow_shadowmappcf;
-qboolean R_CompileShader_CheckStaticParms(void)
+qbool R_CompileShader_CheckStaticParms(void)
{
static int r_compileshader_staticparms_save[(SHADERSTATICPARMS_COUNT + 0x1F) >> 5];
memcpy(r_compileshader_staticparms_save, r_compileshader_staticparms, sizeof(r_compileshader_staticparms));
}
}
-static char *ShaderModeInfo_GetShaderText(shadermodeinfo_t *modeinfo, qboolean printfromdisknotice, qboolean builtinonly)
+static char *ShaderModeInfo_GetShaderText(shadermodeinfo_t *modeinfo, qbool printfromdisknotice, qbool builtinonly)
{
char *shaderstring;
// if the mode has no filename we have to return the builtin string
}
}
-void R_SetupShader_Generic(rtexture_t *t, qboolean usegamma, qboolean notrippy, qboolean suppresstexalpha)
+void R_SetupShader_Generic(rtexture_t *t, qbool usegamma, qbool notrippy, qbool suppresstexalpha)
{
uint64_t permutation = 0;
if (r_trippy.integer && !notrippy)
}
}
-void R_SetupShader_Generic_NoTexture(qboolean usegamma, qboolean notrippy)
+void R_SetupShader_Generic_NoTexture(qbool usegamma, qbool notrippy)
{
R_SetupShader_Generic(NULL, usegamma, notrippy, false);
}
-void R_SetupShader_DepthOrShadow(qboolean notrippy, qboolean depthrgb, qboolean skeletal)
+void R_SetupShader_DepthOrShadow(qbool notrippy, qbool depthrgb, qbool skeletal)
{
uint64_t permutation = 0;
if (r_trippy.integer && !notrippy)
return r;
}
-void R_SetupShader_Surface(const float rtlightambient[3], const float rtlightdiffuse[3], const float rtlightspecular[3], rsurfacepass_t rsurfacepass, int texturenumsurfaces, const msurface_t **texturesurfacelist, void *surfacewaterplane, qboolean notrippy)
+void R_SetupShader_Surface(const float rtlightambient[3], const float rtlightdiffuse[3], const float rtlightspecular[3], rsurfacepass_t rsurfacepass, int texturenumsurfaces, const msurface_t **texturesurfacelist, void *surfacewaterplane, qbool notrippy)
{
// select a permutation of the lighting shader appropriate to this
// combination of texture, entity, light source, and fogging, only use the
return NULL;
}
-skinframe_t *R_SkinFrame_Find(const char *name, int textureflags, int comparewidth, int compareheight, int comparecrc, qboolean add)
+skinframe_t *R_SkinFrame_Find(const char *name, int textureflags, int comparewidth, int compareheight, int comparecrc, qbool add)
{
skinframe_t *item;
int compareflags = textureflags & TEXF_IMPORTANTBITS;
skinframe->avgcolor[3] = avgcolor[4] / (255.0 * cnt); \
}
-skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboolean complain, qboolean fallbacknotexture)
+skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qbool complain, qbool fallbacknotexture)
{
skinframe_t *skinframe;
}
extern cvar_t gl_picmip;
-skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const char *name, int textureflags, qboolean complain, qboolean fallbacknotexture)
+skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const char *name, int textureflags, qbool complain, qbool fallbacknotexture)
{
int j;
unsigned char *pixels;
int basepixels_width = 0;
int basepixels_height = 0;
rtexture_t *ddsbase = NULL;
- qboolean ddshasalpha = false;
+ qbool ddshasalpha = false;
float ddsavgcolor[4];
char basename[MAX_QPATH];
int miplevel = R_PicmipForFlags(textureflags);
return skinframe;
}
-skinframe_t *R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, const unsigned char *skindata, int width, int height, int comparewidth, int compareheight, int comparecrc, qboolean sRGB)
+skinframe_t *R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, const unsigned char *skindata, int width, int height, int comparewidth, int compareheight, int comparecrc, qbool sRGB)
{
int i;
skinframe_t *skinframe;
return skinframe;
}
-static void R_SkinFrame_GenerateTexturesFromQPixels(skinframe_t *skinframe, qboolean colormapped)
+static void R_SkinFrame_GenerateTexturesFromQPixels(skinframe_t *skinframe, qbool colormapped)
{
int width;
int height;
return R_SkinFrame_LoadInternalBGRA("notexture", TEXF_FORCENEAREST, Image_GenerateNoTexture(), 16, 16, 0, 0, 0, false);
}
-skinframe_t *R_SkinFrame_LoadInternalUsingTexture(const char *name, int textureflags, rtexture_t *tex, int width, int height, qboolean sRGB)
+skinframe_t *R_SkinFrame_LoadInternalUsingTexture(const char *name, int textureflags, rtexture_t *tex, int width, int height, qbool sRGB)
{
skinframe_t *skinframe;
if (cls.state == ca_dedicated)
typedef struct suffixinfo_s
{
const char *suffix;
- qboolean flipx, flipy, flipdiagonal;
+ qbool flipx, flipy, flipdiagonal;
}
suffixinfo_t;
static suffixinfo_t suffix[3][6] =
}
}
-static void R_FrameData_Resize(qboolean mustgrow)
+static void R_FrameData_Resize(qbool mustgrow)
{
size_t wantedsize;
wantedsize = (size_t)(r_framedatasize.value * 1024*1024);
}
// resize buffer as needed (this actually makes a new one, the old one will be recycled next frame)
-static void R_BufferData_Resize(r_bufferdata_type_t type, qboolean mustgrow, size_t minsize)
+static void R_BufferData_Resize(r_bufferdata_type_t type, qbool mustgrow, size_t minsize)
{
r_bufferdata_buffer_t *mem = r_bufferdata_buffer[r_bufferdata_cycle][type];
size_t size;
}
}
-qboolean R_AnimCache_GetEntity(entity_render_t *ent, qboolean wantnormals, qboolean wanttangents)
+qbool R_AnimCache_GetEntity(entity_render_t *ent, qbool wantnormals, qbool wanttangents)
{
dp_model_t *model = ent->model;
int numvertices;
//==================================================================================
-qboolean R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t entboxexpand, vec_t pad, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs)
+qbool R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t entboxexpand, vec_t pad, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs)
{
long unsigned int i;
int j;
float viewscalefpsadjusted = 1.0f;
-void R_SetupView(qboolean allowwaterclippingplane, int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
+void R_SetupView(qbool allowwaterclippingplane, int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
{
const float *customclipplane = NULL;
float plane[4];
Matrix4x4_Invert_Full(&r_refdef.view.inverse_matrix, &r_refdef.view.matrix);
}
-void R_RenderTarget_FreeUnused(qboolean force)
+void R_RenderTarget_FreeUnused(qbool force)
{
unsigned int i, j, end;
end = (unsigned int)Mem_ExpandableArray_IndexRange(&r_fb.rendertargets); // checked
texcoord2f[7] = y2;
}
-r_rendertarget_t *R_RenderTarget_Get(int texturewidth, int textureheight, textype_t depthtextype, qboolean depthisrenderbuffer, textype_t colortextype0, textype_t colortextype1, textype_t colortextype2, textype_t colortextype3)
+r_rendertarget_t *R_RenderTarget_Get(int texturewidth, int textureheight, textype_t depthtextype, qbool depthisrenderbuffer, textype_t colortextype0, textype_t colortextype1, textype_t colortextype2, textype_t colortextype3)
{
unsigned int i, j, end;
r_rendertarget_t *r = NULL;
*/
r_refdef_scene_t * R_GetScenePointer( r_refdef_scene_type_t scenetype )
{
- // of course, we could also add a qboolean that provides a lock state and a ReleaseScenePointer function..
+ // of course, we could also add a qbool that provides a lock state and a ReleaseScenePointer function..
if( scenetype == r_currentscenetype ) {
return &r_refdef.scene;
} else {
static void R_DrawLocs(void);
static void R_DrawEntityBBoxes(prvm_prog_t *prog);
static void R_DrawModelDecals(void);
-extern qboolean r_shadow_usingdeferredprepass;
+extern qbool r_shadow_usingdeferredprepass;
extern int r_shadow_shadowmapatlas_modelshadows_size;
void R_RenderScene(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight)
{
- qboolean shadowmapping = false;
+ qbool shadowmapping = false;
if (r_timereport_active)
R_TimeReport("beginscene");
}
}
-static qboolean R_TestQ3WaveFunc(q3wavefunc_t func, const float *parms)
+static qbool R_TestQ3WaveFunc(q3wavefunc_t func, const float *parms)
{
if(parms[0] == 0 && parms[1] == 0)
return false;
rsurfacestate_t rsurface;
-void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, qboolean wanttangents, qboolean prepass)
+void RSurf_ActiveModelEntity(const entity_render_t *ent, qbool wantnormals, qbool wanttangents, qbool prepass)
{
dp_model_t *model = ent->model;
//if (rsurface.entity == ent && (!model->surfmesh.isanimated || (!wantnormals && !wanttangents)))
rsurface.forcecurrenttextureupdate = false;
}
-void RSurf_ActiveCustomEntity(const matrix4x4_t *matrix, const matrix4x4_t *inversematrix, int entflags, double shadertime, float r, float g, float b, float a, int numvertices, const float *vertex3f, const float *texcoord2f, const float *normal3f, const float *svector3f, const float *tvector3f, const float *color4f, int numtriangles, const int *element3i, const unsigned short *element3s, qboolean wantnormals, qboolean wanttangents)
+void RSurf_ActiveCustomEntity(const matrix4x4_t *matrix, const matrix4x4_t *inversematrix, int entflags, double shadertime, float r, float g, float b, float a, int numvertices, const float *vertex3f, const float *texcoord2f, const float *normal3f, const float *svector3f, const float *tvector3f, const float *color4f, int numtriangles, const int *element3i, const unsigned short *element3s, qbool wantnormals, qbool wanttangents)
{
rsurface.entity = r_refdef.scene.worldentity;
if (r != 1.0f || g != 1.0f || b != 1.0f || a != 1.0f) {
int batchnumvertices;
int batchnumtriangles;
int i, j;
- qboolean gaps;
- qboolean dynamicvertex;
+ qbool gaps;
+ qbool dynamicvertex;
float amplitude;
float animpos;
float center[3], forward[3], right[3], up[3], v[3], newforward[3], newright[3], newup[3];
vec3_t vert;
const float *v;
r_waterstate_waterplane_t *p;
- qboolean prepared = false;
+ qbool prepared = false;
bestd = 0;
for (planeindex = 0, p = r_fb.water.waterplanes;planeindex < r_fb.water.numwaterplanes;planeindex++, p++)
{
extern rtexture_t *r_shadow_prepasslightingdiffusetexture;
extern rtexture_t *r_shadow_prepasslightingspeculartexture;
-static void R_DrawTextureSurfaceList_GL20(int texturenumsurfaces, const msurface_t **texturesurfacelist, qboolean writedepth, qboolean prepass, qboolean ui)
+static void R_DrawTextureSurfaceList_GL20(int texturenumsurfaces, const msurface_t **texturesurfacelist, qbool writedepth, qbool prepass, qbool ui)
{
if (r_fb.water.renderingscene && (rsurface.texture->currentmaterialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA)))
return;
RSurf_DrawBatch();
}
-static void R_DrawTextureSurfaceList_ShowSurfaces(int texturenumsurfaces, const msurface_t **texturesurfacelist, qboolean writedepth)
+static void R_DrawTextureSurfaceList_ShowSurfaces(int texturenumsurfaces, const msurface_t **texturesurfacelist, qbool writedepth)
{
int vi;
int j;
RSurf_DrawBatch();
}
-static void R_DrawModelTextureSurfaceList(int texturenumsurfaces, const msurface_t **texturesurfacelist, qboolean writedepth, qboolean prepass, qboolean ui)
+static void R_DrawModelTextureSurfaceList(int texturenumsurfaces, const msurface_t **texturesurfacelist, qbool writedepth, qbool prepass, qbool ui)
{
CHECKGLERROR
RSurf_SetupDepthAndCulling();
if (r_transparentdepthmasking.integer)
{
- qboolean setup = false;
+ qbool setup = false;
for (i = 0;i < numsurfaces;i = j)
{
j = i + 1;
RSurf_DrawBatch();
}
-static void R_ProcessModelTextureSurfaceList(int texturenumsurfaces, const msurface_t **texturesurfacelist, qboolean writedepth, qboolean depthonly, qboolean prepass, qboolean ui)
+static void R_ProcessModelTextureSurfaceList(int texturenumsurfaces, const msurface_t **texturesurfacelist, qbool writedepth, qbool depthonly, qbool prepass, qbool ui)
{
CHECKGLERROR
if (ui)
CHECKGLERROR
}
-static void R_QueueModelSurfaceList(entity_render_t *ent, int numsurfaces, const msurface_t **surfacelist, int flagsmask, qboolean writedepth, qboolean depthonly, qboolean prepass, qboolean ui)
+static void R_QueueModelSurfaceList(entity_render_t *ent, int numsurfaces, const msurface_t **surfacelist, int flagsmask, qbool writedepth, qbool depthonly, qbool prepass, qbool ui)
{
int i, j;
texture_t *texture;
if (decalsystem->maxdecals <= decalsystem->numdecals)
{
decalsystem_t old = *decalsystem;
- qboolean useshortelements;
+ qbool useshortelements;
decalsystem->maxdecals = max(16, decalsystem->maxdecals * 2);
useshortelements = decalsystem->maxdecals * 3 <= 65536;
decalsystem->decals = (tridecal_t *)Mem_Alloc(cls.levelmempool, decalsystem->maxdecals * (sizeof(tridecal_t) + sizeof(float[3][3]) + sizeof(float[3][2]) + sizeof(float[3][4]) + sizeof(int[3]) + (useshortelements ? sizeof(unsigned short[3]) : 0)));
extern cvar_t cl_decals_models;
extern cvar_t cl_decals_newsystem_intensitymultiplier;
// baseparms, parms, temps
-static void R_DecalSystem_SplatTriangle(decalsystem_t *decalsystem, float r, float g, float b, float a, float s1, float t1, float s2, float t2, unsigned int decalsequence, qboolean dynamic, float (*planes)[4], matrix4x4_t *projection, int triangleindex, int surfaceindex)
+static void R_DecalSystem_SplatTriangle(decalsystem_t *decalsystem, float r, float g, float b, float a, float s1, float t1, float s2, float t2, unsigned int decalsequence, qbool dynamic, float (*planes)[4], matrix4x4_t *projection, int triangleindex, int surfaceindex)
{
int cornerindex;
int index;
{
matrix4x4_t projection;
decalsystem_t *decalsystem;
- qboolean dynamic;
+ qbool dynamic;
dp_model_t *model;
const msurface_t *surface;
const msurface_t *surfaces;
{
int triangleindex;
int bihleafindex;
- qboolean cullbox = false;
+ qbool cullbox = false;
const q3mbrush_t *brush;
const bih_t *bih = &model->collision_bih;
const bih_leaf_t *bihleaf;
int r_maxsurfacelist = 0;
const msurface_t **r_surfacelist = NULL;
-void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug, qboolean prepass, qboolean ui)
+void R_DrawModelSurfaces(entity_render_t *ent, qbool skysurfaces, qbool writedepth, qbool depthonly, qbool debug, qbool prepass, qbool ui)
{
int i, j, endj, flagsmask;
dp_model_t *model = ent->model;
}
-void R_DrawCustomSurface(skinframe_t *skinframe, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qboolean writedepth, qboolean prepass, qboolean ui)
+void R_DrawCustomSurface(skinframe_t *skinframe, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qbool writedepth, qbool prepass, qbool ui)
{
static texture_t texture;
R_DrawCustomSurface_Texture(&texture, texmatrix, materialflags, firstvertex, numvertices, firsttriangle, numtriangles, writedepth, prepass, ui);
}
-void R_DrawCustomSurface_Texture(texture_t *texture, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qboolean writedepth, qboolean prepass, qboolean ui)
+void R_DrawCustomSurface_Texture(texture_t *texture, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qbool writedepth, qbool prepass, qbool ui)
{
static msurface_t surface;
const msurface_t *surfacelist = &surface;
// called with a batch, so numsurfaces is always 1, and the surfacelist
// contains only a leaf number for coloring purposes
const mportal_t *portal = (mportal_t *)ent;
- qboolean isvis;
+ qbool isvis;
int i, numpoints;
float *v;
float vertex3f[POLYGONELEMENTS_MAXPOINTS*3];
}
}
-void R_View_WorldVisibility(qboolean forcenovis)
+void R_View_WorldVisibility(qbool forcenovis)
{
int i, j, *mark;
mleaf_t *leaf;
vec3_t lightmins;
vec3_t lightmaxs;
const unsigned char *pvs;
- qboolean svbsp_active;
- qboolean svbsp_insertoccluder;
- qboolean noocclusion; // avoids PVS culling
- qboolean frontsidecasting; // casts shadows from surfaces facing the light (otherwise ones facing away)
+ qbool svbsp_active;
+ qbool svbsp_insertoccluder;
+ qbool noocclusion; // avoids PVS culling
+ qbool frontsidecasting; // casts shadows from surfaces facing the light (otherwise ones facing away)
int numfrustumplanes;
const mplane_t *frustumplanes;
}
#define GETLIGHTINFO_MAXNODESTACK 4096
-static void R_Q1BSP_RecursiveGetLightInfo_BSP(r_q1bsp_getlightinfo_t *info, qboolean skipsurfaces)
+static void R_Q1BSP_RecursiveGetLightInfo_BSP(r_q1bsp_getlightinfo_t *info, qbool skipsurfaces)
{
// nodestack
mnode_t *nodestack[GETLIGHTINFO_MAXNODESTACK];
int surfaceindex;
int triangleindex, t;
int currentmaterialflags;
- qboolean castshadow;
+ qbool castshadow;
const int *e;
const vec_t *v[3];
float v2[3][3];
- qboolean insidebox;
- qboolean noocclusion = info->noocclusion;
- qboolean frontsidecasting = info->frontsidecasting;
- qboolean svbspactive = info->svbsp_active;
- qboolean svbspinsertoccluder = info->svbsp_insertoccluder;
+ qbool insidebox;
+ qbool noocclusion = info->noocclusion;
+ qbool frontsidecasting = info->frontsidecasting;
+ qbool svbspactive = info->svbsp_active;
+ qbool svbspinsertoccluder = info->svbsp_insertoccluder;
const int *leafsurfaceindices;
- qboolean addedtris;
+ qbool addedtris;
int i;
mportal_t *portal;
static float points[128][3];
int t;
int nodeleafindex;
int currentmaterialflags;
- qboolean castshadow;
- qboolean noocclusion = info->noocclusion;
- qboolean frontsidecasting = info->frontsidecasting;
+ qbool castshadow;
+ qbool noocclusion = info->noocclusion;
+ qbool frontsidecasting = info->frontsidecasting;
msurface_t *surface;
const int *e;
const vec_t *v[3];
}
}
-static void R_Q1BSP_CallRecursiveGetLightInfo(r_q1bsp_getlightinfo_t *info, qboolean use_svbsp)
+static void R_Q1BSP_CallRecursiveGetLightInfo(r_q1bsp_getlightinfo_t *info, qbool use_svbsp)
{
extern cvar_t r_shadow_usebihculling;
if (use_svbsp)
extern cvar_t r_shadow_sortsurfaces;
-void R_Mod_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion)
+void R_Mod_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qbool noocclusion)
{
r_q1bsp_getlightinfo_t info;
info.frontsidecasting = r_shadow_frontsidecasting.integer != 0;
R_FrameData_ReturnToMark();
}
-extern qboolean r_shadow_usingdeferredprepass;
+extern qbool r_shadow_usingdeferredprepass;
void R_Mod_DrawLight(entity_render_t *ent, int numsurfaces, const int *surfacelist, const unsigned char *lighttrispvs)
{
dp_model_t *model = ent->model;
cvar_t r_texture_dds_load_logfailure = {CVAR_CLIENT, "r_texture_dds_load_logfailure", "0", "log missing DDS textures to ddstexturefailures.log, 0: done log, 1: log with no optional textures (_norm, glow etc.). 2: log all"};
cvar_t r_texture_dds_swdecode = {CVAR_CLIENT, "r_texture_dds_swdecode", "0", "0: don't software decode DDS, 1: software decode DDS if unsupported, 2: always software decode DDS"};
-qboolean gl_filter_force = false;
+qbool gl_filter_force = false;
int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
int gl_filter_mag = GL_LINEAR;
// speed reasons, must be identical in rtexture_t!
int texnum; // GL texture slot number
int renderbuffernum; // GL renderbuffer slot number
- qboolean dirty; // indicates that R_RealGetTexture should be called
- qboolean glisdepthstencil; // indicates that FBO attachment has to be GL_DEPTH_STENCIL_ATTACHMENT
+ qbool dirty; // indicates that R_RealGetTexture should be called
+ qbool glisdepthstencil; // indicates that FBO attachment has to be GL_DEPTH_STENCIL_ATTACHMENT
int gltexturetypeenum; // used by R_Mesh_TexBind
// dynamic texture stuff [11/22/2007 Black]
// stores backup copy of texture for deferred texture updates (gl_nopartialtextureupdates cvar)
unsigned char *bufferpixels;
- qboolean buffermodified;
+ qbool buffermodified;
// pointer to texturepool (check this to see if the texture is allocated)
struct gltexturepool_s *pool;
return (int)(size * glt->textype->glinternalbytesperpixel) * glt->sides;
}
-void R_TextureStats_Print(qboolean printeach, qboolean printpool, qboolean printtotal)
+void R_TextureStats_Print(qbool printeach, qbool printpool, qbool printtotal)
{
int glsize;
int isloaded;
{
#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
static int old_aniso = 0;
- static qboolean first_time_aniso = true;
+ static qbool first_time_aniso = true;
#endif
// could do procedural texture animation here, if we keep track of which
gltexturepool_t *pool = (gltexturepool_t *)rtexturepool;
textypeinfo_t *texinfo, *texinfo2;
unsigned char *temppixels = NULL;
- qboolean swaprb;
+ qbool swaprb;
if (cls.state == ca_dedicated)
return NULL;
// if sRGB texture formats are not supported, convert input to linear and upload as normal types
if (!vid.support.ext_texture_srgb)
{
- qboolean convertsRGB = false;
+ qbool convertsRGB = false;
switch(textype)
{
case TEXTYPE_SRGB_DXT1: textype = TEXTYPE_DXT1 ;convertsRGB = true;break;
return R_SetupTexture(rtexturepool, identifier, width, width, 1, 6, flags, miplevel, textype, GLTEXTURETYPE_CUBEMAP, data, palette);
}
-rtexture_t *R_LoadTextureShadowMap2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, textype_t textype, qboolean filter)
+rtexture_t *R_LoadTextureShadowMap2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, textype_t textype, qbool filter)
{
return R_SetupTexture(rtexturepool, identifier, width, height, 1, 1, TEXF_RENDERTARGET | TEXF_CLAMP | (filter ? TEXF_FORCELINEAR : TEXF_FORCENEAREST), -1, textype, GLTEXTURETYPE_2D, NULL, NULL);
}
return (rtexture_t *)glt;
}
-int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipuncompressed, qboolean hasalpha)
+int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qbool skipuncompressed, qbool hasalpha)
{
#ifdef USE_GLES2
return -1; // unsupported on this platform
#include "ktx10/include/ktx.h"
#endif
-rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, qboolean srgb, int flags, qboolean *hasalphaflag, float *avgcolor, int miplevel, qboolean optionaltexture) // DDS textures are opaque, so miplevel isn't a pointer but just seen as a hint
+rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, qbool srgb, int flags, qbool *hasalphaflag, float *avgcolor, int miplevel, qbool optionaltexture) // DDS textures are opaque, so miplevel isn't a pointer but just seen as a hint
{
int i, size, dds_format_flags, dds_miplevels, dds_width, dds_height;
//int dds_flags;
unsigned char *dds;
fs_offset_t ddsfilesize;
unsigned int ddssize;
- qboolean force_swdecode;
+ qbool force_swdecode;
#ifdef __ANDROID__
// ELUAN: FIXME: separate this code
char vabuf[1024];
#include "quakedef.h"
#include "hmac.h"
-qboolean hmac(
+qbool hmac(
hashfunc_t hfunc, int hlen, int hblock,
unsigned char *out,
const unsigned char *in, int n,
#define HMAC_H
typedef void (*hashfunc_t) (unsigned char *out, const unsigned char *in, int n);
-qboolean hmac(
+qbool hmac(
hashfunc_t hfunc, int hlen, int hblock,
unsigned char *out,
const unsigned char *in, int n,
{
static char hosterrorstring1[MAX_INPUTLINE]; // THREAD UNSAFE
static char hosterrorstring2[MAX_INPUTLINE]; // THREAD UNSAFE
- static qboolean hosterror = false;
+ static qbool hosterror = false;
va_list argptr;
// turn off rcon redirect if it was active when the crash occurred
//============================================================================
-qboolean vid_opened = false;
+qbool vid_opened = false;
void Host_StartVideo(void)
{
if (!vid_opened && cls.state != ca_dedicated)
char engineversion[128];
-qboolean sys_nostdout = false;
+qbool sys_nostdout = false;
static qfile_t *locksession_fh = NULL;
-static qboolean locksession_run = false;
+static qbool locksession_run = false;
static void Host_InitSession(void)
{
int i;
*/
void Host_Shutdown(void)
{
- static qboolean isdown = false;
+ static qbool isdown = false;
if (isdown)
{
#if 1
// written by LadyHavoc in a readable way, optimized by Vic, further optimized by LadyHavoc (the non-special index case), readable version preserved below this
-void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qboolean inputflipx, qboolean inputflipy, qboolean inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices)
+void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qbool inputflipx, qbool inputflipy, qbool inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices)
{
int index, c, x, y;
const unsigned char *in, *line;
}
#else
// intentionally readable version
-void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qboolean inputflipx, qboolean inputflipy, qboolean inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices)
+void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qbool inputflipx, qbool inputflipy, qbool inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices)
{
int index, c, x, y;
const unsigned char *in, *inrow, *incolumn;
LoadPCX
============
*/
-qboolean LoadPCX_QWSkin(const unsigned char *f, int filesize, unsigned char *pixels, int outwidth, int outheight)
+qbool LoadPCX_QWSkin(const unsigned char *f, int filesize, unsigned char *pixels, int outwidth, int outheight)
{
pcx_t pcx;
unsigned char *a;
LoadPCX
============
*/
-qboolean LoadPCX_PaletteOnly(const unsigned char *f, int filesize, unsigned char *palette768b)
+qbool LoadPCX_PaletteOnly(const unsigned char *f, int filesize, unsigned char *palette768b)
{
if (filesize < 768)
return false;
return image_buffer;
}
-qboolean LoadWAL_GetMetadata(const unsigned char *f, int filesize, int *retwidth, int *retheight, int *retflags, int *retvalue, int *retcontents, char *retanimname32c)
+qbool LoadWAL_GetMetadata(const unsigned char *f, int filesize, int *retwidth, int *retheight, int *retflags, int *retvalue, int *retcontents, char *retanimname32c)
{
const q2wal_t *inwal = (const q2wal_t *)f;
};
int fixtransparentpixels(unsigned char *data, int w, int h);
-unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qboolean allowFixtrans, qboolean convertsRGB, int *miplevel)
+unsigned char *loadimagepixelsbgra (const char *filename, qbool complain, qbool allowFixtrans, qbool convertsRGB, int *miplevel)
{
fs_offset_t filesize;
imageformat_t *firstformat, *format;
return NULL;
}
-qboolean Image_GetStockPicSize(const char *filename, int *returnwidth, int *returnheight)
+qbool Image_GetStockPicSize(const char *filename, int *returnwidth, int *returnheight)
{
unsigned char *data;
fs_offset_t filesize;
}
extern cvar_t gl_picmip;
-rtexture_t *loadtextureimage (rtexturepool_t *pool, const char *filename, qboolean complain, int flags, qboolean allowFixtrans, qboolean sRGB)
+rtexture_t *loadtextureimage (rtexturepool_t *pool, const char *filename, qbool complain, int flags, qbool allowFixtrans, qbool sRGB)
{
unsigned char *data;
rtexture_t *rt;
FS_FreeSearch(search);
}
-qboolean Image_WriteTGABGR_preflipped (const char *filename, int width, int height, const unsigned char *data)
+qbool Image_WriteTGABGR_preflipped (const char *filename, int width, int height, const unsigned char *data)
{
- qboolean ret;
+ qbool ret;
unsigned char buffer[18];
const void *buffers[2];
fs_offset_t sizes[2];
return ret;
}
-qboolean Image_WriteTGABGRA (const char *filename, int width, int height, const unsigned char *data)
+qbool Image_WriteTGABGRA (const char *filename, int width, int height, const unsigned char *data)
{
int y;
unsigned char *buffer, *out;
const unsigned char *in, *end;
- qboolean ret;
+ qbool ret;
buffer = (unsigned char *)Mem_Alloc(tempmempool, width*height*4 + 18);
// (warning: input must be different than output due to non-linear read/write)
// (tip: component indices can contain values | 0x80000000 to tell it to
// store them directly into output, so 255 | 0x80000000 would write 255)
-void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qboolean inputflipx, qboolean inputflipy, qboolean inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices);
+void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int inputwidth, int inputheight, qbool inputflipx, qbool inputflipy, qbool inputflipdiagonal, int numoutputcomponents, int numinputcomponents, int *outputinputcomponentindices);
// applies gamma correction to RGB pixels, in can be the same as out
void Image_GammaRemapRGB(const unsigned char *in, unsigned char *out, int pixels, const unsigned char *gammar, const unsigned char *gammag, const unsigned char *gammab);
unsigned char *LoadTGA_BGRA (const unsigned char *f, int filesize, int *miplevel);
// loads a texture, as pixel data
-unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qboolean allowFixtrans, qboolean convertsRGB, int *miplevel);
+unsigned char *loadimagepixelsbgra (const char *filename, qbool complain, qbool allowFixtrans, qbool convertsRGB, int *miplevel);
// searches for lmp and wad pics of the provided name and returns true and their dimensions if found
-qboolean Image_GetStockPicSize(const char *filename, int *returnwidth, int *returnheight);
+qbool Image_GetStockPicSize(const char *filename, int *returnwidth, int *returnheight);
// loads an 8bit pcx image into a 296x194x8bit buffer, with cropping as needed
-qboolean LoadPCX_QWSkin(const unsigned char *f, int filesize, unsigned char *pixels, int outwidth, int outheight);
+qbool LoadPCX_QWSkin(const unsigned char *f, int filesize, unsigned char *pixels, int outwidth, int outheight);
// loads the palette from an 8bit pcx image into your provided array
-qboolean LoadPCX_PaletteOnly(const unsigned char *f, int filesize, unsigned char *palette768b);
+qbool LoadPCX_PaletteOnly(const unsigned char *f, int filesize, unsigned char *palette768b);
// get the metadata from a Quake2 wal file
-qboolean LoadWAL_GetMetadata(const unsigned char *f, int filesize, int *retwidth, int *retheight, int *retflags, int *retvalue, int *retcontents, char *retanimname32c);
+qbool LoadWAL_GetMetadata(const unsigned char *f, int filesize, int *retwidth, int *retheight, int *retflags, int *retvalue, int *retcontents, char *retanimname32c);
// loads a texture, as a texture
-rtexture_t *loadtextureimage (rtexturepool_t *pool, const char *filename, qboolean complain, int flags, qboolean allowFixtrans, qboolean sRGB);
+rtexture_t *loadtextureimage (rtexturepool_t *pool, const char *filename, qbool complain, int flags, qbool allowFixtrans, qbool sRGB);
// writes an upside down BGR image into a TGA
-qboolean Image_WriteTGABGR_preflipped (const char *filename, int width, int height, const unsigned char *data);
+qbool Image_WriteTGABGR_preflipped (const char *filename, int width, int height, const unsigned char *data);
// writes a BGRA image into a TGA file
-qboolean Image_WriteTGABGRA (const char *filename, int width, int height, const unsigned char *data);
+qbool Image_WriteTGABGRA (const char *filename, int width, int height, const unsigned char *data);
// resizes the image (in can not be the same as out)
void Image_Resample32(const void *indata, int inwidth, int inheight, int indepth, void *outdata, int outwidth, int outheight, int outdepth, int quality);
Try to load the PNG DLL
====================
*/
-qboolean PNG_OpenLibrary (void)
+qbool PNG_OpenLibrary (void)
{
const char* dllnames [] =
{
Save a preflipped PNG image to a file
====================
*/
-qboolean PNG_SaveImage_preflipped (const char *filename, int width, int height, qboolean has_alpha, unsigned char *data)
+qbool PNG_SaveImage_preflipped (const char *filename, int width, int height, qbool has_alpha, unsigned char *data)
{
unsigned int offset, linesize;
qfile_t* file = NULL;
#ifndef PNG_H
#define PNG_H
-qboolean PNG_OpenLibrary (void);
+qbool PNG_OpenLibrary (void);
void PNG_CloseLibrary (void);
unsigned char* PNG_LoadImage_BGRA (const unsigned char *f, int filesize, int *miplevel);
-qboolean PNG_SaveImage_preflipped (const char *filename, int width, int height, qboolean has_alpha, unsigned char *data);
+qbool PNG_SaveImage_preflipped (const char *filename, int width, int height, qbool has_alpha, unsigned char *data);
#endif
extern cvar_t in_pitch_min;
extern cvar_t in_pitch_max;
-extern qboolean in_client_mouse;
+extern qbool in_client_mouse;
extern float in_windowmouse_x, in_windowmouse_y;
extern float in_mouse_x, in_mouse_y;
// Handle for JPEG DLL
dllhandle_t jpeg_dll = NULL;
-qboolean jpeg_tried_loading = 0;
+qbool jpeg_tried_loading = 0;
#endif
static unsigned char jpeg_eoi_marker [2] = {0xFF, JPEG_EOI};
static jmp_buf error_in_jpeg;
-static qboolean jpeg_toolarge;
+static qbool jpeg_toolarge;
// Our own output manager for JPEG compression
typedef struct
Try to load the JPEG DLL
====================
*/
-qboolean JPEG_OpenLibrary (void)
+qbool JPEG_OpenLibrary (void)
{
#ifdef LINK_TO_LIBJPEG
return true;
Save a preflipped JPEG image to a file
====================
*/
-qboolean JPEG_SaveImage_preflipped (const char *filename, int width, int height, unsigned char *data)
+qbool JPEG_SaveImage_preflipped (const char *filename, int width, int height, unsigned char *data)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
return NULL;
}
-qboolean Image_Compress(const char *imagename, size_t maxsize, void **buf, size_t *size)
+qbool Image_Compress(const char *imagename, size_t maxsize, void **buf, size_t *size)
{
unsigned char *imagedata, *newimagedata;
int maxPixelCount;
#define JPEG_H
-qboolean JPEG_OpenLibrary (void);
+qbool JPEG_OpenLibrary (void);
void JPEG_CloseLibrary (void);
unsigned char* JPEG_LoadImage_BGRA (const unsigned char *f, int filesize, int *miplevel);
-qboolean JPEG_SaveImage_preflipped (const char *filename, int width, int height, unsigned char *data);
+qbool JPEG_SaveImage_preflipped (const char *filename, int width, int height, unsigned char *data);
/*! \returns 0 if failed, or the size actually used.
*/
size_t JPEG_SaveImage_to_Buffer (char *jpegbuf, size_t jpegsize, int width, int height, unsigned char *data);
-qboolean Image_Compress(const char *imagename, size_t maxsize, void **buf, size_t *size);
+qbool Image_Compress(const char *imagename, size_t maxsize, void **buf, size_t *size);
#endif
char key_line[MAX_INPUTLINE];
int key_linepos;
-qboolean key_insert = true; // insert key toggle (for editing)
+qbool key_insert = true; // insert key toggle (for editing)
keydest_t key_dest;
int key_consoleactive;
char *keybindings[MAX_BINDMAPS][MAX_KEYS];
int history_line;
char history_savedline[MAX_INPUTLINE];
char history_searchstring[MAX_INPUTLINE];
-qboolean history_matchfound = false;
+qbool history_matchfound = false;
conbuffer_t history;
extern cvar_t con_textsize;
history_matchfound = false;
}
-static qboolean Key_History_Get_foundCommand(void)
+static qbool Key_History_Get_foundCommand(void)
{
if (!history_matchfound)
return false;
==============================================================================
*/
-int Key_ClearEditLine(qboolean is_console)
+int Key_ClearEditLine(qbool is_console)
{
if (is_console)
{
char chat_buffer[MAX_INPUTLINE];
int chat_bufferpos = 0;
-int Key_AddChar(int unicode, qboolean is_console)
+int Key_AddChar(int unicode, qbool is_console)
{
char *line;
char buf[16];
// returns -1 if no key has been recognized
// returns linepos (>= 0) otherwise
// if is_console is true can modify key_line (doesn't change key_linepos)
-int Key_Parse_CommonKeys(cmd_state_t *cmd, qboolean is_console, int key, int unicode)
+int Key_Parse_CommonKeys(cmd_state_t *cmd, qbool is_console, int key, int unicode)
{
char *line;
int linepos, linestart;
}
-qboolean
+qbool
Key_SetBinding (int keynum, int bindmap, const char *binding)
{
char *newbinding;
*bg = key_bmap2;
}
-qboolean Key_SetBindMap(int fg, int bg)
+qbool Key_SetBindMap(int fg, int bg)
{
if(fg >= MAX_BINDMAPS)
return false;
{
int key;
int ascii;
- qboolean down;
+ qbool down;
}
eventqueueitem_t;
static int events_blocked = 0;
static eventqueueitem_t eventqueue[32];
static unsigned eventqueue_idx = 0;
-static void Key_EventQueue_Add(int key, int ascii, qboolean down)
+static void Key_EventQueue_Add(int key, int ascii, qbool down)
{
if(eventqueue_idx < sizeof(eventqueue) / sizeof(*eventqueue))
{
}
void
-Key_Event (int key, int ascii, qboolean down)
+Key_Event (int key, int ascii, qbool down)
{
cmd_state_t *cmd = &cmd_client;
const char *bind;
- qboolean q;
+ qbool q;
keydest_t keydest = key_dest;
char vabuf[1024];
extern char key_line[MAX_INPUTLINE];
extern int key_linepos;
-extern qboolean key_insert; // insert key toggle (for editing)
+extern qbool key_insert; // insert key toggle (for editing)
extern keydest_t key_dest;
// key_consoleactive bits
// user wants console (halfscreen)
extern char chat_buffer[MAX_INPUTLINE];
extern int chat_bufferpos;
-int Key_ClearEditLine(qboolean is_console);
+int Key_ClearEditLine(qbool is_console);
void Key_WriteBindings(qfile_t *f);
void Key_Init(void);
void Key_Shutdown(void);
void Key_Init_Cvars(void);
-void Key_Event(int key, int ascii, qboolean down);
+void Key_Event(int key, int ascii, qbool down);
void Key_ReleaseAll (void);
void Key_ReleaseAll_f(cmd_state_t *cmd);
void Key_EventQueue_Block(void);
void Key_EventQueue_Unblock(void);
-int Key_AddChar(int unicode, qboolean is_console);
-int Key_Parse_CommonKeys(cmd_state_t *cmd, qboolean is_console, int key, int unicode);
+int Key_AddChar(int unicode, qbool is_console);
+int Key_Parse_CommonKeys(cmd_state_t *cmd, qbool is_console, int key, int unicode);
-qboolean Key_SetBinding (int keynum, int bindmap, const char *binding);
+qbool Key_SetBinding (int keynum, int bindmap, const char *binding);
const char *Key_GetBind (int key, int bindmap);
void Key_FindKeysForCommand (const char *command, int *keys, int numkeys, int bindmap);
-qboolean Key_SetBindMap(int fg, int bg);
+qbool Key_SetBindMap(int fg, int bg);
void Key_GetBindMap(int *fg, int *bg);
#endif // __KEYS_H
qfile_t *stream;
fs_offset_t startpos;
CURL *curle;
- qboolean started;
+ qbool started;
int loadtype;
size_t bytes_received; // for buffer
double bytes_received_curl; // for throttling
double bytes_sent_curl; // for throttling
struct downloadinfo_s *next, *prev;
- qboolean forthismap;
+ qbool forthismap;
double maxspeed;
curl_slist *slist; // http headers
static downloadinfo *downloads = NULL;
static int numdownloads = 0;
-static qboolean noclear = false;
+static qbool noclear = false;
static int numdownloads_fail = 0;
static int numdownloads_success = 0;
Returns true if a download needed for the current game is running.
====================
*/
-qboolean Curl_Have_forthismap(void)
+qbool Curl_Have_forthismap(void)
{
return numdownloads_added != 0;
}
Load the cURL DLL
====================
*/
-static qboolean CURL_OpenLibrary (void)
+static qbool CURL_OpenLibrary (void)
{
const char* dllnames [] =
{
code from libcurl, or 0, if another error has occurred.
====================
*/
-static qboolean Curl_Begin(const char *URL, const char *extraheaders, double maxspeed, const char *name, int loadtype, qboolean forthismap, const char *post_content_type, const unsigned char *postbuf, size_t postbufsize, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata);
+static qbool Curl_Begin(const char *URL, const char *extraheaders, double maxspeed, const char *name, int loadtype, qbool forthismap, const char *post_content_type, const unsigned char *postbuf, size_t postbufsize, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata);
static void Curl_EndDownload(downloadinfo *di, CurlStatus status, CURLcode error, const char *content_type_)
{
char content_type[64];
- qboolean ok = false;
+ qbool ok = false;
if(!curl_dll)
return;
switch(status)
if given) in the "dlcache/" folder.
====================
*/
-static qboolean Curl_Begin(const char *URL, const char *extraheaders, double maxspeed, const char *name, int loadtype, qboolean forthismap, const char *post_content_type, const unsigned char *postbuf, size_t postbufsize, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata)
+static qbool Curl_Begin(const char *URL, const char *extraheaders, double maxspeed, const char *name, int loadtype, qbool forthismap, const char *post_content_type, const unsigned char *postbuf, size_t postbufsize, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata)
{
if(buf)
if(loadtype != LOADTYPE_NONE)
{
if(loadtype == LOADTYPE_PAK)
{
- qboolean already_loaded;
+ qbool already_loaded;
if(FS_AddPack(fn, &already_loaded, true))
{
Con_DPrintf("%s already exists, not downloading!\n", fn);
}
}
-qboolean Curl_Begin_ToFile(const char *URL, double maxspeed, const char *name, int loadtype, qboolean forthismap)
+qbool Curl_Begin_ToFile(const char *URL, double maxspeed, const char *name, int loadtype, qbool forthismap)
{
return Curl_Begin(URL, NULL, maxspeed, name, loadtype, forthismap, NULL, NULL, 0, NULL, 0, NULL, NULL);
}
-qboolean Curl_Begin_ToMemory(const char *URL, double maxspeed, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata)
+qbool Curl_Begin_ToMemory(const char *URL, double maxspeed, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata)
{
return Curl_Begin(URL, NULL, maxspeed, NULL, false, false, NULL, NULL, 0, buf, bufsize, callback, cbdata);
}
-qboolean Curl_Begin_ToMemory_POST(const char *URL, const char *extraheaders, double maxspeed, const char *post_content_type, const unsigned char *postbuf, size_t postbufsize, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata)
+qbool Curl_Begin_ToMemory_POST(const char *URL, const char *extraheaders, double maxspeed, const char *post_content_type, const unsigned char *postbuf, size_t postbufsize, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata)
{
return Curl_Begin(URL, extraheaders, maxspeed, NULL, false, false, post_content_type, postbuf, postbufsize, buf, bufsize, callback, cbdata);
}
returns true iff there is a download running.
====================
*/
-qboolean Curl_Running(void)
+qbool Curl_Running(void)
{
if(!curl_dll)
return false;
int i;
int end;
int loadtype = LOADTYPE_NONE;
- qboolean forthismap = false;
+ qbool forthismap = false;
const char *url;
const char *name = 0;
// read lines of format "pattern url"
char *p = buf;
char *pattern = NULL, *patternend = NULL, *url = NULL, *urlend = NULL;
- qboolean eof = false;
+ qbool eof = false;
pattern = p;
while(!eof)
curl --finish_autodownload
====================
*/
-static qboolean Curl_SendRequirement(const char *filename, qboolean foundone, char *sendbuffer, size_t sendbuffer_len)
+static qbool Curl_SendRequirement(const char *filename, qbool foundone, char *sendbuffer, size_t sendbuffer_len)
{
const char *p;
const char *thispack = FS_WhichPack(filename);
// for each requirement, find the pack name
char sendbuffer[4096] = "";
requirement *req;
- qboolean foundone = false;
+ qbool foundone = false;
const char *p;
for(req = requirements; req; req = req->next)
// code is one of the CURLCBSTATUS constants, or the HTTP error code (when > 0).
void Curl_Run(void);
-qboolean Curl_Running(void);
-qboolean Curl_Begin_ToFile(const char *URL, double maxspeed, const char *name, int loadtype, qboolean forthismap);
+qbool Curl_Running(void);
+qbool Curl_Begin_ToFile(const char *URL, double maxspeed, const char *name, int loadtype, qbool forthismap);
-qboolean Curl_Begin_ToMemory(const char *URL, double maxspeed, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata);
-qboolean Curl_Begin_ToMemory_POST(const char *URL, const char *extraheaders, double maxspeed, const char *post_content_type, const unsigned char *postbuf, size_t postbufsize, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata);
+qbool Curl_Begin_ToMemory(const char *URL, double maxspeed, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata);
+qbool Curl_Begin_ToMemory_POST(const char *URL, const char *extraheaders, double maxspeed, const char *post_content_type, const unsigned char *postbuf, size_t postbufsize, unsigned char *buf, size_t bufsize, curl_callback_t callback, void *cbdata);
void Curl_Cancel_ToMemory(curl_callback_t callback, void* cbdata);
void Curl_Init(void);
void Curl_Shutdown(void);
void Curl_CancelAll(void);
void Curl_Clear_forthismap(void);
-qboolean Curl_Have_forthismap(void);
+qbool Curl_Have_forthismap(void);
void Curl_Register_predownload(void);
void Curl_ClearRequirements(void);
char filename[MAX_QPATH];
double progress;
double speed;
- qboolean queued;
+ qbool queued;
}
Curl_downloadinfo_t;
Curl_downloadinfo_t *Curl_GetDownloadInfo(int *nDownloads, const char **additional_info, char *addinfo, size_t addinfolength);
}
// LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors
-void AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qboolean flippitch)
+void AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qbool flippitch)
{
if (forward[0] == 0 && forward[1] == 0)
{
/// LadyHavoc: builds a [3][4] matrix
void AngleMatrix (const vec3_t angles, const vec3_t translate, vec_t matrix[][4]);
/// LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors
-void AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qboolean flippitch);
+void AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qbool flippitch);
/// LadyHavoc: like AngleVectors, but taking a forward vector instead of angles, useful!
void VectorVectors(const vec3_t forward, vec3_t right, vec3_t up);
static void M_ServerList_Key(cmd_state_t *cmd, int key, int ascii);
static void M_ModList_Key(cmd_state_t *cmd, int key, int ascii);
-static qboolean m_entersound; ///< play after drawing a frame, so caching won't disrupt the sound
+static qbool m_entersound; ///< play after drawing a frame, so caching won't disrupt the sound
void M_Update_Return_Reason(const char *s)
{
/* MAIN MENU */
static int m_main_cursor;
-static qboolean m_missingdata = false;
+static qbool m_missingdata = false;
static int MAIN_ITEMS = 4; // Nehahra: Menu Disable
static video_resolution_t *menu_video_resolutions;
static int menu_video_resolutions_count;
-static qboolean menu_video_resolutions_forfullscreen;
+static qbool menu_video_resolutions_forfullscreen;
static void M_Menu_Video_FindResolution(int w, int h, float a)
{
static const char *m_quit_message[9];
static int m_quit_prevstate;
-static qboolean wasInMenus;
+static qbool wasInMenus;
static int M_QuitMessage(const char *line1, const char *line2, const char *line3, const char *line4, const char *line5, const char *line6, const char *line7, const char *line8)
static int startepisode;
static int startlevel;
static int maxplayers;
-static qboolean m_serverInfoMessage = false;
+static qbool m_serverInfoMessage = false;
static double m_serverInfoMessageTime;
void M_Menu_GameOptions_f(cmd_state_t *cmd)
typedef struct modlist_entry_s
{
- qboolean loaded; // used to determine whether this entry is loaded and running
+ qbool loaded; // used to determine whether this entry is loaded and running
int enabled; // index to array of modlist_enabled
// name of the modification, this is (will...be) displayed on the menu entry
//=============================================================================
/* Menu Subsystem */
-static void M_KeyEvent(int key, int ascii, qboolean downevent);
+static void M_KeyEvent(int key, int ascii, qbool downevent);
static void M_Draw(void);
void M_ToggleMenu(int mode);
static void M_Shutdown(void);
}
-void M_KeyEvent (int key, int ascii, qboolean downevent)
+void M_KeyEvent (int key, int ascii, qbool downevent)
{
cmd_state_t *cmd = &cmd_client;
if (!downevent)
static int m_numrequiredglobals = sizeof(m_required_globals) / sizeof(m_required_globals[0]);
-void MR_SetRouting (qboolean forceold);
+void MR_SetRouting (qbool forceold);
void MVM_error_cmd(const char *format, ...) DP_FUNC_PRINTF(1);
void MVM_error_cmd(const char *format, ...)
{
prvm_prog_t *prog = MVM_prog;
- static qboolean processingError = false;
+ static qbool processingError = false;
char errorstring[MAX_INPUTLINE];
va_list argptr;
Con_Printf("active :%3i\n", active);
}
-static qboolean MVM_load_edict(prvm_prog_t *prog, prvm_edict_t *ent)
+static qbool MVM_load_edict(prvm_prog_t *prog, prvm_edict_t *ent)
{
return true;
}
-static void MP_KeyEvent (int key, int ascii, qboolean downevent)
+static void MP_KeyEvent (int key, int ascii, qbool downevent)
{
prvm_prog_t *prog = MVM_prog;
//============================================================================
// Menu router
-void (*MR_KeyEvent) (int key, int ascii, qboolean downevent);
+void (*MR_KeyEvent) (int key, int ascii, qbool downevent);
void (*MR_Draw) (void);
void (*MR_ToggleMenu) (int mode);
void (*MR_Shutdown) (void);
void (*MR_NewMap) (void);
int (*MR_GetServerListEntryCategory) (const serverlist_entry_t *entry);
-void MR_SetRouting(qboolean forceold)
+void MR_SetRouting(qbool forceold)
{
// if the menu prog isnt available or forceqmenu ist set, use the old menu
if(!FS_FileExists(menu_progs.string) || forceqmenu.integer || forceold)
MR_ToggleMenu(m);
}
-static qboolean menu_active;
+static qbool menu_active;
static void MR_Start_f(cmd_state_t *cmd)
{
void MR_Init_Commands (void);
void MR_Init (void);
void MR_Restart (void);
-extern void (*MR_KeyEvent) (int key, int ascii, qboolean downevent);
+extern void (*MR_KeyEvent) (int key, int ascii, qbool downevent);
extern void (*MR_Draw) (void);
extern void (*MR_ToggleMenu) (int mode);
extern void (*MR_Shutdown) (void);
#endif
#ifdef SSE_POSSIBLE
-static qboolean r_skeletal_use_sse_defined = false;
+static qbool r_skeletal_use_sse_defined = false;
cvar_t r_skeletal_use_sse = {CVAR_CLIENT, "r_skeletal_use_sse", "1", "use SSE for skeletal model animation"};
#endif
cvar_t r_skeletal_debugbone = {CVAR_CLIENT, "r_skeletal_debugbone", "-1", "development cvar for testing skeletal model code"};
Mem_Free(basebonepose);
}
-static qboolean Mod_Alias_CalculateBoundingBox(void)
+static qbool Mod_Alias_CalculateBoundingBox(void)
{
int vnum;
- qboolean firstvertex = true;
+ qbool firstvertex = true;
float dist, yawradius, radius;
float *v;
- qboolean isanimated = false;
+ qbool isanimated = false;
VectorClear(loadmodel->normalmins);
VectorClear(loadmodel->normalmaxs);
yawradius = 0;
static texture_t mod_q1bsp_texture_slime;
static texture_t mod_q1bsp_texture_water;
-static qboolean Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
+static qbool Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
void Mod_BrushInit(void)
{
}
}
-static qboolean Mod_Q1BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs)
+static qbool Mod_Q1BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs)
{
trace_t trace;
Mod_Q1BSP_TraceLine(model, NULL, NULL, &trace, start, end, SUPERCONTENTS_VISBLOCKERMASK, 0, MATERIALFLAGMASK_TRANSLUCENT);
}
}
-static qboolean Mod_Q1BSP_CheckWaterAlphaSupport(void)
+static qbool Mod_Q1BSP_CheckWaterAlphaSupport(void)
{
int i, j;
mleaf_t *leaf;
#if 0
// unfinished
int submodel, numbrushes;
- qboolean firstbrush;
+ qbool firstbrush;
char *text, *maptext;
char mapfilename[MAX_QPATH];
FS_StripExtension (loadmodel->name, mapfilename, sizeof (mapfilename));
//Calculates a PVS that is the inclusive or of all leafs within radius pixels
//of the given point.
-static int Mod_BSP_FatPVS(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qboolean merge)
+static int Mod_BSP_FatPVS(dp_model_t *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qbool merge)
{
int bytes = model->brush.num_pvsclusterbytes;
bytes = min(bytes, pvsbufferlength);
int i, j, firstside, numsides, contents, count, maxplanes, q3surfaceflags, supercontents;
colplanef_t *planes;
int structsize = 12;
- qboolean brushmissingtextures;
+ qbool brushmissingtextures;
int numbrushesmissingtextures = 0;
int numcreatedtextures = 0;
unsigned char *mergeddeluxepixels;
unsigned char *mergebuf;
char mapname[MAX_QPATH];
- qboolean external;
+ qbool external;
unsigned char *inpixels[10000]; // max count q3map2 can output (it uses 4 digits)
char vabuf[1024];
float *v;
patchtess_t *patchtess = NULL;
int patchtesscount = 0;
- qboolean again;
+ qbool again;
in = (q3dface_t *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
return ((mleaf_t *)node)->clusterindex < 0;
}
-static qboolean Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs)
+static qbool Mod_Q3BSP_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs)
{
if (model->brush.submodel || mod_q3bsp_tracelineofsight_brushes.integer)
{
return trace.startsupercontents;
}
-qboolean Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs)
+qbool Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs)
{
trace_t trace;
Mod_CollisionBIH_TraceLine(model, NULL, NULL, &trace, start, end, SUPERCONTENTS_VISBLOCKERMASK, 0, MATERIALFLAGMASK_TRANSLUCENT);
}
-bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t *out)
+bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qbool userendersurfaces, bih_t *out)
{
int j;
int bihnumleafs;
void Mod_UnloadModel (dp_model_t *mod)
{
char name[MAX_QPATH];
- qboolean used;
+ qbool used;
dp_model_t *parentmodel;
if (developer_loading.integer)
}
-typedef void (*mod_framegroupify_parsegroups_t) (unsigned int i, int start, int len, float fps, qboolean loop, const char *name, void *pass);
+typedef void (*mod_framegroupify_parsegroups_t) (unsigned int i, int start, int len, float fps, qbool loop, const char *name, void *pass);
static int Mod_FrameGroupify_ParseGroups(const char *buf, mod_framegroupify_parsegroups_t cb, void *pass)
{
int start, len;
float fps;
unsigned int i;
- qboolean loop;
+ qbool loop;
char name[64];
bufptr = buf;
return i;
}
-static void Mod_FrameGroupify_ParseGroups_Store (unsigned int i, int start, int len, float fps, qboolean loop, const char *name, void *pass)
+static void Mod_FrameGroupify_ParseGroups_Store (unsigned int i, int start, int len, float fps, qbool loop, const char *name, void *pass)
{
dp_model_t *mod = (dp_model_t *) pass;
animscene_t *anim = &mod->animscenes[i];
Loads a model
==================
*/
-dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk)
+dp_model_t *Mod_LoadModel(dp_model_t *mod, qbool crash, qbool checkdisk)
{
unsigned int crc;
void *buf;
Loads in a model for the given name
==================
*/
-dp_model_t *Mod_ForName(const char *name, qboolean crash, qboolean checkdisk, const char *parentname)
+dp_model_t *Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname)
{
dp_model_t *model;
model = Mod_FindName(name, parentname);
return count;
}
-qboolean Mod_ValidateElements(int *element3i, unsigned short *element3s, int numtriangles, int firstvertex, int numvertices, const char *filename, int fileline)
+qbool Mod_ValidateElements(int *element3i, unsigned short *element3s, int numtriangles, int firstvertex, int numvertices, const char *filename, int fileline)
{
int first = firstvertex, last = first + numvertices - 1, numelements = numtriangles * 3;
int i;
}
// warning: this is an expensive function!
-void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const int *elements, float *normal3f, qboolean areaweighting)
+void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const int *elements, float *normal3f, qbool areaweighting)
{
int i, j;
const int *element;
#endif
// warning: this is a very expensive function!
-void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qboolean areaweighting)
+void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qbool areaweighting)
{
int i, tnum;
float sdir[3], tdir[3], normal[3], *svec, *tvec;
}
}
-void Mod_AllocSurfMesh(mempool_t *mempool, int numvertices, int numtriangles, qboolean lightmapoffsets, qboolean vertexcolors)
+void Mod_AllocSurfMesh(mempool_t *mempool, int numvertices, int numtriangles, qbool lightmapoffsets, qbool vertexcolors)
{
unsigned char *data;
data = (unsigned char *)Mem_Alloc(mempool, numvertices * (3 + 3 + 3 + 3 + 2 + 2 + (vertexcolors ? 4 : 0)) * sizeof(float) + numvertices * (lightmapoffsets ? 1 : 0) * sizeof(int) + numtriangles * sizeof(int[3]) + (numvertices <= 65536 ? numtriangles * sizeof(unsigned short[3]) : 0));
}
}
-shadowmesh_t *Mod_ShadowMesh_Finish(shadowmesh_t *mesh, qboolean createvbo)
+shadowmesh_t *Mod_ShadowMesh_Finish(shadowmesh_t *mesh, qbool createvbo)
{
if (mesh->numverts >= 3 && mesh->numtriangles >= 1)
{
void Mod_CreateCollisionMesh(dp_model_t *mod)
{
int k, numcollisionmeshtriangles;
- qboolean usesinglecollisionmesh = false;
+ qbool usesinglecollisionmesh = false;
const msurface_t *surface = NULL;
mempool_t *mempool = mod->mempool;
char *custsurfaceparmnames[256]; // VorteX: q3map2 has 64 but well, someone will need more
unsigned long custsurfaceflags[256];
int numcustsurfaceflags;
- qboolean dpshaderkill;
+ qbool dpshaderkill;
Mod_FreeQ3Shaders();
return shaderpass;
}
-qboolean Mod_LoadTextureFromQ3Shader(mempool_t *mempool, const char *modelname, texture_t *texture, const char *name, qboolean warnmissing, qboolean fallback, int defaulttexflags, int defaultmaterialflags)
+qbool Mod_LoadTextureFromQ3Shader(mempool_t *mempool, const char *modelname, texture_t *texture, const char *name, qbool warnmissing, qbool fallback, int defaulttexflags, int defaultmaterialflags)
{
int texflagsmask, texflagsor;
- qboolean success = true;
+ qbool success = true;
shader_t *shader;
if (!name)
name = "";
texture->backgroundcurrentskinframe = NULL;
}
-void Mod_UnloadCustomMaterial(texture_t *texture, qboolean purgeskins)
+void Mod_UnloadCustomMaterial(texture_t *texture, qbool purgeskins)
{
long unsigned int i, j;
for (i = 0; i < sizeof(texture->shaderpasses) / sizeof(texture->shaderpasses[0]); i++)
Con_Printf("Wrote %s (%i bytes, %i vertices, %i faces, %i surfaces with %i distinct textures)\n", filename, (int)outbufferpos, countvertices, countfaces, countsurfaces, counttextures);
}
-static void Mod_Decompile_SMD(dp_model_t *model, const char *filename, int firstpose, int numposes, qboolean writetriangles)
+static void Mod_Decompile_SMD(dp_model_t *model, const char *filename, int firstpose, int numposes, qbool writetriangles)
{
int countnodes = 0, counttriangles = 0, countframes = 0;
int surfaceindex;
memset(state, 0, sizeof(*state));
}
-qboolean Mod_AllocLightmap_Block(mod_alloclightmap_state_t *state, int blockwidth, int blockheight, int *outx, int *outy)
+qbool Mod_AllocLightmap_Block(mod_alloclightmap_state_t *state, int blockwidth, int blockheight, int *outx, int *outy)
{
mod_alloclightmap_row_t *row;
int y;
mod_generatelightmaps_numlights = 0;
}
-static qboolean Mod_GenerateLightmaps_SamplePoint_SVBSP(const svbsp_t *svbsp, const float *pos)
+static qbool Mod_GenerateLightmaps_SamplePoint_SVBSP(const svbsp_t *svbsp, const float *pos)
{
const svbsp_node_t *node;
const svbsp_node_t *nodes = svbsp->nodes;
return t;
}
-msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qboolean batchwithprevioussurface)
+msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qbool batchwithprevioussurface)
{
msurface_t *surf;
// batch if possible; primarily useful for UI rendering where bounding boxes don't matter
void Mod_Mesh_Validate(dp_model_t *mod)
{
int i;
- qboolean warned = false;
+ qbool warned = false;
for (i = 0; i < mod->num_surfaces; i++)
{
msurface_t *surf = mod->data_surfaces + i;
// are freed
unsigned int loadsequence;
// indicates whether this texture has transparent pixels
- qboolean hasalpha;
+ qbool hasalpha;
// average texture color, if applicable
float avgcolor[4];
// for mdl skins, we actually only upload on first use (many are never used, and they are almost never used in both base+pants+shirt and merged modes)
unsigned char *qpixels;
int qwidth;
int qheight;
- qboolean qhascolormapping;
- qboolean qgeneratebase;
- qboolean qgeneratemerged;
- qboolean qgeneratenmap;
- qboolean qgenerateglow;
+ qbool qhascolormapping;
+ qbool qgeneratebase;
+ qbool qgeneratemerged;
+ qbool qgeneratenmap;
+ qbool qgenerateglow;
}
skinframe_t;
int bufferobject; // OpenGL
void *devicebuffer; // Direct3D
size_t size;
- qboolean isindexbuffer;
- qboolean isuniformbuffer;
- qboolean isdynamic;
- qboolean isindex16;
+ qbool isindexbuffer;
+ qbool isuniformbuffer;
+ qbool isdynamic;
+ qbool isindex16;
char name[MAX_QPATH];
}
r_meshbuffer_t;
int num_blends;
unsigned short *blends;
// set if there is some kind of animation on this model
- qboolean isanimated;
+ qbool isanimated;
// dynamic mesh building support (Mod_Mesh_*)
int num_vertexhashsize; // always pow2 for simple masking
int surfaceflags;
int textureflags;
int numlayers;
- qboolean lighting;
- qboolean vertexalpha;
- qboolean textureblendalpha;
+ qbool lighting;
+ qbool vertexalpha;
+ qbool textureblendalpha;
q3shaderinfo_layer_t layers[Q3SHADER_MAXLAYERS];
char skyboxname[Q3PATHLENGTH];
q3shaderinfo_deform_t deforms[Q3MAXDEFORMS];
// dp-specific additions:
// shadow control
- qboolean dpnortlight;
- qboolean dpshadow;
- qboolean dpnoshadow;
+ qbool dpnortlight;
+ qbool dpshadow;
+ qbool dpnoshadow;
// add collisions to all triangles of the surface
- qboolean dpmeshcollisions;
+ qbool dpmeshcollisions;
// kill shader based on cvar checks
- qboolean dpshaderkill;
+ qbool dpshaderkill;
// fake reflection
char dpreflectcube[Q3PATHLENGTH];
typedef struct texture_shaderpass_s
{
- qboolean alphatest; // FIXME: handle alphafunc properly
+ qbool alphatest; // FIXME: handle alphafunc properly
float framerate;
int numframes;
skinframe_t *skinframes[TEXTURE_MAXFRAMES];
unsigned char startpostshaderpass; // range within shaderpasses[]
unsigned char endpostshaderpass; // number of postshaderpasses
- qboolean colormapping;
+ qbool colormapping;
rtexture_t *basetexture; // original texture without pants/shirt/glow
rtexture_t *pantstexture; // pants only (in greyscale)
rtexture_t *shirttexture; // shirt only (in greyscale)
int num_collisionvertices; // q3bsp
// used by Mod_Mesh_Finalize when building sortedmodelsurfaces
- qboolean included;
+ qbool included;
}
msurface_t;
typedef struct model_brush_s
{
// true if this model is a HalfLife .bsp file
- qboolean ishlbsp;
+ qbool ishlbsp;
// true if this model is a BSP2rmqe .bsp file (expanded 32bit bsp format for rmqe)
- qboolean isbsp2rmqe;
+ qbool isbsp2rmqe;
// true if this model is a BSP2 .bsp file (expanded 32bit bsp format for DarkPlaces, others?)
- qboolean isbsp2;
+ qbool isbsp2;
// true if this model is a Quake2 .bsp file (IBSP38)
- qboolean isq2bsp;
+ qbool isq2bsp;
// true if this model is a Quake3 .bsp file (IBSP46)
- qboolean isq3bsp;
+ qbool isq3bsp;
// true if this model is a Quake1/Quake2 .bsp file where skymasking capability exists
- qboolean skymasking;
+ qbool skymasking;
// string of entity definitions (.map format)
char *entities;
int (*SuperContentsFromNativeContents)(int nativecontents);
int (*NativeContentsFromSuperContents)(int supercontents);
unsigned char *(*GetPVS)(struct model_s *model, const vec3_t p);
- int (*FatPVS)(struct model_s *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qboolean merge);
+ int (*FatPVS)(struct model_s *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qbool merge);
int (*BoxTouchingPVS)(struct model_s *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs);
int (*BoxTouchingLeafPVS)(struct model_s *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs);
int (*BoxTouchingVisibleLeafs)(struct model_s *model, const unsigned char *visibleleafs, const vec3_t mins, const vec3_t maxs);
void (*AmbientSoundLevelsForPoint)(struct model_s *model, const vec3_t p, unsigned char *out, int outsize);
void (*RoundUpToHullSize)(struct model_s *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs);
// trace a line of sight through this model (returns false if the line if sight is definitely blocked)
- qboolean (*TraceLineOfSight)(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
+ qbool (*TraceLineOfSight)(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
char skybox[MAX_QPATH];
skinframe_t *solidskyskinframe;
skinframe_t *alphaskyskinframe;
- qboolean supportwateralpha;
+ qbool supportwateralpha;
// QuakeWorld
int qw_md4sum;
// this contains bytes that are 1 if a surface needs its lightmap rebuilt
unsigned char *lightmapupdateflags;
- qboolean firstrender; // causes all surface lightmaps to be loaded in first frame
+ qbool firstrender; // causes all surface lightmaps to be loaded in first frame
}
model_brushq1_t;
// true if this q3bsp file has been detected as using deluxemapping
// (lightmap texture pairs, every odd one is never directly refernced,
// and contains lighting normals, not colors)
- qboolean deluxemapping;
+ qbool deluxemapping;
// true if the detected deluxemaps are the modelspace kind, rather than
// the faster tangentspace kind
- qboolean deluxemapping_modelspace;
+ qbool deluxemapping_modelspace;
// size of lightmaps (128 by default, but may be another poweroftwo if
// external lightmaps are used (q3map2 -lightmapsize)
int lightmapsize;
// name and path of model, for example "progs/player.mdl"
char name[MAX_QPATH];
// model needs to be loaded if this is false
- qboolean loaded;
+ qbool loaded;
// set if the model is used in current map, models which are not, are purged
- qboolean used;
+ qbool used;
// CRC of the file this model was loaded from, to reload if changed
unsigned int crc;
// mod_brush, mod_alias, mod_sprite
int max_textures; // preallocated for expansion (Mod_Mesh_*)
int num_texturesperskin;
texture_t *data_textures;
- qboolean wantnormals;
- qboolean wanttangents;
+ qbool wantnormals;
+ qbool wanttangents;
// surfaces of this model
int num_surfaces;
int max_surfaces; // preallocated for expansion (Mod_Mesh_*)
// draw depth into a shadowmap
void(*DrawShadowMap)(int side, struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs);
// gathers info on which clusters and surfaces are lit by light, as well as calculating a bounding box
- void(*GetLightInfo)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion);
+ void(*GetLightInfo)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qbool noocclusion);
// draw the lighting on a model (through stencil)
void(*DrawLight)(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
// trace a box against this model
int soundfromcenter;
// if set, the model contains light information (lightmap, or vertexlight)
- qboolean lit;
+ qbool lit;
float lightmapscale;
- qboolean nolerp;
+ qbool nolerp;
}
dp_model_t;
void Mod_Init (void);
void Mod_Reload (void);
-dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk);
+dp_model_t *Mod_LoadModel(dp_model_t *mod, qbool crash, qbool checkdisk);
dp_model_t *Mod_FindName (const char *name, const char *parentname);
-dp_model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, const char *parentname);
+dp_model_t *Mod_ForName (const char *name, qbool crash, qbool checkdisk, const char *parentname);
void Mod_UnloadModel (dp_model_t *mod);
void Mod_ClearUsed(void);
extern char loadname[32]; // for hunk tags
int Mod_BuildVertexRemapTableFromElements(int numelements, const int *elements, int numvertices, int *remapvertices);
-void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const int *elements, float *normal3f, qboolean areaweighting);
-void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qboolean areaweighting);
+void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const int *elements, float *normal3f, qbool areaweighting);
+void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qbool areaweighting);
-qboolean Mod_ValidateElements(int *element3i, unsigned short *element3s, int numtriangles, int firstvertex, int numvertices, const char *filename, int fileline);
-void Mod_AllocSurfMesh(mempool_t *mempool, int numvertices, int numtriangles, qboolean lightmapoffsets, qboolean vertexcolors);
+qbool Mod_ValidateElements(int *element3i, unsigned short *element3s, int numtriangles, int firstvertex, int numvertices, const char *filename, int fileline);
+void Mod_AllocSurfMesh(mempool_t *mempool, int numvertices, int numtriangles, qbool lightmapoffsets, qbool vertexcolors);
void Mod_MakeSortedSurfaces(dp_model_t *mod);
// called specially by brush model loaders before generating submodels
int Mod_ShadowMesh_AddVertex(shadowmesh_t *mesh, const float *vertex3f);
void Mod_ShadowMesh_AddMesh(shadowmesh_t *mesh, const float *vertex3f, int numtris, const int *element3i);
shadowmesh_t *Mod_ShadowMesh_Begin(mempool_t *mempool, int maxverts, int maxtriangles);
-shadowmesh_t *Mod_ShadowMesh_Finish(shadowmesh_t *firstmesh, qboolean createvbo);
+shadowmesh_t *Mod_ShadowMesh_Finish(shadowmesh_t *firstmesh, qbool createvbo);
void Mod_ShadowMesh_CalcBBox(shadowmesh_t *firstmesh, vec3_t mins, vec3_t maxs, vec3_t center, float *radius);
void Mod_ShadowMesh_Free(shadowmesh_t *mesh);
void Mod_FreeQ3Shaders(void);
void Mod_LoadQ3Shaders(void);
shader_t *Mod_LookupQ3Shader(const char *name);
-qboolean Mod_LoadTextureFromQ3Shader(mempool_t *mempool, const char *modelname, texture_t *texture, const char *name, qboolean warnmissing, qboolean fallback, int defaulttexflags, int defaultmaterialflags);
+qbool Mod_LoadTextureFromQ3Shader(mempool_t *mempool, const char *modelname, texture_t *texture, const char *name, qbool warnmissing, qbool fallback, int defaulttexflags, int defaultmaterialflags);
texture_shaderpass_t *Mod_CreateShaderPass(mempool_t *mempool, skinframe_t *skinframe);
texture_shaderpass_t *Mod_CreateShaderPassFromQ3ShaderLayer(mempool_t *mempool, const char *modelname, q3shaderinfo_layer_t *layer, int layerindex, int texflags, const char *texturename);
/// Sets up a material to render the provided skinframe. See also R_SkinFrame_LoadInternalBGRA.
void Mod_LoadCustomMaterial(mempool_t *mempool, texture_t *texture, const char *name, int supercontents, int materialflags, skinframe_t *skinframe);
/// Removes all shaderpasses from material, and optionally deletes the textures in the skinframes.
-void Mod_UnloadCustomMaterial(texture_t *texture, qboolean purgeskins);
+void Mod_UnloadCustomMaterial(texture_t *texture, qbool purgeskins);
extern cvar_t r_mipskins;
extern cvar_t r_mipnormalmaps;
void Mod_AllocLightmap_Init(mod_alloclightmap_state_t *state, mempool_t *mempool, int width, int height);
void Mod_AllocLightmap_Free(mod_alloclightmap_state_t *state);
void Mod_AllocLightmap_Reset(mod_alloclightmap_state_t *state);
-qboolean Mod_AllocLightmap_Block(mod_alloclightmap_state_t *state, int blockwidth, int blockheight, int *outx, int *outy);
+qbool Mod_AllocLightmap_Block(mod_alloclightmap_state_t *state, int blockwidth, int blockheight, int *outx, int *outy);
// bsp models
void Mod_BrushInit(void);
void R_Mod_DrawDepth(struct entity_render_s *ent);
void R_Mod_DrawDebug(struct entity_render_s *ent);
void R_Mod_DrawPrepass(struct entity_render_s *ent);
-void R_Mod_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qboolean noocclusion);
+void R_Mod_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qbool noocclusion);
void R_Mod_CompileShadowMap(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
void R_Mod_DrawShadowMap(int side, struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs);
void R_Mod_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
void Mod_Mesh_Destroy(dp_model_t *mod);
void Mod_Mesh_Reset(dp_model_t *mod);
texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags);
-msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qboolean batchwithprevioussurface);
+msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qbool batchwithprevioussurface);
int Mod_Mesh_IndexForVertex(dp_model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a);
void Mod_Mesh_AddTriangle(dp_model_t *mod, msurface_t *surf, int e0, int e1, int e2);
void Mod_Mesh_Validate(dp_model_t *mod);
void Mod_CollisionBIH_TraceBox(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
void Mod_CollisionBIH_TraceBrush(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, struct colbrushf_s *start, struct colbrushf_s *end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
void Mod_CollisionBIH_TracePoint_Mesh(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
-qboolean Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
+qbool Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
int Mod_CollisionBIH_PointSuperContents(struct model_s *model, int frame, const vec3_t point);
int Mod_CollisionBIH_PointSuperContents_Mesh(struct model_s *model, int frame, const vec3_t point);
-bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t *out);
+bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qbool userendersurfaces, bih_t *out);
// alias models
struct frameblend_s;
Cvar_RegisterVariable(&r_track_sprites_scaleh);
}
-static void Mod_SpriteSetupTexture(texture_t *texture, skinframe_t *skinframe, qboolean fullbright, qboolean additive)
+static void Mod_SpriteSetupTexture(texture_t *texture, skinframe_t *skinframe, qbool fullbright, qbool additive)
{
if (!skinframe)
skinframe = R_SkinFrame_LoadMissing();
extern cvar_t gl_texturecompression_sprites;
-static void Mod_Sprite_SharedSetup(const unsigned char *datapointer, int version, const unsigned int *palette, qboolean additive)
+static void Mod_Sprite_SharedSetup(const unsigned char *datapointer, int version, const unsigned int *palette, qbool additive)
{
int i, j, groupframes, realframes, x, y, origin[2], width, height;
- qboolean fullbright;
+ qbool fullbright;
dspriteframetype_t *pinframetype;
dspriteframe_t *pinframe;
dspritegroup_t *pingroup;
void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend)
{
int i, version;
- qboolean fullbright;
+ qbool fullbright;
const dsprite2_t *pinqsprite;
skinframe_t *skinframe;
float modelradius;
*/
static void VM_M_refreshserverlist(prvm_prog_t *prog)
{
- qboolean do_reset = false;
+ qbool do_reset = false;
VM_SAFEPARMCOUNTRANGE( 0, 1, VM_M_refreshserverlist );
if (prog->argc >= 1 && PRVM_G_FLOAT(OFS_PARM0))
do_reset = true;
{
lhnetaddress_t addr;
const char *s;
- qboolean issigned;
+ qbool issigned;
VM_SAFEPARMCOUNT(1,VM_M_crypto_getidstatus);
static void VM_M_crypto_getmyidstatus(prvm_prog_t *prog)
{
int i;
- qboolean issigned;
+ qbool issigned;
VM_SAFEPARMCOUNT(1, VM_M_crypto_getmyidstatus);
#ifdef CONFIG_MENU
/// this is only false if there are still servers left to query
-static qboolean serverlist_querysleep = true;
-static qboolean serverlist_paused = false;
+static qbool serverlist_querysleep = true;
+static qbool serverlist_paused = false;
/// this is pushed a second or two ahead of realtime whenever a master server
/// reply is received, to avoid issuing queries while master replies are still
/// flooding in (which would make a mess of the ping times)
int serverlist_cachecount = 0;
serverlist_entry_t *serverlist_cache = NULL;
-qboolean serverlist_consoleoutput;
+qbool serverlist_consoleoutput;
static int nFavorites = 0;
static lhnetaddress_t favorites[MAX_FAVORITESERVERS];
}
/// \returns true if A should be inserted before B
-static qboolean _ServerList_Entry_Compare( serverlist_entry_t *A, serverlist_entry_t *B )
+static qbool _ServerList_Entry_Compare( serverlist_entry_t *A, serverlist_entry_t *B )
{
int result = 0; // > 0 if for numbers A > B and for text if A < B
return A < B;
}
-static qboolean _ServerList_CompareInt( int A, serverlist_maskop_t op, int B )
+static qbool _ServerList_CompareInt( int A, serverlist_maskop_t op, int B )
{
// This should actually be done with some intermediate and end-of-function return
switch( op ) {
}
}
-static qboolean _ServerList_CompareStr( const char *A, serverlist_maskop_t op, const char *B )
+static qbool _ServerList_CompareStr( const char *A, serverlist_maskop_t op, const char *B )
{
int i;
char bufferA[ 1400 ], bufferB[ 1400 ]; // should be more than enough
}
}
-static qboolean _ServerList_Entry_Mask( serverlist_mask_t *mask, serverlist_info_t *info )
+static qbool _ServerList_Entry_Mask( serverlist_mask_t *mask, serverlist_info_t *info )
{
if( !_ServerList_CompareInt( info->ping, mask->tests[SLIF_PING], mask->info.ping ) )
return false;
}
#endif
-void ServerList_QueryList(qboolean resetcache, qboolean querydp, qboolean queryqw, qboolean consoleoutput)
+void ServerList_QueryList(qbool resetcache, qbool querydp, qbool queryqw, qbool consoleoutput)
{
masterquerytime = host.realtime;
masterquerycount = 0;
return NetConn_Write(mysocket, string, (int)strlen(string), peeraddress);
}
-qboolean NetConn_CanSend(netconn_t *conn)
+qbool NetConn_CanSend(netconn_t *conn)
{
conn->outgoing_packetcounter = (conn->outgoing_packetcounter + 1) % NETGRAPH_PACKETS;
conn->outgoing_netgraph[conn->outgoing_packetcounter].time = host.realtime;
return flag;
}
-int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qboolean quakesignon_suppressreliables)
+int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qbool quakesignon_suppressreliables)
{
int totallen = 0;
unsigned char sendbuffer[NET_HEADERSIZE+NET_MAXMESSAGE];
if (protocol == PROTOCOL_QUAKEWORLD)
{
int packetLen;
- qboolean sendreliable;
+ qbool sendreliable;
// note that it is ok to send empty messages to the qw server,
// otherwise it won't respond to us at all
return 0;
}
-qboolean NetConn_HaveClientPorts(void)
+qbool NetConn_HaveClientPorts(void)
{
return !!cl_numsockets;
}
-qboolean NetConn_HaveServerPorts(void)
+qbool NetConn_HaveServerPorts(void)
{
return !!sv_numsockets;
}
LHNET_CloseSocket(sv_sockets[sv_numsockets - 1]);
}
-static qboolean NetConn_OpenServerPort(const char *addressstring, lhnetaddresstype_t addresstype, int defaultport, int range)
+static qbool NetConn_OpenServerPort(const char *addressstring, lhnetaddresstype_t addresstype, int defaultport, int range)
{
lhnetaddress_t address;
lhnetsocket_t *s;
if (opennetports)
{
#ifndef NOSUPPORTIPV6
- qboolean ip4success = NetConn_OpenServerPort(net_address.string, LHNETADDRESSTYPE_INET4, port, 100);
+ qbool ip4success = NetConn_OpenServerPort(net_address.string, LHNETADDRESSTYPE_INET4, port, 100);
NetConn_OpenServerPort(net_address_ipv6.string, LHNETADDRESSTYPE_INET6, port, ip4success ? 1 : 100);
#else
NetConn_OpenServerPort(net_address.string, LHNETADDRESSTYPE_INET4, port, 100);
if (protocol == PROTOCOL_QUAKEWORLD)
{
unsigned int sequence, sequence_ack;
- qboolean reliable_ack, reliable_message;
+ qbool reliable_ack, reliable_message;
int count;
//int qport;
}
// returns true, if it's sensible to continue the processing
-static qboolean NetConn_ClientParsePacket_ServerList_PrepareQuery( int protocol, const char *ipstring, qboolean isfavorite ) {
+static qbool NetConn_ClientParsePacket_ServerList_PrepareQuery( int protocol, const char *ipstring, qbool isfavorite ) {
int n;
serverlist_entry_t *entry;
return true;
}
-static void NetConn_ClientParsePacket_ServerList_ParseDPList(lhnetaddress_t *senderaddress, const unsigned char *data, int length, qboolean isextended)
+static void NetConn_ClientParsePacket_ServerList_ParseDPList(lhnetaddress_t *senderaddress, const unsigned char *data, int length, qbool isextended)
{
masterreplycount++;
if (serverlist_consoleoutput)
static int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, unsigned char *data, int length, lhnetaddress_t *peeraddress)
{
- qboolean fromserver;
+ qbool fromserver;
int ret, c;
char *string, addressstring2[128];
char stringbuf[16384];
}
/// (div0) build the full response only if possible; better a getinfo response than no response at all if getstatus won't fit
-static qboolean NetConn_BuildStatusResponse(const char* challenge, char* out_msg, size_t out_size, qboolean fullstatus)
+static qbool NetConn_BuildStatusResponse(const char* challenge, char* out_msg, size_t out_size, qbool fullstatus)
{
prvm_prog_t *prog = SVVM_prog;
char qcstatus[256];
return false;
}
-static qboolean NetConn_PreventFlood(lhnetaddress_t *peeraddress, server_floodaddress_t *floodlist, size_t floodlength, double floodtime, qboolean renew)
+static qbool NetConn_PreventFlood(lhnetaddress_t *peeraddress, server_floodaddress_t *floodlist, size_t floodlength, double floodtime, qbool renew)
{
size_t floodslotnum, bestfloodslotnum;
double bestfloodtime;
}
}
-typedef qboolean (*rcon_matchfunc_t) (lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen);
+typedef qbool (*rcon_matchfunc_t) (lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen);
-static qboolean hmac_mdfour_time_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
+static qbool hmac_mdfour_time_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
{
char mdfourbuf[16];
long t1, t2;
return !memcmp(mdfourbuf, hash, 16);
}
-static qboolean hmac_mdfour_challenge_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
+static qbool hmac_mdfour_challenge_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
{
char mdfourbuf[16];
int i;
return true;
}
-static qboolean plaintext_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
+static qbool plaintext_matching(lhnetaddress_t *peeraddress, const char *password, const char *hash, const char *s, int slen)
{
if (!password[0]) {
Con_Print(CON_ERROR "LOGIC ERROR: RCon_Authenticate should never call the comparator with an empty password. Please report.\n");
{
const char *text, *userpass_start, *userpass_end, *userpass_startpass;
static char buf[MAX_INPUTLINE];
- qboolean hasquotes;
- qboolean restricted = false;
- qboolean have_usernames = false;
+ qbool hasquotes;
+ qbool restricted = false;
+ qbool have_usernames = false;
static char vabuf[1024];
userpass_start = rcon_password.string;
return va(vabuf, sizeof(vabuf), "%srcon", restricted ? "restricted " : "");
}
-static void RCon_Execute(lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress, const char *addressstring2, const char *userlevel, const char *s, const char *endpos, qboolean proquakeprotocol)
+static void RCon_Execute(lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress, const char *addressstring2, const char *userlevel, const char *s, const char *endpos, qbool proquakeprotocol)
{
if(userlevel)
{
double besttime;
char *string, response[2800], addressstring2[128];
static char stringbuf[16384]; // server only
- qboolean islocal = (LHNETADDRESS_GetAddressType(peeraddress) == LHNETADDRESSTYPE_LOOP);
+ qbool islocal = (LHNETADDRESS_GetAddressType(peeraddress) == LHNETADDRESSTYPE_LOOP);
char senddata[NET_HEADERSIZE+NET_MAXMESSAGE+CRYPTO_HEADERSIZE];
size_t sendlength, response_len;
char infostringvalue[MAX_INPUTLINE];
}
#ifdef CONFIG_MENU
-void NetConn_QueryMasters(qboolean querydp, qboolean queryqw)
+void NetConn_QueryMasters(qbool querydp, qbool queryqw)
{
int i, j;
int masternum;
struct netconn_qw_s
{
// QW protocol
- qboolean fatal_error;
+ qbool fatal_error;
float last_received; // for timeouts
// sequencing variables
unsigned int incoming_sequence;
unsigned int incoming_acknowledged;
- qboolean incoming_reliable_acknowledged; ///< single bit
+ qbool incoming_reliable_acknowledged; ///< single bit
- qboolean incoming_reliable_sequence; ///< single bit, maintained local
+ qbool incoming_reliable_sequence; ///< single bit, maintained local
- qboolean reliable_sequence; ///< single bit
+ qbool reliable_sequence; ///< single bit
unsigned int last_reliable_sequence; ///< sequence number of last send
}
qw;
// categorized sorting
int category;
/// favorite server flag
- qboolean isfavorite;
+ qbool isfavorite;
} serverlist_info_t;
typedef enum
typedef struct serverlist_mask_s
{
- qboolean active;
+ qbool active;
serverlist_maskop_t tests[SLIF_COUNT];
serverlist_info_t info;
} serverlist_mask_t;
extern serverlist_entry_t *serverlist_cache;
extern const serverlist_entry_t *serverlist_callbackentry;
-extern qboolean serverlist_consoleoutput;
+extern qbool serverlist_consoleoutput;
void ServerList_GetPlayerStatistics(int *numplayerspointer, int *maxplayerspointer);
#endif
extern cvar_t net_usesizelimit;
extern cvar_t net_burstreserve;
-qboolean NetConn_CanSend(netconn_t *conn);
-int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qboolean quakesignon_suppressreliables);
-qboolean NetConn_HaveClientPorts(void);
-qboolean NetConn_HaveServerPorts(void);
+qbool NetConn_CanSend(netconn_t *conn);
+int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qbool quakesignon_suppressreliables);
+qbool NetConn_HaveClientPorts(void);
+qbool NetConn_HaveServerPorts(void);
void NetConn_CloseClientPorts(void);
void NetConn_OpenClientPorts(void);
void NetConn_CloseServerPorts(void);
void NetConn_Shutdown(void);
netconn_t *NetConn_Open(lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress);
void NetConn_Close(netconn_t *conn);
-void NetConn_Listen(qboolean state);
+void NetConn_Listen(qbool state);
int NetConn_Read(lhnetsocket_t *mysocket, void *data, int maxlength, lhnetaddress_t *peeraddress);
int NetConn_Write(lhnetsocket_t *mysocket, const void *data, int length, const lhnetaddress_t *peeraddress);
int NetConn_WriteString(lhnetsocket_t *mysocket, const char *string, const lhnetaddress_t *peeraddress);
void Net_Stats_f(cmd_state_t *cmd);
#ifdef CONFIG_MENU
-void NetConn_QueryMasters(qboolean querydp, qboolean queryqw);
+void NetConn_QueryMasters(qbool querydp, qbool queryqw);
void NetConn_QueryQueueFrame(void);
void Net_Slist_f(cmd_state_t *cmd);
void Net_SlistQW_f(cmd_state_t *cmd);
/// manually refresh the view set, do this after having changed the mask or any other flag
void ServerList_RebuildViewList(void);
void ServerList_ResetMasks(void);
-void ServerList_QueryList(qboolean resetcache, qboolean querydp, qboolean queryqw, qboolean consoleoutput);
+void ServerList_QueryList(qbool resetcache, qbool querydp, qbool queryqw, qbool consoleoutput);
/// called whenever net_slist_favorites changes
void NetConn_UpdateFavorites_c(cvar_t *var);
msurface_t *surface = info->model->data_surfaces + surfaceindex;
if (BoxesOverlap(surface->mins, surface->maxs, info->boxmins, info->boxmaxs))
{
- qboolean insidebox = BoxInsideBox(surface->mins, surface->maxs, info->boxmins, info->boxmaxs);
- qboolean addedtris = false;
+ qbool insidebox = BoxInsideBox(surface->mins, surface->maxs, info->boxmins, info->boxmaxs);
+ qbool addedtris = false;
int t, tend;
const int *elements;
const float *vertex3f;
typedef struct edict_engineprivate_s
{
// true if this edict is unused
- qboolean free;
+ qbool free;
// sv.time when the object was freed (to prevent early reuse which could
// mess up client interpolation or obscure severe QuakeC bugs)
double freetime;
const char *allocation_origin;
// initially false to prevent projectiles from moving on their first frame
// (even if they were spawned by an synchronous client think)
- qboolean move;
+ qbool move;
// cached cluster links for quick stationary object visibility checking
vec3_t cullmins, cullmaxs;
int suspendedinairflag;
// cached position to avoid redundant SV_CheckWaterTransition calls on monsters
- qboolean waterposition_forceupdate; // force an update on this entity (set by SV_PushMove code for moving water entities)
+ qbool waterposition_forceupdate; // force an update on this entity (set by SV_PushMove code for moving water entities)
vec3_t waterposition_origin; // updates whenever this changes
// used by PushMove to keep track of where objects were before they were
skeleton_t skeleton;
// physics parameters
- qboolean ode_physics;
+ qbool ode_physics;
void *ode_body;
void *ode_geom;
void *ode_joint;
vec3_t ode_velocity;
vec3_t ode_angles;
vec3_t ode_avelocity;
- qboolean ode_gravity;
+ qbool ode_gravity;
int ode_modelindex;
vec_t ode_movelimit; // smallest component of (maxs[]-mins[])
matrix4x4_t ode_offsetmatrix;
// it belongs to prvm.
typedef struct prvm_edict_private_s
{
- qboolean free;
+ qbool free;
double freetime; // realtime of last change to "free" (i.e. also set on allocation)
int mark; // used during leaktest (0 = unref, >0 = referenced); special values during server physics:
#define PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN -1
// ... } server_edict_private_t;
// or:
// typedef struct server_edict_private_s {
- // qboolean free;
+ // qbool free;
// float freetime;
// vec3_t moved_from;
// vec3_t moved_fromangles;
// note that in FTEQW polygonbegin with 2 args is handled very differently,
// where the behavior is always 3D unless DRAWFLAG_2D is passed, but
// DRAWFLAG_2D conflicts with our DRAWFLAG_SCREEN.
- qboolean polygonbegin_guess2d;
+ qbool polygonbegin_guess2d;
// the texture name and drawflags provided to polygonbegin
char polygonbegin_texname[MAX_QPATH];
int polygonbegin_drawflags;
// allow writing to world entity fields, this is set by server init and
// cleared before first server frame
- qboolean allowworldwrites;
+ qbool allowworldwrites;
// name of the prog, e.g. "Server", "Client" or "Menu" (used for text output)
const char *name; // [INIT]
const char **extensionstring; // [INIT]
- qboolean loadintoworld; // [INIT]
+ qbool loadintoworld; // [INIT]
// used to indicate whether a prog is loaded
- qboolean loaded;
- qboolean leaktest_active;
+ qbool loaded;
+ qbool leaktest_active;
// translation buffer (only needs to be freed on unloading progs, type is private to prvm_edict.c)
void *po;
void (*count_edicts)(struct prvm_prog_s *prog); // [INIT] used by PRVM_ED_Count_f
- qboolean (*load_edict)(struct prvm_prog_s *prog, prvm_edict_t *ent); // [INIT] used by PRVM_ED_LoadFromFile
+ qbool (*load_edict)(struct prvm_prog_s *prog, prvm_edict_t *ent); // [INIT] used by PRVM_ED_LoadFromFile
void (*init_cmd)(struct prvm_prog_s *prog); // [INIT] used by PRVM_InitProg
void (*reset_cmd)(struct prvm_prog_s *prog); // [INIT] used by PRVM_ResetProg
void PRVM_MEM_IncreaseEdicts(prvm_prog_t *prog);
-qboolean PRVM_ED_CanAlloc(prvm_prog_t *prog, prvm_edict_t *e);
+qbool PRVM_ED_CanAlloc(prvm_prog_t *prog, prvm_edict_t *e);
prvm_edict_t *PRVM_ED_Alloc(prvm_prog_t *prog);
void PRVM_ED_Free(prvm_prog_t *prog, prvm_edict_t *ed);
void PRVM_ED_ClearEdict(prvm_prog_t *prog, prvm_edict_t *e);
void PRVM_ED_ParseGlobals(prvm_prog_t *prog, const char *data);
void PRVM_ED_CallPrespawnFunction(prvm_prog_t *prog, prvm_edict_t *ent);
-qboolean PRVM_ED_CallSpawnFunction(prvm_prog_t *prog, prvm_edict_t *ent, const char *data, const char *start);
+qbool PRVM_ED_CallSpawnFunction(prvm_prog_t *prog, prvm_edict_t *ent, const char *data, const char *start);
void PRVM_ED_CallPostspawnFunction (prvm_prog_t *prog, prvm_edict_t *ent);
void PRVM_ED_LoadFromFile(prvm_prog_t *prog, const char *data);
void PRVM_FreeString(prvm_prog_t *prog, int num);
mdef_t *PRVM_ED_FieldAtOfs(prvm_prog_t *prog, unsigned int ofs);
-qboolean PRVM_ED_ParseEpair(prvm_prog_t *prog, prvm_edict_t *ent, mdef_t *key, const char *s, qboolean parsebackslash);
+qbool PRVM_ED_ParseEpair(prvm_prog_t *prog, prvm_edict_t *ent, mdef_t *key, const char *s, qbool parsebackslash);
char *PRVM_UglyValueString(prvm_prog_t *prog, etype_t type, prvm_eval_t *val, char *line, size_t linelength);
char *PRVM_GlobalString(prvm_prog_t *prog, int ofs, char *line, size_t linelength);
char *PRVM_GlobalStringNoContents(prvm_prog_t *prog, int ofs, char *line, size_t linelength);
void Protocol_WriteStatsReliable(void);
// writes a list of quake entities to the network stream
// (or as many will fit)
-qboolean EntityFrameQuake_WriteFrame(sizebuf_t *msg, int maxsize, int numstates, const entity_state_t **states);
+qbool EntityFrameQuake_WriteFrame(sizebuf_t *msg, int maxsize, int numstates, const entity_state_t **states);
// cleans up dead entities each frame after ReadEntity (which doesn't clear unused entities)
void EntityFrameQuake_ISeeDeadEntities(void);
// (server) adds a entity_frame to the database, for future reference
void EntityFrame_AddFrame_Server(entityframe_database_t *d, vec3_t eye, int framenum, int numentities, const entity_state_t **entitydata);
// (server) writes a frame to network stream
-qboolean EntityFrame_WriteFrame(sizebuf_t *msg, int maxsize, entityframe_database_t *d, int numstates, const entity_state_t **states, int viewentnum);
+qbool EntityFrame_WriteFrame(sizebuf_t *msg, int maxsize, entityframe_database_t *d, int numstates, const entity_state_t **states, int viewentnum);
// (client) reads a frame from network stream
void EntityFrame_CL_ReadFrame(void);
// (client) returns the frame number of the most recent frame recieved
// updates database to account for a frame-received acknowledgment
int EntityFrame4_AckFrame(entityframe4_database_t *d, int framenum, int servermode);
// writes a frame to the network stream
-qboolean EntityFrame4_WriteFrame(sizebuf_t *msg, int maxsize, entityframe4_database_t *d, int numstates, const entity_state_t **states);
+qbool EntityFrame4_WriteFrame(sizebuf_t *msg, int maxsize, entityframe4_database_t *d, int numstates, const entity_state_t **states);
// reads a frame from the network stream
void EntityFrame4_CL_ReadFrame(void);
void EntityFrame5_CL_ReadFrame(void);
void EntityFrame5_LostFrame(entityframe5_database_t *d, int framenum);
void EntityFrame5_AckFrame(entityframe5_database_t *d, int framenum);
-qboolean EntityFrame5_WriteFrame(sizebuf_t *msg, int maxsize, entityframe5_database_t *d, int numstates, const entity_state_t **states, int viewentnum, unsigned int movesequence, qboolean need_empty);
+qbool EntityFrame5_WriteFrame(sizebuf_t *msg, int maxsize, entityframe5_database_t *d, int numstates, const entity_state_t **states, int viewentnum, unsigned int movesequence, qbool need_empty);
extern cvar_t developer_networkentities;
typedef struct entityframeqw_snapshot_s
{
double time;
- qboolean invalid;
+ qbool invalid;
int num_entities;
entity_state_t entities[QW_MAX_PACKET_ENTITIES];
}
entityframeqw_database_t *EntityFrameQW_AllocDatabase(mempool_t *pool);
void EntityFrameQW_FreeDatabase(entityframeqw_database_t *d);
void EntityStateQW_ReadPlayerUpdate(void);
-void EntityFrameQW_CL_ReadFrame(qboolean delta);
+void EntityFrameQW_CL_ReadFrame(qbool delta);
struct client_s;
void EntityFrameCSQC_LostFrame(struct client_s *client, int framenum);
-qboolean EntityFrameCSQC_WriteFrame (sizebuf_t *msg, int maxsize, int numnumbers, const unsigned short *numbers, int framenum);
+qbool EntityFrameCSQC_WriteFrame (sizebuf_t *msg, int maxsize, int numnumbers, const unsigned short *numbers, int framenum);
#endif
*/
// kind of helper function
-static qboolean checkextension(prvm_prog_t *prog, const char *name)
+static qbool checkextension(prvm_prog_t *prog, const char *name)
{
const char **e;
Cbuf_AddText(&cmd_server, string);
}
-static qboolean PRVM_Cvar_ReadOk(prvm_prog_t *prog, const char *string)
+static qbool PRVM_Cvar_ReadOk(prvm_prog_t *prog, const char *string)
{
cvar_t *cvar;
cvar = Cvar_FindVar(prog->console_cmd->cvars, string, prog->console_cmd->cvars_flagsmask);
}
// todo: support UTF8
-static qboolean match_rule(const char *string, int max_string, const char *pattern, int patternlength, int rule)
+static qbool match_rule(const char *string, int max_string, const char *pattern, int patternlength, int rule)
{
const char *mid;
const char *partial, *antipartial;
size_t len, antilen;
size_t alloclen;
- qboolean ispattern, antiispattern;
+ qbool ispattern, antiispattern;
int n;
prvm_stringbuffer_t *stringbuffer;
VM_SAFEPARMCOUNTRANGE(2, 3, VM_buf_cvarlist);
{
const char *url;
float id;
- qboolean ret;
+ qbool ret;
uri_to_prog_t *handle;
const char *posttype = NULL;
const char *postseparator = NULL;
{
skeleton_t *skeleton;
int skeletonindex = -1;
- qboolean need = false;
+ qbool need = false;
struct animatemodel_cache *animatemodel_cache;
if (!prog->animatemodel_cache)
{
cvar_t prvm_stringdebug = {CVAR_CLIENT | CVAR_SERVER, "prvm_stringdebug", "0", "Print debug and warning messages related to strings"};
static double prvm_reuseedicts_always_allow = 0;
-qboolean prvm_runawaycheck = true;
+qbool prvm_runawaycheck = true;
//============================================================================
// mempool handling
Returns if this particular edict could get allocated by PRVM_ED_Alloc
=================
*/
-qboolean PRVM_ED_CanAlloc(prvm_prog_t *prog, prvm_edict_t *e)
+qbool PRVM_ED_CanAlloc(prvm_prog_t *prog, prvm_edict_t *e)
{
if(!e->priv.required->free)
return false;
returns false if error
=============
*/
-qboolean PRVM_ED_ParseEpair(prvm_prog_t *prog, prvm_edict_t *ent, mdef_t *key, const char *s, qboolean parsebackslash)
+qbool PRVM_ED_ParseEpair(prvm_prog_t *prog, prvm_edict_t *ent, mdef_t *key, const char *s, qbool parsebackslash)
{
int i, l;
char *new_p;
const char *PRVM_ED_ParseEdict (prvm_prog_t *prog, const char *data, prvm_edict_t *ent)
{
mdef_t *key;
- qboolean anglehack;
- qboolean init;
+ qbool anglehack;
+ qbool init;
char keyname[256];
size_t n;
}
}
-qboolean PRVM_ED_CallSpawnFunction(prvm_prog_t *prog, prvm_edict_t *ent, const char *data, const char *start)
+qbool PRVM_ED_CallSpawnFunction(prvm_prog_t *prog, prvm_edict_t *ent, const char *data, const char *start)
{
const char *funcname;
mfunction_t *func;
// in CSQC we really shouldn't be able to change how stuff works... sorry for now
// later idea: include a list of authorized .po file checksums with the csprogs
{
- qboolean deftrans = prog == CLVM_prog;
+ qbool deftrans = prog == CLVM_prog;
const char *realfilename = (prog != CLVM_prog ? filename : csqc_progname.string);
if(deftrans) // once we have dotranslate_ strings, ALWAYS use the opt-in method!
{
prog->error_cmd("PRVM_FreeString: invalid string offset %i", num);
}
-static qboolean PRVM_IsStringReferenced(prvm_prog_t *prog, string_t string)
+static qbool PRVM_IsStringReferenced(prvm_prog_t *prog, string_t string)
{
int i, j;
return false;
}
-static qboolean PRVM_IsEdictRelevant(prvm_prog_t *prog, prvm_edict_t *edict)
+static qbool PRVM_IsEdictRelevant(prvm_prog_t *prog, prvm_edict_t *edict)
{
char vabuf[1024];
char vabuf2[1024];
return false;
}
-static qboolean PRVM_IsEdictReferenced(prvm_prog_t *prog, prvm_edict_t *edict, int mark)
+static qbool PRVM_IsEdictReferenced(prvm_prog_t *prog, prvm_edict_t *edict, int mark)
{
int i, j;
int edictnum = PRVM_NUM_FOR_EDICT(edict);
static void PRVM_MarkReferencedEdicts(prvm_prog_t *prog)
{
int i, j;
- qboolean found_new;
+ qbool found_new;
int stage;
// Stage 1: world, all entities that are relevant, and all entities that are referenced by globals.
void PRVM_LeakTest(prvm_prog_t *prog)
{
int i, j;
- qboolean leaked = false;
+ qbool leaked = false;
if(!prog->leaktest_active)
return;
#define OPC ((prvm_eval_t *)&globals[st->operand[2]])
extern cvar_t prvm_traceqc;
extern cvar_t prvm_statementprofiling;
-extern qboolean prvm_runawaycheck;
+extern qbool prvm_runawaycheck;
#ifdef PROFILING
#ifdef CONFIG_MENU
unsigned int cached_max_edicts = prog->max_edicts;
// these do not change
mstatement_t *cached_statements = prog->statements;
- qboolean cached_allowworldwrites = prog->allowworldwrites;
+ qbool cached_allowworldwrites = prog->allowworldwrites;
unsigned int cached_flag = prog->flag;
prvm_vec_t *globals = prog->globals.fp;
unsigned int cached_max_edicts = prog->max_edicts;
// these do not change
mstatement_t *cached_statements = prog->statements;
- qboolean cached_allowworldwrites = prog->allowworldwrites;
+ qbool cached_allowworldwrites = prog->allowworldwrites;
unsigned int cached_flag = prog->flag;
prvm_vec_t *globals = prog->globals.fp;
unsigned int cached_max_edicts = prog->max_edicts;
// these do not change
mstatement_t *cached_statements = prog->statements;
- qboolean cached_allowworldwrites = prog->allowworldwrites;
+ qbool cached_allowworldwrites = prog->allowworldwrites;
unsigned int cached_flag = prog->flag;
prvm_vec_t *globals = prog->globals.fp;
#include <stdbool.h>
#include <inttypes.h>
-typedef bool qboolean;
+typedef bool qbool;
#ifndef NULL
#define NULL ((void *)0)
#endif
#include "csprogs.h"
-extern qboolean noclip_anglehack;
+extern qbool noclip_anglehack;
extern cvar_t developer;
extern cvar_t developer_entityparsing;
#ifdef SSE_POSSIBLE
// runtime detection of SSE/SSE2 capabilities for x86
-qboolean Sys_HaveSSE(void);
-qboolean Sys_HaveSSE2(void);
+qbool Sys_HaveSSE(void);
+qbool Sys_HaveSSE2(void);
#else
#define Sys_HaveSSE() false
#define Sys_HaveSSE2() false
double realtime; // the accumulated mainloop time since application started (with filtering), without any slowmo or clamping
double dirtytime; // the main loop wall time for this frame, equal to Sys_DirtyTime() at the start of this host frame
double sleeptime; // time spent sleeping overall
- qboolean restless; // don't sleep
- qboolean paused; // global paused state, pauses both client and server
+ qbool restless; // don't sleep
+ qbool paused; // global paused state, pauses both client and server
cbuf_t *cbuf;
struct
vec3_t origin;
vec3_t vert[EXPLOSIONVERTS];
vec3_t vertvel[EXPLOSIONVERTS];
- qboolean clipping;
+ qbool clipping;
}
explosion_t;
#ifdef MAX_EXPLOSIONS
static cvar_t r_drawexplosions = {CVAR_CLIENT, "r_drawexplosions", "1", "enables rendering of explosion shells (see also cl_particles_explosions_shell)"};
-//extern qboolean r_loadfog;
+//extern qbool r_loadfog;
static void r_explosion_start(void)
{
int x, y;
int r_shadow_scenemaxlights;
int r_shadow_scenenumlights;
rtlight_t **r_shadow_scenelightlist; // includes both static lights and dlights, as filtered by appropriate flags
-qboolean r_shadow_usingshadowmap2d;
-qboolean r_shadow_usingshadowmaportho;
+qbool r_shadow_usingshadowmap2d;
+qbool r_shadow_usingshadowmaportho;
int r_shadow_shadowmapside;
float r_shadow_lightshadowmap_texturescale[4]; // xy = scale, zw = offset
float r_shadow_lightshadowmap_parameters[4]; // x = frustum width in pixels (excludes border), y = z scale, z = size of viewport, w = z center
int r_shadow_shadowmapdepthbits;
int r_shadow_shadowmapmaxsize;
int r_shadow_shadowmaptexturesize;
-qboolean r_shadow_shadowmapvsdct;
-qboolean r_shadow_shadowmapsampler;
-qboolean r_shadow_shadowmapshadowsampler;
+qbool r_shadow_shadowmapvsdct;
+qbool r_shadow_shadowmapsampler;
+qbool r_shadow_shadowmapshadowsampler;
int r_shadow_shadowmappcf;
int r_shadow_shadowmapborder;
matrix4x4_t r_shadow_shadowmapmatrix;
int r_shadow_lightscissor[4];
-qboolean r_shadow_usingdeferredprepass;
-qboolean r_shadow_shadowmapdepthtexture;
+qbool r_shadow_usingdeferredprepass;
+qbool r_shadow_shadowmapdepthtexture;
mod_alloclightmap_state_t r_shadow_shadowmapatlas_state;
int r_shadow_shadowmapatlas_modelshadows_x;
int r_shadow_shadowmapatlas_modelshadows_y;
dlight_t *r_shadow_selectedlight;
dlight_t r_shadow_bufferlight;
vec3_t r_editlights_cursorlocation;
-qboolean r_editlights_lockcursor;
+qbool r_editlights_lockcursor;
extern int con_vislines;
R_GLSL_Restart_f(&cmd_client);
}
-qboolean R_Shadow_ShadowMappingEnabled(void)
+qbool R_Shadow_ShadowMappingEnabled(void)
{
switch (r_shadow_shadowmode)
{
GL_Clear(GL_DEPTH_BUFFER_BIT, clearcolor, 1.0f, 0);
}
-static void R_Shadow_SetShadowmapParametersForLight(qboolean noselfshadowpass)
+static void R_Shadow_SetShadowmapParametersForLight(qbool noselfshadowpass)
{
int size = rsurface.rtlight->shadowmapatlassidesize;
float nearclip = r_shadow_shadowmapping_nearclip.value / rsurface.rtlight->radius;
r_shadow_shadowmapside = side;
}
-void R_Shadow_RenderMode_Lighting(qboolean transparent, qboolean shadowmapping, qboolean noselfshadowpass)
+void R_Shadow_RenderMode_Lighting(qbool transparent, qbool shadowmapping, qbool noselfshadowpass)
{
R_Mesh_ResetTextureState();
if (transparent)
{ 1, 1, 1},
};
-void R_Shadow_RenderMode_DrawDeferredLight(qboolean shadowmapping)
+void R_Shadow_RenderMode_DrawDeferredLight(qbool shadowmapping)
{
int i;
float vertex3f[8*3];
R_Mesh_Draw(0, 8, 0, 12, NULL, NULL, 0, bboxelements, NULL, 0);
}
-static qboolean R_Shadow_BounceGrid_CheckEnable(int flag)
+static qbool R_Shadow_BounceGrid_CheckEnable(int flag)
{
- qboolean enable = r_shadow_bouncegrid_state.capable && r_shadow_bouncegrid.integer != 0 && r_refdef.scene.worldmodel;
+ qbool enable = r_shadow_bouncegrid_state.capable && r_shadow_bouncegrid.integer != 0 && r_refdef.scene.worldmodel;
int lightindex;
int range;
dlight_t *light;
static void R_Shadow_BounceGrid_GenerateSettings(r_shadow_bouncegrid_settings_t *settings)
{
- qboolean s = r_shadow_bouncegrid_static.integer != 0;
+ qbool s = r_shadow_bouncegrid_static.integer != 0;
float spacing = bound(1.0f, s ? r_shadow_bouncegrid_static_spacing.value : r_shadow_bouncegrid_dynamic_spacing.value, 1024.0f);
float quality = bound(0.0001f, (s ? r_shadow_bouncegrid_static_quality.value : r_shadow_bouncegrid_dynamic_quality.value), 1024.0f);
float bounceminimumintensity = s ? r_shadow_bouncegrid_static_bounceminimumintensity.value : r_shadow_bouncegrid_dynamic_bounceminimumintensity.value;
{
int lightindex;
int range;
- qboolean bounds_set = false;
+ qbool bounds_set = false;
dlight_t *light;
rtlight_t *rtlight;
VectorCopy(cliptrace.endpos, shothit);
if ((remainingbounces == r_shadow_bouncegrid_state.settings.maxbounce || r_shadow_bouncegrid_state.settings.includedirectlighting) && p->numpaths < PHOTON_MAX_PATHS)
{
- qboolean notculled = true;
+ qbool notculled = true;
// cull paths that fail R_CullBox in dynamic mode
if (!r_shadow_bouncegrid_state.settings.staticmode
&& r_shadow_bouncegrid_dynamic_culllightpaths.integer)
{
int flag = r_refdef.scene.rtworld ? LIGHTFLAG_REALTIMEMODE : LIGHTFLAG_NORMALMODE;
r_shadow_bouncegrid_settings_t settings;
- qboolean enable = false;
- qboolean settingschanged;
+ qbool enable = false;
+ qbool settingschanged;
enable = R_Shadow_BounceGrid_CheckEnable(flag);
}
}
-void R_Shadow_RenderMode_VisibleLighting(qboolean transparent)
+void R_Shadow_RenderMode_VisibleLighting(qbool transparent)
{
R_Shadow_RenderMode_Reset();
GL_BlendFunc(GL_ONE, GL_ONE);
{3, 7}, // XY, +Z
};
-qboolean R_Shadow_ScissorForBBox(const float *mins, const float *maxs)
+qbool R_Shadow_ScissorForBBox(const float *mins, const float *maxs)
{
if (!r_shadow_scissor.integer || r_shadow_usingdeferredprepass || r_trippy.integer)
{
extern cvar_t gl_lightmaps;
void R_Shadow_RenderLighting(int texturenumsurfaces, const msurface_t **texturesurfacelist)
{
- qboolean negated;
+ qbool negated;
float ambientcolor[3], diffusecolor[3], specularcolor[3];
VectorM(rsurface.rtlight->ambientscale + rsurface.texture->rtlightambient, rsurface.texture->render_rtlight_diffuse, ambientcolor);
VectorM(rsurface.rtlight->diffusescale * max(0, 1.0 - rsurface.texture->rtlightambient), rsurface.texture->render_rtlight_diffuse, diffusecolor);
static entity_render_t *lightentities_noselfshadow[MAX_EDICTS];
static entity_render_t *shadowentities[MAX_EDICTS];
static entity_render_t *shadowentities_noselfshadow[MAX_EDICTS];
- qboolean nolight;
- qboolean castshadows;
+ qbool nolight;
+ qbool castshadows;
rtlight->draw = false;
rtlight->cached_numlightentities = 0;
entity_render_t **lightentities;
entity_render_t **lightentities_noselfshadow;
int *surfacelist;
- qboolean castshadows;
+ qbool castshadows;
// check if we cached this light this frame (meaning it is worth drawing)
if (!rtlight->draw)
}
#define MAX_SCENELIGHTS 65536
-static qboolean R_Shadow_PrepareLights_AddSceneLight(rtlight_t *rtlight)
+static qbool R_Shadow_PrepareLights_AddSceneLight(rtlight_t *rtlight)
{
if (r_shadow_scenemaxlights <= r_shadow_scenenumlights)
{
Matrix4x4_Concat(&r_shadow_shadowmapmatrix, &texmatrix, &invmvpmatrix);
}
-static void R_BeginCoronaQuery(rtlight_t *rtlight, float scale, qboolean usequery)
+static void R_BeginCoronaQuery(rtlight_t *rtlight, float scale, qbool usequery)
{
float zdist;
vec3_t centerorigin;
if (VectorLength(color) > (1.0f / 256.0f))
{
float vertex3f[12];
- qboolean negated = (color[0] + color[1] + color[2] < 0);
+ qbool negated = (color[0] + color[1] + color[2] < 0);
if(negated)
{
VectorNegate(color, color);
void R_Shadow_DrawCoronas(void)
{
int i, flag;
- qboolean usequery = false;
+ qbool usequery = false;
size_t lightindex;
dlight_t *light;
rtlight_t *rtlight;
// used by shader for bouncegrid feature
typedef struct r_shadow_bouncegrid_settings_s
{
- qboolean staticmode;
- qboolean directionalshading;
- qboolean includedirectlighting;
- qboolean blur;
- qboolean normalizevectors;
+ qbool staticmode;
+ qbool directionalshading;
+ qbool includedirectlighting;
+ qbool blur;
+ qbool normalizevectors;
int floatcolors;
float dlightparticlemultiplier;
- qboolean hitmodels;
+ qbool hitmodels;
float lightradiusscale;
int maxbounce;
float lightpathsize;
typedef struct r_shadow_bouncegrid_state_s
{
r_shadow_bouncegrid_settings_t settings;
- qboolean capable;
- qboolean allowdirectionalshading;
- qboolean directional; // copied from settings.directionalshading after createtexture is decided
- qboolean createtexture; // set to true to recreate the texture rather than updating it - happens when size changes or directional changes
+ qbool capable;
+ qbool allowdirectionalshading;
+ qbool directional; // copied from settings.directionalshading after createtexture is decided
+ qbool createtexture; // set to true to recreate the texture rather than updating it - happens when size changes or directional changes
rtexture_t *texture;
matrix4x4_t matrix;
vec_t intensity;
extern r_shadow_bouncegrid_state_t r_shadow_bouncegrid_state;
void R_Shadow_Init(void);
-qboolean R_Shadow_ShadowMappingEnabled(void);
+qbool R_Shadow_ShadowMappingEnabled(void);
void R_Shadow_ShadowMapFromList(int numverts, int numtris, const float *vertex3f, const int *elements, int numsidetris, const int *sidetotals, const unsigned char *sides, const int *sidetris);
int R_Shadow_CalcTriangleSideMask(const vec3_t p1, const vec3_t p2, const vec3_t p3, float bias);
int R_Shadow_CalcSphereSideMask(const vec3_t p1, float radius, float bias);
void R_Shadow_RenderMode_Begin(void);
void R_Shadow_RenderMode_ActiveLight(const rtlight_t *rtlight);
void R_Shadow_RenderMode_Reset(void);
-void R_Shadow_RenderMode_Lighting(qboolean transparent, qboolean shadowmapping, qboolean noselfshadowpass);
-void R_Shadow_RenderMode_DrawDeferredLight(qboolean shadowmapping);
-void R_Shadow_RenderMode_VisibleLighting(qboolean transparent);
+void R_Shadow_RenderMode_Lighting(qbool transparent, qbool shadowmapping, qbool noselfshadowpass);
+void R_Shadow_RenderMode_DrawDeferredLight(qbool shadowmapping);
+void R_Shadow_RenderMode_VisibleLighting(qbool transparent);
void R_Shadow_RenderMode_End(void);
void R_Shadow_ClearStencil(void);
void R_Shadow_SetupEntityLight(const entity_render_t *ent);
-qboolean R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
+qbool R_Shadow_ScissorForBBox(const float *mins, const float *maxs);
// these never change, they are used to create attenuation matrices
extern matrix4x4_t matrix_attenuationxyz;
typedef struct suffixinfo_s
{
const char *suffix;
- qboolean flipx, flipy, flipdiagonal;
+ qbool flipx, flipy, flipdiagonal;
}
suffixinfo_t;
static const suffixinfo_t suffix[3][6] =
static void R_SkySphere(void)
{
double speedscale;
- static qboolean skysphereinitialized = false;
+ static qbool skysphereinitialized = false;
matrix4x4_t scroll1matrix, scroll2matrix;
if (!skysphereinitialized)
{
// Now that we've kicked center-hotspotted sprites, rotate using the appropriate matrix :)
// determine the angle of a sprite, we could only do that once though and
- // add a `qboolean initialized' to the mspriteframe_t struct... let's get the direction vector of it :)
+ // add a `qbool initialized' to the mspriteframe_t struct... let's get the direction vector of it :)
angle = atan(dir[1] / dir[0]) * 180.0f/M_PI;
// this is exposed (rather than private) for speed reasons only
int texnum; // GL texture slot number
int renderbuffernum; // GL renderbuffer slot number
- qboolean dirty; // indicates that R_RealGetTexture should be called
- qboolean glisdepthstencil; // indicates that FBO attachment has to be GL_DEPTH_STENCIL_ATTACHMENT
+ qbool dirty; // indicates that R_RealGetTexture should be called
+ qbool glisdepthstencil; // indicates that FBO attachment has to be GL_DEPTH_STENCIL_ATTACHMENT
int gltexturetypeenum; // used by R_Mesh_TexBind
}
rtexture_t;
rtexture_t *R_LoadTexture2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette);
rtexture_t *R_LoadTexture3D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, int depth, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette);
rtexture_t *R_LoadTextureCubeMap(rtexturepool_t *rtexturepool, const char *identifier, int width, const unsigned char *data, textype_t textype, int flags, int miplevel, const unsigned int *palette);
-rtexture_t *R_LoadTextureShadowMap2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, textype_t textype, qboolean filter);
+rtexture_t *R_LoadTextureShadowMap2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, textype_t textype, qbool filter);
rtexture_t *R_LoadTextureRenderBuffer(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, textype_t textype);
-rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, qboolean srgb, int flags, qboolean *hasalphaflag, float *avgcolor, int miplevel, qboolean optionaltexture);
+rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, qbool srgb, int flags, qbool *hasalphaflag, float *avgcolor, int miplevel, qbool optionaltexture);
// saves a texture to a DDS file
-int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipuncompressed, qboolean hasalpha);
+int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qbool skipuncompressed, qbool hasalpha);
// free a texture
void R_FreeTexture(rtexture_t *rt);
// returns the desired picmip level for given TEXF_ flags
int R_PicmipForFlags(int flags);
-void R_TextureStats_Print(qboolean printeach, qboolean printpool, qboolean printtotal);
+void R_TextureStats_Print(qbool printeach, qbool printpool, qbool printtotal);
#endif
extern cvar_t r_drawentities;
extern cvar_t r_draw2d;
-extern qboolean r_draw2d_force;
+extern qbool r_draw2d_force;
extern cvar_t r_drawviewmodel;
extern cvar_t r_drawworld;
extern cvar_t r_speeds;
void R_SkinFrame_Purge(void);
// set last to NULL to start from the beginning
skinframe_t *R_SkinFrame_FindNextByName( skinframe_t *last, const char *name );
-skinframe_t *R_SkinFrame_Find(const char *name, int textureflags, int comparewidth, int compareheight, int comparecrc, qboolean add);
-skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboolean complain, qboolean fallbacknotexture);
-skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const char *name, int textureflags, qboolean complain, qboolean fallbacknotexture);
-skinframe_t *R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, const unsigned char *skindata, int width, int height, int comparewidth, int compareheight, int comparecrc, qboolean sRGB);
+skinframe_t *R_SkinFrame_Find(const char *name, int textureflags, int comparewidth, int compareheight, int comparecrc, qbool add);
+skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qbool complain, qbool fallbacknotexture);
+skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const char *name, int textureflags, qbool complain, qbool fallbacknotexture);
+skinframe_t *R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, const unsigned char *skindata, int width, int height, int comparewidth, int compareheight, int comparecrc, qbool sRGB);
skinframe_t *R_SkinFrame_LoadInternalQuake(const char *name, int textureflags, int loadpantsandshirt, int loadglowtexture, const unsigned char *skindata, int width, int height);
skinframe_t *R_SkinFrame_LoadInternal8bit(const char *name, int textureflags, const unsigned char *skindata, int width, int height, const unsigned int *palette, const unsigned int *alphapalette);
skinframe_t *R_SkinFrame_LoadMissing(void);
skinframe_t *R_SkinFrame_LoadNoTexture(void);
-skinframe_t *R_SkinFrame_LoadInternalUsingTexture(const char *name, int textureflags, rtexture_t *tex, int width, int height, qboolean sRGB);
+skinframe_t *R_SkinFrame_LoadInternalUsingTexture(const char *name, int textureflags, rtexture_t *tex, int width, int height, qbool sRGB);
rtexture_t *R_GetCubemap(const char *basename);
-void R_View_WorldVisibility(qboolean forcenovis);
+void R_View_WorldVisibility(qbool forcenovis);
void R_DrawParticles(void);
void R_DrawExplosions(void);
int R_CullBox(const vec3_t mins, const vec3_t maxs);
int R_CullBoxCustomPlanes(const vec3_t mins, const vec3_t maxs, int numplanes, const mplane_t *planes);
-qboolean R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t entboxexpand, vec_t pad, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs);
+qbool R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t entboxexpand, vec_t pad, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs);
#include "r_modules.h"
/// clear the animcache pointers on all known render entities
void R_AnimCache_ClearCache(void);
/// get the skeletal data or cached animated mesh data for an entity (optionally with normals and tangents)
-qboolean R_AnimCache_GetEntity(entity_render_t *ent, qboolean wantnormals, qboolean wanttangents);
+qbool R_AnimCache_GetEntity(entity_render_t *ent, qbool wantnormals, qbool wanttangents);
/// generate animcache data for all entities marked visible
void R_AnimCache_CacheVisibleEntities(void);
//
// this indicates the model* arrays are pointed at array_model* buffers
// (in other words, the model has been animated in software)
- qboolean forcecurrenttextureupdate; // set for RSurf_ActiveCustomEntity to force R_GetCurrentTexture to recalculate the texture parameters (such as entity alpha)
- qboolean modelgeneratedvertex;
+ qbool forcecurrenttextureupdate; // set for RSurf_ActiveCustomEntity to force R_GetCurrentTexture to recalculate the texture parameters (such as entity alpha)
+ qbool modelgeneratedvertex;
// skeletal animation can be done by entity (animcache) or per batch,
// batch may be non-skeletal even if entity is skeletal, indicating that
// the dynamicvertex code path had to apply skeletal manually for a case
// these usually equal the model* pointers, they only differ if
// deformvertexes is used in a q3 shader, and consequently these can
// change on a per-surface basis (according to rsurface.texture)
- qboolean batchgeneratedvertex;
- qboolean batchmultidraw;
+ qbool batchgeneratedvertex;
+ qbool batchmultidraw;
int batchmultidrawnumsurfaces;
const msurface_t **batchmultidrawsurfacelist;
int batchfirstvertex;
rtexture_t *deluxemaptexture;
// whether lightmapping is active on this batch
// (otherwise vertex colored)
- qboolean uselightmaptexture;
+ qbool uselightmaptexture;
// fog plane in model space for direct application to vertices
float fograngerecip;
float fogmasktabledistmultiplier;
void R_HDR_UpdateIrisAdaptation(const vec3_t point);
-void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, qboolean wanttangents, qboolean prepass);
-void RSurf_ActiveCustomEntity(const matrix4x4_t *matrix, const matrix4x4_t *inversematrix, int entflags, double shadertime, float r, float g, float b, float a, int numvertices, const float *vertex3f, const float *texcoord2f, const float *normal3f, const float *svector3f, const float *tvector3f, const float *color4f, int numtriangles, const int *element3i, const unsigned short *element3s, qboolean wantnormals, qboolean wanttangents);
+void RSurf_ActiveModelEntity(const entity_render_t *ent, qbool wantnormals, qbool wanttangents, qbool prepass);
+void RSurf_ActiveCustomEntity(const matrix4x4_t *matrix, const matrix4x4_t *inversematrix, int entflags, double shadertime, float r, float g, float b, float a, int numvertices, const float *vertex3f, const float *texcoord2f, const float *normal3f, const float *svector3f, const float *tvector3f, const float *color4f, int numtriangles, const int *element3i, const unsigned short *element3s, qbool wantnormals, qbool wanttangents);
void RSurf_SetupDepthAndCulling(void);
extern int r_textureframe; ///< used only by R_GetCurrentTexture, incremented per view and per UI render
texture_t *R_GetCurrentTexture(texture_t *t);
-void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug, qboolean prepass, qboolean ui);
-void R_DrawCustomSurface(skinframe_t *skinframe, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qboolean writedepth, qboolean prepass, qboolean ui);
-void R_DrawCustomSurface_Texture(texture_t *texture, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qboolean writedepth, qboolean prepass, qboolean ui);
+void R_DrawModelSurfaces(entity_render_t *ent, qbool skysurfaces, qbool writedepth, qbool depthonly, qbool debug, qbool prepass, qbool ui);
+void R_DrawCustomSurface(skinframe_t *skinframe, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qbool writedepth, qbool prepass, qbool ui);
+void R_DrawCustomSurface_Texture(texture_t *texture, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qbool writedepth, qbool prepass, qbool ui);
#define BATCHNEED_ARRAY_VERTEX (1<< 0) // set up rsurface.batchvertex3f
#define BATCHNEED_ARRAY_NORMAL (1<< 1) // set up rsurface.batchnormal3f
}
rsurfacepass_t;
-void R_SetupShader_Generic(rtexture_t *t, qboolean usegamma, qboolean notrippy, qboolean suppresstexalpha);
-void R_SetupShader_Generic_NoTexture(qboolean usegamma, qboolean notrippy);
-void R_SetupShader_DepthOrShadow(qboolean notrippy, qboolean depthrgb, qboolean skeletal);
-void R_SetupShader_Surface(const float ambientcolor[3], const float diffusecolor[3], const float specularcolor[3], rsurfacepass_t rsurfacepass, int texturenumsurfaces, const msurface_t **texturesurfacelist, void *waterplane, qboolean notrippy);
+void R_SetupShader_Generic(rtexture_t *t, qbool usegamma, qbool notrippy, qbool suppresstexalpha);
+void R_SetupShader_Generic_NoTexture(qbool usegamma, qbool notrippy);
+void R_SetupShader_DepthOrShadow(qbool notrippy, qbool depthrgb, qbool skeletal);
+void R_SetupShader_Surface(const float ambientcolor[3], const float diffusecolor[3], const float specularcolor[3], rsurfacepass_t rsurfacepass, int texturenumsurfaces, const msurface_t **texturesurfacelist, void *waterplane, qbool notrippy);
void R_SetupShader_DeferredLight(const rtlight_t *rtlight);
typedef struct r_rendertarget_s {
// TEXTYPE for depth target - usually TEXTYPE_DEPTHBUFFER24 or TEXTYPE_SHADOWMAP24_COMP
textype_t depthtextype;
// if true the depth target will be a renderbuffer rather than a texture (still rtexture_t though)
- qboolean depthisrenderbuffer;
+ qbool depthisrenderbuffer;
// framebuffer object referencing the textures
int fbo;
// there can be up to 4 color targets and 1 depth target, the depthtexture
} r_rendertarget_t;
// called each frame after render to delete render targets that have not been used for a while
-void R_RenderTarget_FreeUnused(qboolean force);
+void R_RenderTarget_FreeUnused(qbool force);
// returns a rendertarget, creates rendertarget if needed or intelligently reuses targets across frames if they match and have not been used already this frame
-r_rendertarget_t *R_RenderTarget_Get(int texturewidth, int textureheight, textype_t depthtextype, qboolean depthisrenderbuffer, textype_t colortextype0, textype_t colortextype1, textype_t colortextype2, textype_t colortextype3);
+r_rendertarget_t *R_RenderTarget_Get(int texturewidth, int textureheight, textype_t depthtextype, qbool depthisrenderbuffer, textype_t colortextype0, textype_t colortextype1, textype_t colortextype2, textype_t colortextype3);
typedef struct r_waterstate_waterplane_s
{
mplane_t plane;
int materialflags; // combined flags of all water surfaces on this plane
unsigned char pvsbits[(MAX_MAP_LEAFS+7)>>3]; // FIXME: buffer overflow on huge maps
- qboolean pvsvalid;
+ qbool pvsvalid;
int camera_entity;
vec3_t mins, maxs;
}
float screenscale[2];
float screencenter[2];
- qboolean enabled;
+ qbool enabled;
- qboolean renderingscene; // true while rendering a refraction or reflection texture, disables water surfaces
- qboolean hideplayer;
+ qbool renderingscene; // true while rendering a refraction or reflection texture, disables water surfaces
+ qbool hideplayer;
}
r_waterstate_t;
r_waterstate_t water;
- qboolean ghosttexture_valid; // don't draw garbage on first frame with motionblur
- qboolean usedepthtextures; // use depth texture instead of depth renderbuffer (faster if you need to read it later anyway)
+ qbool ghosttexture_valid; // don't draw garbage on first frame with motionblur
+ qbool usedepthtextures; // use depth texture instead of depth renderbuffer (faster if you need to read it later anyway)
// rendertargets (fbo and viewport), these can be reused across frames
memexpandablearray_t rendertargets;
void R_ResetViewRendering2D_Common(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight, float x2, float y2); // this is called by R_ResetViewRendering2D and _DrawQ_Setup and internal
void R_ResetViewRendering2D(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight);
void R_ResetViewRendering3D(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight);
-void R_SetupView(qboolean allowwaterclippingplane, int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight);
+void R_SetupView(qbool allowwaterclippingplane, int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight);
void R_DebugLine(vec3_t start, vec3_t end);
extern const float r_screenvertex3f[12];
extern cvar_t r_showspriteedges;
extern cvar_t r_transparent_sortmindist;
extern cvar_t r_transparent_sortmaxdist;
-extern qboolean r_shadow_usingdeferredprepass;
+extern qbool r_shadow_usingdeferredprepass;
extern rtexture_t *r_shadow_attenuationgradienttexture;
extern rtexture_t *r_shadow_attenuation2dtexture;
extern rtexture_t *r_shadow_attenuation3dtexture;
-extern qboolean r_shadow_usingshadowmap2d;
-extern qboolean r_shadow_usingshadowmaportho;
+extern qbool r_shadow_usingshadowmap2d;
+extern qbool r_shadow_usingshadowmaportho;
extern float r_shadow_modelshadowmap_texturescale[4];
extern float r_shadow_modelshadowmap_parameters[4];
extern float r_shadow_lightshadowmap_texturescale[4];
extern float r_shadow_lightshadowmap_parameters[4];
-extern qboolean r_shadow_shadowmapvsdct;
+extern qbool r_shadow_shadowmapvsdct;
extern rtexture_t *r_shadow_shadowmap2ddepthbuffer;
extern rtexture_t *r_shadow_shadowmap2ddepthtexture;
extern rtexture_t *r_shadow_shadowmapvsdcttexture;
struct prvm_prog_s;
void R_UpdateFog(void);
-qboolean CL_VM_UpdateView(double frametime);
+qbool CL_VM_UpdateView(double frametime);
void SCR_DrawConsole(void);
void R_Shadow_EditLights_DrawSelectedLightProperties(void);
void R_DecalSystem_Reset(decalsystem_t *decalsystem);
void R_BuildLightMap(const entity_render_t *ent, msurface_t *surface);
void R_Water_AddWaterPlane(msurface_t *surface, int entno);
int R_Shadow_GetRTLightInfo(unsigned int lightindex, float *origin, float *radius, float *color);
-dp_font_t *FindFont(const char *title, qboolean allocate_new);
-void LoadFont(qboolean override, const char *name, dp_font_t *fnt, float scale, float voffset);
+dp_font_t *FindFont(const char *title, qbool allocate_new);
+void LoadFont(qbool override, const char *name, dp_font_t *fnt, float scale, float voffset);
void Render_Init(void);
void Mod_RenderInit(void);
void Font_Init(void);
-qboolean R_CompileShader_CheckStaticParms(void);
+qbool R_CompileShader_CheckStaticParms(void);
void R_GLSL_Restart_f(cmd_state_t *cmd);
#endif
cachepic_t *sb_face_invuln;
cachepic_t *sb_face_invis_invuln;
-qboolean sb_showscores;
+qbool sb_showscores;
int sb_lines; // scan lines to draw
char topspeedstring[48];
char texstring[MAX_QPATH];
char entstring[32];
- qboolean red = false;
+ qbool red = false;
soundstring[0] = 0;
fpsstring[0] = 0;
timedemostring1[0] = 0;
}
if (cl_showtopspeed.integer)
{
- qboolean topspeed_latched = false, topspeedxy_latched = false;
+ qbool topspeed_latched = false, topspeedxy_latched = false;
get_showspeed_unit(cl_showtopspeed.integer, &f, &unit);
if (speed >= topspeed || current_time - top_time > 3)
{
static float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y)
{
int minutes;
- qboolean myself = false;
+ qbool myself = false;
unsigned char *c;
char vabuf[1024];
minutes = (int)((cl.intermission ? cl.completed_time - s->qw_entertime : cl.time - s->qw_entertime) / 60.0);
void CL_UpdateScreen (void);
void SCR_CenterPrint(const char *str);
-void SCR_BeginLoadingPlaque (qboolean startup);
+void SCR_BeginLoadingPlaque (qbool startup);
void SCR_EndLoadingPlaque (void);
// invoke refresh of loading plaque (nothing else seen)
-void SCR_UpdateLoadingScreen(qboolean clear, qboolean startup);
+void SCR_UpdateLoadingScreen(qbool clear, qbool startup);
void SCR_UpdateLoadingScreenIfShown(void);
// pushes an item on the loading screen
void SCR_PushLoadingScreen (const char *msg, float len_in_parent);
-void SCR_PopLoadingScreen (qboolean redraw);
-void SCR_ClearLoadingScreen (qboolean redraw);
+void SCR_PopLoadingScreen (qbool redraw);
+void SCR_ClearLoadingScreen (qbool redraw);
extern float scr_con_current; // current height of displayed console
extern cvar_t r_stereo_separation;
extern cvar_t r_stereo_angle;
-qboolean R_Stereo_Active(void);
+qbool R_Stereo_Active(void);
extern int r_stereo_side;
typedef struct scr_touchscreenarea_s
/// episode completion information
int serverflags;
/// cleared when at SV_SpawnServer
- qboolean changelevel_issued;
+ qbool changelevel_issued;
/// server infostring
char serverinfo[MAX_SERVERINFO_STRING];
// performance data
unsigned char *csqc_progdata_deflated;
// independent server thread (when running client)
- qboolean threaded; // true if server is running on separate thread
- qboolean volatile threadstop;
+ qbool threaded; // true if server is running on separate thread
+ qbool volatile threadstop;
void *threadmutex;
void *thread;
} server_static_t;
typedef struct server_s
{
/// false if only a net client
- qboolean active;
+ qbool active;
- qboolean paused;
+ qbool paused;
double pausedstart;
/// handle connections specially
- qboolean loadgame;
+ qbool loadgame;
/// one of the PROTOCOL_ values
protocolversion_t protocol;
server_floodaddress_t connectfloodaddresses[MAX_CONNECTFLOODADDRESSES];
server_floodaddress_t getstatusfloodaddresses[MAX_GETSTATUSFLOODADDRESSES];
- qboolean particleeffectnamesloaded;
+ qbool particleeffectnamesloaded;
char particleeffectname[MAX_PARTICLEEFFECTNAME][MAX_QPATH];
int writeentitiestoclient_stats_culled_pvs;
typedef struct client_s
{
/// false = empty client slot
- qboolean active;
+ qbool active;
/// false = don't do ClientDisconnect on drop
- qboolean clientconnectcalled;
+ qbool clientconnectcalled;
/// false = don't allow spawn
- qboolean prespawned;
+ qbool prespawned;
/// false = don't allow begin
- qboolean spawned;
+ qbool spawned;
/// false = don't send datagrams
- qboolean begun;
+ qbool begun;
/// 1 = send svc_serverinfo and advance to 2, 2 doesn't send, then advances to 0 (allowing unlimited sending) when prespawn is received
int sendsignon;
// information on an active download if any
qfile_t *download_file;
int download_expectedposition; ///< next position the client should ack
- qboolean download_started;
+ qbool download_started;
char download_name[MAX_QPATH];
- qboolean download_deflate;
+ qbool download_deflate;
// fixangle data
- qboolean fixangle_angles_set;
+ qbool fixangle_angles_set;
vec3_t fixangle_angles;
/// demo recording
void SV_StartParticle (vec3_t org, vec3_t dir, int color, int count);
void SV_StartEffect (vec3_t org, int modelindex, int startframe, int framecount, int framerate);
-void SV_StartSound (prvm_edict_t *entity, int channel, const char *sample, int volume, float attenuation, qboolean reliable, float speed);
+void SV_StartSound (prvm_edict_t *entity, int channel, const char *sample, int volume, float attenuation, qbool reliable, float speed);
void SV_StartPointSound (vec3_t origin, const char *sample, int volume, float attenuation, float speed);
void SV_ConnectClient (int clientnum, netconn_t *netconnection);
-void SV_DropClient (qboolean crash);
+void SV_DropClient (qbool crash);
void SV_SendClientMessages(void);
void SV_Physics_ClientMove (void);
//void SV_Physics_ClientEntity (prvm_edict_t *ent);
-qboolean SV_PlayerCheckGround (prvm_edict_t *ent);
-qboolean SV_CheckBottom (prvm_edict_t *ent);
-qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace);
+qbool SV_PlayerCheckGround (prvm_edict_t *ent);
+qbool SV_CheckBottom (prvm_edict_t *ent);
+qbool SV_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool noenemy, qbool settrace);
/*! Needs to be called any time an entity changes origin, mins, maxs, or solid
* sets ent->v.absmin and ent->v.absmax
/*! move an entity that is stuck by small amounts in various directions to try to nudge it back into the collision hull
* returns true if it found a better place
*/
-qboolean SV_UnstickEntity (prvm_edict_t *ent);
+qbool SV_UnstickEntity (prvm_edict_t *ent);
/*! move an entity that is stuck out of the surface it is stuck in (can move large amounts)
* returns true if it found a better place
*/
-qboolean SV_NudgeOutOfSolid(prvm_edict_t *ent);
+qbool SV_NudgeOutOfSolid(prvm_edict_t *ent);
/// calculates hitsupercontentsmask for a generic qc entity
int SV_GenericHitSuperContentsMask(const prvm_edict_t *edict);
trace_t SV_TracePoint(const vec3_t start, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
int SV_EntitiesInBox(const vec3_t mins, const vec3_t maxs, int maxedicts, prvm_edict_t **resultedicts);
-qboolean SV_CanSeeBox(int numsamples, vec_t eyejitter, vec_t enlarge, vec_t entboxexpand, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs);
+qbool SV_CanSeeBox(int numsamples, vec_t eyejitter, vec_t enlarge, vec_t entboxexpand, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs);
int SV_PointSuperContents(const vec3_t point);
const char *Host_TimingReport(char *buf, size_t buflen); ///< for output in SV_Status_f
int SV_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent);
-void SV_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatrix);
+void SV_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qbool viewmatrix);
void SV_StartThread(void);
void SV_StopThread(void);
static unsigned int oldpaintedtime = 0;
static unsigned int extrasoundtime = 0;
static double snd_starttime = 0.0;
-qboolean snd_threaded = false;
-qboolean snd_usethreadedmixing = false;
+qbool snd_threaded = false;
+qbool snd_usethreadedmixing = false;
vec3_t listener_origin;
matrix4x4_t listener_basematrix;
// Linked list of known sfx
static sfx_t *known_sfx = NULL;
-static qboolean sound_spatialized = false;
+static qbool sound_spatialized = false;
-qboolean simsound = false;
+qbool simsound = false;
#ifdef CONFIG_VIDEO_CAPTURE
-static qboolean recording_sound = false;
+static qbool recording_sound = false;
#endif
int snd_blocked = 0;
// Functions
// ====================================================================
-void S_FreeSfx (sfx_t *sfx, qboolean force);
+void S_FreeSfx (sfx_t *sfx, qbool force);
static void S_Play_Common (cmd_state_t *cmd, float fvol, float attenuation)
{
S_FreeSfx
==================
*/
-void S_FreeSfx (sfx_t *sfx, qboolean force)
+void S_FreeSfx (sfx_t *sfx, qbool force)
{
unsigned int i;
S_PrecacheSound
==================
*/
-sfx_t *S_PrecacheSound (const char *name, qboolean complain, qboolean levelsound)
+sfx_t *S_PrecacheSound (const char *name, qbool complain, qbool levelsound)
{
sfx_t *sfx;
S_IsSoundPrecached
==================
*/
-qboolean S_IsSoundPrecached (const sfx_t *sfx)
+qbool S_IsSoundPrecached (const sfx_t *sfx)
{
return (sfx != NULL && sfx->fetcher != NULL) || (sfx == &changevolume_sfx);
}
=================
*/
extern cvar_t cl_gameplayfix_soundsmovewithentities;
-static void SND_Spatialize_WithSfx(channel_t *ch, qboolean isstatic, sfx_t *sfx)
+static void SND_Spatialize_WithSfx(channel_t *ch, qbool isstatic, sfx_t *sfx)
{
int i;
double f;
intensity = mastervol * f;
if (intensity > 0)
{
- qboolean occluded = false;
+ qbool occluded = false;
if (snd_spatialization_occlusion.integer)
{
if(snd_spatialization_occlusion.integer & 1)
ch->volume[i] = 0;
}
}
-static void SND_Spatialize(channel_t *ch, qboolean isstatic)
+static void SND_Spatialize(channel_t *ch, qbool isstatic)
{
sfx_t *sfx = ch->sfx;
SND_Spatialize_WithSfx(ch, isstatic, sfx);
// Start a sound effect
// =======================================================================
-static void S_PlaySfxOnChannel (sfx_t *sfx, channel_t *target_chan, unsigned int flags, vec3_t origin, float fvol, float attenuation, qboolean isstatic, int entnum, int entchannel, int startpos, float fspeed)
+static void S_PlaySfxOnChannel (sfx_t *sfx, channel_t *target_chan, unsigned int flags, vec3_t origin, float fvol, float attenuation, qbool isstatic, int entnum, int entchannel, int startpos, float fspeed)
{
if (!sfx)
{
return S_StartSound_StartPosition_Flags(entnum, entchannel, sfx, origin, fvol, attenuation, 0, CHANNELFLAG_NONE, 1.0f);
}
-void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean freesfx)
+void S_StopChannel (unsigned int channel_ind, qbool lockmutex, qbool freesfx)
{
channel_t *ch;
sfx_t *sfx;
}
-qboolean S_SetChannelFlag (unsigned int ch_ind, unsigned int flag, qboolean value)
+qbool S_SetChannelFlag (unsigned int ch_ind, unsigned int flag, qbool value)
{
if (ch_ind >= total_channels)
return false;
}
-void S_PauseGameSounds (qboolean toggle)
+void S_PauseGameSounds (qbool toggle)
{
unsigned int i;
S_PaintAndSubmit();
}
-qboolean S_LocalSound (const char *sound)
+qbool S_LocalSound (const char *sound)
{
sfx_t *sfx;
int ch_ind;
extern channel_t channels[MAX_CHANNELS];
extern snd_ringbuffer_t *snd_renderbuffer;
-extern qboolean snd_threaded; // enables use of snd_usethreadedmixing, provided that no sound hacks are in effect (like timedemo)
-extern qboolean snd_usethreadedmixing; // if true, the main thread does not mix sound, soundtime does not advance, and neither does snd_renderbuffer->endframe, instead the audio thread will call S_MixToBuffer as needed
+extern qbool snd_threaded; // enables use of snd_usethreadedmixing, provided that no sound hacks are in effect (like timedemo)
+extern qbool snd_usethreadedmixing; // if true, the main thread does not mix sound, soundtime does not advance, and neither does snd_renderbuffer->endframe, instead the audio thread will call S_MixToBuffer as needed
extern cvar_t _snd_mixahead;
extern cvar_t snd_swapstereo;
// If simsound is true, the sound card is not initialized and no sound is submitted to it.
// More generally, all arch-dependent operations are skipped or emulated.
// Used for isolating performance in the renderer.
-extern qboolean simsound;
+extern qbool simsound;
#define STREAM_BUFFERSIZE 16384 // in sampleframes
void S_MixToBuffer(void *stream, unsigned int frames);
-qboolean S_LoadSound (sfx_t *sfx, qboolean complain);
+qbool S_LoadSound (sfx_t *sfx, qbool complain);
// If "buffer" is NULL, the function allocates one buffer of "sampleframes" sample frames itself
// (if "sampleframes" is 0, the function chooses the size).
// Create "snd_renderbuffer", attempting to use the chosen sound format, but accepting if the driver wants to change it (e.g. 7.1 to stereo or lowering the speed)
// Note: SDL automatically converts all formats, so this only fails if there is no audio
-qboolean SndSys_Init (snd_format_t* fmt);
+qbool SndSys_Init (snd_format_t* fmt);
// Stop the sound card, delete "snd_renderbuffer" and free its other resources
void SndSys_Shutdown (void);
unsigned int SndSys_GetSoundTime (void);
// Get the exclusive lock on "snd_renderbuffer"
-qboolean SndSys_LockRenderBuffer (void);
+qbool SndSys_LockRenderBuffer (void);
// Release the exclusive lock on "snd_renderbuffer"
void SndSys_UnlockRenderBuffer (void);
S_LoadSound
==============
*/
-qboolean S_LoadSound (sfx_t *sfx, qboolean complain)
+qbool S_LoadSound (sfx_t *sfx, qbool complain)
{
char namebuffer[MAX_QPATH + 16];
size_t len;
double posd;
double speedd;
float maxvol;
- qboolean looping;
- qboolean silent;
+ qbool looping;
+ qbool silent;
// mix as many times as needed to fill the requested buffer
while (bufferframes)
return -1;
}
-void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean freesfx)
+void S_StopChannel (unsigned int channel_ind, qbool lockmutex, qbool freesfx)
{
}
-qboolean S_SetChannelFlag (unsigned int ch_ind, unsigned int flag, qboolean value)
+qbool S_SetChannelFlag (unsigned int ch_ind, unsigned int flag, qbool value)
{
return false;
}
{
}
-void S_PauseGameSounds (qboolean toggle)
+void S_PauseGameSounds (qbool toggle)
{
}
{
}
-sfx_t *S_PrecacheSound (const char *sample, qboolean complain, qboolean levelsound)
+sfx_t *S_PrecacheSound (const char *sample, qbool complain, qbool levelsound)
{
return NULL;
}
return -1;
}
-qboolean S_IsSoundPrecached (const sfx_t *sfx)
+qbool S_IsSoundPrecached (const sfx_t *sfx)
{
return false;
}
{
}
-qboolean S_LocalSound (const char *s)
+qbool S_LocalSound (const char *s)
{
return false;
}
#define qov_read ov_read
#define qvorbis_comment_query vorbis_comment_query
-qboolean OGG_OpenLibrary (void) {return true;}
+qbool OGG_OpenLibrary (void) {return true;}
void OGG_CloseLibrary (void) {}
#else
Try to load the VorbisFile DLL
====================
*/
-qboolean OGG_OpenLibrary (void)
+qbool OGG_OpenLibrary (void)
{
const char* dllnames_vo [] =
{
Load an Ogg Vorbis file into memory
====================
*/
-qboolean OGG_LoadVorbisFile(const char *filename, sfx_t *sfx)
+qbool OGG_LoadVorbisFile(const char *filename, sfx_t *sfx)
{
unsigned char *data;
fs_offset_t filesize;
#define SND_OGG_H
-qboolean OGG_OpenLibrary (void);
+qbool OGG_OpenLibrary (void);
void OGG_CloseLibrary (void);
-qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *sfx);
+qbool OGG_LoadVorbisFile (const char *filename, sfx_t *sfx);
#endif
May return a suggested format if the requested format isn't available
====================
*/
-qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
+qbool SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
{
int flags, ioctl_param, prev_value;
unsigned int fragmentsize;
Get the exclusive lock on "snd_renderbuffer"
====================
*/
-qboolean SndSys_LockRenderBuffer (void)
+qbool SndSys_LockRenderBuffer (void)
{
// Nothing to do
return true;
May return a suggested format if the requested format isn't available
====================
*/
-qboolean SndSys_Init (snd_format_t* fmt)
+qbool SndSys_Init (snd_format_t* fmt)
{
unsigned int buffersize;
SDL_AudioSpec wantspec;
Get the exclusive lock on "snd_renderbuffer"
====================
*/
-qboolean SndSys_LockRenderBuffer (void)
+qbool SndSys_LockRenderBuffer (void)
{
SDL_LockAudioDevice(audio_device);
return true;
S_LoadWavFile
==============
*/
-qboolean S_LoadWavFile (const char *filename, sfx_t *sfx)
+qbool S_LoadWavFile (const char *filename, sfx_t *sfx)
{
fs_offset_t filesize;
unsigned char *data;
extern const snd_fetcher_t wav_fetcher;
-qboolean S_LoadWavFile (const char *filename, sfx_t *sfx);
+qbool S_LoadWavFile (const char *filename, sfx_t *sfx);
#endif
#define xmp_dll 1
-qboolean XMP_OpenLibrary (void) {return true;}
+qbool XMP_OpenLibrary (void) {return true;}
void XMP_CloseLibrary (void) {}
#else
Try to load the libxmp DLL
====================
*/
-qboolean XMP_OpenLibrary (void)
+qbool XMP_OpenLibrary (void)
{
const char* dllnames_xmp [] =
{
Load an XMP module file into memory
===============
*/
-qboolean XMP_LoadModFile(const char *filename, sfx_t *sfx)
+qbool XMP_LoadModFile(const char *filename, sfx_t *sfx)
{
fs_offset_t filesize;
unsigned char *data;
#define SND_XMP_H
-qboolean XMP_OpenLibrary (void);
+qbool XMP_OpenLibrary (void);
void XMP_CloseLibrary (void);
-qboolean XMP_LoadModFile (const char *filename, sfx_t *sfx);
+qbool XMP_LoadModFile (const char *filename, sfx_t *sfx);
#endif
void S_Update(const matrix4x4_t *listenermatrix);
void S_ExtraUpdate (void);
-sfx_t *S_PrecacheSound (const char *sample, qboolean complain, qboolean levelsound);
+sfx_t *S_PrecacheSound (const char *sample, qbool complain, qbool levelsound);
float S_SoundLength(const char *name);
void S_ClearUsed (void);
void S_PurgeUnused (void);
-qboolean S_IsSoundPrecached (const sfx_t *sfx);
+qbool S_IsSoundPrecached (const sfx_t *sfx);
sfx_t *S_FindName(const char *name);
// these define the "engine" channel namespace
// S_StartSound returns the channel index, or -1 if an error occurred
int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, float startposition, int flags, float fspeed);
-qboolean S_LocalSound (const char *s);
+qbool S_LocalSound (const char *s);
void S_StaticSound (sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void S_StopSound (int entnum, int entchannel);
void S_StopAllSounds (void);
void S_StopAllSounds_f(cmd_state_t *cmd);
-void S_PauseGameSounds (qboolean toggle);
+void S_PauseGameSounds (qbool toggle);
-void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean freesfx);
-qboolean S_SetChannelFlag (unsigned int ch_ind, unsigned int flag, qboolean value);
+void S_StopChannel (unsigned int channel_ind, qbool lockmutex, qbool freesfx);
+qbool S_SetChannelFlag (unsigned int ch_ind, unsigned int flag, qbool value);
void S_SetChannelVolume (unsigned int ch_ind, float fvol);
void S_SetChannelSpeed (unsigned int ch_ind, float fspeed);
float S_GetChannelPosition (unsigned int ch_ind);
SV_ClientPrint("godmode ON\n");
}
-qboolean noclip_anglehack;
+qbool noclip_anglehack;
static void SV_Noclip_f(cmd_state_t *cmd)
{
MSG_WriteByte(&sv.reliable_datagram, sv.paused);
}
-static void SV_Say(cmd_state_t *cmd, qboolean teamonly)
+static void SV_Say(cmd_state_t *cmd, qbool teamonly)
{
prvm_prog_t *prog = SVVM_prog;
client_t *save;
char *p2;
// LadyHavoc: long say messages
char text[1024];
- qboolean fromServer = false;
+ qbool fromServer = false;
if (cmd->source == src_local)
{
int j;
const char *p1, *p2;
char text[MAX_INPUTLINE]; // LadyHavoc: FIXME: temporary buffer overflow fix (was 64)
- qboolean fromServer = false;
+ qbool fromServer = false;
if (cmd->source == src_local)
fromServer = true;
static void SV_Name_f(cmd_state_t *cmd)
{
int i, j;
- qboolean valid_colors;
+ qbool valid_colors;
const char *newNameSource;
char newName[sizeof(host_client->name)];
const char *message = NULL;
client_t *save;
int i;
- qboolean byNumber = false;
+ qbool byNumber = false;
if (!sv.active)
return;
prvm_edict_t *ed;
mdef_t *key;
int i;
- qboolean haveorigin;
+ qbool haveorigin;
- qboolean expectval = false;
+ qbool expectval = false;
void (*print)(const char *, ...) = (cmd->source == src_client ? SV_ClientPrintf : Con_Printf);
if(!Cmd_Argc(cmd))
FS_Printf(client->sv_demo_file, "%i\n", forcetrack);
}
-void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qboolean clienttoserver)
+void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qbool clienttoserver)
{
prvm_prog_t *prog = SVVM_prog;
int len, i;
#define SV_DEMO_H
void SV_StartDemoRecording(client_t *client, const char *filename, int forcetrack);
-void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qboolean clienttoserver);
+void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qbool clienttoserver);
void SV_StopDemoRecording(client_t *client);
void SV_WriteNetnameIntoDemo(client_t *client);
}
// (server) writes a frame to network stream
-qboolean EntityFrame_WriteFrame(sizebuf_t *msg, int maxsize, entityframe_database_t *d, int numstates, const entity_state_t **states, int viewentnum)
+qbool EntityFrame_WriteFrame(sizebuf_t *msg, int maxsize, entityframe_database_t *d, int numstates, const entity_state_t **states, int viewentnum)
{
prvm_prog_t *prog = SVVM_prog;
int i, onum, number;
#include "quakedef.h"
#include "protocol.h"
-qboolean EntityFrame4_WriteFrame(sizebuf_t *msg, int maxsize, entityframe4_database_t *d, int numstates, const entity_state_t **states)
+qbool EntityFrame4_WriteFrame(sizebuf_t *msg, int maxsize, entityframe4_database_t *d, int numstates, const entity_state_t **states)
{
prvm_prog_t *prog = SVVM_prog;
const entity_state_t *e, *s;
}
}
-qboolean EntityFrame5_WriteFrame(sizebuf_t *msg, int maxsize, entityframe5_database_t *d, int numstates, const entity_state_t **states, int viewentnum, unsigned int movesequence, qboolean need_empty)
+qbool EntityFrame5_WriteFrame(sizebuf_t *msg, int maxsize, entityframe5_database_t *d, int numstates, const entity_state_t **states, int viewentnum, unsigned int movesequence, qbool need_empty)
{
prvm_prog_t *prog = SVVM_prog;
const entity_state_t *n;
{
// marks a frame as lost
int i, j;
- qboolean valid;
+ qbool valid;
int ringfirst, ringlast;
static int recoversendflags[MAX_EDICTS]; // client only
csqcentityframedb_t *d;
//[515]: we use only one array per-client for SendEntity feature
// TODO: add some handling for entity send priorities, to better deal with huge
// amounts of csqc networked entities
-qboolean EntityFrameCSQC_WriteFrame (sizebuf_t *msg, int maxsize, int numnumbers, const unsigned short *numbers, int framenum)
+qbool EntityFrameCSQC_WriteFrame (sizebuf_t *msg, int maxsize, int numnumbers, const unsigned short *numbers, int framenum)
{
prvm_prog_t *prog = SVVM_prog;
int num, number, end, sendflags;
- qboolean sectionstarted = false;
+ qbool sectionstarted = false;
const unsigned short *n;
prvm_edict_t *ed;
client_t *client = svs.clients + sv.writeentitiestoclient_clientnumber;
#include "quakedef.h"
#include "protocol.h"
-qboolean EntityFrameQuake_WriteFrame(sizebuf_t *msg, int maxsize, int numstates, const entity_state_t **states)
+qbool EntityFrameQuake_WriteFrame(sizebuf_t *msg, int maxsize, int numstates, const entity_state_t **states)
{
prvm_prog_t *prog = SVVM_prog;
const entity_state_t *s;
int i, bits;
sizebuf_t buf;
unsigned char data[128];
- qboolean success = false;
+ qbool success = false;
// prepare the buffer
memset(&buf, 0, sizeof(buf));
==================
*/
-void SV_StartSound (prvm_edict_t *entity, int channel, const char *sample, int nvolume, float attenuation, qboolean reliable, float speed)
+void SV_StartSound (prvm_edict_t *entity, int channel, const char *sample, int nvolume, float attenuation, qbool reliable, float speed)
{
prvm_prog_t *prog = SVVM_prog;
sizebuf_t *dest;
if (crash = true), don't bother sending signofs
=====================
*/
-void SV_DropClient(qboolean crash)
+void SV_DropClient(qbool crash)
{
prvm_prog_t *prog = SVVM_prog;
int i;
=============================================================================
*/
-static qboolean SV_PrepareEntityForSending (prvm_edict_t *ent, entity_state_t *cs, int enumber)
+static qbool SV_PrepareEntityForSending (prvm_edict_t *ent, entity_state_t *cs, int enumber)
{
prvm_prog_t *prog = SVVM_prog;
int i;
#define MAX_LINEOFSIGHTTRACES 64
-qboolean SV_CanSeeBox(int numtraces, vec_t eyejitter, vec_t enlarge, vec_t entboxexpand, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs)
+qbool SV_CanSeeBox(int numtraces, vec_t eyejitter, vec_t enlarge, vec_t entboxexpand, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs)
{
prvm_prog_t *prog = SVVM_prog;
float pitchsign;
static void SV_WriteEntitiesToClient(client_t *client, prvm_edict_t *clent, sizebuf_t *msg, int maxsize)
{
prvm_prog_t *prog = SVVM_prog;
- qboolean need_empty = false;
+ qbool need_empty = false;
int i, numsendstates, numcsqcsendstates;
entity_state_t *s;
prvm_edict_t *camera;
- qboolean success;
+ qbool success;
vec3_t eye;
// if there isn't enough space to accomplish anything, skip it
static void SV_Download_f(cmd_state_t *cmd)
{
const char *whichpack, *whichpack2, *extension;
- qboolean is_csqc; // so we need to check only once
+ qbool is_csqc; // so we need to check only once
if (Cmd_Argc(cmd) < 2)
{
Con_Printf("step :%3i\n", step);
}
-static qboolean SVVM_load_edict(prvm_prog_t *prog, prvm_edict_t *ent)
+static qbool SVVM_load_edict(prvm_prog_t *prog, prvm_edict_t *ent)
{
// remove things from different skill levels or deathmatch
if (gamemode != GAME_TRANSFUSION) //Transfusion does this in QC
static double sv_timer;
int i;
char vabuf[1024];
- qboolean playing = false;
+ qbool playing = false;
if (!svs.threaded)
{
static int SV_ThreadFunc(void *voiddata)
{
prvm_prog_t *prog = SVVM_prog;
- qboolean playing = false;
+ qbool playing = false;
double sv_timer = 0;
double sv_deltarealtime, sv_oldrealtime, sv_realtime;
double wait;
*/
int c_yes, c_no;
-qboolean SV_CheckBottom (prvm_edict_t *ent)
+qbool SV_CheckBottom (prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
vec3_t mins, maxs, start, stop;
possible, no move is done and false is returned
=============
*/
-qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace)
+qbool SV_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool noenemy, qbool settrace)
{
prvm_prog_t *prog = SVVM_prog;
float dz;
======================
*/
-static qboolean SV_StepDirection (prvm_edict_t *ent, float yaw, float dist)
+static qbool SV_StepDirection (prvm_edict_t *ent, float yaw, float dist)
{
prvm_prog_t *prog = SVVM_prog;
vec3_t move, oldorigin;
======================
*/
-static qboolean SV_CloseEnough (prvm_edict_t *ent, prvm_edict_t *goal, float dist)
+static qbool SV_CloseEnough (prvm_edict_t *ent, prvm_edict_t *goal, float dist)
{
int i;
int i, bodysupercontents;
int passedictprog;
float pitchsign = 1;
- qboolean pointtrace;
+ qbool pointtrace;
prvm_edict_t *traceowner, *touch;
trace_t trace;
// temporary storage because prvm_vec_t may differ from vec_t
Returns false if the entity removed itself.
=============
*/
-static qboolean SV_RunThink (prvm_edict_t *ent)
+static qbool SV_RunThink (prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
int iterations;
============
*/
static float SV_Gravity (prvm_edict_t *ent);
-static qboolean SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, qboolean dolink);
+static qbool SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, qbool dolink);
#define MAX_CLIP_PLANES 5
-static int SV_FlyMove (prvm_edict_t *ent, float time, qboolean applygravity, float *stepnormal, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float stepheight)
+static int SV_FlyMove (prvm_edict_t *ent, float time, qbool applygravity, float *stepnormal, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float stepheight)
{
prvm_prog_t *prog = SVVM_prog;
int blocked, bumpcount;
===============================================================================
*/
-static qboolean SV_NudgeOutOfSolid_PivotIsKnownGood(prvm_edict_t *ent, vec3_t pivot)
+static qbool SV_NudgeOutOfSolid_PivotIsKnownGood(prvm_edict_t *ent, vec3_t pivot)
{
prvm_prog_t *prog = SVVM_prog;
int bump;
return true;
}
-qboolean SV_NudgeOutOfSolid(prvm_edict_t *ent)
+qbool SV_NudgeOutOfSolid(prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
int bump, pass;
Returns true if the push did not result in the entity being teleported by QC code.
============
*/
-static qboolean SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, qboolean dolink)
+static qbool SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, qbool dolink)
{
prvm_prog_t *prog = SVVM_prog;
int solid;
int i, e, index;
int pusherowner, pusherprog;
int checkcontents;
- qboolean rotated;
+ qbool rotated;
float savesolid, movetime2, pushltime;
vec3_t mins, maxs, move, move1, moveangle, pushorig, pushang, a, forward, left, up, org, pushermins, pushermaxs, checkorigin, checkmins, checkmaxs;
int num_moved;
return UNSTICK_STUCK;
}
-qboolean SV_UnstickEntity (prvm_edict_t *ent)
+qbool SV_UnstickEntity (prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
vec3_t offset;
SV_CheckWater
=============
*/
-static qboolean SV_CheckWater (prvm_edict_t *ent)
+static qbool SV_CheckWater (prvm_edict_t *ent)
{
prvm_prog_t *prog = SVVM_prog;
int cont;
int type;
vec3_t upmove, downmove, start_origin, start_velocity, stepnormal, originalmove_origin, originalmove_velocity, entmins, entmaxs;
trace_t downtrace, trace;
- qboolean applygravity;
+ qbool applygravity;
// if frametime is 0 (due to client sending the same timestamp twice),
// don't move
// (if an ent spawns a higher numbered ent, it moves in the same frame,
// but if it spawns a lower numbered ent, it doesn't - this never moves
// ents in the first frame regardless)
- qboolean runmove = ent->priv.server->move;
+ qbool runmove = ent->priv.server->move;
ent->priv.server->move = true;
if (!runmove && sv_gameplayfix_delayprojectiles.integer > 0)
return;
int i, k, l, numbuffers, lightstyles = 64;
char comment[SAVEGAME_COMMENT_LENGTH+1];
char line[MAX_INPUTLINE];
- qboolean isserver;
+ qbool isserver;
char *s;
// first we have to figure out if this can be saved in 64 lightstyles
{
prvm_prog_t *prog = SVVM_prog;
char name[MAX_QPATH];
- qboolean deadflag = false;
+ qbool deadflag = false;
if (!sv.active)
{
static vec3_t wishdir, forward, right, up;
static float wishspeed;
-static qboolean onground;
+static qbool onground;
/*
==================
PRVM_serveredictfloat(host_client->edict, ping_movementloss) = movementloss / (float) NETGRAPH_PACKETS;
}
-static qboolean SV_FrameLost(int framenum)
+static qbool SV_FrameLost(int framenum)
{
if (host_client->entitydatabase5)
{
}
// TODO: rotate param isnt used.. could be a bug. please check this and remove it if possible [1/10/2008 Black]
-static void SetMinMaxSize (prvm_prog_t *prog, prvm_edict_t *e, float *min, float *max, qboolean rotate)
+static void SetMinMaxSize (prvm_prog_t *prog, prvm_edict_t *e, float *min, float *max, qbool rotate)
{
int i;
vec3_t move;
mfunction_t *oldf;
int oldself;
- qboolean settrace;
+ qbool settrace;
VM_SAFEPARMCOUNTRANGE(2, 3, VM_SV_walkmove);
return 1;
}
-void SV_GetEntityMatrix (prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatrix)
+void SV_GetEntityMatrix (prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qbool viewmatrix)
{
float scale;
float pitchsign = 1;
int selffd;
int outfd;
int nicelevel;
- qboolean nicepossible;
- qboolean isnice;
+ qbool nicepossible;
+ qbool isnice;
} sys_t;
extern sys_t sys;
* \param handle
* \param fcts
*/
-qboolean Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts);
+qbool Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts);
void Sys_UnloadLibrary (dllhandle_t* handle);
void* Sys_GetProcAddress (dllhandle_t handle, const char* name);
#ifdef __cplusplus
extern "C"
#endif
-void Sys_AllowProfiling (qboolean enable);
+void Sys_AllowProfiling (qbool enable);
typedef struct sys_cleantime_s
{
char *Sys_GetClipboardData (void);
-extern qboolean sys_supportsdlgetticks;
+extern qbool sys_supportsdlgetticks;
unsigned int Sys_SDL_GetTicks (void); // wrapper to call SDL_GetTicks
void Sys_SDL_Delay (unsigned int milliseconds); // wrapper to call SDL_Delay
SDL_Quit();
}
-static qboolean nocrashdialog;
+static qbool nocrashdialog;
void Sys_Error (const char *error, ...)
{
va_list argptr;
return 0;
}
-qboolean sys_supportsdlgetticks = true;
+qbool sys_supportsdlgetticks = true;
unsigned int Sys_SDL_GetTicks (void)
{
return SDL_GetTicks();
#ifdef __cplusplus
extern "C"
#endif
-void Sys_AllowProfiling(qboolean enable)
+void Sys_AllowProfiling(qbool enable)
{
#ifdef __ANDROID__
#ifdef USE_PROFILER
===============================================================================
*/
-static qboolean Sys_LoadLibraryFunctions(dllhandle_t dllhandle, const dllfunction_t *fcts, qboolean complain, qboolean has_next)
+static qbool Sys_LoadLibraryFunctions(dllhandle_t dllhandle, const dllfunction_t *fcts, qbool complain, qbool has_next)
{
const dllfunction_t *func;
if(dllhandle)
return false;
}
-qboolean Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts)
+qbool Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts)
{
#ifdef SUPPORTDLL
const dllfunction_t *func;
#endif
#ifdef SSE_POSSIBLE
-qboolean Sys_HaveSSE(void)
+qbool Sys_HaveSSE(void)
{
// COMMANDLINEOPTION: SSE: -nosse disables SSE support and detection
if(Sys_CheckParm("-nosse"))
#endif
}
-qboolean Sys_HaveSSE2(void)
+qbool Sys_HaveSSE2(void)
{
// COMMANDLINEOPTION: SSE2: -nosse2 disables SSE2 support and detection
if(Sys_CheckParm("-nosse") || Sys_CheckParm("-nosse2"))
return 0;
}
-qboolean sys_supportsdlgetticks = false;
+qbool sys_supportsdlgetticks = false;
unsigned int Sys_SDL_GetTicks (void)
{
Sys_Error("Called Sys_SDL_GetTicks on non-SDL target");
}
#endif
-qboolean sys_supportsdlgetticks = false;
+qbool sys_supportsdlgetticks = false;
unsigned int Sys_SDL_GetTicks (void)
{
Sys_Error("Called Sys_SDL_GetTicks on non-SDL target");
unsigned int sleepcounter = 0;
for (;;)
{
- qboolean quit;
+ qbool quit;
while (s->dequeueposition != s->enqueueposition)
{
taskqueue_task_t *t = s->queue[s->dequeueposition % THREADTASKS];
TaskQueue_Enqueue(1, t);
}
-qboolean TaskQueue_IsDone(taskqueue_task_t *t)
+qbool TaskQueue_IsDone(taskqueue_task_t *t)
{
return !!t->done;
}
void TaskQueue_WaitForTaskDone(taskqueue_task_t *t)
{
- qboolean done = false;
+ qbool done = false;
for (;;)
{
Thread_AtomicLock(&taskqueue_state.command_lock);
}
}
-void TaskQueue_Frame(qboolean shutdown)
+void TaskQueue_Frame(qbool shutdown)
{
int i;
unsigned long long int avg;
void TaskQueue_Yield(taskqueue_task_t *t);
// polls for status of task and returns the result, does not cause tasks to be executed (see TaskQueue_WaitForTaskDone for that)
-qboolean TaskQueue_IsDone(taskqueue_task_t *t);
+qbool TaskQueue_IsDone(taskqueue_task_t *t);
// triggers execution of queued tasks, and waits for the specified task to be done
void TaskQueue_WaitForTaskDone(taskqueue_task_t *t);
void TaskQueue_Init(void);
void TaskQueue_Shutdown(void);
-void TaskQueue_Frame(qboolean shutdown);
+void TaskQueue_Frame(qbool shutdown);
#endif
int Thread_Init(void);
void Thread_Shutdown(void);
-qboolean Thread_HasThreads(void);
+qbool Thread_HasThreads(void);
void *_Thread_CreateMutex(const char *filename, int fileline);
void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline);
int _Thread_LockMutex(void *mutex, const char *filename, int fileline);
int _Thread_AtomicSet(Thread_Atomic *ref, int v, const char *filename, int fileline);
int _Thread_AtomicAdd(Thread_Atomic *ref, int v, const char *filename, int fileline);
void _Thread_AtomicIncRef(Thread_Atomic *ref, const char *filename, int fileline);
-qboolean _Thread_AtomicDecRef(Thread_Atomic *ref, const char *filename, int fileline);
-qboolean _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline);
+qbool _Thread_AtomicDecRef(Thread_Atomic *ref, const char *filename, int fileline);
+qbool _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline);
void _Thread_AtomicLock(Thread_SpinLock *lock, const char *filename, int fileline);
void _Thread_AtomicUnlock(Thread_SpinLock *lock, const char *filename, int fileline);
{
}
-qboolean Thread_HasThreads(void)
+qbool Thread_HasThreads(void)
{
return false;
}
a->value++;
}
-qboolean _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline)
+qbool _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline)
{
return a->value++ == 1;
}
-qboolean _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline)
+qbool _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline)
{
return true;
}
{
}
-qboolean Thread_HasThreads(void)
+qbool Thread_HasThreads(void)
{
return true;
}
{
}
-qboolean Thread_HasThreads(void)
+qbool Thread_HasThreads(void)
{
#ifdef THREADDISABLE
return false;
SDL_AtomicIncRef((SDL_atomic_t *)a);
}
-qboolean _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline)
+qbool _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline)
{
#ifdef THREADDEBUG
Sys_PrintfToTerminal("%p atomic decref %s:%i\n", a, filename, fileline);
return SDL_AtomicDecRef((SDL_atomic_t *)a) != SDL_FALSE;
}
-qboolean _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline)
+qbool _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline)
{
#ifdef THREADDEBUG
Sys_PrintfToTerminal("%p atomic try lock %s:%i\n", lock, filename, fileline);
{
}
-qboolean Thread_HasThreads(void)
+qbool Thread_HasThreads(void)
{
#ifdef THREADDISABLE
return false;
* @return Whether or not another valid character is in the string
*/
#define U8_ANALYZE_INFINITY 7
-static qboolean u8_analyze(const char *_s, size_t *_start, size_t *_len, Uchar *_ch, size_t _maxlen)
+static qbool u8_analyze(const char *_s, size_t *_start, size_t *_len, Uchar *_ch, size_t _maxlen)
{
const unsigned char *s = (const unsigned char*)_s;
size_t i, j;
============
*/
size_t
-COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid);
+COM_StringLengthNoColors(const char *s, size_t size_s, qbool *valid);
size_t
-u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid)
+u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qbool *valid)
{
const unsigned char *s = (const unsigned char*)_s;
const unsigned char *end;
* @param maxwidth The maximum output width
* @return The number of bytes written, not including the terminating \0
*/
-size_t u8_strpad(char *out, size_t outsize, const char *in, qboolean leftalign, size_t minwidth, size_t maxwidth)
+size_t u8_strpad(char *out, size_t outsize, const char *in, qbool leftalign, size_t minwidth, size_t maxwidth)
{
if(!utf8_enable.integer)
{
}
}
-size_t u8_strpad_colorcodes(char *out, size_t outsize, const char *in, qboolean leftalign, size_t minwidth, size_t maxwidth)
+size_t u8_strpad_colorcodes(char *out, size_t outsize, const char *in, qbool leftalign, size_t minwidth, size_t maxwidth)
{
size_t l = u8_bytelen_colorcodes(in, maxwidth);
size_t actual_width = u8_strnlen_colorcodes(in, l);
int u8_fromchar(Uchar, char*, size_t);
size_t u8_mbstowcs(Uchar *, const char *, size_t);
size_t u8_wcstombs(char*, const Uchar*, size_t);
-size_t u8_COM_StringLengthNoColors(const char *s, size_t size_s, qboolean *valid);
+size_t u8_COM_StringLengthNoColors(const char *s, size_t size_s, qbool *valid);
// returns a static buffer, use this for inlining
char *u8_encodech(Uchar ch, size_t*, char*buf16);
-size_t u8_strpad(char *out, size_t outsize, const char *in, qboolean leftalign, size_t minwidth, size_t maxwidth);
-size_t u8_strpad_colorcodes(char *out, size_t outsize, const char *in, qboolean leftalign, size_t minwidth, size_t maxwidth);
+size_t u8_strpad(char *out, size_t outsize, const char *in, qbool leftalign, size_t minwidth, size_t maxwidth);
+size_t u8_strpad_colorcodes(char *out, size_t outsize, const char *in, qbool leftalign, size_t minwidth, size_t maxwidth);
/* Careful: if we disable utf8 but not freetype, we wish to see freetype chars
* for normal letters. So use E000+x for special chars, but leave the freetype stuff for the
typedef struct viddef_support_s
{
int glshaderversion; // this is at least 150 (GL 3.2)
- qboolean amd_texture_texture4;
- qboolean arb_texture_gather;
- qboolean ext_texture_compression_s3tc;
- qboolean ext_texture_filter_anisotropic;
- qboolean ext_texture_srgb;
- qboolean arb_debug_output;
+ qbool amd_texture_texture4;
+ qbool arb_texture_gather;
+ qbool ext_texture_compression_s3tc;
+ qbool ext_texture_filter_anisotropic;
+ qbool ext_texture_srgb;
+ qbool arb_debug_output;
}
viddef_support_t;
int width;
int height;
int bitsperpixel;
- qboolean fullscreen;
+ qbool fullscreen;
float refreshrate;
- qboolean userefreshrate;
- qboolean stereobuffer;
+ qbool userefreshrate;
+ qbool stereobuffer;
int samples;
}
viddef_mode_t;
int width;
int height;
int bitsperpixel;
- qboolean fullscreen;
+ qbool fullscreen;
float refreshrate;
- qboolean userefreshrate;
- qboolean stereobuffer;
+ qbool userefreshrate;
+ qbool stereobuffer;
int samples;
- qboolean stencil;
- qboolean sRGB2D; // whether 2D rendering is sRGB corrected (based on sRGBcapable2D)
- qboolean sRGB3D; // whether 3D rendering is sRGB corrected (based on sRGBcapable3D)
- qboolean sRGBcapable2D; // whether 2D rendering can be sRGB corrected (renderpath)
- qboolean sRGBcapable3D; // whether 3D rendering can be sRGB corrected (renderpath)
+ qbool stencil;
+ qbool sRGB2D; // whether 2D rendering is sRGB corrected (based on sRGBcapable2D)
+ qbool sRGB3D; // whether 3D rendering is sRGB corrected (based on sRGBcapable3D)
+ qbool sRGBcapable2D; // whether 2D rendering can be sRGB corrected (renderpath)
+ qbool sRGBcapable3D; // whether 3D rendering can be sRGB corrected (renderpath)
renderpath_t renderpath;
- qboolean allowalphatocoverage; // indicates the GL_AlphaToCoverage function works on this renderpath and framebuffer
+ qbool allowalphatocoverage; // indicates the GL_AlphaToCoverage function works on this renderpath and framebuffer
unsigned int maxtexturesize_2d;
unsigned int maxtexturesize_3d;
{
float axis[MAXJOYAXIS]; // -1 to +1
unsigned char button[MAXJOYBUTTON]; // 0 or 1
- qboolean is360; // indicates this joystick is a Microsoft Xbox 360 Controller For Windows
+ qbool is360; // indicates this joystick is a Microsoft Xbox 360 Controller For Windows
}
vid_joystate_t;
void VID_Shared_BuildJoyState_Begin(vid_joystate_t *joystate);
void VID_Shared_BuildJoyState_Finish(vid_joystate_t *joystate);
int VID_Shared_SetJoystick(int index);
-qboolean VID_JoyBlockEmulatedKeys(int keycode);
-void VID_EnableJoystick(qboolean enable);
+qbool VID_JoyBlockEmulatedKeys(int keycode);
+void VID_EnableJoystick(qbool enable);
-extern qboolean vid_hidden;
-extern qboolean vid_activewindow;
-extern qboolean vid_supportrefreshrate;
+extern qbool vid_hidden;
+extern qbool vid_activewindow;
+extern qbool vid_supportrefreshrate;
extern cvar_t vid_fullscreen;
extern cvar_t vid_borderless;
extern char gl_driver[256];
void *GL_GetProcAddress(const char *name);
-qboolean GL_CheckExtension(const char *name, const char *disableparm, int silent);
-qboolean GL_ExtensionSupported(const char *name);
+qbool GL_CheckExtension(const char *name, const char *disableparm, int silent);
+qbool GL_ExtensionSupported(const char *name);
void VID_Shared_Init(void);
// sets the mode; only used by the Quake engine for resetting to mode 0 (the
// base mode) on memory allocation failures
-qboolean VID_InitMode(viddef_mode_t *mode);
+qbool VID_InitMode(viddef_mode_t *mode);
// allocates and opens an appropriate OpenGL context (and its window)
// (ONLY to be called from VID_Finish!)
void VID_UpdateGamma(void);
-qboolean VID_HasScreenKeyboardSupport(void);
-void VID_ShowKeyboard(qboolean show);
-qboolean VID_ShowingKeyboard(void);
+qbool VID_HasScreenKeyboardSupport(void);
+void VID_ShowKeyboard(qbool show);
+qbool VID_ShowingKeyboard(void);
-void VID_SetMouse (qboolean fullscreengrab, qboolean relative, qboolean hidecursor);
+void VID_SetMouse (qbool fullscreengrab, qbool relative, qbool hidecursor);
void VID_Finish (void);
void VID_Restart_f(cmd_state_t *cmd);
void VID_Stop(void);
extern unsigned int vid_gammatables_serial; // so other subsystems can poll if gamma parameters have changed; this starts with 0 and gets increased by 1 each time the gamma parameters get changed and VID_BuildGammaTables should be called again
-extern qboolean vid_gammatables_trivial; // this is set to true if all color control values are at default setting, and it therefore would make no sense to use the gamma table
+extern qbool vid_gammatables_trivial; // this is set to true if all color control values are at default setting, and it therefore would make no sense to use the gamma table
void VID_BuildGammaTables(unsigned short *ramps, int rampsize); // builds the current gamma tables into an array (needs 3*rampsize items)
void VID_ApplyGammaToColor(const float *rgb, float *out); // applies current gamma settings to a color (0-1 range)
vid_mode_t;
vid_mode_t *VID_GetDesktopMode(void);
size_t VID_ListModes(vid_mode_t *modes, size_t maxcount);
-size_t VID_SortModes(vid_mode_t *modes, size_t count, qboolean usebpp, qboolean userefreshrate, qboolean useaspect);
+size_t VID_SortModes(vid_mode_t *modes, size_t count, qbool usebpp, qbool userefreshrate, qbool useaspect);
void VID_Soft_SharedSetup(void);
#endif
int cl_available = false;
-qboolean vid_supportrefreshrate = false;
+qbool vid_supportrefreshrate = false;
void VID_Shutdown(void)
{
#endif
}
-void VID_SetMouse (qboolean fullscreengrab, qboolean relative, qboolean hidecursor)
+void VID_SetMouse (qbool fullscreengrab, qbool relative, qbool hidecursor)
{
}
InitSig(); // trap evil signals
}
-qboolean VID_InitMode(viddef_mode_t *mode)
+qbool VID_InitMode(viddef_mode_t *mode)
{
return false;
}
return 0;
}
-qboolean GL_ExtensionSupported(const char *name)
+qbool GL_ExtensionSupported(const char *name)
{
return false;
}
#include <IOKit/hidsystem/IOHIDParameter.h>
#include <IOKit/hidsystem/event_status_driver.h>
static cvar_t apple_mouse_noaccel = {CVAR_CLIENT | CVAR_SAVE, "apple_mouse_noaccel", "1", "disables mouse acceleration while DarkPlaces is active"};
-static qboolean vid_usingnoaccel;
+static qbool vid_usingnoaccel;
static double originalMouseSpeed = -1.0;
io_connect_t IN_GetIOHandle(void)
{
// Tell startup code that we have a client
int cl_available = true;
-qboolean vid_supportrefreshrate = false;
+qbool vid_supportrefreshrate = false;
-static qboolean vid_usingmouse = false;
-static qboolean vid_usingmouse_relativeworks = false; // SDL2 workaround for unimplemented RelativeMouse mode
-static qboolean vid_usinghidecursor = false;
-static qboolean vid_hasfocus = false;
-static qboolean vid_isfullscreen;
-static qboolean vid_usingvsync = false;
+static qbool vid_usingmouse = false;
+static qbool vid_usingmouse_relativeworks = false; // SDL2 workaround for unimplemented RelativeMouse mode
+static qbool vid_usinghidecursor = false;
+static qbool vid_hasfocus = false;
+static qbool vid_isfullscreen;
+static qbool vid_usingvsync = false;
static SDL_Joystick *vid_sdljoystick = NULL;
static SDL_GameController *vid_sdlgamecontroller = NULL;
static cvar_t joy_sdl2_trigger_deadzone = {CVAR_SAVE | CVAR_CLIENT, "joy_sdl2_trigger_deadzone", "0.5", "deadzone for triggers to be registered as key presses"};
}
}
-qboolean VID_HasScreenKeyboardSupport(void)
+qbool VID_HasScreenKeyboardSupport(void)
{
return SDL_HasScreenKeyboardSupport() != SDL_FALSE;
}
-void VID_ShowKeyboard(qboolean show)
+void VID_ShowKeyboard(qbool show)
{
if (!SDL_HasScreenKeyboardSupport())
return;
}
}
-qboolean VID_ShowingKeyboard(void)
+qbool VID_ShowingKeyboard(void)
{
return SDL_IsTextInputActive() != 0;
}
-void VID_SetMouse(qboolean fullscreengrab, qboolean relative, qboolean hidecursor)
+void VID_SetMouse(qbool fullscreengrab, qbool relative, qbool hidecursor)
{
#ifndef DP_MOBILETOUCH
#ifdef MACOSX
int multitouchs[MAXFINGERS];
// modified heavily by ELUAN
-static qboolean VID_TouchscreenArea(int corner, float px, float py, float pwidth, float pheight, const char *icon, float textheight, const char *text, float *resultmove, qboolean *resultbutton, keynum_t key, const char *typedtext, float deadzone, float oversizepixels_x, float oversizepixels_y, qboolean iamexclusive)
+static qbool VID_TouchscreenArea(int corner, float px, float py, float pwidth, float pheight, const char *icon, float textheight, const char *text, float *resultmove, qbool *resultbutton, keynum_t key, const char *typedtext, float deadzone, float oversizepixels_x, float oversizepixels_y, qbool iamexclusive)
{
int finger;
float fx, fy, fwidth, fheight;
float overfx, overfy, overfwidth, overfheight;
float rel[3];
float sqsum;
- qboolean button = false;
+ qbool button = false;
VectorClear(rel);
if (pwidth > 0 && pheight > 0)
{
// ELUAN:
// not reentrant, but we only need one mouse cursor anyway...
-static void VID_TouchscreenCursor(float px, float py, float pwidth, float pheight, qboolean *resultbutton, keynum_t key)
+static void VID_TouchscreenCursor(float px, float py, float pwidth, float pheight, qbool *resultbutton, keynum_t key)
{
int finger;
float fx, fy, fwidth, fheight;
- qboolean button = false;
+ qbool button = false;
static int cursorfinger = -1;
static int cursorfreemovement = false;
static int canclick = false;
int i, numfingers;
float xscale, yscale;
float move[3], aim[3];
- static qboolean oldbuttons[128];
- static qboolean buttons[128];
+ static qbool oldbuttons[128];
+ static qbool buttons[128];
keydest_t keydest = (key_consoleactive & KEY_CONSOLEACTIVE_USER) ? key_console : key_dest;
memcpy(oldbuttons, buttons, sizeof(oldbuttons));
memset(multitouchs, 0, sizeof(multitouchs));
{
int x, y;
float move[3], aim[3], click[3];
- static qboolean oldbuttons[128];
- static qboolean buttons[128];
+ static qbool oldbuttons[128];
+ static qbool buttons[128];
keydest_t keydest = (key_consoleactive & KEY_CONSOLEACTIVE_USER) ? key_console : key_dest;
memcpy(oldbuttons, buttons, sizeof(oldbuttons));
memset(multitouchs, 0, sizeof(multitouchs));
static int old_x = 0, old_y = 0;
static int stuck = 0;
static keydest_t oldkeydest;
- static qboolean oldshowkeyboard;
+ static qbool oldshowkeyboard;
int x, y;
vid_joystate_t joystate;
keydest_t keydest = (key_consoleactive & KEY_CONSOLEACTIVE_USER) ? key_console : key_dest;
////
#ifdef SDL_R_RESTART
-static qboolean sdl_needs_restart;
+static qbool sdl_needs_restart;
static void sdl_start(void)
{
}
// SDL2
void Sys_SendKeyEvents( void )
{
- static qboolean sound_active = true;
+ static qbool sound_active = true;
int keycode;
int i;
- qboolean isdown;
+ qbool isdown;
Uchar unicode;
SDL_Event event;
return p;
}
-qboolean GL_ExtensionSupported(const char *name)
+qbool GL_ExtensionSupported(const char *name)
{
return SDL_GL_ExtensionSupported(name);
}
-static qboolean vid_sdl_initjoysticksystem = false;
+static qbool vid_sdl_initjoysticksystem = false;
void VID_Init (void)
{
}
static int vid_sdljoystickindex = -1;
-void VID_EnableJoystick(qboolean enable)
+void VID_EnableJoystick(qbool enable)
{
int index = joy_enable.integer > 0 ? joy_index.integer : -1;
int numsdljoysticks;
- qboolean success = false;
+ qbool success = false;
int sharedcount = 0;
int sdlindex = -1;
sharedcount = VID_Shared_SetJoystick(index);
extern cvar_t gl_info_platform;
extern cvar_t gl_info_driver;
-static qboolean VID_InitModeGL(viddef_mode_t *mode)
+static qbool VID_InitModeGL(viddef_mode_t *mode)
{
int windowflags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL;
// currently SDL_WINDOWPOS_UNDEFINED behaves exactly like SDL_WINDOWPOS_CENTERED, this might change some day
extern cvar_t gl_info_platform;
extern cvar_t gl_info_driver;
-qboolean VID_InitMode(viddef_mode_t *mode)
+qbool VID_InitMode(viddef_mode_t *mode)
{
// GAME_STEELSTORM specific
steelstorm_showing_map = Cvar_FindVar(&cvars_all, "steelstorm_showing_map", ~0);
void VID_Finish (void)
{
- qboolean vid_usevsync;
+ qbool vid_usevsync;
vid_activewindow = !vid_hidden && vid_hasfocus;
VID_UpdateGamma();
DWORD (WINAPI *qXInputGetState)(DWORD index, xinput_state_t *state);
DWORD (WINAPI *qXInputGetKeystroke)(DWORD index, DWORD reserved, xinput_keystroke_t *keystroke);
-qboolean vid_xinputinitialized = false;
+qbool vid_xinputinitialized = false;
int vid_xinputindex = -1;
#endif
viddef_t vid;
// AK FIXME -> input_dest
-qboolean in_client_mouse = true;
+qbool in_client_mouse = true;
// AK where should it be placed ?
float in_mouse_x, in_mouse_y;
float in_windowmouse_x, in_windowmouse_y;
// LadyHavoc: if window is hidden, don't update screen
-qboolean vid_hidden = true;
+qbool vid_hidden = true;
// LadyHavoc: if window is not the active window, don't hog as much CPU time,
// let go of the mouse, turn off sound, and restore system gamma ramps...
-qboolean vid_activewindow = true;
+qbool vid_activewindow = true;
vid_joystate_t vid_joystate;
};
#endif
-qboolean GL_CheckExtension(const char *name, const char *disableparm, int silent)
+qbool GL_CheckExtension(const char *name, const char *disableparm, int silent)
{
int failed = false;
const glfunction_t *func;
int j;
GLint numextensions = 0;
const glfunction_t *func;
- qboolean missingrequiredfuncs = false;
+ qbool missingrequiredfuncs = false;
static char missingfuncs[16384];
#ifndef USE_GLES2
return value * fsensitivity;
}
-qboolean VID_JoyBlockEmulatedKeys(int keycode)
+qbool VID_JoyBlockEmulatedKeys(int keycode)
{
int j;
vid_joystate_t joystate;
joystate->button[35] = r < 0.0f;
}
-static void VID_KeyEventForButton(qboolean oldbutton, qboolean newbutton, int key, double *timer)
+static void VID_KeyEventForButton(qbool oldbutton, qbool newbutton, int key, double *timer)
{
if (oldbutton)
{
}
unsigned int vid_gammatables_serial = 0; // so other subsystems can poll if gamma parameters have changed
-qboolean vid_gammatables_trivial = true;
+qbool vid_gammatables_trivial = true;
void VID_BuildGammaTables(unsigned short *ramps, int rampsize)
{
if (cachecolorenable)
{
cvar_t *c;
float f;
- qboolean gamma_changed = false;
+ qbool gamma_changed = false;
#define BOUNDCVAR(cvar, m1, m2) c = &(cvar);f = bound(m1, c->value, m2);if (c->value != f) Cvar_SetValueQuick(c, f);
BOUNDCVAR(v_gamma, 0.1, 5);
Key_ReleaseAll();
}
-qboolean vid_commandlinecheck = true;
-extern qboolean vid_opened;
+qbool vid_commandlinecheck = true;
+extern qbool vid_opened;
void VID_Restart_f(cmd_state_t *cmd)
{
return -1;
return 0;
}
-size_t VID_SortModes(vid_mode_t *modes, size_t count, qboolean usebpp, qboolean userefreshrate, qboolean useaspect)
+size_t VID_SortModes(vid_mode_t *modes, size_t count, qbool usebpp, qbool userefreshrate, qbool useaspect)
{
size_t i;
if(count == 0)
* viewmodelmatrix_nobob
* viewmodelmatrix_withbob
*/
-void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewangles, qboolean teleported, qboolean clonground, qboolean clcmdjump, float clstatsviewheight, qboolean cldead, qboolean clintermission, const vec3_t clvelocity)
+void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewangles, qbool teleported, qbool clonground, qbool clcmdjump, float clstatsviewheight, qbool cldead, qbool clintermission, const vec3_t clvelocity)
{
float vieworg[3], viewangles[3], smoothtime;
float gunorg[3], gunangles[3];
void V_CalcRefdef (void)
{
entity_t *ent;
- qboolean cldead;
+ qbool cldead;
if (cls.state == ca_connected && cls.signon == SIGNONS && !cl.csqc_server2csqcentitynumber[cl.viewentity])
{
int triangleindex;
int vertexindex;
mempool_t *mempool;
- qboolean modified = false;
+ qbool modified = false;
vec3_t angles;
vec3_t avelocity;
vec3_t entmaxs;
vec3_t scale;
vec_t spinlimit;
vec_t test;
- qboolean gravity;
- qboolean geom_modified = false;
+ qbool gravity;
+ qbool geom_modified = false;
edict_odefunc_t *func, *nextf;
dReal *planes, *planesData, *pointsData;
unsigned int *polygons, *polygonsData, polyvert;
- qboolean *mapped, *used, convex_compatible;
+ qbool *mapped, *used, convex_compatible;
int numplanes = 0, numpoints = 0, i;
#ifndef LINK_TO_LIBODE
// followed by that amount of indices to "points" in counter clockwise order
polygonsData = polygons = (unsigned int *)Mem_Alloc(mempool, numtriangles*sizeof(int)*4);
planesData = planes = (dReal *)Mem_Alloc(mempool, numtriangles*sizeof(dReal)*4);
- mapped = (qboolean *)Mem_Alloc(mempool, numvertices*sizeof(qboolean));
- used = (qboolean *)Mem_Alloc(mempool, numtriangles*sizeof(qboolean));
- memset(mapped, 0, numvertices*sizeof(qboolean));
- memset(used, 0, numtriangles*sizeof(qboolean));
+ mapped = (qbool *)Mem_Alloc(mempool, numvertices*sizeof(qbool));
+ used = (qbool *)Mem_Alloc(mempool, numtriangles*sizeof(qbool));
+ memset(mapped, 0, numvertices*sizeof(qbool));
+ memset(used, 0, numtriangles*sizeof(qbool));
numplanes = numpoints = polyvert = 0;
// build convex hull
// todo: merge duplicated verts here
typedef struct world_physics_s
{
// for ODE physics engine
- qboolean ode; // if true then ode is activated
+ qbool ode; // if true then ode is activated
void *ode_world;
void *ode_space;
void *ode_contactgroup;
#define MEMHEADER_SENTINEL_FOR_ADDRESS(p) ((sentinel_seed ^ (unsigned int) (uintptr_t) (p)) + sentinel_seed)
unsigned int sentinel_seed;
-qboolean mem_bigendian = false;
+qbool mem_bigendian = false;
void *mem_mutex = NULL;
// divVerent: enables file backed malloc using mmap to conserve swap space (instead of malloc)
#endif
}
-qboolean Mem_IsAllocated(mempool_t *pool, void *data)
+qbool Mem_IsAllocated(mempool_t *pool, void *data)
{
memheader_t *header;
memheader_t *target;
#ifndef ZONE_H
#define ZONE_H
-extern qboolean mem_bigendian;
+extern qbool mem_bigendian;
// div0: heap overflow detection paranoia
#define MEMPARANOIA 0
void _Mem_CheckSentinels(void *data, const char *filename, int fileline);
void _Mem_CheckSentinelsGlobal(const char *filename, int fileline);
// if pool is NULL this searches ALL pools for the allocation
-qboolean Mem_IsAllocated(mempool_t *pool, void *data);
+qbool Mem_IsAllocated(mempool_t *pool, void *data);
char* Mem_strdup (mempool_t *pool, const char* s);