{
case 0:
if(valid)
- *valid = TRUE;
+ *valid = true;
return len;
case STRING_COLOR_TAG:
++s;
case 0: // ends with unfinished color code!
++len;
if(valid)
- *valid = FALSE;
+ *valid = false;
return len;
case STRING_COLOR_TAG: // escaped ^
++len;
qboolean
COM_StringDecolorize(const char *in, size_t size_in, char *out, size_t size_out, qboolean escape_carets)
{
-#define APPEND(ch) do { if(--size_out) { *out++ = (ch); } else { *out++ = 0; return FALSE; } } while(0)
+#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;
if(size_out < 1)
- return FALSE;
+ return false;
for(;;)
{
switch((in == end) ? 0 : *in)
{
case 0:
*out++ = 0;
- return TRUE;
+ return true;
case STRING_COLOR_TAG:
++in;
switch((in == end) ? 0 : *in)
if(escape_carets)
APPEND(STRING_COLOR_TAG);
*out++ = 0;
- return TRUE;
+ return true;
case STRING_COLOR_TAG: // escaped ^
APPEND(STRING_COLOR_TAG);
// append a ^ twice when escaping
cinfo->src->next_input_byte = jpeg_eoi_marker;
cinfo->src->bytes_in_buffer = 2;
- return TRUE;
+ return true;
}
static void JPEG_SkipInputData (j_decompress_ptr cinfo, long num_bytes)
cinfo.err = qjpeg_std_error (&jerr);
cinfo.err->error_exit = JPEG_ErrorExit;
JPEG_MemSrc (&cinfo, f, filesize);
- qjpeg_read_header (&cinfo, TRUE);
+ qjpeg_read_header (&cinfo, true);
cinfo.scale_num = 1;
cinfo.scale_denom = (1 << submip);
qjpeg_start_decompress (&cinfo);
cinfo.in_color_space = JCS_RGB;
cinfo.input_components = 3;
qjpeg_set_defaults (&cinfo);
- qjpeg_set_quality (&cinfo, (int)(scr_screenshot_jpeg_quality.value * 100), TRUE);
+ qjpeg_set_quality (&cinfo, (int)(scr_screenshot_jpeg_quality.value * 100), true);
qjpeg_simple_progression (&cinfo);
// turn off subsampling (to make text look better)
static downloadinfo *downloads = NULL;
static int numdownloads = 0;
-static qboolean noclear = FALSE;
+static qboolean noclear = false;
static int numdownloads_fail = 0;
static int numdownloads_success = 0;
double maxspeed;
downloadinfo *di;
- noclear = FALSE;
+ noclear = false;
if(!cl_curl_enabled.integer)
return;
{
dpsnprintf(donecommand, sizeof(donecommand), "connect %s", cls.netcon->address);
Curl_CommandWhenDone(donecommand);
- noclear = TRUE;
+ noclear = true;
CL_Disconnect();
- noclear = FALSE;
+ noclear = false;
Curl_CheckCommandWhenDone();
}
else
key_dest = key_game;
// init the normal menu now -> this will also correct the menu router pointers
- MR_SetRouting (TRUE);
+ MR_SetRouting (true);
// reset the active scene, too (to be on the safe side ;))
R_SelectScene( RST_CLIENT );
{
if(MR_Shutdown)
MR_Shutdown ();
- MR_SetRouting (FALSE);
+ MR_SetRouting (false);
}
static void MR_Restart_f(cmd_state_t *cmd)
// the normal quake menu only the first time
// COMMANDLINEOPTION: Client: -useqmenu causes the first time you open the menu to use the quake menu, then reverts to menu.dat (if forceqmenu is 0)
if(COM_CheckParm("-useqmenu"))
- MR_SetRouting (TRUE);
+ MR_SetRouting (true);
else
- MR_SetRouting (FALSE);
+ MR_SetRouting (false);
}
// Prepare Strings
VM_SAFEPARMCOUNT(1,VM_strdecolorize);
szString = PRVM_G_STRING(OFS_PARM0);
- COM_StringDecolorize(szString, 0, szNewString, sizeof(szNewString), TRUE);
+ COM_StringDecolorize(szString, 0, szNewString, sizeof(szNewString), true);
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, szNewString);
}
========================
VM_buf_sort
sort buffer by beginnings of strings (cmplength defaults it's length)
-"backward == TRUE" means that sorting goes upside-down
+"backward == true" means that sorting goes upside-down
void buf_sort(float bufhandle, float cmplength, float backward) = #464;
========================
*/
========================
VM_bufstr_add
adds string to buffer in first free slot and returns its index
-"order == TRUE" means that string will be added after last "full" slot
+"order == true" means that string will be added after last "full" slot
float bufstr_add(float bufhandle, string str, float order) = #467;
========================
*/
// Prepare Strings
VM_SAFEPARMCOUNT(1, VM_uncolorstring);
szString = PRVM_G_STRING(OFS_PARM0);
- COM_StringDecolorize(szString, 0, szNewString, sizeof(szNewString), TRUE);
+ COM_StringDecolorize(szString, 0, szNewString, sizeof(szNewString), true);
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, szNewString);
}
;
}
- prog->loaded = TRUE;
+ prog->loaded = true;
PRVM_UpdateBreakpoints(prog);
#ifndef QTYPES_H
#define QTYPES_H
-#undef true
-#undef false
-
#ifndef __cplusplus
-typedef enum qboolean_e {false, true} qboolean;
+#ifdef _MSC_VER
+typedef enum {false, true} bool;
#else
-typedef bool qboolean;
+#include <stdbool.h>
#endif
+#endif
+typedef bool qboolean;
+
#ifndef NULL
#define NULL ((void *)0)
#endif
-#ifndef FALSE
-#define FALSE false
-#define TRUE true
-#endif
-
// up / down
#define PITCH 0
// angle fixing was requested by global thinking code...
// so store the current angles for later use
VectorCopy(PRVM_serveredictvector(ent, angles), host_client->fixangle_angles);
- host_client->fixangle_angles_set = TRUE;
+ host_client->fixangle_angles_set = true;
// and clear fixangle for the next frame
PRVM_serveredictfloat(ent, fixangle) = 0;
MSG_WriteByte (msg, svc_setangle);
for (i=0 ; i < 3 ; i++)
MSG_WriteAngle (msg, host_client->fixangle_angles[i], sv.protocol);
- host_client->fixangle_angles_set = FALSE;
+ host_client->fixangle_angles_set = false;
}
// the runes are in serverflags, pack them into the items value, also pack
// angle fixing was requested by physics code...
// so store the current angles for later use
VectorCopy(PRVM_serveredictvector(ent, angles), host_client->fixangle_angles);
- host_client->fixangle_angles_set = TRUE;
+ host_client->fixangle_angles_set = true;
// and clear fixangle for the next frame
PRVM_serveredictfloat(ent, fixangle) = 0;
// angle fixing was requested by physics code...
// so store the current angles for later use
VectorCopy(PRVM_serveredictvector(ent, angles), host_client->fixangle_angles);
- host_client->fixangle_angles_set = TRUE;
+ host_client->fixangle_angles_set = true;
// and clear fixangle for the next frame
PRVM_serveredictfloat(ent, fixangle) = 0;
#ifdef THREADDEBUG
Sys_PrintfToTerminal("%p mutex unlock %s:%i\n" , mutex, filename, fileline);
#endif
- return (ReleaseMutex(mutex) == FALSE) ? -1 : 0;
+ return (ReleaseMutex(mutex) == false) ? -1 : 0;
}
typedef struct thread_semaphore_s
{
case 0:
if(valid)
- *valid = TRUE;
+ *valid = true;
return len;
case STRING_COLOR_TAG:
++s;
case 0: // ends with unfinished color code!
++len;
if(valid)
- *valid = FALSE;
+ *valid = false;
return len;
case STRING_COLOR_TAG: // escaped ^
++len;
{
// we CAN end up here, if an invalid char is between this one and the end of the string
if(valid)
- *valid = TRUE;
+ *valid = true;
return len;
}
{
// string length exceeded by new character
if(valid)
- *valid = TRUE;
+ *valid = true;
return len;
}