autosync screen cleanup

This commit is contained in:
Chris Danford
2006-02-06 06:50:10 +00:00
parent 1e19360944
commit 1fb529668c
3 changed files with 39 additions and 1 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ void AdjustSync::HandleAutosync( float fNoteOffBySeconds )
ASSERT(0);
}
if( stddev < .03 && stddev < fabsf(mean) ) // If they stepped with less than .03 error
if( stddev < .03 ) // If they stepped with less than .03 error
{
switch( GAMESTATE->m_SongOptions.m_AutosyncType )
{
@@ -5,6 +5,7 @@
#include "GameManager.h"
#include "PrefsManager.h"
#include "AdjustSync.h"
#include "ScreenDimensions.h"
REGISTER_SCREEN_CLASS( ScreenGameplaySyncMachine );
@@ -35,6 +36,22 @@ void ScreenGameplaySyncMachine::Init()
GAMESTATE->m_bGameplayLeadIn.Set( false );
m_DancingState = STATE_DANCING;
m_textSyncInfo.LoadFromFont( THEME->GetPathF("Common","normal") );
m_textSyncInfo.SetXY( SCREEN_CENTER_X+160, SCREEN_CENTER_Y );
m_textSyncInfo.SetDiffuse( RageColor(1,1,1,1) );
m_textSyncInfo.SetZoom( 0.6f );
this->AddChild( &m_textSyncInfo );
this->SubscribeToMessage( Message_AutosyncChanged );
RefreshText();
}
void ScreenGameplaySyncMachine::Update( float fDelta )
{
ScreenGameplayNormal::Update( fDelta );
RefreshText();
}
void ScreenGameplaySyncMachine::HandleScreenMessage( const ScreenMessage SM )
@@ -64,6 +81,19 @@ void ScreenGameplaySyncMachine::ResetAndRestartCurrentSong()
StartPlayingSong( 4, 0 );
}
void ScreenGameplaySyncMachine::RefreshText()
{
float fNew = PREFSMAN->m_fGlobalOffsetSeconds;
float fOld = AdjustSync::s_fGlobalOffsetSecondsOriginal;
RString s;
s += ssprintf( "Old offset: %0.3f\n", fOld );
s += ssprintf( "New offset: %0.3f\n", fNew );
s += ssprintf( "Collecting sample: %d / %d", AdjustSync::s_iAutosyncOffsetSample+1, SAMPLE_COUNT );
m_textSyncInfo.SetText( s );
}
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
@@ -10,11 +10,19 @@ class ScreenGameplaySyncMachine : public ScreenGameplayNormal
public:
virtual void Init();
virtual void Update( float fDelta );
virtual ScreenType GetScreenType() const { return system_menu; }
void HandleScreenMessage( const ScreenMessage SM );
void ResetAndRestartCurrentSong();
protected:
void RefreshText();
Song m_Song;
const Steps *m_pSteps;
BitmapText m_textSyncInfo;
};
#endif