Handle a missing pad model gracefully
This commit is contained in:
@@ -62,15 +62,18 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay")
|
|||||||
m_LifeMeterBar.Command( LIFEBARONCOMMAND );
|
m_LifeMeterBar.Command( LIFEBARONCOMMAND );
|
||||||
m_LifeMeterBar.FillForHowToPlay( NUM_PERFECTS, NUM_MISSES );
|
m_LifeMeterBar.FillForHowToPlay( NUM_PERFECTS, NUM_MISSES );
|
||||||
|
|
||||||
if( USEPAD )
|
m_bUsingPad = (USEPAD && DoesFileExist("Characters" SLASH "DancePad-DDR.txt"));
|
||||||
|
|
||||||
|
if( m_bUsingPad )
|
||||||
{
|
{
|
||||||
m_mDancePad.LoadMilkshapeAscii("Characters" SLASH "DancePad-DDR.txt");
|
m_mDancePad.LoadMilkshapeAscii("Characters" SLASH "DancePad-DDR.txt");
|
||||||
m_mDancePad.SetRotationX( 35 );
|
m_mDancePad.SetRotationX( 35 );
|
||||||
m_mDancePad.Command( PADONCOMMAND );
|
m_mDancePad.Command( PADONCOMMAND );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display random character+pad
|
// Display random character
|
||||||
if( USECHARACTER && GAMESTATE->m_pCharacters.size() )
|
m_bUsingCharacter = (USECHARACTER && GAMESTATE->m_pCharacters.size());
|
||||||
|
if( m_bUsingCharacter )
|
||||||
{
|
{
|
||||||
Character* rndchar = GAMESTATE->GetRandomCharacter();
|
Character* rndchar = GAMESTATE->GetRandomCharacter();
|
||||||
|
|
||||||
@@ -161,12 +164,20 @@ ScreenHowToPlay::~ScreenHowToPlay()
|
|||||||
|
|
||||||
void ScreenHowToPlay::Update( float fDelta )
|
void ScreenHowToPlay::Update( float fDelta )
|
||||||
{
|
{
|
||||||
float rate = 1;
|
|
||||||
if(GAMESTATE->m_pCurSong != NULL)
|
if(GAMESTATE->m_pCurSong != NULL)
|
||||||
{
|
{
|
||||||
|
float rate = 1;
|
||||||
|
|
||||||
GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong );
|
GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong );
|
||||||
m_fFakeSecondsIntoSong += fDelta;
|
m_fFakeSecondsIntoSong += fDelta;
|
||||||
|
|
||||||
|
// we want misses from beat 22.8 on out, so change to a HUMAN controller.
|
||||||
|
// since we aren't taking input from the user, the steps are always missed.
|
||||||
|
if(GAMESTATE->m_fSongBeat > 22.8f)
|
||||||
|
GAMESTATE->m_PlayerController[PLAYER_1] = PC_HUMAN;
|
||||||
|
|
||||||
|
if ( m_bUsingCharacter )
|
||||||
|
{
|
||||||
if( GAMESTATE->m_bFreeze )
|
if( GAMESTATE->m_bFreeze )
|
||||||
{
|
{
|
||||||
switch(int(GAMESTATE->m_fSongBeat))
|
switch(int(GAMESTATE->m_fSongBeat))
|
||||||
@@ -201,11 +212,6 @@ void ScreenHowToPlay::Update( float fDelta )
|
|||||||
}
|
}
|
||||||
// ----------------------------------------------------------------------- */
|
// ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
// we want misses from here on out, so change to a HUMAN controller.
|
|
||||||
// since we aren't taking input from the user, the steps are always missed.
|
|
||||||
if(GAMESTATE->m_fSongBeat > 22.8f)
|
|
||||||
GAMESTATE->m_PlayerController[PLAYER_1] = PC_HUMAN;
|
|
||||||
|
|
||||||
if( (GAMESTATE->m_fSongBeat >= 0.0f && GAMESTATE->m_fSongBeat <= 15.0f) ||
|
if( (GAMESTATE->m_fSongBeat >= 0.0f && GAMESTATE->m_fSongBeat <= 15.0f) ||
|
||||||
(GAMESTATE->m_fSongBeat >= 16.8f && GAMESTATE->m_fSongBeat <= 17.0f) ||
|
(GAMESTATE->m_fSongBeat >= 16.8f && GAMESTATE->m_fSongBeat <= 17.0f) ||
|
||||||
(GAMESTATE->m_fSongBeat >= 18.8f && GAMESTATE->m_fSongBeat <= 19.0f) ||
|
(GAMESTATE->m_fSongBeat >= 18.8f && GAMESTATE->m_fSongBeat <= 19.0f) ||
|
||||||
@@ -220,10 +226,14 @@ void ScreenHowToPlay::Update( float fDelta )
|
|||||||
// doesn't finish in time.
|
// doesn't finish in time.
|
||||||
rate = 1.8f;
|
rate = 1.8f;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
m_mCharacter.Update( fDelta * rate );
|
m_mCharacter.Update( fDelta * rate );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( m_bUsingPad )
|
||||||
m_mDancePad.Update( fDelta );
|
m_mDancePad.Update( fDelta );
|
||||||
|
|
||||||
ScreenAttract::Update( fDelta );
|
ScreenAttract::Update( fDelta );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,6 +252,8 @@ void ScreenHowToPlay::DrawPrimitives()
|
|||||||
{
|
{
|
||||||
Screen::DrawPrimitives();
|
Screen::DrawPrimitives();
|
||||||
|
|
||||||
|
if( m_bUsingPad || m_bUsingCharacter )
|
||||||
|
{
|
||||||
DISPLAY->SetLighting( true );
|
DISPLAY->SetLighting( true );
|
||||||
DISPLAY->SetLightDirectional(
|
DISPLAY->SetLightDirectional(
|
||||||
0,
|
0,
|
||||||
@@ -250,11 +262,14 @@ void ScreenHowToPlay::DrawPrimitives()
|
|||||||
RageColor(0,0,0,1),
|
RageColor(0,0,0,1),
|
||||||
RageVector3(0, 0, 1) );
|
RageVector3(0, 0, 1) );
|
||||||
|
|
||||||
|
if( m_bUsingCharacter )
|
||||||
m_mCharacter.Draw();
|
m_mCharacter.Draw();
|
||||||
|
if( m_bUsingPad )
|
||||||
m_mDancePad.Draw();
|
m_mDancePad.Draw();
|
||||||
|
|
||||||
DISPLAY->SetLightOff( 0 );
|
DISPLAY->SetLightOff( 0 );
|
||||||
DISPLAY->SetLighting( false );
|
DISPLAY->SetLighting( false );
|
||||||
|
}
|
||||||
|
|
||||||
m_Overlay.DrawPrimitives();
|
m_Overlay.DrawPrimitives();
|
||||||
m_In.DrawPrimitives();
|
m_In.DrawPrimitives();
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ protected:
|
|||||||
Player m_Player;
|
Player m_Player;
|
||||||
Model m_mCharacter;
|
Model m_mCharacter;
|
||||||
Model m_mDancePad;
|
Model m_mDancePad;
|
||||||
|
bool m_bUsingCharacter;
|
||||||
|
bool m_bUsingPad;
|
||||||
|
|
||||||
Song* m_pSong;
|
Song* m_pSong;
|
||||||
float m_fFakeSecondsIntoSong;
|
float m_fFakeSecondsIntoSong;
|
||||||
|
|||||||
Reference in New Issue
Block a user