added a transition between course songs
This commit is contained in:
@@ -105,6 +105,8 @@ float ArrowGetAlpha( const PlayerNumber pn, float fYPos )
|
||||
if (blinktimer == 0)
|
||||
blinktimer = TIMER->GetTimeSinceStart();
|
||||
|
||||
const bool bReverse = GAMESTATE->m_PlayerOptions[pn].m_bReverseScroll;
|
||||
|
||||
static int blinkstate=2;
|
||||
switch( GAMESTATE->m_PlayerOptions[pn].m_AppearanceType )
|
||||
{
|
||||
@@ -112,10 +114,10 @@ float ArrowGetAlpha( const PlayerNumber pn, float fYPos )
|
||||
fAlpha = 1;
|
||||
break;
|
||||
case PlayerOptions::APPEARANCE_HIDDEN:
|
||||
fAlpha = (fYPos-100)/200;
|
||||
fAlpha = ((bReverse?-fYPos:fYPos)-100)/200;
|
||||
break;
|
||||
case PlayerOptions::APPEARANCE_SUDDEN:
|
||||
fAlpha = ((SCREEN_HEIGHT-fYPos)-260)/200;
|
||||
fAlpha = ((SCREEN_HEIGHT-(bReverse?-fYPos:fYPos))-260)/200;
|
||||
break;
|
||||
case PlayerOptions::APPEARANCE_STEALTH:
|
||||
fAlpha = 0;
|
||||
@@ -160,7 +162,9 @@ float ArrowGetAlpha( const PlayerNumber pn, float fYPos )
|
||||
ASSERT( false );
|
||||
fAlpha = 0;
|
||||
};
|
||||
if( fYPos < 0 )
|
||||
if( !bReverse && fYPos < 0 )
|
||||
fAlpha = 1;
|
||||
else if( bReverse && fYPos > 0 )
|
||||
fAlpha = 1;
|
||||
|
||||
return fAlpha;
|
||||
|
||||
@@ -24,7 +24,6 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our progr
|
||||
GameState::GameState()
|
||||
{
|
||||
m_CurGame = GAME_DANCE;
|
||||
m_sLoadingMessage = "Initializing hardware...";
|
||||
m_CurGame = GAME_DANCE;
|
||||
Reset();
|
||||
}
|
||||
@@ -62,10 +61,11 @@ void GameState::Reset()
|
||||
|
||||
m_apSongsPlayed.RemoveAll();
|
||||
|
||||
m_iSongsIntoCourse = 0;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_fSecondsBeforeFail[p] = -1;
|
||||
m_iStagesIntoCourse[p] = 0;
|
||||
m_iSongsBeforeFail[p] = 0;
|
||||
}
|
||||
m_bUsedAutoPlayer = false;
|
||||
|
||||
@@ -195,29 +195,6 @@ bool GameState::IsExtraStage2()
|
||||
|
||||
CString GameState::GetStageText()
|
||||
{
|
||||
switch( m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
{
|
||||
CString sText;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( this->IsPlayerEnabled(p) )
|
||||
sText += ssprintf("%d ", m_iStagesIntoCourse[p]);
|
||||
else
|
||||
sText += "a ";
|
||||
}
|
||||
sText.TrimRight();
|
||||
sText.Replace('a',' ');
|
||||
return sText;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
; // fall through
|
||||
}
|
||||
|
||||
|
||||
if( IsFinalStage() )
|
||||
return "Final";
|
||||
else if( IsExtraStage() )
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
SongSortOrder m_SongSortOrder; // used by MusicWheel
|
||||
PlayMode m_PlayMode;
|
||||
bool m_bEditing;
|
||||
int m_iCurrentStageIndex; // incremented after a song ends
|
||||
int m_iCurrentStageIndex; // incremented on Eval screen
|
||||
|
||||
int GetStageIndex();
|
||||
bool IsFinalStage();
|
||||
@@ -79,11 +79,13 @@ public:
|
||||
// and used to calculate the time into a course
|
||||
float GetElapsedSeconds(); // Arcade: time into current song. Oni/Endless: time into current course
|
||||
|
||||
int m_iSongsIntoCourse; // In Arcade, this value is meaningless.
|
||||
// In Oni and Endless, this is the number of songs played in the current course.
|
||||
int m_iSongsBeforeFail[NUM_PLAYERS]; // In Arcade, this value is meaningless.
|
||||
// In Oni and Endless, this is the number of songs played before failing.
|
||||
float m_fSecondsBeforeFail[NUM_PLAYERS];// -1 means not yet failed
|
||||
// In Arcade, is the time into the current stage before failing.
|
||||
// In Oni and Endless this is the time into the current course before failing
|
||||
int m_iStagesIntoCourse[NUM_PLAYERS]; // In Arcade, this value is meaningless.
|
||||
// In Oni and Endless, this is the number of songs played before failing.
|
||||
bool m_bUsedAutoPlayer; // Used autoplayer at any time during any stage/course/song
|
||||
|
||||
float GetPlayerSurviveTime( PlayerNumber p );
|
||||
|
||||
@@ -26,7 +26,10 @@ void NoteDataWithScoring::Init()
|
||||
m_TapNoteScores[t][i] = TNS_NONE;
|
||||
|
||||
for( int i=0; i<MAX_HOLD_NOTES; i++ )
|
||||
{
|
||||
m_HoldNoteScores[i] = HNS_NONE;
|
||||
m_fHoldNoteLife[i] = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,12 @@ struct NoteDataWithScoring : public NoteData
|
||||
// maintain this extra data in addition to the NoteData
|
||||
TapNoteScore m_TapNoteScores[MAX_NOTE_TRACKS][MAX_TAP_NOTE_ROWS];
|
||||
HoldNoteScore m_HoldNoteScores[MAX_HOLD_NOTES];
|
||||
float m_fHoldNoteLife[MAX_TAP_NOTE_ROWS]; // 1.0 means this HoldNote has full life.
|
||||
// 0.0 means this HoldNote is dead
|
||||
// When this value hits 0.0 for the first time,
|
||||
// m_HoldScore becomes HSS_NG.
|
||||
// If the life is > 0.0 when the HoldNote ends, then
|
||||
// m_HoldScore becomes HSS_OK.
|
||||
|
||||
|
||||
// statistics
|
||||
|
||||
+25
-11
@@ -48,6 +48,11 @@ void NoteField::Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBeh
|
||||
m_iPixelsToDrawBehind = iPixelsToDrawBehind;
|
||||
m_iPixelsToDrawAhead = iPixelsToDrawAhead;
|
||||
|
||||
NoteDataWithScoring::Init();
|
||||
|
||||
for( int i=0; i<MAX_HOLD_NOTES; i++ )
|
||||
m_bIsHoldingHoldNote[i] = false;
|
||||
|
||||
StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
||||
|
||||
this->CopyAll( pNoteData );
|
||||
@@ -63,7 +68,7 @@ void NoteField::Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBeh
|
||||
|
||||
|
||||
for( int i=0; i<MAX_HOLD_NOTES; i++ )
|
||||
m_HoldNoteLife[i] = 1; // start with full life
|
||||
m_fHoldNoteLife[i] = 1; // start with full life
|
||||
|
||||
|
||||
ASSERT( m_iNumTracks == GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer );
|
||||
@@ -266,7 +271,12 @@ void NoteField::DrawPrimitives()
|
||||
for( int i=0; i<m_iNumHoldNotes; i++ )
|
||||
{
|
||||
HoldNote &hn = m_HoldNotes[i];
|
||||
const float fLife = m_HoldNoteLife[i];
|
||||
HoldNoteScore &hns = m_HoldNoteScores[i];
|
||||
|
||||
if( hns == HNS_OK ) // if this HoldNote was completed
|
||||
continue; // don't draw anything
|
||||
|
||||
const float fLife = m_fHoldNoteLife[i];
|
||||
|
||||
if( hn.m_iTrack != c ) // this HoldNote doesn't belong to this column
|
||||
continue;
|
||||
@@ -281,13 +291,13 @@ void NoteField::DrawPrimitives()
|
||||
|
||||
|
||||
// If this note was in the past and has life > 0, then it was completed and don't draw it!
|
||||
if( hn.m_iEndIndex < BeatToNoteRow(fSongBeat) && fLife > 0 )
|
||||
if( hn.m_iEndIndex < BeatToNoteRow(fSongBeat) && fLife > 0 && m_bIsHoldingHoldNote[i] )
|
||||
continue; // skip
|
||||
|
||||
|
||||
const int iCol = hn.m_iTrack;
|
||||
const float fHoldNoteLife = m_HoldNoteLife[i];
|
||||
const bool bActive = NoteRowToBeat(hn.m_iStartIndex-1) <= fSongBeat && fSongBeat <= NoteRowToBeat(hn.m_iEndIndex); // hack: added -1 because hn.m_iStartIndex changes as note is held
|
||||
const float fHoldNoteLife = m_fHoldNoteLife[i];
|
||||
const bool bActive = m_bIsHoldingHoldNote[i]; // hack: added -1 because hn.m_iStartIndex changes as note is held
|
||||
|
||||
// parts of the hold
|
||||
const float fStartDrawingAtBeat = froundf( (float)hn.m_iStartIndex, ROWS_BETWEEN_HOLD_BITS/GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fArrowScrollSpeed );
|
||||
@@ -299,7 +309,7 @@ void NoteField::DrawPrimitives()
|
||||
if( j < iIndexFirstArrowToDraw || iIndexLastArrowToDraw < j)
|
||||
continue; // skip this arrow
|
||||
|
||||
if( fLife > 0 && NoteRowToBeat(j) < fSongBeat )
|
||||
if( bActive && NoteRowToBeat(j) < fSongBeat )
|
||||
continue;
|
||||
|
||||
CreateHoldNoteInstance( instances[iCount++], bActive, (float)j, hn, fHoldNoteLife );
|
||||
@@ -325,17 +335,25 @@ void NoteField::DrawPrimitives()
|
||||
|
||||
// See if there is a hold step that begins on this beat.
|
||||
bool bHoldNoteOnThisBeat = false;
|
||||
float fHoldLife = -1;
|
||||
for( int j=0; j<m_iNumHoldNotes; j++ )
|
||||
{
|
||||
if( m_HoldNotes[j].m_iStartIndex == i )
|
||||
{
|
||||
bHoldNoteOnThisBeat = true;
|
||||
fHoldLife = m_fHoldNoteLife[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( bHoldNoteOnThisBeat )
|
||||
CreateTapNoteInstance( instances[iCount++], c, (float)i, D3DXCOLOR(0,1,0,1) );
|
||||
{
|
||||
D3DXCOLOR color(0,1,0,1);
|
||||
color.r *= fHoldLife;
|
||||
color.g *= fHoldLife;
|
||||
color.b *= fHoldLife;
|
||||
CreateTapNoteInstance( instances[iCount++], c, (float)i, color );
|
||||
}
|
||||
else
|
||||
CreateTapNoteInstance( instances[iCount++], c, (float)i );
|
||||
}
|
||||
@@ -355,7 +373,3 @@ void NoteField::RemoveTapNoteRow( int iIndex )
|
||||
m_TapNotes[c][iIndex] = '0';
|
||||
}
|
||||
|
||||
void NoteField::SetHoldNoteLife( int iIndex, float fLife )
|
||||
{
|
||||
m_HoldNoteLife[iIndex] = fLife;
|
||||
}
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
#include "BitmapText.h"
|
||||
#include "Quad.h"
|
||||
#include "ArrowEffects.h"
|
||||
#include "NoteDataWithScoring.h"
|
||||
|
||||
|
||||
|
||||
|
||||
class NoteField : public NoteData, public ActorFrame
|
||||
class NoteField : public NoteDataWithScoring, public ActorFrame
|
||||
{
|
||||
public:
|
||||
NoteField();
|
||||
@@ -34,9 +33,8 @@ public:
|
||||
|
||||
void Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBehind, int iPixelsToDrawAhead );
|
||||
void RemoveTapNoteRow( int iIndex );
|
||||
void SetHoldNoteLife( int iIndex, float fLife );
|
||||
|
||||
float m_HoldNoteLife[MAX_HOLD_NOTES]; // 1.0 = full life, 0 = dead
|
||||
bool m_bIsHoldingHoldNote[MAX_HOLD_NOTES]; // hack: Need this to prevent hold note jitter
|
||||
|
||||
float m_fBeginMarker, m_fEndMarker; // only used with MODE_EDIT
|
||||
|
||||
|
||||
@@ -367,12 +367,15 @@ bool Notes::LoadFromDWITokens(
|
||||
sStepData2.Replace( "\n", "" );
|
||||
sStepData2.Replace( " ", "" );
|
||||
|
||||
if( sMode == "#SINGLE" ) m_NotesType = NOTES_TYPE_DANCE_SINGLE;
|
||||
else if( sMode == "#DOUBLE" ) m_NotesType = NOTES_TYPE_DANCE_DOUBLE;
|
||||
else if( sMode == "#COUPLE" ) m_NotesType = NOTES_TYPE_DANCE_COUPLE;
|
||||
else if( sMode == "#SOLO" ) m_NotesType = NOTES_TYPE_DANCE_SOLO;
|
||||
else throw RageException( "Unrecognized DWI mode '%s'", sMode );
|
||||
|
||||
if( sMode == "SINGLE" ) m_NotesType = NOTES_TYPE_DANCE_SINGLE;
|
||||
else if( sMode == "DOUBLE" ) m_NotesType = NOTES_TYPE_DANCE_DOUBLE;
|
||||
else if( sMode == "COUPLE" ) m_NotesType = NOTES_TYPE_DANCE_COUPLE;
|
||||
else if( sMode == "SOLO" ) m_NotesType = NOTES_TYPE_DANCE_SOLO;
|
||||
else
|
||||
{
|
||||
ASSERT(0); // Unrecognized DWI notes format
|
||||
m_NotesType = NOTES_TYPE_DANCE_SINGLE;
|
||||
}
|
||||
|
||||
|
||||
CMap<int, int, int, int> mapDanceNoteToNoteDataColumn;
|
||||
|
||||
@@ -79,8 +79,6 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi
|
||||
|
||||
// init scoring
|
||||
NoteDataWithScoring::Init();
|
||||
for( int i=0; i<MAX_TAP_NOTE_ROWS; i++ )
|
||||
m_fHoldNoteLife[i] = 1.0f;
|
||||
|
||||
|
||||
if( m_pScore )
|
||||
@@ -165,8 +163,10 @@ void Player::Update( float fDeltaTime )
|
||||
{
|
||||
const bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI ) || PREFSMAN->m_bAutoPlay;
|
||||
// if they got a bad score or haven't stepped on the corresponding tap yet
|
||||
const bool bSteppedOnTapNote = m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] >= TNS_GREAT;
|
||||
const bool bSteppedOnTapNote = m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] != TNS_NONE &&
|
||||
m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] != TNS_MISS;
|
||||
|
||||
m_NoteField.m_bIsHoldingHoldNote[i] = bIsHoldingButton && bSteppedOnTapNote;
|
||||
|
||||
if( bIsHoldingButton && bSteppedOnTapNote )
|
||||
{
|
||||
@@ -178,7 +178,7 @@ void Player::Update( float fDeltaTime )
|
||||
|
||||
m_GhostArrowRow.HoldNote( hn.m_iTrack ); // update the "electric ghost" effect
|
||||
}
|
||||
else // !bIsHoldingButton
|
||||
else
|
||||
{
|
||||
if( fSongBeat-fStartBeat > GetMaxBeatDifference() )
|
||||
{
|
||||
@@ -187,7 +187,7 @@ void Player::Update( float fDeltaTime )
|
||||
fLife = max( fLife, 0 ); // clamp
|
||||
}
|
||||
}
|
||||
m_NoteField.SetHoldNoteLife( i, fLife ); // update the NoteField display
|
||||
m_NoteField.m_fHoldNoteLife[i] = fLife; // update the NoteField display
|
||||
}
|
||||
|
||||
// check for NG
|
||||
@@ -197,6 +197,7 @@ void Player::Update( float fDeltaTime )
|
||||
HandleNoteScore( hns );
|
||||
m_Combo.EndCombo();
|
||||
m_HoldJudgement[hn.m_iTrack].SetHoldJudgement( HNS_NG );
|
||||
m_NoteField.m_HoldNoteScores[i] = HNS_NG; // update the NoteField display
|
||||
}
|
||||
|
||||
// check for OK
|
||||
@@ -207,7 +208,8 @@ void Player::Update( float fDeltaTime )
|
||||
hns = HNS_OK;
|
||||
HandleNoteScore( hns );
|
||||
m_HoldJudgement[hn.m_iTrack].SetHoldJudgement( HNS_OK );
|
||||
m_NoteField.SetHoldNoteLife( i, fLife ); // update the NoteField display
|
||||
m_NoteField.m_fHoldNoteLife[i] = fLife; // update the NoteField display
|
||||
m_NoteField.m_HoldNoteScores[i] = HNS_OK; // update the NoteField display
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,7 +371,18 @@ void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn )
|
||||
score = min( score, m_TapNoteScores[t][iIndexThatWasSteppedOn] );
|
||||
|
||||
// remove this row from the NoteField
|
||||
if ( ( score == TNS_PERFECT ) || ( score == TNS_GREAT ) )
|
||||
bool bHoldNoteOnThisBeat = false;
|
||||
for( int j=0; j<m_iNumHoldNotes; j++ )
|
||||
{
|
||||
if( m_HoldNotes[j].m_iStartIndex == iIndexThatWasSteppedOn )
|
||||
{
|
||||
bHoldNoteOnThisBeat = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( score==TNS_PERFECT || score == TNS_GREAT || bHoldNoteOnThisBeat )
|
||||
m_NoteField.RemoveTapNoteRow( iIndexThatWasSteppedOn );
|
||||
|
||||
for( int c=0; c<m_iNumTracks; c++ ) // for each column
|
||||
|
||||
@@ -60,12 +60,6 @@ protected:
|
||||
|
||||
PlayerNumber m_PlayerNumber;
|
||||
|
||||
float m_fHoldNoteLife[MAX_TAP_NOTE_ROWS]; // 1.0 means this HoldNote has full life.
|
||||
// 0.0 means this HoldNote is dead
|
||||
// When this value hits 0.0 for the first time,
|
||||
// m_HoldScore becomes HSS_NG.
|
||||
// If the life is > 0.0 when the HoldNote ends, then
|
||||
// m_HoldScore becomes HSS_OK.
|
||||
int m_iNumTapNotes; // num of TapNotes for the current notes needed by scoring
|
||||
int m_iTapNotesHit; // number of notes judged so far, needed by scoring
|
||||
int m_iMeter; // meter of current steps, needed by scoring
|
||||
|
||||
@@ -340,7 +340,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
}
|
||||
|
||||
m_BonusInfoFrame[p].SetBonusInfo( (PlayerNumber)p, fPossibleRadarValues[p], fActualRadarValues[p], iMaxCombo[p] );
|
||||
m_StageBox[p].SetStageInfo( (PlayerNumber)p, GAMESTATE->m_iStagesIntoCourse[p] );
|
||||
m_StageBox[p].SetStageInfo( (PlayerNumber)p, GAMESTATE->m_iSongsBeforeFail[p] );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,10 @@ const float STAGE_NUMBER_LOCAL_X = 0;
|
||||
const float STAGE_NUMBER_LOCAL_Y = +20;
|
||||
const float STAGE_NUMBER_LOCALEZ2_Y = -30;
|
||||
|
||||
const float SONG_NUMBER_LOCAL_X[NUM_PLAYERS] = { STAGE_NUMBER_LOCAL_X-16, STAGE_NUMBER_LOCAL_X+16 };
|
||||
const float SONG_NUMBER_LOCAL_Y[NUM_PLAYERS] = { STAGE_NUMBER_LOCAL_Y, STAGE_NUMBER_LOCAL_Y };
|
||||
|
||||
|
||||
const float SCORE_LOCAL_X[NUM_PLAYERS] = { -214, +214 };
|
||||
const float SCORE_LOCAL_Y[NUM_PLAYERS] = { -6, -6 };
|
||||
|
||||
@@ -61,7 +65,8 @@ const float TIME_BETWEEN_DANCING_COMMENTS = 13;
|
||||
|
||||
|
||||
// received while STATE_DANCING
|
||||
const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+102);
|
||||
const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+101);
|
||||
const ScreenMessage SM_BeginLoadingNextSong = ScreenMessage(SM_User+102);
|
||||
const ScreenMessage SM_LastNotesEnded = ScreenMessage(SM_User+103);
|
||||
|
||||
|
||||
@@ -134,6 +139,9 @@ ScreenGameplay::ScreenGameplay()
|
||||
this->AddSubActor( &m_Background );
|
||||
|
||||
|
||||
m_OniFade.SetOpened();
|
||||
this->AddSubActor( &m_OniFade );
|
||||
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
@@ -191,6 +199,15 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_textStageNumber.SetText( GAMESTATE->GetStageText() );
|
||||
m_textStageNumber.SetDiffuseColor( GAMESTATE->GetStageColor() );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_textCourseSongNumber[p].Load( THEME->GetPathTo(FONT_HEADER2) );
|
||||
m_textCourseSongNumber[p].TurnShadowOff();
|
||||
m_textCourseSongNumber[p].SetXY( SONG_NUMBER_LOCAL_X[p], SONG_NUMBER_LOCAL_Y[p] );
|
||||
m_textCourseSongNumber[p].SetText( "" );
|
||||
m_textCourseSongNumber[p].SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,1,1) ); // light blue
|
||||
}
|
||||
|
||||
if( GAMESTATE->m_CurGame == GAME_EZ2 )
|
||||
{
|
||||
m_textStageNumber.SetXY( STAGE_NUMBER_LOCAL_X, STAGE_NUMBER_LOCALEZ2_Y );
|
||||
@@ -202,7 +219,19 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_textStageNumber.SetText( GAMESTATE->GetStageText() );
|
||||
m_textStageNumber.SetDiffuseColor( GAMESTATE->GetStageColor() );
|
||||
|
||||
m_frameTop.AddSubActor( &m_textStageNumber );
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ARCADE:
|
||||
m_frameTop.AddSubActor( &m_textStageNumber );
|
||||
break;
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
m_frameTop.AddSubActor( &m_textCourseSongNumber[p] );
|
||||
break;
|
||||
default:
|
||||
ASSERT(0); // invalid GameMode
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
@@ -402,7 +431,7 @@ bool ScreenGameplay::IsLastSong()
|
||||
CArray<Notes*,Notes*> apNotes[NUM_PLAYERS];
|
||||
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes );
|
||||
|
||||
return GAMESTATE->m_iCurrentStageIndex >= apSongs.GetSize(); // there are no more songs left
|
||||
return GAMESTATE->m_iSongsIntoCourse >= apSongs.GetSize(); // there are no more songs left
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -431,7 +460,7 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad )
|
||||
if( pCourse->m_bRandomize )
|
||||
iPlaySongIndex = rand() % apSongs.GetSize();
|
||||
else
|
||||
iPlaySongIndex = GAMESTATE->m_iCurrentStageIndex;
|
||||
iPlaySongIndex = GAMESTATE->m_iSongsIntoCourse;
|
||||
|
||||
GAMESTATE->m_pCurSong = apSongs[iPlaySongIndex];
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
@@ -553,8 +582,12 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
// Check for end of song
|
||||
//
|
||||
if( fSongBeat > GAMESTATE->m_pCurSong->m_fLastBeat+4 )
|
||||
{
|
||||
GAMESTATE->m_fSongBeat = 0;
|
||||
m_soundMusic.Stop();
|
||||
this->SendScreenMessage( SM_NotesEnded, 0 );
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// check for fail
|
||||
//
|
||||
@@ -902,8 +935,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
{
|
||||
m_pLifeMeter[p]->SongEnded(); // let the oni life meter give them back a life
|
||||
|
||||
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ )
|
||||
{
|
||||
RadarCategory rc = (RadarCategory)r;
|
||||
@@ -914,12 +945,21 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
|
||||
GAMESTATE->m_apSongsPlayed.Add( GAMESTATE->m_pCurSong );
|
||||
GAMESTATE->m_iSongsIntoCourse++;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
if( !m_pLifeMeter[p]->FailedEarlier() )
|
||||
GAMESTATE->m_iSongsBeforeFail[p]++;
|
||||
|
||||
GAMESTATE->m_iCurrentStageIndex++;
|
||||
|
||||
if( !IsLastSong() )
|
||||
{
|
||||
LoadNextSong( false );
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
if( !m_pLifeMeter[p]->FailedEarlier() )
|
||||
m_pLifeMeter[p]->SongEnded(); // let the oni life meter give them back a life
|
||||
|
||||
m_OniFade.CloseWipingRight( SM_BeginLoadingNextSong );
|
||||
}
|
||||
else // IsLastSong
|
||||
{
|
||||
@@ -943,6 +983,11 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
break;
|
||||
|
||||
case SM_BeginLoadingNextSong:
|
||||
LoadNextSong( false );
|
||||
m_OniFade.OpenWipingRight( SM_None );
|
||||
break;
|
||||
|
||||
case SM_100Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "ScoreDisplay.h"
|
||||
#include "DifficultyBanner.h"
|
||||
#include "TransitionFadeWipe.h"
|
||||
#include "TransitionOniFade.h"
|
||||
|
||||
|
||||
// messages sent by Combo
|
||||
@@ -78,10 +79,13 @@ private:
|
||||
|
||||
Background m_Background;
|
||||
|
||||
TransitionOniFade m_OniFade; // shows between songs in a course
|
||||
|
||||
ActorFrame m_frameTop;
|
||||
Sprite m_sprTopFrame;
|
||||
LifeMeter* m_pLifeMeter[NUM_PLAYERS];
|
||||
BitmapText m_textStageNumber;
|
||||
BitmapText m_textCourseSongNumber[NUM_PLAYERS];
|
||||
|
||||
ActorFrame m_frameBottom;
|
||||
Sprite m_sprBottomFrame;
|
||||
|
||||
@@ -36,7 +36,7 @@ ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, Prompt
|
||||
m_bAnswer = bDefaultAnswer;
|
||||
|
||||
m_Fade.SetTransitionTime( 0.5f );
|
||||
m_Fade.SetColor( D3DXCOLOR(0,0,0,0.7f) );
|
||||
m_Fade.SetDiffuseColor( D3DXCOLOR(0,0,0,0.7f) );
|
||||
m_Fade.SetOpened();
|
||||
m_Fade.CloseWipingRight();
|
||||
this->AddSubActor( &m_Fade );
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "ScreenStage.h"
|
||||
#include "AnnouncerManager.h"
|
||||
#include "GameState.h"
|
||||
#include "RageMusic.h"
|
||||
|
||||
|
||||
const float COURSE_INFO_FRAME_X = 160;
|
||||
@@ -54,6 +55,12 @@ ScreenSelectCourse::ScreenSelectCourse()
|
||||
{
|
||||
LOG->Trace( "ScreenSelectCourse::ScreenSelectCourse()" );
|
||||
|
||||
if( !MUSIC->IsPlaying() )
|
||||
{
|
||||
MUSIC->Load( THEME->GetPathTo(SOUND_MENU_MUSIC) );
|
||||
MUSIC->Play(true);
|
||||
}
|
||||
|
||||
m_bMadeChoice = false;
|
||||
m_bGoToOptions = false;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ const float DIFFICULTY_ARROW_X[NUM_DIFFICULTY_ITEMS][NUM_PLAYERS] = {
|
||||
|
||||
const float ARROW_SHADOW_OFFSET = 10;
|
||||
|
||||
const float LOCK_INPUT_TIME = 0.50f; // lock input while waiting for tweening to complete
|
||||
const float LOCK_INPUT_TIME = 0.30f; // lock input while waiting for tweening to complete
|
||||
|
||||
|
||||
const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User + 1);
|
||||
|
||||
+14
-14
@@ -696,32 +696,32 @@ bool Song::LoadFromDWIFile( CString sPath )
|
||||
CString sValueName = sParams[0];
|
||||
|
||||
// handle the data
|
||||
if( 0==stricmp(sValueName,"#FILE") )
|
||||
if( 0==stricmp(sValueName,"FILE") )
|
||||
m_sMusicFile = sParams[1];
|
||||
|
||||
else if( 0==stricmp(sValueName,"#TITLE") )
|
||||
else if( 0==stricmp(sValueName,"TITLE") )
|
||||
GetMainAndSubTitlesFromFullTitle( sParams[1], m_sMainTitle, m_sSubTitle );
|
||||
|
||||
else if( 0==stricmp(sValueName,"#ARTIST") )
|
||||
else if( 0==stricmp(sValueName,"ARTIST") )
|
||||
m_sArtist = sParams[1];
|
||||
|
||||
else if( 0==stricmp(sValueName,"#CDTITLE") )
|
||||
else if( 0==stricmp(sValueName,"CDTITLE") )
|
||||
m_sCDTitleFile = sParams[1];
|
||||
|
||||
else if( 0==stricmp(sValueName,"#BPM") )
|
||||
else if( 0==stricmp(sValueName,"BPM") )
|
||||
AddBPMSegment( BPMSegment(0, (float)atof(sParams[1])) );
|
||||
|
||||
else if( 0==stricmp(sValueName,"#GAP") )
|
||||
else if( 0==stricmp(sValueName,"GAP") )
|
||||
// the units of GAP is 1/1000 second
|
||||
m_fBeat0OffsetInSeconds = -atoi( sParams[1] ) / 1000.0f;
|
||||
|
||||
else if( 0==stricmp(sValueName,"#SAMPLESTART") )
|
||||
else if( 0==stricmp(sValueName,"SAMPLESTART") )
|
||||
m_fMusicSampleStartSeconds = TimeToSeconds( sParams[1] );
|
||||
|
||||
else if( 0==stricmp(sValueName,"#SAMPLELENGTH") )
|
||||
else if( 0==stricmp(sValueName,"SAMPLELENGTH") )
|
||||
m_fMusicSampleLengthSeconds = TimeToSeconds( sParams[1] );
|
||||
|
||||
else if( 0==stricmp(sValueName,"#FREEZE") )
|
||||
else if( 0==stricmp(sValueName,"FREEZE") )
|
||||
{
|
||||
CStringArray arrayFreezeExpressions;
|
||||
split( sParams[1], ",", arrayFreezeExpressions );
|
||||
@@ -739,7 +739,7 @@ bool Song::LoadFromDWIFile( CString sPath )
|
||||
}
|
||||
}
|
||||
|
||||
else if( 0==stricmp(sValueName,"#CHANGEBPM") || 0==stricmp(sValueName,"#BPMCHANGE") )
|
||||
else if( 0==stricmp(sValueName,"CHANGEBPM") || 0==stricmp(sValueName,"BPMCHANGE") )
|
||||
{
|
||||
CStringArray arrayBPMChangeExpressions;
|
||||
split( sParams[1], ",", arrayBPMChangeExpressions );
|
||||
@@ -756,10 +756,10 @@ bool Song::LoadFromDWIFile( CString sPath )
|
||||
}
|
||||
}
|
||||
|
||||
else if( 0==stricmp(sValueName,"#SINGLE") ||
|
||||
0==stricmp(sValueName,"#DOUBLE") ||
|
||||
0==stricmp(sValueName,"#COUPLE") ||
|
||||
0==stricmp(sValueName,"#SOLO"))
|
||||
else if( 0==stricmp(sValueName,"SINGLE") ||
|
||||
0==stricmp(sValueName,"DOUBLE") ||
|
||||
0==stricmp(sValueName,"COUPLE") ||
|
||||
0==stricmp(sValueName,"SOLO"))
|
||||
{
|
||||
Notes* pNewNotes = new Notes;
|
||||
pNewNotes->LoadFromDWITokens(
|
||||
|
||||
@@ -134,7 +134,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
|
||||
continue; // ignore it
|
||||
|
||||
// this is a song directory. Load a new song!
|
||||
GAMESTATE->m_sLoadingMessage = ssprintf("Loading songs...\n%s\n\n%s", sGroupDirName, sSongDirName);
|
||||
GAMESTATE->m_sLoadingMessage = ssprintf("Loading songs...\n%s\n%s", sGroupDirName, sSongDirName);
|
||||
if( callback )
|
||||
callback();
|
||||
Song* pNewSong = new Song;
|
||||
|
||||
@@ -286,6 +286,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
|
||||
Render();
|
||||
if( !g_bIsActive && DISPLAY && DISPLAY->IsWindowed() )
|
||||
::Sleep( 0 ); // give some time to other processes
|
||||
#ifdef _DEBUG
|
||||
::Sleep( 1 );
|
||||
#endif
|
||||
}
|
||||
} // end while( WM_QUIT != msg.message )
|
||||
|
||||
@@ -387,10 +390,10 @@ BOOL CALLBACK LoadingWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
||||
case WM_PAINT:
|
||||
{
|
||||
CStringArray asMessageLines;
|
||||
if( GAMESTATE )
|
||||
if( GAMESTATE && GAMESTATE->m_sLoadingMessage != "" )
|
||||
split( GAMESTATE->m_sLoadingMessage, "\n", asMessageLines, false );
|
||||
else
|
||||
asMessageLines.Add( "Initializing hardware" );
|
||||
asMessageLines.Add( "Initializing hardware..." );
|
||||
|
||||
SendDlgItemMessage(
|
||||
hWnd,
|
||||
|
||||
@@ -516,6 +516,12 @@
|
||||
<File
|
||||
RelativePath="TransitionKeepAlive.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="TransitionOniFade.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="TransitionOniFade.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\TransitionRectWipe.cpp">
|
||||
</File>
|
||||
|
||||
@@ -20,7 +20,6 @@ Transition::Transition()
|
||||
m_TransitionState = closed,
|
||||
m_fTransitionTime = DEFAULT_TRANSITION_TIME;
|
||||
m_fPercentThroughTransition = 0.0f;
|
||||
m_Color = D3DXCOLOR(0,0,0,1);
|
||||
}
|
||||
|
||||
Transition::~Transition()
|
||||
|
||||
@@ -53,8 +53,6 @@ public:
|
||||
|
||||
void SetTransitionTime( float fNewTransitionTime ) { m_fTransitionTime = fNewTransitionTime; };
|
||||
|
||||
void SetColor( D3DXCOLOR new_color ) { m_Color = new_color; };
|
||||
|
||||
protected:
|
||||
|
||||
enum TransitionState { opened, closed,
|
||||
@@ -64,7 +62,7 @@ protected:
|
||||
TransitionState m_TransitionState;
|
||||
float m_fTransitionTime;
|
||||
float m_fPercentThroughTransition;
|
||||
float GetPercentageOpen()
|
||||
float GetPercentageOpen()
|
||||
{
|
||||
switch( m_TransitionState )
|
||||
{
|
||||
@@ -83,11 +81,10 @@ protected:
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
float GetPercentageClosed() { return 1-GetPercentageOpen(); };
|
||||
|
||||
|
||||
ScreenMessage m_MessageToSendWhenDone;
|
||||
|
||||
D3DXCOLOR m_Color;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: TransitionFade.cpp
|
||||
Class: TransitionFade
|
||||
|
||||
Desc: Fades out or in.
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -20,6 +21,7 @@
|
||||
TransitionFade::TransitionFade()
|
||||
{
|
||||
m_rect.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) );
|
||||
SetDiffuseColor( D3DXCOLOR(0,0,0,1) ); // black
|
||||
}
|
||||
|
||||
TransitionFade::~TransitionFade()
|
||||
@@ -33,7 +35,7 @@ void TransitionFade::DrawPrimitives()
|
||||
if( fPercentageOpaque == 0 )
|
||||
return; // draw nothing
|
||||
|
||||
D3DXCOLOR colorTemp = m_Color * fPercentageOpaque;
|
||||
D3DXCOLOR colorTemp = m_colorDiffuse[0] * fPercentageOpaque;
|
||||
m_rect.SetDiffuseColor( colorTemp );
|
||||
m_rect.Draw();
|
||||
}
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: TransitionFade.cpp
|
||||
Class: TransitionFade
|
||||
|
||||
Desc: Fades out or in.
|
||||
Desc: Fades whole screen to color.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TransitionFade_H_
|
||||
#define _TransitionFade_H_
|
||||
|
||||
|
||||
#include "Transition.h"
|
||||
#include "RageDisplay.h"
|
||||
#include "RageSound.h"
|
||||
@@ -31,7 +29,3 @@ protected:
|
||||
Quad m_rect;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,97 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: TransitionOniFade
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "RageUtil.h"
|
||||
|
||||
#include "TransitionOniFade.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
TransitionOniFade::TransitionOniFade()
|
||||
{
|
||||
SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // white
|
||||
|
||||
m_quadBackground.StretchTo( CRect(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) );
|
||||
|
||||
m_quadStrip.StretchTo( CRect(SCREEN_LEFT, int(CENTER_Y-30), SCREEN_RIGHT, int(CENTER_Y+30)) );
|
||||
|
||||
m_textSongInfo.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textSongInfo.TurnShadowOff();
|
||||
m_textSongInfo.SetZoom( 0.5f );
|
||||
m_textSongInfo.SetXY( CENTER_X, CENTER_Y );
|
||||
}
|
||||
|
||||
TransitionOniFade::~TransitionOniFade()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void TransitionOniFade::DrawPrimitives()
|
||||
{
|
||||
if( m_TransitionState == opened )
|
||||
return;
|
||||
|
||||
if( m_TransitionState == closed )
|
||||
{
|
||||
UpdateSongText();
|
||||
}
|
||||
|
||||
m_quadBackground.SetDiffuseColor( D3DXCOLOR(1,1,1,SCALE(GetPercentageClosed(),0,1,-1,1)) );
|
||||
m_quadBackground.Draw();
|
||||
|
||||
if( m_TransitionState == closed || m_TransitionState == opening_right )
|
||||
{
|
||||
m_quadStrip.SetDiffuseColor( D3DXCOLOR(0,0,0,SCALE(GetPercentageClosed(),0,1,0,2)) );
|
||||
m_quadStrip.Draw();
|
||||
|
||||
m_textSongInfo.SetDiffuseColor( D3DXCOLOR(1,1,1,SCALE(GetPercentageClosed(),0,1,0,2)) );
|
||||
m_textSongInfo.Draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TransitionOniFade::OpenWipingRight( ScreenMessage send_when_done )
|
||||
{
|
||||
SetTransitionTime( 4 );
|
||||
Transition::OpenWipingRight( send_when_done );
|
||||
UpdateSongText();
|
||||
}
|
||||
|
||||
void TransitionOniFade::OpenWipingLeft( ScreenMessage send_when_done )
|
||||
{
|
||||
SetTransitionTime( 4 );
|
||||
Transition::OpenWipingLeft( send_when_done );
|
||||
UpdateSongText();
|
||||
}
|
||||
|
||||
void TransitionOniFade::CloseWipingRight(ScreenMessage send_when_done )
|
||||
{
|
||||
SetTransitionTime( 2 );
|
||||
Transition::CloseWipingRight( send_when_done );
|
||||
UpdateSongText();
|
||||
}
|
||||
|
||||
void TransitionOniFade::CloseWipingLeft( ScreenMessage send_when_done )
|
||||
{
|
||||
SetTransitionTime( 2 );
|
||||
Transition::CloseWipingLeft( send_when_done );
|
||||
UpdateSongText();
|
||||
}
|
||||
|
||||
void TransitionOniFade::UpdateSongText()
|
||||
{
|
||||
Song* pSong = GAMESTATE->m_pCurSong;
|
||||
ASSERT( pSong );
|
||||
m_textSongInfo.SetText( pSong->GetFullTitle() + "\n" + pSong->m_sArtist + "\n");
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: TransitionOniFade
|
||||
|
||||
Desc: Fade to white and shows song title and artist info.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "Transition.h"
|
||||
#include "RageDisplay.h"
|
||||
#include "RageSound.h"
|
||||
#include "Sprite.h"
|
||||
#include "Quad.h"
|
||||
#include "TransitionFade.h"
|
||||
|
||||
|
||||
class TransitionOniFade : public Transition
|
||||
{
|
||||
public:
|
||||
TransitionOniFade();
|
||||
~TransitionOniFade();
|
||||
|
||||
virtual void DrawPrimitives();
|
||||
|
||||
virtual void OpenWipingRight( ScreenMessage send_when_done = SM_None );
|
||||
virtual void OpenWipingLeft( ScreenMessage send_when_done = SM_None );
|
||||
virtual void CloseWipingRight(ScreenMessage send_when_done = SM_None );
|
||||
virtual void CloseWipingLeft( ScreenMessage send_when_done = SM_None );
|
||||
|
||||
protected:
|
||||
|
||||
void UpdateSongText();
|
||||
|
||||
Quad m_quadBackground;
|
||||
Quad m_quadStrip; // background for song text
|
||||
BitmapText m_textSongInfo;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user