Bring light into the shadow...variables.
Yeah, yeah, can't make a good joke at 2:30 AM.
This commit is contained in:
+2
-2
@@ -519,8 +519,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
|||||||
if( e->iChooseIndex < int(vSongAndSteps.size()) )
|
if( e->iChooseIndex < int(vSongAndSteps.size()) )
|
||||||
{
|
{
|
||||||
resolved.pSong = vpSongs[e->iChooseIndex];
|
resolved.pSong = vpSongs[e->iChooseIndex];
|
||||||
const vector<Steps*> &vpSongs = mapSongToSteps[resolved.pSong];
|
const vector<Steps*> &mappedSongs = mapSongToSteps[resolved.pSong];
|
||||||
resolved.pSteps = vpSongs[ RandomInt(vpSongs.size()) ];
|
resolved.pSteps = mappedSongs[ RandomInt(mappedSongs.size()) ];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-3
@@ -155,15 +155,15 @@ void ModIconRow::SetFromGameState()
|
|||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
// search for a vacant spot
|
// search for a vacant spot
|
||||||
for( int i=iPerferredCol; i<NUM_OPTION_ICONS; i++ )
|
for( int j=iPerferredCol; j<NUM_OPTION_ICONS; j++ )
|
||||||
{
|
{
|
||||||
if( vsText[i] != "" )
|
if( vsText[j] != "" )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
vsText[i] = sOption;
|
vsText[j] = sOption;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -847,9 +847,9 @@ void NoteData::GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow,
|
|||||||
--prev;
|
--prev;
|
||||||
if( prev->second.type == TapNote::hold_head )
|
if( prev->second.type == TapNote::hold_head )
|
||||||
{
|
{
|
||||||
int iStartRow = prev->first;
|
int localStartRow = prev->first;
|
||||||
const TapNote &tn = prev->second;
|
const TapNote &tn = prev->second;
|
||||||
if( iStartRow + tn.iDuration >= iEndRow )
|
if( localStartRow + tn.iDuration >= iEndRow )
|
||||||
end = prev;
|
end = prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-12
@@ -476,9 +476,9 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
|
|||||||
if( sNoteId != "00" )
|
if( sNoteId != "00" )
|
||||||
{
|
{
|
||||||
vTapNotes.push_back( TAP_ORIGINAL_TAP );
|
vTapNotes.push_back( TAP_ORIGINAL_TAP );
|
||||||
map<RString,int>::const_iterator it = idToKeySoundIndex.find( sNoteId );
|
map<RString,int>::const_iterator rInt = idToKeySoundIndex.find( sNoteId );
|
||||||
if( it != idToKeySoundIndex.end() )
|
if( rInt != idToKeySoundIndex.end() )
|
||||||
vTapNotes.back().iKeysoundIndex = it->second;
|
vTapNotes.back().iKeysoundIndex = rInt->second;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -762,28 +762,28 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// this is keysound file name. Looks like "#WAV1A"
|
// this is keysound file name. Looks like "#WAV1A"
|
||||||
RString sData = it->second;
|
RString nData = it->second;
|
||||||
RString sWavID = sName.Right(2);
|
RString sWavID = sName.Right(2);
|
||||||
|
|
||||||
/* Due to bugs in some programs, many BMS files have a "WAV" extension
|
/* Due to bugs in some programs, many BMS files have a "WAV" extension
|
||||||
* on files in the BMS for files that actually have some other extension.
|
* on files in the BMS for files that actually have some other extension.
|
||||||
* Do a search. Don't do a wildcard search; if sData is "song.wav",
|
* Do a search. Don't do a wildcard search; if sData is "song.wav",
|
||||||
* we might also have "song.png", which we shouldn't match. */
|
* we might also have "song.png", which we shouldn't match. */
|
||||||
if( !IsAFile(out.GetSongDir()+sData) )
|
if( !IsAFile(out.GetSongDir()+nData) )
|
||||||
{
|
{
|
||||||
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
|
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
|
||||||
for( unsigned i = 0; exts[i] != NULL; ++i )
|
for( unsigned i = 0; exts[i] != NULL; ++i )
|
||||||
{
|
{
|
||||||
RString fn = SetExtension( sData, exts[i] );
|
RString fn = SetExtension( nData, exts[i] );
|
||||||
if( IsAFile(out.GetSongDir()+fn) )
|
if( IsAFile(out.GetSongDir()+fn) )
|
||||||
{
|
{
|
||||||
sData = fn;
|
nData = fn;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !IsAFile(out.GetSongDir()+sData) )
|
if( !IsAFile(out.GetSongDir()+nData) )
|
||||||
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() );
|
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() );
|
||||||
|
|
||||||
sWavID.MakeUpper(); // HACK: undo the MakeLower()
|
sWavID.MakeUpper(); // HACK: undo the MakeLower()
|
||||||
out.m_vsKeysoundFile.push_back( sData );
|
out.m_vsKeysoundFile.push_back( sData );
|
||||||
@@ -807,11 +807,11 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
|||||||
float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut );
|
float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut );
|
||||||
int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure );
|
int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure );
|
||||||
|
|
||||||
RString sData = it->second;
|
RString nData = it->second;
|
||||||
int totalPairs = sData.size() / 2;
|
int totalPairs = nData.size() / 2;
|
||||||
for( int i = 0; i < totalPairs; ++i )
|
for( int i = 0; i < totalPairs; ++i )
|
||||||
{
|
{
|
||||||
RString sPair = sData.substr( i*2, 2 );
|
RString sPair = nData.substr( i*2, 2 );
|
||||||
|
|
||||||
int iVal = 0;
|
int iVal = 0;
|
||||||
if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 )
|
if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 )
|
||||||
|
|||||||
@@ -750,9 +750,9 @@ static bool LoadFromMidi( const RString &sPath, Song &songOut )
|
|||||||
if( uVelocity == 0 )
|
if( uVelocity == 0 )
|
||||||
midiEventType = note_off;
|
midiEventType = note_off;
|
||||||
|
|
||||||
MidiEvent event = { count, midiEventType };
|
MidiEvent mEvent = { count, midiEventType };
|
||||||
//float fBeat = NoteRowToBeat( MidiCountToNoteRow(count) );
|
//float fBeat = NoteRowToBeat( MidiCountToNoteRow(count) );
|
||||||
vMidiEvent[uNoteNumber].push_back( event );
|
vMidiEvent[uNoteNumber].push_back( mEvent );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -850,13 +850,13 @@ skip_track:
|
|||||||
// hold note ending on the same row as a tap note.
|
// hold note ending on the same row as a tap note.
|
||||||
NoteData::TrackMap::iterator begin, end;
|
NoteData::TrackMap::iterator begin, end;
|
||||||
noteData.GetTapNoteRangeInclusive( nnt, MidiCountToNoteRow(count), MidiCountToNoteRow(count), begin, end, true );
|
noteData.GetTapNoteRangeInclusive( nnt, MidiCountToNoteRow(count), MidiCountToNoteRow(count), begin, end, true );
|
||||||
for( NoteData::TrackMap::iterator iter = begin; iter != end; iter++ )
|
for( NoteData::TrackMap::iterator lIter = begin; lIter != end; lIter++ )
|
||||||
{
|
{
|
||||||
// if( gd == expert && fBeat >= 27*4-2 && nnt == green )
|
// if( gd == expert && fBeat >= 27*4-2 && nnt == green )
|
||||||
// LOG->Trace( "shortening hold at %f, length %d", fBeat, length );
|
// LOG->Trace( "shortening hold at %f, length %d", fBeat, length );
|
||||||
|
|
||||||
ASSERT( iter->second.type == TapNote::hold_head );
|
ASSERT( lIter->second.type == TapNote::hold_head );
|
||||||
iter->second.iDuration = MidiCountToNoteRow(count) - iter->first - 2;
|
lIter->second.iDuration = MidiCountToNoteRow(count) - lIter->first - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
noteData.SetTapNote( nnt, MidiCountToNoteRow(count), tn );
|
noteData.SetTapNote( nnt, MidiCountToNoteRow(count), tn );
|
||||||
|
|||||||
+14
-14
@@ -408,9 +408,9 @@ static bool LoadFromPMSFile( const RString &sPath, const NameToData_t &mapNameTo
|
|||||||
if( sNoteId != "00" )
|
if( sNoteId != "00" )
|
||||||
{
|
{
|
||||||
vTapNotes.push_back( TAP_ORIGINAL_TAP );
|
vTapNotes.push_back( TAP_ORIGINAL_TAP );
|
||||||
map<RString,int>::const_iterator it = idToKeySoundIndex.find( sNoteId );
|
map<RString,int>::const_iterator rInt = idToKeySoundIndex.find( sNoteId );
|
||||||
if( it != idToKeySoundIndex.end() )
|
if( rInt != idToKeySoundIndex.end() )
|
||||||
vTapNotes.back().iKeysoundIndex = it->second;
|
vTapNotes.back().iKeysoundIndex = rInt->second;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -609,31 +609,31 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// this is keysound file name. Looks like "#WAV1A"
|
// this is keysound file name. Looks like "#WAV1A"
|
||||||
RString sData = it->second;
|
RString nData = it->second;
|
||||||
RString sWavID = sName.Right(2);
|
RString sWavID = sName.Right(2);
|
||||||
|
|
||||||
/* Due to bugs in some programs, many PMS files have a "WAV" extension
|
/* Due to bugs in some programs, many PMS files have a "WAV" extension
|
||||||
* on files in the PMS for files that actually have some other extension.
|
* on files in the PMS for files that actually have some other extension.
|
||||||
* Do a search. Don't do a wildcard search; if sData is "song.wav",
|
* Do a search. Don't do a wildcard search; if sData is "song.wav",
|
||||||
* we might also have "song.png", which we shouldn't match. */
|
* we might also have "song.png", which we shouldn't match. */
|
||||||
if( !IsAFile(out.GetSongDir()+sData) )
|
if( !IsAFile(out.GetSongDir()+nData) )
|
||||||
{
|
{
|
||||||
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
|
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
|
||||||
for( unsigned i = 0; exts[i] != NULL; ++i )
|
for( unsigned i = 0; exts[i] != NULL; ++i )
|
||||||
{
|
{
|
||||||
RString fn = SetExtension( sData, exts[i] );
|
RString fn = SetExtension( nData, exts[i] );
|
||||||
if( IsAFile(out.GetSongDir()+fn) )
|
if( IsAFile(out.GetSongDir()+fn) )
|
||||||
{
|
{
|
||||||
sData = fn;
|
nData = fn;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !IsAFile(out.GetSongDir()+sData) )
|
if( !IsAFile(out.GetSongDir()+nData) )
|
||||||
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() );
|
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() );
|
||||||
|
|
||||||
sWavID.MakeUpper(); // HACK: undo the MakeLower()
|
sWavID.MakeUpper(); // HACK: undo the MakeLower()
|
||||||
out.m_vsKeysoundFile.push_back( sData );
|
out.m_vsKeysoundFile.push_back( nData );
|
||||||
idToKeySoundIndexOut[ sWavID ] = out.m_vsKeysoundFile.size()-1;
|
idToKeySoundIndexOut[ sWavID ] = out.m_vsKeysoundFile.size()-1;
|
||||||
LOG->Trace( "Inserting keysound index %u '%s'", unsigned(out.m_vsKeysoundFile.size()-1), sWavID.c_str() );
|
LOG->Trace( "Inserting keysound index %u '%s'", unsigned(out.m_vsKeysoundFile.size()-1), sWavID.c_str() );
|
||||||
}
|
}
|
||||||
@@ -654,11 +654,11 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
|||||||
float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut );
|
float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut );
|
||||||
int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure );
|
int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure );
|
||||||
|
|
||||||
RString sData = it->second;
|
RString nData = it->second;
|
||||||
int totalPairs = sData.size() / 2;
|
int totalPairs = nData.size() / 2;
|
||||||
for( int i = 0; i < totalPairs; ++i )
|
for( int i = 0; i < totalPairs; ++i )
|
||||||
{
|
{
|
||||||
RString sPair = sData.substr( i*2, 2 );
|
RString sPair = nData.substr( i*2, 2 );
|
||||||
|
|
||||||
int iVal = 0;
|
int iVal = 0;
|
||||||
if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 )
|
if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 )
|
||||||
@@ -738,7 +738,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
|||||||
{
|
{
|
||||||
// XXX: offset
|
// XXX: offset
|
||||||
int iBPMNo;
|
int iBPMNo;
|
||||||
sscanf( sData, "%x", &iBPMNo ); // data is in hexadecimal
|
sscanf( nData, "%x", &iBPMNo ); // data is in hexadecimal
|
||||||
|
|
||||||
RString sBPM;
|
RString sBPM;
|
||||||
RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo );
|
RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo );
|
||||||
|
|||||||
@@ -413,9 +413,9 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
|
|||||||
if(arrayWarpsFromNegativeBPMs.size() > 0)
|
if(arrayWarpsFromNegativeBPMs.size() > 0)
|
||||||
{
|
{
|
||||||
// zomg we already have some warps...
|
// zomg we already have some warps...
|
||||||
for( unsigned i=0; i<arrayWarpsFromNegativeBPMs.size(); i++ )
|
for( unsigned j=0; j<arrayWarpsFromNegativeBPMs.size(); j++ )
|
||||||
{
|
{
|
||||||
out.AddWarpSegment( arrayWarpsFromNegativeBPMs[i] );
|
out.AddWarpSegment( arrayWarpsFromNegativeBPMs[j] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// warp sorting will need to take place.
|
// warp sorting will need to take place.
|
||||||
|
|||||||
+1
-1
@@ -603,7 +603,7 @@ void OptionRow::UpdateEnabledDisabled()
|
|||||||
case LAYOUT_SHOW_ONE_IN_ROW:
|
case LAYOUT_SHOW_ONE_IN_ROW:
|
||||||
FOREACH_HumanPlayer( pn )
|
FOREACH_HumanPlayer( pn )
|
||||||
{
|
{
|
||||||
bool bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end();
|
bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end();
|
||||||
|
|
||||||
if( !m_pHand->m_Def.m_bOneChoiceForAllPlayers )
|
if( !m_pHand->m_Def.m_bOneChoiceForAllPlayers )
|
||||||
{
|
{
|
||||||
|
|||||||
+12
-12
@@ -146,9 +146,9 @@ void OptionListRow::SetUnderlines( const vector<bool> &aSelections, const Option
|
|||||||
else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE )
|
else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE )
|
||||||
{
|
{
|
||||||
const vector<bool> &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second;
|
const vector<bool> &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second;
|
||||||
for( unsigned i=0; i<bTargetSelections.size(); i++ )
|
for( unsigned j=0; j<bTargetSelections.size(); j++ )
|
||||||
{
|
{
|
||||||
if( bTargetSelections[i] )
|
if( bTargetSelections[j] )
|
||||||
bSelected = true;
|
bSelected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -400,10 +400,10 @@ void OptionsList::Input( const InputEventPlus &input )
|
|||||||
wrap( iSelection, bTargetSelections.size() );
|
wrap( iSelection, bTargetSelections.size() );
|
||||||
SelectItem( sDest, iSelection );
|
SelectItem( sDest, iSelection );
|
||||||
|
|
||||||
Message msg("OptionsListQuickChange");
|
Message lMsg("OptionsListQuickChange");
|
||||||
msg.SetParam( "Player", pn );
|
lMsg.SetParam( "Player", pn );
|
||||||
msg.SetParam( "Direction", iDir );
|
lMsg.SetParam( "Direction", iDir );
|
||||||
MESSAGEMAN->Broadcast( msg );
|
MESSAGEMAN->Broadcast( lMsg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -426,9 +426,9 @@ void OptionsList::Input( const InputEventPlus &input )
|
|||||||
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
|
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
|
||||||
PositionCursor();
|
PositionCursor();
|
||||||
|
|
||||||
Message msg("OptionsListLeft");
|
Message lMsg("OptionsListLeft");
|
||||||
msg.SetParam( "Player", input.pn );
|
lMsg.SetParam( "Player", input.pn );
|
||||||
MESSAGEMAN->Broadcast( msg );
|
MESSAGEMAN->Broadcast( lMsg );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if( input.MenuI == GAME_BUTTON_RIGHT )
|
else if( input.MenuI == GAME_BUTTON_RIGHT )
|
||||||
@@ -447,9 +447,9 @@ void OptionsList::Input( const InputEventPlus &input )
|
|||||||
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
|
wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row
|
||||||
PositionCursor();
|
PositionCursor();
|
||||||
|
|
||||||
Message msg("OptionsListRight");
|
Message lMsg("OptionsListRight");
|
||||||
msg.SetParam( "Player", input.pn );
|
lMsg.SetParam( "Player", input.pn );
|
||||||
MESSAGEMAN->Broadcast( msg );
|
MESSAGEMAN->Broadcast( lMsg );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if( input.MenuI == GAME_BUTTON_START )
|
else if( input.MenuI == GAME_BUTTON_START )
|
||||||
|
|||||||
+5
-5
@@ -2810,16 +2810,16 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
|
|||||||
int iNumHoldsMissedThisRow = 0;
|
int iNumHoldsMissedThisRow = 0;
|
||||||
|
|
||||||
// start at r-1 so that we consider holds whose end rows are equal to the checkpoint row
|
// start at r-1 so that we consider holds whose end rows are equal to the checkpoint row
|
||||||
NoteData::all_tracks_iterator iter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true );
|
NoteData::all_tracks_iterator nIter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true );
|
||||||
for( ; !iter.IsAtEnd(); ++iter )
|
for( ; !nIter.IsAtEnd(); ++nIter )
|
||||||
{
|
{
|
||||||
TapNote &tn = *iter;
|
TapNote &tn = *nIter;
|
||||||
if( tn.type != TapNote::hold_head )
|
if( tn.type != TapNote::hold_head )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int iStartRow = iter.Row();
|
int iStartRow = nIter.Row();
|
||||||
int iEndRow = iStartRow + tn.iDuration;
|
int iEndRow = iStartRow + tn.iDuration;
|
||||||
int iTrack = iter.Track();
|
int iTrack = nIter.Track();
|
||||||
|
|
||||||
// "the first row after the hold head that lands on a beat"
|
// "the first row after the hold head that lands on a beat"
|
||||||
int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows;
|
int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows;
|
||||||
|
|||||||
+2
-2
@@ -575,8 +575,8 @@ float RageFastSin( float x )
|
|||||||
bInited = true;
|
bInited = true;
|
||||||
for( unsigned i=0; i<ARRAYLEN(table); i++ )
|
for( unsigned i=0; i<ARRAYLEN(table); i++ )
|
||||||
{
|
{
|
||||||
float x = SCALE(i,0,ARRAYLEN(table),0.0f,PI);
|
float z = SCALE(i,0,ARRAYLEN(table),0.0f,PI);
|
||||||
table[i] = sinf(x);
|
table[i] = sinf(z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -383,14 +383,14 @@ void ScreenOptionsEditCourse::SetCurrentSong()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int iRow = m_iCurrentRow[PLAYER_1];
|
iRow = m_iCurrentRow[PLAYER_1];
|
||||||
int iEntryIndex = RowToEntryIndex( iRow );
|
int iEntryIndex = RowToEntryIndex( iRow );
|
||||||
Song *pSong = NULL;
|
Song *pSong = NULL;
|
||||||
if( iEntryIndex != -1 )
|
if( iEntryIndex != -1 )
|
||||||
{
|
{
|
||||||
int iCurrentSongRow = EntryIndexAndRowTypeToRow(iEntryIndex,RowType_Song);
|
int iCurrentSongRow = EntryIndexAndRowTypeToRow(iEntryIndex,RowType_Song);
|
||||||
OptionRow &row = *m_pRows[ iCurrentSongRow ];
|
OptionRow &oRow = *m_pRows[ iCurrentSongRow ];
|
||||||
int index = row.GetOneSelection(PLAYER_1);
|
int index = oRow.GetOneSelection(PLAYER_1);
|
||||||
if( index != 0 )
|
if( index != 0 )
|
||||||
pSong = m_vpSongs[ index - 1 ];
|
pSong = m_vpSongs[ index - 1 ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ void ScreenOptionsManageCourses::BeginScreen()
|
|||||||
vector<Course*>::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse );
|
vector<Course*>::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse );
|
||||||
if( iter != m_vpCourses.end() )
|
if( iter != m_vpCourses.end() )
|
||||||
{
|
{
|
||||||
int iIndex = iter - m_vpCourses.begin();
|
iIndex = iter - m_vpCourses.begin();
|
||||||
this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex );
|
this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ void ScreenOptionsManageEditSteps::BeginScreen()
|
|||||||
vector<Steps*>::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] );
|
vector<Steps*>::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] );
|
||||||
if( iter != m_vpSteps.end() )
|
if( iter != m_vpSteps.end() )
|
||||||
{
|
{
|
||||||
int iIndex = iter - m_vpSteps.begin();
|
iIndex = iter - m_vpSteps.begin();
|
||||||
this->MoveRowAbsolute( PLAYER_1, 1 + iIndex );
|
this->MoveRowAbsolute( PLAYER_1, 1 + iIndex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,8 +197,9 @@ void ScreenOptionsMemoryCard::ProcessMenuStart( const InputEventPlus &input )
|
|||||||
const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices;
|
const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices;
|
||||||
if( iCurRow < int(v.size()) ) // a card
|
if( iCurRow < int(v.size()) ) // a card
|
||||||
{
|
{
|
||||||
const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices;
|
// Why is this statement in twice? Doubt it would change right after the if. -Wolfman2000
|
||||||
const UsbStorageDevice &dev = v[iCurRow];
|
const vector<UsbStorageDevice> &vUSB = m_CurrentUsbStorageDevices;
|
||||||
|
const UsbStorageDevice &dev = vUSB[iCurRow];
|
||||||
MEMCARDMAN->m_sEditorMemoryCardOsMountPoint.Set( dev.sOsMountDir );
|
MEMCARDMAN->m_sEditorMemoryCardOsMountPoint.Set( dev.sOsMountDir );
|
||||||
|
|
||||||
/* The destination screen must UnmountCard. XXX: brittle */
|
/* The destination screen must UnmountCard. XXX: brittle */
|
||||||
|
|||||||
+6
-6
@@ -669,21 +669,21 @@ namespace
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
RString sName;
|
RString nName;
|
||||||
LuaHelpers::Pop( L, sName );
|
LuaHelpers::Pop( L, nName );
|
||||||
NodeNamesToAdd.push_back( sName );
|
NodeNamesToAdd.push_back( nName );
|
||||||
NodesToAdd.push_back( LuaReference() );
|
NodesToAdd.push_back( LuaReference() );
|
||||||
NodesToAdd.back().SetFromStack( L );
|
NodesToAdd.back().SetFromStack( L );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
RString sName;
|
RString nName;
|
||||||
LuaHelpers::Pop( L, sName );
|
LuaHelpers::Pop( L, nName );
|
||||||
|
|
||||||
// Otherwise, add an attribute.
|
// Otherwise, add an attribute.
|
||||||
XNodeLuaValue *pValue = new XNodeLuaValue;
|
XNodeLuaValue *pValue = new XNodeLuaValue;
|
||||||
pValue->SetValueFromStack( L );
|
pValue->SetValueFromStack( L );
|
||||||
pNode->AppendAttrFrom( sName, pValue );
|
pNode->AppendAttrFrom( nName, pValue );
|
||||||
}
|
}
|
||||||
lua_pop( L, 1 );
|
lua_pop( L, 1 );
|
||||||
|
|
||||||
|
|||||||
@@ -425,10 +425,10 @@ wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool b
|
|||||||
if( KeyLayout )
|
if( KeyLayout )
|
||||||
{
|
{
|
||||||
UInt32 keyboardType = LMGetKbdType();
|
UInt32 keyboardType = LMGetKbdType();
|
||||||
UInt32 modifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0;
|
UInt32 nModifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0;
|
||||||
UniChar unicodeInputString[4];
|
UniChar unicodeInputString[4];
|
||||||
UniCharCount length;
|
UniCharCount length;
|
||||||
OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, modifiers,
|
OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, nModifiers,
|
||||||
keyboardType, 0, &iDeadKeyState, ARRAYLEN(unicodeInputString),
|
keyboardType, 0, &iDeadKeyState, ARRAYLEN(unicodeInputString),
|
||||||
&length, unicodeInputString );
|
&length, unicodeInputString );
|
||||||
|
|
||||||
|
|||||||
@@ -193,10 +193,10 @@ RString MovieDecoder_Theora::ProcessHeaders()
|
|||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
ogg_packet op;
|
ogg_packet op;
|
||||||
int ret = ogg_stream_packetpeek( &m_OggStream, &op );
|
int ret2 = ogg_stream_packetpeek( &m_OggStream, &op );
|
||||||
if( ret == 0 )
|
if( ret2 == 0 )
|
||||||
break;
|
break;
|
||||||
if( ret < 0 )
|
if( ret2 < 0 )
|
||||||
return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() );
|
return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() );
|
||||||
|
|
||||||
if( !theora_packet_isheader(&op) )
|
if( !theora_packet_isheader(&op) )
|
||||||
@@ -208,8 +208,8 @@ RString MovieDecoder_Theora::ProcessHeaders()
|
|||||||
return RString();
|
return RString();
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op);
|
ret2 = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op);
|
||||||
if( ret < 0 && ret != OC_NEWPACKET )
|
if( ret2 < 0 && ret2 != OC_NEWPACKET )
|
||||||
return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() );
|
return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() );
|
||||||
|
|
||||||
ogg_stream_packetout( &m_OggStream, NULL );
|
ogg_stream_packetout( &m_OggStream, NULL );
|
||||||
|
|||||||
Reference in New Issue
Block a user