replace qboolean with stdbool

master
an 2019-11-25 18:28:38 -05:00
parent 5d5dc61d1b
commit 3a9d2a8db0
90 changed files with 361 additions and 369 deletions

View File

@ -29,10 +29,10 @@
#define MUSIC_DIRNAME "music"
qboolean bgmloop;
bool bgmloop;
cvar_t bgm_extmusic = {"bgm_extmusic", "1", CVAR_ARCHIVE};
static qboolean no_extmusic= false;
static bool no_extmusic= false;
static float old_volume = -1.0f;
typedef enum _bgm_player
@ -123,7 +123,7 @@ static void BGM_Stop_f (void)
BGM_Stop();
}
qboolean BGM_Init (void)
bool BGM_Init (void)
{
music_handler_t *handlers = NULL;
int i;
@ -278,7 +278,7 @@ void BGM_Play (const char *filename)
Con_Printf("Couldn't handle music file %s\n", filename);
}
void BGM_PlayCDtrack (byte track, qboolean looping)
void BGM_PlayCDtrack (byte track, bool looping)
{
/* instead of searching by the order of music_handlers, do so by
* the order of searchpath priority: the file from the searchpath
@ -371,7 +371,7 @@ void BGM_Resume (void)
static void BGM_UpdateStream (void)
{
qboolean did_rewind = false;
bool did_rewind = false;
int res; /* Number of bytes read. */
int bufferSamples;
int fileSamples;

View File

@ -25,10 +25,10 @@
#ifndef _BGMUSIC_H_
#define _BGMUSIC_H_
extern qboolean bgmloop;
extern bool bgmloop;
extern cvar_t bgm_extmusic;
qboolean BGM_Init (void);
bool BGM_Init (void);
void BGM_Shutdown (void);
void BGM_Play (const char *filename);
@ -37,7 +37,7 @@ void BGM_Update (void);
void BGM_Pause (void);
void BGM_Resume (void);
void BGM_PlayCDtrack (byte track, qboolean looping);
void BGM_PlayCDtrack (byte track, bool looping);
#endif /* _BGMUSIC_H_ */

View File

@ -20,7 +20,7 @@
#include "quakedef.h"
int CDAudio_Play(byte track, qboolean looping)
int CDAudio_Play(byte track, bool looping)
{
(void)track, (void)looping;
return -1;

View File

@ -34,18 +34,18 @@
#include "quakedef.h"
#include "cdaudio.h"
static qboolean cdValid = false;
static qboolean playing = false;
static qboolean wasPlaying = false;
static qboolean enabled = true;
static qboolean playLooping = false;
static bool cdValid = false;
static bool playing = false;
static bool wasPlaying = false;
static bool enabled = true;
static bool playLooping = false;
static byte remap[100];
static byte playTrack;
static double endOfTrack = -1.0, pausetime = -1.0;
static SDL_CD *cd_handle;
static int cd_dev = -1;
static float old_cdvolume;
static qboolean hw_vol_works = true;
static bool hw_vol_works = true;
static void CDAudio_Eject(void)
@ -75,7 +75,7 @@ static int CDAudio_GetAudioDiskInfo(void)
return 0;
}
int CDAudio_Play(byte track, qboolean looping)
int CDAudio_Play(byte track, bool looping)
{
int len_m, len_s, len_f;
@ -361,21 +361,21 @@ static void CD_f (void)
Con_Printf ("cd: unknown command \"%s\"\n", command);
}
static qboolean CD_GetVolume (void *unused)
static bool CD_GetVolume (void *unused)
{
/* FIXME: write proper code in here when SDL
supports cdrom volume control some day. */
return false;
}
static qboolean CD_SetVolume (void *unused)
static bool CD_SetVolume (void *unused)
{
/* FIXME: write proper code in here when SDL
supports cdrom volume control some day. */
return false;
}
static qboolean CDAudio_SetVolume (float value)
static bool CDAudio_SetVolume (float value)
{
if (!cd_handle || !enabled)
return false;

View File

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define __CDAUDIO_H
int CDAudio_Init (void);
int CDAudio_Play (byte track, qboolean looping);
int CDAudio_Play (byte track, bool looping);
/* returns 0 for success, -1 for failure. */
void CDAudio_Stop (void);
void CDAudio_Pause (void);

View File

@ -154,7 +154,7 @@ int CFG_OpenConfig (const char *cfg_name)
{
FILE *f;
long length;
qboolean pak;
bool pak;
CFG_CloseConfig ();

View File

@ -383,7 +383,7 @@ void CL_PlayDemo_f (void)
{
char name[MAX_OSPATH];
int i, c;
qboolean neg;
bool neg;
if (cmd_source != src_command)
return;

View File

@ -176,7 +176,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;
bool impulsedown, impulseup, down;
impulsedown = key->state & 2;
impulseup = key->state & 4;

View File

@ -89,7 +89,7 @@ const char *svc_strings[] =
//johnfitz
};
qboolean warn_about_nehahra_protocol; //johnfitz
bool warn_about_nehahra_protocol; //johnfitz
extern vec3_t v_punchangles[2]; //johnfitz
@ -424,7 +424,7 @@ void CL_ParseUpdate (int bits)
int i;
qmodel_t *model;
int modnum;
qboolean forcelink;
bool forcelink;
entity_t *ent;
int num;
int skin;

View File

@ -112,14 +112,14 @@ typedef struct
// demo recording info must be here, because record is started before
// entering a map (and clearing client_state_t)
qboolean demorecording;
qboolean demoplayback;
bool demorecording;
bool demoplayback;
// did the user pause demo playback? (separate from cl.paused because we don't
// want a svc_setpause inside the demo to actually pause demo playback).
qboolean demopaused;
bool demopaused;
qboolean timedemo;
bool timedemo;
int forcetrack; // -1 = use normal cd track
FILE *demofile;
int td_lastframe; // to meter out one message a frame
@ -173,16 +173,16 @@ typedef struct
// pitch drifting vars
float idealpitch;
float pitchvel;
qboolean nodrift;
bool nodrift;
float driftmove;
double laststop;
float viewheight;
float crouch; // local amount for smoothing stepups
qboolean paused; // send over by server
qboolean onground;
qboolean inwater;
bool paused; // send over by server
bool onground;
bool inwater;
int intermission; // don't change view angle, full screen, etc
int completed_time; // latched at intermission start

View File

@ -39,7 +39,7 @@ typedef struct cmdalias_s
cmdalias_t *cmd_alias;
qboolean cmd_wait;
bool cmd_wait;
//=============================================================================
@ -721,7 +721,7 @@ void Cmd_AddCommand (const char *cmd_name, xcommand_t function)
Cmd_Exists
============
*/
qboolean Cmd_Exists (const char *cmd_name)
bool Cmd_Exists (const char *cmd_name)
{
cmd_function_t *cmd;

View File

@ -88,7 +88,7 @@ void Cmd_AddCommand (const char *cmd_name, xcommand_t function);
// register commands and functions to call for them.
// The cmd_name is referenced later, so it should not be in temp memory
qboolean Cmd_Exists (const char *cmd_name);
bool Cmd_Exists (const char *cmd_name);
// used by the cvar code to check for cvar / command name overlap
const char *Cmd_CompleteCommand (const char *partial);

View File

@ -34,9 +34,9 @@ int safemode;
cvar_t registered = {"registered","1",CVAR_ROM}; /* set to correct value in COM_CheckRegistered() */
cvar_t cmdline = {"cmdline","",CVAR_ROM/*|CVAR_SERVERINFO*/}; /* sending cmdline upon CCREQ_RULE_INFO is evil */
static qboolean com_modified; // set true if using non-id files
static bool com_modified; // set true if using non-id files
qboolean fitzmode;
bool fitzmode;
static void COM_Path_f (void);
@ -56,7 +56,7 @@ char **com_argv;
#define CMDLINE_LENGTH 256 /* johnfitz -- mirrored in cmd.c */
char com_cmdline[CMDLINE_LENGTH];
qboolean standard_quake = true, rogue, hipnotic;
bool standard_quake = true, rogue, hipnotic;
// this graphic needs to be in the pak file to use registered features
static uint16_t pop[] =
@ -555,7 +555,7 @@ float Q_atof (const char *str)
============================================================================
*/
qboolean host_bigendian;
bool host_bigendian;
int16_t (*BigShort) (int16_t l);
int16_t (*LittleShort) (int16_t l);
@ -756,7 +756,7 @@ void MSG_WriteAngle16 (sizebuf_t *sb, float f, uint32_t flags)
// reading functions
//
int msg_readcount;
qboolean msg_badread;
bool msg_badread;
void MSG_BeginReading (void)
{
@ -1711,7 +1711,7 @@ COM_FileExists
Returns whether the file is found in the quake filesystem.
===========
*/
qboolean COM_FileExists (const char *filename, uint32_t *path_id)
bool COM_FileExists (const char *filename, uint32_t *path_id)
{
int ret = COM_FindFile (filename, NULL, NULL, path_id);
return (ret == -1) ? false : true;
@ -2026,7 +2026,7 @@ static void COM_AddGameDirectory (const char *base, const char *dir)
searchpath_t *search;
pack_t *pak, *qspak;
char pakfile[MAX_OSPATH];
qboolean been_here = false;
bool been_here = false;
q_strlcpy (com_gamedir, va("%s/%s", base, dir), sizeof(com_gamedir));
@ -2051,7 +2051,7 @@ _add_path:
if (i != 0 || path_id != 1 || fitzmode)
qspak = NULL;
else {
qboolean old = com_modified;
bool old = com_modified;
if (been_here) base = host_parms->userdir;
q_snprintf (pakfile, sizeof(pakfile), "%s/quakespasm.pak", base);
qspak = COM_LoadPackFile (pakfile);

View File

@ -49,8 +49,8 @@ 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
bool allowoverflow; // if false, do a Sys_Error
bool overflowed; // set to true if the buffer size failed
byte *data;
int maxsize;
int cursize;
@ -83,7 +83,7 @@ void InsertLinkAfter (link_t *l, link_t *after);
//============================================================================
extern qboolean host_bigendian;
extern bool host_bigendian;
extern int16_t (*BigShort) (int16_t l);
extern int16_t (*LittleShort) (int16_t l);
@ -105,7 +105,7 @@ void MSG_WriteAngle (sizebuf_t *sb, float f, uint32_t flags);
void MSG_WriteAngle16 (sizebuf_t *sb, float f, uint32_t flags); //johnfitz
extern int msg_readcount;
extern qboolean msg_badread; // set if a read goes beyond end of message
extern bool msg_badread; // set if a read goes beyond end of message
void MSG_BeginReading (void);
int MSG_ReadChar (void);
@ -155,7 +155,7 @@ extern int q_vsnprintf(char *str, size_t size, const char *format, va_list args)
//============================================================================
extern char com_token[1024];
extern qboolean com_eof;
extern bool com_eof;
const char *COM_Parse (const char *data);
@ -231,7 +231,7 @@ extern int file_from_pak; // global indicating that file came from a pak
void COM_WriteFile (const char *filename, const void *data, int len);
int COM_OpenFile (const char *filename, int *handle, uint32_t *path_id);
int COM_FOpenFile (const char *filename, FILE **file, uint32_t *path_id);
qboolean COM_FileExists (const char *filename, uint32_t *path_id);
bool COM_FileExists (const char *filename, uint32_t *path_id);
void COM_CloseFile (int h);
// these procedures open a file using COM_FindFile and loads it into a proper
@ -281,7 +281,7 @@ const char *COM_ParseStringNewline(const char *buffer);
typedef struct _fshandle_t
{
FILE *file;
qboolean pak; /* is the file read from a pak */
bool pak; /* is the file read from a pak */
long start; /* file or data start position */
long length; /* file or data size */
long pos; /* current position relative to start */
@ -300,8 +300,8 @@ long FS_filelength (fshandle_t *fh);
extern struct cvar_s registered;
extern qboolean standard_quake, rogue, hipnotic;
extern qboolean fitzmode;
extern bool standard_quake, rogue, hipnotic;
extern bool fitzmode;
/* if true, run in fitzquake mode disabling custom quakespasm hacks */
#endif /* _Q_COMMON_H */

View File

@ -41,7 +41,7 @@ float con_cursorspeed = 4;
int con_buffersize; //johnfitz -- user can now override default
qboolean con_forcedup; // because no entities to refresh
bool con_forcedup; // because no entities to refresh
int con_totallines; // total lines in console scrollback
int con_backscroll; // lines up from bottom to display
@ -60,9 +60,9 @@ float con_times[NUM_CON_TIMES]; // realtime time the line was generated
int con_vislines;
qboolean con_debuglog = false;
bool con_debuglog = false;
qboolean con_initialized;
bool con_initialized;
/*
@ -373,7 +373,7 @@ static void Con_Print (const char *txt)
int c, l;
static int cr;
int mask;
qboolean boundary;
bool boundary;
//con_backscroll = 0; //johnfitz -- better console scrolling
@ -483,7 +483,7 @@ void Con_Printf (const char *fmt, ...)
{
va_list argptr;
char msg[MAXPRINTMSG];
static qboolean inupdate;
static bool inupdate;
va_start (argptr, fmt);
q_vsnprintf (msg, sizeof(msg), fmt, argptr);
@ -716,7 +716,7 @@ typedef struct tab_s
tab_t *tablist;
//defs from elsewhere
extern qboolean keydown[256];
extern bool keydown[256];
typedef struct cmd_function_s
{
struct cmd_function_s *next;
@ -744,7 +744,7 @@ tablist is a doubly-linked loop, alphabetized by name
// bash_partial is the string that can be expanded,
// aka Linux Bash shell. -- S.A.
static char bash_partial[80];
static qboolean bash_singlematch;
static bool bash_singlematch;
void AddToTabList (const char *name, const char *type)
{
@ -1180,7 +1180,7 @@ Draws the console with the solid background
The typing input line at the bottom should only be drawn if typing is allowed
================
*/
void Con_DrawConsole (int lines, qboolean drawinput)
void Con_DrawConsole (int lines, bool drawinput)
{
int i, x, y, j, sb, rows;
const char *text;

View File

@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
extern int con_totallines;
extern int con_backscroll;
extern qboolean con_forcedup; // because no entities to refresh
extern qboolean con_initialized;
extern bool con_forcedup; // because no entities to refresh
extern bool con_initialized;
extern byte *con_chars;
extern char con_lastcenterstring[]; //johnfitz
@ -38,7 +38,7 @@ void Con_DrawCharacter (int cx, int line, int num);
void Con_CheckResize (void);
void Con_Init (void);
void Con_DrawConsole (int lines, qboolean drawinput);
void Con_DrawConsole (int lines, bool drawinput);
void Con_Printf (const char *fmt, ...) FUNC_PRINTF(1,2);
void Con_DWarning (const char *fmt, ...) FUNC_PRINTF(1,2); //ericw
void Con_Warning (const char *fmt, ...) FUNC_PRINTF(1,2); //johnfitz

View File

@ -532,7 +532,7 @@ Adds a freestanding variable to the variable list.
void Cvar_RegisterVariable (cvar_t *variable)
{
char value[512];
qboolean set_rom;
bool set_rom;
cvar_t *cursor,*prev; //johnfitz -- sorted list insert
// first check to see if it has already been defined
@ -610,7 +610,7 @@ Cvar_Command
Handles variable inspection and changing from the console
============
*/
qboolean Cvar_Command (void)
bool Cvar_Command (void)
{
cvar_t *v;

View File

@ -117,7 +117,7 @@ float Cvar_VariableValue (const char *var_name);
const char *Cvar_VariableString (const char *var_name);
// returns an empty string if not defined
qboolean Cvar_Command (void);
bool Cvar_Command (void);
// called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known
// command. Returns true if the command was a variable reference that
// was handled. (print or change)

View File

@ -136,7 +136,7 @@ byte menuplyr_pixels[4096];
int scrap_allocated[MAX_SCRAPS][BLOCK_WIDTH];
byte scrap_texels[MAX_SCRAPS][BLOCK_WIDTH*BLOCK_HEIGHT]; //johnfitz -- removed *4 after BLOCK_HEIGHT
qboolean scrap_dirty;
bool scrap_dirty;
gltexture_t *scrap_textures[MAX_SCRAPS]; //johnfitz

View File

@ -35,7 +35,7 @@ ALIAS MODEL DISPLAY LIST GENERATION
qmodel_t *aliasmodel;
aliashdr_t *paliashdr;
int used[8192]; // qboolean
int used[8192]; // bool
// the command list holds counts and s/t values that are valid for
// every frame

View File

@ -32,7 +32,7 @@ char loadname[32]; // for hunk tags
void Mod_LoadSpriteModel (qmodel_t *mod, void *buffer);
void Mod_LoadBrushModel (qmodel_t *mod, void *buffer);
void Mod_LoadAliasModel (qmodel_t *mod, void *buffer);
qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash);
qmodel_t *Mod_LoadModel (qmodel_t *mod, bool crash);
cvar_t external_ents = {"external_ents", "1", CVAR_ARCHIVE};
@ -302,7 +302,7 @@ Mod_LoadModel
Loads a model into the cache
==================
*/
qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash)
qmodel_t *Mod_LoadModel (qmodel_t *mod, bool crash)
{
byte *buf;
byte stackbuf[1024]; // avoid dirtying the cache heap
@ -378,7 +378,7 @@ Mod_ForName
Loads in a model for the given name
==================
*/
qmodel_t *Mod_ForName (const char *name, qboolean crash)
qmodel_t *Mod_ForName (const char *name, bool crash)
{
qmodel_t *mod;
@ -403,7 +403,7 @@ byte *mod_base;
Mod_CheckFullbrights -- johnfitz
=================
*/
qboolean Mod_CheckFullbrights (byte *pixels, int count)
bool Mod_CheckFullbrights (byte *pixels, int count)
{
int i;
for (i = 0; i < count; i++)
@ -1141,7 +1141,7 @@ void Mod_CalcSurfaceBounds (msurface_t *s)
Mod_LoadFaces
=================
*/
void Mod_LoadFaces (lump_t *l, qboolean bsp2)
void Mod_LoadFaces (lump_t *l, bool bsp2)
{
dsface_t *ins;
dlface_t *inl;
@ -1609,7 +1609,7 @@ void Mod_LoadLeafs (lump_t *l, int bsp2)
Mod_LoadClipnodes
=================
*/
void Mod_LoadClipnodes (lump_t *l, qboolean bsp2)
void Mod_LoadClipnodes (lump_t *l, bool bsp2)
{
dsclipnode_t *ins;
dlclipnode_t *inl;
@ -2449,7 +2449,7 @@ void Mod_CalcAliasBounds (aliashdr_t *a)
loadmodel->ymaxs[2] = loadmodel->maxs[2];
}
static qboolean
static bool
nameInList(const char *list, const char *name)
{
const char *s;

View File

@ -89,7 +89,7 @@ typedef struct texture_s
struct gltexture_s *gltexture; //johnfitz -- pointer to gltexture
struct gltexture_s *fullbright; //johnfitz -- fullbright mask texture
struct gltexture_s *warpimage; //johnfitz -- for water animation
qboolean update_warp; //johnfitz -- update warp this frame
bool update_warp; //johnfitz -- update warp this frame
struct msurface_s *texturechains[2]; // for texture chains
int anim_total; // total tenths in sequence ( 0 = no)
int anim_min, anim_max; // time for this frame min <=time< max
@ -141,7 +141,7 @@ typedef struct glpoly_s
typedef struct msurface_s
{
int visframe; // should be drawn when node is crossed
qboolean culled; // johnfitz -- for frustum culling
bool culled; // johnfitz -- for frustum culling
float mins[3]; // johnfitz -- for frustum culling
float maxs[3]; // johnfitz -- for frustum culling
@ -171,7 +171,7 @@ typedef struct msurface_s
int lightmaptexturenum;
byte styles[MAXLIGHTMAPS];
int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
qboolean cached_dlight; // true if dynamic light in cache
bool cached_dlight; // true if dynamic light in cache
byte *samples; // [numstyles*surfsize]
} msurface_t;
@ -411,7 +411,7 @@ typedef struct qmodel_s
char name[MAX_QPATH];
uint32_t path_id; // path id of the game directory
// that this model came from
qboolean needload; // bmodels and sprites don't cache normally
bool needload; // bmodels and sprites don't cache normally
modtype_t type;
int numframes;
@ -430,7 +430,7 @@ typedef struct qmodel_s
//
// solid volume for clipping
//
qboolean clipbox;
bool clipbox;
vec3_t clipmins, clipmaxs;
//
@ -480,7 +480,7 @@ typedef struct qmodel_s
byte *lightdata;
char *entities;
qboolean viswarn; // for Mod_DecompressVis()
bool viswarn; // for Mod_DecompressVis()
int bspversion;
@ -506,7 +506,7 @@ typedef struct qmodel_s
void Mod_Init (void);
void Mod_ClearAll (void);
void Mod_ResetAll (void); // for gamedir changes (Host_Game_f)
qmodel_t *Mod_ForName (const char *name, qboolean crash);
qmodel_t *Mod_ForName (const char *name, bool crash);
void *Mod_Extradata (qmodel_t *mod); // handles caching
void Mod_TouchModel (const char *name);

View File

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
qboolean r_cache_thrash; // compatability
bool r_cache_thrash; // compatability
vec3_t modelorg, r_entorigin;
entity_t *currententity;
@ -110,7 +110,7 @@ cvar_t r_slimealpha = {"r_slimealpha","0",CVAR_NONE};
float map_wateralpha, map_lavaalpha, map_telealpha, map_slimealpha;
qboolean r_drawflat_cheatsafe, r_fullbright_cheatsafe, r_lightmap_cheatsafe, r_drawworld_cheatsafe; //johnfitz
bool r_drawflat_cheatsafe, r_fullbright_cheatsafe, r_lightmap_cheatsafe, r_drawworld_cheatsafe; //johnfitz
cvar_t r_scale = {"r_scale", "1", CVAR_ARCHIVE};
@ -268,7 +268,7 @@ R_CullBox -- johnfitz -- replaced with new function from lordhavoc
Returns true if the box is completely outside the frustum
=================
*/
qboolean R_CullBox (vec3_t emins, vec3_t emaxs)
bool R_CullBox (vec3_t emins, vec3_t emaxs)
{
int i;
mplane_t *p;
@ -319,7 +319,7 @@ qboolean R_CullBox (vec3_t emins, vec3_t emaxs)
R_CullModelForEntity -- johnfitz -- uses correct bounds based on rotation
===============
*/
qboolean R_CullModelForEntity (entity_t *e)
bool R_CullModelForEntity (entity_t *e)
{
vec3_t mins, maxs;
@ -616,7 +616,7 @@ void R_SetupView (void)
R_DrawEntitiesOnList
=============
*/
void R_DrawEntitiesOnList (qboolean alphapass) //johnfitz -- added parameter
void R_DrawEntitiesOnList (bool alphapass) //johnfitz -- added parameter
{
int i;

View File

@ -456,7 +456,7 @@ void D_FlushCaches (void)
static GLuint gl_programs[16];
static int gl_num_programs;
static qboolean GL_CheckShader (GLuint shader)
static bool GL_CheckShader (GLuint shader)
{
GLint status;
GL_GetShaderivFunc (shader, GL_COMPILE_STATUS, &status);
@ -475,7 +475,7 @@ static qboolean GL_CheckShader (GLuint shader)
return true;
}
static qboolean GL_CheckProgram (GLuint program)
static bool GL_CheckProgram (GLuint program)
{
GLint status;
GL_GetProgramivFunc (program, GL_LINK_STATUS, &status);

View File

@ -101,7 +101,7 @@ cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", CVAR_ARCHIVE};
extern cvar_t crosshair;
qboolean scr_initialized; // ready to draw
bool scr_initialized; // ready to draw
qpic_t *scr_ram;
qpic_t *scr_net;
@ -112,8 +112,8 @@ int clearnotify;
vrect_t scr_vrect;
qboolean scr_disabled_for_loading;
qboolean scr_drawloading;
bool scr_disabled_for_loading;
bool scr_drawloading;
float scr_disabled_time;
int scr_tileclear_updates = 0; //johnfitz
@ -779,7 +779,7 @@ void SCR_ScreenShot_f (void)
char imagename[16]; //johnfitz -- was [80]
char checkname[MAX_OSPATH];
int i, quality;
qboolean ok;
bool ok;
Q_strncpy (ext, "png", sizeof(ext));
@ -898,7 +898,7 @@ void SCR_EndLoadingPlaque (void)
//=============================================================================
const char *scr_notifystring;
qboolean scr_drawdialog;
bool scr_drawdialog;
void SCR_DrawNotifyString (void)
{

View File

@ -154,7 +154,7 @@ void Sky_LoadSkyBox (const char *name)
int i, mark, width, height;
char filename[MAX_OSPATH];
byte *data;
qboolean nonefound = true;
bool nonefound = true;
if (strcmp(skybox_name, name) == 0)
return; //no change
@ -417,7 +417,7 @@ void Sky_ClipPoly (int nump, vec3_t vecs, int stage)
{
float *norm;
float *v;
qboolean front, back;
bool front, back;
float d, e;
float dists[MAX_CLIP_VERTS];
int sides[MAX_CLIP_VERTS];
@ -566,7 +566,7 @@ void Sky_ProcessEntities (void)
glpoly_t *p;
int i,j,k,mark;
float dot;
qboolean rotated;
bool rotated;
vec3_t temp, forward, right, up;
if (!r_drawentities.value)

View File

@ -349,7 +349,7 @@ gltexture_t *TexMgr_NewTexture (void)
static void GL_DeleteTexture (gltexture_t *texture);
//ericw -- workaround for preventing TexMgr_FreeTexture during TexMgr_ReloadImages
static qboolean in_reload_images;
static bool in_reload_images;
/*
================
@ -753,7 +753,7 @@ static unsigned *TexMgr_MipMapH (unsigned *data, int width, int height)
TexMgr_ResampleTexture -- bilinear resample
================
*/
static unsigned *TexMgr_ResampleTexture (unsigned *in, int inwidth, int inheight, qboolean alpha)
static unsigned *TexMgr_ResampleTexture (unsigned *in, int inwidth, int inheight, bool alpha)
{
byte *nwpx, *nepx, *swpx, *sepx, *dest;
unsigned xfrac, yfrac, x, y, modx, mody, imodx, imody, injump, outjump;
@ -1084,7 +1084,7 @@ TexMgr_LoadImage8 -- handles 8bit source data, then passes it to LoadImage32
static void TexMgr_LoadImage8 (gltexture_t *glt, byte *data)
{
extern cvar_t gl_fullbrights;
qboolean padw = false, padh = false;
bool padw = false, padh = false;
byte padbyte;
uint32_t *usepal;
int i;
@ -1445,7 +1445,7 @@ void TexMgr_ReloadNobrightImages (void)
static GLuint currenttexture[3] = {GL_UNUSED_TEXTURE, GL_UNUSED_TEXTURE, GL_UNUSED_TEXTURE}; // to avoid unnecessary texture sets
static GLenum currenttarget = GL_TEXTURE0_ARB;
qboolean mtexenabled = false;
bool mtexenabled = false;
/*
================

View File

@ -63,13 +63,13 @@ static char * gl_extensions_nice;
static vmode_t modelist[MAX_MODE_LIST];
static int nummodes;
static qboolean vid_initialized = false;
static bool vid_initialized = false;
static SDL_Window *draw_context;
static SDL_GLContext gl_context;
static qboolean vid_locked = false; //johnfitz
static qboolean vid_changed = false;
static bool vid_locked = false; //johnfitz
static bool vid_changed = false;
static void VID_Menu_Init (void); //johnfitz
static void VID_Menu_f (void); //johnfitz
@ -82,20 +82,20 @@ static void GL_SetupState (void); //johnfitz
viddef_t vid; // global video state
modestate_t modestate = MS_UNINIT;
qboolean scr_skipupdate;
bool scr_skipupdate;
qboolean gl_mtexable = false;
qboolean gl_texture_env_combine = false; //johnfitz
qboolean gl_texture_env_add = false; //johnfitz
qboolean gl_swap_control = false; //johnfitz
qboolean gl_anisotropy_able = false; //johnfitz
bool gl_mtexable = false;
bool gl_texture_env_combine = false; //johnfitz
bool gl_texture_env_add = false; //johnfitz
bool gl_swap_control = false; //johnfitz
bool gl_anisotropy_able = false; //johnfitz
float gl_max_anisotropy; //johnfitz
qboolean gl_texture_NPOT = false; //ericw
qboolean gl_vbo_able = false; //ericw
qboolean gl_glsl_able = false; //ericw
bool gl_texture_NPOT = false; //ericw
bool gl_vbo_able = false; //ericw
bool gl_glsl_able = false; //ericw
GLint gl_max_texture_units = 0; //ericw
qboolean gl_glsl_gamma_able = false; //ericw
qboolean gl_glsl_alias_able = false; //ericw
bool gl_glsl_gamma_able = false; //ericw
bool gl_glsl_alias_able = false; //ericw
int gl_stencilbits;
PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc = NULL; //johnfitz
@ -166,7 +166,7 @@ static uint16_t vid_sysgamma_green[256];
static uint16_t vid_sysgamma_blue[256];
#endif
static qboolean gammaworks = false; // whether hw-gamma works
static bool gammaworks = false; // whether hw-gamma works
static int fsaa;
/*
@ -343,7 +343,7 @@ VID_GetFullscreen
returns true if we are in regular fullscreen or "desktop fullscren"
====================
*/
static qboolean VID_GetFullscreen (void)
static bool VID_GetFullscreen (void)
{
return (SDL_GetWindowFlags(draw_context) & SDL_WINDOW_FULLSCREEN) != 0;
}
@ -355,7 +355,7 @@ VID_GetDesktopFullscreen
returns true if we are specifically in "desktop fullscreen" mode
====================
*/
static qboolean VID_GetDesktopFullscreen (void)
static bool VID_GetDesktopFullscreen (void)
{
return (SDL_GetWindowFlags(draw_context) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP;
}
@ -365,7 +365,7 @@ static qboolean VID_GetDesktopFullscreen (void)
VID_GetVSync
====================
*/
static qboolean VID_GetVSync (void)
static bool VID_GetVSync (void)
{
return SDL_GL_GetSwapInterval() == 1;
}
@ -387,7 +387,7 @@ void *VID_GetWindow (void)
VID_HasMouseOrInputFocus
====================
*/
qboolean VID_HasMouseOrInputFocus (void)
bool VID_HasMouseOrInputFocus (void)
{
return (SDL_GetWindowFlags(draw_context) & (SDL_WINDOW_MOUSE_FOCUS | SDL_WINDOW_INPUT_FOCUS)) != 0;
}
@ -397,7 +397,7 @@ qboolean VID_HasMouseOrInputFocus (void)
VID_IsMinimized
====================
*/
qboolean VID_IsMinimized (void)
bool VID_IsMinimized (void)
{
return !(SDL_GetWindowFlags(draw_context) & SDL_WINDOW_SHOWN);
}
@ -440,7 +440,7 @@ static SDL_DisplayMode *VID_SDL2_GetDisplayMode(int width, int height, int refre
VID_ValidMode
================
*/
static qboolean VID_ValidMode (int width, int height, int refreshrate, int bpp, qboolean fullscreen)
static bool VID_ValidMode (int width, int height, int refreshrate, int bpp, bool fullscreen)
{
// ignore width / height / bpp if vid_desktopfullscreen is enabled
if (fullscreen && vid_desktopfullscreen.value)
@ -473,7 +473,7 @@ static qboolean VID_ValidMode (int width, int height, int refreshrate, int bpp,
VID_SetMode
================
*/
static qboolean VID_SetMode (int width, int height, int refreshrate, int bpp, qboolean fullscreen)
static bool VID_SetMode (int width, int height, int refreshrate, int bpp, bool fullscreen)
{
int temp;
Uint32 flags;
@ -640,7 +640,7 @@ VID_Restart -- johnfitz -- change video modes on the fly
static void VID_Restart (void)
{
int width, height, refreshrate, bpp;
qboolean fullscreen;
bool fullscreen;
if (vid_locked || !vid_changed)
return;
@ -830,7 +830,7 @@ static void GL_Info_f (void)
GL_CheckExtensions
===============
*/
static qboolean GL_ParseExtensionList (const char *list, const char *name)
static bool GL_ParseExtensionList (const char *list, const char *name)
{
const char *start;
const char *where, *terminator;
@ -1362,7 +1362,7 @@ void VID_Init (void)
static char vid_center[] = "SDL_VIDEO_CENTERED=center";
int p, width, height, refreshrate, bpp;
int display_width, display_height, display_refreshrate, display_bpp;
qboolean fullscreen;
bool fullscreen;
const char *read_vars[] = { "vid_fullscreen",
"vid_width",
"vid_height",
@ -1536,8 +1536,8 @@ void VID_Toggle (void)
// TODO: Clear out the dead code, reinstate the fast path using SDL_SetWindowFullscreen
// inside VID_SetMode, check window size to fix WinXP issue. This will
// keep all the mode changing code in one place.
static qboolean vid_toggle_works = false;
qboolean toggleWorked;
static bool vid_toggle_works = false;
bool toggleWorked;
Uint32 flags = 0;
S_ClearBuffer ();

View File

@ -102,7 +102,7 @@ typedef struct particle_s
//====================================================
extern qboolean r_cache_thrash; // compatability
extern bool r_cache_thrash; // compatability
extern vec3_t modelorg, r_entorigin;
extern entity_t *currententity;
extern int r_visframecount; // ??? what difs?
@ -158,8 +158,8 @@ extern float load_subdivide_size; //johnfitz -- remember what subdivide_size val
extern int gl_stencilbits;
// Multitexture
extern qboolean mtexenabled;
extern qboolean gl_mtexable;
extern bool mtexenabled;
extern bool gl_mtexable;
extern PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc;
extern PFNGLACTIVETEXTUREARBPROC GL_SelectTextureFunc;
extern PFNGLCLIENTACTIVETEXTUREARBPROC GL_ClientActiveTextureFunc;
@ -169,7 +169,7 @@ extern GLint gl_max_texture_units; //ericw
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
extern float gl_max_anisotropy;
extern qboolean gl_anisotropy_able;
extern bool gl_anisotropy_able;
//ericw -- VBO
extern PFNGLBINDBUFFERARBPROC GL_BindBufferFunc;
@ -177,7 +177,7 @@ extern PFNGLBUFFERDATAARBPROC GL_BufferDataFunc;
extern PFNGLBUFFERSUBDATAARBPROC GL_BufferSubDataFunc;
extern PFNGLDELETEBUFFERSARBPROC GL_DeleteBuffersFunc;
extern PFNGLGENBUFFERSARBPROC GL_GenBuffersFunc;
extern qboolean gl_vbo_able;
extern bool gl_vbo_able;
//ericw
//ericw -- GLSL
@ -230,13 +230,13 @@ extern QS_PFNGLUNIFORM1IPROC GL_Uniform1iFunc;
extern QS_PFNGLUNIFORM1FPROC GL_Uniform1fFunc;
extern QS_PFNGLUNIFORM3FPROC GL_Uniform3fFunc;
extern QS_PFNGLUNIFORM4FPROC GL_Uniform4fFunc;
extern qboolean gl_glsl_able;
extern qboolean gl_glsl_gamma_able;
extern qboolean gl_glsl_alias_able;
extern bool gl_glsl_able;
extern bool gl_glsl_gamma_able;
extern bool gl_glsl_alias_able;
// ericw --
//ericw -- NPOT texture support
extern qboolean gl_texture_NPOT;
extern bool gl_texture_NPOT;
//johnfitz -- polygon offset
#define OFFSET_BMODEL 1
@ -259,8 +259,8 @@ void GL_PolygonOffset (int);
#define GL_SOURCE1_RGB_EXT 0x8581
#define GL_SOURCE0_ALPHA_EXT 0x8588
#define GL_SOURCE1_ALPHA_EXT 0x8589
extern qboolean gl_texture_env_combine;
extern qboolean gl_texture_env_add; // for GL_EXT_texture_env_add
extern bool gl_texture_env_combine;
extern bool gl_texture_env_add; // for GL_EXT_texture_env_add
//johnfitz -- rendering statistics
extern int rs_brushpolys, rs_aliaspolys, rs_skypolys, rs_particles, rs_fogpolys;
@ -297,7 +297,7 @@ extern gltexture_t *lightmap_textures[MAX_LIGHTMAPS]; //johnfitz -- changed to a
extern int gl_warpimagesize; //johnfitz -- for water warp
extern qboolean r_drawflat_cheatsafe, r_fullbright_cheatsafe, r_lightmap_cheatsafe, r_drawworld_cheatsafe; //johnfitz
extern bool r_drawflat_cheatsafe, r_fullbright_cheatsafe, r_lightmap_cheatsafe, r_drawworld_cheatsafe; //johnfitz
typedef struct glsl_attrib_binding_s {
const char *name;
@ -324,9 +324,9 @@ void R_NewGame (void);
void R_AnimateLight (void);
void R_MarkSurfaces (void);
void R_CullSurfaces (void);
qboolean R_CullBox (vec3_t emins, vec3_t emaxs);
bool R_CullBox (vec3_t emins, vec3_t emaxs);
void R_StoreEfrags (efrag_t **ppefrag);
qboolean R_CullModelForEntity (entity_t *e);
bool R_CullModelForEntity (entity_t *e);
void R_RotateForEntity (vec3_t origin, vec3_t angles);
void R_MarkLights (dlight_t *light, int num, mnode_t *node);

View File

@ -39,7 +39,7 @@ Memory is cleared / released when a server or client begins, not when they end.
quakeparms_t *host_parms;
qboolean host_initialized; // true if into command execution
bool host_initialized; // true if into command execution
double host_frametime;
double realtime; // without any filtering or bounding
@ -150,7 +150,7 @@ void Host_Error (const char *error, ...)
{
va_list argptr;
char string[1024];
static qboolean inerror = false;
static bool inerror = false;
if (inerror)
Sys_Error ("Host_Error: recursively entered");
@ -403,7 +403,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 (bool crash)
{
int saveSelf;
int i;
@ -465,7 +465,7 @@ Host_ShutdownServer
This only happens at the end of a game, not between levels
==================
*/
void Host_ShutdownServer(qboolean crash)
void Host_ShutdownServer(bool crash)
{
int i;
int count;
@ -564,7 +564,7 @@ Host_FilterTime
Returns false if the time is too short to run a frame
===================
*/
qboolean Host_FilterTime (float time)
bool Host_FilterTime (float time)
{
float maxfps; //johnfitz
@ -901,7 +901,7 @@ to run quit through here before the final handoff to the sys code.
*/
void Host_Shutdown(void)
{
static qboolean isdown = false;
static bool isdown = false;
if (isdown)
{

View File

@ -561,7 +561,7 @@ void Host_Notarget_f (void)
//johnfitz
}
qboolean noclip_anglehack;
bool noclip_anglehack;
/*
==================
@ -1310,15 +1310,15 @@ void Host_Name_f (void)
MSG_WriteString (&sv.reliable_datagram, host_client->name);
}
void Host_Say(qboolean teamonly)
void Host_Say(bool teamonly)
{
int j;
client_t *client;
client_t *save;
const char *p;
char text[MAXCMDLINE], *p2;
qboolean quoted;
qboolean fromServer = false;
bool quoted;
bool fromServer = false;
if (cmd_source == src_command)
{
@ -1407,7 +1407,7 @@ void Host_Tell_f(void)
client_t *save;
const char *p;
char text[MAXCMDLINE], *p2;
qboolean quoted;
bool quoted;
if (cmd_source == src_command)
{
@ -1762,7 +1762,7 @@ void Host_Kick_f (void)
const char *message = NULL;
client_t *save;
int i;
qboolean byNumber = false;
bool byNumber = false;
if (cmd_source == src_command)
{

View File

@ -144,7 +144,7 @@ returns true if successful
TODO: support BGRA and BGR formats (since opengl can return them, and we don't have to swap)
============
*/
qboolean Image_WriteTGA (const char *name, byte *data, int width, int height, int bpp, qboolean upsidedown)
bool Image_WriteTGA (const char *name, byte *data, int width, int height, int bpp, bool upsidedown)
{
int handle, i, size, temp, bytes;
char pathname[MAX_OSPATH];
@ -195,7 +195,7 @@ byte *Image_LoadTGA (FILE *fin, int *width, int *height)
int row, column;
byte *targa_rgba;
int realrow; //johnfitz -- fix for upside-down targas
qboolean upside_down; //johnfitz -- fix for upside-down targas
bool upside_down; //johnfitz -- fix for upside-down targas
stdio_buffer_t *buf;
targa_header.id_length = fgetc(fin);
@ -509,7 +509,7 @@ Image_WriteJPG -- writes using stb_image_write
returns true if successful
============
*/
qboolean Image_WriteJPG (const char *name, byte *data, int width, int height, int bpp, int quality, qboolean upsidedown)
bool Image_WriteJPG (const char *name, byte *data, int width, int height, int bpp, int quality, bool upsidedown)
{
unsigned error;
char pathname[MAX_OSPATH];
@ -540,7 +540,7 @@ qboolean Image_WriteJPG (const char *name, byte *data, int width, int height, in
return (error != 0);
}
qboolean Image_WritePNG (const char *name, byte *data, int width, int height, int bpp, qboolean upsidedown)
bool Image_WritePNG (const char *name, byte *data, int width, int height, int bpp, bool upsidedown)
{
unsigned error;
char pathname[MAX_OSPATH];

View File

@ -30,9 +30,9 @@ byte *Image_LoadTGA (FILE *f, int *width, int *height);
byte *Image_LoadPCX (FILE *f, int *width, int *height);
byte *Image_LoadImage (const char *name, int *width, int *height);
qboolean Image_WriteTGA (const char *name, byte *data, int width, int height, int bpp, qboolean upsidedown);
qboolean Image_WritePNG (const char *name, byte *data, int width, int height, int bpp, qboolean upsidedown);
qboolean Image_WriteJPG (const char *name, byte *data, int width, int height, int bpp, int quality, qboolean upsidedown);
bool Image_WriteTGA (const char *name, byte *data, int width, int height, int bpp, bool upsidedown);
bool Image_WritePNG (const char *name, byte *data, int width, int height, int bpp, bool upsidedown);
bool Image_WriteJPG (const char *name, byte *data, int width, int height, int bpp, int quality, bool upsidedown);
#endif /* GL_IMAGE_H */

View File

@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#include <SDL.h>
static qboolean textmode;
static bool textmode;
static cvar_t in_debugkeys = {"in_debugkeys", "0", CVAR_NONE};
@ -54,7 +54,7 @@ cvar_t joy_enable = { "joy_enable", "1", CVAR_ARCHIVE };
static SDL_JoystickID joy_active_instaceid = -1;
static SDL_GameController *joy_active_controller = NULL;
static qboolean no_mouse = false;
static bool no_mouse = false;
static int buttonremap[] =
{
@ -197,7 +197,7 @@ void IN_Activate (void)
total_dy = 0;
}
void IN_Deactivate (qboolean free_cursor)
void IN_Deactivate (bool free_cursor)
{
if (no_mouse)
return;
@ -336,7 +336,7 @@ typedef struct joyaxis_s
typedef struct joy_buttonstate_s
{
qboolean buttondown[SDL_CONTROLLER_BUTTON_MAX];
bool buttondown[SDL_CONTROLLER_BUTTON_MAX];
} joybuttonstate_t;
typedef struct axisstate_s
@ -481,7 +481,7 @@ and generates key repeats if the button is held down.
Adapted from DarkPlaces by lordhavoc
================
*/
static void IN_JoyKeyEvent(qboolean wasdown, qboolean isdown, int key, double *timer)
static void IN_JoyKeyEvent(bool wasdown, bool isdown, int key, double *timer)
{
// we can't use `realtime` for key repeats because it is not monotomic
const double currenttime = Sys_DoubleTime();
@ -535,8 +535,8 @@ void IN_Commands (void)
// emit key events for controller buttons
for (i = 0; i < SDL_CONTROLLER_BUTTON_MAX; i++)
{
qboolean newstate = SDL_GameControllerGetButton(joy_active_controller, (SDL_GameControllerButton)i);
qboolean oldstate = joy_buttonstate.buttondown[i];
bool newstate = SDL_GameControllerGetButton(joy_active_controller, (SDL_GameControllerButton)i);
bool oldstate = joy_buttonstate.buttondown[i];
joy_buttonstate.buttondown[i] = newstate;
@ -676,7 +676,7 @@ void IN_ClearStates (void)
void IN_UpdateInputMode (void)
{
qboolean want_textmode = Key_TextEntry();
bool want_textmode = Key_TextEntry();
if (textmode != want_textmode)
{
textmode = want_textmode;
@ -835,7 +835,7 @@ void IN_SendKeyEvents (void)
{
SDL_Event event;
int key;
qboolean down;
bool down;
while (SDL_PollEvent(&event))
{

View File

@ -51,7 +51,7 @@ void IN_ClearStates (void);
void IN_Activate ();
// called when the app becomes inactive
void IN_Deactivate (qboolean free_cursor);
void IN_Deactivate (bool free_cursor);
#endif /* _QUAKE_INPUT_H */

View File

@ -40,9 +40,9 @@ int history_line = 0;
keydest_t key_dest;
char *keybindings[MAX_KEYS];
qboolean consolekeys[MAX_KEYS]; // if true, can't be rebound while in console
qboolean menubound[MAX_KEYS]; // if true, can't be rebound while in menu
qboolean keydown[MAX_KEYS];
bool consolekeys[MAX_KEYS]; // if true, can't be rebound while in console
bool menubound[MAX_KEYS]; // if true, can't be rebound while in menu
bool keydown[MAX_KEYS];
typedef struct
{
@ -449,7 +449,7 @@ void Char_Console (int key)
if (key_linepos < MAXCMDLINE-1)
{
qboolean endpos = !workline[key_linepos];
bool endpos = !workline[key_linepos];
key_tabpartial[0] = 0; //johnfitz
// if inserting, move the text to the right
@ -475,7 +475,7 @@ void Char_Console (int key)
//============================================================================
qboolean chat_team = false;
bool chat_team = false;
static char chat_buffer[MAXCMDLINE];
static int chat_bufferlen = 0;
@ -883,7 +883,7 @@ void Key_Init (void)
}
static struct {
qboolean active;
bool active;
int lastkey;
int lastchar;
} key_inputgrab = { false, -1, -1 };
@ -939,7 +939,7 @@ Called by the system between frames for both key up and key down events
Should NOT be called during an interrupt!
===================
*/
void Key_Event (int key, qboolean down)
void Key_Event (int key, bool down)
{
char *kb;
char cmd[1024];
@ -1124,7 +1124,7 @@ void Char_Event (int key)
Key_TextEntry
===================
*/
qboolean Key_TextEntry (void)
bool Key_TextEntry (void)
{
if (key_inputgrab.active)
return true;
@ -1169,7 +1169,7 @@ Key_UpdateForDest
*/
void Key_UpdateForDest (void)
{
static qboolean forced = false;
static bool forced = false;
if (cls.state == ca_dedicated)
return;

View File

@ -171,7 +171,7 @@ extern int key_linepos;
extern int key_insert;
extern double key_blinktime;
extern qboolean chat_team;
extern bool chat_team;
void Key_Init (void);
void Key_ClearStates (void);
@ -181,9 +181,9 @@ void Key_BeginInputGrab (void);
void Key_EndInputGrab (void);
void Key_GetGrabbedInput (int *lastkey, int *lastchar);
void Key_Event (int key, qboolean down);
void Key_Event (int key, bool down);
void Char_Event (int key);
qboolean Key_TextEntry (void);
bool Key_TextEntry (void);
void Key_SetBinding (int keynum, const char *binding);
const char *Key_KeynumToString (int keynum);

View File

@ -80,12 +80,12 @@ void M_Main_Key (int key);
void M_Help_Key (int key);
void M_Quit_Key (int key);
qboolean m_entersound; // play after drawing a frame, so caching
bool m_entersound; // play after drawing a frame, so caching
// won't disrupt the sound
qboolean m_recursiveDraw;
bool m_recursiveDraw;
enum m_state_e m_return_state;
qboolean m_return_onerror;
bool m_return_onerror;
char m_return_reason [32];
#define StartingGame (m_multiplayer_cursor == 1)
@ -855,7 +855,7 @@ void M_Setup_Char (int k)
}
qboolean M_Setup_TextEntry (void)
bool M_Setup_TextEntry (void)
{
return (setup_cursor == 0 || setup_cursor == 1);
}
@ -1359,7 +1359,7 @@ const char *bindnames[][2] =
#define NUMCOMMANDS (sizeof(bindnames)/sizeof(bindnames[0]))
static int keys_cursor;
static qboolean bind_grab;
static bool bind_grab;
void M_Menu_Keys_f (void)
{
@ -1607,7 +1607,7 @@ void M_Help_Key (int key)
int msgNumber;
enum m_state_e m_quit_prevstate;
qboolean wasInMenus;
bool wasInMenus;
void M_Menu_Quit_f (void)
{
@ -1675,7 +1675,7 @@ void M_Quit_Char (int key)
}
qboolean M_Quit_TextEntry (void)
bool M_Quit_TextEntry (void)
{
return true;
}
@ -1923,7 +1923,7 @@ void M_LanConfig_Char (int key)
}
qboolean M_LanConfig_TextEntry (void)
bool M_LanConfig_TextEntry (void)
{
return (lanConfig_cursor == 0 || lanConfig_cursor == 2);
}
@ -2078,7 +2078,7 @@ episode_t rogueepisodes[] =
int startepisode;
int startlevel;
int maxplayers;
qboolean m_serverInfoMessage = false;
bool m_serverInfoMessage = false;
double m_serverInfoMessageTime;
void M_Menu_GameOptions_f (void)
@ -2385,7 +2385,7 @@ void M_GameOptions_Key (int key)
//=============================================================================
/* SEARCH MENU */
qboolean searchComplete = false;
bool searchComplete = false;
double searchCompleteTime;
void M_Menu_Search_f (void)
@ -2448,7 +2448,7 @@ void M_Search_Key (int key)
/* SLIST MENU */
int slist_cursor;
qboolean slist_sorted;
bool slist_sorted;
void M_Menu_ServerList_f (void)
{
@ -2756,7 +2756,7 @@ void M_Charinput (int key)
}
qboolean M_TextEntry (void)
bool M_TextEntry (void)
{
switch (m_state)
{

View File

@ -46,7 +46,7 @@ enum m_state_e {
extern enum m_state_e m_state;
extern enum m_state_e m_return_state;
extern qboolean m_entersound;
extern bool m_entersound;
//
// menus
@ -54,7 +54,7 @@ extern qboolean m_entersound;
void M_Init (void);
void M_Keydown (int key);
void M_Charinput (int key);
qboolean M_TextEntry (void);
bool M_TextEntry (void);
void M_ToggleMenu_f (void);
void M_Menu_Main_f (void);

View File

@ -58,7 +58,7 @@ struct qsocket_s *NET_Connect (const char *host);
double NET_QSocketGetTime (const struct qsocket_s *sock);
const char *NET_QSocketGetAddressString (const struct qsocket_s *sock);
qboolean NET_CanSendMessage (struct qsocket_s *sock);
bool NET_CanSendMessage (struct qsocket_s *sock);
// Returns true or false if the given qsocket can currently accept a
// message to be transmitted.
@ -92,9 +92,9 @@ void NET_Poll (void);
// Server list related globals:
extern qboolean slistInProgress;
extern qboolean slistSilent;
extern qboolean slistLocal;
extern bool slistInProgress;
extern bool slistSilent;
extern bool slistLocal;
extern int hostCacheCount;
@ -106,8 +106,8 @@ const char *NET_SlistPrintServerName (int n);
/* FIXME: driver related, but public:
*/
extern qboolean ipxAvailable;
extern qboolean tcpipAvailable;
extern bool ipxAvailable;
extern bool tcpipAvailable;
extern char my_ipx_address[NET_NAMELEN];
extern char my_tcpip_address[NET_NAMELEN];

View File

@ -134,9 +134,9 @@ typedef struct qsocket_s
double lastMessageTime;
double lastSendTime;
qboolean disconnected;
qboolean canSend;
qboolean sendNext;
bool disconnected;
bool canSend;
bool sendNext;
int driver;
int landriver;
@ -166,11 +166,11 @@ extern int net_numsockets;
typedef struct
{
const char *name;
qboolean initialized;
bool initialized;
sys_socket_t controlSock;
sys_socket_t (*Init) (void);
void (*Shutdown) (void);
void (*Listen) (qboolean state);
void (*Listen) (bool state);
sys_socket_t (*Open_Socket) (int port);
int (*Close_Socket) (sys_socket_t socketid);
int (*Connect) (sys_socket_t socketid, struct qsockaddr *addr);
@ -195,17 +195,17 @@ extern const int net_numlandrivers;
typedef struct
{
const char *name;
qboolean initialized;
bool initialized;
int (*Init) (void);
void (*Listen) (qboolean state);
void (*SearchForHosts) (qboolean xmit);
void (*Listen) (bool state);
void (*SearchForHosts) (bool xmit);
qsocket_t *(*Connect) (const char *host);
qsocket_t *(*CheckNewConnections) (void);
int (*QGetMessage) (qsocket_t *sock);
int (*QSendMessage) (qsocket_t *sock, sizebuf_t *data);
int (*SendUnreliableMessage) (qsocket_t *sock, sizebuf_t *data);
qboolean (*CanSendMessage) (qsocket_t *sock);
qboolean (*CanSendUnreliableMessage) (qsocket_t *sock);
bool (*CanSendMessage) (qsocket_t *sock);
bool (*CanSendUnreliableMessage) (qsocket_t *sock);
void (*Close) (qsocket_t *sock);
void (*Shutdown) (void);
} net_driver_t;

View File

@ -52,7 +52,7 @@ static struct
static int myDriverLevel;
extern qboolean m_return_onerror;
extern bool m_return_onerror;
extern char m_return_reason[32];
@ -242,7 +242,7 @@ static int ReSendMessage (qsocket_t *sock)
}
qboolean Datagram_CanSendMessage (qsocket_t *sock)
bool Datagram_CanSendMessage (qsocket_t *sock)
{
if (sock->sendNext)
SendMessageNext (sock);
@ -251,7 +251,7 @@ qboolean Datagram_CanSendMessage (qsocket_t *sock)
}
qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock)
bool Datagram_CanSendUnreliableMessage (qsocket_t *sock)
{
(void)sock;
return true;
@ -515,7 +515,7 @@ static const char *Strip_Port (const char *host)
}
static qboolean testInProgress = false;
static bool testInProgress = false;
static int testPollCount;
static int testDriver;
static sys_socket_t testSocket;
@ -651,7 +651,7 @@ JustDoIt:
}
static qboolean test2InProgress = false;
static bool test2InProgress = false;
static int test2Driver;
static sys_socket_t test2Socket;
@ -847,7 +847,7 @@ void Datagram_Close (qsocket_t *sock)
}
void Datagram_Listen (qboolean state)
void Datagram_Listen (bool state)
{
int i;
@ -1121,7 +1121,7 @@ qsocket_t *Datagram_CheckNewConnections (void)
}
static void _Datagram_SearchForHosts (qboolean xmit)
static void _Datagram_SearchForHosts (bool xmit)
{
int ret;
int n;
@ -1223,7 +1223,7 @@ static void _Datagram_SearchForHosts (qboolean xmit)
}
}
void Datagram_SearchForHosts (qboolean xmit)
void Datagram_SearchForHosts (bool xmit)
{
for (net_landriverlevel = 0; net_landriverlevel < net_numlandrivers; net_landriverlevel++)
{

View File

@ -23,15 +23,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define __NET_DATAGRAM_H
int Datagram_Init (void);
void Datagram_Listen (qboolean state);
void Datagram_SearchForHosts (qboolean xmit);
void Datagram_Listen (bool state);
void Datagram_SearchForHosts (bool xmit);
qsocket_t *Datagram_Connect (const char *host);
qsocket_t *Datagram_CheckNewConnections (void);
int Datagram_GetMessage (qsocket_t *sock);
int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data);
int Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data);
qboolean Datagram_CanSendMessage (qsocket_t *sock);
qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock);
bool Datagram_CanSendMessage (qsocket_t *sock);
bool Datagram_CanSendUnreliableMessage (qsocket_t *sock);
void Datagram_Close (qsocket_t *sock);
void Datagram_Shutdown (void);

View File

@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "net_defs.h"
#include "net_loop.h"
static qboolean localconnectpending = false;
static bool localconnectpending = false;
static qsocket_t *loop_client = NULL;
static qsocket_t *loop_server = NULL;
@ -43,13 +43,13 @@ void Loop_Shutdown (void)
}
void Loop_Listen (qboolean state)
void Loop_Listen (bool state)
{
(void)state;
}
void Loop_SearchForHosts (qboolean xmit)
void Loop_SearchForHosts (bool xmit)
{
(void)xmit;
@ -224,7 +224,7 @@ int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
}
qboolean Loop_CanSendMessage (qsocket_t *sock)
bool Loop_CanSendMessage (qsocket_t *sock)
{
if (!sock->driverdata)
return false;
@ -232,7 +232,7 @@ qboolean Loop_CanSendMessage (qsocket_t *sock)
}
qboolean Loop_CanSendUnreliableMessage (qsocket_t *sock)
bool Loop_CanSendUnreliableMessage (qsocket_t *sock)
{
(void)sock;
return true;

View File

@ -24,15 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// net_loop.h
int Loop_Init (void);
void Loop_Listen (qboolean state);
void Loop_SearchForHosts (qboolean xmit);
void Loop_Listen (bool state);
void Loop_SearchForHosts (bool xmit);
qsocket_t *Loop_Connect (const char *host);
qsocket_t *Loop_CheckNewConnections (void);
int Loop_GetMessage (qsocket_t *sock);
int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data);
int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data);
qboolean Loop_CanSendMessage (qsocket_t *sock);
qboolean Loop_CanSendUnreliableMessage (qsocket_t *sock);
bool Loop_CanSendMessage (qsocket_t *sock);
bool Loop_CanSendUnreliableMessage (qsocket_t *sock);
void Loop_Close (qsocket_t *sock);
void Loop_Shutdown (void);

View File

@ -29,8 +29,8 @@ qsocket_t *net_activeSockets = NULL;
qsocket_t *net_freeSockets = NULL;
int net_numsockets = 0;
qboolean ipxAvailable = false;
qboolean tcpipAvailable = false;
bool ipxAvailable = false;
bool tcpipAvailable = false;
int net_hostport;
int DEFAULTnet_hostport = 26000;
@ -38,11 +38,11 @@ int DEFAULTnet_hostport = 26000;
char my_ipx_address[NET_NAMELEN];
char my_tcpip_address[NET_NAMELEN];
static qboolean listening = false;
static bool listening = false;
qboolean slistInProgress = false;
qboolean slistSilent = false;
qboolean slistLocal = true;
bool slistInProgress = false;
bool slistSilent = false;
bool slistLocal = true;
static double slistStartTime;
static int slistLastShown;
@ -660,7 +660,7 @@ Returns true or false if the given qsocket can currently accept a
message to be transmitted.
==================
*/
qboolean NET_CanSendMessage (qsocket_t *sock)
bool NET_CanSendMessage (qsocket_t *sock)
{
if (!sock)
return false;
@ -679,8 +679,8 @@ int NET_SendToAll (sizebuf_t *data, double blocktime)
double start;
int i;
int count = 0;
qboolean msg_init[MAX_SCOREBOARD]; /* did we write the message to the client's connection */
qboolean msg_sent[MAX_SCOREBOARD]; /* did the msg arrive its destination (canSend state). */
bool msg_init[MAX_SCOREBOARD]; /* did we write the message to the client's connection */
bool msg_sent[MAX_SCOREBOARD]; /* did the msg arrive its destination (canSend state). */
for (i = 0, host_client = svs.clients; i < svs.maxclients; i++, host_client++)
{

View File

@ -166,7 +166,7 @@ static void PF_setorigin (void)
}
static void SetMinMaxSize (edict_t *e, float *minvec, float *maxvec, qboolean rotate)
static void SetMinMaxSize (edict_t *e, float *minvec, float *maxvec, bool rotate)
{
float *angles;
vec3_t rmin, rmax;

View File

@ -34,7 +34,7 @@ static int pr_numknownstrings;
static ddef_t *pr_fielddefs;
static ddef_t *pr_globaldefs;
qboolean pr_alpha_supported; //johnfitz
bool pr_alpha_supported; //johnfitz
dstatement_t *pr_statements;
globalvars_t *pr_global_struct;
@ -55,7 +55,7 @@ int type_size[8] = {
};
static ddef_t *ED_FieldAtOfs (int ofs);
static qboolean ED_ParseEpair (void *base, ddef_t *key, const char *s);
static bool ED_ParseEpair (void *base, ddef_t *key, const char *s);
#define MAX_FIELD_LEN 64
#define GEFV_CACHESIZE 2
@ -771,7 +771,7 @@ Can parse either fields or globals
returns false if error
=============
*/
static qboolean ED_ParseEpair (void *base, ddef_t *key, const char *s)
static bool ED_ParseEpair (void *base, ddef_t *key, const char *s)
{
int i;
char string[128];
@ -863,7 +863,7 @@ const char *ED_ParseEdict (const char *data, edict_t *ent)
{
ddef_t *key;
char keyname[256];
qboolean anglehack, init;
bool anglehack, init;
int n;
init = false;

View File

@ -35,7 +35,7 @@ static int pr_depth;
static int localstack[LOCALSTACK_SIZE];
static int localstack_used;
qboolean pr_trace;
bool pr_trace;
dfunction_t *pr_xfunction;
int pr_xstatement;
int pr_argc;

View File

@ -39,7 +39,7 @@ typedef union eval_s
#define MAX_ENT_LEAFS 32
typedef struct edict_s
{
qboolean free;
bool free;
link_t area; /* linked to a division node or leaf */
int num_leafs;
@ -47,7 +47,7 @@ typedef struct edict_s
entity_state_t baseline;
uint8_t alpha; /* johnfitz -- hack to support alpha since it's not part of entvars_t */
qboolean sendinterval; /* johnfitz -- send time until nextthink to client for better lerp timing */
bool sendinterval; /* johnfitz -- send time until nextthink to client for better lerp timing */
float freetime; /* sv.time when the object was freed */
entvars_t v; /* C exported fields from progs */
@ -124,7 +124,7 @@ extern int pr_numbuiltins;
extern int pr_argc;
extern qboolean pr_trace;
extern bool pr_trace;
extern dfunction_t *pr_xfunction;
extern int pr_xstatement;

View File

@ -95,7 +95,7 @@ void S_Shutdown (void);
void S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void S_StopSound (int entnum, int entchannel);
void S_StopAllSounds(qboolean clear);
void S_StopAllSounds(bool clear);
void S_ClearBuffer (void);
void S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up);
void S_ExtraUpdate (void);
@ -122,7 +122,7 @@ void S_RawSamples(int samples, int rate, int width, int channels, byte * data, f
/* Expects data in signed 16 bit, or unsigned 8 bit format. */
/* initializes cycling through a DMA buffer and returns information on it */
qboolean SNDDMA_Init(dma_t *dma);
bool SNDDMA_Init(dma_t *dma);
/* gets the current DMA position */
int SNDDMA_GetDMAPos(void);

View File

@ -31,6 +31,7 @@
#include <sys/types.h>
#include <stddef.h>
#include <stdbool.h>
#include <limits.h>
#ifndef _WIN32 /* others we support without sys/param.h? */
#include <sys/param.h>
@ -67,29 +68,20 @@
/*==========================================================================*/
/* Make sure the types really have the right
* sizes: These macros are from SDL headers.
*/
_Static_assert(sizeof(char) == 1, "char not correct size");
_Static_assert(sizeof(float) == 4, "float not correct size");
_Static_assert(sizeof(long) >= 4, "long not correct size");
_Static_assert(sizeof(int) == 4, "int not correct size");
/* make sure enums are the size of ints for structure packing */
typedef enum {
THE_DUMMY_VALUE
} THE_DUMMY_ENUM;
_Static_assert(sizeof(THE_DUMMY_ENUM) == sizeof(int), "enum not sizeof(int)");
enum dummy_enum {
dummy_value
};
_Static_assert(sizeof(enum dummy_enum) == sizeof(int), "enum not sizeof(int)");
/*==========================================================================*/
typedef uint8_t byte;
typedef enum {
false = 0,
true = 1
} qboolean;
/*==========================================================================*/
/* math */

View File

@ -239,7 +239,7 @@ typedef struct
// command line parms passed to the program, and the amount of memory
// available for the program to use
extern qboolean noclip_anglehack;
extern bool noclip_anglehack;
//
// host
@ -252,7 +252,7 @@ extern cvar_t sys_nostdout;
extern cvar_t developer;
extern cvar_t max_edicts; //johnfitz
extern qboolean host_initialized; // true if into command execution
extern bool host_initialized; // true if into command execution
extern double host_frametime;
extern byte *host_colormap;
extern int host_framecount; // incremented every frame, never reset
@ -284,7 +284,7 @@ FUNC_NORETURN void Host_EndGame (const char *message, ...) FUNC_PRINTF(1,2);
void Host_Frame (float time);
void Host_Quit_f (void);
void Host_ClientCommands (const char *fmt, ...) FUNC_PRINTF(1,2);
void Host_ShutdownServer (qboolean crash);
void Host_ShutdownServer (bool crash);
void Host_WriteConfiguration (void);
void ExtraMaps_Init (void);
@ -297,7 +297,7 @@ extern int current_skill; // skill level for currently loaded level (in case
// the user changes the cvar while the level is
// running, this reflects the level actually in use)
extern qboolean isDedicated;
extern bool isDedicated;
extern int minimum_memory;

View File

@ -52,9 +52,9 @@ vec3_t shadevector;
float entalpha; //johnfitz
qboolean overbright; //johnfitz
bool overbright; //johnfitz
qboolean shading = true; //johnfitz -- if false, disable vertex shading for various reasons (fullbright, r_lightmap, showtris, etc)
bool shading = true; //johnfitz -- if false, disable vertex shading for various reasons (fullbright, r_lightmap, showtris, etc)
//johnfitz -- struct for passing lerp information to drawing functions
typedef struct {
@ -305,7 +305,7 @@ void GL_DrawAliasFrame (aliashdr_t *paliashdr, lerpdata_t lerpdata)
int count;
float u,v;
float blend, iblend;
qboolean lerping;
bool lerping;
if (lerpdata.pose1 != lerpdata.pose2)
{
@ -628,7 +628,7 @@ void R_DrawAliasModel (entity_t *e)
int i, anim, skinnum;
gltexture_t *tx, *fb;
lerpdata_t lerpdata;
qboolean alphatest = !!(e->model->flags & MF_HOLEY);
bool alphatest = !!(e->model->flags & MF_HOLEY);
//
// setup pose/lerp data -- do it first so we don't miss updates due to culling

View File

@ -42,7 +42,7 @@ typedef struct glRect_s {
} glRect_t;
glpoly_t *lightmap_polys[MAX_LIGHTMAPS];
qboolean lightmap_modified[MAX_LIGHTMAPS];
bool lightmap_modified[MAX_LIGHTMAPS];
glRect_t lightmap_rectchange[MAX_LIGHTMAPS];
int allocated[MAX_LIGHTMAPS][BLOCK_WIDTH];

View File

@ -82,7 +82,7 @@ void R_MarkSurfaces (void)
mnode_t *node;
msurface_t *surf, **mark;
int i, j;
qboolean nearwaterportal;
bool nearwaterportal;
// clear lightmap chains
memset (lightmap_polys, 0, sizeof(lightmap_polys));
@ -169,7 +169,7 @@ void R_MarkSurfaces (void)
R_BackFaceCull -- johnfitz -- returns true if the surface is facing away from vieworg
================
*/
qboolean R_BackFaceCull (msurface_t *surf)
bool R_BackFaceCull (msurface_t *surf)
{
double dot;
@ -397,7 +397,7 @@ void R_DrawTextureChains_Glow (qmodel_t *model, entity_t *ent, texchain_t chain)
msurface_t *s;
texture_t *t;
gltexture_t *glt;
qboolean bound;
bool bound;
for (i=0 ; i<model->numtextures ; i++)
{
@ -515,7 +515,7 @@ void R_DrawTextureChains_Multitexture (qmodel_t *model, entity_t *ent, texchain_
msurface_t *s;
texture_t *t;
float *v;
qboolean bound;
bool bound;
for (i=0 ; i<model->numtextures ; i++)
{
@ -569,7 +569,7 @@ void R_DrawTextureChains_NoTexture (qmodel_t *model, texchain_t chain)
int i;
msurface_t *s;
texture_t *t;
qboolean bound;
bool bound;
for (i=0 ; i<model->numtextures ; i++)
{
@ -604,7 +604,7 @@ void R_DrawTextureChains_TextureOnly (qmodel_t *model, entity_t *ent, texchain_t
int i;
msurface_t *s;
texture_t *t;
qboolean bound;
bool bound;
for (i=0 ; i<model->numtextures ; i++)
{
@ -664,7 +664,7 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain
msurface_t *s;
texture_t *t;
glpoly_t *p;
qboolean bound;
bool bound;
float entalpha;
if (r_drawflat_cheatsafe || r_lightmap_cheatsafe) // ericw -- !r_drawworld_cheatsafe check moved to R_DrawWorld_Water ()
@ -906,7 +906,7 @@ void R_DrawTextureChains_GLSL (qmodel_t *model, entity_t *ent, texchain_t chain)
int i;
msurface_t *s;
texture_t *t;
qboolean bound;
bool bound;
int lastlightmap;
gltexture_t *fullbright = NULL;
float entalpha;

View File

@ -48,7 +48,7 @@ typedef struct efrag_s
typedef struct entity_s
{
qboolean forcelink; // model changed
bool forcelink; // model changed
int update_type;
@ -166,7 +166,7 @@ void R_PushDlights (void);
// surface cache related
//
extern int reinit_surfcache; // if 1, surface cache is currently empty and
extern qboolean r_cache_thrash; // set if thrashing the surface cache
extern bool r_cache_thrash; // set if thrashing the surface cache
int D_SurfaceCacheForRes (int width, int height);
void D_FlushCaches (void);

View File

@ -46,7 +46,7 @@ qpic_t *sb_face_quad;
qpic_t *sb_face_invuln;
qpic_t *sb_face_invis_invuln;
qboolean sb_showscores;
bool sb_showscores;
int sb_lines; // scan lines to draw

View File

@ -47,8 +47,8 @@ extern float scr_conlines; // lines of console to display
extern int sb_lines;
extern int clearnotify; // set to 0 whenever notify text is drawn
extern qboolean scr_disabled_for_loading;
extern qboolean scr_skipupdate;
extern bool scr_disabled_for_loading;
extern bool scr_skipupdate;
extern cvar_t scr_viewsize;

View File

@ -31,7 +31,7 @@ typedef struct
int maxclientslimit;
struct client_s *clients; // [maxclients]
int serverflags; // episode completion information
qboolean changelevel_issued; // cleared when at SV_SpawnServer
bool changelevel_issued; // cleared when at SV_SpawnServer
} server_static_t;
//=============================================================================
@ -40,10 +40,10 @@ typedef enum {ss_loading, ss_active} server_state_t;
typedef struct
{
qboolean active; // false if only a net client
bool active; // false if only a net client
qboolean paused;
qboolean loadgame; // handle connections specially
bool paused;
bool loadgame; // handle connections specially
double time;
@ -83,10 +83,10 @@ typedef struct
typedef struct client_s
{
qboolean active; // false = client is free
qboolean spawned; // false = don't send datagrams
qboolean dropasap; // has been told to go to another level
qboolean sendsignon; // only valid before spawned
bool active; // false = client is free
bool spawned; // false = don't send datagrams
bool dropasap; // has been told to go to another level
bool sendsignon; // only valid before spawned
double last_message; // reliable messages must be sent
// periodically
@ -197,7 +197,7 @@ void SV_StartParticle (vec3_t org, vec3_t dir, int color, int count);
void SV_StartSound (edict_t *entity, int channel, const char *sample, int volume,
float attenuation);
void SV_DropClient (qboolean crash);
void SV_DropClient (bool crash);
void SV_SendClientMessages (void);
void SV_ClearDatagram (void);
@ -216,8 +216,8 @@ void SV_BroadcastPrintf (const char *fmt, ...) FUNC_PRINTF(1,2);
void SV_Physics (void);
qboolean SV_CheckBottom (edict_t *ent);
qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink);
bool SV_CheckBottom (edict_t *ent);
bool SV_movestep (edict_t *ent, vec3_t move, bool relink);
void SV_WriteClientdataToMessage (edict_t *ent, sizebuf_t *msg);

View File

@ -225,7 +225,7 @@ snd_stream_t *S_CodecOpenStreamAny (const char *filename)
}
}
qboolean S_CodecForwardStream (snd_stream_t *stream, uint32_t type)
bool S_CodecForwardStream (snd_stream_t *stream, uint32_t type)
{
snd_codec_t *codec = codecs;
@ -262,7 +262,7 @@ snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec)
{
snd_stream_t *stream;
FILE *handle;
qboolean pak;
bool pak;
long length;
/* Try to open the file */

View File

@ -49,7 +49,7 @@ typedef struct snd_codec_s snd_codec_t;
typedef struct snd_stream_s
{
fshandle_t fh;
qboolean pak;
bool pak;
char name[MAX_QPATH]; /* name of the source file */
snd_info_t info;
stream_status_t status;

View File

@ -27,9 +27,9 @@
#define _SND_CODECI_H_
/* Codec internals */
typedef qboolean (*CODEC_INIT)(void);
typedef bool (*CODEC_INIT)(void);
typedef void (*CODEC_SHUTDOWN)(void);
typedef qboolean (*CODEC_OPEN)(snd_stream_t *stream);
typedef bool (*CODEC_OPEN)(snd_stream_t *stream);
typedef int (*CODEC_READ)(snd_stream_t *stream, int bytes, void *buffer);
typedef int (*CODEC_REWIND)(snd_stream_t *stream);
typedef void (*CODEC_CLOSE)(snd_stream_t *stream);
@ -37,7 +37,7 @@ typedef void (*CODEC_CLOSE)(snd_stream_t *stream);
struct snd_codec_s
{
uint32_t type; /* handled data type. (1U << n) */
qboolean initialized; /* init succeedded */
bool initialized; /* init succeedded */
const char *ext; /* expected extension */
CODEC_INIT initialize;
CODEC_SHUTDOWN shutdown;
@ -48,7 +48,7 @@ struct snd_codec_s
snd_codec_t *next;
};
qboolean S_CodecForwardStream (snd_stream_t *stream, uint32_t type);
bool S_CodecForwardStream (snd_stream_t *stream, uint32_t type);
/* Forward a stream to another codec of 'type' type. */
#endif /* _SND_CODECI_H_ */

View File

@ -32,7 +32,7 @@ static void S_Play (void);
static void S_PlayVol (void);
static void S_SoundList (void);
static void S_Update_ (void);
void S_StopAllSounds (qboolean clear);
void S_StopAllSounds (bool clear);
static void S_StopAllSoundsC (void);
// =======================================================================
@ -43,7 +43,7 @@ channel_t snd_channels[MAX_CHANNELS];
int total_channels;
static int snd_blocked = 0;
static qboolean snd_initialized = false;
static bool snd_initialized = false;
static dma_t sn;
volatile dma_t *shm = NULL;
@ -68,7 +68,7 @@ static int num_sfx;
static sfx_t *ambient_sfx[NUM_AMBIENTS];
static qboolean sound_started = false;
static bool sound_started = false;
cvar_t bgmvolume = {"bgmvolume", "1", CVAR_ARCHIVE};
cvar_t sfxvolume = {"volume", "0.7", CVAR_ARCHIVE};
@ -532,7 +532,7 @@ void S_StopSound (int entnum, int entchannel)
}
}
void S_StopAllSounds (qboolean clear)
void S_StopAllSounds (bool clear)
{
int i;

View File

@ -232,7 +232,7 @@ flac_meta_func (const FLAC__StreamDecoder *decoder,
}
static qboolean S_FLAC_CodecInitialize (void)
static bool S_FLAC_CodecInitialize (void)
{
return true;
}
@ -241,7 +241,7 @@ static void S_FLAC_CodecShutdown (void)
{
}
static qboolean S_FLAC_CodecOpenStream (snd_stream_t *stream)
static bool S_FLAC_CodecOpenStream (snd_stream_t *stream)
{
flacfile_t *ff;
int rc;

View File

@ -78,7 +78,7 @@ static BOOL MIK_Eof (MREADER *r)
return FS_feof(((mik_priv_t *)r)->fh);
}
static qboolean S_MIKMOD_CodecInitialize (void)
static bool S_MIKMOD_CodecInitialize (void)
{
if (mikmod_codec.initialized)
return true;
@ -126,7 +126,7 @@ static void S_MIKMOD_CodecShutdown (void)
}
}
static qboolean S_MIKMOD_CodecOpenStream (snd_stream_t *stream)
static bool S_MIKMOD_CodecOpenStream (snd_stream_t *stream)
{
mik_priv_t *priv;

View File

@ -67,7 +67,7 @@ typedef struct _mp3_priv_t
/* This function merges the functions tagtype() and id3_tag_query()
* from MAD's libid3tag, so we don't have to link to it
* Returns 0 if the frame is not an ID3 tag, tag length if it is */
static inline qboolean tag_is_id3v1(const uint8_t *data, size_t length)
static inline bool tag_is_id3v1(const uint8_t *data, size_t length)
{
if (length >= 3 &&
data[0] == 'T' && data[1] == 'A' && data[2] == 'G')
@ -77,7 +77,7 @@ static inline qboolean tag_is_id3v1(const uint8_t *data, size_t length)
return false;
}
static inline qboolean tag_is_id3v2(const uint8_t *data, size_t length)
static inline bool tag_is_id3v2(const uint8_t *data, size_t length)
{
if (length >= 10 &&
(data[0] == 'I' && data[1] == 'D' && data[2] == '3') &&
@ -93,7 +93,7 @@ static inline qboolean tag_is_id3v2(const uint8_t *data, size_t length)
* http://wiki.hydrogenaud.io/index.php?title=APEv2_specification
* Detect an APEv2 tag. (APEv1 has no header, so no luck.)
*/
static inline qboolean tag_is_apetag(const uint8_t *data, size_t length)
static inline bool tag_is_apetag(const uint8_t *data, size_t length)
{
uint32_t v;
@ -394,7 +394,7 @@ static int mp3_madseek(snd_stream_t *stream, unsigned long offset)
size_t initial_bitrate = p->Frame.header.bitrate;
size_t tagsize = 0, consumed = 0;
int vbr = 0; /* Variable Bit Rate, bool */
qboolean depadded = false;
bool depadded = false;
unsigned long to_skip_samples = 0;
/* Reset all */
@ -509,7 +509,7 @@ static int mp3_madseek(snd_stream_t *stream, unsigned long offset)
return -1;
}
static qboolean S_MP3_CodecInitialize (void)
static bool S_MP3_CodecInitialize (void)
{
return true;
}
@ -518,7 +518,7 @@ static void S_MP3_CodecShutdown (void)
{
}
static qboolean S_MP3_CodecOpenStream (snd_stream_t *stream)
static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
{
int err;

View File

@ -61,7 +61,7 @@ static off_t mp3_seek (void *f, off_t offset, int whence)
return (off_t) FS_ftell((fshandle_t *)f);
}
static qboolean S_MP3_CodecInitialize (void)
static bool S_MP3_CodecInitialize (void)
{
if (!mp3_codec.initialized)
{
@ -86,7 +86,7 @@ static void S_MP3_CodecShutdown (void)
}
}
static qboolean S_MP3_CodecOpenStream (snd_stream_t *stream)
static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
{
long rate = 0;
int encoding = 0, channels = 0;

View File

@ -75,7 +75,7 @@ static const OpusFileCallbacks opc_qfs =
(int (*)(void *)) opc_fclose
};
static qboolean S_OPUS_CodecInitialize (void)
static bool S_OPUS_CodecInitialize (void)
{
return true;
}
@ -84,7 +84,7 @@ static void S_OPUS_CodecShutdown (void)
{
}
static qboolean S_OPUS_CodecOpenStream (snd_stream_t *stream)
static bool S_OPUS_CodecOpenStream (snd_stream_t *stream)
{
OggOpusFile *opFile;
const OpusHead *op_info;

View File

@ -72,7 +72,7 @@ static void SDLCALL paint_audio (void *unused, Uint8 *stream, int len)
shm->samplepos = 0;
}
qboolean SNDDMA_Init (dma_t *dma)
bool SNDDMA_Init (dma_t *dma)
{
SDL_AudioSpec desired, obtained;
int tmp, val;

View File

@ -334,7 +334,7 @@ static int process_upkg (fshandle_t *f, int32_t *ofs, int32_t *objsize)
return probe_umx(f, (struct upkg_hdr *)header, ofs, objsize);
}
static qboolean S_UMX_CodecInitialize (void)
static bool S_UMX_CodecInitialize (void)
{
return true;
}
@ -343,7 +343,7 @@ static void S_UMX_CodecShutdown (void)
{
}
static qboolean S_UMX_CodecOpenStream (snd_stream_t *stream)
static bool S_UMX_CodecOpenStream (snd_stream_t *stream)
{
int type;
int32_t ofs = 0, size = 0;

View File

@ -65,7 +65,7 @@ static ov_callbacks ovc_qfs =
(long (*)(void *)) FS_ftell
};
static qboolean S_VORBIS_CodecInitialize (void)
static bool S_VORBIS_CodecInitialize (void)
{
return true;
}
@ -74,7 +74,7 @@ static void S_VORBIS_CodecShutdown (void)
{
}
static qboolean S_VORBIS_CodecOpenStream (snd_stream_t *stream)
static bool S_VORBIS_CodecOpenStream (snd_stream_t *stream)
{
OggVorbis_File *ovFile;
vorbis_info *ovf_info;

View File

@ -30,7 +30,7 @@ static char localmodels[MAX_MODELS][8]; // inline model names for precache
int sv_protocol = PROTOCOL_FITZQUAKE; //johnfitz
extern qboolean pr_alpha_supported; //johnfitz
extern bool pr_alpha_supported; //johnfitz
//============================================================================
@ -530,7 +530,7 @@ SV_VisibleToClient -- johnfitz
PVS test encapsulated in a nice function
=============
*/
qboolean SV_VisibleToClient (edict_t *client, edict_t *test, qmodel_t *worldmodel)
bool SV_VisibleToClient (edict_t *client, edict_t *test, qmodel_t *worldmodel)
{
byte *pvs;
vec3_t org;
@ -951,7 +951,7 @@ void SV_WriteClientdataToMessage (edict_t *ent, sizebuf_t *msg)
SV_SendClientDatagram
=======================
*/
qboolean SV_SendClientDatagram (client_t *client)
bool SV_SendClientDatagram (client_t *client)
{
byte buf[MAX_DATAGRAM];
sizebuf_t msg;

View File

@ -36,7 +36,7 @@ is not a staircase.
*/
int c_yes, c_no;
qboolean SV_CheckBottom (edict_t *ent)
bool SV_CheckBottom (edict_t *ent)
{
vec3_t mins, maxs, start, stop;
trace_t trace;
@ -109,7 +109,7 @@ possible, no move is done, false is returned, and
pr_global_struct->trace_normal is set to the normal of the blocking wall
=============
*/
qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
bool SV_movestep (edict_t *ent, vec3_t move, bool relink)
{
float dz;
vec3_t oldorg, neworg, end;
@ -232,7 +232,7 @@ facing it.
======================
*/
void PF_changeyaw (void);
qboolean SV_StepDirection (edict_t *ent, float yaw, float dist)
bool SV_StepDirection (edict_t *ent, float yaw, float dist)
{
vec3_t move, oldorigin;
float delta;
@ -372,7 +372,7 @@ SV_CloseEnough
======================
*/
qboolean SV_CloseEnough (edict_t *ent, edict_t *goal, float dist)
bool SV_CloseEnough (edict_t *ent, edict_t *goal, float dist)
{
int i;

View File

@ -120,7 +120,7 @@ in a frame. Not used for pushmove objects, because they must be exact.
Returns false if the entity removed itself.
=============
*/
qboolean SV_RunThink (edict_t *ent)
bool SV_RunThink (edict_t *ent)
{
float thinktime;
float oldframe; //johnfitz
@ -673,7 +673,7 @@ void SV_CheckStuck (edict_t *ent)
SV_CheckWater
=============
*/
qboolean SV_CheckWater (edict_t *ent)
bool SV_CheckWater (edict_t *ent)
{
vec3_t point;
int cont;
@ -1133,7 +1133,7 @@ will fall if the floor is pulled out from under them.
*/
void SV_Physics_Step (edict_t *ent)
{
qboolean hitsound;
bool hitsound;
// freefall if not onground
if ( ! ((int)ent->v.flags & (FL_ONGROUND | FL_FLY | FL_SWIM) ) )

View File

@ -36,7 +36,7 @@ float *angles;
float *origin;
float *velocity;
qboolean onground;
bool onground;
usercmd_t cmd;
@ -479,7 +479,7 @@ SV_ReadClientMessage
Returns false if the client should be killed
===================
*/
qboolean SV_ReadClientMessage (void)
bool SV_ReadClientMessage (void)
{
int ret;
int ccmd;

View File

@ -116,7 +116,7 @@ void UDP_Shutdown (void)
//=============================================================================
void UDP_Listen (qboolean state)
void UDP_Listen (bool state)
{
// enable listening
if (state)

View File

@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sys_socket_t UDP_Init (void);
void UDP_Shutdown (void);
void UDP_Listen (qboolean state);
void UDP_Listen (bool state);
sys_socket_t UDP_OpenSocket (int port);
int UDP_CloseSocket (sys_socket_t socketid);
int UDP_Connect (sys_socket_t socketid, struct qsockaddr *addr);

View File

@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <SDL.h>
qboolean isDedicated;
bool isDedicated;
cvar_t sys_throttle = {"sys_throttle", "0.02", CVAR_ARCHIVE};
#define MAX_HANDLES 32 /* johnfitz -- was 10 */

View File

@ -85,8 +85,8 @@ void VID_SyncCvars (void);
void VID_Toggle (void);
void *VID_GetWindow (void);
qboolean VID_HasMouseOrInputFocus (void);
qboolean VID_IsMinimized (void);
bool VID_HasMouseOrInputFocus (void);
bool VID_IsMinimized (void);
void VID_Lock (void);
#endif /* __VID_DEFS_H */

View File

@ -486,7 +486,7 @@ V_UpdateBlend -- johnfitz -- V_UpdatePalette cleaned up and renamed
void V_UpdateBlend (void)
{
int i, j;
qboolean blend_changed;
bool blend_changed;
V_CalcPowerupCshift ();

View File

@ -194,7 +194,7 @@ void WINS_Shutdown (void)
//=============================================================================
void WINS_Listen (qboolean state)
void WINS_Listen (bool state)
{
// enable listening
if (state)

View File

@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sys_socket_t WINS_Init (void);
void WINS_Shutdown (void);
void WINS_Listen (qboolean state);
void WINS_Listen (bool state);
sys_socket_t WINS_OpenSocket (int port);
int WINS_CloseSocket (sys_socket_t socketid);
int WINS_Connect (sys_socket_t socketid, struct qsockaddr *addr);

View File

@ -36,7 +36,7 @@ static sys_socket_t net_controlsocket;
static struct sockaddr_ipx broadcastaddr;
/* externs from net_wins.c: */
extern qboolean winsock_initialized;
extern bool winsock_initialized;
extern WSADATA winsockdata;
extern const char *__WSAE_StrError (int);
@ -120,7 +120,7 @@ void WIPX_Shutdown (void)
//=============================================================================
void WIPX_Listen (qboolean state)
void WIPX_Listen (bool state)
{
// enable listening
if (state)

View File

@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sys_socket_t WIPX_Init (void);
void WIPX_Shutdown (void);
void WIPX_Listen (qboolean state);
void WIPX_Listen (bool state);
sys_socket_t WIPX_OpenSocket (int port);
int WIPX_CloseSocket (sys_socket_t socketid);
int WIPX_Connect (sys_socket_t socketid, struct qsockaddr *addr);

View File

@ -36,8 +36,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <SDL.h>
qboolean isDedicated;
qboolean Win95, Win95old, WinNT, WinVista;
bool isDedicated;
bool Win95, Win95old, WinNT, WinVista;
cvar_t sys_throttle = {"sys_throttle", "0.02", CVAR_ARCHIVE};
static HANDLE hinput, houtput;

View File

@ -429,7 +429,7 @@ SV_LinkEdict
===============
*/
void SV_LinkEdict (edict_t *ent, qboolean touch_triggers)
void SV_LinkEdict (edict_t *ent, bool touch_triggers)
{
areanode_t *node;
@ -603,7 +603,7 @@ SV_RecursiveHullCheck
==================
*/
qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace)
bool SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace)
{
mclipnode_t *node; //johnfitz -- was dclipnode_t
mplane_t *plane;

View File

@ -31,9 +31,9 @@ typedef struct
typedef struct
{
qboolean allsolid; // if true, plane is not valid
qboolean startsolid; // if true, the initial point was in a solid area
qboolean inopen, inwater;
bool allsolid; // if true, plane is not valid
bool startsolid; // if true, the initial point was in a solid area
bool inopen, inwater;
float fraction; // time completed, 1.0 = didn't hit anything
vec3_t endpos; // final position
plane_t plane; // surface normal at impact
@ -54,7 +54,7 @@ void SV_UnlinkEdict (edict_t *ent);
// so it doesn't clip against itself
// flags ent->v.modified
void SV_LinkEdict (edict_t *ent, qboolean touch_triggers);
void SV_LinkEdict (edict_t *ent, bool touch_triggers);
// Needs to be called any time an entity changes origin, mins, maxs, or solid
// flags ent->v.modified
// sets ent->v.absmin and ent->v.absmax
@ -81,7 +81,7 @@ trace_t SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, e
// passedict is explicitly excluded from clipping checks (normally NULL)
qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace);
bool SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace);
#endif /* _QUAKE_WORLD_H */

View File

@ -300,7 +300,7 @@ int hunk_size;
int hunk_low_used;
int hunk_high_used;
qboolean hunk_tempactive;
bool hunk_tempactive;
int hunk_tempmark;
/*
@ -332,7 +332,7 @@ If "all" is specified, every single allocation is printed.
Otherwise, allocations with the same name will be totaled up before printing.
==============
*/
void Hunk_Print (qboolean all)
void Hunk_Print (bool all)
{
hunk_t *h, *next, *endlow, *starthigh, *endhigh;
int count, sum;
@ -601,7 +601,7 @@ typedef struct cache_system_s
struct cache_system_s *lru_prev, *lru_next; // for LRU flushing
} cache_system_t;
cache_system_t *Cache_TryAlloc (int size, qboolean nobottom);
cache_system_t *Cache_TryAlloc (int size, bool nobottom);
cache_system_t cache_head;
@ -715,7 +715,7 @@ Looks for a free block of memory between the high and low hunk marks
Size should already include the header and padding
============
*/
cache_system_t *Cache_TryAlloc (int size, qboolean nobottom)
cache_system_t *Cache_TryAlloc (int size, bool nobottom)
{
cache_system_t *cs, *new_cs;
@ -848,7 +848,7 @@ Cache_Free
Frees the memory and removes it from the LRU list
==============
*/
void Cache_Free (cache_user_t *c, qboolean freetextures) //johnfitz -- added second argument
void Cache_Free (cache_user_t *c, bool freetextures) //johnfitz -- added second argument
{
cache_system_t *cs;

View File

@ -122,7 +122,7 @@ void *Cache_Check (cache_user_t *c);
// returns the cached data, and moves to the head of the LRU list
// if present, otherwise returns NULL
void Cache_Free (cache_user_t *c, qboolean freetextures); //johnfitz -- added second argument
void Cache_Free (cache_user_t *c, bool freetextures); //johnfitz -- added second argument
void *Cache_Alloc (cache_user_t *c, int size, const char *name);
// Returns NULL if all purgable data was tossed and there still