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