change SongEntry to UnlockEntry

This commit is contained in:
Andrew Wong
2003-08-11 20:57:57 +00:00
parent c94325c088
commit 6812cbfd7a
4 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ ScreenSelectGroup::ScreenSelectGroup() : Screen("ScreenSelectGroup")
// check if song is locked // check if song is locked
if (PREFSMAN->m_bUseUnlockSystem) 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) if (m_UnlockSong)
DisplaySong = (m_UnlockSong->SelectableWheel()); DisplaySong = (m_UnlockSong->SelectableWheel());
+4 -4
View File
@@ -68,14 +68,14 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
entry->SetName( ssprintf("Unlock%d",i) ); entry->SetName( ssprintf("Unlock%d",i) );
SET_XY( *entry ); SET_XY( *entry );
// get pertaining songentry // get pertaining UnlockEntry
CString SongTitle = DISPLAYED_SONG(i); CString SongTitle = DISPLAYED_SONG(i);
if (USE_UNLOCKS_DAT == 1) if (USE_UNLOCKS_DAT == 1)
if ((unsigned)i <= GAMESTATE->m_pUnlockingSys->m_SongEntries.size() ) if ((unsigned)i <= GAMESTATE->m_pUnlockingSys->m_SongEntries.size() )
SongTitle = GAMESTATE->m_pUnlockingSys->m_SongEntries[i-1].m_sSongName; SongTitle = GAMESTATE->m_pUnlockingSys->m_SongEntries[i-1].m_sSongName;
LOG->Trace("UnlockScreen: Searching for %s", SongTitle.c_str()); 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) if( pSong == NULL)
{ {
@@ -125,7 +125,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
DisplayedSong = GAMESTATE->m_pUnlockingSys->m_SongEntries[i-1].m_sSongName; DisplayedSong = GAMESTATE->m_pUnlockingSys->m_SongEntries[i-1].m_sSongName;
DisplayedSong.MakeUpper(); DisplayedSong.MakeUpper();
SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong); UnlockEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong);
if ( pSong == NULL ) // no such song if ( pSong == NULL ) // no such song
continue; continue;
@@ -254,7 +254,7 @@ ScreenUnlock::ScreenUnlock() : ScreenAttract("ScreenUnlock")
} }
DisplayedSong.MakeUpper(); DisplayedSong.MakeUpper();
SongEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong); UnlockEntry *pSong = GAMESTATE->m_pUnlockingSys->FindLockEntry(DisplayedSong);
/* Reset zoom before using SetTextMaxWidth. */ /* Reset zoom before using SetTextMaxWidth. */
NewText->SetZoom(UNLOCK_TEXT_SCROLL_ZOOM); NewText->SetZoom(UNLOCK_TEXT_SCROLL_ZOOM);
+12 -12
View File
@@ -50,7 +50,7 @@ void UnlockSystem::RouletteUnlock( const Song *song )
if (GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2()) if (GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2())
return; return;
SongEntry *p = FindSong( song ); UnlockEntry *p = FindSong( song );
if (!p) if (!p)
return; // does not exist return; // does not exist
if (p->m_iRouletteSeed == 0) 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 // I know, its not a song, but for purposes of title
// comparison, its the same thing. // comparison, its the same thing.
SongEntry *p = FindCourse( course ); UnlockEntry *p = FindCourse( course );
if (p) if (p)
p->UpdateLocked(); p->UpdateLocked();
@@ -80,7 +80,7 @@ bool UnlockSystem::SongIsLocked( const Song *song )
if( !PREFSMAN->m_bUseUnlockSystem ) if( !PREFSMAN->m_bUseUnlockSystem )
return false; return false;
SongEntry *p = FindSong( song ); UnlockEntry *p = FindSong( song );
if( p == NULL ) if( p == NULL )
return false; return false;
@@ -93,12 +93,12 @@ bool UnlockSystem::SongIsLocked( const Song *song )
bool UnlockSystem::SongIsRoulette( const Song *song ) bool UnlockSystem::SongIsRoulette( const Song *song )
{ {
SongEntry *p = FindSong( song ); UnlockEntry *p = FindSong( song );
return p && (p->m_iRouletteSeed != 0) ; 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++) for(unsigned i = 0; i < m_SongEntries.size(); i++)
if (!songname.CompareNoCase(m_SongEntries[i].m_sSongName)) if (!songname.CompareNoCase(m_SongEntries[i].m_sSongName))
@@ -107,7 +107,7 @@ SongEntry *UnlockSystem::FindLockEntry( CString songname )
return NULL; return NULL;
} }
SongEntry *UnlockSystem::FindSong( const Song *pSong ) UnlockEntry *UnlockSystem::FindSong( const Song *pSong )
{ {
for(unsigned i = 0; i < m_SongEntries.size(); i++) for(unsigned i = 0; i < m_SongEntries.size(); i++)
if (m_SongEntries[i].m_pSong == pSong ) if (m_SongEntries[i].m_pSong == pSong )
@@ -116,7 +116,7 @@ SongEntry *UnlockSystem::FindSong( const Song *pSong )
return NULL; return NULL;
} }
SongEntry *UnlockSystem::FindCourse( const Course *pCourse ) UnlockEntry *UnlockSystem::FindCourse( const Course *pCourse )
{ {
for(unsigned i = 0; i < m_SongEntries.size(); i++) for(unsigned i = 0; i < m_SongEntries.size(); i++)
if (m_SongEntries[i].m_pCourse== pCourse ) 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_fDancePointsRequired = 0;
m_fArcadePointsRequired = 0; m_fArcadePointsRequired = 0;
@@ -144,7 +144,7 @@ SongEntry::SongEntry()
} }
void SongEntry::UpdateLocked() void UnlockEntry::UpdateLocked()
{ {
if (!isLocked) if (!isLocked)
return; return;
@@ -215,7 +215,7 @@ bool UnlockSystem::LoadFromDATFile( CString sPath )
continue; continue;
} }
SongEntry current; UnlockEntry current;
current.m_sSongName = sParams[1]; current.m_sSongName = sParams[1];
LOG->Trace("Song entry: %s", current.m_sSongName.c_str() ); LOG->Trace("Song entry: %s", current.m_sSongName.c_str() );
@@ -288,12 +288,12 @@ bool UnlockSystem::LoadFromDATFile( CString sPath )
return true; return true;
} }
bool SongEntry::SelectableWheel() bool UnlockEntry::SelectableWheel()
{ {
return (!isLocked); // cached return (!isLocked); // cached
} }
bool SongEntry::SelectableRoulette() bool UnlockEntry::SelectableRoulette()
{ {
if (!isLocked) return true; if (!isLocked) return true;
+6 -6
View File
@@ -19,9 +19,9 @@ enum UnlockTypes { UNLOCK_AP, UNLOCK_DP, UNLOCK_SP,
class Song; class Song;
struct SongEntry struct UnlockEntry
{ {
SongEntry(); UnlockEntry();
CString m_sSongName; CString m_sSongName;
@@ -70,7 +70,7 @@ public:
bool LoadFromDATFile( CString sPath ); bool LoadFromDATFile( CString sPath );
// All locked songs are stored here // All locked songs are stored here
vector<SongEntry> m_SongEntries; vector<UnlockEntry> m_SongEntries;
// Gets number of unlocks for title screen // Gets number of unlocks for title screen
int GetNumUnlocks() const; int GetNumUnlocks() const;
@@ -105,13 +105,13 @@ public:
void UpdateSongs(); void UpdateSongs();
SongEntry *FindLockEntry( CString lockname ); UnlockEntry *FindLockEntry( CString lockname );
// so class can access FindSong // so class can access FindSong
friend class ScreenSelectGroup; friend class ScreenSelectGroup;
private: private:
SongEntry *FindSong( const Song *pSong ); UnlockEntry *FindSong( const Song *pSong );
SongEntry *FindCourse( const Course *pCourse ); UnlockEntry *FindCourse( const Course *pCourse );
void InitRouletteSeeds(int MaxRouletteSlot); void InitRouletteSeeds(int MaxRouletteSlot);
// makes RouletteSeeds more efficient // makes RouletteSeeds more efficient