cs16-client now compiles with -Wall
This commit is contained in:
parent
b21d4d1a12
commit
1677afff9f
|
@ -25,7 +25,7 @@ project (CLDLL)
|
|||
|
||||
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ ")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined -std=c++11")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wl,--no-undefined -std=c++11")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
||||
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os")
|
||||
|
@ -172,7 +172,6 @@ set (CLDLL_SOURCES
|
|||
./entity.cpp
|
||||
./in_camera.cpp
|
||||
./input.cpp
|
||||
./overview.cpp
|
||||
./parsemsg.cpp
|
||||
./rain.cpp
|
||||
./tri.cpp
|
||||
|
|
|
@ -119,7 +119,7 @@ HUD_ConnectionlessPacket
|
|||
int DLLEXPORT HUD_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size )
|
||||
{
|
||||
// Parse stuff from args
|
||||
int max_buffer_size = *response_buffer_size;
|
||||
// int max_buffer_size = *response_buffer_size;
|
||||
|
||||
// Zero it out since we aren't going to respond.
|
||||
// If we wanted to response, we'd write data into response_buffer
|
||||
|
|
|
@ -46,7 +46,7 @@ void COM_Log( char *pszFile, char *fmt, ...)
|
|||
va_list argptr;
|
||||
char string[1024];
|
||||
FILE *fp;
|
||||
char *pfilename;
|
||||
const char *pfilename;
|
||||
|
||||
if ( !pszFile )
|
||||
{
|
||||
|
@ -285,8 +285,8 @@ stub functions for such things as precaching. So we don't have to modify weapon
|
|||
is compiled into both game and client .dlls.
|
||||
======================
|
||||
*/
|
||||
int stub_PrecacheModel ( char* s ) { return 0; }
|
||||
int stub_PrecacheSound ( char* s ) { return 0; }
|
||||
int stub_PrecacheModel ( const char* s ) { return 0; }
|
||||
int stub_PrecacheSound ( const char* s ) { return 0; }
|
||||
unsigned short stub_PrecacheEvent ( int type, const char *s ) { return 0; }
|
||||
const char *stub_NameForFunction ( unsigned int function ) { return "func"; }
|
||||
void stub_SetModel ( edict_t *e, const char *m ) {}
|
||||
|
|
|
@ -78,7 +78,7 @@ void UTIL_GunshotDecalTrace( TraceResult *pTrace, int decalNumber ) { }
|
|||
BOOL UTIL_IsValidEntity( edict_t *pent ) { return TRUE; }
|
||||
void UTIL_SetOrigin( entvars_t *, const Vector &org ) { }
|
||||
BOOL UTIL_GetNextBestWeapon( CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon ) { return TRUE; }
|
||||
void UTIL_LogPrintf(char *,...) { }
|
||||
void UTIL_LogPrintf(const char *,...) { }
|
||||
void UTIL_ClientPrintAll( int,char const *,char const *,char const *,char const *,char const *) { }
|
||||
void ClientPrint( entvars_t *client, int msg_dest, const char *msg_name, const char *param1, const char *param2, const char *param3, const char *param4 ) { }
|
||||
CBaseEntity *UTIL_FindEntityByClassname(CBaseEntity *pStartEntity, const char *szName) { return 0; }
|
||||
|
@ -168,7 +168,7 @@ void CBasePlayer::PreThink(void) { }
|
|||
void CBasePlayer::CheckTimeBasedDamage() { }
|
||||
void CBasePlayer :: UpdateGeigerCounter( void ) { }
|
||||
void CBasePlayer::CheckSuitUpdate() { }
|
||||
void CBasePlayer::SetSuitUpdate(char *name, int fgroup, int iNoRepeatTime) { }
|
||||
void CBasePlayer::SetSuitUpdate(const char *name, int fgroup, int iNoRepeatTime) { }
|
||||
void CBasePlayer :: UpdatePlayerSound ( void ) { }
|
||||
void CBasePlayer::PostThink() { }
|
||||
void CBasePlayer :: Precache( void ) { }
|
||||
|
|
|
@ -121,7 +121,7 @@ AlertMessage
|
|||
Print debug messages to console
|
||||
======================
|
||||
*/
|
||||
void AlertMessage( ALERT_TYPE atype, char *szFmt, ... )
|
||||
void AlertMessage( ALERT_TYPE atype, const char *szFmt, ... )
|
||||
{
|
||||
va_list argptr;
|
||||
static char string[1024];
|
||||
|
@ -424,7 +424,7 @@ CBasePlayerWeapon :: DefaultDeploy
|
|||
|
||||
=====================
|
||||
*/
|
||||
BOOL CBasePlayerWeapon :: DefaultDeploy( char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal )
|
||||
BOOL CBasePlayerWeapon :: DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal )
|
||||
{
|
||||
if ( !CanDeploy() )
|
||||
return FALSE;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
extern cvar_t *hud_textmode;
|
||||
float DrawUtils :: color[3];
|
||||
|
||||
int DrawUtils :: DrawHudString( int xpos, int ypos, int iMaxX, char *szIt, int r, int g, int b, bool drawing )
|
||||
int DrawUtils :: DrawHudString( int xpos, int ypos, int iMaxX, const char *str, int r, int g, int b, bool drawing )
|
||||
{
|
||||
int first_xpos = xpos;
|
||||
char *szIt = (char*)str;
|
||||
// draw the string until we hit the null character or a newline character
|
||||
for ( ; *szIt != 0 && *szIt != '\n'; szIt++ )
|
||||
{
|
||||
|
@ -64,11 +64,8 @@ int DrawUtils :: DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber
|
|||
|
||||
}
|
||||
|
||||
int DrawUtils :: DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b, bool drawing )
|
||||
int DrawUtils :: DrawHudStringReverse( int xpos, int ypos, int iMinX, const char *szString, int r, int g, int b, bool drawing )
|
||||
{
|
||||
int first_xpos = xpos;
|
||||
|
||||
|
||||
// iterate throug the string in reverse
|
||||
for ( signed int i = strlen(szString); i >= 0; i-- )
|
||||
{
|
||||
|
|
|
@ -612,7 +612,7 @@ void DLLEXPORT HUD_TempEntUpdate (
|
|||
static int gTempEntFrame = 0;
|
||||
int i;
|
||||
TEMPENTITY *pTemp, *pnext, *pprev;
|
||||
float freq, gravity, gravitySlow, life, fastFreq;
|
||||
float gravity, gravitySlow, life, fastFreq;
|
||||
|
||||
// Nothing to simulate
|
||||
if ( !*ppTempEntActive )
|
||||
|
@ -650,7 +650,6 @@ void DLLEXPORT HUD_TempEntUpdate (
|
|||
}
|
||||
|
||||
pprev = NULL;
|
||||
freq = client_time * 0.01;
|
||||
fastFreq = client_time * 5.5;
|
||||
gravity = -frametime * cl_gravity;
|
||||
gravitySlow = gravity * 0.5;
|
||||
|
@ -737,9 +736,11 @@ void DLLEXPORT HUD_TempEntUpdate (
|
|||
}
|
||||
else if ( pTemp->flags & FTENT_SPIRAL )
|
||||
{
|
||||
/*
|
||||
float s, c;
|
||||
s = sin( pTemp->entity.baseline.origin[2] + fastFreq );
|
||||
c = cos( pTemp->entity.baseline.origin[2] + fastFreq );
|
||||
*/
|
||||
|
||||
pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * frametime + 8 * sin( client_time * 20 + (long long)(void*)pTemp );
|
||||
pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * frametime + 4 * sin( client_time * 30 + (long long)(void*)pTemp );
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
static int tracerCount[ 32 ];
|
||||
extern float g_flRoundTime;
|
||||
|
||||
extern "C" char PM_FindTextureType( char *name );
|
||||
|
@ -106,8 +105,7 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
// hit the world, try to play sound based on texture material type
|
||||
char chTextureType = CHAR_TEX_CONCRETE;
|
||||
float fvol;
|
||||
float fvolbar;
|
||||
char *rgsz[4];
|
||||
const char *rgsz[4];
|
||||
int cnt;
|
||||
float fattn = ATTN_NORM;
|
||||
int entity;
|
||||
|
@ -164,7 +162,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_CONCRETE:
|
||||
{
|
||||
fvol = 0.9;
|
||||
fvolbar = 0.6;
|
||||
rgsz[0] = "player/pl_step1.wav";
|
||||
rgsz[1] = "player/pl_step2.wav";
|
||||
cnt = 2;
|
||||
|
@ -173,7 +170,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_METAL:
|
||||
{
|
||||
fvol = 0.9;
|
||||
fvolbar = 0.3;
|
||||
rgsz[0] = "player/pl_metal1.wav";
|
||||
rgsz[1] = "player/pl_metal2.wav";
|
||||
cnt = 2;
|
||||
|
@ -182,7 +178,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_DIRT:
|
||||
{
|
||||
fvol = 0.9;
|
||||
fvolbar = 0.1;
|
||||
rgsz[0] = "player/pl_dirt1.wav";
|
||||
rgsz[1] = "player/pl_dirt2.wav";
|
||||
rgsz[2] = "player/pl_dirt3.wav";
|
||||
|
@ -192,7 +187,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_VENT:
|
||||
{
|
||||
fvol = 0.5;
|
||||
fvolbar = 0.3;
|
||||
rgsz[0] = "player/pl_duct1.wav";
|
||||
rgsz[1] = "player/pl_duct1.wav";
|
||||
cnt = 2;
|
||||
|
@ -201,7 +195,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_GRATE:
|
||||
{
|
||||
fvol = 0.9;
|
||||
fvolbar = 0.5;
|
||||
rgsz[0] = "player/pl_grate1.wav";
|
||||
rgsz[1] = "player/pl_grate4.wav";
|
||||
cnt = 2;
|
||||
|
@ -210,7 +203,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_TILE:
|
||||
{
|
||||
fvol = 0.8;
|
||||
fvolbar = 0.2;
|
||||
rgsz[0] = "player/pl_tile1.wav";
|
||||
rgsz[1] = "player/pl_tile3.wav";
|
||||
rgsz[2] = "player/pl_tile2.wav";
|
||||
|
@ -221,7 +213,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_SLOSH:
|
||||
{
|
||||
fvol = 0.9;
|
||||
fvolbar = 0;
|
||||
rgsz[0] = "player/pl_slosh1.wav";
|
||||
rgsz[1] = "player/pl_slosh3.wav";
|
||||
rgsz[2] = "player/pl_slosh2.wav";
|
||||
|
@ -232,7 +223,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_SNOW:
|
||||
{
|
||||
fvol = 0.7;
|
||||
fvolbar = 0.4;
|
||||
rgsz[0] = "debris/pl_snow1.wav";
|
||||
rgsz[1] = "debris/pl_snow2.wav";
|
||||
rgsz[2] = "debris/pl_snow3.wav";
|
||||
|
@ -243,7 +233,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_WOOD:
|
||||
{
|
||||
fvol = 0.9;
|
||||
fvolbar = 0.2;
|
||||
rgsz[0] = "debris/wood1.wav";
|
||||
rgsz[1] = "debris/wood2.wav";
|
||||
rgsz[2] = "debris/wood3.wav";
|
||||
|
@ -254,7 +243,6 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
case CHAR_TEX_COMPUTER:
|
||||
{
|
||||
fvol = 0.8;
|
||||
fvolbar = 0.2;
|
||||
rgsz[0] = "debris/glass1.wav";
|
||||
rgsz[1] = "debris/glass2.wav";
|
||||
rgsz[2] = "debris/glass3.wav";
|
||||
|
@ -263,7 +251,7 @@ char EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *ve
|
|||
}
|
||||
case CHAR_TEX_FLESH:
|
||||
{
|
||||
fvol = 1.0;fvolbar = 0.2;
|
||||
fvol = 1.0;
|
||||
rgsz[0] = "weapons/bullet_hit1.wav";
|
||||
rgsz[1] = "weapons/bullet_hit2.wav";
|
||||
fattn = 1.0;
|
||||
|
@ -517,7 +505,6 @@ void EV_HLDM_FireBullets(int idx,
|
|||
int i;
|
||||
pmtrace_t tr;
|
||||
int iShot;
|
||||
int tracer;
|
||||
int iPenetrationPower;
|
||||
float flPenetrationDistance;
|
||||
|
||||
|
@ -567,7 +554,7 @@ void EV_HLDM_FireBullets(int idx,
|
|||
{
|
||||
gEngfuncs.pEventAPI->EV_SetTraceHull( 2 );
|
||||
gEngfuncs.pEventAPI->EV_PlayerTrace(vecShotSrc, vecEnd, 0, -1, &tr);
|
||||
tracer = EV_HLDM_CheckTracer( idx, vecShotSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount );
|
||||
EV_HLDM_CheckTracer( idx, vecShotSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount );
|
||||
|
||||
float flCurrentDistance = tr.fraction * flDistance;
|
||||
#ifdef _DEBUG
|
||||
|
|
|
@ -43,8 +43,7 @@ void EV_FireAUG( struct event_args_s *args )
|
|||
vec3_t ShellVelocity, ShellOrigin;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
int shell, idx, sequence;
|
||||
int shell, idx;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -43,13 +43,8 @@ void EV_FireAWP( event_args_t *args )
|
|||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
vec3_t velocity;
|
||||
|
||||
vec3_t ShellVelocity;
|
||||
vec3_t ShellOrigin;
|
||||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
@ -75,9 +70,6 @@ void EV_FireAWP( event_args_t *args )
|
|||
}
|
||||
#endif
|
||||
|
||||
shell = gEngfuncs.pEventAPI->EV_FindModelIndex ("models/rshell_big.mdl");
|
||||
EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, -right, up, 12, -10, -7 );
|
||||
|
||||
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON,
|
||||
"weapons/awp1.wav",
|
||||
1, ATTN_NORM, 0,
|
||||
|
|
|
@ -49,7 +49,6 @@ void EV_FireDEAGLE( event_args_t *args )
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -59,7 +59,6 @@ void EV_FireElite( event_args_s *args, int sequence )
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -49,7 +49,6 @@ void EV_FireFAMAS( event_args_t *args )
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -50,7 +50,6 @@ void EV_Fire57(event_args_t *args)
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -38,12 +38,11 @@ enum g3sg1_e
|
|||
|
||||
void EV_FireG3SG1(event_args_s *args)
|
||||
{
|
||||
vec3_t origin, angles, velocity;
|
||||
vec3_t origin, angles, velocity;
|
||||
|
||||
vec3_t ShellVelocity, ShellOrigin;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
int shell, idx;
|
||||
|
||||
idx = args->entindex;
|
||||
|
|
|
@ -50,7 +50,6 @@ void EV_FireGALIL( event_args_t *args )
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -71,7 +71,6 @@ void EV_Fireglock18( event_args_t *args )
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -43,7 +43,6 @@ void EV_FireM249(event_args_s *args)
|
|||
vec3_t ShellVelocity, ShellOrigin;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
int shell, idx;
|
||||
|
||||
idx = args->entindex;
|
||||
|
|
|
@ -45,12 +45,8 @@ void EV_FireM3( event_args_t *args )
|
|||
vec3_t angles;
|
||||
vec3_t velocity;
|
||||
|
||||
vec3_t ShellVelocity;
|
||||
vec3_t ShellOrigin;
|
||||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
@ -73,8 +69,6 @@ void EV_FireM3( event_args_t *args )
|
|||
}
|
||||
#endif
|
||||
|
||||
shell = gEngfuncs.pEventAPI->EV_FindModelIndex ("models/rshell.mdl");
|
||||
EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, -right, up, 12, -10, -7 );
|
||||
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON,
|
||||
"weapons/m3-1.wav",
|
||||
1, ATTN_NORM, 0,
|
||||
|
|
|
@ -57,7 +57,6 @@ void EV_FireM4A1( event_args_t *args )
|
|||
int shell, sequence;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
const char *szSoundName;
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -44,9 +44,7 @@ void EV_FireMAC10(event_args_s *args)
|
|||
vec3_t ShellVelocity, ShellOrigin;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
const char *szSoundName;
|
||||
int sequence, shell, idx;
|
||||
int shell, idx;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -49,7 +49,6 @@ void EV_FireMP5( event_args_t *args )
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -63,7 +63,6 @@ void EV_FireP228(event_args_s *args)
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -43,9 +43,7 @@ vec3_t origin, angles, velocity;
|
|||
vec3_t ShellVelocity, ShellOrigin;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
const char *szSoundName;
|
||||
int sequence, shell, idx;
|
||||
int shell, idx;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -42,10 +42,6 @@ void EV_FireScout(event_args_s *args)
|
|||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
vec3_t velocity;
|
||||
|
||||
vec3_t ShellVelocity;
|
||||
vec3_t ShellOrigin;
|
||||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
|
||||
|
@ -72,8 +68,6 @@ void EV_FireScout(event_args_s *args)
|
|||
}
|
||||
#endif
|
||||
|
||||
shell = gEngfuncs.pEventAPI->EV_FindModelIndex ("models/rshell_big.mdl");
|
||||
EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, -right, up, 12, -10, -7 );
|
||||
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON,
|
||||
"weapons/scout_fire-1.wav",
|
||||
1, ATTN_NORM, 0,
|
||||
|
|
|
@ -48,7 +48,6 @@ void EV_FireSG550(event_args_s *args)
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -49,7 +49,6 @@ void EV_FireSG552( event_args_t *args )
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -49,7 +49,6 @@ void EV_FireTMP(event_args_s *args)
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -49,7 +49,6 @@ void EV_FireUMP45(event_args_s *args)
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -72,7 +72,6 @@ void EV_FireUSP( event_args_t *args )
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
const char *szSoundName;
|
||||
|
||||
idx = args->entindex;
|
||||
|
|
|
@ -50,7 +50,6 @@ void EV_FireXM1014(event_args_s *args)
|
|||
int shell;
|
||||
vec3_t vecSrc, vecAiming;
|
||||
vec3_t up, right, forward;
|
||||
float flSpread = 0.01;
|
||||
|
||||
idx = args->entindex;
|
||||
VectorCopy( args->origin, origin );
|
||||
|
|
|
@ -74,7 +74,6 @@ int CHudMOTD :: Draw( float fTime )
|
|||
}
|
||||
|
||||
gHUD.m_iNoConsolePrint |= 1 << 1;
|
||||
bool bScroll;
|
||||
// find the top of where the MOTD should be drawn, so the whole thing is centered in the screen
|
||||
int ypos = (ScreenHeight - LINE_HEIGHT * m_iLines)/2; // shift it up slightly
|
||||
char *ch = m_szMOTD;
|
||||
|
@ -93,7 +92,6 @@ int CHudMOTD :: Draw( float fTime )
|
|||
ypos_r = ROW_RANGE_MIN;
|
||||
height = ROW_RANGE_MAX;
|
||||
}
|
||||
int ymax = ypos + height;
|
||||
if( xmax > ScreenWidth - 30 ) xmax = ScreenWidth - 30;
|
||||
char *next_line;
|
||||
DrawUtils::DrawRectangle(xpos-5, ypos_r - 5, xmax - xpos+10, height + 10);
|
||||
|
@ -101,7 +99,7 @@ int CHudMOTD :: Draw( float fTime )
|
|||
{
|
||||
int line_length = 0; // count the length of the current line
|
||||
for ( next_line = ch; *next_line != '\n' && *next_line != 0; next_line++ )
|
||||
line_length += gHUD.m_scrinfo.charWidths[ *next_line ];
|
||||
line_length += gHUD.m_scrinfo.charWidths[ (unsigned char)*next_line ];
|
||||
char *top = next_line;
|
||||
if ( *top == '\n' )
|
||||
*top = 0;
|
||||
|
|
|
@ -612,7 +612,6 @@ int CHudAmmo::MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf )
|
|||
int CHudAmmo::MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf )
|
||||
{
|
||||
static wrect_t nullrc;
|
||||
int fOnTarget = FALSE;
|
||||
|
||||
BEGIN_READ( pbuf, iSize );
|
||||
|
||||
|
@ -620,12 +619,6 @@ int CHudAmmo::MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf )
|
|||
int iId = READ_CHAR();
|
||||
int iClip = READ_CHAR();
|
||||
|
||||
// detect if we're also on target
|
||||
if ( iState > 1 )
|
||||
{
|
||||
fOnTarget = TRUE;
|
||||
}
|
||||
|
||||
if ( iId < 1 )
|
||||
{
|
||||
SetCrosshair(0, nullrc, 0, 0, 0);
|
||||
|
@ -731,7 +724,7 @@ int CHudAmmo::MsgFunc_Crosshair(const char *pszName, int iSize, void *pbuf)
|
|||
int CHudAmmo::MsgFunc_Brass( const char *pszName, int iSize, void *pbuf )
|
||||
{
|
||||
BEGIN_READ( pbuf, iSize );
|
||||
int MessageID = READ_BYTE();
|
||||
READ_BYTE();
|
||||
|
||||
Vector start, velocity;
|
||||
start.x = READ_COORD();
|
||||
|
@ -748,7 +741,7 @@ int CHudAmmo::MsgFunc_Brass( const char *pszName, int iSize, void *pbuf )
|
|||
int ModelIndex = READ_SHORT();
|
||||
int BounceSoundType = READ_BYTE();
|
||||
int Life = READ_BYTE();
|
||||
int PlayerID = READ_BYTE();
|
||||
READ_BYTE();
|
||||
|
||||
float sin, cos, x, y;
|
||||
sincosf( Rotation, &sin, &cos );
|
||||
|
@ -1010,7 +1003,7 @@ void CHudAmmo::UserCmd_Autobuy()
|
|||
|
||||
strncpy(szCmd, "cl_setautobuy", sizeof(szCmd));
|
||||
|
||||
while(pfile = gEngfuncs.COM_ParseFile( pfile, token ))
|
||||
while((pfile = gEngfuncs.COM_ParseFile( pfile, token )))
|
||||
{
|
||||
// append space first
|
||||
strncat(szCmd, " ", sizeof(szCmd));
|
||||
|
@ -1042,7 +1035,7 @@ void CHudAmmo::UserCmd_Rebuy()
|
|||
|
||||
|
||||
|
||||
while(pfile = gEngfuncs.COM_ParseFile( pfile, token ))
|
||||
while((pfile = gEngfuncs.COM_ParseFile( pfile, token )))
|
||||
{
|
||||
strncat(szCmd, token, sizeof(szCmd));
|
||||
// append space after token
|
||||
|
@ -1131,12 +1124,6 @@ int CHudAmmo::Draw(float flTime)
|
|||
x = ScreenWidth - (8 * AmmoWidth) - iIconWidth;
|
||||
x = DrawUtils::DrawHudNumber(x, y, iFlags | DHN_3DIGITS, pw->iClip, r, g, b);
|
||||
|
||||
wrect_t rc;
|
||||
rc.top = 0;
|
||||
rc.left = 0;
|
||||
rc.right = AmmoWidth;
|
||||
rc.bottom = 100;
|
||||
|
||||
int iBarWidth = AmmoWidth/10;
|
||||
|
||||
x += AmmoWidth/2;
|
||||
|
|
|
@ -181,7 +181,7 @@ int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *p
|
|||
gHUD.m_Scoreboard.GetAllPlayersInfo();
|
||||
|
||||
// Get the Killer's name
|
||||
char *killer_name = g_PlayerInfoList[ killer ].name;
|
||||
const char *killer_name = g_PlayerInfoList[ killer ].name;
|
||||
if ( !killer_name )
|
||||
{
|
||||
killer_name = "";
|
||||
|
@ -195,7 +195,7 @@ int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *p
|
|||
}
|
||||
|
||||
// Get the Victim's name
|
||||
char *victim_name = NULL;
|
||||
const char *victim_name = NULL;
|
||||
// If victim is -1, the killer killed a specific, non-player object (like a sentrygun)
|
||||
if ( ((char)victim) != -1 )
|
||||
victim_name = g_PlayerInfoList[ victim ].name;
|
||||
|
@ -276,7 +276,7 @@ int CHudDeathNotice :: MsgFunc_DeathMsg( const char *pszName, int iSize, void *p
|
|||
ConsolePrint( rgDeathNoticeList[i].szVictim );
|
||||
}
|
||||
|
||||
if ( killedwith && *killedwith && (*killedwith > 13 ) && strncmp( killedwith, "d_world", sizeof(killedwith) ) && !rgDeathNoticeList[i].bTeamKill )
|
||||
if ( *killedwith && (*killedwith > 13 ) && strncmp( killedwith, "d_world", sizeof(killedwith) ) && !rgDeathNoticeList[i].bTeamKill )
|
||||
{
|
||||
if ( headshot )
|
||||
ConsolePrint(" with a headshot from ");
|
||||
|
|
|
@ -65,7 +65,6 @@ int CHudGeiger::Draw (float flTime)
|
|||
{
|
||||
int pct;
|
||||
float flvol;
|
||||
int rg[3];
|
||||
int i;
|
||||
|
||||
if (m_iGeigerRange < 1000 && m_iGeigerRange > 0)
|
||||
|
@ -79,61 +78,42 @@ int CHudGeiger::Draw (float flTime)
|
|||
{
|
||||
pct = 2;
|
||||
flvol = 0.4; //Con_Printf ( "range > 600\n");
|
||||
rg[0] = 1;
|
||||
rg[1] = 1;
|
||||
i = 2;
|
||||
}
|
||||
else if (m_iGeigerRange > 500)
|
||||
{
|
||||
pct = 4;
|
||||
flvol = 0.5; //Con_Printf ( "range > 500\n");
|
||||
rg[0] = 1;
|
||||
rg[1] = 2;
|
||||
i = 2;
|
||||
}
|
||||
else if (m_iGeigerRange > 400)
|
||||
{
|
||||
pct = 8;
|
||||
flvol = 0.6; //Con_Printf ( "range > 400\n");
|
||||
rg[0] = 1;
|
||||
rg[1] = 2;
|
||||
rg[2] = 3;
|
||||
i = 3;
|
||||
}
|
||||
else if (m_iGeigerRange > 300)
|
||||
{
|
||||
pct = 8;
|
||||
flvol = 0.7; //Con_Printf ( "range > 300\n");
|
||||
rg[0] = 2;
|
||||
rg[1] = 3;
|
||||
rg[2] = 4;
|
||||
i = 3;
|
||||
}
|
||||
else if (m_iGeigerRange > 200)
|
||||
{
|
||||
pct = 28;
|
||||
flvol = 0.78; //Con_Printf ( "range > 200\n");
|
||||
rg[0] = 2;
|
||||
rg[1] = 3;
|
||||
rg[2] = 4;
|
||||
i = 3;
|
||||
}
|
||||
else if (m_iGeigerRange > 150)
|
||||
{
|
||||
pct = 40;
|
||||
flvol = 0.80; //Con_Printf ( "range > 150\n");
|
||||
rg[0] = 3;
|
||||
rg[1] = 4;
|
||||
rg[2] = 5;
|
||||
i = 3;
|
||||
}
|
||||
else if (m_iGeigerRange > 100)
|
||||
{
|
||||
pct = 60;
|
||||
flvol = 0.85; //Con_Printf ( "range > 100\n");
|
||||
rg[0] = 3;
|
||||
rg[1] = 4;
|
||||
rg[2] = 5;
|
||||
i = 3;
|
||||
}
|
||||
else if (m_iGeigerRange > 75)
|
||||
|
@ -141,25 +121,18 @@ int CHudGeiger::Draw (float flTime)
|
|||
pct = 80;
|
||||
flvol = 0.9; //Con_Printf ( "range > 75\n");
|
||||
//gflGeigerDelay = cl.time + GEIGERDELAY * 0.75;
|
||||
rg[0] = 4;
|
||||
rg[1] = 5;
|
||||
rg[2] = 6;
|
||||
i = 3;
|
||||
}
|
||||
else if (m_iGeigerRange > 50)
|
||||
{
|
||||
pct = 90;
|
||||
flvol = 0.95; //Con_Printf ( "range > 50\n");
|
||||
rg[0] = 5;
|
||||
rg[1] = 6;
|
||||
i = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
pct = 95;
|
||||
flvol = 1.0; //Con_Printf ( "range < 50\n");
|
||||
rg[0] = 5;
|
||||
rg[1] = 6;
|
||||
i = 2;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
#include "studio_util.h"
|
||||
#include "screenfade.h"
|
||||
|
||||
#ifdef MSC_VER
|
||||
#pragma warning(disable: 4244)
|
||||
#endif
|
||||
|
||||
extern "C" int iJumpSpectator;
|
||||
extern "C" float vJumpOrigin[3];
|
||||
|
|
|
@ -269,7 +269,7 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time )
|
|||
width = 0;
|
||||
}
|
||||
else
|
||||
width += gHUD.m_scrinfo.charWidths[*pText];
|
||||
width += gHUD.m_scrinfo.charWidths[(unsigned char)*pText];
|
||||
pText++;
|
||||
length++;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ extern float *GetClientColor( int clientIndex );
|
|||
// allow 20 pixels on either side of the text
|
||||
#define MAX_LINE_WIDTH ( ScreenWidth - 40 )
|
||||
#define LINE_START 10
|
||||
static float SCROLL_SPEED = 5;
|
||||
|
||||
static char g_szLineBuffer[ MAX_LINES + 1 ][ MAX_CHARS_PER_LINE ];
|
||||
static float *g_pflNameColors[ MAX_LINES + 1 ];
|
||||
|
|
|
@ -147,8 +147,6 @@ int CHudScoreboard :: Draw( float flTime )
|
|||
|
||||
int CHudScoreboard :: DrawScoreboard( float fTime )
|
||||
{
|
||||
int j;
|
||||
|
||||
GetAllPlayersInfo();
|
||||
|
||||
// Packetloss removed on Kelly 'shipping nazi' Bailey's orders
|
||||
|
@ -188,6 +186,7 @@ int CHudScoreboard :: DrawScoreboard( float fTime )
|
|||
// it's not teamplay, so just draw a simple player list
|
||||
DrawPlayers( list_slot );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CHudScoreboard :: DrawTeams( float list_slot )
|
||||
|
@ -339,7 +338,7 @@ int CHudScoreboard :: DrawTeams( float list_slot )
|
|||
}
|
||||
|
||||
// returns the ypos where it finishes drawing
|
||||
int CHudScoreboard :: DrawPlayers( float list_slot, int nameoffset, char *team )
|
||||
int CHudScoreboard :: DrawPlayers( float list_slot, int nameoffset, const char *team )
|
||||
{
|
||||
// draw the players, in order, and restricted to team if set
|
||||
while ( 1 )
|
||||
|
|
|
@ -70,7 +70,7 @@ char *CHudTextMessage::LocaliseTextString( const char *msg, char *dst_buffer, in
|
|||
continue;
|
||||
}
|
||||
|
||||
if(clmsg->pMessage[0] == '#') strncpy(dst, Localize(clmsg->pMessage+1), sizeof( dst ));
|
||||
if(clmsg->pMessage[0] == '#') strncpy(dst, Localize(clmsg->pMessage+1), buffer_size);
|
||||
|
||||
// copy string into message over the msg name
|
||||
for ( char *wsrc = (char*)clmsg->pMessage; *wsrc != 0; wsrc++, dst++ )
|
||||
|
@ -100,10 +100,10 @@ char *CHudTextMessage::BufferedLocaliseTextString( const char *msg )
|
|||
}
|
||||
|
||||
// Simplified version of LocaliseTextString; assumes string is only one word
|
||||
char *CHudTextMessage::LookupString( const char *msg, int *msg_dest )
|
||||
char *CHudTextMessage::LookupString( char *msg, int *msg_dest )
|
||||
{
|
||||
if ( !msg )
|
||||
return "";
|
||||
return (char*)"";
|
||||
|
||||
// '#' character indicates this is a reference to a string in titles.txt, and not the string itself
|
||||
if ( msg[0] == '#' )
|
||||
|
@ -192,7 +192,7 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf
|
|||
// VALVEWHY?
|
||||
if( strlen(msg_text) >= 3 )
|
||||
{
|
||||
for( int i = 0; i < strlen(msg_text) - 2; i++)
|
||||
for( size_t i = 0; i < strlen(msg_text) - 2; i++)
|
||||
{
|
||||
if( msg_text[i] == '%' && msg_text[i + 1] == 's' && isdigit(msg_text[i + 2]))
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ POINT cam_mouse;
|
|||
//-------------------------------------------------- Local Variables
|
||||
|
||||
static kbutton_t cam_pitchup, cam_pitchdown, cam_yawleft, cam_yawright;
|
||||
static kbutton_t cam_in, cam_out, cam_move;
|
||||
static kbutton_t cam_in, cam_out;
|
||||
|
||||
//-------------------------------------------------- Prototypes
|
||||
|
||||
|
|
|
@ -130,10 +130,12 @@ void VectorInverse ( float *v );
|
|||
|
||||
extern vec3_t vec3_origin;
|
||||
|
||||
#ifdef MSC_VER
|
||||
// disable 'possible loss of data converting float to int' warning message
|
||||
#pragma warning( disable: 4244 )
|
||||
// disable 'truncation from 'const double' to 'float' warning message
|
||||
#pragma warning( disable: 4305 )
|
||||
#endif
|
||||
|
||||
HSPRITE LoadSprite(const char *pszName);
|
||||
float *GetClientColor( int clientIndex );
|
||||
|
|
|
@ -52,8 +52,8 @@ int HUD_GetWeapon( void );
|
|||
void HUD_PlaySound( char *sound, float volume );
|
||||
void HUD_PlaybackEvent( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
|
||||
void HUD_SetMaxSpeed( const struct edict_s *ed, float speed );
|
||||
int stub_PrecacheModel( char* s );
|
||||
int stub_PrecacheSound( char* s );
|
||||
int stub_PrecacheModel( const char* s );
|
||||
int stub_PrecacheSound( const char* s );
|
||||
unsigned short stub_PrecacheEvent( int type, const char *s );
|
||||
const char *stub_NameForFunction ( unsigned int function );
|
||||
void stub_SetModel ( struct edict_s *e, const char *m );
|
||||
|
|
|
@ -46,10 +46,10 @@ public:
|
|||
static int DrawHudNumber2( int x, int y, int iNumber,
|
||||
int r, int g, int b);
|
||||
|
||||
static int DrawHudString(int x, int y, int iMaxX, char *szString,
|
||||
static int DrawHudString(int x, int y, int iMaxX, const char *szString,
|
||||
int r, int g, int b, bool drawing = false );
|
||||
|
||||
static int DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString,
|
||||
static int DrawHudStringReverse( int xpos, int ypos, int iMinX, const char *szString,
|
||||
int r, int g, int b, bool drawing = false );
|
||||
|
||||
static int DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber,
|
||||
|
|
|
@ -307,7 +307,7 @@ public:
|
|||
|
||||
int DrawScoreboard( float flTime );
|
||||
int DrawTeams( float listslot );
|
||||
int DrawPlayers( float listslot, int nameoffset = 0, char *team = NULL ); // returns the ypos where it finishes drawing
|
||||
int DrawPlayers( float listslot, int nameoffset = 0, const char *team = NULL ); // returns the ypos where it finishes drawing
|
||||
|
||||
void DeathMsg( int killer, int victim );
|
||||
void SetScoreboardDefaults( void );
|
||||
|
@ -579,7 +579,7 @@ public:
|
|||
int Init( void );
|
||||
static char *LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size );
|
||||
static char *BufferedLocaliseTextString( const char *msg );
|
||||
static char *LookupString( const char *msg_name, int *msg_dest = NULL );
|
||||
static char *LookupString( char *msg_name, int *msg_dest = NULL );
|
||||
CHudMsgFunc(TextMsg);
|
||||
};
|
||||
|
||||
|
@ -800,7 +800,7 @@ private:
|
|||
class CHud
|
||||
{
|
||||
public:
|
||||
CHud() : m_iSpriteCount(0), m_pHudList(NULL) {}
|
||||
CHud() : m_pHudList(NULL), m_iSpriteCount(0) {}
|
||||
~CHud(); // destructor, frees allocated memory // thanks, Captain Obvious
|
||||
|
||||
void Init( void );
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef unsigned int uchar32;
|
|||
#else
|
||||
|
||||
typedef unsigned short uchar16;
|
||||
typedef wchar_t uchar32;
|
||||
typedef unsigned int uchar32;
|
||||
|
||||
#endif // _WIN32
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef unsigned char byte;
|
|||
|
||||
static byte *gpBuf;
|
||||
static size_t giSize;
|
||||
static int giRead;
|
||||
static size_t giRead;
|
||||
static bool giBadRead;
|
||||
|
||||
void BEGIN_READ( void *buf, int size )
|
||||
|
@ -128,11 +128,10 @@ float READ_FLOAT( void )
|
|||
char* READ_STRING( void )
|
||||
{
|
||||
static char string[2048];
|
||||
int l,c;
|
||||
int c;
|
||||
size_t l = 0;
|
||||
|
||||
string[0] = 0;
|
||||
|
||||
l = 0;
|
||||
do
|
||||
{
|
||||
if ( giRead+1 > giSize )
|
||||
|
@ -143,7 +142,7 @@ char* READ_STRING( void )
|
|||
break;
|
||||
string[l] = c;
|
||||
l++;
|
||||
} while (l < sizeof(string)-1);
|
||||
} while (l < sizeof(string) - 1);
|
||||
|
||||
string[l] = 0;
|
||||
|
||||
|
|
|
@ -775,7 +775,6 @@ void CStudioModelRenderer::StudioMergeBones(model_t *m_pSubModel)
|
|||
{
|
||||
int i, j;
|
||||
double f;
|
||||
int do_hunt = true;
|
||||
|
||||
mstudiobone_t *pbones;
|
||||
mstudioseqdesc_t *pseqdesc;
|
||||
|
|
|
@ -89,7 +89,7 @@ int Q_UChar32ToUTF32(uchar32 uVal, uchar32 *pUTF32)
|
|||
}
|
||||
else
|
||||
{
|
||||
pUTF32[1] = uVal & 0x3FF | 0xDC00;
|
||||
pUTF32[1] = (uVal & 0x3FF) | 0xDC00;
|
||||
pUTF32[0] = ((uVal - 0x10000) >> 10) | 0xD800;
|
||||
return 2;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ int Q_UChar32ToUTF16(uchar32 uVal, uchar16 *pUTF16Out)
|
|||
}
|
||||
else
|
||||
{
|
||||
pUTF16Out[1] = uVal & 0x3FF | 0xDC00;
|
||||
pUTF16Out[1] = (uVal & 0x3FF) | 0xDC00;
|
||||
pUTF16Out[0] = ((uVal - 0x10000) >> 10) | 0xD800;
|
||||
return 2;
|
||||
}
|
||||
|
@ -212,22 +212,22 @@ int Q_UChar32ToUTF8(uchar32 uVal, char *pUTF8Out)
|
|||
else if (uVal <= 0x7FF)
|
||||
{
|
||||
*pUTF8Out = (uVal >> 6) | 0xC0;
|
||||
pUTF8Out[1] = uVal & 0x3F | 0x80;
|
||||
pUTF8Out[1] = (uVal & 0x3F) | 0x80;
|
||||
return 2;
|
||||
}
|
||||
else if (uVal <= 0xFFFF)
|
||||
{
|
||||
*pUTF8Out = (uVal >> 12) | 0xE0;
|
||||
pUTF8Out[2] = uVal & 0x3F | 0x80;
|
||||
pUTF8Out[1] = (uVal >> 6) & 0x3F | 0x80;
|
||||
pUTF8Out[2] = (uVal & 0x3F) | 0x80;
|
||||
pUTF8Out[1] = ((uVal >> 6) & 0x3F) | 0x80;
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pUTF8Out = (uVal >> 18) & 7 | 0xF0;
|
||||
pUTF8Out[1] = (uVal >> 12) & 0x3F | 0x80;
|
||||
pUTF8Out[3] = uVal & 0x3F | 0x80;
|
||||
pUTF8Out[2] = (uVal >> 6) & 0x3F | 0x80;
|
||||
*pUTF8Out = ((uVal >> 18) & 7) | 0xF0;
|
||||
pUTF8Out[1] = ((uVal >> 12) & 0x3F) | 0x80;
|
||||
pUTF8Out[3] = (uVal & 0x3F) | 0x80;
|
||||
pUTF8Out[2] = ((uVal >> 6) & 0x3F) | 0x80;
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ void V_NormalizeAngles( float *angles )
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
===================
|
||||
V_InterpolateAngles
|
||||
|
@ -143,7 +143,8 @@ Interpolate Euler angles.
|
|||
FIXME: Use Quaternions to avoid discontinuities
|
||||
Frac is 0.0 to 1.0 ( i.e., should probably be clamped, but doesn't have to be )
|
||||
===================
|
||||
|
||||
*/
|
||||
/*
|
||||
void V_InterpolateAngles( float *start, float *end, float *output, float frac )
|
||||
{
|
||||
int i;
|
||||
|
@ -433,12 +434,9 @@ V_CalcIntermissionRefdef
|
|||
*/
|
||||
void V_CalcIntermissionRefdef ( struct ref_params_s *pparams )
|
||||
{
|
||||
cl_entity_t *ent, *view;
|
||||
cl_entity_t *view;
|
||||
float old;
|
||||
|
||||
// ent is the player model ( visible when out of body )
|
||||
ent = gEngfuncs.GetLocalPlayer();
|
||||
|
||||
// view is the weapon model (only visible from inside body )
|
||||
view = gEngfuncs.GetViewModel();
|
||||
|
||||
|
|
12
dlls/cbase.h
12
dlls/cbase.h
|
@ -253,7 +253,7 @@ public:
|
|||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void FunctionCheck(void *pFunction, char *name)
|
||||
void FunctionCheck(void *pFunction, const char *name)
|
||||
{
|
||||
if (pFunction && !NAME_FOR_FUNCTION((unsigned long)(pFunction)))
|
||||
{
|
||||
|
@ -267,28 +267,28 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
BASEPTR ThinkSet(BASEPTR func, char *name)
|
||||
BASEPTR ThinkSet(BASEPTR func, const char *name)
|
||||
{
|
||||
m_pfnThink = func;
|
||||
FunctionCheck((void *)*((int *)((char *)this + (offsetof(CBaseEntity, m_pfnThink)))), name);
|
||||
return func;
|
||||
}
|
||||
|
||||
ENTITYFUNCPTR TouchSet(ENTITYFUNCPTR func, char *name)
|
||||
ENTITYFUNCPTR TouchSet(ENTITYFUNCPTR func, const char *name)
|
||||
{
|
||||
m_pfnTouch = func;
|
||||
FunctionCheck((void *)*((int *)((char *)this + (offsetof(CBaseEntity, m_pfnTouch)))), name);
|
||||
return func;
|
||||
}
|
||||
|
||||
USEPTR UseSet(USEPTR func, char *name)
|
||||
USEPTR UseSet(USEPTR func, const char *name)
|
||||
{
|
||||
m_pfnUse = func;
|
||||
FunctionCheck((void *)*((int *)((char *)this + (offsetof(CBaseEntity, m_pfnUse)))), name);
|
||||
return func;
|
||||
}
|
||||
|
||||
ENTITYFUNCPTR BlockedSet(ENTITYFUNCPTR func, char *name)
|
||||
ENTITYFUNCPTR BlockedSet(ENTITYFUNCPTR func, const char *name)
|
||||
{
|
||||
m_pfnBlocked = func;
|
||||
FunctionCheck((void *)*((int *)((char *)this + (offsetof(CBaseEntity, m_pfnBlocked)))), name);
|
||||
|
@ -349,7 +349,7 @@ public:
|
|||
};
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define SetThink(a) ThinkSet(static_cast <void (CBaseEntity::*)(void)>(a), #a)
|
||||
#define SetThink(a) ThinkSet(static_cast <void (CBaseEntity::*)(void)>(a), (char*)#a)
|
||||
#define SetTouch(a) TouchSet(static_cast <void (CBaseEntity::*)(CBaseEntity *)>(a), #a)
|
||||
#define SetUse(a) UseSet(static_cast <void (CBaseEntity::*)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)>(a), #a)
|
||||
#define SetBlocked(a) BlockedSet(static_cast <void (CBaseEntity::*)(CBaseEntity *)>(a), #a)
|
||||
|
|
|
@ -24,12 +24,14 @@
|
|||
#define DEBUG 1
|
||||
#endif
|
||||
|
||||
#ifdef MSC_VER
|
||||
// Silence certain warnings
|
||||
#pragma warning(disable : 4244) // int or float down-conversion
|
||||
#pragma warning(disable : 4305) // int or float data truncation
|
||||
#pragma warning(disable : 4201) // nameless struct/union
|
||||
#pragma warning(disable : 4514) // unreferenced inline function removed
|
||||
#pragma warning(disable : 4100) // unreferenced formal parameter
|
||||
#endif
|
||||
|
||||
#include "archtypes.h" // DAL
|
||||
|
||||
|
|
|
@ -338,7 +338,7 @@ public:
|
|||
void EXPORT PlayerDeathThink(void);
|
||||
void PlayerUse(void);
|
||||
void CheckSuitUpdate(void);
|
||||
void SetSuitUpdate(char *name, int fgroup, int iNoRepeat);
|
||||
void SetSuitUpdate(const char *name, int fgroup, int iNoRepeat);
|
||||
void UpdateGeigerCounter(void);
|
||||
void CheckTimeBasedDamage(void);
|
||||
void BarnacleVictimBitten(entvars_t *pevBarnacle);
|
||||
|
|
|
@ -277,7 +277,7 @@ extern char *UTIL_dtos1(int d);
|
|||
extern char *UTIL_dtos2(int d);
|
||||
extern char *UTIL_dtos3(int d);
|
||||
extern char *UTIL_dtos4(int d);
|
||||
extern void UTIL_LogPrintf(char *fmt, ...);
|
||||
extern void UTIL_LogPrintf(const char *fmt, ...);
|
||||
extern float UTIL_DotPoints(const Vector &vecSrc, const Vector &vecCheck, const Vector &vecDir);
|
||||
extern void UTIL_StripToken(const char *pKey, char *pDest);
|
||||
extern char UTIL_TextureHit(TraceResult *ptrHit, Vector vecSrc, Vector vecEnd);
|
||||
|
|
|
@ -613,7 +613,7 @@ public:
|
|||
virtual CBasePlayerItem *GetWeaponPtr(void) { return (CBasePlayerItem *)this; }
|
||||
|
||||
public:
|
||||
BOOL DefaultDeploy(char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0);
|
||||
BOOL DefaultDeploy(const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal = 0);
|
||||
int DefaultReload(int iClipSize, int iAnim, float fDelay, int body = 0);
|
||||
void ReloadSound(void);
|
||||
BOOL AddPrimaryAmmo(int iCount, char *szName, int iMaxClip, int iMaxCarry);
|
||||
|
|
|
@ -199,7 +199,7 @@ typedef struct cl_enginefuncs_s
|
|||
void ( *pfnWeaponAnim ) ( int iAnim, int body );
|
||||
float ( *pfnRandomFloat ) ( float flLow, float flHigh );
|
||||
long ( *pfnRandomLong ) ( long lLow, long lHigh );
|
||||
void ( *pfnHookEvent ) ( char *name, void ( *pfnEvent )( struct event_args_s *args ) );
|
||||
void ( *pfnHookEvent ) ( const char *name, void ( *pfnEvent )( struct event_args_s *args ) );
|
||||
int (*Con_IsVisible) ();
|
||||
const char *( *pfnGetGameDirectory ) ( void );
|
||||
struct cvar_s *( *pfnGetCvarPointer ) ( const char *szName );
|
||||
|
|
|
@ -104,8 +104,8 @@ typedef struct
|
|||
// Engine hands this to DLLs for functionality callbacks
|
||||
typedef struct enginefuncs_s
|
||||
{
|
||||
int (*pfnPrecacheModel) (char* s);
|
||||
int (*pfnPrecacheSound) (char* s);
|
||||
int (*pfnPrecacheModel) (const char* s);
|
||||
int (*pfnPrecacheSound) (const char* s);
|
||||
void (*pfnSetModel) (edict_t *e, const char *m);
|
||||
int (*pfnModelIndex) (const char *m);
|
||||
int (*pfnModelFrames) (int modelIndex);
|
||||
|
@ -165,8 +165,8 @@ typedef struct enginefuncs_s
|
|||
const char* (*pfnCVarGetString) (const char *szVarName);
|
||||
void (*pfnCVarSetFloat) (const char *szVarName, float flValue);
|
||||
void (*pfnCVarSetString) (const char *szVarName, const char *szValue);
|
||||
void (*pfnAlertMessage) (ALERT_TYPE atype, char *szFmt, ...);
|
||||
void (*pfnEngineFprintf) (void *pfile, char *szFmt, ...);
|
||||
void (*pfnAlertMessage) (ALERT_TYPE atype, const char *szFmt, ...);
|
||||
void (*pfnEngineFprintf) (void *pfile, const char *szFmt, ...);
|
||||
void* (*pfnPvAllocEntPrivateData) (edict_t *pEdict, int32 cb);
|
||||
void* (*pfnPvEntPrivateData) (edict_t *pEdict);
|
||||
void (*pfnFreeEntPrivateData) (edict_t *pEdict);
|
||||
|
|
|
@ -23,8 +23,10 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef MSC_VER
|
||||
#pragma warning(disable : 4244)
|
||||
#pragma warning(disable : 4305)
|
||||
#endif
|
||||
|
||||
extern playermove_t *pmove;
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
// fall over
|
||||
#define ROLL 2
|
||||
|
||||
#ifdef MSC_VER
|
||||
#pragma warning(disable : 4244)
|
||||
#endif
|
||||
|
||||
vec3_t vec3_origin = {0,0,0};
|
||||
int nanmask = 255<<23;
|
||||
|
|
|
@ -131,7 +131,9 @@ hull_t;
|
|||
|
||||
#define PLAYER_LONGJUMP_SPEED 350
|
||||
|
||||
#ifdef MSC_VER
|
||||
#pragma warning(disable : 4244)
|
||||
#endif
|
||||
|
||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
|
@ -502,7 +504,6 @@ void PM_UpdateStepSound(void)
|
|||
float fvol;
|
||||
vec3_t knee;
|
||||
vec3_t feet;
|
||||
vec3_t center;
|
||||
float height;
|
||||
float speed;
|
||||
int fLadder;
|
||||
|
@ -528,7 +529,6 @@ void PM_UpdateStepSound(void)
|
|||
{
|
||||
PM_CatagorizeTextureType();
|
||||
|
||||
VectorCopy(pmove->origin, center);
|
||||
VectorCopy(pmove->origin, knee);
|
||||
VectorCopy(pmove->origin, feet);
|
||||
|
||||
|
@ -925,7 +925,6 @@ void PM_Accelerate(vec3_t wishdir, float wishspeed, float accel)
|
|||
|
||||
void PM_WalkMove(void)
|
||||
{
|
||||
int clip;
|
||||
int oldonground;
|
||||
int i;
|
||||
|
||||
|
@ -935,7 +934,7 @@ void PM_WalkMove(void)
|
|||
vec3_t wishdir;
|
||||
float wishspeed;
|
||||
|
||||
vec3_t dest, start;
|
||||
vec3_t dest;
|
||||
vec3_t original, originalvel;
|
||||
vec3_t down, downvel;
|
||||
float downdist, updist;
|
||||
|
@ -994,7 +993,6 @@ void PM_WalkMove(void)
|
|||
dest[1] = pmove->origin[1] + pmove->velocity[1]*pmove->frametime;
|
||||
dest[2] = pmove->origin[2];
|
||||
|
||||
VectorCopy(dest, start);
|
||||
trace = pmove->PM_PlayerTrace(pmove->origin, dest, PM_NORMAL, -1);
|
||||
|
||||
if (trace.fraction == 1)
|
||||
|
@ -1012,7 +1010,7 @@ void PM_WalkMove(void)
|
|||
VectorCopy(pmove->origin, original);
|
||||
VectorCopy(pmove->velocity, originalvel);
|
||||
|
||||
clip = PM_FlyMove();
|
||||
PM_FlyMove();
|
||||
|
||||
VectorCopy(pmove->origin, down);
|
||||
VectorCopy(pmove->velocity, downvel);
|
||||
|
@ -1028,7 +1026,7 @@ void PM_WalkMove(void)
|
|||
if (!trace.startsolid && !trace.allsolid)
|
||||
VectorCopy(trace.endpos, pmove->origin);
|
||||
|
||||
clip = PM_FlyMove();
|
||||
PM_FlyMove();
|
||||
|
||||
VectorCopy(pmove->origin, dest);
|
||||
dest[2] -= pmove->movevars->stepsize;
|
||||
|
@ -1490,7 +1488,6 @@ int PM_CheckStuck(void)
|
|||
void PM_SpectatorMove(void)
|
||||
{
|
||||
float speed, drop, friction, control, newspeed;
|
||||
float accel;
|
||||
float currentspeed, addspeed, accelspeed;
|
||||
int i;
|
||||
vec3_t wishvel;
|
||||
|
@ -1630,7 +1627,6 @@ void PM_FixPlayerCrouchStuck(int direction)
|
|||
|
||||
void PM_UnDuck(void)
|
||||
{
|
||||
int i;
|
||||
pmtrace_t trace;
|
||||
vec3_t newOrigin;
|
||||
|
||||
|
@ -1675,16 +1671,12 @@ void PM_UnDuck(void)
|
|||
|
||||
void PM_Duck(void)
|
||||
{
|
||||
int i;
|
||||
float time;
|
||||
float duckFraction;
|
||||
|
||||
int buttonsChanged = (pmove->oldbuttons ^ pmove->cmd.buttons);
|
||||
int nButtonPressed = buttonsChanged & pmove->cmd.buttons;
|
||||
|
||||
int duckchange = buttonsChanged & IN_DUCK ? 1 : 0;
|
||||
int duckpressed = nButtonPressed & IN_DUCK ? 1 : 0;
|
||||
|
||||
if (pmove->cmd.buttons & IN_DUCK)
|
||||
{
|
||||
pmove->oldbuttons |= IN_DUCK;
|
||||
|
@ -2022,7 +2014,6 @@ void PM_NoClip(void)
|
|||
int i;
|
||||
vec3_t wishvel;
|
||||
float fmove, smove;
|
||||
float currentspeed, addspeed, accelspeed;
|
||||
|
||||
fmove = pmove->cmd.forwardmove;
|
||||
smove = pmove->cmd.sidemove;
|
||||
|
@ -2067,11 +2058,6 @@ void PM_PreventMegaBunnyJumping(void)
|
|||
|
||||
void PM_Jump(void)
|
||||
{
|
||||
int i;
|
||||
qboolean tfc = false;
|
||||
|
||||
qboolean cansuperjump = false;
|
||||
|
||||
if (pmove->dead)
|
||||
{
|
||||
pmove->oldbuttons |= IN_JUMP;
|
||||
|
|
|
@ -10,22 +10,20 @@
|
|||
//
|
||||
// A growable memory class.
|
||||
//=============================================================================
|
||||
|
||||
#pragma once
|
||||
#ifndef UTLMEMORY_H
|
||||
#define UTLMEMORY_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <new>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef MSC_VER
|
||||
#pragma warning (disable:4100)
|
||||
#pragma warning (disable:4514)
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Methods to invoke the constructor, copy constructor, and destructor
|
||||
|
|
Loading…
Reference in New Issue