From 6812cbfd7a6cd8e6cfea74036200fbbb60d67091 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Mon, 11 Aug 2003 20:57:57 +0000 Subject: [PATCH] change SongEntry to UnlockEntry --- stepmania/src/ScreenSelectGroup.cpp | 2 +- stepmania/src/ScreenUnlock.cpp | 8 ++++---- stepmania/src/UnlockSystem.cpp | 24 ++++++++++++------------ stepmania/src/UnlockSystem.h | 12 ++++++------ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index 07f73c413c..9bc871d80a 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -71,7 +71,7 @@ ScreenSelectGroup::ScreenSelectGroup() : Screen("ScreenSelectGroup") // check if song is locked if (PREFSMAN->m_bUseUnlockSystem) { - SongEntry* m_UnlockSong = GAMESTATE->m_pUnlockingSys->FindSong( aAllSongs[j] ); + UnlockEntry* m_UnlockSong = GAMESTATE->m_pUnlockingSys->FindSong( aAllSongs[j] ); if (m_UnlockSong) DisplaySong = (m_UnlockSong->SelectableWheel()); diff --git a/stepmania/src/ScreenUnlock.cpp b/stepmania/src/ScreenUnlock.cpp index 7a92d4f816..ec34fd5e4f 100644 --- a/stepmania/src/ScreenUnlock.cpp +++ b/stepmania/src/ScreenUnlock.cpp @@ -68,14 +68,14 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") entry->SetName( ssprintf("Unlock%d",i) ); SET_XY( *entry ); - // get pertaining songentry + // get pertaining UnlockEntry CString SongTitle = DISPLAYED_SONG(i); if (USE_UNLOCKS_DAT == 1) if ((unsigned)i <= GAMESTATE->m_pUnlockingSys->m_SongEntries.size() ) SongTitle = GAMESTATE->m_pUnlockingSys->m_SongEntries[i-1].m_sSongName; LOG->Trace("UnlockScreen: Searching for %s", SongTitle.c_str()); - SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry( SongTitle ); + UnlockEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry( SongTitle ); if( pSong == NULL) { @@ -125,7 +125,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") DisplayedSong = GAMESTATE->m_pUnlockingSys->m_SongEntries[i-1].m_sSongName; DisplayedSong.MakeUpper(); - SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong); + UnlockEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong); if ( pSong == NULL ) // no such song continue; @@ -254,7 +254,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock") } DisplayedSong.MakeUpper(); - SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong); + UnlockEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong); /* Reset zoom before using SetTextMaxWidth. */ NewText->SetZoom(UNLOCK_TEXT_SCROLL_ZOOM); diff --git a/stepmania/src/UnlockSystem.cpp b/stepmania/src/UnlockSystem.cpp index 46aa4fd41a..4513c2cede 100644 --- a/stepmania/src/UnlockSystem.cpp +++ b/stepmania/src/UnlockSystem.cpp @@ -50,7 +50,7 @@ void UnlockSystem::RouletteUnlock( const Song *song ) if (GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2()) return; - SongEntry *p = FindSong( song ); + UnlockEntry *p = FindSong( song ); if (!p) return; // does not exist if (p->m_iRouletteSeed == 0) @@ -67,7 +67,7 @@ bool UnlockSystem::CourseIsLocked( const Course *course ) // I know, its not a song, but for purposes of title // comparison, its the same thing. - SongEntry *p = FindCourse( course ); + UnlockEntry *p = FindCourse( course ); if (p) p->UpdateLocked(); @@ -80,7 +80,7 @@ bool UnlockSystem::SongIsLocked( const Song *song ) if( !PREFSMAN->m_bUseUnlockSystem ) return false; - SongEntry *p = FindSong( song ); + UnlockEntry *p = FindSong( song ); if( p == NULL ) return false; @@ -93,12 +93,12 @@ bool UnlockSystem::SongIsLocked( const Song *song ) bool UnlockSystem::SongIsRoulette( const Song *song ) { - SongEntry *p = FindSong( song ); + UnlockEntry *p = FindSong( song ); return p && (p->m_iRouletteSeed != 0) ; } -SongEntry *UnlockSystem::FindLockEntry( CString songname ) +UnlockEntry *UnlockSystem::FindLockEntry( CString songname ) { for(unsigned i = 0; i < m_SongEntries.size(); i++) if (!songname.CompareNoCase(m_SongEntries[i].m_sSongName)) @@ -107,7 +107,7 @@ SongEntry *UnlockSystem::FindLockEntry( CString songname ) return NULL; } -SongEntry *UnlockSystem::FindSong( const Song *pSong ) +UnlockEntry *UnlockSystem::FindSong( const Song *pSong ) { for(unsigned i = 0; i < m_SongEntries.size(); i++) if (m_SongEntries[i].m_pSong == pSong ) @@ -116,7 +116,7 @@ SongEntry *UnlockSystem::FindSong( const Song *pSong ) return NULL; } -SongEntry *UnlockSystem::FindCourse( const Course *pCourse ) +UnlockEntry *UnlockSystem::FindCourse( const Course *pCourse ) { for(unsigned i = 0; i < m_SongEntries.size(); i++) if (m_SongEntries[i].m_pCourse== pCourse ) @@ -126,7 +126,7 @@ SongEntry *UnlockSystem::FindCourse( const Course *pCourse ) } -SongEntry::SongEntry() +UnlockEntry::UnlockEntry() { m_fDancePointsRequired = 0; m_fArcadePointsRequired = 0; @@ -144,7 +144,7 @@ SongEntry::SongEntry() } -void SongEntry::UpdateLocked() +void UnlockEntry::UpdateLocked() { if (!isLocked) return; @@ -215,7 +215,7 @@ bool UnlockSystem::LoadFromDATFile( CString sPath ) continue; } - SongEntry current; + UnlockEntry current; current.m_sSongName = sParams[1]; LOG->Trace("Song entry: %s", current.m_sSongName.c_str() ); @@ -288,12 +288,12 @@ bool UnlockSystem::LoadFromDATFile( CString sPath ) return true; } -bool SongEntry::SelectableWheel() +bool UnlockEntry::SelectableWheel() { return (!isLocked); // cached } -bool SongEntry::SelectableRoulette() +bool UnlockEntry::SelectableRoulette() { if (!isLocked) return true; diff --git a/stepmania/src/UnlockSystem.h b/stepmania/src/UnlockSystem.h index c008c303e3..9016dad124 100644 --- a/stepmania/src/UnlockSystem.h +++ b/stepmania/src/UnlockSystem.h @@ -19,9 +19,9 @@ enum UnlockTypes { UNLOCK_AP, UNLOCK_DP, UNLOCK_SP, class Song; -struct SongEntry +struct UnlockEntry { - SongEntry(); + UnlockEntry(); CString m_sSongName; @@ -70,7 +70,7 @@ public: bool LoadFromDATFile( CString sPath ); // All locked songs are stored here - vector m_SongEntries; + vector m_SongEntries; // Gets number of unlocks for title screen int GetNumUnlocks() const; @@ -105,13 +105,13 @@ public: void UpdateSongs(); - SongEntry *FindLockEntry( CString lockname ); + UnlockEntry *FindLockEntry( CString lockname ); // so class can access FindSong friend class ScreenSelectGroup; private: - SongEntry *FindSong( const Song *pSong ); - SongEntry *FindCourse( const Course *pCourse ); + UnlockEntry *FindSong( const Song *pSong ); + UnlockEntry *FindCourse( const Course *pCourse ); void InitRouletteSeeds(int MaxRouletteSlot); // makes RouletteSeeds more efficient