cleanup
handle lights via autogen as originally suggested
This commit is contained in:
@@ -150,20 +150,8 @@ void LightsManager::Update( float fDeltaTime )
|
|||||||
break;
|
break;
|
||||||
case LIGHTSMODE_DEMONSTRATION:
|
case LIGHTSMODE_DEMONSTRATION:
|
||||||
case LIGHTSMODE_GAMEPLAY:
|
case LIGHTSMODE_GAMEPLAY:
|
||||||
{
|
FOREACH_CabinetLight( cl )
|
||||||
|
m_LightsState.m_bCabinetLights[cl] = m_fSecsLeftInCabinetLightBlink[cl] > 0;
|
||||||
if (PREFSMAN->m_bLightsOrOutput)
|
|
||||||
{
|
|
||||||
bool bOn=false;
|
|
||||||
FOREACH_CabinetLight( cl )
|
|
||||||
bOn = (m_fSecsLeftInCabinetLightBlink[cl] > 0) || bOn;
|
|
||||||
FOREACH_CabinetLight( cl )
|
|
||||||
m_LightsState.m_bCabinetLights[cl] = bOn;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
FOREACH_CabinetLight( cl )
|
|
||||||
m_LightsState.m_bCabinetLights[cl] = m_fSecsLeftInCabinetLightBlink[cl] > 0 ;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case LIGHTSMODE_STAGE:
|
case LIGHTSMODE_STAGE:
|
||||||
case LIGHTSMODE_ALL_CLEARED:
|
case LIGHTSMODE_ALL_CLEARED:
|
||||||
|
|||||||
@@ -263,6 +263,41 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in_, CString ¬es_out,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NoteDataUtil::LoadTransformedLights( const NoteData &in, NoteData &out, int iNewNumTracks )
|
||||||
|
{
|
||||||
|
// reset all notes
|
||||||
|
out.Init();
|
||||||
|
|
||||||
|
NoteData Original;
|
||||||
|
Original.To4s( in );
|
||||||
|
|
||||||
|
out.Config(in);
|
||||||
|
out.SetNumTracks( iNewNumTracks );
|
||||||
|
|
||||||
|
for( int r=0; r < Original.GetMaxRow(); ++r )
|
||||||
|
{
|
||||||
|
if( Original.IsRowEmpty( r ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Enable every track in the output. If there are any hold notes in the source
|
||||||
|
* on this row, output hold notes; otherwise tap notes. This is to 1: prevent
|
||||||
|
* converting everything to hold notes, and 2: so if it's written to an SM, we
|
||||||
|
* don't write huge streams of tap notes. */
|
||||||
|
bool bHoldNoteOnThisRow = false;
|
||||||
|
for( int t=0; t<Original.GetNumTracks(); t++ )
|
||||||
|
if( Original.GetTapNote( t, r ) == TAP_HOLD )
|
||||||
|
bHoldNoteOnThisRow = true;
|
||||||
|
|
||||||
|
for( int t=0; t<out.GetNumTracks(); t++ )
|
||||||
|
{
|
||||||
|
TapNote tn = bHoldNoteOnThisRow? TAP_HOLD:TAP_TAP;
|
||||||
|
out.SetTapNote( t, r, tn );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
out.Convert4sToHoldNotes();
|
||||||
|
}
|
||||||
|
|
||||||
float NoteDataUtil::GetRadarValue( const NoteData &in, RadarCategory rv, float fSongSeconds )
|
float NoteDataUtil::GetRadarValue( const NoteData &in, RadarCategory rv, float fSongSeconds )
|
||||||
{
|
{
|
||||||
switch( rv )
|
switch( rv )
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace NoteDataUtil
|
|||||||
NoteType GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex );
|
NoteType GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex );
|
||||||
void LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData, CString sSMAttackData );
|
void LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData, CString sSMAttackData );
|
||||||
void GetSMNoteDataString( const NoteData &in, CString ¬es_out, CString &attacks_out );
|
void GetSMNoteDataString( const NoteData &in, CString ¬es_out, CString &attacks_out );
|
||||||
|
void LoadTransformedLights( const NoteData &in, NoteData &out, int iNewNumTracks );
|
||||||
|
|
||||||
float GetStreamRadarValue( const NoteData &in, float fSongSeconds );
|
float GetStreamRadarValue( const NoteData &in, float fSongSeconds );
|
||||||
float GetVoltageRadarValue( const NoteData &in, float fSongSeconds );
|
float GetVoltageRadarValue( const NoteData &in, float fSongSeconds );
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our pro
|
|||||||
|
|
||||||
const float DEFAULT_SOUND_VOLUME = 1.00f;
|
const float DEFAULT_SOUND_VOLUME = 1.00f;
|
||||||
const CString DEFAULT_LIGHTS_DRIVER = "Null";
|
const CString DEFAULT_LIGHTS_DRIVER = "Null";
|
||||||
const CString DEFAULT_LIGHTS_STEPS_TYPE = "lights-cabinet";
|
|
||||||
const CString DEFAULT_LIGHTS_STEPS_DIFFICULTY = "standard";
|
|
||||||
|
|
||||||
bool g_bAutoRestart = false;
|
bool g_bAutoRestart = false;
|
||||||
|
|
||||||
@@ -266,10 +264,7 @@ void PrefsManager::Init()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_sLightsDriver = DEFAULT_LIGHTS_DRIVER;
|
m_sLightsDriver = DEFAULT_LIGHTS_DRIVER;
|
||||||
m_sLightsStepsType = DEFAULT_LIGHTS_STEPS_TYPE;
|
m_sLightsStepsDifficulty = "medium";
|
||||||
m_sLightsStepsDifficulty = DEFAULT_LIGHTS_STEPS_DIFFICULTY;
|
|
||||||
m_bLightsOrOutput = false;
|
|
||||||
|
|
||||||
m_bBlinkGameplayButtonLightsOnNote = false;
|
m_bBlinkGameplayButtonLightsOnNote = false;
|
||||||
m_bAllowUnacceleratedRenderer = false;
|
m_bAllowUnacceleratedRenderer = false;
|
||||||
m_bThreadedInput = true;
|
m_bThreadedInput = true;
|
||||||
@@ -448,9 +443,6 @@ void PrefsManager::ReadPrefsFromFile( CString sIni )
|
|||||||
ini.GetValue( "Options", "MarvelousTiming", (int&)m_iMarvelousTiming );
|
ini.GetValue( "Options", "MarvelousTiming", (int&)m_iMarvelousTiming );
|
||||||
ini.GetValue( "Options", "SoundVolume", m_fSoundVolume );
|
ini.GetValue( "Options", "SoundVolume", m_fSoundVolume );
|
||||||
ini.GetValue( "Options", "LightsDriver", m_sLightsDriver );
|
ini.GetValue( "Options", "LightsDriver", m_sLightsDriver );
|
||||||
ini.GetValue( "Options", "LightsStepsType", m_sLightsStepsType );
|
|
||||||
ini.GetValue( "Options", "LightsStepsDifficulty", m_sLightsStepsDifficulty );
|
|
||||||
ini.GetValue( "Options", "LightsOrOutput", m_bLightsOrOutput);
|
|
||||||
ini.GetValue( "Options", "SoundResampleQuality", m_iSoundResampleQuality );
|
ini.GetValue( "Options", "SoundResampleQuality", m_iSoundResampleQuality );
|
||||||
ini.GetValue( "Options", "CoinMode", m_iCoinMode );
|
ini.GetValue( "Options", "CoinMode", m_iCoinMode );
|
||||||
ini.GetValue( "Options", "CoinsPerCredit", m_iCoinsPerCredit );
|
ini.GetValue( "Options", "CoinsPerCredit", m_iCoinsPerCredit );
|
||||||
@@ -462,6 +454,7 @@ void PrefsManager::ReadPrefsFromFile( CString sIni )
|
|||||||
ini.GetValue( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
|
ini.GetValue( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
|
||||||
ini.GetValue( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
|
ini.GetValue( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
|
||||||
ini.GetValue( "Options", "ShowSongOptions", (int&)m_ShowSongOptions );
|
ini.GetValue( "Options", "ShowSongOptions", (int&)m_ShowSongOptions );
|
||||||
|
ini.GetValue( "Options", "LightsStepsDifficulty", m_sLightsStepsDifficulty );
|
||||||
ini.GetValue( "Options", "BlinkGameplayButtonLightsOnNote", m_bBlinkGameplayButtonLightsOnNote );
|
ini.GetValue( "Options", "BlinkGameplayButtonLightsOnNote", m_bBlinkGameplayButtonLightsOnNote );
|
||||||
ini.GetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
|
ini.GetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
|
||||||
ini.GetValue( "Options", "ThreadedInput", m_bThreadedInput );
|
ini.GetValue( "Options", "ThreadedInput", m_bThreadedInput );
|
||||||
@@ -688,6 +681,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
|||||||
ini.SetValue( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
|
ini.SetValue( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
|
||||||
ini.SetValue( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
|
ini.SetValue( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
|
||||||
ini.SetValue( "Options", "ShowSongOptions", m_ShowSongOptions );
|
ini.SetValue( "Options", "ShowSongOptions", m_ShowSongOptions );
|
||||||
|
ini.SetValue( "Options", "LightsStepsDifficulty", m_sLightsStepsDifficulty );
|
||||||
ini.SetValue( "Options", "BlinkGameplayButtonLightsOnNote", m_bBlinkGameplayButtonLightsOnNote );
|
ini.SetValue( "Options", "BlinkGameplayButtonLightsOnNote", m_bBlinkGameplayButtonLightsOnNote );
|
||||||
ini.SetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
|
ini.SetValue( "Options", "AllowUnacceleratedRenderer", m_bAllowUnacceleratedRenderer );
|
||||||
ini.SetValue( "Options", "ThreadedInput", m_bThreadedInput );
|
ini.SetValue( "Options", "ThreadedInput", m_bThreadedInput );
|
||||||
@@ -771,14 +765,8 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
|||||||
ini.SetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
|
ini.SetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
|
||||||
if(m_fSoundVolume != DEFAULT_SOUND_VOLUME)
|
if(m_fSoundVolume != DEFAULT_SOUND_VOLUME)
|
||||||
ini.SetValue( "Options", "SoundVolume", m_fSoundVolume );
|
ini.SetValue( "Options", "SoundVolume", m_fSoundVolume );
|
||||||
if(m_bLightsOrOutput != false)
|
|
||||||
ini.SetValue( "Options", "LightsOrOutput", m_bLightsOrOutput );
|
|
||||||
if(m_sLightsDriver != DEFAULT_LIGHTS_DRIVER)
|
if(m_sLightsDriver != DEFAULT_LIGHTS_DRIVER)
|
||||||
ini.SetValue( "Options", "LightsDriver", m_sLightsDriver );
|
ini.SetValue( "Options", "LightsDriver", m_sLightsDriver );
|
||||||
if(m_sLightsStepsType != DEFAULT_LIGHTS_STEPS_TYPE)
|
|
||||||
ini.SetValue( "Options", "LightsStepsType", m_sLightsStepsType );
|
|
||||||
if(m_sLightsStepsDifficulty != DEFAULT_LIGHTS_STEPS_DIFFICULTY)
|
|
||||||
ini.SetValue( "Options", "LightsStepsDifficulty", m_sLightsStepsDifficulty );
|
|
||||||
if(m_sMovieDrivers != DEFAULT_MOVIE_DRIVER_LIST)
|
if(m_sMovieDrivers != DEFAULT_MOVIE_DRIVER_LIST)
|
||||||
ini.SetValue ( "Options", "MovieDrivers", m_sMovieDrivers );
|
ini.SetValue ( "Options", "MovieDrivers", m_sMovieDrivers );
|
||||||
|
|
||||||
|
|||||||
@@ -243,9 +243,7 @@ public:
|
|||||||
int m_iSoundResampleQuality;
|
int m_iSoundResampleQuality;
|
||||||
CString m_sMovieDrivers;
|
CString m_sMovieDrivers;
|
||||||
CString m_sLightsDriver;
|
CString m_sLightsDriver;
|
||||||
CString m_sLightsStepsType;
|
|
||||||
CString m_sLightsStepsDifficulty;
|
CString m_sLightsStepsDifficulty;
|
||||||
bool m_bLightsOrOutput;
|
|
||||||
bool m_bBlinkGameplayButtonLightsOnNote;
|
bool m_bBlinkGameplayButtonLightsOnNote;
|
||||||
bool m_bAllowUnacceleratedRenderer;
|
bool m_bAllowUnacceleratedRenderer;
|
||||||
bool m_bThreadedInput;
|
bool m_bThreadedInput;
|
||||||
|
|||||||
@@ -1040,27 +1040,12 @@ void ScreenGameplay::LoadNextSong()
|
|||||||
// Load cabinet lights data
|
// Load cabinet lights data
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
m_CabinetLightsNoteData.Init();
|
m_CabinetLightsNoteData.Init();
|
||||||
ASSERT( GAMESTATE->m_pCurSong );
|
ASSERT( GAMESTATE->m_pCurSong );
|
||||||
vector<Steps*> vSteps;
|
|
||||||
|
|
||||||
StepsType lightsSteps = STEPS_TYPE_LIGHTS_CABINET;
|
Steps *pSteps = GAMESTATE->m_pCurSong->GetClosestNotes( STEPS_TYPE_LIGHTS_CABINET, StringToDifficulty(PREFSMAN->m_sLightsStepsDifficulty) );
|
||||||
|
if( pSteps != NULL )
|
||||||
lightsSteps = GAMEMAN->StringToNotesType(PREFSMAN->m_sLightsStepsType);
|
pSteps->GetNoteData( &m_CabinetLightsNoteData );
|
||||||
|
|
||||||
GAMESTATE->m_pCurSong->GetSteps( vSteps, lightsSteps );
|
|
||||||
|
|
||||||
if( !vSteps.empty() )
|
|
||||||
vSteps[0]->GetNoteData( &m_CabinetLightsNoteData );
|
|
||||||
|
|
||||||
for (i=0;i<vSteps.size();i++)
|
|
||||||
{
|
|
||||||
Difficulty DC = StringToDifficulty(PREFSMAN->m_sLightsStepsDifficulty);
|
|
||||||
Difficulty DC2 = vSteps[i]->GetDifficulty();
|
|
||||||
if (DC == DC2)
|
|
||||||
vSteps[i]->GetNoteData( &m_CabinetLightsNoteData );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert to 4s so that we can check if we're inside a hold with just
|
// Convert to 4s so that we can check if we're inside a hold with just
|
||||||
// GetTapNote().
|
// GetTapNote().
|
||||||
|
|||||||
@@ -873,7 +873,8 @@ void Song::ReCalculateRadarValuesAndLastBeat()
|
|||||||
|
|
||||||
void Song::GetSteps( vector<Steps*>& arrayAddTo, StepsType nt, Difficulty dc, int iMeterLow, int iMeterHigh, const CString &sDescription, bool bIncludeAutoGen, int Max ) const
|
void Song::GetSteps( vector<Steps*>& arrayAddTo, StepsType nt, Difficulty dc, int iMeterLow, int iMeterHigh, const CString &sDescription, bool bIncludeAutoGen, int Max ) const
|
||||||
{
|
{
|
||||||
if( !PREFSMAN->m_bAutogenSteps )
|
/* Ignore m_bAutogenSteps for STEPS_TYPE_LIGHTS_CABINET. */
|
||||||
|
if( nt != STEPS_TYPE_LIGHTS_CABINET && !PREFSMAN->m_bAutogenSteps )
|
||||||
bIncludeAutoGen = false;
|
bIncludeAutoGen = false;
|
||||||
|
|
||||||
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Steps
|
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Steps
|
||||||
|
|||||||
@@ -189,9 +189,14 @@ void Steps::Decompress() const
|
|||||||
|
|
||||||
int iNewTracks = GameManager::NotesTypeToNumTracks(m_StepsType);
|
int iNewTracks = GameManager::NotesTypeToNumTracks(m_StepsType);
|
||||||
|
|
||||||
notes->LoadTransformedSlidingWindow( &pdata, iNewTracks );
|
if( this->m_StepsType == STEPS_TYPE_LIGHTS_CABINET )
|
||||||
|
{
|
||||||
|
NoteDataUtil::LoadTransformedLights( pdata, *notes, iNewTracks );
|
||||||
|
} else {
|
||||||
|
notes->LoadTransformedSlidingWindow( &pdata, iNewTracks );
|
||||||
|
|
||||||
NoteDataUtil::FixImpossibleRows( *notes, m_StepsType );
|
NoteDataUtil::FixImpossibleRows( *notes, m_StepsType );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(!notes_comp)
|
else if(!notes_comp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user