Fixed articts in hold note and life frames.

This commit is contained in:
Chris Danford
2002-10-18 19:01:32 +00:00
parent 1c955f47f6
commit 15fc589cc6
16 changed files with 217 additions and 99 deletions
+1 -1
View File
@@ -333,7 +333,7 @@ void Background::LoadFromSong( Song* pSong )
index = 1; // force the first random background to play first index = 1; // force the first random background to play first
else else
index = 1 + rand()%(m_BGAnimations.GetSize()-1); index = 1 + rand()%(m_BGAnimations.GetSize()-1);
m_aBGSegments.Add( BGSegment(f,index,bFade || f==fFirstBeat) ); m_aBGSegments.Add( BGSegment(f,index,bFade) );
} }
// change BG every BPM change // change BG every BPM change
+10 -5
View File
@@ -23,7 +23,7 @@ InputFilter::InputFilter()
for( int i=0; i<NUM_INPUT_DEVICES; i++ ) for( int i=0; i<NUM_INPUT_DEVICES; i++ )
{ {
for( int j=0; j<NUM_DEVICE_BUTTONS; j++ ) for( int j=0; j<NUM_DEVICE_BUTTONS; j++ )
m_fTimeHeld[i][j] = 0; m_fSecsHeld[i][j] = 0;
} }
} }
@@ -51,6 +51,11 @@ bool InputFilter::IsBeingPressed( DeviceInput di )
return BeingPressed(di, false); return BeingPressed(di, false);
} }
float InputFilter::GetSecsHeld( DeviceInput di )
{
return m_fSecsHeld[di.device][di.button];
}
void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime ) void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime )
{ {
INPUTMAN->Update(); INPUTMAN->Update();
@@ -67,9 +72,9 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime )
{ {
if( IsBeingPressed(di) ) if( IsBeingPressed(di) )
{ {
const float fOldHoldTime = m_fTimeHeld[d][b]; const float fOldHoldTime = m_fSecsHeld[d][b];
m_fTimeHeld[d][b] += fDeltaTime; m_fSecsHeld[d][b] += fDeltaTime;
const float fNewHoldTime = m_fTimeHeld[d][b]; const float fNewHoldTime = m_fSecsHeld[d][b];
float fTimeBetweenRepeats; float fTimeBetweenRepeats;
InputEventType iet; InputEventType iet;
@@ -90,7 +95,7 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime )
} }
} }
else { // !IsBeingPressed(di) else { // !IsBeingPressed(di)
m_fTimeHeld[d][b] = 0; m_fSecsHeld[d][b] = 0;
array.Add( InputEvent(di,IET_RELEASE) ); array.Add( InputEvent(di,IET_RELEASE) );
} }
} }
+2 -1
View File
@@ -43,10 +43,11 @@ public:
bool BeingPressed( DeviceInput di, bool Prev = false); bool BeingPressed( DeviceInput di, bool Prev = false);
bool WasBeingPressed( DeviceInput di ); bool WasBeingPressed( DeviceInput di );
bool IsBeingPressed( DeviceInput di ); bool IsBeingPressed( DeviceInput di );
float GetSecsHeld( DeviceInput di );
void GetInputEvents( InputEventArray &array, float fDeltaTime ); void GetInputEvents( InputEventArray &array, float fDeltaTime );
float m_fTimeHeld[NUM_INPUT_DEVICES][NUM_DEVICE_BUTTONS]; float m_fSecsHeld[NUM_INPUT_DEVICES][NUM_DEVICE_BUTTONS];
}; };
+36 -3
View File
@@ -266,11 +266,9 @@ bool InputMapper::IsButtonDown( GameInput GameI )
DeviceInput DeviceI; DeviceInput DeviceI;
if( GameToDevice( GameI, i, DeviceI ) ) if( GameToDevice( GameI, i, DeviceI ) )
{
if( INPUTFILTER->IsBeingPressed( DeviceI ) ) if( INPUTFILTER->IsBeingPressed( DeviceI ) )
return true; return true;
} }
}
return false; return false;
} }
@@ -286,10 +284,45 @@ bool InputMapper::IsButtonDown( MenuInput MenuI )
return false; return false;
} }
bool InputMapper::IsButtonDown( StyleInput StyleI ) bool InputMapper::IsButtonDown( StyleInput StyleI )
{ {
GameInput GameI; GameInput GameI;
StyleToGame( StyleI, GameI ); StyleToGame( StyleI, GameI );
return IsButtonDown( GameI ); return IsButtonDown( GameI );
} }
float InputMapper::GetSecsHeld( GameInput GameI )
{
float fMaxSecsHeld = 0;
for( int i=0; i<NUM_GAME_TO_DEVICE_SLOTS; i++ )
{
DeviceInput DeviceI;
if( GameToDevice( GameI, i, DeviceI ) )
fMaxSecsHeld = max( fMaxSecsHeld, INPUTFILTER->GetSecsHeld(DeviceI) );
}
return fMaxSecsHeld;
}
float InputMapper::GetSecsHeld( MenuInput MenuI )
{
float fMaxSecsHeld = 0;
GameInput GameI[4];
MenuToGame( MenuI, GameI );
for( int i=0; i<4; i++ )
if( GameI[i].IsValid() )
fMaxSecsHeld = max( fMaxSecsHeld, GetSecsHeld(GameI[i]) );
return fMaxSecsHeld;
}
float InputMapper::GetSecsHeld( StyleInput StyleI )
{
GameInput GameI;
StyleToGame( StyleI, GameI );
return GetSecsHeld( GameI );
}
+4 -1
View File
@@ -52,11 +52,14 @@ public:
void GameToMenu( GameInput GameI, MenuInput &MenuI ); void GameToMenu( GameInput GameI, MenuInput &MenuI );
void MenuToGame( MenuInput MenuI, GameInput GameIout[4] ); void MenuToGame( MenuInput MenuI, GameInput GameIout[4] );
float GetSecsHeld( GameInput GameI );
float GetSecsHeld( MenuInput MenuI );
float GetSecsHeld( StyleInput StyleI );
bool IsButtonDown( GameInput GameI ); bool IsButtonDown( GameInput GameI );
bool IsButtonDown( MenuInput MenuI ); bool IsButtonDown( MenuInput MenuI );
bool IsButtonDown( StyleInput StyleI ); bool IsButtonDown( StyleInput StyleI );
protected: protected:
// all the DeviceInputs that map to a GameInput // all the DeviceInputs that map to a GameInput
DeviceInput m_GItoDI[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS][NUM_GAME_TO_DEVICE_SLOTS]; DeviceInput m_GItoDI[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS][NUM_GAME_TO_DEVICE_SLOTS];
+1 -1
View File
@@ -905,7 +905,7 @@ void NoteData::LoadTransformedSlidingWindow( NoteData* pOriginal, int iNewNumTra
for( int r=0; r<=iLastRow; r++ ) for( int r=0; r<=iLastRow; r++ )
{ {
// copy notes in this measure // copy notes in this measure
for( int t=0; t<=pOriginal->m_iNumTracks; t++ ) for( int t=0; t<pOriginal->m_iNumTracks; t++ )
{ {
int iOldTrack = t; int iOldTrack = t;
int iNewTrack = (iOldTrack + iCurTrackOffset) % iNewNumTracks; int iNewTrack = (iOldTrack + iCurTrackOffset) % iNewNumTracks;
+1
View File
@@ -112,6 +112,7 @@ public:
void Turn( PlayerOptions::TurnType tt ); void Turn( PlayerOptions::TurnType tt );
void MakeLittle(); void MakeLittle();
void SnapToNearestNoteType( NoteType nt, float fBeginBeat, float fEndBeat ) { SnapToNearestNoteType( nt, (NoteType)-1, fBeginBeat, fEndBeat ); }
void SnapToNearestNoteType( NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat ); void SnapToNearestNoteType( NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat );
NoteType GetSmallestNoteTypeForMeasure( int iMeasureIndex ); NoteType GetSmallestNoteTypeForMeasure( int iMeasureIndex );
+9 -5
View File
@@ -227,13 +227,15 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
else else
DISPLAY->SetColorTextureMultDiffuse(); DISPLAY->SetColorTextureMultDiffuse();
DISPLAY->SetAlphaTextureMultDiffuse(); DISPLAY->SetAlphaTextureMultDiffuse();
DISPLAY->EnableTextureWrapping();
DISPLAY->SetTexture( m_sprHoldParts.GetTexture() ); DISPLAY->SetTexture( m_sprHoldParts.GetTexture() );
// //
// Draw the tail // Draw the tail
// //
float fY; float fY;
for( fY=max(fYTailTop,fYHead); fY<fYTailBottom; fY+=fYStep ) // don't draw the part of the tail that is before the middle of the head // HACK: +0.05 below to try and get rid of ugly border at top of tail
for( fY=max(fYTailTop-0.05f,fYHead); fY<fYTailBottom; fY+=fYStep ) // don't draw the part of the tail that is before the middle of the head
{ {
const float fYTop = fY; const float fYTop = fY;
const float fYBottom = fY+min(fYStep, fYTailBottom-fY); const float fYBottom = fY+min(fYStep, fYTailBottom-fY);
@@ -277,7 +279,7 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
// //
// Draw the body // Draw the body
// //
for( fY=fYBodyTop; fY<=fYBodyBottom; fY+=fYStep ) // top to bottom for( fY=fYBodyTop; fY<=fYBodyBottom+1; fY+=fYStep ) // top to bottom
{ {
const float fYTop = fY; const float fYTop = fY;
const float fYBottom = min( fY+fYStep, fYTailTop+1 ); const float fYBottom = min( fY+fYStep, fYTailTop+1 );
@@ -333,8 +335,8 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
const float fXBottomRight = fXBottom + fFrameWidth/2; const float fXBottomRight = fXBottom + fFrameWidth/2;
const float fTopDistFromHeadTop = fYTop - fYHeadTop; const float fTopDistFromHeadTop = fYTop - fYHeadTop;
const float fBottomDistFromHeadTop = fYBottom - fYHeadTop; const float fBottomDistFromHeadTop = fYBottom - fYHeadTop;
const float fTexCoordTop = SCALE( fTopDistFromHeadTop, 0, fFrameHeight, 0.0f, 0.5f ); const float fTexCoordTop = SCALE( fTopDistFromHeadTop, 0, fFrameHeight, 0.0f, 0.499f );
const float fTexCoordBottom = SCALE( fBottomDistFromHeadTop, 0, fFrameHeight, 0.0f, 0.5f ); const float fTexCoordBottom = SCALE( fBottomDistFromHeadTop, 0, fFrameHeight, 0.0f, 0.499f );
ASSERT( fBottomDistFromHeadTop-0.0001 <= fFrameHeight ); ASSERT( fBottomDistFromHeadTop-0.0001 <= fFrameHeight );
const float fTexCoordLeft = bActive ? 0.25f : 0.00f; const float fTexCoordLeft = bActive ? 0.25f : 0.00f;
const float fTexCoordRight = bActive ? 0.50f : 0.25f; const float fTexCoordRight = bActive ? 0.50f : 0.25f;
@@ -378,7 +380,9 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
const D3DXCOLOR colorDiffuse= D3DXCOLOR(fColorScale,fColorScale,fColorScale,fAlpha); const D3DXCOLOR colorDiffuse= D3DXCOLOR(fColorScale,fColorScale,fColorScale,fAlpha);
const D3DXCOLOR colorGlow = D3DXCOLOR(1,1,1,fGlow); const D3DXCOLOR colorGlow = D3DXCOLOR(1,1,1,fGlow);
m_sprHoldParts.SetState( bActive?1:0 ); // m_sprHoldParts.SetState( bActive?1:0 );
// HACK: the border around the edge of on this sprite is super-obvious.
m_sprHoldParts.SetCustomTextureRect( bActive ? FRECT(0.251f,0.002f,0.499f,0.498f) : FRECT(0.001f,0.002f,0.249f,0.498f) );
m_sprHoldParts.SetXY( fX, fY ); m_sprHoldParts.SetXY( fX, fY );
if( bDrawGlowOnly ) if( bDrawGlowOnly )
{ {
+27 -2
View File
@@ -380,8 +380,9 @@ HRESULT RageDisplay::BeginFrame()
// Don't tile texture coords. This creates ugly wrapping artifacts on textures that have to be rescaled. // Don't tile texture coords. This creates ugly wrapping artifacts on textures that have to be rescaled.
//m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, D3DTADDRESS_BORDER ); m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, D3DTADDRESS_BORDER );
//m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, D3DTADDRESS_BORDER ); m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, D3DTADDRESS_BORDER );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_BORDERCOLOR, D3DCOLOR_ARGB(0,0,0,0) );
m_pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX ); m_pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX );
@@ -784,3 +785,27 @@ void RageDisplay::DisableZBuffer()
m_pd3dDevice->SetRenderState( D3DRS_ZENABLE, FALSE ); m_pd3dDevice->SetRenderState( D3DRS_ZENABLE, FALSE );
m_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE ); m_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE );
} }
void RageDisplay::EnableTextureWrapping()
{
DWORD dw0, dw1;
m_pd3dDevice->GetTextureStageState( 0, D3DTSS_ADDRESSU, &dw0 );
m_pd3dDevice->GetTextureStageState( 0, D3DTSS_ADDRESSV, &dw1 );
if( dw0!=D3DTADDRESS_WRAP || dw1!=D3DTADDRESS_WRAP )
FlushQueue();
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP );
}
void RageDisplay::DisableTextureWrapping()
{
DWORD dw0, dw1;
m_pd3dDevice->GetTextureStageState( 0, D3DTSS_ADDRESSU, &dw0 );
m_pd3dDevice->GetTextureStageState( 0, D3DTSS_ADDRESSV, &dw1 );
if( dw0!=D3DTADDRESS_BORDER || dw1!=D3DTADDRESS_BORDER )
FlushQueue();
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, D3DTADDRESS_BORDER );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, D3DTADDRESS_BORDER );
}
+2
View File
@@ -159,6 +159,8 @@ public:
void SetBlendModeAdd(); void SetBlendModeAdd();
void EnableZBuffer(); void EnableZBuffer();
void DisableZBuffer(); void DisableZBuffer();
void EnableTextureWrapping();
void DisableTextureWrapping();
}; };
+66 -49
View File
@@ -20,10 +20,13 @@
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "RageLog.h" #include "RageLog.h"
#include "GameState.h" #include "GameState.h"
#include "InputFilter.h" #include "InputMapper.h"
#include <utility> #include <utility>
const float RECORD_HOLD_THRESHOLD = 0.3f;
// //
// Defines specific to GameScreenTitleMenu // Defines specific to GameScreenTitleMenu
// //
@@ -366,6 +369,34 @@ void ScreenEdit::Update( float fDeltaTime )
GAMESTATE->m_bFreeze = bFreeze; GAMESTATE->m_bFreeze = bFreeze;
if( m_EditMode == MODE_RECORDING )
{
// add or extend holds
for( int t=0; t<GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer; t++ ) // for each track
{
StyleInput StyleI( PLAYER_1, t );
float fSecsHeld = INPUTMAPPER->GetSecsHeld( StyleI );
if( fSecsHeld > RECORD_HOLD_THRESHOLD )
{
// add or extend hold
const float fHoldStartSeconds = m_soundMusic.GetPositionSeconds() - fSecsHeld;
float fStartBeat = m_pSong->GetBeatFromElapsedTime( fHoldStartSeconds );
float fEndBeat = GAMESTATE->m_fSongBeat;
// Round hold start and end to the nearest snap interval
fStartBeat = froundf( fStartBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
fEndBeat = froundf( fEndBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
// create a new hold note
HoldNote newHN = { t, fStartBeat, fEndBeat };
m_NoteFieldRecord.AddHoldNote( newHN );
}
}
}
if( m_EditMode == MODE_RECORDING || m_EditMode == MODE_PLAYING ) if( m_EditMode == MODE_RECORDING || m_EditMode == MODE_PLAYING )
{ {
GAMESTATE->m_fSongBeat = fSongBeat; GAMESTATE->m_fSongBeat = fSongBeat;
@@ -450,14 +481,14 @@ void ScreenEdit::Update( float fDeltaTime )
CString sNoteType; CString sNoteType;
switch( m_SnapDisplay.GetSnapMode() ) switch( m_SnapDisplay.GetNoteType() )
{ {
case NOTE_TYPE_4TH: sNoteType = "quarter notes"; break; case NOTE_TYPE_4TH: sNoteType = "4th notes"; break;
case NOTE_TYPE_8TH: sNoteType = "eighth notes"; break; case NOTE_TYPE_8TH: sNoteType = "8th notes"; break;
case NOTE_TYPE_12TH: sNoteType = "triplets"; break; case NOTE_TYPE_12TH: sNoteType = "12th notes"; break;
case NOTE_TYPE_16TH: sNoteType = "sixteenth notes"; break; case NOTE_TYPE_16TH: sNoteType = "16th notes"; break;
case NOTE_TYPE_24TH: sNoteType = "twentyforth notes"; break; case NOTE_TYPE_24TH: sNoteType = "24th notes"; break;
case NOTE_TYPE_32ND: sNoteType = "thirtysecond notes"; break; case NOTE_TYPE_32ND: sNoteType = "32nd notes"; break;
default: ASSERT(0); default: ASSERT(0);
} }
@@ -738,7 +769,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
{ {
case DIK_UP: case DIK_UP:
case DIK_DOWN: case DIK_DOWN:
fBeatsToMove = NoteTypeToBeat( m_SnapDisplay.GetSnapMode() ); fBeatsToMove = NoteTypeToBeat( m_SnapDisplay.GetNoteType() );
if( DeviceI.button == DIK_UP ) if( DeviceI.button == DIK_UP )
fBeatsToMove *= -1; fBeatsToMove *= -1;
break; break;
@@ -799,7 +830,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
GAMESTATE->m_fSongBeat += fBeatsToMove; GAMESTATE->m_fSongBeat += fBeatsToMove;
GAMESTATE->m_fSongBeat = clamp( GAMESTATE->m_fSongBeat, 0, MAX_BEATS-1 ); GAMESTATE->m_fSongBeat = clamp( GAMESTATE->m_fSongBeat, 0, MAX_BEATS-1 );
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetSnapMode()) ); GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
m_soundChangeLine.Play(); m_soundChangeLine.Play();
} }
break; break;
@@ -1158,52 +1189,38 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ) void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{ {
if(type == IET_RELEASE) return; // don't care if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == DIK_ESCAPE )
if( DeviceI.device == DEVICE_KEYBOARD )
{ {
switch( DeviceI.button )
{
case DIK_ESCAPE:
TransitionFromRecordToEdit(); TransitionFromRecordToEdit();
return; return;
} }
}
switch( StyleI.player )
{
case PLAYER_1:
int iCol;
iCol = StyleI.col;
int iNoteIndex; if( StyleI.player != PLAYER_1 )
iNoteIndex = BeatToNoteRow( GAMESTATE->m_fSongBeat ); return; // ignore
if(iNoteIndex < 0)
const int iCol = StyleI.col;
switch( type )
{
case IET_FIRST_PRESS:
{
// Add a tap
float fBeat = GAMESTATE->m_fSongBeat;
fBeat = froundf( fBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
const int iRow = BeatToNoteRow( fBeat );
if( iRow < 0 )
break; break;
if( type == IET_FIRST_PRESS ) m_NoteFieldRecord.m_TapNotes[iCol][iRow] = '1';
{
m_NoteFieldRecord.m_TapNotes[iCol][iNoteIndex] = '1';
m_NoteFieldRecord.SnapToNearestNoteType( NOTE_TYPE_12TH, NOTE_TYPE_16TH, max(0,GAMESTATE->m_fSongBeat-1), GAMESTATE->m_fSongBeat+1);
m_GrayArrowRowRecord.Step( iCol ); m_GrayArrowRowRecord.Step( iCol );
} }
else break;
{ case IET_SLOW_REPEAT:
const float fHoldEndSeconds = m_soundMusic.GetPositionSeconds(); case IET_FAST_REPEAT:
const float fHoldStartSeconds = m_soundMusic.GetPositionSeconds() - TIME_BEFORE_SLOW_REPEATS * m_soundMusic.GetPlaybackRate() * 1.2f; // 1.2 is a fudge. This doesn't compensate enough for the repeat delay and leaves a tap note near the head of the hold. case IET_RELEASE:
// don't add or extend holds here
float fStartBeat, fEndBeat, fThrowAway;
bool bFreeze;
m_pSong->GetBeatAndBPSFromElapsedTime( fHoldStartSeconds, fStartBeat, fThrowAway, bFreeze );
m_pSong->GetBeatAndBPSFromElapsedTime( fHoldEndSeconds, fEndBeat, fThrowAway, bFreeze );
// create a new hold note
HoldNote newHN;
newHN.m_iTrack = iCol;
newHN.m_fStartBeat = fStartBeat;
newHN.m_fEndBeat = fEndBeat;
m_NoteFieldRecord.AddHoldNote( newHN );
m_NoteFieldRecord.SnapToNearestNoteType( NOTE_TYPE_12TH, NOTE_TYPE_16TH, max(0,GAMESTATE->m_fSongBeat-2), GAMESTATE->m_fSongBeat+2);
}
break; break;
} }
} }
@@ -1375,7 +1392,7 @@ void ScreenEdit::TransitionToEdit()
m_rectRecordBack.SetTweenDiffuse( D3DXCOLOR(0,0,0,0) ); m_rectRecordBack.SetTweenDiffuse( D3DXCOLOR(0,0,0,0) );
/* Make sure we're snapped. */ /* Make sure we're snapped. */
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetSnapMode()) ); GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
/* Playing and recording have lead-ins, which may start before beat 0; /* Playing and recording have lead-ins, which may start before beat 0;
* make sure we don't stay there if we escaped out early. */ * make sure we don't stay there if we escaped out early. */
@@ -1415,7 +1432,7 @@ void ScreenEdit::OnSnapModeChange()
{ {
m_soundChangeSnap.Play(); m_soundChangeSnap.Play();
NoteType nt = m_SnapDisplay.GetSnapMode(); NoteType nt = m_SnapDisplay.GetNoteType();
int iStepIndex = BeatToNoteRow( GAMESTATE->m_fSongBeat ); int iStepIndex = BeatToNoteRow( GAMESTATE->m_fSongBeat );
int iElementsPerNoteType = BeatToNoteRow( NoteTypeToBeat(nt) ); int iElementsPerNoteType = BeatToNoteRow( NoteTypeToBeat(nt) );
int iStepIndexHangover = iStepIndex % iElementsPerNoteType; int iStepIndexHangover = iStepIndex % iElementsPerNoteType;
+12
View File
@@ -101,6 +101,7 @@ const ScreenMessage SM_GoToSelectMusic = ScreenMessage(SM_User+1);
const ScreenMessage SM_GoToSelectCourse = ScreenMessage(SM_User+2); const ScreenMessage SM_GoToSelectCourse = ScreenMessage(SM_User+2);
const ScreenMessage SM_GoToFinalEvaluation = ScreenMessage(SM_User+3); const ScreenMessage SM_GoToFinalEvaluation = ScreenMessage(SM_User+3);
const ScreenMessage SM_GoToMusicScroll = ScreenMessage(SM_User+4); const ScreenMessage SM_GoToMusicScroll = ScreenMessage(SM_User+4);
const ScreenMessage SM_PlayCheer = ScreenMessage(SM_User+5);
ScreenEvaluation::ScreenEvaluation( bool bSummary ) ScreenEvaluation::ScreenEvaluation( bool bSummary )
@@ -609,6 +610,14 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
} }
} }
switch( max_grade )
{
case GRADE_AA:
case GRADE_AAA:
this->SendScreenMessage( SM_PlayCheer, 3 );
break;
}
m_Menu.TweenOnScreenFromBlack( SM_None ); m_Menu.TweenOnScreenFromBlack( SM_None );
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","evaluation music") ); MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","evaluation music") );
@@ -817,6 +826,9 @@ void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
case SM_GoToFinalEvaluation: case SM_GoToFinalEvaluation:
SCREENMAN->SetNewScreen( "ScreenFinalEvaluation" ); SCREENMAN->SetNewScreen( "ScreenFinalEvaluation" );
break; break;
case SM_PlayCheer:
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation cheer") );
break;
} }
} }
+12 -12
View File
@@ -183,6 +183,18 @@ ScreenGameplay::ScreenGameplay()
m_sprMiddleFrame.SetXY( MIDDLE_FRAME_X, MIDDLE_FRAME_Y ); m_sprMiddleFrame.SetXY( MIDDLE_FRAME_X, MIDDLE_FRAME_Y );
// LifeFrame goes below LifeMeter
CString sLifeFrameName;
if( bExtra )
sLifeFrameName = "gameplay extra life frame";
else if( GAMESTATE->m_SongOptions.m_LifeType == SongOptions::LIFE_BATTERY )
sLifeFrameName = "gameplay oni life frame";
else
sLifeFrameName = "gameplay life frame";
m_sprLifeFrame.Load( THEME->GetPathTo("Graphics",sLifeFrameName) );
m_sprLifeFrame.SetXY( LIFE_FRAME_X, LIFE_FRAME_Y(bExtra) );
this->AddChild( &m_sprLifeFrame );
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
{ {
switch( GAMESTATE->m_SongOptions.m_LifeType ) switch( GAMESTATE->m_SongOptions.m_LifeType )
@@ -202,18 +214,6 @@ ScreenGameplay::ScreenGameplay()
this->AddChild( m_pLifeMeter[p] ); this->AddChild( m_pLifeMeter[p] );
} }
// LifeFrame goes above LifeMeter
CString sLifeFrameName;
if( bExtra )
sLifeFrameName = "gameplay extra life frame";
else if( GAMESTATE->m_SongOptions.m_LifeType == SongOptions::LIFE_BATTERY )
sLifeFrameName = "gameplay oni life frame";
else
sLifeFrameName = "gameplay life frame";
m_sprLifeFrame.Load( THEME->GetPathTo("Graphics",sLifeFrameName) );
m_sprLifeFrame.SetXY( LIFE_FRAME_X, LIFE_FRAME_Y(bExtra) );
this->AddChild( &m_sprLifeFrame );
m_textStageNumber.LoadFromFont( THEME->GetPathTo("Fonts","gameplay stage") ); m_textStageNumber.LoadFromFont( THEME->GetPathTo("Fonts","gameplay stage") );
m_textStageNumber.TurnShadowOff(); m_textStageNumber.TurnShadowOff();
+1 -1
View File
@@ -29,7 +29,7 @@ public:
bool PrevSnapMode(); bool PrevSnapMode();
bool NextSnapMode(); bool NextSnapMode();
NoteType GetSnapMode() { return m_NoteType; }; NoteType GetNoteType() { return m_NoteType; };
protected: protected:
int m_iNumCols; int m_iNumCols;
+14 -6
View File
@@ -194,12 +194,13 @@ void Sprite::DrawPrimitives()
::Sleep( PREFSMAN->m_iMovieDecodeMS ); // let the movie decode a frame ::Sleep( PREFSMAN->m_iMovieDecodeMS ); // let the movie decode a frame
// offset so that pixels are aligned to texels // Offset so that pixels are aligned to texels
if( PREFSMAN->m_iDisplayResolution == 320 ) // Offset by -0.5, -0.5 if 640x480
DISPLAY->TranslateLocal( -1, -1, 0 ); // Offset by -1.0, -1.0 if 320x240
else DISPLAY->TranslateLocal(
DISPLAY->TranslateLocal( -0.5f, -0.5f, 0 ); -0.5f*SCREEN_WIDTH/(float)PREFSMAN->m_iDisplayResolution,
-0.5f*SCREEN_WIDTH/(float)PREFSMAN->GetDisplayHeight(),
0 );
// use m_temp_* variables to draw the object // use m_temp_* variables to draw the object
FRECT quadVerticies; FRECT quadVerticies;
@@ -235,6 +236,8 @@ void Sprite::DrawPrimitives()
v[1].t = D3DXVECTOR2( m_CustomTexCoords[2], m_CustomTexCoords[3] ); // top left v[1].t = D3DXVECTOR2( m_CustomTexCoords[2], m_CustomTexCoords[3] ); // top left
v[2].t = D3DXVECTOR2( m_CustomTexCoords[4], m_CustomTexCoords[5] ); // bottom right v[2].t = D3DXVECTOR2( m_CustomTexCoords[4], m_CustomTexCoords[5] ); // bottom right
v[3].t = D3DXVECTOR2( m_CustomTexCoords[6], m_CustomTexCoords[7] ); // top right v[3].t = D3DXVECTOR2( m_CustomTexCoords[6], m_CustomTexCoords[7] ); // top right
DISPLAY->EnableTextureWrapping();
} }
else else
{ {
@@ -245,6 +248,11 @@ void Sprite::DrawPrimitives()
v[1].t = D3DXVECTOR2( pTexCoordRect->left, pTexCoordRect->top ); // top left v[1].t = D3DXVECTOR2( pTexCoordRect->left, pTexCoordRect->top ); // top left
v[2].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->bottom ); // bottom right v[2].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->bottom ); // bottom right
v[3].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->top ); // top right v[3].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->top ); // top right
// if the texture has more than one frame, we're going to get border mess from the
// neighboring frame, so don't bother turning wrapping off.
if( m_pTexture->GetNumFrames() == 1 )
DISPLAY->DisableTextureWrapping();
} }
+7
View File
@@ -177,6 +177,13 @@ public:
return m_BackgroundChanges[i].m_sBGName; return m_BackgroundChanges[i].m_sBGName;
}; };
void GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut, bool &bFreezeOut ) const; void GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut, bool &bFreezeOut ) const;
float GetBeatFromElapsedTime( float fElapsedTime ) const // shortcut for places that care only about the beat
{
float fBeat, fThrowAway;
bool bThrowAway;
GetBeatAndBPSFromElapsedTime( fElapsedTime, fBeat, fThrowAway, bThrowAway );
return fBeat;
}
float GetElapsedTimeFromBeat( float fBeat ) const; float GetElapsedTimeFromBeat( float fBeat ) const;