Skip to content

Commit

Permalink
Remove TRUE and FALSE from the client code
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed Nov 8, 2024
1 parent ea20465 commit cfde15f
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 45 deletions.
14 changes: 7 additions & 7 deletions cl_dll/ammo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int WeaponsResource::CountAmmo( int iId )
int WeaponsResource::HasAmmo( WEAPON *p )
{
if( !p )
return FALSE;
return 0;

// weapons with no max ammo can always be selected
return ( p->iAmmoType == -1 ) || p->iClip > 0 || CountAmmo( p->iAmmoType )
Expand Down Expand Up @@ -581,7 +581,7 @@ HSPRITE* WeaponsResource::GetAmmoPicFromWeapon( int iAmmoId, wrect_t& rect )
// Menu Selection Code
void WeaponsResource::SelectSlot( int iSlot, int fAdvance, int iDirection )
{
if( gHUD.m_Menu.m_fMenuDisplayed && ( fAdvance == FALSE ) && ( iDirection == 1 ) )
if( gHUD.m_Menu.m_fMenuDisplayed && ( fAdvance == 0 ) && ( iDirection == 1 ) )
{
// menu is overriding slot use commands
gHUD.m_Menu.SelectMenuItem( iSlot + 1 ); // slots are one off the key numbers
Expand Down Expand Up @@ -734,7 +734,7 @@ int CHudAmmo::MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf )
int CHudAmmo::MsgFunc_CurWeapon( const char *pszName, int iSize, void *pbuf )
{
wrect_t nullrc = {0,};
int fOnTarget = FALSE;
bool fOnTarget = false;

BEGIN_READ( pbuf, iSize );

Expand All @@ -745,7 +745,7 @@ int CHudAmmo::MsgFunc_CurWeapon( const char *pszName, int iSize, void *pbuf )
// detect if we're also on target
if( iState > 1 )
{
fOnTarget = TRUE;
fOnTarget = true;
}

if( iId < 1 )
Expand All @@ -761,11 +761,11 @@ int CHudAmmo::MsgFunc_CurWeapon( const char *pszName, int iSize, void *pbuf )
// Is player dead???
if( ( iId == -1 ) && ( iClip == -1 ) )
{
gHUD.m_fPlayerDead = TRUE;
gHUD.m_fPlayerDead = true;
gpActiveSel = NULL;
return 1;
}
gHUD.m_fPlayerDead = FALSE;
gHUD.m_fPlayerDead = false;
}

WEAPON *pWeapon = gWR.GetWeapon( iId );
Expand Down Expand Up @@ -875,7 +875,7 @@ void CHudAmmo::SlotInput( int iSlot )
if( gViewPort && gViewPort->SlotInput( iSlot ) )
return;
#endif
gWR.SelectSlot(iSlot, FALSE, 1);
gWR.SelectSlot(iSlot, 0, 1);
}

void CHudAmmo::UserCmd_Slot1( void )
Expand Down
5 changes: 0 additions & 5 deletions cl_dll/cl_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
#include "cvardef.h"
#include "color_utils.h"

#if !defined(TRUE)
#define TRUE 1
#define FALSE 0
#endif

// Macros to hook function calls into the HUD object

#define HOOK_MESSAGE(x) gEngfuncs.pfnHookUserMsg( #x, __MsgFunc_##x );
Expand Down
14 changes: 7 additions & 7 deletions cl_dll/death.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ struct DeathNoticeItem {
char szKiller[MAX_PLAYER_NAME_LENGTH * 2];
char szVictim[MAX_PLAYER_NAME_LENGTH * 2];
int iId; // the index number of the associated sprite
int iSuicide;
int iTeamKill;
int iNonPlayerKill;
bool iSuicide;
bool iTeamKill;
bool iNonPlayerKill;
float flDisplayTime;
float *KillerColor;
float *VictimColor;
Expand Down Expand Up @@ -155,7 +155,7 @@ int CHudDeathNotice::Draw( float flTime )
x += ( gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left );

// Draw victims name (if it was a player that was killed)
if( rgDeathNoticeList[i].iNonPlayerKill == FALSE )
if( !rgDeathNoticeList[i].iNonPlayerKill )
{
if( rgDeathNoticeList[i].VictimColor )
DrawSetTextColor( rgDeathNoticeList[i].VictimColor[0], rgDeathNoticeList[i].VictimColor[1], rgDeathNoticeList[i].VictimColor[2] );
Expand Down Expand Up @@ -236,18 +236,18 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu
// Is it a non-player object kill?
if( ( (signed char)victim ) == -1 )
{
rgDeathNoticeList[i].iNonPlayerKill = TRUE;
rgDeathNoticeList[i].iNonPlayerKill = true;

// Store the object's name in the Victim slot (skip the d_ bit)
strcpy( rgDeathNoticeList[i].szVictim, killedwith + 2 );
}
else
{
if( killer == victim || killer == 0 )
rgDeathNoticeList[i].iSuicide = TRUE;
rgDeathNoticeList[i].iSuicide = true;

if( !strcmp( killedwith, "d_teammate" ) )
rgDeathNoticeList[i].iTeamKill = TRUE;
rgDeathNoticeList[i].iTeamKill = true;
}

// Find the sprite in the list
Expand Down
10 changes: 5 additions & 5 deletions cl_dll/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class CHudScoreboard : public CHudBase
int m_iLastKilledBy;
int m_fLastKillTime;
int m_iPlayerNum;
int m_iShowscoresHeld;
bool m_iShowscoresHeld;
};

//
Expand Down Expand Up @@ -419,10 +419,10 @@ struct team_info_t
short deaths;
short ping;
short packetloss;
short ownteam;
bool ownteam;
short players;
int already_drawn;
int scores_overriden;
bool already_drawn;
bool scores_overriden;
int teamnumber;
};

Expand Down Expand Up @@ -1067,7 +1067,7 @@ class CHud

int m_iWeaponBits;
int m_iItemBits;
int m_fPlayerDead;
bool m_fPlayerDead;
int m_iIntermission;

// sprite indexes
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/hud_spectator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ void CHudSpectator::DrawOverviewLayer()
float screenaspect, xs, ys, xStep, yStep, x, y, z;
int ix, iy, i, xTiles, yTiles, frame;

qboolean hasMapImage = m_MapSprite ? TRUE : FALSE;
bool hasMapImage = m_MapSprite ? true : false;
model_t *dummySprite = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprUnkownMap );

if( hasMapImage )
Expand Down
4 changes: 2 additions & 2 deletions cl_dll/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void CHudMenu::InitHUDData( void )
void CHudMenu::Reset( void )
{
g_szPrelocalisedMenuString[0] = 0;
m_fWaitingForMore = FALSE;
m_fWaitingForMore = false;
}

int CHudMenu::VidInit( void )
Expand Down Expand Up @@ -195,7 +195,7 @@ int CHudMenu::MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf )
m_iFlags &= ~HUD_ACTIVE;
}

m_fWaitingForMore = NeedMore;
m_fWaitingForMore = NeedMore != 0;

return 1;
}
4 changes: 2 additions & 2 deletions cl_dll/saytext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int CHudSayText::Draw( float flTime )
int y = Y_START;

#if USE_VGUI
if( ( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) )
if( ( gViewPort && !gViewPort->AllowedToPrintText() ) )
return 1;
#endif
if ( !m_HUD_saytext->value )
Expand Down Expand Up @@ -165,7 +165,7 @@ int CHudSayText::MsgFunc_SayText( const char *pszName, int iSize, void *pbuf )
void CHudSayText::SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex )
{
#if USE_VGUI
if( gViewPort && gViewPort->AllowedToPrintText() == FALSE )
if( gViewPort && !gViewPort->AllowedToPrintText() )
{
// Print it straight to the console
ConsolePrint( pszBuf );
Expand Down
14 changes: 7 additions & 7 deletions cl_dll/scoreboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ int CHudScoreboard::Draw( float fTime )
CHud::UtfText::DrawString( xpos, ypos, xpos+50, buf, r, g, b );
}

team_info->already_drawn = TRUE; // set the already_drawn to be TRUE, so this team won't get drawn again
team_info->already_drawn = true; // set the already_drawn to be TRUE, so this team won't get drawn again
list_slot++;

// draw all the players that belong to this team, indented slightly
Expand Down Expand Up @@ -465,7 +465,7 @@ int CHudScoreboard::MsgFunc_TeamScore( const char *pszName, int iSize, void *pbu
return 1;

// use this new score data instead of combined player scores
g_TeamInfo[i].scores_overriden = TRUE;
g_TeamInfo[i].scores_overriden = true;
g_TeamInfo[i].frags = READ_SHORT();
g_TeamInfo[i].deaths = READ_SHORT();

Expand All @@ -487,12 +487,12 @@ void CHudScoreboard::DeathMsg( int killer, int victim )

void CHudScoreboard::UserCmd_ShowScores( void )
{
m_iShowscoresHeld = TRUE;
m_iShowscoresHeld = true;
}

void CHudScoreboard::UserCmd_HideScores( void )
{
m_iShowscoresHeld = FALSE;
m_iShowscoresHeld = false;
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -594,9 +594,9 @@ void CHudScoreboard::UpdateTeams()
g_TeamInfo[j].packetloss += g_PlayerInfoList[i].packetloss;

if( g_PlayerInfoList[i].thisplayer )
g_TeamInfo[j].ownteam = TRUE;
g_TeamInfo[j].ownteam = true;
else
g_TeamInfo[j].ownteam = FALSE;
g_TeamInfo[j].ownteam = false;

// Set the team's number (used for team colors)
g_TeamInfo[j].teamnumber = g_PlayerExtraInfo[i].teamnumber;
Expand All @@ -605,7 +605,7 @@ void CHudScoreboard::UpdateTeams()
// find team ping/packetloss averages
for( i = 1; i <= m_iNumTeams; i++ )
{
g_TeamInfo[i].already_drawn = FALSE;
g_TeamInfo[i].already_drawn = false;

if( g_TeamInfo[i].players > 0 )
{
Expand Down
6 changes: 3 additions & 3 deletions cl_dll/statusbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int CHudStatusBar::Draw( float fTime )
m_pflNameColors[i] = g_ColorYellow;
ParseStatusString( i );
}
m_bReparseString = FALSE;
m_bReparseString = false;
}

int Y_START = ScreenHeight - YRES( 32 + 4 );
Expand Down Expand Up @@ -237,7 +237,7 @@ int CHudStatusBar::MsgFunc_StatusText( const char *pszName, int iSize, void *pbu
else
m_iFlags |= HUD_ACTIVE; // we have status text, so turn on the status bar

m_bReparseString = TRUE;
m_bReparseString = true;

return 1;
}
Expand All @@ -256,7 +256,7 @@ int CHudStatusBar::MsgFunc_StatusValue( const char *pszName, int iSize, void *pb

m_iStatusValues[index] = READ_SHORT();

m_bReparseString = TRUE;
m_bReparseString = true;

return 1;
}
2 changes: 1 addition & 1 deletion cl_dll/text_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf
char *psz = szBuf[5];

#if USE_VGUI
if( gViewPort && gViewPort->AllowedToPrintText() == FALSE )
if( gViewPort && !gViewPort->AllowedToPrintText() )
return 1;
#endif

Expand Down
2 changes: 1 addition & 1 deletion cl_dll/vgui_ScorePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void ScorePanel::SortTeams()
// Put this team in the sorted list
m_iSortedRows[m_iRows] = best_team;
m_iIsATeam[m_iRows] = TEAM_YES;
g_TeamInfo[best_team].already_drawn = TRUE; // set the already_drawn to be TRUE, so this team won't get sorted again
g_TeamInfo[best_team].already_drawn = true; // set the already_drawn to be TRUE, so this team won't get sorted again
m_iRows++;

// Now sort all the players on this team
Expand Down
6 changes: 3 additions & 3 deletions cl_dll/vgui_TeamFortressViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1584,10 +1584,10 @@ bool TeamFortressViewport::AllowedToPrintText( void )
{
int iId = m_pCurrentMenu->GetMenuID();
if( iId == MENU_TEAM || iId == MENU_CLASS || iId == MENU_INTRO || iId == MENU_CLASSHELP )
return FALSE;
return false;
}

return TRUE;
return true;
}

//======================================================================================
Expand Down Expand Up @@ -1801,7 +1801,7 @@ bool TeamFortressViewport::SlotInput( int iSlot )
if( m_pCurrentMenu )
return m_pCurrentMenu->SlotInput( iSlot );

return FALSE;
return false;
}

// Direct Key Input
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/voice_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int CVoiceStatus::VidInit()
}

m_VoiceHeadModel = gEngfuncs.pfnSPR_Load("sprites/voiceicon.spr");
return TRUE;
return 1;
}


Expand Down

0 comments on commit cfde15f

Please sign in to comment.