diff --git a/Makefile b/Makefile index ed9e3bbf..1dbb6bf7 100644 --- a/Makefile +++ b/Makefile @@ -1111,7 +1111,7 @@ $(INSTALLDIR)/heretic2/h2data.$(EXE): \ libl_net.$(A) \ $(if $(findstring $(OS),Win32),icons/h2data.o,) \ -$(INSTALLDIR)/mbspc.$(EXE): CPPFLAGS_EXTRA := -Wstrict-prototypes -DNDEBUG -DBSPC -DBSPCINCLUDE +$(INSTALLDIR)/mbspc.$(EXE): CPPFLAGS_EXTRA := -Wstrict-prototypes -DNDEBUG -DBSPC -DBSPCINCLUDE -Ilibs $(INSTALLDIR)/mbspc.$(EXE): \ tools/mbspc/botlib/be_aas_bspq3.o \ tools/mbspc/botlib/be_aas_cluster.o \ diff --git a/libs/bytebool.h b/libs/bytebool.h index 7e3d3306..ed7adf70 100644 --- a/libs/bytebool.h +++ b/libs/bytebool.h @@ -26,7 +26,9 @@ // this header is not really meant for direct inclusion, // it is used by mathlib and cmdlib -typedef enum { qfalse, qtrue } qboolean; +#include +typedef bool qboolean; +//typedef enum { qfalse, qtrue } qboolean; typedef unsigned char byte; #endif diff --git a/libs/l_net/l_net.c b/libs/l_net/l_net.c index caf6c422..924e123e 100644 --- a/libs/l_net/l_net.c +++ b/libs/l_net/l_net.c @@ -39,9 +39,6 @@ #define GetMemory malloc #define FreeMemory free -#define qtrue 1 -#define qfalse 0 - #ifdef _DEBUG void WinPrint( const char *str, ... ){ va_list argptr; @@ -326,12 +323,10 @@ void Net_MyAddress( address_t *address ){ // Returns: - // Changes Globals: - //=========================================================================== -int Net_Setup( void ){ +void Net_Setup( void ){ WINS_Init(); // WinPrint( "my address is %s\n", WINS_MyAddress() ); - // - return qtrue; } //end of the function Net_Setup //=========================================================================== // @@ -461,7 +456,7 @@ void NMSG_WriteString( netmessage_t *msg, char *string ){ // Changes Globals: - //=========================================================================== void NMSG_ReadStart( netmessage_t *msg ){ - msg->readoverflow = qfalse; + msg->readoverflow = false; msg->read = 4; } //end of the function NMSG_ReadStart //=========================================================================== @@ -472,7 +467,7 @@ void NMSG_ReadStart( netmessage_t *msg ){ //=========================================================================== int NMSG_ReadChar( netmessage_t *msg ){ if ( msg->read + 1 > msg->size ) { - msg->readoverflow = qtrue; + msg->readoverflow = true; WinPrint( "NMSG_ReadChar: read overflow\n" ); return 0; } //end if @@ -487,7 +482,7 @@ int NMSG_ReadChar( netmessage_t *msg ){ //=========================================================================== int NMSG_ReadByte( netmessage_t *msg ){ if ( msg->read + 1 > msg->size ) { - msg->readoverflow = qtrue; + msg->readoverflow = true; WinPrint( "NMSG_ReadByte: read overflow\n" ); return 0; } //end if @@ -504,7 +499,7 @@ int NMSG_ReadShort( netmessage_t *msg ){ int c; if ( msg->read + 2 > msg->size ) { - msg->readoverflow = qtrue; + msg->readoverflow = true; WinPrint( "NMSG_ReadShort: read overflow\n" ); return 0; } //end if @@ -522,7 +517,7 @@ int NMSG_ReadLong( netmessage_t *msg ){ int c; if ( msg->read + 4 > msg->size ) { - msg->readoverflow = qtrue; + msg->readoverflow = true; WinPrint( "NMSG_ReadLong: read overflow\n" ); return 0; } //end if @@ -543,7 +538,7 @@ float NMSG_ReadFloat( netmessage_t *msg ){ int c; if ( msg->read + 4 > msg->size ) { - msg->readoverflow = qtrue; + msg->readoverflow = true; WinPrint( "NMSG_ReadLong: read overflow\n" ); return 0; } //end if @@ -568,7 +563,7 @@ char *NMSG_ReadString( netmessage_t *msg ){ do { if ( msg->read + 1 > msg->size ) { - msg->readoverflow = qtrue; + msg->readoverflow = true; WinPrint( "NMSG_ReadString: read overflow\n" ); string[l] = 0; return string; diff --git a/libs/l_net/l_net.h b/libs/l_net/l_net.h index 120201b3..8782f27c 100644 --- a/libs/l_net/l_net.h +++ b/libs/l_net/l_net.h @@ -39,11 +39,7 @@ extern "C" { #endif -#ifndef __BYTEBOOL__ -#define __BYTEBOOL__ -typedef enum { qfalse, qtrue } qboolean; -typedef unsigned char byte; -#endif +#include "bytebool.h" typedef struct address_s { @@ -61,7 +57,7 @@ typedef struct netmessage_s unsigned char data[MAX_NETMESSAGE]; int size; int read; - int readoverflow; + bool readoverflow; } netmessage_t; typedef struct socket_s @@ -100,7 +96,7 @@ socket_t *Net_ListenSocket( int port ); //accept new connections at the given socket socket_t *Net_Accept( socket_t *sock ); //setup networking -int Net_Setup( void ); +void Net_Setup( void ); //shutdown networking void Net_Shutdown( void ); //message handling diff --git a/libs/l_net/l_net_berkley.c b/libs/l_net/l_net_berkley.c index ac618dd6..49b5a01a 100644 --- a/libs/l_net/l_net_berkley.c +++ b/libs/l_net/l_net_berkley.c @@ -52,9 +52,6 @@ #define WinError WinPrint -#define qtrue 1 -#define qfalse 0 - #define ioctlsocket ioctl #define closesocket close @@ -88,8 +85,6 @@ static int net_acceptsocket = -1; // socket for fielding new connections static int net_controlsocket; static int net_hostport; // udp port number for acceptsocket static int net_broadcastsocket = 0; -//static qboolean ifbcastinit = qfalse; -//static struct sockaddr_s broadcastaddr; static struct sockaddr_s broadcastaddr; static unsigned long myAddr; @@ -307,7 +302,7 @@ int WINS_OpenSocket( int port ){ int WINS_OpenReliableSocket( int port ){ int newsocket; struct sockaddr_in address; - qboolean _true = 0xFFFFFFFF; + int _true = 0xFFFFFFFF; //IPPROTO_TCP // @@ -362,7 +357,7 @@ int WINS_Listen( int socket ){ int WINS_Accept( int socket, struct sockaddr_s *addr ){ socklen_t addrlen = sizeof( struct sockaddr_s ); int newsocket; - qboolean _true = 1; + int _true = 1; newsocket = accept( socket, (struct sockaddr *)addr, &addrlen ); if ( newsocket == INVALID_SOCKET ) { @@ -564,13 +559,13 @@ int WINS_Broadcast( int socket, byte *buf, int len ){ return WINS_Write( socket, buf, len, &broadcastaddr ); } //end of the function WINS_Broadcast //=========================================================================== -// returns qtrue on success or qfalse on failure +// returns true on success or false on failure // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== -int WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ){ +bool WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ){ int ret, written; ret = 0; @@ -581,7 +576,7 @@ int WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ){ ret = sendto( socket, &buf[written], len - written, 0, (struct sockaddr *)addr, sizeof( struct sockaddr_s ) ); if ( ret == SOCKET_ERROR ) { if ( WSAGetLastError() != EAGAIN ) { - return qfalse; + return false; } //++timo FIXME: what is this used for? // Sleep(1000); @@ -600,7 +595,7 @@ int WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ){ ret = send( socket, buf, len, 0 ); if ( ret == SOCKET_ERROR ) { if ( WSAGetLastError() != EAGAIN ) { - return qfalse; + return false; } //++timo FIXME: what is this used for? // Sleep(1000); diff --git a/libs/l_net/l_net_wins.c b/libs/l_net/l_net_wins.c index 30ef9ac0..ddad1783 100644 --- a/libs/l_net/l_net_wins.c +++ b/libs/l_net/l_net_wins.c @@ -35,14 +35,9 @@ #include #include "l_net.h" #include "l_net_wins.h" -//#include -//#include "mpdosock.h" #define WinError WinPrint -#define qtrue 1 -#define qfalse 0 - typedef struct tag_error_struct { int errnum; @@ -61,7 +56,6 @@ static int net_acceptsocket = -1; // socket for fielding new connections static int net_controlsocket; static int net_hostport; // udp port number for acceptsocket static int net_broadcastsocket = 0; -//static qboolean ifbcastinit = qfalse; static struct sockaddr_s broadcastaddr; static unsigned long myAddr; @@ -580,13 +574,13 @@ int WINS_Broadcast( int socket, byte *buf, int len ){ return WINS_Write( socket, buf, len, &broadcastaddr ); } //end of the function WINS_Broadcast //=========================================================================== -// returns qtrue on success or qfalse on failure +// returns true on success or false on failure // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== -int WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ){ +bool WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ){ int ret, written; if ( addr ) { @@ -596,7 +590,7 @@ int WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ){ ret = sendto( socket, &buf[written], len - written, 0, (struct sockaddr *)addr, sizeof( struct sockaddr_s ) ); if ( ret == SOCKET_ERROR ) { if ( WSAGetLastError() != WSAEWOULDBLOCK ) { - return qfalse; + return false; } Sleep( 1000 ); } //end if @@ -614,7 +608,7 @@ int WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ){ ret = send( socket, buf, len, 0 ); if ( ret == SOCKET_ERROR ) { if ( WSAGetLastError() != WSAEWOULDBLOCK ) { - return qfalse; + return false; } Sleep( 1000 ); } //end if diff --git a/libs/l_net/l_net_wins.h b/libs/l_net/l_net_wins.h index ebe75472..f3efb88c 100644 --- a/libs/l_net/l_net_wins.h +++ b/libs/l_net/l_net_wins.h @@ -28,7 +28,7 @@ // Tab Size: 3 // Notes: //=========================================================================== - +#include "bytebool.h" int WINS_Init( void ); void WINS_Shutdown( void ); char *WINS_MyAddress( void ); @@ -40,7 +40,7 @@ int WINS_CloseSocket( int socket ); int WINS_Connect( int socket, struct sockaddr_s *addr ); int WINS_CheckNewConnections( void ); int WINS_Read( int socket, byte *buf, int len, struct sockaddr_s *addr ); -int WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ); +bool WINS_Write( int socket, byte *buf, int len, struct sockaddr_s *addr ); int WINS_Broadcast( int socket, byte *buf, int len ); char *WINS_AddrToString( struct sockaddr_s *addr ); int WINS_StringToAddr( char *string, struct sockaddr_s *addr ); diff --git a/libs/mathlib.h b/libs/mathlib.h index 9d855f9d..1610c314 100644 --- a/libs/mathlib.h +++ b/libs/mathlib.h @@ -89,10 +89,10 @@ extern const vec3_t g_vec3_axis_z; #define Q_rint( in ) ( (vec_t)floor( in + 0.5 ) ) -qboolean VectorCompare( const vec3_t v1, const vec3_t v2 ); +bool VectorCompare( const vec3_t v1, const vec3_t v2 ); -qboolean VectorIsOnAxis( vec3_t v ); -qboolean VectorIsOnAxialPlane( vec3_t v ); +bool VectorIsOnAxis( vec3_t v ); +bool VectorIsOnAxialPlane( vec3_t v ); vec_t VectorLength( const vec3_t v ); @@ -155,7 +155,7 @@ void VectorRotateOrigin( vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t ou // some function merged from tools mathlib code -qboolean PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c ); +bool PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c ); void NormalToLatLong( const vec3_t normal, byte bytes[2] ); int PlaneTypeForNormal( vec3_t normal ); void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees ); @@ -438,7 +438,7 @@ void ray_transform( ray_t* ray, const m4x4_t matrix ); /*! distance from ray origin in ray direction to point. FLT_MAX if no intersection. */ vec_t ray_intersect_point( const ray_t* ray, const vec3_t point, vec_t epsilon, vec_t divergence ); /*! distance from ray origin in ray direction to triangle. FLT_MAX if no intersection. */ -vec_t ray_intersect_triangle( const ray_t* ray, qboolean bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2 ); +vec_t ray_intersect_triangle( const ray_t* ray, bool bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2 ); /*! distance from ray origin in ray direction to plane. */ vec_t ray_intersect_plane( const ray_t* ray, const vec3_t normal, vec_t dist ); diff --git a/libs/mathlib/mathlib.c b/libs/mathlib/mathlib.c index dbc2a0f2..9acb3b34 100644 --- a/libs/mathlib/mathlib.c +++ b/libs/mathlib/mathlib.c @@ -35,7 +35,7 @@ const vec3_t g_vec3_axis_z = { 0, 0, 1, }; VectorIsOnAxis ================ */ -qboolean VectorIsOnAxis( vec3_t v ){ +bool VectorIsOnAxis( vec3_t v ){ int i, zeroComponentCount; zeroComponentCount = 0; @@ -48,10 +48,10 @@ qboolean VectorIsOnAxis( vec3_t v ){ if ( zeroComponentCount > 1 ) { // The zero vector will be on axis. - return qtrue; + return true; } - return qfalse; + return false; } /* @@ -59,18 +59,18 @@ qboolean VectorIsOnAxis( vec3_t v ){ VectorIsOnAxialPlane ================ */ -qboolean VectorIsOnAxialPlane( vec3_t v ){ +bool VectorIsOnAxialPlane( vec3_t v ){ int i; for ( i = 0; i < 3; i++ ) { if ( v[i] == 0.0 ) { // The zero vector will be on axial plane. - return qtrue; + return true; } } - return qfalse; + return false; } /* @@ -108,15 +108,15 @@ vec_t VectorLength( const vec3_t v ){ return length; } -qboolean VectorCompare( const vec3_t v1, const vec3_t v2 ){ +bool VectorCompare( const vec3_t v1, const vec3_t v2 ){ int i; for ( i = 0 ; i < 3 ; i++ ) if ( fabs( v1[i] - v2[i] ) > EQUAL_EPSILON ) { - return qfalse; + return false; } - return qtrue; + return true; } void VectorMA( const vec3_t va, vec_t scale, const vec3_t vb, vec3_t vc ){ @@ -429,18 +429,18 @@ void VectorToAngles( vec3_t vec, vec3_t angles ){ The normal will point out of the clock for clockwise ordered points ===================== */ -qboolean PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c ) { +bool PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c ) { vec3_t d1, d2; VectorSubtract( b, a, d1 ); VectorSubtract( c, a, d2 ); CrossProduct( d2, d1, plane ); if ( VectorNormalize( plane, plane ) == 0 ) { - return qfalse; + return false; } plane[3] = DotProduct( a, plane ); - return qtrue; + return true; } /* diff --git a/libs/mathlib/ray.c b/libs/mathlib/ray.c index f08a8842..a39b48a0 100644 --- a/libs/mathlib/ray.c +++ b/libs/mathlib/ray.c @@ -60,7 +60,7 @@ vec_t ray_intersect_point( const ray_t *ray, const vec3_t point, vec_t epsilon, #define EPSILON 0.000001 -vec_t ray_intersect_triangle( const ray_t *ray, qboolean bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2 ){ +vec_t ray_intersect_triangle( const ray_t *ray, bool bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2 ){ float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; float det,inv_det; float u, v; @@ -76,7 +76,7 @@ vec_t ray_intersect_triangle( const ray_t *ray, qboolean bCullBack, const vec3_t /* if determinant is near zero, ray lies in plane of triangle */ det = DotProduct( edge1, pvec ); - if ( bCullBack == qtrue ) { + if ( bCullBack == true ) { if ( det < EPSILON ) { return depth; } diff --git a/tools/mbspc/botlib/be_aas_bspq3.c b/tools/mbspc/botlib/be_aas_bspq3.c index ae1fbc41..7d830b91 100644 --- a/tools/mbspc/botlib/be_aas_bspq3.c +++ b/tools/mbspc/botlib/be_aas_bspq3.c @@ -178,9 +178,9 @@ qboolean AAS_EntityCollision(int entnum, if (enttrace.fraction < trace->fraction) { Com_Memcpy(trace, &enttrace, sizeof(bsp_trace_t)); - return qtrue; + return true; } //end if - return qfalse; + return false; } //end of the function AAS_EntityCollision //=========================================================================== // returns true if in Potentially Hearable Set @@ -202,7 +202,7 @@ qboolean AAS_inPVS(vec3_t p1, vec3_t p2) //=========================================================================== qboolean AAS_inPHS(vec3_t p1, vec3_t p2) { - return qtrue; + return true; } //end of the function AAS_inPHS //=========================================================================== // @@ -267,9 +267,9 @@ int AAS_BSPEntityInRange(int ent) if (ent <= 0 || ent >= bspworld.numentities) { botimport.Print(PRT_MESSAGE, "bsp entity out of range\n"); - return qfalse; + return false; } //end if - return qtrue; + return true; } //end of the function AAS_BSPEntityInRange //=========================================================================== // @@ -282,17 +282,17 @@ int AAS_ValueForBSPEpairKey(int ent, char *key, char *value, int size) bsp_epair_t *epair; value[0] = '\0'; - if (!AAS_BSPEntityInRange(ent)) return qfalse; + if (!AAS_BSPEntityInRange(ent)) return false; for (epair = bspworld.entities[ent].epairs; epair; epair = epair->next) { if (!strcmp(epair->key, key)) { strncpy(value, epair->value, size-1); value[size-1] = '\0'; - return qtrue; + return true; } //end if } //end for - return qfalse; + return false; } //end of the function AAS_FindBSPEpair //=========================================================================== // @@ -306,14 +306,14 @@ int AAS_VectorForBSPEpairKey(int ent, char *key, vec3_t v) double v1, v2, v3; VectorClear(v); - if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return qfalse; + if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return false; //scanf into doubles, then assign, so it is vec_t size independent v1 = v2 = v3 = 0; sscanf(buf, "%lf %lf %lf", &v1, &v2, &v3); v[0] = v1; v[1] = v2; v[2] = v3; - return qtrue; + return true; } //end of the function AAS_VectorForBSPEpairKey //=========================================================================== // @@ -324,11 +324,11 @@ int AAS_VectorForBSPEpairKey(int ent, char *key, vec3_t v) int AAS_FloatForBSPEpairKey(int ent, char *key, float *value) { char buf[MAX_EPAIRKEY]; - + *value = 0; - if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return qfalse; + if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return false; *value = atof(buf); - return qtrue; + return true; } //end of the function AAS_FloatForBSPEpairKey //=========================================================================== // @@ -339,11 +339,11 @@ int AAS_FloatForBSPEpairKey(int ent, char *key, float *value) int AAS_IntForBSPEpairKey(int ent, char *key, int *value) { char buf[MAX_EPAIRKEY]; - + *value = 0; - if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return qfalse; + if (!AAS_ValueForBSPEpairKey(ent, key, buf, MAX_EPAIRKEY)) return false; *value = atoi(buf); - return qtrue; + return true; } //end of the function AAS_IntForBSPEpairKey //=========================================================================== // @@ -466,7 +466,7 @@ void AAS_DumpBSPData(void) bspworld.dentdata = NULL; bspworld.entdatasize = 0; // - bspworld.loaded = qfalse; + bspworld.loaded = false; Com_Memset( &bspworld, 0, sizeof(bspworld) ); } //end of the function AAS_DumpBSPData //=========================================================================== @@ -483,6 +483,6 @@ int AAS_LoadBSPFile(void) bspworld.dentdata = (char *) GetClearedHunkMemory(bspworld.entdatasize); Com_Memcpy(bspworld.dentdata, botimport.BSPEntityData(), bspworld.entdatasize); AAS_ParseBSPEntities(); - bspworld.loaded = qtrue; + bspworld.loaded = true; return BLERR_NOERROR; } //end of the function AAS_LoadBSPFile diff --git a/tools/mbspc/botlib/be_aas_cluster.c b/tools/mbspc/botlib/be_aas_cluster.c index dc30b655..834561de 100644 --- a/tools/mbspc/botlib/be_aas_cluster.c +++ b/tools/mbspc/botlib/be_aas_cluster.c @@ -57,7 +57,7 @@ extern aas_t aasworld; #define MAX_PORTALAREAS 1024 // do not flood through area faces, only use reachabilities -int nofaceflood = qtrue; +qboolean nofaceflood = true; //=========================================================================== // @@ -135,13 +135,13 @@ int AAS_UpdatePortal(int areanum, int clusternum) if (portalnum == aasworld.numportals) { AAS_Error("no portal of area %d", areanum); - return qtrue; + return true; } //end if // portal = &aasworld.portals[portalnum]; //if the portal is already fully updated - if (portal->frontcluster == clusternum) return qtrue; - if (portal->backcluster == clusternum) return qtrue; + if (portal->frontcluster == clusternum) return true; + if (portal->backcluster == clusternum) return true; //if the portal has no front cluster yet if (!portal->frontcluster) { @@ -157,12 +157,12 @@ int AAS_UpdatePortal(int areanum, int clusternum) //remove the cluster portal flag contents aasworld.areasettings[areanum].contents &= ~AREACONTENTS_CLUSTERPORTAL; Log_Write("portal area %d is seperating more than two clusters\r\n", areanum); - return qfalse; + return false; } //end else if (aasworld.portalindexsize >= AAS_MAX_PORTALINDEXSIZE) { AAS_Error("AAS_MAX_PORTALINDEXSIZE"); - return qtrue; + return true; } //end if //set the area cluster number to the negative portal number aasworld.areasettings[areanum].cluster = -portalnum; @@ -171,7 +171,7 @@ int AAS_UpdatePortal(int areanum, int clusternum) aasworld.portalindex[cluster->firstportal + cluster->numportals] = portalnum; aasworld.portalindexsize++; cluster->numportals++; - return qtrue; + return true; } //end of the function AAS_UpdatePortal //=========================================================================== // @@ -189,18 +189,18 @@ int AAS_FloodClusterAreas_r(int areanum, int clusternum) if (areanum <= 0 || areanum >= aasworld.numareas) { AAS_Error("AAS_FloodClusterAreas_r: areanum out of range"); - return qfalse; + return false; } //end if //if the area is already part of a cluster if (aasworld.areasettings[areanum].cluster > 0) { - if (aasworld.areasettings[areanum].cluster == clusternum) return qtrue; + if (aasworld.areasettings[areanum].cluster == clusternum) return true; // //there's a reachability going from one cluster to another only in one direction // AAS_Error("cluster %d touched cluster %d at area %d\r\n", clusternum, aasworld.areasettings[areanum].cluster, areanum); - return qfalse; + return false; } //end if //don't add the cluster portal areas to the clusters if (aasworld.areasettings[areanum].contents & AREACONTENTS_CLUSTERPORTAL) @@ -224,11 +224,11 @@ int AAS_FloodClusterAreas_r(int areanum, int clusternum) face = &aasworld.faces[facenum]; if (face->frontarea == areanum) { - if (face->backarea) if (!AAS_FloodClusterAreas_r(face->backarea, clusternum)) return qfalse; + if (face->backarea) if (!AAS_FloodClusterAreas_r(face->backarea, clusternum)) return false; } //end if else { - if (face->frontarea) if (!AAS_FloodClusterAreas_r(face->frontarea, clusternum)) return qfalse; + if (face->frontarea) if (!AAS_FloodClusterAreas_r(face->frontarea, clusternum)) return false; } //end else } //end for } //end if @@ -241,9 +241,9 @@ int AAS_FloodClusterAreas_r(int areanum, int clusternum) continue; } //end if if (!AAS_FloodClusterAreas_r(aasworld.reachability[ - aasworld.areasettings[areanum].firstreachablearea + i].areanum, clusternum)) return qfalse; + aasworld.areasettings[areanum].firstreachablearea + i].areanum, clusternum)) return false; } //end for - return qtrue; + return true; } //end of the function AAS_FloodClusterAreas_r //=========================================================================== // try to flood from all areas without cluster into areas with a cluster set @@ -276,13 +276,13 @@ int AAS_FloodClusterAreasUsingReachabilities(int clusternum) if (aasworld.areasettings[areanum].cluster) { if (!AAS_FloodClusterAreas_r(i, clusternum)) - return qfalse; + return false; i = 0; break; } //end if } //end for } //end for - return qtrue; + return true; } //end of the function AAS_FloodClusterAreasUsingReachabilities //=========================================================================== // @@ -415,7 +415,7 @@ int AAS_FindClusters(void) if (aasworld.numclusters >= AAS_MAX_CLUSTERS) { AAS_Error("AAS_MAX_CLUSTERS"); - return qfalse; + return false; } //end if cluster = &aasworld.clusters[aasworld.numclusters]; cluster->numareas = 0; @@ -424,16 +424,16 @@ int AAS_FindClusters(void) cluster->numportals = 0; //flood the areas in this cluster if (!AAS_FloodClusterAreas_r(i, aasworld.numclusters)) - return qfalse; + return false; if (!AAS_FloodClusterAreasUsingReachabilities(aasworld.numclusters)) - return qfalse; + return false; //number the cluster areas //AAS_NumberClusterPortals(aasworld.numclusters); AAS_NumberClusterAreas(aasworld.numclusters); //Log_Write("cluster %d has %d areas\r\n", aasworld.numclusters, cluster->numareas); aasworld.numclusters++; } //end for - return qtrue; + return true; } //end of the function AAS_FindClusters //=========================================================================== // @@ -484,10 +484,10 @@ int AAS_MapContainsTeleporters(void) if (classname && !strcmp(classname, "misc_teleporter")) { AAS_FreeBSPEntities(entities); - return qtrue; + return true; } //end if } //end for - return qfalse; + return false; } //end of the function AAS_MapContainsTeleporters //=========================================================================== // @@ -500,7 +500,7 @@ int AAS_NonConvexFaces(aas_face_t *face1, aas_face_t *face2, int side1, int side int i, j, edgenum; aas_plane_t *plane1, *plane2; aas_edge_t *edge; - + plane1 = &aasworld.planes[face1->planenum ^ side1]; plane2 = &aasworld.planes[face2->planenum ^ side2]; @@ -513,7 +513,7 @@ int AAS_NonConvexFaces(aas_face_t *face1, aas_face_t *face2, int side1, int side for (j = 0; j < 2; j++) { if (DotProduct(plane2->normal, aasworld.vertexes[edge->v[j]]) - - plane2->dist < -0.01) return qtrue; + plane2->dist < -0.01) return true; } //end for } //end for for (i = 0; i < face2->numedges; i++) @@ -523,11 +523,11 @@ int AAS_NonConvexFaces(aas_face_t *face1, aas_face_t *face2, int side1, int side for (j = 0; j < 2; j++) { if (DotProduct(plane1->normal, aasworld.vertexes[edge->v[j]]) - - plane1->dist < -0.01) return qtrue; + plane1->dist < -0.01) return true; } //end for } //end for - return qfalse; + return false; } //end of the function AAS_NonConvexFaces //=========================================================================== // @@ -576,12 +576,12 @@ qboolean AAS_CanMergeAreas(int *areanums, int numareas) //if the face was a shared one if (s != numareas) continue; // - if (AAS_NonConvexFaces(face1, face2, side1, side2)) return qfalse; + if (AAS_NonConvexFaces(face1, face2, side1, side2)) return false; } //end for } //end for } //end for } //end for - return qtrue; + return true; } //end of the function AAS_CanMergeAreas //=========================================================================== // @@ -609,13 +609,13 @@ qboolean AAS_NonConvexEdges(aas_edge_t *edge1, aas_edge_t *edge2, int side1, int for (i = 0; i < 2; i++) { - if (DotProduct(aasworld.vertexes[edge1->v[i]], normal2) - dist2 < -0.01) return qfalse; + if (DotProduct(aasworld.vertexes[edge1->v[i]], normal2) - dist2 < -0.01) return false; } //end for for (i = 0; i < 2; i++) { - if (DotProduct(aasworld.vertexes[edge2->v[i]], normal1) - dist1 < -0.01) return qfalse; + if (DotProduct(aasworld.vertexes[edge2->v[i]], normal1) - dist1 < -0.01) return false; } //end for - return qtrue; + return true; } //end of the function AAS_NonConvexEdges //=========================================================================== // @@ -676,12 +676,12 @@ qboolean AAS_CanMergeFaces(int *facenums, int numfaces, int planenum) //if the edge was shared if (s != numfaces) continue; // - if (AAS_NonConvexEdges(edge1, edge2, side1, side2, planenum)) return qfalse; + if (AAS_NonConvexEdges(edge1, edge2, side1, side2, planenum)) return false; } //end for } //end for } //end for } //end for - return qtrue; + return true; } //end of the function AAS_CanMergeFaces*/ //=========================================================================== // @@ -695,7 +695,7 @@ void AAS_ConnectedAreas_r(int *areanums, int numareas, int *connectedareas, int aas_area_t *area; aas_face_t *face; - connectedareas[curarea] = qtrue; + connectedareas[curarea] = true; area = &aasworld.areas[areanums[curarea]]; for (i = 0; i < area->numfaces; i++) { @@ -730,14 +730,14 @@ qboolean AAS_ConnectedAreas(int *areanums, int numareas) int connectedareas[MAX_PORTALAREAS], i; Com_Memset(connectedareas, 0, sizeof(connectedareas)); - if (numareas < 1) return qfalse; - if (numareas == 1) return qtrue; + if (numareas < 1) return false; + if (numareas == 1) return true; AAS_ConnectedAreas_r(areanums, numareas, connectedareas, 0); for (i = 0; i < numareas; i++) { - if (!connectedareas[i]) return qfalse; + if (!connectedareas[i]) return false; } //end for - return qtrue; + return true; } //end of the function AAS_ConnectedAreas //=========================================================================== // gets adjacent areas with less presence types recursively @@ -1183,7 +1183,7 @@ void AAS_RemoveNotClusterClosingPortals(void) { otherareanum = aasworld.reachability[ aasworld.areasettings[i].firstreachablearea + j].areanum; - //this should never be qtrue but we check anyway + //this should never be true but we check anyway if (!otherareanum) continue; //don't flood into other portals if (aasworld.areasettings[otherareanum].contents & AREACONTENTS_CLUSTERPORTAL) continue; @@ -1386,16 +1386,16 @@ int AAS_TestPortals(void) { aasworld.areasettings[portal->areanum].contents &= ~AREACONTENTS_CLUSTERPORTAL; Log_Write("portal area %d has no front cluster\r\n", portal->areanum); - return qfalse; + return false; } //end if if (!portal->backcluster) { aasworld.areasettings[portal->areanum].contents &= ~AREACONTENTS_CLUSTERPORTAL; Log_Write("portal area %d has no back cluster\r\n", portal->areanum); - return qfalse; + return false; } //end if } //end for - return qtrue; + return true; } //end of the function //=========================================================================== // @@ -1521,7 +1521,7 @@ void AAS_InitClustering(void) } //end while botimport.Print(PRT_MESSAGE, "\n"); //the AAS file should be saved - aasworld.savefile = qtrue; + aasworld.savefile = true; //write the portal areas to the log file for (i = 1; i < aasworld.numportals; i++) { diff --git a/tools/mbspc/botlib/be_aas_move.c b/tools/mbspc/botlib/be_aas_move.c index a0fca864..9de1b445 100644 --- a/tools/mbspc/botlib/be_aas_move.c +++ b/tools/mbspc/botlib/be_aas_move.c @@ -68,9 +68,9 @@ int AAS_DropToFloor(vec3_t origin, vec3_t mins, vec3_t maxs) VectorCopy(origin, end); end[2] -= 100; trace = AAS_Trace(origin, mins, maxs, end, 0, CONTENTS_SOLID); - if (trace.startsolid) return qfalse; + if (trace.startsolid) return false; VectorCopy(trace.endpos, origin); - return qtrue; + return true; } //end of the function AAS_DropToFloor //=========================================================================== // @@ -121,7 +121,7 @@ void AAS_InitSettings(void) aassettings.rs_maxjumpfallheight = LibVarValue("rs_maxjumpfallheight", "450"); } //end of the function AAS_InitSettings //=========================================================================== -// returns qtrue if the bot is against a ladder +// returns true if the bot is against a ladder // // Parameter: - // Returns: - @@ -158,11 +158,11 @@ int AAS_AgainstLadder(vec3_t origin) } //end if } //end if //if in solid... wrrr shouldn't happen - if (!areanum) return qfalse; + if (!areanum) return false; //if not in a ladder area - if (!(aasworld.areasettings[areanum].areaflags & AREA_LADDER)) return qfalse; + if (!(aasworld.areasettings[areanum].areaflags & AREA_LADDER)) return false; //if a crouch only area - if (!(aasworld.areasettings[areanum].presencetype & PRESENCE_NORMAL)) return qfalse; + if (!(aasworld.areasettings[areanum].presencetype & PRESENCE_NORMAL)) return false; // area = &aasworld.areas[areanum]; for (i = 0; i < area->numfaces; i++) @@ -177,13 +177,13 @@ int AAS_AgainstLadder(vec3_t origin) //if the origin is pretty close to the plane if (fabs(DotProduct(plane->normal, origin) - plane->dist) < 3.0f) { - if (AAS_PointInsideFace(abs(facenum), origin, 0.1f)) return qtrue; + if (AAS_PointInsideFace(abs(facenum), origin, 0.1f)) return true; } //end if } //end for - return qfalse; + return false; } //end of the function AAS_AgainstLadder //=========================================================================== -// returns qtrue if the bot is on the ground +// returns true if the bot is on the ground // // Parameter: - // Returns: - @@ -201,19 +201,19 @@ int AAS_OnGround(vec3_t origin, int presencetype, int passent) trace = AAS_TraceClientBBox(origin, end, presencetype, passent); //if in solid - if (trace.startsolid) return qfalse; + if (trace.startsolid) return false; //if nothing hit at all - if (trace.fraction >= 1.0) return qfalse; + if (trace.fraction >= 1.0) return false; //if too far from the hit plane - if (origin[2] - trace.endpos[2] > 10) return qfalse; + if (origin[2] - trace.endpos[2] > 10) return false; //check if the plane isn't too steep plane = AAS_PlaneFromNum(trace.planenum); - if (DotProduct(plane->normal, up) < aassettings.phys_maxsteepness) return qfalse; + if (DotProduct(plane->normal, up) < aassettings.phys_maxsteepness) return false; //the bot is on the ground - return qtrue; + return true; } //end of the function AAS_OnGround //=========================================================================== -// returns qtrue if a bot at the given position is swimming +// returns true if a bot at the given position is swimming // // Parameter: - // Returns: - @@ -225,8 +225,8 @@ int AAS_Swimming(vec3_t origin) VectorCopy(origin, testorg); testorg[2] -= 2; - if (AAS_PointContents(testorg) & (CONTENTS_LAVA|CONTENTS_SLIME|CONTENTS_WATER)) return qtrue; - return qfalse; + if (AAS_PointContents(testorg) & (CONTENTS_LAVA|CONTENTS_SLIME|CONTENTS_WATER)) return true; + return false; } //end of the function AAS_Swimming //=========================================================================== // @@ -276,10 +276,10 @@ void AAS_JumpReachRunStart(aas_reachability_t *reach, vec3_t runstart) //get command movement VectorScale(hordir, 400, cmdmove); // - AAS_PredictClientMovement(&move, -1, start, PRESENCE_NORMAL, qtrue, + AAS_PredictClientMovement(&move, -1, start, PRESENCE_NORMAL, true, vec3_origin, cmdmove, 1, 2, 0.1f, SE_ENTERWATER|SE_ENTERSLIME|SE_ENTERLAVA| - SE_HITGROUNDDAMAGE|SE_GAP, 0, qfalse); + SE_HITGROUNDDAMAGE|SE_GAP, 0, false); VectorCopy(move.endpos, runstart); //don't enter slime or lava and don't fall from too high if (move.stopevent & (SE_ENTERSLIME|SE_ENTERLAVA|SE_HITGROUNDDAMAGE)) @@ -383,9 +383,9 @@ void AAS_Accelerate(vec3_t velocity, float frametime, vec3_t wishdir, float wish if (accelspeed > addspeed) { accelspeed = addspeed; } - + for (i=0 ; i<3 ; i++) { - velocity[i] += accelspeed*wishdir[i]; + velocity[i] += accelspeed*wishdir[i]; } } //end of the function AAS_Accelerate //=========================================================================== @@ -441,8 +441,8 @@ int AAS_ClipToBBox(aas_trace_t *trace, vec3_t start, vec3_t end, int presencetyp trace->fraction = 1; for (i = 0; i < 3; i++) { - if (start[i] < absmins[i] && end[i] < absmins[i]) return qfalse; - if (start[i] > absmaxs[i] && end[i] > absmaxs[i]) return qfalse; + if (start[i] < absmins[i] && end[i] < absmins[i]) return false; + if (start[i] > absmaxs[i] && end[i] > absmaxs[i]) return false; } //end for //check bounding box collision VectorSubtract(end, start, dir); @@ -476,7 +476,7 @@ int AAS_ClipToBBox(aas_trace_t *trace, vec3_t start, vec3_t end, int presencetyp //if there was a collision if (i != 3) { - trace->startsolid = qfalse; + trace->startsolid = false; trace->fraction = frac; trace->ent = 0; trace->planenum = 0; @@ -484,9 +484,9 @@ int AAS_ClipToBBox(aas_trace_t *trace, vec3_t start, vec3_t end, int presencetyp trace->lastarea = 0; //trace endpos for (j = 0; j < 3; j++) trace->endpos[j] = start[j] + dir[j] * frac; - return qtrue; + return true; } //end if - return qfalse; + return false; } //end of the function AAS_ClipToBBox //=========================================================================== // predicts the movement @@ -530,7 +530,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, vec3_t up = {0, 0, 1}; aas_plane_t *plane, *plane2; aas_trace_t trace, steptrace; - + if (frametime <= 0) frametime = 0.1f; // phys_friction = aassettings.phys_friction; @@ -574,7 +574,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, AAS_ApplyFriction(frame_test_vel, friction, phys_stopspeed, frametime); VectorScale(frame_test_vel, frametime, frame_test_vel); } //end if - crouch = qfalse; + crouch = false; //apply command movement if (n < cmdframes) { @@ -585,7 +585,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, { if (cmdmove[2] < -300) { - crouch = qtrue; + crouch = true; maxvel = phys_maxcrouchvelocity; } //end if //if not swimming and upmove is positive then jump @@ -679,7 +679,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if //NOTE: if not the first frame @@ -696,7 +696,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if if (stopevent & SE_TOUCHTELEPORTER) @@ -712,7 +712,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if if (stopevent & SE_TOUCHCLUSTERPORTAL) @@ -728,7 +728,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if } //end for @@ -747,7 +747,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if //move the entity to the trace end point @@ -775,12 +775,12 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if } //end if //assume there's no step - step = qfalse; + step = false; //if it is a vertical plane and the bot didn't jump recently if (plane->normal[2] == 0 && (jump_frame < 0 || n - jump_frame > 2)) { @@ -810,7 +810,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, } //end if //#endif //AAS_MOVE_DEBUG org[2] = steptrace.endpos[2]; - step = qtrue; + step = true; } //end if } //end if } //end if @@ -818,19 +818,19 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, if (!step) { //velocity left to test for this frame is the projection - //of the current test velocity into the hit plane + //of the current test velocity into the hit plane VectorMA(left_test_vel, -DotProduct(left_test_vel, plane->normal), plane->normal, left_test_vel); //store the old velocity for landing check VectorCopy(frame_test_vel, old_frame_test_vel); //test velocity for the next frame is the projection - //of the velocity of the current frame into the hit plane + //of the velocity of the current frame into the hit plane VectorMA(frame_test_vel, -DotProduct(frame_test_vel, plane->normal), plane->normal, frame_test_vel); //check for a landing on an almost horizontal floor if (DotProduct(plane->normal, up) > phys_maxsteepness) { - onground = qtrue; + onground = true; } //end if if (stopevent & SE_HITGROUNDDAMAGE) { @@ -867,14 +867,14 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if } //end if } //end if } //end if //extra check to prevent endless loop - if (++j > 20) return qfalse; + if (++j > 20) return false; //while there is a plane hit } while(trace.fraction < 1.0); //if going down @@ -908,7 +908,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = pc; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if // @@ -927,7 +927,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if else if (stopevent & SE_LEAVEGROUND) @@ -941,7 +941,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end else if else if (stopevent & SE_GAP) { @@ -968,7 +968,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->endcontents = 0; move->time = n * frametime; move->frames = n; - return qtrue; + return true; } //end if } //end if } //end if @@ -984,7 +984,7 @@ int AAS_ClientMovementPrediction(struct aas_clientmove_s *move, move->time = n * frametime; move->frames = n; // - return qtrue; + return true; } //end of the function AAS_ClientMovementPrediction //=========================================================================== // @@ -1042,8 +1042,8 @@ void AAS_TestMovementPrediction(int entnum, vec3_t origin, vec3_t dir) VectorScale(dir, 400, cmdmove); cmdmove[2] = 224; AAS_ClearShownDebugLines(); - AAS_PredictClientMovement(&move, entnum, origin, PRESENCE_NORMAL, qtrue, - velocity, cmdmove, 13, 13, 0.1f, SE_HITGROUND, 0, qtrue);//SE_LEAVEGROUND); + AAS_PredictClientMovement(&move, entnum, origin, PRESENCE_NORMAL, true, + velocity, cmdmove, 13, 13, 0.1f, SE_HITGROUND, 0, true);//SE_LEAVEGROUND); if (move.stopevent & SE_LEAVEGROUND) { botimport.Print(PRT_MESSAGE, "leave ground\n"); @@ -1057,7 +1057,7 @@ void AAS_TestMovementPrediction(int entnum, vec3_t origin, vec3_t dir) // start : start position of jump // end : end position of jump // *speed : returned speed for jump -// Returns: qfalse if too high or too far from start to end +// Returns: false if too high or too far from start to end // Changes Globals: - //=========================================================================== int AAS_HorizontalVelocityForJump(float zvel, vec3_t start, vec3_t end, float *velocity) diff --git a/tools/mbspc/botlib/be_aas_reach.c b/tools/mbspc/botlib/be_aas_reach.c index 182cf478..7c85a49c 100644 --- a/tools/mbspc/botlib/be_aas_reach.c +++ b/tools/mbspc/botlib/be_aas_reach.c @@ -268,7 +268,7 @@ int AAS_GetJumpPadInfo(int ent, vec3_t areastart, vec3_t absmins, vec3_t absmaxs if (!ent2) { botimport.Print(PRT_MESSAGE, "trigger_push without target entity %s\n", target); - return qfalse; + return false; } //end if AAS_VectorForBSPEpairKey(ent2, "origin", ent2origin); // @@ -278,7 +278,7 @@ int AAS_GetJumpPadInfo(int ent, vec3_t areastart, vec3_t absmins, vec3_t absmaxs if (!time) { botimport.Print(PRT_MESSAGE, "trigger_push without time\n"); - return qfalse; + return false; } //end if // set s.origin2 to the push velocity VectorSubtract ( ent2origin, origin, velocity); @@ -288,7 +288,7 @@ int AAS_GetJumpPadInfo(int ent, vec3_t areastart, vec3_t absmins, vec3_t absmaxs forward *= 1.1f; VectorScale(velocity, forward, velocity); velocity[2] = time * gravity; - return qtrue; + return true; } //end of the function AAS_GetJumpPadInfo //=========================================================================== // @@ -336,7 +336,7 @@ int AAS_BestReachableFromJumpPadArea(vec3_t origin, vec3_t mins, vec3_t maxs) // VectorSet(cmdmove, 0, 0, 0); Com_Memset(&move, 0, sizeof(aas_clientmove_t)); - AAS_ClientMovementHitBBox(&move, -1, areastart, PRESENCE_NORMAL, qfalse, + AAS_ClientMovementHitBBox(&move, -1, areastart, PRESENCE_NORMAL, false, velocity, cmdmove, 0, 30, 0.1f, bboxmins, bboxmaxs, bot_visualizejumppads); if (move.frames < 30) { @@ -422,7 +422,7 @@ int AAS_BestReachableArea(vec3_t origin, vec3_t mins, vec3_t maxs, vec3_t goalor { //it can very well happen that the AAS_PointAreaNum function tells that //a point is in an area and that starting a AAS_TraceClientBBox from that - //point will return trace.startsolid qtrue + //point will return trace.startsolid true #if 0 if (AAS_PointAreaNum(start)) { @@ -522,7 +522,7 @@ void AAS_FreeReachability(aas_lreachability_t *lreach) numlreachabilities--; } //end of the function AAS_FreeReachability //=========================================================================== -// returns qtrue if the area has reachability links +// returns true if the area has reachability links // // Parameter: - // Returns: - @@ -664,11 +664,11 @@ float AAS_MaxJumpDistance(float phys_jumpvel) //=========================================================================== int AAS_AreaCrouch(int areanum) { - if (!(aasworld.areasettings[areanum].presencetype & PRESENCE_NORMAL)) return qtrue; - else return qfalse; + if (!(aasworld.areasettings[areanum].presencetype & PRESENCE_NORMAL)) return true; + else return false; } //end of the function AAS_AreaCrouch //=========================================================================== -// returns qtrue if it is possible to swim in the area +// returns true if it is possible to swim in the area // // Parameter: - // Returns: - @@ -676,11 +676,11 @@ int AAS_AreaCrouch(int areanum) //=========================================================================== int AAS_AreaSwim(int areanum) { - if (aasworld.areasettings[areanum].areaflags & AREA_LIQUID) return qtrue; - else return qfalse; + if (aasworld.areasettings[areanum].areaflags & AREA_LIQUID) return true; + else return false; } //end of the function AAS_AreaSwim //=========================================================================== -// returns qtrue if the area contains a liquid +// returns true if the area contains a liquid // // Parameter: - // Returns: - @@ -688,8 +688,8 @@ int AAS_AreaSwim(int areanum) //=========================================================================== int AAS_AreaLiquid(int areanum) { - if (aasworld.areasettings[areanum].areaflags & AREA_LIQUID) return qtrue; - else return qfalse; + if (aasworld.areasettings[areanum].areaflags & AREA_LIQUID) return true; + else return false; } //end of the function AAS_AreaLiquid //=========================================================================== // @@ -712,7 +712,7 @@ int AAS_AreaSlime(int areanum) return (aasworld.areasettings[areanum].contents & AREACONTENTS_SLIME); } //end of the function AAS_AreaSlime //=========================================================================== -// returns qtrue if the area contains ground faces +// returns true if the area contains ground faces // // Parameter: - // Returns: - @@ -797,9 +797,9 @@ qboolean AAS_ReachabilityExists(int area1num, int area2num) for (r = areareachability[area1num]; r; r = r->next) { - if (r->areanum == area2num) return qtrue; + if (r->areanum == area2num) return true; } //end for - return qfalse; + return false; } //end of the function AAS_ReachabilityExists //=========================================================================== // returns true if there is a solid just after the end point when going @@ -824,15 +824,15 @@ int AAS_NearbySolidOrGap(vec3_t start, vec3_t end) { testpoint[2] += 16; areanum = AAS_PointAreaNum(testpoint); - if (!areanum) return qtrue; + if (!areanum) return true; } //end if VectorMA(end, 64, dir, testpoint); areanum = AAS_PointAreaNum(testpoint); if (areanum) { - if (!AAS_AreaSwim(areanum) && !AAS_AreaGrounded(areanum)) return qtrue; + if (!AAS_AreaSwim(areanum) && !AAS_AreaGrounded(areanum)) return true; } //end if - return qfalse; + return false; } //end of the function AAS_SolidGapTime //=========================================================================== // searches for swim reachabilities between adjacent areas @@ -850,9 +850,9 @@ int AAS_Reachability_Swim(int area1num, int area2num) aas_plane_t *plane; vec3_t start; - if (!AAS_AreaSwim(area1num) || !AAS_AreaSwim(area2num)) return qfalse; + if (!AAS_AreaSwim(area1num) || !AAS_AreaSwim(area2num)) return false; //if the second area is crouch only - if (!(aasworld.areasettings[area2num].presencetype & PRESENCE_NORMAL)) return qfalse; + if (!(aasworld.areasettings[area2num].presencetype & PRESENCE_NORMAL)) return false; area1 = &aasworld.areas[area1num]; area2 = &aasworld.areas[area2num]; @@ -860,8 +860,8 @@ int AAS_Reachability_Swim(int area1num, int area2num) //if the areas are not near anough for (i = 0; i < 3; i++) { - if (area1->mins[i] > area2->maxs[i] + 10) return qfalse; - if (area1->maxs[i] < area2->mins[i] - 10) return qfalse; + if (area1->mins[i] > area2->maxs[i] + 10) return false; + if (area1->maxs[i] < area2->mins[i] - 10) return false; } //end for //find a shared face and create a reachability link for (i = 0; i < area1->numfaces; i++) @@ -884,7 +884,7 @@ int AAS_Reachability_Swim(int area1num, int area2num) face1 = &aasworld.faces[face1num]; //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = face1num; lreach->edgenum = 0; @@ -901,12 +901,12 @@ int AAS_Reachability_Swim(int area1num, int area2num) lreach->next = areareachability[area1num]; areareachability[area1num] = lreach; reach_swim++; - return qtrue; + return true; } //end if } //end if } //end for } //end for - return qfalse; + return false; } //end of the function AAS_Reachability_Swim //=========================================================================== // searches for reachabilities between adjacent areas with equal floor @@ -928,25 +928,25 @@ int AAS_Reachability_EqualFloorHeight(int area1num, int area2num) aas_plane_t *plane2; aas_lreachability_t lr, *lreach; - if (!AAS_AreaGrounded(area1num) || !AAS_AreaGrounded(area2num)) return qfalse; + if (!AAS_AreaGrounded(area1num) || !AAS_AreaGrounded(area2num)) return false; area1 = &aasworld.areas[area1num]; area2 = &aasworld.areas[area2num]; //if the areas are not near anough in the x-y direction for (i = 0; i < 2; i++) { - if (area1->mins[i] > area2->maxs[i] + 10) return qfalse; - if (area1->maxs[i] < area2->mins[i] - 10) return qfalse; + if (area1->mins[i] > area2->maxs[i] + 10) return false; + if (area1->maxs[i] < area2->mins[i] - 10) return false; } //end for //if area 2 is too high above area 1 - if (area2->mins[2] > area1->maxs[2]) return qfalse; + if (area2->mins[2] > area1->maxs[2]) return false; // VectorCopy(gravitydirection, invgravity); VectorInverse(invgravity); // bestheight = 99999; bestlength = 0; - foundreach = qfalse; + foundreach = false; Com_Memset(&lr, 0, sizeof(aas_lreachability_t)); //make the compiler happy // //check if the areas have ground faces with a common edge @@ -1015,7 +1015,7 @@ int AAS_Reachability_EqualFloorHeight(int area1num, int area2num) VectorCopy(end, lr.end); lr.traveltype = TRAVEL_WALK; lr.traveltime = 1; - foundreach = qtrue; + foundreach = true; } //end if } //end for } //end for @@ -1025,7 +1025,7 @@ int AAS_Reachability_EqualFloorHeight(int area1num, int area2num) { //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = lr.areanum; lreach->facenum = lr.facenum; lreach->edgenum = lr.edgenum; @@ -1051,9 +1051,9 @@ int AAS_Reachability_EqualFloorHeight(int area1num, int area2num) //if (AAS_AreaGroundFaceArea(lreach->areanum) < 500) lreach->traveltime += 100; // reach_equalfloor++; - return qtrue; + return true; } //end if - return qfalse; + return false; } //end of the function AAS_Reachability_EqualFloorHeight //=========================================================================== // searches step, barrier, waterjump and walk off ledge reachabilities @@ -1085,9 +1085,9 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 aas_trace_t trace; //must be able to walk or swim in the first area - if (!AAS_AreaGrounded(area1num) && !AAS_AreaSwim(area1num)) return qfalse; + if (!AAS_AreaGrounded(area1num) && !AAS_AreaSwim(area1num)) return false; // - if (!AAS_AreaGrounded(area2num) && !AAS_AreaSwim(area2num)) return qfalse; + if (!AAS_AreaGrounded(area2num) && !AAS_AreaSwim(area2num)) return false; // area1 = &aasworld.areas[area1num]; area2 = &aasworld.areas[area2num]; @@ -1096,16 +1096,16 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 //if the areas are not near anough in the x-y direction for (i = 0; i < 2; i++) { - if (area1->mins[i] > area2->maxs[i] + 10) return qfalse; - if (area1->maxs[i] < area2->mins[i] - 10) return qfalse; + if (area1->mins[i] > area2->maxs[i] + 10) return false; + if (area1->maxs[i] < area2->mins[i] - 10) return false; } //end for // - ground_foundreach = qfalse; + ground_foundreach = false; ground_bestdist = 99999; ground_bestlength = 0; ground_bestarea2groundedgenum = 0; // - water_foundreach = qfalse; + water_foundreach = false; water_bestdist = 99999; water_bestlength = 0; water_bestarea2groundedgenum = 0; @@ -1305,7 +1305,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 { ground_bestdist = dist; ground_bestlength = length; - ground_foundreach = qtrue; + ground_foundreach = true; ground_bestarea2groundedgenum = edge1num; //best point towards area1 VectorCopy(start, ground_beststart); @@ -1325,7 +1325,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 { water_bestdist = dist; water_bestlength = length; - water_foundreach = qtrue; + water_foundreach = true; water_bestarea2groundedgenum = edge1num; //best point towards area1 VectorCopy(start, water_beststart); @@ -1366,7 +1366,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 { //create walk reachability from area1 to area2 lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = 0; lreach->edgenum = ground_bestarea2groundedgenum; @@ -1392,7 +1392,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 //if (AAS_AreaGroundFaceArea(lreach->areanum) < 500) lreach->traveltime += 100; // reach_step++; - return qtrue; + return true; } //end if } //end if // @@ -1433,7 +1433,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 { //create water jump reachability from area1 to area2 lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = 0; lreach->edgenum = water_bestarea2groundedgenum; @@ -1445,7 +1445,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 areareachability[area1num] = lreach; //we've got another waterjump reachability reach_waterjump++; - return qtrue; + return true; } //end if } //end if } //end if @@ -1481,7 +1481,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 { //create barrier jump reachability from area1 to area2 lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = 0; lreach->edgenum = ground_bestarea2groundedgenum; @@ -1493,7 +1493,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 areareachability[area1num] = lreach; //we've got another barrierjump reachability reach_barrier++; - return qtrue; + return true; } //end if } //end if } //end if @@ -1528,7 +1528,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 { //create walk reachability from area1 to area2 lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = 0; lreach->edgenum = ground_bestarea2groundedgenum; @@ -1540,7 +1540,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 areareachability[area1num] = lreach; //we've got another walk reachability reach_walk++; - return qtrue; + return true; } //end if // if no maximum fall height set or less than the max if (!aassettings.rs_maxfallheight || fabs(ground_bestdist) < aassettings.rs_maxfallheight) { @@ -1567,7 +1567,7 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 { //create a walk off ledge reachability from area1 to area2 lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = 0; lreach->edgenum = ground_bestarea2groundedgenum; @@ -1594,14 +1594,14 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2 //NOTE: don't create a weapon (rl, bfg) jump reachability here //because it interferes with other reachabilities //like the ladder reachability - return qtrue; + return true; } //end if } //end if } //end if } //end if } //end else } //end if - return qfalse; + return false; } //end of the function AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge //=========================================================================== // returns the distance between the two vectors @@ -1729,7 +1729,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, p3[2] = (plane1->dist - DotProduct(plane1->normal, p3)) / plane1->normal[2]; p4[2] = (plane1->dist - DotProduct(plane1->normal, p4)) / plane1->normal[2]; // - founddist = qfalse; + founddist = false; // if (VectorBetweenVectors(p1, v3, v4)) { @@ -1745,7 +1745,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, VectorCopy(v1, beststart); VectorCopy(p1, bestend); } //end if - founddist = qtrue; + founddist = true; } //end if if (VectorBetweenVectors(p2, v3, v4)) { @@ -1761,7 +1761,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, VectorCopy(v2, beststart); VectorCopy(p2, bestend); } //end if - founddist = qtrue; + founddist = true; } //end else if if (VectorBetweenVectors(p3, v1, v2)) { @@ -1777,7 +1777,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, VectorCopy(p3, beststart); VectorCopy(v3, bestend); } //end if - founddist = qtrue; + founddist = true; } //end else if if (VectorBetweenVectors(p4, v1, v2)) { @@ -1793,7 +1793,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, VectorCopy(p4, beststart); VectorCopy(v4, bestend); } //end if - founddist = qtrue; + founddist = true; } //end else if //if no shortest distance was found the shortest distance //is between one of the vertexes of edge1 and one of edge2 @@ -1905,7 +1905,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, p3[2] = (plane1->dist - DotProduct(plane1->normal, p3)) / plane1->normal[2]; p4[2] = (plane1->dist - DotProduct(plane1->normal, p4)) / plane1->normal[2]; // - founddist = qfalse; + founddist = false; // if (VectorBetweenVectors(p1, v3, v4)) { @@ -1941,7 +1941,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, VectorCopy(p1, bestend1); VectorCopy(p1, bestend2); } //end if - founddist = qtrue; + founddist = true; } //end if if (VectorBetweenVectors(p2, v3, v4)) { @@ -1977,7 +1977,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, VectorCopy(p2, bestend1); VectorCopy(p2, bestend2); } //end if - founddist = qtrue; + founddist = true; } //end else if if (VectorBetweenVectors(p3, v1, v2)) { @@ -2013,7 +2013,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, VectorCopy(v3, bestend1); VectorCopy(v3, bestend2); } //end if - founddist = qtrue; + founddist = true; } //end else if if (VectorBetweenVectors(p4, v1, v2)) { @@ -2049,7 +2049,7 @@ float AAS_ClosestEdgePoints(vec3_t v1, vec3_t v2, vec3_t v3, vec3_t v4, VectorCopy(v4, bestend1); VectorCopy(v4, bestend2); } //end if - founddist = qtrue; + founddist = true; } //end else if //if no shortest distance was found the shortest distance //is between one of the vertexes of edge1 and one of edge2 @@ -2125,9 +2125,9 @@ int AAS_Reachability_Jump(int area1num, int area2num) aas_clientmove_t move; aas_lreachability_t *lreach; - if (!AAS_AreaGrounded(area1num) || !AAS_AreaGrounded(area2num)) return qfalse; + if (!AAS_AreaGrounded(area1num) || !AAS_AreaGrounded(area2num)) return false; //cannot jump from or to a crouch area - if (AAS_AreaCrouch(area1num) || AAS_AreaCrouch(area2num)) return qfalse; + if (AAS_AreaCrouch(area1num) || AAS_AreaCrouch(area2num)) return false; // area1 = &aasworld.areas[area1num]; area2 = &aasworld.areas[area2num]; @@ -2141,11 +2141,11 @@ int AAS_Reachability_Jump(int area1num, int area2num) //if the areas are not near anough in the x-y direction for (i = 0; i < 2; i++) { - if (area1->mins[i] > area2->maxs[i] + maxjumpdistance) return qfalse; - if (area1->maxs[i] < area2->mins[i] - maxjumpdistance) return qfalse; + if (area1->mins[i] > area2->maxs[i] + maxjumpdistance) return false; + if (area1->maxs[i] < area2->mins[i] - maxjumpdistance) return false; } //end for //if area2 is way to high to jump up to - if (area2->mins[2] > area1->maxs[2] + maxjumpheight) return qfalse; + if (area2->mins[2] > area1->maxs[2] + maxjumpheight) return false; // bestdist = 999999; // @@ -2209,7 +2209,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) //get the horizontal speed for the jump, if it isn't possible to calculate this //speed (the jump is not possible) then there's no jump reachability created if (!AAS_HorizontalVelocityForJump(phys_jumpvel, beststart, bestend, &speed)) - return qfalse; + return false; speed *= 1.05f; traveltype = TRAVEL_JUMP; // @@ -2217,7 +2217,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) VectorSubtract(bestend, beststart, dir); dir[2] = 0; if (VectorLength(dir) < 10) - return qfalse; + return false; } //end if // VectorSubtract(bestend, beststart, dir); @@ -2229,7 +2229,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) trace = AAS_TraceClientBBox(teststart, testend, PRESENCE_NORMAL, -1); // if (trace.startsolid) - return qfalse; + return false; if (trace.fraction < 1) { plane = &aasworld.planes[trace.planenum]; @@ -2240,7 +2240,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) if (!(AAS_PointContents(trace.endpos) & (CONTENTS_LAVA|CONTENTS_SLIME))) { if (teststart[2] - trace.endpos[2] <= aassettings.phys_maxbarrier) - return qfalse; + return false; } //end if } //end if } //end if @@ -2252,7 +2252,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) trace = AAS_TraceClientBBox(teststart, testend, PRESENCE_NORMAL, -1); // if (trace.startsolid) - return qfalse; + return false; if (trace.fraction < 1) { plane = &aasworld.planes[trace.planenum]; @@ -2263,7 +2263,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) if (!(AAS_PointContents(trace.endpos) & (CONTENTS_LAVA|CONTENTS_SLIME))) { if (teststart[2] - trace.endpos[2] <= aassettings.phys_maxbarrier) - return qfalse; + return false; } //end if } //end if } //end if @@ -2298,18 +2298,18 @@ int AAS_Reachability_Jump(int area1num, int area2num) VectorNormalize(dir); VectorScale(dir, speed, velocity); // - AAS_PredictClientMovement(&move, -1, beststart, PRESENCE_NORMAL, qtrue, + AAS_PredictClientMovement(&move, -1, beststart, PRESENCE_NORMAL, true, velocity, cmdmove, 3, 30, 0.1f, - stopevent, 0, qfalse); + stopevent, 0, false); // if prediction time wasn't enough to fully predict the movement if (move.frames >= 30) - return qfalse; + return false; // don't enter slime or lava and don't fall from too high if (move.stopevent & (SE_ENTERSLIME|SE_ENTERLAVA)) - return qfalse; + return false; // never jump or fall through a cluster portal if (move.stopevent & SE_TOUCHCLUSTERPORTAL) - return qfalse; + return false; //the end position should be in area2, also test a little bit back //because the predicted jump could have rushed through the area VectorMA(move.endpos, -64, dir, teststart); @@ -2324,7 +2324,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) break; } if (i >= 3) - return qfalse; + return false; // #ifdef REACH_DEBUG //create the reachability @@ -2332,7 +2332,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) #endif //REACH_DEBUG //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = 0; lreach->edgenum = 0; @@ -2371,7 +2371,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) else reach_walkoffledge++; } //end if - return qfalse; + return false; } //end of the function AAS_Reachability_Jump //=========================================================================== // create a possible ladder reachability from area1 to area2 @@ -2396,7 +2396,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) aas_lreachability_t *lreach; aas_trace_t trace; - if (!AAS_AreaLadder(area1num) || !AAS_AreaLadder(area2num)) return qfalse; + if (!AAS_AreaLadder(area1num) || !AAS_AreaLadder(area2num)) return false; // phys_jumpvel = aassettings.phys_jumpvel; //maximum height a player can jump with the given initial z velocity @@ -2475,7 +2475,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) ladderface1vertical = fabs(DotProduct(plane1->normal, up)) < 0.1f; ladderface2vertical = fabs(DotProduct(plane2->normal, up)) < 0.1f; //there's only reachability between vertical ladder faces - if (!ladderface1vertical && !ladderface2vertical) return qfalse; + if (!ladderface1vertical && !ladderface2vertical) return false; //if both vertical ladder faces if (ladderface1vertical && ladderface2vertical //and the ladder faces do not make a sharp corner @@ -2485,7 +2485,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) { //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = ladderface1num; lreach->edgenum = abs(sharededgenum); @@ -2500,7 +2500,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) reach_ladder++; //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area1num; lreach->facenum = ladderface2num; lreach->edgenum = abs(sharededgenum); @@ -2514,7 +2514,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) // reach_ladder++; // - return qtrue; + return true; } //end if //if the second ladder face is also a ground face //create ladder end (just ladder) reachability and @@ -2523,7 +2523,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) { //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = ladderface1num; lreach->edgenum = abs(sharededgenum); @@ -2539,7 +2539,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) reach_ladder++; //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area1num; lreach->facenum = ladderface2num; lreach->edgenum = abs(sharededgenum); @@ -2552,7 +2552,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) // reach_walkoffledge++; // - return qtrue; + return true; } //end if // if (ladderface1vertical) @@ -2620,7 +2620,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) { //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = ladderface1num; lreach->edgenum = lowestedgenum; @@ -2634,7 +2634,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) reach_ladder++; //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area1num; lreach->facenum = ladderface1num; lreach->edgenum = lowestedgenum; @@ -2650,7 +2650,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) // reach_jump++; // - return qtrue; + return true; #ifdef REACH_DEBUG Log_Write("jump up to ladder reach between %d and %d\r\n", area2num, area1num); #endif //REACH_DEBUG @@ -2685,7 +2685,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) // //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area1num; lreach->facenum = ladderface1num; lreach->edgenum = lowestedgenum; @@ -2706,7 +2706,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num) } //end if*/ } //end if } //end if - return qfalse; + return false; } //end of the function AAS_Reachability_Ladder //=========================================================================== // @@ -2879,10 +2879,10 @@ void AAS_Reachability_Teleport(void) VectorClear(velocity); } //end else VectorClear(cmdmove); - AAS_PredictClientMovement(&move, -1, destorigin, PRESENCE_NORMAL, qfalse, + AAS_PredictClientMovement(&move, -1, destorigin, PRESENCE_NORMAL, false, velocity, cmdmove, 0, 30, 0.1f, SE_HITGROUND|SE_ENTERWATER|SE_ENTERSLIME| - SE_ENTERLAVA|SE_HITGROUNDDAMAGE|SE_TOUCHJUMPPAD|SE_TOUCHTELEPORTER, 0, qfalse); //qtrue); + SE_ENTERLAVA|SE_HITGROUNDDAMAGE|SE_TOUCHJUMPPAD|SE_TOUCHTELEPORTER, 0, false); //true); area2num = AAS_PointAreaNum(move.endpos); if (move.stopevent & (SE_ENTERSLIME|SE_ENTERLAVA)) { @@ -3403,13 +3403,13 @@ void AAS_Reachability_FuncBobbing(void) // if (i == 0) { - firststartreach = AAS_FindFaceReachabilities(start_edgeverts, 4, &start_plane, qtrue); - firstendreach = AAS_FindFaceReachabilities(end_edgeverts, 4, &end_plane, qfalse); + firststartreach = AAS_FindFaceReachabilities(start_edgeverts, 4, &start_plane, true); + firstendreach = AAS_FindFaceReachabilities(end_edgeverts, 4, &end_plane, false); } //end if else { - firststartreach = AAS_FindFaceReachabilities(end_edgeverts, 4, &end_plane, qtrue); - firstendreach = AAS_FindFaceReachabilities(start_edgeverts, 4, &start_plane, qfalse); + firststartreach = AAS_FindFaceReachabilities(end_edgeverts, 4, &end_plane, true); + firstendreach = AAS_FindFaceReachabilities(start_edgeverts, 4, &start_plane, false); } //end else // //create reachabilities from start to end @@ -3596,7 +3596,7 @@ void AAS_Reachability_JumpPad(void) { if (link->areanum == 563) { - ret = qfalse; + ret = false; } } */ @@ -3622,7 +3622,7 @@ void AAS_Reachability_JumpPad(void) area2num = 0; for (i = 0; i < 20; i++) { - AAS_PredictClientMovement(&move, -1, areastart, PRESENCE_NORMAL, qfalse, + AAS_PredictClientMovement(&move, -1, areastart, PRESENCE_NORMAL, false, velocity, cmdmove, 0, 30, 0.1f, SE_HITGROUND|SE_ENTERWATER|SE_ENTERSLIME| SE_ENTERLAVA|SE_HITGROUNDDAMAGE|SE_TOUCHJUMPPAD|SE_TOUCHTELEPORTER, 0, bot_visualizejumppads); @@ -3671,7 +3671,7 @@ void AAS_Reachability_JumpPad(void) //check for areas we can reach with air control for (area2num = 1; area2num < aasworld.numareas; area2num++) { - visualize = qfalse; + visualize = false; /* if (area2num == 3568) { @@ -3679,7 +3679,7 @@ void AAS_Reachability_JumpPad(void) { if (link->areanum == 3380) { - visualize = qtrue; + visualize = true; botimport.Print(PRT_MESSAGE, "bah\n"); } //end if } //end for @@ -3721,7 +3721,7 @@ void AAS_Reachability_JumpPad(void) //get command movement VectorScale(dir, speed, cmdmove); // - AAS_PredictClientMovement(&move, -1, areastart, PRESENCE_NORMAL, qfalse, + AAS_PredictClientMovement(&move, -1, areastart, PRESENCE_NORMAL, false, velocity, cmdmove, 30, 30, 0.1f, SE_ENTERWATER|SE_ENTERSLIME| SE_ENTERLAVA|SE_HITGROUNDDAMAGE| @@ -3795,16 +3795,16 @@ int AAS_Reachability_Grapple(int area1num, int area2num) vec_t *v; //only grapple when on the ground or swimming - if (!AAS_AreaGrounded(area1num) && !AAS_AreaSwim(area1num)) return qfalse; + if (!AAS_AreaGrounded(area1num) && !AAS_AreaSwim(area1num)) return false; //don't grapple from a crouch area - if (!(AAS_AreaPresenceType(area1num) & PRESENCE_NORMAL)) return qfalse; + if (!(AAS_AreaPresenceType(area1num) & PRESENCE_NORMAL)) return false; //NOTE: disabled area swim it doesn't work right - if (AAS_AreaSwim(area1num)) return qfalse; + if (AAS_AreaSwim(area1num)) return false; // area1 = &aasworld.areas[area1num]; area2 = &aasworld.areas[area2num]; //don't grapple towards way lower areas - if (area2->maxs[2] < area1->mins[2]) return qfalse; + if (area2->maxs[2] < area1->mins[2]) return false; // VectorCopy(aasworld.areas[area1num].center, start); //if not a swim area @@ -3815,12 +3815,12 @@ int AAS_Reachability_Grapple(int area1num, int area2num) VectorCopy(start, end); end[2] -= 1000; trace = AAS_TraceClientBBox(start, end, PRESENCE_CROUCH, -1); - if (trace.startsolid) return qfalse; + if (trace.startsolid) return false; VectorCopy(trace.endpos, areastart); } //end if else { - if (!(AAS_PointContents(start) & (CONTENTS_LAVA|CONTENTS_SLIME|CONTENTS_WATER))) return qfalse; + if (!(AAS_PointContents(start) & (CONTENTS_LAVA|CONTENTS_SLIME|CONTENTS_WATER))) return false; } //end else // //start is now the start point @@ -3899,7 +3899,7 @@ int AAS_Reachability_Grapple(int area1num, int area2num) if (j < numareas) continue; //create a new reachability link lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = areanum; lreach->facenum = face2num; lreach->edgenum = 0; @@ -3915,7 +3915,7 @@ int AAS_Reachability_Grapple(int area1num, int area2num) reach_grapple++; } //end for // - return qfalse; + return false; } //end of the function AAS_Reachability_Grapple //=========================================================================== // @@ -4007,20 +4007,20 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num) aas_clientmove_t move; aas_trace_t trace; - visualize = qfalse; + visualize = false; // if (area1num == 4436 && area2num == 4318) // { -// visualize = qtrue; +// visualize = true; // } - if (!AAS_AreaGrounded(area1num) || AAS_AreaSwim(area1num)) return qfalse; - if (!AAS_AreaGrounded(area2num)) return qfalse; + if (!AAS_AreaGrounded(area1num) || AAS_AreaSwim(area1num)) return false; + if (!AAS_AreaGrounded(area2num)) return false; //NOTE: only weapon jump towards areas with an interesting item in it?? - if (!(aasworld.areasettings[area2num].areaflags & AREA_WEAPONJUMP)) return qfalse; + if (!(aasworld.areasettings[area2num].areaflags & AREA_WEAPONJUMP)) return false; // area1 = &aasworld.areas[area1num]; area2 = &aasworld.areas[area2num]; //don't weapon jump towards way lower areas - if (area2->maxs[2] < area1->mins[2]) return qfalse; + if (area2->maxs[2] < area1->mins[2]) return false; // VectorCopy(aasworld.areas[area1num].center, start); //if not a swim area @@ -4029,7 +4029,7 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num) VectorCopy(start, end); end[2] -= 1000; trace = AAS_TraceClientBBox(start, end, PRESENCE_CROUCH, -1); - if (trace.startsolid) return qfalse; + if (trace.startsolid) return false; VectorCopy(trace.endpos, areastart); // //areastart is now the start point @@ -4069,7 +4069,7 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num) VectorSet(cmdmove, 0, 0, 0); */ // - AAS_PredictClientMovement(&move, -1, areastart, PRESENCE_NORMAL, qtrue, + AAS_PredictClientMovement(&move, -1, areastart, PRESENCE_NORMAL, true, velocity, cmdmove, 30, 30, 0.1f, SE_ENTERWATER|SE_ENTERSLIME| SE_ENTERLAVA|SE_HITGROUNDDAMAGE| @@ -4082,7 +4082,7 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num) { //create a rocket or bfg jump reachability from area1 to area2 lreach = AAS_AllocReachability(); - if (!lreach) return qfalse; + if (!lreach) return false; lreach->areanum = area2num; lreach->facenum = 0; lreach->edgenum = 0; @@ -4102,14 +4102,14 @@ int AAS_Reachability_WeaponJump(int area1num, int area2num) areareachability[area1num] = lreach; // reach_rocketjump++; - return qtrue; + return true; } //end if } //end if } //end if } //end for } //end for // - return qfalse; + return false; } //end of the function AAS_Reachability_WeaponJump //=========================================================================== // calculates additional walk off ledge reachabilities for the given area @@ -4168,7 +4168,7 @@ void AAS_Reachability_WalkOffLedge(int areanum) if (aasworld.areasettings[otherareanum].areaflags & AREA_GROUNDED) { //check for a possible gap - gap = qfalse; + gap = false; for (n = 0; n < area2->numfaces; n++) { face3num = aasworld.faceindex[area2->firstface + n]; @@ -4185,17 +4185,17 @@ void AAS_Reachability_WalkOffLedge(int areanum) { if (!(face3->faceflags & FACE_SOLID)) { - gap = qtrue; + gap = true; break; } //end if // if (face3->faceflags & FACE_GROUND) { - gap = qfalse; + gap = false; break; } //end if //FIXME: there are more situations to be handled - gap = qtrue; + gap = true; break; } //end if } //end for @@ -4362,9 +4362,9 @@ int AAS_ContinueInitReachability(float time) static float framereachability, reachability_delay; static int lastpercentage; - if (!aasworld.loaded) return qfalse; + if (!aasworld.loaded) return false; //if reachability is calculated for all areas - if (aasworld.numreachabilityareas >= aasworld.numareas + 2) return qfalse; + if (aasworld.numreachabilityareas >= aasworld.numareas + 2) return false; //if starting with area 1 (area 0 is a dummy) if (aasworld.numreachabilityareas == 1) { @@ -4495,7 +4495,7 @@ int AAS_ContinueInitReachability(float time) botimport.Print(PRT_MESSAGE, "\r%6.1f%%", (float) lastpercentage / 10); } //end else //not yet finished - return qtrue; + return true; } //end of the function AAS_ContinueInitReachability //=========================================================================== // @@ -4523,7 +4523,7 @@ void AAS_InitReachability(void) #ifndef BSPC calcgrapplereach = LibVarGetValue("grapplereach"); #endif - aasworld.savefile = qtrue; + aasworld.savefile = true; //start with area 1 because area zero is a dummy aasworld.numreachabilityareas = 1; ////aasworld.numreachabilityareas = aasworld.numareas + 1; //only calculate entity reachabilities diff --git a/tools/mbspc/botlib/be_aas_sample.c b/tools/mbspc/botlib/be_aas_sample.c index 8423235c..603b251a 100644 --- a/tools/mbspc/botlib/be_aas_sample.c +++ b/tools/mbspc/botlib/be_aas_sample.c @@ -416,7 +416,7 @@ qboolean AAS_AreaEntityCollision(int areanum, vec3_t start, vec3_t end, Com_Memset(&bsptrace, 0, sizeof(bsp_trace_t)); //make compiler happy //assume no collision bsptrace.fraction = 1; - collision = qfalse; + collision = false; for (link = aasworld.arealinkedentities[areanum]; link; link = link->next_ent) { //ignore the pass entity @@ -425,7 +425,7 @@ qboolean AAS_AreaEntityCollision(int areanum, vec3_t start, vec3_t end, if (AAS_EntityCollision(link->entnum, start, boxmins, boxmaxs, end, CONTENTS_SOLID|CONTENTS_PLAYERCLIP, &bsptrace)) { - collision = qtrue; + collision = true; } //end if } //end for if (collision) @@ -435,9 +435,9 @@ qboolean AAS_AreaEntityCollision(int areanum, vec3_t start, vec3_t end, VectorCopy(bsptrace.endpos, trace->endpos); trace->area = 0; trace->planenum = 0; - return qtrue; + return true; } //end if - return qfalse; + return false; } //end of the function AAS_AreaEntityCollision //=========================================================================== // recursive subdivision of the line by the BSP tree. @@ -462,7 +462,7 @@ aas_trace_t AAS_TraceClientBBox(vec3_t start, vec3_t end, int presencetype, Com_Memset(&trace, 0, sizeof(aas_trace_t)); if (!aasworld.loaded) return trace; - + tstack_p = tracestack; //we start with the whole line on the stack VectorCopy(start, tstack_p->start); @@ -471,7 +471,7 @@ aas_trace_t AAS_TraceClientBBox(vec3_t start, vec3_t end, int presencetype, //start with node 1 because node zero is a dummy for a solid leaf tstack_p->nodenum = 1; //starting at the root of the tree tstack_p++; - + while (1) { //pop up the stack @@ -482,7 +482,7 @@ aas_trace_t AAS_TraceClientBBox(vec3_t start, vec3_t end, int presencetype, { tstack_p++; //nothing was hit - trace.startsolid = qfalse; + trace.startsolid = false; trace.fraction = 1.0; //endpos is the end of the line VectorCopy(end, trace.endpos); @@ -515,13 +515,13 @@ aas_trace_t AAS_TraceClientBBox(vec3_t start, vec3_t end, int presencetype, tstack_p->start[1] == start[1] && tstack_p->start[2] == start[2]) { - trace.startsolid = qtrue; + trace.startsolid = true; trace.fraction = 0.0; VectorClear(v1); } //end if else { - trace.startsolid = qfalse; + trace.startsolid = false; VectorSubtract(end, start, v1); VectorSubtract(tstack_p->start, start, v2); trace.fraction = VectorLength(v2) / VectorNormalize(v1); @@ -568,13 +568,13 @@ aas_trace_t AAS_TraceClientBBox(vec3_t start, vec3_t end, int presencetype, tstack_p->start[1] == start[1] && tstack_p->start[2] == start[2]) { - trace.startsolid = qtrue; + trace.startsolid = true; trace.fraction = 0.0; VectorClear(v1); } //end if else { - trace.startsolid = qfalse; + trace.startsolid = false; VectorSubtract(end, start, v1); VectorSubtract(tstack_p->start, start, v2); trace.fraction = VectorLength(v2) / VectorNormalize(v1); @@ -668,7 +668,7 @@ aas_trace_t AAS_TraceClientBBox(vec3_t start, vec3_t end, int presencetype, { tmpplanenum = tstack_p->planenum; // bk010221 - new location of divide by zero (see above) - if ( front == back ) front -= 0.001f; // bk0101022 - hack/FPE + if ( front == back ) front -= 0.001f; // bk0101022 - hack/FPE //calculate the hitpoint with the node (split point of the line) //put the crosspoint TRACEPLANE_EPSILON pixels on the near side if (front < 0) frac = (front + TRACEPLANE_EPSILON)/(front-back); @@ -920,7 +920,7 @@ int AAS_TraceAreas(vec3_t start, vec3_t end, int *areas, vec3_t *points, int max // Parameter: face : face to test if the point is in it // pnormal : normal of the plane to use for the face // point : point to test if inside face boundaries -// Returns: qtrue if the point is within the face boundaries +// Returns: true if the point is within the face boundaries // Changes Globals: - //=========================================================================== qboolean AAS_InsideFace(aas_face_t *face, vec3_t pnormal, vec3_t point, float epsilon) @@ -933,7 +933,7 @@ qboolean AAS_InsideFace(aas_face_t *face, vec3_t pnormal, vec3_t point, float ep int lastvertex = 0; #endif //AAS_SAMPLE_DEBUG - if (!aasworld.loaded) return qfalse; + if (!aasworld.loaded) return false; for (i = 0; i < face->numedges; i++) { @@ -963,11 +963,11 @@ qboolean AAS_InsideFace(aas_face_t *face, vec3_t pnormal, vec3_t point, float ep //check on wich side of the above plane the point is //this is done by checking the sign of the dot product of the //vector orthogonal vector from above and the vector from the - //origin (first vertex of edge) to the point + //origin (first vertex of edge) to the point //if the dotproduct is smaller than zero the point is outside the face - if (DotProduct(pointvec, sepnormal) < -epsilon) return qfalse; + if (DotProduct(pointvec, sepnormal) < -epsilon) return false; } //end for - return qtrue; + return true; } //end of the function AAS_InsideFace //=========================================================================== // @@ -984,7 +984,7 @@ qboolean AAS_PointInsideFace(int facenum, vec3_t point, float epsilon) aas_plane_t *plane; aas_face_t *face; - if (!aasworld.loaded) return qfalse; + if (!aasworld.loaded) return false; face = &aasworld.faces[facenum]; plane = &aasworld.planes[face->planenum]; @@ -1004,9 +1004,9 @@ qboolean AAS_PointInsideFace(int facenum, vec3_t point, float epsilon) // CrossProduct(edgevec, plane->normal, sepnormal); // - if (DotProduct(pointvec, sepnormal) < -epsilon) return qfalse; + if (DotProduct(pointvec, sepnormal) < -epsilon) return false; } //end for - return qtrue; + return true; } //end of the function AAS_PointInsideFace //=========================================================================== // returns the ground face the given point is above in the given area @@ -1242,7 +1242,7 @@ aas_link_t *AAS_AASLinkEntity(vec3_t absmins, vec3_t absmaxs, int entnum) //start with node 1 because node zero is a dummy used for solid leafs lstack_p->nodenum = 1; //starting at the root of the tree lstack_p++; - + while (1) { //pop up the stack diff --git a/tools/mbspc/botlib/l_libvar.c b/tools/mbspc/botlib/l_libvar.c index be7ad3ab..44f9f5a6 100644 --- a/tools/mbspc/botlib/l_libvar.c +++ b/tools/mbspc/botlib/l_libvar.c @@ -201,7 +201,7 @@ libvar_t *LibVar(char *var_name, char *value) //the value v->value = LibVarStringValue(v->string); //variable is modified - v->modified = qtrue; + v->modified = true; // return v; } //end of the function LibVar @@ -256,7 +256,7 @@ void LibVarSet(char *var_name, char *value) //the value v->value = LibVarStringValue(v->string); //variable is modified - v->modified = qtrue; + v->modified = true; } //end of the function LibVarSet //=========================================================================== // @@ -275,7 +275,7 @@ qboolean LibVarChanged(char *var_name) } //end if else { - return qfalse; + return false; } //end else } //end of the function LibVarChanged //=========================================================================== @@ -291,6 +291,6 @@ void LibVarSetNotModified(char *var_name) v = LibVarGet(var_name); if (v) { - v->modified = qfalse; + v->modified = false; } //end if } //end of the function LibVarSetNotModified diff --git a/tools/mbspc/botlib/l_precomp.c b/tools/mbspc/botlib/l_precomp.c index 7dc8f03c..d19fd197 100644 --- a/tools/mbspc/botlib/l_precomp.c +++ b/tools/mbspc/botlib/l_precomp.c @@ -37,8 +37,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../mbspc/l_mem.h" #include "l_precomp.h" -#define qtrue true -#define qfalse false #define Q_stricmp stricmp @@ -204,7 +202,7 @@ void PC_InitTokenHeap(void) token_heap[i].next = freetokens; freetokens = &token_heap[i]; } //end for - tokenheapinitialized = qtrue; + tokenheapinitialized = true; */ } //end of the function PC_InitTokenHeap //============================================================================ @@ -265,7 +263,7 @@ int PC_ReadSourceToken(source_t *source, token_t *token) while(!source->tokens) { //if there's a token to read from the script - if (PS_ReadToken(source->scriptstack, token)) return qtrue; + if (PS_ReadToken(source->scriptstack, token)) return true; //if at the end of the script if (EndOfScript(source->scriptstack)) { @@ -278,7 +276,7 @@ int PC_ReadSourceToken(source_t *source, token_t *token) } //end if } //end if //if this was the initial script - if (!source->scriptstack->next) return qfalse; + if (!source->scriptstack->next) return false; //remove the script and return to the last one script = source->scriptstack; source->scriptstack = source->scriptstack->next; @@ -290,7 +288,7 @@ int PC_ReadSourceToken(source_t *source, token_t *token) t = source->tokens; source->tokens = source->tokens->next; PC_FreeToken(t); - return qtrue; + return true; } //end of the function PC_ReadSourceToken //============================================================================ // @@ -305,7 +303,7 @@ int PC_UnreadSourceToken(source_t *source, token_t *token) t = PC_CopyToken(token); t->next = source->tokens; source->tokens = t; - return qtrue; + return true; } //end of the function PC_UnreadSourceToken //============================================================================ // @@ -321,13 +319,13 @@ int PC_ReadDefineParms(source_t *source, define_t *define, token_t **parms, int if (!PC_ReadSourceToken(source, &token)) { SourceError(source, "define %s missing parms", define->name); - return qfalse; + return false; } //end if // if (define->numparms > maxparms) { SourceError(source, "define with more than %d parameters", maxparms); - return qfalse; + return false; } //end if // for (i = 0; i < define->numparms; i++) parms[i] = NULL; @@ -336,7 +334,7 @@ int PC_ReadDefineParms(source_t *source, define_t *define, token_t **parms, int { PC_UnreadSourceToken(source, &token); SourceError(source, "define %s missing parms", define->name); - return qfalse; + return false; } //end if //read the define parameters for (done = 0, numparms = 0, indent = 0; !done;) @@ -344,12 +342,12 @@ int PC_ReadDefineParms(source_t *source, define_t *define, token_t **parms, int if (numparms >= maxparms) { SourceError(source, "define %s with too many parms", define->name); - return qfalse; + return false; } //end if if (numparms >= define->numparms) { SourceWarning(source, "define %s has too many parms", define->name); - return qfalse; + return false; } //end if parms[numparms] = NULL; lastcomma = 1; @@ -360,7 +358,7 @@ int PC_ReadDefineParms(source_t *source, define_t *define, token_t **parms, int if (!PC_ReadSourceToken(source, &token)) { SourceError(source, "define %s incomplete", define->name); - return qfalse; + return false; } //end if // if (!strcmp(token.string, ",")) @@ -404,7 +402,7 @@ int PC_ReadDefineParms(source_t *source, define_t *define, token_t **parms, int } //end while numparms++; } //end for - return qtrue; + return true; } //end of the function PC_ReadDefineParms //============================================================================ // @@ -426,7 +424,7 @@ int PC_StringizeTokens(token_t *tokens, token_t *token) strncat(token->string, t->string, MAX_TOKEN - strlen(token->string) - 1); } //end for strncat(token->string, "\"", MAX_TOKEN - strlen(token->string) - 1); - return qtrue; + return true; } //end of the function PC_StringizeTokens //============================================================================ // @@ -440,7 +438,7 @@ int PC_MergeTokens(token_t *t1, token_t *t2) if (t1->type == TT_NAME && (t2->type == TT_NAME || t2->type == TT_NUMBER)) { strcat(t1->string, t2->string); - return qtrue; + return true; } //end if //merging of two strings if (t1->type == TT_STRING && t2->type == TT_STRING) @@ -449,10 +447,10 @@ int PC_MergeTokens(token_t *t1, token_t *t2) t1->string[strlen(t1->string)-1] = '\0'; //concat without leading double quote strcat(t1->string, &t2->string[1]); - return qtrue; + return true; } //end if //FIXME: merging of two number of the same sub type - return qfalse; + return false; } //end of the function PC_MergeTokens //============================================================================ // @@ -726,7 +724,7 @@ int PC_ExpandBuiltinDefine(source_t *source, token_t *deftoken, define_t *define break; } //end case } //end switch - return qtrue; + return true; } //end of the function PC_ExpandBuiltinDefine //============================================================================ // @@ -749,7 +747,7 @@ int PC_ExpandDefine(source_t *source, token_t *deftoken, define_t *define, //if the define has parameters if (define->numparms) { - if (!PC_ReadDefineParms(source, define, parms, MAX_DEFINEPARMS)) return qfalse; + if (!PC_ReadDefineParms(source, define, parms, MAX_DEFINEPARMS)) return false; #ifdef DEBUG_EVAL for (i = 0; i < define->numparms; i++) { @@ -803,7 +801,7 @@ int PC_ExpandDefine(source_t *source, token_t *deftoken, define_t *define, if (!PC_StringizeTokens(parms[parmnum], &token)) { SourceError(source, "can't stringize tokens"); - return qfalse; + return false; } //end if t = PC_CopyToken(&token); } //end if @@ -839,7 +837,7 @@ int PC_ExpandDefine(source_t *source, token_t *deftoken, define_t *define, if (!PC_MergeTokens(t1, t2)) { SourceError(source, "can't merge %s with %s", t1->string, t2->string); - return qfalse; + return false; } //end if PC_FreeToken(t1->next); t1->next = t2->next; @@ -864,7 +862,7 @@ int PC_ExpandDefine(source_t *source, token_t *deftoken, define_t *define, } //end for } //end for // - return qtrue; + return true; } //end of the function PC_ExpandDefine //============================================================================ // @@ -876,15 +874,15 @@ int PC_ExpandDefineIntoSource(source_t *source, token_t *deftoken, define_t *def { token_t *firsttoken, *lasttoken; - if (!PC_ExpandDefine(source, deftoken, define, &firsttoken, &lasttoken)) return qfalse; + if (!PC_ExpandDefine(source, deftoken, define, &firsttoken, &lasttoken)) return false; if (firsttoken && lasttoken) { lasttoken->next = source->tokens; source->tokens = firsttoken; - return qtrue; + return true; } //end if - return qfalse; + return false; } //end of the function PC_ExpandDefineIntoSource //============================================================================ // @@ -931,17 +929,17 @@ int PC_Directive_include(source_t *source) foundfile_t file; #endif //QUAKE - if (source->skip > 0) return qtrue; + if (source->skip > 0) return true; // if (!PC_ReadSourceToken(source, &token)) { SourceError(source, "#include without file name"); - return qfalse; + return false; } //end if if (token.linescrossed > 0) { SourceError(source, "#include without file name"); - return qfalse; + return false; } //end if if (token.type == TT_STRING) { @@ -976,7 +974,7 @@ int PC_Directive_include(source_t *source) if (!strlen(path)) { SourceError(source, "#include without file name between < >"); - return qfalse; + return false; } //end if PC_ConvertPath(path); script = LoadScriptFile(path); @@ -984,7 +982,7 @@ int PC_Directive_include(source_t *source) else { SourceError(source, "#include without file name"); - return qfalse; + return false; } //end else #ifdef QUAKE if (!script) @@ -998,14 +996,14 @@ int PC_Directive_include(source_t *source) { #ifdef SCREWUP SourceWarning(source, "file %s not found", path); - return qtrue; + return true; #else SourceError(source, "file %s not found", path); - return qfalse; + return false; #endif //SCREWUP } //end if PC_PushScript(source, script); - return qtrue; + return true; } //end of the function PC_Directive_include //============================================================================ // reads a token from the current line, continues reading on the next @@ -1022,16 +1020,16 @@ int PC_ReadLine(source_t *source, token_t *token) crossline = 0; do { - if (!PC_ReadSourceToken(source, token)) return qfalse; + if (!PC_ReadSourceToken(source, token)) return false; if (token->linescrossed > crossline) { PC_UnreadSourceToken(source, token); - return qfalse; + return false; } //end if crossline = 1; } while(!strcmp(token->string, "\\")); - return qtrue; + return true; } //end of the function PC_ReadLine //============================================================================ // @@ -1067,18 +1065,18 @@ int PC_Directive_undef(source_t *source) define_t *define, *lastdefine; int hash; - if (source->skip > 0) return qtrue; + if (source->skip > 0) return true; // if (!PC_ReadLine(source, &token)) { SourceError(source, "undef without name"); - return qfalse; + return false; } //end if if (token.type != TT_NAME) { PC_UnreadSourceToken(source, &token); SourceError(source, "expected name, found %s", token.string); - return qfalse; + return false; } //end if #if DEFINEHASHING @@ -1121,7 +1119,7 @@ int PC_Directive_undef(source_t *source) lastdefine = define; } //end for #endif //DEFINEHASHING - return qtrue; + return true; } //end of the function PC_Directive_undef //============================================================================ // @@ -1134,18 +1132,18 @@ int PC_Directive_define(source_t *source) token_t token, *t, *last; define_t *define; - if (source->skip > 0) return qtrue; + if (source->skip > 0) return true; // if (!PC_ReadLine(source, &token)) { SourceError(source, "#define without name"); - return qfalse; + return false; } //end if if (token.type != TT_NAME) { PC_UnreadSourceToken(source, &token); SourceError(source, "expected name after #define, found %s", token.string); - return qfalse; + return false; } //end if //check if the define already exists #if DEFINEHASHING @@ -1158,12 +1156,12 @@ int PC_Directive_define(source_t *source) if (define->flags & DEFINE_FIXED) { SourceError(source, "can't redefine %s", token.string); - return qfalse; + return false; } //end if SourceWarning(source, "redefinition of %s", token.string); //unread the define name before executing the #undef directive PC_UnreadSourceToken(source, &token); - if (!PC_Directive_undef(source)) return qfalse; + if (!PC_Directive_undef(source)) return false; //if the define was not removed (define->flags & DEFINE_FIXED) #if DEFINEHASHING define = PC_FindHashedDefine(source->definehash, token.string); @@ -1184,7 +1182,7 @@ int PC_Directive_define(source_t *source) source->defines = define; #endif //DEFINEHASHING //if nothing is defined, just return - if (!PC_ReadLine(source, &token)) return qtrue; + if (!PC_ReadLine(source, &token)) return true; //if it is a define with parameters if (!PC_WhiteSpaceBeforeToken(&token) && !strcmp(token.string, "(")) { @@ -1197,19 +1195,19 @@ int PC_Directive_define(source_t *source) if (!PC_ReadLine(source, &token)) { SourceError(source, "expected define parameter"); - return qfalse; + return false; } //end if //if it isn't a name if (token.type != TT_NAME) { SourceError(source, "invalid define parameter"); - return qfalse; + return false; } //end if // if (PC_FindDefineParm(define, token.string) >= 0) { SourceError(source, "two the same define parameters"); - return qfalse; + return false; } //end if //add the define parm t = PC_CopyToken(&token); @@ -1223,7 +1221,7 @@ int PC_Directive_define(source_t *source) if (!PC_ReadLine(source, &token)) { SourceError(source, "define parameters not terminated"); - return qfalse; + return false; } //end if // if (!strcmp(token.string, ")")) break; @@ -1231,11 +1229,11 @@ int PC_Directive_define(source_t *source) if (strcmp(token.string, ",")) { SourceError(source, "define not terminated"); - return qfalse; + return false; } //end if } //end while } //end if - if (!PC_ReadLine(source, &token)) return qtrue; + if (!PC_ReadLine(source, &token)) return true; } //end if //read the defined stuff last = NULL; @@ -1261,10 +1259,10 @@ int PC_Directive_define(source_t *source) !strcmp(last->string, "##")) { SourceError(source, "define with misplaced ##"); - return qfalse; + return false; } //end if } //end if - return qtrue; + return true; } //end of the function PC_Directive_define //============================================================================ // @@ -1335,14 +1333,14 @@ int PC_AddDefine(source_t *source, char *string) define_t *define; define = PC_DefineFromString(string); - if (!define) return qfalse; + if (!define) return false; #if DEFINEHASHING PC_AddDefineToHash(define, source->definehash); #else //DEFINEHASHING define->next = source->defines; source->defines = define; #endif //DEFINEHASHING - return qtrue; + return true; } //end of the function PC_AddDefine //============================================================================ // add a globals define that will be added to all opened sources @@ -1356,10 +1354,10 @@ int PC_AddGlobalDefine(char *string) define_t *define; define = PC_DefineFromString(string); - if (!define) return qfalse; + if (!define) return false; define->next = globaldefines; globaldefines = define; - return qtrue; + return true; } //end of the function PC_AddGlobalDefine //============================================================================ // remove the given global define @@ -1376,9 +1374,9 @@ int PC_RemoveGlobalDefine(char *name) if (define) { PC_FreeDefine(define); - return qtrue; + return true; } //end if - return qfalse; + return false; } //end of the function PC_RemoveGlobalDefine //============================================================================ // remove all globals defines @@ -1476,13 +1474,13 @@ int PC_Directive_if_def(source_t *source, int type) if (!PC_ReadLine(source, &token)) { SourceError(source, "#ifdef without name"); - return qfalse; + return false; } //end if if (token.type != TT_NAME) { PC_UnreadSourceToken(source, &token); SourceError(source, "expected name after #ifdef, found %s", token.string); - return qfalse; + return false; } //end if #if DEFINEHASHING d = PC_FindHashedDefine(source->definehash, token.string); @@ -1491,7 +1489,7 @@ int PC_Directive_if_def(source_t *source, int type) #endif //DEFINEHASHING skip = (type == INDENT_IFDEF) == (d == NULL); PC_PushIndent(source, type, skip); - return qtrue; + return true; } //end of the function PC_Directiveif_def //============================================================================ // @@ -1527,15 +1525,15 @@ int PC_Directive_else(source_t *source) if (!type) { SourceError(source, "misplaced #else"); - return qfalse; + return false; } //end if if (type == INDENT_ELSE) { SourceError(source, "#else after #else"); - return qfalse; + return false; } //end if PC_PushIndent(source, INDENT_ELSE, !skip); - return qtrue; + return true; } //end of the function PC_Directive_else //============================================================================ // @@ -1551,9 +1549,9 @@ int PC_Directive_endif(source_t *source) if (!type) { SourceError(source, "misplaced #endif"); - return qfalse; + return false; } //end if - return qtrue; + return true; } //end of the function PC_Directive_endif //============================================================================ // @@ -1609,7 +1607,7 @@ int PC_OperatorPriority(int op) case P_COLON: return 5; case P_QUESTIONMARK: return 5; } //end switch - return qfalse; + return false; } //end of the function PC_OperatorPriority //#define AllocValue() GetClearedMemory(sizeof(value_t)); @@ -1645,14 +1643,14 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval operator_t *o, *firstoperator, *lastoperator; value_t *v, *firstvalue, *lastvalue, *v1, *v2; token_t *t; - int brace = 0; + qboolean brace = false; int parentheses = 0; int error = 0; int lastwasvalue = 0; int negativevalue = 0; int questmarkintvalue = 0; float questmarkfloatvalue = 0; - int gotquestmarkvalue = qfalse; + qboolean gotquestmarkvalue = false; // operator_t operator_heap[MAX_OPERATORS]; int numoperators = 0; @@ -1684,7 +1682,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval t = t->next; if (!strcmp(t->string, "(")) { - brace = qtrue; + brace = true; t = t->next; } //end if if (!t || t->type != TT_NAME) @@ -1725,7 +1723,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval break; } //end if } //end if - brace = qfalse; + brace = false; // defined() creates a value lastwasvalue = 1; break; @@ -1905,7 +1903,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval } //end else if } //end if // - gotquestmarkvalue = qfalse; + gotquestmarkvalue = false; questmarkintvalue = 0; questmarkfloatvalue = 0; //while there are operators @@ -2019,7 +2017,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval { if (!questmarkfloatvalue) v1->floatvalue = v2->floatvalue; } //end else - gotquestmarkvalue = qfalse; + gotquestmarkvalue = false; break; } //end case case P_QUESTIONMARK: @@ -2032,7 +2030,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval } //end if questmarkintvalue = v1->intvalue; questmarkfloatvalue = v1->floatvalue; - gotquestmarkvalue = qtrue; + gotquestmarkvalue = true; break; } //end if } //end switch @@ -2081,10 +2079,10 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval //FreeMemory(v); FreeValue(v); } //end for - if (!error) return qtrue; + if (!error) return true; if (intvalue) *intvalue = 0; if (floatvalue) *floatvalue = 0; - return qfalse; + return false; } //end of the function PC_EvaluateTokens //============================================================================ // @@ -2098,7 +2096,7 @@ int PC_Evaluate(source_t *source, signed long int *intvalue, token_t token, *firsttoken, *lasttoken; token_t *t, *nexttoken; define_t *define; - int defined = qfalse; + qboolean defined = false; if (intvalue) *intvalue = 0; if (floatvalue) *floatvalue = 0; @@ -2106,7 +2104,7 @@ int PC_Evaluate(source_t *source, signed long int *intvalue, if (!PC_ReadLine(source, &token)) { SourceError(source, "no value after #if/#elif"); - return qfalse; + return false; } //end if firsttoken = NULL; lasttoken = NULL; @@ -2117,7 +2115,7 @@ int PC_Evaluate(source_t *source, signed long int *intvalue, { if (defined) { - defined = qfalse; + defined = false; t = PC_CopyToken(&token); t->next = NULL; if (lasttoken) lasttoken->next = t; @@ -2126,7 +2124,7 @@ int PC_Evaluate(source_t *source, signed long int *intvalue, } //end if else if (!strcmp(token.string, "defined")) { - defined = qtrue; + defined = true; t = PC_CopyToken(&token); t->next = NULL; if (lasttoken) lasttoken->next = t; @@ -2144,9 +2142,9 @@ int PC_Evaluate(source_t *source, signed long int *intvalue, if (!define) { SourceError(source, "can't evaluate %s, not defined", token.string); - return qfalse; + return false; } //end if - if (!PC_ExpandDefineIntoSource(source, &token, define)) return qfalse; + if (!PC_ExpandDefineIntoSource(source, &token, define)) return false; } //end else } //end if //if the token is a number or a punctuation @@ -2161,11 +2159,11 @@ int PC_Evaluate(source_t *source, signed long int *intvalue, else //can't evaluate the token { SourceError(source, "can't evaluate %s", token.string); - return qfalse; + return false; } //end else } while(PC_ReadLine(source, &token)); // - if (!PC_EvaluateTokens(source, firsttoken, intvalue, floatvalue, integer)) return qfalse; + if (!PC_EvaluateTokens(source, firsttoken, intvalue, floatvalue, integer)) return false; // #ifdef DEBUG_EVAL Log_Write("eval:"); @@ -2183,7 +2181,7 @@ int PC_Evaluate(source_t *source, signed long int *intvalue, else Log_Write("eval result: %f", *floatvalue); #endif //DEBUG_EVAL // - return qtrue; + return true; } //end of the function PC_Evaluate //============================================================================ // @@ -2194,7 +2192,8 @@ int PC_Evaluate(source_t *source, signed long int *intvalue, int PC_DollarEvaluate(source_t *source, signed long int *intvalue, float *floatvalue, int integer) { - int indent, defined = qfalse; + int indent; + qboolean defined = false; token_t token, *firsttoken, *lasttoken; token_t *t, *nexttoken; define_t *define; @@ -2205,12 +2204,12 @@ int PC_DollarEvaluate(source_t *source, signed long int *intvalue, if (!PC_ReadSourceToken(source, &token)) { SourceError(source, "no leading ( after $evalint/$evalfloat"); - return qfalse; + return false; } //end if if (!PC_ReadSourceToken(source, &token)) { SourceError(source, "nothing to evaluate"); - return qfalse; + return false; } //end if indent = 1; firsttoken = NULL; @@ -2222,7 +2221,7 @@ int PC_DollarEvaluate(source_t *source, signed long int *intvalue, { if (defined) { - defined = qfalse; + defined = false; t = PC_CopyToken(&token); t->next = NULL; if (lasttoken) lasttoken->next = t; @@ -2231,7 +2230,7 @@ int PC_DollarEvaluate(source_t *source, signed long int *intvalue, } //end if else if (!strcmp(token.string, "defined")) { - defined = qtrue; + defined = true; t = PC_CopyToken(&token); t->next = NULL; if (lasttoken) lasttoken->next = t; @@ -2249,9 +2248,9 @@ int PC_DollarEvaluate(source_t *source, signed long int *intvalue, if (!define) { SourceError(source, "can't evaluate %s, not defined", token.string); - return qfalse; + return false; } //end if - if (!PC_ExpandDefineIntoSource(source, &token, define)) return qfalse; + if (!PC_ExpandDefineIntoSource(source, &token, define)) return false; } //end else } //end if //if the token is a number or a punctuation @@ -2269,11 +2268,11 @@ int PC_DollarEvaluate(source_t *source, signed long int *intvalue, else //can't evaluate the token { SourceError(source, "can't evaluate %s", token.string); - return qfalse; + return false; } //end else } while(PC_ReadSourceToken(source, &token)); // - if (!PC_EvaluateTokens(source, firsttoken, intvalue, floatvalue, integer)) return qfalse; + if (!PC_EvaluateTokens(source, firsttoken, intvalue, floatvalue, integer)) return false; // #ifdef DEBUG_EVAL Log_Write("$eval:"); @@ -2291,7 +2290,7 @@ int PC_DollarEvaluate(source_t *source, signed long int *intvalue, else Log_Write("$eval result: %f", *floatvalue); #endif //DEBUG_EVAL // - return qtrue; + return true; } //end of the function PC_DollarEvaluate //============================================================================ // @@ -2308,12 +2307,12 @@ int PC_Directive_elif(source_t *source) if (!type || type == INDENT_ELSE) { SourceError(source, "misplaced #elif"); - return qfalse; + return false; } //end if - if (!PC_Evaluate(source, &value, NULL, qtrue)) return qfalse; + if (!PC_Evaluate(source, &value, NULL, true)) return false; skip = (value == 0); PC_PushIndent(source, INDENT_ELIF, skip); - return qtrue; + return true; } //end of the function PC_Directive_elif //============================================================================ // @@ -2326,10 +2325,10 @@ int PC_Directive_if(source_t *source) signed long int value; int skip; - if (!PC_Evaluate(source, &value, NULL, qtrue)) return qfalse; + if (!PC_Evaluate(source, &value, NULL, true)) return false; skip = (value == 0); PC_PushIndent(source, INDENT_IF, skip); - return qtrue; + return true; } //end of the function PC_Directive //============================================================================ // @@ -2340,7 +2339,7 @@ int PC_Directive_if(source_t *source) int PC_Directive_line(source_t *source) { SourceError(source, "#line directive not supported"); - return qfalse; + return false; } //end of the function PC_Directive_line //============================================================================ // @@ -2355,7 +2354,7 @@ int PC_Directive_error(source_t *source) strcpy(token.string, ""); PC_ReadSourceToken(source, &token); SourceError(source, "#error directive: %s", token.string); - return qfalse; + return false; } //end of the function PC_Directive_error //============================================================================ // @@ -2369,7 +2368,7 @@ int PC_Directive_pragma(source_t *source) SourceWarning(source, "#pragma directive not supported"); while(PC_ReadLine(source, &token)) ; - return qtrue; + return true; } //end of the function PC_Directive_pragma //============================================================================ // @@ -2401,7 +2400,7 @@ int PC_Directive_eval(source_t *source) signed long int value; token_t token; - if (!PC_Evaluate(source, &value, NULL, qtrue)) return qfalse; + if (!PC_Evaluate(source, &value, NULL, true)) return false; // token.line = source->scriptstack->line; token.whitespace_p = source->scriptstack->script_p; @@ -2412,7 +2411,7 @@ int PC_Directive_eval(source_t *source) token.subtype = TT_INTEGER|TT_LONG|TT_DECIMAL; PC_UnreadSourceToken(source, &token); if (value < 0) UnreadSignToken(source); - return qtrue; + return true; } //end of the function PC_Directive_eval //============================================================================ // @@ -2425,7 +2424,7 @@ int PC_Directive_evalfloat(source_t *source) float value; token_t token; - if (!PC_Evaluate(source, NULL, &value, qfalse)) return qfalse; + if (!PC_Evaluate(source, NULL, &value, false)) return false; token.line = source->scriptstack->line; token.whitespace_p = source->scriptstack->script_p; token.endwhitespace_p = source->scriptstack->script_p; @@ -2435,7 +2434,7 @@ int PC_Directive_evalfloat(source_t *source) token.subtype = TT_FLOAT|TT_LONG|TT_DECIMAL; PC_UnreadSourceToken(source, &token); if (value < 0) UnreadSignToken(source); - return qtrue; + return true; } //end of the function PC_Directive_evalfloat //============================================================================ // @@ -2471,14 +2470,14 @@ int PC_ReadDirective(source_t *source) if (!PC_ReadSourceToken(source, &token)) { SourceError(source, "found # without name"); - return qfalse; + return false; } //end if //directive name must be on the same line if (token.linescrossed > 0) { PC_UnreadSourceToken(source, &token); SourceError(source, "found # at end of line"); - return qfalse; + return false; } //end if //if if is a name if (token.type == TT_NAME) @@ -2493,7 +2492,7 @@ int PC_ReadDirective(source_t *source) } //end for } //end if SourceError(source, "unknown precompiler directive %s", token.string); - return qfalse; + return false; } //end of the function PC_ReadDirective //============================================================================ // @@ -2506,7 +2505,7 @@ int PC_DollarDirective_evalint(source_t *source) signed long int value; token_t token; - if (!PC_DollarEvaluate(source, &value, NULL, qtrue)) return qfalse; + if (!PC_DollarEvaluate(source, &value, NULL, true)) return false; // token.line = source->scriptstack->line; token.whitespace_p = source->scriptstack->script_p; @@ -2521,7 +2520,7 @@ int PC_DollarDirective_evalint(source_t *source) #endif //NUMBERVALUE PC_UnreadSourceToken(source, &token); if (value < 0) UnreadSignToken(source); - return qtrue; + return true; } //end of the function PC_DollarDirective_evalint //============================================================================ // @@ -2534,7 +2533,7 @@ int PC_DollarDirective_evalfloat(source_t *source) float value; token_t token; - if (!PC_DollarEvaluate(source, NULL, &value, qfalse)) return qfalse; + if (!PC_DollarEvaluate(source, NULL, &value, false)) return false; token.line = source->scriptstack->line; token.whitespace_p = source->scriptstack->script_p; token.endwhitespace_p = source->scriptstack->script_p; @@ -2548,7 +2547,7 @@ int PC_DollarDirective_evalfloat(source_t *source) #endif //NUMBERVALUE PC_UnreadSourceToken(source, &token); if (value < 0) UnreadSignToken(source); - return qtrue; + return true; } //end of the function PC_DollarDirective_evalfloat //============================================================================ // @@ -2572,14 +2571,14 @@ int PC_ReadDollarDirective(source_t *source) if (!PC_ReadSourceToken(source, &token)) { SourceError(source, "found $ without name"); - return qfalse; + return false; } //end if //directive name must be on the same line if (token.linescrossed > 0) { PC_UnreadSourceToken(source, &token); SourceError(source, "found $ at end of line"); - return qfalse; + return false; } //end if //if if is a name if (token.type == TT_NAME) @@ -2595,7 +2594,7 @@ int PC_ReadDollarDirective(source_t *source) } //end if PC_UnreadSourceToken(source, &token); SourceError(source, "unknown precompiler directive %s", token.string); - return qfalse; + return false; } //end of the function PC_ReadDirective #ifdef QUAKEC @@ -2609,16 +2608,16 @@ int BuiltinFunction(source_t *source) { token_t token; - if (!PC_ReadSourceToken(source, &token)) return qfalse; + if (!PC_ReadSourceToken(source, &token)) return false; if (token.type == TT_NUMBER) { PC_UnreadSourceToken(source, &token); - return qtrue; + return true; } //end if else { PC_UnreadSourceToken(source, &token); - return qfalse; + return false; } //end else } //end of the function BuiltinFunction //============================================================================ @@ -2632,11 +2631,11 @@ int QuakeCMacro(source_t *source) int i; token_t token; - if (!PC_ReadSourceToken(source, &token)) return qtrue; + if (!PC_ReadSourceToken(source, &token)) return true; if (token.type != TT_NAME) { PC_UnreadSourceToken(source, &token); - return qtrue; + return true; } //end if //find the precompiler directive for (i = 0; dollardirectives[i].name; i++) @@ -2644,11 +2643,11 @@ int QuakeCMacro(source_t *source) if (!strcmp(dollardirectives[i].name, token.string)) { PC_UnreadSourceToken(source, &token); - return qfalse; + return false; } //end if } //end for PC_UnreadSourceToken(source, &token); - return qtrue; + return true; } //end of the function QuakeCMacro #endif //QUAKEC //============================================================================ @@ -2663,7 +2662,7 @@ int PC_ReadToken(source_t *source, token_t *token) while(1) { - if (!PC_ReadSourceToken(source, token)) return qfalse; + if (!PC_ReadSourceToken(source, token)) return false; //check for precompiler directives if (token->type == TT_PUNCTUATION && *token->string == '#') { @@ -2672,7 +2671,7 @@ int PC_ReadToken(source_t *source, token_t *token) #endif //QUAKC { //read the precompiler directive - if (!PC_ReadDirective(source)) return qfalse; + if (!PC_ReadDirective(source)) return false; continue; } //end if } //end if @@ -2683,7 +2682,7 @@ int PC_ReadToken(source_t *source, token_t *token) #endif //QUAKEC { //read the precompiler directive - if (!PC_ReadDollarDirective(source)) return qfalse; + if (!PC_ReadDollarDirective(source)) return false; continue; } //end if } //end if @@ -2699,7 +2698,7 @@ int PC_ReadToken(source_t *source, token_t *token) if (strlen(token->string) + strlen(newtoken.string+1) + 1 >= MAX_TOKEN) { SourceError(source, "string longer than MAX_TOKEN %d\n", MAX_TOKEN); - return qfalse; + return false; } strcat(token->string, newtoken.string+1); } @@ -2724,14 +2723,14 @@ int PC_ReadToken(source_t *source, token_t *token) if (define) { //expand the defined macro - if (!PC_ExpandDefineIntoSource(source, token, define)) return qfalse; + if (!PC_ExpandDefineIntoSource(source, token, define)) return false; continue; } //end if } //end if //copy token for unreading Com_Memcpy(&source->token, token, sizeof(token_t)); //found a token - return qtrue; + return true; } //end while } //end of the function PC_ReadToken //============================================================================ @@ -2747,15 +2746,15 @@ int PC_ExpectTokenString(source_t *source, char *string) if (!PC_ReadToken(source, &token)) { SourceError(source, "couldn't find expected %s", string); - return qfalse; + return false; } //end if if (strcmp(token.string, string)) { SourceError(source, "expected %s, found %s", string, token.string); - return qfalse; + return false; } //end if - return qtrue; + return true; } //end of the function PC_ExpectTokenString //============================================================================ // @@ -2770,7 +2769,7 @@ int PC_ExpectTokenType(source_t *source, int type, int subtype, token_t *token) if (!PC_ReadToken(source, token)) { SourceError(source, "couldn't read expected token"); - return qfalse; + return false; } //end if if (token->type != type) @@ -2782,7 +2781,7 @@ int PC_ExpectTokenType(source_t *source, int type, int subtype, token_t *token) if (type == TT_NAME) strcpy(str, "name"); if (type == TT_PUNCTUATION) strcpy(str, "punctuation"); SourceError(source, "expected a %s, found %s", str, token->string); - return qfalse; + return false; } //end if if (token->type == TT_NUMBER) { @@ -2797,7 +2796,7 @@ int PC_ExpectTokenType(source_t *source, int type, int subtype, token_t *token) if (subtype & TT_FLOAT) strcat(str, " float"); if (subtype & TT_INTEGER) strcat(str, " integer"); SourceError(source, "expected %s, found %s", str, token->string); - return qfalse; + return false; } //end if } //end if else if (token->type == TT_PUNCTUATION) @@ -2805,10 +2804,10 @@ int PC_ExpectTokenType(source_t *source, int type, int subtype, token_t *token) if (token->subtype != subtype) { SourceError(source, "found %s", token->string); - return qfalse; + return false; } //end if } //end else if - return qtrue; + return true; } //end of the function PC_ExpectTokenType //============================================================================ // @@ -2821,11 +2820,11 @@ int PC_ExpectAnyToken(source_t *source, token_t *token) if (!PC_ReadToken(source, token)) { SourceError(source, "couldn't read expected token"); - return qfalse; + return false; } //end if else { - return qtrue; + return true; } //end else } //end of the function PC_ExpectAnyToken //============================================================================ @@ -2838,12 +2837,12 @@ int PC_CheckTokenString(source_t *source, char *string) { token_t tok; - if (!PC_ReadToken(source, &tok)) return qfalse; + if (!PC_ReadToken(source, &tok)) return false; //if the token is available - if (!strcmp(tok.string, string)) return qtrue; + if (!strcmp(tok.string, string)) return true; // PC_UnreadSourceToken(source, &tok); - return qfalse; + return false; } //end of the function PC_CheckTokenString //============================================================================ // @@ -2855,17 +2854,17 @@ int PC_CheckTokenType(source_t *source, int type, int subtype, token_t *token) { token_t tok; - if (!PC_ReadToken(source, &tok)) return qfalse; + if (!PC_ReadToken(source, &tok)) return false; //if the type matches if (tok.type == type && (tok.subtype & subtype) == subtype) { Com_Memcpy(token, &tok, sizeof(token_t)); - return qtrue; + return true; } //end if // PC_UnreadSourceToken(source, &tok); - return qfalse; + return false; } //end of the function PC_CheckTokenType //============================================================================ // @@ -2879,9 +2878,9 @@ int PC_SkipUntilString(source_t *source, char *string) while(PC_ReadToken(source, &token)) { - if (!strcmp(token.string, string)) return qtrue; + if (!strcmp(token.string, string)) return true; } //end while - return qfalse; + return false; } //end of the function PC_SkipUntilString //============================================================================ // @@ -3097,13 +3096,13 @@ int PC_LoadSourceHandle(const char *filename) int PC_FreeSourceHandle(int handle) { if (handle < 1 || handle >= MAX_SOURCEFILES) - return qfalse; + return false; if (!sourceFiles[handle]) - return qfalse; + return false; FreeSource(sourceFiles[handle]); sourceFiles[handle] = NULL; - return qtrue; + return true; } //end of the function PC_FreeSourceHandle //============================================================================ // @@ -3140,16 +3139,16 @@ int PC_ReadTokenHandle(int handle, pc_token_t *pc_token) int PC_SourceFileAndLine(int handle, char *filename, int *line) { if (handle < 1 || handle >= MAX_SOURCEFILES) - return qfalse; + return false; if (!sourceFiles[handle]) - return qfalse; + return false; strcpy(filename, sourceFiles[handle]->filename); if (sourceFiles[handle]->scriptstack) *line = sourceFiles[handle]->scriptstack->line; else *line = 0; - return qtrue; + return true; } //end of the function PC_SourceFileAndLine //============================================================================ // diff --git a/tools/mbspc/botlib/l_script.c b/tools/mbspc/botlib/l_script.c index f0192f07..8f363502 100644 --- a/tools/mbspc/botlib/l_script.c +++ b/tools/mbspc/botlib/l_script.c @@ -35,9 +35,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../mbspc/l_mem.h" #include "../mbspc/l_cmd.h" -#define qtrue true -#define qfalse false - #define PUNCTABLE //longer punctuations first @@ -370,7 +367,7 @@ int PS_ReadEscapeCharacter(script_t *script, char *ch) // // Parameter: script : script to read from // token : buffer to store the string -// Returns: qtrue when a string was read succesfully +// Returns: true when a string was read succesfully // Changes Globals: - //============================================================================ int PS_ReadString(script_t *script, token_t *token, int quote) @@ -567,7 +564,7 @@ void NumberValue(char *string, int subtype, unsigned long int *intvalue, int PS_ReadNumber(script_t *script, token_t *token) { int len = 0, i; - int octal, dot; + qboolean octal, dot; char c; // unsigned long int intvalue = 0; // double floatvalue = 0; @@ -621,14 +618,14 @@ int PS_ReadNumber(script_t *script, token_t *token) #endif //BINARYNUMBERS else //decimal or octal integer or floating point number { - octal = qfalse; - dot = qfalse; - if (*script->script_p == '0') octal = qtrue; + octal = false; + dot = false; + if (*script->script_p == '0') octal = true; while(1) { c = *script->script_p; - if (c == '.') dot = qtrue; - else if (c == '8' || c == '9') octal = qfalse; + if (c == '.') dot = true; + else if (c == '8' || c == '9') octal = false; else if (c < '0' || c > '9') break; token->string[len++] = *script->script_p++; if (len >= MAX_TOKEN - 1) diff --git a/tools/mbspc/botlib/l_struct.c b/tools/mbspc/botlib/l_struct.c index 2d6f4c92..864ee7b7 100644 --- a/tools/mbspc/botlib/l_struct.c +++ b/tools/mbspc/botlib/l_struct.c @@ -35,9 +35,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "l_precomp.h" #include "l_struct.h" -#define qtrue true -#define qfalse false - //=========================================================================== // // Parameter: - @@ -63,7 +60,7 @@ fielddef_t *FindField(fielddef_t *defs, char *name) qboolean ReadNumber(source_t *source, fielddef_t *fd, void *p) { token_t token; - int negative = qfalse; + qboolean negative = false; long int intval, intmin = 0, intmax = 0; double floatval; @@ -83,7 +80,7 @@ qboolean ReadNumber(source_t *source, fielddef_t *fd, void *p) SourceError(source, "unexpected punctuation %s", token.string); return 0; } //end if - negative = qtrue; + negative = true; //read the number if (!PC_ExpectAnyToken(source, &token)) return 0; } //end if @@ -230,7 +227,7 @@ int ReadStructure(source_t *source, structdef_t *def, char *structure) if (!PC_ExpectTokenString(source, "{")) return 0; while(1) { - if (!PC_ExpectAnyToken(source, &token)) return qfalse; + if (!PC_ExpectAnyToken(source, &token)) return false; //if end of structure if (!strcmp(token.string, "}")) break; //find the field with the name @@ -238,12 +235,12 @@ int ReadStructure(source_t *source, structdef_t *def, char *structure) if (!fd) { SourceError(source, "unknown structure field %s", token.string); - return qfalse; + return false; } //end if if (fd->type & FT_ARRAY) { num = fd->maxarray; - if (!PC_ExpectTokenString(source, "{")) return qfalse; + if (!PC_ExpectTokenString(source, "{")) return false; } //end if else { @@ -260,25 +257,25 @@ int ReadStructure(source_t *source, structdef_t *def, char *structure) { case FT_CHAR: { - if (!ReadChar(source, fd, p)) return qfalse; + if (!ReadChar(source, fd, p)) return false; p = (char *) p + sizeof(char); break; } //end case case FT_INT: { - if (!ReadNumber(source, fd, p)) return qfalse; + if (!ReadNumber(source, fd, p)) return false; p = (char *) p + sizeof(int); break; } //end case case FT_FLOAT: { - if (!ReadNumber(source, fd, p)) return qfalse; + if (!ReadNumber(source, fd, p)) return false; p = (char *) p + sizeof(float); break; } //end case case FT_STRING: { - if (!ReadString(source, fd, p)) return qfalse; + if (!ReadString(source, fd, p)) return false; p = (char *) p + MAX_STRINGFIELD; break; } //end case @@ -287,7 +284,7 @@ int ReadStructure(source_t *source, structdef_t *def, char *structure) if (!fd->substruct) { SourceError(source, "BUG: no sub structure defined"); - return qfalse; + return false; } //end if ReadStructure(source, fd->substruct, (char *) p); p = (char *) p + fd->substruct->size; @@ -296,17 +293,17 @@ int ReadStructure(source_t *source, structdef_t *def, char *structure) } //end switch if (fd->type & FT_ARRAY) { - if (!PC_ExpectAnyToken(source, &token)) return qfalse; + if (!PC_ExpectAnyToken(source, &token)) return false; if (!strcmp(token.string, "}")) break; if (strcmp(token.string, ",")) { SourceError(source, "expected a comma, found %s", token.string); - return qfalse; + return false; } //end if } //end if } //end while } //end while - return qtrue; + return true; } //end of the function ReadStructure //=========================================================================== // @@ -318,9 +315,9 @@ int WriteIndent(FILE *fp, int indent) { while(indent-- > 0) { - if (fprintf(fp, "\t") < 0) return qfalse; + if (fprintf(fp, "\t") < 0) return false; } //end while - return qtrue; + return true; } //end of the function WriteIndent //=========================================================================== // @@ -362,20 +359,20 @@ int WriteStructWithIndent(FILE *fp, structdef_t *def, char *structure, int inden void *p; fielddef_t *fd; - if (!WriteIndent(fp, indent)) return qfalse; - if (fprintf(fp, "{\r\n") < 0) return qfalse; + if (!WriteIndent(fp, indent)) return false; + if (fprintf(fp, "{\r\n") < 0) return false; indent++; for (i = 0; def->fields[i].name; i++) { fd = &def->fields[i]; - if (!WriteIndent(fp, indent)) return qfalse; - if (fprintf(fp, "%s\t", fd->name) < 0) return qfalse; + if (!WriteIndent(fp, indent)) return false; + if (fprintf(fp, "%s\t", fd->name) < 0) return false; p = (void *)(structure + fd->offset); if (fd->type & FT_ARRAY) { num = fd->maxarray; - if (fprintf(fp, "{") < 0) return qfalse; + if (fprintf(fp, "{") < 0) return false; } //end if else { @@ -387,31 +384,31 @@ int WriteStructWithIndent(FILE *fp, structdef_t *def, char *structure, int inden { case FT_CHAR: { - if (fprintf(fp, "%d", *(char *) p) < 0) return qfalse; + if (fprintf(fp, "%d", *(char *) p) < 0) return false; p = (char *) p + sizeof(char); break; } //end case case FT_INT: { - if (fprintf(fp, "%d", *(int *) p) < 0) return qfalse; + if (fprintf(fp, "%d", *(int *) p) < 0) return false; p = (char *) p + sizeof(int); break; } //end case case FT_FLOAT: { - if (!WriteFloat(fp, *(float *)p)) return qfalse; + if (!WriteFloat(fp, *(float *)p)) return false; p = (char *) p + sizeof(float); break; } //end case case FT_STRING: { - if (fprintf(fp, "\"%s\"", (char *) p) < 0) return qfalse; + if (fprintf(fp, "\"%s\"", (char *) p) < 0) return false; p = (char *) p + MAX_STRINGFIELD; break; } //end case case FT_STRUCT: { - if (!WriteStructWithIndent(fp, fd->substruct, structure, indent)) return qfalse; + if (!WriteStructWithIndent(fp, fd->substruct, structure, indent)) return false; p = (char *) p + fd->substruct->size; break; } //end case @@ -420,21 +417,21 @@ int WriteStructWithIndent(FILE *fp, structdef_t *def, char *structure, int inden { if (num > 0) { - if (fprintf(fp, ",") < 0) return qfalse; + if (fprintf(fp, ",") < 0) return false; } //end if else { - if (fprintf(fp, "}") < 0) return qfalse; + if (fprintf(fp, "}") < 0) return false; } //end else } //end if } //end while - if (fprintf(fp, "\r\n") < 0) return qfalse; + if (fprintf(fp, "\r\n") < 0) return false; } //end for indent--; - if (!WriteIndent(fp, indent)) return qfalse; - if (fprintf(fp, "}\r\n") < 0) return qfalse; - return qtrue; + if (!WriteIndent(fp, indent)) return false; + if (fprintf(fp, "}\r\n") < 0) return false; + return true; } //end of the function WriteStructWithIndent //=========================================================================== // diff --git a/tools/mbspc/mbspc/be_aas_bspc.c b/tools/mbspc/mbspc/be_aas_bspc.c index 47cc9f9c..e21f73de 100644 --- a/tools/mbspc/mbspc/be_aas_bspc.c +++ b/tools/mbspc/mbspc/be_aas_bspc.c @@ -278,7 +278,7 @@ void AAS_CalcReachAndClusters(struct quakefile_s *qf) // if (!qf->pakfile[0]) strcpy(qf->pakfile, qf->filename); //load the map - CM_LoadMap((char *) qf, qfalse, &aasworld.bspchecksum); + CM_LoadMap((char *) qf, false, &aasworld.bspchecksum); //get a handle to the world model worldmodel = CM_InlineModel(0); // 0 = world, 1 + are bmodels //initialize bot import structure diff --git a/tools/mbspc/mbspc/l_cmd.h b/tools/mbspc/mbspc/l_cmd.h index 8f0ade4d..4adcd085 100644 --- a/tools/mbspc/mbspc/l_cmd.h +++ b/tools/mbspc/mbspc/l_cmd.h @@ -36,11 +36,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#ifndef __BYTEBOOL__ -#define __BYTEBOOL__ -typedef enum {false, true} qboolean; -typedef unsigned char byte; -#endif +#include "bytebool.h" // set these before calling CheckParm diff --git a/tools/mbspc/qcommon/cm_load.c b/tools/mbspc/qcommon/cm_load.c index 5120a536..fc625830 100644 --- a/tools/mbspc/qcommon/cm_load.c +++ b/tools/mbspc/qcommon/cm_load.c @@ -465,7 +465,7 @@ void CMod_LoadVisibility( lump_t *l ) { } buf = cmod_base + l->fileofs; - cm.vised = qtrue; + cm.vised = true; cm.visibility = Hunk_Alloc( len, h_high ); cm.numClusters = LittleLong( ((int *)buf)[0] ); cm.clusterBytes = LittleLong( ((int *)buf)[1] ); diff --git a/tools/mbspc/qcommon/cm_patch.c b/tools/mbspc/qcommon/cm_patch.c index f2a4b3f4..50c8d2d9 100644 --- a/tools/mbspc/qcommon/cm_patch.c +++ b/tools/mbspc/qcommon/cm_patch.c @@ -131,11 +131,11 @@ static qboolean CM_PlaneFromPoints( vec4_t plane, vec3_t a, vec3_t b, vec3_t c ) VectorSubtract( c, a, d2 ); CrossProduct( d2, d1, plane ); if ( VectorNormalize( plane ) == 0 ) { - return qfalse; + return false; } plane[3] = DotProduct( a, plane ); - return qtrue; + return true; } @@ -175,7 +175,7 @@ static qboolean CM_NeedsSubdivision( vec3_t a, vec3_t b, vec3_t c ) { // see if the curve is far enough away from the linear mid VectorSubtract( cmid, lmid, delta ); dist = VectorLength( delta ); - + return dist >= SUBDIVIDE_DISTANCE; } @@ -252,7 +252,7 @@ static void CM_TransposeGrid( cGrid_t *grid ) { =================== CM_SetGridWrapWidth -If the left and right columns are exactly equal, set grid->wrapWidth qtrue +If the left and right columns are exactly equal, set grid->wrapWidth true =================== */ static void CM_SetGridWrapWidth( cGrid_t *grid ) { @@ -271,9 +271,9 @@ static void CM_SetGridWrapWidth( cGrid_t *grid ) { } } if ( i == grid->height ) { - grid->wrapWidth = qtrue; + grid->wrapWidth = true; } else { - grid->wrapWidth = qfalse; + grid->wrapWidth = false; } } @@ -359,17 +359,17 @@ static qboolean CM_ComparePoints( float *a, float *b ) { d = a[0] - b[0]; if ( d < -POINT_EPSILON || d > POINT_EPSILON ) { - return qfalse; + return false; } d = a[1] - b[1]; if ( d < -POINT_EPSILON || d > POINT_EPSILON ) { - return qfalse; + return false; } d = a[2] - b[2]; if ( d < -POINT_EPSILON || d > POINT_EPSILON ) { - return qfalse; + return false; } - return qtrue; + return true; } /* @@ -437,8 +437,8 @@ int CM_PlaneEqual(patchPlane_t *p, float plane[4], int *flipped) { && fabs(p->plane[2] - plane[2]) < NORMAL_EPSILON && fabs(p->plane[3] - plane[3]) < DIST_EPSILON ) { - *flipped = qfalse; - return qtrue; + *flipped = false; + return true; } VectorNegate(plane, invplane); @@ -450,11 +450,11 @@ int CM_PlaneEqual(patchPlane_t *p, float plane[4], int *flipped) { && fabs(p->plane[2] - invplane[2]) < NORMAL_EPSILON && fabs(p->plane[3] - invplane[3]) < DIST_EPSILON ) { - *flipped = qtrue; - return qtrue; + *flipped = true; + return true; } - return qfalse; + return false; } /* @@ -505,7 +505,7 @@ int CM_FindPlane2(float plane[4], int *flipped) { numPlanes++; - *flipped = qfalse; + *flipped = false; return numPlanes-1; } @@ -725,18 +725,18 @@ static void CM_SetBorderInward( facet_t *facet, cGrid_t *grid, int gridPlanes[MA } if ( front && !back ) { - facet->borderInward[k] = qtrue; + facet->borderInward[k] = true; } else if ( back && !front ) { - facet->borderInward[k] = qfalse; + facet->borderInward[k] = false; } else if ( !front && !back ) { // flat side border facet->borderPlanes[k] = -1; } else { // bisecting side border Com_DPrintf( "WARNING: CM_SetBorderInward: mixed plane sides\n" ); - facet->borderInward[k] = qfalse; + facet->borderInward[k] = false; if ( !debugBlock ) { - debugBlock = qtrue; + debugBlock = true; VectorCopy( grid->points[i][j], debugBlockPoints[0] ); VectorCopy( grid->points[i+1][j], debugBlockPoints[1] ); VectorCopy( grid->points[i+1][j+1], debugBlockPoints[2] ); @@ -760,7 +760,7 @@ static qboolean CM_ValidateFacet( facet_t *facet ) { vec3_t bounds[2]; if ( facet->surfacePlane == -1 ) { - return qfalse; + return false; } Vector4Copy( planes[ facet->surfacePlane ].plane, plane ); @@ -768,7 +768,7 @@ static qboolean CM_ValidateFacet( facet_t *facet ) { for ( j = 0 ; j < facet->numBorders && w ; j++ ) { if ( facet->borderPlanes[j] == -1 ) { FreeWinding(w); - return qfalse; + return false; } Vector4Copy( planes[ facet->borderPlanes[j] ].plane, plane ); if ( !facet->borderInward[j] ) { @@ -779,25 +779,25 @@ static qboolean CM_ValidateFacet( facet_t *facet ) { } if ( !w ) { - return qfalse; // winding was completely chopped away + return false; // winding was completely chopped away } // see if the facet is unreasonably large WindingBounds( w, bounds[0], bounds[1] ); FreeWinding( w ); - + for ( j = 0 ; j < 3 ; j++ ) { if ( bounds[1][j] - bounds[0][j] > MAX_MAP_BOUNDS ) { - return qfalse; // we must be missing a plane + return false; // we must be missing a plane } if ( bounds[0][j] >= MAX_MAP_BOUNDS ) { - return qfalse; + return false; } if ( bounds[1][j] <= -MAX_MAP_BOUNDS ) { - return qfalse; + return false; } } - return qtrue; // winding is fine + return true; // winding is fine } /* @@ -960,7 +960,7 @@ void CM_AddFacetBevels( facet_t *facet ) { //add opposite plane facet->borderPlanes[facet->numBorders] = facet->surfacePlane; facet->borderNoAdjust[facet->numBorders] = 0; - facet->borderInward[facet->numBorders] = qtrue; + facet->borderInward[facet->numBorders] = true; facet->numBorders++; #endif //BSPC @@ -1007,13 +1007,13 @@ static void CM_PatchCollideFromGrid( cGrid_t *grid, patchCollide_t *pf ) { // create the borders for each facet for ( i = 0 ; i < grid->width - 1 ; i++ ) { for ( j = 0 ; j < grid->height - 1 ; j++ ) { - + borders[EN_TOP] = -1; if ( j > 0 ) { borders[EN_TOP] = gridPlanes[i][j-1][1]; } else if ( grid->wrapHeight ) { borders[EN_TOP] = gridPlanes[i][grid->height-2][1]; - } + } noAdjust[EN_TOP] = ( borders[EN_TOP] == gridPlanes[i][j][0] ); if ( borders[EN_TOP] == -1 || noAdjust[EN_TOP] ) { borders[EN_TOP] = CM_EdgePlaneNum( grid, gridPlanes, i, j, 0 ); @@ -1167,8 +1167,8 @@ struct patchCollide_s *CM_GeneratePatchCollide( int width, int height, vec3_t *p // build a grid grid.width = width; grid.height = height; - grid.wrapWidth = qfalse; - grid.wrapHeight = qfalse; + grid.wrapWidth = false; + grid.wrapHeight = false; for ( i = 0 ; i < width ; i++ ) { for ( j = 0 ; j < height ; j++ ) { VectorCopy( points[j*width + i], grid.points[i][j] ); @@ -1255,9 +1255,9 @@ void CM_TracePointThroughPatchCollide( traceWork_t *tw, const struct patchCollid d1 = DotProduct( tw->start, planes->plane ) - planes->plane[3] + offset; d2 = DotProduct( tw->end, planes->plane ) - planes->plane[3] + offset; if ( d1 <= 0 ) { - frontFacing[i] = qfalse; + frontFacing[i] = false; } else { - frontFacing[i] = qtrue; + frontFacing[i] = true; } if ( d1 == d2 ) { intersection[i] = 99999; @@ -1332,19 +1332,19 @@ CM_CheckFacetPlane int CM_CheckFacetPlane(float *plane, vec3_t start, vec3_t end, float *enterFrac, float *leaveFrac, int *hit) { float d1, d2, f; - *hit = qfalse; + *hit = false; d1 = DotProduct( start, plane ) - plane[3]; d2 = DotProduct( end, plane ) - plane[3]; // if completely in front of face, no intersection with the entire facet if (d1 > 0 && ( d2 >= SURFACE_CLIP_EPSILON || d2 >= d1 ) ) { - return qfalse; + return false; } // if it doesn't cross the plane, the plane isn't relevent if (d1 <= 0 && d2 <= 0 ) { - return qtrue; + return true; } // crosses face @@ -1356,7 +1356,7 @@ int CM_CheckFacetPlane(float *plane, vec3_t start, vec3_t end, float *enterFrac, //always favor previous plane hits and thus also the surface plane hit if (f > *enterFrac) { *enterFrac = f; - *hit = qtrue; + *hit = true; } } else { // leave f = (d1+SURFACE_CLIP_EPSILON) / (d1-d2); @@ -1367,7 +1367,7 @@ int CM_CheckFacetPlane(float *plane, vec3_t start, vec3_t end, float *enterFrac, *leaveFrac = f; } } - return qtrue; + return true; } /* @@ -1526,7 +1526,7 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli vec3_t startp; if (tw->isPoint) { - return qfalse; + return false; } // facet = pc->facets; @@ -1595,9 +1595,9 @@ qboolean CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchColli continue; } // inside this patch facet - return qtrue; + return true; } - return qfalse; + return false; } /* @@ -1669,7 +1669,7 @@ void CM_DrawDebugSurface( void (*drawPoly)(int color, int numPoints, float *poin } else { planenum = facet->surfacePlane; - inward = qfalse; + inward = false; //continue; } @@ -1701,7 +1701,7 @@ void CM_DrawDebugSurface( void (*drawPoly)(int color, int numPoints, float *poin } else { curplanenum = facet->surfacePlane; - curinward = qfalse; + curinward = false; //continue; } // diff --git a/tools/mbspc/qcommon/cm_test.c b/tools/mbspc/qcommon/cm_test.c index f6d685fb..3dac22dc 100644 --- a/tools/mbspc/qcommon/cm_test.c +++ b/tools/mbspc/qcommon/cm_test.c @@ -37,7 +37,7 @@ int CM_PointLeafnum_r( const vec3_t p, int num ) { { node = cm.nodes + num; plane = node->plane; - + if (plane->type < 3) d = p[plane->type] - plane->dist; else @@ -81,7 +81,7 @@ void CM_StoreLeafs( leafList_t *ll, int nodenum ) { } if ( ll->count >= ll->maxcount) { - ll->overflowed = qtrue; + ll->overflowed = true; return; } ll->list[ ll->count++ ] = leafNum; @@ -114,7 +114,7 @@ void CM_StoreBrushes( leafList_t *ll, int nodenum ) { continue; } if ( ll->count >= ll->maxcount) { - ll->overflowed = qtrue; + ll->overflowed = true; return; } ((cbrush_t **)ll->list)[ ll->count++ ] = b; @@ -147,7 +147,7 @@ void CM_BoxLeafnums_r( leafList_t *ll, int nodenum ) { ll->storeLeafs( ll, nodenum ); return; } - + node = &cm.nodes[nodenum]; plane = node->plane; s = BoxOnPlaneSide( ll->bounds[0], ll->bounds[1], plane ); @@ -181,7 +181,7 @@ int CM_BoxLeafnums( const vec3_t mins, const vec3_t maxs, int *list, int listsiz ll.list = list; ll.storeLeafs = CM_StoreLeafs; ll.lastLeaf = 0; - ll.overflowed = qfalse; + ll.overflowed = false; CM_BoxLeafnums_r( &ll, 0 ); @@ -206,8 +206,8 @@ int CM_BoxBrushes( const vec3_t mins, const vec3_t maxs, cbrush_t **list, int li ll.list = (void *)list; ll.storeLeafs = CM_StoreBrushes; ll.lastLeaf = 0; - ll.overflowed = qfalse; - + ll.overflowed = false; + CM_BoxLeafnums_r( &ll, 0 ); return ll.count; @@ -288,7 +288,7 @@ int CM_TransformedPointContents( const vec3_t p, clipHandle_t model, const vec3_ VectorSubtract (p, origin, p_l); // rotate start and end into the models frame of reference - if ( model != BOX_MODEL_HANDLE && + if ( model != BOX_MODEL_HANDLE && (angles[0] || angles[1] || angles[2]) ) { AngleVectors (angles, forward, right, up); @@ -417,12 +417,12 @@ CM_AreasConnected qboolean CM_AreasConnected( int area1, int area2 ) { #ifndef BSPC if ( cm_noAreas->integer ) { - return qtrue; + return true; } #endif if ( area1 < 0 || area2 < 0 ) { - return qfalse; + return false; } if (area1 >= cm.numAreas || area2 >= cm.numAreas) { @@ -430,9 +430,9 @@ qboolean CM_AreasConnected( int area1, int area2 ) { } if (cm.areas[area1].floodnum == cm.areas[area2].floodnum) { - return qtrue; + return true; } - return qfalse; + return false; } @@ -491,10 +491,10 @@ qboolean CM_BoundsIntersect( const vec3_t mins, const vec3_t maxs, const vec3_t mins[0] > maxs2[0] + SURFACE_CLIP_EPSILON || mins[1] > maxs2[1] + SURFACE_CLIP_EPSILON || mins[2] > maxs2[2] + SURFACE_CLIP_EPSILON ) { - return qfalse; + return false; } - return qtrue; + return true; } /* ==================== @@ -508,8 +508,8 @@ qboolean CM_BoundsIntersectPoint( const vec3_t mins, const vec3_t maxs, const ve mins[0] > point[0] + SURFACE_CLIP_EPSILON || mins[1] > point[1] + SURFACE_CLIP_EPSILON || mins[2] > point[2] + SURFACE_CLIP_EPSILON ) { - return qfalse; + return false; } - return qtrue; + return true; } diff --git a/tools/mbspc/qcommon/cm_trace.c b/tools/mbspc/qcommon/cm_trace.c index 0346f572..746c187b 100644 --- a/tools/mbspc/qcommon/cm_trace.c +++ b/tools/mbspc/qcommon/cm_trace.c @@ -41,7 +41,7 @@ BASIC MATH RotatePoint ================ */ -void RotatePoint(vec3_t point, /*const*/ vec3_t matrix[3]) { // bk: FIXME +void RotatePoint(vec3_t point, /*const*/ vec3_t matrix[3]) { // bk: FIXME vec3_t tvec; VectorCopy(point, tvec); @@ -98,7 +98,7 @@ float CM_DistanceFromLineSquared(vec3_t p, vec3_t lp1, vec3_t lp2, vec3_t dir) { int j; CM_ProjectPointOntoVector(p, lp1, dir, proj); - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) if ((proj[j] > lp1[j] && proj[j] > lp2[j]) || (proj[j] < lp1[j] && proj[j] < lp2[j])) break; @@ -227,7 +227,7 @@ void CM_TestBoxInBrush( traceWork_t *tw, cbrush_t *brush ) { } // inside this brush - tw->trace.startsolid = tw->trace.allsolid = qtrue; + tw->trace.startsolid = tw->trace.allsolid = true; tw->trace.fraction = 0; tw->trace.contents = brush->contents; } @@ -257,7 +257,7 @@ void CM_TestInLeaf( traceWork_t *tw, cLeaf_t *leaf ) { if ( !(b->contents & tw->contents)) { continue; } - + CM_TestBoxInBrush( tw, b ); if ( tw->trace.allsolid ) { return; @@ -283,9 +283,9 @@ void CM_TestInLeaf( traceWork_t *tw, cLeaf_t *leaf ) { if ( !(patch->contents & tw->contents)) { continue; } - + if ( CM_PositionTestInPatchCollide( tw, patch->pc ) ) { - tw->trace.startsolid = tw->trace.allsolid = qtrue; + tw->trace.startsolid = tw->trace.allsolid = true; tw->trace.fraction = 0; tw->trace.contents = patch->contents; return; @@ -329,24 +329,24 @@ void CM_TestCapsuleInCapsule( traceWork_t *tw, clipHandle_t model ) { p1[2] += offs; VectorSubtract(p1, top, tmp); if ( VectorLengthSquared(tmp) < r ) { - tw->trace.startsolid = tw->trace.allsolid = qtrue; + tw->trace.startsolid = tw->trace.allsolid = true; tw->trace.fraction = 0; } VectorSubtract(p1, bottom, tmp); if ( VectorLengthSquared(tmp) < r ) { - tw->trace.startsolid = tw->trace.allsolid = qtrue; + tw->trace.startsolid = tw->trace.allsolid = true; tw->trace.fraction = 0; } VectorCopy(offset, p2); p2[2] -= offs; VectorSubtract(p2, top, tmp); if ( VectorLengthSquared(tmp) < r ) { - tw->trace.startsolid = tw->trace.allsolid = qtrue; + tw->trace.startsolid = tw->trace.allsolid = true; tw->trace.fraction = 0; } VectorSubtract(p2, bottom, tmp); if ( VectorLengthSquared(tmp) < r ) { - tw->trace.startsolid = tw->trace.allsolid = qtrue; + tw->trace.startsolid = tw->trace.allsolid = true; tw->trace.fraction = 0; } // if between cylinder up and lower bounds @@ -357,7 +357,7 @@ void CM_TestCapsuleInCapsule( traceWork_t *tw, clipHandle_t model ) { // if the cylinders overlap VectorSubtract(top, p1, tmp); if ( VectorLengthSquared(tmp) < r ) { - tw->trace.startsolid = tw->trace.allsolid = qtrue; + tw->trace.startsolid = tw->trace.allsolid = true; tw->trace.fraction = 0; } } @@ -389,13 +389,13 @@ void CM_TestBoundingBoxInCapsule( traceWork_t *tw, clipHandle_t model ) { } // replace the bounding box with the capsule - tw->sphere.use = qtrue; + tw->sphere.use = true; tw->sphere.radius = ( size[1][0] > size[1][2] ) ? size[1][2]: size[1][0]; tw->sphere.halfheight = size[1][2]; VectorSet( tw->sphere.offset, 0, 0, size[1][2] - tw->sphere.radius ); // replace the capsule with the bounding box - h = CM_TempBoxModel(tw->size[0], tw->size[1], qfalse); + h = CM_TempBoxModel(tw->size[0], tw->size[1], false); // calculate collision cmod = CM_ClipHandleToModel( h ); CM_TestInLeaf( tw, &cmod->leaf ); @@ -426,7 +426,7 @@ void CM_PositionTest( traceWork_t *tw ) { ll.list = leafs; ll.storeLeafs = CM_StoreLeafs; ll.lastLeaf = 0; - ll.overflowed = qfalse; + ll.overflowed = false; cm.checkcount++; @@ -502,8 +502,8 @@ void CM_TraceThroughBrush( traceWork_t *tw, cbrush_t *brush ) { c_brush_traces++; - getout = qfalse; - startout = qfalse; + getout = false; + startout = false; leadside = NULL; @@ -537,10 +537,10 @@ void CM_TraceThroughBrush( traceWork_t *tw, cbrush_t *brush ) { d2 = DotProduct( endp, plane->normal ) - dist; if (d2 > 0) { - getout = qtrue; // endpoint is not in solid + getout = true; // endpoint is not in solid } if (d1 > 0) { - startout = qtrue; + startout = true; } // if completely in front of face, no intersection with the entire brush @@ -591,10 +591,10 @@ void CM_TraceThroughBrush( traceWork_t *tw, cbrush_t *brush ) { d2 = DotProduct( tw->end, plane->normal ) - dist; if (d2 > 0) { - getout = qtrue; // endpoint is not in solid + getout = true; // endpoint is not in solid } if (d1 > 0) { - startout = qtrue; + startout = true; } // if completely in front of face, no intersection with the entire brush @@ -635,15 +635,15 @@ void CM_TraceThroughBrush( traceWork_t *tw, cbrush_t *brush ) { // completely outside the brush // if (!startout) { // original point was inside brush - tw->trace.startsolid = qtrue; + tw->trace.startsolid = true; if (!getout) { - tw->trace.allsolid = qtrue; + tw->trace.allsolid = true; tw->trace.fraction = 0; tw->trace.contents = brush->contents; } return; } - + if (enterFrac < leaveFrac) { if (enterFrac > -1 && enterFrac < tw->trace.fraction) { if (enterFrac < 0) { @@ -711,7 +711,7 @@ void CM_TraceThroughLeaf( traceWork_t *tw, cLeaf_t *leaf ) { if ( !(patch->contents & tw->contents) ) { continue; } - + CM_TraceThroughPatch( tw, patch ); if ( !tw->trace.fraction ) { return; @@ -739,12 +739,12 @@ void CM_TraceThroughSphere( traceWork_t *tw, vec3_t origin, float radius, vec3_t l1 = VectorLengthSquared(dir); if (l1 < Square(radius)) { tw->trace.fraction = 0; - tw->trace.startsolid = qtrue; + tw->trace.startsolid = true; // test for allsolid VectorSubtract(end, origin, dir); l1 = VectorLengthSquared(dir); if (l1 < Square(radius)) { - tw->trace.allsolid = qtrue; + tw->trace.allsolid = true; } return; } @@ -834,11 +834,11 @@ void CM_TraceThroughVerticalCylinder( traceWork_t *tw, vec3_t origin, float radi l1 = VectorLengthSquared(dir); if (l1 < Square(radius)) { tw->trace.fraction = 0; - tw->trace.startsolid = qtrue; + tw->trace.startsolid = true; VectorSubtract(end2d, org2d, dir); l1 = VectorLengthSquared(dir); if (l1 < Square(radius)) { - tw->trace.allsolid = qtrue; + tw->trace.allsolid = true; } return; } @@ -1001,13 +1001,13 @@ void CM_TraceBoundingBoxThroughCapsule( traceWork_t *tw, clipHandle_t model ) { } // replace the bounding box with the capsule - tw->sphere.use = qtrue; + tw->sphere.use = true; tw->sphere.radius = ( size[1][0] > size[1][2] ) ? size[1][2]: size[1][0]; tw->sphere.halfheight = size[1][2]; VectorSet( tw->sphere.offset, 0, 0, size[1][2] - tw->sphere.radius ); // replace the capsule with the bounding box - h = CM_TempBoxModel(tw->size[0], tw->size[1], qfalse); + h = CM_TempBoxModel(tw->size[0], tw->size[1], false); // calculate collision cmod = CM_ClipHandleToModel( h ); CM_TraceThroughLeaf( tw, &cmod->leaf ); @@ -1113,7 +1113,7 @@ void CM_TraceThroughTree( traceWork_t *tw, int num, float p1f, float p2f, vec3_t if ( frac > 1 ) { frac = 1; } - + midf = p1f + (p2f - p1f)*frac; mid[0] = p1[0] + frac*(p2[0] - p1[0]); @@ -1130,7 +1130,7 @@ void CM_TraceThroughTree( traceWork_t *tw, int num, float p1f, float p2f, vec3_t if ( frac2 > 1 ) { frac2 = 1; } - + midf = p1f + (p2f - p1f)*frac2; mid[0] = p1[0] + frac2*(p2[0] - p1[0]); @@ -1274,7 +1274,7 @@ void CM_Trace( trace_t *results, const vec3_t start, const vec3_t end, vec3_t mi if ( model ) { #ifdef ALWAYS_BBOX_VS_BBOX // bk010201 - FIXME - compile time flag? if ( model == BOX_MODEL_HANDLE || model == CAPSULE_MODEL_HANDLE) { - tw.sphere.use = qfalse; + tw.sphere.use = false; CM_TestInLeaf( &tw, &cmod->leaf ); } else @@ -1303,10 +1303,10 @@ void CM_Trace( trace_t *results, const vec3_t start, const vec3_t end, vec3_t mi // check for point special case // if ( tw.size[0][0] == 0 && tw.size[0][1] == 0 && tw.size[0][2] == 0 ) { - tw.isPoint = qtrue; + tw.isPoint = true; VectorClear( tw.extents ); } else { - tw.isPoint = qfalse; + tw.isPoint = false; tw.extents[0] = tw.size[1][0]; tw.extents[1] = tw.size[1][1]; tw.extents[2] = tw.size[1][2]; @@ -1318,7 +1318,7 @@ void CM_Trace( trace_t *results, const vec3_t start, const vec3_t end, vec3_t mi if ( model ) { #ifdef ALWAYS_BBOX_VS_BBOX if ( model == BOX_MODEL_HANDLE || model == CAPSULE_MODEL_HANDLE) { - tw.sphere.use = qfalse; + tw.sphere.use = false; CM_TraceThroughLeaf( &tw, &cmod->leaf ); } else @@ -1420,11 +1420,11 @@ void CM_TransformedBoxTrace( trace_t *results, const vec3_t start, const vec3_t VectorSubtract( end_l, origin, end_l ); // rotate start and end into the models frame of reference - if ( model != BOX_MODEL_HANDLE && + if ( model != BOX_MODEL_HANDLE && (angles[0] || angles[1] || angles[2]) ) { - rotated = qtrue; + rotated = true; } else { - rotated = qfalse; + rotated = false; } halfwidth = symetricSize[ 1 ][ 0 ]; diff --git a/tools/mbspc/qcommon/q_shared.h b/tools/mbspc/qcommon/q_shared.h index e931a9ee..6ee20e2b 100644 --- a/tools/mbspc/qcommon/q_shared.h +++ b/tools/mbspc/qcommon/q_shared.h @@ -102,16 +102,12 @@ typedef int intptr_t; #include "q_platform.h" - +#include "bytebool.h" //============================================================= -typedef unsigned char byte; - -typedef enum {qfalse, qtrue} qboolean; - typedef union { float f; @@ -359,7 +355,7 @@ extern vec3_t axisDefault[3]; static ID_INLINE float Q_rsqrt( float number ) { float x = 0.5f * number; float y; -#ifdef __GNUC__ +#ifdef __GNUC__ asm("frsqrte %0,%1" : "=f" (y) : "f" (number)); #else y = __frsqrte( number ); @@ -367,10 +363,10 @@ static ID_INLINE float Q_rsqrt( float number ) { return y * (1.5f - (x * y * y)); } -#ifdef __GNUC__ +#ifdef __GNUC__ static ID_INLINE float Q_fabs(float x) { float abs_x; - + asm("fabs %0,%1" : "=f" (abs_x) : "f" (x)); return abs_x; } @@ -453,7 +449,7 @@ void AddPointToBounds( const vec3_t v, vec3_t mins, vec3_t maxs ); static ID_INLINE int VectorCompare( const vec3_t v1, const vec3_t v2 ) { if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]) { return 0; - } + } return 1; } @@ -514,7 +510,7 @@ vec_t VectorLengthSquared( const vec3_t v ); vec_t Distance( const vec3_t p1, const vec3_t p2 ); vec_t DistanceSquared( const vec3_t p1, const vec3_t p2 ); - + void VectorNormalizeFast( vec3_t v ); void VectorInverse( vec3_t v ); @@ -948,7 +944,7 @@ typedef struct { #define MAX_STATS 16 #define MAX_PERSISTANT 16 #define MAX_POWERUPS 16 -#define MAX_WEAPONS 16 +#define MAX_WEAPONS 16 #define MAX_PS_EVENTS 2 @@ -1072,7 +1068,7 @@ typedef struct usercmd_s { int serverTime; int angles[3]; int buttons; - byte weapon; // weapon + byte weapon; // weapon signed char forwardmove, rightmove, upmove; } usercmd_t; @@ -1152,7 +1148,7 @@ typedef struct entityState_s { typedef enum { CA_UNINITIALIZED, CA_DISCONNECTED, // not talking to a server - CA_AUTHORIZING, // not used any more, was checking cd key + CA_AUTHORIZING, // not used any more, was checking cd key CA_CONNECTING, // sending request packets to the server CA_CHALLENGING, // sending challenge packets to the server CA_CONNECTED, // netchan_t established, getting gamestate @@ -1162,7 +1158,7 @@ typedef enum { CA_CINEMATIC // playing a cinematic or a static pic, not connected to a server } connstate_t; -// font support +// font support #define GLYPH_START 0 #define GLYPH_END 255 diff --git a/tools/quake2/common/cmdlib.h b/tools/quake2/common/cmdlib.h index 7c8ad5c4..0112d7df 100644 --- a/tools/quake2/common/cmdlib.h +++ b/tools/quake2/common/cmdlib.h @@ -44,11 +44,7 @@ #pragma intrinsic( memset, memcpy ) #endif -#ifndef __BYTEBOOL__ - #define __BYTEBOOL__ -typedef enum {false, true} qboolean; -typedef unsigned char byte; -#endif +#include "bytebool.h" #ifdef PATH_MAX #define MAX_OS_PATH PATH_MAX diff --git a/tools/quake2/q2map/main.c b/tools/quake2/q2map/main.c index 7313598b..3ebd40a1 100644 --- a/tools/quake2/q2map/main.c +++ b/tools/quake2/q2map/main.c @@ -28,9 +28,6 @@ /* dependencies */ #include "q2map.h" -#define qtrue true -#define qfalse false - char *mapname; char game[64]; extern qboolean verbose; @@ -124,7 +121,7 @@ int BSPInfo(){ } /* enable info mode */ - //infoMode = qtrue; + //infoMode = true; /* mangle filename and get size */ @@ -554,10 +551,10 @@ int main( int argc, char **argv ){ double start, end; int alt_argc; char** alt_argv; - qboolean do_info = qfalse; - qboolean do_bsp = qfalse; - qboolean do_vis = qfalse; - qboolean do_rad = qfalse; + qboolean do_info = false; + qboolean do_bsp = false; + qboolean do_vis = false; + qboolean do_rad = false; /* we want consistent 'randomness' */ @@ -588,7 +585,7 @@ int main( int argc, char **argv ){ /* verbose */ else if ( !strcmp( argv[ i ], "-v" ) ) { - verbose = qtrue; + verbose = true; } /* threads */ @@ -614,12 +611,12 @@ int main( int argc, char **argv ){ { /* info */ if ( !strcmp( argv[ i ], "-info" ) ) { - do_info = qtrue; + do_info = true; } /* bsp */ if ( !strcmp( argv[ i ], "-bsp" ) ) { - do_bsp = qtrue; + do_bsp = true; alt_argc = argc - i; alt_argv = (char **) ( argv + i ); Check_BSP_Options( alt_argc, alt_argv ); @@ -627,7 +624,7 @@ int main( int argc, char **argv ){ /* vis */ if ( !strcmp( argv[ i ], "-vis" ) ) { - do_vis = qtrue; + do_vis = true; alt_argc = argc - i; alt_argv = (char **) ( argv + i ); Check_VIS_Options( alt_argc, alt_argv ); @@ -635,7 +632,7 @@ int main( int argc, char **argv ){ /* rad */ if ( !strcmp( argv[ i ], "-rad" ) ) { - do_rad = qtrue; + do_rad = true; alt_argc = argc - i; alt_argv = (char **) ( argv + i ); Check_RAD_Options( alt_argc, alt_argv ); diff --git a/tools/quake2/qdata_heretic2/common/cmdlib.h b/tools/quake2/qdata_heretic2/common/cmdlib.h index b62a34f3..1018cd3d 100644 --- a/tools/quake2/qdata_heretic2/common/cmdlib.h +++ b/tools/quake2/qdata_heretic2/common/cmdlib.h @@ -50,12 +50,7 @@ #endif -#ifndef __BYTEBOOL__ - #define __BYTEBOOL__ -//typedef enum {false, true} qboolean; -//typedef unsigned char byte; - #include "q_typedef.h" -#endif +#include "q_typedef.h" #ifdef PATH_MAX #define MAX_OS_PATH PATH_MAX diff --git a/tools/quake2/qdata_heretic2/qcommon/q_typedef.h b/tools/quake2/qdata_heretic2/qcommon/q_typedef.h index c980b544..ebc61e62 100644 --- a/tools/quake2/qdata_heretic2/qcommon/q_typedef.h +++ b/tools/quake2/qdata_heretic2/qcommon/q_typedef.h @@ -22,6 +22,8 @@ #ifndef Q_TYPEDEF_H #define Q_TYPEDEF_H +#include "bytebool.h" + typedef float vec_t; typedef vec_t vec2_t[2]; typedef vec_t vec3_t[3]; @@ -35,14 +37,6 @@ typedef int fixed4_t; typedef int fixed8_t; typedef int fixed16_t; -typedef unsigned char byte; - -#ifndef __cplusplus -typedef enum {false, true} qboolean; -#else -typedef int qboolean; -#endif - typedef struct edict_s edict_t; typedef struct paletteRGBA_s diff --git a/tools/quake3/common/aselib.c b/tools/quake3/common/aselib.c index 8150fabf..0e0f7230 100644 --- a/tools/quake3/common/aselib.c +++ b/tools/quake3/common/aselib.c @@ -102,8 +102,8 @@ typedef struct int len; int currentObject; - qboolean verbose; - qboolean grabAnims; + bool verbose; + bool grabAnims; } ase_t; @@ -117,7 +117,7 @@ static void ASE_FreeGeomObject( int ndx ); /* ** ASE_Load */ -void ASE_Load( const char *filename, qboolean verbose, qboolean grabAnims ){ +void ASE_Load( const char *filename, bool verbose, bool grabAnims ){ FILE *fp = fopen( filename, "rb" ); if ( !fp ) { @@ -307,7 +307,7 @@ static int CharIsTokenDelimiter( int ch ){ return 0; } -static int ASE_GetToken( qboolean restOfLine ){ +static int ASE_GetToken( bool restOfLine ){ int i = 0; if ( ase.buffer == 0 ) { @@ -347,7 +347,7 @@ static int ASE_GetToken( qboolean restOfLine ){ static void ASE_ParseBracedBlock( void ( *parser )( const char *token ) ){ int indent = 0; - while ( ASE_GetToken( qfalse ) ) + while ( ASE_GetToken( false ) ) { if ( !strcmp( s_token, "{" ) ) { indent++; @@ -373,7 +373,7 @@ static void ASE_ParseBracedBlock( void ( *parser )( const char *token ) ){ static void ASE_SkipEnclosingBraces( void ){ int indent = 0; - while ( ASE_GetToken( qfalse ) ) + while ( ASE_GetToken( false ) ) { if ( !strcmp( s_token, "{" ) ) { indent++; @@ -391,7 +391,7 @@ static void ASE_SkipEnclosingBraces( void ){ } static void ASE_SkipRestOfLine( void ){ - ASE_GetToken( qtrue ); + ASE_GetToken( true ); } static void ASE_KeyMAP_DIFFUSE( const char *token ){ @@ -401,7 +401,7 @@ static void ASE_KeyMAP_DIFFUSE( const char *token ){ strcpy( filename, gl_filename ); if ( !strcmp( token, "*BITMAP" ) ) { - ASE_GetToken( qfalse ); + ASE_GetToken( false ); // the purpose of this whole chunk of code below is to extract the relative path // from a full path in the ASE @@ -456,7 +456,7 @@ static void ASE_KeyMATERIAL( const char *token ){ static void ASE_KeyMATERIAL_LIST( const char *token ){ if ( !strcmp( token, "*MATERIAL_COUNT" ) ) { - ASE_GetToken( qfalse ); + ASE_GetToken( false ); VERBOSE( ( "..num materials: %s\n", s_token ) ); if ( atoi( s_token ) > MAX_ASE_MATERIALS ) { Error( "Too many materials!" ); @@ -474,15 +474,15 @@ static void ASE_KeyMESH_VERTEX_LIST( const char *token ){ aseMesh_t *pMesh = ASE_GetCurrentMesh(); if ( !strcmp( token, "*MESH_VERTEX" ) ) { - ASE_GetToken( qfalse ); // skip number + ASE_GetToken( false ); // skip number - ASE_GetToken( qfalse ); + ASE_GetToken( false ); pMesh->vertexes[pMesh->currentVertex].y = atof( s_token ); - ASE_GetToken( qfalse ); + ASE_GetToken( false ); pMesh->vertexes[pMesh->currentVertex].x = -atof( s_token ); - ASE_GetToken( qfalse ); + ASE_GetToken( false ); pMesh->vertexes[pMesh->currentVertex].z = atof( s_token ); pMesh->currentVertex++; @@ -501,21 +501,21 @@ static void ASE_KeyMESH_FACE_LIST( const char *token ){ aseMesh_t *pMesh = ASE_GetCurrentMesh(); if ( !strcmp( token, "*MESH_FACE" ) ) { - ASE_GetToken( qfalse ); // skip face number + ASE_GetToken( false ); // skip face number - ASE_GetToken( qfalse ); // skip label - ASE_GetToken( qfalse ); // first vertex + ASE_GetToken( false ); // skip label + ASE_GetToken( false ); // first vertex pMesh->faces[pMesh->currentFace][0] = atoi( s_token ); - ASE_GetToken( qfalse ); // skip label - ASE_GetToken( qfalse ); // second vertex + ASE_GetToken( false ); // skip label + ASE_GetToken( false ); // second vertex pMesh->faces[pMesh->currentFace][2] = atoi( s_token ); - ASE_GetToken( qfalse ); // skip label - ASE_GetToken( qfalse ); // third vertex + ASE_GetToken( false ); // skip label + ASE_GetToken( false ); // third vertex pMesh->faces[pMesh->currentFace][1] = atoi( s_token ); - ASE_GetToken( qtrue ); + ASE_GetToken( true ); /* if ( ( p = strstr( s_token, "*MESH_MTLID" ) ) != 0 ) @@ -543,13 +543,13 @@ static void ASE_KeyTFACE_LIST( const char *token ){ if ( !strcmp( token, "*MESH_TFACE" ) ) { int a, b, c; - ASE_GetToken( qfalse ); + ASE_GetToken( false ); - ASE_GetToken( qfalse ); + ASE_GetToken( false ); a = atoi( s_token ); - ASE_GetToken( qfalse ); + ASE_GetToken( false ); c = atoi( s_token ); - ASE_GetToken( qfalse ); + ASE_GetToken( false ); b = atoi( s_token ); pMesh->tfaces[pMesh->currentFace][0] = a; @@ -570,15 +570,15 @@ static void ASE_KeyMESH_TVERTLIST( const char *token ){ if ( !strcmp( token, "*MESH_TVERT" ) ) { char u[80], v[80], w[80]; - ASE_GetToken( qfalse ); + ASE_GetToken( false ); - ASE_GetToken( qfalse ); + ASE_GetToken( false ); strcpy( u, s_token ); - ASE_GetToken( qfalse ); + ASE_GetToken( false ); strcpy( v, s_token ); - ASE_GetToken( qfalse ); + ASE_GetToken( false ); strcpy( w, s_token ); pMesh->tvertexes[pMesh->currentVertex].s = atof( u ); @@ -600,33 +600,33 @@ static void ASE_KeyMESH( const char *token ){ aseMesh_t *pMesh = ASE_GetCurrentMesh(); if ( !strcmp( token, "*TIMEVALUE" ) ) { - ASE_GetToken( qfalse ); + ASE_GetToken( false ); pMesh->timeValue = atoi( s_token ); VERBOSE( ( ".....timevalue: %d\n", pMesh->timeValue ) ); } else if ( !strcmp( token, "*MESH_NUMVERTEX" ) ) { - ASE_GetToken( qfalse ); + ASE_GetToken( false ); pMesh->numVertexes = atoi( s_token ); VERBOSE( ( ".....TIMEVALUE: %d\n", pMesh->timeValue ) ); VERBOSE( ( ".....num vertexes: %d\n", pMesh->numVertexes ) ); } else if ( !strcmp( token, "*MESH_NUMFACES" ) ) { - ASE_GetToken( qfalse ); + ASE_GetToken( false ); pMesh->numFaces = atoi( s_token ); VERBOSE( ( ".....num faces: %d\n", pMesh->numFaces ) ); } else if ( !strcmp( token, "*MESH_NUMTVFACES" ) ) { - ASE_GetToken( qfalse ); + ASE_GetToken( false ); if ( atoi( s_token ) != pMesh->numFaces ) { Error( "MESH_NUMTVFACES != MESH_NUMFACES" ); } } else if ( !strcmp( token, "*MESH_NUMTVERTEX" ) ) { - ASE_GetToken( qfalse ); + ASE_GetToken( false ); pMesh->numTVertexes = atoi( s_token ); VERBOSE( ( ".....num tvertexes: %d\n", pMesh->numTVertexes ) ); @@ -687,7 +687,7 @@ static void ASE_KeyGEOMOBJECT( const char *token ){ if ( !strcmp( token, "*NODE_NAME" ) ) { char *name = ase.objects[ase.currentObject].name; - ASE_GetToken( qtrue ); + ASE_GetToken( true ); VERBOSE( ( " %s\n", s_token ) ); strcpy( ase.objects[ase.currentObject].name, s_token + 1 ); if ( strchr( ase.objects[ase.currentObject].name, '"' ) ) { @@ -740,7 +740,7 @@ static void ASE_KeyGEOMOBJECT( const char *token ){ } // according to spec these are obsolete else if ( !strcmp( token, "*MATERIAL_REF" ) ) { - ASE_GetToken( qfalse ); + ASE_GetToken( false ); ase.objects[ase.currentObject].materialRef = atoi( s_token ); } @@ -807,7 +807,7 @@ static void CollapseObjects( void ){ ** ASE_Process */ static void ASE_Process( void ){ - while ( ASE_GetToken( qfalse ) ) + while ( ASE_GetToken( false ) ) { if ( !strcmp( s_token, "*3DSMAX_ASCIIEXPORT" ) || !strcmp( s_token, "*COMMENT" ) ) { diff --git a/tools/quake3/common/aselib.h b/tools/quake3/common/aselib.h index 2f5f015a..7eb1ded4 100644 --- a/tools/quake3/common/aselib.h +++ b/tools/quake3/common/aselib.h @@ -24,7 +24,7 @@ #include "mathlib.h" #include "polyset.h" -void ASE_Load( const char *filename, qboolean verbose, qboolean meshanims ); +void ASE_Load( const char *filename, bool verbose, bool meshanims ); int ASE_GetNumSurfaces( void ); polyset_t *ASE_GetSurfaceAnimation( int ndx, int *numFrames, int skipFrameStart, int skipFrameEnd, int maxFrames ); const char *ASE_GetSurfaceName( int ndx ); diff --git a/tools/quake3/common/bspfile.c b/tools/quake3/common/bspfile.c index a5ba4f7b..68574f42 100644 --- a/tools/quake3/common/bspfile.c +++ b/tools/quake3/common/bspfile.c @@ -500,7 +500,7 @@ epair_t *ParseEpair( void ) { Error( "ParseEpar: token too long" ); } e->key = copystring( token ); - GetToken( qfalse ); + GetToken( false ); if ( strlen( token ) >= MAX_VALUE - 1 ) { Error( "ParseEpar: token too long" ); } @@ -520,12 +520,12 @@ epair_t *ParseEpair( void ) { ParseEntity ================ */ -qboolean ParseEntity( void ) { +bool ParseEntity( void ) { epair_t *e; entity_t *mapent; - if ( !GetToken( qtrue ) ) { - return qfalse; + if ( !GetToken( true ) ) { + return false; } if ( strcmp( token, "{" ) ) { @@ -538,7 +538,7 @@ qboolean ParseEntity( void ) { num_entities++; do { - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { Error( "ParseEntity: EOF without closing brace" ); } if ( !strcmp( token, "}" ) ) { @@ -549,7 +549,7 @@ qboolean ParseEntity( void ) { mapent->epairs = e; } while ( 1 ); - return qtrue; + return true; } /* diff --git a/tools/quake3/common/cmdlib.c b/tools/quake3/common/cmdlib.c index d8afa0d7..37b3780a 100644 --- a/tools/quake3/common/cmdlib.c +++ b/tools/quake3/common/cmdlib.c @@ -89,9 +89,9 @@ int myargc; char **myargv; char com_token[1024]; -qboolean com_eof; +bool com_eof; -qboolean archive; +bool archive; char archivedir[1024]; @@ -362,7 +362,7 @@ skipwhite: while ( ( c = *data ) <= ' ' ) { if ( c == 0 ) { - com_eof = qtrue; + com_eof = true; return NULL; // end of file; } data++; @@ -564,15 +564,15 @@ void SafeWrite( FILE *f, const void *buffer, int count ){ FileExists ============== */ -qboolean FileExists( const char *filename ){ +bool FileExists( const char *filename ){ FILE *f; f = fopen( filename, "r" ); if ( !f ) { - return qfalse; + return false; } fclose( f ); - return qtrue; + return true; } /* @@ -676,7 +676,7 @@ void SaveFile( const char *filename, const void *buffer, int count ){ */ /// \brief Returns true if \p path is a fully qualified file-system path. -qboolean path_is_absolute( const char* path ){ +bool path_is_absolute( const char* path ){ #if defined( WIN32 ) return path[0] == '/' || ( path[0] != '\0' && path[1] == ':' ); // local drive diff --git a/tools/quake3/common/cmdlib.h b/tools/quake3/common/cmdlib.h index eaa68111..93af470a 100644 --- a/tools/quake3/common/cmdlib.h +++ b/tools/quake3/common/cmdlib.h @@ -77,7 +77,7 @@ void *safe_calloc_info( size_t size, const char* info ); extern int myargc; extern char **myargv; -static inline qboolean strEmpty( const char* string ){ +static inline bool strEmpty( const char* string ){ return *string == '\0'; } static inline void strClear( char* string ){ @@ -140,13 +140,13 @@ int LoadFile( const char *filename, void **bufferptr ); int LoadFileBlock( const char *filename, void **bufferptr ); int TryLoadFile( const char *filename, void **bufferptr ); void SaveFile( const char *filename, const void *buffer, int count ); -qboolean FileExists( const char *filename ); +bool FileExists( const char *filename ); -static inline qboolean path_separator( const char c ){ +static inline bool path_separator( const char c ){ return c == '/' || c == '\\'; } -qboolean path_is_absolute( const char* path ); +bool path_is_absolute( const char* path ); char* path_get_last_separator( const char* path ); char* path_get_filename_start( const char* path ); char* path_get_filename_base_end( const char* path ); @@ -181,7 +181,7 @@ float LittleFloat( float l ); char *COM_Parse( char *data ); extern char com_token[1024]; -extern qboolean com_eof; +extern bool com_eof; void CRC_Init( unsigned short *crcvalue ); @@ -191,7 +191,7 @@ unsigned short CRC_Value( unsigned short crcvalue ); void CreatePath( const char *path ); void QCopyFile( const char *from, const char *to ); -extern qboolean archive; +extern bool archive; extern char archivedir[1024]; // sleep for the given amount of milliseconds diff --git a/tools/quake3/common/imagelib.c b/tools/quake3/common/imagelib.c index c8a6f2ae..54d8254e 100644 --- a/tools/quake3/common/imagelib.c +++ b/tools/quake3/common/imagelib.c @@ -686,7 +686,7 @@ void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int int bcPlanes; int bcBitCount; byte bcPalette[1024]; - qboolean flipped; + bool flipped; byte *in; int len, pos = 0; @@ -763,10 +763,10 @@ void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int if ( bcHeight < 0 ) { bcHeight = -bcHeight; - flipped = qtrue; + flipped = true; } else { - flipped = qfalse; + flipped = false; } if ( width ) { diff --git a/tools/quake3/common/inout.c b/tools/quake3/common/inout.c index ee82d508..2cfe2671 100644 --- a/tools/quake3/common/inout.c +++ b/tools/quake3/common/inout.c @@ -48,7 +48,7 @@ socket_t *brdcst_socket; netmessage_t msg; -qboolean verbose = qfalse; +bool verbose = false; // our main document // is streamed through the network to Radiant @@ -140,7 +140,7 @@ void xml_SendNode( xmlNodePtr node ){ } } -void xml_Select( char *msg, int entitynum, int brushnum, qboolean bError ){ +void xml_Select( char *msg, int entitynum, int brushnum, bool bError ){ xmlNodePtr node, select; char buf[1024]; char level[2]; @@ -190,7 +190,7 @@ void xml_Point( char *msg, vec3_t pt ){ } #define WINDING_BUFSIZE 2048 -void xml_Winding( char *msg, vec3_t p[], int numpoints, qboolean die ){ +void xml_Winding( char *msg, vec3_t p[], int numpoints, bool die ){ xmlNodePtr node, winding; char buf[WINDING_BUFSIZE]; char smlbuf[128]; @@ -232,8 +232,8 @@ void xml_Winding( char *msg, vec3_t p[], int numpoints, qboolean die ){ void set_console_colour_for_flag( int flag ){ #ifdef WIN32 static int curFlag = SYS_STD; - static qboolean ok = qtrue; - static qboolean initialized = qfalse; + static bool ok = true; + static bool initialized = false; static HANDLE hConsole; static WORD colour_saved; if( !ok ) @@ -242,11 +242,11 @@ void set_console_colour_for_flag( int flag ){ hConsole = GetStdHandle( STD_OUTPUT_HANDLE ); CONSOLE_SCREEN_BUFFER_INFO consoleInfo; if( hConsole == INVALID_HANDLE_VALUE || !GetConsoleScreenBufferInfo( hConsole, &consoleInfo ) ){ - ok = qfalse; + ok = false; return; } colour_saved = consoleInfo.wAttributes; - initialized = qtrue; + initialized = true; } if( curFlag != flag ){ curFlag = flag; @@ -336,7 +336,7 @@ void xml_message_push( int flag, const char* characters, size_t length ){ // all output ends up through here void FPrintf( int flag, char *buf ){ - static qboolean bGotXML = qfalse; + static bool bGotXML = false; set_console_colour_for_flag( flag & ~( SYS_NOXMLflag | SYS_VRBflag ) ); printf( "%s", buf ); @@ -358,7 +358,7 @@ void FPrintf( int flag, char *buf ){ // initialize doc = xmlNewDoc( (const xmlChar*)"1.0" ); doc->children = xmlNewDocRawNode( doc, NULL, (const xmlChar*)"q3map_feedback", NULL ); - bGotXML = qtrue; + bGotXML = true; } xml_message_push( flag & ~( SYS_NOXMLflag | SYS_VRBflag ), buf, strlen( buf ) ); } @@ -373,7 +373,7 @@ void Sys_FPrintf( int flag, const char *format, ... ){ char out_buffer[4096]; va_list argptr; - if ( ( flag & SYS_VRBflag ) && ( verbose == qfalse ) ) { + if ( ( flag & SYS_VRBflag ) && !verbose ) { return; } diff --git a/tools/quake3/common/inout.h b/tools/quake3/common/inout.h index 6fe911f1..a7aa7798 100644 --- a/tools/quake3/common/inout.h +++ b/tools/quake3/common/inout.h @@ -31,10 +31,10 @@ xmlNodePtr xml_NodeForVec( vec3_t v ); void xml_SendNode( xmlNodePtr node ); // print a message in q3map output and send the corresponding select information down the xml stream // bError: do we end with an error on this one or do we go ahead? -void xml_Select( char *msg, int entitynum, int brushnum, qboolean bError ); +void xml_Select( char *msg, int entitynum, int brushnum, bool bError ); // end q3map with an error message and send a point information in the xml stream // note: we might want to add a boolean to use this as a warning or an error thing.. -void xml_Winding( char *msg, vec3_t p[], int numpoints, qboolean die ); +void xml_Winding( char *msg, vec3_t p[], int numpoints, bool die ); void xml_Point( char *msg, vec3_t pt ); void Broadcast_Setup( const char *dest ); @@ -51,7 +51,7 @@ void Broadcast_Shutdown(); #define SYS_VRB SYS_STD | SYS_VRBflag // verbose support (on/off) //a shortcut, not for sending! -extern qboolean verbose; +extern bool verbose; void Sys_Printf( const char *text, ... ); void Sys_FPrintf( int flag, const char *text, ... ); void Sys_Warning( const char *format, ... ); diff --git a/tools/quake3/common/polylib.c b/tools/quake3/common/polylib.c index b10fef34..2883d94b 100644 --- a/tools/quake3/common/polylib.c +++ b/tools/quake3/common/polylib.c @@ -948,12 +948,12 @@ void CheckWinding( winding_t *w ){ ============ */ int WindingOnPlaneSide( winding_t *w, vec3_t normal, vec_t dist ){ - qboolean front, back; + bool front, back; int i; vec_t d; - front = qfalse; - back = qfalse; + front = false; + back = false; for ( i = 0 ; i < w->numpoints ; i++ ) { d = DotProduct( w->p[i], normal ) - dist; @@ -961,14 +961,14 @@ int WindingOnPlaneSide( winding_t *w, vec3_t normal, vec_t dist ){ if ( front ) { return SIDE_CROSS; } - back = qtrue; + back = true; continue; } if ( d > ON_EPSILON ) { if ( back ) { return SIDE_CROSS; } - front = qtrue; + front = true; continue; } } @@ -1000,8 +1000,8 @@ void AddWindingToConvexHull( winding_t *w, winding_t **hull, vec3_t normal ) vec3_t hullPoints[MAX_HULL_POINTS]; vec3_t newHullPoints[MAX_HULL_POINTS]; vec3_t hullDirs[MAX_HULL_POINTS]; - qboolean hullSide[MAX_HULL_POINTS]; - qboolean outside; + bool hullSide[MAX_HULL_POINTS]; + bool outside; if ( !*hull ) { *hull = CopyWinding( w ); @@ -1023,19 +1023,14 @@ void AddWindingToConvexHull( winding_t *w, winding_t **hull, vec3_t normal ) CrossProduct( normal, dir, hullDirs[j] ); } - outside = qfalse; + outside = false; for ( j = 0 ; j < numHullPoints ; j++ ) { VectorSubtract( p, hullPoints[j], dir ); d = DotProduct( dir, hullDirs[j] ); if ( d >= ON_EPSILON ) { - outside = qtrue; - } - if ( d >= -ON_EPSILON ) { - hullSide[j] = qtrue; - } - else { - hullSide[j] = qfalse; + outside = true; } + hullSide[j] = ( d >= -ON_EPSILON ); } // if the point is effectively inside, do nothing diff --git a/tools/quake3/common/qthreads.h b/tools/quake3/common/qthreads.h index 624cebde..8339cae9 100644 --- a/tools/quake3/common/qthreads.h +++ b/tools/quake3/common/qthreads.h @@ -24,7 +24,7 @@ extern int numthreads; void ThreadSetDefault( void ); int GetThreadWork( void ); -void RunThreadsOnIndividual( int workcnt, qboolean showpacifier, void ( *func )( int ) ); -void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ); +void RunThreadsOnIndividual( int workcnt, bool showpacifier, void ( *func )( int ) ); +void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ); void ThreadLock( void ); void ThreadUnlock( void ); diff --git a/tools/quake3/common/scriplib.c b/tools/quake3/common/scriplib.c index 181e5063..51ba9c77 100644 --- a/tools/quake3/common/scriplib.c +++ b/tools/quake3/common/scriplib.c @@ -48,8 +48,8 @@ script_t *script; int scriptline; char token[MAXTOKEN]; -qboolean endofscript; -qboolean tokenready; // only qtrue if UnGetToken was just called +bool endofscript; +bool tokenready; // only true if UnGetToken was just called /* ============== @@ -98,8 +98,8 @@ void LoadScriptFile( const char *filename, int index ){ script = scriptstack; AddScriptToStack( filename, index ); - endofscript = qfalse; - tokenready = qfalse; + endofscript = false; + tokenready = false; } /* &unload current; for autopacker */ void SilentLoadScriptFile( const char *filename, int index ){ @@ -127,8 +127,8 @@ void SilentLoadScriptFile( const char *filename, int index ){ script->script_p = script->buffer; script->end_p = script->buffer + size; - endofscript = qfalse; - tokenready = qfalse; + endofscript = false; + tokenready = false; } /* @@ -149,8 +149,8 @@ void ParseFromMemory( char *buffer, int size ){ script->script_p = script->buffer; script->end_p = script->buffer + size; - endofscript = qfalse; - tokenready = qfalse; + endofscript = false; + tokenready = false; } @@ -161,26 +161,26 @@ void ParseFromMemory( char *buffer, int size ){ Signals that the current token was not used, and should be reported for the next GetToken. Note that - GetToken (qtrue); + GetToken (true); UnGetToken (); - GetToken (qfalse); + GetToken (false); could cross a line boundary. ============== */ void UnGetToken( void ){ - tokenready = qtrue; + tokenready = true; } -qboolean EndOfScript( qboolean crossline ){ +bool EndOfScript( bool crossline ){ if ( !crossline ) { Error( "Line %i is incomplete\nFile location be: %s\n", scriptline, g_strLoadedFileLocation ); } if ( !strcmp( script->filename, "memory buffer" ) ) { - endofscript = qtrue; - return qfalse; + endofscript = true; + return false; } if ( script->buffer == NULL ) { @@ -191,8 +191,8 @@ qboolean EndOfScript( qboolean crossline ){ } script->buffer = NULL; if ( script == scriptstack + 1 ) { - endofscript = qtrue; - return qfalse; + endofscript = true; + return false; } script--; scriptline = script->line; @@ -205,18 +205,18 @@ qboolean EndOfScript( qboolean crossline ){ GetToken ============== */ -qboolean GetToken( qboolean crossline ){ +bool GetToken( bool crossline ){ char *token_p; /* ydnar: dummy testing */ if ( script == NULL || script->buffer == NULL ) { - return qfalse; + return false; } if ( tokenready ) { // is a token already waiting? - tokenready = qfalse; - return qtrue; + tokenready = false; + return true; } if ( ( script->script_p >= script->end_p ) || ( script->script_p == NULL ) ) { @@ -314,12 +314,12 @@ skipspace: *token_p = 0; if ( !strcmp( token, "$include" ) ) { - GetToken( qfalse ); + GetToken( false ); AddScriptToStack( token, 0 ); return GetToken( crossline ); } - return qtrue; + return true; } @@ -327,31 +327,29 @@ skipspace: ============== TokenAvailable - Returns qtrue if there is another token on the line + Returns true if there is another token on the line ============== */ -qboolean TokenAvailable( void ) { +bool TokenAvailable( void ) { int oldLine; - qboolean r; /* save */ oldLine = scriptline; /* test */ - r = GetToken( qtrue ); - if ( !r ) { - return qfalse; + if ( !GetToken( true ) ) { + return false; } UnGetToken(); if ( oldLine == scriptline ) { - return qtrue; + return true; } /* restore */ //% scriptline = oldLine; //% script->line = oldScriptLine; - return qfalse; + return false; } @@ -359,7 +357,7 @@ qboolean TokenAvailable( void ) { void MatchToken( char *match ) { - GetToken( qtrue ); + GetToken( true ); if ( strcmp( token, match ) ) { Error( "MatchToken( \"%s\" ) failed at line %i in file %s", match, scriptline, script->filename ); @@ -373,7 +371,7 @@ void Parse1DMatrix( int x, vec_t *m ) { MatchToken( "(" ); for ( i = 0 ; i < x ; i++ ) { - GetToken( qfalse ); + GetToken( false ); m[i] = atof( token ); } diff --git a/tools/quake3/common/scriplib.h b/tools/quake3/common/scriplib.h index a1cf4def..79c76918 100644 --- a/tools/quake3/common/scriplib.h +++ b/tools/quake3/common/scriplib.h @@ -34,16 +34,16 @@ extern char token[MAXTOKEN]; extern char *scriptbuffer,*script_p,*scriptend_p; extern int grabbed; extern int scriptline; -extern qboolean endofscript; +extern bool endofscript; void LoadScriptFile( const char *filename, int index ); void SilentLoadScriptFile( const char *filename, int index ); void ParseFromMemory( char *buffer, int size ); -qboolean GetToken( qboolean crossline ); +bool GetToken( bool crossline ); void UnGetToken( void ); -qboolean TokenAvailable( void ); +bool TokenAvailable( void ); void MatchToken( char *match ); diff --git a/tools/quake3/common/threads.c b/tools/quake3/common/threads.c index 07ac9549..bd3486ce 100644 --- a/tools/quake3/common/threads.c +++ b/tools/quake3/common/threads.c @@ -36,9 +36,9 @@ int dispatch; int workcount; int oldf; -qboolean pacifier; +bool pacifier; -qboolean threaded; +bool threaded; /* ============= @@ -100,7 +100,7 @@ void ThreadWorkerFunction( int threadnum ){ } } -void RunThreadsOnIndividual( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ +void RunThreadsOnIndividual( int workcnt, bool showpacifier, void ( *func )( int ) ){ if ( numthreads == -1 ) { ThreadSetDefault(); } @@ -168,7 +168,7 @@ void ThreadUnlock( void ){ RunThreadsOn ============= */ -void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ +void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){ HANDLE threadhandle[MAX_THREADS]; int i; int start, end; @@ -178,7 +178,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ workcount = workcnt; oldf = -1; pacifier = showpacifier; - threaded = qtrue; + threaded = true; // // run threads in parallel @@ -210,7 +210,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ } DeleteCriticalSection( &crit ); - threaded = qfalse; + threaded = false; end = I_FloatTime(); if ( pacifier ) { Sys_Printf( " (%i)\n", end - start ); @@ -262,7 +262,7 @@ void ThreadUnlock( void ){ RunThreadsOn ============= */ -void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ +void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){ int i; pthread_t work_threads[MAX_THREADS]; pthread_addr_t status; @@ -275,7 +275,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ workcount = workcnt; oldf = -1; pacifier = showpacifier; - threaded = qtrue; + threaded = true; if ( pacifier ) { setbuf( stdout, NULL ); @@ -316,7 +316,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ } } - threaded = qfalse; + threaded = false; end = I_FloatTime(); if ( pacifier ) { @@ -370,7 +370,7 @@ void ThreadUnlock( void ){ RunThreadsOn ============= */ -void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ +void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){ int i; int pid[MAX_THREADS]; int start, end; @@ -380,7 +380,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ workcount = workcnt; oldf = -1; pacifier = showpacifier; - threaded = qtrue; + threaded = true; if ( pacifier ) { setbuf( stdout, NULL ); @@ -403,7 +403,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ for ( i = 0 ; i < numthreads - 1 ; i++ ) wait( NULL ); - threaded = qfalse; + threaded = false; end = I_FloatTime(); if ( pacifier ) { @@ -530,7 +530,7 @@ void recursive_mutex_init( pthread_mutexattr_t attribs ){ RunThreadsOn ============= */ -void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ +void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){ pthread_mutexattr_t mattrib; pthread_attr_t attr; pthread_t work_threads[MAX_THREADS]; @@ -558,7 +558,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ } else { - threaded = qtrue; + threaded = true; if ( pacifier ) { setbuf( stdout, NULL ); @@ -586,7 +586,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ } } pthread_mutexattr_destroy( &mattrib ); - threaded = qfalse; + threaded = false; } end = I_FloatTime(); @@ -624,7 +624,7 @@ void ThreadUnlock( void ){ RunThreadsOn ============= */ -void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){ +void RunThreadsOn( int workcnt, bool showpacifier, void ( *func )( int ) ){ int i; int start, end; diff --git a/tools/quake3/common/vfs.c b/tools/quake3/common/vfs.c index bfd43dac..84eb86ca 100644 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@ -399,7 +399,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){ -qboolean vfsPackFile( const char *filename, const char *packname, const int compLevel ){ +bool vfsPackFile( const char *filename, const char *packname, const int compLevel ){ int i; char tmp[NAME_MAX], fixed[NAME_MAX]; GSList *lst; @@ -442,7 +442,7 @@ qboolean vfsPackFile( const char *filename, const char *packname, const int comp mz_zip_writer_end( &zip ); } - return qtrue; + return true; } } @@ -457,7 +457,7 @@ qboolean vfsPackFile( const char *filename, const char *packname, const int comp memcpy( file->zipfile, &file->zipinfo, sizeof( unz_s ) ); if ( unzOpenCurrentFile( file->zipfile ) != UNZ_OK ) { - return qfalse; + return false; } bufferptr = safe_malloc( file->size + 1 ); @@ -467,7 +467,7 @@ qboolean vfsPackFile( const char *filename, const char *packname, const int comp i = unzReadCurrentFile( file->zipfile, bufferptr, file->size ); unzCloseCurrentFile( file->zipfile ); if ( i < 0 ) { - return qfalse; + return false; } else{ mz_bool success = MZ_TRUE; @@ -476,14 +476,14 @@ qboolean vfsPackFile( const char *filename, const char *packname, const int comp Error( "Failed creating zip archive \"%s\"!\n", packname ); } free( bufferptr ); - return qtrue; + return true; } } - return qfalse; + return false; } -qboolean vfsPackFile_Absolute_Path( const char *filepath, const char *filename, const char *packname, const int compLevel ){ +bool vfsPackFile_Absolute_Path( const char *filepath, const char *filename, const char *packname, const int compLevel ){ char tmp[NAME_MAX]; strcpy( tmp, filepath ); if ( access( tmp, R_OK ) == 0 ) { @@ -515,8 +515,8 @@ qboolean vfsPackFile_Absolute_Path( const char *filepath, const char *filename, mz_zip_writer_end( &zip ); } - return qtrue; + return true; } - return qfalse; + return false; } diff --git a/tools/quake3/common/vfs.h b/tools/quake3/common/vfs.h index 73e1477b..4e18063f 100644 --- a/tools/quake3/common/vfs.h +++ b/tools/quake3/common/vfs.h @@ -57,8 +57,8 @@ int vfsGetFileCount( const char *filename ); int vfsLoadFile( const char *filename, void **buffer, int index ); typedef struct StrList_s StrList; void vfsListShaderFiles( StrList* list, void pushStringCallback( StrList* list, const char* string ) ); -qboolean vfsPackFile( const char *filename, const char *packname, const int compLevel ); -qboolean vfsPackFile_Absolute_Path( const char *filepath, const char *filename, const char *packname, const int compLevel ); +bool vfsPackFile( const char *filename, const char *packname, const int compLevel ); +bool vfsPackFile_Absolute_Path( const char *filepath, const char *filename, const char *packname, const int compLevel ); extern char g_strForbiddenDirs[VFS_MAXDIRS][PATH_MAX + 1]; extern int g_numForbiddenDirs; diff --git a/tools/quake3/q3data/3dslib.c b/tools/quake3/q3data/3dslib.c index b7902bf0..28c73b60 100644 --- a/tools/quake3/q3data/3dslib.c +++ b/tools/quake3/q3data/3dslib.c @@ -22,9 +22,9 @@ #include #include "q3data.h" -static void Load3DS( const char *filename, _3DS_t *p3DS, qboolean verbose ); +static void Load3DS( const char *filename, _3DS_t *p3DS, bool verbose ); -static qboolean s_verbose; +static bool s_verbose; #define MAX_MATERIALS 100 #define MAX_NAMED_OBJECTS 100 @@ -448,7 +448,7 @@ static void LoadEditChunk( FILE *fp, long thisChunkLen, _3DSEditChunk_t *pEC ){ memcpy( pEC->pNamedObjects, namedObjects, numNamedObjects * sizeof( namedObjects[0] ) ); } -static void Load3DS( const char *filename, _3DS_t *p3DS, qboolean verbose ){ +static void Load3DS( const char *filename, _3DS_t *p3DS, bool verbose ){ FILE *fp; unsigned short chunkID; long chunkLen; @@ -555,7 +555,7 @@ static void ComputeNormals( _3DSTriObject_t *pTO, triangle_t *pTris ){ /* ** void _3DS_LoadPolysets */ -void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets, qboolean verbose ){ +void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets, bool verbose ){ _3DS_t _3ds; int numPolysets; polyset_t *pPSET; diff --git a/tools/quake3/q3data/3dslib.h b/tools/quake3/q3data/3dslib.h index 5490e939..5ea8a212 100644 --- a/tools/quake3/q3data/3dslib.h +++ b/tools/quake3/q3data/3dslib.h @@ -136,4 +136,4 @@ typedef struct #define _3DS_CHUNK_KEYFRAME_DATA 0xb000 -void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets, qboolean verbose ); +void _3DS_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets, bool verbose ); diff --git a/tools/quake3/q3data/compress.c b/tools/quake3/q3data/compress.c index e09975b2..ca8607c8 100644 --- a/tools/quake3/q3data/compress.c +++ b/tools/quake3/q3data/compress.c @@ -151,7 +151,7 @@ cblock_t BWT( cblock_t in ){ typedef struct hnode_s { int count; - qboolean used; + bool used; int children[2]; } hnode_t; diff --git a/tools/quake3/q3data/images.c b/tools/quake3/q3data/images.c index 06ed0cb2..61a8a42c 100644 --- a/tools/quake3/q3data/images.c +++ b/tools/quake3/q3data/images.c @@ -27,7 +27,7 @@ int byteimagewidth, byteimageheight; char mip_prefix[1024]; // directory to dump the textures in -qboolean colormap_issued; +bool colormap_issued; byte colormap_palette[768]; /* @@ -43,7 +43,7 @@ void Cmd_Grab( void ){ char savename[1024]; char dest[1024]; - GetToken( qfalse ); + GetToken( false ); if ( path_separator( token[0] ) ) { sprintf( savename, "%s%s.pcx", writedir, token + 1 ); @@ -64,13 +64,13 @@ void Cmd_Grab( void ){ return; } - GetToken( qfalse ); + GetToken( false ); xl = atoi( token ); - GetToken( qfalse ); + GetToken( false ); yl = atoi( token ); - GetToken( qfalse ); + GetToken( false ); w = atoi( token ); - GetToken( qfalse ); + GetToken( false ); h = atoi( token ); if ( xl < 0 || yl < 0 || w < 0 || h < 0 || xl + w > byteimagewidth || yl + h > byteimageheight ) { @@ -105,7 +105,7 @@ void Cmd_Raw( void ){ char savename[1024]; char dest[1024]; - GetToken( qfalse ); + GetToken( false ); sprintf( savename, "%s%s.lmp", writedir, token ); @@ -115,13 +115,13 @@ void Cmd_Raw( void ){ return; } - GetToken( qfalse ); + GetToken( false ); xl = atoi( token ); - GetToken( qfalse ); + GetToken( false ); yl = atoi( token ); - GetToken( qfalse ); + GetToken( false ); w = atoi( token ); - GetToken( qfalse ); + GetToken( false ); h = atoi( token ); if ( xl < 0 || yl < 0 || w < 0 || h < 0 || xl + w > byteimagewidth || yl + h > byteimageheight ) { @@ -213,7 +213,7 @@ void Cmd_Colormap( void ){ char savename[1024]; char dest[1024]; - colormap_issued = qtrue; + colormap_issued = true; if ( !g_release ) { memcpy( colormap_palette, lbmpalette, 768 ); } @@ -222,7 +222,7 @@ void Cmd_Colormap( void ){ return; } - GetToken( qfalse ); + GetToken( false ); sprintf( savename, "%spics/%s.pcx", writedir, token ); if ( g_release ) { @@ -302,7 +302,7 @@ byte pixdata[256]; int d_red, d_green, d_blue; byte palmap[32][32][32]; -qboolean palmap_built; +bool palmap_built; /* ============= @@ -348,7 +348,7 @@ void BuildPalmap( void ){ if ( palmap_built ) { return; } - palmap_built = qtrue; + palmap_built = true; for ( r = 4 ; r < 256 ; r += 8 ) { @@ -443,7 +443,7 @@ void Cmd_Environment( void ){ byte image[256 * 256]; byte *tga; - GetToken( qfalse ); + GetToken( false ); if ( g_release ) { for ( i = 0 ; i < 6 ; i++ ) diff --git a/tools/quake3/q3data/models.c b/tools/quake3/q3data/models.c index 33a3c015..a91203b0 100644 --- a/tools/quake3/q3data/models.c +++ b/tools/quake3/q3data/models.c @@ -153,7 +153,7 @@ void ClearModel( void ){ memset( &g_data.model, 0, sizeof( g_data.model ) ); VectorCopy( vec3_origin, g_data.adjust ); g_data.fixedwidth = g_data.fixedheight = 0; - g_skipmodel = qfalse; + g_skipmodel = false; } /* @@ -509,7 +509,7 @@ void FinishModel( int type ){ */ static void OrderSurfaces( void ){ int s; - extern qboolean g_stripify; + extern bool g_stripify; // go through each surface and find best strip/fans possible for ( s = 0; s < g_data.model.numSurfaces; s++ ) @@ -763,7 +763,7 @@ static int LoadModelFile( const char *filename, polyset_t **psets, int *numpolys void Cmd_Base( void ){ char filename[1024]; - GetToken( qfalse ); + GetToken( false ); sprintf( filename, "%s/%s", g_cddir, token ); LoadBase( filename ); } @@ -776,7 +776,7 @@ static void LoadBase( const char *filename ){ // determine polyset splitting threshold if ( TokenAvailable() ) { - GetToken( qfalse ); + GetToken( false ); g_data.maxSurfaceTris = atoi( token ); } else @@ -818,13 +818,13 @@ void Cmd_SpriteBase( void ){ g_data.type = MD3_TYPE_SPRITE; - GetToken( qfalse ); + GetToken( false ); xl = atof( token ); - GetToken( qfalse ); + GetToken( false ); yl = atof( token ); - GetToken( qfalse ); + GetToken( false ); width = atof( token ); - GetToken( qfalse ); + GetToken( false ); height = atof( token ); // if (g_skipmodel || g_release || g_archive) @@ -917,7 +917,7 @@ void GrabFrame( const char *frame ){ float *frameNormals; const char *framefile; polyset_t *psets; - qboolean parentTagExists = qfalse; + bool parentTagExists = false; int numpolysets; int numtags = 0; int tagcount; @@ -1005,7 +1005,7 @@ void GrabFrame( const char *frame ){ MD3_ComputeTagFromTri( &tagParent, tri ); strcpy( tagParent.name, psets[i].name ); g_data.tags[g_data.model.numFrames][numtags] = tagParent; - parentTagExists = qtrue; + parentTagExists = true; } } @@ -1129,7 +1129,7 @@ void GrabFrame( const char *frame ){ void Cmd_Frame( void ){ while ( TokenAvailable() ) { - GetToken( qfalse ); + GetToken( false ); if ( g_skipmodel ) { continue; } @@ -1185,7 +1185,7 @@ void Cmd_Skin( void ){ char skinfile[1024]; if ( g_data.type == MD3_TYPE_BASE3DS ) { - GetToken( qfalse ); + GetToken( false ); sprintf( skinfile, "%s/%s", g_cddir, token ); @@ -1214,7 +1214,7 @@ void Cmd_Skin( void ){ */ void Cmd_SpriteShader(){ - GetToken( qfalse ); + GetToken( false ); strcpy( g_data.surfData[0].shaders[g_data.surfData[0].header.numShaders].name, token ); g_data.surfData[0].header.numShaders++; g_data.model.numSkins++; @@ -1229,13 +1229,13 @@ void Cmd_Origin( void ){ // rotate points into frame of reference so model points down the // positive x axis // FIXME: use alias native coordinate system - GetToken( qfalse ); + GetToken( false ); g_data.adjust[1] = -atof( token ); - GetToken( qfalse ); + GetToken( false ); g_data.adjust[0] = atof( token ); - GetToken( qfalse ); + GetToken( false ); g_data.adjust[2] = -atof( token ); } @@ -1246,7 +1246,7 @@ void Cmd_Origin( void ){ ================= */ void Cmd_ScaleUp( void ){ - GetToken( qfalse ); + GetToken( false ); g_data.scale_up = atof( token ); if ( g_skipmodel || g_release || g_archive ) { return; @@ -1265,9 +1265,9 @@ void Cmd_ScaleUp( void ){ ================= */ void Cmd_Skinsize( void ){ - GetToken( qfalse ); + GetToken( false ); g_data.fixedwidth = atoi( token ); - GetToken( qfalse ); + GetToken( false ); g_data.fixedheight = atoi( token ); } @@ -1282,7 +1282,7 @@ void Cmd_Modelname( void ){ FinishModel( TYPE_UNKNOWN ); ClearModel(); - GetToken( qfalse ); + GetToken( false ); strcpy( g_modelname, token ); path_set_extension( g_modelname, ".md3" ); strcpy( g_data.model.name, g_modelname ); @@ -1298,7 +1298,7 @@ void Cmd_Cd( void ){ Error( "$cd command without a $modelname" ); } - GetToken( qfalse ); + GetToken( false ); sprintf( g_cddir, "%s%s", gamedir, token ); @@ -1309,7 +1309,7 @@ void Cmd_Cd( void ){ return; } if ( strncmp( token, g_only, strlen( g_only ) ) ) { - g_skipmodel = qtrue; + g_skipmodel = true; printf( "skipping %s\n", token ); } } @@ -1334,7 +1334,7 @@ void Cmd_3DSConvert(){ FinishModel( TYPE_UNKNOWN ); ClearModel(); - GetToken( qfalse ); + GetToken( false ); sprintf( file, "%s%s", gamedir, token ); strcpy( g_modelname, token ); @@ -1345,26 +1345,26 @@ void Cmd_3DSConvert(){ } if ( TokenAvailable() ) { - GetToken( qfalse ); + GetToken( false ); g_data.scale_up = atof( token ); } Convert3DStoMD3( file ); } -static void ConvertASE( const char *filename, int type, qboolean grabAnims ); +static void ConvertASE( const char *filename, int type, bool grabAnims ); /* ** Cmd_ASEConvert */ -void Cmd_ASEConvert( qboolean grabAnims ){ +void Cmd_ASEConvert( bool grabAnims ){ char filename[1024]; int type = TYPE_ITEM; FinishModel( TYPE_UNKNOWN ); ClearModel(); - GetToken( qfalse ); + GetToken( false ); sprintf( filename, "%s%s", gamedir, token ); strcpy( g_modelname, token ); @@ -1379,31 +1379,31 @@ void Cmd_ASEConvert( qboolean grabAnims ){ while ( TokenAvailable() ) { - GetToken( qfalse ); + GetToken( false ); if ( !strcmp( token, "-origin" ) ) { if ( !TokenAvailable() ) { Error( "missing parameter for -origin" ); } - GetToken( qfalse ); + GetToken( false ); g_data.aseAdjust[1] = -atof( token ); if ( !TokenAvailable() ) { Error( "missing parameter for -origin" ); } - GetToken( qfalse ); + GetToken( false ); g_data.aseAdjust[0] = atof( token ); if ( !TokenAvailable() ) { Error( "missing parameter for -origin" ); } - GetToken( qfalse ); + GetToken( false ); g_data.aseAdjust[2] = -atof( token ); } else if ( !strcmp( token, "-lod" ) ) { if ( !TokenAvailable() ) { Error( "No parameter for -lod" ); } - GetToken( qfalse ); + GetToken( false ); g_data.currentLod = atoi( token ); if ( g_data.currentLod > MD3_MAX_LODS - 1 ) { Error( "-lod parameter too large! (%d)\n", g_data.currentLod ); @@ -1412,35 +1412,35 @@ void Cmd_ASEConvert( qboolean grabAnims ){ if ( !TokenAvailable() ) { Error( "No second parameter for -lod" ); } - GetToken( qfalse ); + GetToken( false ); g_data.lodBias = atof( token ); } else if ( !strcmp( token, "-maxtris" ) ) { if ( !TokenAvailable() ) { Error( "No parameter for -maxtris" ); } - GetToken( qfalse ); + GetToken( false ); g_data.maxSurfaceTris = atoi( token ); } else if ( !strcmp( token, "-playerparms" ) ) { if ( !TokenAvailable() ) { Error( "missing skip start parameter for -playerparms" ); } - GetToken( qfalse ); + GetToken( false ); g_data.lowerSkipFrameStart = atoi( token ); #if 0 if ( !TokenAvailable() ) { Error( "missing skip end parameter for -playerparms" ); } - GetToken( qfalse ); + GetToken( false ); g_data.lowerSkipFrameEnd = atoi( token ); #endif if ( !TokenAvailable() ) { Error( "missing upper parameter for -playerparms" ); } - GetToken( qfalse ); + GetToken( false ); g_data.maxUpperFrames = atoi( token ); g_data.lowerSkipFrameEnd = g_data.maxUpperFrames - 1; @@ -1449,7 +1449,7 @@ void Cmd_ASEConvert( qboolean grabAnims ){ if ( !TokenAvailable() ) { Error( "missing head parameter for -playerparms" ); } - GetToken( qfalse ); + GetToken( false ); g_data.maxHeadFrames = atoi( token ); #endif g_data.maxHeadFrames = 1; @@ -1479,8 +1479,8 @@ void Cmd_ASEConvert( qboolean grabAnims ){ } if ( type == TYPE_WEAPON ) { - ConvertASE( filename, type, qfalse ); - ConvertASE( filename, TYPE_HAND, qtrue ); + ConvertASE( filename, type, false ); + ConvertASE( filename, TYPE_HAND, true ); } else { @@ -1620,7 +1620,7 @@ static void BuildAnimationFromOAFs( const char *filename, ObjectAnimationFrame_t for ( f = 0; f < numFrames; f++ ) { ObjectAnimationFrame_t *pOAF = &oanims[f]; - qboolean parentTagExists = qfalse; + bool parentTagExists = false; md3Tag_t tagParent; int numtags = 0; md3Frame_t *fr; @@ -1684,7 +1684,7 @@ static void BuildAnimationFromOAFs( const char *filename, ObjectAnimationFrame_t MD3_ComputeTagFromTri( &tagParent, tri ); strcpy( tagParent.name, "tag_parent" ); g_data.tags[f][numtags] = tagParent; - parentTagExists = qtrue; + parentTagExists = true; } else { @@ -1808,7 +1808,7 @@ static void BuildAnimationFromOAFs( const char *filename, ObjectAnimationFrame_t ClearModel(); } -static void ConvertASE( const char *filename, int type, qboolean grabAnims ){ +static void ConvertASE( const char *filename, int type, bool grabAnims ){ int i, j; int numSurfaces; int numFrames = -1; @@ -1855,9 +1855,9 @@ static void ConvertASE( const char *filename, int type, qboolean grabAnims ){ } } else if ( type == TYPE_PLAYER ) { - qboolean tagTorso = qfalse; - qboolean tagHead = qfalse; - qboolean tagWeapon = qfalse; + bool tagTorso = false; + bool tagHead = false; + bool tagWeapon = false; // // verify that all necessary tags exist @@ -1866,13 +1866,13 @@ static void ConvertASE( const char *filename, int type, qboolean grabAnims ){ for ( i = 0; i < numSurfaces; i++ ) { if ( !strcmp( ASE_GetSurfaceName( i ), "tag_head" ) ) { - tagHead = qtrue; + tagHead = true; } if ( !strcmp( ASE_GetSurfaceName( i ), "tag_torso" ) ) { - tagTorso = qtrue; + tagTorso = true; } if ( !strcmp( ASE_GetSurfaceName( i ), "tag_weapon" ) ) { - tagWeapon = qtrue; + tagWeapon = true; } } diff --git a/tools/quake3/q3data/q3data.c b/tools/quake3/q3data/q3data.c index 370546b6..42ef09d4 100644 --- a/tools/quake3/q3data/q3data.c +++ b/tools/quake3/q3data/q3data.c @@ -24,13 +24,13 @@ #include "vfs.h" -qboolean g_verbose; -qboolean g_stripify = qtrue; -qboolean g_release; // don't grab, copy output data to new tree +bool g_verbose; +bool g_stripify = true; +bool g_release; // don't grab, copy output data to new tree char g_releasedir[1024]; // c:\quake2\baseq2, etc -qboolean g_archive; // don't grab, copy source data to new tree +bool g_archive; // don't grab, copy source data to new tree char g_only[256]; // if set, only grab this cd -qboolean g_skipmodel; // set true when a cd is not g_only +bool g_skipmodel; // set true when a cd is not g_only // bogus externs for some TA hacks (common/ using them against q3map) char *moddir = NULL; @@ -279,7 +279,7 @@ void ReleaseShader( char *filename ){ =============== */ void Cmd_File( void ){ - GetToken( qfalse ); + GetToken( false ); ReleaseFile( token ); } @@ -381,7 +381,7 @@ void PackDirectory_r( char *dir ){ =============== */ void Cmd_Dir( void ){ - GetToken( qfalse ); + GetToken( false ); PackDirectory_r( token ); } @@ -425,7 +425,7 @@ void Cmd_Maps( void ){ while ( TokenAvailable() ) { - GetToken( qfalse ); + GetToken( false ); sprintf( map, "maps/%s.bsp", token ); ReleaseFile( map ); @@ -452,7 +452,7 @@ void ParseScript( void ){ { do { // look for a line starting with a $ command - GetToken( qtrue ); + GetToken( true ); if ( endofscript ) { return; } @@ -460,7 +460,7 @@ void ParseScript( void ){ break; } while ( TokenAvailable() ) - GetToken( qfalse ); + GetToken( false ); } while ( 1 ); // @@ -500,10 +500,10 @@ void ParseScript( void ){ Cmd_SpriteShader(); } else if ( !strcmp( token, "$aseconvert" ) ) { - Cmd_ASEConvert( qfalse ); + Cmd_ASEConvert( false ); } else if ( !strcmp( token, "$aseanimconvert" ) ) { - Cmd_ASEConvert( qtrue ); + Cmd_ASEConvert( true ); } // @@ -568,19 +568,19 @@ int main( int argc, char **argv ){ for ( i = 1 ; i < argc ; i++ ) { if ( !strcmp( argv[i], "-archive" ) ) { - archive = qtrue; + archive = true; strcpy( archivedir, argv[i + 1] ); printf( "Archiving source to: %s\n", archivedir ); i++; } else if ( !strcmp( argv[i], "-release" ) ) { - g_release = qtrue; + g_release = true; strcpy( g_releasedir, argv[i + 1] ); printf( "Copy output to: %s\n", g_releasedir ); i++; } else if ( !strcmp( argv[i], "-nostrips" ) ) { - g_stripify = qfalse; + g_stripify = false; printf( "Not optimizing for strips\n" ); } else if ( !strcmp( argv[i], "-writedir" ) ) { @@ -589,7 +589,7 @@ int main( int argc, char **argv ){ i++; } else if ( !strcmp( argv[i], "-verbose" ) ) { - g_verbose = qtrue; + g_verbose = true; } else if ( !strcmp( argv[i], "-dump" ) ) { printf( "Dumping contents of: '%s'\n", argv[i + 1] ); diff --git a/tools/quake3/q3data/q3data.h b/tools/quake3/q3data/q3data.h index d852369a..51ed42ec 100644 --- a/tools/quake3/q3data/q3data.h +++ b/tools/quake3/q3data/q3data.h @@ -42,7 +42,7 @@ #include "aselib.h" #include "md3lib.h" -void Cmd_ASEConvert( qboolean grabAnims ); +void Cmd_ASEConvert( bool grabAnims ); void Cmd_3DSConvert( void ); void Cmd_Modelname( void ); void Cmd_SpriteBase( void ); @@ -82,13 +82,13 @@ void OrderMesh( int input[][3], int output[][3], int numTris ); extern byte *byteimage, *lbmpalette; extern int byteimagewidth, byteimageheight; -extern qboolean g_release; // don't grab, copy output data to new tree +extern bool g_release; // don't grab, copy output data to new tree extern char g_releasedir[1024]; // c:\quake2\baseq2, etc -extern qboolean g_archive; // don't grab, copy source data to new tree -extern qboolean do3ds; +extern bool g_archive; // don't grab, copy source data to new tree +extern bool do3ds; extern char g_only[256]; // if set, only grab this cd -extern qboolean g_skipmodel; // set true when a cd is not g_only -extern qboolean g_verbose; +extern bool g_skipmodel; // set true when a cd is not g_only +extern bool g_verbose; extern char *trifileext; diff --git a/tools/quake3/q3data/video.c b/tools/quake3/q3data/video.c index b3a94070..b548804c 100644 --- a/tools/quake3/q3data/video.c +++ b/tools/quake3/q3data/video.c @@ -910,7 +910,7 @@ void Cmd_Video( void ){ unsigned long *compressed; clock_t start, stop; - GetToken( qfalse ); + GetToken( false ); strcpy( s_base, token ); if ( g_release ) { // sprintf (savename, "video/%s.cin", token); @@ -918,13 +918,13 @@ void Cmd_Video( void ){ return; } - GetToken( qfalse ); + GetToken( false ); strcpy( s_output_base, token ); - GetToken( qfalse ); + GetToken( false ); digits = atoi( token ); - GetToken( qfalse ); + GetToken( false ); if ( !strcmp( token, "btc" ) ) { s_compression_method = BTC_COMPRESSION; @@ -939,10 +939,10 @@ void Cmd_Video( void ){ Error( "Uknown compression method '%s'\n", token ); } - GetToken( qfalse ); + GetToken( false ); s_resample_width = atoi( token ); - GetToken( qfalse ); + GetToken( false ); s_resample_height = atoi( token ); resampled = malloc( sizeof( unsigned char ) * 4 * s_resample_width * s_resample_height ); @@ -953,7 +953,7 @@ void Cmd_Video( void ){ // optionally skip frames if ( TokenAvailable() ) { - GetToken( qfalse ); + GetToken( false ); startframe = atoi( token ); } else{ diff --git a/tools/quake3/q3map2/autopk3.c b/tools/quake3/q3map2/autopk3.c index e8c98980..8e96489e 100644 --- a/tools/quake3/q3map2/autopk3.c +++ b/tools/quake3/q3map2/autopk3.c @@ -114,12 +114,12 @@ static inline void res2list( StrList* list, const char* res ){ } static inline void parseEXblock( StrList* list, const char *exName ){ - if ( !GetToken( qtrue ) || strcmp( token, "{" ) ) { + if ( !GetToken( true ) || strcmp( token, "{" ) ) { Error( "ReadExclusionsFile: %s, line %d: { not found", exName, scriptline ); } while ( 1 ) { - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -154,7 +154,7 @@ static void parseEXfile( const char* filename, StrList* ExTextures, StrList* ExS while ( 1 ) { /* test for end of file */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } @@ -218,22 +218,22 @@ static inline void StrBuf_cpy( StrBuf* buf, const char* string ){ -static qboolean packResource( const char* resname, const char* packname, const int compLevel ){ - const qboolean ret = vfsPackFile( resname, packname, compLevel ); +static bool packResource( const char* resname, const char* packname, const int compLevel ){ + const bool ret = vfsPackFile( resname, packname, compLevel ); if ( ret ) Sys_Printf( "++%s\n", resname ); return ret; } -static qboolean packTexture( const char* texname, const char* packname, const int compLevel, const qboolean png ){ +static bool packTexture( const char* texname, const char* packname, const int compLevel, const bool png ){ const char* extensions[4] = { ".png", ".tga", ".jpg", 0 }; for ( const char** ext = extensions + !png; *ext; ++ext ){ char str[MAX_QPATH * 2]; sprintf( str, "%s%s", texname, *ext ); if( packResource( str, packname, compLevel ) ){ - return qtrue; + return true; } } - return qfalse; + return false; } @@ -248,15 +248,15 @@ char g_q3map2path[1024]; int pk3BSPMain( int argc, char **argv ){ int i, compLevel = 10; - qboolean dbg = qfalse, png = qfalse, packFAIL = qfalse; + bool dbg = false, png = false, packFAIL = false; /* process arguments */ for ( i = 1; i < ( argc - 1 ); ++i ){ if ( !strcmp( argv[ i ], "-dbg" ) ) { - dbg = qtrue; + dbg = true; } else if ( !strcmp( argv[ i ], "-png" ) ) { - png = qtrue; + png = true; } else if ( !strcmp( argv[ i ], "-complevel" ) ) { compLevel = atoi( argv[ i + 1 ] ); @@ -282,13 +282,13 @@ int pk3BSPMain( int argc, char **argv ){ /* extract map name */ ExtractFileBase( source, nameOFmap ); - qboolean drawsurfSHs[numBSPShaders]; + bool drawsurfSHs[numBSPShaders]; memset( drawsurfSHs, 0, sizeof( drawsurfSHs ) ); for ( i = 0; i < numBSPDrawSurfaces; ++i ){ /* can't exclude nodraw patches here (they want shaders :0!) */ - //if ( !( bspDrawSurfaces[i].surfaceType == 2 && bspDrawSurfaces[i].numIndexes == 0 ) ) drawsurfSHs[bspDrawSurfaces[i].shaderNum] = qtrue; - drawsurfSHs[ bspDrawSurfaces[i].shaderNum ] = qtrue; + //if ( !( bspDrawSurfaces[i].surfaceType == 2 && bspDrawSurfaces[i].numIndexes == 0 ) ) drawsurfSHs[bspDrawSurfaces[i].shaderNum] = true; + drawsurfSHs[ bspDrawSurfaces[i].shaderNum ] = true; //Sys_Printf( "%s\n", bspShaders[bspDrawSurfaces[i].shaderNum].shader ); } @@ -418,10 +418,10 @@ int pk3BSPMain( int argc, char **argv ){ //Parse Shader Files /* hack */ - endofscript = qtrue; + endofscript = true; for ( i = 0; i < pk3Shaderfiles->n; ++i ){ - qboolean wantShader = qfalse, wantShaderFile = qfalse, ShaderFileExcluded = qfalse; + bool wantShader = false, wantShaderFile = false, ShaderFileExcluded = false; int shader, found; char* reasonShader = NULL; char* reasonShaderFile = NULL; @@ -435,7 +435,7 @@ int pk3BSPMain( int argc, char **argv ){ /* do wanna le shader file? */ if( ( found = StrList_find( ExShaderfiles, pk3Shaderfiles->s[i] ) ) ){ - ShaderFileExcluded = qtrue; + ShaderFileExcluded = true; reasonShaderFile = ExShaderfiles->s[found - 1]; } /* tokenize it */ @@ -443,24 +443,24 @@ int pk3BSPMain( int argc, char **argv ){ while ( !ShaderFileExcluded ) { /* test for end of file */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } /* does it contain restricted shaders/textures? */ if( ( found = StrList_find( ExShaders, token ) ) ){ - ShaderFileExcluded = qtrue; + ShaderFileExcluded = true; reasonShader = ExShaders->s[found - 1]; break; } else if( ( found = StrList_find( ExPureTextures, token ) ) ){ - ShaderFileExcluded = qtrue; + ShaderFileExcluded = true; reasonShader = ExPureTextures->s[found - 1]; break; } /* handle { } section */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( strcmp( token, "{" ) ) { @@ -471,7 +471,7 @@ int pk3BSPMain( int argc, char **argv ){ while ( 1 ) { /* get the next token */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -481,7 +481,7 @@ int pk3BSPMain( int argc, char **argv ){ if ( !strcmp( token, "{" ) ) { while ( 1 ) { - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -497,21 +497,21 @@ int pk3BSPMain( int argc, char **argv ){ while ( 1 ) { /* test for end of file */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } //dump shader names if( dbg ) Sys_Printf( "%s\n", token ); /* do wanna le shader? */ - wantShader = qfalse; + wantShader = false; if( ( found = StrList_find( pk3Shaders, token ) ) ){ shader = found - 1; - wantShader = qtrue; + wantShader = true; } /* handle { } section */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( strcmp( token, "{" ) ) { @@ -519,11 +519,11 @@ int pk3BSPMain( int argc, char **argv ){ scriptFile, scriptline, token, g_strLoadedFileLocation ); } - qboolean hasmap = qfalse; + bool hasmap = false; while ( 1 ) { /* get the next token */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -539,7 +539,7 @@ int pk3BSPMain( int argc, char **argv ){ if ( !strcmp( token, "{" ) ) { while ( 1 ) { - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -558,25 +558,25 @@ int pk3BSPMain( int argc, char **argv ){ /* digest any images */ if ( !Q_stricmp( token, "map" ) || !Q_stricmp( token, "clampMap" ) ) { - hasmap = qtrue; + hasmap = true; /* get an image */ - GetToken( qfalse ); + GetToken( false ); if ( token[ 0 ] != '*' && token[ 0 ] != '$' ) { tex2list( pk3Textures, ExTextures, NULL ); } } else if ( !Q_stricmp( token, "animMap" ) || !Q_stricmp( token, "clampAnimMap" ) ) { - hasmap = qtrue; - GetToken( qfalse );// skip num + hasmap = true; + GetToken( false );// skip num while ( TokenAvailable() ){ - GetToken( qfalse ); + GetToken( false ); tex2list( pk3Textures, ExTextures, NULL ); } } else if ( !Q_stricmp( token, "videoMap" ) ){ - hasmap = qtrue; - GetToken( qfalse ); + hasmap = true; + GetToken( false ); FixDOSName( token ); if ( strchr( token, '/' ) == NULL ){ sprintf( str, "video/%s", token ); @@ -601,18 +601,18 @@ int pk3BSPMain( int argc, char **argv ){ /* match surfaceparm */ else if ( !Q_stricmp( token, "surfaceparm" ) ) { - GetToken( qfalse ); + GetToken( false ); if ( !Q_stricmp( token, "nodraw" ) ) { - wantShader = qfalse; + wantShader = false; pk3Shaders->s[shader][0] = '\0'; } } /* skyparms */ else if ( !Q_stricmp( token, "skyParms" ) ) { - hasmap = qtrue; + hasmap = true; /* get image base */ - GetToken( qfalse ); + GetToken( false ); /* ignore bogus paths */ if ( Q_stricmp( token, "-" ) && Q_stricmp( token, "full" ) ) { @@ -624,22 +624,22 @@ int pk3BSPMain( int argc, char **argv ){ } } /* skip rest of line */ - GetToken( qfalse ); - GetToken( qfalse ); + GetToken( false ); + GetToken( false ); } else if ( !Q_stricmp( token, "fogparms" ) ){ - hasmap = qtrue; + hasmap = true; } } //exclude shader if ( wantShader ){ if( StrList_find( ExShaders, pk3Shaders->s[shader] ) ){ - wantShader = qfalse; + wantShader = false; pk3Shaders->s[shader][0] = '\0'; } if ( !hasmap ){ - wantShader = qfalse; + wantShader = false; } if ( wantShader ){ if ( ShaderFileExcluded ){ @@ -652,7 +652,7 @@ int pk3BSPMain( int argc, char **argv ){ ExReasonShader[ shader ] = reasonShader; } else{ - wantShaderFile = qtrue; + wantShaderFile = true; pk3Shaders->s[shader][0] = '\0'; } } @@ -671,7 +671,7 @@ int pk3BSPMain( int argc, char **argv ){ for ( i = 0; i < pk3Shaders->n; ++i ){ if ( pk3Shaders->s[i][0] != '\0' && ( ExReasonShader[i] != NULL || ExReasonShaderFile[i] != NULL ) ){ Sys_FPrintf( SYS_WRN, " !FAIL! %s\n", pk3Shaders->s[i] ); - packFAIL = qtrue; + packFAIL = true; if ( ExReasonShader[i] != NULL ){ Sys_Printf( " reason: is located in %s,\n containing restricted shader %s\n", ExReasonShaderFile[i], ExReasonShader[i] ); } @@ -711,7 +711,7 @@ int pk3BSPMain( int argc, char **argv ){ for ( i = 0; i < pk3Textures->n; ++i ){ if( !packTexture( pk3Textures->s[i], packname, compLevel, png ) ){ Sys_FPrintf( SYS_WRN, " !FAIL! %s\n", pk3Textures->s[i] ); - packFAIL = qtrue; + packFAIL = true; } } @@ -725,7 +725,7 @@ int pk3BSPMain( int argc, char **argv ){ } else{ Sys_FPrintf( SYS_WRN, " !FAIL! %s\n", pk3Shaders->s[i] ); - packFAIL = qtrue; + packFAIL = true; } } } @@ -738,7 +738,7 @@ int pk3BSPMain( int argc, char **argv ){ sprintf( str, "%s/%s", game->shaderPath, pk3Shaderfiles->s[i] ); if ( !packResource( str, packname, compLevel ) ){ Sys_FPrintf( SYS_WRN, " !FAIL! %s\n", pk3Shaders->s[i] ); - packFAIL = qtrue; + packFAIL = true; } } } @@ -749,7 +749,7 @@ int pk3BSPMain( int argc, char **argv ){ if ( pk3Sounds->s[i][0] != '\0' ){ if ( !packResource( pk3Sounds->s[i], packname, compLevel ) ){ Sys_FPrintf( SYS_WRN, " !FAIL! %s\n", pk3Sounds->s[i] ); - packFAIL = qtrue; + packFAIL = true; } } } @@ -759,7 +759,7 @@ int pk3BSPMain( int argc, char **argv ){ for ( i = 0; i < pk3Videos->n; ++i ){ if ( !packResource( pk3Videos->s[i], packname, compLevel ) ){ Sys_FPrintf( SYS_WRN, " !FAIL! %s\n", pk3Videos->s[i] ); - packFAIL = qtrue; + packFAIL = true; } } @@ -772,7 +772,7 @@ int pk3BSPMain( int argc, char **argv ){ } else{ Sys_FPrintf( SYS_WRN, " !FAIL! %s\n", str ); - packFAIL = qtrue; + packFAIL = true; } sprintf( str, "maps/%s.aas", nameOFmap ); @@ -807,16 +807,16 @@ int pk3BSPMain( int argc, char **argv ){ int repackBSPMain( int argc, char **argv ){ int i, j, compLevel = 0; - qboolean dbg = qfalse, png = qfalse; + bool dbg = false, png = false; char str[ 1024 ]; /* process arguments */ for ( i = 1; i < ( argc - 1 ); ++i ){ if ( !strcmp( argv[ i ], "-dbg" ) ) { - dbg = qtrue; + dbg = true; } else if ( !strcmp( argv[ i ], "-png" ) ) { - png = qtrue; + png = true; } else if ( !strcmp( argv[ i ], "-complevel" ) ) { compLevel = atoi( argv[ i + 1 ] ); @@ -922,7 +922,7 @@ int repackBSPMain( int argc, char **argv ){ while ( 1 ) { /* test for end of file */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if( bspListSize == bspListN ) @@ -964,11 +964,11 @@ int repackBSPMain( int argc, char **argv ){ char nameOFmap[ 1024 ]; ExtractFileBase( source, nameOFmap ); - qboolean drawsurfSHs[numBSPShaders]; + bool drawsurfSHs[numBSPShaders]; memset( drawsurfSHs, 0, sizeof( drawsurfSHs ) ); for ( i = 0; i < numBSPDrawSurfaces; ++i ){ - drawsurfSHs[ bspDrawSurfaces[i].shaderNum ] = qtrue; + drawsurfSHs[ bspDrawSurfaces[i].shaderNum ] = true; } for ( i = 0; i < numBSPShaders; ++i ){ @@ -1187,10 +1187,10 @@ int repackBSPMain( int argc, char **argv ){ StrBuf* shaderText = StrBuf_allocate( 8192 ); StrBuf* allShaders = StrBuf_allocate( 16777216 ); /* hack */ - endofscript = qtrue; + endofscript = true; for ( i = 0; i < pk3Shaderfiles->n; ++i ){ - qboolean wantShader = qfalse; + bool wantShader = false; int shader, found; /* load the shader */ @@ -1205,7 +1205,7 @@ int repackBSPMain( int argc, char **argv ){ { int line = scriptline; /* test for end of file */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } //dump shader names @@ -1219,17 +1219,17 @@ int repackBSPMain( int argc, char **argv ){ } /* do wanna le shader? */ - wantShader = qfalse; + wantShader = false; if( ( found = StrList_find( pk3Shaders, token ) ) ){ shader = found - 1; - wantShader = qtrue; + wantShader = true; if( StrList_find( rExTextures, token ) ) Sys_FPrintf( SYS_WRN, "WARNING3: %s : about to include shader for excluded texture\n", token ); } /* handle { } section */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( strcmp( token, "{" ) ) { @@ -1237,13 +1237,13 @@ int repackBSPMain( int argc, char **argv ){ scriptFile, scriptline, token, g_strLoadedFileLocation ); } StrBuf_cat( shaderText, "\n{" ); - qboolean hasmap = qfalse; + bool hasmap = false; while ( 1 ) { line = scriptline; /* get the next token */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -1252,16 +1252,16 @@ int repackBSPMain( int argc, char **argv ){ } /* parse stage directives */ if ( !strcmp( token, "{" ) ) { - qboolean tokenready = qfalse; + bool tokenready = false; StrBuf_cat( shaderText, "\n\t{" ); while ( 1 ) { /* detour of TokenAvailable() '~' */ if ( tokenready ) - tokenready = qfalse; + tokenready = false; else line = scriptline; - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -1280,10 +1280,10 @@ int repackBSPMain( int argc, char **argv ){ if ( !Q_stricmp( token, "map" ) || !Q_stricmp( token, "clampMap" ) ) { StrBuf_cat2( shaderText, "\n\t\t", token ); - hasmap = qtrue; + hasmap = true; /* get an image */ - GetToken( qfalse ); + GetToken( false ); if ( token[ 0 ] != '*' && token[ 0 ] != '$' ) { tex2list( pk3Textures, ExTextures, rExTextures ); } @@ -1292,21 +1292,21 @@ int repackBSPMain( int argc, char **argv ){ else if ( !Q_stricmp( token, "animMap" ) || !Q_stricmp( token, "clampAnimMap" ) ) { StrBuf_cat2( shaderText, "\n\t\t", token ); - hasmap = qtrue; + hasmap = true; - GetToken( qfalse );// skip num + GetToken( false );// skip num StrBuf_cat2( shaderText, " ", token ); while ( TokenAvailable() ){ - GetToken( qfalse ); + GetToken( false ); tex2list( pk3Textures, ExTextures, rExTextures ); StrBuf_cat2( shaderText, " ", token ); } - tokenready = qtrue; + tokenready = true; } else if ( !Q_stricmp( token, "videoMap" ) ){ StrBuf_cat2( shaderText, "\n\t\t", token ); - hasmap = qtrue; - GetToken( qfalse ); + hasmap = true; + GetToken( false ); StrBuf_cat2( shaderText, " ", token ); FixDOSName( token ); if ( strchr( token, '/' ) == NULL ){ @@ -1320,7 +1320,7 @@ int repackBSPMain( int argc, char **argv ){ } else if ( !Q_stricmp( token, "mapComp" ) || !Q_stricmp( token, "mapNoComp" ) || !Q_stricmp( token, "animmapcomp" ) || !Q_stricmp( token, "animmapnocomp" ) ){ Sys_FPrintf( SYS_WRN, "WARNING7: %s : %s shader\n", pk3Shaders->s[shader], token ); - hasmap = qtrue; + hasmap = true; if ( line == scriptline ){ StrBuf_cat2( shaderText, " ", token ); } @@ -1347,10 +1347,10 @@ int repackBSPMain( int argc, char **argv ){ /* match surfaceparm */ else if ( !Q_stricmp( token, "surfaceparm" ) ) { StrBuf_cat( shaderText, "\n\tsurfaceparm " ); - GetToken( qfalse ); + GetToken( false ); StrBuf_cat( shaderText, token ); if ( !Q_stricmp( token, "nodraw" ) ) { - wantShader = qfalse; + wantShader = false; pk3Shaders->s[shader][0] = '\0'; } } @@ -1358,9 +1358,9 @@ int repackBSPMain( int argc, char **argv ){ /* skyparms */ else if ( !Q_stricmp( token, "skyParms" ) ) { StrBuf_cat( shaderText, "\n\tskyParms " ); - hasmap = qtrue; + hasmap = true; /* get image base */ - GetToken( qfalse ); + GetToken( false ); StrBuf_cat( shaderText, token ); /* ignore bogus paths */ @@ -1373,14 +1373,14 @@ int repackBSPMain( int argc, char **argv ){ } } /* skip rest of line */ - GetToken( qfalse ); + GetToken( false ); StrBuf_cat2( shaderText, " ", token ); - GetToken( qfalse ); + GetToken( false ); StrBuf_cat2( shaderText, " ", token ); } else if ( !Q_strncasecmp( token, "implicit", 8 ) ){ Sys_FPrintf( SYS_WRN, "WARNING5: %s : %s shader\n", pk3Shaders->s[shader], token ); - hasmap = qtrue; + hasmap = true; if ( line == scriptline ){ StrBuf_cat2( shaderText, " ", token ); } @@ -1389,7 +1389,7 @@ int repackBSPMain( int argc, char **argv ){ } } else if ( !Q_stricmp( token, "fogparms" ) ){ - hasmap = qtrue; + hasmap = true; if ( line == scriptline ){ StrBuf_cat2( shaderText, " ", token ); } @@ -1408,12 +1408,12 @@ int repackBSPMain( int argc, char **argv ){ //exclude shader if ( wantShader ){ if( StrList_find( ExShaders, pk3Shaders->s[shader] ) ){ - wantShader = qfalse; + wantShader = false; pk3Shaders->s[shader][0] = '\0'; } if ( wantShader && !hasmap ){ Sys_FPrintf( SYS_WRN, "WARNING8: %s : shader has no known maps\n", pk3Shaders->s[shader] ); - wantShader = qfalse; + wantShader = false; pk3Shaders->s[shader][0] = '\0'; } if ( wantShader ){ diff --git a/tools/quake3/q3map2/brush.c b/tools/quake3/q3map2/brush.c index a5c948f3..f4e7ee48 100644 --- a/tools/quake3/q3map2/brush.c +++ b/tools/quake3/q3map2/brush.c @@ -179,7 +179,7 @@ brush_t *CopyBrush( const brush_t *brush ){ returns false if the brush doesn't enclose a valid volume */ -qboolean BoundBrush( brush_t *brush ){ +bool BoundBrush( brush_t *brush ){ int i, j; winding_t *w; @@ -198,11 +198,11 @@ qboolean BoundBrush( brush_t *brush ){ for ( i = 0; i < 3; i++ ) { if ( brush->mins[ i ] < MIN_WORLD_COORD || brush->maxs[ i ] > MAX_WORLD_COORD || brush->mins[i] >= brush->maxs[ i ] ) { - return qfalse; + return false; } } - return qtrue; + return true; } @@ -307,13 +307,13 @@ void SnapWeldVectorAccu( vec3_accu_t a, vec3_accu_t b, vec3_accu_t out ){ /* FixWinding() - ydnar removes degenerate edges from a winding - returns qtrue if the winding is valid + returns true if the winding is valid */ #define DEGENERATE_EPSILON 0.1 -qboolean FixWinding( winding_t *w ){ - qboolean valid = qtrue; +bool FixWinding( winding_t *w ){ + bool valid = true; int i, j, k; vec3_t vec; float dist; @@ -321,7 +321,7 @@ qboolean FixWinding( winding_t *w ){ /* dummy check */ if ( !w ) { - return qfalse; + return false; } /* check all verts */ @@ -339,7 +339,7 @@ qboolean FixWinding( winding_t *w ){ VectorSubtract( w->p[ i ], w->p[ j ], vec ); dist = VectorLength( vec ); if ( dist < DEGENERATE_EPSILON ) { - valid = qfalse; + valid = false; //Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: Degenerate winding edge found, fixing...\n" ); /* create an average point (ydnar 2002-01-26: using nearest-integer weld preference) */ @@ -359,7 +359,7 @@ qboolean FixWinding( winding_t *w ){ /* one last check and return */ if ( w->numpoints < 3 ) { - valid = qfalse; + valid = false; } return valid; } @@ -369,8 +369,8 @@ qboolean FixWinding( winding_t *w ){ FixWindingAccu Removes degenerate edges (edges that are too short) from a winding. - Returns qtrue if the winding has been altered by this function. - Returns qfalse if the winding is untouched by this function. + Returns true if the winding has been altered by this function. + Returns false if the winding is untouched by this function. It's advised that you check the winding after this function exits to make sure it still has at least 3 points. If that is not the case, the winding @@ -378,24 +378,24 @@ qboolean FixWinding( winding_t *w ){ if the some of the winding's points are close together. ================== */ -qboolean FixWindingAccu( winding_accu_t *w ){ +bool FixWindingAccu( winding_accu_t *w ){ int i, j, k; vec3_accu_t vec; vec_accu_t dist; - qboolean done, altered; + bool done, altered; if ( w == NULL ) { Error( "FixWindingAccu: NULL argument" ); } - altered = qfalse; + altered = false; - while ( qtrue ) + while ( true ) { if ( w->numpoints < 2 ) { break; // Don't remove the only remaining point. } - done = qtrue; + done = true; for ( i = 0; i < w->numpoints; i++ ) { j = ( ( ( i + 1 ) == w->numpoints ) ? 0 : ( i + 1 ) ); @@ -415,14 +415,14 @@ qboolean FixWindingAccu( winding_accu_t *w ){ VectorCopyAccu( w->p[k], w->p[k - 1] ); } w->numpoints--; - altered = qtrue; + altered = true; // The only way to finish off fixing the winding consistently and // accurately is by fixing the winding all over again. For example, // the point at index i and the point at index i-1 could now be // less than the epsilon distance apart. There are too many special // case problems we'd need to handle if we didn't start from the // beginning. - done = qfalse; + done = false; break; // This will cause us to return to the "while" loop. } } @@ -441,7 +441,7 @@ qboolean FixWindingAccu( winding_accu_t *w ){ returns false if the brush doesn't enclose a valid volume */ -qboolean CreateBrushWindings( brush_t *brush ){ +bool CreateBrushWindings( brush_t *brush ){ int i, j; #if Q3MAP2_EXPERIMENTAL_HIGH_PRECISION_MATH_FIXES winding_accu_t *w; @@ -679,12 +679,12 @@ int FilterBrushIntoTree_r( brush_t *b, node_t *node ){ /* classify the leaf by the structural brush */ if ( !b->detail ) { if ( b->opaque ) { - node->opaque = qtrue; - node->areaportal = qfalse; + node->opaque = true; + node->areaportal = false; } else if ( b->compileFlags & C_AREAPORTAL ) { if ( !node->opaque ) { - node->areaportal = qtrue; + node->areaportal = true; } } } @@ -739,7 +739,7 @@ void FilterDetailBrushesIntoTree( entity_t *e, tree_t *tree ){ for ( i = 0; i < b->numsides; i++ ) { if ( b->sides[ i ].winding ) { - b->sides[ i ].visible = qtrue; + b->sides[ i ].visible = true; } } } @@ -780,7 +780,7 @@ void FilterStructuralBrushesIntoTree( entity_t *e, tree_t *tree ) { if ( r ) { for ( i = 0 ; i < b->numsides ; i++ ) { if ( b->sides[i].winding ) { - b->sides[i].visible = qtrue; + b->sides[i].visible = true; } } } @@ -823,11 +823,11 @@ node_t *AllocNode( void ){ ================ */ #define EDGE_LENGTH 0.2 -qboolean WindingIsTiny( winding_t *w ){ +bool WindingIsTiny( winding_t *w ){ /* if (WindingArea (w) < 1) - return qtrue; - return qfalse; + return true; + return false; */ int i, j; vec_t len; @@ -842,11 +842,11 @@ qboolean WindingIsTiny( winding_t *w ){ len = VectorLength( delta ); if ( len > EDGE_LENGTH ) { if ( ++edges == 3 ) { - return qfalse; + return false; } } } - return qtrue; + return true; } /* @@ -857,17 +857,17 @@ qboolean WindingIsTiny( winding_t *w ){ from basewinding for plane ================ */ -qboolean WindingIsHuge( winding_t *w ){ +bool WindingIsHuge( winding_t *w ){ int i, j; for ( i = 0 ; i < w->numpoints ; i++ ) { for ( j = 0 ; j < 3 ; j++ ) if ( w->p[i][j] <= MIN_WORLD_COORD || w->p[i][j] >= MAX_WORLD_COORD ) { - return qtrue; + return true; } } - return qfalse; + return false; } //============================================================ diff --git a/tools/quake3/q3map2/bsp.c b/tools/quake3/q3map2/bsp.c index 27874172..d7c30d8a 100644 --- a/tools/quake3/q3map2/bsp.c +++ b/tools/quake3/q3map2/bsp.c @@ -38,7 +38,7 @@ -qboolean g_autocaulk = qfalse; +static bool g_autocaulk = false; static void autocaulk_write(){ char filename[1024]; @@ -320,7 +320,7 @@ void ProcessWorldModel( void ){ entity_t *e; tree_t *tree; face_t *faces; - qboolean ignoreLeaks, leaked; + bool ignoreLeaks, leaked; xmlNodePtr polyline, leaknode; char level[ 2 ], shader[ 1024 ]; const char *value; @@ -351,12 +351,7 @@ void ProcessWorldModel( void ){ if ( value[ 0 ] == '\0' ) { value = ValueForKey( &entities[ 0 ], "ignoreleaks" ); } - if ( value[ 0 ] == '1' ) { - ignoreLeaks = qtrue; - } - else{ - ignoreLeaks = qfalse; - } + ignoreLeaks = ( value[ 0 ] == '1' ); /* begin worldspawn model */ BeginModel(); @@ -387,13 +382,8 @@ void ProcessWorldModel( void ){ } } - if ( leakStatus == FLOODENTITIES_GOOD ) { - leaked = qfalse; - } - else - { - leaked = qtrue; - + leaked = ( leakStatus != FLOODENTITIES_GOOD ); + if( leaked ){ Sys_FPrintf( SYS_NOXMLflag | SYS_ERR, "**********************\n" ); Sys_FPrintf( SYS_NOXMLflag | SYS_ERR, "******* leaked *******\n" ); Sys_FPrintf( SYS_NOXMLflag | SYS_ERR, "**********************\n" ); @@ -425,7 +415,7 @@ void ProcessWorldModel( void ){ MakeTreePortals( tree ); FilterStructuralBrushesIntoTree( e, tree ); - if( g_autocaulk == qtrue ){ + if( g_autocaulk ){ autocaulk_write(); exit( 0 ); } @@ -654,7 +644,7 @@ void ProcessSubModel( void ){ */ void ProcessModels( void ){ - qboolean oldVerbose; + bool oldVerbose; entity_t *entity; @@ -734,7 +724,7 @@ void OnlyEnts( void ){ numEntities = 0; LoadShaderInfo(); - LoadMapFile( name, qfalse, qfalse ); + LoadMapFile( name, false, false ); SetModelNumbers(); SetLightStyles(); @@ -764,7 +754,7 @@ void OnlyEnts( void ){ int BSPMain( int argc, char **argv ){ int i; char path[ 1024 ], tempSource[ 1024 ]; - qboolean onlyents = qfalse; + bool onlyents = false; if ( argc >= 2 && !strcmp( argv[ 1 ], "-bsp" ) ) { Sys_Printf( "-bsp argument unnecessary\n" ); @@ -775,7 +765,7 @@ int BSPMain( int argc, char **argv ){ /* note it */ Sys_Printf( "--- BSP ---\n" ); - doingBSP = qtrue; + doingBSP = true; SetDrawSurfacesBuffer(); mapDrawSurfs = safe_calloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS ); numMapDrawSurfs = 0; @@ -795,7 +785,7 @@ int BSPMain( int argc, char **argv ){ { if ( !strcmp( argv[ i ], "-onlyents" ) ) { Sys_Printf( "Running entity-only compile\n" ); - onlyents = qtrue; + onlyents = true; } else if ( !strcmp( argv[ i ], "-tempname" ) ) { strcpy( tempSource, argv[ ++i ] ); @@ -805,47 +795,47 @@ int BSPMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-nowater" ) ) { Sys_Printf( "Disabling water\n" ); - nowater = qtrue; + nowater = true; } else if ( !strcmp( argv[ i ], "-keeplights" ) ) { - keepLights = qtrue; + keepLights = true; Sys_Printf( "Leaving light entities on map after compile\n" ); } else if ( !strcmp( argv[ i ], "-nodetail" ) ) { Sys_Printf( "Ignoring detail brushes\n" ) ; - nodetail = qtrue; + nodetail = true; } else if ( !strcmp( argv[ i ], "-fulldetail" ) ) { Sys_Printf( "Turning detail brushes into structural brushes\n" ); - fulldetail = qtrue; + fulldetail = true; } else if ( !strcmp( argv[ i ], "-nofog" ) ) { Sys_Printf( "Fog volumes disabled\n" ); - nofog = qtrue; + nofog = true; } else if ( !strcmp( argv[ i ], "-nosubdivide" ) ) { Sys_Printf( "Disabling brush face subdivision\n" ); - nosubdivide = qtrue; + nosubdivide = true; } else if ( !strcmp( argv[ i ], "-leaktest" ) ) { Sys_Printf( "Leaktest enabled\n" ); - leaktest = qtrue; + leaktest = true; } else if ( !strcmp( argv[ i ], "-verboseentities" ) ) { Sys_Printf( "Verbose entities enabled\n" ); - verboseEntities = qtrue; + verboseEntities = true; } else if ( !strcmp( argv[ i ], "-nocurves" ) ) { Sys_Printf( "Ignoring curved surfaces (patches)\n" ); - noCurveBrushes = qtrue; + noCurveBrushes = true; } else if ( !strcmp( argv[ i ], "-notjunc" ) ) { Sys_Printf( "T-junction fixing disabled\n" ); - notjunc = qtrue; + notjunc = true; } else if ( !strcmp( argv[ i ], "-fakemap" ) ) { Sys_Printf( "Generating fakemap.map\n" ); - fakemap = qtrue; + fakemap = true; } else if ( !strcmp( argv[ i ], "-samplesize" ) ) { sampleSize = atoi( argv[ i + 1 ] ); @@ -865,13 +855,13 @@ int BSPMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-custinfoparms" ) ) { Sys_Printf( "Custom info parms enabled\n" ); - useCustomInfoParms = qtrue; + useCustomInfoParms = true; } /* sof2 args */ else if ( !strcmp( argv[ i ], "-rename" ) ) { Sys_Printf( "Appending _bsp suffix to misc_model shaders (SOF2)\n" ); - renameModelShaders = qtrue; + renameModelShaders = true; } /* ydnar args */ @@ -934,11 +924,11 @@ int BSPMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-nohint" ) ) { Sys_Printf( "Hint brushes disabled\n" ); - noHint = qtrue; + noHint = true; } else if ( !strcmp( argv[ i ], "-flat" ) ) { Sys_Printf( "Flatshading enabled\n" ); - flat = qtrue; + flat = true; } else if ( !strcmp( argv[ i ], "-celshader" ) ) { ++i; @@ -952,7 +942,7 @@ int BSPMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-meta" ) ) { Sys_Printf( "Creating meta surfaces from brush faces\n" ); - meta = qtrue; + meta = true; } else if ( !strcmp( argv[ i ], "-metaadequatescore" ) ) { metaAdequateScore = atoi( argv[ i + 1 ] ); @@ -986,35 +976,35 @@ int BSPMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-patchmeta" ) ) { Sys_Printf( "Creating meta surfaces from patches\n" ); - patchMeta = qtrue; + patchMeta = true; } else if ( !strcmp( argv[ i ], "-flares" ) ) { Sys_Printf( "Flare surfaces enabled\n" ); - emitFlares = qtrue; + emitFlares = true; } else if ( !strcmp( argv[ i ], "-noflares" ) ) { Sys_Printf( "Flare surfaces disabled\n" ); - emitFlares = qfalse; + emitFlares = false; } else if ( !strcmp( argv[ i ], "-skyfix" ) ) { Sys_Printf( "GL_CLAMP sky fix/hack/workaround enabled\n" ); - skyFixHack = qtrue; + skyFixHack = true; } else if ( !strcmp( argv[ i ], "-debugsurfaces" ) ) { Sys_Printf( "emitting debug surfaces\n" ); - debugSurfaces = qtrue; + debugSurfaces = true; } else if ( !strcmp( argv[ i ], "-debuginset" ) ) { Sys_Printf( "Debug surface triangle insetting enabled\n" ); - debugInset = qtrue; + debugInset = true; } else if ( !strcmp( argv[ i ], "-debugportals" ) ) { Sys_Printf( "Debug portal surfaces enabled\n" ); - debugPortals = qtrue; + debugPortals = true; } else if ( !strcmp( argv[ i ], "-debugclip" ) ) { Sys_Printf( "Debug model clip enabled\n" ); - debugClip = qtrue; + debugClip = true; } else if ( !strcmp( argv[ i ], "-clipdepth" ) ) { clipDepthGlobal = atof( argv[ i + 1 ] ); @@ -1022,46 +1012,46 @@ int BSPMain( int argc, char **argv ){ Sys_Printf( "Model autoclip thickness set to %.3f\n", clipDepthGlobal ); } else if ( !strcmp( argv[ i ], "-sRGBtex" ) ) { - texturesRGB = qtrue; + texturesRGB = true; Sys_Printf( "Textures are in sRGB\n" ); } else if ( !strcmp( argv[ i ], "-nosRGBtex" ) ) { - texturesRGB = qfalse; + texturesRGB = false; Sys_Printf( "Textures are linear\n" ); } else if ( !strcmp( argv[ i ], "-sRGBcolor" ) ) { - colorsRGB = qtrue; + colorsRGB = true; Sys_Printf( "Colors are in sRGB\n" ); } else if ( !strcmp( argv[ i ], "-nosRGBcolor" ) ) { - colorsRGB = qfalse; + colorsRGB = false; Sys_Printf( "Colors are linear\n" ); } else if ( !strcmp( argv[ i ], "-nosRGB" ) ) { - texturesRGB = qfalse; + texturesRGB = false; Sys_Printf( "Textures are linear\n" ); - colorsRGB = qfalse; + colorsRGB = false; Sys_Printf( "Colors are linear\n" ); } else if ( !strcmp( argv[ i ], "-altsplit" ) ) { Sys_Printf( "Alternate BSP splitting (by 27) enabled\n" ); - bspAlternateSplitWeights = qtrue; + bspAlternateSplitWeights = true; } else if ( !strcmp( argv[ i ], "-deep" ) ) { Sys_Printf( "Deep BSP tree generation enabled\n" ); - deepBSP = qtrue; + deepBSP = true; } else if ( !strcmp( argv[ i ], "-maxarea" ) ) { Sys_Printf( "Max Area face surface generation enabled\n" ); - maxAreaFaceSurface = qtrue; + maxAreaFaceSurface = true; } else if ( !strcmp( argv[ i ], "-noob" ) ) { Sys_Printf( "No oBs!\n" ); - noob = qtrue; + noob = true; } else if ( !strcmp( argv[ i ], "-autocaulk" ) ) { Sys_Printf( "\trunning in autocaulk mode\n" ); - g_autocaulk = qtrue; + g_autocaulk = true; } else { @@ -1109,10 +1099,10 @@ int BSPMain( int argc, char **argv ){ /* load original file from temp spot in case it was renamed by the editor on the way in */ if ( strlen( tempSource ) > 0 ) { - LoadMapFile( tempSource, qfalse, g_autocaulk ); + LoadMapFile( tempSource, false, g_autocaulk ); } else{ - LoadMapFile( name, qfalse, g_autocaulk ); + LoadMapFile( name, false, g_autocaulk ); } /* div0: inject command line parameters */ @@ -1134,7 +1124,7 @@ int BSPMain( int argc, char **argv ){ ProcessAdvertisements(); /* finish and write bsp */ - EndBSPFile( qtrue ); + EndBSPFile( true ); /* remove temp map source file if appropriate */ if ( strlen( tempSource ) > 0 ) { diff --git a/tools/quake3/q3map2/bspfile_abstract.c b/tools/quake3/q3map2/bspfile_abstract.c index 9677c23d..b732f853 100644 --- a/tools/quake3/q3map2/bspfile_abstract.c +++ b/tools/quake3/q3map2/bspfile_abstract.c @@ -527,7 +527,7 @@ epair_t *ParseEPair( void ){ } e->key = copystring( token ); - GetToken( qfalse ); + GetToken( false ); /* handle value */ if ( strlen( token ) >= MAX_VALUE - 1 ) { @@ -550,13 +550,13 @@ epair_t *ParseEPair( void ){ parses an entity's epairs */ -qboolean ParseEntity( void ){ +bool ParseEntity( void ){ epair_t *e; /* dummy check */ - if ( !GetToken( qtrue ) ) { - return qfalse; + if ( !GetToken( true ) ) { + return false; } if ( strcmp( token, "{" ) ) { Error( "ParseEntity: { not found" ); @@ -571,7 +571,7 @@ qboolean ParseEntity( void ){ /* parse */ while ( 1 ) { - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { Error( "ParseEntity: EOF without closing brace" ); } if ( !EPAIR_STRCMP( token, "}" ) ) { @@ -583,7 +583,7 @@ qboolean ParseEntity( void ){ } /* return to sender */ - return qtrue; + return true; } @@ -777,19 +777,19 @@ void SetKeyValue( entity_t *ent, const char *key, const char *value ){ returns true if entity has this key */ -qboolean KeyExists( const entity_t *ent, const char *key ){ +bool KeyExists( const entity_t *ent, const char *key ){ epair_t *ep; /* walk epair list */ for ( ep = ent->epairs; ep != NULL; ep = ep->next ) { if ( !EPAIR_STRCMP( ep->key, key ) ) { - return qtrue; + return true; } } /* no match */ - return qfalse; + return false; } /* diff --git a/tools/quake3/q3map2/bspfile_ibsp.c b/tools/quake3/q3map2/bspfile_ibsp.c index e3b40dea..febabace 100644 --- a/tools/quake3/q3map2/bspfile_ibsp.c +++ b/tools/quake3/q3map2/bspfile_ibsp.c @@ -452,10 +452,10 @@ void LoadIBSPFile( const char *filename ){ SwapBlock( (int*) ( (byte*) header + sizeof( int ) ), sizeof( *header ) - sizeof( int ) ); /* make sure it matches the format we're trying to load */ - if ( force == qfalse && *( (int*) header->ident ) != *( (int*) game->bspIdent ) ) { + if ( !force && *( (int*) header->ident ) != *( (int*) game->bspIdent ) ) { Error( "%s is not a %s file", filename, game->bspIdent ); } - if ( force == qfalse && header->version != game->bspVersion ) { + if ( !force && header->version != game->bspVersion ) { Error( "%s is version %d, not %d", filename, header->version, game->bspVersion ); } @@ -524,10 +524,10 @@ void PartialLoadIBSPFile( const char *filename ){ SwapBlock( (int*) ( (byte*) header + sizeof( int ) ), sizeof( *header ) - sizeof( int ) ); /* make sure it matches the format we're trying to load */ - if ( force == qfalse && *( (int*) header->ident ) != *( (int*) game->bspIdent ) ) { + if ( !force && *( (int*) header->ident ) != *( (int*) game->bspIdent ) ) { Error( "%s is not a %s file", filename, game->bspIdent ); } - if ( force == qfalse && header->version != game->bspVersion ) { + if ( !force && header->version != game->bspVersion ) { Error( "%s is version %d, not %d", filename, header->version, game->bspVersion ); } diff --git a/tools/quake3/q3map2/bspfile_rbsp.c b/tools/quake3/q3map2/bspfile_rbsp.c index 096e6771..d38b1542 100644 --- a/tools/quake3/q3map2/bspfile_rbsp.c +++ b/tools/quake3/q3map2/bspfile_rbsp.c @@ -117,7 +117,7 @@ static void AddLightGridLumps( FILE *file, rbspHeader_t *header ){ bspGridPoint_t *gridPoints, *in, *out; int numGridArray; unsigned short *gridArray; - qboolean bad; + bool bad; /* allocate temporary buffers */ @@ -158,14 +158,14 @@ static void AddLightGridLumps( FILE *file, rbspHeader_t *header ){ } /* compare light */ - bad = qfalse; - for ( k = 0; ( k < MAX_LIGHTMAPS && bad == qfalse ); k++ ) + bad = false; + for ( k = 0; ( k < MAX_LIGHTMAPS && !bad ); k++ ) { for ( c = 0; c < 3; c++ ) { if ( abs( (int) in->ambient[ k ][ c ] - (int) out->ambient[ k ][ c ] ) > LG_EPSILON || abs( (int) in->directed[ k ][ c ] - (int) out->directed[ k ][ c ] ) > LG_EPSILON ) { - bad = qtrue; + bad = true; break; } } @@ -221,10 +221,10 @@ void LoadRBSPFile( const char *filename ){ SwapBlock( (int*) ( (byte*) header + sizeof( int ) ), sizeof( *header ) - sizeof( int ) ); /* make sure it matches the format we're trying to load */ - if ( force == qfalse && *( (int*) header->ident ) != *( (int*) game->bspIdent ) ) { + if ( !force && *( (int*) header->ident ) != *( (int*) game->bspIdent ) ) { Error( "%s is not a %s file", filename, game->bspIdent ); } - if ( force == qfalse && header->version != game->bspVersion ) { + if ( !force && header->version != game->bspVersion ) { Error( "%s is version %d, not %d", filename, header->version, game->bspVersion ); } diff --git a/tools/quake3/q3map2/convert_bsp.c b/tools/quake3/q3map2/convert_bsp.c index b7acdba9..c1f38d3b 100644 --- a/tools/quake3/q3map2/convert_bsp.c +++ b/tools/quake3/q3map2/convert_bsp.c @@ -128,7 +128,7 @@ int AnalyzeBSP( int argc, char **argv ){ void *lump; float lumpFloat; char lumpString[ 1024 ], source[ 1024 ]; - qboolean lumpSwap = qfalse; + bool lumpSwap = false; abspLumpTest_t *lumpTest; static abspLumpTest_t lumpTests[] = { @@ -161,7 +161,7 @@ int AnalyzeBSP( int argc, char **argv ){ /* -format map|ase|... */ if ( !strcmp( argv[ i ], "-lumpswap" ) ) { Sys_Printf( "Swapped lump structs enabled\n" ); - lumpSwap = qtrue; + lumpSwap = true; } } @@ -282,7 +282,7 @@ int BSPInfo( int count, char **fileNames ){ } /* enable info mode */ - infoMode = qtrue; + infoMode = true; /* walk file list */ for ( i = 0; i < count; i++ ) @@ -399,7 +399,7 @@ int ScaleBSPMain( int argc, char **argv ){ vec3_t vec; char str[ 1024 ]; int uniform, axis; - qboolean texscale; + bool texscale; float *old_xyzst = NULL; float spawn_ref = 0; @@ -410,11 +410,11 @@ int ScaleBSPMain( int argc, char **argv ){ return 0; } - texscale = qfalse; + texscale = false; for ( i = 1; i < argc - 2; ++i ) { if ( !strcmp( argv[i], "-tex" ) ) { - texscale = qtrue; + texscale = true; } else if ( !strcmp( argv[i], "-spawn_ref" ) ) { spawn_ref = atof( argv[i + 1] ); @@ -811,7 +811,7 @@ int ShiftBSPMain( int argc, char **argv ){ PseudoCompileBSP() a stripped down ProcessModels */ -void PseudoCompileBSP( qboolean need_tree ){ +void PseudoCompileBSP( bool need_tree ){ int models; char modelValue[16]; entity_t *entity; @@ -898,7 +898,7 @@ void PseudoCompileBSP( qboolean need_tree ){ EmitBrushes( entity->brushes, &entity->firstBrush, &entity->numBrushes ); EndModel( entity, node ); } - EndBSPFile( qfalse ); + EndBSPFile( false ); } /* @@ -910,15 +910,15 @@ int ConvertBSPMain( int argc, char **argv ){ int i; int ( *convertFunc )( char * ); game_t *convertGame; - qboolean map_allowed, force_bsp, force_map; + bool map_allowed, force_bsp, force_map; /* set default */ convertFunc = ConvertBSPToASE; convertGame = NULL; - map_allowed = qfalse; - force_bsp = qfalse; - force_map = qfalse; + map_allowed = false; + force_bsp = false; + force_map = false; /* arg checking */ if ( argc < 2 ) { @@ -934,24 +934,24 @@ int ConvertBSPMain( int argc, char **argv ){ i++; if ( !Q_stricmp( argv[ i ], "ase" ) ) { convertFunc = ConvertBSPToASE; - map_allowed = qfalse; + map_allowed = false; } else if ( !Q_stricmp( argv[ i ], "obj" ) ) { convertFunc = ConvertBSPToOBJ; - map_allowed = qfalse; + map_allowed = false; } else if ( !Q_stricmp( argv[ i ], "map_bp" ) ) { convertFunc = ConvertBSPToMap_BP; - map_allowed = qtrue; + map_allowed = true; } else if ( !Q_stricmp( argv[ i ], "map" ) ) { convertFunc = ConvertBSPToMap; - map_allowed = qtrue; + map_allowed = true; } else { convertGame = GetGame( argv[ i ] ); - map_allowed = qfalse; + map_allowed = false; if ( convertGame == NULL ) { Sys_Printf( "Unknown conversion format \"%s\". Defaulting to ASE.\n", argv[ i ] ); } @@ -968,30 +968,30 @@ int ConvertBSPMain( int argc, char **argv ){ Sys_Printf( "Distance epsilon set to %f\n", distanceEpsilon ); } else if ( !strcmp( argv[ i ], "-shaderasbitmap" ) || !strcmp( argv[ i ], "-shadersasbitmap" ) ) { - shadersAsBitmap = qtrue; + shadersAsBitmap = true; } else if ( !strcmp( argv[ i ], "-lightmapastexcoord" ) || !strcmp( argv[ i ], "-lightmapsastexcoord" ) ) { - lightmapsAsTexcoord = qtrue; + lightmapsAsTexcoord = true; } else if ( !strcmp( argv[ i ], "-deluxemapastexcoord" ) || !strcmp( argv[ i ], "-deluxemapsastexcoord" ) ) { - lightmapsAsTexcoord = qtrue; - deluxemap = qtrue; + lightmapsAsTexcoord = true; + deluxemap = true; } else if ( !strcmp( argv[ i ], "-readbsp" ) ) { - force_bsp = qtrue; + force_bsp = true; } else if ( !strcmp( argv[ i ], "-readmap" ) ) { - force_map = qtrue; + force_map = true; } else if ( !strcmp( argv[ i ], "-meta" ) ) { - meta = qtrue; + meta = true; } else if ( !strcmp( argv[ i ], "-patchmeta" ) ) { - meta = qtrue; - patchMeta = qtrue; + meta = true; + patchMeta = true; } else if ( !strcmp( argv[ i ], "-fast" ) ) { - fast = qtrue; + fast = true; } } @@ -1001,7 +1001,7 @@ int ConvertBSPMain( int argc, char **argv ){ strcpy( source, ExpandArg( argv[i] ) ); if ( !map_allowed && !force_map ) { - force_bsp = qtrue; + force_bsp = true; } if ( force_map || ( !force_bsp && !Q_stricmp( path_get_extension( source ), "map" ) && map_allowed ) ) { @@ -1010,7 +1010,7 @@ int ConvertBSPMain( int argc, char **argv ){ } path_set_extension( source, ".map" ); Sys_Printf( "Loading %s\n", source ); - LoadMapFile( source, qfalse, convertGame == NULL ); + LoadMapFile( source, false, convertGame == NULL ); PseudoCompileBSP( convertGame != NULL ); } else diff --git a/tools/quake3/q3map2/convert_map.c b/tools/quake3/q3map2/convert_map.c index cdbb7560..7bc75b03 100644 --- a/tools/quake3/q3map2/convert_map.c +++ b/tools/quake3/q3map2/convert_map.c @@ -43,9 +43,6 @@ exports a map brush */ -#define SNAP_FLOAT_TO_INT 4 -#define SNAP_INT_TO_FLOAT ( 1.0 / SNAP_FLOAT_TO_INT ) - typedef vec_t vec2_t[2]; static vec_t Det3x3( vec_t a00, vec_t a01, vec_t a02, @@ -164,7 +161,7 @@ exwinding: } #define FRAC( x ) ( ( x ) - floor( x ) ) -static void ConvertOriginBrush( FILE *f, int num, vec3_t origin, qboolean brushPrimitives ){ +static void ConvertOriginBrush( FILE *f, int num, vec3_t origin, bool brushPrimitives ){ int originSize = 256; char pattern[6][7][3] = { @@ -224,7 +221,7 @@ static void ConvertOriginBrush( FILE *f, int num, vec3_t origin, qboolean brushP fprintf( f, "\t}\n\n" ); } -static void ConvertBrushFast( FILE *f, int num, bspBrush_t *brush, vec3_t origin, qboolean brushPrimitives ){ +static void ConvertBrushFast( FILE *f, int num, bspBrush_t *brush, vec3_t origin, bool brushPrimitives ){ int i; bspBrushSide_t *side; side_t *buildSide; @@ -245,11 +242,11 @@ static void ConvertBrushFast( FILE *f, int num, bspBrush_t *brush, vec3_t origin } buildBrush->numsides = 0; - qboolean modelclip = qfalse; + bool modelclip = false; /* try to guess if thats model clip */ if ( force ){ int notNoShader = 0; - modelclip = qtrue; + modelclip = true; for ( i = 0; i < brush->numSides; i++ ) { /* get side */ @@ -265,7 +262,7 @@ static void ConvertBrushFast( FILE *f, int num, bspBrush_t *brush, vec3_t origin notNoShader++; } if( notNoShader > 1 ){ - modelclip = qfalse; + modelclip = false; break; } } @@ -373,7 +370,7 @@ static void ConvertBrushFast( FILE *f, int num, bspBrush_t *brush, vec3_t origin fprintf( f, "\t}\n\n" ); } -static void ConvertBrush( FILE *f, int num, bspBrush_t *brush, vec3_t origin, qboolean brushPrimitives ){ +static void ConvertBrush( FILE *f, int num, bspBrush_t *brush, vec3_t origin, bool brushPrimitives ){ int i, j; bspBrushSide_t *side; side_t *buildSide; @@ -395,11 +392,11 @@ static void ConvertBrush( FILE *f, int num, bspBrush_t *brush, vec3_t origin, qb } buildBrush->numsides = 0; - qboolean modelclip = qfalse; + bool modelclip = false; /* try to guess if thats model clip */ if ( force ){ int notNoShader = 0; - modelclip = qtrue; + modelclip = true; for ( i = 0; i < brush->numSides; i++ ) { /* get side */ @@ -415,7 +412,7 @@ static void ConvertBrush( FILE *f, int num, bspBrush_t *brush, vec3_t origin, qb notNoShader++; } if( notNoShader > 1 ){ - modelclip = qfalse; + modelclip = false; break; } } @@ -907,7 +904,7 @@ static void ConvertPatch( FILE *f, int num, bspDrawSurface_t *ds, vec3_t origin exports a bsp model to a map file */ -static void ConvertModel( FILE *f, bspModel_t *model, int modelNum, vec3_t origin, qboolean brushPrimitives ){ +static void ConvertModel( FILE *f, bspModel_t *model, int modelNum, vec3_t origin, bool brushPrimitives ){ int i, num; bspBrush_t *brush; bspDrawSurface_t *ds; @@ -969,7 +966,7 @@ static void ConvertModel( FILE *f, bspModel_t *model, int modelNum, vec3_t origi exports entity key/value pairs to a map file */ -static void ConvertEPairs( FILE *f, entity_t *e, qboolean skip_origin ){ +static void ConvertEPairs( FILE *f, entity_t *e, bool skip_origin ){ epair_t *ep; @@ -1003,7 +1000,7 @@ static void ConvertEPairs( FILE *f, entity_t *e, qboolean skip_origin ){ exports an quake map file from the bsp */ -int ConvertBSPToMap_Ext( char *bspName, qboolean brushPrimitives ){ +int ConvertBSPToMap_Ext( char *bspName, bool brushPrimitives ){ int i, modelNum; FILE *f; bspModel_t *model; @@ -1089,9 +1086,9 @@ int ConvertBSPToMap_Ext( char *bspName, qboolean brushPrimitives ){ } int ConvertBSPToMap( char *bspName ){ - return ConvertBSPToMap_Ext( bspName, qfalse ); + return ConvertBSPToMap_Ext( bspName, false ); } int ConvertBSPToMap_BP( char *bspName ){ - return ConvertBSPToMap_Ext( bspName, qtrue ); + return ConvertBSPToMap_Ext( bspName, true ); } diff --git a/tools/quake3/q3map2/convert_obj.c b/tools/quake3/q3map2/convert_obj.c index 0c6aa6b9..c5f657d6 100644 --- a/tools/quake3/q3map2/convert_obj.c +++ b/tools/quake3/q3map2/convert_obj.c @@ -237,14 +237,14 @@ void Convert_ReferenceLightmaps( const char* base, int* lmIndices ){ while ( 1 ) { /* test for end of file */ - if ( !GetToken( qtrue ) ) + if ( !GetToken( true ) ) break; char shadername[256]; strcpy( shadername, token ); /* handle { } section */ - if ( !GetToken( qtrue ) ) + if ( !GetToken( true ) ) break; if ( strcmp( token, "{" ) ) Error( "ParseShaderFile: %s, line %d: { not found!\nFound instead: %s\nFile location be: %s", @@ -252,7 +252,7 @@ void Convert_ReferenceLightmaps( const char* base, int* lmIndices ){ while ( 1 ) { /* get the next token */ - if ( !GetToken( qtrue ) ) + if ( !GetToken( true ) ) break; if ( !strcmp( token, "}" ) ) break; @@ -260,7 +260,7 @@ void Convert_ReferenceLightmaps( const char* base, int* lmIndices ){ if ( !strcmp( token, "{" ) ) { while ( 1 ) { - if ( !GetToken( qtrue ) ) + if ( !GetToken( true ) ) break; if ( !strcmp( token, "}" ) ) break; @@ -270,7 +270,7 @@ void Convert_ReferenceLightmaps( const char* base, int* lmIndices ){ /* digest any images */ if ( !Q_stricmp( token, "map" ) ) { /* get an image */ - GetToken( qfalse ); + GetToken( false ); if ( *token != '*' && *token != '$' ) { // map maps/bake_test_1/lm_0004.tga int lmindex; diff --git a/tools/quake3/q3map2/decals.c b/tools/quake3/q3map2/decals.c index 07514910..c318088a 100644 --- a/tools/quake3/q3map2/decals.c +++ b/tools/quake3/q3map2/decals.c @@ -92,12 +92,12 @@ dvec_t DVectorNormalize( dvec3_t in, dvec3_t out ){ /* MakeTextureMatrix() generates a texture projection matrix for a triangle - returns qfalse if a texture matrix cannot be created + returns false if a texture matrix cannot be created */ #define Vector2Subtract( a,b,c ) ( ( c )[ 0 ] = ( a )[ 0 ] - ( b )[ 0 ], ( c )[ 1 ] = ( a )[ 1 ] - ( b )[ 1 ] ) -static qboolean MakeTextureMatrix( decalProjector_t *dp, vec4_t projection, bspDrawVert_t *a, bspDrawVert_t *b, bspDrawVert_t *c ){ +static bool MakeTextureMatrix( decalProjector_t *dp, vec4_t projection, bspDrawVert_t *a, bspDrawVert_t *b, bspDrawVert_t *c ){ int i, j; double bb, s, t, d; dvec3_t pa, pb, pc; @@ -121,7 +121,7 @@ static qboolean MakeTextureMatrix( decalProjector_t *dp, vec4_t projection, bspD /* calculate barycentric basis for the triangle */ bb = ( b->st[ 0 ] - a->st[ 0 ] ) * ( c->st[ 1 ] - a->st[ 1 ] ) - ( c->st[ 0 ] - a->st[ 0 ] ) * ( b->st[ 1 ] - a->st[ 1 ] ); if ( fabs( bb ) < 0.00000001 ) { - return qfalse; + return false; } /* calculate texture origin */ @@ -254,25 +254,25 @@ static qboolean MakeTextureMatrix( decalProjector_t *dp, vec4_t projection, bspD if ( fabs( s - a->st[ 0 ] ) > 0.01 || fabs( t - a->st[ 1 ] ) > 0.01 ) { Sys_Printf( "Bad texture matrix! (A) (%f, %f) != (%f, %f)\n", s, t, a->st[ 0 ], a->st[ 1 ] ); - //% return qfalse; + //% return false; } s = DotProduct( b->xyz, dp->texMat[ 0 ] ) + dp->texMat[ 0 ][ 3 ]; t = DotProduct( b->xyz, dp->texMat[ 1 ] ) + dp->texMat[ 1 ][ 3 ]; if ( fabs( s - b->st[ 0 ] ) > 0.01 || fabs( t - b->st[ 1 ] ) > 0.01 ) { Sys_Printf( "Bad texture matrix! (B) (%f, %f) != (%f, %f)\n", s, t, b->st[ 0 ], b->st[ 1 ] ); - //% return qfalse; + //% return false; } s = DotProduct( c->xyz, dp->texMat[ 0 ] ) + dp->texMat[ 0 ][ 3 ]; t = DotProduct( c->xyz, dp->texMat[ 1 ] ) + dp->texMat[ 1 ][ 3 ]; if ( fabs( s - c->st[ 0 ] ) > 0.01 || fabs( t - c->st[ 1 ] ) > 0.01 ) { Sys_Printf( "Bad texture matrix! (C) (%f, %f) != (%f, %f)\n", s, t, c->st[ 0 ], c->st[ 1 ] ); - //% return qfalse; + //% return false; } /* disco */ - return qtrue; + return true; } diff --git a/tools/quake3/q3map2/facebsp.c b/tools/quake3/q3map2/facebsp.c index 5cac9a4f..b5d42cfd 100644 --- a/tools/quake3/q3map2/facebsp.c +++ b/tools/quake3/q3map2/facebsp.c @@ -118,7 +118,7 @@ static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum, // div0: this check causes detail/structural mixes //for( split = list; split; split = split->next ) - // split->checked = qfalse; + // split->checked = false; for ( split = list; split; split = split->next ) { @@ -133,7 +133,7 @@ static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum, for ( check = list ; check ; check = check->next ) { if ( check->planenum == split->planenum ) { facing++; - //check->checked = qtrue; // won't need to test this plane again + //check->checked = true; // won't need to test this plane again continue; } side = WindingOnPlaneSide( check->w, plane->normal, plane->dist ); @@ -244,7 +244,7 @@ void BuildFaceTree_r( node_t *node, face_t *list ){ int i; int splitPlaneNum, compileFlags; #if 0 - qboolean isstruct = qfalse; + bool isstruct = false; #endif @@ -257,7 +257,7 @@ void BuildFaceTree_r( node_t *node, face_t *list ){ /* if we don't have any more faces, this is a node */ if ( splitPlaneNum == -1 ) { node->planenum = PLANENUM_LEAF; - node->has_structural_children = qfalse; + node->has_structural_children = false; c_faceLeafs++; return; } @@ -283,7 +283,7 @@ void BuildFaceTree_r( node_t *node, face_t *list ){ #if 0 if ( !( split->compileFlags & C_DETAIL ) ) { - isstruct = 1; + isstruct = true; } #endif diff --git a/tools/quake3/q3map2/fog.c b/tools/quake3/q3map2/fog.c index e8dcffac..5e77cf40 100644 --- a/tools/quake3/q3map2/fog.c +++ b/tools/quake3/q3map2/fog.c @@ -249,7 +249,7 @@ void SplitMeshByPlane( mesh_t *in, vec3_t normal, float dist, mesh_t **front, me chops a patch up by a fog brush */ -qboolean ChopPatchSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ){ +bool ChopPatchSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ){ int i, j; side_t *s; plane_t *plane; @@ -275,7 +275,7 @@ qboolean ChopPatchSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b for ( j = 0 ; j < numOutside ; j++ ) { FreeMesh( outside[j] ); } - return qfalse; + return false; } m = back; @@ -327,7 +327,7 @@ qboolean ChopPatchSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b /* free the source mesh and return */ FreeMesh( m ); - return qtrue; + return true; } @@ -355,7 +355,7 @@ winding_t *WindingFromDrawSurf( mapDrawSurface_t *ds ){ VectorCopy( ds->verts[i].xyz, p[i] ); } - xml_Winding( "WindingFromDrawSurf failed: MAX_POINTS_ON_WINDING exceeded", p, max, qtrue ); + xml_Winding( "WindingFromDrawSurf failed: MAX_POINTS_ON_WINDING exceeded", p, max, true ); } w = AllocWinding( ds->numVerts ); @@ -373,7 +373,7 @@ winding_t *WindingFromDrawSurf( mapDrawSurface_t *ds ){ chops up a face drawsurface by a fog brush, with a potential fragment left inside */ -qboolean ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ){ +bool ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ){ int i, j; side_t *s; plane_t *plane; @@ -386,7 +386,7 @@ qboolean ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ) /* dummy check */ if ( ds->sideRef == NULL || ds->sideRef->side == NULL ) { - return qfalse; + return false; } /* initial setup */ @@ -402,7 +402,7 @@ qboolean ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ) /* handle coplanar outfacing (don't fog) */ if ( ds->sideRef->side->planenum == s->planenum ) { - return qfalse; + return false; } /* handle coplanar infacing (keep inside) */ @@ -418,7 +418,7 @@ qboolean ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ) /* nothing actually contained inside */ for ( j = 0; j < numOutside; j++ ) FreeWinding( outside[ j ] ); - return qfalse; + return false; } if ( front != NULL ) { @@ -451,7 +451,7 @@ qboolean ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ) /* build a drawsurf for it */ newds = DrawSurfaceForSide( e, ds->mapBrush, s, w ); if ( newds == NULL ) { - return qfalse; + return false; } /* copy new to original */ @@ -462,7 +462,7 @@ qboolean ChopFaceSurfaceByBrush( entity_t *e, mapDrawSurface_t *ds, brush_t *b ) numMapDrawSurfs--; /* return ok */ - return qtrue; + return true; } @@ -588,7 +588,7 @@ void FogDrawSurfaces( entity_t *e ){ int FogForPoint( vec3_t point, float epsilon ){ int fogNum, i, j; float dot; - qboolean inside; + bool inside; brush_t *brush; plane_t *plane; @@ -609,14 +609,14 @@ int FogForPoint( vec3_t point, float epsilon ){ brush = mapFogs[ i ].brush; /* check point against all planes */ - inside = qtrue; + inside = true; for ( j = 0; j < brush->numsides && inside; j++ ) { plane = &mapplanes[ brush->sides[ j ].planenum ]; /* note usage of map planes here */ dot = DotProduct( point, plane->normal ); dot -= plane->dist; if ( dot > epsilon ) { - inside = qfalse; + inside = false; } } @@ -738,7 +738,7 @@ void CreateMapFogs( void ){ for ( brush = entity->brushes; brush != NULL; brush = brush->next ) { /* ignore non-fog brushes */ - if ( brush->contentShader->fogParms == qfalse ) { + if ( !brush->contentShader->fogParms ) { continue; } diff --git a/tools/quake3/q3map2/game__null.h b/tools/quake3/q3map2/game__null.h index 0fb21eb5..43c8d797 100644 --- a/tools/quake3/q3map2/game__null.h +++ b/tools/quake3/q3map2/game__null.h @@ -58,34 +58,34 @@ 0, /* max lightmapped surface verts */ 0, /* max surface verts */ 0, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ NULL, /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 0, /* lightmap width/height */ 0, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0, /* lightmap exposure */ 0, /* lightmap compensate */ 0, /* lightgrid scale */ 0, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 0, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 0, /* minimap size */ 0, /* minimap sharpener */ 0, /* minimap border */ - qfalse, /* minimap keep aspect */ + false, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ NULL, /* minimap name format */ NULL, /* bsp file prefix */ 0, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ NULL, /* bsp load function */ NULL, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_darkplaces.h b/tools/quake3/q3map2/game_darkplaces.h index b60e221f..7a8d03c0 100644 --- a/tools/quake3/q3map2/game_darkplaces.h +++ b/tools/quake3/q3map2/game_darkplaces.h @@ -49,34 +49,34 @@ 999, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 200.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 0.3f, /* lightgrid scale */ 0.6f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qtrue, /* disable shader lightstyles hack */ - qtrue, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + true, /* disable shader lightstyles hack */ + true, /* keep light entities on bsp */ 4, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_dq.h b/tools/quake3/q3map2/game_dq.h index ca249916..5576e790 100644 --- a/tools/quake3/q3map2/game_dq.h +++ b/tools/quake3/q3map2/game_dq.h @@ -49,34 +49,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.2f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 200.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 0.3f, /* lightgrid scale */ 0.6f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qtrue, /* disable shader lightstyles hack */ - qtrue, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + true, /* disable shader lightstyles hack */ + true, /* keep light entities on bsp */ 4, /* default patchMeta subdivisions tolerance */ - qtrue, /* patch casting enabled */ - qtrue, /* compile deluxemaps */ + true, /* patch casting enabled */ + true, /* compile deluxemaps */ 1, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_ef.h b/tools/quake3/q3map2/game_ef.h index a622557a..2f48c5d7 100644 --- a/tools/quake3/q3map2/game_ef.h +++ b/tools/quake3/q3map2/game_ef.h @@ -109,34 +109,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_etut.h b/tools/quake3/q3map2/game_etut.h index 9e80ae28..a725bf93 100644 --- a/tools/quake3/q3map2/game_etut.h +++ b/tools/quake3/q3map2/game_etut.h @@ -144,34 +144,34 @@ 1024, /* max lightmapped surface verts */ 1024, /* max surface verts */ 6144, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qtrue, /* lightmap sRGB */ - qfalse, /* texture sRGB (yes, this is incorrect, but we better match ET:UT) */ - qfalse, /* color sRGB */ + true, /* lightmap sRGB */ + false, /* texture sRGB (yes, this is incorrect, but we better match ET:UT) */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 47, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_ja.h b/tools/quake3/q3map2/game_ja.h index 787868a7..14539778 100644 --- a/tools/quake3/q3map2/game_ja.h +++ b/tools/quake3/q3map2/game_ja.h @@ -62,34 +62,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qtrue, /* flares */ + true, /* flares */ "gfx/misc/flare", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "RBSP", /* bsp file prefix */ 1, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadRBSPFile, /* bsp load function */ WriteRBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_jk2.h b/tools/quake3/q3map2/game_jk2.h index 7361c3dc..e24f7045 100644 --- a/tools/quake3/q3map2/game_jk2.h +++ b/tools/quake3/q3map2/game_jk2.h @@ -59,34 +59,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qtrue, /* flares */ + true, /* flares */ "gfx/misc/flare", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "RBSP", /* bsp file prefix */ 1, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadRBSPFile, /* bsp load function */ WriteRBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_nexuiz.h b/tools/quake3/q3map2/game_nexuiz.h index 75062ece..113fb370 100644 --- a/tools/quake3/q3map2/game_nexuiz.h +++ b/tools/quake3/q3map2/game_nexuiz.h @@ -58,34 +58,34 @@ 999, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qtrue, /* disable shader lightstyles hack */ - qtrue, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + true, /* disable shader lightstyles hack */ + true, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 1.0f / 66.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "../gfx/%s_mini.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_prophecy.h b/tools/quake3/q3map2/game_prophecy.h index 8986b953..4ffd1b25 100644 --- a/tools/quake3/q3map2/game_prophecy.h +++ b/tools/quake3/q3map2/game_prophecy.h @@ -49,34 +49,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 200.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 0.4f, /* lightgrid scale */ 0.6f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qtrue, /* disable shader lightstyles hack */ - qtrue, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + true, /* disable shader lightstyles hack */ + true, /* keep light entities on bsp */ 4, /* default patchMeta subdivisions tolerance */ - qtrue, /* patch casting enabled */ - qtrue, /* compile deluxemaps */ + true, /* patch casting enabled */ + true, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_qfusion.h b/tools/quake3/q3map2/game_qfusion.h index 87f2a43f..62e0756e 100644 --- a/tools/quake3/q3map2/game_qfusion.h +++ b/tools/quake3/q3map2/game_qfusion.h @@ -111,34 +111,34 @@ 65535, /* max lightmapped surface verts */ 65535, /* max surface verts */ 393210, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 512, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qtrue, /* lightmap sRGB */ - qtrue, /* texture sRGB */ - qtrue, /* color sRGB */ + true, /* lightmap sRGB */ + true, /* texture sRGB */ + true, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qtrue, /* light angle attenuation uses half-lambert curve */ - qtrue, /* disable shader lightstyles hack */ - qtrue, /* keep light entities on bsp */ + true, /* light angle attenuation uses half-lambert curve */ + true, /* disable shader lightstyles hack */ + true, /* keep light entities on bsp */ 4, /* default patchMeta subdivisions tolerance */ - qtrue, /* patch casting enabled */ - qtrue, /* compile deluxemaps */ + true, /* patch casting enabled */ + true, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 1.0f / 66.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "../minimaps/%s.tga", /* minimap name format */ "FBSP", /* bsp file prefix */ 1, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadRBSPFile, /* bsp load function */ WriteRBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_quake3.h b/tools/quake3/q3map2/game_quake3.h index 378521db..cefacef6 100644 --- a/tools/quake3/q3map2/game_quake3.h +++ b/tools/quake3/q3map2/game_quake3.h @@ -109,34 +109,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_quakelive.h b/tools/quake3/q3map2/game_quakelive.h index 05d15158..b59984cf 100644 --- a/tools/quake3/q3map2/game_quakelive.h +++ b/tools/quake3/q3map2/game_quakelive.h @@ -71,34 +71,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 47, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_reaction.h b/tools/quake3/q3map2/game_reaction.h index db3bd2d2..229a9c73 100644 --- a/tools/quake3/q3map2/game_reaction.h +++ b/tools/quake3/q3map2/game_reaction.h @@ -79,34 +79,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_sof2.h b/tools/quake3/q3map2/game_sof2.h index 9e1563cd..0299cbea 100644 --- a/tools/quake3/q3map2/game_sof2.h +++ b/tools/quake3/q3map2/game_sof2.h @@ -136,34 +136,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qtrue, /* flares */ + true, /* flares */ "gfx/misc/lens_flare", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "RBSP", /* bsp file prefix */ 1, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadRBSPFile, /* bsp load function */ WriteRBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_t.h b/tools/quake3/q3map2/game_t.h index 385afae0..1fc20e73 100644 --- a/tools/quake3/q3map2/game_t.h +++ b/tools/quake3/q3map2/game_t.h @@ -27,7 +27,7 @@ typedef struct game_s char *gamePath; /* main game data dir */ char *homeBasePath; /* home sub-dir on unix */ char *magic; /* magic word for figuring out base path */ - qboolean wolfLight; /* when true, lights work like wolf q3map */ - int bspVersion; /* BSP version to use */ + bool wolfLight; /* when true, lights work like wolf q3map */ + int bspVersion; /* BSP version to use */ } game_t; diff --git a/tools/quake3/q3map2/game_tenebrae.h b/tools/quake3/q3map2/game_tenebrae.h index 17901018..ca269331 100644 --- a/tools/quake3/q3map2/game_tenebrae.h +++ b/tools/quake3/q3map2/game_tenebrae.h @@ -108,34 +108,34 @@ 1024, /* max lightmapped surface verts */ 1024, /* max surface verts */ 6144, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 512, /* lightmap width/height */ 2.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qtrue, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + true, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qtrue, /* compile deluxemaps */ + false, /* patch casting enabled */ + true, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_tremulous.h b/tools/quake3/q3map2/game_tremulous.h index bd9b079b..50324303 100644 --- a/tools/quake3/q3map2/game_tremulous.h +++ b/tools/quake3/q3map2/game_tremulous.h @@ -65,34 +65,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_unvanquished.h b/tools/quake3/q3map2/game_unvanquished.h index 9f3d1ebb..200e803b 100644 --- a/tools/quake3/q3map2/game_unvanquished.h +++ b/tools/quake3/q3map2/game_unvanquished.h @@ -66,34 +66,34 @@ game_t struct 1048575, /* max lightmapped surface verts */ 1048575, /* max surface verts */ 1048575, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qtrue, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + true, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 1, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_WHITE, /* minimap mode */ "../minimaps/%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_wolf.h b/tools/quake3/q3map2/game_wolf.h index 1048bd1c..8e0e8fa7 100644 --- a/tools/quake3/q3map2/game_wolf.h +++ b/tools/quake3/q3map2/game_wolf.h @@ -125,34 +125,34 @@ 64, /* max lightmapped surface verts */ 999, /* max surface verts */ 6000, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qtrue, /* wolf lighting model? */ + true, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 47, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_wolfet.h b/tools/quake3/q3map2/game_wolfet.h index cfa03b05..f9389425 100644 --- a/tools/quake3/q3map2/game_wolfet.h +++ b/tools/quake3/q3map2/game_wolfet.h @@ -61,34 +61,34 @@ 1024, /* max lightmapped surface verts */ 1024, /* max surface verts */ 6144, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qtrue, /* wolf lighting model? */ + true, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qfalse, /* lightmap sRGB */ - qfalse, /* texture sRGB */ - qfalse, /* color sRGB */ + false, /* lightmap sRGB */ + false, /* texture sRGB */ + false, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qfalse, /* disable shader lightstyles hack */ - qfalse, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + false, /* disable shader lightstyles hack */ + false, /* keep light entities on bsp */ 8, /* default patchMeta subdivisions tolerance */ - qfalse, /* patch casting enabled */ - qfalse, /* compile deluxemaps */ + false, /* patch casting enabled */ + false, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 0.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "%s.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 47, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/game_xonotic.h b/tools/quake3/q3map2/game_xonotic.h index d1e3f63c..8daa1318 100644 --- a/tools/quake3/q3map2/game_xonotic.h +++ b/tools/quake3/q3map2/game_xonotic.h @@ -58,34 +58,34 @@ 1048575, /* max lightmapped surface verts */ 1048575, /* max surface verts */ 1048575, /* max surface indexes */ - qfalse, /* flares */ + false, /* flares */ "flareshader", /* default flare shader */ - qfalse, /* wolf lighting model? */ + false, /* wolf lighting model? */ 128, /* lightmap width/height */ 1.0f, /* lightmap gamma */ - qtrue, /* lightmap sRGB */ - qtrue, /* texture sRGB */ - qtrue, /* color sRGB */ + true, /* lightmap sRGB */ + true, /* texture sRGB */ + true, /* color sRGB */ 0.0f, /* lightmap exposure */ 1.0f, /* lightmap compensate */ 1.0f, /* lightgrid scale */ 1.0f, /* lightgrid ambient scale */ - qfalse, /* light angle attenuation uses half-lambert curve */ - qtrue, /* disable shader lightstyles hack */ - qtrue, /* keep light entities on bsp */ + false, /* light angle attenuation uses half-lambert curve */ + true, /* disable shader lightstyles hack */ + true, /* keep light entities on bsp */ 4, /* default patchMeta subdivisions tolerance */ - qtrue, /* patch casting enabled */ - qtrue, /* compile deluxemaps */ + true, /* patch casting enabled */ + true, /* compile deluxemaps */ 0, /* deluxemaps default mode */ 512, /* minimap size */ 1.0f, /* minimap sharpener */ 1.0f / 66.0f, /* minimap border */ - qtrue, /* minimap keep aspect */ + true, /* minimap keep aspect */ MINIMAP_MODE_GRAY, /* minimap mode */ "../gfx/%s_mini.tga", /* minimap name format */ "IBSP", /* bsp file prefix */ 46, /* bsp file version */ - qfalse, /* cod-style lump len/ofs order */ + false, /* cod-style lump len/ofs order */ LoadIBSPFile, /* bsp load function */ WriteIBSPFile, /* bsp write function */ diff --git a/tools/quake3/q3map2/image.c b/tools/quake3/q3map2/image.c index 792aeb4c..b5078544 100644 --- a/tools/quake3/q3map2/image.c +++ b/tools/quake3/q3map2/image.c @@ -319,7 +319,7 @@ image_t *ImageLoad( const char *filename ){ char name[ 1024 ]; int size; byte *buffer = NULL; - qboolean alphaHack = qfalse; + bool alphaHack = false; /* init */ @@ -380,7 +380,7 @@ image_t *ImageLoad( const char *filename ){ // On error, LoadJPGBuff might store a pointer to the error message in image->pixels Sys_Warning( "LoadJPGBuff %s %s\n", name, (unsigned char*) image->pixels ); } - alphaHack = qtrue; + alphaHack = true; } else { diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 1ebbbf3f..697dde3e 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -224,7 +224,7 @@ void CreateEntityLights( void ){ const char *_color; float intensity, scale, deviance, filterRadius; int spawnflags, flags, numSamples; - qboolean junior; + bool junior; /* go throught entity list and find lights */ @@ -236,10 +236,10 @@ void CreateEntityLights( void ){ /* ydnar: check for lightJunior */ if ( Q_strncasecmp( name, "lightJunior", 11 ) == 0 ) { - junior = qtrue; + junior = true; } else if ( Q_strncasecmp( name, "light", 5 ) == 0 ) { - junior = qfalse; + junior = false; } else{ continue; @@ -261,7 +261,7 @@ void CreateEntityLights( void ){ spawnflags = IntForKey( e, "spawnflags" ); /* ydnar: quake 3+ light behavior */ - if ( wolfLight == qfalse ) { + if ( !wolfLight ) { /* set default flags */ flags = LIGHT_Q3A_DEFAULT; @@ -775,9 +775,9 @@ int LightContributionToSample( trace_t *trace ){ float add; float dist; float addDeluxe = 0.0f, addDeluxeBounceScale = 0.25f; - qboolean angledDeluxe = qtrue; + bool angledDeluxe = true; float colorBrightness; - qboolean doAddDeluxe = qtrue; + bool doAddDeluxe = true; /* get light */ light = trace->light; @@ -798,7 +798,7 @@ int LightContributionToSample( trace_t *trace ){ /* do some culling checks */ if ( light->type != EMIT_SUN ) { /* MrE: if the light is behind the surface */ - if ( trace->twoSided == qfalse ) { + if ( !trace->twoSided ) { if ( DotProduct( light->origin, trace->normal ) - DotProduct( trace->origin, trace->normal ) < 0.0f ) { return 0; } @@ -856,7 +856,7 @@ int LightContributionToSample( trace_t *trace ){ angle = -angle; /* no deluxemap contribution from "other side" light */ - doAddDeluxe = qfalse; + doAddDeluxe = false; } /* attenuate */ @@ -869,7 +869,7 @@ int LightContributionToSample( trace_t *trace ){ angle = -angle; /* no deluxemap contribution from "other side" light */ - doAddDeluxe = qfalse; + doAddDeluxe = false; } /* clamp the distance to prevent super hot spots */ @@ -909,7 +909,7 @@ int LightContributionToSample( trace_t *trace ){ } /* no deluxemap contribution from "other side" light */ - doAddDeluxe = qfalse; + doAddDeluxe = false; } else{ return 0; @@ -919,7 +919,7 @@ int LightContributionToSample( trace_t *trace ){ /* also don't deluxe if the direction is on the wrong side */ if ( DotProduct( trace->normal, trace->direction ) < 0 ) { /* no deluxemap contribution from "other side" light */ - doAddDeluxe = qfalse; + doAddDeluxe = false; } /* ydnar: moved to here */ @@ -956,7 +956,7 @@ int LightContributionToSample( trace_t *trace ){ dot = -dot; /* no deluxemap contribution from "other side" light */ - doAddDeluxe = qfalse; + doAddDeluxe = false; } /* jal: optional half Lambert attenuation (http://developer.valvesoftware.com/wiki/Half_Lambert) */ @@ -1079,7 +1079,7 @@ int LightContributionToSample( trace_t *trace ){ dot = -dot; /* no deluxemap contribution from "other side" light */ - doAddDeluxe = qfalse; + doAddDeluxe = false; } /* jal: optional half Lambert attenuation (http://developer.valvesoftware.com/wiki/Half_Lambert) */ @@ -1137,7 +1137,7 @@ int LightContributionToSample( trace_t *trace ){ VectorScale( trace->direction, addDeluxe, trace->directionContribution ); /* setup trace */ - trace->testAll = qtrue; + trace->testAll = true; VectorScale( light->color, add, trace->color ); /* trace to point */ @@ -1195,7 +1195,7 @@ int LightContributionToSample( trace_t *trace ){ } /* setup trace */ - trace->testAll = qfalse; + trace->testAll = false; VectorScale( light->color, add, trace->color ); /* raytrace */ @@ -1295,7 +1295,7 @@ void LightingAtSample( trace_t *trace, byte styles[ MAX_LIGHTMAPS ], vec3_t colo note: this is similar to LightContributionToSample() but optimized for omnidirectional sampling */ -int LightContributionToPoint( trace_t *trace ){ +bool LightContributionToPoint( trace_t *trace ){ light_t *light; float add, dist; @@ -1308,19 +1308,19 @@ int LightContributionToPoint( trace_t *trace ){ /* ydnar: early out */ if ( !( light->flags & LIGHT_GRID ) || light->envelope <= 0.0f ) { - return qfalse; + return false; } /* is this a sun? */ if ( light->type != EMIT_SUN ) { /* sun only? */ if ( sunOnly ) { - return qfalse; + return false; } /* test pvs */ if ( !ClusterVisible( trace->cluster, light->cluster ) ) { - return qfalse; + return false; } } @@ -1329,7 +1329,7 @@ int LightContributionToPoint( trace_t *trace ){ trace->origin[ 1 ] > light->maxs[ 1 ] || trace->origin[ 1 ] < light->mins[ 1 ] || trace->origin[ 2 ] > light->maxs[ 2 ] || trace->origin[ 2 ] < light->mins[ 2 ] ) { gridBoundsCulled++; - return qfalse; + return false; } /* set light origin */ @@ -1346,7 +1346,7 @@ int LightContributionToPoint( trace_t *trace ){ /* test envelope */ if ( dist > light->envelope ) { gridEnvelopeCulled++; - return qfalse; + return false; } /* ptpff approximation */ @@ -1370,7 +1370,7 @@ int LightContributionToPoint( trace_t *trace ){ /* see if the point is behind the light */ d = DotProduct( trace->origin, light->normal ) - light->dist; if ( !( light->flags & LIGHT_TWOSIDED ) && d < -1.0f ) { - return qfalse; + return false; } /* nudge the point so that it is clearly forward of the light */ @@ -1385,14 +1385,14 @@ int LightContributionToPoint( trace_t *trace ){ /* calculate the contribution (ydnar 2002-10-21: [bug 642] bad normal calc) */ factor = PointToPolygonFormFactor( pushedOrigin, trace->direction, light->w ); if ( factor == 0.0f ) { - return qfalse; + return false; } else if ( factor < 0.0f ) { if ( light->flags & LIGHT_TWOSIDED ) { factor = -factor; } else{ - return qfalse; + return false; } } @@ -1428,7 +1428,7 @@ int LightContributionToPoint( trace_t *trace ){ /* do cone calculation */ distByNormal = -DotProduct( trace->displacement, light->normal ); if ( distByNormal < 0.0f ) { - return qfalse; + return false; } VectorMA( light->origin, distByNormal, light->normal, pointAtDist ); radiusAtDist = light->radiusByDist * distByNormal; @@ -1437,7 +1437,7 @@ int LightContributionToPoint( trace_t *trace ){ /* outside the cone */ if ( sampleRadius >= radiusAtDist ) { - return qfalse; + return false; } /* attenuate */ @@ -1452,11 +1452,11 @@ int LightContributionToPoint( trace_t *trace ){ /* attenuate */ add = light->photons; if ( add <= 0.0f ) { - return qfalse; + return false; } /* setup trace */ - trace->testAll = qtrue; + trace->testAll = true; VectorScale( light->color, add, trace->color ); /* trace to point */ @@ -1465,37 +1465,37 @@ int LightContributionToPoint( trace_t *trace ){ TraceLine( trace ); if ( !( trace->compileFlags & C_SKY ) || trace->opaque ) { VectorClear( trace->color ); - return -1; + return false; } } /* return to sender */ - return qtrue; + return true; } /* unknown light type */ else{ - return qfalse; + return false; } /* ydnar: changed to a variable number */ if ( add <= 0.0f || ( add <= light->falloffTolerance && ( light->flags & LIGHT_FAST_ACTUAL ) ) ) { - return qfalse; + return false; } /* setup trace */ - trace->testAll = qfalse; + trace->testAll = false; VectorScale( light->color, add, trace->color ); /* trace */ TraceLine( trace ); if ( trace->passSolid ) { VectorClear( trace->color ); - return qfalse; + return false; } /* we have a valid sample */ - return qtrue; + return true; } @@ -1580,7 +1580,7 @@ void TraceGrid( int num ){ /* setup trace */ trace.testOcclusion = !noTrace; - trace.forceSunlight = qfalse; + trace.forceSunlight = false; trace.recvShadows = WORLDSPAWN_RECV_SHADOWS; trace.numSurfaces = 0; trace.surfaces = NULL; @@ -1639,10 +1639,10 @@ void TraceGrid( int num ){ vec3_t dir = { 0, 0, 1 }; float ambientFrac = 0.25f; - trace.testOcclusion = qtrue; - trace.forceSunlight = qfalse; + trace.testOcclusion = true; + trace.forceSunlight = false; trace.inhibitRadius = DEFAULT_INHIBIT_RADIUS; - trace.testAll = qtrue; + trace.testAll = true; for ( k = 0; k < 2; k++ ) { @@ -1883,11 +1883,11 @@ void SetupGrid( void ){ does what it says... */ -void LightWorld( qboolean fastAllocate ){ +void LightWorld( bool fastAllocate ){ vec3_t color; float f; int b, bt; - qboolean minVertex, minGrid; + bool minVertex, minGrid; const char *value; @@ -1920,19 +1920,19 @@ void LightWorld( qboolean fastAllocate ){ VectorScale( color, f, ambientColor ); /* minvertexlight */ - minVertex = qfalse; + minVertex = false; value = ValueForKey( &entities[ 0 ], "_minvertexlight" ); if ( value[ 0 ] != '\0' ) { - minVertex = qtrue; + minVertex = true; f = atof( value ); VectorScale( color, f, minVertexLight ); } /* mingridlight */ - minGrid = qfalse; + minGrid = false; value = ValueForKey( &entities[ 0 ], "_mingridlight" ); if ( value[ 0 ] != '\0' ) { - minGrid = qtrue; + minGrid = true; f = atof( value ); VectorScale( color, f, minGridLight ); } @@ -1942,10 +1942,10 @@ void LightWorld( qboolean fastAllocate ){ if ( value[ 0 ] != '\0' ) { f = atof( value ); VectorScale( color, f, minLight ); - if ( minVertex == qfalse ) { + if ( !minVertex ) { VectorScale( color, f, minVertexLight ); } - if ( minGrid == qfalse ) { + if ( !minGrid ) { VectorScale( color, f, minGridLight ); } } @@ -1969,12 +1969,12 @@ void LightWorld( qboolean fastAllocate ){ /* calculate lightgrid */ if ( !noGridLighting ) { /* ydnar: set up light envelopes */ - SetupEnvelopes( qtrue, fastgrid ); + SetupEnvelopes( true, fastgrid ); Sys_Printf( "--- TraceGrid ---\n" ); - inGrid = qtrue; - RunThreadsOnIndividual( numRawGridPoints, qtrue, TraceGrid ); - inGrid = qfalse; + inGrid = true; + RunThreadsOnIndividual( numRawGridPoints, true, TraceGrid ); + inGrid = false; Sys_Printf( "%d x %d x %d = %d grid\n", gridBounds[ 0 ], gridBounds[ 1 ], gridBounds[ 2 ], numBSPGridPoints ); @@ -1988,7 +1988,7 @@ void LightWorld( qboolean fastAllocate ){ /* map the world luxels */ Sys_Printf( "--- MapRawLightmap ---\n" ); - RunThreadsOnIndividual( numRawLightmaps, qtrue, MapRawLightmap ); + RunThreadsOnIndividual( numRawLightmaps, true, MapRawLightmap ); Sys_Printf( "%9d luxels\n", numLuxels ); Sys_Printf( "%9d luxels mapped\n", numLuxelsMapped ); Sys_Printf( "%9d luxels occluded\n", numLuxelsOccluded ); @@ -1996,14 +1996,14 @@ void LightWorld( qboolean fastAllocate ){ /* dirty them up */ if ( dirty ) { Sys_Printf( "--- DirtyRawLightmap ---\n" ); - RunThreadsOnIndividual( numRawLightmaps, qtrue, DirtyRawLightmap ); + RunThreadsOnIndividual( numRawLightmaps, true, DirtyRawLightmap ); } /* floodlight pass */ FloodlightRawLightmaps(); /* ydnar: set up light envelopes */ - SetupEnvelopes( qfalse, fast ); + SetupEnvelopes( false, fast ); /* light up my world */ lightsPlaneCulled = 0; @@ -2012,13 +2012,13 @@ void LightWorld( qboolean fastAllocate ){ lightsClusterCulled = 0; Sys_Printf( "--- IlluminateRawLightmap ---\n" ); - RunThreadsOnIndividual( numRawLightmaps, qtrue, IlluminateRawLightmap ); + RunThreadsOnIndividual( numRawLightmaps, true, IlluminateRawLightmap ); Sys_Printf( "%9d luxels illuminated\n", numLuxelsIlluminated ); StitchSurfaceLightmaps(); Sys_Printf( "--- IlluminateVertexes ---\n" ); - RunThreadsOnIndividual( numBSPDrawSurfaces, qtrue, IlluminateVertexes ); + RunThreadsOnIndividual( numBSPDrawSurfaces, true, IlluminateVertexes ); Sys_Printf( "%9d vertexes illuminated\n", numVertsIlluminated ); /* ydnar: emit statistics on light culling */ @@ -2042,16 +2042,16 @@ void LightWorld( qboolean fastAllocate ){ Sys_Printf( "\n--- Radiosity (bounce %d of %d) ---\n", b, bt ); /* flag bouncing */ - bouncing = qtrue; + bouncing = true; VectorClear( ambientColor ); - floodlighty = qfalse; + floodlighty = false; /* generate diffuse lights */ RadFreeLights(); RadCreateDiffuseLights(); /* setup light envelopes */ - SetupEnvelopes( qfalse, fastbounce ); + SetupEnvelopes( false, fastbounce ); if ( numLights == 0 ) { Sys_Printf( "No diffuse light to calculate, ending radiosity.\n" ); break; @@ -2063,9 +2063,9 @@ void LightWorld( qboolean fastAllocate ){ gridBoundsCulled = 0; Sys_Printf( "--- BounceGrid ---\n" ); - inGrid = qtrue; - RunThreadsOnIndividual( numRawGridPoints, qtrue, TraceGrid ); - inGrid = qfalse; + inGrid = true; + RunThreadsOnIndividual( numRawGridPoints, true, TraceGrid ); + inGrid = false; Sys_FPrintf( SYS_VRB, "%9d grid points envelope culled\n", gridEnvelopeCulled ); Sys_FPrintf( SYS_VRB, "%9d grid points bounds culled\n", gridBoundsCulled ); } @@ -2077,14 +2077,14 @@ void LightWorld( qboolean fastAllocate ){ lightsClusterCulled = 0; Sys_Printf( "--- IlluminateRawLightmap ---\n" ); - RunThreadsOnIndividual( numRawLightmaps, qtrue, IlluminateRawLightmap ); + RunThreadsOnIndividual( numRawLightmaps, true, IlluminateRawLightmap ); Sys_Printf( "%9d luxels illuminated\n", numLuxelsIlluminated ); Sys_Printf( "%9d vertexes illuminated\n", numVertsIlluminated ); StitchSurfaceLightmaps(); Sys_Printf( "--- IlluminateVertexes ---\n" ); - RunThreadsOnIndividual( numBSPDrawSurfaces, qtrue, IlluminateVertexes ); + RunThreadsOnIndividual( numBSPDrawSurfaces, true, IlluminateVertexes ); Sys_Printf( "%9d vertexes illuminated\n", numVertsIlluminated ); /* ydnar: emit statistics on light culling */ @@ -2111,8 +2111,8 @@ int LightMain( int argc, char **argv ){ float f; const char *value; int lightmapMergeSize = 0; - qboolean lightSamplesInsist = qfalse; - qboolean fastAllocate = qtrue; + bool lightSamplesInsist = false; + bool fastAllocate = true; /* note it */ @@ -2121,7 +2121,7 @@ int LightMain( int argc, char **argv ){ /* set standard game flags */ wolfLight = game->wolfLight; - if ( wolfLight == qtrue ) { + if ( wolfLight ) { Sys_Printf( " lightning model: wolf\n" ); } else{ @@ -2176,7 +2176,7 @@ int LightMain( int argc, char **argv ){ } noStyles = game->noStyles; - if ( noStyles == qtrue ) { + if ( noStyles ) { Sys_Printf( " shader lightstyles hack: disabled\n" ); } else{ @@ -2184,7 +2184,7 @@ int LightMain( int argc, char **argv ){ } patchShadows = game->patchShadows; - if ( patchShadows == qtrue ) { + if ( patchShadows ) { Sys_Printf( " patch shadows: enabled\n" ); } else{ @@ -2193,7 +2193,7 @@ int LightMain( int argc, char **argv ){ deluxemap = game->deluxeMap; deluxemode = game->deluxeMode; - if ( deluxemap == qtrue ) { + if ( deluxemap ) { if ( deluxemode ) { Sys_Printf( " deluxemapping: enabled with tangentspace deluxemaps\n" ); } @@ -2268,7 +2268,7 @@ int LightMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-nolm" ) ) { - nolm = qtrue; + nolm = true; Sys_Printf( "No lightmaps yo\n" ); } @@ -2351,50 +2351,50 @@ int LightMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-sRGBlight" ) ) { - lightmapsRGB = qtrue; + lightmapsRGB = true; Sys_Printf( "Lighting is in sRGB\n" ); } else if ( !strcmp( argv[ i ], "-nosRGBlight" ) ) { - lightmapsRGB = qfalse; + lightmapsRGB = false; Sys_Printf( "Lighting is linear\n" ); } else if ( !strcmp( argv[ i ], "-sRGBtex" ) ) { - texturesRGB = qtrue; + texturesRGB = true; Sys_Printf( "Textures are in sRGB\n" ); } else if ( !strcmp( argv[ i ], "-nosRGBtex" ) ) { - texturesRGB = qfalse; + texturesRGB = false; Sys_Printf( "Textures are linear\n" ); } else if ( !strcmp( argv[ i ], "-sRGBcolor" ) ) { - colorsRGB = qtrue; + colorsRGB = true; Sys_Printf( "Colors are in sRGB\n" ); } else if ( !strcmp( argv[ i ], "-nosRGBcolor" ) ) { - colorsRGB = qfalse; + colorsRGB = false; Sys_Printf( "Colors are linear\n" ); } else if ( !strcmp( argv[ i ], "-sRGB" ) ) { - lightmapsRGB = qtrue; + lightmapsRGB = true; Sys_Printf( "Lighting is in sRGB\n" ); - texturesRGB = qtrue; + texturesRGB = true; Sys_Printf( "Textures are in sRGB\n" ); - colorsRGB = qtrue; + colorsRGB = true; Sys_Printf( "Colors are in sRGB\n" ); } else if ( !strcmp( argv[ i ], "-nosRGB" ) ) { - lightmapsRGB = qfalse; + lightmapsRGB = false; Sys_Printf( "Lighting is linear\n" ); - texturesRGB = qfalse; + texturesRGB = false; Sys_Printf( "Textures are linear\n" ); - colorsRGB = qfalse; + colorsRGB = false; Sys_Printf( "Colors are linear\n" ); } @@ -2456,17 +2456,12 @@ int LightMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-randomsamples" ) ) { - lightRandomSamples = qtrue; + lightRandomSamples = true; Sys_Printf( "Random sampling enabled\n", lightRandomSamples ); } else if ( !strcmp( argv[ i ], "-samples" ) ) { - if ( *argv[i + 1] == '+' ) { - lightSamplesInsist = qtrue; - } - else{ - lightSamplesInsist = qfalse; - } + lightSamplesInsist = ( *argv[i + 1] == '+' ); lightSamples = atoi( argv[ i + 1 ] ); if ( lightSamples < 1 ) { lightSamples = 1; @@ -2489,12 +2484,12 @@ int LightMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-filter" ) ) { - filter = qtrue; + filter = true; Sys_Printf( "Lightmap filtering enabled\n" ); } else if ( !strcmp( argv[ i ], "-dark" ) ) { - dark = qtrue; + dark = true; Sys_Printf( "Dark lightmap seams enabled\n" ); } @@ -2504,7 +2499,7 @@ int LightMain( int argc, char **argv ){ shadeAngleDegrees = 0.0f; } else if ( shadeAngleDegrees > 0.0f ) { - shade = qtrue; + shade = true; Sys_Printf( "Phong shading enabled with a breaking angle of %f degrees\n", shadeAngleDegrees ); } i++; @@ -2532,7 +2527,7 @@ int LightMain( int argc, char **argv ){ i++; } else if ( !strcmp( argv[ i ], "-deluxe" ) || !strcmp( argv[ i ], "-deluxemap" ) ) { - deluxemap = qtrue; + deluxemap = true; Sys_Printf( "Generating deluxemaps for average light direction\n" ); } else if ( !strcmp( argv[ i ], "-deluxemode" ) ) { @@ -2547,11 +2542,11 @@ int LightMain( int argc, char **argv ){ i++; } else if ( !strcmp( argv[ i ], "-nodeluxe" ) || !strcmp( argv[ i ], "-nodeluxemap" ) ) { - deluxemap = qfalse; + deluxemap = false; Sys_Printf( "Disabling generating of deluxemaps for average light direction\n" ); } else if ( !strcmp( argv[ i ], "-external" ) ) { - externalLightmaps = qtrue; + externalLightmaps = true; Sys_Printf( "Storing all lightmaps externally\n" ); } @@ -2571,7 +2566,7 @@ int LightMain( int argc, char **argv ){ if ( lmCustomSize != game->lightmapSize ) { /* -lightmapsize might just require -external for native external lms, but it has already been used in existing batches alone, so brand new switch here for external lms, referenced by shaders hack/behavior */ - externalLightmaps = ( qboolean )strcmp( argv[ i - 1 ], "-extlmhacksize" ); + externalLightmaps = strcmp( argv[ i - 1 ], "-extlmhacksize" ); Sys_Printf( "Storing all lightmaps externally\n" ); } } @@ -2587,25 +2582,25 @@ int LightMain( int argc, char **argv ){ lmCustomDir = argv[i + 1]; i++; Sys_Printf( "Lightmap directory set to %s\n", lmCustomDir ); - externalLightmaps = qtrue; + externalLightmaps = true; Sys_Printf( "Storing all lightmaps externally\n" ); } /* ydnar: add this to suppress warnings */ else if ( !strcmp( argv[ i ], "-custinfoparms" ) ) { Sys_Printf( "Custom info parms enabled\n" ); - useCustomInfoParms = qtrue; + useCustomInfoParms = true; } else if ( !strcmp( argv[ i ], "-wolf" ) ) { /* -game should already be set */ - wolfLight = qtrue; + wolfLight = true; Sys_Printf( "Enabling Wolf lighting model (linear default)\n" ); } else if ( !strcmp( argv[ i ], "-q3" ) ) { /* -game should already be set */ - wolfLight = qfalse; + wolfLight = false; Sys_Printf( "Enabling Quake 3 lighting model (nonlinear default)\n" ); } @@ -2619,17 +2614,17 @@ int LightMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-sunonly" ) ) { - sunOnly = qtrue; + sunOnly = true; Sys_Printf( "Only computing sunlight\n" ); } else if ( !strcmp( argv[ i ], "-bounceonly" ) ) { - bounceOnly = qtrue; + bounceOnly = true; Sys_Printf( "Storing bounced light (radiosity) only\n" ); } else if ( !strcmp( argv[ i ], "-nocollapse" ) ) { - noCollapse = qtrue; + noCollapse = true; Sys_Printf( "Identical lightmap collapsing disabled\n" ); } @@ -2651,12 +2646,12 @@ int LightMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-shade" ) ) { - shade = qtrue; + shade = true; Sys_Printf( "Phong shading enabled\n" ); } else if ( !strcmp( argv[ i ], "-bouncegrid" ) ) { - bouncegrid = qtrue; + bouncegrid = true; if ( bounce > 0 ) { Sys_Printf( "Grid lighting with radiosity enabled\n" ); } @@ -2668,112 +2663,112 @@ int LightMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-nofastpoint" ) ) { - fastpoint = qfalse; + fastpoint = false; Sys_Printf( "Automatic fast mode for point lights disabled\n" ); } else if ( !strcmp( argv[ i ], "-fast" ) ) { - fast = qtrue; - fastgrid = qtrue; - fastbounce = qtrue; + fast = true; + fastgrid = true; + fastbounce = true; Sys_Printf( "Fast mode enabled for all area lights\n" ); } else if ( !strcmp( argv[ i ], "-faster" ) ) { - faster = qtrue; - fast = qtrue; - fastgrid = qtrue; - fastbounce = qtrue; + faster = true; + fast = true; + fastgrid = true; + fastbounce = true; Sys_Printf( "Faster mode enabled\n" ); } // else if ( !strcmp( argv[ i ], "-fastallocate" ) ) { -// fastAllocate = qtrue; +// fastAllocate = true; // Sys_Printf( "Fast allocation mode enabled\n" ); // } else if ( !strcmp( argv[ i ], "-slowallocate" ) ) { - fastAllocate = qfalse; + fastAllocate = false; Sys_Printf( "Slow allocation mode enabled\n" ); } else if ( !strcmp( argv[ i ], "-fastgrid" ) ) { - fastgrid = qtrue; + fastgrid = true; Sys_Printf( "Fast grid lighting enabled\n" ); } else if ( !strcmp( argv[ i ], "-fastbounce" ) ) { - fastbounce = qtrue; + fastbounce = true; Sys_Printf( "Fast bounce mode enabled\n" ); } else if ( !strcmp( argv[ i ], "-cheap" ) ) { - cheap = qtrue; - cheapgrid = qtrue; + cheap = true; + cheapgrid = true; Sys_Printf( "Cheap mode enabled\n" ); } else if ( !strcmp( argv[ i ], "-cheapgrid" ) ) { - cheapgrid = qtrue; + cheapgrid = true; Sys_Printf( "Cheap grid mode enabled\n" ); } else if ( !strcmp( argv[ i ], "-normalmap" ) ) { - normalmap = qtrue; + normalmap = true; Sys_Printf( "Storing normal map instead of lightmap\n" ); } else if ( !strcmp( argv[ i ], "-trisoup" ) ) { - trisoup = qtrue; + trisoup = true; Sys_Printf( "Converting brush faces to triangle soup\n" ); } else if ( !strcmp( argv[ i ], "-debug" ) ) { - debug = qtrue; + debug = true; Sys_Printf( "Lightmap debugging enabled\n" ); } else if ( !strcmp( argv[ i ], "-debugsurfaces" ) || !strcmp( argv[ i ], "-debugsurface" ) ) { - debugSurfaces = qtrue; + debugSurfaces = true; Sys_Printf( "Lightmap surface debugging enabled\n" ); } else if ( !strcmp( argv[ i ], "-debugunused" ) ) { - debugUnused = qtrue; + debugUnused = true; Sys_Printf( "Unused luxel debugging enabled\n" ); } else if ( !strcmp( argv[ i ], "-debugaxis" ) ) { - debugAxis = qtrue; + debugAxis = true; Sys_Printf( "Lightmap axis debugging enabled\n" ); } else if ( !strcmp( argv[ i ], "-debugcluster" ) ) { - debugCluster = qtrue; + debugCluster = true; Sys_Printf( "Luxel cluster debugging enabled\n" ); } else if ( !strcmp( argv[ i ], "-debugorigin" ) ) { - debugOrigin = qtrue; + debugOrigin = true; Sys_Printf( "Luxel origin debugging enabled\n" ); } else if ( !strcmp( argv[ i ], "-debugdeluxe" ) ) { - deluxemap = qtrue; - debugDeluxemap = qtrue; + deluxemap = true; + debugDeluxemap = true; Sys_Printf( "Deluxemap debugging enabled\n" ); } else if ( !strcmp( argv[ i ], "-export" ) ) { - exportLightmaps = qtrue; + exportLightmaps = true; Sys_Printf( "Exporting lightmaps\n" ); } else if ( !strcmp( argv[ i ], "-notrace" ) ) { - noTrace = qtrue; + noTrace = true; Sys_Printf( "Shadow occlusion disabled\n" ); } else if ( !strcmp( argv[ i ], "-patchshadows" ) ) { - patchShadows = qtrue; + patchShadows = true; Sys_Printf( "Patch shadow casting enabled\n" ); } else if ( !strcmp( argv[ i ], "-extra" ) ) { @@ -2782,7 +2777,7 @@ int LightMain( int argc, char **argv ){ } else if ( !strcmp( argv[ i ], "-extrawide" ) ) { superSample = EXTRAWIDE_SCALE; /* ydnar */ - filter = qtrue; /* ydnar */ + filter = true; /* ydnar */ Sys_Printf( "The -extrawide argument is deprecated, use \"-filter [-super 2]\" instead\n" ); } else if ( !strcmp( argv[ i ], "-samplesize" ) ) { @@ -2822,23 +2817,23 @@ int LightMain( int argc, char **argv ){ } } else if ( !strcmp( argv[ i ], "-nogrid" ) ) { - noGridLighting = qtrue; + noGridLighting = true; Sys_Printf( "Disabling grid lighting\n" ); } else if ( !strcmp( argv[ i ], "-border" ) ) { - lightmapBorder = qtrue; + lightmapBorder = true; Sys_Printf( "Adding debug border to lightmaps\n" ); } else if ( !strcmp( argv[ i ], "-nosurf" ) ) { - noSurfaces = qtrue; + noSurfaces = true; Sys_Printf( "Not tracing against surfaces\n" ); } else if ( !strcmp( argv[ i ], "-dump" ) ) { - dump = qtrue; + dump = true; Sys_Printf( "Dumping radiosity lights into numbered prefabs\n" ); } else if ( !strcmp( argv[ i ], "-lomem" ) ) { - loMem = qtrue; + loMem = true; Sys_Printf( "Enabling low-memory (potentially slower) lighting mode\n" ); } else if ( !strcmp( argv[ i ], "-lightanglehl" ) ) { @@ -2854,37 +2849,37 @@ int LightMain( int argc, char **argv ){ } } else if ( !strcmp( argv[ i ], "-nostyle" ) || !strcmp( argv[ i ], "-nostyles" ) ) { - noStyles = qtrue; + noStyles = true; Sys_Printf( "Disabling lightstyles\n" ); } else if ( !strcmp( argv[ i ], "-style" ) || !strcmp( argv[ i ], "-styles" ) ) { - noStyles = qfalse; + noStyles = false; Sys_Printf( "Enabling lightstyles\n" ); } else if ( !strcmp( argv[ i ], "-cpma" ) ) { - cpmaHack = qtrue; + cpmaHack = true; Sys_Printf( "Enabling Challenge Pro Mode Asstacular Vertex Lighting Mode (tm)\n" ); } else if ( !strcmp( argv[ i ], "-floodlight" ) ) { - floodlighty = qtrue; + floodlighty = true; Sys_Printf( "FloodLighting enabled\n" ); } else if ( !strcmp( argv[ i ], "-debugnormals" ) ) { - debugnormals = qtrue; + debugnormals = true; Sys_Printf( "DebugNormals enabled\n" ); } else if ( !strcmp( argv[ i ], "-lowquality" ) ) { - floodlight_lowquality = qtrue; + floodlight_lowquality = true; Sys_Printf( "Low Quality FloodLighting enabled\n" ); } /* r7: dirtmapping */ else if ( !strcmp( argv[ i ], "-dirty" ) ) { - dirty = qtrue; + dirty = true; Sys_Printf( "Dirtmapping enabled\n" ); } else if ( !strcmp( argv[ i ], "-dirtdebug" ) || !strcmp( argv[ i ], "-debugdirt" ) ) { - dirtDebug = qtrue; + dirtDebug = true; Sys_Printf( "Dirtmap debugging enabled\n" ); } else if ( !strcmp( argv[ i ], "-dirtmode" ) ) { @@ -2925,17 +2920,17 @@ int LightMain( int argc, char **argv ){ i++; } else if ( !strcmp( argv[ i ], "-trianglecheck" ) ) { - lightmapTriangleCheck = qtrue; + lightmapTriangleCheck = true; } else if ( !strcmp( argv[ i ], "-extravisnudge" ) ) { - lightmapExtraVisClusterNudge = qtrue; + lightmapExtraVisClusterNudge = true; } else if ( !strcmp( argv[ i ], "-fill" ) ) { - lightmapFill = qtrue; + lightmapFill = true; Sys_Printf( "Filling lightmap colors from surrounding pixels to improve JPEG compression\n" ); } else if ( !strcmp( argv[ i ], "-fillpink" ) ) { - lightmapPink = qtrue; + lightmapPink = true; } /* unhandled args */ else @@ -3024,7 +3019,7 @@ int LightMain( int argc, char **argv ){ /* load map file */ value = ValueForKey( &entities[ 0 ], "_keepLights" ); if ( value[ 0 ] != '1' ) { - LoadMapFile( name, qtrue, qfalse ); + LoadMapFile( name, true, false ); } /* set the entity/model origins and init yDrawVerts */ diff --git a/tools/quake3/q3map2/light_bounce.c b/tools/quake3/q3map2/light_bounce.c index 96fc568a..355fa439 100644 --- a/tools/quake3/q3map2/light_bounce.c +++ b/tools/quake3/q3map2/light_bounce.c @@ -200,10 +200,10 @@ static void RadClipWindingEpsilon( radWinding_t *in, vec3_t normal, vec_t dist, /* RadSampleImage() samples a texture image for a given color - returns qfalse if pixels are bad + returns false if pixels are bad */ -qboolean RadSampleImage( byte *pixels, int width, int height, float st[ 2 ], float color[ 4 ] ){ +bool RadSampleImage( byte *pixels, int width, int height, float st[ 2 ], float color[ 4 ] ){ float sto[ 2 ]; int x, y; @@ -213,7 +213,7 @@ qboolean RadSampleImage( byte *pixels, int width, int height, float st[ 2 ], flo /* dummy check */ if ( pixels == NULL || width < 1 || height < 1 ) { - return qfalse; + return false; } /* bias st */ @@ -241,7 +241,7 @@ qboolean RadSampleImage( byte *pixels, int width, int height, float st[ 2 ], flo color[2] = Image_LinearFloatFromsRGBFloat( color[2] * ( 1.0 / 255.0 ) ) * 255.0; } - return qtrue; + return true; } @@ -282,7 +282,7 @@ static void RadSample( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm, samples = 0; /* sample vertex colors if no lightmap or this is the initial pass */ - if ( lm == NULL || lm->radLuxels[ lightmapNum ] == NULL || bouncing == qfalse ) { + if ( lm == NULL || lm->radLuxels[ lightmapNum ] == NULL || !bouncing ) { for ( samples = 0; samples < rw->numVerts; samples++ ) { /* multiply by texture color */ @@ -750,7 +750,7 @@ void RadLightForPatch( int num, int lightmapNum, rawLightmap_t *lm, shaderInfo_t float *radVertexLuxel; float dist; vec4_t plane; - qboolean planar; + bool planar; radWinding_t rw; @@ -814,7 +814,7 @@ void RadLightForPatch( int num, int lightmapNum, rawLightmap_t *lm, shaderInfo_t if ( planar ) { dist = DotProduct( dv[ 1 ]->xyz, plane ) - plane[ 3 ]; if ( fabs( dist ) > PLANAR_EPSILON ) { - planar = qfalse; + planar = false; } } @@ -969,7 +969,7 @@ void RadCreateDiffuseLights( void ){ numAreaLights = 0; /* hit every surface (threaded) */ - RunThreadsOnIndividual( numBSPDrawSurfaces, qtrue, RadLight ); + RunThreadsOnIndividual( numBSPDrawSurfaces, true, RadLight ); /* dump the lights generated to a file */ if ( dump ) { diff --git a/tools/quake3/q3map2/light_shadows.c b/tools/quake3/q3map2/light_shadows.c index 50a0d627..4d255c7d 100644 --- a/tools/quake3/q3map2/light_shadows.c +++ b/tools/quake3/q3map2/light_shadows.c @@ -99,7 +99,7 @@ void SetupShadows( void ){ for ( i = 0, leaf = dleafs; i < numleafs; i++, leaf++ ) { /* in pvs? */ - if ( ClusterVisible( light->cluster, leaf->cluster ) == qfalse ) { + if ( !ClusterVisible( light->cluster, leaf->cluster ) ) { continue; } diff --git a/tools/quake3/q3map2/light_trace.c b/tools/quake3/q3map2/light_trace.c index bd920244..a686d4bf 100644 --- a/tools/quake3/q3map2/light_trace.c +++ b/tools/quake3/q3map2/light_trace.c @@ -73,7 +73,8 @@ traceVert_t; typedef struct traceInfo_s { shaderInfo_t *si; - int surfaceNum, castShadows, skipGrid; + int surfaceNum, castShadows; + bool skipGrid; } traceInfo_t; @@ -872,7 +873,7 @@ static void PopulateWithBSPModel( bspModel_t *model, m4x4_t transform ){ } /* patchshadows? */ - if ( ds->surfaceType == MST_PATCH && patchShadows == qfalse ) { + if ( ds->surfaceType == MST_PATCH && !patchShadows ) { continue; } @@ -1073,7 +1074,7 @@ static void PopulateWithPicoModel( int castShadows, picoModel_t *model, m4x4_t t /* setup trace info */ ti.castShadows = castShadows; ti.surfaceNum = -1; - ti.skipGrid = qtrue; // also ignore picomodels when skipping patches + ti.skipGrid = true; // also ignore picomodels when skipping patches /* setup trace winding */ memset( &tw, 0, sizeof( tw ) ); @@ -1267,7 +1268,7 @@ void SetupTraceNodes( void ){ PopulateTraceNodes(); /* create the raytracing bsp */ - if ( loMem == qfalse ) { + if ( !loMem ) { SubdivideTraceNode_r( headNodeNum, 0 ); SubdivideTraceNode_r( skyboxNodeNum, 0 ); } @@ -1345,7 +1346,7 @@ void SetupTraceNodes( void ){ #define NEAR_SHADOW_EPSILON 1.5f //% 1.25f #define SELF_SHADOW_EPSILON 0.5f -qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ +bool TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ int i; float tvec[ 3 ], pvec[ 3 ], qvec[ 3 ]; float det, invDet, depth; @@ -1359,20 +1360,20 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ /* don't double-trace against sky */ si = ti->si; if ( trace->compileFlags & si->compileFlags & C_SKY ) { - return qfalse; + return false; } /* receive shadows from worldspawn group only */ if ( trace->recvShadows == 1 ) { if ( ti->castShadows != 1 ) { - return qfalse; + return false; } } /* receive shadows from same group and worldspawn group */ else if ( trace->recvShadows > 1 ) { if ( ti->castShadows != 1 && abs( ti->castShadows ) != abs( trace->recvShadows ) ) { - return qfalse; + return false; } //% Sys_Printf( "%d:%d ", tt->castShadows, trace->recvShadows ); } @@ -1381,14 +1382,14 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ else { if ( abs( ti->castShadows ) != abs( trace->recvShadows ) ) { - return qfalse; + return false; } } /* skip patches when doing the grid (FIXME this is an ugly hack) */ if ( inGrid ) { if ( ti->skipGrid ) { - return qfalse; + return false; } } @@ -1400,7 +1401,7 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ /* the non-culling branch */ if ( fabs( det ) < COPLANAR_EPSILON ) { - return qfalse; + return false; } invDet = 1.0f / det; @@ -1410,7 +1411,7 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ /* calculate u parameter and test bounds */ u = DotProduct( tvec, pvec ) * invDet; if ( u < -BARY_EPSILON || u > ( 1.0f + BARY_EPSILON ) ) { - return qfalse; + return false; } /* prepare to test v parameter */ @@ -1419,13 +1420,13 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ /* calculate v parameter and test bounds */ v = DotProduct( trace->direction, qvec ) * invDet; if ( v < -BARY_EPSILON || ( u + v ) > ( 1.0f + BARY_EPSILON ) ) { - return qfalse; + return false; } /* calculate t (depth) */ depth = DotProduct( tt->edge2, qvec ) * invDet; if ( depth <= trace->inhibitRadius || depth >= trace->distance ) { - return qfalse; + return false; } /* if hitpoint is really close to trace origin (sample point), then check for self-shadowing */ @@ -1434,7 +1435,7 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ for ( i = 0; i < trace->numSurfaces; i++ ) { if ( ti->surfaceNum == trace->surfaces[ i ] ) { - return qfalse; + return false; } } } @@ -1444,7 +1445,7 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ /* don't trace against sky */ if ( si->compileFlags & C_SKY ) { - return qfalse; + return false; } /* most surfaces are completely opaque */ @@ -1452,8 +1453,8 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ si->lightImage == NULL || si->lightImage->pixels == NULL ) { VectorMA( trace->origin, depth, trace->direction, trace->hit ); VectorClear( trace->color ); - trace->opaque = qtrue; - return qtrue; + trace->opaque = true; + return true; } /* force subsampling because the lighting is texture dependent */ @@ -1462,7 +1463,7 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ /* try to avoid double shadows near triangle seams */ if ( u < -ASLF_EPSILON || u > ( 1.0f + ASLF_EPSILON ) || v < -ASLF_EPSILON || ( u + v ) > ( 1.0f + ASLF_EPSILON ) ) { - return qfalse; + return false; } /* calculate w parameter */ @@ -1512,12 +1513,12 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ if ( trace->color[ 0 ] <= 0.001f && trace->color[ 1 ] <= 0.001f && trace->color[ 2 ] <= 0.001f ) { VectorClear( trace->color ); VectorMA( trace->origin, depth, trace->direction, trace->hit ); - trace->opaque = qtrue; - return qtrue; + trace->opaque = true; + return true; } /* continue tracing */ - return qfalse; + return false; } @@ -1527,7 +1528,7 @@ qboolean TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){ temporary hack */ -qboolean TraceWinding( traceWinding_t *tw, trace_t *trace ){ +bool TraceWinding( traceWinding_t *tw, trace_t *trace ){ int i; traceTriangle_t tt; @@ -1549,12 +1550,12 @@ qboolean TraceWinding( traceWinding_t *tw, trace_t *trace ){ /* trace it */ if ( TraceTriangle( &traceInfos[ tt.infoNum ], &tt, trace ) ) { - return qtrue; + return true; } } /* done */ - return qfalse; + return false; } @@ -1562,7 +1563,7 @@ qboolean TraceWinding( traceWinding_t *tw, trace_t *trace ){ /* TraceLine_r() - returns qtrue if something is hit and tracing can stop + returns true if something is hit and tracing can stop SmileTheory: made half-iterative */ @@ -1570,9 +1571,9 @@ qboolean TraceWinding( traceWinding_t *tw, trace_t *trace ){ #define TRACELINE_R_HALF_ITERATIVE 1 #if TRACELINE_R_HALF_ITERATIVE -static qboolean TraceLine_r( int nodeNum, const vec3_t start, const vec3_t end, trace_t *trace ) +static bool TraceLine_r( int nodeNum, const vec3_t start, const vec3_t end, trace_t *trace ) #else -static qboolean TraceLine_r( int nodeNum, const vec3_t origin, const vec3_t end, trace_t *trace ) +static bool TraceLine_r( int nodeNum, const vec3_t origin, const vec3_t end, trace_t *trace ) #endif { traceNode_t *node; @@ -1590,8 +1591,8 @@ static qboolean TraceLine_r( int nodeNum, const vec3_t origin, const vec3_t end, /* bogus node number means solid, end tracing unless testing all */ if ( nodeNum < 0 ) { VectorCopy( origin, trace->hit ); - trace->passSolid = qtrue; - return qtrue; + trace->passSolid = true; + return true; } /* get node */ @@ -1600,8 +1601,8 @@ static qboolean TraceLine_r( int nodeNum, const vec3_t origin, const vec3_t end, /* solid? */ if ( node->type == TRACE_LEAF_SOLID ) { VectorCopy( origin, trace->hit ); - trace->passSolid = qtrue; - return qtrue; + trace->passSolid = true; + return true; } /* leafnode? */ @@ -1610,12 +1611,12 @@ static qboolean TraceLine_r( int nodeNum, const vec3_t origin, const vec3_t end, if ( node->numItems > 0 && trace->numTestNodes < MAX_TRACE_TEST_NODES ) { trace->testNodes[ trace->numTestNodes++ ] = nodeNum; } - return qfalse; + return false; } /* ydnar 2003-09-07: don't test branches of the bsp with nothing in them when testall is enabled */ if ( trace->testAll && node->numItems == 0 ) { - return qfalse; + return false; } /* classify beginning and end points */ @@ -1678,7 +1679,7 @@ static qboolean TraceLine_r( int nodeNum, const vec3_t origin, const vec3_t end, /* trace first side */ if ( TraceLine_r( node->children[ side ], origin, mid, trace ) ) { - return qtrue; + return true; } /* trace other side */ @@ -1706,8 +1707,8 @@ void TraceLine( trace_t *trace ){ /* setup output (note: this code assumes the input data is completely filled out) */ - trace->passSolid = qfalse; - trace->opaque = qfalse; + trace->passSolid = false; + trace->opaque = false; trace->compileFlags = 0; trace->numTestNodes = 0; @@ -1719,7 +1720,7 @@ void TraceLine( trace_t *trace ){ /* trace through nodes */ TraceLine_r( headNodeNum, trace->origin, trace->end, trace ); if ( trace->passSolid && !trace->testAll ) { - trace->opaque = qtrue; + trace->opaque = true; return; } diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index 32d9a8f7..6e7c1912 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -250,7 +250,7 @@ void SmoothNormals( void ){ } /* test vertexes */ - if ( VectorCompare( yDrawVerts[ i ].xyz, yDrawVerts[ j ].xyz ) == qfalse ) { + if ( !VectorCompare( yDrawVerts[ i ].xyz, yDrawVerts[ j ].xyz ) ) { continue; } @@ -333,7 +333,7 @@ void SmoothNormals( void ){ calculates the st tangent vectors for normalmapping */ -static qboolean CalcTangentVectors( int numVerts, bspDrawVert_t **dv, vec3_t *stv, vec3_t *ttv ){ +static bool CalcTangentVectors( int numVerts, bspDrawVert_t **dv, vec3_t *stv, vec3_t *ttv ){ int i; float bb, s, t; vec3_t bary; @@ -342,7 +342,7 @@ static qboolean CalcTangentVectors( int numVerts, bspDrawVert_t **dv, vec3_t *st /* calculate barycentric basis for the triangle */ bb = ( dv[ 1 ]->st[ 0 ] - dv[ 0 ]->st[ 0 ] ) * ( dv[ 2 ]->st[ 1 ] - dv[ 0 ]->st[ 1 ] ) - ( dv[ 2 ]->st[ 0 ] - dv[ 0 ]->st[ 0 ] ) * ( dv[ 1 ]->st[ 1 ] - dv[ 0 ]->st[ 1 ] ); if ( fabs( bb ) < 0.00000001f ) { - return qfalse; + return false; } /* do each vertex */ @@ -382,7 +382,7 @@ static qboolean CalcTangentVectors( int numVerts, bspDrawVert_t **dv, vec3_t *st } /* return to caller */ - return qtrue; + return true; } @@ -402,7 +402,7 @@ static void PerturbNormal( bspDrawVert_t *dv, shaderInfo_t *si, vec3_t pNormal, VectorCopy( dv->normal, pNormal ); /* sample normalmap */ - if ( RadSampleImage( si->normalImage->pixels, si->normalImage->width, si->normalImage->height, dv->st, bump ) == qfalse ) { + if ( !RadSampleImage( si->normalImage->pixels, si->normalImage->width, si->normalImage->height, dv->st, bump ) ) { return; } @@ -628,7 +628,7 @@ static int MapSingleLuxel( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t luxel[ 1 ] = 0.0f; /* point in solid? (except in dark mode) */ - if ( pointCluster < 0 && dark == qfalse ) { + if ( pointCluster < 0 && !dark ) { /* nudge the the location around */ nudge = nudges[ 0 ]; while ( nudge[ 0 ] > BOGUS_NUDGE && pointCluster < 0 ) @@ -651,7 +651,7 @@ static int MapSingleLuxel( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t } /* as a last resort, if still in solid, try drawvert origin offset by normal (except in dark mode) */ - if ( pointCluster < 0 && si != NULL && dark == qfalse ) { + if ( pointCluster < 0 && si != NULL && !dark ) { VectorMA( dv->xyz, lightmapSampleOffset, dv->normal, nudged ); pointCluster = ClusterForPointExtFilter( nudged, LUXEL_EPSILON, numClusters, clusters ); if ( pointCluster >= 0 ) { @@ -774,7 +774,7 @@ static void MapTriangle_r( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t requires a cw ordered triangle */ -static qboolean MapTriangle( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv[ 3 ], qboolean mapNonAxial ){ +static bool MapTriangle( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv[ 3 ], bool mapNonAxial ){ int i; vec4_t plane; vec3_t *stv, *ttv, stvStatic[ 3 ], ttvStatic[ 3 ]; @@ -788,8 +788,8 @@ static qboolean MapTriangle( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert } /* otherwise make one from the points */ - else if ( PlaneFromPoints( plane, dv[ 0 ]->xyz, dv[ 1 ]->xyz, dv[ 2 ]->xyz ) == qfalse ) { - return qfalse; + else if ( !PlaneFromPoints( plane, dv[ 0 ]->xyz, dv[ 1 ]->xyz, dv[ 2 ]->xyz ) ) { + return false; } /* check to see if we need to calculate texture->world tangent vectors */ @@ -816,7 +816,7 @@ static qboolean MapTriangle( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert if ( mapNonAxial ) { /* subdivide the triangle */ MapTriangle_r( lm, info, dv, plane, stv, ttv, worldverts ); - return qtrue; + return true; } for ( i = 0; i < 3; i++ ) @@ -840,7 +840,7 @@ static qboolean MapTriangle( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert } } - return qtrue; + return true; } @@ -946,7 +946,7 @@ static void MapQuad_r( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv #define QUAD_PLANAR_EPSILON 0.5f -static qboolean MapQuad( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv[ 4 ] ){ +static bool MapQuad( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv[ 4 ] ){ float dist; vec4_t plane; vec3_t *stv, *ttv, stvStatic[ 4 ], ttvStatic[ 4 ]; @@ -959,14 +959,14 @@ static qboolean MapQuad( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t * } /* otherwise make one from the points */ - else if ( PlaneFromPoints( plane, dv[ 0 ]->xyz, dv[ 1 ]->xyz, dv[ 2 ]->xyz ) == qfalse ) { - return qfalse; + else if ( !PlaneFromPoints( plane, dv[ 0 ]->xyz, dv[ 1 ]->xyz, dv[ 2 ]->xyz ) ) { + return false; } /* 4th point must fall on the plane */ dist = DotProduct( plane, dv[ 3 ]->xyz ) - plane[ 3 ]; if ( fabs( dist ) > QUAD_PLANAR_EPSILON ) { - return qfalse; + return false; } /* check to see if we need to calculate texture->world tangent vectors */ @@ -988,7 +988,7 @@ static qboolean MapQuad( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t * /* subdivide the quad */ MapQuad_r( lm, info, dv, plane, stv, ttv ); - return qtrue; + return true; } @@ -1565,7 +1565,7 @@ void DirtyRawLightmap( int rawLightmapNum ){ rawLightmap_t *lm; surfaceInfo_t *info; trace_t trace; - qboolean noDirty; + bool noDirty; /* bail if this number exceeds the number of raw lightmaps */ @@ -1577,16 +1577,16 @@ void DirtyRawLightmap( int rawLightmapNum ){ lm = &rawLightmaps[ rawLightmapNum ]; /* setup trace */ - trace.testOcclusion = qtrue; - trace.forceSunlight = qfalse; + trace.testOcclusion = true; + trace.forceSunlight = false; trace.recvShadows = lm->recvShadows; trace.numSurfaces = lm->numLightSurfaces; trace.surfaces = &lightSurfaces[ lm->firstLightSurface ]; trace.inhibitRadius = 0.0f; - trace.testAll = qfalse; + trace.testAll = false; /* twosided lighting (may or may not be a good idea for lightmapped stuff) */ - trace.twoSided = qfalse; + trace.twoSided = false; for ( i = 0; i < trace.numSurfaces; i++ ) { /* get surface */ @@ -1594,12 +1594,12 @@ void DirtyRawLightmap( int rawLightmapNum ){ /* check twosidedness */ if ( info->si->twoSided ) { - trace.twoSided = qtrue; + trace.twoSided = true; break; } } - noDirty = qfalse; + noDirty = false; for ( i = 0; i < trace.numSurfaces; i++ ) { /* get surface */ @@ -1607,7 +1607,7 @@ void DirtyRawLightmap( int rawLightmapNum ){ /* check twosidedness */ if ( info->si->noDirty ) { - noDirty = qtrue; + noDirty = true; break; } } @@ -1710,7 +1710,7 @@ void DirtyRawLightmap( int rawLightmapNum ){ calculates the pvs cluster, origin, normal of a sub-luxel */ -static qboolean SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float by, int *sampleCluster, vec3_t sampleOrigin, vec3_t sampleNormal ){ +static bool SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float by, int *sampleCluster, vec3_t sampleOrigin, vec3_t sampleNormal ){ int i, *cluster, *cluster2; float *origin, *origin2, *normal; //% , *normal2; vec3_t originVecs[ 2 ]; //% , normalVecs[ 2 ]; @@ -1774,19 +1774,19 @@ static qboolean SubmapRawLuxel( rawLightmap_t *lm, int x, int y, float bx, float /* get cluster */ *sampleCluster = ClusterForPointExtFilter( sampleOrigin, ( LUXEL_EPSILON * 2 ), lm->numLightClusters, lm->lightClusters ); if ( *sampleCluster < 0 ) { - return qfalse; + return false; } /* calculate new normal */ //% VectorMA( normal, bx, normalVecs[ 0 ], sampleNormal ); //% VectorMA( sampleNormal, by, normalVecs[ 1 ], sampleNormal ); //% if( VectorNormalize( sampleNormal, sampleNormal ) <= 0.0f ) - //% return qfalse; + //% return false; normal = SUPER_NORMAL( x, y ); VectorCopy( normal, sampleNormal ); /* return ok */ - return qtrue; + return true; } @@ -1988,7 +1988,7 @@ void IlluminateRawLightmap( int rawLightmapNum ){ size_t llSize, ldSize; rawLightmap_t *lm; surfaceInfo_t *info; - qboolean filterColor, filterDir; + bool filterColor, filterDir; float brightness; float *origin, *normal, *dirt, *luxel, *luxel2, *deluxel, *deluxel2; unsigned char *flag; @@ -2009,14 +2009,14 @@ void IlluminateRawLightmap( int rawLightmapNum ){ /* setup trace */ trace.testOcclusion = !noTrace; - trace.forceSunlight = qfalse; + trace.forceSunlight = false; trace.recvShadows = lm->recvShadows; trace.numSurfaces = lm->numLightSurfaces; trace.surfaces = &lightSurfaces[ lm->firstLightSurface ]; trace.inhibitRadius = DEFAULT_INHIBIT_RADIUS; /* twosided lighting (may or may not be a good idea for lightmapped stuff) */ - trace.twoSided = qfalse; + trace.twoSided = false; for ( i = 0; i < trace.numSurfaces; i++ ) { /* get surface */ @@ -2024,7 +2024,7 @@ void IlluminateRawLightmap( int rawLightmapNum ){ /* check twosidedness */ if ( info->si->twoSided ) { - trace.twoSided = qtrue; + trace.twoSided = true; break; } } @@ -2646,15 +2646,15 @@ void IlluminateRawLightmap( int rawLightmapNum ){ normal = SUPER_NORMAL( x, y ); /* determine if filtering is necessary */ - filterColor = qfalse; - filterDir = qfalse; + filterColor = false; + filterDir = false; if ( *cluster < 0 || ( lm->splotchFix && ( luxel[ 0 ] <= ambientColor[ 0 ] || luxel[ 1 ] <= ambientColor[ 1 ] || luxel[ 2 ] <= ambientColor[ 2 ] ) ) ) { - filterColor = qtrue; + filterColor = true; } if ( deluxemap && lightmapNum == 0 && ( *cluster < 0 || filter ) ) { - filterDir = qtrue; + filterDir = true; } if ( !filterColor && !filterDir ) { @@ -2804,7 +2804,7 @@ void IlluminateVertexes( int num ){ /* calculate vertex lighting for surfaces without lightmaps */ if ( lm == NULL || cpmaHack ) { /* setup trace */ - trace.testOcclusion = ( cpmaHack && lm != NULL ) ? qfalse : !noTrace; + trace.testOcclusion = ( cpmaHack && lm != NULL ) ? false : !noTrace; trace.forceSunlight = info->si->forceSunlight; trace.recvShadows = info->recvShadows; trace.numSurfaces = 1; @@ -3262,24 +3262,24 @@ void SetupBrushes( void ){ determines if two clusters are visible to each other using the PVS */ -qboolean ClusterVisible( int a, int b ){ +bool ClusterVisible( int a, int b ){ int leafBytes; byte *pvs; /* dummy check */ if ( a < 0 || b < 0 ) { - return qfalse; + return false; } /* early out */ if ( a == b ) { - return qtrue; + return true; } /* not vised? */ if ( numBSPVisBytes <= 8 ) { - return qtrue; + return true; } /* get pvs data */ @@ -3289,9 +3289,9 @@ qboolean ClusterVisible( int a, int b ){ /* check */ if ( ( pvs[ b >> 3 ] & ( 1 << ( b & 7 ) ) ) ) { - return qtrue; + return true; } - return qfalse; + return false; } @@ -3348,17 +3348,17 @@ int PointInLeafNum( vec3_t point ){ /* ClusterVisibleToPoint() - ydnar - returns qtrue if point can "see" cluster + returns true if point can "see" cluster */ -qboolean ClusterVisibleToPoint( vec3_t point, int cluster ){ +bool ClusterVisibleToPoint( vec3_t point, int cluster ){ int pointCluster; /* get leafNum for point */ pointCluster = ClusterForPoint( point ); if ( pointCluster < 0 ) { - return qfalse; + return false; } /* check pvs */ @@ -3396,7 +3396,7 @@ int ClusterForPoint( vec3_t point ){ int ClusterForPointExt( vec3_t point, float epsilon ){ int i, j, b, leafNum, cluster; float dot; - qboolean inside; + bool inside; int *brushes, numBSPBrushes; bspLeaf_t *leaf; bspBrush_t *brush; @@ -3432,14 +3432,14 @@ int ClusterForPointExt( vec3_t point, float epsilon ){ } /* check point against all planes */ - inside = qtrue; + inside = true; for ( j = 0; j < brush->numSides && inside; j++ ) { plane = &bspPlanes[ bspBrushSides[ brush->firstSide + j ].planeNum ]; dot = DotProduct( point, plane->normal ); dot -= plane->dist; if ( dot > epsilon ) { - inside = qfalse; + inside = false; } } @@ -3495,7 +3495,7 @@ int ClusterForPointExtFilter( vec3_t point, float epsilon, int numClusters, int int ShaderForPointInLeaf( vec3_t point, int leafNum, float epsilon, int wantContentFlags, int wantSurfaceFlags, int *contentFlags, int *surfaceFlags ){ int i, j; float dot; - qboolean inside; + bool inside; int *brushes, numBSPBrushes; bspLeaf_t *leaf; bspBrush_t *brush; @@ -3524,7 +3524,7 @@ int ShaderForPointInLeaf( vec3_t point, int leafNum, float epsilon, int wantCont brush = &bspBrushes[ brushes[ i ] ]; /* check point against all planes */ - inside = qtrue; + inside = true; allSurfaceFlags = 0; allContentFlags = 0; for ( j = 0; j < brush->numSides && inside; j++ ) @@ -3534,7 +3534,7 @@ int ShaderForPointInLeaf( vec3_t point, int leafNum, float epsilon, int wantCont dot = DotProduct( point, plane->normal ); dot -= plane->dist; if ( dot > epsilon ) { - inside = qfalse; + inside = false; } else { @@ -3570,14 +3570,14 @@ int ShaderForPointInLeaf( vec3_t point, int leafNum, float epsilon, int wantCont /* ChopBounds() chops a bounding box by the plane defined by origin and normal - returns qfalse if the bounds is entirely clipped away + returns false if the bounds is entirely clipped away this is not exactly the fastest way to do this... */ -qboolean ChopBounds( vec3_t mins, vec3_t maxs, vec3_t origin, vec3_t normal ){ +bool ChopBounds( vec3_t mins, vec3_t maxs, vec3_t origin, vec3_t normal ){ /* FIXME: rewrite this so it doesn't use bloody brushes */ - return qtrue; + return true; } @@ -3591,7 +3591,7 @@ qboolean ChopBounds( vec3_t mins, vec3_t maxs, vec3_t origin, vec3_t normal ){ #define LIGHT_EPSILON 0.125f #define LIGHT_NUDGE 2.0f -void SetupEnvelopes( qboolean forGrid, qboolean fastFlag ){ +void SetupEnvelopes( bool forGrid, bool fastFlag ){ int i, x, y, z, x1, y1, z1; light_t *light, *light2, **owner; bspLeaf_t *leaf; @@ -3786,7 +3786,7 @@ void SetupEnvelopes( qboolean forGrid, qboolean fastFlag ){ if ( leaf->cluster < 0 ) { continue; } - if ( ClusterVisible( light->cluster, leaf->cluster ) == qfalse ) { /* ydnar: thanks Arnout for exposing my stupid error (this never failed before) */ + if ( !ClusterVisible( light->cluster, leaf->cluster ) ) { /* ydnar: thanks Arnout for exposing my stupid error (this never failed before) */ continue; } @@ -3893,7 +3893,7 @@ void SetupEnvelopes( qboolean forGrid, qboolean fastFlag ){ /* if any styled light is present, automatically set nocollapse */ if ( light->style != LS_NORMAL ) { - noCollapse = qtrue; + noCollapse = true; } } @@ -3931,7 +3931,7 @@ void CreateTraceLightsForBounds( vec3_t mins, vec3_t maxs, vec3_t normal, int nu /* potential pre-setup */ if ( numLights == 0 ) { - SetupEnvelopes( qfalse, fast ); + SetupEnvelopes( false, fast ); } /* debug code */ @@ -4007,11 +4007,11 @@ void CreateTraceLightsForBounds( vec3_t mins, vec3_t maxs, vec3_t normal, int nu /* check bounding box against light's pvs envelope (note: this code never eliminated any lights, so disabling it) */ #if 0 - skip = qfalse; + bool skip = false; for ( i = 0; i < 3; i++ ) { if ( mins[ i ] > light->maxs[ i ] || maxs[ i ] < light->mins[ i ] ) { - skip = qtrue; + skip = true; } } if ( skip ) { @@ -4022,7 +4022,7 @@ void CreateTraceLightsForBounds( vec3_t mins, vec3_t maxs, vec3_t normal, int nu } /* planar surfaces (except twosided surfaces) have a couple more checks */ - if ( length > 0.0f && trace->twoSided == qfalse ) { + if ( length > 0.0f && !trace->twoSided ) { /* lights coplanar with a surface won't light it */ if ( !( light->flags & LIGHT_TWOSIDED ) && DotProduct( light->normal, normal ) > 0.999f ) { lightsPlaneCulled++; @@ -4163,7 +4163,7 @@ void SetupFloodLight( void ){ floodlightIntensity = v5; floodlightDirectionScale = v6; - floodlighty = qtrue; + floodlighty = true; Sys_Printf( "FloodLighting enabled via worldspawn _floodlight key.\n" ); } else @@ -4184,7 +4184,7 @@ void SetupFloodLight( void ){ once again, kudos to the dirtmapping coder */ -float FloodLightForSample( trace_t *trace, float floodLightDistance, qboolean floodLightLowQuality ){ +float FloodLightForSample( trace_t *trace, float floodLightDistance, bool floodLightLowQuality ){ int i; float d; float contribution; @@ -4228,7 +4228,7 @@ float FloodLightForSample( trace_t *trace, float floodLightDistance, qboolean fl } /* vortex: optimise floodLightLowQuality a bit */ - if ( floodLightLowQuality == qtrue ) { + if ( floodLightLowQuality ) { /* iterate through ordered vectors */ for ( i = 0; i < numFloodVectors; i++ ) if ( rand() % 10 != 0 ) { @@ -4309,7 +4309,7 @@ float FloodLightForSample( trace_t *trace, float floodLightDistance, qboolean fl */ // floodlight pass on a lightmap -void FloodLightRawLightmapPass( rawLightmap_t *lm, vec3_t lmFloodLightRGB, float lmFloodLightIntensity, float lmFloodLightDistance, qboolean lmFloodLightLowQuality, float floodlightDirectionScale ){ +void FloodLightRawLightmapPass( rawLightmap_t *lm, vec3_t lmFloodLightRGB, float lmFloodLightIntensity, float lmFloodLightDistance, bool lmFloodLightLowQuality, float floodlightDirectionScale ){ int i, x, y, *cluster; float *origin, *normal, *floodlight, floodLightAmount; surfaceInfo_t *info; @@ -4320,18 +4320,18 @@ void FloodLightRawLightmapPass( rawLightmap_t *lm, vec3_t lmFloodLightRGB, float memset( &trace,0,sizeof( trace_t ) ); /* setup trace */ - trace.testOcclusion = qtrue; - trace.forceSunlight = qfalse; - trace.twoSided = qtrue; + trace.testOcclusion = true; + trace.forceSunlight = false; + trace.twoSided = true; trace.recvShadows = lm->recvShadows; trace.numSurfaces = lm->numLightSurfaces; trace.surfaces = &lightSurfaces[ lm->firstLightSurface ]; trace.inhibitRadius = DEFAULT_INHIBIT_RADIUS; - trace.testAll = qfalse; + trace.testAll = false; trace.distance = 1024; /* twosided lighting (may or may not be a good idea for lightmapped stuff) */ - //trace.twoSided = qfalse; + //trace.twoSided = false; for ( i = 0; i < trace.numSurfaces; i++ ) { /* get surface */ @@ -4339,7 +4339,7 @@ void FloodLightRawLightmapPass( rawLightmap_t *lm, vec3_t lmFloodLightRGB, float /* check twosidedness */ if ( info->si->twoSided ) { - trace.twoSided = qtrue; + trace.twoSided = true; break; } } @@ -4455,7 +4455,7 @@ void FloodLightRawLightmap( int rawLightmapNum ){ /* custom pass */ if ( lm->floodlightIntensity ) { - FloodLightRawLightmapPass( lm, lm->floodlightRGB, lm->floodlightIntensity, lm->floodlightDistance, qfalse, lm->floodlightDirectionScale ); + FloodLightRawLightmapPass( lm, lm->floodlightRGB, lm->floodlightIntensity, lm->floodlightDistance, false, lm->floodlightDirectionScale ); numSurfacesFloodlighten += 1; } } @@ -4463,7 +4463,7 @@ void FloodLightRawLightmap( int rawLightmapNum ){ void FloodlightRawLightmaps(){ Sys_Printf( "--- FloodlightRawLightmap ---\n" ); numSurfacesFloodlighten = 0; - RunThreadsOnIndividual( numRawLightmaps, qtrue, FloodLightRawLightmap ); + RunThreadsOnIndividual( numRawLightmaps, true, FloodLightRawLightmap ); Sys_Printf( "%9d custom lightmaps floodlighted\n", numSurfacesFloodlighten ); } diff --git a/tools/quake3/q3map2/lightmaps.c b/tools/quake3/q3map2/lightmaps.c index d0893973..c5d2d65b 100644 --- a/tools/quake3/q3map2/lightmaps.c +++ b/tools/quake3/q3map2/lightmaps.c @@ -48,7 +48,7 @@ void PrepareNewLightmap( void ) { returns a texture number and the position inside it =============== */ -qboolean AllocLMBlock( int w, int h, int *x, int *y ){ +bool AllocLMBlock( int w, int h, int *x, int *y ){ int i, j; int best, best2; @@ -72,14 +72,14 @@ qboolean AllocLMBlock( int w, int h, int *x, int *y ){ } if ( best + h > LIGHTMAP_HEIGHT ) { - return qfalse; + return false; } for ( i = 0 ; i < w ; i++ ) { allocated[*x + i] = best + h; } - return qtrue; + return true; } diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index 531a5819..24371c9b 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -59,7 +59,7 @@ based on WriteTGA() from imagelib.c */ -void WriteTGA24( char *filename, byte *data, int width, int height, qboolean flip ){ +void WriteTGA24( char *filename, byte *data, int width, int height, bool flip ){ int i; const int headSz = 18; const int sz = width * height * 3 + headSz; @@ -141,7 +141,7 @@ void ExportLightmaps( void ){ /* write a tga image out */ sprintf( filename, "%s/lightmap_%04d.tga", dirname, i ); Sys_Printf( "Writing %s\n", filename ); - WriteTGA24( filename, lightmap, game->lightmapSize, game->lightmapSize, qfalse ); + WriteTGA24( filename, lightmap, game->lightmapSize, game->lightmapSize, false ); } } @@ -458,7 +458,7 @@ void FinishRawLightmap( rawLightmap_t *lm ){ based on AllocateLightmapForPatch() */ -qboolean AddPatchToRawLightmap( int num, rawLightmap_t *lm ){ +bool AddPatchToRawLightmap( int num, rawLightmap_t *lm ){ bspDrawSurface_t *ds; surfaceInfo_t *info; int x, y; @@ -470,7 +470,7 @@ qboolean AddPatchToRawLightmap( int num, rawLightmap_t *lm ){ /* patches finish a raw lightmap */ - lm->finished = qtrue; + lm->finished = true; /* get surface and info */ ds = &bspDrawSurfaces[ num ]; @@ -548,8 +548,8 @@ qboolean AddPatchToRawLightmap( int num, rawLightmap_t *lm ){ FreeMesh( mesh ); /* set the lightmap texture coordinates in yDrawVerts */ - lm->wrap[ 0 ] = qtrue; - lm->wrap[ 1 ] = qtrue; + lm->wrap[ 0 ] = true; + lm->wrap[ 1 ] = true; verts = &yDrawVerts[ ds->firstVert ]; for ( y = 0; y < ds->patchHeight; y++ ) { @@ -561,12 +561,12 @@ qboolean AddPatchToRawLightmap( int num, rawLightmap_t *lm ){ verts[ ( y * ds->patchWidth ) + x ].lightmap[ 0 ][ 1 ] = t * superSample; if ( y == 0 && !VectorCompare( verts[ x ].xyz, verts[ ( ( ds->patchHeight - 1 ) * ds->patchWidth ) + x ].xyz ) ) { - lm->wrap[ 1 ] = qfalse; + lm->wrap[ 1 ] = false; } } if ( !VectorCompare( verts[ ( y * ds->patchWidth ) ].xyz, verts[ ( y * ds->patchWidth ) + ( ds->patchWidth - 1 ) ].xyz ) ) { - lm->wrap[ 0 ] = qfalse; + lm->wrap[ 0 ] = false; } } @@ -581,7 +581,7 @@ qboolean AddPatchToRawLightmap( int num, rawLightmap_t *lm ){ numPatchesLightmapped++; /* return */ - return qtrue; + return true; } @@ -592,7 +592,7 @@ qboolean AddPatchToRawLightmap( int num, rawLightmap_t *lm ){ based on AllocateLightmapForSurface() */ -qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){ +bool AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){ bspDrawSurface_t *ds, *ds2; surfaceInfo_t *info; int num2, n, i, axisNum; @@ -613,8 +613,8 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){ /* does this raw lightmap already have any surfaces? */ if ( lm->numLightSurfaces > 1 ) { /* surface and raw lightmap must have the same lightmap projection axis */ - if ( VectorCompare( info->axis, lm->axis ) == qfalse ) { - return qfalse; + if ( !VectorCompare( info->axis, lm->axis ) ) { + return false; } /* match identical attributes */ @@ -626,36 +626,36 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){ info->si->lmBrightness != lm->brightness || info->si->lmFilterRadius != lm->filterRadius || info->si->splotchFix != lm->splotchFix ) { - return qfalse; + return false; } /* surface bounds must intersect with raw lightmap bounds */ for ( i = 0; i < 3; i++ ) { if ( info->mins[ i ] > lm->maxs[ i ] ) { - return qfalse; + return false; } if ( info->maxs[ i ] < lm->mins[ i ] ) { - return qfalse; + return false; } } /* plane check (fixme: allow merging of nonplanars) */ - if ( info->si->lmMergable == qfalse ) { + if ( !info->si->lmMergable ) { if ( info->plane == NULL || lm->plane == NULL ) { - return qfalse; + return false; } /* compare planes */ for ( i = 0; i < 4; i++ ) if ( fabs( info->plane[ i ] - lm->plane[ i ] ) > EQUAL_EPSILON ) { - return qfalse; + return false; } } /* debug code hacking */ //% if( lm->numLightSurfaces > 1 ) - //% return qfalse; + //% return false; } /* set plane */ @@ -768,7 +768,7 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){ if ( faxis[ axisNum ] == 0.0f ) { Sys_Warning( "ProjectSurfaceLightmap: Chose a 0 valued axis\n" ); lm->w = lm->h = 0; - return qfalse; + return false; } /* store the axis number in the lightmap */ @@ -860,7 +860,7 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){ } /* return */ - return qtrue; + return true; } @@ -972,7 +972,7 @@ void SetupSurfaceLightmaps( void ){ bspDrawSurface_t *ds; surfaceInfo_t *info, *info2; rawLightmap_t *lm; - qboolean added; + bool added; vec3_t mapSize, entityOrigin; @@ -1103,13 +1103,13 @@ void SetupSurfaceLightmaps( void ){ if ( ds->surfaceType == MST_TRIANGLE_SOUP || ds->surfaceType == MST_FOLIAGE || ( info->si->compileFlags & C_VERTEXLIT ) || - nolm == qtrue ) { + nolm ) { numSurfsVertexLit++; } else { numSurfsLightmapped++; - info->hasLightmap = qtrue; + info->hasLightmap = true; } } } @@ -1137,7 +1137,7 @@ void SetupSurfaceLightmaps( void ){ num = sortSurfaces[ i ]; ds = &bspDrawSurfaces[ num ]; info = &surfaceInfos[ num ]; - if ( info->hasLightmap == qfalse || info->lm != NULL || info->parentSurfaceNum >= 0 ) { + if ( !info->hasLightmap || info->lm != NULL || info->parentSurfaceNum >= 0 ) { continue; } @@ -1178,24 +1178,24 @@ void SetupSurfaceLightmaps( void ){ info->lm = lm; /* do an exhaustive merge */ - added = qtrue; + added = true; while ( added ) { /* walk the list of surfaces again */ - added = qfalse; - for ( j = i + 1; j < numBSPDrawSurfaces && lm->finished == qfalse; j++ ) + added = false; + for ( j = i + 1; j < numBSPDrawSurfaces && !lm->finished; j++ ) { /* get info and attempt early out */ num2 = sortSurfaces[ j ]; info2 = &surfaceInfos[ num2 ]; - if ( info2->hasLightmap == qfalse || info2->lm != NULL ) { + if ( !info2->hasLightmap || info2->lm != NULL ) { continue; } /* add the surface to the raw lightmap */ if ( AddSurfaceToRawLightmap( num2, lm ) ) { info2->lm = lm; - added = qtrue; + added = true; } else { @@ -1408,7 +1408,7 @@ void StitchSurfaceLightmaps( void ){ #define LUXEL_TOLERANCE 0.0025 #define LUXEL_COLOR_FRAC 0.001302083 /* 1 / 3 / 256 */ -static qboolean CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int bNum ){ +static bool CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int bNum ){ rawLightmap_t *lm; int x, y; double delta, total, rd, gd, bd; @@ -1418,7 +1418,7 @@ static qboolean CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, /* styled lightmaps will never be collapsed to non-styled lightmaps when there is _minlight */ if ( ( minLight[ 0 ] || minLight[ 1 ] || minLight[ 2 ] ) && ( ( aNum == 0 && bNum != 0 ) || ( aNum != 0 && bNum == 0 ) ) ) { - return qfalse; + return false; } /* basic tests */ @@ -1426,7 +1426,7 @@ static qboolean CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, a->brightness != b->brightness || a->solid[ aNum ] != b->solid[ bNum ] || a->bspLuxels[ aNum ] == NULL || b->bspLuxels[ bNum ] == NULL ) { - return qfalse; + return false; } /* compare solid color lightmaps */ @@ -1438,16 +1438,16 @@ static qboolean CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, /* compare color */ if ( rd > SOLID_EPSILON || gd > SOLID_EPSILON || bd > SOLID_EPSILON ) { - return qfalse; + return false; } /* okay */ - return qtrue; + return true; } /* compare nonsolid lightmaps */ if ( a->w != b->w || a->h != b->h ) { - return qfalse; + return false; } /* compare luxels */ @@ -1476,7 +1476,7 @@ static qboolean CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, /* 2003-09-27: compare individual luxels */ if ( rd > 3.0 || gd > 3.0 || bd > 3.0 ) { - return qfalse; + return false; } /* compare (fixme: take into account perceptual differences) */ @@ -1486,13 +1486,13 @@ static qboolean CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, /* is the change too high? */ if ( total > 0.0 && ( ( delta / total ) > LUXEL_TOLERANCE ) ) { - return qfalse; + return false; } } } /* made it this far, they must be identical (or close enough) */ - return qtrue; + return true; } @@ -1502,7 +1502,7 @@ static qboolean CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, merges two surface lightmaps' bsp luxels, overwriting occluded luxels */ -static qboolean MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int bNum ){ +static bool MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int bNum ){ rawLightmap_t *lm; int x, y; float luxel[ 3 ], *aLuxel, *bLuxel; @@ -1513,7 +1513,7 @@ static qboolean MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, in a->brightness != b->brightness || a->solid[ aNum ] != b->solid[ bNum ] || a->bspLuxels[ aNum ] == NULL || b->bspLuxels[ bNum ] == NULL ) { - return qfalse; + return false; } /* compare solid lightmaps */ @@ -1527,12 +1527,12 @@ static qboolean MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, in VectorCopy( luxel, b->solidColor[ bNum ] ); /* return to sender */ - return qtrue; + return true; } /* compare nonsolid lightmaps */ if ( a->w != b->w || a->h != b->h ) { - return qfalse; + return false; } /* merge luxels */ @@ -1568,7 +1568,7 @@ static qboolean MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, in } /* done */ - return qtrue; + return true; } @@ -1578,7 +1578,7 @@ static qboolean MergeBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, in determines if a single luxel is can be approximated with the interpolated vertex rgba */ -static qboolean ApproximateLuxel( rawLightmap_t *lm, bspDrawVert_t *dv ){ +static bool ApproximateLuxel( rawLightmap_t *lm, bspDrawVert_t *dv ){ int i, x, y, d, lightmapNum; float *luxel; vec3_t color, vertexColor; @@ -1614,7 +1614,7 @@ static qboolean ApproximateLuxel( rawLightmap_t *lm, bspDrawVert_t *dv ){ /* ignore occluded luxels */ if ( luxel[ 0 ] < 0.0f || luxel[ 1 ] < 0.0f || luxel[ 2 ] < 0.0f ) { - return qtrue; + return true; } /* copy, set min color and compare */ @@ -1647,13 +1647,13 @@ static qboolean ApproximateLuxel( rawLightmap_t *lm, bspDrawVert_t *dv ){ d *= -1; } if ( d > approximateTolerance ) { - return qfalse; + return false; } } } /* close enough for the girls i date */ - return qtrue; + return true; } @@ -1663,20 +1663,20 @@ static qboolean ApproximateLuxel( rawLightmap_t *lm, bspDrawVert_t *dv ){ determines if a single triangle can be approximated with vertex rgba */ -static qboolean ApproximateTriangle_r( rawLightmap_t *lm, bspDrawVert_t *dv[ 3 ] ){ +static bool ApproximateTriangle_r( rawLightmap_t *lm, bspDrawVert_t *dv[ 3 ] ){ bspDrawVert_t mid, *dv2[ 3 ]; int max; /* approximate the vertexes */ - if ( ApproximateLuxel( lm, dv[ 0 ] ) == qfalse ) { - return qfalse; + if ( !ApproximateLuxel( lm, dv[ 0 ] ) ) { + return false; } - if ( ApproximateLuxel( lm, dv[ 1 ] ) == qfalse ) { - return qfalse; + if ( !ApproximateLuxel( lm, dv[ 1 ] ) ) { + return false; } - if ( ApproximateLuxel( lm, dv[ 2 ] ) == qfalse ) { - return qfalse; + if ( !ApproximateLuxel( lm, dv[ 2 ] ) ) { + return false; } /* subdivide calc */ @@ -1701,21 +1701,21 @@ static qboolean ApproximateTriangle_r( rawLightmap_t *lm, bspDrawVert_t *dv[ 3 ] /* try to early out */ if ( i < 0 || maxDist < subdivideThreshold ) { - return qtrue; + return true; } } /* split the longest edge and map it */ LerpDrawVert( dv[ max ], dv[ ( max + 1 ) % 3 ], &mid ); - if ( ApproximateLuxel( lm, &mid ) == qfalse ) { - return qfalse; + if ( !ApproximateLuxel( lm, &mid ) ) { + return false; } /* recurse to first triangle */ VectorCopy( dv, dv2 ); dv2[ max ] = ∣ - if ( ApproximateTriangle_r( lm, dv2 ) == qfalse ) { - return qfalse; + if ( !ApproximateTriangle_r( lm, dv2 ) ) { + return false; } /* recurse to second triangle */ @@ -1731,38 +1731,38 @@ static qboolean ApproximateTriangle_r( rawLightmap_t *lm, bspDrawVert_t *dv[ 3 ] determines if a raw lightmap can be approximated sufficiently with vertex colors */ -static qboolean ApproximateLightmap( rawLightmap_t *lm ){ +static bool ApproximateLightmap( rawLightmap_t *lm ){ int n, num, i, x, y, pw[ 5 ], r; bspDrawSurface_t *ds; surfaceInfo_t *info; mesh_t src, *subdivided, *mesh; bspDrawVert_t *verts, *dv[ 3 ]; - qboolean approximated; + bool approximated; /* approximating? */ if ( approximateTolerance <= 0 ) { - return qfalse; + return false; } /* test for jmonroe */ #if 0 /* don't approx lightmaps with styled twins */ if ( lm->numStyledTwins > 0 ) { - return qfalse; + return false; } /* don't approx lightmaps with styles */ for ( i = 1; i < MAX_LIGHTMAPS; i++ ) { if ( lm->styles[ i ] != LS_NONE ) { - return qfalse; + return false; } } #endif /* assume reduced until shadow detail is found */ - approximated = qtrue; + approximated = true; /* walk the list of surfaces on this raw lightmap */ for ( n = 0; n < lm->numLightSurfaces; n++ ) @@ -1773,7 +1773,7 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ){ info = &surfaceInfos[ num ]; /* assume not-reduced initially */ - info->approximated = qfalse; + info->approximated = false; /* bail if lightmap doesn't match up */ if ( info->lm != lm ) { @@ -1789,7 +1789,7 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ){ if ( ( info->maxs[ 0 ] - info->mins[ 0 ] ) <= ( 2.0f * info->sampleSize ) && ( info->maxs[ 1 ] - info->mins[ 1 ] ) <= ( 2.0f * info->sampleSize ) && ( info->maxs[ 2 ] - info->mins[ 2 ] ) <= ( 2.0f * info->sampleSize ) ) { - info->approximated = qtrue; + info->approximated = true; numSurfsVertexForced++; continue; } @@ -1802,7 +1802,7 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ){ verts = yDrawVerts + ds->firstVert; /* map the triangles */ - info->approximated = qtrue; + info->approximated = true; for ( i = 0; i < ds->numIndexes && info->approximated; i += 3 ) { dv[ 0 ] = &verts[ bspDrawIndexes[ ds->firstIndex + i ] ]; @@ -1829,7 +1829,7 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ){ verts = mesh->verts; /* map the mesh quads */ - info->approximated = qtrue; + info->approximated = true; for ( y = 0; y < ( mesh->height - 1 ) && info->approximated; y++ ) { for ( x = 0; x < ( mesh->width - 1 ) && info->approximated; x++ ) @@ -1869,8 +1869,8 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ){ } /* reduced? */ - if ( info->approximated == qfalse ) { - approximated = qfalse; + if ( !info->approximated ) { + approximated = false; } else{ numSurfsVertexApproximated++; @@ -1888,23 +1888,23 @@ static qboolean ApproximateLightmap( rawLightmap_t *lm ){ tests a stamp on a given lightmap for validity */ -static qboolean TestOutLightmapStamp( rawLightmap_t *lm, int lightmapNum, outLightmap_t *olm, int x, int y ){ +static bool TestOutLightmapStamp( rawLightmap_t *lm, int lightmapNum, outLightmap_t *olm, int x, int y ){ int sx, sy, ox, oy, offset; float *luxel; /* bounds check */ if ( x < 0 || y < 0 || ( x + lm->w ) > olm->customWidth || ( y + lm->h ) > olm->customHeight ) { - return qfalse; + return false; } /* solid lightmaps test a 1x1 stamp */ if ( lm->solid[ lightmapNum ] ) { offset = ( y * olm->customWidth ) + x; if ( olm->lightBits[ offset >> 3 ] & ( 1 << ( offset & 7 ) ) ) { - return qfalse; + return false; } - return qtrue; + return true; } /* test the stamp */ @@ -1923,13 +1923,13 @@ static qboolean TestOutLightmapStamp( rawLightmap_t *lm, int lightmapNum, outLig oy = y + sy; offset = ( oy * olm->customWidth ) + ox; if ( olm->lightBits[ offset >> 3 ] & ( 1 << ( offset & 7 ) ) ) { - return qfalse; + return false; } } } /* stamp is empty */ - return qtrue; + return true; } @@ -1985,14 +1985,14 @@ static void SetupOutLightmap( rawLightmap_t *lm, outLightmap_t *olm ){ */ #define LIGHTMAP_RESERVE_COUNT 1 -static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){ +static void FindOutLightmaps( rawLightmap_t *lm, bool fastAllocate ){ int i, j, k, lightmapNum, xMax, yMax, x = -1, y = -1, sx, sy, ox, oy, offset; outLightmap_t *olm; surfaceInfo_t *info; float *luxel, *deluxel; vec3_t color, direction; byte *pixel; - qboolean ok; + bool ok; int xIncrement, yIncrement; @@ -2019,7 +2019,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){ } /* if this is a styled lightmap, try some normalized locations first */ - ok = qfalse; + ok = false; if ( lightmapNum > 0 && outLightmaps != NULL ) { /* loop twice */ for ( j = 0; j < 2; j++ ) @@ -2082,7 +2082,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){ } /* try normal placement algorithm */ - if ( ok == qfalse ) { + if ( !ok ) { /* reset origin */ x = 0; y = 0; @@ -2105,7 +2105,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){ } /* if fast allocation, skip lightmap files that are more than 90% complete */ - if ( fastAllocate == qtrue ) { + if ( fastAllocate ) { if (olm->freeLuxels < (olm->customWidth * olm->customHeight) / 10) { continue; } @@ -2129,7 +2129,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){ } /* if fast allocation, do not test allocation on every pixels, especially for large lightmaps */ - if ( fastAllocate == qtrue ) { + if ( fastAllocate ) { xIncrement = MAX(1, lm->w / 15); yIncrement = MAX(1, lm->h / 15); } @@ -2167,7 +2167,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){ } /* no match? */ - if ( ok == qfalse ) { + if ( !ok ) { /* allocate LIGHTMAP_RESERVE_COUNT new output lightmaps */ numOutLightmaps += LIGHTMAP_RESERVE_COUNT; olm = safe_malloc_info( numOutLightmaps * sizeof( outLightmap_t ), "FindOutLightmaps" ); @@ -2479,7 +2479,7 @@ void FillOutLightmap( outLightmap_t *olm ){ stores the surface lightmaps into the bsp as byte rgb triplets */ -void StoreSurfaceLightmaps( qboolean fastAllocate ){ +void StoreSurfaceLightmaps( bool fastAllocate ){ int i, j, k, x, y, lx, ly, sx, sy, *cluster, mappedSamples, timer_start; int style, size, lightmapNum, lightmapNum2; float *normal, *luxel, *bspLuxel, *bspLuxel2, *radLuxel, samples, occludedSamples; @@ -2790,19 +2790,19 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ } /* set solid color */ - lm->solid[ lightmapNum ] = qfalse; + lm->solid[ lightmapNum ] = false; VectorAdd( colorMins, colorMaxs, lm->solidColor[ lightmapNum ] ); VectorScale( lm->solidColor[ lightmapNum ], 0.5f, lm->solidColor[ lightmapNum ] ); /* nocollapse prevents solid lightmaps */ - if ( noCollapse == qfalse ) { + if ( !noCollapse ) { /* check solid color */ VectorSubtract( colorMaxs, colorMins, sample ); if ( ( sample[ 0 ] <= SOLID_EPSILON && sample[ 1 ] <= SOLID_EPSILON && sample[ 2 ] <= SOLID_EPSILON ) || ( lm->w <= 2 && lm->h <= 2 ) ) { /* small lightmaps get forced to solid color */ /* set to solid */ VectorCopy( colorMins, lm->solidColor[ lightmapNum ] ); - lm->solid[ lightmapNum ] = qtrue; + lm->solid[ lightmapNum ] = true; numSolidLightmaps++; } @@ -2813,7 +2813,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ if ( lm->solid[ y ] ) { numSolidLightmaps--; } - lm->solid[ y ] = qfalse; + lm->solid[ y ] = false; } } } @@ -2992,7 +2992,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ collapse non-unique lightmaps ----------------------------------------------------------------- */ - if ( noCollapse == qfalse && deluxemap == qfalse ) { + if ( !noCollapse && !deluxemap ) { /* note it */ Sys_Printf( "collapsing..." ); @@ -3203,14 +3203,14 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ /* write lightmap */ sprintf( filename, "%s/" EXTERNAL_LIGHTMAP, dirname, numExtLightmaps ); Sys_FPrintf( SYS_VRB, "\nwriting %s", filename ); - WriteTGA24( filename, olm->bspLightBytes, olm->customWidth, olm->customHeight, qtrue ); + WriteTGA24( filename, olm->bspLightBytes, olm->customWidth, olm->customHeight, true ); numExtLightmaps++; /* write deluxemap */ if ( deluxemap ) { sprintf( filename, "%s/" EXTERNAL_LIGHTMAP, dirname, numExtLightmaps ); Sys_FPrintf( SYS_VRB, "\nwriting %s", filename ); - WriteTGA24( filename, olm->bspDirBytes, olm->customWidth, olm->customHeight, qtrue ); + WriteTGA24( filename, olm->bspDirBytes, olm->customWidth, olm->customHeight, true ); numExtLightmaps++; if ( debugDeluxemap ) { @@ -3377,7 +3377,6 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ /* surfaces with styled lightmaps and a style marker get a custom generated shader (fixme: make this work with external lightmaps) */ if ( olm != NULL && lm != NULL && lm->styles[ 1 ] != LS_NONE && game->load != LoadRBSPFile ) { //% info->si->styleMarker > 0 ) - qboolean dfEqual; char key[ 32 ], styleStage[ 512 ], styleStages[ 4096 ], rgbGen[ 128 ], alphaGen[ 128 ]; @@ -3386,12 +3385,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){ dv = &bspDrawVerts[ ds->firstVert ]; /* depthFunc equal? */ - if ( info->si->styleMarker == 2 || info->si->implicitMap == IM_MASKED ) { - dfEqual = qtrue; - } - else{ - dfEqual = qfalse; - } + const bool dfEqual = ( info->si->styleMarker == 2 || info->si->implicitMap == IM_MASKED ); /* generate stages for styled lightmaps */ for ( lightmapNum = 1; lightmapNum < MAX_LIGHTMAPS; lightmapNum++ ) diff --git a/tools/quake3/q3map2/main.c b/tools/quake3/q3map2/main.c index 90a4668b..cd88461a 100644 --- a/tools/quake3/q3map2/main.c +++ b/tools/quake3/q3map2/main.c @@ -101,14 +101,14 @@ int main( int argc, char **argv ){ /* verbose */ else if ( !strcmp( argv[ i ], "-v" ) ) { if ( !verbose ) { - verbose = qtrue; + verbose = true; argv[ i ] = NULL; } } /* force */ else if ( !strcmp( argv[ i ], "-force" ) ) { - force = qtrue; + force = true; argv[ i ] = NULL; } @@ -138,7 +138,7 @@ int main( int argc, char **argv ){ else if( !strcmp( argv[ i ], "-nocmdline" ) ) { Sys_Printf( "noCmdLine\n" ); - nocmdline = qtrue; + nocmdline = true; argv[ i ] = NULL; } diff --git a/tools/quake3/q3map2/map.c b/tools/quake3/q3map2/map.c index 0ab7ead4..f3a088c9 100644 --- a/tools/quake3/q3map2/map.c +++ b/tools/quake3/q3map2/map.c @@ -59,7 +59,7 @@ int c_structural; ydnar: replaced with variable epsilon for djbob */ -qboolean PlaneEqual( plane_t *p, vec3_t normal, vec_t dist ){ +bool PlaneEqual( plane_t *p, vec3_t normal, vec_t dist ){ float ne, de; @@ -76,11 +76,11 @@ qboolean PlaneEqual( plane_t *p, vec3_t normal, vec_t dist ){ ( p->normal[0] == normal[0] || fabs( p->normal[0] - normal[0] ) < ne ) && ( p->normal[1] == normal[1] || fabs( p->normal[1] - normal[1] ) < ne ) && ( p->normal[2] == normal[2] || fabs( p->normal[2] - normal[2] ) < ne ) ) { - return qtrue; + return true; } /* different */ - return qfalse; + return false; } @@ -149,13 +149,13 @@ int CreateNewFloatPlane( vec3_t normal, vec_t dist ){ /* SnapNormal() Snaps a near-axial normal vector. - Returns qtrue if and only if the normal was adjusted. + Returns true if and only if the normal was adjusted. */ -qboolean SnapNormal( vec3_t normal ){ +bool SnapNormal( vec3_t normal ){ #if Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX int i; - qboolean adjusted = qfalse; + bool adjusted = false; // A change from the original SnapNormal() is that we snap each // component that's close to 0. So for example if a normal is @@ -170,15 +170,15 @@ qboolean SnapNormal( vec3_t normal ){ if ( ( normal[0] != 0.0 || normal[1] != 0.0 ) && fabs(normal[0]) < 0.00025 && fabs(normal[1]) < 0.00025){ normal[0] = normal[1] = 0.0; - adjusted = qtrue; + adjusted = true; } else if ( ( normal[0] != 0.0 || normal[2] != 0.0 ) && fabs(normal[0]) < 0.00025 && fabs(normal[2]) < 0.00025){ normal[0] = normal[2] = 0.0; - adjusted = qtrue; + adjusted = true; } else if ( ( normal[2] != 0.0 || normal[1] != 0.0 ) && fabs(normal[2]) < 0.00025 && fabs(normal[1]) < 0.00025){ normal[2] = normal[1] = 0.0; - adjusted = qtrue; + adjusted = true; } @@ -206,15 +206,15 @@ qboolean SnapNormal( vec3_t normal ){ { if ( normal[i] != 0.0 && -normalEpsilon < normal[i] && normal[i] < normalEpsilon ) { normal[i] = 0.0; - adjusted = qtrue; + adjusted = true; } } if ( adjusted ) { VectorNormalize( normal, normal ); - return qtrue; + return true; } - return qfalse; + return false; #else int i; @@ -256,15 +256,15 @@ qboolean SnapNormal( vec3_t normal ){ if ( fabs( normal[ i ] - 1 ) < normalEpsilon ) { VectorClear( normal ); normal[ i ] = 1; - return qtrue; + return true; } if ( fabs( normal[ i ] - -1 ) < normalEpsilon ) { VectorClear( normal ); normal[ i ] = -1; - return qtrue; + return true; } } - return qfalse; + return false; #endif } @@ -517,7 +517,7 @@ void SetBrushContents( brush_t *b ){ int contentFlags, compileFlags; side_t *s; int i; - //% qboolean mixed; + //% bool mixed; /* get initial compile flags from first side */ @@ -525,7 +525,7 @@ void SetBrushContents( brush_t *b ){ contentFlags = s->contentFlags; compileFlags = s->compileFlags; b->contentShader = s->shaderInfo; - //% mixed = qfalse; + //% mixed = false; /* get the content/compile flags for every side in the brush */ //for ( i = 1; i < b->numsides; i++, s++ ) @@ -536,7 +536,7 @@ void SetBrushContents( brush_t *b ){ continue; } //% if( s->contentFlags != contentFlags || s->compileFlags != compileFlags ) - //% mixed = qtrue; + //% mixed = true; contentFlags |= s->contentFlags; compileFlags |= s->compileFlags; @@ -575,7 +575,7 @@ void SetBrushContents( brush_t *b ){ /* check for detail & structural */ if ( ( compileFlags & C_DETAIL ) && ( compileFlags & C_STRUCTURAL ) ) { - xml_Select( "Mixed detail and structural (defaulting to structural)", mapEnt->mapEntityNum, entitySourceBrushes, qfalse ); + xml_Select( "Mixed detail and structural (defaulting to structural)", mapEnt->mapEntityNum, entitySourceBrushes, false ); compileFlags &= ~C_DETAIL; } @@ -592,20 +592,20 @@ void SetBrushContents( brush_t *b ){ /* detail? */ if ( compileFlags & C_DETAIL ) { c_detail++; - b->detail = qtrue; + b->detail = true; } else { c_structural++; - b->detail = qfalse; + b->detail = false; } /* opaque? */ if ( compileFlags & C_TRANSLUCENT ) { - b->opaque = qfalse; + b->opaque = false; } else{ - b->opaque = qtrue; + b->opaque = true; } /* areaportal? */ @@ -671,7 +671,7 @@ void AddBrushBevels( void ){ if ( i == buildBrush->numsides ) { // add a new side if ( buildBrush->numsides == MAX_BUILD_SIDES ) { - xml_Select( "MAX_BUILD_SIDES", buildBrush->entityNum, buildBrush->brushNum, qtrue ); + xml_Select( "MAX_BUILD_SIDES", buildBrush->entityNum, buildBrush->brushNum, true ); } memset( s, 0, sizeof( *s ) ); buildBrush->numsides++; @@ -716,7 +716,7 @@ void AddBrushBevels( void ){ } } } - s->bevel = qtrue; + s->bevel = true; c_boxbevels++; } @@ -821,7 +821,7 @@ void AddBrushBevels( void ){ // add this plane if ( buildBrush->numsides == MAX_BUILD_SIDES ) { - xml_Select( "MAX_BUILD_SIDES", buildBrush->entityNum, buildBrush->brushNum, qtrue ); + xml_Select( "MAX_BUILD_SIDES", buildBrush->entityNum, buildBrush->brushNum, true ); } s2 = &buildBrush->sides[buildBrush->numsides]; buildBrush->numsides++; @@ -830,7 +830,7 @@ void AddBrushBevels( void ){ s2->planenum = FindFloatPlane( normal, dist, 1, &w->p[ j ] ); s2->contentFlags = buildBrush->sides[0].contentFlags; s2->surfaceFlags = ( s->surfaceFlags & surfaceFlagsMask ); /* handle bevel surfaceflags */ - s2->bevel = qtrue; + s2->bevel = true; c_edgebevels++; } } @@ -861,7 +861,7 @@ static void MergeOrigin( entity_t *ent, vec3_t origin ){ SetKeyValue( ent, "origin", string ); } -brush_t *FinishBrush( qboolean noCollapseGroups ){ +brush_t *FinishBrush( bool noCollapseGroups ){ brush_t *b; @@ -1077,7 +1077,7 @@ void QuakeTextureVecs( plane_t *plane, vec_t shift[ 2 ], vec_t rotate, vec_t sca NOTE: it would be "cleaner" to have seperate functions to parse between old and new brushes */ -static void ParseRawBrush( qboolean onlyLights ){ +static void ParseRawBrush( bool onlyLights ){ side_t *side; vec3_t planePoints[ 3 ]; int planenum; @@ -1092,7 +1092,7 @@ static void ParseRawBrush( qboolean onlyLights ){ /* initial setup */ buildBrush->numsides = 0; - buildBrush->detail = qfalse; + buildBrush->detail = false; /* bp */ if ( g_brushType == BPRIMIT_BP ) { @@ -1102,7 +1102,7 @@ static void ParseRawBrush( qboolean onlyLights ){ /* parse sides */ while ( 1 ) { - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -1114,19 +1114,19 @@ static void ParseRawBrush( qboolean onlyLights ){ while ( 1 ) { if ( strcmp( token, "(" ) ) { - GetToken( qfalse ); + GetToken( false ); } else{ break; } - GetToken( qtrue ); + GetToken( true ); } } UnGetToken(); /* test side count */ if ( buildBrush->numsides >= MAX_BUILD_SIDES ) { - xml_Select( "MAX_BUILD_SIDES", buildBrush->entityNum, buildBrush->brushNum, qtrue ); + xml_Select( "MAX_BUILD_SIDES", buildBrush->entityNum, buildBrush->brushNum, true ); } /* add side */ @@ -1145,12 +1145,12 @@ static void ParseRawBrush( qboolean onlyLights ){ } /* read shader name */ - GetToken( qfalse ); + GetToken( false ); strcpy( name, token ); /* AP or 220? */ if ( g_brushType == BPRIMIT_UNDEFINED ){ - GetToken( qfalse ); + GetToken( false ); if ( !strcmp( token, "[" ) ){ g_brushType = BPRIMIT_VALVE220; Sys_FPrintf( SYS_VRB, "detected brushType = VALVE 220\n" ); @@ -1163,15 +1163,15 @@ static void ParseRawBrush( qboolean onlyLights ){ } if ( g_brushType == BPRIMIT_QUAKE ) { - GetToken( qfalse ); + GetToken( false ); shift[ 0 ] = atof( token ); - GetToken( qfalse ); + GetToken( false ); shift[ 1 ] = atof( token ); - GetToken( qfalse ); + GetToken( false ); rotate = atof( token ); - GetToken( qfalse ); + GetToken( false ); scale[ 0 ] = atof( token ); - GetToken( qfalse ); + GetToken( false ); scale[ 1 ] = atof( token ); } else if ( g_brushType == BPRIMIT_VALVE220 ){ @@ -1179,16 +1179,16 @@ static void ParseRawBrush( qboolean onlyLights ){ for ( axis = 0; axis < 2; ++axis ){ MatchToken( "[" ); for ( comp = 0; comp < 4; ++comp ){ - GetToken( qfalse ); + GetToken( false ); side->vecs[axis][comp] = atof( token ); } MatchToken( "]" ); } - GetToken( qfalse ); + GetToken( false ); rotate = atof( token ); - GetToken( qfalse ); + GetToken( false ); scale[ 0 ] = atof( token ); - GetToken( qfalse ); + GetToken( false ); scale[ 1 ] = atof( token ); if ( !scale[0] ) scale[0] = 1.f; @@ -1213,7 +1213,7 @@ static void ParseRawBrush( qboolean onlyLights ){ side->value = si->value; /* ydnar: gs mods: bias texture shift */ - if ( si->globalTexture == qfalse ) { + if ( !si->globalTexture ) { shift[ 0 ] -= ( floor( shift[ 0 ] / si->shaderWidth ) * si->shaderWidth ); shift[ 1 ] -= ( floor( shift[ 1 ] / si->shaderHeight ) * si->shaderHeight ); } @@ -1231,16 +1231,16 @@ static void ParseRawBrush( qboolean onlyLights ){ if ( TokenAvailable() ) { /* get detail bit from map content flags */ - GetToken( qfalse ); + GetToken( false ); flags = atoi( token ); if ( flags & C_DETAIL ) { side->compileFlags |= C_DETAIL; } /* historical */ - GetToken( qfalse ); + GetToken( false ); //% td.flags = atoi( token ); - GetToken( qfalse ); + GetToken( false ); //% td.value = atoi( token ); } @@ -1271,7 +1271,7 @@ static void ParseRawBrush( qboolean onlyLights ){ also removes planes without any normal */ -qboolean RemoveDuplicateBrushPlanes( brush_t *b ){ +bool RemoveDuplicateBrushPlanes( brush_t *b ){ int i, j, k; side_t *sides; @@ -1281,7 +1281,7 @@ qboolean RemoveDuplicateBrushPlanes( brush_t *b ){ // check for a degenerate plane if ( sides[i].planenum == -1 ) { - xml_Select( "degenerate plane", b->entityNum, b->brushNum, qfalse ); + xml_Select( "degenerate plane", b->entityNum, b->brushNum, false ); // remove it for ( k = i + 1 ; k < b->numsides ; k++ ) { sides[k - 1] = sides[k]; @@ -1294,7 +1294,7 @@ qboolean RemoveDuplicateBrushPlanes( brush_t *b ){ // check for duplication and mirroring for ( j = 0 ; j < i ; j++ ) { if ( sides[i].planenum == sides[j].planenum ) { - xml_Select( "duplicate plane", b->entityNum, b->brushNum, qfalse ); + xml_Select( "duplicate plane", b->entityNum, b->brushNum, false ); // remove the second duplicate for ( k = i + 1 ; k < b->numsides ; k++ ) { sides[k - 1] = sides[k]; @@ -1306,12 +1306,12 @@ qboolean RemoveDuplicateBrushPlanes( brush_t *b ){ if ( sides[i].planenum == ( sides[j].planenum ^ 1 ) ) { // mirror plane, brush is invalid - xml_Select( "mirrored plane", b->entityNum, b->brushNum, qfalse ); - return qfalse; + xml_Select( "mirrored plane", b->entityNum, b->brushNum, false ); + return false; } } } - return qtrue; + return true; } @@ -1321,7 +1321,7 @@ qboolean RemoveDuplicateBrushPlanes( brush_t *b ){ parses a brush out of a map file and sets it up */ -static void ParseBrush( qboolean onlyLights, qboolean noCollapseGroups ){ +static void ParseBrush( bool onlyLights, bool noCollapseGroups ){ /* parse the brush out of the map */ ParseRawBrush( onlyLights ); @@ -1696,7 +1696,7 @@ void LoadEntityIndexMap( entity_t *e ){ parses a single entity out of a map file */ -static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ){ +static bool ParseMapEntity( bool onlyLights, bool noCollapseGroups ){ epair_t *ep; const char *classname, *value; float lightmapScale, shadeAngle; @@ -1705,13 +1705,13 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ) shaderInfo_t *celShader = NULL; brush_t *brush; parseMesh_t *patch; - qboolean funcGroup; + bool funcGroup; int castShadows, recvShadows; /* eof check */ - if ( !GetToken( qtrue ) ) { - return qfalse; + if ( !GetToken( true ) ) { + return false; } /* conformance check */ @@ -1719,7 +1719,7 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ) Sys_Warning( "ParseEntity: { not found, found %s on line %d - last entity was at: <%4.2f, %4.2f, %4.2f>...\n" "Continuing to process map, but resulting BSP may be invalid.\n", token, scriptline, entities[ numEntities ].origin[ 0 ], entities[ numEntities ].origin[ 1 ], entities[ numEntities ].origin[ 2 ] ); - return qfalse; + return false; } /* range check */ @@ -1739,10 +1739,10 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ) while ( 1 ) { /* get initial token */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { Sys_Warning( "ParseEntity: EOF without closing brace\n" "Continuing to process map, but resulting BSP may be invalid.\n" ); - return qfalse; + return false; } if ( !strcmp( token, "}" ) ) { @@ -1751,7 +1751,7 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ) if ( !strcmp( token, "{" ) ) { /* parse a brush or patch */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } @@ -1798,16 +1798,11 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ) /* ydnar: only lights? */ if ( onlyLights && Q_strncasecmp( classname, "light", 5 ) ) { numEntities--; - return qtrue; + return true; } /* ydnar: determine if this is a func_group */ - if ( !Q_stricmp( "func_group", classname ) ) { - funcGroup = qtrue; - } - else{ - funcGroup = qfalse; - } + funcGroup = !Q_stricmp( "func_group", classname ); /* worldspawn (and func_groups) default to cast/recv shadows in worldspawn group */ if ( funcGroup || mapEnt->mapEntityNum == 0 ) { @@ -1953,18 +1948,18 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ) /* group_info entities are just for editor grouping (fixme: leak!) */ if ( !noCollapseGroups && !Q_stricmp( "group_info", classname ) ) { numEntities--; - return qtrue; + return true; } /* group entities are just for editor convenience, toss all brushes into worldspawn */ if ( !noCollapseGroups && funcGroup ) { MoveBrushesToWorld( mapEnt ); numEntities--; - return qtrue; + return true; } /* done */ - return qtrue; + return true; } @@ -1974,7 +1969,7 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups ) loads a map file into a list of entities */ -void LoadMapFile( char *filename, qboolean onlyLights, qboolean noCollapseGroups ){ +void LoadMapFile( char *filename, bool onlyLights, bool noCollapseGroups ){ FILE *file; brush_t *b; int oldNumEntities = 0, numMapBrushes; diff --git a/tools/quake3/q3map2/mesh.c b/tools/quake3/q3map2/mesh.c index 023afe39..cdb7e915 100644 --- a/tools/quake3/q3map2/mesh.c +++ b/tools/quake3/q3map2/mesh.c @@ -204,8 +204,8 @@ void MakeMeshNormals( mesh_t in ){ int x, y; bspDrawVert_t *dv; vec3_t around[8], temp; - qboolean good[8]; - qboolean wrapWidth, wrapHeight; + bool good[8]; + bool wrapWidth, wrapHeight; float len; int neighbors[8][2] = { @@ -213,7 +213,7 @@ void MakeMeshNormals( mesh_t in ){ }; - wrapWidth = qfalse; + wrapWidth = false; for ( i = 0 ; i < in.height ; i++ ) { VectorSubtract( in.verts[i * in.width].xyz, in.verts[i * in.width + in.width - 1].xyz, delta ); @@ -223,10 +223,10 @@ void MakeMeshNormals( mesh_t in ){ } } if ( i == in.height ) { - wrapWidth = qtrue; + wrapWidth = true; } - wrapHeight = qfalse; + wrapHeight = false; for ( i = 0 ; i < in.width ; i++ ) { VectorSubtract( in.verts[i].xyz, in.verts[i + ( in.height - 1 ) * in.width].xyz, delta ); @@ -236,7 +236,7 @@ void MakeMeshNormals( mesh_t in ){ } } if ( i == in.width ) { - wrapHeight = qtrue; + wrapHeight = true; } @@ -247,7 +247,7 @@ void MakeMeshNormals( mesh_t in ){ VectorCopy( dv->xyz, base ); for ( k = 0 ; k < 8 ; k++ ) { VectorClear( around[k] ); - good[k] = qfalse; + good[k] = false; for ( dist = 1 ; dist <= 3 ; dist++ ) { x = i + neighbors[k][0] * dist; @@ -277,7 +277,7 @@ void MakeMeshNormals( mesh_t in ){ continue; // degenerate edge, get more dist } else { - good[k] = qtrue; + good[k] = true; VectorCopy( temp, around[k] ); break; // good edge } diff --git a/tools/quake3/q3map2/minimap.c b/tools/quake3/q3map2/minimap.c index de3e049b..049d61d2 100644 --- a/tools/quake3/q3map2/minimap.c +++ b/tools/quake3/q3map2/minimap.c @@ -51,9 +51,9 @@ minimap_t; static minimap_t minimap; -qboolean BrushIntersectionWithLine( bspBrush_t *brush, vec3_t start, vec3_t dir, float *t_in, float *t_out ){ +bool BrushIntersectionWithLine( bspBrush_t *brush, vec3_t start, vec3_t dir, float *t_in, float *t_out ){ int i; - qboolean in = qfalse, out = qfalse; + bool in = false, out = false; bspBrushSide_t *sides = &bspBrushSides[brush->firstSide]; for ( i = 0; i < brush->numSides; ++i ) @@ -63,7 +63,7 @@ qboolean BrushIntersectionWithLine( bspBrush_t *brush, vec3_t start, vec3_t dir, float dn = DotProduct( dir, p->normal ); if ( dn == 0 ) { if ( sn > p->dist ) { - return qfalse; // outside! + return false; // outside! } } else @@ -72,10 +72,10 @@ qboolean BrushIntersectionWithLine( bspBrush_t *brush, vec3_t start, vec3_t dir, if ( dn < 0 ) { if ( !in || t > *t_in ) { *t_in = t; - in = qtrue; + in = true; // as t_in can only increase, and t_out can only decrease, early out if ( out && *t_in >= *t_out ) { - return qfalse; + return false; } } } @@ -83,10 +83,10 @@ qboolean BrushIntersectionWithLine( bspBrush_t *brush, vec3_t start, vec3_t dir, { if ( !out || t < *t_out ) { *t_out = t; - out = qtrue; + out = true; // as t_in can only increase, and t_out can only decrease, early out if ( in && *t_in >= *t_out ) { - return qfalse; + return false; } } } @@ -220,15 +220,15 @@ static void MiniMapNoSupersampling( int y ){ static void MiniMapSharpen( int y ){ int x; - qboolean up = ( y > 0 ); - qboolean down = ( y < minimap.height - 1 ); + const bool up = ( y > 0 ); + const bool down = ( y < minimap.height - 1 ); float *p = &minimap.data1f[y * minimap.width]; float *q = &minimap.sharpendata1f[y * minimap.width]; for ( x = 0; x < minimap.width; ++x ) { - qboolean left = ( x > 0 ); - qboolean right = ( x < minimap.width - 1 ); + const bool left = ( x > 0 ); + const bool right = ( x < minimap.width - 1 ); float val = p[0] * minimap.sharpen_centermult; if ( left && up ) { @@ -282,7 +282,7 @@ static void MiniMapBrightnessContrast( int y ){ } } -void MiniMapMakeMinsMaxs( vec3_t mins_in, vec3_t maxs_in, float border, qboolean keepaspect ){ +void MiniMapMakeMinsMaxs( vec3_t mins_in, vec3_t maxs_in, float border, bool keepaspect ){ vec3_t mins, maxs, extend; VectorCopy( mins_in, mins ); VectorCopy( maxs_in, maxs ); @@ -331,7 +331,7 @@ void MiniMapSetupBrushes( void ){ // not all may be nodraw } -qboolean MiniMapEvaluateSampleOffsets( int *bestj, int *bestk, float *bestval ){ +bool MiniMapEvaluateSampleOffsets( int *bestj, int *bestk, float *bestval ){ float val, dx, dy; int j, k; @@ -461,7 +461,7 @@ int MiniMapBSPMain( int argc, char **argv ){ char basename[1024]; char path[1024]; char relativeMinimapFilename[1024]; - qboolean autolevel; + bool autolevel; float minimapSharpen; float border; byte *data4b, *p; @@ -470,7 +470,7 @@ int MiniMapBSPMain( int argc, char **argv ){ int i; miniMapMode_t mode; vec3_t mins, maxs; - qboolean keepaspect; + bool keepaspect; /* arg checking */ if ( argc < 2 ) { @@ -497,7 +497,7 @@ int MiniMapBSPMain( int argc, char **argv ){ keepaspect = game->miniMapKeepAspect; mode = game->miniMapMode; - autolevel = qfalse; + autolevel = false; minimap.samples = 1; minimap.sample_offsets = NULL; minimap.boost = 1.0; @@ -538,11 +538,11 @@ int MiniMapBSPMain( int argc, char **argv ){ Sys_Printf( "Border set to %f\n", border ); } else if ( !strcmp( argv[ i ], "-keepaspect" ) ) { - keepaspect = qtrue; + keepaspect = true; Sys_Printf( "Keeping aspect ratio by letterboxing\n", border ); } else if ( !strcmp( argv[ i ], "-nokeepaspect" ) ) { - keepaspect = qfalse; + keepaspect = false; Sys_Printf( "Not keeping aspect ratio\n", border ); } else if ( !strcmp( argv[ i ], "-o" ) ) { @@ -588,11 +588,11 @@ int MiniMapBSPMain( int argc, char **argv ){ Sys_Printf( "Contrast set to %f\n", minimap.contrast ); } else if ( !strcmp( argv[ i ], "-autolevel" ) ) { - autolevel = qtrue; + autolevel = true; Sys_Printf( "Auto level enabled\n", border ); } else if ( !strcmp( argv[ i ], "-noautolevel" ) ) { - autolevel = qfalse; + autolevel = false; Sys_Printf( "Auto level disabled\n", border ); } } @@ -624,24 +624,24 @@ int MiniMapBSPMain( int argc, char **argv ){ if ( minimap.samples <= 1 ) { Sys_Printf( "\n--- MiniMapNoSupersampling (%d) ---\n", minimap.height ); - RunThreadsOnIndividual( minimap.height, qtrue, MiniMapNoSupersampling ); + RunThreadsOnIndividual( minimap.height, true, MiniMapNoSupersampling ); } else { if ( minimap.sample_offsets ) { Sys_Printf( "\n--- MiniMapSupersampled (%d) ---\n", minimap.height ); - RunThreadsOnIndividual( minimap.height, qtrue, MiniMapSupersampled ); + RunThreadsOnIndividual( minimap.height, true, MiniMapSupersampled ); } else { Sys_Printf( "\n--- MiniMapRandomlySupersampled (%d) ---\n", minimap.height ); - RunThreadsOnIndividual( minimap.height, qtrue, MiniMapRandomlySupersampled ); + RunThreadsOnIndividual( minimap.height, true, MiniMapRandomlySupersampled ); } } if ( minimap.boost != 1.0 ) { Sys_Printf( "\n--- MiniMapContrastBoost (%d) ---\n", minimap.height ); - RunThreadsOnIndividual( minimap.height, qtrue, MiniMapContrastBoost ); + RunThreadsOnIndividual( minimap.height, true, MiniMapContrastBoost ); } if ( autolevel ) { @@ -685,12 +685,12 @@ int MiniMapBSPMain( int argc, char **argv ){ if ( minimap.brightness != 0 || minimap.contrast != 1 ) { Sys_Printf( "\n--- MiniMapBrightnessContrast (%d) ---\n", minimap.height ); - RunThreadsOnIndividual( minimap.height, qtrue, MiniMapBrightnessContrast ); + RunThreadsOnIndividual( minimap.height, true, MiniMapBrightnessContrast ); } if ( minimap.sharpendata1f ) { Sys_Printf( "\n--- MiniMapSharpen (%d) ---\n", minimap.height ); - RunThreadsOnIndividual( minimap.height, qtrue, MiniMapSharpen ); + RunThreadsOnIndividual( minimap.height, true, MiniMapSharpen ); q = minimap.sharpendata1f; } else diff --git a/tools/quake3/q3map2/model.c b/tools/quake3/q3map2/model.c index afc207d5..73362f30 100644 --- a/tools/quake3/q3map2/model.c +++ b/tools/quake3/q3map2/model.c @@ -545,7 +545,7 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap vec3_t points[ 4 ], cnt, bestNormal, nrm, Vnorm[3], Enorm[3]; vec4_t plane, reverse, p[3]; double normalEpsilon_save; - qboolean snpd; + bool snpd; vec3_t min = { 999999, 999999, 999999 }, max = { -999999, -999999, -999999 }; vec3_t avgDirection = { 0, 0, 0 }; int axis; @@ -633,12 +633,12 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap buildBrush->contentShader = si; buildBrush->compileFlags = si->compileFlags; buildBrush->contentFlags = si->contentFlags; - buildBrush->detail = qtrue; + buildBrush->detail = true; //snap points before using them for further calculations //precision suffers a lot, when two of normal values are under .00025 (often no collision, knocking up effect in ioq3) //also broken drawsurfs in case of normal brushes - snpd = qfalse; + snpd = false; for ( j=0; j<3; j++ ) { if ( fabs(plane[j]) < 0.00025 && fabs(plane[(j+1)%3]) < 0.00025 && ( plane[j] != 0.0 || plane[(j+1)%3] != 0.0 ) ){ @@ -646,7 +646,7 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap VectorAdd( cnt, points[ 2 ], cnt ); VectorScale( cnt, 0.3333333333333f, cnt ); points[0][(j+2)%3]=points[1][(j+2)%3]=points[2][(j+2)%3]=cnt[(j+2)%3]; - snpd = qtrue; + snpd = true; break; } } @@ -662,14 +662,14 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap //Sys_Printf( "b4(%6.6f %6.6f %6.6f)(%6.6f %6.6f %6.6f)\n", points[j][0], points[j][1], points[j][2], points[(j+1)%3][0], points[(j+1)%3][1], points[(j+1)%3][2] ); points[j][k]=points[(j+1)%3][k] = ( points[j][k] + points[(j+1)%3][k] ) / 2.0; //Sys_Printf( "sn(%6.6f %6.6f %6.6f)(%6.6f %6.6f %6.6f)\n", points[j][0], points[j][1], points[j][2], points[(j+1)%3][0], points[(j+1)%3][1], points[(j+1)%3][2] ); - snpd = qtrue; + snpd = true; } } } if ( snpd ) { PlaneFromPoints( plane, points[ 0 ], points[ 1 ], points[ 2 ] ); - snpd = qfalse; + snpd = false; } //vector-is-close-to-be-on-axis check again, happens after previous code sometimes @@ -690,7 +690,7 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap { if ( plane[j] != 0.0 && fabs(plane[j]) < 0.00005 ){ plane[j]=0.0; - snpd = qtrue; + snpd = true; } } @@ -994,12 +994,12 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap VectorNormalize( p[ j ], p[ j ] ); p[j][3] = DotProduct( points[j], p[j] ); //snap nearly axial side planes - snpd = qfalse; + snpd = false; for ( k = 0; k < 3; k++ ) { if ( fabs(p[j][k]) < 0.00025 && p[j][k] != 0.0 ){ p[j][k] = 0.0; - snpd = qtrue; + snpd = true; } } if ( snpd ){ @@ -1080,13 +1080,13 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap VectorNormalize( p[ j ], p[ j ] ); p[j][3] = DotProduct( points[j], p[j] ); //snap nearly axial side planes - snpd = qfalse; + snpd = false; for ( k = 0; k < 3; k++ ) { if ( fabs(p[j][k]) < 0.00025 && p[j][k] != 0.0 ){ //Sys_Printf( "init plane %6.8f %6.8f %6.8f %6.8f\n", p[j][0], p[j][1], p[j][2], p[j][3]); p[j][k] = 0.0; - snpd = qtrue; + snpd = true; } } if ( snpd ){ @@ -1137,13 +1137,13 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap VectorNormalize( p[ j ], p[ j ] ); p[j][3] = DotProduct( points[j], p[j] ); //snap nearly axial side planes - snpd = qfalse; + snpd = false; for ( k = 0; k < 3; k++ ) { if ( fabs(p[j][k]) < 0.00025 && p[j][k] != 0.0 ){ //Sys_Printf( "init plane %6.8f %6.8f %6.8f %6.8f\n", p[j][0], p[j][1], p[j][2], p[j][3]); p[j][k] = 0.0; - snpd = qtrue; + snpd = true; } } if ( snpd ){ diff --git a/tools/quake3/q3map2/patch.c b/tools/quake3/q3map2/patch.c index 3715b4a8..1d82347c 100644 --- a/tools/quake3/q3map2/patch.c +++ b/tools/quake3/q3map2/patch.c @@ -217,7 +217,7 @@ static void ExpandMaxIterations( int *maxIterations, int maxError, vec3_t a, vec creates a mapDrawSurface_t from the patch text */ -void ParsePatch( qboolean onlyLights ){ +void ParsePatch( bool onlyLights ){ vec_t info[ 5 ]; int i, j, k; parseMesh_t *pm; @@ -227,14 +227,14 @@ void ParsePatch( qboolean onlyLights ){ bspDrawVert_t *verts; epair_t *ep; vec4_t delta, delta2, delta3; - qboolean degenerate; + bool degenerate; float longestCurve; int maxIterations; MatchToken( "{" ); /* get texture */ - GetToken( qtrue ); + GetToken( true ); strcpy( texture, token ); Parse1DMatrix( 5, info ); @@ -268,7 +268,7 @@ void ParsePatch( qboolean onlyLights ){ MatchToken( ")" ); // if brush primitives format, we may have some epairs to ignore here - GetToken( qtrue ); + GetToken( true ); if ( strcmp( token, "}" ) && ( g_brushType == BPRIMIT_BP || g_brushType == BPRIMIT_UNDEFINED ) ) { ep = ParseEPair(); free( ep->key ); @@ -292,7 +292,7 @@ void ParsePatch( qboolean onlyLights ){ j = ( m.width * m.height ); VectorClear( delta ); delta[ 3 ] = 0; - degenerate = qtrue; + degenerate = true; /* find first valid vector */ for ( i = 1; i < j && delta[ 3 ] == 0; i++ ) @@ -303,12 +303,12 @@ void ParsePatch( qboolean onlyLights ){ /* secondary degenerate test */ if ( delta[ 3 ] == 0 ) { - degenerate = qtrue; + degenerate = true; } else { /* if all vectors match this or are zero, then this is a degenerate patch */ - for ( i = 1; i < j && degenerate == qtrue; i++ ) + for ( i = 1; i < j && degenerate; i++ ) { VectorSubtract( m.verts[ 0 ].xyz, m.verts[ i ].xyz, delta2 ); delta2[ 3 ] = VectorNormalize( delta2, delta2 ); @@ -319,8 +319,8 @@ void ParsePatch( qboolean onlyLights ){ VectorInverse( delta3 ); /* compare */ - if ( VectorCompare( delta, delta2 ) == qfalse && VectorCompare( delta, delta3 ) == qfalse ) { - degenerate = qfalse; + if ( !VectorCompare( delta, delta2 ) && !VectorCompare( delta, delta3 ) ) { + degenerate = false; } } } @@ -328,7 +328,7 @@ void ParsePatch( qboolean onlyLights ){ /* warn and select degenerate patch */ if ( degenerate ) { - xml_Select( "degenerate patch", mapEnt->mapEntityNum, entitySourceBrushes, qfalse ); + xml_Select( "degenerate patch", mapEnt->mapEntityNum, entitySourceBrushes, false ); free( m.verts ); return; } @@ -429,7 +429,7 @@ void PatchMapDrawSurfs( entity_t *e ){ /* ydnar: mac os x fails with these if not static */ MAC_STATIC parseMesh_t *meshes[ MAX_MAP_DRAW_SURFS ]; - MAC_STATIC qb_t grouped[ MAX_MAP_DRAW_SURFS ]; + MAC_STATIC bool grouped[ MAX_MAP_DRAW_SURFS ]; MAC_STATIC byte group[ MAX_MAP_DRAW_SURFS ]; @@ -507,7 +507,7 @@ void PatchMapDrawSurfs( entity_t *e ){ for ( j = 0; j < patchCount; j++ ) { if ( group[ j ] ) { - grouped[ j ] = qtrue; + grouped[ j ] = true; check = meshes[ j ]; c1 = check->mesh.width * check->mesh.height; v1 = check->mesh.verts; @@ -520,7 +520,7 @@ void PatchMapDrawSurfs( entity_t *e ){ //% Sys_Printf( "Longest curve: %f Iterations: %d\n", scan->longestCurve, scan->maxIterations ); /* create drawsurf */ - scan->grouped = qtrue; + scan->grouped = true; ds = DrawSurfaceForMesh( e, scan, NULL ); /* ydnar */ VectorCopy( bounds[ 0 ], ds->bounds[ 0 ] ); VectorCopy( bounds[ 1 ], ds->bounds[ 1 ] ); diff --git a/tools/quake3/q3map2/path_init.c b/tools/quake3/q3map2/path_init.c index c0ae1218..00adf618 100644 --- a/tools/quake3/q3map2/path_init.c +++ b/tools/quake3/q3map2/path_init.c @@ -116,7 +116,7 @@ void LokiInitPaths( char *argv0 ){ char temp[ MAX_OS_PATH ]; char *path; char *last; - qboolean found; + bool found; path = getenv( "PATH" ); @@ -143,11 +143,11 @@ void LokiInitPaths( char *argv0 ){ so it will use "/opt/radiant/" as installPath, which will be expanded later to "/opt/radiant/baseq3" to find paks. */ - found = qfalse; + found = false; last = path; /* go through each : segment of path */ - while ( !strEmpty( last ) && found == qfalse ) + while ( !strEmpty( last ) && !found ) { /* null out temp */ strClear( temp ); @@ -174,7 +174,7 @@ void LokiInitPaths( char *argv0 ){ /* verify the path */ if ( access( temp, X_OK ) == 0 ) { - found = qtrue; + found = true; } path = last + 1; } diff --git a/tools/quake3/q3map2/portals.c b/tools/quake3/q3map2/portals.c index 7280d0c5..c34cfe24 100644 --- a/tools/quake3/q3map2/portals.c +++ b/tools/quake3/q3map2/portals.c @@ -39,7 +39,7 @@ /* ydnar: to fix broken portal windings */ -extern qboolean FixWinding( winding_t *w ); +extern bool FixWinding( winding_t *w ); /* @@ -65,10 +65,10 @@ void FreePortal( portal_t *p ){ returns true if the portal has non-opaque leafs on both sides */ -qboolean PortalPassable( portal_t *p ){ +bool PortalPassable( portal_t *p ){ /* is this to global outside leaf? */ if ( !p->onnode ) { - return qfalse; + return false; } /* this should never happen */ @@ -79,16 +79,16 @@ qboolean PortalPassable( portal_t *p ){ /* ydnar: added antiportal to suppress portal generation for visibility blocking */ if ( p->compileFlags & C_ANTIPORTAL ) { - return qfalse; + return false; } /* both leaves on either side of the portal must be passable */ - if ( p->nodes[ 0 ]->opaque == qfalse && p->nodes[ 1 ]->opaque == qfalse ) { - return qtrue; + if ( p->nodes[ 0 ]->opaque == false && p->nodes[ 1 ]->opaque == false ) { + return true; } /* otherwise this isn't a passable portal */ - return qfalse; + return false; } @@ -201,7 +201,7 @@ void MakeHeadnodePortals( tree_t *tree ){ tree->outside_node.planenum = PLANENUM_LEAF; tree->outside_node.brushlist = NULL; tree->outside_node.portals = NULL; - tree->outside_node.opaque = qfalse; + tree->outside_node.opaque = false; for ( i = 0 ; i < 3 ; i++ ) for ( j = 0 ; j < 2 ; j++ ) @@ -328,7 +328,7 @@ void MakeNodePortal( node_t *node ){ /* ydnar: adding this here to fix degenerate windings */ #if 0 - if ( FixWinding( w ) == qfalse ) { + if ( !FixWinding( w ) ) { c_badportals++; FreeWinding( w ); return; @@ -512,7 +512,7 @@ void MakeTreePortals_r( node_t *node ){ { if ( node->mins[i] < MIN_WORLD_COORD || node->maxs[i] > MAX_WORLD_COORD ) { if ( node->portals && node->portals->winding ) { - xml_Winding( "WARNING: Node With Unbounded Volume", node->portals->winding->p, node->portals->winding->numpoints, qfalse ); + xml_Winding( "WARNING: Node With Unbounded Volume", node->portals->winding->p, node->portals->winding->numpoints, false ); } break; @@ -558,7 +558,7 @@ int c_floodedleafs; ============= */ -void FloodPortals_r( node_t *node, int dist, qboolean skybox ){ +void FloodPortals_r( node_t *node, int dist, bool skybox ){ int s; portal_t *p; @@ -604,7 +604,7 @@ void FloodPortals_r( node_t *node, int dist, qboolean skybox ){ ============= */ -qboolean PlaceOccupant( node_t *headnode, vec3_t origin, entity_t *occupant, qboolean skybox ){ +bool PlaceOccupant( node_t *headnode, vec3_t origin, entity_t *occupant, bool skybox ){ vec_t d; node_t *node; plane_t *plane; @@ -625,14 +625,14 @@ qboolean PlaceOccupant( node_t *headnode, vec3_t origin, entity_t *occupant, qbo } if ( node->opaque ) { - return qfalse; + return false; } node->occupant = occupant; node->skybox = skybox; FloodPortals_r( node, 1, skybox ); - return qtrue; + return true; } /* @@ -646,7 +646,7 @@ qboolean PlaceOccupant( node_t *headnode, vec3_t origin, entity_t *occupant, qbo int FloodEntities( tree_t *tree ){ int i, s; vec3_t origin, offset, scale, angles; - qboolean r, inside, skybox; + bool r, inside, skybox; node_t *headnode; entity_t *e, *tripped; const char *value; @@ -655,10 +655,10 @@ int FloodEntities( tree_t *tree ){ headnode = tree->headnode; Sys_FPrintf( SYS_VRB, "--- FloodEntities ---\n" ); - inside = qfalse; + inside = false; tree->outside_node.occupied = 0; - tripped = qfalse; + tripped = NULL; c_floodedleafs = 0; for ( i = 1; i < numEntities; i++ ) { @@ -681,8 +681,8 @@ int FloodEntities( tree_t *tree ){ /* handle skybox entities */ value = ValueForKey( e, "classname" ); if ( !Q_stricmp( value, "_skybox" ) ) { - skybox = qtrue; - skyboxPresent = qtrue; + skybox = true; + skyboxPresent = true; /* invert origin */ VectorScale( origin, -1.0f, offset ); @@ -711,7 +711,7 @@ int FloodEntities( tree_t *tree ){ m4x4_pivoted_transform_by_vec3( skyboxTransform, offset, angles, eXYZ, scale, origin ); } else{ - skybox = qfalse; + skybox = false; } /* nudge off floor */ @@ -724,7 +724,7 @@ int FloodEntities( tree_t *tree ){ /* find leaf */ r = PlaceOccupant( headnode, origin, e, skybox ); if ( r ) { - inside = qtrue; + inside = true; } if ( !r ) { Sys_FPrintf( SYS_WRN, "Entity %i (%s): Entity in solid\n", e->mapEntityNum, ValueForKey( e, "classname" ) ); @@ -738,7 +738,7 @@ int FloodEntities( tree_t *tree ){ } if ( tripped ) { - xml_Select( "Entity leaked", e->mapEntityNum, 0, qfalse ); + xml_Select( "Entity leaked", e->mapEntityNum, 0, false ); } Sys_FPrintf( SYS_VRB, "%9d flooded leafs\n", c_floodedleafs ); @@ -915,7 +915,7 @@ void FloodSkyboxArea_r( node_t *node ){ return; } - node->skybox = qtrue; + node->skybox = true; } @@ -959,7 +959,7 @@ void FillOutside_r( node_t *node ){ if ( !node->occupied ) { if ( !node->opaque ) { c_outside++; - node->opaque = qtrue; + node->opaque = true; } else { c_solid++; diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index c8c7b82e..d2f55121 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -517,10 +517,6 @@ typedef struct { ------------------------------------------------------------------------------- */ -/* ydnar: for smaller structs */ -typedef unsigned char qb_t; - - /* ydnar: for q3map_tcMod */ typedef float tcMod_t[ 3 ][ 3 ]; @@ -553,34 +549,34 @@ typedef struct game_s int maxLMSurfaceVerts; /* default maximum meta surface verts */ int maxSurfaceVerts; /* default maximum surface verts */ int maxSurfaceIndexes; /* default maximum surface indexes (tris * 3) */ - qboolean emitFlares; /* when true, emit flare surfaces */ + bool emitFlares; /* when true, emit flare surfaces */ char *flareShader; /* default flare shader (MUST BE SET) */ - qboolean wolfLight; /* when true, lights work like wolf q3map */ + bool wolfLight; /* when true, lights work like wolf q3map */ int lightmapSize; /* bsp lightmap width/height */ float lightmapGamma; /* default lightmap gamma */ - qboolean lightmapsRGB; /* default lightmap sRGB mode */ - qboolean texturesRGB; /* default texture sRGB mode */ - qboolean colorsRGB; /* default color sRGB mode */ + bool lightmapsRGB; /* default lightmap sRGB mode */ + bool texturesRGB; /* default texture sRGB mode */ + bool colorsRGB; /* default color sRGB mode */ float lightmapExposure; /* default lightmap exposure */ float lightmapCompensate; /* default lightmap compensate value */ float gridScale; /* vortex: default lightgrid scale (affects both directional and ambient spectres) */ float gridAmbientScale; /* vortex: default lightgrid ambient spectre scale */ - qboolean lightAngleHL; /* jal: use half-lambert curve for light angle attenuation */ - qboolean noStyles; /* use lightstyles hack or not */ - qboolean keepLights; /* keep light entities on bsp */ + bool lightAngleHL; /* jal: use half-lambert curve for light angle attenuation */ + bool noStyles; /* use lightstyles hack or not */ + bool keepLights; /* keep light entities on bsp */ int patchSubdivisions; /* default patch subdivisions tolerance */ - qboolean patchShadows; /* patch casting enabled */ - qboolean deluxeMap; /* compile deluxemaps */ + bool patchShadows; /* patch casting enabled */ + bool deluxeMap; /* compile deluxemaps */ int deluxeMode; /* deluxemap mode (0 - modelspace, 1 - tangentspace with renormalization, 2 - tangentspace without renormalization) */ int miniMapSize; /* minimap size */ float miniMapSharpen; /* minimap sharpening coefficient */ float miniMapBorder; /* minimap border amount */ - qboolean miniMapKeepAspect; /* minimap keep aspect ratio by letterboxing */ + bool miniMapKeepAspect; /* minimap keep aspect ratio by letterboxing */ miniMapMode_t miniMapMode; /* minimap mode */ char *miniMapNameFormat; /* minimap name format */ char *bspIdent; /* 4-letter bsp file prefix */ int bspVersion; /* bsp version to use */ - qboolean lumpSwap; /* cod-style len/ofs order */ + bool lumpSwap; /* cod-style len/ofs order */ bspFunc load, write; /* load/write function pointers */ surfaceParm_t surfaceParms[ 128 ]; /* surfaceparm array */ int brushBevelsSurfaceFlagsMask; /* apply only these surfaceflags to bevels to reduce extra bsp shaders amount; applying them to get correct physics at walkable brush edges and vertices */ @@ -615,7 +611,7 @@ typedef struct surfaceModel_s float density, odds; float minScale, maxScale; float minAngle, maxAngle; - qboolean oriented; + bool oriented; } surfaceModel_t; @@ -626,7 +622,7 @@ typedef struct foliage_s struct foliage_s *next; char model[ MAX_QPATH ]; float scale, density, odds; - qboolean inverseAlpha; + int inverseAlpha; } foliage_t; @@ -729,14 +725,14 @@ typedef struct shaderInfo_s vec3_t mins, maxs; /* ydnar: for particle studio vertexDeform move support */ - qb_t legacyTerrain; /* ydnar: enable legacy terrain crutches */ - qb_t indexed; /* ydnar: attempt to use indexmap (terrain alphamap style) */ - qb_t forceMeta; /* ydnar: force metasurface path */ - qb_t noClip; /* ydnar: don't clip into bsp, preserve original face winding */ - qb_t noFast; /* ydnar: suppress fast lighting for surfaces with this shader */ - qb_t invert; /* ydnar: reverse facing */ - qb_t nonplanar; /* ydnar: for nonplanar meta surface merging */ - qb_t tcGen; /* ydnar: has explicit texcoord generation */ + bool legacyTerrain; /* ydnar: enable legacy terrain crutches */ + bool indexed; /* ydnar: attempt to use indexmap (terrain alphamap style) */ + bool forceMeta; /* ydnar: force metasurface path */ + bool noClip; /* ydnar: don't clip into bsp, preserve original face winding */ + bool noFast; /* ydnar: suppress fast lighting for surfaces with this shader */ + bool invert; /* ydnar: reverse facing */ + bool nonplanar; /* ydnar: for nonplanar meta surface merging */ + bool tcGen; /* ydnar: has explicit texcoord generation */ vec3_t vecs[ 2 ]; /* ydnar: explicit texture vectors for [0,1] texture space */ tcMod_t mod; /* ydnar: q3map_tcMod matrix for djbob :) */ vec3_t lightmapAxis; /* ydnar: explicit lightmap axis projection */ @@ -746,22 +742,22 @@ typedef struct shaderInfo_s float furOffset; /* ydnar: offset of each layer */ float furFade; /* ydnar: alpha fade amount per layer */ - qb_t splotchFix; /* ydnar: filter splotches on lightmaps */ + bool splotchFix; /* ydnar: filter splotches on lightmaps */ - qb_t hasPasses; /* false if the shader doesn't define any rendering passes */ - qb_t globalTexture; /* don't normalize texture repeats */ - qb_t twoSided; /* cull none */ - qb_t autosprite; /* autosprite shaders will become point lights instead of area lights */ - qb_t polygonOffset; /* ydnar: don't face cull this or against this */ - qb_t patchShadows; /* have patches casting shadows when using -light for this surface */ - qb_t vertexShadows; /* shadows will be casted at this surface even when vertex lit */ - qb_t forceSunlight; /* force sun light at this surface even tho we might not calculate shadows in vertex lighting */ - qb_t notjunc; /* don't use this surface for tjunction fixing */ - qb_t fogParms; /* ydnar: has fogparms */ - qb_t noFog; /* ydnar: suppress fogging */ - qb_t clipModel; /* ydnar: solid model hack */ - qb_t noVertexLight; /* ydnar: leave vertex color alone */ - qb_t noDirty; /* jal: do not apply the dirty pass to this surface */ + bool hasPasses; /* false if the shader doesn't define any rendering passes */ + bool globalTexture; /* don't normalize texture repeats */ + bool twoSided; /* cull none */ + bool autosprite; /* autosprite shaders will become point lights instead of area lights */ + bool polygonOffset; /* ydnar: don't face cull this or against this */ + bool patchShadows; /* have patches casting shadows when using -light for this surface */ + bool vertexShadows; /* shadows will be casted at this surface even when vertex lit */ + bool forceSunlight; /* force sun light at this surface even tho we might not calculate shadows in vertex lighting */ + bool notjunc; /* don't use this surface for tjunction fixing */ + bool fogParms; /* ydnar: has fogparms */ + bool noFog; /* ydnar: suppress fogging */ + bool clipModel; /* ydnar: solid model hack */ + bool noVertexLight; /* ydnar: leave vertex color alone */ + bool noDirty; /* jal: do not apply the dirty pass to this surface */ byte styleMarker; /* ydnar: light styles hack */ @@ -794,7 +790,7 @@ typedef struct shaderInfo_s float floodlightIntensity; float floodlightDistance; - qb_t lmMergable; /* ydnar */ + bool lmMergable; /* ydnar */ int lmCustomWidth, lmCustomHeight; /* ydnar */ float lmBrightness; /* ydnar */ float lmFilterRadius; /* ydnar: lightmap filtering/blurring radius for this shader (default: 0) */ @@ -805,8 +801,8 @@ typedef struct shaderInfo_s vec3_t fogDir; /* ydnar */ char *shaderText; /* ydnar */ - qb_t custom; - qb_t finished; + bool custom; + bool finished; } shaderInfo_t; @@ -823,7 +819,7 @@ typedef struct face_s struct face_s *next; int planenum; int priority; - //qboolean checked; + //bool checked; int compileFlags; winding_t *w; } @@ -860,9 +856,9 @@ typedef struct side_s int compileFlags; /* from shaderInfo */ int value; /* from shaderInfo */ - qboolean visible; /* choose visible planes first */ - qboolean bevel; /* don't ever use for bsp splitting, and don't bother making windings for it */ - qboolean culled; /* ydnar: face culling */ + bool visible; /* choose visible planes first */ + bool bevel; /* don't ever use for bsp splitting, and don't bother making windings for it */ + bool culled; /* ydnar: face culling */ } side_t; @@ -911,8 +907,8 @@ typedef struct brush_s int contentFlags; int compileFlags; /* ydnar */ - qboolean detail; - qboolean opaque; + bool detail; + bool opaque; int portalareas[ 2 ]; @@ -962,7 +958,7 @@ typedef struct parseMesh_s indexMap_t *im; /* grouping */ - qboolean grouped; + bool grouped; float longestCurve; int maxIterations; } @@ -1026,12 +1022,12 @@ char *surfaceTypes[ NUM_SURFACE_TYPES ] typedef struct mapDrawSurface_s { surfaceType_t type; - qboolean planar; + bool planar; int outputNum; /* ydnar: to match this sort of thing up */ - qboolean fur; /* ydnar: this is kind of a hack, but hey... */ - qboolean skybox; /* ydnar: yet another fun hack */ - qboolean backSide; /* ydnar: q3map_backShader support */ + bool fur; /* ydnar: this is kind of a hack, but hey... */ + bool skybox; /* ydnar: yet another fun hack */ + bool backSide; /* ydnar: q3map_backShader support */ struct mapDrawSurface_s *parent; /* ydnar: for cloned (skybox) surfaces to share lighting data */ struct mapDrawSurface_s *clone; /* ydnar: for cloned surfaces */ @@ -1148,10 +1144,10 @@ typedef struct node_s vec3_t referencepoint; /* leafs only */ - qboolean opaque; /* view can never be inside */ - qboolean areaportal; - qboolean skybox; /* ydnar: a skybox leaf */ - qboolean sky; /* ydnar: a sky leaf */ + bool opaque; /* view can never be inside */ + bool areaportal; + bool skybox; /* ydnar: a skybox leaf */ + bool sky; /* ydnar: a sky leaf */ int cluster; /* for portalfile writing */ int area; /* for areaportals */ brush_t *brushlist; /* fragments of all brushes in this leaf */ @@ -1162,7 +1158,7 @@ typedef struct node_s struct portal_s *portals; /* also on nodes during construction */ - qboolean has_structural_children; + bool has_structural_children; } node_t; @@ -1175,7 +1171,7 @@ typedef struct portal_s struct portal_s *next[ 2 ]; winding_t *winding; - qboolean sidefound; /* false if ->side hasn't been checked */ + bool sidefound; /* false if ->side hasn't been checked */ int compileFlags; /* from original face that caused the split */ side_t *side; /* NULL = non-visible */ } @@ -1233,9 +1229,9 @@ vstatus_t; typedef struct { int num; - qboolean hint; /* true if this portal was created from a hint splitter */ - qboolean sky; /* true if this portal belongs to a sky leaf */ - qboolean removed; + bool hint; /* true if this portal was created from a hint splitter */ + bool sky; /* true if this portal belongs to a sky leaf */ + bool removed; visPlane_t plane; /* normal pointing into neighbor */ int leaf; /* neighbor */ @@ -1341,7 +1337,7 @@ light_t; typedef struct { /* constant input */ - qboolean testOcclusion, forceSunlight, testAll; + bool testOcclusion, forceSunlight, testAll; int recvShadows; int numSurfaces; @@ -1350,7 +1346,7 @@ typedef struct int numLights; light_t **lights; - qboolean twoSided; + bool twoSided; /* per-sample input */ int cluster; @@ -1373,9 +1369,9 @@ typedef struct /* output */ vec3_t hit; int compileFlags; /* for determining surface compile flags traced through */ - qboolean passSolid; - qboolean opaque; - vec_t forceSubsampling; /* needs subsampling (alphashadow), value = max color contribution possible from it */ + bool passSolid; + bool opaque; + vec_t forceSubsampling; /* needs subsampling (alphashadow), value = max color contribution possible from it */ /* working data */ int numTestNodes; @@ -1432,7 +1428,7 @@ outLightmap_t; typedef struct rawLightmap_s { - qboolean finished, splotchFix, wrap[ 2 ]; + bool finished, splotchFix, wrap[ 2 ]; int customWidth, customHeight; float brightness; float filterRadius; @@ -1454,7 +1450,7 @@ typedef struct rawLightmap_s float *plane; int w, h, sw, sh, used; - qboolean solid[ MAX_LIGHTMAPS ]; + bool solid[ MAX_LIGHTMAPS ]; vec3_t solidColor[ MAX_LIGHTMAPS ]; int numStyledTwins; @@ -1499,7 +1495,7 @@ typedef struct surfaceInfo_s float longestCurve; float *plane; vec3_t axis, mins, maxs; - qboolean hasLightmap, approximated; + bool hasLightmap, approximated; int firstSurfaceCluster, numSurfaceClusters; } surfaceInfo_t; @@ -1556,8 +1552,8 @@ brush_t *AllocBrush( int numsides ); void FreeBrush( brush_t *brushes ); void FreeBrushList( brush_t *brushes ); brush_t *CopyBrush( const brush_t *brush ); -qboolean BoundBrush( brush_t *brush ); -qboolean CreateBrushWindings( brush_t *brush ); +bool BoundBrush( brush_t *brush ); +bool CreateBrushWindings( brush_t *brush ); brush_t *BrushFromBounds( vec3_t mins, vec3_t maxs ); vec_t BrushVolume( brush_t *brush ); void WriteBSPBrushMap( char *name, brush_t *list ); @@ -1566,7 +1562,7 @@ void FilterDetailBrushesIntoTree( entity_t *e, tree_t *tr void FilterStructuralBrushesIntoTree( entity_t *e, tree_t *tree ); int BoxOnPlaneSide( vec3_t mins, vec3_t maxs, plane_t *plane ); -qboolean WindingIsTiny( winding_t *w ); +bool WindingIsTiny( winding_t *w ); void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back ); @@ -1594,12 +1590,12 @@ void MakeNormalVectors( vec3_t forward, vec3_t right, vec /* map.c */ -void LoadMapFile( char *filename, qboolean onlyLights, qboolean noCollapseGroups ); +void LoadMapFile( char *filename, bool onlyLights, bool noCollapseGroups ); int FindFloatPlane( vec3_t normal, vec_t dist, int numPoints, vec3_t *points ); -qboolean PlaneEqual( plane_t *p, vec3_t normal, vec_t dist ); +bool PlaneEqual( plane_t *p, vec3_t normal, vec_t dist ); int PlaneTypeForNormal( vec3_t normal ); void AddBrushBevels( void ); -brush_t *FinishBrush( qboolean noCollapseGroups ); +brush_t *FinishBrush( bool noCollapseGroups ); /* portals.c */ @@ -1607,7 +1603,7 @@ void MakeHeadnodePortals( tree_t *tree ); void MakeNodePortal( node_t *node ); void SplitNodePortals( node_t *node ); -qboolean PortalPassable( portal_t *p ); +bool PortalPassable( portal_t *p ); #define FLOODENTITIES_LEAKED 1 #define FLOODENTITIES_GOOD 0 @@ -1637,7 +1633,7 @@ void SetLightStyles( void ); int EmitShader( const char *shader, int *contentFlags, int *surfaceFlags ); void BeginBSPFile( void ); -void EndBSPFile( qboolean do_write ); +void EndBSPFile( bool do_write ); void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ); void EmitFogs( void ); @@ -1653,7 +1649,7 @@ void FreeTreePortals_r( node_t *node ); /* patch.c */ -void ParsePatch( qboolean onlyLights ); +void ParsePatch( bool onlyLights ); mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength ); void PatchMapDrawSurfs( entity_t *e ); void TriangulatePatchSurface( entity_t *e, mapDrawSurface_t *ds ); @@ -1691,14 +1687,14 @@ mapDrawSurface_t *AllocDrawSurface( surfaceType_t type ); void FinishSurface( mapDrawSurface_t *ds ); void StripFaceSurface( mapDrawSurface_t *ds ); void MaxAreaFaceSurface( mapDrawSurface_t *ds ); -qboolean CalcSurfaceTextureRange( mapDrawSurface_t *ds ); -qboolean CalcLightmapAxis( vec3_t normal, vec3_t axis ); +bool CalcSurfaceTextureRange( mapDrawSurface_t *ds ); +bool CalcLightmapAxis( vec3_t normal, vec3_t axis ); void ClassifySurfaces( int numSurfs, mapDrawSurface_t *ds ); void ClassifyEntitySurfaces( entity_t *e ); void TidyEntitySurfaces( entity_t *e ); mapDrawSurface_t *CloneSurface( mapDrawSurface_t *src, shaderInfo_t *si ); mapDrawSurface_t *MakeCelSurface( mapDrawSurface_t *src, shaderInfo_t *si ); -qboolean IsTriangleDegenerate( bspDrawVert_t *points, int a, int b, int c ); +bool IsTriangleDegenerate( bspDrawVert_t *points, int a, int b, int c ); void ClearSurface( mapDrawSurface_t *ds ); void AddEntitySurfaceModels( entity_t *e ); mapDrawSurface_t *DrawSurfaceForSide( entity_t *e, brush_t *b, side_t *s, winding_t *w ); @@ -1784,7 +1780,7 @@ void PassagePortalFlow( int portalnum ); float PointToPolygonFormFactor( const vec3_t point, const vec3_t normal, const winding_t *w ); int LightContributionToSample( trace_t *trace ); void LightingAtSample( trace_t * trace, byte styles[ MAX_LIGHTMAPS ], vec3_t colors[ MAX_LIGHTMAPS ] ); -int LightContributionToPoint( trace_t *trace ); +bool LightContributionToPoint( trace_t *trace ); int LightMain( int argc, char **argv ); @@ -1795,7 +1791,7 @@ float SetupTrace( trace_t *trace ); /* light_bounce.c */ -qboolean RadSampleImage( byte * pixels, int width, int height, float st[ 2 ], float color[ 4 ] ); +bool RadSampleImage( byte * pixels, int width, int height, float st[ 2 ], float color[ 4 ] ); void RadLightForTriangles( int num, int lightmapNum, rawLightmap_t *lm, shaderInfo_t *si, float scale, float subdivide, clipWork_t *cw ); void RadLightForPatch( int num, int lightmapNum, rawLightmap_t *lm, shaderInfo_t *si, float scale, float subdivide, clipWork_t *cw ); void RadCreateDiffuseLights( void ); @@ -1815,7 +1811,7 @@ void DirtyRawLightmap( int num ); void SetupFloodLight(); void FloodlightRawLightmaps(); void FloodlightIlluminateLightmap( rawLightmap_t *lm ); -float FloodLightForSample( trace_t *trace, float floodLightDistance, qboolean floodLightLowQuality ); +float FloodLightForSample( trace_t *trace, float floodLightDistance, bool floodLightLowQuality ); void FloodLightRawLightmap( int num ); void IlluminateRawLightmap( int num ); @@ -1824,13 +1820,13 @@ void IlluminateVertexes( int num ); void SetupBrushesFlags( int mask_any, int test_any, int mask_all, int test_all ); void SetupBrushes( void ); void SetupClusters( void ); -qboolean ClusterVisible( int a, int b ); -qboolean ClusterVisibleToPoint( vec3_t point, int cluster ); +bool ClusterVisible( int a, int b ); +bool ClusterVisibleToPoint( vec3_t point, int cluster ); int ClusterForPoint( vec3_t point ); int ClusterForPointExt( vec3_t point, float epsilon ); int ClusterForPointExtFilter( vec3_t point, float epsilon, int numClusters, int *clusters ); int ShaderForPointInLeaf( vec3_t point, int leafNum, float epsilon, int wantContentFlags, int wantSurfaceFlags, int *contentFlags, int *surfaceFlags ); -void SetupEnvelopes( qboolean forGrid, qboolean fastFlag ); +void SetupEnvelopes( bool forGrid, bool fastFlag ); void FreeTraceLights( trace_t *trace ); void CreateTraceLightsForBounds( vec3_t mins, vec3_t maxs, vec3_t normal, int numClusters, int *clusters, int flags, trace_t *trace ); void CreateTraceLightsForSurface( int num, trace_t *trace ); @@ -1844,7 +1840,7 @@ int ImportLightmapsMain( int argc, char **argv ); void SetupSurfaceLightmaps( void ); void StitchSurfaceLightmaps( void ); -void StoreSurfaceLightmaps( qboolean fastAllocate ); +void StoreSurfaceLightmaps( bool fastAllocate ); /* exportents.c */ @@ -1861,14 +1857,14 @@ image_t *ImageLoad( const char *filename ); /* shaders.c */ void ColorMod( colorMod_t *am, int numVerts, bspDrawVert_t *drawVerts ); -void TCMod( tcMod_t mod, float st[ 2 ] ); +void TCMod( tcMod_t mod, float st[ 2 ] ); void TCModIdentity( tcMod_t mod ); void TCModMultiply( tcMod_t a, tcMod_t b, tcMod_t out ); void TCModTranslate( tcMod_t mod, float s, float t ); void TCModScale( tcMod_t mod, float s, float t ); void TCModRotate( tcMod_t mod, float euler ); -qboolean ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *compileFlags ); +bool ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *compileFlags ); void BeginMapShaderFile( const char *mapFile ); void WriteMapShaderFile( void ); @@ -1906,14 +1902,14 @@ void ParseEntities( void ); void UnparseEntities( void ); void PrintEntity( const entity_t *ent ); void SetKeyValue( entity_t *ent, const char *key, const char *value ); -qboolean KeyExists( const entity_t *ent, const char *key ); /* VorteX: check if key exists */ +bool KeyExists( const entity_t *ent, const char *key ); /* VorteX: check if key exists */ const char *ValueForKey( const entity_t *ent, const char *key ); int IntForKey( const entity_t *ent, const char *key ); vec_t FloatForKey( const entity_t *ent, const char *key ); void GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec ); entity_t *FindTargetEntity( const char *target ); void GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castShadows, int *recvShadows ); -void InjectCommandLine( char **argv, int beginArgs, int endArgs ); +void InjectCommandLine( char **argv, int beginArgs, int endArgs ); @@ -2011,37 +2007,37 @@ Q_EXTERN int numCustSurfaceParms Q_ASSIGN( 0 ); Q_EXTERN char mapName[ MAX_QPATH ]; /* ydnar: per-map custom shaders for larger lightmaps */ Q_EXTERN char mapShaderFile[ 1024 ]; -Q_EXTERN qboolean warnImage Q_ASSIGN( qtrue ); +Q_EXTERN bool warnImage Q_ASSIGN( true ); /* ydnar: sinusoid samples */ Q_EXTERN float jitters[ MAX_JITTERS ]; /* can't code */ -Q_EXTERN qboolean doingBSP Q_ASSIGN( qfalse ); +Q_EXTERN bool doingBSP Q_ASSIGN( false ); /* commandline arguments */ -Q_EXTERN qboolean verboseEntities Q_ASSIGN( qfalse ); -Q_EXTERN qboolean force Q_ASSIGN( qfalse ); -Q_EXTERN qboolean infoMode Q_ASSIGN( qfalse ); -Q_EXTERN qboolean useCustomInfoParms Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noprune Q_ASSIGN( qfalse ); -Q_EXTERN qboolean leaktest Q_ASSIGN( qfalse ); -Q_EXTERN qboolean nodetail Q_ASSIGN( qfalse ); -Q_EXTERN qboolean nosubdivide Q_ASSIGN( qfalse ); -Q_EXTERN qboolean notjunc Q_ASSIGN( qfalse ); -Q_EXTERN qboolean fulldetail Q_ASSIGN( qfalse ); -Q_EXTERN qboolean nowater Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noCurveBrushes Q_ASSIGN( qfalse ); -Q_EXTERN qboolean fakemap Q_ASSIGN( qfalse ); -Q_EXTERN qboolean coplanar Q_ASSIGN( qfalse ); -Q_EXTERN qboolean nofog Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noHint Q_ASSIGN( qfalse ); /* ydnar */ -Q_EXTERN qboolean renameModelShaders Q_ASSIGN( qfalse ); /* ydnar */ -Q_EXTERN qboolean skyFixHack Q_ASSIGN( qfalse ); /* ydnar */ -Q_EXTERN qboolean bspAlternateSplitWeights Q_ASSIGN( qfalse ); /* 27 */ -Q_EXTERN qboolean deepBSP Q_ASSIGN( qfalse ); /* div0 */ -Q_EXTERN qboolean maxAreaFaceSurface Q_ASSIGN( qfalse ); /* divVerent */ -Q_EXTERN qboolean nocmdline Q_ASSIGN( qfalse ); +Q_EXTERN bool verboseEntities Q_ASSIGN( false ); +Q_EXTERN bool force Q_ASSIGN( false ); +Q_EXTERN bool infoMode Q_ASSIGN( false ); +Q_EXTERN bool useCustomInfoParms Q_ASSIGN( false ); +Q_EXTERN bool noprune Q_ASSIGN( false ); +Q_EXTERN bool leaktest Q_ASSIGN( false ); +Q_EXTERN bool nodetail Q_ASSIGN( false ); +Q_EXTERN bool nosubdivide Q_ASSIGN( false ); +Q_EXTERN bool notjunc Q_ASSIGN( false ); +Q_EXTERN bool fulldetail Q_ASSIGN( false ); +Q_EXTERN bool nowater Q_ASSIGN( false ); +Q_EXTERN bool noCurveBrushes Q_ASSIGN( false ); +Q_EXTERN bool fakemap Q_ASSIGN( false ); +Q_EXTERN bool coplanar Q_ASSIGN( false ); +Q_EXTERN bool nofog Q_ASSIGN( false ); +Q_EXTERN bool noHint Q_ASSIGN( false ); /* ydnar */ +Q_EXTERN bool renameModelShaders Q_ASSIGN( false ); /* ydnar */ +Q_EXTERN bool skyFixHack Q_ASSIGN( false ); /* ydnar */ +Q_EXTERN bool bspAlternateSplitWeights Q_ASSIGN( false ); /* 27 */ +Q_EXTERN bool deepBSP Q_ASSIGN( false ); /* div0 */ +Q_EXTERN bool maxAreaFaceSurface Q_ASSIGN( false ); /* divVerent */ +Q_EXTERN bool nocmdline Q_ASSIGN( false ); Q_EXTERN int patchSubdivisions Q_ASSIGN( 8 ); /* ydnar: -patchmeta subdivisions */ @@ -2051,23 +2047,23 @@ Q_EXTERN int maxSurfaceIndexes Q_ASSIGN( 6000 ); /* ydnar */ Q_EXTERN float npDegrees Q_ASSIGN( 0.0f ); /* ydnar: nonplanar degrees */ Q_EXTERN int bevelSnap Q_ASSIGN( 0 ); /* ydnar: bevel plane snap */ Q_EXTERN int texRange Q_ASSIGN( 0 ); -Q_EXTERN qboolean flat Q_ASSIGN( qfalse ); -Q_EXTERN qboolean meta Q_ASSIGN( qfalse ); -Q_EXTERN qboolean patchMeta Q_ASSIGN( qfalse ); -Q_EXTERN qboolean emitFlares Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugSurfaces Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugInset Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugPortals Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugClip Q_ASSIGN( qfalse ); /* debug model autoclipping */ +Q_EXTERN bool flat Q_ASSIGN( false ); +Q_EXTERN bool meta Q_ASSIGN( false ); +Q_EXTERN bool patchMeta Q_ASSIGN( false ); +Q_EXTERN bool emitFlares Q_ASSIGN( false ); +Q_EXTERN bool debugSurfaces Q_ASSIGN( false ); +Q_EXTERN bool debugInset Q_ASSIGN( false ); +Q_EXTERN bool debugPortals Q_ASSIGN( false ); +Q_EXTERN bool debugClip Q_ASSIGN( false ); /* debug model autoclipping */ Q_EXTERN float clipDepthGlobal Q_ASSIGN( 2.0f ); -Q_EXTERN qboolean lightmapTriangleCheck Q_ASSIGN( qfalse ); -Q_EXTERN qboolean lightmapExtraVisClusterNudge Q_ASSIGN( qfalse ); -Q_EXTERN qboolean lightmapFill Q_ASSIGN( qfalse ); -Q_EXTERN qboolean lightmapPink Q_ASSIGN( qfalse ); +Q_EXTERN bool lightmapTriangleCheck Q_ASSIGN( false ); +Q_EXTERN bool lightmapExtraVisClusterNudge Q_ASSIGN( false ); +Q_EXTERN bool lightmapFill Q_ASSIGN( false ); +Q_EXTERN bool lightmapPink Q_ASSIGN( false ); Q_EXTERN int metaAdequateScore Q_ASSIGN( -1 ); Q_EXTERN int metaGoodScore Q_ASSIGN( -1 ); Q_EXTERN float metaMaxBBoxDistance Q_ASSIGN( -1 ); -Q_EXTERN qboolean noob Q_ASSIGN( qfalse ); +Q_EXTERN bool noob Q_ASSIGN( false ); #if Q3MAP2_EXPERIMENTAL_SNAP_NORMAL_FIX // Increasing the normalEpsilon to compensate for new logic in SnapNormal(), where @@ -2173,7 +2169,7 @@ Q_EXTERN byte debugColors[ 12 ][ 3 ] }; #endif -Q_EXTERN qboolean skyboxPresent Q_ASSIGN( qfalse ); +Q_EXTERN bool skyboxPresent Q_ASSIGN( false ); Q_EXTERN int skyboxArea Q_ASSIGN( -1 ); Q_EXTERN m4x4_t skyboxTransform; @@ -2186,14 +2182,14 @@ Q_EXTERN m4x4_t skyboxTransform; ------------------------------------------------------------------------------- */ /* commandline arguments */ -Q_EXTERN qboolean fastvis; -Q_EXTERN qboolean noPassageVis; -Q_EXTERN qboolean passageVisOnly; -Q_EXTERN qboolean mergevis; -Q_EXTERN qboolean mergevisportals; -Q_EXTERN qboolean nosort; -Q_EXTERN qboolean saveprt; -Q_EXTERN qboolean hint; /* ydnar */ +Q_EXTERN bool fastvis; +Q_EXTERN bool noPassageVis; +Q_EXTERN bool passageVisOnly; +Q_EXTERN bool mergevis; +Q_EXTERN bool mergevisportals; +Q_EXTERN bool nosort; +Q_EXTERN bool saveprt; +Q_EXTERN bool hint; /* ydnar */ Q_EXTERN char inbase[ MAX_QPATH ]; Q_EXTERN char globalCelShader[ MAX_QPATH ]; @@ -2231,81 +2227,81 @@ Q_EXTERN vportal_t *sorted_portals[ MAX_MAP_PORTALS * 2 ]; ------------------------------------------------------------------------------- */ /* commandline arguments */ -Q_EXTERN qboolean wolfLight Q_ASSIGN( qfalse ); +Q_EXTERN bool wolfLight Q_ASSIGN( false ); Q_EXTERN float extraDist Q_ASSIGN( 0.0f ); -Q_EXTERN qboolean loMem Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noStyles Q_ASSIGN( qfalse ); -Q_EXTERN qboolean keepLights Q_ASSIGN( qfalse ); +Q_EXTERN bool loMem Q_ASSIGN( false ); +Q_EXTERN bool noStyles Q_ASSIGN( false ); +Q_EXTERN bool keepLights Q_ASSIGN( false ); Q_EXTERN int sampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_SAMPLE_SIZE ); Q_EXTERN int minSampleSize Q_ASSIGN( DEFAULT_LIGHTMAP_MIN_SAMPLE_SIZE ); Q_EXTERN float noVertexLighting Q_ASSIGN( 0.0f ); -Q_EXTERN qboolean nolm Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noGridLighting Q_ASSIGN( qfalse ); +Q_EXTERN bool nolm Q_ASSIGN( false ); +Q_EXTERN bool noGridLighting Q_ASSIGN( false ); -Q_EXTERN qboolean noTrace Q_ASSIGN( qfalse ); -Q_EXTERN qboolean noSurfaces Q_ASSIGN( qfalse ); -Q_EXTERN qboolean patchShadows Q_ASSIGN( qfalse ); -Q_EXTERN qboolean cpmaHack Q_ASSIGN( qfalse ); +Q_EXTERN bool noTrace Q_ASSIGN( false ); +Q_EXTERN bool noSurfaces Q_ASSIGN( false ); +Q_EXTERN bool patchShadows Q_ASSIGN( false ); +Q_EXTERN bool cpmaHack Q_ASSIGN( false ); -Q_EXTERN qboolean deluxemap Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugDeluxemap Q_ASSIGN( qfalse ); +Q_EXTERN bool deluxemap Q_ASSIGN( false ); +Q_EXTERN bool debugDeluxemap Q_ASSIGN( false ); Q_EXTERN int deluxemode Q_ASSIGN( 0 ); /* deluxemap format (0 - modelspace, 1 - tangentspace with renormalization, 2 - tangentspace without renormalization) */ -Q_EXTERN qboolean fast Q_ASSIGN( qfalse ); -Q_EXTERN qboolean fastpoint Q_ASSIGN( qtrue ); -Q_EXTERN qboolean faster Q_ASSIGN( qfalse ); -Q_EXTERN qboolean fastgrid Q_ASSIGN( qfalse ); -Q_EXTERN qboolean fastbounce Q_ASSIGN( qfalse ); -Q_EXTERN qboolean cheap Q_ASSIGN( qfalse ); -Q_EXTERN qboolean cheapgrid Q_ASSIGN( qfalse ); +Q_EXTERN bool fast Q_ASSIGN( false ); +Q_EXTERN bool fastpoint Q_ASSIGN( true ); +Q_EXTERN bool faster Q_ASSIGN( false ); +Q_EXTERN bool fastgrid Q_ASSIGN( false ); +Q_EXTERN bool fastbounce Q_ASSIGN( false ); +Q_EXTERN bool cheap Q_ASSIGN( false ); +Q_EXTERN bool cheapgrid Q_ASSIGN( false ); Q_EXTERN int bounce Q_ASSIGN( 0 ); -Q_EXTERN qboolean bounceOnly Q_ASSIGN( qfalse ); -Q_EXTERN qboolean bouncing Q_ASSIGN( qfalse ); -Q_EXTERN qboolean bouncegrid Q_ASSIGN( qfalse ); -Q_EXTERN qboolean normalmap Q_ASSIGN( qfalse ); -Q_EXTERN qboolean trisoup Q_ASSIGN( qfalse ); -Q_EXTERN qboolean shade Q_ASSIGN( qfalse ); +Q_EXTERN bool bounceOnly Q_ASSIGN( false ); +Q_EXTERN bool bouncing Q_ASSIGN( false ); +Q_EXTERN bool bouncegrid Q_ASSIGN( false ); +Q_EXTERN bool normalmap Q_ASSIGN( false ); +Q_EXTERN bool trisoup Q_ASSIGN( false ); +Q_EXTERN bool shade Q_ASSIGN( false ); Q_EXTERN float shadeAngleDegrees Q_ASSIGN( 0.0f ); Q_EXTERN int superSample Q_ASSIGN( 0 ); Q_EXTERN int lightSamples Q_ASSIGN( 1 ); -Q_EXTERN qboolean lightRandomSamples Q_ASSIGN( qfalse ); +Q_EXTERN bool lightRandomSamples Q_ASSIGN( false ); Q_EXTERN int lightSamplesSearchBoxSize Q_ASSIGN( 1 ); -Q_EXTERN qboolean filter Q_ASSIGN( qfalse ); -Q_EXTERN qboolean dark Q_ASSIGN( qfalse ); -Q_EXTERN qboolean sunOnly Q_ASSIGN( qfalse ); +Q_EXTERN bool filter Q_ASSIGN( false ); +Q_EXTERN bool dark Q_ASSIGN( false ); +Q_EXTERN bool sunOnly Q_ASSIGN( false ); Q_EXTERN int approximateTolerance Q_ASSIGN( 0 ); -Q_EXTERN qboolean noCollapse Q_ASSIGN( qfalse ); +Q_EXTERN bool noCollapse Q_ASSIGN( false ); Q_EXTERN int lightmapSearchBlockSize Q_ASSIGN( 0 ); -Q_EXTERN qboolean exportLightmaps Q_ASSIGN( qfalse ); -Q_EXTERN qboolean externalLightmaps Q_ASSIGN( qfalse ); +Q_EXTERN bool exportLightmaps Q_ASSIGN( false ); +Q_EXTERN bool externalLightmaps Q_ASSIGN( false ); Q_EXTERN int lmCustomSize Q_ASSIGN( LIGHTMAP_WIDTH ); Q_EXTERN char * lmCustomDir Q_ASSIGN( NULL ); Q_EXTERN int lmLimitSize Q_ASSIGN( 0 ); -Q_EXTERN qboolean dirty Q_ASSIGN( qfalse ); -Q_EXTERN qboolean dirtDebug Q_ASSIGN( qfalse ); +Q_EXTERN bool dirty Q_ASSIGN( false ); +Q_EXTERN bool dirtDebug Q_ASSIGN( false ); Q_EXTERN int dirtMode Q_ASSIGN( 0 ); Q_EXTERN float dirtDepth Q_ASSIGN( 128.0f ); Q_EXTERN float dirtScale Q_ASSIGN( 1.0f ); Q_EXTERN float dirtGain Q_ASSIGN( 1.0f ); /* 27: floodlighting */ -Q_EXTERN qboolean debugnormals Q_ASSIGN( qfalse ); -Q_EXTERN qboolean floodlighty Q_ASSIGN( qfalse ); -Q_EXTERN qboolean floodlight_lowquality Q_ASSIGN( qfalse ); +Q_EXTERN bool debugnormals Q_ASSIGN( false ); +Q_EXTERN bool floodlighty Q_ASSIGN( false ); +Q_EXTERN bool floodlight_lowquality Q_ASSIGN( false ); Q_EXTERN vec3_t floodlightRGB; Q_EXTERN float floodlightIntensity Q_ASSIGN( 512.0f ); Q_EXTERN float floodlightDistance Q_ASSIGN( 1024.0f ); Q_EXTERN float floodlightDirectionScale Q_ASSIGN( 1.0f ); -Q_EXTERN qboolean dump Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debug Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugUnused Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugAxis Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugCluster Q_ASSIGN( qfalse ); -Q_EXTERN qboolean debugOrigin Q_ASSIGN( qfalse ); -Q_EXTERN qboolean lightmapBorder Q_ASSIGN( qfalse ); +Q_EXTERN bool dump Q_ASSIGN( false ); +Q_EXTERN bool debug Q_ASSIGN( false ); +Q_EXTERN bool debugUnused Q_ASSIGN( false ); +Q_EXTERN bool debugAxis Q_ASSIGN( false ); +Q_EXTERN bool debugCluster Q_ASSIGN( false ); +Q_EXTERN bool debugOrigin Q_ASSIGN( false ); +Q_EXTERN bool lightmapBorder Q_ASSIGN( false ); //1=warn; 0=warn if lmsize>128 Q_EXTERN int debugSampleSize Q_ASSIGN( 0 ); @@ -2324,20 +2320,20 @@ Q_EXTERN float g_backsplashFractionScale Q_ASSIGN( 1.0f ); Q_EXTERN float g_backsplashDistance Q_ASSIGN( -999.0f ); /* jal: alternative angle attenuation curve */ -Q_EXTERN qboolean lightAngleHL Q_ASSIGN( qfalse ); +Q_EXTERN bool lightAngleHL Q_ASSIGN( false ); /* vortex: gridscale and gridambientscale */ Q_EXTERN float gridScale Q_ASSIGN( 1.0f ); Q_EXTERN float gridAmbientScale Q_ASSIGN( 1.0f ); Q_EXTERN float gridDirectionality Q_ASSIGN( 1.0f ); Q_EXTERN float gridAmbientDirectionality Q_ASSIGN( 0.0f ); -Q_EXTERN qboolean inGrid Q_ASSIGN( 0 ); +Q_EXTERN bool inGrid Q_ASSIGN( false ); /* ydnar: lightmap gamma/compensation */ Q_EXTERN float lightmapGamma Q_ASSIGN( 1.0f ); -Q_EXTERN float lightmapsRGB Q_ASSIGN( qfalse ); -Q_EXTERN float texturesRGB Q_ASSIGN( qfalse ); -Q_EXTERN float colorsRGB Q_ASSIGN( qfalse ); +Q_EXTERN float lightmapsRGB Q_ASSIGN( 0.0f ); +Q_EXTERN float texturesRGB Q_ASSIGN( 0.0f ); +Q_EXTERN float colorsRGB Q_ASSIGN( 0.0f ); Q_EXTERN float lightmapExposure Q_ASSIGN( 0.0f ); Q_EXTERN float lightmapCompensate Q_ASSIGN( 1.0f ); Q_EXTERN float lightmapBrightness Q_ASSIGN( 1.0f ); @@ -2345,13 +2341,13 @@ Q_EXTERN float lightmapContrast Q_ASSIGN( 1.0f ); /* ydnar: for runtime tweaking of falloff tolerance */ Q_EXTERN float falloffTolerance Q_ASSIGN( 1.0f ); -Q_EXTERN qboolean exactPointToPolygon Q_ASSIGN( qtrue ); +Q_EXTERN bool exactPointToPolygon Q_ASSIGN( true ); Q_EXTERN float formFactorValueScale Q_ASSIGN( 3.0f ); Q_EXTERN float linearScale Q_ASSIGN( 1.0f / 8000.0f ); // for .ase conversion -Q_EXTERN qboolean shadersAsBitmap Q_ASSIGN( qfalse ); -Q_EXTERN qboolean lightmapsAsTexcoord Q_ASSIGN( qfalse ); +Q_EXTERN bool shadersAsBitmap Q_ASSIGN( false ); +Q_EXTERN bool lightmapsAsTexcoord Q_ASSIGN( false ); Q_EXTERN light_t *lights; Q_EXTERN int numPointLights; diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index e2f0741b..9418dc0e 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -237,7 +237,7 @@ void TCModRotate( tcMod_t mod, float euler ){ applies a named surfaceparm to the supplied flags */ -qboolean ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *compileFlags ){ +bool ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *compileFlags ){ int i, fake; surfaceParm_t *sp; @@ -271,7 +271,7 @@ qboolean ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *compileFlags |= sp->compileFlags; /* return ok */ - return qtrue; + return true; } /* next */ @@ -295,12 +295,12 @@ qboolean ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *compileFlags |= sp->compileFlags; /* return ok */ - return qtrue; + return true; } } /* no matching surfaceparm found */ - return qfalse; + return false; } @@ -331,7 +331,7 @@ void BeginMapShaderFile( const char *mapFile ){ remove( mapShaderFile ); /* stop making warnings about missing images */ - warnImage = qfalse; + warnImage = false; } @@ -386,7 +386,7 @@ void WriteMapShaderFile( void ){ { /* get the shader and print it */ si = &shaderInfo[ i ]; - if ( si->custom == qfalse || si->shaderText == NULL || si->shaderText[ 0 ] == '\0' ) { + if ( !si->custom || si->shaderText == NULL || si->shaderText[ 0 ] == '\0' ) { continue; } num++; @@ -558,7 +558,7 @@ shaderInfo_t *CustomShader( shaderInfo_t *si, char *find, char *replace ){ /* clone the existing shader and rename */ memcpy( csi, si, sizeof( shaderInfo_t ) ); strcpy( csi->shader, shader ); - csi->custom = qtrue; + csi->custom = true; /* store new shader text */ csi->shaderText = copystring( shaderText ); /* LEAK! */ @@ -638,17 +638,17 @@ static shaderInfo_t *AllocShaderInfo( void ){ si->lightStyle = LS_NORMAL; - si->polygonOffset = qfalse; + si->polygonOffset = false; si->shadeAngleDegrees = 0.0f; si->lightmapSampleSize = 0; si->lightmapSampleOffset = DEFAULT_LIGHTMAP_SAMPLE_OFFSET; - si->patchShadows = qfalse; - si->vertexShadows = qtrue; /* ydnar: changed default behavior */ - si->forceSunlight = qfalse; + si->patchShadows = false; + si->vertexShadows = true; /* ydnar: changed default behavior */ + si->forceSunlight = false; si->lmBrightness = lightmapBrightness; si->vertexScale = vertexglobalscale; - si->notjunc = qfalse; + si->notjunc = false; /* ydnar: set texture coordinate transform matrix to identity */ TCModIdentity( si->mod ); @@ -686,9 +686,9 @@ void FinishShader( shaderInfo_t *si ){ } /* legacy terrain has explicit image-sized texture projection */ - if ( si->legacyTerrain && si->tcGen == qfalse ) { + if ( si->legacyTerrain && !si->tcGen ) { /* set xy texture projection */ - si->tcGen = qtrue; + si->tcGen = true; VectorSet( si->vecs[ 0 ], ( 1.0f / ( si->shaderWidth * 0.5f ) ), 0, 0 ); VectorSet( si->vecs[ 1 ], 0, ( 1.0f / ( si->shaderHeight * 0.5f ) ), 0 ); } @@ -719,7 +719,7 @@ void FinishShader( shaderInfo_t *si ){ } /* set to finished */ - si->finished = qtrue; + si->finished = true; } @@ -865,7 +865,7 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ){ } /* load image if necessary */ - if ( si->finished == qfalse ) { + if ( !si->finished ) { LoadShaderImages( si ); FinishShader( si ); } @@ -895,14 +895,14 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ){ static int oldScriptLine = 0; static int tabDepth = 0; -qboolean GetTokenAppend( char *buffer, qboolean crossline ){ - qboolean r; +bool GetTokenAppend( char *buffer, bool crossline ){ + bool r; int i; /* get the token */ r = GetToken( crossline ); - if ( r == qfalse || buffer == NULL || token[ 0 ] == '\0' ) { + if ( !r || buffer == NULL || token[ 0 ] == '\0' ) { return r; } @@ -937,17 +937,17 @@ void Parse1DMatrixAppend( char *buffer, int x, vec_t *m ){ int i; - if ( !GetTokenAppend( buffer, qtrue ) || strcmp( token, "(" ) ) { + if ( !GetTokenAppend( buffer, true ) || strcmp( token, "(" ) ) { Error( "Parse1DMatrixAppend(): line %d: ( not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation ); } for ( i = 0; i < x; i++ ) { - if ( !GetTokenAppend( buffer, qfalse ) ) { + if ( !GetTokenAppend( buffer, false ) ) { Error( "Parse1DMatrixAppend(): line %d: Number not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation ); } m[ i ] = atof( token ); } - if ( !GetTokenAppend( buffer, qtrue ) || strcmp( token, ")" ) ) { + if ( !GetTokenAppend( buffer, true ) || strcmp( token, ")" ) ) { Error( "Parse1DMatrixAppend(): line %d: ) not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation ); } } @@ -989,7 +989,7 @@ static void ParseShaderFile( const char *filename ){ shaderText[ 0 ] = '\0'; /* test for end of file */ - if ( !GetToken( qtrue ) ) { + if ( !GetToken( true ) ) { break; } @@ -1004,7 +1004,7 @@ static void ParseShaderFile( const char *filename ){ } /* handle { } section */ - if ( !GetTokenAppend( shaderText, qtrue ) ) { + if ( !GetTokenAppend( shaderText, true ) ) { break; } if ( strcmp( token, "{" ) ) { @@ -1021,7 +1021,7 @@ static void ParseShaderFile( const char *filename ){ while ( 1 ) { /* get the next token */ - if ( !GetTokenAppend( shaderText, qtrue ) ) { + if ( !GetTokenAppend( shaderText, true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -1035,10 +1035,10 @@ static void ParseShaderFile( const char *filename ){ /* parse stage directives */ if ( !strcmp( token, "{" ) ) { - si->hasPasses = qtrue; + si->hasPasses = true; while ( 1 ) { - if ( !GetTokenAppend( shaderText, qtrue ) ) { + if ( !GetTokenAppend( shaderText, true ) ) { break; } if ( !strcmp( token, "}" ) ) { @@ -1056,11 +1056,11 @@ static void ParseShaderFile( const char *filename ){ !Q_stricmp( token, "mapNoComp" ) ) { /* skip one token for animated stages */ if ( !Q_stricmp( token, "animMap" ) || !Q_stricmp( token, "clampAnimMap" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); } /* get an image */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] != '*' && token[ 0 ] != '$' ) { strcpy( si->lightImagePath, token ); DefaultExtension( si->lightImagePath, ".tga" ); @@ -1080,8 +1080,8 @@ static void ParseShaderFile( const char *filename ){ /* match surfaceparm */ else if ( !Q_stricmp( token, "surfaceparm" ) ) { - GetTokenAppend( shaderText, qfalse ); - if ( ApplySurfaceParm( token, &si->contentFlags, &si->surfaceFlags, &si->compileFlags ) == qfalse ) { + GetTokenAppend( shaderText, false ); + if ( !ApplySurfaceParm( token, &si->contentFlags, &si->surfaceFlags, &si->compileFlags ) ) { Sys_Warning( "Unknown surfaceparm: \"%s\"\n", token ); } } @@ -1093,25 +1093,25 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: fogparms (for determining fog volumes) */ else if ( !Q_stricmp( token, "fogparms" ) ) { - si->fogParms = qtrue; + si->fogParms = true; } /* ydnar: polygonoffset (for no culling) */ else if ( !Q_stricmp( token, "polygonoffset" ) ) { - si->polygonOffset = qtrue; + si->polygonOffset = true; } /* tesssize is used to force liquid surfaces to subdivide */ else if ( !Q_stricmp( token, "tessSize" ) || !Q_stricmp( token, "q3map_tessSize" ) /* sof2 */ ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->subdivisions = atof( token ); } /* cull none will set twoSided (ydnar: added disable too) */ else if ( !Q_stricmp( token, "cull" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( !Q_stricmp( token, "none" ) || !Q_stricmp( token, "disable" ) || !Q_stricmp( token, "twosided" ) ) { - si->twoSided = qtrue; + si->twoSided = true; } } @@ -1119,17 +1119,17 @@ static void ParseShaderFile( const char *filename ){ we catch this so autosprited surfaces become point lights instead of area lights */ else if ( !Q_stricmp( token, "deformVertexes" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); /* deformVertexes autosprite(2) */ if ( !Q_strncasecmp( token, "autosprite", 10 ) ) { /* set it as autosprite and detail */ - si->autosprite = qtrue; + si->autosprite = true; ApplySurfaceParm( "detail", &si->contentFlags, &si->surfaceFlags, &si->compileFlags ); /* ydnar: gs mods: added these useful things */ - si->noClip = qtrue; - si->notjunc = qtrue; + si->noClip = true; + si->notjunc = true; } /* deformVertexes move (ydnar: for particle studio support) */ @@ -1139,16 +1139,16 @@ static void ParseShaderFile( const char *filename ){ /* get move amount */ - GetTokenAppend( shaderText, qfalse ); amt[ 0 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); amt[ 1 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); amt[ 2 ] = atof( token ); + GetTokenAppend( shaderText, false ); amt[ 0 ] = atof( token ); + GetTokenAppend( shaderText, false ); amt[ 1 ] = atof( token ); + GetTokenAppend( shaderText, false ); amt[ 2 ] = atof( token ); /* skip func */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); /* get base and amplitude */ - GetTokenAppend( shaderText, qfalse ); base = atof( token ); - GetTokenAppend( shaderText, qfalse ); amp = atof( token ); + GetTokenAppend( shaderText, false ); base = atof( token ); + GetTokenAppend( shaderText, false ); amp = atof( token ); /* calculate */ VectorScale( amt, base, mins ); @@ -1160,23 +1160,23 @@ static void ParseShaderFile( const char *filename ){ /* light (old-style flare specification) */ else if ( !Q_stricmp( token, "light" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->flareShader = game->flareShader; } /* ydnar: damageShader (sof2 mods) */ else if ( !Q_stricmp( token, "damageShader" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] != '\0' ) { si->damageShader = copystring( token ); } - GetTokenAppend( shaderText, qfalse ); /* don't do anything with health */ + GetTokenAppend( shaderText, false ); /* don't do anything with health */ } /* ydnar: enemy territory implicit shaders */ else if ( !Q_stricmp( token, "implicitMap" ) ) { si->implicitMap = IM_OPAQUE; - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) { sprintf( si->implicitImagePath, "%s.tga", si->shader ); } @@ -1187,7 +1187,7 @@ static void ParseShaderFile( const char *filename ){ else if ( !Q_stricmp( token, "implicitMask" ) ) { si->implicitMap = IM_MASKED; - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) { sprintf( si->implicitImagePath, "%s.tga", si->shader ); } @@ -1198,7 +1198,7 @@ static void ParseShaderFile( const char *filename ){ else if ( !Q_stricmp( token, "implicitBlend" ) ) { si->implicitMap = IM_MASKED; - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) { sprintf( si->implicitImagePath, "%s.tga", si->shader ); } @@ -1214,21 +1214,21 @@ static void ParseShaderFile( const char *filename ){ /* qer_editorimage */ else if ( !Q_stricmp( token, "qer_editorImage" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); strcpy( si->editorImagePath, token ); DefaultExtension( si->editorImagePath, ".tga" ); } /* ydnar: q3map_normalimage (bumpmapping normal map) */ else if ( !Q_stricmp( token, "q3map_normalImage" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); strcpy( si->normalImagePath, token ); DefaultExtension( si->normalImagePath, ".tga" ); } /* q3map_lightimage */ else if ( !Q_stricmp( token, "q3map_lightImage" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); strcpy( si->lightImagePath, token ); DefaultExtension( si->lightImagePath, ".tga" ); } @@ -1236,7 +1236,7 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: skyparms */ else if ( !Q_stricmp( token, "skyParms" ) ) { /* get image base */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); /* ignore bogus paths */ if ( Q_stricmp( token, "-" ) && Q_stricmp( token, "full" ) ) { @@ -1249,8 +1249,8 @@ static void ParseShaderFile( const char *filename ){ } /* skip rest of line */ - GetTokenAppend( shaderText, qfalse ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); + GetTokenAppend( shaderText, false ); } /* ----------------------------------------------------------------- @@ -1265,13 +1265,8 @@ static void ParseShaderFile( const char *filename ){ else if ( !Q_stricmp( token, "sun" ) /* sof2 */ || !Q_stricmp( token, "q3map_sun" ) || !Q_stricmp( token, "q3map_sunExt" ) ) { float a, b; sun_t *sun; - qboolean ext = qfalse; - - /* ydnar: extended sun directive? */ - if ( !Q_stricmp( token, "q3map_sunext" ) ) { - ext = qtrue; - } + const bool ext = !Q_stricmp( token, "q3map_sunext" ); /* allocate sun */ sun = safe_calloc( sizeof( *sun ) ); @@ -1280,11 +1275,11 @@ static void ParseShaderFile( const char *filename ){ sun->style = si->lightStyle; /* get color */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); sun->color[ 0 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); sun->color[ 1 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); sun->color[ 2 ] = atof( token ); if ( colorsRGB ) { @@ -1297,15 +1292,15 @@ static void ParseShaderFile( const char *filename ){ ColorNormalize( sun->color, sun->color ); /* scale color by brightness */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); sun->photons = atof( token ); /* get sun angle/elevation */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); a = atof( token ); a = a / 180.0f * Q_PI; - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); b = atof( token ); b = b / 180.0f * Q_PI; @@ -1318,11 +1313,11 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: get sun angular deviance/samples */ if ( ext && TokenAvailable() ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); sun->deviance = atof( token ); sun->deviance = sun->deviance / 180.0f * Q_PI; - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); sun->numSamples = atoi( token ); } @@ -1342,14 +1337,14 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: q3map_baseShader (inherit this shader's parameters) */ if ( !Q_stricmp( token, "q3map_baseShader" ) ) { shaderInfo_t *si2; - qboolean oldWarnImage; + bool oldWarnImage; /* get shader */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); //% Sys_FPrintf( SYS_VRB, "Shader %s has base shader %s\n", si->shader, token ); oldWarnImage = warnImage; - warnImage = qfalse; + warnImage = false; si2 = ShaderInfoForShader( token ); warnImage = oldWarnImage; @@ -1365,7 +1360,7 @@ static void ParseShaderFile( const char *filename ){ strcpy( si->shader, temp ); si->shaderWidth = 0; si->shaderHeight = 0; - si->finished = qfalse; + si->finished = false; } } @@ -1379,26 +1374,26 @@ static void ParseShaderFile( const char *filename ){ si->surfaceModel = model; /* get parameters */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); strcpy( model->model, token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); model->density = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); model->odds = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); model->minScale = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); model->maxScale = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); model->minAngle = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); model->maxAngle = atof( token ); - GetTokenAppend( shaderText, qfalse ); - model->oriented = ( token[ 0 ] == '1' ? qtrue : qfalse ); + GetTokenAppend( shaderText, false ); + model->oriented = ( token[ 0 ] == '1' ); } /* ydnar/sd: q3map_foliage */ @@ -1412,30 +1407,30 @@ static void ParseShaderFile( const char *filename ){ si->foliage = foliage; /* get parameters */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); strcpy( foliage->model, token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); foliage->scale = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); foliage->density = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); foliage->odds = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); foliage->inverseAlpha = atoi( token ); } /* ydnar: q3map_bounce (fraction of light to re-emit during radiosity passes) */ else if ( !Q_stricmp( token, "q3map_bounce" ) || !Q_stricmp( token, "q3map_bounceScale" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->bounceScale = atof( token ); } /* ydnar/splashdamage: q3map_skyLight */ else if ( !Q_stricmp( token, "q3map_skyLight" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->skyLightValue = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->skyLightIterations = atoi( token ); /* clamp */ @@ -1449,13 +1444,13 @@ static void ParseShaderFile( const char *filename ){ /* q3map_surfacelight */ else if ( !Q_stricmp( token, "q3map_surfacelight" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->value = atof( token ); } /* q3map_lightStyle (sof2/jk2 lightstyle) */ else if ( !Q_stricmp( token, "q3map_lightStyle" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); val = atoi( token ); if ( val < 0 ) { val = 0; @@ -1469,11 +1464,11 @@ static void ParseShaderFile( const char *filename ){ /* wolf: q3map_lightRGB */ else if ( !Q_stricmp( token, "q3map_lightRGB" ) ) { VectorClear( si->color ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->color[ 0 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->color[ 1 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->color[ 2 ] = atof( token ); if ( colorsRGB ) { si->color[0] = Image_LinearFloatFromsRGBFloat( si->color[0] ); @@ -1485,32 +1480,32 @@ static void ParseShaderFile( const char *filename ){ /* q3map_lightSubdivide */ else if ( !Q_stricmp( token, "q3map_lightSubdivide" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->lightSubdivide = atoi( token ); } /* q3map_backsplash */ else if ( !Q_stricmp( token, "q3map_backsplash" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->backsplashFraction = atof( token ) * 0.01f; - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->backsplashDistance = atof( token ); } /* q3map_floodLight */ else if ( !Q_stricmp( token, "q3map_floodLight" ) ) { /* get color */ - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->floodlightRGB[ 0 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->floodlightRGB[ 1 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->floodlightRGB[ 2 ] = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->floodlightDistance = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->floodlightIntensity = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->floodlightDirectionScale = atof( token ); if ( colorsRGB ) { si->floodlightRGB[0] = Image_LinearFloatFromsRGBFloat( si->floodlightRGB[0] ); @@ -1522,32 +1517,32 @@ static void ParseShaderFile( const char *filename ){ /* jal: q3map_nodirty : skip dirty */ else if ( !Q_stricmp( token, "q3map_nodirty" ) ) { - si->noDirty = qtrue; + si->noDirty = true; } /* q3map_lightmapSampleSize */ else if ( !Q_stricmp( token, "q3map_lightmapSampleSize" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->lightmapSampleSize = atoi( token ); } /* q3map_lightmapSampleOffset */ else if ( !Q_stricmp( token, "q3map_lightmapSampleOffset" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->lightmapSampleOffset = atof( token ); } /* ydnar: q3map_lightmapFilterRadius */ else if ( !Q_stricmp( token, "q3map_lightmapFilterRadius" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->lmFilterRadius = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->lightFilterRadius = atof( token ); } /* ydnar: q3map_lightmapAxis [xyz] */ else if ( !Q_stricmp( token, "q3map_lightmapAxis" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( !Q_stricmp( token, "x" ) ) { VectorSet( si->lightmapAxis, 1, 0, 0 ); } @@ -1566,9 +1561,9 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: q3map_lightmapSize (for autogenerated shaders + external tga lightmaps) */ else if ( !Q_stricmp( token, "q3map_lightmapSize" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->lmCustomWidth = atoi( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->lmCustomHeight = atoi( token ); /* must be a power of 2 */ @@ -1583,7 +1578,7 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: q3map_lightmapBrightness N (for autogenerated shaders + external tga lightmaps) */ else if ( !Q_stricmp( token, "q3map_lightmapBrightness" ) || !Q_stricmp( token, "q3map_lightmapGamma" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->lmBrightness *= atof( token ); if ( si->lmBrightness < 0 ) { si->lmBrightness = 1.0; @@ -1592,18 +1587,18 @@ static void ParseShaderFile( const char *filename ){ /* q3map_vertexScale (scale vertex lighting by this fraction) */ else if ( !Q_stricmp( token, "q3map_vertexScale" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->vertexScale *= atof( token ); } /* q3map_noVertexLight */ else if ( !Q_stricmp( token, "q3map_noVertexLight" ) ) { - si->noVertexLight = qtrue; + si->noVertexLight = true; } /* q3map_flare[Shader] */ else if ( !Q_stricmp( token, "q3map_flare" ) || !Q_stricmp( token, "q3map_flareShader" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] != '\0' ) { si->flareShader = copystring( token ); } @@ -1611,7 +1606,7 @@ static void ParseShaderFile( const char *filename ){ /* q3map_backShader */ else if ( !Q_stricmp( token, "q3map_backShader" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] != '\0' ) { si->backShader = copystring( token ); } @@ -1619,7 +1614,7 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: q3map_cloneShader */ else if ( !Q_stricmp( token, "q3map_cloneShader" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] != '\0' ) { si->cloneShader = copystring( token ); } @@ -1627,7 +1622,7 @@ static void ParseShaderFile( const char *filename ){ /* q3map_remapShader */ else if ( !Q_stricmp( token, "q3map_remapShader" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] != '\0' ) { si->remapShader = copystring( token ); } @@ -1635,7 +1630,7 @@ static void ParseShaderFile( const char *filename ){ /* q3map_deprecateShader */ else if ( !Q_stricmp( token, "q3map_deprecateShader" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); if ( token[ 0 ] != '\0' ) { si->deprecateShader = copystring( token ); } @@ -1643,17 +1638,17 @@ static void ParseShaderFile( const char *filename ){ /* ydnar: q3map_offset */ else if ( !Q_stricmp( token, "q3map_offset" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->offset = atof( token ); } /* ydnar: q3map_fur */ else if ( !Q_stricmp( token, "q3map_fur" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->furNumLayers = atoi( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->furOffset = atof( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->furFade = atof( token ); } @@ -1661,39 +1656,39 @@ static void ParseShaderFile( const char *filename ){ else if ( !Q_stricmp( token, "q3map_terrain" ) ) { /* team arena terrain is assumed to be nonplanar, with full normal averaging, passed through the metatriangle surface pipeline, with a lightmap axis on z */ - si->legacyTerrain = qtrue; - si->noClip = qtrue; - si->notjunc = qtrue; - si->indexed = qtrue; - si->nonplanar = qtrue; - si->forceMeta = qtrue; + si->legacyTerrain = true; + si->noClip = true; + si->notjunc = true; + si->indexed = true; + si->nonplanar = true; + si->forceMeta = true; si->shadeAngleDegrees = 179.0f; //% VectorSet( si->lightmapAxis, 0, 0, 1 ); /* ydnar 2002-09-21: turning this off for better lightmapping of cliff faces */ } /* ydnar: picomodel: q3map_forceMeta (forces brush faces and/or triangle models to go through the metasurface pipeline) */ else if ( !Q_stricmp( token, "q3map_forceMeta" ) ) { - si->forceMeta = qtrue; + si->forceMeta = true; } /* ydnar: gs mods: q3map_shadeAngle */ else if ( !Q_stricmp( token, "q3map_shadeAngle" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->shadeAngleDegrees = atof( token ); } /* ydnar: q3map_textureSize (substitute for q3map_lightimage derivation for terrain) */ else if ( !Q_stricmp( token, "q3map_textureSize" ) ) { - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->shaderWidth = atoi( token ); - GetTokenAppend( shaderText, qfalse ); + GetTokenAppend( shaderText, false ); si->shaderHeight = atoi( token ); } /* ydnar: gs mods: q3map_tcGen