Browse Source

Merge branch 'master' into poke646

poke646
Andrey Akhmichin 5 years ago
parent
commit
49b69ec20b
  1. 10
      cl_dll/ammo.cpp
  2. 4
      cl_dll/ammo_secondary.cpp
  3. 8
      cl_dll/ammohistory.cpp
  4. 4
      cl_dll/cl_util.h
  5. 2
      cl_dll/death.cpp
  6. 26
      cl_dll/health.cpp
  7. 2
      cl_dll/hud_redraw.cpp
  8. 11
      cl_dll/saytext.cpp
  9. 2
      cl_dll/scoreboard.cpp
  10. 2
      cl_dll/statusbar.cpp
  11. 8
      cl_dll/view.cpp
  12. 4
      dlls/player.h
  13. 4
      dlls/util.h
  14. 11
      scripts/waifulib/xcompile.py

10
cl_dll/ammo.cpp

@ -152,7 +152,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon )
pWeapon->hInactive = SPR_Load( sz ); pWeapon->hInactive = SPR_Load( sz );
pWeapon->rcInactive = p->rc; pWeapon->rcInactive = p->rc;
gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); gHR.iHistoryGap = Q_max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top );
} }
else else
pWeapon->hInactive = 0; pWeapon->hInactive = 0;
@ -174,7 +174,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon )
pWeapon->hAmmo = SPR_Load( sz ); pWeapon->hAmmo = SPR_Load( sz );
pWeapon->rcAmmo = p->rc; pWeapon->rcAmmo = p->rc;
gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); gHR.iHistoryGap = Q_max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top );
} }
else else
pWeapon->hAmmo = 0; pWeapon->hAmmo = 0;
@ -186,7 +186,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon )
pWeapon->hAmmo2 = SPR_Load( sz ); pWeapon->hAmmo2 = SPR_Load( sz );
pWeapon->rcAmmo2 = p->rc; pWeapon->rcAmmo2 = p->rc;
gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); gHR.iHistoryGap = Q_max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top );
} }
else else
pWeapon->hAmmo2 = 0; pWeapon->hAmmo2 = 0;
@ -321,7 +321,7 @@ int CHudAmmo::VidInit( void )
giBucketWidth = gHUD.GetSpriteRect( m_HUD_bucket0 ).right - gHUD.GetSpriteRect( m_HUD_bucket0 ).left; giBucketWidth = gHUD.GetSpriteRect( m_HUD_bucket0 ).right - gHUD.GetSpriteRect( m_HUD_bucket0 ).left;
giBucketHeight = gHUD.GetSpriteRect( m_HUD_bucket0 ).bottom - gHUD.GetSpriteRect( m_HUD_bucket0 ).top; giBucketHeight = gHUD.GetSpriteRect( m_HUD_bucket0 ).bottom - gHUD.GetSpriteRect( m_HUD_bucket0 ).top;
gHR.iHistoryGap = max( gHR.iHistoryGap, gHUD.GetSpriteRect( m_HUD_bucket0 ).bottom - gHUD.GetSpriteRect( m_HUD_bucket0 ).top ); gHR.iHistoryGap = Q_max( gHR.iHistoryGap, gHUD.GetSpriteRect( m_HUD_bucket0 ).bottom - gHUD.GetSpriteRect( m_HUD_bucket0 ).top );
// If we've already loaded weapons, let's get new sprites // If we've already loaded weapons, let's get new sprites
gWR.LoadAllWeaponSprites(); gWR.LoadAllWeaponSprites();
@ -856,7 +856,7 @@ int CHudAmmo::Draw( float flTime )
AmmoWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left; AmmoWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left;
a = (int)max( MIN_ALPHA, m_fFade); a = (int)Q_max( MIN_ALPHA, m_fFade );
if( m_fFade > 0 ) if( m_fFade > 0 )
m_fFade -= ( gHUD.m_flTimeDelta * 20 ); m_fFade -= ( gHUD.m_flTimeDelta * 20 );

4
cl_dll/ammo_secondary.cpp

@ -61,7 +61,7 @@ int CHudAmmoSecondary::Draw( float flTime )
// draw secondary ammo icons above normal ammo readout // draw secondary ammo icons above normal ammo readout
int a, x, y, r, g, b, AmmoWidth; int a, x, y, r, g, b, AmmoWidth;
UnpackRGB( r, g, b, RGB_YELLOWISH ); UnpackRGB( r, g, b, RGB_YELLOWISH );
a = (int) max( MIN_ALPHA, m_fFade ); a = (int)Q_max( MIN_ALPHA, m_fFade );
if( m_fFade > 0 ) if( m_fFade > 0 )
m_fFade -= ( gHUD.m_flTimeDelta * 20 ); // slowly lower alpha to fade out icons m_fFade -= ( gHUD.m_flTimeDelta * 20 ); // slowly lower alpha to fade out icons
ScaleColors( r, g, b, a ); ScaleColors( r, g, b, a );
@ -142,7 +142,7 @@ int CHudAmmoSecondary::MsgFunc_SecAmmoVal( const char *pszName, int iSize, void
int count = 0; int count = 0;
for( int i = 0; i < MAX_SEC_AMMO_VALUES; i++ ) for( int i = 0; i < MAX_SEC_AMMO_VALUES; i++ )
{ {
count += max( 0, m_iAmmoAmounts[i] ); count += Q_max( 0, m_iAmmoAmounts[i] );
} }
if( count == 0 ) if( count == 0 )

8
cl_dll/ammohistory.cpp

@ -111,7 +111,7 @@ int HistoryResource::DrawAmmoHistory( float flTime )
{ {
if( rgAmmoHistory[i].type ) if( rgAmmoHistory[i].type )
{ {
rgAmmoHistory[i].DisplayTime = min( rgAmmoHistory[i].DisplayTime, gHUD.m_flTime + HISTORY_DRAW_TIME ); rgAmmoHistory[i].DisplayTime = Q_min( rgAmmoHistory[i].DisplayTime, gHUD.m_flTime + HISTORY_DRAW_TIME );
if( rgAmmoHistory[i].DisplayTime <= flTime ) if( rgAmmoHistory[i].DisplayTime <= flTime )
{ {
@ -127,7 +127,7 @@ int HistoryResource::DrawAmmoHistory( float flTime )
int r, g, b; int r, g, b;
UnpackRGB( r, g, b, RGB_YELLOWISH ); UnpackRGB( r, g, b, RGB_YELLOWISH );
float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80; float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80;
ScaleColors( r, g, b, min( scale, 255 ) ); ScaleColors( r, g, b, Q_min( scale, 255 ) );
// Draw the pic // Draw the pic
int ypos = ScreenHeight - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i)); int ypos = ScreenHeight - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i));
@ -158,7 +158,7 @@ int HistoryResource::DrawAmmoHistory( float flTime )
UnpackRGB( r, g, b, RGB_REDISH ); // if the weapon doesn't have ammo, display it as red UnpackRGB( r, g, b, RGB_REDISH ); // if the weapon doesn't have ammo, display it as red
float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80; float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80;
ScaleColors( r, g, b, min( scale, 255 ) ); ScaleColors( r, g, b, Q_min( scale, 255 ) );
int ypos = ScreenHeight - ( AMMO_PICKUP_PICK_HEIGHT + ( AMMO_PICKUP_GAP * i ) ); int ypos = ScreenHeight - ( AMMO_PICKUP_PICK_HEIGHT + ( AMMO_PICKUP_GAP * i ) );
int xpos = ScreenWidth - ( weap->rcInactive.right - weap->rcInactive.left ); int xpos = ScreenWidth - ( weap->rcInactive.right - weap->rcInactive.left );
@ -176,7 +176,7 @@ int HistoryResource::DrawAmmoHistory( float flTime )
UnpackRGB( r, g, b, RGB_YELLOWISH ); UnpackRGB( r, g, b, RGB_YELLOWISH );
float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80; float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80;
ScaleColors( r, g, b, min( scale, 255 ) ); ScaleColors( r, g, b, Q_min( scale, 255 ) );
int ypos = ScreenHeight - ( AMMO_PICKUP_PICK_HEIGHT + ( AMMO_PICKUP_GAP * i ) ); int ypos = ScreenHeight - ( AMMO_PICKUP_PICK_HEIGHT + ( AMMO_PICKUP_GAP * i ) );
int xpos = ScreenWidth - ( rect.right - rect.left ) - 10; int xpos = ScreenWidth - ( rect.right - rect.left ) - 10;

4
cl_dll/cl_util.h

@ -148,8 +148,8 @@ inline void CenterPrint( const char *string )
inline void PlaySound( const char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); } inline void PlaySound( const char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); }
inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); } inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); }
#define max(a, b) (((a) > (b)) ? (a) : (b)) #define Q_max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b)) #define Q_min(a, b) (((a) < (b)) ? (a) : (b))
#define fabs(x) ((x) > 0 ? (x) : 0 - (x)) #define fabs(x) ((x) > 0 ? (x) : 0 - (x))
void ScaleColors( int &r, int &g, int &b, int a ); void ScaleColors( int &r, int &g, int &b, int a );

2
cl_dll/death.cpp

@ -106,7 +106,7 @@ int CHudDeathNotice::Draw( float flTime )
continue; continue;
} }
rgDeathNoticeList[i].flDisplayTime = min( rgDeathNoticeList[i].flDisplayTime, gHUD.m_flTime + DEATHNOTICE_DISPLAY_TIME ); rgDeathNoticeList[i].flDisplayTime = Q_min( rgDeathNoticeList[i].flDisplayTime, gHUD.m_flTime + DEATHNOTICE_DISPLAY_TIME );
// Only draw if the viewport will let me // Only draw if the viewport will let me
// vgui dropped out // vgui dropped out

26
cl_dll/health.cpp

@ -276,25 +276,25 @@ void CHudHealth::CalcDamageDirection( vec3_t vecFrom )
if( side > 0 ) if( side > 0 )
{ {
if( side > 0.3 ) if( side > 0.3 )
m_fAttackFront = max( m_fAttackFront, side ); m_fAttackFront = Q_max( m_fAttackFront, side );
} }
else else
{ {
float f = fabs( side ); float f = fabs( side );
if( f > 0.3 ) if( f > 0.3 )
m_fAttackRear = max( m_fAttackRear, f ); m_fAttackRear = Q_max( m_fAttackRear, f );
} }
if( front > 0 ) if( front > 0 )
{ {
if( front > 0.3 ) if( front > 0.3 )
m_fAttackRight = max( m_fAttackRight, front ); m_fAttackRight = Q_max( m_fAttackRight, front );
} }
else else
{ {
float f = fabs( front ); float f = fabs( front );
if( f > 0.3 ) if( f > 0.3 )
m_fAttackLeft = max( m_fAttackLeft, f ); m_fAttackLeft = Q_max( m_fAttackLeft, f );
} }
} }
} }
@ -316,28 +316,28 @@ int CHudHealth::DrawPain( float flTime )
if( m_fAttackFront > 0.4 ) if( m_fAttackFront > 0.4 )
{ {
GetPainColor( r, g, b ); GetPainColor( r, g, b );
shade = a * max( m_fAttackFront, 0.5 ); shade = a * Q_max( m_fAttackFront, 0.5 );
ScaleColors( r, g, b, shade ); ScaleColors( r, g, b, shade );
SPR_Set( m_hSprite, r, g, b ); SPR_Set( m_hSprite, r, g, b );
x = ScreenWidth / 2 - SPR_Width( m_hSprite, 0 ) / 2; x = ScreenWidth / 2 - SPR_Width( m_hSprite, 0 ) / 2;
y = ScreenHeight / 2 - SPR_Height( m_hSprite, 0 ) * 3; y = ScreenHeight / 2 - SPR_Height( m_hSprite, 0 ) * 3;
SPR_DrawAdditive( 0, x, y, NULL ); SPR_DrawAdditive( 0, x, y, NULL );
m_fAttackFront = max( 0, m_fAttackFront - fFade ); m_fAttackFront = Q_max( 0, m_fAttackFront - fFade );
} else } else
m_fAttackFront = 0; m_fAttackFront = 0;
if( m_fAttackRight > 0.4 ) if( m_fAttackRight > 0.4 )
{ {
GetPainColor( r, g, b ); GetPainColor( r, g, b );
shade = a * max( m_fAttackRight, 0.5 ); shade = a * Q_max( m_fAttackRight, 0.5 );
ScaleColors( r, g, b, shade ); ScaleColors( r, g, b, shade );
SPR_Set( m_hSprite, r, g, b ); SPR_Set( m_hSprite, r, g, b );
x = ScreenWidth / 2 + SPR_Width( m_hSprite, 1 ) * 2; x = ScreenWidth / 2 + SPR_Width( m_hSprite, 1 ) * 2;
y = ScreenHeight / 2 - SPR_Height( m_hSprite,1 ) / 2; y = ScreenHeight / 2 - SPR_Height( m_hSprite,1 ) / 2;
SPR_DrawAdditive( 1, x, y, NULL ); SPR_DrawAdditive( 1, x, y, NULL );
m_fAttackRight = max( 0, m_fAttackRight - fFade ); m_fAttackRight = Q_max( 0, m_fAttackRight - fFade );
} }
else else
m_fAttackRight = 0; m_fAttackRight = 0;
@ -345,14 +345,14 @@ int CHudHealth::DrawPain( float flTime )
if( m_fAttackRear > 0.4 ) if( m_fAttackRear > 0.4 )
{ {
GetPainColor( r, g, b ); GetPainColor( r, g, b );
shade = a * max( m_fAttackRear, 0.5 ); shade = a * Q_max( m_fAttackRear, 0.5 );
ScaleColors( r, g, b, shade ); ScaleColors( r, g, b, shade );
SPR_Set( m_hSprite, r, g, b ); SPR_Set( m_hSprite, r, g, b );
x = ScreenWidth / 2 - SPR_Width( m_hSprite, 2 ) / 2; x = ScreenWidth / 2 - SPR_Width( m_hSprite, 2 ) / 2;
y = ScreenHeight / 2 + SPR_Height( m_hSprite, 2 ) * 2; y = ScreenHeight / 2 + SPR_Height( m_hSprite, 2 ) * 2;
SPR_DrawAdditive( 2, x, y, NULL ); SPR_DrawAdditive( 2, x, y, NULL );
m_fAttackRear = max( 0, m_fAttackRear - fFade ); m_fAttackRear = Q_max( 0, m_fAttackRear - fFade );
} }
else else
m_fAttackRear = 0; m_fAttackRear = 0;
@ -360,7 +360,7 @@ int CHudHealth::DrawPain( float flTime )
if( m_fAttackLeft > 0.4 ) if( m_fAttackLeft > 0.4 )
{ {
GetPainColor( r, g, b ); GetPainColor( r, g, b );
shade = a * max( m_fAttackLeft, 0.5 ); shade = a * Q_max( m_fAttackLeft, 0.5 );
ScaleColors( r, g, b, shade ); ScaleColors( r, g, b, shade );
SPR_Set( m_hSprite, r, g, b ); SPR_Set( m_hSprite, r, g, b );
@ -368,7 +368,7 @@ int CHudHealth::DrawPain( float flTime )
y = ScreenHeight / 2 - SPR_Height( m_hSprite,3 ) / 2; y = ScreenHeight / 2 - SPR_Height( m_hSprite,3 ) / 2;
SPR_DrawAdditive( 3, x, y, NULL ); SPR_DrawAdditive( 3, x, y, NULL );
m_fAttackLeft = max( 0, m_fAttackLeft - fFade ); m_fAttackLeft = Q_max( 0, m_fAttackLeft - fFade );
} else } else
m_fAttackLeft = 0; m_fAttackLeft = 0;
@ -400,7 +400,7 @@ int CHudHealth::DrawDamage( float flTime )
SPR_Set( gHUD.GetSprite( m_HUD_dmg_bio + i ), r, g, b ); SPR_Set( gHUD.GetSprite( m_HUD_dmg_bio + i ), r, g, b );
SPR_DrawAdditive( 0, pdmg->x, pdmg->y, &gHUD.GetSpriteRect( m_HUD_dmg_bio + i ) ); SPR_DrawAdditive( 0, pdmg->x, pdmg->y, &gHUD.GetSpriteRect( m_HUD_dmg_bio + i ) );
pdmg->fExpire = min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire ); pdmg->fExpire = Q_min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire );
if( pdmg->fExpire <= flTime // when the time has expired if( pdmg->fExpire <= flTime // when the time has expired
&& a < 40 ) // and the flash is at the low point of the cycle && a < 40 ) // and the flash is at the low point of the cycle

2
cl_dll/hud_redraw.cpp

@ -75,7 +75,7 @@ void CHud::Think( void )
if( m_iFOV == 0 ) if( m_iFOV == 0 )
{ {
// only let players adjust up in fov, and only if they are not overriden by something else // only let players adjust up in fov, and only if they are not overriden by something else
m_iFOV = max( default_fov->value, 90 ); m_iFOV = Q_max( default_fov->value, 90 );
} }
} }

11
cl_dll/saytext.cpp

@ -96,10 +96,7 @@ int CHudSayText::Draw( float flTime )
int y = Y_START; int y = Y_START;
// make sure the scrolltime is within reasonable bounds, to guard against the clock being reset // make sure the scrolltime is within reasonable bounds, to guard against the clock being reset
flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value ); flScrollTime = Q_min( flScrollTime, flTime + m_HUD_saytext_time->value );
// make sure the scrolltime is within reasonable bounds, to guard against the clock being reset
flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value );
if( flScrollTime <= flTime ) if( flScrollTime <= flTime )
{ {
@ -126,8 +123,8 @@ int CHudSayText::Draw( float flTime )
static char buf[MAX_PLAYER_NAME_LENGTH + 32]; static char buf[MAX_PLAYER_NAME_LENGTH + 32];
// draw the first x characters in the player color // draw the first x characters in the player color
strncpy( buf, g_szLineBuffer[i], min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 32 ) ); strncpy( buf, g_szLineBuffer[i], Q_min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 32 ) );
buf[min( g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 31 )] = 0; buf[Q_min( g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 31 )] = 0;
DrawSetTextColor( g_pflNameColors[i][0], g_pflNameColors[i][1], g_pflNameColors[i][2] ); DrawSetTextColor( g_pflNameColors[i][0], g_pflNameColors[i][1], g_pflNameColors[i][2] );
int x = DrawConsoleString( LINE_START, y, buf ); int x = DrawConsoleString( LINE_START, y, buf );
@ -196,7 +193,7 @@ void CHudSayText::SayTextPrint( const char *pszBuf, int iBufSize, int clientInde
} }
} }
strncpy( g_szLineBuffer[i], pszBuf, max( iBufSize - 1, MAX_CHARS_PER_LINE - 1 ) ); strncpy( g_szLineBuffer[i], pszBuf, Q_max( iBufSize - 1, MAX_CHARS_PER_LINE - 1 ) );
// make sure the text fits in one line // make sure the text fits in one line
EnsureTextFitsInOneLineAndWrapIfHaveTo( i ); EnsureTextFitsInOneLineAndWrapIfHaveTo( i );

2
cl_dll/scoreboard.cpp

@ -561,7 +561,7 @@ int CHudScoreboard::MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf
if( g_TeamInfo[j].name[0] == '\0' ) if( g_TeamInfo[j].name[0] == '\0' )
break; break;
} }
m_iNumTeams = max( j, m_iNumTeams ); m_iNumTeams = Q_max( j, m_iNumTeams );
strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME ); strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME );
g_TeamInfo[j].players = 0; g_TeamInfo[j].players = 0;

2
cl_dll/statusbar.cpp

@ -197,7 +197,7 @@ int CHudStatusBar::Draw( float fTime )
// let user set status ID bar centering // let user set status ID bar centering
if( ( i == STATUSBAR_ID_LINE ) && CVAR_GET_FLOAT( "hud_centerid" ) ) if( ( i == STATUSBAR_ID_LINE ) && CVAR_GET_FLOAT( "hud_centerid" ) )
{ {
x = max( 0, max( 2, ( ScreenWidth - TextWidth ) ) / 2 ); x = Q_max( 0, Q_max( 2, ( ScreenWidth - TextWidth ) ) / 2 );
y = ( ScreenHeight / 2 ) + ( TextHeight * CVAR_GET_FLOAT( "hud_centerid" ) ); y = ( ScreenHeight / 2 ) + ( TextHeight * CVAR_GET_FLOAT( "hud_centerid" ) );
} }

8
cl_dll/view.cpp

@ -214,8 +214,8 @@ float V_CalcBob( struct ref_params_s *pparams )
bob = sqrt( vel[0] * vel[0] + vel[1] * vel[1] ) * cl_bob->value; bob = sqrt( vel[0] * vel[0] + vel[1] * vel[1] ) * cl_bob->value;
bob = bob * 0.3 + bob * 0.7 * sin(cycle); bob = bob * 0.3 + bob * 0.7 * sin(cycle);
bob = min( bob, 4 ); bob = Q_min( bob, 4 );
bob = max( bob, -7 ); bob = Q_max( bob, -7 );
return bob; return bob;
} }
@ -709,7 +709,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams )
if( dt > 0.0 ) if( dt > 0.0 )
{ {
frac = ( t - ViewInterp.OriginTime[foundidx & ORIGIN_MASK] ) / dt; frac = ( t - ViewInterp.OriginTime[foundidx & ORIGIN_MASK] ) / dt;
frac = min( 1.0, frac ); frac = Q_min( 1.0, frac );
VectorSubtract( ViewInterp.Origins[( foundidx + 1 ) & ORIGIN_MASK], ViewInterp.Origins[foundidx & ORIGIN_MASK], delta ); VectorSubtract( ViewInterp.Origins[( foundidx + 1 ) & ORIGIN_MASK], ViewInterp.Origins[foundidx & ORIGIN_MASK], delta );
VectorMA( ViewInterp.Origins[foundidx & ORIGIN_MASK], frac, delta, neworg ); VectorMA( ViewInterp.Origins[foundidx & ORIGIN_MASK], frac, delta, neworg );
@ -1561,7 +1561,7 @@ void V_DropPunchAngle( float frametime, float *ev_punchangle )
len = VectorNormalize( ev_punchangle ); len = VectorNormalize( ev_punchangle );
len -= ( 10.0 + len * 0.5 ) * frametime; len -= ( 10.0 + len * 0.5 ) * frametime;
len = max( len, 0.0 ); len = Q_max( len, 0.0 );
VectorScale( ev_punchangle, len, ev_punchangle ); VectorScale( ev_punchangle, len, ev_punchangle );
} }

4
dlls/player.h

@ -307,8 +307,6 @@ public:
void SetCustomDecalFrames( int nFrames ); void SetCustomDecalFrames( int nFrames );
int GetCustomDecalFrames( void ); int GetCustomDecalFrames( void );
Vector m_vecLastViewAngles;
float m_flStartCharge; float m_flStartCharge;
float m_flAmmoStartCharge; float m_flAmmoStartCharge;
float m_flPlayAftershock; float m_flPlayAftershock;
@ -325,6 +323,8 @@ public:
float m_flNextChatTime; float m_flNextChatTime;
Vector m_vecLastViewAngles;
bool m_bSentBhopcap; // If false, the player just joined and needs a bhopcap message. bool m_bSentBhopcap; // If false, the player just joined and needs a bhopcap message.
}; };

4
dlls/util.h

@ -108,7 +108,11 @@ typedef int BOOL;
// The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress() // The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress()
// The function is used to intialize / allocate the object for the entity // The function is used to intialize / allocate the object for the entity
#if defined(CLIENT_DLL)
#define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName)
#else // CLIENT_DLL
#define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) extern "C" EXPORT void mapClassName( entvars_t *pev ); void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); } #define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) extern "C" EXPORT void mapClassName( entvars_t *pev ); void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); }
#endif // CLIENT_DLL
// //
// Conversion among the three types of "entity", including identity-conversions. // Conversion among the three types of "entity", including identity-conversions.

11
scripts/waifulib/xcompile.py

@ -64,7 +64,7 @@ class Android:
else: else:
self.ndk_rev = 10 self.ndk_rev = 10
if self.ndk_rev not in [10, 19]: if self.ndk_rev not in [10, 19, 20]:
ctx.fatal('Unknown NDK revision: {}'.format(self.ndk_rev)) ctx.fatal('Unknown NDK revision: {}'.format(self.ndk_rev))
self.arch = arch self.arch = arch
@ -197,7 +197,10 @@ class Android:
return os.path.abspath(os.path.join(self.ndk_home, path)) return os.path.abspath(os.path.join(self.ndk_home, path))
def cflags(self): def cflags(self):
cflags = ['--sysroot={0}'.format(self.sysroot()), '-DANDROID', '-D__ANDROID__'] cflags = []
if self.ndk_rev < 20:
cflags = ['--sysroot={0}'.format(self.sysroot())]
cflags += ['-DANDROID', '-D__ANDROID__']
cflags += ['-I{0}'.format(self.system_stl())] cflags += ['-I{0}'.format(self.system_stl())]
if self.is_arm(): if self.is_arm():
if self.arch == 'armeabi-v7a': if self.arch == 'armeabi-v7a':
@ -218,6 +221,8 @@ class Android:
# they go before object list # they go before object list
def linkflags(self): def linkflags(self):
linkflags = []
if self.ndk_rev < 20:
linkflags = ['--sysroot={0}'.format(self.sysroot())] linkflags = ['--sysroot={0}'.format(self.sysroot())]
return linkflags return linkflags
@ -277,7 +282,7 @@ def configure(conf):
def post_compiler_cxx_configure(conf): def post_compiler_cxx_configure(conf):
if conf.options.ANDROID_OPTS: if conf.options.ANDROID_OPTS:
if conf.android.ndk_rev >= 19: if conf.android.ndk_rev == 19:
conf.env.CXXFLAGS_cxxshlib += ['-static-libstdc++'] conf.env.CXXFLAGS_cxxshlib += ['-static-libstdc++']
conf.env.LDFLAGS_cxxshlib += ['-static-libstdc++'] conf.env.LDFLAGS_cxxshlib += ['-static-libstdc++']
return return

Loading…
Cancel
Save