From 0a05c446ba26bd5897645a37ceec8646c5bc93eb Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Thu, 17 Sep 2020 05:17:53 +0000 Subject: [PATCH] Rename qboolean to qbool git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12920 d7cf8633-e32d-0410-b094-e92efae38249 --- cap_avi.c | 4 +- cap_ogg.c | 4 +- cap_ogg.h | 2 +- cd_shared.c | 16 +++--- cdaudio.h | 2 +- cl_collision.c | 8 +-- cl_collision.h | 6 +- cl_demo.c | 2 +- cl_ents_qw.c | 4 +- cl_input.c | 10 ++-- cl_main.c | 6 +- cl_parse.c | 30 +++++----- cl_particles.c | 32 +++++------ cl_screen.c | 36 ++++++------ cl_screen.h | 4 +- cl_video.c | 8 +-- cl_video.h | 4 +- cl_video_libavw.c | 2 +- cl_video_libavw.h | 2 +- client.h | 140 +++++++++++++++++++++++----------------------- clvm_cmds.c | 38 ++++++------- cmd.c | 52 ++++++++--------- cmd.h | 22 ++++---- collision.c | 14 ++--- collision.h | 10 ++-- com_list.c | 6 +- com_list.h | 6 +- common.c | 16 +++--- common.h | 22 ++++---- console.c | 28 +++++----- console.h | 10 ++-- crypto.c | 52 ++++++++--------- crypto.h | 18 +++--- csprogs.c | 32 +++++------ csprogs.h | 18 +++--- curves.c | 4 +- cvar.c | 14 ++--- cvar.h | 10 ++-- draw.h | 14 ++--- filematch.c | 4 +- fs.c | 66 +++++++++++----------- fs.h | 32 +++++------ ft2.c | 32 +++++------ ft2.h | 12 ++-- ft2_fontdefs.h | 8 +-- gl_backend.c | 34 +++++------ gl_backend.h | 20 +++---- gl_draw.c | 30 +++++----- gl_rmain.c | 104 +++++++++++++++++----------------- gl_rsurf.c | 40 ++++++------- gl_textures.c | 24 ++++---- hmac.c | 2 +- hmac.h | 2 +- host.c | 10 ++-- image.c | 24 ++++---- image.h | 18 +++--- image_png.c | 4 +- image_png.h | 4 +- input.h | 2 +- jpeg.c | 10 ++-- jpeg.h | 6 +- keys.c | 24 ++++---- keys.h | 14 ++--- libcurl.c | 34 +++++------ libcurl.h | 12 ++-- mathlib.c | 2 +- mathlib.h | 2 +- menu.c | 30 +++++----- menu.h | 2 +- model_alias.c | 8 +-- model_brush.c | 22 ++++---- model_shared.c | 42 +++++++------- model_shared.h | 110 ++++++++++++++++++------------------ model_sprite.c | 8 +-- mvm_cmds.c | 6 +- netconn.c | 62 ++++++++++---------- netconn.h | 28 +++++----- portals.c | 4 +- progs.h | 10 ++-- progsvm.h | 22 ++++---- protocol.h | 14 ++--- prvm_cmds.c | 12 ++-- prvm_edict.c | 24 ++++---- prvm_exec.c | 8 +-- qtypes.h | 2 +- quakedef.h | 10 ++-- r_explosion.c | 4 +- r_shadow.c | 58 +++++++++---------- r_shadow.h | 30 +++++----- r_sky.c | 4 +- r_sprites.c | 2 +- r_textures.h | 12 ++-- render.h | 82 +++++++++++++-------------- sbar.c | 8 +-- screen.h | 10 ++-- server.h | 48 ++++++++-------- snd_main.c | 34 +++++------ snd_main.h | 12 ++-- snd_mem.c | 2 +- snd_mix.c | 4 +- snd_null.c | 12 ++-- snd_ogg.c | 6 +- snd_ogg.h | 4 +- snd_oss.c | 4 +- snd_sdl.c | 4 +- snd_wav.c | 2 +- snd_wav.h | 2 +- snd_xmp.c | 6 +- snd_xmp.h | 4 +- sound.h | 12 ++-- sv_ccmds.c | 16 +++--- sv_demo.c | 2 +- sv_demo.h | 2 +- sv_ents.c | 2 +- sv_ents4.c | 2 +- sv_ents5.c | 2 +- sv_ents_csqc.c | 6 +- sv_ents_nq.c | 4 +- sv_main.c | 20 +++---- sv_move.c | 8 +-- sv_phys.c | 24 ++++---- sv_save.c | 4 +- sv_user.c | 4 +- svvm_cmds.c | 6 +- sys.h | 10 ++-- sys_sdl.c | 4 +- sys_shared.c | 10 ++-- sys_unix.c | 2 +- sys_win.c | 2 +- taskqueue.c | 8 +-- taskqueue.h | 4 +- thread.h | 6 +- thread_null.c | 6 +- thread_pthread.c | 2 +- thread_sdl.c | 6 +- thread_win.c | 2 +- utf8lib.c | 10 ++-- utf8lib.h | 6 +- vid.h | 66 +++++++++++----------- vid_null.c | 8 +-- vid_sdl.c | 62 ++++++++++---------- vid_shared.c | 26 ++++----- view.c | 4 +- world.c | 16 +++--- world.h | 2 +- zone.c | 4 +- zone.h | 4 +- 147 files changed, 1223 insertions(+), 1223 deletions(-) diff --git a/cap_avi.c b/cap_avi.c index 029e4e19..ea0e3544 100644 --- a/cap_avi.c +++ b/cap_avi.c @@ -18,7 +18,7 @@ typedef struct capturevideostate_avi_formatspecific_s 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; @@ -269,7 +269,7 @@ static void SCR_CaptureVideo_RIFF_MakeIxChunk(const char *fcc, const char *dwChu 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 diff --git a/cap_ogg.c b/cap_ogg.c index 0565a9e8..b88bb91b 100644 --- a/cap_ogg.c +++ b/cap_ogg.c @@ -512,7 +512,7 @@ static dllfunction_t theorafuncs[] = 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 [] = { @@ -596,7 +596,7 @@ void SCR_CaptureVideo_Ogg_Init(void) 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; } diff --git a/cap_ogg.h b/cap_ogg.h index 81718f2a..d56439f3 100644 --- a/cap_ogg.h +++ b/cap_ogg.h @@ -1,4 +1,4 @@ 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); diff --git a/cd_shared.c b/cd_shared.c index 8c4566c4..0b857609 100644 --- a/cd_shared.c +++ b/cd_shared.c @@ -85,9 +85,9 @@ cvar_t music_playlist_sampleposition[MAX_PLAYLISTS] = {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 @@ -95,8 +95,8 @@ static filename_t remap[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) @@ -116,7 +116,7 @@ static int CDAudio_GetAudioDiskInfo (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; @@ -208,7 +208,7 @@ static void CDAudio_Play_byName (const char *trackname, qboolean looping, qboole 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) @@ -444,7 +444,7 @@ static void CDAudio_StopPlaylistTrack(void) music_playlist_playing = 0; // not playing } -static void CDAudio_StartPlaylist(qboolean resume) +static void CDAudio_StartPlaylist(qbool resume) { const char *list; const char *t; diff --git a/cdaudio.h b/cdaudio.h index 6c46f602..50065aa4 100644 --- a/cdaudio.h +++ b/cdaudio.h @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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); diff --git a/cl_collision.c b/cl_collision.c index 924d017c..d678e1b8 100644 --- a/cl_collision.c +++ b/cl_collision.c @@ -203,7 +203,7 @@ int CL_GenericHitSuperContentsMask(const prvm_edict_t *passedict) 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; @@ -424,7 +424,7 @@ finished: 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; @@ -648,13 +648,13 @@ finished: 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 diff --git a/cl_collision.h b/cl_collision.h index 20ce9f65..d0c5b09d 100644 --- a/cl_collision.h +++ b/cl_collision.h @@ -10,9 +10,9 @@ dp_model_t *CL_GetModelFromEdict(prvm_edict_t *ed); 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) diff --git a/cl_demo.c b/cl_demo.c index bc8fd7e9..2e5c17c9 100644 --- a/cl_demo.c +++ b/cl_demo.c @@ -414,7 +414,7 @@ void CL_PlayDemo_f(cmd_state_t *cmd) { char name[MAX_QPATH]; int c; - qboolean neg = false; + qbool neg = false; qfile_t *f; if (Cmd_Argc(cmd) != 2) diff --git a/cl_ents_qw.c b/cl_ents_qw.c index 2656dbc0..dcbe7490 100644 --- a/cl_ents_qw.c +++ b/cl_ents_qw.c @@ -251,9 +251,9 @@ void EntityFrameQW_FreeDatabase(entityframeqw_database_t *d) 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; diff --git a/cl_input.c b/cl_input.c index 8ccd3477..110c7229 100644 --- a/cl_input.c +++ b/cl_input.c @@ -315,7 +315,7 @@ Returns 0.25 if a key was pressed and released during the frame, 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; @@ -837,7 +837,7 @@ static vec3_t offsets[NUMOFFSETS] = {-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; @@ -1401,7 +1401,7 @@ static void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s) { // apply air speed limit vec_t accel, wishspeed0, wishspeed2, accelqw, strafity; - qboolean accelerating; + qbool accelerating; accelqw = cl.movevars_airaccel_qw; wishspeed0 = wishspeed; @@ -1758,8 +1758,8 @@ void CL_SendMove(void) 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) diff --git a/cl_main.c b/cl_main.c index 73fb6986..753001ae 100644 --- a/cl_main.c +++ b/cl_main.c @@ -224,10 +224,10 @@ void CL_ClearState(void) 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; @@ -1029,7 +1029,7 @@ void CL_SetEntityColormapColors(entity_render_t *ent, int colormap) } // 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; diff --git a/cl_parse.c b/cl_parse.c index bc79dd0f..c93b3c81 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -190,10 +190,10 @@ cvar_t cl_nettimesyncboundmode = {CVAR_CLIENT | CVAR_SAVE, "cl_nettimesyncboundm 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); /* @@ -301,17 +301,17 @@ so the server doesn't disconnect. */ 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; @@ -376,7 +376,7 @@ void CL_KeepaliveMessage (qboolean readmessages) 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 @@ -530,7 +530,7 @@ static void CL_SetupWorldModel(void) } } -static qboolean QW_CL_CheckOrDownloadFile(const char *filename) +static qbool QW_CL_CheckOrDownloadFile(const char *filename) { qfile_t *file; char vabuf[1024]; @@ -952,7 +952,7 @@ void QW_CL_StartUpload(unsigned char *data, int size) } #if 0 -qboolean QW_CL_IsUploading(void) +qbool QW_CL_IsUploading(void) { return cls.qw_uploaddata != NULL; } @@ -1077,7 +1077,7 @@ static void CL_UpdateItemsAndWeapon(void) #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 @@ -2977,13 +2977,13 @@ typedef struct cl_iplog_item_s } 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; @@ -3131,7 +3131,7 @@ static void CL_IPLog_List_f(cmd_state_t *cmd) } // 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; @@ -3163,7 +3163,7 @@ static qboolean CL_ExaminePrintString(const char *text) 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; @@ -3390,8 +3390,8 @@ void CL_ParseServerMessage(void) 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 diff --git a/cl_particles.c b/cl_particles.c index 6ff07233..b08172e8 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -114,7 +114,7 @@ typedef struct particleeffectinfo_s 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! @@ -264,7 +264,7 @@ particleeffectinfo_t baselineparticleeffectinfo = 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! @@ -650,7 +650,7 @@ void CL_SpawnDecalParticleForPoint(const vec3_t org, float maxdist, float size, // 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; @@ -890,8 +890,8 @@ static char *LightCubemapNumToName(char *vabuf, size_t vasize, int lightcubemapn 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; @@ -1014,7 +1014,7 @@ static void CL_ParticleEffect_Fallback(int effectnameindex, float count, const v 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--) @@ -1419,9 +1419,9 @@ static void CL_ParticleEffect_Fallback(int effectnameindex, float count, const v // 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]) { @@ -1445,8 +1445,8 @@ static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, con 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 @@ -1468,9 +1468,9 @@ static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, con { 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; @@ -1640,12 +1640,12 @@ static void CL_NewParticlesFromEffectinfo(int effectnameindex, float pcount, con 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); } @@ -2462,7 +2462,7 @@ static void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const 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); @@ -2740,7 +2740,7 @@ void R_DrawParticles (void) 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); diff --git a/cl_screen.c b/cl_screen.c index 8238ff62..431b9a4e 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -118,7 +118,7 @@ extern cvar_t r_fog_clear; 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; @@ -131,7 +131,7 @@ static void SCR_ScreenShot_f(cmd_state_t *cmd); static void R_Envmap_f(cmd_state_t *cmd); // backend -void R_ClearScreen(qboolean fogcolor); +void R_ClearScreen(qbool fogcolor); /* =============================================================================== @@ -727,7 +727,7 @@ void SCR_DrawConsole (void) con_vislines = 0; } -qboolean scr_loading = false; +qbool scr_loading = false; /* =============== @@ -735,7 +735,7 @@ SCR_BeginLoadingPlaque ================ */ -void SCR_BeginLoadingPlaque (qboolean startup) +void SCR_BeginLoadingPlaque (qbool startup) { scr_loading = true; SCR_UpdateLoadingScreen(false, startup); @@ -1397,8 +1397,8 @@ void SCR_ScreenShot_f(cmd_state_t *cmd) 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) @@ -1790,7 +1790,7 @@ struct envmapinfo_s { float angles[3]; const char *name; - qboolean flipx, flipy, flipdiagonaly; + qbool flipx, flipy, flipdiagonaly; } envmapinfo[12] = { @@ -1961,10 +1961,10 @@ void SHOWLMP_drawall(void) // 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); @@ -2052,7 +2052,7 @@ static void SCR_DrawTouchscreenOverlay(void) } } -void R_ClearScreen(qboolean fogcolor) +void R_ClearScreen(qbool fogcolor) { float clearcolor[4]; if (scr_screenshot_alpha.integer) @@ -2085,8 +2085,8 @@ typedef struct loadingscreenstack_s } 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]; @@ -2371,7 +2371,7 @@ void SCR_PushLoadingScreen (const char *msg, float len_in_parent) SCR_UpdateLoadingScreenIfShown(); } -void SCR_PopLoadingScreen (qboolean redraw) +void SCR_PopLoadingScreen (qbool redraw) { loadingscreenstack_t *s = loadingscreenstack; @@ -2390,7 +2390,7 @@ void SCR_PopLoadingScreen (qboolean redraw) SCR_UpdateLoadingScreenIfShown(); } -void SCR_ClearLoadingScreen (qboolean redraw) +void SCR_ClearLoadingScreen (qbool redraw) { while(loadingscreenstack) SCR_PopLoadingScreen(redraw && !loadingscreenstack->prev); @@ -2477,7 +2477,7 @@ static cachepic_t *loadingscreenpic; 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; @@ -2577,7 +2577,7 @@ static double loadingscreen_lastupdate; 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; @@ -2663,12 +2663,12 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup) 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()); } diff --git a/cl_screen.h b/cl_screen.h index faf906b2..d9787262 100644 --- a/cl_screen.h +++ b/cl_screen.h @@ -20,8 +20,8 @@ void CL_Screen_Init(void); 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 diff --git a/cl_video.c b/cl_video.c index db97d1cd..b9073847 100644 --- a/cl_video.c +++ b/cl_video.c @@ -46,7 +46,7 @@ static clvideo_t *FindUnusedVid( void ) return NULL; } -static qboolean OpenStream( clvideo_t * video ) +static qbool OpenStream( clvideo_t * video ) { const char *errorstring; @@ -104,7 +104,7 @@ static void SuspendVideo( clvideo_t * video ) } } -static qboolean WakeVideo( clvideo_t * video ) +static qbool WakeVideo( clvideo_t * video ) { if( !video->suspended ) return true; @@ -444,7 +444,7 @@ static float CL_DrawVideo_WordWidthFunc(void *passthrough, const char *w, size_t 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; @@ -593,7 +593,7 @@ void CL_VideoStart(char *filename, const char *subtitlesfile) 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 ) { diff --git a/cl_video.h b/cl_video.h index e96e2a47..d3a4763a 100644 --- a/cl_video.h +++ b/cl_video.h @@ -67,7 +67,7 @@ typedef struct clvideo_s // 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; @@ -93,6 +93,6 @@ void CL_VideoStop( void ); // 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 diff --git a/cl_video_libavw.c b/cl_video_libavw.c index c3662213..96a71f50 100644 --- a/cl_video_libavw.c +++ b/cl_video_libavw.c @@ -355,7 +355,7 @@ static void libavw_message(int level, const char *message) Con_Printf(CON_ERROR "LibAvcodec panic: %s\n", message); } -qboolean LibAvW_OpenLibrary(void) +qbool LibAvW_OpenLibrary(void) { int errorcode; diff --git a/cl_video_libavw.h b/cl_video_libavw.h index 53006a96..07d42c54 100644 --- a/cl_video_libavw.h +++ b/cl_video_libavw.h @@ -3,5 +3,5 @@ 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 diff --git a/client.h b/client.h index a9a1eb36..1d124533 100644 --- a/client.h +++ b/client.h @@ -313,9 +313,9 @@ typedef struct rtlight_s /// 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; @@ -587,11 +587,11 @@ typedef struct entity_render_s 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!) @@ -618,7 +618,7 @@ typedef struct entity_persistent_s 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; @@ -663,14 +663,14 @@ typedef struct usercmd_s 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 @@ -752,9 +752,9 @@ typedef struct capturevideostate_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; @@ -830,12 +830,12 @@ typedef struct client_static_s // 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; @@ -850,12 +850,12 @@ typedef struct client_static_s 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; @@ -905,7 +905,7 @@ typedef struct client_static_s 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; @@ -952,9 +952,9 @@ extern client_static_t cls; //[515]: csqc typedef struct { - qboolean drawworld; - qboolean drawenginesbar; - qboolean drawcrosshair; + qbool drawworld; + qbool drawenginesbar; + qbool drawcrosshair; }csqc_vidvars_t; typedef enum @@ -981,7 +981,7 @@ typedef struct particletype_s { pblend_t blendmode; porientation_t orientation; - qboolean lighting; + qbool lighting; } particletype_t; @@ -1053,7 +1053,7 @@ cl_locnode_t; typedef struct showlmp_s { - qboolean isactive; + qbool isactive; float x; float y; char label[32]; @@ -1122,19 +1122,19 @@ typedef struct client_state_s // 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; @@ -1150,26 +1150,26 @@ typedef struct client_state_s // 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; @@ -1246,7 +1246,7 @@ typedef struct client_state_s 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 @@ -1342,10 +1342,10 @@ typedef struct client_state_s 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 @@ -1363,7 +1363,7 @@ typedef struct client_state_s // 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; @@ -1426,13 +1426,13 @@ typedef struct client_state_s // 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]; @@ -1581,7 +1581,7 @@ void CL_Effect(vec3_t org, dp_model_t *model, int startframe, int framecount, fl 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); @@ -1636,7 +1636,7 @@ void CL_Parse_DumpPacket(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 @@ -1679,7 +1679,7 @@ extern cvar_t cl_decals_fadetime; 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 { @@ -1726,8 +1726,8 @@ effectnameindex_t; 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); @@ -1738,7 +1738,7 @@ void R_NewExplosion(const vec3_t org); #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); @@ -1789,8 +1789,8 @@ typedef struct r_refdef_view_s 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]; @@ -1820,16 +1820,16 @@ typedef struct r_refdef_view_s 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; @@ -1861,7 +1861,7 @@ typedef struct r_refdef_viewcache_s 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; @@ -1869,7 +1869,7 @@ 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; @@ -1889,7 +1889,7 @@ typedef struct r_refdef_scene_s { entity_render_t *tempentities; int numtempentities; int maxtempentities; - qboolean expandtempentities; + qbool expandtempentities; // renderable dynamic lights rtlight_t *lights[MAX_DLIGHTS]; @@ -1909,10 +1909,10 @@ typedef struct r_refdef_scene_s { // 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 @@ -1942,7 +1942,7 @@ typedef struct r_refdef_s float fogplane[4]; float fogplaneviewdist; - qboolean fogplaneviewabove; + qbool fogplaneviewabove; float fogheightfade; float fogcolor[3]; float fogrange; @@ -1960,8 +1960,8 @@ typedef struct r_refdef_s 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 @@ -1975,7 +1975,7 @@ typedef struct r_refdef_s 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; @@ -2012,9 +2012,9 @@ typedef struct cl_clientmovement_state_s 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 @@ -2061,7 +2061,7 @@ void SCR_CaptureVideo_SoundFrame(const portable_sampleframe_t *paintbuffer, size 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); diff --git a/clvm_cmds.c b/clvm_cmds.c index 68080dea..9161ee61 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -1103,7 +1103,7 @@ static void VM_CL_R_AddDynamicLight (prvm_prog_t *prog) 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; @@ -1362,7 +1362,7 @@ static void VM_CL_boxparticles (prvm_prog_t *prog) 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); @@ -2386,7 +2386,7 @@ int CL_GetPitchSign(prvm_prog_t *prog, prvm_edict_t *ent) 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; @@ -2633,7 +2633,7 @@ static void VM_CL_gettaginfo (prvm_prog_t *prog) typedef struct vmparticletheme_s { unsigned short typeindex; - qboolean initialized; + qbool initialized; pblend_t blendmode; porientation_t orientation; int color1; @@ -2649,7 +2649,7 @@ typedef struct vmparticletheme_s float liquidfriction; float originjitter; float velocityjitter; - qboolean qualityreduction; + qbool qualityreduction; float lifetime; float stretch; int staincolor1; @@ -2667,8 +2667,8 @@ typedef struct vmparticletheme_s typedef struct vmparticlespawner_s { mempool_t *pool; - qboolean initialized; - qboolean verified; + qbool initialized; + qbool verified; vmparticletheme_t *themes; int max_themes; }vmparticlespawner_t; @@ -3248,7 +3248,7 @@ static void VM_CL_GetEntity (prvm_prog_t *prog) // --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); @@ -3291,7 +3291,7 @@ static void VM_CL_R_PolygonBegin (prvm_prog_t *prog) { const char *texname; int drawflags; - qboolean draw2d; + qbool draw2d; dp_model_t *mod; VM_SAFEPARMCOUNTRANGE(2, 3, VM_CL_R_PolygonBegin); @@ -3361,8 +3361,8 @@ static void VM_CL_R_PolygonVertex (prvm_prog_t *prog) 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; @@ -3429,7 +3429,7 @@ is not a staircase. ============= */ -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; @@ -3498,7 +3498,7 @@ The move will be adjusted for slopes and stairs, but if the move isn't 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; @@ -3628,7 +3628,7 @@ static void VM_CL_walkmove (prvm_prog_t *prog) vec3_t move; mfunction_t *oldf; int oldself; - qboolean settrace; + qbool settrace; VM_SAFEPARMCOUNTRANGE(2, 3, VM_CL_walkmove); @@ -4120,11 +4120,11 @@ static void VM_CL_V_CalcRefdef(prvm_prog_t *prog) 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; diff --git a/cmd.c b/cmd.c index 8637f488..6bb65872 100644 --- a/cmd.c +++ b/cmd.c @@ -43,7 +43,7 @@ static cmd_iter_t cmd_iter_all[] = { // we only run the +whatever commandline arguments once -qboolean host_stuffcmdsrun = false; +qbool host_stuffcmdsrun = false; //============================================================================= @@ -184,13 +184,13 @@ Parses Quake console command-line 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. @@ -288,7 +288,7 @@ static cmd_input_t *Cbuf_LinkGet(cbuf_t *cbuf, cmd_input_t *existing) 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; @@ -419,7 +419,7 @@ static void Cbuf_Execute_Deferred (cbuf_t *cbuf) 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; @@ -569,7 +569,7 @@ static void Cmd_Exec(cmd_state_t *cmd, const char *filename) { char *f; size_t filenameLen = strlen(filename); - qboolean isdefaultcfg = + qbool isdefaultcfg = !strcmp(filename, "default.cfg") || (filenameLen >= 12 && !strcmp(filename + filenameLen - 12, "/default.cfg")); @@ -1074,7 +1074,7 @@ static void Cmd_UnAlias_f (cmd_state_t *cmd) ============================================================================= */ -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; @@ -1141,11 +1141,11 @@ static const char *Cmd_GetDirectCvarValue(cmd_state_t *cmd, const char *varname, 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) { @@ -1206,8 +1206,8 @@ static const char *Cmd_GetCvarValue(cmd_state_t *cmd, const char *var, size_t va 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) @@ -1261,7 +1261,7 @@ static const char *Cmd_GetCvarValue(cmd_state_t *cmd, const char *var, size_t va 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) @@ -1316,7 +1316,7 @@ Cmd_PreprocessString 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; @@ -1449,7 +1449,7 @@ static void Cmd_ExecuteAlias (cmd_state_t *cmd, cmd_alias_t *alias) { 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 @@ -1477,7 +1477,7 @@ static void Cmd_List_f (cmd_state_t *cmd) const char *partial; size_t len; int count; - qboolean ispattern; + qbool ispattern; if (Cmd_Argc(cmd) > 1) { @@ -1526,7 +1526,7 @@ static void Cmd_Apropos_f(cmd_state_t *cmd) cmd_alias_t *alias; const char *partial; int count; - qboolean ispattern; + qbool ispattern; char vabuf[1024]; if (Cmd_Argc(cmd) > 1) @@ -1803,7 +1803,7 @@ void Cmd_AddCommand(int flags, const char *cmd_name, xcommand_t function, const 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++) @@ -1899,7 +1899,7 @@ next: } } -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)); @@ -1907,7 +1907,7 @@ static int Cmd_Compare(const char *s1, const char *s2, size_t len, qboolean case 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; @@ -1928,7 +1928,7 @@ cmd_function_t *Cmd_GetCommand(cmd_state_t *cmd, const char *partial, size_t len 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; @@ -2149,7 +2149,7 @@ A complete command line has been parsed, so try to execute it 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; diff --git a/cmd.h b/cmd.h index adf83b2b..0b8c3d7d 100644 --- a/cmd.h +++ b/cmd.h @@ -66,7 +66,7 @@ typedef struct cmd_alias_s 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; @@ -77,9 +77,9 @@ typedef struct cmd_function_s 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 @@ -141,7 +141,7 @@ typedef struct cmd_input_s double delay; size_t size; char text[MAX_INPUTLINE]; - qboolean pending; + qbool pending; } cmd_input_t; typedef struct cbuf_s @@ -149,7 +149,7 @@ 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]; @@ -171,7 +171,7 @@ extern cmd_state_t cmd_server; // 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); @@ -222,10 +222,10 @@ void Cmd_AddCommand(int flags, const char *cmd_name, xcommand_t function, const // 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 @@ -266,7 +266,7 @@ int Cmd_CheckParm (cmd_state_t *cmd, const char *parm); /// 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 @@ -274,7 +274,7 @@ void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qb /// "\"\\$"). 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); diff --git a/collision.c b/collision.c index 4f90e33f..2244760f 100644 --- a/collision.c +++ b/collision.c @@ -907,7 +907,7 @@ void Collision_TraceLineBrushFloat(trace_t *trace, const vec3_t linestart, const } } -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; @@ -1457,7 +1457,7 @@ collision_cachedtrace_parameters_t; typedef struct collision_cachedtrace_s { - qboolean valid; + qbool valid; collision_cachedtrace_parameters_t p; trace_t result; } @@ -1475,9 +1475,9 @@ static unsigned int *collision_cachedtrace_arrayfullhashindex; 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); @@ -1841,7 +1841,7 @@ void Collision_ClipToWorld(trace_t *trace, dp_model_t *model, const vec3_t tstar 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; @@ -1867,7 +1867,7 @@ void Collision_ClipLineToGenericEntity(trace_t *trace, dp_model_t *model, const 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); @@ -1911,7 +1911,7 @@ void Collision_ClipPointToWorld(trace_t *trace, dp_model_t *model, const vec3_t 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) diff --git a/collision.h b/collision.h index 9984a166..fd693375 100644 --- a/collision.h +++ b/collision.h @@ -71,7 +71,7 @@ void Collision_Init(void); 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); @@ -143,7 +143,7 @@ void Collision_TraceBrushTriangleMeshFloat(trace_t *trace, const colbrushf_t *th 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); @@ -168,11 +168,11 @@ void Collision_TraceBrushTriangleFloat(trace_t *trace, const colbrushf_t *thisbr 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); @@ -180,7 +180,7 @@ void Collision_Cache_ClipLineToWorldSurfaces(trace_t *trace, dp_model_t *model, // 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: diff --git a/com_list.c b/com_list.c index a28a83da..5f8d178d 100644 --- a/com_list.c +++ b/com_list.c @@ -203,17 +203,17 @@ void List_Splice_Tail(const llist_t *list, llist_t *head) __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 diff --git a/com_list.h b/com_list.h index 8ba08dc5..8da053c3 100644 --- a/com_list.h +++ b/com_list.h @@ -51,6 +51,6 @@ void List_Rotate_Left(llist_t *head); 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 diff --git a/common.c b/common.c index 72713840..931db1c6 100644 --- a/common.c +++ b/common.c @@ -180,7 +180,7 @@ int COM_Wordwrap(const char *string, size_t length, float continuationWidth, flo // 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; @@ -258,7 +258,7 @@ int COM_Wordwrap(const char *string, size_t length, float continuationWidth, flo return result; /* - qboolean isContinuation = false; + qbool isContinuation = false; float currentWordSpace = 0; const char *currentWord = 0; float minReserve = 0; @@ -457,7 +457,7 @@ COM_ParseToken_Simple 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; @@ -570,7 +570,7 @@ COM_ParseToken_QuakeC 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; @@ -684,7 +684,7 @@ COM_ParseToken_VM_Tokenize 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; @@ -1163,7 +1163,7 @@ all characters until the zero terminator. ============ */ 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; @@ -1236,8 +1236,8 @@ For size_in, specify the maximum number of characters from in to use, or 0 to us 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; diff --git a/common.h b/common.h index b38f830d..d11b141c 100644 --- a/common.h +++ b/common.h @@ -42,13 +42,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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); @@ -195,14 +195,14 @@ float MSG_ReadAngle (sizebuf_t *sb, protocolversion_t protocol); //============================================================================ 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); @@ -321,8 +321,8 @@ int COM_StringBeginsWith(const char *s, const char *match); 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); @@ -335,11 +335,11 @@ typedef struct stringlist_s } 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); diff --git a/console.c b/console.c index 44560dd6..761e390f 100644 --- a/console.c +++ b/console.c @@ -97,14 +97,14 @@ cvar_t rcon_address = {CVAR_CLIENT, "rcon_address", "", "server address to send 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 @@ -431,7 +431,7 @@ static void Log_DestBuffer_Flush_NoLock(void) 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; @@ -584,7 +584,7 @@ Log_ConPrint */ 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) @@ -998,7 +998,7 @@ static void Con_PrintToHistory(const char *txt, int mask) } } -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; @@ -1153,7 +1153,7 @@ Con_MaskPrint */ 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; @@ -1524,7 +1524,7 @@ The input line scrolls horizontally if typing goes beyond the right edge 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 @@ -1672,7 +1672,7 @@ static float Con_WordWidthFunc(void *passthrough, const char *w, size_t *length, } } -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; @@ -1682,7 +1682,7 @@ static int Con_CountLineFunc(void *passthrough, const char *line, size_t length, 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; @@ -2115,7 +2115,7 @@ its format (q1/q2/q3/hl) and even its message //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]; @@ -2370,7 +2370,7 @@ static int Nicks_strncasecmp(char *a, char *b, unsigned int a_len) // 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)) { @@ -2405,7 +2405,7 @@ static int Nicks_strncasecmp(char *a, char *b, unsigned int a_len) 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; @@ -2663,7 +2663,7 @@ static const char **Nicks_CompleteBuildList(int count) */ 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; @@ -2733,7 +2733,7 @@ static int Nicks_AddLastColor(char *buffer, int pos) 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; diff --git a/console.h b/console.h index 079b538d..9279b1c9 100644 --- a/console.h +++ b/console.h @@ -26,9 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // 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); @@ -63,13 +63,13 @@ void Con_DrawNotify (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 @@ -112,7 +112,7 @@ con_lineinfo_t; typedef struct conbuffer_s { - qboolean active; + qbool active; int textsize; char *text; int maxlines; diff --git a/crypto.c b/crypto.c index 4589741a..7d09966a 100644 --- a/crypto.c +++ b/crypto.c @@ -259,7 +259,7 @@ static dllfunction_t d0_blind_id_funcs[] = // 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 [] = { @@ -328,7 +328,7 @@ static dllfunction_t d0_rijndael_funcs[] = // 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 [] = { @@ -364,7 +364,7 @@ void sha256(unsigned char *out, const unsigned char *in, int n) 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; @@ -382,7 +382,7 @@ static size_t Crypto_LoadFile(const char *path, char *buf, size_t nmax, qboolean 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); @@ -445,7 +445,7 @@ static d0_blind_id_t *Crypto_ReadPublicKey(char *buf, size_t len) } // 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]; @@ -460,8 +460,8 @@ static qboolean Crypto_AddPrivateKey(d0_blind_id_t *pk, char *buf, size_t len) #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; @@ -493,8 +493,8 @@ typedef struct 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; @@ -504,7 +504,7 @@ 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; @@ -534,7 +534,7 @@ static crypto_t *Crypto_ServerFindInstance(lhnetaddress_t *peeraddress, qboolean 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) @@ -562,7 +562,7 @@ typedef struct crypto_storedhostkey_s 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]; @@ -589,12 +589,12 @@ static void Crypto_ClearHostKeys(void) } } -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; @@ -611,7 +611,7 @@ static qboolean Crypto_ClearHostKey(lhnetaddress_t *peeraddress) 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; @@ -619,7 +619,7 @@ static void Crypto_StoreHostKey(lhnetaddress_t *peeraddress, const char *keystri int keyid; char idfp[FP64_SIZE+1]; int aeslevel; - qboolean issigned; + qbool issigned; if(!d0_blind_id_dll) return; @@ -639,7 +639,7 @@ static void Crypto_StoreHostKey(lhnetaddress_t *peeraddress, const char *keystri { // id@key const char *idstart, *idend, *keystart, *keyend; - qboolean thisissigned = true; + qbool thisissigned = true; ++keystring; // skip the space idstart = keystring; while(*keystring && *keystring != ' ' && *keystring != '@') @@ -710,7 +710,7 @@ static void Crypto_StoreHostKey(lhnetaddress_t *peeraddress, const char *keystri 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; @@ -739,7 +739,7 @@ qboolean Crypto_RetrieveHostKey(lhnetaddress_t *peeraddress, int *keyid, char *k 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; @@ -790,7 +790,7 @@ static void Crypto_BuildChallengeAppend(void) challenge_append_length = p - challenge_append; } -static qboolean Crypto_SavePubKeyTextFile(int i) +static qbool Crypto_SavePubKeyTextFile(int i) { qfile_t *f; char vabuf[1024]; @@ -1073,7 +1073,7 @@ void Crypto_Init(void) } // end -qboolean Crypto_Available(void) +qbool Crypto_Available(void) { if(!d0_blind_id_dll) return false; @@ -1672,7 +1672,7 @@ const char *Crypto_GetInfoResponseDataString(void) } // 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) @@ -2020,8 +2020,8 @@ int Crypto_ServerParsePacket(const char *data_in, size_t len_in, char *data_out, 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)) @@ -2186,10 +2186,10 @@ int Crypto_ClientParsePacket(const char *data_in, size_t len_in, char *data_out, 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)) diff --git a/crypto.h b/crypto.h index 0a2d4869..80eea7a2 100644 --- a/crypto.h +++ b/crypto.h @@ -21,12 +21,12 @@ typedef struct 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; @@ -35,7 +35,7 @@ void Crypto_Init(void); 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); @@ -48,15 +48,15 @@ int Crypto_ServerParsePacket(const char *data_in, size_t len_in, char *data_out, // 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); diff --git a/csprogs.c b/csprogs.c index 97118eb2..1c54c5e4 100644 --- a/csprogs.c +++ b/csprogs.c @@ -286,7 +286,7 @@ void CSQC_Think (prvm_edict_t *ed) } 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; @@ -434,10 +434,10 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum) // 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; @@ -461,7 +461,7 @@ CSQC_END 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; @@ -502,11 +502,11 @@ qboolean CL_VM_UpdateView (double frametime) 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 @@ -524,11 +524,11 @@ qboolean CL_VM_ConsoleCommand (const char *text) 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 @@ -708,10 +708,10 @@ void CL_VM_UpdateShowingScoresState (int showingscores) 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 @@ -923,14 +923,14 @@ static void CLVM_count_edicts(prvm_prog_t *prog) 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); @@ -1168,13 +1168,13 @@ CSQC_END 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; @@ -1196,10 +1196,10 @@ qboolean CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out) 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; diff --git a/csprogs.h b/csprogs.h index a8420e85..4b2fc486 100644 --- a/csprogs.h +++ b/csprogs.h @@ -80,27 +80,27 @@ extern cvar_t csqc_polygons_defaultmaterial_nocullface; 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); @@ -110,7 +110,7 @@ void CSQC_RelinkAllEntities(int drawmask); 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); diff --git a/curves.c b/curves.c index 58ce43d0..154450de 100644 --- a/curves.c +++ b/curves.c @@ -277,7 +277,7 @@ static int FindEqualOddVertexInArray(int numcomponents, float *vertex, float *ve { for (x=0; x 0.05) // div0: this is notably smaller than the smallest radiant grid @@ -337,7 +337,7 @@ int Q3PatchAdjustTesselation(int numcomponents, patchinfo_t *patch1, float *patc 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; diff --git a/cvar.c b/cvar.c index 1b7bc874..c3883afb 100644 --- a/cvar.c +++ b/cvar.c @@ -266,7 +266,7 @@ const char **Cvar_CompleteBuildList(cvar_state_t *cvars, const char *partial, in 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)) @@ -299,7 +299,7 @@ void Cvar_CompleteCvarPrint(cvar_state_t *cvars, const char *partial, int needed } // 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; @@ -373,7 +373,7 @@ Cvar_Set 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; @@ -717,7 +717,7 @@ cvar_t *Cvar_Get(cvar_state_t *cvars, const char *name, const char *value, int f 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) { @@ -737,7 +737,7 @@ Cvar_Command 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; @@ -967,7 +967,7 @@ void Cvar_List_f(cmd_state_t *cmd) cvar_t *cvar; const char *partial; int count; - qboolean ispattern; + qbool ispattern; char vabuf[1024]; if (Cmd_Argc(cmd) > 1) @@ -1123,7 +1123,7 @@ void Cvar_FillAll_f(cmd_state_t *cmd) 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)); diff --git a/cvar.h b/cvar.h index 186d1677..9d0eb032 100644 --- a/cvar.h +++ b/cvar.h @@ -95,13 +95,13 @@ typedef struct cvar_s 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; @@ -140,7 +140,7 @@ void Cvar_RegisterCallback(cvar_t *variable, void (*callback)(cvar_t *)); /// 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 " " typed at the console void Cvar_Set (cvar_state_t *cvars, const char *var_name, const char *value); @@ -174,11 +174,11 @@ const char *Cvar_CompleteVariable (cvar_state_t *cvars, const char *partial, int // 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) diff --git a/draw.h b/draw.h index abc520da..e1d4eaae 100644 --- a/draw.h +++ b/draw.h @@ -157,12 +157,12 @@ void DrawQ_Fill(float x, float y, float width, float height, float red, float gr // 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 @@ -175,7 +175,7 @@ void DrawQ_Line(float width, float x1, float y1, float x2, float y2, float r, fl 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 diff --git a/filematch.c b/filematch.c index b95951d7..47aeb35e 100644 --- a/filematch.c +++ b/filematch.c @@ -16,7 +16,7 @@ int matchpattern(const char *in, const char *pattern, int caseinsensitive) // 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) @@ -122,7 +122,7 @@ static int stringlistsort_cmp(const void *a, const void *b) 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) diff --git a/fs.c b/fs.c index 18c79c18..3fc3d2a3 100644 --- a/fs.c +++ b/fs.c @@ -320,7 +320,7 @@ typedef struct pack_s filedesc_t handle; int ignorecase; ///< PK3 ignores case int numfiles; - qboolean vpack; + qbool vpack; packfile_t *files; } pack_t; //@} @@ -347,7 +347,7 @@ void FS_Dir_f(cmd_state_t *cmd); 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); @@ -507,7 +507,7 @@ PK3_OpenLibrary Try to load the Zlib DLL ==================== */ -static qboolean PK3_OpenLibrary (void) +static qbool PK3_OpenLibrary (void) { #ifdef LINK_TO_ZLIB return true; @@ -546,7 +546,7 @@ FS_HasZlib See if zlib is available ==================== */ -qboolean FS_HasZlib(void) +qbool FS_HasZlib(void) { #ifdef LINK_TO_ZLIB return true; @@ -563,7 +563,7 @@ PK3_GetEndOfCentralDir 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; @@ -762,7 +762,7 @@ FS_LoadPackPK3 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; @@ -816,7 +816,7 @@ static pack_t *FS_LoadPackPK3FromFD (const char *packfile, filedesc_t packhandle 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; @@ -834,7 +834,7 @@ PK3_GetTrueFileOffset 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; @@ -1118,7 +1118,7 @@ FS_AddPack_Fullpath * 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; @@ -1232,7 +1232,7 @@ FS_AddPack * 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; @@ -1416,8 +1416,8 @@ FS_Rescan 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]; @@ -1523,8 +1523,8 @@ static void FS_Rescan_f(cmd_state_t *cmd) 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; @@ -1632,7 +1632,7 @@ static void FS_GameDir_f(cmd_state_t *cmd) 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; @@ -2227,12 +2227,12 @@ void FS_Shutdown (void) 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]) @@ -2310,7 +2310,7 @@ static filedesc_t FS_SysOpenFiledesc(const char *filepath, const char *mode, qbo 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; @@ -2326,7 +2326,7 @@ FS_SysOpen 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; @@ -2460,7 +2460,7 @@ Return true if the path should be rejected due to one of the following: 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]) @@ -2518,7 +2518,7 @@ Return the searchpath where the file was found (or NULL) 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; @@ -2607,7 +2607,7 @@ FS_OpenReadFile 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; @@ -2722,7 +2722,7 @@ Open a file in the userpath. The syntax is the same as fopen 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]; @@ -2749,7 +2749,7 @@ FS_OpenVirtualFile 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)) @@ -2772,7 +2772,7 @@ FS_FileFromData 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)); @@ -3324,7 +3324,7 @@ Loads full content of a qfile_t and closes it. 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; @@ -3361,7 +3361,7 @@ Filename are relative to the quake directory. 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); @@ -3376,7 +3376,7 @@ Filename are OS paths. 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); @@ -3390,7 +3390,7 @@ FS_WriteFile 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; @@ -3413,7 +3413,7 @@ qboolean FS_WriteFileInBlocks (const char *filename, const void *const *data, co 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); } @@ -3512,7 +3512,7 @@ FS_FileExists 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); } @@ -3558,7 +3558,7 @@ int FS_SysFileType (const char *path) #endif } -qboolean FS_SysFileExists (const char *path) +qbool FS_SysFileExists (const char *path) { return FS_SysFileType (path) != FS_FILETYPE_NONE; } @@ -3926,7 +3926,7 @@ Look for a proof of purchase file file in the requested package 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; diff --git a/fs.h b/fs.h index e466d990..aefa5b59 100644 --- a/fs.h +++ b/fs.h @@ -56,14 +56,14 @@ extern char fs_gamedirs[MAX_GAMEDIRS][MAX_QPATH]; // 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); @@ -79,7 +79,7 @@ fs_offset_t FS_FileSize (qfile_t* file); 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 @@ -93,8 +93,8 @@ gamedir_t; 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); @@ -110,10 +110,10 @@ fssearch_t; 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 ------ // @@ -127,13 +127,13 @@ void FS_DefaultExtension (char *path, const char *extension, size_t size_path); 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); diff --git a/ft2.c b/ft2.c index d4f9e07a..dbddec7a 100644 --- a/ft2.c +++ b/ft2.c @@ -246,7 +246,7 @@ typedef struct fontfilecache_s 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; @@ -339,7 +339,7 @@ Font_OpenLibrary Try to load the FreeType2 DLL ==================== */ -qboolean Font_OpenLibrary (void) +qbool Font_OpenLibrary (void) { #ifndef DP_FREETYPE_STATIC const char* dllnames [] = @@ -454,7 +454,7 @@ ft2_font_t *Font_Alloc(void) 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; @@ -495,9 +495,9 @@ float Font_SnapTo(float val, float snapwidth) 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; @@ -604,7 +604,7 @@ qboolean Font_LoadFont(const char *name, dp_font_t *dpfnt) 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]; @@ -713,8 +713,8 @@ static void Font_Postprocess_Update(ft2_font_t *fnt, int bpp, int w, int h) { 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; @@ -886,8 +886,8 @@ static void Font_Postprocess(ft2_font_t *fnt, unsigned char *imagedata, int pitc } 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; @@ -1034,7 +1034,7 @@ ft2_font_map_t *Font_MapForIndex(ft2_font_t *font, int index) 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 @@ -1060,7 +1060,7 @@ static qboolean Font_SetSize(ft2_font_t *font, float w, float h) 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) @@ -1118,7 +1118,7 @@ qboolean Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h } } -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); } @@ -1200,7 +1200,7 @@ 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 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; @@ -1659,7 +1659,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _ 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; diff --git a/ft2.h b/ft2.h index aa203be5..2104a8c4 100644 --- a/ft2.h +++ b/ft2.h @@ -37,13 +37,13 @@ typedef struct ft2_kerning_s 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. @@ -67,7 +67,7 @@ typedef struct ft2_font_s 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 @@ -75,9 +75,9 @@ void Font_UnloadFont(ft2_font_t *font); // 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_* diff --git a/ft2_fontdefs.h b/ft2_fontdefs.h index 3f08187d..8cdc9e1d 100644 --- a/ft2_fontdefs.h +++ b/ft2_fontdefs.h @@ -9,7 +9,7 @@ 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] @@ -35,7 +35,7 @@ struct ft2_font_map_s 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 @@ -54,8 +54,8 @@ struct ft2_attachment_s 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); diff --git a/gl_backend.c b/gl_backend.c index f5317e01..8211740a 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -14,7 +14,7 @@ cvar_t r_waterwarp = {CVAR_CLIENT | CVAR_SAVE, "r_waterwarp", "1", "warp view wh 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; @@ -24,7 +24,7 @@ matrix4x4_t gl_projectionmatrix; matrix4x4_t gl_modelviewprojectionmatrix; float gl_modelview16f[16]; float gl_modelviewprojection16f[16]; -qboolean gl_modelmatrixchanged; +qbool gl_modelmatrixchanged; #ifdef DEBUGGL int gl_errornumber = 0; @@ -135,14 +135,14 @@ typedef struct gl_state_s 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]; @@ -154,7 +154,7 @@ typedef struct gl_state_s 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; @@ -179,7 +179,7 @@ typedef struct gl_state_s memexpandablearray_t meshbufferarray; - qboolean active; + qbool active; } gl_state_t; @@ -379,7 +379,7 @@ void gl_backend_init(void) 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) { @@ -428,7 +428,7 @@ static int bboxedges[12][2] = {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; @@ -1166,7 +1166,7 @@ void GL_BlendFunc(int blendfunc1, int blendfunc2) { 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); @@ -1276,7 +1276,7 @@ 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) { switch (vid.renderpath) { @@ -1316,7 +1316,7 @@ void GL_PolygonOffset(float planeoffset, float depthoffset) } } -void GL_SetMirrorState(qboolean state) +void GL_SetMirrorState(qbool state) { if (v_flipped_state != state) { @@ -1379,7 +1379,7 @@ void GL_CullFace(int state) } } -void GL_AlphaToCoverage(qboolean state) +void GL_AlphaToCoverage(qbool state) { if (gl_state.alphatocoverage != state) { @@ -1560,7 +1560,7 @@ void R_Mesh_Start(void) } } -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; @@ -1763,7 +1763,7 @@ void R_Mesh_Finish(void) 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); @@ -1780,7 +1780,7 @@ r_meshbuffer_t *R_Mesh_CreateMeshBuffer(const void *data, size_t size, const cha 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; @@ -1853,7 +1853,7 @@ void R_Mesh_DestroyMeshBuffer(r_meshbuffer_t *buffer) } 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; @@ -2204,7 +2204,7 @@ void R_Mesh_PrepareVertices_Mesh_Arrays(int numvertices, const float *vertex3f, 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) diff --git a/gl_backend.h b/gl_backend.h index d12ab1c6..c015aeb2 100644 --- a/gl_backend.h +++ b/gl_backend.h @@ -10,7 +10,7 @@ extern matrix4x4_t gl_projectionmatrix; 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]; @@ -20,7 +20,7 @@ extern int quadelement3i[QUADELEMENTS_MAXQUADS*6]; 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); @@ -32,15 +32,15 @@ void R_GetViewport(r_viewport_t *v); 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); @@ -71,10 +71,10 @@ void R_Mesh_Finish(void); // 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); @@ -103,9 +103,9 @@ void R_Mesh_ClearBindingsForTexture(int texnum); 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 diff --git a/gl_draw.c b/gl_draw.c index fd4eef5d..a4c2d72a 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -206,7 +206,7 @@ int Draw_GetPicHeight(cachepic_t *pic) return pic->height; } -qboolean Draw_IsPicLoaded(cachepic_t *pic) +qbool Draw_IsPicLoaded(cachepic_t *pic) { if (pic == NULL) return false; @@ -325,7 +325,7 @@ void Draw_FreePic(const char *picname) 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; @@ -475,7 +475,7 @@ void LoadFont(qboolean override, const char *name, dp_font_t *fnt, float scale, } 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; @@ -778,7 +778,7 @@ void DrawQ_Start(void) 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) { @@ -865,7 +865,7 @@ static const vec4_t string_colors[] = #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; @@ -910,7 +910,7 @@ static int RGBstring_to_colorindex(const char *str) } // 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; @@ -926,8 +926,8 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max //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; @@ -1075,7 +1075,7 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max } 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; @@ -1090,7 +1090,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma 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; @@ -1322,22 +1322,22 @@ out: 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); } @@ -1345,7 +1345,7 @@ float DrawQ_TextWidth_UntilWidth(const char *text, size_t *maxlen, float w, floa #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; diff --git a/gl_rmain.c b/gl_rmain.c index 6a69bdd6..f488bf49 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -44,12 +44,12 @@ rtexturepool_t *r_main_texturepool; 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 @@ -258,7 +258,7 @@ cvar_t r_buffermegs[R_BUFFERDATA_COUNT] = extern cvar_t v_glslgamma_2d; -extern qboolean v_flipped_state; +extern qbool v_flipped_state; r_framebufferstate_t r_fb; @@ -690,7 +690,7 @@ typedef struct r_glsl_permutation_s 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 @@ -853,9 +853,9 @@ static int shaderstaticparms_count = 0; 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)); @@ -997,7 +997,7 @@ static void R_InitShaderModeInfo(void) } } -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 @@ -1451,7 +1451,7 @@ static void R_GLSL_DumpShader_f(cmd_state_t *cmd) } } -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) @@ -1478,12 +1478,12 @@ void R_SetupShader_Generic(rtexture_t *t, qboolean usegamma, qboolean 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) @@ -1553,7 +1553,7 @@ static int R_BlendFuncFlags(int src, int dst) 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 @@ -2230,7 +2230,7 @@ skinframe_t *R_SkinFrame_FindNextByName( skinframe_t *last, const char *name ) { 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; @@ -2304,7 +2304,7 @@ skinframe_t *R_SkinFrame_Find(const char *name, int textureflags, int comparewid 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; @@ -2321,7 +2321,7 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole } 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; @@ -2330,7 +2330,7 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch 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); @@ -2536,7 +2536,7 @@ skinframe_t *R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const ch 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; @@ -2666,7 +2666,7 @@ skinframe_t *R_SkinFrame_LoadInternalQuake(const char *name, int textureflags, i 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; @@ -2830,7 +2830,7 @@ skinframe_t *R_SkinFrame_LoadNoTexture(void) 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) @@ -2865,7 +2865,7 @@ skinframe_t *R_SkinFrame_LoadInternalUsingTexture(const char *name, int texturef typedef struct suffixinfo_s { const char *suffix; - qboolean flipx, flipy, flipdiagonal; + qbool flipx, flipy, flipdiagonal; } suffixinfo_t; static suffixinfo_t suffix[3][6] = @@ -3563,7 +3563,7 @@ void R_FrameData_Reset(void) } } -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); @@ -3696,7 +3696,7 @@ void R_BufferData_Reset(void) } // 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; @@ -3849,7 +3849,7 @@ void R_AnimCache_ClearCache(void) } } -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; @@ -3948,7 +3948,7 @@ void R_AnimCache_CacheVisibleEntities(void) //================================================================================== -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; @@ -4452,7 +4452,7 @@ static void R_View_Update(void) 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]; @@ -4586,7 +4586,7 @@ void R_RenderView_UpdateViewVectors(void) 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 @@ -4627,7 +4627,7 @@ static void R_CalcTexCoordsForView(float x, float y, float w, float h, float tw, 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; @@ -5622,7 +5622,7 @@ R_GetScenePointer */ 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 { @@ -5849,11 +5849,11 @@ extern cvar_t cl_locs_show; 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"); @@ -6442,7 +6442,7 @@ void R_Mesh_AddBrushMeshFromPlanes(rmesh_t *mesh, int numplanes, mplane_t *plane } } -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; @@ -6966,7 +6966,7 @@ texture_t *R_GetCurrentTexture(texture_t *t) 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))) @@ -7191,7 +7191,7 @@ void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, q 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) { @@ -7450,8 +7450,8 @@ void RSurf_PrepareVerticesForBatch(int batchneed, int texturenumsurfaces, const 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]; @@ -8589,7 +8589,7 @@ static int RSurf_FindWaterPlaneForSurface(const msurface_t *surface) 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++) { @@ -8731,7 +8731,7 @@ static void R_DrawTextureSurfaceList_Sky(int texturenumsurfaces, const msurface_ 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; @@ -8791,7 +8791,7 @@ static void R_DrawTextureSurfaceList_GL20(int texturenumsurfaces, const msurface 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; @@ -8823,7 +8823,7 @@ static void R_DrawTextureSurfaceList_ShowSurfaces(int texturenumsurfaces, const 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(); @@ -8854,7 +8854,7 @@ static void R_DrawSurface_TransparentCallback(const entity_render_t *ent, const if (r_transparentdepthmasking.integer) { - qboolean setup = false; + qbool setup = false; for (i = 0;i < numsurfaces;i = j) { j = i + 1; @@ -8969,7 +8969,7 @@ static void R_DrawTextureSurfaceList_DepthOnly(int texturenumsurfaces, const msu 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) @@ -9003,7 +9003,7 @@ static void R_ProcessModelTextureSurfaceList(int texturenumsurfaces, const msurf 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; @@ -9142,7 +9142,7 @@ static void R_DecalSystem_SpawnTriangle(decalsystem_t *decalsystem, const float 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))); @@ -9212,7 +9212,7 @@ extern cvar_t cl_decals_bias; 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; @@ -9309,7 +9309,7 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor { matrix4x4_t projection; decalsystem_t *decalsystem; - qboolean dynamic; + qbool dynamic; dp_model_t *model; const msurface_t *surface; const msurface_t *surfaces; @@ -9826,7 +9826,7 @@ static void R_DrawDebugModel(void) { 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; @@ -9992,7 +9992,7 @@ static void R_DrawDebugModel(void) 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; @@ -10155,7 +10155,7 @@ void R_DebugLine(vec3_t start, vec3_t end) } -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; @@ -10175,7 +10175,7 @@ void R_DrawCustomSurface(skinframe_t *skinframe, const matrix4x4_t *texmatrix, i 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; diff --git a/gl_rsurf.c b/gl_rsurf.c index f7e070aa..413efdab 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -346,7 +346,7 @@ static void R_DrawPortal_Callback(const entity_render_t *ent, const rtlight_t *r // 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]; @@ -437,7 +437,7 @@ static void R_View_WorldVisibility_CullSurfaces(void) } } -void R_View_WorldVisibility(qboolean forcenovis) +void R_View_WorldVisibility(qbool forcenovis) { int i, j, *mark; mleaf_t *leaf; @@ -704,10 +704,10 @@ typedef struct r_q1bsp_getlightinfo_s 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; } @@ -715,7 +715,7 @@ r_q1bsp_getlightinfo_t; #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]; @@ -733,17 +733,17 @@ static void R_Q1BSP_RecursiveGetLightInfo_BSP(r_q1bsp_getlightinfo_t *info, qboo 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]; @@ -989,9 +989,9 @@ static void R_Q1BSP_RecursiveGetLightInfo_BIH(r_q1bsp_getlightinfo_t *info, cons 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]; @@ -1109,7 +1109,7 @@ static void R_Q1BSP_RecursiveGetLightInfo_BIH(r_q1bsp_getlightinfo_t *info, cons } } -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) @@ -1211,7 +1211,7 @@ static int R_Q1BSP_GetLightInfo_comparefunc(const void *ap, const void *bp) 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; @@ -1404,7 +1404,7 @@ static void R_Q1BSP_DrawLight_TransparentCallback(const entity_render_t *ent, co 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; diff --git a/gl_textures.c b/gl_textures.c index eef12da9..e806c438 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -32,7 +32,7 @@ cvar_t r_texture_dds_load_alphamode = {CVAR_CLIENT, "r_texture_dds_load_alphamod 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; @@ -163,8 +163,8 @@ typedef struct gltexture_s // 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] @@ -174,7 +174,7 @@ typedef struct gltexture_s // 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; @@ -560,7 +560,7 @@ static int R_CalcTexelDataSize (gltexture_t *glt) 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; @@ -736,7 +736,7 @@ void R_Textures_Frame (void) { #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 @@ -1112,7 +1112,7 @@ static rtexture_t *R_SetupTexture(rtexturepool_t *rtexturepool, const char *iden 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; @@ -1162,7 +1162,7 @@ static rtexture_t *R_SetupTexture(rtexturepool_t *rtexturepool, const char *iden // 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; @@ -1342,7 +1342,7 @@ rtexture_t *R_LoadTextureCubeMap(rtexturepool_t *rtexturepool, const char *ident 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); } @@ -1406,7 +1406,7 @@ rtexture_t *R_LoadTextureRenderBuffer(rtexturepool_t *rtexturepool, const char * 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 @@ -1544,7 +1544,7 @@ int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipunco #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; @@ -1563,7 +1563,7 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen 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]; diff --git a/hmac.c b/hmac.c index e740632d..83f062b9 100644 --- a/hmac.c +++ b/hmac.c @@ -1,7 +1,7 @@ #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, diff --git a/hmac.h b/hmac.h index 44939002..76ed6558 100644 --- a/hmac.h +++ b/hmac.h @@ -2,7 +2,7 @@ #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, diff --git a/host.c b/host.c index 55b0c5f3..52d23cf1 100644 --- a/host.c +++ b/host.c @@ -93,7 +93,7 @@ void Host_Error (const char *error, ...) { 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 @@ -520,7 +520,7 @@ void Host_Main(void) //============================================================================ -qboolean vid_opened = false; +qbool vid_opened = false; void Host_StartVideo(void) { if (!vid_opened && cls.state != ca_dedicated) @@ -537,10 +537,10 @@ void Host_StartVideo(void) 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; @@ -806,7 +806,7 @@ to run quit through here before the final handoff to the sys code. */ void Host_Shutdown(void) { - static qboolean isdown = false; + static qbool isdown = false; if (isdown) { diff --git a/image.c b/image.c index a4e97d14..f0243e5b 100644 --- a/image.c +++ b/image.c @@ -21,7 +21,7 @@ static void Image_CopyAlphaFromBlueBGRA(unsigned char *outpixels, const unsigned #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; @@ -70,7 +70,7 @@ void Image_CopyMux(unsigned char *outpixels, const unsigned char *inpixels, int } #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; @@ -283,7 +283,7 @@ static unsigned char* LoadPCX_BGRA (const unsigned char *f, int filesize, int *m 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; @@ -362,7 +362,7 @@ qboolean LoadPCX_QWSkin(const unsigned char *f, int filesize, unsigned char *pix 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; @@ -797,7 +797,7 @@ static unsigned char *LoadWAL_BGRA (const unsigned char *f, int filesize, int *m 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; @@ -1077,7 +1077,7 @@ imageformat_t imageformats_other[] = }; 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; @@ -1228,7 +1228,7 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo 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; @@ -1277,7 +1277,7 @@ qboolean Image_GetStockPicSize(const char *filename, int *returnwidth, int *retu } 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; @@ -1444,9 +1444,9 @@ void Image_FixTransparentPixels_f(cmd_state_t *cmd) 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]; @@ -1468,12 +1468,12 @@ qboolean Image_WriteTGABGR_preflipped (const char *filename, int width, int heig 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); diff --git a/image.h b/image.h index 5b5cbdaa..98173984 100644 --- a/image.h +++ b/image.h @@ -10,7 +10,7 @@ unsigned char *Image_GenerateNoTexture(void); // (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); @@ -24,28 +24,28 @@ void Image_StripImageExtension (const char *in, char *out, size_t size_out); 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); diff --git a/image_png.c b/image_png.c index 7ef74f9a..600f787b 100644 --- a/image_png.c +++ b/image_png.c @@ -140,7 +140,7 @@ PNG_OpenLibrary Try to load the PNG DLL ==================== */ -qboolean PNG_OpenLibrary (void) +qbool PNG_OpenLibrary (void) { const char* dllnames [] = { @@ -474,7 +474,7 @@ PNG_SaveImage_preflipped 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; diff --git a/image_png.h b/image_png.h index d290d98f..37dc886c 100644 --- a/image_png.h +++ b/image_png.h @@ -24,10 +24,10 @@ #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 diff --git a/input.h b/input.h index e157294f..db5b22d6 100644 --- a/input.h +++ b/input.h @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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; diff --git a/jpeg.c b/jpeg.c index effab6a1..8c47e794 100644 --- a/jpeg.c +++ b/jpeg.c @@ -454,12 +454,12 @@ static dllfunction_t jpegfuncs[] = // 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 @@ -488,7 +488,7 @@ JPEG_OpenLibrary Try to load the JPEG DLL ==================== */ -qboolean JPEG_OpenLibrary (void) +qbool JPEG_OpenLibrary (void) { #ifdef LINK_TO_LIBJPEG return true; @@ -814,7 +814,7 @@ JPEG_SaveImage_preflipped 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; @@ -1043,7 +1043,7 @@ static CompressedImageCacheItem *CompressedImageCache_Find(const char *imagename 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; diff --git a/jpeg.h b/jpeg.h index ff17eb75..34f7dff3 100644 --- a/jpeg.h +++ b/jpeg.h @@ -25,15 +25,15 @@ #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 diff --git a/keys.c b/keys.c index cceec519..178495d4 100644 --- a/keys.c +++ b/keys.c @@ -33,7 +33,7 @@ key up events are sent even if in console mode 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]; @@ -41,7 +41,7 @@ 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; @@ -123,7 +123,7 @@ static void Key_History_Push(void) history_matchfound = false; } -static qboolean Key_History_Get_foundCommand(void) +static qbool Key_History_Get_foundCommand(void) { if (!history_matchfound) return false; @@ -663,7 +663,7 @@ static const keyname_t keynames[] = { ============================================================================== */ -int Key_ClearEditLine(qboolean is_console) +int Key_ClearEditLine(qbool is_console) { if (is_console) { @@ -698,7 +698,7 @@ int chat_mode; // 0 for say, 1 for say_team, -1 for command 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]; @@ -745,7 +745,7 @@ int Key_AddChar(int unicode, qboolean is_console) // 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; @@ -1401,7 +1401,7 @@ Key_KeynumToString (int keynum, char *tinystr, size_t tinystrlength) } -qboolean +qbool Key_SetBinding (int keynum, int bindmap, const char *binding) { char *newbinding; @@ -1436,7 +1436,7 @@ void Key_GetBindMap(int *fg, int *bg) *bg = key_bmap2; } -qboolean Key_SetBindMap(int fg, int bg) +qbool Key_SetBindMap(int fg, int bg) { if(fg >= MAX_BINDMAPS) return false; @@ -1794,14 +1794,14 @@ typedef struct eventqueueitem_s { 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)) { @@ -1829,11 +1829,11 @@ void Key_EventQueue_Unblock(void) } 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]; diff --git a/keys.h b/keys.h index 6c10a6f1..ea104f1d 100644 --- a/keys.h +++ b/keys.h @@ -357,7 +357,7 @@ typedef enum keydest_e { key_game, key_message, key_menu, key_menu_grabbed, key_ 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) @@ -371,23 +371,23 @@ extern int chat_mode; // 0 for say, 1 for say_team, -1 for command 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 diff --git a/libcurl.c b/libcurl.c index 77c4aa33..65a79698 100644 --- a/libcurl.c +++ b/libcurl.c @@ -204,13 +204,13 @@ typedef struct downloadinfo_s 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 @@ -228,7 +228,7 @@ downloadinfo; 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; @@ -301,7 +301,7 @@ Curl_Have_forthismap 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; } @@ -353,7 +353,7 @@ CURL_CloseLibrary Load the cURL DLL ==================== */ -static qboolean CURL_OpenLibrary (void) +static qbool CURL_OpenLibrary (void) { const char* dllnames [] = { @@ -509,11 +509,11 @@ CURL_DOWNLOAD_FAILED or CURL_DOWNLOAD_ABORTED) and in the second case the error 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) @@ -875,7 +875,7 @@ Starts a download of a given URL to the file name portion of this URL (or name 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) @@ -989,7 +989,7 @@ static qboolean Curl_Begin(const char *URL, const char *extraheaders, double max { 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); @@ -1104,15 +1104,15 @@ static qboolean Curl_Begin(const char *URL, const char *extraheaders, double max } } -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); } @@ -1271,7 +1271,7 @@ Curl_Running returns true iff there is a download running. ==================== */ -qboolean Curl_Running(void) +qbool Curl_Running(void) { if(!curl_dll) return false; @@ -1394,7 +1394,7 @@ static void Curl_Curl_f(cmd_state_t *cmd) int i; int end; int loadtype = LOADTYPE_NONE; - qboolean forthismap = false; + qbool forthismap = false; const char *url; const char *name = 0; @@ -1666,7 +1666,7 @@ static const char *Curl_FindPackURL(const char *filename) // 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) @@ -1772,7 +1772,7 @@ This is done by sending him the following console commands: 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); @@ -1813,7 +1813,7 @@ void Curl_SendRequirements(void) // 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) diff --git a/libcurl.h b/libcurl.h index 15bf019b..43ab1713 100644 --- a/libcurl.h +++ b/libcurl.h @@ -10,11 +10,11 @@ typedef void (*curl_callback_t) (int status, size_t length_received, unsigned ch // 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); @@ -22,7 +22,7 @@ void Curl_Init_Commands(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); @@ -34,7 +34,7 @@ typedef struct Curl_downloadinfo_s 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); diff --git a/mathlib.c b/mathlib.c index 8816dc56..cf9e24a8 100644 --- a/mathlib.c +++ b/mathlib.c @@ -647,7 +647,7 @@ void AngleVectorsDuke3DFLU (const vec3_t angles, vec3_t forward, vec3_t left, ve } // 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) { diff --git a/mathlib.h b/mathlib.h index c21fb7b0..aeab1db8 100644 --- a/mathlib.h +++ b/mathlib.h @@ -258,7 +258,7 @@ void AngleVectorsDuke3DFLU (const vec3_t angles, vec3_t forward, vec3_t left, ve /// 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); diff --git a/menu.c b/menu.c index 6c4830d0..227f77de 100644 --- a/menu.c +++ b/menu.c @@ -106,7 +106,7 @@ static void M_GameOptions_Key(cmd_state_t *cmd, int key, int ascii); 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) { @@ -355,7 +355,7 @@ static void M_Demo_Key (cmd_state_t *cmd, int k, int ascii) /* 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 @@ -2848,7 +2848,7 @@ int video_resolutions_count; 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) { @@ -3168,7 +3168,7 @@ static void M_Credits_Key(cmd_state_t *cmd, int key, int ascii) 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) @@ -3949,7 +3949,7 @@ static gamelevels_t *gameoptions_levels = NULL; 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) @@ -4506,7 +4506,7 @@ static int modlist_numenabled; //number of enabled (or in process to be..) mod 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 @@ -4728,7 +4728,7 @@ static void M_ModList_Key(cmd_state_t *cmd, int k, int ascii) //============================================================================= /* 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); @@ -4908,7 +4908,7 @@ void M_Draw (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) @@ -5199,13 +5199,13 @@ static prvm_required_field_t m_required_globals[] = 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; @@ -5275,12 +5275,12 @@ static void MVM_count_edicts(prvm_prog_t *prog) 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; @@ -5417,14 +5417,14 @@ static void MP_Init (void) //============================================================================ // 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) @@ -5472,7 +5472,7 @@ static void Call_MR_ToggleMenu_f(cmd_state_t *cmd) MR_ToggleMenu(m); } -static qboolean menu_active; +static qbool menu_active; static void MR_Start_f(cmd_state_t *cmd) { diff --git a/menu.h b/menu.h index c68c4295..e8105871 100644 --- a/menu.h +++ b/menu.h @@ -76,7 +76,7 @@ void MP_Shutdown (void);*/ 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); diff --git a/model_alias.c b/model_alias.c index 5aa98c53..0cdf74fb 100644 --- a/model_alias.c +++ b/model_alias.c @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #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"}; @@ -623,13 +623,13 @@ static void Mod_BuildBaseBonePoses(void) 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; diff --git a/model_brush.c b/model_brush.c index 130c946b..8c31924a 100644 --- a/model_brush.c +++ b/model_brush.c @@ -73,7 +73,7 @@ static texture_t mod_q1bsp_texture_lava; 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) { @@ -1176,7 +1176,7 @@ void Collision_ClipTrace_Point(trace_t *trace, const vec3_t cmins, const vec3_t } } -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); @@ -3067,7 +3067,7 @@ static void Mod_Q1BSP_LoadLeafs(sizebuf_t *sb) } } -static qboolean Mod_Q1BSP_CheckWaterAlphaSupport(void) +static qbool Mod_Q1BSP_CheckWaterAlphaSupport(void) { int i, j; mleaf_t *leaf; @@ -3268,7 +3268,7 @@ static void Mod_Q1BSP_LoadMapBrushes(void) #if 0 // unfinished int submodel, numbrushes; - qboolean firstbrush; + qbool firstbrush; char *text, *maptext; char mapfilename[MAX_QPATH]; FS_StripExtension (loadmodel->name, mapfilename, sizeof (mapfilename)); @@ -3804,7 +3804,7 @@ static void Mod_BSP_FatPVS_RecursiveBSPNode(dp_model_t *model, const vec3_t org, //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); @@ -4699,7 +4699,7 @@ static void Mod_Q2BSP_LoadBrushes(sizebuf_t *sb) 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; @@ -5544,7 +5544,7 @@ static void Mod_Q3BSP_LoadLightmaps(lump_t *l, lump_t *faceslump) 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]; @@ -5824,7 +5824,7 @@ static void Mod_Q3BSP_LoadFaces(lump_t *l) 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)) @@ -6770,7 +6770,7 @@ static int Mod_Q3BSP_TraceLineOfSight_RecursiveNodeCheck(mnode_t *node, double p 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) { @@ -7160,7 +7160,7 @@ int Mod_CollisionBIH_PointSuperContents(struct model_s *model, int frame, const 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); @@ -7217,7 +7217,7 @@ void Mod_CollisionBIH_TraceLineAgainstSurfaces(dp_model_t *model, const frameble } -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; diff --git a/model_shared.c b/model_shared.c index 65a4e155..02d72bf9 100644 --- a/model_shared.c +++ b/model_shared.c @@ -210,7 +210,7 @@ void Mod_RenderInit(void) void Mod_UnloadModel (dp_model_t *mod) { char name[MAX_QPATH]; - qboolean used; + qbool used; dp_model_t *parentmodel; if (developer_loading.integer) @@ -257,7 +257,7 @@ static void R_Model_Null_Draw(entity_render_t *ent) } -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) { @@ -265,7 +265,7 @@ static int Mod_FrameGroupify_ParseGroups(const char *buf, mod_framegroupify_pars int start, len; float fps; unsigned int i; - qboolean loop; + qbool loop; char name[64]; bufptr = buf; @@ -332,7 +332,7 @@ static int Mod_FrameGroupify_ParseGroups(const char *buf, mod_framegroupify_pars 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]; @@ -402,7 +402,7 @@ Mod_LoadModel 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; @@ -633,7 +633,7 @@ Mod_ForName 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); @@ -726,7 +726,7 @@ int Mod_BuildVertexRemapTableFromElements(int numelements, const int *elements, 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; @@ -794,7 +794,7 @@ qboolean Mod_ValidateElements(int *element3i, unsigned short *element3s, int num } // 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; @@ -881,7 +881,7 @@ static void Mod_BuildBumpVectors(const float *v0, const float *v1, const float * #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; @@ -961,7 +961,7 @@ void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int nu } } -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)); @@ -1081,7 +1081,7 @@ static void Mod_ShadowMesh_CreateVBOs(shadowmesh_t *mesh) } } -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) { @@ -1181,7 +1181,7 @@ void Mod_ShadowMesh_Free(shadowmesh_t *mesh) 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; @@ -1462,7 +1462,7 @@ void Mod_LoadQ3Shaders(void) 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(); @@ -2257,10 +2257,10 @@ texture_shaderpass_t *Mod_CreateShaderPassFromQ3ShaderLayer(mempool_t *mempool, 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 = ""; @@ -2672,7 +2672,7 @@ void Mod_LoadCustomMaterial(mempool_t *mempool, texture_t *texture, const char * 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++) @@ -3101,7 +3101,7 @@ static void Mod_Decompile_OBJ(dp_model_t *model, const char *filename, const cha 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; @@ -3429,7 +3429,7 @@ void Mod_AllocLightmap_Free(mod_alloclightmap_state_t *state) 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; @@ -3715,7 +3715,7 @@ static void Mod_GenerateLightmaps_DestroyLights(dp_model_t *model) 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; @@ -4473,7 +4473,7 @@ texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdra 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 @@ -4688,7 +4688,7 @@ static void Mod_Mesh_ComputeBounds(dp_model_t *mod) 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; diff --git a/model_shared.h b/model_shared.h index 5c38de4d..c72715c9 100644 --- a/model_shared.h +++ b/model_shared.h @@ -70,18 +70,18 @@ typedef struct skinframe_s // 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; @@ -106,10 +106,10 @@ typedef struct r_meshbuffer_s 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; @@ -172,7 +172,7 @@ typedef struct surfmesh_s 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 @@ -417,9 +417,9 @@ typedef struct shader_s 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]; @@ -427,15 +427,15 @@ typedef struct shader_s // 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]; @@ -473,7 +473,7 @@ shader_t; 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]; @@ -549,7 +549,7 @@ typedef struct texture_s 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) @@ -700,7 +700,7 @@ typedef struct msurface_s int num_collisionvertices; // q3bsp // used by Mod_Mesh_Finalize when building sortedmodelsurfaces - qboolean included; + qbool included; } msurface_t; @@ -732,17 +732,17 @@ model_brush_lightstyleinfo_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; @@ -811,7 +811,7 @@ typedef struct model_brush_s 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); @@ -823,14 +823,14 @@ typedef struct model_brush_s 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; @@ -872,7 +872,7 @@ typedef struct model_brushq1_s // 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; @@ -927,10 +927,10 @@ typedef struct model_brushq3_s // 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; @@ -945,9 +945,9 @@ typedef struct model_s // 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 @@ -1005,8 +1005,8 @@ typedef struct model_s 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_*) @@ -1036,7 +1036,7 @@ typedef struct model_s // 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 @@ -1059,10 +1059,10 @@ typedef struct model_s 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; @@ -1100,9 +1100,9 @@ extern cvar_t mod_q3bsp_lightgrid_bsp_surfaces; 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); @@ -1113,11 +1113,11 @@ extern dp_model_t *loadmodel; 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 @@ -1128,7 +1128,7 @@ shadowmesh_t *Mod_ShadowMesh_Alloc(mempool_t *mempool, int maxverts, int maxtria 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); @@ -1137,13 +1137,13 @@ void Mod_CreateCollisionMesh(dp_model_t *mod); 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; @@ -1191,7 +1191,7 @@ mod_alloclightmap_state_t; 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); @@ -1210,7 +1210,7 @@ void R_Mod_Draw(struct entity_render_s *ent); 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); @@ -1220,7 +1220,7 @@ void Mod_Mesh_Create(dp_model_t *mod, const char *name); 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); @@ -1232,10 +1232,10 @@ void Mod_CollisionBIH_TraceLine(dp_model_t *model, const struct frameblend_s *fr 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; diff --git a/model_sprite.c b/model_sprite.c index acfac9f5..7e76b860 100644 --- a/model_sprite.c +++ b/model_sprite.c @@ -57,7 +57,7 @@ void Mod_SpriteInit (void) 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(); @@ -88,10 +88,10 @@ static void Mod_SpriteSetupTexture(texture_t *texture, skinframe_t *skinframe, q 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; @@ -379,7 +379,7 @@ void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend) 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; diff --git a/mvm_cmds.c b/mvm_cmds.c index 8b9df778..a8fdbb6e 100644 --- a/mvm_cmds.c +++ b/mvm_cmds.c @@ -599,7 +599,7 @@ refreshserverlist() */ 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; @@ -836,7 +836,7 @@ static void VM_M_crypto_getidstatus(prvm_prog_t *prog) { lhnetaddress_t addr; const char *s; - qboolean issigned; + qbool issigned; VM_SAFEPARMCOUNT(1,VM_M_crypto_getidstatus); @@ -912,7 +912,7 @@ static void VM_M_crypto_getmyidfp(prvm_prog_t *prog) static void VM_M_crypto_getmyidstatus(prvm_prog_t *prog) { int i; - qboolean issigned; + qbool issigned; VM_SAFEPARMCOUNT(1, VM_M_crypto_getmyidstatus); diff --git a/netconn.c b/netconn.c index b53877d7..09a8ab3d 100755 --- a/netconn.c +++ b/netconn.c @@ -114,8 +114,8 @@ challenge_t challenges[MAX_CHALLENGES]; #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) @@ -159,7 +159,7 @@ int serverlist_maxcachecount = 0; 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]; @@ -215,7 +215,7 @@ static void _ServerList_ViewList_Helper_Remove( int index ) } /// \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 @@ -297,7 +297,7 @@ static qboolean _ServerList_Entry_Compare( serverlist_entry_t *A, serverlist_ent 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 ) { @@ -323,7 +323,7 @@ static qboolean _ServerList_CompareInt( int A, serverlist_maskop_t op, int B ) } } -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 @@ -365,7 +365,7 @@ static qboolean _ServerList_CompareStr( const char *A, serverlist_maskop_t op, c } } -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; @@ -576,7 +576,7 @@ static void _ServerList_Test(void) } #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; @@ -668,7 +668,7 @@ int NetConn_WriteString(lhnetsocket_t *mysocket, const char *string, const lhnet 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; @@ -723,7 +723,7 @@ static int NetConn_AddCryptoFlag(crypto_t *crypto) 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]; @@ -740,7 +740,7 @@ int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolvers 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 @@ -931,12 +931,12 @@ int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolvers return 0; } -qboolean NetConn_HaveClientPorts(void) +qbool NetConn_HaveClientPorts(void) { return !!cl_numsockets; } -qboolean NetConn_HaveServerPorts(void) +qbool NetConn_HaveServerPorts(void) { return !!sv_numsockets; } @@ -1007,7 +1007,7 @@ void NetConn_CloseServerPorts(void) 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; @@ -1067,7 +1067,7 @@ void NetConn_OpenServerPorts(int opennetports) 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); @@ -1207,7 +1207,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s if (protocol == PROTOCOL_QUAKEWORLD) { unsigned int sequence, sequence_ack; - qboolean reliable_ack, reliable_message; + qbool reliable_ack, reliable_message; int count; //int qport; @@ -1661,7 +1661,7 @@ static void NetConn_ClientParsePacket_ServerList_UpdateCache(int n) } // 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; @@ -1704,7 +1704,7 @@ static qboolean NetConn_ClientParsePacket_ServerList_PrepareQuery( int protocol, 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) @@ -1783,7 +1783,7 @@ static void NetConn_ClientParsePacket_ServerList_ParseDPList(lhnetaddress_t *sen 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]; @@ -2502,7 +2502,7 @@ static void NetConn_BuildChallengeString(char *buffer, int bufferlength) } /// (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]; @@ -2668,7 +2668,7 @@ bad: 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; @@ -2731,9 +2731,9 @@ void NetConn_ClearFlood(lhnetaddress_t *peeraddress, server_floodaddress_t *floo } } -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; @@ -2754,7 +2754,7 @@ static qboolean hmac_mdfour_time_matching(lhnetaddress_t *peeraddress, const cha 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; @@ -2788,7 +2788,7 @@ static qboolean hmac_mdfour_challenge_matching(lhnetaddress_t *peeraddress, cons 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"); @@ -2803,9 +2803,9 @@ static const char *RCon_Authenticate(lhnetaddress_t *peeraddress, const char *pa { 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; @@ -2897,7 +2897,7 @@ allow: 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) { @@ -2941,7 +2941,7 @@ static int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, unsigned char *dat 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]; @@ -3625,7 +3625,7 @@ void NetConn_SleepMicroseconds(int microseconds) } #ifdef CONFIG_MENU -void NetConn_QueryMasters(qboolean querydp, qboolean queryqw) +void NetConn_QueryMasters(qbool querydp, qbool queryqw) { int i, j; int masternum; diff --git a/netconn.h b/netconn.h index 8e3cdab3..1198db55 100755 --- a/netconn.h +++ b/netconn.h @@ -182,7 +182,7 @@ typedef struct netconn_s struct netconn_qw_s { // QW protocol - qboolean fatal_error; + qbool fatal_error; float last_received; // for timeouts @@ -199,11 +199,11 @@ typedef struct netconn_s // 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; @@ -303,7 +303,7 @@ typedef struct serverlist_info_s // categorized sorting int category; /// favorite server flag - qboolean isfavorite; + qbool isfavorite; } serverlist_info_t; typedef enum @@ -363,7 +363,7 @@ typedef struct serverlist_entry_s typedef struct serverlist_mask_s { - qboolean active; + qbool active; serverlist_maskop_t tests[SLIF_COUNT]; serverlist_info_t info; } serverlist_mask_t; @@ -387,7 +387,7 @@ extern int serverlist_cachecount; 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 @@ -430,10 +430,10 @@ extern cvar_t net_address_ipv6; 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); @@ -445,7 +445,7 @@ void NetConn_Init(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); @@ -457,7 +457,7 @@ void NetConn_Heartbeat(int priority); 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); @@ -467,7 +467,7 @@ void Net_Refresh_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); diff --git a/portals.c b/portals.c index 2872a8ca..7cd20a5d 100644 --- a/portals.c +++ b/portals.c @@ -325,8 +325,8 @@ static void Portal_RecursiveFlow (portalrecursioninfo_t *info, mleaf_t *leaf, in 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; diff --git a/progs.h b/progs.h index 3b6e3543..fd8d109c 100644 --- a/progs.h +++ b/progs.h @@ -68,7 +68,7 @@ typedef struct edict_odefunc_s 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; @@ -78,7 +78,7 @@ typedef struct edict_engineprivate_s 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; @@ -101,7 +101,7 @@ typedef struct edict_engineprivate_s 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 @@ -114,7 +114,7 @@ typedef struct edict_engineprivate_s skeleton_t skeleton; // physics parameters - qboolean ode_physics; + qbool ode_physics; void *ode_body; void *ode_geom; void *ode_joint; @@ -132,7 +132,7 @@ typedef struct edict_engineprivate_s 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; diff --git a/progsvm.h b/progsvm.h index 6c185b63..9ee619a0 100644 --- a/progsvm.h +++ b/progsvm.h @@ -69,7 +69,7 @@ typedef struct prvm_required_field_s // 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 @@ -99,7 +99,7 @@ typedef struct prvm_edict_s // ... } 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; @@ -641,7 +641,7 @@ typedef struct prvm_prog_s // 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; @@ -677,7 +677,7 @@ typedef struct prvm_prog_s // 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] @@ -687,11 +687,11 @@ typedef struct prvm_prog_s 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; @@ -722,7 +722,7 @@ typedef struct prvm_prog_s 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 @@ -826,7 +826,7 @@ func_t PRVM_ED_FindFunctionOffset(prvm_prog_t *prog, const char *name); 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); @@ -840,7 +840,7 @@ void PRVM_ED_WriteGlobals(prvm_prog_t *prog, qfile_t *f); 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); @@ -892,7 +892,7 @@ int PRVM_AllocString(prvm_prog_t *prog, size_t bufferlength, char **pointer); 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); diff --git a/protocol.h b/protocol.h index 1799ca11..3fa39244 100644 --- a/protocol.h +++ b/protocol.h @@ -448,7 +448,7 @@ void Protocol_UpdateClientStats(const int *stats); 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); @@ -638,7 +638,7 @@ void EntityFrame_AddFrame_Client(entityframe_database_t *d, vec3_t eye, int fram // (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 @@ -692,7 +692,7 @@ void EntityFrame4_ResetDatabase(entityframe4_database_t *d); // 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); @@ -854,7 +854,7 @@ int EntityState5_DeltaBitsForState(entity_state_t *o, entity_state_t *n); 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; @@ -1016,7 +1016,7 @@ 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]; } @@ -1031,11 +1031,11 @@ entityframeqw_database_t; 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 diff --git a/prvm_cmds.c b/prvm_cmds.c index 46c5864a..ec585faa 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -263,7 +263,7 @@ checkextension(extensionname) */ // 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; @@ -629,7 +629,7 @@ void VM_localcmd_server(prvm_prog_t *prog) 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); @@ -5348,7 +5348,7 @@ static const char *detect_match_rule(char *pattern, int *matchrule) } // 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; @@ -5476,7 +5476,7 @@ void VM_buf_cvarlist(prvm_prog_t *prog) 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); @@ -6237,7 +6237,7 @@ void VM_uri_get (prvm_prog_t *prog) { const char *url; float id; - qboolean ret; + qbool ret; uri_to_prog_t *handle; const char *posttype = NULL; const char *postseparator = NULL; @@ -6911,7 +6911,7 @@ static void animatemodel(prvm_prog_t *prog, dp_model_t *model, prvm_edict_t *ed) { skeleton_t *skeleton; int skeletonindex = -1; - qboolean need = false; + qbool need = false; struct animatemodel_cache *animatemodel_cache; if (!prog->animatemodel_cache) { diff --git a/prvm_edict.c b/prvm_edict.c index cccc66df..7717b0df 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -51,7 +51,7 @@ cvar_t prvm_garbagecollection_strings = {CVAR_CLIENT | CVAR_SERVER, "prvm_garbag 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 @@ -233,7 +233,7 @@ PRVM_ED_CanAlloc 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; @@ -977,7 +977,7 @@ Can parse either fields or globals 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; @@ -1270,8 +1270,8 @@ Used for initial level load and for savegames. 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; @@ -1369,7 +1369,7 @@ 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) { const char *funcname; mfunction_t *func; @@ -2500,7 +2500,7 @@ void PRVM_Prog_Load(prvm_prog_t *prog, const char * filename, unsigned char * da // 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! { @@ -3428,7 +3428,7 @@ void PRVM_FreeString(prvm_prog_t *prog, int num) 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; @@ -3459,7 +3459,7 @@ static qboolean PRVM_IsStringReferenced(prvm_prog_t *prog, string_t string) 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]; @@ -3511,7 +3511,7 @@ static qboolean PRVM_IsEdictRelevant(prvm_prog_t *prog, prvm_edict_t *edict) 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); @@ -3554,7 +3554,7 @@ static qboolean PRVM_IsEdictReferenced(prvm_prog_t *prog, prvm_edict_t *edict, i 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. @@ -3607,7 +3607,7 @@ static void PRVM_MarkReferencedEdicts(prvm_prog_t *prog) void PRVM_LeakTest(prvm_prog_t *prog) { int i, j; - qboolean leaked = false; + qbool leaked = false; if(!prog->leaktest_active) return; diff --git a/prvm_exec.c b/prvm_exec.c index dc86140c..eb4217d8 100644 --- a/prvm_exec.c +++ b/prvm_exec.c @@ -909,7 +909,7 @@ static void PRVM_StatementCoverageEvent(prvm_prog_t *prog, mfunction_t *func, in #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 @@ -940,7 +940,7 @@ void MVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessag 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; @@ -1049,7 +1049,7 @@ void CLVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessa 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; @@ -1162,7 +1162,7 @@ void PRVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessa 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; diff --git a/qtypes.h b/qtypes.h index 7bbc212d..69600ec1 100644 --- a/qtypes.h +++ b/qtypes.h @@ -6,7 +6,7 @@ #include #include -typedef bool qboolean; +typedef bool qbool; #ifndef NULL #define NULL ((void *)0) diff --git a/quakedef.h b/quakedef.h index ff6a3943..0279913c 100644 --- a/quakedef.h +++ b/quakedef.h @@ -404,7 +404,7 @@ extern char engineversion[128]; #endif #include "csprogs.h" -extern qboolean noclip_anglehack; +extern qbool noclip_anglehack; extern cvar_t developer; extern cvar_t developer_entityparsing; @@ -521,8 +521,8 @@ extern cvar_t sessionid; #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 @@ -547,8 +547,8 @@ typedef struct host_s 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 diff --git a/r_explosion.c b/r_explosion.c index b60bfc2d..e52e304a 100644 --- a/r_explosion.c +++ b/r_explosion.c @@ -43,7 +43,7 @@ typedef struct explosion_s vec3_t origin; vec3_t vert[EXPLOSIONVERTS]; vec3_t vertvel[EXPLOSIONVERTS]; - qboolean clipping; + qbool clipping; } explosion_t; @@ -59,7 +59,7 @@ cvar_t r_explosionclip = {CVAR_CLIENT | CVAR_SAVE, "r_explosionclip", "1", "enab #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; diff --git a/r_shadow.c b/r_shadow.c index a34af2c8..005ba384 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -34,8 +34,8 @@ r_shadow_rendermode_t r_shadow_lightingrendermode = R_SHADOW_RENDERMODE_NONE; 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 @@ -54,15 +54,15 @@ int r_shadow_shadowmapfilterquality; 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; @@ -274,7 +274,7 @@ static memexpandablearray_t r_shadow_worldlightsarray; 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; @@ -375,7 +375,7 @@ static void R_Shadow_SetShadowMode(void) R_GLSL_Restart_f(&cmd_client); } -qboolean R_Shadow_ShadowMappingEnabled(void) +qbool R_Shadow_ShadowMappingEnabled(void) { switch (r_shadow_shadowmode) { @@ -1526,7 +1526,7 @@ void R_Shadow_ClearShadowMapTexture(void) 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; @@ -1596,7 +1596,7 @@ static void R_Shadow_RenderMode_ShadowMap(int side, int size, int x, int y) 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) @@ -1641,7 +1641,7 @@ static const float bboxpoints[8][3] = { 1, 1, 1}, }; -void R_Shadow_RenderMode_DrawDeferredLight(qboolean shadowmapping) +void R_Shadow_RenderMode_DrawDeferredLight(qbool shadowmapping) { int i; float vertex3f[8*3]; @@ -1673,9 +1673,9 @@ void R_Shadow_RenderMode_DrawDeferredLight(qboolean shadowmapping) 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; @@ -1709,7 +1709,7 @@ static qboolean R_Shadow_BounceGrid_CheckEnable(int flag) 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; @@ -1776,7 +1776,7 @@ static void R_Shadow_BounceGrid_UpdateSpacing(void) { int lightindex; int range; - qboolean bounds_set = false; + qbool bounds_set = false; dlight_t *light; rtlight_t *rtlight; @@ -2635,7 +2635,7 @@ static void R_Shadow_BounceGrid_TracePhotons_Shot(r_shadow_bouncegrid_photon_t * 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) @@ -2766,8 +2766,8 @@ void R_Shadow_UpdateBounceGridTexture(void) { 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); @@ -2883,7 +2883,7 @@ void R_Shadow_UpdateBounceGridTexture(void) } } -void R_Shadow_RenderMode_VisibleLighting(qboolean transparent) +void R_Shadow_RenderMode_VisibleLighting(qbool transparent) { R_Shadow_RenderMode_Reset(); GL_BlendFunc(GL_ONE, GL_ONE); @@ -2923,7 +2923,7 @@ int bboxedges[12][2] = {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) { @@ -2961,7 +2961,7 @@ static void R_Shadow_RenderLighting_Light_GLSL(int texturenumsurfaces, const msu 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); @@ -3439,8 +3439,8 @@ static void R_Shadow_PrepareLight(rtlight_t *rtlight) 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; @@ -3875,7 +3875,7 @@ static void R_Shadow_DrawLight(rtlight_t *rtlight) 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) @@ -4047,7 +4047,7 @@ void R_Shadow_DrawPrepass(void) } #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) { @@ -4456,7 +4456,7 @@ static void R_Shadow_DrawModelShadowMaps(void) 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; @@ -4550,7 +4550,7 @@ static void R_DrawCorona(rtlight_t *rtlight, float cscale, float scale) 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); @@ -4567,7 +4567,7 @@ static void R_DrawCorona(rtlight_t *rtlight, float cscale, float scale) void R_Shadow_DrawCoronas(void) { int i, flag; - qboolean usequery = false; + qbool usequery = false; size_t lightindex; dlight_t *light; rtlight_t *rtlight; diff --git a/r_shadow.h b/r_shadow.h index 25e6ce0f..7766838e 100644 --- a/r_shadow.h +++ b/r_shadow.h @@ -37,14 +37,14 @@ extern cvar_t r_shadow_scissor; // 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; @@ -88,10 +88,10 @@ r_shadow_bouncegrid_photon_t; 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; @@ -133,7 +133,7 @@ r_shadow_bouncegrid_state_t; 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); @@ -142,14 +142,14 @@ void R_Shadow_RenderLighting(int texturenumsurfaces, const msurface_t **textures 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; diff --git a/r_sky.c b/r_sky.c index 43d60a37..dc6e037c 100644 --- a/r_sky.c +++ b/r_sky.c @@ -21,7 +21,7 @@ static matrix4x4_t skyinversematrix; typedef struct suffixinfo_s { const char *suffix; - qboolean flipx, flipy, flipdiagonal; + qbool flipx, flipy, flipdiagonal; } suffixinfo_t; static const suffixinfo_t suffix[3][6] = @@ -376,7 +376,7 @@ static void skyspherecalc(void) static void R_SkySphere(void) { double speedscale; - static qboolean skysphereinitialized = false; + static qbool skysphereinitialized = false; matrix4x4_t scroll1matrix, scroll2matrix; if (!skysphereinitialized) { diff --git a/r_sprites.c b/r_sprites.c index d01c99a4..4118a5b7 100644 --- a/r_sprites.c +++ b/r_sprites.c @@ -181,7 +181,7 @@ static void R_RotateSprite(const mspriteframe_t *frame, vec3_t origin, vec3_t le // 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; diff --git a/r_textures.h b/r_textures.h index 7a7cc460..a008112c 100644 --- a/r_textures.h +++ b/r_textures.h @@ -106,8 +106,8 @@ typedef struct rtexture_s // 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; @@ -147,12 +147,12 @@ extern cvar_t r_texture_dds_save; 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); @@ -193,7 +193,7 @@ void R_ClearTexture (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 diff --git a/render.h b/render.h index c8d63be8..459693fc 100644 --- a/render.h +++ b/render.h @@ -196,7 +196,7 @@ extern cvar_t r_showdisabledepthtest; 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; @@ -223,19 +223,19 @@ void R_SkinFrame_PurgeSkinFrame(skinframe_t *skinframe); 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); @@ -244,7 +244,7 @@ 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" @@ -287,7 +287,7 @@ void R_AnimCache_Free(void); /// 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); @@ -354,8 +354,8 @@ typedef struct rsurfacestate_s // // 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 @@ -409,8 +409,8 @@ typedef struct rsurfacestate_s // 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; @@ -482,7 +482,7 @@ typedef struct rsurfacestate_s 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; @@ -519,15 +519,15 @@ extern rsurfacestate_t rsurface; 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 @@ -555,10 +555,10 @@ typedef enum rsurfacepass_e } 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 { @@ -572,7 +572,7 @@ 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 @@ -587,9 +587,9 @@ typedef struct r_rendertarget_s { } 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 { @@ -599,7 +599,7 @@ 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; } @@ -618,10 +618,10 @@ typedef struct r_waterstate_s 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; @@ -644,8 +644,8 @@ typedef struct r_framebufferstate_s 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; @@ -659,7 +659,7 @@ extern cvar_t r_viewfbo; 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; @@ -680,17 +680,17 @@ extern cvar_t r_transparent_sortarraysize; 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; @@ -716,7 +716,7 @@ void R_Model_Sprite_Draw(entity_render_t *ent); 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); @@ -725,8 +725,8 @@ void R_DrawPortals(void); 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); @@ -745,7 +745,7 @@ void R_LightningBeams_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 diff --git a/sbar.c b/sbar.c index 288965a2..7a488ea4 100644 --- a/sbar.c +++ b/sbar.c @@ -53,7 +53,7 @@ cachepic_t *sb_face_quad; cachepic_t *sb_face_invuln; cachepic_t *sb_face_invis_invuln; -qboolean sb_showscores; +qbool sb_showscores; int sb_lines; // scan lines to draw @@ -1112,7 +1112,7 @@ void Sbar_ShowFPS(void) 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; @@ -1176,7 +1176,7 @@ void Sbar_ShowFPS(void) } 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) { @@ -1798,7 +1798,7 @@ Sbar_DeathmatchOverlay 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); diff --git a/screen.h b/screen.h index 55b0e3f0..081c3c7c 100644 --- a/screen.h +++ b/screen.h @@ -26,17 +26,17 @@ void CL_Screen_Init (void); 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 @@ -69,7 +69,7 @@ extern cvar_t scr_stipple; 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 diff --git a/server.h b/server.h index 440cb49f..b3ab98a2 100644 --- a/server.h +++ b/server.h @@ -31,7 +31,7 @@ typedef struct server_static_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 @@ -55,8 +55,8 @@ typedef struct server_static_s 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; @@ -77,12 +77,12 @@ server_floodaddress_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; @@ -141,7 +141,7 @@ typedef struct server_s 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; @@ -187,15 +187,15 @@ typedef struct csqcentityframedb_s 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; @@ -295,12 +295,12 @@ typedef struct client_s // 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 @@ -515,11 +515,11 @@ void SV_Init (void); 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); @@ -552,9 +552,9 @@ void SV_Physics (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 @@ -567,11 +567,11 @@ void SV_LinkEdict_TouchAreaGrid_Call(prvm_edict_t *touch, prvm_edict_t *ent); // /*! 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); @@ -581,7 +581,7 @@ trace_t SV_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_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); @@ -601,7 +601,7 @@ void SV_SetupVM(void); 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); diff --git a/snd_main.c b/snd_main.c index c76e503d..bcf5163c 100644 --- a/snd_main.c +++ b/snd_main.c @@ -133,8 +133,8 @@ static unsigned int soundtime = 0; 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; @@ -146,12 +146,12 @@ mempool_t *snd_mempool; // 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; @@ -264,7 +264,7 @@ static const char* ambient_names [2] = { "sound/ambience/water1.wav", "sound/amb // 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) { @@ -935,7 +935,7 @@ sfx_t *S_FindName (const char *name) S_FreeSfx ================== */ -void S_FreeSfx (sfx_t *sfx, qboolean force) +void S_FreeSfx (sfx_t *sfx, qbool force) { unsigned int i; @@ -1040,7 +1040,7 @@ void S_PurgeUnused(void) 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; @@ -1097,7 +1097,7 @@ float S_SoundLength(const char *name) 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); } @@ -1204,7 +1204,7 @@ Spatializes a channel ================= */ 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; @@ -1400,7 +1400,7 @@ static void SND_Spatialize_WithSfx(channel_t *ch, qboolean isstatic, sfx_t *sfx) intensity = mastervol * f; if (intensity > 0) { - qboolean occluded = false; + qbool occluded = false; if (snd_spatialization_occlusion.integer) { if(snd_spatialization_occlusion.integer & 1) @@ -1516,7 +1516,7 @@ static void SND_Spatialize_WithSfx(channel_t *ch, qboolean isstatic, sfx_t *sfx) 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); @@ -1527,7 +1527,7 @@ static void SND_Spatialize(channel_t *ch, qboolean isstatic) // 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) { @@ -1661,7 +1661,7 @@ int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f 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; @@ -1692,7 +1692,7 @@ void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean frees } -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; @@ -1762,7 +1762,7 @@ void S_StopAllSounds_f(cmd_state_t *cmd) } -void S_PauseGameSounds (qboolean toggle) +void S_PauseGameSounds (qbool toggle) { unsigned int i; @@ -2240,7 +2240,7 @@ void S_ExtraUpdate (void) S_PaintAndSubmit(); } -qboolean S_LocalSound (const char *sound) +qbool S_LocalSound (const char *sound) { sfx_t *sfx; int ch_ind; diff --git a/snd_main.h b/snd_main.h index 5a07d72b..e3ccdecd 100644 --- a/snd_main.h +++ b/snd_main.h @@ -119,8 +119,8 @@ extern unsigned int total_channels; 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; @@ -139,7 +139,7 @@ extern mempool_t *snd_mempool; // 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 @@ -151,7 +151,7 @@ extern qboolean simsound; 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). @@ -164,7 +164,7 @@ snd_ringbuffer_t *Snd_CreateRingBuffer (const snd_format_t* format, unsigned int // 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); @@ -176,7 +176,7 @@ void SndSys_Submit (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); diff --git a/snd_mem.c b/snd_mem.c index 09bdb8ee..bc664fa0 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -81,7 +81,7 @@ snd_ringbuffer_t *Snd_CreateRingBuffer (const snd_format_t* format, unsigned int 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; diff --git a/snd_mix.c b/snd_mix.c index b718bdcb..736d6ea1 100644 --- a/snd_mix.c +++ b/snd_mix.c @@ -347,8 +347,8 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) 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) diff --git a/snd_null.c b/snd_null.c index 42e88f04..0d81f849 100755 --- a/snd_null.c +++ b/snd_null.c @@ -74,11 +74,11 @@ int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, ve 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; } @@ -87,7 +87,7 @@ void S_StopSound (int entnum, int entchannel) { } -void S_PauseGameSounds (qboolean toggle) +void S_PauseGameSounds (qbool toggle) { } @@ -95,7 +95,7 @@ void S_SetChannelVolume (unsigned int ch_ind, float fvol) { } -sfx_t *S_PrecacheSound (const char *sample, qboolean complain, qboolean levelsound) +sfx_t *S_PrecacheSound (const char *sample, qbool complain, qbool levelsound) { return NULL; } @@ -105,7 +105,7 @@ float S_SoundLength(const char *name) return -1; } -qboolean S_IsSoundPrecached (const sfx_t *sfx) +qbool S_IsSoundPrecached (const sfx_t *sfx) { return false; } @@ -131,7 +131,7 @@ void S_ExtraUpdate (void) { } -qboolean S_LocalSound (const char *s) +qbool S_LocalSound (const char *s) { return false; } diff --git a/snd_ogg.c b/snd_ogg.c index d91b8232..e0cb0f48 100644 --- a/snd_ogg.c +++ b/snd_ogg.c @@ -41,7 +41,7 @@ #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 @@ -269,7 +269,7 @@ OGG_OpenLibrary Try to load the VorbisFile DLL ==================== */ -qboolean OGG_OpenLibrary (void) +qbool OGG_OpenLibrary (void) { const char* dllnames_vo [] = { @@ -600,7 +600,7 @@ OGG_LoadVorbisFile 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; diff --git a/snd_ogg.h b/snd_ogg.h index f8c5fe78..0b30e24a 100644 --- a/snd_ogg.h +++ b/snd_ogg.h @@ -25,9 +25,9 @@ #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 diff --git a/snd_oss.c b/snd_oss.c index 9926b800..05f91c92 100644 --- a/snd_oss.c +++ b/snd_oss.c @@ -46,7 +46,7 @@ Create "snd_renderbuffer" with the proper sound format if the call is successful 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; @@ -312,7 +312,7 @@ SndSys_LockRenderBuffer Get the exclusive lock on "snd_renderbuffer" ==================== */ -qboolean SndSys_LockRenderBuffer (void) +qbool SndSys_LockRenderBuffer (void) { // Nothing to do return true; diff --git a/snd_sdl.c b/snd_sdl.c index 68c84cdb..680d53e7 100644 --- a/snd_sdl.c +++ b/snd_sdl.c @@ -102,7 +102,7 @@ Create "snd_renderbuffer" with the proper sound format if the call is successful 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; @@ -220,7 +220,7 @@ SndSys_LockRenderBuffer Get the exclusive lock on "snd_renderbuffer" ==================== */ -qboolean SndSys_LockRenderBuffer (void) +qbool SndSys_LockRenderBuffer (void) { SDL_LockAudioDevice(audio_device); return true; diff --git a/snd_wav.c b/snd_wav.c index b4d014b3..e5d47523 100644 --- a/snd_wav.c +++ b/snd_wav.c @@ -265,7 +265,7 @@ const snd_fetcher_t wav_fetcher = { WAV_GetSamplesFloat, NULL, WAV_FreeSfx }; 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; diff --git a/snd_wav.h b/snd_wav.h index 89c7ee51..65015d35 100644 --- a/snd_wav.h +++ b/snd_wav.h @@ -28,7 +28,7 @@ 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 diff --git a/snd_xmp.c b/snd_xmp.c index 2985112b..2bcb2675 100644 --- a/snd_xmp.c +++ b/snd_xmp.c @@ -69,7 +69,7 @@ #define xmp_dll 1 -qboolean XMP_OpenLibrary (void) {return true;} +qbool XMP_OpenLibrary (void) {return true;} void XMP_CloseLibrary (void) {} #else @@ -345,7 +345,7 @@ XMP_OpenLibrary Try to load the libxmp DLL ==================== */ -qboolean XMP_OpenLibrary (void) +qbool XMP_OpenLibrary (void) { const char* dllnames_xmp [] = { @@ -592,7 +592,7 @@ XMP_LoadModFile 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; diff --git a/snd_xmp.h b/snd_xmp.h index caa68323..799ffd1e 100644 --- a/snd_xmp.h +++ b/snd_xmp.h @@ -21,9 +21,9 @@ #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 diff --git a/sound.h b/sound.h index 288b475c..5266231f 100644 --- a/sound.h +++ b/sound.h @@ -68,11 +68,11 @@ void S_UnloadAllSounds_f(cmd_state_t *cmd); 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 @@ -97,16 +97,16 @@ sfx_t *S_FindName(const char *name); // 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); diff --git a/sv_ccmds.c b/sv_ccmds.c index e3331dce..fd84fdd2 100644 --- a/sv_ccmds.c +++ b/sv_ccmds.c @@ -208,7 +208,7 @@ static void SV_God_f(cmd_state_t *cmd) SV_ClientPrint("godmode ON\n"); } -qboolean noclip_anglehack; +qbool noclip_anglehack; static void SV_Noclip_f(cmd_state_t *cmd) { @@ -440,7 +440,7 @@ static void SV_Pause_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; @@ -449,7 +449,7 @@ static void SV_Say(cmd_state_t *cmd, qboolean teamonly) char *p2; // LadyHavoc: long say messages char text[1024]; - qboolean fromServer = false; + qbool fromServer = false; if (cmd->source == src_local) { @@ -519,7 +519,7 @@ static void SV_Tell_f(cmd_state_t *cmd) 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; @@ -934,7 +934,7 @@ SV_Name_f 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)]; @@ -1108,7 +1108,7 @@ static void SV_Kick_f(cmd_state_t *cmd) const char *message = NULL; client_t *save; int i; - qboolean byNumber = false; + qbool byNumber = false; if (!sv.active) return; @@ -1489,9 +1489,9 @@ static void SV_Ent_Create_f(cmd_state_t *cmd) 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)) diff --git a/sv_demo.c b/sv_demo.c index ad3e509f..08ebe841 100644 --- a/sv_demo.c +++ b/sv_demo.c @@ -29,7 +29,7 @@ void SV_StartDemoRecording(client_t *client, const char *filename, int forcetrac 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; diff --git a/sv_demo.h b/sv_demo.h index 65c19248..8dbbd65f 100644 --- a/sv_demo.h +++ b/sv_demo.h @@ -2,7 +2,7 @@ #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); diff --git a/sv_ents.c b/sv_ents.c index c0e1eaca..8e732cd5 100644 --- a/sv_ents.c +++ b/sv_ents.c @@ -263,7 +263,7 @@ void EntityFrame_AddFrame_Server(entityframe_database_t *d, vec3_t eye, int fram } // (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; diff --git a/sv_ents4.c b/sv_ents4.c index b587afe9..c6e40ea1 100644 --- a/sv_ents4.c +++ b/sv_ents4.c @@ -1,7 +1,7 @@ #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; diff --git a/sv_ents5.c b/sv_ents5.c index b2119f96..98be9b36 100644 --- a/sv_ents5.c +++ b/sv_ents5.c @@ -407,7 +407,7 @@ void EntityState5_WriteUpdate(int number, const entity_state_t *s, int changedbi } } -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; diff --git a/sv_ents_csqc.c b/sv_ents_csqc.c index 482d467d..3e09b3ca 100644 --- a/sv_ents_csqc.c +++ b/sv_ents_csqc.c @@ -29,7 +29,7 @@ void EntityFrameCSQC_LostFrame(client_t *client, int framenum) { // 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; @@ -159,11 +159,11 @@ static void EntityFrameCSQC_DeallocFrame(client_t *client, int framenum) //[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; diff --git a/sv_ents_nq.c b/sv_ents_nq.c index 7479280f..8db8a623 100644 --- a/sv_ents_nq.c +++ b/sv_ents_nq.c @@ -1,7 +1,7 @@ #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; @@ -9,7 +9,7 @@ qboolean EntityFrameQuake_WriteFrame(sizebuf_t *msg, int maxsize, int numstates, int i, bits; sizebuf_t buf; unsigned char data[128]; - qboolean success = false; + qbool success = false; // prepare the buffer memset(&buf, 0, sizeof(buf)); diff --git a/sv_main.c b/sv_main.c index c2419941..1005083d 100644 --- a/sv_main.c +++ b/sv_main.c @@ -733,7 +733,7 @@ Larger attenuations will drop off. (max 4 attenuation) ================== */ -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; @@ -1167,7 +1167,7 @@ Called when the player is getting totally kicked off the host 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; @@ -1299,7 +1299,7 @@ crosses a waterline. ============================================================================= */ -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; @@ -1628,7 +1628,7 @@ static void SV_PrepareEntitiesForSending(void) #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; @@ -1975,11 +1975,11 @@ void SV_AddCameraEyes(void) 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 @@ -2822,7 +2822,7 @@ static void Download_CheckExtensions(cmd_state_t *cmd) 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) { @@ -3884,7 +3884,7 @@ static void SVVM_count_edicts(prvm_prog_t *prog) 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 @@ -4104,7 +4104,7 @@ double SV_Frame(double time) static double sv_timer; int i; char vabuf[1024]; - qboolean playing = false; + qbool playing = false; if (!svs.threaded) { @@ -4272,7 +4272,7 @@ double SV_Frame(double time) 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; diff --git a/sv_move.c b/sv_move.c index 62060b13..0699180d 100644 --- a/sv_move.c +++ b/sv_move.c @@ -33,7 +33,7 @@ is not a staircase. */ 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; @@ -106,7 +106,7 @@ The move will be adjusted for slopes and stairs, but if the move isn't 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; @@ -254,7 +254,7 @@ facing it. ====================== */ -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; @@ -397,7 +397,7 @@ SV_CloseEnough ====================== */ -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; diff --git a/sv_phys.c b/sv_phys.c index fcd37002..af376820 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -419,7 +419,7 @@ trace_t SV_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co 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 @@ -1079,7 +1079,7 @@ in a frame. Not used for pushmove objects, because they must be exact. 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; @@ -1193,9 +1193,9 @@ If stepnormal is not NULL, the plane normal of any vertical wall hit will be sto ============ */ 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; @@ -1458,7 +1458,7 @@ PUSHMOVE =============================================================================== */ -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; @@ -1539,7 +1539,7 @@ static qboolean SV_NudgeOutOfSolid_PivotIsKnownGood(prvm_edict_t *ent, vec3_t pi 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; @@ -1588,7 +1588,7 @@ The trace struct is filled with the trace that has been done. 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; @@ -1676,7 +1676,7 @@ static void SV_PushMove (prvm_edict_t *pusher, float movetime) 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; @@ -2090,7 +2090,7 @@ static unstickresult_t SV_UnstickEntityReturnOffset (prvm_edict_t *ent, vec3_t o 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; @@ -2154,7 +2154,7 @@ static void SV_CheckStuck (prvm_edict_t *ent) 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; @@ -2308,7 +2308,7 @@ static void SV_WalkMove (prvm_edict_t *ent) 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 @@ -2839,7 +2839,7 @@ static void SV_Physics_Entity (prvm_edict_t *ent) // (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; diff --git a/sv_save.c b/sv_save.c index b32cd9c6..f85d97f2 100644 --- a/sv_save.c +++ b/sv_save.c @@ -37,7 +37,7 @@ void SV_Savegame_to(prvm_prog_t *prog, const char *name) 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 @@ -185,7 +185,7 @@ void SV_Savegame_f(cmd_state_t *cmd) { prvm_prog_t *prog = SVVM_prog; char name[MAX_QPATH]; - qboolean deadflag = false; + qbool deadflag = false; if (!sv.active) { diff --git a/sv_user.c b/sv_user.c index 57fc14b7..7f14e19f 100644 --- a/sv_user.c +++ b/sv_user.c @@ -306,7 +306,7 @@ void SV_SetIdealPitch (void) static vec3_t wishdir, forward, right, up; static float wishspeed; -static qboolean onground; +static qbool onground; /* ================== @@ -973,7 +973,7 @@ void SV_ApplyClientMove (void) 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) { diff --git a/svvm_cmds.c b/svvm_cmds.c index 871e7386..634de814 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -266,7 +266,7 @@ static void VM_SV_setorigin(prvm_prog_t *prog) } // 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; @@ -1080,7 +1080,7 @@ static void VM_SV_walkmove(prvm_prog_t *prog) vec3_t move; mfunction_t *oldf; int oldself; - qboolean settrace; + qbool settrace; VM_SAFEPARMCOUNTRANGE(2, 3, VM_SV_walkmove); @@ -2439,7 +2439,7 @@ static int SV_GetExtendedTagInfo (prvm_prog_t *prog, prvm_edict_t *e, int tagind 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; diff --git a/sys.h b/sys.h index 1dd5ae76..5f277e78 100644 --- a/sys.h +++ b/sys.h @@ -29,8 +29,8 @@ typedef struct sys_s int selffd; int outfd; int nicelevel; - qboolean nicepossible; - qboolean isnice; + qbool nicepossible; + qbool isnice; } sys_t; extern sys_t sys; @@ -63,7 +63,7 @@ dllfunction_t; * \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); @@ -101,7 +101,7 @@ void Sys_Quit (int returnvalue); #ifdef __cplusplus extern "C" #endif -void Sys_AllowProfiling (qboolean enable); +void Sys_AllowProfiling (qbool enable); typedef struct sys_cleantime_s { @@ -124,7 +124,7 @@ void Sys_SendKeyEvents (void); 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 diff --git a/sys_sdl.c b/sys_sdl.c index 3adfb980..72d12264 100644 --- a/sys_sdl.c +++ b/sys_sdl.c @@ -43,7 +43,7 @@ void Sys_Shutdown (void) SDL_Quit(); } -static qboolean nocrashdialog; +static qbool nocrashdialog; void Sys_Error (const char *error, ...) { va_list argptr; @@ -230,7 +230,7 @@ int main (int argc, char *argv[]) return 0; } -qboolean sys_supportsdlgetticks = true; +qbool sys_supportsdlgetticks = true; unsigned int Sys_SDL_GetTicks (void) { return SDL_GetTicks(); diff --git a/sys_shared.c b/sys_shared.c index b7ea5d5a..0ba8862f 100644 --- a/sys_shared.c +++ b/sys_shared.c @@ -65,7 +65,7 @@ void Sys_Quit (int returnvalue) #ifdef __cplusplus extern "C" #endif -void Sys_AllowProfiling(qboolean enable) +void Sys_AllowProfiling(qbool enable) { #ifdef __ANDROID__ #ifdef USE_PROFILER @@ -91,7 +91,7 @@ DLL MANAGEMENT =============================================================================== */ -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) @@ -116,7 +116,7 @@ static qboolean Sys_LoadLibraryFunctions(dllhandle_t dllhandle, const dllfunctio 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; @@ -580,7 +580,7 @@ static int CPUID_Features(void) #endif #ifdef SSE_POSSIBLE -qboolean Sys_HaveSSE(void) +qbool Sys_HaveSSE(void) { // COMMANDLINEOPTION: SSE: -nosse disables SSE support and detection if(Sys_CheckParm("-nosse")) @@ -597,7 +597,7 @@ qboolean Sys_HaveSSE(void) #endif } -qboolean Sys_HaveSSE2(void) +qbool Sys_HaveSSE2(void) { // COMMANDLINEOPTION: SSE2: -nosse2 disables SSE2 support and detection if(Sys_CheckParm("-nosse") || Sys_CheckParm("-nosse2")) diff --git a/sys_unix.c b/sys_unix.c index 56bdd883..c7f9acb3 100644 --- a/sys_unix.c +++ b/sys_unix.c @@ -175,7 +175,7 @@ int main (int argc, char **argv) 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"); diff --git a/sys_win.c b/sys_win.c index 34609b0d..ee27f1eb 100644 --- a/sys_win.c +++ b/sys_win.c @@ -395,7 +395,7 @@ int main (int argc, const char* argv[]) } #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"); diff --git a/taskqueue.c b/taskqueue.c index ccde49c5..74a72b1b 100644 --- a/taskqueue.c +++ b/taskqueue.c @@ -80,7 +80,7 @@ static int TaskQueue_ThreadFunc(void *d) unsigned int sleepcounter = 0; for (;;) { - qboolean quit; + qbool quit; while (s->dequeueposition != s->enqueueposition) { taskqueue_task_t *t = s->queue[s->dequeueposition % THREADTASKS]; @@ -136,7 +136,7 @@ void TaskQueue_Yield(taskqueue_task_t *t) TaskQueue_Enqueue(1, t); } -qboolean TaskQueue_IsDone(taskqueue_task_t *t) +qbool TaskQueue_IsDone(taskqueue_task_t *t) { return !!t->done; } @@ -198,7 +198,7 @@ static void TaskQueue_DistributeTasks(void) void TaskQueue_WaitForTaskDone(taskqueue_task_t *t) { - qboolean done = false; + qbool done = false; for (;;) { Thread_AtomicLock(&taskqueue_state.command_lock); @@ -210,7 +210,7 @@ void TaskQueue_WaitForTaskDone(taskqueue_task_t *t) } } -void TaskQueue_Frame(qboolean shutdown) +void TaskQueue_Frame(qbool shutdown) { int i; unsigned long long int avg; diff --git a/taskqueue.h b/taskqueue.h index 9e8741f4..3f5ac3a4 100644 --- a/taskqueue.h +++ b/taskqueue.h @@ -30,7 +30,7 @@ void TaskQueue_Enqueue(int numtasks, taskqueue_task_t *tasks); 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); @@ -45,6 +45,6 @@ void TaskQueue_Task_CheckTasksDone(taskqueue_task_t *t); void TaskQueue_Init(void); void TaskQueue_Shutdown(void); -void TaskQueue_Frame(qboolean shutdown); +void TaskQueue_Frame(qbool shutdown); #endif diff --git a/thread.h b/thread.h index a9a00658..847cc26c 100644 --- a/thread.h +++ b/thread.h @@ -35,7 +35,7 @@ typedef struct {int value;} Thread_Atomic; 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); @@ -54,8 +54,8 @@ int _Thread_AtomicGet(Thread_Atomic *ref, 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); diff --git a/thread_null.c b/thread_null.c index 66981583..a38a15b6 100644 --- a/thread_null.c +++ b/thread_null.c @@ -10,7 +10,7 @@ void Thread_Shutdown(void) { } -qboolean Thread_HasThreads(void) +qbool Thread_HasThreads(void) { return false; } @@ -105,12 +105,12 @@ void _Thread_AtomicIncRef(Thread_Atomic *a, const char *filename, int fileline) 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; } diff --git a/thread_pthread.c b/thread_pthread.c index 7bded93d..2f8273ab 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -16,7 +16,7 @@ void Thread_Shutdown(void) { } -qboolean Thread_HasThreads(void) +qbool Thread_HasThreads(void) { return true; } diff --git a/thread_sdl.c b/thread_sdl.c index 5c77bb3c..3ce56c89 100644 --- a/thread_sdl.c +++ b/thread_sdl.c @@ -15,7 +15,7 @@ void Thread_Shutdown(void) { } -qboolean Thread_HasThreads(void) +qbool Thread_HasThreads(void) { #ifdef THREADDISABLE return false; @@ -200,7 +200,7 @@ void _Thread_AtomicIncRef(Thread_Atomic *a, const char *filename, int fileline) 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); @@ -208,7 +208,7 @@ qboolean _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileli 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); diff --git a/thread_win.c b/thread_win.c index ff1be87e..fa282f4d 100644 --- a/thread_win.c +++ b/thread_win.c @@ -14,7 +14,7 @@ void Thread_Shutdown(void) { } -qboolean Thread_HasThreads(void) +qbool Thread_HasThreads(void) { #ifdef THREADDISABLE return false; diff --git a/utf8lib.c b/utf8lib.c index c66f06e1..ee363898 100644 --- a/utf8lib.c +++ b/utf8lib.c @@ -59,7 +59,7 @@ Uchar utf8_range[5] = { * @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; @@ -771,9 +771,9 @@ all characters until the zero terminator. ============ */ 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; @@ -877,7 +877,7 @@ u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid) * @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) { @@ -895,7 +895,7 @@ size_t u8_strpad(char *out, size_t outsize, const char *in, qboolean leftalign, } } -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); diff --git a/utf8lib.h b/utf8lib.h index fc5d1be7..275366e6 100644 --- a/utf8lib.h +++ b/utf8lib.h @@ -33,13 +33,13 @@ Uchar u8_getnchar_utf8_enabled(const char*, const char**, size_t); 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 diff --git a/vid.h b/vid.h index 2199ea0b..91220d75 100644 --- a/vid.h +++ b/vid.h @@ -38,12 +38,12 @@ renderpath_t; 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; @@ -52,10 +52,10 @@ typedef struct viddef_mode_s 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; @@ -68,19 +68,19 @@ typedef struct viddef_s 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; @@ -105,7 +105,7 @@ typedef struct vid_joystate_s { 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; @@ -122,12 +122,12 @@ void VID_BuildJoyState(vid_joystate_t *joystate); 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; @@ -188,8 +188,8 @@ extern const char *gl_platform; 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); @@ -207,7 +207,7 @@ int VID_SetMode (int modenum); // 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) @@ -215,11 +215,11 @@ qboolean VID_InitMode(viddef_mode_t *mode); // (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); @@ -228,7 +228,7 @@ void VID_Start(void); 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) @@ -240,7 +240,7 @@ typedef struct 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 diff --git a/vid_null.c b/vid_null.c index aa409946..cf2ba864 100644 --- a/vid_null.c +++ b/vid_null.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int cl_available = false; -qboolean vid_supportrefreshrate = false; +qbool vid_supportrefreshrate = false; void VID_Shutdown(void) { @@ -51,7 +51,7 @@ static void InitSig(void) #endif } -void VID_SetMouse (qboolean fullscreengrab, qboolean relative, qboolean hidecursor) +void VID_SetMouse (qbool fullscreengrab, qbool relative, qbool hidecursor) { } @@ -64,7 +64,7 @@ void VID_Init(void) InitSig(); // trap evil signals } -qboolean VID_InitMode(viddef_mode_t *mode) +qbool VID_InitMode(viddef_mode_t *mode) { return false; } @@ -96,7 +96,7 @@ size_t VID_ListModes(vid_mode_t *modes, size_t maxcount) return 0; } -qboolean GL_ExtensionSupported(const char *name) +qbool GL_ExtensionSupported(const char *name) { return false; } diff --git a/vid_sdl.c b/vid_sdl.c index de693c42..58123482 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include 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) { @@ -63,14 +63,14 @@ 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"}; @@ -341,12 +341,12 @@ static int MapKey( unsigned int sdlkey ) } } -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; @@ -363,12 +363,12 @@ void VID_ShowKeyboard(qboolean show) } } -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 @@ -455,14 +455,14 @@ float multitouch[MAXFINGERS][3]; 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) { @@ -568,11 +568,11 @@ static qboolean VID_TouchscreenArea(int corner, float px, float py, float pwidth // 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; @@ -761,8 +761,8 @@ static void IN_Move_TouchScreen_SteelStorm(void) 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)); @@ -874,8 +874,8 @@ static void IN_Move_TouchScreen_Quake(void) { 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)); @@ -944,7 +944,7 @@ void IN_Move( void ) 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; @@ -1022,7 +1022,7 @@ void IN_Move( void ) //// #ifdef SDL_R_RESTART -static qboolean sdl_needs_restart; +static qbool sdl_needs_restart; static void sdl_start(void) { } @@ -1060,10 +1060,10 @@ static keynum_t buttonremap[] = // 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; @@ -1311,12 +1311,12 @@ void *GL_GetProcAddress(const char *name) 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) { @@ -1343,11 +1343,11 @@ 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); @@ -1468,7 +1468,7 @@ extern cvar_t gl_info_version; 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 @@ -1636,7 +1636,7 @@ extern cvar_t gl_info_version; 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); @@ -1666,7 +1666,7 @@ void VID_Shutdown (void) void VID_Finish (void) { - qboolean vid_usevsync; + qbool vid_usevsync; vid_activewindow = !vid_hidden && vid_hasfocus; VID_UpdateGamma(); diff --git a/vid_shared.c b/vid_shared.c index 661fb0a6..177f99ff 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -56,7 +56,7 @@ xinput_keystroke_t; 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 @@ -64,17 +64,17 @@ int vid_xinputindex = -1; 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; @@ -635,7 +635,7 @@ static glfunction_t openglfuncs[] = }; #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; @@ -692,7 +692,7 @@ void GL_Setup(void) int j; GLint numextensions = 0; const glfunction_t *func; - qboolean missingrequiredfuncs = false; + qbool missingrequiredfuncs = false; static char missingfuncs[16384]; #ifndef USE_GLES2 @@ -845,7 +845,7 @@ float VID_JoyState_GetAxis(const vid_joystate_t *joystate, int axis, float fsens return value * fsensitivity; } -qboolean VID_JoyBlockEmulatedKeys(int keycode) +qbool VID_JoyBlockEmulatedKeys(int keycode) { int j; vid_joystate_t joystate; @@ -927,7 +927,7 @@ void VID_Shared_BuildJoyState_Finish(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) { @@ -1097,7 +1097,7 @@ void VID_ApplyGammaToColor(const float *rgb, float *out) } 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) @@ -1166,7 +1166,7 @@ void VID_UpdateGamma(void) { 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); @@ -1459,8 +1459,8 @@ static void VID_CloseSystems(void) 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) { @@ -1596,7 +1596,7 @@ static int VID_SortModes_Compare(const void *a_, const void *b_) 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) diff --git a/view.c b/view.c index d7b1ac74..0fa6d0d4 100644 --- a/view.c +++ b/view.c @@ -475,7 +475,7 @@ static void highpass3_limited(vec3_t value, vec_t fracx, vec_t limitx, vec_t fra * 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]; @@ -934,7 +934,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa void V_CalcRefdef (void) { entity_t *ent; - qboolean cldead; + qbool cldead; if (cls.state == ca_connected && cls.signon == SIGNONS && !cl.csqc_server2csqcentitynumber[cl.viewentity]) { diff --git a/world.c b/world.c index fdcd235d..97e246e5 100644 --- a/world.c +++ b/world.c @@ -2130,7 +2130,7 @@ static void World_Physics_Frame_BodyFromEntity(world_t *world, prvm_edict_t *ed) int triangleindex; int vertexindex; mempool_t *mempool; - qboolean modified = false; + qbool modified = false; vec3_t angles; vec3_t avelocity; vec3_t entmaxs; @@ -2151,13 +2151,13 @@ static void World_Physics_Frame_BodyFromEntity(world_t *world, prvm_edict_t *ed) 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 @@ -2374,10 +2374,10 @@ static void World_Physics_Frame_BodyFromEntity(world_t *world, prvm_edict_t *ed) // 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 diff --git a/world.h b/world.h index d1b45a7c..3e4e3881 100644 --- a/world.h +++ b/world.h @@ -42,7 +42,7 @@ typedef struct link_s 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; diff --git a/zone.c b/zone.c index e2ec8ca7..1298c177 100644 --- a/zone.c +++ b/zone.c @@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #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) @@ -660,7 +660,7 @@ void _Mem_CheckSentinelsGlobal(const char *filename, int fileline) #endif } -qboolean Mem_IsAllocated(mempool_t *pool, void *data) +qbool Mem_IsAllocated(mempool_t *pool, void *data) { memheader_t *header; memheader_t *target; diff --git a/zone.h b/zone.h index 5112acf0..00c0f267 100644 --- a/zone.h +++ b/zone.h @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef ZONE_H #define ZONE_H -extern qboolean mem_bigendian; +extern qbool mem_bigendian; // div0: heap overflow detection paranoia #define MEMPARANOIA 0 @@ -100,7 +100,7 @@ void _Mem_EmptyPool(mempool_t *pool, const char *filename, int fileline); 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); -- 2.39.2