diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 3fbc53d..3e53ca4 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -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 diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 97fa883..2222442 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.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 diff --git a/cl_dll/com_weapons.cpp b/cl_dll/com_weapons.cpp index 8891aba..20574c9 100644 --- a/cl_dll/com_weapons.cpp +++ b/cl_dll/com_weapons.cpp @@ -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 ) {} diff --git a/cl_dll/cs_wpn/cs_baseentity.cpp b/cl_dll/cs_wpn/cs_baseentity.cpp index 7dacce4..571cf65 100644 --- a/cl_dll/cs_wpn/cs_baseentity.cpp +++ b/cl_dll/cs_wpn/cs_baseentity.cpp @@ -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 ) { } diff --git a/cl_dll/cs_wpn/cs_weapons.cpp b/cl_dll/cs_wpn/cs_weapons.cpp index 483bad1..1c1aecf 100644 --- a/cl_dll/cs_wpn/cs_weapons.cpp +++ b/cl_dll/cs_wpn/cs_weapons.cpp @@ -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; diff --git a/cl_dll/draw_util.cpp b/cl_dll/draw_util.cpp index 4d1f68e..c2979b2 100644 --- a/cl_dll/draw_util.cpp +++ b/cl_dll/draw_util.cpp @@ -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-- ) { diff --git a/cl_dll/entity.cpp b/cl_dll/entity.cpp index 226ac5e..e7cb8a4 100644 --- a/cl_dll/entity.cpp +++ b/cl_dll/entity.cpp @@ -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 ); diff --git a/cl_dll/events/ev_cs16.cpp b/cl_dll/events/ev_cs16.cpp index 7090ba7..8a87be3 100644 --- a/cl_dll/events/ev_cs16.cpp +++ b/cl_dll/events/ev_cs16.cpp @@ -38,7 +38,6 @@ #include -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 diff --git a/cl_dll/events/event_aug.cpp b/cl_dll/events/event_aug.cpp index 217ad6d..fddddca 100644 --- a/cl_dll/events/event_aug.cpp +++ b/cl_dll/events/event_aug.cpp @@ -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 ); diff --git a/cl_dll/events/event_awp.cpp b/cl_dll/events/event_awp.cpp index dbbb9f6..ef42642 100644 --- a/cl_dll/events/event_awp.cpp +++ b/cl_dll/events/event_awp.cpp @@ -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, diff --git a/cl_dll/events/event_deagle.cpp b/cl_dll/events/event_deagle.cpp index dfc9a8e..66c8922 100644 --- a/cl_dll/events/event_deagle.cpp +++ b/cl_dll/events/event_deagle.cpp @@ -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 ); diff --git a/cl_dll/events/event_elite_left.cpp b/cl_dll/events/event_elite_left.cpp index 4d7f406..737ddf3 100644 --- a/cl_dll/events/event_elite_left.cpp +++ b/cl_dll/events/event_elite_left.cpp @@ -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 ); diff --git a/cl_dll/events/event_famas.cpp b/cl_dll/events/event_famas.cpp index 8a64c72..2145cf9 100644 --- a/cl_dll/events/event_famas.cpp +++ b/cl_dll/events/event_famas.cpp @@ -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 ); diff --git a/cl_dll/events/event_fiveseven.cpp b/cl_dll/events/event_fiveseven.cpp index c4c814d..f26e46b 100644 --- a/cl_dll/events/event_fiveseven.cpp +++ b/cl_dll/events/event_fiveseven.cpp @@ -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 ); diff --git a/cl_dll/events/event_g3sg1.cpp b/cl_dll/events/event_g3sg1.cpp index c4a7c04..48c4559 100644 --- a/cl_dll/events/event_g3sg1.cpp +++ b/cl_dll/events/event_g3sg1.cpp @@ -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; diff --git a/cl_dll/events/event_galil.cpp b/cl_dll/events/event_galil.cpp index 325de22..177a189 100644 --- a/cl_dll/events/event_galil.cpp +++ b/cl_dll/events/event_galil.cpp @@ -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 ); diff --git a/cl_dll/events/event_glock18.cpp b/cl_dll/events/event_glock18.cpp index b69b9f2..53cf259 100644 --- a/cl_dll/events/event_glock18.cpp +++ b/cl_dll/events/event_glock18.cpp @@ -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 ); diff --git a/cl_dll/events/event_m249.cpp b/cl_dll/events/event_m249.cpp index 79437af..d0a85ef 100644 --- a/cl_dll/events/event_m249.cpp +++ b/cl_dll/events/event_m249.cpp @@ -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; diff --git a/cl_dll/events/event_m3.cpp b/cl_dll/events/event_m3.cpp index b506ab9..2d9eabc 100644 --- a/cl_dll/events/event_m3.cpp +++ b/cl_dll/events/event_m3.cpp @@ -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, diff --git a/cl_dll/events/event_m4a1.cpp b/cl_dll/events/event_m4a1.cpp index c8ebb71..0d954a9 100644 --- a/cl_dll/events/event_m4a1.cpp +++ b/cl_dll/events/event_m4a1.cpp @@ -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 ); diff --git a/cl_dll/events/event_mac10.cpp b/cl_dll/events/event_mac10.cpp index d475952..0a2c88a 100644 --- a/cl_dll/events/event_mac10.cpp +++ b/cl_dll/events/event_mac10.cpp @@ -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 ); diff --git a/cl_dll/events/event_mp5n.cpp b/cl_dll/events/event_mp5n.cpp index daad661..361e093 100644 --- a/cl_dll/events/event_mp5n.cpp +++ b/cl_dll/events/event_mp5n.cpp @@ -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 ); diff --git a/cl_dll/events/event_p228.cpp b/cl_dll/events/event_p228.cpp index 4e2c486..7875651 100644 --- a/cl_dll/events/event_p228.cpp +++ b/cl_dll/events/event_p228.cpp @@ -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 ); diff --git a/cl_dll/events/event_p90.cpp b/cl_dll/events/event_p90.cpp index 5fe2b6b..2865515 100644 --- a/cl_dll/events/event_p90.cpp +++ b/cl_dll/events/event_p90.cpp @@ -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 ); diff --git a/cl_dll/events/event_scout.cpp b/cl_dll/events/event_scout.cpp index ca95d2e..9ca6d17 100644 --- a/cl_dll/events/event_scout.cpp +++ b/cl_dll/events/event_scout.cpp @@ -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, diff --git a/cl_dll/events/event_sg550.cpp b/cl_dll/events/event_sg550.cpp index f78e87a..36fa581 100644 --- a/cl_dll/events/event_sg550.cpp +++ b/cl_dll/events/event_sg550.cpp @@ -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 ); diff --git a/cl_dll/events/event_sg552.cpp b/cl_dll/events/event_sg552.cpp index daeb8b6..ca11a30 100644 --- a/cl_dll/events/event_sg552.cpp +++ b/cl_dll/events/event_sg552.cpp @@ -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 ); diff --git a/cl_dll/events/event_tmp.cpp b/cl_dll/events/event_tmp.cpp index 724cc11..6082cfa 100644 --- a/cl_dll/events/event_tmp.cpp +++ b/cl_dll/events/event_tmp.cpp @@ -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 ); diff --git a/cl_dll/events/event_ump45.cpp b/cl_dll/events/event_ump45.cpp index 0841b82..871fea1 100644 --- a/cl_dll/events/event_ump45.cpp +++ b/cl_dll/events/event_ump45.cpp @@ -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 ); diff --git a/cl_dll/events/event_usp.cpp b/cl_dll/events/event_usp.cpp index eedf568..e672602 100644 --- a/cl_dll/events/event_usp.cpp +++ b/cl_dll/events/event_usp.cpp @@ -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; diff --git a/cl_dll/events/event_xm1014.cpp b/cl_dll/events/event_xm1014.cpp index 7ea6581..3a68353 100644 --- a/cl_dll/events/event_xm1014.cpp +++ b/cl_dll/events/event_xm1014.cpp @@ -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 ); diff --git a/cl_dll/hud/MOTD.cpp b/cl_dll/hud/MOTD.cpp index 3932ab9..5f6948c 100644 --- a/cl_dll/hud/MOTD.cpp +++ b/cl_dll/hud/MOTD.cpp @@ -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; diff --git a/cl_dll/hud/ammo.cpp b/cl_dll/hud/ammo.cpp index db18c56..6cee00f 100644 --- a/cl_dll/hud/ammo.cpp +++ b/cl_dll/hud/ammo.cpp @@ -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; diff --git a/cl_dll/hud/death.cpp b/cl_dll/hud/death.cpp index 03a90e3..c0b3f42 100644 --- a/cl_dll/hud/death.cpp +++ b/cl_dll/hud/death.cpp @@ -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 "); diff --git a/cl_dll/hud/geiger.cpp b/cl_dll/hud/geiger.cpp index 8fa1407..2bc1a4a 100644 --- a/cl_dll/hud/geiger.cpp +++ b/cl_dll/hud/geiger.cpp @@ -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; } diff --git a/cl_dll/hud/hud_spectator.cpp b/cl_dll/hud/hud_spectator.cpp index dec582c..c256f1e 100644 --- a/cl_dll/hud/hud_spectator.cpp +++ b/cl_dll/hud/hud_spectator.cpp @@ -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]; diff --git a/cl_dll/hud/message.cpp b/cl_dll/hud/message.cpp index 9a06d11..0f5f4c3 100644 --- a/cl_dll/hud/message.cpp +++ b/cl_dll/hud/message.cpp @@ -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++; } diff --git a/cl_dll/hud/saytext.cpp b/cl_dll/hud/saytext.cpp index 6aee2c2..5526add 100644 --- a/cl_dll/hud/saytext.cpp +++ b/cl_dll/hud/saytext.cpp @@ -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 ]; diff --git a/cl_dll/hud/scoreboard.cpp b/cl_dll/hud/scoreboard.cpp index 18c18d7..177f051 100644 --- a/cl_dll/hud/scoreboard.cpp +++ b/cl_dll/hud/scoreboard.cpp @@ -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 ) diff --git a/cl_dll/hud/text_message.cpp b/cl_dll/hud/text_message.cpp index ce08773..b0c11db 100644 --- a/cl_dll/hud/text_message.cpp +++ b/cl_dll/hud/text_message.cpp @@ -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])) { diff --git a/cl_dll/in_camera.cpp b/cl_dll/in_camera.cpp index e96a438..6803fbd 100644 --- a/cl_dll/in_camera.cpp +++ b/cl_dll/in_camera.cpp @@ -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 diff --git a/cl_dll/include/cl_util.h b/cl_dll/include/cl_util.h index 573f622..476f20c 100644 --- a/cl_dll/include/cl_util.h +++ b/cl_dll/include/cl_util.h @@ -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 ); diff --git a/cl_dll/include/com_weapons.h b/cl_dll/include/com_weapons.h index dab8abe..1ff3aa9 100644 --- a/cl_dll/include/com_weapons.h +++ b/cl_dll/include/com_weapons.h @@ -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 ); diff --git a/cl_dll/include/draw_util.h b/cl_dll/include/draw_util.h index bc30e5d..5de42b6 100644 --- a/cl_dll/include/draw_util.h +++ b/cl_dll/include/draw_util.h @@ -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, diff --git a/cl_dll/include/hud/hud.h b/cl_dll/include/hud/hud.h index f34bb82..35f9f33 100644 --- a/cl_dll/include/hud/hud.h +++ b/cl_dll/include/hud/hud.h @@ -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 ); diff --git a/cl_dll/include/unicode_strtools.h b/cl_dll/include/unicode_strtools.h index cf7f96d..c0e81a2 100644 --- a/cl_dll/include/unicode_strtools.h +++ b/cl_dll/include/unicode_strtools.h @@ -38,7 +38,7 @@ typedef unsigned int uchar32; #else typedef unsigned short uchar16; -typedef wchar_t uchar32; +typedef unsigned int uchar32; #endif // _WIN32 diff --git a/cl_dll/parsemsg.cpp b/cl_dll/parsemsg.cpp index 8b5f4cc..9331a5d 100644 --- a/cl_dll/parsemsg.cpp +++ b/cl_dll/parsemsg.cpp @@ -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; diff --git a/cl_dll/studio/StudioModelRenderer.cpp b/cl_dll/studio/StudioModelRenderer.cpp index caed02f..7fbf38f 100644 --- a/cl_dll/studio/StudioModelRenderer.cpp +++ b/cl_dll/studio/StudioModelRenderer.cpp @@ -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; diff --git a/cl_dll/unicode_strtools.cpp b/cl_dll/unicode_strtools.cpp index b54e915..5e7df04 100644 --- a/cl_dll/unicode_strtools.cpp +++ b/cl_dll/unicode_strtools.cpp @@ -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; } } diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index f4f4506..b071402 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -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(); diff --git a/dlls/cbase.h b/dlls/cbase.h index 45c6f2e..d09a5eb 100644 --- a/dlls/cbase.h +++ b/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 (a), #a) +#define SetThink(a) ThinkSet(static_cast (a), (char*)#a) #define SetTouch(a) TouchSet(static_cast (a), #a) #define SetUse(a) UseSet(static_cast (a), #a) #define SetBlocked(a) BlockedSet(static_cast (a), #a) diff --git a/dlls/extdll.h b/dlls/extdll.h index 0c765c4..b4792e9 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -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 diff --git a/dlls/player.h b/dlls/player.h index da2b442..a0fdef9 100644 --- a/dlls/player.h +++ b/dlls/player.h @@ -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); diff --git a/dlls/util.h b/dlls/util.h index 59cfbfe..987df62 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -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); diff --git a/dlls/weapons.h b/dlls/weapons.h index 63ac7a8..1bf969a 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -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); diff --git a/engine/cdll_int.h b/engine/cdll_int.h index 3e833f0..1e64732 100644 --- a/engine/cdll_int.h +++ b/engine/cdll_int.h @@ -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 ); diff --git a/engine/eiface.h b/engine/eiface.h index a0bdff0..dae28a2 100644 --- a/engine/eiface.h +++ b/engine/eiface.h @@ -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); diff --git a/pm_shared/pm_debug.c b/pm_shared/pm_debug.c index 9da3eee..135ff5f 100644 --- a/pm_shared/pm_debug.c +++ b/pm_shared/pm_debug.c @@ -23,8 +23,10 @@ #include +#ifdef MSC_VER #pragma warning(disable : 4244) #pragma warning(disable : 4305) +#endif extern playermove_t *pmove; diff --git a/pm_shared/pm_math.c b/pm_shared/pm_math.c index 8edaa3a..0863551 100644 --- a/pm_shared/pm_math.c +++ b/pm_shared/pm_math.c @@ -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; diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index 3fb44bc..cb9ee87 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -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; diff --git a/public/tier1/UtlMemory.h b/public/tier1/UtlMemory.h index 123ce2a..1b5671d 100644 --- a/public/tier1/UtlMemory.h +++ b/public/tier1/UtlMemory.h @@ -10,22 +10,20 @@ // // A growable memory class. //============================================================================= - +#pragma once #ifndef UTLMEMORY_H #define UTLMEMORY_H -#ifdef _WIN32 -#pragma once -#endif - #include #include #include #include #include +#ifdef MSC_VER #pragma warning (disable:4100) #pragma warning (disable:4514) +#endif //----------------------------------------------------------------------------- // Methods to invoke the constructor, copy constructor, and destructor