ScreenSelectMaxType2 had a small veriable error that would not let it compile.. renamed p to pl is all..nuthin big

This commit is contained in:
Kevin Slaughter
2003-03-08 08:03:22 +00:00
parent 1d72329ba7
commit 69d97d461b
8 changed files with 140 additions and 27 deletions
+29 -11
View File
@@ -106,6 +106,12 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
{
LOG->Trace( "ScreenGameplay::ScreenGameplay()" );
m_textLyrics.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
m_textLyrics.SetXY( 100,100 );
m_textLyrics.SetDiffuse( RageColor(1,1,1,1) );
if( GAMESTATE->m_pCurSong == NULL && GAMESTATE->m_pCurCourse == NULL )
return; // ScreenDemonstration will move us to the next scren. We just need to survive for one update without crashing.
@@ -183,18 +189,23 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
// If this is beginner mode, show the helper
/* !! Working on this.. having probs loading the BG sequences -- Miryokuteki
m_sprBH.Load( THEME->GetPathTo("BGAnimations","beginner helper up") );
this->AddChild( &m_sprBH );
m_sprBH.SetXY( 100,100 );
m_sprBH.StartAnimating();
this->AddChild( &m_bgaBeginnerHelper );
m_bgaBH.SetXY( 100,100 );
m_Background.AddChild(&m_bgaBH);
*/
// If this is beginner mode, show the helper
/* !! Working on this.. having probs loading the BG sequences -- Miryokuteki */
//this->AddChild( &m_bhDancer );
//m_bhDancer.Load( THEME->GetPathTo("Graphics", "select difficulty ex picture easy") );
//m_bhDancer.SetXY( -100,-100 ); //<-- causing entire screen to offset!
//m_bhDancer.SetDiffuse( RageColor(1,1,1,1) );
//m_bhDancer.SetEffectGlowShift( 0.5f );
//m_bhDancer.BeginDraw();
/* */
@@ -391,6 +402,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
m_textDebug.SetXY( DEBUG_X, DEBUG_Y );
m_textDebug.SetDiffuse( RageColor(1,1,1,1) );
this->AddChild( &m_textDebug );
this->AddChild( &m_textLyrics );
for( int s=0; s<NUM_STATUS_ICONS; s++ )
@@ -777,6 +789,12 @@ void ScreenGameplay::Update( float fDeltaTime )
{
case STATE_DANCING:
//
// Check if we should show lyrics now
//
m_fLyricsTime += fDeltaTime;
m_textLyrics.SetText( SecondsToTime( m_fLyricsTime ) );
//
// Update players' alive time
//
+8 -1
View File
@@ -32,6 +32,8 @@
#include "Inventory.h"
#include "ActiveItemList.h"
#include "BeginnerHelper.h"
// messages sent by Combo
const ScreenMessage SM_BeginToasty = ScreenMessage(SM_User+104);
@@ -48,7 +50,7 @@ const ScreenMessage SM_900Combo = ScreenMessage(SM_User+208);
const ScreenMessage SM_1000Combo = ScreenMessage(SM_User+209);
const ScreenMessage SM_ComboStopped = ScreenMessage(SM_User+210);
class LyricsLoader;
class ScreenGameplay : public Screen
{
public:
@@ -62,6 +64,9 @@ public:
protected:
//BeginnerHelper m_bhDancer; // The model for training
Sprite m_bhDancer;
void TweenOnScreen();
void TweenOffScreen();
@@ -88,6 +93,7 @@ protected:
bool m_bChangedOffsetOrBPM;
float m_fTimeLeftBeforeDancingComment; // this counter is only running while STATE_DANCING
float m_fLyricsTime;
Background m_Background;
@@ -108,6 +114,7 @@ protected:
BitmapText m_textSongOptions;
BitmapText m_textDebug;
BitmapText m_textLyrics;
#define NUM_STATUS_ICONS 2
Sprite m_sprStatusIcons[NUM_STATUS_ICONS]; // shows whether these options are on.
+6 -6
View File
@@ -45,8 +45,8 @@ const CString CHOICE_TEXT[ScreenSelectDifficultyEX::NUM_CHOICES_EX] =
"hard",
"nonstop",
"oni",
"endless",
"battle"
"endless"/*,
"battle"*/
};
@@ -186,7 +186,7 @@ void ScreenSelectDifficultyEX::HandleScreenMessage( const ScreenMessage SM )
case CHOICE_EX_BEGINNER: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_BEGINNER; break;
case CHOICE_EX_EASY: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_EASY; break;
case CHOICE_EX_NONSTOP: // need to set preferred difficulty even for courses
case CHOICE_EX_BATTLE:
//case CHOICE_EX_BATTLE:
case CHOICE_EX_ONI:
case CHOICE_EX_ENDLESS:
case CHOICE_EX_MEDIUM: GAMESTATE->m_PreferredDifficulty[p] = DIFFICULTY_MEDIUM; break;
@@ -204,7 +204,7 @@ void ScreenSelectDifficultyEX::HandleScreenMessage( const ScreenMessage SM )
case CHOICE_EX_NONSTOP: GAMESTATE->m_PlayMode = PLAY_MODE_NONSTOP; break;
case CHOICE_EX_ONI: GAMESTATE->m_PlayMode = PLAY_MODE_ONI; break;
case CHOICE_EX_ENDLESS: GAMESTATE->m_PlayMode = PLAY_MODE_ENDLESS; break;
case CHOICE_EX_BATTLE: GAMESTATE->m_PlayMode = PLAY_MODE_BATTLE; break;
//case CHOICE_EX_BATTLE: GAMESTATE->m_PlayMode = PLAY_MODE_BATTLE; break;
default: ASSERT(0); // bad selection
}
@@ -259,7 +259,7 @@ bool ScreenSelectDifficultyEX::AnyPlayerIsOnCourse()
{
case CHOICE_EX_NONSTOP:
case CHOICE_EX_ONI:
case CHOICE_EX_BATTLE:
//case CHOICE_EX_BATTLE:
case CHOICE_EX_ENDLESS: return true; break;
}
}
@@ -273,7 +273,7 @@ bool ScreenSelectDifficultyEX::PlayerIsOnCourse( PlayerNumber pl )
{
case CHOICE_EX_NONSTOP:
case CHOICE_EX_ONI:
case CHOICE_EX_BATTLE:
//case CHOICE_EX_BATTLE:
case CHOICE_EX_ENDLESS: return true; break;
}
return false;
+1 -1
View File
@@ -33,7 +33,7 @@ public:
CHOICE_EX_NONSTOP,
CHOICE_EX_ONI,
CHOICE_EX_ENDLESS,
CHOICE_EX_BATTLE,
//CHOICE_EX_BATTLE,
NUM_CHOICES_EX
};
+2 -2
View File
@@ -329,9 +329,9 @@ void ScreenSelectMaxType2::MenuStart( PlayerNumber pn )
// check to see if everyone has chosen
for( p=0; p<NUM_PLAYERS; p++ )
for( int pl=0; pl<NUM_PLAYERS; pl++ )
{
if( GAMESTATE->IsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false )
if( GAMESTATE->IsPlayerEnabled((PlayerNumber)pl) && m_bChosen[pl] == false )
return;
}
this->SendScreenMessage( SM_BeginFadingOut, SLEEP_AFTER_CHOICE_SECONDS ); // tell our owner it's time to move on
+58 -1
View File
@@ -25,7 +25,6 @@
#include "GameManager.h"
#include "PrefsManager.h"
#include "StyleDef.h"
#include "Notes.h"
#include "GameState.h"
#include "FontCharAliases.h"
#include "TitleSubstitution.h"
@@ -37,6 +36,8 @@
#include "NotesWriterDWI.h"
#include "NotesWriterSM.h"
#include "LyricsLoader.h"
#include "SDL.h"
#include "SDL_image.h"
@@ -76,6 +77,16 @@ void SortBackgroundChangesArray( vector<BackgroundChange> &arrayBackgroundChange
sort( arrayBackgroundChanges.begin(), arrayBackgroundChanges.end(), CompareBackgroundChanges );
}
static int CompareLyricSegments(const LyricSegment &seg1, const LyricSegment &seg2)
{
return seg1.m_fStartTime < seg2.m_fStartTime;
}
void SortLyricSegmentsArray( vector<LyricSegment> &arrayLyricSegments )
{
sort( arrayLyricSegments.begin(), arrayLyricSegments.end(), CompareLyricSegments );
}
//////////////////////////////
// Song
@@ -122,6 +133,14 @@ void Song::AddBackgroundChange( BackgroundChange seg )
SortBackgroundChangesArray( m_BackgroundChanges );
}
void Song::AddLyricSegment( LyricSegment seg )
{
m_LyricSegments.push_back( seg );
SortLyricSegmentsArray( m_LyricSegments );
}
float Song::GetMusicStartBeat() const
{
float fBPS = m_BPMSegments[0].m_fBPM / 60.0f;
@@ -290,6 +309,16 @@ bool Song::LoadWithoutCache( CString sDir )
bool success = ld->LoadFromDir( sDir, *this );
delete ld;
LOG->Trace("\n\n\n SONG NAME:: %s", this->GetDisplayMainTitle().GetBuffer() );
if( this->GetDisplayMainTitle().GetBuffer() == "Future Girls" )
{
LOG->Trace("AAA");
}
if( HasLyrics() )
{
LOG->Trace("\n\n\n LOAD LYRICS HERE!! \n\n\n");
}
if(!success)
return false;
@@ -490,6 +519,7 @@ void Song::TidyUpData()
m_fMusicSampleStartSeconds = this->GetElapsedTimeFromBeat( (float)iBeat );
}
}
/* Some DWIs have lengths in ms when they meant seconds, eg. #SAMPLELENGTH:10;.
* If the sample length is way too short, change it. */
@@ -553,6 +583,26 @@ void Song::TidyUpData()
}
LOG->Trace("Looking for lyrics..");
//if( HasLyrics() )
//{
//Check if there is a lyric file in here
CStringArray arrayLyricFiles;
GetDirListing(m_sSongDir + CString("*.lrc"), arrayLyricFiles );
if( !arrayLyricFiles.empty() )
{
m_sLyricsFile = m_sSongDir+arrayLyricFiles[0];
LyricsLoader ll;
ll.LoadFromLRCFile(m_sLyricsFile.GetBuffer(), *GAMESTATE->m_pCurSong);
}
//}
//
// Now, For the images we still haven't found, look at the image dimensions of the remaining unclassified images.
//
@@ -1126,6 +1176,7 @@ bool Song::RouletteDisplayed() const
bool Song::HasMusic() const {return m_sMusicFile != "" && IsAFile(GetMusicPath()); }
bool Song::HasBanner() const {return m_sBannerFile != "" && IsAFile(GetBannerPath()); }
bool Song::HasLyrics() const {return m_sLyricsFile != "" && IsAFile(GetLyricsPath()); }
bool Song::HasBackground() const {return m_sBackgroundFile != "" && IsAFile(GetBackgroundPath()); }
bool Song::HasCDTitle() const {return m_sCDTitleFile != "" && IsAFile(GetCDTitlePath()); }
bool Song::HasBGChanges() const {return !m_BackgroundChanges.empty(); }
@@ -1189,6 +1240,12 @@ CString Song::GetBannerPath() const
return m_sSongDir+m_sBannerFile;
}
CString Song::GetLyricsPath() const
{
LOG->Trace("\n\n\n TRYING TO GET LYRICS FROM:: %s", m_sSongDir+m_sBannerFile);
return m_sSongDir+m_sLyricsFile;
}
CString Song::GetCDTitlePath() const
{
if( m_sCDTitleFile.Find('/') == -1)
+18 -2
View File
@@ -57,7 +57,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /pdb:none
# Begin Special Build Tool
IntDir=.\../Release6
TargetDir=\stepmania\stepmania
TargetDir=\stepmania
TargetName=StepMania
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
@@ -92,7 +92,7 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
# Begin Special Build Tool
IntDir=.\../Debug6
TargetDir=\stepmania\stepmania
TargetDir=\stepmania
TargetName=StepMania-debug
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
@@ -371,6 +371,14 @@ SOURCE=.\Inventory.h
# End Source File
# Begin Source File
SOURCE=.\LyricsLoader.cpp
# End Source File
# Begin Source File
SOURCE=.\LyricsLoader.h
# End Source File
# Begin Source File
SOURCE=.\ModeChoice.h
# End Source File
# Begin Source File
@@ -551,6 +559,14 @@ SOURCE=.\IniFile.h
# End Source File
# Begin Source File
SOURCE=.\LRCFile.cpp
# End Source File
# Begin Source File
SOURCE=.\LRCFile.h
# End Source File
# Begin Source File
SOURCE=.\MsdFile.cpp
# End Source File
# Begin Source File
+18 -3
View File
@@ -17,6 +17,7 @@
struct Notes;
class StyleDef;
class NotesLoader;
class LyricsLoader;
extern const int FILE_CACHE_VERSION;
@@ -46,6 +47,15 @@ struct BackgroundChange
CString m_sBGName;
};
struct LyricSegment
{
LyricSegment() { m_fStartTime = -1; };
LyricSegment( float a, CString m_sLyric, CString m_sStartTime ) { m_fStartTime = a, m_sLyric = m_sLyric, m_sStartTime = m_sStartTime; };
float m_fStartTime; // For the sorting routine
CString m_sLyric;
CString m_sStartTime;
};
class Song
{
@@ -131,11 +141,13 @@ public:
float GetMusicStartBeat() const;
CString m_sBannerFile;
CString m_sLyricsFile;
CString m_sBackgroundFile;
CString m_sCDTitleFile;
CString GetMusicPath() const;
CString GetBannerPath() const;
CString GetLyricsPath() const;
CString GetBackgroundPath() const;
CString GetCDTitlePath() const;
@@ -146,14 +158,17 @@ public:
bool HasCDTitle() const;
bool HasMovieBackground() const;
bool HasBGChanges() const;
bool HasLyrics() const;
vector<BPMSegment> m_BPMSegments; // this must be sorted before gameplay
vector<StopSegment> m_StopSegments; // this must be sorted before gameplay
vector<BackgroundChange> m_BackgroundChanges; // this must be sorted before gameplay
vector<BPMSegment> m_BPMSegments; // this must be sorted before gameplay
vector<StopSegment> m_StopSegments; // this must be sorted before gameplay
vector<BackgroundChange> m_BackgroundChanges; // this must be sorted before gameplay
vector<LyricSegment> m_LyricSegments; // same
void AddBPMSegment( BPMSegment seg );
void AddStopSegment( StopSegment seg );
void AddBackgroundChange( BackgroundChange seg );
void AddLyricSegment( LyricSegment seg );
void GetMinMaxBPM( float &fMinBPM, float &fMaxBPM ) const
{