Fixed articts in hold note and life frames.
This commit is contained in:
@@ -333,7 +333,7 @@ void Background::LoadFromSong( Song* pSong )
|
||||
index = 1; // force the first random background to play first
|
||||
else
|
||||
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
|
||||
|
||||
@@ -23,7 +23,7 @@ InputFilter::InputFilter()
|
||||
for( int i=0; i<NUM_INPUT_DEVICES; i++ )
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
float InputFilter::GetSecsHeld( DeviceInput di )
|
||||
{
|
||||
return m_fSecsHeld[di.device][di.button];
|
||||
}
|
||||
|
||||
void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime )
|
||||
{
|
||||
INPUTMAN->Update();
|
||||
@@ -67,9 +72,9 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime )
|
||||
{
|
||||
if( IsBeingPressed(di) )
|
||||
{
|
||||
const float fOldHoldTime = m_fTimeHeld[d][b];
|
||||
m_fTimeHeld[d][b] += fDeltaTime;
|
||||
const float fNewHoldTime = m_fTimeHeld[d][b];
|
||||
const float fOldHoldTime = m_fSecsHeld[d][b];
|
||||
m_fSecsHeld[d][b] += fDeltaTime;
|
||||
const float fNewHoldTime = m_fSecsHeld[d][b];
|
||||
|
||||
float fTimeBetweenRepeats;
|
||||
InputEventType iet;
|
||||
@@ -90,7 +95,7 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime )
|
||||
}
|
||||
}
|
||||
else { // !IsBeingPressed(di)
|
||||
m_fTimeHeld[d][b] = 0;
|
||||
m_fSecsHeld[d][b] = 0;
|
||||
array.Add( InputEvent(di,IET_RELEASE) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +43,11 @@ public:
|
||||
bool BeingPressed( DeviceInput di, bool Prev = false);
|
||||
bool WasBeingPressed( DeviceInput di );
|
||||
bool IsBeingPressed( DeviceInput di );
|
||||
float GetSecsHeld( DeviceInput di );
|
||||
|
||||
void GetInputEvents( InputEventArray &array, float fDeltaTime );
|
||||
|
||||
float m_fTimeHeld[NUM_INPUT_DEVICES][NUM_DEVICE_BUTTONS];
|
||||
float m_fSecsHeld[NUM_INPUT_DEVICES][NUM_DEVICE_BUTTONS];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -266,10 +266,8 @@ bool InputMapper::IsButtonDown( GameInput GameI )
|
||||
DeviceInput DeviceI;
|
||||
|
||||
if( GameToDevice( GameI, i, DeviceI ) )
|
||||
{
|
||||
if( INPUTFILTER->IsBeingPressed( DeviceI ) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -286,10 +284,45 @@ bool InputMapper::IsButtonDown( MenuInput MenuI )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool InputMapper::IsButtonDown( StyleInput StyleI )
|
||||
{
|
||||
GameInput GameI;
|
||||
StyleToGame( StyleI, 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 );
|
||||
}
|
||||
|
||||
@@ -52,11 +52,14 @@ public:
|
||||
void GameToMenu( GameInput GameI, MenuInput &MenuI );
|
||||
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( MenuInput MenuI );
|
||||
bool IsButtonDown( StyleInput StyleI );
|
||||
|
||||
|
||||
protected:
|
||||
// all the DeviceInputs that map to a GameInput
|
||||
DeviceInput m_GItoDI[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS][NUM_GAME_TO_DEVICE_SLOTS];
|
||||
|
||||
@@ -905,7 +905,7 @@ void NoteData::LoadTransformedSlidingWindow( NoteData* pOriginal, int iNewNumTra
|
||||
for( int r=0; r<=iLastRow; r++ )
|
||||
{
|
||||
// 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 iNewTrack = (iOldTrack + iCurTrackOffset) % iNewNumTracks;
|
||||
|
||||
@@ -112,6 +112,7 @@ public:
|
||||
void Turn( PlayerOptions::TurnType tt );
|
||||
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 );
|
||||
|
||||
NoteType GetSmallestNoteTypeForMeasure( int iMeasureIndex );
|
||||
|
||||
@@ -227,13 +227,15 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
||||
else
|
||||
DISPLAY->SetColorTextureMultDiffuse();
|
||||
DISPLAY->SetAlphaTextureMultDiffuse();
|
||||
DISPLAY->EnableTextureWrapping();
|
||||
DISPLAY->SetTexture( m_sprHoldParts.GetTexture() );
|
||||
|
||||
//
|
||||
// Draw the tail
|
||||
//
|
||||
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 fYBottom = fY+min(fYStep, fYTailBottom-fY);
|
||||
@@ -277,7 +279,7 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
||||
//
|
||||
// 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 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 fTopDistFromHeadTop = fYTop - fYHeadTop;
|
||||
const float fBottomDistFromHeadTop = fYBottom - fYHeadTop;
|
||||
const float fTexCoordTop = SCALE( fTopDistFromHeadTop, 0, fFrameHeight, 0.0f, 0.5f );
|
||||
const float fTexCoordBottom = SCALE( fBottomDistFromHeadTop, 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.499f );
|
||||
ASSERT( fBottomDistFromHeadTop-0.0001 <= fFrameHeight );
|
||||
const float fTexCoordLeft = bActive ? 0.25f : 0.00f;
|
||||
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 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 );
|
||||
if( bDrawGlowOnly )
|
||||
{
|
||||
|
||||
@@ -380,8 +380,9 @@ HRESULT RageDisplay::BeginFrame()
|
||||
|
||||
|
||||
// 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_ADDRESSV, D3DTADDRESS_BORDER );
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, 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 );
|
||||
@@ -784,3 +785,27 @@ void RageDisplay::DisableZBuffer()
|
||||
m_pd3dDevice->SetRenderState( D3DRS_ZENABLE, 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 );
|
||||
}
|
||||
|
||||
@@ -159,6 +159,8 @@ public:
|
||||
void SetBlendModeAdd();
|
||||
void EnableZBuffer();
|
||||
void DisableZBuffer();
|
||||
void EnableTextureWrapping();
|
||||
void DisableTextureWrapping();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -20,10 +20,13 @@
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "RageLog.h"
|
||||
#include "GameState.h"
|
||||
#include "InputFilter.h"
|
||||
#include "InputMapper.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
|
||||
const float RECORD_HOLD_THRESHOLD = 0.3f;
|
||||
|
||||
//
|
||||
// Defines specific to GameScreenTitleMenu
|
||||
//
|
||||
@@ -366,6 +369,34 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
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 )
|
||||
{
|
||||
GAMESTATE->m_fSongBeat = fSongBeat;
|
||||
@@ -450,14 +481,14 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
|
||||
|
||||
CString sNoteType;
|
||||
switch( m_SnapDisplay.GetSnapMode() )
|
||||
switch( m_SnapDisplay.GetNoteType() )
|
||||
{
|
||||
case NOTE_TYPE_4TH: sNoteType = "quarter notes"; break;
|
||||
case NOTE_TYPE_8TH: sNoteType = "eighth notes"; break;
|
||||
case NOTE_TYPE_12TH: sNoteType = "triplets"; break;
|
||||
case NOTE_TYPE_16TH: sNoteType = "sixteenth notes"; break;
|
||||
case NOTE_TYPE_24TH: sNoteType = "twentyforth notes"; break;
|
||||
case NOTE_TYPE_32ND: sNoteType = "thirtysecond notes"; break;
|
||||
case NOTE_TYPE_4TH: sNoteType = "4th notes"; break;
|
||||
case NOTE_TYPE_8TH: sNoteType = "8th notes"; break;
|
||||
case NOTE_TYPE_12TH: sNoteType = "12th notes"; break;
|
||||
case NOTE_TYPE_16TH: sNoteType = "16th notes"; break;
|
||||
case NOTE_TYPE_24TH: sNoteType = "24th notes"; break;
|
||||
case NOTE_TYPE_32ND: sNoteType = "32nd notes"; break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
|
||||
@@ -738,7 +769,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
{
|
||||
case DIK_UP:
|
||||
case DIK_DOWN:
|
||||
fBeatsToMove = NoteTypeToBeat( m_SnapDisplay.GetSnapMode() );
|
||||
fBeatsToMove = NoteTypeToBeat( m_SnapDisplay.GetNoteType() );
|
||||
if( DeviceI.button == DIK_UP )
|
||||
fBeatsToMove *= -1;
|
||||
break;
|
||||
@@ -799,7 +830,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
|
||||
GAMESTATE->m_fSongBeat += fBeatsToMove;
|
||||
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();
|
||||
}
|
||||
break;
|
||||
@@ -1158,53 +1189,39 @@ 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 )
|
||||
{
|
||||
if(type == IET_RELEASE) return; // don't care
|
||||
if( DeviceI.device == DEVICE_KEYBOARD )
|
||||
if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == DIK_ESCAPE )
|
||||
{
|
||||
switch( DeviceI.button )
|
||||
{
|
||||
case DIK_ESCAPE:
|
||||
TransitionFromRecordToEdit();
|
||||
return;
|
||||
}
|
||||
TransitionFromRecordToEdit();
|
||||
return;
|
||||
}
|
||||
switch( StyleI.player )
|
||||
{
|
||||
case PLAYER_1:
|
||||
int iCol;
|
||||
iCol = StyleI.col;
|
||||
|
||||
int iNoteIndex;
|
||||
iNoteIndex = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
if(iNoteIndex < 0)
|
||||
if( StyleI.player != PLAYER_1 )
|
||||
return; // ignore
|
||||
|
||||
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;
|
||||
|
||||
if( type == IET_FIRST_PRESS )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
else
|
||||
{
|
||||
const float fHoldEndSeconds = m_soundMusic.GetPositionSeconds();
|
||||
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.
|
||||
|
||||
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;
|
||||
m_NoteFieldRecord.m_TapNotes[iCol][iRow] = '1';
|
||||
m_GrayArrowRowRecord.Step( iCol );
|
||||
}
|
||||
break;
|
||||
case IET_SLOW_REPEAT:
|
||||
case IET_FAST_REPEAT:
|
||||
case IET_RELEASE:
|
||||
// don't add or extend holds here
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1375,7 +1392,7 @@ void ScreenEdit::TransitionToEdit()
|
||||
m_rectRecordBack.SetTweenDiffuse( D3DXCOLOR(0,0,0,0) );
|
||||
|
||||
/* 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;
|
||||
* make sure we don't stay there if we escaped out early. */
|
||||
@@ -1415,7 +1432,7 @@ void ScreenEdit::OnSnapModeChange()
|
||||
{
|
||||
m_soundChangeSnap.Play();
|
||||
|
||||
NoteType nt = m_SnapDisplay.GetSnapMode();
|
||||
NoteType nt = m_SnapDisplay.GetNoteType();
|
||||
int iStepIndex = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
int iElementsPerNoteType = BeatToNoteRow( NoteTypeToBeat(nt) );
|
||||
int iStepIndexHangover = iStepIndex % iElementsPerNoteType;
|
||||
|
||||
@@ -101,6 +101,7 @@ const ScreenMessage SM_GoToSelectMusic = ScreenMessage(SM_User+1);
|
||||
const ScreenMessage SM_GoToSelectCourse = ScreenMessage(SM_User+2);
|
||||
const ScreenMessage SM_GoToFinalEvaluation = ScreenMessage(SM_User+3);
|
||||
const ScreenMessage SM_GoToMusicScroll = ScreenMessage(SM_User+4);
|
||||
const ScreenMessage SM_PlayCheer = ScreenMessage(SM_User+5);
|
||||
|
||||
|
||||
ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
@@ -592,11 +593,11 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
case RM_ARCADE_SUMMARY:
|
||||
switch( max_grade )
|
||||
{
|
||||
case GRADE_E: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final e") ); break;
|
||||
case GRADE_D: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final d") ); break;
|
||||
case GRADE_C: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final c") ); break;
|
||||
case GRADE_B: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final b") ); break;
|
||||
case GRADE_A: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final a") ); break;
|
||||
case GRADE_E: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final e") ); break;
|
||||
case GRADE_D: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final d") ); break;
|
||||
case GRADE_C: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final c") ); break;
|
||||
case GRADE_B: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final b") ); break;
|
||||
case GRADE_A: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final a") ); break;
|
||||
case GRADE_AA: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final aa") ); break;
|
||||
case GRADE_AAA: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation final aaa") ); break;
|
||||
case GRADE_NO_DATA:
|
||||
@@ -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 );
|
||||
|
||||
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","evaluation music") );
|
||||
@@ -817,6 +826,9 @@ void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
case SM_GoToFinalEvaluation:
|
||||
SCREENMAN->SetNewScreen( "ScreenFinalEvaluation" );
|
||||
break;
|
||||
case SM_PlayCheer:
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("evaluation cheer") );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,6 +183,18 @@ ScreenGameplay::ScreenGameplay()
|
||||
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++ )
|
||||
{
|
||||
switch( GAMESTATE->m_SongOptions.m_LifeType )
|
||||
@@ -202,18 +214,6 @@ ScreenGameplay::ScreenGameplay()
|
||||
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.TurnShadowOff();
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
bool PrevSnapMode();
|
||||
bool NextSnapMode();
|
||||
|
||||
NoteType GetSnapMode() { return m_NoteType; };
|
||||
NoteType GetNoteType() { return m_NoteType; };
|
||||
|
||||
protected:
|
||||
int m_iNumCols;
|
||||
|
||||
@@ -194,12 +194,13 @@ void Sprite::DrawPrimitives()
|
||||
::Sleep( PREFSMAN->m_iMovieDecodeMS ); // let the movie decode a frame
|
||||
|
||||
|
||||
// offset so that pixels are aligned to texels
|
||||
if( PREFSMAN->m_iDisplayResolution == 320 )
|
||||
DISPLAY->TranslateLocal( -1, -1, 0 );
|
||||
else
|
||||
DISPLAY->TranslateLocal( -0.5f, -0.5f, 0 );
|
||||
|
||||
// Offset so that pixels are aligned to texels
|
||||
// Offset by -0.5, -0.5 if 640x480
|
||||
// Offset by -1.0, -1.0 if 320x240
|
||||
DISPLAY->TranslateLocal(
|
||||
-0.5f*SCREEN_WIDTH/(float)PREFSMAN->m_iDisplayResolution,
|
||||
-0.5f*SCREEN_WIDTH/(float)PREFSMAN->GetDisplayHeight(),
|
||||
0 );
|
||||
|
||||
// use m_temp_* variables to draw the object
|
||||
FRECT quadVerticies;
|
||||
@@ -235,6 +236,8 @@ void Sprite::DrawPrimitives()
|
||||
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[3].t = D3DXVECTOR2( m_CustomTexCoords[6], m_CustomTexCoords[7] ); // top right
|
||||
|
||||
DISPLAY->EnableTextureWrapping();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -245,6 +248,11 @@ void Sprite::DrawPrimitives()
|
||||
v[1].t = D3DXVECTOR2( pTexCoordRect->left, pTexCoordRect->top ); // top left
|
||||
v[2].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->bottom ); // bottom 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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -177,6 +177,13 @@ public:
|
||||
return m_BackgroundChanges[i].m_sBGName;
|
||||
};
|
||||
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;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user