Merge branch 'double_promotion'

pull/110/head
Andrey Akhmichin 3 years ago
commit 4a02cfc012
  1. 5
      cl_dll/CMakeLists.txt
  2. 2
      cl_dll/GameStudioModelRenderer.cpp
  3. 2
      cl_dll/GameStudioModelRenderer_Sample.cpp
  4. 4
      cl_dll/MOTD.cpp
  5. 172
      cl_dll/StudioModelRenderer.cpp
  6. 2
      cl_dll/ammo.cpp
  7. 2
      cl_dll/ammo_secondary.cpp
  8. 4
      cl_dll/battery.cpp
  9. 4
      cl_dll/com_weapons.cpp
  10. 54
      cl_dll/entity.cpp
  11. 94
      cl_dll/ev_hldm.cpp
  12. 10
      cl_dll/flashlight.cpp
  13. 22
      cl_dll/geiger.cpp
  14. 38
      cl_dll/health.cpp
  15. 8
      cl_dll/hl/hl_objects.cpp
  16. 90
      cl_dll/hl/hl_weapons.cpp
  17. 7
      cl_dll/hud_redraw.cpp
  18. 70
      cl_dll/hud_spectator.cpp
  19. 2
      cl_dll/hud_update.cpp
  20. 56
      cl_dll/in_camera.cpp
  21. 2
      cl_dll/input.cpp
  22. 16
      cl_dll/input_xash3d.cpp
  23. 48
      cl_dll/message.cpp
  24. 6
      cl_dll/scoreboard.cpp
  25. 54
      cl_dll/studio_util.cpp
  26. 4
      cl_dll/studio_util.h
  27. 40
      cl_dll/util.cpp
  28. 6
      cl_dll/util_vector.h
  29. 172
      cl_dll/view.cpp
  30. 11
      common/mathlib.h
  31. 6
      dlls/CMakeLists.txt
  32. 80
      dlls/aflock.cpp
  33. 170
      dlls/agrunt.cpp
  34. 28
      dlls/animating.cpp
  35. 50
      dlls/animation.cpp
  36. 288
      dlls/apache.cpp
  37. 46
      dlls/barnacle.cpp
  38. 46
      dlls/barney.cpp
  39. 107
      dlls/bigmomma.cpp
  40. 94
      dlls/bmodels.cpp
  41. 170
      dlls/bullsquid.cpp
  42. 82
      dlls/buttons.cpp
  43. 38
      dlls/cbase.cpp
  44. 20
      dlls/client.cpp
  45. 226
      dlls/combat.cpp
  46. 159
      dlls/controller.cpp
  47. 56
      dlls/crossbow.cpp
  48. 58
      dlls/crowbar.cpp
  49. 96
      dlls/doors.cpp
  50. 94
      dlls/effects.cpp
  51. 56
      dlls/egon.cpp
  52. 50
      dlls/explode.cpp
  53. 12
      dlls/extdll.h
  54. 46
      dlls/flyingmonster.cpp
  55. 52
      dlls/func_break.cpp
  56. 38
      dlls/func_tank.cpp
  57. 80
      dlls/gargantua.cpp
  58. 108
      dlls/gauss.cpp
  59. 56
      dlls/ggrenade.cpp
  60. 20
      dlls/glock.cpp
  61. 24
      dlls/h_ai.cpp
  62. 8
      dlls/h_battery.cpp
  63. 20
      dlls/h_cine.cpp
  64. 44
      dlls/h_cycler.cpp
  65. 64
      dlls/handgrenade.cpp
  66. 26
      dlls/hassassin.cpp
  67. 28
      dlls/headcrab.cpp
  68. 8
      dlls/healthkit.cpp
  69. 28
      dlls/hgrunt.cpp
  70. 46
      dlls/hornet.cpp
  71. 66
      dlls/hornetgun.cpp
  72. 46
      dlls/houndeye.cpp
  73. 88
      dlls/ichthyosaur.cpp
  74. 4
      dlls/islave.cpp
  75. 4
      dlls/items.cpp
  76. 104
      dlls/leech.cpp
  77. 12
      dlls/lights.cpp
  78. 82
      dlls/monsters.cpp
  79. 26
      dlls/mp5.cpp
  80. 94
      dlls/nihilanth.cpp
  81. 30
      dlls/nodes.cpp
  82. 6
      dlls/observer.cpp
  83. 82
      dlls/osprey.cpp
  84. 62
      dlls/plats.cpp
  85. 108
      dlls/player.cpp
  86. 36
      dlls/python.cpp
  87. 4
      dlls/roach.cpp
  88. 66
      dlls/rpg.cpp
  89. 40
      dlls/satchel.cpp
  90. 4
      dlls/schedule.cpp
  91. 76
      dlls/scientist.cpp
  92. 34
      dlls/scripted.cpp
  93. 48
      dlls/shotgun.cpp
  94. 132
      dlls/sound.cpp
  95. 4
      dlls/soundent.cpp
  96. 13
      dlls/squadmonster.cpp
  97. 112
      dlls/squeakgrenade.cpp
  98. 6
      dlls/subs.cpp
  99. 134
      dlls/talkmonster.cpp
  100. 2
      dlls/talkmonster.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -25,6 +25,11 @@ project (CLDLL)
set (CLDLL_LIBRARY client)
include(CheckIncludeFile)
check_include_file("tgmath.h" HAVE_TGMATH_H)
if(HAVE_TGMATH_H)
add_definitions(-DHAVE_TGMATH_H)
endif()
add_definitions(-DCLIENT_WEAPONS -DCLIENT_DLL)

@ -19,7 +19,7 @@
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <cmath>
#include "studio_util.h"
#include "r_studioint.h"

@ -19,7 +19,7 @@
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <cmath>
#include "studio_util.h"
#include "r_studioint.h"

@ -80,9 +80,9 @@ int CHudMOTD::Draw( float fTime )
{
ypos = ROW_RANGE_MIN + 7 + scroll;
if( ypos > ROW_RANGE_MIN + 4 )
scroll-= ( ypos - ( ROW_RANGE_MIN + 4 ) ) / 3.0;
scroll-= ( ypos - ( ROW_RANGE_MIN + 4 ) ) / 3.0f;
if( ypos + height < ROW_RANGE_MAX )
scroll+= ( ROW_RANGE_MAX - ( ypos + height ) ) / 3.0;
scroll+= ( ROW_RANGE_MAX - ( ypos + height ) ) / 3.0f;
ypos_r = ROW_RANGE_MIN;
height = ROW_RANGE_MAX;
}

@ -21,7 +21,7 @@
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <cmath>
#include "studio_util.h"
#include "r_studioint.h"
@ -138,27 +138,27 @@ void CStudioModelRenderer::StudioCalcBoneAdj( float dadt, float *adj, const byte
int a, b;
a = ( pcontroller1[j] + 128 ) % 256;
b = ( pcontroller2[j] + 128 ) % 256;
value = ( ( a * dadt ) + ( b * ( 1 - dadt ) ) - 128 ) * ( 360.0 / 256.0 ) + pbonecontroller[j].start;
value = ( ( a * dadt ) + ( b * ( 1.0f - dadt ) ) - 128.0f ) * ( 360.0f / 256.0f ) + pbonecontroller[j].start;
}
else
{
value = ( ( pcontroller1[i] * dadt + ( pcontroller2[i] ) * ( 1.0 - dadt ) ) ) * ( 360.0 / 256.0 ) + pbonecontroller[j].start;
value = ( ( pcontroller1[i] * dadt + ( pcontroller2[i] ) * ( 1.0f - dadt ) ) ) * ( 360.0f / 256.0f ) + pbonecontroller[j].start;
}
}
else
{
value = ( pcontroller1[i] * dadt + pcontroller2[i] * ( 1.0 - dadt ) ) / 255.0;
if( value < 0 ) value = 0;
if( value > 1.0 ) value = 1.0;
value = ( 1.0 - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end;
value = ( pcontroller1[i] * dadt + pcontroller2[i] * ( 1.0f - dadt ) ) / 255.0f;
if( value < 0.0f ) value = 0.0f;
if( value > 1.0f ) value = 1.0f;
value = ( 1.0f - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end;
}
// Con_DPrintf( "%d %d %f : %f\n", m_pCurrentEntity->curstate.controller[j], m_pCurrentEntity->latched.prevcontroller[j], value, dadt );
}
else
{
value = mouthopen / 64.0;
if( value > 1.0 ) value = 1.0;
value = ( 1.0 - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end;
value = mouthopen / 64.0f;
if( value > 1.0f ) value = 1.0f;
value = ( 1.0f - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end;
// Con_DPrintf( "%d %f\n", mouthopen, value );
}
switch( pbonecontroller[j].type & STUDIO_TYPES )
@ -166,7 +166,7 @@ void CStudioModelRenderer::StudioCalcBoneAdj( float dadt, float *adj, const byte
case STUDIO_XR:
case STUDIO_YR:
case STUDIO_ZR:
adj[j] = value * ( M_PI / 180.0 );
adj[j] = value * ( M_PI_F / 180.0f );
break;
case STUDIO_X:
case STUDIO_Y:
@ -305,7 +305,7 @@ void CStudioModelRenderer::StudioCalcBonePosition( int frame, float s, mstudiobo
// and there's more data in the span
if( panimvalue->num.valid > k + 1 )
{
pos[j] += ( panimvalue[k + 1].value * ( 1.0 - s ) + s * panimvalue[k + 2].value ) * pbone->scale[j];
pos[j] += ( panimvalue[k + 1].value * ( 1.0f - s ) + s * panimvalue[k + 2].value ) * pbone->scale[j];
}
else
{
@ -317,7 +317,7 @@ void CStudioModelRenderer::StudioCalcBonePosition( int frame, float s, mstudiobo
// are we at the end of the repeating values section and there's another section with data?
if( panimvalue->num.total <= k + 1 )
{
pos[j] += ( panimvalue[panimvalue->num.valid].value * ( 1.0 - s ) + s * panimvalue[panimvalue->num.valid + 2].value ) * pbone->scale[j];
pos[j] += ( panimvalue[panimvalue->num.valid].value * ( 1.0f - s ) + s * panimvalue[panimvalue->num.valid + 2].value ) * pbone->scale[j];
}
else
{
@ -344,12 +344,12 @@ void CStudioModelRenderer::StudioSlerpBones( vec4_t q1[], float pos1[][3], vec4_
vec4_t q3;
float s1;
if( s < 0 )
s = 0;
else if( s > 1.0 )
s = 1.0;
if( s < 0.0f )
s = 0.0f;
else if( s > 1.0f )
s = 1.0f;
s1 = 1.0 - s;
s1 = 1.0f - s;
for( i = 0; i < m_pStudioHeader->numbones; i++ )
{
@ -410,17 +410,17 @@ void CStudioModelRenderer::StudioPlayerBlend( mstudioseqdesc_t *pseqdesc, int *p
*pBlend = ( *pPitch * 3 );
if( *pBlend < pseqdesc->blendstart[0] )
{
*pPitch -= pseqdesc->blendstart[0] / 3.0;
*pPitch -= pseqdesc->blendstart[0] / 3.0f;
*pBlend = 0;
}
else if( *pBlend > pseqdesc->blendend[0] )
{
*pPitch -= pseqdesc->blendend[0] / 3.0;
*pPitch -= pseqdesc->blendend[0] / 3.0f;
*pBlend = 255;
}
else
{
if( pseqdesc->blendend[0] - pseqdesc->blendstart[0] < 0.1 ) // catch qc error
if( pseqdesc->blendend[0] - pseqdesc->blendstart[0] < 0.1f ) // catch qc error
*pBlend = 127;
else
*pBlend = 255 * ( *pBlend - pseqdesc->blendstart[0] ) / ( pseqdesc->blendend[0] - pseqdesc->blendstart[0] );
@ -475,11 +475,11 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept )
if( m_fDoInterp )
{
// ugly hack to interpolate angle, position. current is reached 0.1 seconds after being set
f = f - 1.0;
f = f - 1.0f;
}
else
{
f = 0;
f = 0.0f;
}
for( i = 0; i < 3; i++ )
@ -489,7 +489,7 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept )
// NOTE: Because multiplayer lag can be relatively large, we don't want to cap
// f at 1.5 anymore.
//if( f > -1.0 && f < 1.5 ) {}
//if( f > -1.0f && f < 1.5f ) {}
//Con_DPrintf( "%.0f %.0f\n",m_pCurrentEntity->msg_angles[0][YAW], m_pCurrentEntity->msg_angles[1][YAW] );
for( i = 0; i < 3; i++ )
{
@ -499,13 +499,13 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept )
ang2 = m_pCurrentEntity->latched.prevangles[i];
d = ang1 - ang2;
if( d > 180 )
if( d > 180.0f )
{
d -= 360;
d -= 360.0f;
}
else if( d < -180 )
else if( d < -180.0f )
{
d += 360;
d += 360.0f;
}
angles[i] += d * f;
@ -547,9 +547,9 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept )
{
for( i = 0; i < 4; i++ )
{
(*m_paliastransform)[0][i] *= m_fSoftwareXScale * ( 1.0 / ( ZISCALE * 0x10000 ) );
(*m_paliastransform)[1][i] *= m_fSoftwareYScale * ( 1.0 / ( ZISCALE * 0x10000 ) );
(*m_paliastransform)[2][i] *= 1.0 / ( ZISCALE * 0x10000 );
(*m_paliastransform)[0][i] *= m_fSoftwareXScale * ( 1.0f / ( ZISCALE * 0x10000 ) );
(*m_paliastransform)[1][i] *= m_fSoftwareYScale * ( 1.0f / ( ZISCALE * 0x10000 ) );
(*m_paliastransform)[2][i] *= 1.0f / ( ZISCALE * 0x10000 );
}
}
}
@ -567,14 +567,14 @@ StudioEstimateInterpolant
*/
float CStudioModelRenderer::StudioEstimateInterpolant( void )
{
float dadt = 1.0;
float dadt = 1.0f;
if( m_fDoInterp && ( m_pCurrentEntity->curstate.animtime >= m_pCurrentEntity->latched.prevanimtime + 0.01 ) )
if( m_fDoInterp && ( m_pCurrentEntity->curstate.animtime >= m_pCurrentEntity->latched.prevanimtime + 0.01f ) )
{
dadt = ( m_clTime - m_pCurrentEntity->curstate.animtime ) / 0.1;
if( dadt > 2.0 )
dadt = ( m_clTime - m_pCurrentEntity->curstate.animtime ) / 0.1f;
if( dadt > 2.0f )
{
dadt = 2.0;
dadt = 2.0f;
}
}
return dadt;
@ -598,14 +598,14 @@ void CStudioModelRenderer::StudioCalcRotations( float pos[][3], vec4_t *q, mstud
if( f > pseqdesc->numframes - 1 )
{
f = 0; // bah, fix this bug with changing sequences too fast
f = 0.0f; // bah, fix this bug with changing sequences too fast
}
// BUG ( somewhere else ) but this code should validate this data.
// This could cause a crash if the frame # is negative, so we'll go ahead
// and clamp it here
else if( f < -0.01 )
else if( f < -0.01f )
{
f = -0.01;
f = -0.01f;
}
frame = (int)f;
@ -635,18 +635,18 @@ void CStudioModelRenderer::StudioCalcRotations( float pos[][3], vec4_t *q, mstud
if( pseqdesc->motiontype & STUDIO_X )
{
pos[pseqdesc->motionbone][0] = 0.0;
pos[pseqdesc->motionbone][0] = 0.0f;
}
if( pseqdesc->motiontype & STUDIO_Y )
{
pos[pseqdesc->motionbone][1] = 0.0;
pos[pseqdesc->motionbone][1] = 0.0f;
}
if( pseqdesc->motiontype & STUDIO_Z )
{
pos[pseqdesc->motionbone][2] = 0.0;
pos[pseqdesc->motionbone][2] = 0.0f;
}
s = 0 * ( ( 1.0 - ( f - (int)( f ) ) ) / ( pseqdesc->numframes ) ) * m_pCurrentEntity->curstate.framerate;
s = 0 * ( ( 1.0f - ( f - (int)( f ) ) ) / ( pseqdesc->numframes ) ) * m_pCurrentEntity->curstate.framerate;
if( pseqdesc->motiontype & STUDIO_LX )
{
@ -679,7 +679,7 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[
int axis = gEngfuncs.pfnRandomLong( 0, 1 );
if( axis == 1 ) // Choose between x & z
axis = 2;
VectorScale( transform[axis], gEngfuncs.pfnRandomFloat( 1, 1.484 ), transform[axis] );
VectorScale( transform[axis], gEngfuncs.pfnRandomFloat( 1.0f, 1.484f ), transform[axis] );
}
else if( gEngfuncs.pfnRandomLong( 0, 49 ) == 0 )
{
@ -687,7 +687,7 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[
int axis = gEngfuncs.pfnRandomLong(0,1);
if( axis == 1 ) // Choose between x & z
axis = 2;
offset = gEngfuncs.pfnRandomFloat( -10, 10 );
offset = gEngfuncs.pfnRandomFloat( -10.0f, 10.0f );
transform[gEngfuncs.pfnRandomLong( 0, 2 )][3] += offset;
}
break;
@ -695,7 +695,7 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[
{
float scale;
scale = 1.0 + ( m_clTime - ent->curstate.animtime ) * 10.0;
scale = 1.0f + ( m_clTime - ent->curstate.animtime ) * 10.0f;
if( scale > 2 ) // Don't blow up more than 200%
scale = 2;
transform[0][1] *= scale;
@ -734,7 +734,7 @@ float CStudioModelRenderer::StudioEstimateFrame( mstudioseqdesc_t *pseqdesc )
if( pseqdesc->numframes <= 1 )
{
f = 0;
f = 0.0;
}
else
{
@ -1188,10 +1188,10 @@ void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer )
vec3_t est_velocity;
dt = ( m_clTime - m_clOldTime );
if( dt < 0 )
dt = 0;
else if( dt > 1.0 )
dt = 1;
if( dt < 0.0f )
dt = 0.0f;
else if( dt > 1.0f )
dt = 1.0f;
if( dt == 0 || m_pPlayerInfo->renderframe == m_nFrameCount )
{
@ -1221,29 +1221,29 @@ void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer )
if( est_velocity[1] == 0 && est_velocity[0] == 0 )
{
float flYawDiff = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw;
flYawDiff = flYawDiff - (int)( flYawDiff / 360 ) * 360;
if( flYawDiff > 180 )
flYawDiff -= 360;
if( flYawDiff < -180 )
flYawDiff += 360;
if( dt < 0.25 )
flYawDiff *= dt * 4;
flYawDiff = flYawDiff - (int)( flYawDiff / 360.0f ) * 360.0f;
if( flYawDiff > 180.0f )
flYawDiff -= 360.0f;
if( flYawDiff < -180.0f )
flYawDiff += 360.0f;
if( dt < 0.25f )
flYawDiff *= dt * 4.0f;
else
flYawDiff *= dt;
m_pPlayerInfo->gaityaw += flYawDiff;
m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - (int)( m_pPlayerInfo->gaityaw / 360 ) * 360;
m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - (int)( m_pPlayerInfo->gaityaw / 360.0f ) * 360.0f;
m_flGaitMovement = 0;
}
else
{
m_pPlayerInfo->gaityaw = ( atan2( est_velocity[1], est_velocity[0] ) * 180 / M_PI );
if( m_pPlayerInfo->gaityaw > 180 )
m_pPlayerInfo->gaityaw = 180;
if( m_pPlayerInfo->gaityaw < -180 )
m_pPlayerInfo->gaityaw = -180;
m_pPlayerInfo->gaityaw = ( atan2( est_velocity[1], est_velocity[0] ) * 180.0f / M_PI_F );
if( m_pPlayerInfo->gaityaw > 180.0f )
m_pPlayerInfo->gaityaw = 180.0f;
if( m_pPlayerInfo->gaityaw < -180.0f )
m_pPlayerInfo->gaityaw = -180.0f;
}
}
@ -1277,10 +1277,10 @@ void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer )
// Con_DPrintf( "%f %d\n", m_pCurrentEntity->angles[PITCH], m_pCurrentEntity->blending[0] );
dt = ( m_clTime - m_clOldTime );
if( dt < 0 )
dt = 0;
else if( dt > 1.0 )
dt = 1;
if( dt < 0.0f )
dt = 0.0f;
else if( dt > 1.0f )
dt = 1.0f;
StudioEstimateGait( pplayer );
@ -1288,38 +1288,38 @@ void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer )
// calc side to side turning
flYaw = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw;
flYaw = flYaw - (int)( flYaw / 360 ) * 360;
if( flYaw < -180 )
flYaw = flYaw + 360;
if( flYaw > 180 )
flYaw = flYaw - 360;
flYaw = flYaw - (int)( flYaw / 360.0f ) * 360.0f;
if( flYaw < -180.0f )
flYaw = flYaw + 360.0f;
if( flYaw > 180.0f )
flYaw = flYaw - 360.0f;
if( flYaw > 120 )
if( flYaw > 120.0f )
{
m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - 180;
m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - 180.0f;
m_flGaitMovement = -m_flGaitMovement;
flYaw = flYaw - 180;
flYaw = flYaw - 180.0f;
}
else if( flYaw < -120 )
else if( flYaw < -120.0f )
{
m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw + 180;
m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw + 180.0f;
m_flGaitMovement = -m_flGaitMovement;
flYaw = flYaw + 180;
flYaw = flYaw + 180.0f;
}
// adjust torso
m_pCurrentEntity->curstate.controller[0] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 );
m_pCurrentEntity->curstate.controller[1] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 );
m_pCurrentEntity->curstate.controller[2] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 );
m_pCurrentEntity->curstate.controller[3] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 );
m_pCurrentEntity->curstate.controller[0] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f );
m_pCurrentEntity->curstate.controller[1] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f );
m_pCurrentEntity->curstate.controller[2] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f );
m_pCurrentEntity->curstate.controller[3] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f );
m_pCurrentEntity->latched.prevcontroller[0] = m_pCurrentEntity->curstate.controller[0];
m_pCurrentEntity->latched.prevcontroller[1] = m_pCurrentEntity->curstate.controller[1];
m_pCurrentEntity->latched.prevcontroller[2] = m_pCurrentEntity->curstate.controller[2];
m_pCurrentEntity->latched.prevcontroller[3] = m_pCurrentEntity->curstate.controller[3];
m_pCurrentEntity->angles[YAW] = m_pPlayerInfo->gaityaw;
if( m_pCurrentEntity->angles[YAW] < -0 )
m_pCurrentEntity->angles[YAW] += 360;
if( m_pCurrentEntity->angles[YAW] < -0.0f )
m_pCurrentEntity->angles[YAW] += 360.0f;
m_pCurrentEntity->latched.prevangles[YAW] = m_pCurrentEntity->angles[YAW];
if( pplayer->gaitsequence >= m_pStudioHeader->numseq )

@ -864,7 +864,7 @@ int CHudAmmo::Draw( float flTime )
a = (int)Q_max( MIN_ALPHA, m_fFade );
if( m_fFade > 0 )
m_fFade -= ( gHUD.m_flTimeDelta * 20 );
m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f );
UnpackRGB( r, g, b, RGB_YELLOWISH );

@ -63,7 +63,7 @@ int CHudAmmoSecondary::Draw( float flTime )
UnpackRGB( r, g, b, RGB_YELLOWISH );
a = (int)Q_max( MIN_ALPHA, m_fFade );
if( m_fFade > 0 )
m_fFade -= ( gHUD.m_flTimeDelta * 20 ); // slowly lower alpha to fade out icons
m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); // slowly lower alpha to fade out icons
ScaleColors( r, g, b, a );
AmmoWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left;

@ -78,7 +78,7 @@ int CHudBattery::Draw( float flTime )
wrect_t rc;
rc = *m_prc2;
rc.top += m_iHeight * ( (float)( 100 - ( Q_min( 100, m_iBat ) ) ) * 0.01 ); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1
rc.top += m_iHeight * ( (float)( 100 - ( Q_min( 100, m_iBat ) ) ) * 0.01f ); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1
UnpackRGB( r, g, b, RGB_YELLOWISH );
@ -91,7 +91,7 @@ int CHudBattery::Draw( float flTime )
if( m_fFade > FADE_TIME )
m_fFade = FADE_TIME;
m_fFade -= ( gHUD.m_flTimeDelta * 20 );
m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f );
if( m_fFade <= 0 )
{
a = 128;

@ -161,7 +161,7 @@ Always 0.0 on client, even if not predicting weapons ( won't get called
*/
float UTIL_WeaponTimeBase( void )
{
return 0.0;
return 0.0f;
}
static unsigned int glSeed = 0;
@ -254,7 +254,7 @@ float UTIL_SharedRandomFloat( unsigned int seed, float low, float high )
tensixrand = U_Random() & 65535;
offset = (float)tensixrand / 65536.0;
offset = (float)tensixrand / 65536.0f;
return ( low + offset * range );
}

@ -319,12 +319,12 @@ void Particles( void )
curtime = gEngfuncs.GetClientTime();
if( ( curtime - lasttime ) < 2.0 )
if( ( curtime - lasttime ) < 2.0f )
return;
if( !color )
{
color = gEngfuncs.pfnRegisterVariable ( "color","255 0 0", 0 );
color = gEngfuncs.pfnRegisterVariable( "color", "255 0 0", 0 );
}
lasttime = curtime;
@ -342,8 +342,8 @@ void Particles( void )
for( j = 0; j < 3; j++ )
{
p->org[j] = v_origin[j] + gEngfuncs.pfnRandomFloat( -32.0, 32.0 );
p->vel[j] = gEngfuncs.pfnRandomFloat( -100.0, 100.0 );
p->org[j] = v_origin[j] + gEngfuncs.pfnRandomFloat( -32.0f, 32.0f );
p->vel[j] = gEngfuncs.pfnRandomFloat( -100.0f, 100.0f );
}
if( color )
@ -361,7 +361,7 @@ void Particles( void )
gEngfuncs.pEfxAPI->R_GetPackedColor( &p->packedColor, p->color );
// p->die is set to current time so all you have to do is add an additional time to it
p->die += 3.0;
p->die += 3.0f;
}
}
*/
@ -384,7 +384,7 @@ void TempEnts( void )
curtime = gEngfuncs.GetClientTime();
if( ( curtime - lasttime ) < 10.0 )
if( ( curtime - lasttime ) < 10.0f )
return;
lasttime = curtime;
@ -417,11 +417,11 @@ void TempEnts( void )
p->entity.curstate.origin[j] = origin[j];
// Store velocity in baseline origin
p->entity.baseline.origin[j] = gEngfuncs.pfnRandomFloat( -100, 100 );
p->entity.baseline.origin[j] = gEngfuncs.pfnRandomFloat( -100.0f, 100.0f );
}
// p->die is set to current time so all you have to do is add an additional time to it
p->die += 10.0;
p->die += 10.0f;
}
}
*/
@ -626,7 +626,7 @@ void DLLEXPORT HUD_TempEntUpdate (
//freq = client_time * 0.01;
fastFreq = client_time * 5.5;
gravity = -frametime * cl_gravity;
gravitySlow = gravity * 0.5;
gravitySlow = gravity * 0.5f;
while( pTemp )
{
@ -634,7 +634,7 @@ void DLLEXPORT HUD_TempEntUpdate (
active = 1;
life = pTemp->die - client_time;
life = pTemp->die - (float)client_time;
pnext = pTemp->next;
if( life < 0 )
{
@ -674,9 +674,9 @@ void DLLEXPORT HUD_TempEntUpdate (
gEngfuncs.pEfxAPI->R_SparkEffect( pTemp->entity.origin, 8, -200, 200 );
// Reduce life
pTemp->entity.baseline.framerate -= 0.1;
pTemp->entity.baseline.framerate -= 0.1f;
if( pTemp->entity.baseline.framerate <= 0.0 )
if( pTemp->entity.baseline.framerate <= 0.0f )
{
pTemp->die = client_time;
}
@ -700,11 +700,11 @@ void DLLEXPORT HUD_TempEntUpdate (
}
else if( pTemp->flags & FTENT_SINEWAVE )
{
pTemp->x += pTemp->entity.baseline.origin[0] * frametime;
pTemp->y += pTemp->entity.baseline.origin[1] * frametime;
pTemp->x += pTemp->entity.baseline.origin[0] * (float)frametime;
pTemp->y += pTemp->entity.baseline.origin[1] * (float)frametime;
pTemp->entity.origin[0] = pTemp->x + sin( pTemp->entity.baseline.origin[2] + client_time * pTemp->entity.prevstate.frame ) * ( 10 * pTemp->entity.curstate.framerate );
pTemp->entity.origin[1] = pTemp->y + sin( pTemp->entity.baseline.origin[2] + fastFreq + 0.7 ) * ( 8 * pTemp->entity.curstate.framerate );
pTemp->entity.origin[1] = pTemp->y + sin( pTemp->entity.baseline.origin[2] + fastFreq + 0.7f ) * ( 8 * pTemp->entity.curstate.framerate );
pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime;
}
else if( pTemp->flags & FTENT_SPIRAL )
@ -713,19 +713,19 @@ void DLLEXPORT HUD_TempEntUpdate (
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 + (size_t)pTemp );
pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * frametime + 4 * sin( client_time * 30 + (size_t)pTemp );
pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime;
pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * (float)frametime + 8 * sin( client_time * 20 + (size_t)pTemp );
pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * (float)frametime + 4 * sin( client_time * 30 + (size_t)pTemp );
pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * (float)frametime;
}
else
{
for( i = 0; i < 3; i++ )
pTemp->entity.origin[i] += pTemp->entity.baseline.origin[i] * frametime;
pTemp->entity.origin[i] += pTemp->entity.baseline.origin[i] * (float)frametime;
}
if( pTemp->flags & FTENT_SPRANIMATE )
{
pTemp->entity.curstate.frame += frametime * pTemp->entity.curstate.framerate;
pTemp->entity.curstate.frame += (float)frametime * pTemp->entity.curstate.framerate;
if( pTemp->entity.curstate.frame >= pTemp->frameMax )
{
pTemp->entity.curstate.frame = pTemp->entity.curstate.frame - (int)( pTemp->entity.curstate.frame );
@ -755,9 +755,9 @@ void DLLEXPORT HUD_TempEntUpdate (
if( pTemp->flags & FTENT_ROTATE )
{
pTemp->entity.angles[0] += pTemp->entity.baseline.angles[0] * frametime;
pTemp->entity.angles[1] += pTemp->entity.baseline.angles[1] * frametime;
pTemp->entity.angles[2] += pTemp->entity.baseline.angles[2] * frametime;
pTemp->entity.angles[0] += pTemp->entity.baseline.angles[0] * (float)frametime;
pTemp->entity.angles[1] += pTemp->entity.baseline.angles[1] * (float)frametime;
pTemp->entity.angles[2] += pTemp->entity.baseline.angles[2] * (float)frametime;
VectorCopy( pTemp->entity.angles, pTemp->entity.latched.prevangles );
}
@ -809,7 +809,7 @@ void DLLEXPORT HUD_TempEntUpdate (
{
// Chop spark speeds a bit more
//
VectorScale( pTemp->entity.baseline.origin, 0.6, pTemp->entity.baseline.origin );
VectorScale( pTemp->entity.baseline.origin, 0.6f, pTemp->entity.baseline.origin );
if( Length( pTemp->entity.baseline.origin ) < 10 )
{
@ -829,13 +829,13 @@ void DLLEXPORT HUD_TempEntUpdate (
float proj, damp;
// Place at contact point
VectorMA( pTemp->entity.prevstate.origin, traceFraction * frametime, pTemp->entity.baseline.origin, pTemp->entity.origin );
VectorMA( pTemp->entity.prevstate.origin, traceFraction * (float)frametime, pTemp->entity.baseline.origin, pTemp->entity.origin );
// Damp velocity
damp = pTemp->bounceFactor;
if( pTemp->flags & ( FTENT_GRAVITY | FTENT_SLOWGRAVITY ) )
{
damp *= 0.5;
if( traceNormal[2] > 0.9 ) // Hit floor?
damp *= 0.5f;
if( traceNormal[2] > 0.9f ) // Hit floor?
{
if( pTemp->entity.baseline.origin[2] <= 0 && pTemp->entity.baseline.origin[2] >= gravity*3 )
{

@ -72,18 +72,18 @@ void EV_SnarkFire( struct event_args_s *args );
void EV_TrainPitchAdjust( struct event_args_s *args );
}
#define VECTOR_CONE_1DEGREES Vector( 0.00873, 0.00873, 0.00873 )
#define VECTOR_CONE_2DEGREES Vector( 0.01745, 0.01745, 0.01745 )
#define VECTOR_CONE_3DEGREES Vector( 0.02618, 0.02618, 0.02618 )
#define VECTOR_CONE_4DEGREES Vector( 0.03490, 0.03490, 0.03490 )
#define VECTOR_CONE_5DEGREES Vector( 0.04362, 0.04362, 0.04362 )
#define VECTOR_CONE_6DEGREES Vector( 0.05234, 0.05234, 0.05234 )
#define VECTOR_CONE_7DEGREES Vector( 0.06105, 0.06105, 0.06105 )
#define VECTOR_CONE_8DEGREES Vector( 0.06976, 0.06976, 0.06976 )
#define VECTOR_CONE_9DEGREES Vector( 0.07846, 0.07846, 0.07846 )
#define VECTOR_CONE_10DEGREES Vector( 0.08716, 0.08716, 0.08716 )
#define VECTOR_CONE_15DEGREES Vector( 0.13053, 0.13053, 0.13053 )
#define VECTOR_CONE_20DEGREES Vector( 0.17365, 0.17365, 0.17365 )
#define VECTOR_CONE_1DEGREES Vector( 0.00873f, 0.00873f, 0.00873f )
#define VECTOR_CONE_2DEGREES Vector( 0.01745f, 0.01745f, 0.01745f )
#define VECTOR_CONE_3DEGREES Vector( 0.02618f, 0.02618f, 0.02618f )
#define VECTOR_CONE_4DEGREES Vector( 0.03490f, 0.03490f, 0.03490f )
#define VECTOR_CONE_5DEGREES Vector( 0.04362f, 0.04362f, 0.04362f )
#define VECTOR_CONE_6DEGREES Vector( 0.05234f, 0.05234f, 0.05234f )
#define VECTOR_CONE_7DEGREES Vector( 0.06105f, 0.06105f, 0.06105f )
#define VECTOR_CONE_8DEGREES Vector( 0.06976f, 0.06976f, 0.06976f )
#define VECTOR_CONE_9DEGREES Vector( 0.07846f, 0.07846f, 0.07846f )
#define VECTOR_CONE_10DEGREES Vector( 0.08716f, 0.08716f, 0.08716f )
#define VECTOR_CONE_15DEGREES Vector( 0.13053f, 0.13053f, 0.13053f )
#define VECTOR_CONE_20DEGREES Vector( 0.17365f, 0.17365f, 0.17365f )
// play a strike sound based on the texture that was hit by the attack traceline. VecSrc/VecEnd are the
// original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture.
@ -425,7 +425,7 @@ void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int
tracer = EV_HLDM_CheckTracer( idx, vecSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount );
// do damage, paint decals
if( tr.fraction != 1.0 )
if( tr.fraction != 1.0f )
{
switch( iBulletType )
{
@ -901,14 +901,14 @@ void EV_FireGauss( event_args_t *args )
if( EV_IsLocal( idx ) )
{
V_PunchAxis( 0, -2.0 );
V_PunchAxis( 0.0f, -2.0f );
gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 2 );
if( m_fPrimaryFire == false )
g_flApplyVel = flDamage;
}
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/gauss2.wav", 0.5 + flDamage * ( 1.0 / 400.0 ), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) );
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/gauss2.wav", 0.5f + flDamage * ( 1.0f / 400.0f ), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) );
while( flDamage > 10 && nMaxHits > 0 )
{
@ -943,10 +943,10 @@ void EV_FireGauss( event_args_t *args )
idx | 0x1000,
tr.endpos,
m_iBeam,
0.1,
m_fPrimaryFire ? 1.0 : 2.5,
0.0,
m_fPrimaryFire ? 128.0 : flDamage,
0.1f,
m_fPrimaryFire ? 1.0f : 2.5f,
0.0f,
m_fPrimaryFire ? 128.0f : flDamage,
0,
0,
0,
@ -960,10 +960,10 @@ void EV_FireGauss( event_args_t *args )
gEngfuncs.pEfxAPI->R_BeamPoints( vecSrc,
tr.endpos,
m_iBeam,
0.1,
m_fPrimaryFire ? 1.0 : 2.5,
0.0,
m_fPrimaryFire ? 128.0 : flDamage,
0.1f,
m_fPrimaryFire ? 1.0f : 2.5f,
0.0f,
m_fPrimaryFire ? 128.0f : flDamage,
0,
0,
0,
@ -985,13 +985,13 @@ void EV_FireGauss( event_args_t *args )
n = -DotProduct( tr.plane.normal, forward );
if( n < 0.5 ) // 60 degrees
if( n < 0.5f ) // 60 degrees
{
// ALERT( at_console, "reflect %f\n", n );
// reflect
vec3_t r;
VectorMA( forward, 2.0 * n, tr.plane.normal, r );
VectorMA( forward, 2.0f * n, tr.plane.normal, r );
flMaxFrac = flMaxFrac - tr.fraction;
@ -1000,18 +1000,18 @@ void EV_FireGauss( event_args_t *args )
VectorMA( tr.endpos, 8.0, forward, vecSrc );
VectorMA( vecSrc, 8192.0, forward, vecDest );
gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage * n / 255.0, flDamage * n * 0.5 * 0.1, FTENT_FADEOUT );
gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage * n / 255.0f, flDamage * n * 0.5f * 0.1f, FTENT_FADEOUT );
vec3_t fwd;
VectorAdd( tr.endpos, tr.plane.normal, fwd );
gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100,
gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100,
255, 100 );
// lose energy
if( n == 0 )
if( n == 0.0f )
{
n = 0.1;
n = 0.1f;
}
flDamage = flDamage * ( 1 - n );
@ -1021,7 +1021,7 @@ void EV_FireGauss( event_args_t *args )
// tunnel
EV_HLDM_DecalGunshot( &tr, BULLET_MONSTER_12MM );
gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 1.0, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0, 6.0, FTENT_FADEOUT );
gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 1.0, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0f, 6.0f, FTENT_FADEOUT );
// limit it to one hole punch
if( fHasPunched )
@ -1067,7 +1067,7 @@ void EV_FireGauss( event_args_t *args )
{
vec3_t fwd;
VectorSubtract( tr.endpos, forward, fwd );
gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100,
gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100,
255, 100 );
}
@ -1076,13 +1076,13 @@ void EV_FireGauss( event_args_t *args )
EV_HLDM_DecalGunshot( &beam_tr, BULLET_MONSTER_12MM );
gEngfuncs.pEfxAPI->R_TempSprite( beam_tr.endpos, vec3_origin, 0.1, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0, 6.0, FTENT_FADEOUT );
gEngfuncs.pEfxAPI->R_TempSprite( beam_tr.endpos, vec3_origin, 0.1, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0f, 6.0f, FTENT_FADEOUT );
// balls
{
vec3_t fwd;
VectorSubtract( beam_tr.endpos, forward, fwd );
gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, beam_tr.endpos, fwd, m_iBalls, (int)( flDamage * 0.3 ), 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 200,
gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, beam_tr.endpos, fwd, m_iBalls, (int)( flDamage * 0.3f ), 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 200,
255, 40 );
}
@ -1102,11 +1102,11 @@ void EV_FireGauss( event_args_t *args )
{
// slug doesn't punch through ever with primary
// fire, so leave a little glowy bit and make some balls
gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, 200.0 / 255.0, 0.3, FTENT_FADEOUT );
gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, 200.0f / 255.0f, 0.3, FTENT_FADEOUT );
{
vec3_t fwd;
VectorAdd( tr.endpos, tr.plane.normal, fwd );
gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 8, 0.6, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100,
gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 8, 0.6, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100,
255, 200 );
}
}
@ -1238,7 +1238,7 @@ void EV_FireCrossbow2( event_args_t *args )
VectorMA( vecSrc, 8192, forward, vecEnd );
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) );
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) );
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) );
if( EV_IsLocal( idx ) )
{
@ -1257,7 +1257,7 @@ void EV_FireCrossbow2( event_args_t *args )
gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr );
//We hit something
if( tr.fraction < 1.0 )
if( tr.fraction < 1.0f )
{
physent_t *pe = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent );
@ -1277,7 +1277,7 @@ void EV_FireCrossbow2( event_args_t *args )
//Stick to world but don't stick to glass, it might break and leave the bolt floating. It can still stick to other non-transparent breakables though.
else if( pe->rendermode == kRenderNormal )
{
gEngfuncs.pEventAPI->EV_PlaySound( 0, tr.endpos, CHAN_BODY, "weapons/xbow_hit1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, PITCH_NORM );
gEngfuncs.pEventAPI->EV_PlaySound( 0, tr.endpos, CHAN_BODY, "weapons/xbow_hit1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, PITCH_NORM );
//Not underwater, do some sparks...
if( gEngfuncs.PM_PointContents( tr.endpos, NULL ) != CONTENTS_WATER )
@ -1313,7 +1313,7 @@ void EV_FireCrossbow( event_args_t *args )
VectorCopy( args->origin, origin );
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) );
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) );
gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) );
//Only play the weapon anims if I shot it.
if( EV_IsLocal( idx ) )
@ -1323,7 +1323,7 @@ void EV_FireCrossbow( event_args_t *args )
else if ( args->iparam2 )
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 );
V_PunchAxis( 0, -2.0 );
V_PunchAxis( 0.0f, -2.0f );
}
}
//======================
@ -1541,13 +1541,13 @@ void EV_EgonStop( event_args_t *args )
{
if( pBeam )
{
pBeam->die = 0.0;
pBeam->die = 0.0f;
pBeam = NULL;
}
if( pBeam2 )
{
pBeam2->die = 0.0;
pBeam2->die = 0.0f;
pBeam2 = NULL;
}
@ -1667,10 +1667,10 @@ void EV_TripmineFire( event_args_t *args )
// Now add in all of the players.
gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 );
gEngfuncs.pEventAPI->EV_SetTraceHull( 2 );
gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128, PM_NORMAL, -1, &tr );
gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128.0f, PM_NORMAL, -1, &tr );
//Hit something solid
if( tr.fraction < 1.0 )
if( tr.fraction < 1.0f )
gEngfuncs.pEventAPI->EV_WeaponAnimation ( TRIPMINE_DRAW, 0 );
gEngfuncs.pEventAPI->EV_PopPMStates();
@ -1722,7 +1722,7 @@ void EV_SnarkFire( event_args_t *args )
gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc + forward * 20, vecSrc + forward * 64, PM_NORMAL, -1, &tr );
//Find space to drop the thing.
if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25 )
if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25f )
gEngfuncs.pEventAPI->EV_WeaponAnimation( SQUEAK_THROW, 0 );
gEngfuncs.pEventAPI->EV_PopPMStates();
@ -1751,9 +1751,9 @@ void EV_TrainPitchAdjust( event_args_t *args )
us_params = (unsigned short)args->iparam1;
stop = args->bparam1;
m_flVolume = (float)( us_params & 0x003f ) / 40.0;
m_flVolume = (float)( us_params & 0x003f ) / 40.0f;
noise = (int)( ( ( us_params ) >> 12 ) & 0x0007 );
pitch = (int)( 10.0 * (float)( ( us_params >> 6 ) & 0x003f ) );
pitch = (int)( 10.0f * (float)( ( us_params >> 6 ) & 0x003f ) );
switch( noise )
{

@ -50,7 +50,7 @@ void CHudFlashlight::Reset( void )
m_fFade = 0;
m_fOn = 0;
m_iBat = 100;
m_flBat = 1.0;
m_flBat = 1.0f;
}
int CHudFlashlight::VidInit( void )
@ -75,7 +75,7 @@ int CHudFlashlight::MsgFunc_FlashBat( const char *pszName, int iSize, void *pbu
BEGIN_READ( pbuf, iSize );
int x = READ_BYTE();
m_iBat = x;
m_flBat = ( (float)x ) / 100.0;
m_flBat = ( (float)x ) / 100.0f;
return 1;
}
@ -86,7 +86,7 @@ int CHudFlashlight::MsgFunc_Flashlight( const char *pszName, int iSize, void *p
m_fOn = READ_BYTE();
int x = READ_BYTE();
m_iBat = x;
m_flBat = ( (float)x ) / 100.0;
m_flBat = ( (float)x ) / 100.0f;
return 1;
}
@ -119,7 +119,7 @@ int CHudFlashlight::Draw( float flTime )
else
a = MIN_ALPHA;
if( m_flBat < 0.20 )
if( m_flBat < 0.20f )
UnpackRGB( r,g,b, RGB_REDISH );
else
UnpackRGB( r,g,b, RGB_YELLOWISH );
@ -144,7 +144,7 @@ int CHudFlashlight::Draw( float flTime )
// draw the flashlight energy level
x = ScreenWidth - m_iWidth - m_iWidth / 2;
int iOffset = m_iWidth * ( 1.0 - m_flBat );
int iOffset = m_iWidth * ( 1.0f - m_flBat );
if( iOffset < m_iWidth )
{
rc = *m_prc2;

@ -78,7 +78,7 @@ int CHudGeiger::Draw( float flTime )
else if( m_iGeigerRange > 600 )
{
pct = 2;
flvol = 0.4; //Con_Printf( "range > 600\n" );
flvol = 0.4f; //Con_Printf( "range > 600\n" );
//rg[0] = 1;
//rg[1] = 1;
i = 2;
@ -86,7 +86,7 @@ int CHudGeiger::Draw( float flTime )
else if( m_iGeigerRange > 500 )
{
pct = 4;
flvol = 0.5; //Con_Printf( "range > 500\n" );
flvol = 0.5f; //Con_Printf( "range > 500\n" );
//rg[0] = 1;
//rg[1] = 2;
i = 2;
@ -94,7 +94,7 @@ int CHudGeiger::Draw( float flTime )
else if( m_iGeigerRange > 400 )
{
pct = 8;
flvol = 0.6; //Con_Printf( "range > 400\n" );
flvol = 0.6f; //Con_Printf( "range > 400\n" );
//rg[0] = 1;
//rg[1] = 2;
//rg[2] = 3;
@ -103,7 +103,7 @@ int CHudGeiger::Draw( float flTime )
else if( m_iGeigerRange > 300 )
{
pct = 8;
flvol = 0.7; //Con_Printf( "range > 300\n" );
flvol = 0.7f; //Con_Printf( "range > 300\n" );
//rg[0] = 2;
//rg[1] = 3;
//rg[2] = 4;
@ -112,7 +112,7 @@ int CHudGeiger::Draw( float flTime )
else if( m_iGeigerRange > 200 )
{
pct = 28;
flvol = 0.78; //Con_Printf( "range > 200\n" );
flvol = 0.78f; //Con_Printf( "range > 200\n" );
//rg[0] = 2;
//rg[1] = 3;
//rg[2] = 4;
@ -121,7 +121,7 @@ int CHudGeiger::Draw( float flTime )
else if( m_iGeigerRange > 150 )
{
pct = 40;
flvol = 0.80; //Con_Printf( "range > 150\n" );
flvol = 0.80f; //Con_Printf( "range > 150\n" );
//rg[0] = 3;
//rg[1] = 4;
//rg[2] = 5;
@ -139,7 +139,7 @@ int CHudGeiger::Draw( float flTime )
else if( m_iGeigerRange > 75 )
{
pct = 80;
flvol = 0.9; //Con_Printf( "range > 75\n" );
flvol = 0.9f; //Con_Printf( "range > 75\n" );
//gflGeigerDelay = cl.time + GEIGERDELAY * 0.75;
//rg[0] = 4;
//rg[1] = 5;
@ -149,7 +149,7 @@ int CHudGeiger::Draw( float flTime )
else if( m_iGeigerRange > 50 )
{
pct = 90;
flvol = 0.95; //Con_Printf( "range > 50\n" );
flvol = 0.95f; //Con_Printf( "range > 50\n" );
//rg[0] = 5;
//rg[1] = 6;
i = 2;
@ -157,17 +157,17 @@ int CHudGeiger::Draw( float flTime )