Cleanup. Do not use == true or == false.

This commit is contained in:
Steve Checkoway
2004-09-06 21:28:56 +00:00
parent 1ec7e317ad
commit 27d4678adf
11 changed files with 48 additions and 43 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ void GrooveRadar::GrooveRadarValueMap::SetFromSteps( PlayerNumber pn, Steps* pSt
m_fValuesNew[pn][c] = pSteps->GetRadarValues()[c];
}
if( m_bValuesVisible[pn] == false ) // the values WERE invisible
if( !m_bValuesVisible[pn] ) // the values WERE invisible
m_PercentTowardNew[pn] = 1;
else
m_PercentTowardNew[pn] = 0;
+9 -9
View File
@@ -244,13 +244,13 @@ void StepManiaLanServer::CheckReady()
int x;
//Only check clients that are starting (after ScreenNetMusicSelect before InGame).
for (x = 0; (x < NUMBERCLIENTS)&&(canStart == true); ++x)
if (Client[x].Used == true)
for (x = 0; (x < NUMBERCLIENTS)&& canStart; ++x)
if (Client[x].Used)
if (Client[x].isStarting)
if (Client[x].GotStartRequest == false)
if (!Client[x].GotStartRequest)
canStart = false;
if (canStart == true)
if (canStart)
{
//(Test this)
//For whatever reason we need to pause in a way
@@ -291,9 +291,9 @@ void StepManiaLanServer::GameOver(PacketFunctions& Packet, int clientNum)
Client[clientNum].InGame = false;
Client[clientNum].wasIngame = true;
for (x = 0; (x < NUMBERCLIENTS)&&(allOver == true); ++x)
if (Client[x].Used == true)
if ((Client[x].InGame == true))
for (x = 0; (x < NUMBERCLIENTS)&&allOver ; ++x)
if (Client[x].Used)
if (Client[x].InGame)
allOver = false;
//Wait untill everyone is done before sending
@@ -350,7 +350,7 @@ int StepManiaLanServer::SortStats(LanPlayer *playersPtr[])
//Populate with in game players only
for (int x = 0; x < NUMBERCLIENTS; ++x)
if (Client[x].Used == true)
if (Client[x].Used)
if (Client[x].InGame||Client[x].wasIngame)
for (int y = 0; y < 2; ++y)
if (Client[x].IsPlaying(y))
@@ -565,7 +565,7 @@ void StepManiaLanServer::SelectSong(PacketFunctions& Packet, int clientNum)
if (strcmp(CurrentSongInfo.artist, LastSongInfo.artist) == 0)
SecondSameSelect = true;
if (SecondSameSelect == false)
if (!SecondSameSelect)
{
LastSongInfo.title = CurrentSongInfo.title;
LastSongInfo.artist = CurrentSongInfo.artist;
+5 -4
View File
@@ -1,3 +1,4 @@
#include "global.h"
#include "ScreenNetEvaluation.h"
#include "ThemeManager.h"
#include "GameState.h"
@@ -50,7 +51,7 @@ ScreenNetEvaluation::ScreenNetEvaluation (const CString & sClassName) : ScreenEv
m_iActivePlayers = NSMAN->m_ActivePlayers;
m_iCurrentPlayer = 0;
for( int i=0; i<m_iActivePlayers; i++ )
for( int i=0; i<m_iActivePlayers; ++i )
{
m_textUsers[i].LoadFromFont( THEME->GetPathF(m_sName,"names") );
m_textUsers[i].SetName( "User" );
@@ -100,7 +101,7 @@ void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM )
{
case SM_GotEval:
m_bHasStats = true;
for( int i=0; i<m_iActivePlayers; i++ )
for( int i=0; i<m_iActivePlayers; ++i )
{
m_textUsers[i].SetText( NSMAN->m_PlayerNames[NSMAN->m_EvalPlayerData[i].name] );
ON_COMMAND( m_textUsers[i] );
@@ -115,7 +116,7 @@ void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM )
void ScreenNetEvaluation::TweenOffScreen( )
{
for( int i=0; i<m_iActivePlayers; i++ )
for( int i=0; i<m_iActivePlayers; ++i )
OFF_COMMAND( m_textUsers[i] );
OFF_COMMAND( m_rectUsersBG );
ScreenEvaluation::TweenOffScreen();
@@ -131,7 +132,7 @@ void ScreenNetEvaluation::UpdateStats()
m_DifficultyIcon[m_pActivePlayer].SetFromDifficulty( m_pActivePlayer, NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty );
for (int j=0;j<NETNUMTAPSCORES;j++)
for (int j=0; j<NETNUMTAPSCORES; ++j)
{
int iNumDigits = (j==max_combo) ? MAX_COMBO_NUM_DIGITS : 4;
m_textJudgeNumbers[j][m_pActivePlayer].SetText( ssprintf( "%*d", iNumDigits, NSMAN->m_EvalPlayerData[m_iCurrentPlayer].tapScores[j] ) );
+1 -3
View File
@@ -1,5 +1,3 @@
#include "global.h"
#include "Screen.h"
#include "ScreenEvaluation.h"
#include "NetworkSyncManager.h"
#include "Quad.h"
@@ -9,7 +7,7 @@
class ScreenNetEvaluation: public ScreenEvaluation
{
public:
ScreenNetEvaluation (const CString & sClassName);
ScreenNetEvaluation (const CString& sClassName);
protected:
virtual void MenuLeft( PlayerNumber pn, const InputEventType type );
virtual void MenuUp( PlayerNumber pn, const InputEventType type );
+15 -11
View File
@@ -177,7 +177,9 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenWithM
FOREACH_EnabledPlayer (p)
{
m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) );
m_DifficultyIcon[p].Load( THEME->GetPathG( "ScreenSelectMusic" ,ssprintf("difficulty icons 1x%d",NUM_DIFFICULTIES)) );
m_DifficultyIcon[p].Load( THEME->GetPathG( "ScreenSelectMusic",
ssprintf("difficulty icons 1x%d",
NUM_DIFFICULTIES)) );
SET_XY( m_DifficultyIcon[p] );
this->AddChild( &m_DifficultyIcon[p] );
ON_COMMAND( m_DifficultyIcon[p] );
@@ -233,7 +235,9 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenWithM
return;
}
void ScreenNetSelectMusic::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
void ScreenNetSelectMusic::Input( const DeviceInput& DeviceI, const InputEventType type,
const GameInput& GameI, const MenuInput& MenuI,
const StyleInput& StyleI )
{
if( m_In.IsTransitioning() || m_Out.IsTransitioning() )
return;
@@ -272,7 +276,7 @@ void ScreenNetSelectMusic::Input( const DeviceInput& DeviceI, const InputEventTy
char c;
c = DeviceI.ToChar();
if( bHoldingShift && (!bHoldingCtrl) )
if( bHoldingShift && !bHoldingCtrl )
{
c = (char)toupper(c);
@@ -307,8 +311,7 @@ void ScreenNetSelectMusic::Input( const DeviceInput& DeviceI, const InputEventTy
if( bHoldingCtrl )
{
c = (char)toupper(c);
int i;
for (i=0;i<(int)m_vSongs.size();i++)
for (int i=0; i<(int)m_vSongs.size(); ++i)
if ( (char) toupper(m_vSongs[i]->GetTranslitMainTitle().c_str()[0]) == (char) c )
{
m_iSongNum = i;
@@ -435,7 +438,7 @@ void ScreenNetSelectMusic::MenuLeft( PlayerNumber pn, const InputEventType type
m_DC[pn] = NUM_DIFFICULTIES;
else
{
for ( i=0; i<(int)MultiSteps.size(); i++ )
for ( i=0; i<(int)MultiSteps.size(); ++i )
if ( MultiSteps[i]->GetDifficulty() >= m_DC[pn] )
break;
@@ -483,7 +486,7 @@ void ScreenNetSelectMusic::MenuRight( PlayerNumber pn, const InputEventType type
m_DC[pn] = NUM_DIFFICULTIES;
else
{
for ( i=0; i<(int)MultiSteps.size(); i++ )
for ( i=0; i<(int)MultiSteps.size(); ++i )
if ( MultiSteps[i]->GetDifficulty() >= m_DC[pn] )
break;
@@ -532,7 +535,8 @@ void ScreenNetSelectMusic::MenuStart( PlayerNumber pn )
NSMAN->m_sSubTitle = m_vSongs[j]->GetTranslitSubTitle();
NSMAN->m_iSelectMode = 2; //Command for user selecting song
NSMAN->SelectUserSong ();
} else
}
else
StartSelectedSong();
}
@@ -622,7 +626,7 @@ void ScreenNetSelectMusic::UpdateSongsListPos()
if (m_iSongNum<m_iShowSongs)
m_iSongNum+=m_vSongs.size();
CString SongsDisplay="";
for (i=m_iSongNum-m_iShowSongs;i<=m_iSongNum+m_iShowSongs;i++)
for (i=m_iSongNum-m_iShowSongs; i<=m_iSongNum+m_iShowSongs; ++i)
{
j= i % m_vSongs.size();
SongsDisplay+=m_vSongs.at(j)->GetTranslitMainTitle();
@@ -649,7 +653,7 @@ void ScreenNetSelectMusic::UpdateSongsListPos()
m_DC[pn] = NUM_DIFFICULTIES;
else
{
for ( i=0; i<(int)MultiSteps.size(); i++ )
for ( i=0; i<(int)MultiSteps.size(); ++i )
if ( MultiSteps[i]->GetDifficulty() >= m_DC[pn] )
break;
@@ -684,7 +688,7 @@ void ScreenNetSelectMusic::UpdateGroupsListPos()
if (m_iGroupNum<m_iShowGroups)
m_iGroupNum+=m_vGroups.size();
CString GroupsDisplay="";
for (i=m_iGroupNum-m_iShowGroups;i<=m_iGroupNum+m_iShowGroups;i++)
for (i=m_iGroupNum-m_iShowGroups; i<=m_iGroupNum+m_iShowGroups; ++i)
{
j=i%m_vGroups.size();
GroupsDisplay+=m_vGroups[j];
+3 -1
View File
@@ -21,7 +21,9 @@ public:
virtual void DrawPrimitives();
virtual void Update( float fDeltaTime );
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void Input( const DeviceInput& DeviceI, const InputEventType type,
const GameInput& GameI, const MenuInput& MenuI,
const StyleInput& StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
void UpdateSongsListPos();
+1 -1
View File
@@ -119,7 +119,7 @@ void ScreenNetworkOptions::MenuStart( PlayerNumber pn, const InputEventType type
switch (m_Rows[GetCurrentRow()]->GetOneSharedSelection())
{
case NO_START_SERVER:
if (NSMAN->isLanServer == false)
if (!NSMAN->isLanServer)
SCREENMAN->TextEntry( SM_ServerNameEnter, "Enter a server name...", "", NULL );
break;
case NO_STOP_SERVER:
+1 -1
View File
@@ -384,7 +384,7 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo
if( !row.bMultiSelect )
{
// The first row ("go down") should not be selected.
ASSERT( vbSelectedOut[0] == false );
ASSERT( !vbSelectedOut[0] );
// there should be exactly one option selected
int iNumSelected = 0;
+2 -2
View File
@@ -360,7 +360,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
{
if( m_fLockInputTime > 0 )
return;
if( m_bChosen[pn] == true )
if( m_bChosen[pn] )
return;
m_bChosen[pn] = true;
@@ -480,7 +480,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
// check to see if everyone has chosen
FOREACH_HumanPlayer( p )
{
if( m_bChosen[p] == false )
if( !m_bChosen[p] )
return;
}
this->PostScreenMessage( SM_BeginFadingOut, SLEEP_AFTER_CHOICE_SECONDS ); // tell our owner it's time to move on
+2 -2
View File
@@ -565,7 +565,7 @@ ScreenSelectMaster::Page ScreenSelectMaster::GetCurrentPage() const
float ScreenSelectMaster::DoMenuStart( PlayerNumber pn )
{
if( m_bChosen[pn] == true )
if( m_bChosen[pn] )
return 0;
m_bChosen[pn] = true;
@@ -590,7 +590,7 @@ void ScreenSelectMaster::MenuStart( PlayerNumber pn )
{
if( m_fLockInputSecs > 0 )
return;
if( m_bChosen[pn] == true )
if( m_bChosen[pn] )
return;
ModeChoice &mc = m_aModeChoices[m_iChoice[pn]];
+8 -8
View File
@@ -209,7 +209,7 @@ char* XNode::LoadAttributes( const char* pszAttrs , PARSEINFO *pi /*= &piDefault
if( pEnd == NULL )
{
// error
if( pi->erorr_occur == false )
if( !pi->erorr_occur )
{
pi->erorr_occur = true;
pi->error_pointer = xml;
@@ -331,7 +331,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
else
{
// error: <TAG ... / >
if( pi->erorr_occur == false )
if( !pi->erorr_occur )
{
pi->erorr_occur = true;
pi->error_pointer = xml;
@@ -354,7 +354,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
char* pEnd = tcsechr( ++xml, chXMLTagOpen, chXMLEscape );
if( pEnd == NULL )
{
if( pi->erorr_occur == false )
if( !pi->erorr_occur )
{
pi->erorr_occur = true;
pi->error_pointer = xml;
@@ -383,7 +383,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
node->parent = this;
xml = node->Load( xml,pi );
if( node->name.empty() == false )
if( !node->name.empty() )
{
childs.push_back( node );
}
@@ -408,7 +408,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
char* pEnd = strpbrk( xml, " >" );
if( pEnd == NULL )
{
if( pi->erorr_occur == false )
if( !pi->erorr_occur )
{
pi->erorr_occur = true;
pi->error_pointer = xml;
@@ -430,7 +430,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
{
xml = pEnd+1;
// not welformed open/close
if( pi->erorr_occur == false )
if( !pi->erorr_occur )
{
pi->erorr_occur = true;
pi->error_pointer = xml;
@@ -453,7 +453,7 @@ char* XNode::Load( const char* pszXml, PARSEINFO *pi /*= &piDefault*/ )
if( pEnd == NULL )
{
// error cos not exist CloseTag </TAG>
if( pi->erorr_occur == false )
if( !pi->erorr_occur )
{
pi->erorr_occur = true;
pi->error_pointer = xml;
@@ -522,7 +522,7 @@ bool XNode::GetXML( RageFile &f, DISP_OPT *opt /*= &optDefault*/ )
return false;
// <TAG Attr1="Val1"
if( attrs.empty() == false )
if( !attrs.empty() )
if( f.Write(" ") == -1 )
return false;
for( unsigned i = 0 ; i < attrs.size(); i++ )