fix ambiguous ?: types

This commit is contained in:
Glenn Maynard
2004-08-06 21:01:28 +00:00
parent 6c56149963
commit 0c4f092fd3
19 changed files with 29 additions and 28 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ void BPMDisplay::Update( float fDeltaTime )
if(m_fBPMTo == -1)
{
m_fBPMFrom = -1;
m_textBPM.SetText( (RandomFloat(0,1)>0.90) ? "xxx" : ssprintf("%03.0f",RandomFloat(0,600)) );
m_textBPM.SetText( (RandomFloat(0,1)>0.90) ? CString("xxx") : ssprintf("%03.0f",RandomFloat(0,600)) );
} else if(m_fBPMFrom == -1)
m_fBPMFrom = m_fBPMTo;
}
+2 -2
View File
@@ -42,12 +42,12 @@ void CourseEntryDisplay::Load()
if( !SEPARATE_COURSE_METERS && pn != GAMESTATE->m_MasterPlayerNumber )
continue; // skip
m_textFoot[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("FootP%i", pn+1):"Foot" );
m_textFoot[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("FootP%i", pn+1):CString("Foot") );
m_textFoot[pn].LoadFromTextureAndChars( THEME->GetPathToG("CourseEntryDisplay difficulty 2x1"),"10" );
SET_XY_AND_ON_COMMAND( &m_textFoot[pn] );
this->AddChild( &m_textFoot[pn] );
m_textDifficultyNumber[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("DifficultyP%i", pn+1):"Difficulty" );
m_textDifficultyNumber[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("DifficultyP%i", pn+1):CString("Difficulty") );
m_textDifficultyNumber[pn].LoadFromFont( THEME->GetPathToF("Common normal") );
SET_XY_AND_ON_COMMAND( &m_textDifficultyNumber[pn] );
this->AddChild( &m_textDifficultyNumber[pn] );
+3 -3
View File
@@ -434,7 +434,7 @@ void EditCoursesMenu::OnRowValueChanged( Row row )
// fall through
case ROW_ENTRY_TYPE:
CHECKPOINT;
m_textValue[ROW_ENTRY_TYPE].SetText( pEntry ? CourseEntryTypeToString(pEntry->type) : "(none)" );
m_textValue[ROW_ENTRY_TYPE].SetText( pEntry ? CourseEntryTypeToString(pEntry->type) : CString("(none)") );
// fall through
case ROW_ENTRY_OPTIONS:
CHECKPOINT;
@@ -443,9 +443,9 @@ void EditCoursesMenu::OnRowValueChanged( Row row )
const bool *bShow = g_bRowEnabledForType[GetSelectedEntry()->type];
if( bShow[song] )
as.push_back( pEntry->pSong ? pEntry->pSong->GetFullTranslitTitle() : "(missing song)" );
as.push_back( pEntry->pSong ? pEntry->pSong->GetFullTranslitTitle() : CString("(missing song)") );
if( bShow[group] )
as.push_back( pEntry->group_name.empty() ? "(no group)" : pEntry->group_name );
as.push_back( pEntry->group_name.empty() ? CString("(no group)") : pEntry->group_name );
if( bShow[difficulty] )
if( pEntry->difficulty != DIFFICULTY_INVALID )
as.push_back( DifficultyToString(pEntry->difficulty) );
+1 -1
View File
@@ -277,7 +277,7 @@ void EditCoursesSongMenu::OnRowValueChanged( Row row )
// fall through
case ROW_SONG:
CHECKPOINT;
m_textValue[ROW_SONG].SetText( pSong? pSong->GetTranslitMainTitle():"" );
m_textValue[ROW_SONG].SetText( pSong? pSong->GetTranslitMainTitle():CString("") );
// fall through
case ROW_TYPE:
+1
View File
@@ -49,6 +49,7 @@ GameState::GameState()
ReloadCharacters();
m_iNumTimesThroughAttract = -1; // initial screen will bump this up to 0
m_iRoundSeed = m_iGameSeed = 0;
/* Don't reset yet; let the first screen do it, so we can
* use PREFSMAN and THEME. */
+1 -1
View File
@@ -38,7 +38,7 @@ XNode* HighScore::CreateNode() const
pNode->name = "HighScore";
// TRICKY: Don't write "name to fill in" markers.
pNode->AppendChild( "Name", IsRankingToFillIn(sName) ? "" : sName );
pNode->AppendChild( "Name", IsRankingToFillIn(sName) ? CString("") : sName );
pNode->AppendChild( "Grade", GradeToString(grade) );
pNode->AppendChild( "Score", iScore );
pNode->AppendChild( "PercentDP", fPercentDP );
+1 -1
View File
@@ -468,7 +468,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
sParams[1],
sParams[2],
sParams[3],
(iNumParams==5) ? sParams[4] : "",
(iNumParams==5) ? sParams[4] : CString(""),
*pNewNotes
);
if(pNewNotes->m_StepsType != STEPS_TYPE_INVALID)
+2 -2
View File
@@ -347,7 +347,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
}
LoadFromSMTokens(
sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6], (iNumParams>=8)?sParams[7]:"",
sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6], (iNumParams>=8)?sParams[7]:CString(""),
*pNewNotes);
out.AddSteps( pNewNotes );
@@ -445,7 +445,7 @@ bool SMLoader::LoadEdit( CString sEditFilePath, ProfileSlot slot )
}
LoadFromSMTokens(
sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6], (iNumParams>=8)?sParams[7]:"",
sParams[1], sParams[2], sParams[3], sParams[4], sParams[5], sParams[6], (iNumParams>=8)?sParams[7]:CString(""),
*pNewNotes);
pNewNotes->SetLoadedFromProfile( slot );
+1 -1
View File
@@ -51,7 +51,7 @@ void OptionIcon::Load( PlayerNumber pn, CString sText, bool bHeader )
int iState = pn*3 + (bHeader?0:(bVacant?1:2));
m_spr.SetState( iState );
m_text.SetText( bHeader ? "" : sText );
m_text.SetText( bHeader ? CString("") : sText );
m_text.SetZoom( TEXT_ZOOM );
m_text.CropToWidth( TEXT_WIDTH );
}
+1 -1
View File
@@ -65,7 +65,7 @@ static CString AddPart( float level, CString name )
if( level == 0 )
return "";
const CString LevelStr = (level == 1)? "": ssprintf( "%i%% ", (int) roundf(level*100) );
const CString LevelStr = (level == 1)? CString(""): ssprintf( "%i%% ", (int) roundf(level*100) );
return LevelStr + name + ", ";
}
+1 -1
View File
@@ -239,7 +239,7 @@ const Profile* ProfileManager::GetProfile( PlayerNumber pn ) const
CString ProfileManager::GetPlayerName( PlayerNumber pn ) const
{
const Profile *prof = GetProfile( pn );
return prof ? prof->GetDisplayName() : "";
return prof ? prof->GetDisplayName() : CString("");
}
+1 -1
View File
@@ -163,7 +163,7 @@ ScreenEnding::ScreenEnding( CString sClassName ) : ScreenAttract( sClassName, fa
Profile* pProfile = PROFILEMAN->GetProfile( p );
m_textPlayerName[p].LoadFromFont( THEME->GetPathToF("ScreenEnding player name") );
m_textPlayerName[p].SetText( pProfile ? pProfile->GetDisplayName() : "NO CARD" );
m_textPlayerName[p].SetText( pProfile ? pProfile->GetDisplayName() : CString("NO CARD") );
m_textPlayerName[p].SetName( ssprintf("PlayerNameP%d",p+1) );
SET_XY_AND_ON_COMMAND( m_textPlayerName[p] );
this->AddChild( &m_textPlayerName[p] );
+1 -1
View File
@@ -930,7 +930,7 @@ void ScreenEvaluation::CommitScores(
hs.fSurviveSeconds = stageStats.fAliveSeconds[p];
hs.sModifiers = GAMESTATE->m_PlayerOptions[p].GetString();
hs.dateTime = DateTime::GetNowDateTime();
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : "";
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : CString("");
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
hs.iProductID = PREFSMAN->m_iProductID;
memcpy( hs.iTapNoteScores, stageStats.iTapNoteScores[p], sizeof(hs.iTapNoteScores) );
+1 -1
View File
@@ -90,7 +90,7 @@ ScreenMiniMenu::ScreenMiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMes
ASSERT_M( line.choices.empty() || line.defaultChoice < (int) line.choices.size(),
ssprintf("%i, %i", line.defaultChoice, (int) line.choices.size()) );
CString sText = line.choices.empty() ? "" : line.choices[line.defaultChoice];
CString sText = line.choices.empty() ? CString("") : line.choices[line.defaultChoice];
m_textAnswer[i].SetText( sText );
if( !bMarkedFirstEnabledLine && line.enabled )
+1 -1
View File
@@ -167,7 +167,7 @@ static void Announcer( int &sel, bool ToSel, const CStringArray &choices )
if( !stricmp(choices[i], ANNOUNCER->GetCurAnnouncerName()) )
sel = i;
} else {
const CString sNewAnnouncer = sel? choices[sel]:"";
const CString sNewAnnouncer = sel? choices[sel]:CString("");
ANNOUNCER->SwitchAnnouncer( sNewAnnouncer );
}
}
+1 -1
View File
@@ -214,7 +214,7 @@ void ScreenTextEntry::MenuStart( PlayerNumber pn )
}
s_bCancelledLast = m_bCancelled;
s_sLastAnswer = m_bCancelled ? "" : WStringToCString(m_sAnswer);
s_sLastAnswer = m_bCancelled ? CString("") : WStringToCString(m_sAnswer);
}
void ScreenTextEntry::MenuBack( PlayerNumber pn )
+1 -1
View File
@@ -111,7 +111,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
m_textMaxStages.Command( MAX_STAGES_ON_COMMAND );
CString sText =
PREFSMAN->m_bEventMode ?
"event mode" :
CString("event mode") :
ssprintf( "%d %s%s max", PREFSMAN->m_iNumArcadeStages, MAX_STAGES_TEXT.c_str(), (PREFSMAN->m_iNumArcadeStages>1)?"s":"" );
m_textMaxStages.SetText( sText );
this->AddChild( &m_textMaxStages );
+2 -2
View File
@@ -605,8 +605,8 @@ void SongManager::InitAutogenCourses()
vector<Song *> aSongs;
unsigned i = 0;
do {
CString sArtist = i >= apSongs.size()? "": apSongs[i]->GetDisplayArtist();
CString sTranslitArtist = i >= apSongs.size()? "": apSongs[i]->GetTranslitArtist();
CString sArtist = i >= apSongs.size()? CString(""): apSongs[i]->GetDisplayArtist();
CString sTranslitArtist = i >= apSongs.size()? CString(""): apSongs[i]->GetTranslitArtist();
if( i < apSongs.size() && !sCurArtist.CompareNoCase(sArtist) )
{
aSongs.push_back( apSongs[i] );
+6 -6
View File
@@ -85,12 +85,12 @@ void TextBanner::LoadFromSong( const Song* pSong )
{
Init();
CString sDisplayTitle = pSong ? pSong->GetDisplayMainTitle() : "";
CString sTranslitTitle = pSong ? pSong->GetTranslitMainTitle() : "";
CString sDisplaySubTitle = pSong ? pSong->GetDisplaySubTitle() : "";
CString sTranslitSubTitle = pSong ? pSong->GetTranslitSubTitle() : "";
CString sDisplayArtist = pSong ? (CString)ARTIST_PREPEND_STRING + pSong->GetDisplayArtist() : "";
CString sTranslitArtist = pSong ? (CString)ARTIST_PREPEND_STRING + pSong->GetTranslitArtist() : "";
CString sDisplayTitle = pSong ? pSong->GetDisplayMainTitle() : CString("");
CString sTranslitTitle = pSong ? pSong->GetTranslitMainTitle() : CString("");
CString sDisplaySubTitle = pSong ? pSong->GetDisplaySubTitle() : CString("");
CString sTranslitSubTitle = pSong ? pSong->GetTranslitSubTitle() : CString("");
CString sDisplayArtist = pSong ? (CString)ARTIST_PREPEND_STRING + pSong->GetDisplayArtist() : CString("");
CString sTranslitArtist = pSong ? (CString)ARTIST_PREPEND_STRING + pSong->GetTranslitArtist() : CString("");
LoadFromString(
sDisplayTitle, sTranslitTitle,