diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index 281a975c6..4731e4811 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -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 ) @@ -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 @@ -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 ); @@ -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 ) @@ -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 ); @@ -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 ) diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index cf53975d2..294fbfd49 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -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 ); diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index 94871ba83..ad745d7b9 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -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; @@ -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] ); @@ -236,7 +236,7 @@ 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 ); @@ -244,10 +244,10 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu 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 diff --git a/cl_dll/hud.h b/cl_dll/hud.h index cf7853fef..ccaadaf20 100644 --- a/cl_dll/hud.h +++ b/cl_dll/hud.h @@ -367,7 +367,7 @@ class CHudScoreboard : public CHudBase int m_iLastKilledBy; int m_fLastKillTime; int m_iPlayerNum; - int m_iShowscoresHeld; + bool m_iShowscoresHeld; }; // @@ -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; }; @@ -1067,7 +1067,7 @@ class CHud int m_iWeaponBits; int m_iItemBits; - int m_fPlayerDead; + bool m_fPlayerDead; int m_iIntermission; // sprite indexes diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index 5a74bb093..cb865a4df 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -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 ) diff --git a/cl_dll/menu.cpp b/cl_dll/menu.cpp index b4e126d21..a90164d84 100644 --- a/cl_dll/menu.cpp +++ b/cl_dll/menu.cpp @@ -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 ) @@ -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; } diff --git a/cl_dll/saytext.cpp b/cl_dll/saytext.cpp index c34a556bd..851f6fcdd 100644 --- a/cl_dll/saytext.cpp +++ b/cl_dll/saytext.cpp @@ -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 ) @@ -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 ); diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index c9c1af86f..8c354cb5d 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -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 @@ -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(); @@ -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; } //----------------------------------------------------------------------------- @@ -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; @@ -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 ) { diff --git a/cl_dll/statusbar.cpp b/cl_dll/statusbar.cpp index 546941233..cec0a36ce 100644 --- a/cl_dll/statusbar.cpp +++ b/cl_dll/statusbar.cpp @@ -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 ); @@ -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; } @@ -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; } diff --git a/cl_dll/text_message.cpp b/cl_dll/text_message.cpp index 4518339d0..2bd29620f 100644 --- a/cl_dll/text_message.cpp +++ b/cl_dll/text_message.cpp @@ -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 diff --git a/cl_dll/vgui_ScorePanel.cpp b/cl_dll/vgui_ScorePanel.cpp index b059b7fbb..cab8358fd 100644 --- a/cl_dll/vgui_ScorePanel.cpp +++ b/cl_dll/vgui_ScorePanel.cpp @@ -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 diff --git a/cl_dll/vgui_TeamFortressViewport.cpp b/cl_dll/vgui_TeamFortressViewport.cpp index 157dacea1..cfc83757c 100644 --- a/cl_dll/vgui_TeamFortressViewport.cpp +++ b/cl_dll/vgui_TeamFortressViewport.cpp @@ -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; } //====================================================================================== @@ -1801,7 +1801,7 @@ bool TeamFortressViewport::SlotInput( int iSlot ) if( m_pCurrentMenu ) return m_pCurrentMenu->SlotInput( iSlot ); - return FALSE; + return false; } // Direct Key Input diff --git a/cl_dll/voice_status.cpp b/cl_dll/voice_status.cpp index e367fd644..464ea15d3 100644 --- a/cl_dll/voice_status.cpp +++ b/cl_dll/voice_status.cpp @@ -293,7 +293,7 @@ int CVoiceStatus::VidInit() } m_VoiceHeadModel = gEngfuncs.pfnSPR_Load("sprites/voiceicon.spr"); - return TRUE; + return 1; }