merging :|

This commit is contained in:
AJ Kelly
2011-03-14 12:30:12 -05:00
67 changed files with 308 additions and 306 deletions
+20 -8
View File
@@ -7099,7 +7099,7 @@
GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_MATH = YES;
GCC_FAST_MATH = NO;
GCC_FAST_OBJC_DISPATCH = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
@@ -7112,6 +7112,7 @@
GCC_UNROLL_LOOPS = YES;
GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -7119,9 +7120,11 @@
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_SHADOW = NO;
GCC_WARN_PROTOTYPE_CONVERSION = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = NO;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
@@ -7632,7 +7635,7 @@
GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_MATH = YES;
GCC_FAST_MATH = NO;
GCC_FAST_OBJC_DISPATCH = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
@@ -7644,6 +7647,7 @@
GCC_UNROLL_LOOPS = YES;
GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -7651,9 +7655,11 @@
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_SHADOW = NO;
GCC_WARN_PROTOTYPE_CONVERSION = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
@@ -7963,7 +7969,7 @@
GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_MATH = YES;
GCC_FAST_MATH = NO;
GCC_FAST_OBJC_DISPATCH = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
@@ -7975,6 +7981,7 @@
GCC_UNROLL_LOOPS = YES;
GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -7982,9 +7989,11 @@
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_SHADOW = NO;
GCC_WARN_PROTOTYPE_CONVERSION = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
@@ -8088,7 +8097,7 @@
GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_SYMBOL_SEPARATION = NO;
GCC_FAST_MATH = YES;
GCC_FAST_MATH = NO;
GCC_FAST_OBJC_DISPATCH = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
@@ -8100,6 +8109,7 @@
GCC_UNROLL_LOOPS = YES;
GCC_VERSION = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -8107,9 +8117,11 @@
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_MISSING_PARENTHESES = YES;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_SHADOW = NO;
GCC_WARN_PROTOTYPE_CONVERSION = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
+1 -1
View File
@@ -445,7 +445,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
{
// find the middle, and split based on iColNum
// it's unknown if this will work for routine.
const int iMiddleColumn = floor(pStyle->m_iColsPerPlayer/2.0f);
const int iMiddleColumn = static_cast<int>(floor(pStyle->m_iColsPerPlayer/2.0f));
if( iColNum > iMiddleColumn-1 )
fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*-(fYOffset);
else
+2 -2
View File
@@ -34,8 +34,8 @@ void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlay
fStartBeat = min( GAMESTATE->m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat );
fStartBeat = truncf(fStartBeat)+1;
const float fStartSecond = pSong->GetElapsedTimeFromBeat( fStartBeat );
const float fEndSecond = fStartSecond + fSecsRemaining;
const float lStartSecond = pSong->GetElapsedTimeFromBeat( fStartBeat );
const float fEndSecond = lStartSecond + fSecsRemaining;
fEndBeat = pSong->GetBeatFromElapsedTime( fEndSecond );
fEndBeat = truncf(fEndBeat)+1;
+9 -11
View File
@@ -32,7 +32,10 @@ struct Attack
bGlobal = false;
bShowInAttackList = true;
}
Attack() { MakeBlank(); }
Attack(): level(ATTACK_LEVEL_1), fStartSecond(-1),
fSecsRemaining(0), sModifiers(RString()),
bOn(false), bGlobal(false), bShowInAttackList(true)
{} // MakeBlank() is effectively called here.
Attack(
AttackLevel level_,
float fStartSecond_,
@@ -40,16 +43,11 @@ struct Attack
RString sModifiers_,
bool bOn_,
bool bGlobal_,
bool bShowInAttackList_ = true )
{
level = level_;
fStartSecond = fStartSecond_;
fSecsRemaining = fSecsRemaining_;
sModifiers = sModifiers_;
bOn = bOn_;
bGlobal = bGlobal_;
bShowInAttackList = bShowInAttackList_;
}
bool bShowInAttackList_ = true ):
level(level_), fStartSecond(fStartSecond_),
fSecsRemaining(fSecsRemaining_), sModifiers(sModifiers_),
bOn(bOn_), bGlobal(bGlobal_),
bShowInAttackList(bShowInAttackList_) {}
void GetAttackBeats( const Song *pSong, float &fStartBeat, float &fEndBeat ) const;
void GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlayerState, float &fStartBeat, float &fEndBeat ) const;
+2 -2
View File
@@ -80,11 +80,11 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain )
bool bSoundIsGlobal = true;
{
PlayerNumber pn = GetNextEnabledPlayer((PlayerNumber)-1);
const TapNote &t = tn[pn];
const TapNote &tap = tn[pn];
pn = GetNextEnabledPlayer(pn);
while( pn != PLAYER_INVALID )
{
if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != t.iKeysoundIndex )
if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != tap.iKeysoundIndex )
bSoundIsGlobal = false;
pn = GetNextEnabledPlayer(pn);
}
+3 -3
View File
@@ -77,9 +77,9 @@ void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNo
else
{
// import as a single layer
BGAnimationLayer* pLayer = new BGAnimationLayer;
pLayer->LoadFromNode( pKey );
this->AddChild( pLayer );
BGAnimationLayer* bgLayer = new BGAnimationLayer;
bgLayer->LoadFromNode( pKey );
this->AddChild( bgLayer );
}
}
}
+3 -3
View File
@@ -746,9 +746,9 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
if( !change.m_sTransition.empty() )
{
map<RString,BackgroundTransition>::const_iterator iter = mapNameToTransition.find( change.m_sTransition );
ASSERT( iter != mapNameToTransition.end() );
const BackgroundTransition &bt = iter->second;
map<RString,BackgroundTransition>::const_iterator lIter = mapNameToTransition.find( change.m_sTransition );
ASSERT( lIter != mapNameToTransition.end() );
const BackgroundTransition &bt = lIter->second;
m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves );
m_pFadingBGA->RunCommands( *bt.cmdRoot );
}
+2
View File
@@ -250,9 +250,11 @@ void BeginnerHelper::DrawPrimitives()
m_sStepCircle[scd][scde].Draw();
if( DrawCelShaded )
{
FOREACH_PlayerNumber( pn ) // Draw each dancer
if( GAMESTATE->IsHumanPlayer(pn) )
m_pDancer[pn]->DrawCelShaded();
}
else
{
DISPLAY->SetLighting( true );
+4 -4
View File
@@ -519,8 +519,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
if( e->iChooseIndex < int(vSongAndSteps.size()) )
{
resolved.pSong = vpSongs[e->iChooseIndex];
const vector<Steps*> &vpSongs = mapSongToSteps[resolved.pSong];
resolved.pSteps = vpSongs[ RandomInt(vpSongs.size()) ];
const vector<Steps*> &mappedSongs = mapSongToSteps[resolved.pSong];
resolved.pSteps = mappedSongs[ RandomInt(mappedSongs.size()) ];
}
else
{
@@ -930,8 +930,8 @@ const CourseEntry *Course::FindFixedSong( const Song *pSong ) const
FOREACH_CONST( CourseEntry, m_vEntries, e )
{
const CourseEntry &entry = *e;
Song *pSong = entry.songID.ToSong();
if( pSong == pSong )
Song *lSong = entry.songID.ToSong();
if( pSong == lSong )
return &entry;
}
+1 -1
View File
@@ -464,7 +464,7 @@ void EditCourseUtil::PrepareForPlay()
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_GoalType = GoalType_Time;
Course *pCourse = GAMESTATE->m_pCurCourse;
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = pCourse->m_fGoalSeconds;
PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = static_cast<int>(pCourse->m_fGoalSeconds);
}
void EditCourseUtil::GetAllEditCourses( vector<Course*> &vpCoursesOut )
+6 -6
View File
@@ -311,15 +311,15 @@ const glyph &Font::GetGlyph( wchar_t c ) const
bool Font::FontCompleteForString( const wstring &str ) const
{
map<wchar_t,glyph*>::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH );
if( m_pDefault == m_iCharToGlyph.end() )
map<wchar_t,glyph*>::const_iterator mapDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH );
if( mapDefault == m_iCharToGlyph.end() )
RageException::Throw( "The default glyph is missing from the font \"%s\".", path.c_str() );
for( unsigned i = 0; i < str.size(); ++i )
{
// If the glyph for this character is the default glyph, we're incomplete.
const glyph &g = GetGlyph( str[i] );
if( &g == m_pDefault->second )
if( &g == mapDefault->second )
return false;
}
return true;
@@ -718,8 +718,8 @@ void Font::Load( const RString &sIniPath, RString sChars )
for(unsigned i = 0; i < ImportList.size(); ++i)
{
RString path = THEME->GetPathF( "", ImportList[i], true );
if( path == "" )
RString fPath = THEME->GetPathF( "", ImportList[i], true );
if( fPath == "" )
{
RString s = ssprintf( "Font \"%s\" imports a font \"%s\" that doesn't exist", sIniPath.c_str(), ImportList[i].c_str() );
Dialog::OK( s );
@@ -727,7 +727,7 @@ void Font::Load( const RString &sIniPath, RString sChars )
}
Font subfont;
subfont.Load(path,"");
subfont.Load(fPath,"");
MergeFont(subfont);
//FONT->UnloadFont(subfont);
}
+5 -5
View File
@@ -76,23 +76,23 @@ void Foreground::Update( float fDeltaTime )
/* Update the actor even if we're about to hide it, so queued commands
* are always run. */
float fDeltaTime;
float lDeltaTime;
if( !bga.m_bga->GetVisible() )
{
bga.m_bga->SetVisible( true );
const float fStartSecond = m_pSong->m_Timing.GetElapsedTimeFromBeat( bga.m_fStartBeat );
fDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond;
lDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond;
}
else
{
fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds;
lDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds;
}
// This shouldn't go down, but be safe:
fDeltaTime = max( fDeltaTime, 0 );
lDeltaTime = max( lDeltaTime, 0 );
bga.m_bga->Update( fDeltaTime / fRate );
bga.m_bga->Update( lDeltaTime / fRate );
if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat )
{
+2 -2
View File
@@ -93,8 +93,8 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
if( m_pSteps == NULL && m_dc != Difficulty_Invalid )
{
// Why is this checking for all players?
FOREACH_HumanPlayer( pn )
if( GAMESTATE->m_PreferredDifficulty[pn] != m_dc )
FOREACH_HumanPlayer( human )
if( GAMESTATE->m_PreferredDifficulty[human] != m_dc )
return false;
}
+2 -2
View File
@@ -2361,9 +2361,9 @@ public:
return 1;
}
static int GetCurrentStepsCredits( T* p, lua_State *L )
static int GetCurrentStepsCredits( T* t, lua_State *L )
{
const Song* pSong = p->m_pCurSong;
const Song* pSong = t->m_pCurSong;
if( pSong == NULL )
return 0;
+3 -3
View File
@@ -1093,12 +1093,12 @@ void InputMappings::ReadMappings( const InputScheme *pInputScheme, RString sFile
vector<RString> sDeviceInputStrings;
split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false );
for( unsigned i=0; i<sDeviceInputStrings.size() && i<unsigned(NUM_GAME_TO_DEVICE_SLOTS); i++ )
for( unsigned j=0; j<sDeviceInputStrings.size() && j<unsigned(NUM_GAME_TO_DEVICE_SLOTS); j++ )
{
DeviceInput DeviceI;
DeviceI.FromString( sDeviceInputStrings[i] );
DeviceI.FromString( sDeviceInputStrings[j] );
if( DeviceI.IsValid() )
SetInputMap( DeviceI, GameI, i );
SetInputMap( DeviceI, GameI, j );
}
}
}
+3 -3
View File
@@ -155,15 +155,15 @@ void ModIconRow::SetFromGameState()
continue; // skip
// 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;
}
else
{
vsText[i] = sOption;
vsText[j] = sOption;
break;
}
}
+3 -6
View File
@@ -66,12 +66,9 @@ private:
RageTexture* pTexture_,
float fDelaySecs_,
RageVector2 vTranslate_
)
{
pTexture = pTexture_;
fDelaySecs = fDelaySecs_;
vTranslate = vTranslate_;
}
):
pTexture(pTexture_), fDelaySecs(fDelaySecs_),
vTranslate(vTranslate_) {}
RageTexture* pTexture;
float fDelaySecs;
+2 -2
View File
@@ -847,9 +847,9 @@ void NoteData::GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow,
--prev;
if( prev->second.type == TapNote::hold_head )
{
int iStartRow = prev->first;
int localStartRow = prev->first;
const TapNote &tn = prev->second;
if( iStartRow + tn.iDuration >= iEndRow )
if( localStartRow + tn.iDuration >= iEndRow )
end = prev;
}
}
+5 -8
View File
@@ -250,8 +250,8 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS
for( int t=0; t<out.GetNumTracks(); t++ )
{
NoteData::iterator begin = out.begin( t );
NoteData::iterator end = out.end( t );
while( begin != end )
NoteData::iterator lEnd = out.end( t );
while( begin != lEnd )
{
NoteData::iterator next = Increment( begin );
const TapNote &tn = begin->second;
@@ -629,12 +629,9 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow )
int iMaxTailRow = -1;
for( int t=0; t<in.GetNumTracks(); t++ )
{
for( int t=0; t<in.GetNumTracks(); t++ )
{
const TapNote &tn = in.GetTapNote( t, iRow );
if( tn.type == TapNote::hold_head )
iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration );
}
const TapNote &tn = in.GetTapNote( t, iRow );
if( tn.type == TapNote::hold_head )
iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration );
}
return iMaxTailRow;
+13 -9
View File
@@ -209,7 +209,7 @@ void NoteField::Load(
memset( m_pDisplays, 0, sizeof(m_pDisplays) );
FOREACH_EnabledPlayer( pn )
{
RString sNoteSkinLower = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin;
sNoteSkinLower = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin;
// XXX: Re-setup sNoteSkinLower. Unsure if inserting the skin again is needed.
if (sNoteSkinLower.empty())
@@ -1005,8 +1005,8 @@ void NoteField::DrawPrimitives()
m_pNoteData->GetTapNoteRange( c, iFirstRowToDraw, iLastRowToDraw+1, begin, end );
for( ; begin != end; ++begin )
{
int i = begin->first;
const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, i);
int q = begin->first;
const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, q);
// Switch modified by Wolfman2000, tested by Saturn2888
// Fixes hold head overlapping issue, but not the rolls.
@@ -1031,10 +1031,11 @@ void NoteField::DrawPrimitives()
// TRICKY: If boomerang is on, then all notes in the range
// [iFirstRowToDraw,iLastRowToDraw] aren't necessarily visible.
// Test every note to make sure it's on screen before drawing.
if( !IsOnScreen( NoteRowToBeat(i), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) )
if( !IsOnScreen( NoteRowToBeat(q), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) )
continue; // skip
ASSERT_M( NoteRowToBeat(i) > -2000, ssprintf("%i %i %i, %f %f", i, iLastRowToDraw, iFirstRowToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) );
ASSERT_M( NoteRowToBeat(q) > -2000, ssprintf("%i %i %i, %f %f", q, iLastRowToDraw,
iFirstRowToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) );
// See if there is a hold step that begins on this index.
// Only do this if the noteskin cares.
@@ -1043,7 +1044,7 @@ void NoteField::DrawPrimitives()
{
for( int c2=0; c2<m_pNoteData->GetNumTracks(); c2++ )
{
if( m_pNoteData->GetTapNote(c2, i).type == TapNote::hold_head)
if( m_pNoteData->GetTapNote(c2, q).type == TapNote::hold_head)
{
bHoldNoteBeginsOnThisBeat = true;
break;
@@ -1053,15 +1054,18 @@ void NoteField::DrawPrimitives()
bool bIsInSelectionRange = false;
if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 )
bIsInSelectionRange = m_iBeginMarker<=i && i<m_iEndMarker;
bIsInSelectionRange = m_iBeginMarker<=q && q<m_iEndMarker;
bool bIsAddition = (tn.source == TapNote::addition);
bool bIsHopoPossible = (tn.bHopoPossible);
bool bUseAdditionColoring = bIsAddition || bIsHopoPossible;
NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn];
displayCols->display[c].DrawTap( tn, c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels, FADE_BEFORE_TARGETS_PERCENT );
displayCols->display[c].DrawTap( tn, c, NoteRowToBeat(q), bHoldNoteBeginsOnThisBeat,
bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail,
m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels,
FADE_BEFORE_TARGETS_PERCENT );
bool bNoteIsUpcoming = NoteRowToBeat(i) > GAMESTATE->m_fSongBeat;
bool bNoteIsUpcoming = NoteRowToBeat(q) > GAMESTATE->m_fSongBeat;
bAnyUpcomingInThisCol |= bNoteIsUpcoming;
}
+7 -7
View File
@@ -282,22 +282,22 @@ try_again:
const NoteSkinData &data = iter->second;
RString sPath; // fill this in below
FOREACH_CONST( RString, data.vsDirSearchOrder, iter )
FOREACH_CONST( RString, data.vsDirSearchOrder, lIter )
{
if( sButtonName.empty() )
sPath = GetPathFromDirAndFile( *iter, sElement );
sPath = GetPathFromDirAndFile( *lIter, sElement );
else
sPath = GetPathFromDirAndFile( *iter, sButtonName+" "+sElement );
sPath = GetPathFromDirAndFile( *lIter, sButtonName+" "+sElement );
if( !sPath.empty() )
break; // done searching
}
if( sPath.empty() )
{
FOREACH_CONST( RString, data.vsDirSearchOrder, iter )
FOREACH_CONST( RString, data.vsDirSearchOrder, lIter )
{
if( !sButtonName.empty() )
sPath = GetPathFromDirAndFile( *iter, "Fallback "+sElement );
sPath = GetPathFromDirAndFile( *lIter, "Fallback "+sElement );
if( !sPath.empty() )
break; // done searching
}
@@ -340,9 +340,9 @@ try_again:
GetFileContents( sPath, sNewFileName, true );
RString sRealPath;
FOREACH_CONST( RString, data.vsDirSearchOrder, iter )
FOREACH_CONST( RString, data.vsDirSearchOrder, lIter )
{
sRealPath = GetPathFromDirAndFile( *iter, sNewFileName );
sRealPath = GetPathFromDirAndFile( *lIter, sNewFileName );
if( !sRealPath.empty() )
break; // done searching
}
+12 -12
View File
@@ -476,9 +476,9 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
if( sNoteId != "00" )
{
vTapNotes.push_back( TAP_ORIGINAL_TAP );
map<RString,int>::const_iterator it = idToKeySoundIndex.find( sNoteId );
if( it != idToKeySoundIndex.end() )
vTapNotes.back().iKeysoundIndex = it->second;
map<RString,int>::const_iterator rInt = idToKeySoundIndex.find( sNoteId );
if( rInt != idToKeySoundIndex.end() )
vTapNotes.back().iKeysoundIndex = rInt->second;
}
else
{
@@ -762,28 +762,28 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
continue;
// this is keysound file name. Looks like "#WAV1A"
RString sData = it->second;
RString nData = it->second;
RString sWavID = sName.Right(2);
/* 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.
* 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. */
if( !IsAFile(out.GetSongDir()+sData) )
if( !IsAFile(out.GetSongDir()+nData) )
{
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
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) )
{
sData = fn;
nData = fn;
break;
}
}
}
if( !IsAFile(out.GetSongDir()+sData) )
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() );
if( !IsAFile(out.GetSongDir()+nData) )
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() );
sWavID.MakeUpper(); // HACK: undo the MakeLower()
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 );
int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure );
RString sData = it->second;
int totalPairs = sData.size() / 2;
RString nData = it->second;
int totalPairs = nData.size() / 2;
for( int i = 0; i < totalPairs; ++i )
{
RString sPair = sData.substr( i*2, 2 );
RString sPair = nData.substr( i*2, 2 );
int iVal = 0;
if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 )
+5 -5
View File
@@ -750,9 +750,9 @@ static bool LoadFromMidi( const RString &sPath, Song &songOut )
if( uVelocity == 0 )
midiEventType = note_off;
MidiEvent event = { count, midiEventType };
MidiEvent mEvent = { count, midiEventType };
//float fBeat = NoteRowToBeat( MidiCountToNoteRow(count) );
vMidiEvent[uNoteNumber].push_back( event );
vMidiEvent[uNoteNumber].push_back( mEvent );
}
break;
default:
@@ -850,13 +850,13 @@ skip_track:
// hold note ending on the same row as a tap note.
NoteData::TrackMap::iterator begin, end;
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 )
// LOG->Trace( "shortening hold at %f, length %d", fBeat, length );
ASSERT( iter->second.type == TapNote::hold_head );
iter->second.iDuration = MidiCountToNoteRow(count) - iter->first - 2;
ASSERT( lIter->second.type == TapNote::hold_head );
lIter->second.iDuration = MidiCountToNoteRow(count) - lIter->first - 2;
}
noteData.SetTapNote( nnt, MidiCountToNoteRow(count), tn );
+14 -14
View File
@@ -408,9 +408,9 @@ static bool LoadFromPMSFile( const RString &sPath, const NameToData_t &mapNameTo
if( sNoteId != "00" )
{
vTapNotes.push_back( TAP_ORIGINAL_TAP );
map<RString,int>::const_iterator it = idToKeySoundIndex.find( sNoteId );
if( it != idToKeySoundIndex.end() )
vTapNotes.back().iKeysoundIndex = it->second;
map<RString,int>::const_iterator rInt = idToKeySoundIndex.find( sNoteId );
if( rInt != idToKeySoundIndex.end() )
vTapNotes.back().iKeysoundIndex = rInt->second;
}
else
{
@@ -609,31 +609,31 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
continue;
// this is keysound file name. Looks like "#WAV1A"
RString sData = it->second;
RString nData = it->second;
RString sWavID = sName.Right(2);
/* 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.
* 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. */
if( !IsAFile(out.GetSongDir()+sData) )
if( !IsAFile(out.GetSongDir()+nData) )
{
const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere
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) )
{
sData = fn;
nData = fn;
break;
}
}
}
if( !IsAFile(out.GetSongDir()+sData) )
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() );
if( !IsAFile(out.GetSongDir()+nData) )
LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() );
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;
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 );
int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure );
RString sData = it->second;
int totalPairs = sData.size() / 2;
RString nData = it->second;
int totalPairs = nData.size() / 2;
for( int i = 0; i < totalPairs; ++i )
{
RString sPair = sData.substr( i*2, 2 );
RString sPair = nData.substr( i*2, 2 );
int 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
int iBPMNo;
sscanf( sData, "%x", &iBPMNo ); // data is in hexadecimal
sscanf( nData, "%x", &iBPMNo ); // data is in hexadecimal
RString sBPM;
RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo );
+2 -2
View File
@@ -413,9 +413,9 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
if(arrayWarpsFromNegativeBPMs.size() > 0)
{
// 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.
+1 -1
View File
@@ -603,7 +603,7 @@ void OptionRow::UpdateEnabledDisabled()
case LAYOUT_SHOW_ONE_IN_ROW:
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 )
{
+7 -7
View File
@@ -149,15 +149,15 @@ public:
{
// Parse the basic configuration metric.
Commands cmds = ParseCommands( ENTRY(sParam) );
if( cmds.v.size() < 1 )
Commands lCmds = ParseCommands( ENTRY(sParam) );
if( lCmds.v.size() < 1 )
RageException::Throw( "Parse error in \"ScreenOptionsMaster::%s\".", sParam.c_str() );
m_Def.m_bOneChoiceForAllPlayers = false;
const int NumCols = atoi( cmds.v[0].m_vsArgs[0] );
for( unsigned i=1; i<cmds.v.size(); i++ )
const int NumCols = atoi( lCmds.v[0].m_vsArgs[0] );
for( unsigned i=1; i<lCmds.v.size(); i++ )
{
const Command &cmd = cmds.v[i];
const Command &cmd = lCmds.v[i];
RString sName = cmd.GetName();
if( sName == "together" ) m_Def.m_bOneChoiceForAllPlayers = true;
@@ -188,8 +188,8 @@ public:
}
else if( sName == "broadcastonexport" )
{
for( unsigned i=1; i<cmd.m_vsArgs.size(); i++ )
m_vsBroadcastOnExport.push_back( cmd.m_vsArgs[i] );
for( unsigned j=1; j<cmd.m_vsArgs.size(); j++ )
m_vsBroadcastOnExport.push_back( cmd.m_vsArgs[j] );
}
else
{
+4 -4
View File
@@ -53,12 +53,12 @@ void OptionsCursor::Load( const RString &sMetricsGroup, bool bLoadCanGos )
}
#undef LOAD_SPR
m_iOriginalLeftX = m_sprLeft->GetX();
m_iOriginalRightX = m_sprRight->GetX();
m_iOriginalLeftX = static_cast<int>(m_sprLeft->GetX());
m_iOriginalRightX = static_cast<int>(m_sprRight->GetX());
if( bLoadCanGos )
{
m_iOriginalCanGoLeftX = m_sprCanGoLeft->GetX();
m_iOriginalCanGoRightX = m_sprCanGoRight->GetX();
m_iOriginalCanGoLeftX = static_cast<int>(m_sprCanGoLeft->GetX());
m_iOriginalCanGoRightX = static_cast<int>(m_sprCanGoRight->GetX());
}
SetCanGo( false, false );
+14 -14
View File
@@ -138,17 +138,17 @@ void OptionListRow::SetUnderlines( const vector<bool> &aSelections, const Option
if( pTarget->m_Def.m_selectType == SELECT_ONE )
{
int iSelection = m_pOptions->GetOneSelection(sDest);
const OptionRowHandler *pHandler = m_pOptions->m_Rows.find(sDest)->second;
int iDefault = pHandler->GetDefaultOption();
const OptionRowHandler *lHandler = m_pOptions->m_Rows.find(sDest)->second;
int iDefault = lHandler->GetDefaultOption();
if( iDefault != -1 && iSelection != iDefault )
bSelected |= true;
}
else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE )
{
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;
}
}
@@ -400,10 +400,10 @@ void OptionsList::Input( const InputEventPlus &input )
wrap( iSelection, bTargetSelections.size() );
SelectItem( sDest, iSelection );
Message msg("OptionsListQuickChange");
msg.SetParam( "Player", pn );
msg.SetParam( "Direction", iDir );
MESSAGEMAN->Broadcast( msg );
Message lMsg("OptionsListQuickChange");
lMsg.SetParam( "Player", pn );
lMsg.SetParam( "Direction", iDir );
MESSAGEMAN->Broadcast( lMsg );
}
}
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
PositionCursor();
Message msg("OptionsListLeft");
msg.SetParam( "Player", input.pn );
MESSAGEMAN->Broadcast( msg );
Message lMsg("OptionsListLeft");
lMsg.SetParam( "Player", input.pn );
MESSAGEMAN->Broadcast( lMsg );
return;
}
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
PositionCursor();
Message msg("OptionsListRight");
msg.SetParam( "Player", input.pn );
MESSAGEMAN->Broadcast( msg );
Message lMsg("OptionsListRight");
lMsg.SetParam( "Player", input.pn );
MESSAGEMAN->Broadcast( lMsg );
return;
}
else if( input.MenuI == GAME_BUTTON_START )
+6 -6
View File
@@ -2810,16 +2810,16 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now )
int iNumHoldsMissedThisRow = 0;
// 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 );
for( ; !iter.IsAtEnd(); ++iter )
NoteData::all_tracks_iterator nIter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true );
for( ; !nIter.IsAtEnd(); ++nIter )
{
TapNote &tn = *iter;
TapNote &tn = *nIter;
if( tn.type != TapNote::hold_head )
continue;
int iStartRow = iter.Row();
int iStartRow = nIter.Row();
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"
int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows;
@@ -3193,7 +3193,7 @@ void Player::SetCombo( int iCombo, int iMisses )
if( GAMESTATE->IsCourseMode() )
{
int iSongIndexStartColoring = GAMESTATE->m_pCurCourse->GetEstimatedNumStages();
iSongIndexStartColoring = floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO);
iSongIndexStartColoring = static_cast<int>(floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO));
bPastBeginning = GAMESTATE->GetCourseSongIndex() >= iSongIndexStartColoring;
}
else
+7 -7
View File
@@ -363,8 +363,8 @@ float Profile::GetSongsActual( StepsType st, Difficulty dc ) const
FOREACHM_CONST( StepsID, HighScoresForASteps, hsfas.m_StepsHighScores, j )
{
const StepsID &id = j->first;
Steps* pSteps = id.ToSteps( pSong, true );
const StepsID &sid = j->first;
Steps* pSteps = sid.ToSteps( pSong, true );
CHECKPOINT_M( ssprintf("Profile::GetSongsActual: song %p, steps %p", pSong, pSteps) );
// If the Steps isn't loaded on the current machine, then we can't
@@ -375,7 +375,7 @@ float Profile::GetSongsActual( StepsType st, Difficulty dc ) const
if( pSteps->m_StepsType != st )
continue;
CHECKPOINT_M( ssprintf("Profile::GetSongsActual: n %s = %p", id.ToString().c_str(), pSteps) );
CHECKPOINT_M( ssprintf("Profile::GetSongsActual: n %s = %p", sid.ToString().c_str(), pSteps) );
if( pSteps->GetDifficulty() != dc )
continue; // skip
CHECKPOINT;
@@ -1303,13 +1303,13 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
if( style->GetName() != "Style" )
continue;
StyleID s;
s.LoadFromNode( style );
StyleID sID;
sID.LoadFromNode( style );
if( !s.IsValid() )
if( !sID.IsValid() )
WARN_AND_CONTINUE;
style->GetTextValue( m_iNumSongsPlayedByStyle[s] );
style->GetTextValue( m_iNumSongsPlayedByStyle[sID] );
}
}
}
+3 -3
View File
@@ -489,10 +489,10 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID )
g_vLocalProfile.erase( i );
// Delete all references to this profileID
FOREACH_CONST( Preference<RString>*, m_sDefaultLocalProfileID.m_v, i )
FOREACH_CONST( Preference<RString>*, m_sDefaultLocalProfileID.m_v, j )
{
if( (*i)->Get() == sProfileID )
(*i)->Set( "" );
if( (*j)->Get() == sProfileID )
(*j)->Set( "" );
}
return true;
}
+1 -1
View File
@@ -760,7 +760,7 @@ bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format )
int iHeight = 480;
// This used to be lrintf. However, lrintf causes odd resolutions like
// 639x480 (4:3) and 853x480 (16:9). ceilf gives correct values. -aj
int iWidth = ceilf( iHeight * GetActualVideoModeParams().fDisplayAspectRatio );
int iWidth = static_cast<int>(ceilf( iHeight * GetActualVideoModeParams().fDisplayAspectRatio ));
timer.Touch();
RageSurfaceUtils::Zoom( surface, iWidth, iHeight );
// LOG->Trace( "%ix%i -> %ix%i (%.3f) in %f seconds", surface->w, surface->h, iWidth, iHeight, GetActualVideoModeParams().fDisplayAspectRatio, timer.GetDeltaTime() );
+3 -3
View File
@@ -245,14 +245,14 @@ int RageFileObjDeflate::WriteInternal( const void *pBuffer, size_t iBytes )
if( m_pDeflate->avail_out < sizeof(buf) )
{
int iBytes = sizeof(buf)-m_pDeflate->avail_out;
int iRet = m_pFile->Write( buf, iBytes );
int lBytes = sizeof(buf)-m_pDeflate->avail_out;
int iRet = m_pFile->Write( buf, lBytes );
if( iRet == -1 )
{
SetError( m_pFile->GetError() );
return -1;
}
if( iRet < iBytes )
if( iRet < lBytes )
{
SetError( "Partial write" );
return -1;
+2 -2
View File
@@ -377,8 +377,8 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector<RString> &Add
for( unsigned j = OldStart; j < AddTo.size(); ++j )
{
/* Skip the trailing slash on the mountpoint; there's already a slash there. */
RString &sPath = AddTo[j];
sPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 );
RString &lPath = AddTo[j];
lPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 );
}
}
}
+2 -2
View File
@@ -575,8 +575,8 @@ float RageFastSin( float x )
bInited = true;
for( unsigned i=0; i<ARRAYLEN(table); i++ )
{
float x = SCALE(i,0,ARRAYLEN(table),0.0f,PI);
table[i] = sinf(x);
float z = SCALE(i,0,ARRAYLEN(table),0.0f,PI);
table[i] = sinf(z);
}
}
-3
View File
@@ -33,7 +33,6 @@ RageSoundReader_Chain::~RageSoundReader_Chain()
while( !m_apActiveSounds.empty() )
ReleaseSound( m_apActiveSounds.front() );
map<RString, RageSoundReader *>::iterator it;
FOREACH( RageSoundReader *, m_apLoadedSounds, it )
delete *it;
}
@@ -103,7 +102,6 @@ int RageSoundReader_Chain::GetSampleRateInternal() const
if( m_apLoadedSounds.empty() )
return m_iPreferredSampleRate;
map<RString, RageSoundReader *>::const_iterator it;
int iRate = -1;
FOREACH_CONST( RageSoundReader *, m_apLoadedSounds, it )
{
@@ -120,7 +118,6 @@ void RageSoundReader_Chain::Finish()
/* Figure out how many channels we have. All sounds must either have 1 or 2 channels,
* which will be converted as needed, or have the same number of channels. */
m_iChannels = 1;
map<RString, RageSoundReader *>::iterator it;
FOREACH( RageSoundReader *, m_apLoadedSounds, it )
m_iChannels = max( m_iChannels, (*it)->GetNumChannels() );
+1 -1
View File
@@ -426,7 +426,7 @@ int RageSoundReader_MP3::do_mad_frame_decode( bool headers_only )
return -1;
}
int ret = fill_buffer();
ret = fill_buffer();
if( ret <= 0 )
return ret;
bytes_read += ret;
-1
View File
@@ -18,7 +18,6 @@ RageSoundReader_Merge::RageSoundReader_Merge()
RageSoundReader_Merge::~RageSoundReader_Merge()
{
map<RString, RageSoundReader *>::iterator it;
FOREACH( RageSoundReader *, m_aSounds, it )
delete *it;
}
+1 -1
View File
@@ -7,7 +7,7 @@
struct RageSurfaceColor
{
uint8_t r, g, b, a;
RageSurfaceColor() { }
RageSurfaceColor(): r(0), g(0), b(0), a(0) { }
RageSurfaceColor( uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_ ):
r(r_), g(g_), b(b_), a(a_) { }
+2 -2
View File
@@ -585,8 +585,8 @@ static bool blit_rgba_to_rgba( const RageSurface *src_surf, const RageSurface *d
unsigned int opixel = 0;
for( int c = 0; c < 4; ++c )
{
int src = (pixel & src_masks[c]) >> src_shifts[c];
opixel |= lookup[c][src] << dst_shifts[c];
int lSrc = (pixel & src_masks[c]) >> src_shifts[c];
opixel |= lookup[c][lSrc] << dst_shifts[c];
}
// Store it.
+6 -6
View File
@@ -454,7 +454,7 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i
#ifdef REP_AVERAGE_PIXELS
int indx = bv[bi].ind;
int clrs = bv[bi].colors;
long r = 0, g = 0, b = 0, a = 0, sum = 0;
long r = 0, g = 0, b = 0, a = 0, lSum = 0;
for ( int i = 0; i < clrs; ++i )
{
@@ -462,15 +462,15 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i
g += PAM_GETG( achv[indx + i].acolor ) * achv[indx + i].value;
b += PAM_GETB( achv[indx + i].acolor ) * achv[indx + i].value;
a += PAM_GETA( achv[indx + i].acolor ) * achv[indx + i].value;
sum += achv[indx + i].value;
lSum += achv[indx + i].value;
}
r = r / sum;
r = r / lSum;
r = min( r, (long) maxval );
g = g / sum;
g = g / lSum;
g = min( g, (long) maxval );
b = b / sum;
b = b / lSum;
b = min( b, (long) maxval );
a = a / sum;
a = a / lSum;
a = min( a, (long) maxval );
PAM_ASSIGN( acolormap[bi].acolor, (uint8_t)r, (uint8_t)g, (uint8_t)b, (uint8_t)a );
#endif // REP_AVERAGE_PIXELS
+9 -2
View File
@@ -59,8 +59,15 @@ struct RageTextureID
void Init();
RageTextureID() { Init(); }
RageTextureID( const RString &fn ) { Init(); SetFilename(fn); }
RageTextureID(): filename(RString()), iMaxSize(0), bMipMaps(false),
iAlphaBits(0), iGrayscaleBits(0), iColorDepth(0),
bDither(false), bStretch(false), bHotPinkColorKey(false),
AdditionalTextureHints(RString()), Policy(TEX_DEFAULT) { Init(); }
RageTextureID( const RString &fn ): filename(RString()), iMaxSize(0),
bMipMaps(false), iAlphaBits(0), iGrayscaleBits(0),
iColorDepth(0), bDither(false), bStretch(false),
bHotPinkColorKey(false), AdditionalTextureHints(RString()),
Policy(TEX_DEFAULT) { Init(); SetFilename(fn); }
void SetFilename( const RString &fn );
};
+11 -18
View File
@@ -14,30 +14,23 @@ struct RageTextureManagerPrefs
bool m_bHighResolutionTextures;
bool m_bMipMaps;
RageTextureManagerPrefs()
{
m_bDelayedDelete = false;
m_iMovieColorDepth = 16;
m_iTextureColorDepth = 16;
m_iMaxTextureResolution = 1024;
m_bHighResolutionTextures = true;
m_bMipMaps = false;
}
RageTextureManagerPrefs(): m_iTextureColorDepth(16),
m_iMovieColorDepth(16), m_bDelayedDelete(false),
m_iMaxTextureResolution(1024),
m_bHighResolutionTextures(true), m_bMipMaps(false) {}
RageTextureManagerPrefs(
int iTextureColorDepth,
int iMovieColorDepth,
bool bDelayedDelete,
int iMaxTextureResolution,
bool bHighResolutionTextures,
bool bMipMaps )
{
m_bDelayedDelete = bDelayedDelete;
m_iMovieColorDepth = iMovieColorDepth;
m_iTextureColorDepth = iTextureColorDepth;
m_iMaxTextureResolution = iMaxTextureResolution;
m_bHighResolutionTextures = bHighResolutionTextures;
m_bMipMaps = bMipMaps;
}
bool bMipMaps ):
m_iTextureColorDepth(iTextureColorDepth),
m_iMovieColorDepth(iMovieColorDepth),
m_bDelayedDelete(bDelayedDelete),
m_iMaxTextureResolution(iMaxTextureResolution),
m_bHighResolutionTextures(bHighResolutionTextures),
m_bMipMaps(bMipMaps) {}
bool operator!=( const RageTextureManagerPrefs& rhs ) const
{
+17 -16
View File
@@ -100,9 +100,9 @@ struct lua_State;
struct RageVector2
{
public:
RageVector2() {}
RageVector2( const float * f ) { x=f[0]; y=f[1]; }
RageVector2( float x1, float y1 ) { x=x1; y=y1; }
RageVector2(): x(0), y(0) {}
RageVector2( const float * f ): x(f[0]), y(f[1]) {}
RageVector2( float x1, float y1 ): x(x1), y(y1) {}
// casting
operator float* () { return &x; };
@@ -129,9 +129,9 @@ public:
struct RageVector3
{
public:
RageVector3() {}
RageVector3( const float * f ) { x=f[0]; y=f[1]; z=f[2]; }
RageVector3( float x1, float y1, float z1 ) { x=x1; y=y1; z=z1; }
RageVector3(): x(0), y(0), z(0) {}
RageVector3( const float * f ): x(f[0]), y(f[1]), z(f[2]) {}
RageVector3( float x1, float y1, float z1 ): x(x1), y(y1), z(z1) {}
// casting
operator float* () { return &x; };
@@ -158,9 +158,9 @@ public:
struct RageVector4
{
public:
RageVector4() {}
RageVector4( const float * f ) { x=f[0]; y=f[1]; z=f[2]; w=f[3]; }
RageVector4( float x1, float y1, float z1, float w1 ) { x=x1; y=y1; z=z1; w=w1; }
RageVector4(): x(0), y(0), z(0), w(0) {}
RageVector4( const float * f ): x(f[0]), y(f[1]), z(f[2]), w(f[3]) {}
RageVector4( float x1, float y1, float z1, float w1 ): x(x1), y(y1), z(z1), w(w1) {}
// casting
operator float* () { return &x; };
@@ -186,9 +186,9 @@ public:
struct RageColor
{
public:
RageColor() : r(0), g(0), b(0), a(0) {}
explicit RageColor( const float * f ) { r=f[0]; g=f[1]; b=f[2]; a=f[3]; }
RageColor( float r1, float g1, float b1, float a1 ) { r=r1; g=g1; b=b1; a=a1; }
RageColor(): r(0), g(0), b(0), a(0) {}
explicit RageColor( const float * f ): r(f[0]), g(f[1]), b(f[2]), a(f[3]) {}
RageColor( float r1, float g1, float b1, float a1 ): r(r1), g(g1), b(b1), a(a1) {}
// casting
operator float* () { return &r; };
@@ -290,8 +290,8 @@ class RageVColor
public:
uint8_t b,g,r,a; // specific ordering required by Direct3D
RageVColor() { }
RageVColor(const RageColor &rc) { *this = rc; }
RageVColor(): b(0), g(0), r(0), a(0) { }
RageVColor(const RageColor &rc): b(0), g(0), r(0), a(0) { *this = rc; }
RageVColor &operator= (const RageColor &rc)
{
r = FTOC(rc.r); g = FTOC(rc.g); b = FTOC(rc.b); a = FTOC(rc.a);
@@ -305,8 +305,8 @@ namespace StepMania
class Rect
{
public:
Rect() {};
Rect(T l, T t, T r, T b) { left = l, top = t, right = r, bottom = b; };
Rect(): left(0), top(0), right(0), bottom(0) {}
Rect(T l, T t, T r, T b): left(l), top(t), right(r), bottom(b) {}
T GetWidth() const { return right-left; };
T GetHeight() const { return bottom-top; };
@@ -349,6 +349,7 @@ struct RageModelVertex // doesn't have color. Relies on material color
p(0,0,0),
n(0,0,0),
t(0,0),
bone(0),
TextureMatrixScale(1,1)
{ }
RageVector3 p; // position
+3 -5
View File
@@ -17,7 +17,7 @@
RandomGen g_RandomNumberGenerator;
MersenneTwister::MersenneTwister( int iSeed )
MersenneTwister::MersenneTwister( int iSeed ) : m_iNext(0)
{
Reset( iSeed );
}
@@ -1315,15 +1315,13 @@ void Regex::Release()
m_sPattern = RString();
}
Regex::Regex( const RString &sStr )
Regex::Regex( const RString &sStr ): m_pReg(NULL), m_iBackrefs(0), m_sPattern(RString())
{
m_pReg = NULL;
Set( sStr );
}
Regex::Regex( const Regex &rhs )
Regex::Regex( const Regex &rhs ): m_pReg(NULL), m_iBackrefs(0), m_sPattern(RString())
{
m_pReg = NULL;
Set( rhs.m_sPattern );
}
+1 -1
View File
@@ -488,7 +488,7 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score )
p += m_CustomComboBonusValue;
}
p += m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier;
p += static_cast<int>(m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier);
if( m_iNumNotesHitThisRow == 2 )
p = (int)(p * m_DoubleNoteMultiplier);
+1 -1
View File
@@ -165,7 +165,7 @@ void ScreenBookkeeping::UpdateView()
if( iSongIndex < (int)vpSongs.size() )
{
Song *pSong = vpSongs[iSongIndex];
int iCount = pProfile->GetSongNumTimesPlayed( pSong );
iCount = pProfile->GetSongNumTimesPlayed( pSong );
RString sTitle = ssprintf("%4d",iCount) + " " + pSong->GetDisplayFullTitle();
if( sTitle.length() > 22 )
sTitle = sTitle.Left(20) + "...";
+19 -19
View File
@@ -273,30 +273,30 @@ void ScreenDebugOverlay::Init()
FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p )
{
{
BitmapText *p = new BitmapText;
p->SetName( "ButtonText" );
p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") );
p->SetHorizAlign( align_right );
p->SetText( "blah" );
BitmapText *bt = new BitmapText;
bt->SetName( "ButtonText" );
bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") );
bt->SetHorizAlign( align_right );
bt->SetText( "blah" );
//p->SetShadowLength( 2 );
LOAD_ALL_COMMANDS( *p );
LOAD_ALL_COMMANDS( *bt );
// xxx: I shouldn't have to do this:
ON_COMMAND( p );
m_vptextButton.push_back( p );
this->AddChild( p );
ON_COMMAND( bt );
m_vptextButton.push_back( bt );
this->AddChild( bt );
}
{
BitmapText *p = new BitmapText;
p->SetName( "FunctionText" );
p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") );
p->SetHorizAlign( align_left );
p->SetText( "blah" );
BitmapText *bt = new BitmapText;
bt->SetName( "FunctionText" );
bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") );
bt->SetHorizAlign( align_left );
bt->SetText( "blah" );
//p->SetShadowLength( 2 );
LOAD_ALL_COMMANDS( *p );
LOAD_ALL_COMMANDS( *bt );
// xxx: I shouldn't have to do this:
ON_COMMAND( p );
m_vptextFunction.push_back( p );
this->AddChild( p );
ON_COMMAND( bt );
m_vptextFunction.push_back( bt );
this->AddChild( bt );
}
}
@@ -498,7 +498,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input )
bt.FinishTweening();
// blink 5 times instead of 8
// TODO: make this all metrics instead -aj
for( int i=0; i<5; i++ )
for( i=0; i<5; i++ )
{
bt.SetGlow( RageColor(1,0,0,1) );
bt.Sleep(0.1f);
+3 -7
View File
@@ -797,12 +797,12 @@ void ScreenGameplay::InitSongQueues()
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
{
Trail *pTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ];
ASSERT( pTrail );
Trail *lTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ];
ASSERT( lTrail );
pi->m_vpStepsQueue.clear();
pi->m_asModifiersQueue.clear();
FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e )
FOREACH_CONST( TrailEntry, lTrail->m_vEntries, e )
{
ASSERT( e->pSteps );
pi->m_vpStepsQueue.push_back( e->pSteps );
@@ -1270,8 +1270,6 @@ void ScreenGameplay::LoadLights()
{
if( asDifficulties[0].CompareNoCase("selected") == 0 )
{
PlayerInfo pi;
// Base lights off current difficulty of active player
// Can be either P1 or P2 if they're individual or P1 if both are active
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
@@ -1305,8 +1303,6 @@ void ScreenGameplay::LoadLights()
// We've also specified for Player 2 to be based off current difficulty
if( asDifficulties[1].CompareNoCase("selected") == 0 && GAMESTATE->GetNumPlayersEnabled() > 1 )
{
PlayerInfo pi;
// Base lights off current difficulty of active player
// Only do this for P2 in a two-player situation, since P1 is taken care of above
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
+7 -7
View File
@@ -106,10 +106,10 @@ void ScreenJukebox::SetSong()
SONGMAN->GetAllCourses( apCourses, false );
vector<const CourseEntry *> apOptions;
vector<Course*> apPossibleCourses;
for( unsigned i = 0; i < apCourses.size(); ++i )
for( unsigned j = 0; j < apCourses.size(); ++j )
{
Course *pCourse = apCourses[i];
const CourseEntry *pEntry = pCourse->FindFixedSong( pSong );
Course *lCourse = apCourses[j];
const CourseEntry *pEntry = lCourse->FindFixedSong( pSong );
if( pEntry == NULL || pEntry->attacks.size() == 0 )
continue;
@@ -144,14 +144,14 @@ void ScreenJukebox::SetSong()
{
int iIndex = RandomInt( apOptions.size() );
m_pCourseEntry = apOptions[iIndex];
Course *pCourse = apPossibleCourses[iIndex];
Course *lCourse = apPossibleCourses[iIndex];
PlayMode pm = CourseTypeToPlayMode( pCourse->GetCourseType() );
PlayMode pm = CourseTypeToPlayMode( lCourse->GetCourseType() );
GAMESTATE->m_PlayMode.Set( pm );
GAMESTATE->m_pCurCourse.Set( pCourse );
GAMESTATE->m_pCurCourse.Set( lCourse );
FOREACH_PlayerNumber( p )
{
GAMESTATE->m_pCurTrail[p].Set( pCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) );
GAMESTATE->m_pCurTrail[p].Set( lCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) );
ASSERT( GAMESTATE->m_pCurTrail[p] );
}
}
+5 -5
View File
@@ -236,15 +236,15 @@ void ColorBitmapText::SetText( const RString& _sText, const RString& _sAlternate
RString FirstThree = m_sText.substr( i, 3 );
if( FirstThree.CompareNoCase("|c0") == 0 && iCharsLeft > 8 )
{
ColorChange change;
ColorChange cChange;
unsigned int r, g, b;
sscanf( m_sText.substr( i, 9 ).c_str(), "|%*c0%2x%2x%2x", &r, &g, &b );
change.c = RageColor( r/255.f, g/255.f, b/255.f, 1.f );
change.l = iGlyphsSoFar;
cChange.c = RageColor( r/255.f, g/255.f, b/255.f, 1.f );
cChange.l = iGlyphsSoFar;
if( iGlyphsSoFar == 0 )
m_vColors[0] = change;
m_vColors[0] = cChange;
else
m_vColors.push_back( change );
m_vColors.push_back( cChange );
i+=8;
continue;
}
+4 -4
View File
@@ -261,7 +261,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber
{
case EditCourseRow_Minutes:
row.SetOneSharedSelection( 0 );
row.SetOneSharedSelectionIfPresent( MakeMinutesString(GAMESTATE->m_pCurCourse->m_fGoalSeconds/60) );
row.SetOneSharedSelectionIfPresent( MakeMinutesString(static_cast<int>(GAMESTATE->m_pCurCourse->m_fGoalSeconds)/60) );
break;
default:
{
@@ -383,14 +383,14 @@ void ScreenOptionsEditCourse::SetCurrentSong()
}
else
{
int iRow = m_iCurrentRow[PLAYER_1];
iRow = m_iCurrentRow[PLAYER_1];
int iEntryIndex = RowToEntryIndex( iRow );
Song *pSong = NULL;
if( iEntryIndex != -1 )
{
int iCurrentSongRow = EntryIndexAndRowTypeToRow(iEntryIndex,RowType_Song);
OptionRow &row = *m_pRows[ iCurrentSongRow ];
int index = row.GetOneSelection(PLAYER_1);
OptionRow &oRow = *m_pRows[ iCurrentSongRow ];
int index = oRow.GetOneSelection(PLAYER_1);
if( index != 0 )
pSong = m_vpSongs[ index - 1 ];
}
+1 -1
View File
@@ -142,7 +142,7 @@ void ScreenOptionsManageCourses::BeginScreen()
vector<Course*>::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse );
if( iter != m_vpCourses.end() )
{
int iIndex = iter - m_vpCourses.begin();
iIndex = iter - m_vpCourses.begin();
this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex );
}
}
+1 -1
View File
@@ -110,7 +110,7 @@ void ScreenOptionsManageEditSteps::BeginScreen()
vector<Steps*>::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] );
if( iter != m_vpSteps.end() )
{
int iIndex = iter - m_vpSteps.begin();
iIndex = iter - m_vpSteps.begin();
this->MoveRowAbsolute( PLAYER_1, 1 + iIndex );
}
}
+3 -2
View File
@@ -197,8 +197,9 @@ void ScreenOptionsMemoryCard::ProcessMenuStart( const InputEventPlus &input )
const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices;
if( iCurRow < int(v.size()) ) // a card
{
const vector<UsbStorageDevice> &v = m_CurrentUsbStorageDevices;
const UsbStorageDevice &dev = v[iCurRow];
// Why is this statement in twice? Doubt it would change right after the if. -Wolfman2000
const vector<UsbStorageDevice> &vUSB = m_CurrentUsbStorageDevices;
const UsbStorageDevice &dev = vUSB[iCurRow];
MEMCARDMAN->m_sEditorMemoryCardOsMountPoint.Set( dev.sOsMountDir );
/* The destination screen must UnmountCard. XXX: brittle */
+2 -1
View File
@@ -244,7 +244,8 @@ float ScreenRanking::SetPage( const PageToShow &pts )
for( int l=0; l<NUM_RANKING_LINES; l++ )
{
StepsType st = pts.aTypes.front().second;
// No need to shadow at this point.
st = pts.aTypes.front().second;
HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCategoryHighScoreList(st, pts.category);
HighScore hs;
bool bRecentHighScore = false;
+6 -6
View File
@@ -1376,9 +1376,9 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
// Don't play start sound. We play it again below on finalized
//m_soundStart.Play();
Message msg("StepsChosen");
msg.SetParam( "Player", p );
MESSAGEMAN->Broadcast( msg );
Message lMsg("StepsChosen");
lMsg.SetParam( "Player", p );
MESSAGEMAN->Broadcast( lMsg );
}
}
@@ -1781,19 +1781,19 @@ void ScreenSelectMusic::AfterMusicChange()
case TYPE_COURSE:
{
const Course *pCourse = m_MusicWheel.GetSelectedCourse();
const Course *lCourse = m_MusicWheel.GetSelectedCourse();
const Style *pStyle = NULL;
if( CommonMetrics::AUTO_SET_STYLE )
pStyle = pCourse->GetCourseStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined() );
if( pStyle == NULL )
pStyle = GAMESTATE->GetCurrentStyle();
pCourse->GetTrails( m_vpTrails, pStyle->m_StepsType );
lCourse->GetTrails( m_vpTrails, pStyle->m_StepsType );
m_sSampleMusicToPlay = m_sCourseMusicPath;
m_fSampleStartSeconds = 0;
m_fSampleLengthSeconds = -1;
g_sBannerPath = pCourse->GetBannerPath();
g_sBannerPath = lCourse->GetBannerPath();
if( g_sBannerPath.empty() )
m_Banner.LoadFallback();
-1
View File
@@ -38,7 +38,6 @@ class InputList: public BitmapText
// Update input texts
vector<RString> asInputs;
DeviceInput di;
vector<DeviceInput> DeviceInputs;
INPUTFILTER->GetPressedButtons( DeviceInputs );
FOREACH( DeviceInput, DeviceInputs, di )
+1 -1
View File
@@ -46,7 +46,7 @@ void ScrollBar::SetPercentage( float fCenterPercent, float fSizePercent )
{
wrap( fCenterPercent, 1.0f );
const int iBarContentHeight = m_sprMiddle->GetZoomedHeight();
const int iBarContentHeight = static_cast<int>(m_sprMiddle->GetZoomedHeight());
ASSERT( iBarContentHeight != 0 );
/* Set tick thumb */
+5 -5
View File
@@ -1488,15 +1488,15 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre
if( MOVE_UNLOCKS_TO_BOTTOM_OF_PREFERRED_SORT.GetValue() )
{
// move all unlock songs to a group at the bottom
PreferredSortSection section;
section.sName = "Unlocks";
PreferredSortSection PFSection;
PFSection.sName = "Unlocks";
FOREACH( UnlockEntry, UNLOCKMAN->m_UnlockEntries, ue )
{
if( ue->m_Type == UnlockRewardType_Song )
{
Song *pSong = ue->m_Song.ToSong();
if( pSong )
section.vpSongs.push_back( pSong );
PFSection.vpSongs.push_back( pSong );
}
}
@@ -1505,14 +1505,14 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre
for( int i=v->vpSongs.size()-1; i>=0; i-- )
{
Song *pSong = v->vpSongs[i];
if( find(section.vpSongs.begin(),section.vpSongs.end(),pSong) != section.vpSongs.end() )
if( find(PFSection.vpSongs.begin(),PFSection.vpSongs.end(),pSong) != PFSection.vpSongs.end() )
{
v->vpSongs.erase( v->vpSongs.begin()+i );
}
}
}
m_vPreferredSongSort.push_back( section );
m_vPreferredSongSort.push_back( PFSection );
}
// prune empty groups
+2 -2
View File
@@ -396,11 +396,11 @@ public:
return 1;
}
static int GetBestFinalGrade( T* p, lua_State *L )
static int GetBestFinalGrade( T* t, lua_State *L )
{
Grade top_grade = Grade_Failed;
StageStats stats;
p->GetFinalEvalStageStats( stats );
t->GetFinalEvalStageStats( stats );
FOREACH_HumanPlayer( p )
{
// If this player failed any stage, then their final grade is an F.
+2 -2
View File
@@ -103,7 +103,7 @@ void StepMania::GetPreferredVideoModeParams( VideoModeParams &paramsOut )
{
//float fRatio = PREFSMAN->m_iDisplayWidth / PREFSMAN->m_iDisplayHeight;
//iWidth = PREFSMAN->m_iDisplayHeight * fRatio;
iWidth = ceilf(PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio);
iWidth = static_cast<int>(ceilf(PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio));
}
// todo: allow for PRODUCT_ID + "-" + CommonMetrics::WINDOW_TITLE as
@@ -917,7 +917,7 @@ static void WriteLogHeader()
#endif
// this code should only be enabled in distributed builds
//LOG->Info("sm-ssc is Copyright ©2009 the spinal shark collective, all rights reserved. Commercial use of this binary is prohibited by law and will be prosecuted to the fullest extent of the law.");
//LOG->Info("sm-ssc is Copyright 2009 the spinal shark collective, all rights reserved. Commercial use of this binary is prohibited by law and will be prosecuted to the fullest extent of the law.");
// end limited code
time_t cur_time;
+1 -1
View File
@@ -31,7 +31,7 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
m_transformPill.SetFromReference( THEME->GetMetricR(sMetricsGroup,"PillTransformFunction") );
float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX");
int iNumPills = THEME->GetMetricF(sMetricsGroup,"NumPills");
int iNumPills = static_cast<int>(THEME->GetMetricF(sMetricsGroup,"NumPills"));
m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar");
FOREACH_ENUM( StreamType, st )
+6 -6
View File
@@ -669,21 +669,21 @@ namespace
continue;
}
RString sName;
LuaHelpers::Pop( L, sName );
NodeNamesToAdd.push_back( sName );
RString nName;
LuaHelpers::Pop( L, nName );
NodeNamesToAdd.push_back( nName );
NodesToAdd.push_back( LuaReference() );
NodesToAdd.back().SetFromStack( L );
continue;
}
RString sName;
LuaHelpers::Pop( L, sName );
RString nName;
LuaHelpers::Pop( L, nName );
// Otherwise, add an attribute.
XNodeLuaValue *pValue = new XNodeLuaValue;
pValue->SetValueFromStack( L );
pNode->AppendAttrFrom( sName, pValue );
pNode->AppendAttrFrom( nName, pValue );
}
lua_pop( L, 1 );
@@ -425,10 +425,10 @@ wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool b
if( KeyLayout )
{
UInt32 keyboardType = LMGetKbdType();
UInt32 modifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0;
UInt32 nModifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0;
UniChar unicodeInputString[4];
UniCharCount length;
OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, modifiers,
OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, nModifiers,
keyboardType, 0, &iDeadKeyState, ARRAYLEN(unicodeInputString),
&length, unicodeInputString );
@@ -193,10 +193,10 @@ RString MovieDecoder_Theora::ProcessHeaders()
while(1)
{
ogg_packet op;
int ret = ogg_stream_packetpeek( &m_OggStream, &op );
if( ret == 0 )
int ret2 = ogg_stream_packetpeek( &m_OggStream, &op );
if( ret2 == 0 )
break;
if( ret < 0 )
if( ret2 < 0 )
return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() );
if( !theora_packet_isheader(&op) )
@@ -208,8 +208,8 @@ RString MovieDecoder_Theora::ProcessHeaders()
return RString();
}
ret = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op);
if( ret < 0 && ret != OC_NEWPACKET )
ret2 = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op);
if( ret2 < 0 && ret2 != OC_NEWPACKET )
return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() );
ogg_stream_packetout( &m_OggStream, NULL );