From e14cb3ce6e63ae817230bc69e2303eadf568dbf0 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 19:25:55 -0400 Subject: [PATCH 01/37] new branch: sm124futures. So far: Have both description and author credit be filled in from a .sm file. --- src/NotesLoaderSM.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 9b3b3e9ff8..d2ec3c749d 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -37,6 +37,7 @@ void SMLoader::LoadFromSMTokens( // insert stepstype hacks from GameManager.cpp here? -aj out.m_StepsType = GAMEMAN->StringToStepsType( sStepsType ); out.SetDescription( sDescription ); + out.SetCredit( sDescription ); // this is often used for both. out.SetDifficulty( DwiCompatibleStringToDifficulty(sDifficulty) ); // Handle hacks that originated back when StepMania didn't have From c4351290782cb4cdb94656990a81584165247cd4 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 19:35:57 -0400 Subject: [PATCH 02/37] sm124futures: Allow choosing which field to use. Either the #DESCRIPTION or #CREDIT tag can be used for SM files. By default, the old behavior is still used. --- Themes/_fallback/metrics.ini | 3 +++ src/NotesWriterSM.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 18418ebc07..9072a6269f 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -647,6 +647,9 @@ LyricBackChangedCommand=LyricCommand,"Back" InLength=0 OutLength=0 +[NotesWriterSM] +DescriptionUsesCreditField=false + [OptionRow] ShowModIcons=false ShowUnderlines=true diff --git a/src/NotesWriterSM.cpp b/src/NotesWriterSM.cpp index df1ac5e87d..af3855a78c 100644 --- a/src/NotesWriterSM.cpp +++ b/src/NotesWriterSM.cpp @@ -15,6 +15,9 @@ #include "RageUtil.h" #include "Song.h" #include "Steps.h" +#include "ThemeMetric.h" + +ThemeMetric USE_CREDIT ( "NotesWriterSM", "DescriptionUsesCreditField" ); /** * @brief Turn the BackgroundChange into a string. @@ -268,7 +271,8 @@ static RString GetSMNotesTag( const Song &song, const Steps &in ) GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName, SmEscape(in.GetDescription()).c_str()) ); lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" ); lines.push_back( ssprintf( " %s:", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) ); - lines.push_back( ssprintf( " %s:", SmEscape(in.GetDescription()).c_str() ) ); + RString desc = (USE_CREDIT ? in.GetCredit() : in.GetDescription()); + lines.push_back( ssprintf( " %s:", SmEscape(desc).c_str() ) ); lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); From c661650956ade60847c38db587bc84b494079c6e Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 19:37:41 -0400 Subject: [PATCH 03/37] sm124futures: changelog. --- Docs/Changelog_sm-ssc.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 7be1d02092..29fa2edf1f 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -9,6 +9,15 @@ Not all changes are documented, for various reasons. supported but exist anyways.) _____________________________________________________________________________ +================================================================================ +sm-ssc v1.2.4 | 20110??? +-------------------------------------------------------------------------------- + +20110313 +-------- +* [NotesWriterSM] Allow for either the #DESCRIPTION or #CREDIT tags to be used + for the .sm format's description token. [Wolfman2000] + ================================================================================ sm-ssc v1.2.3 | 201103?? -------------------------------------------------------------------------------- From cec55f1aeda2f6dc9cfbc897e7c203f47bad4dc1 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 19:47:39 -0400 Subject: [PATCH 04/37] sm124futures: doxygen for the next version. --- src/Player.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Player.cpp b/src/Player.cpp index cc2d2fafa2..ffd130e238 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -175,8 +175,15 @@ ThemeMetric REQUIRE_STEP_ON_MINES ( "Player", "RequireStepOnMines" ); * For those wishing to make a theme very accurate to In The Groove 2, set this to false. */ ThemeMetric ROLL_BODY_INCREMENTS_COMBO ( "Player", "RollBodyIncrementsCombo" ); ThemeMetric CHECKPOINTS_TAPS_SEPARATE_JUDGMENT ( "Player", "CheckpointsTapsSeparateJudgment" ); -ThemeMetric SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" ); // sm-ssc addition +/** + * @brief Do we score missed holds and rolls with HoldNoteScores? + * + * If set to true, missed holds and rolls are given LetGo judgments. + * If set to false, missed holds and rolls are given no judgment on the hold side of things. */ +ThemeMetric SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" ); +/** @brief How much of the song/course must have gone by before a Player's combo is colored? */ ThemeMetric PERCENT_UNTIL_COLOR_COMBO ( "Player", "PercentUntilColorCombo" ); +/** @brief How much combo must be earned before the announcer says "Combo Stopped"? */ ThemeMetric COMBO_STOPPED_AT ( "Player", "ComboStoppedAt" ); ThemeMetric ATTACK_RUN_TIME_RANDOM ( "Player", "AttackRunTimeRandom" ); ThemeMetric ATTACK_RUN_TIME_MINE ( "Player", "AttackRunTimeMine" ); From e988bba855c016d5735bff76cbf79e3abcb93fca Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 20:03:54 -0400 Subject: [PATCH 05/37] sm124futures: Enhanced editor stuff in progress. Cycle between the different types of Tap Notes. Hold/Roll heads do not count on this. Obviously still being worked on, but the code compiles at this point. --- Themes/_fallback/Languages/en.ini | 1 + src/ScreenEdit.cpp | 4 ++++ src/ScreenEdit.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 984de88fc7..64d49a73a8 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1925,6 +1925,7 @@ Insert beat and shift down=Insert beat and shift down Shift BPM changes and stops down one beat=Shift BPM changes and stops down one beat Delete beat and shift up=Delete beat and shift up Shift BPM changes and stops up one beat=Shift BPM changes and stops up one beat +Cycle between tap notes=Cycle between tap notes Lay mine=Lay mine Lay lift=Lay lift Add to/remove from right half=Add to/remove from right half diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 5fba445970..7e50cc8faf 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -269,6 +269,9 @@ void ScreenEdit::InitEditMappings() // m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_TAP_ATTACK][0] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); + + m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_LEFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cn); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_RIGHT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cm); m_EditMappingsDeviceInput.button [EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_UP); m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); @@ -4035,6 +4038,7 @@ static const EditHelpLine g_EditHelpLines[] = EditHelpLine( "Shift BPM changes and stops down one beat", EDIT_BUTTON_INSERT_SHIFT_PAUSES ), EditHelpLine( "Delete beat and shift up", EDIT_BUTTON_DELETE ), EditHelpLine( "Shift BPM changes and stops up one beat", EDIT_BUTTON_DELETE_SHIFT_PAUSES ), + EditHelpLine( "Cycle between tap notes", EDIT_BUTTON_CYCLE_TAP_LEFT, EDIT_BUTTON_CYCLE_TAP_RIGHT ), EditHelpLine( "Lay mine", EDIT_BUTTON_LAY_MINE_OR_ROLL ), EditHelpLine( "Lay lift", EDIT_BUTTON_LAY_LIFT ), EditHelpLine( "Add to/remove from right half", EDIT_BUTTON_RIGHT_SIDE ), diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index f32e6940ac..d68d2dafd4 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -54,6 +54,10 @@ enum EditButton EDIT_BUTTON_LAY_TAP_ATTACK, EDIT_BUTTON_LAY_LIFT, EDIT_BUTTON_REMOVE_NOTE, + + // These are modifiers to change the present tap note. + EDIT_BUTTON_CYCLE_TAP_LEFT, + EDIT_BUTTON_CYCLE_TAP_RIGHT, EDIT_BUTTON_SCROLL_UP_LINE, EDIT_BUTTON_SCROLL_UP_PAGE, From ca1bd8345d62f0e4af2db0756af02ccca354b852 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 20:52:03 -0400 Subject: [PATCH 06/37] sm124futures: Add TapNoteType to string function. This will be needed for the Editor. --- src/NoteTypes.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NoteTypes.h b/src/NoteTypes.h index 9bee6d5b54..7fd893a230 100644 --- a/src/NoteTypes.h +++ b/src/NoteTypes.h @@ -204,6 +204,10 @@ extern TapNote TAP_ORIGINAL_FAKE; // 'F' extern TapNote TAP_ADDITION_TAP; extern TapNote TAP_ADDITION_MINE; +const RString& TapNoteTypeToString( TapNote::Type tn ); +const RString& TapNoteTypeToLocalizedString( TapNote::Type tn ); +LuaDeclareType( TapNote::Type ); + /** * @brief The number of tracks allowed. * From 8d42e1827cf24ee68ce45fe8da74094ee02af92e Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 20:58:08 -0400 Subject: [PATCH 07/37] sm124futures: prepare the .ini files. --- Themes/_fallback/Languages/en.ini | 1 + Themes/_fallback/metrics.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 64d49a73a8..c25622c8a6 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1244,6 +1244,7 @@ Description=Description Chart Style=Chart Style Main title=Main title Subtitle=Subtitle +Tap Note=Tap Note Tap Steps=Tap Steps Jumps=Jumps Hands=Hands diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 9072a6269f..3fc779c3b6 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -3652,6 +3652,7 @@ DescriptionFormat="%s:\n %s\n" ChartStyleFormat="%s:\n %s\n" MainTitleFormat="%s:\n %s\n" SubtitleFormat="%s:\n %s\n" +TapNoteTypeFormat="%s: %s\n" NumStepsFormat="%s: %d\n" NumJumpsFormat="%s: %d\n" NumHoldsFormat="%s: %d\n" From f951a8706801fecedc32296fe3eeece7d2b67c72 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 22:24:43 -0400 Subject: [PATCH 08/37] sm124futures: Working tap note cycling. The code in NoteTypes could use a review: perhaps the Type definition should be taken out of the struct to try to make it more consistent? --- src/NoteTypes.h | 25 +++++++++++++++++++--- src/ScreenEdit.cpp | 53 ++++++++++++++++++++++++++++------------------ src/ScreenEdit.h | 4 ++++ 3 files changed, 58 insertions(+), 24 deletions(-) diff --git a/src/NoteTypes.h b/src/NoteTypes.h index 7fd893a230..4c23f1576f 100644 --- a/src/NoteTypes.h +++ b/src/NoteTypes.h @@ -204,9 +204,28 @@ extern TapNote TAP_ORIGINAL_FAKE; // 'F' extern TapNote TAP_ADDITION_TAP; extern TapNote TAP_ADDITION_MINE; -const RString& TapNoteTypeToString( TapNote::Type tn ); -const RString& TapNoteTypeToLocalizedString( TapNote::Type tn ); -LuaDeclareType( TapNote::Type ); +/** + * @brief Retrieve the string representing the TapNote Type. + * + * TODO: Find a way to standardize this with the other enum string calls. + * @param tn the TapNote's type. + * @return the intended string. */ +inline const RString TapNoteTypeToString( TapNote::Type tn ) +{ + switch( tn ) + { + case TapNote::empty: return RString("empty"); + case TapNote::tap: return RString("tap"); + case TapNote::hold_head: return RString("hold_head"); + case TapNote::hold_tail: return RString("hold_tail"); + case TapNote::mine: return RString("mine"); + case TapNote::lift: return RString("lift"); + case TapNote::attack: return RString("attack"); + case TapNote::autoKeysound: return RString("autoKeysound"); + case TapNote::fake: return RString("fake"); + default: return RString(); + } +} /** * @brief The number of tracks allowed. diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 7e50cc8faf..7a9d0cf0c1 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -16,6 +16,7 @@ #include "LocalizedString.h" #include "NoteDataUtil.h" #include "NoteSkinManager.h" +#include "NoteTypes.h" #include "NotesWriterSM.h" #include "PrefsManager.h" #include "RageSoundManager.h" @@ -733,6 +734,8 @@ void ScreenEdit::Init() m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; m_bReturnToRecordMenuAfterPlay = false; m_fBeatToReturnTo = 0; + + m_selectedTap = TAP_ORIGINAL_TAP; GAMESTATE->m_bGameplayLeadIn.Set( true ); GAMESTATE->m_EditMode = EDIT_MODE.GetValue(); @@ -1027,6 +1030,7 @@ static LocalizedString DESCRIPTION("ScreenEdit", "Description"); static LocalizedString CHART_STYLE("ScreenEdit", "Chart Style"); static LocalizedString MAIN_TITLE("ScreenEdit", "Main title"); static LocalizedString SUBTITLE("ScreenEdit", "Subtitle"); +static LocalizedString TAP_NOTE_TYPE("ScreenEdit", "Tap Note"); static LocalizedString TAP_STEPS("ScreenEdit", "Tap Steps"); static LocalizedString JUMPS("ScreenEdit", "Jumps"); static LocalizedString HANDS("ScreenEdit", "Hands"); @@ -1051,6 +1055,7 @@ static ThemeMetric DESCRIPTION_FORMAT("ScreenEdit", "DescriptionFormat" static ThemeMetric CHART_STYLE_FORMAT("ScreenEdit", "ChartStyleFormat"); static ThemeMetric MAIN_TITLE_FORMAT("ScreenEdit", "MainTitleFormat"); static ThemeMetric SUBTITLE_FORMAT("ScreenEdit", "SubtitleFormat"); +static ThemeMetric TAP_NOTE_TYPE_FORMAT("ScreenEdit", "TapNoteTypeFormat"); static ThemeMetric NUM_STEPS_FORMAT("ScreenEdit", "NumStepsFormat"); static ThemeMetric NUM_JUMPS_FORMAT("ScreenEdit", "NumJumpsFormat"); static ThemeMetric NUM_HOLDS_FORMAT("ScreenEdit", "NumHoldsFormat"); @@ -1119,6 +1124,7 @@ void ScreenEdit::UpdateTextInfo() sText += ssprintf( MAIN_TITLE_FORMAT.GetValue(), MAIN_TITLE.GetValue().c_str(), m_pSong->m_sMainTitle.c_str() ); if( m_pSong->m_sSubTitle.size() ) sText += ssprintf( SUBTITLE_FORMAT.GetValue(), SUBTITLE.GetValue().c_str(), m_pSong->m_sSubTitle.c_str() ); + sText += ssprintf( TAP_NOTE_TYPE_FORMAT.GetValue(), TAP_NOTE_TYPE.GetValue().c_str(), TapNoteTypeToString( m_selectedTap.type ).c_str() ); break; } sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() ); @@ -1299,43 +1305,48 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) m_NoteDataEdit.SetTapNote( iCol, iSongIndex, TAP_EMPTY ); // Don't CheckNumberOfNotesAndUndo. We don't want to revert any change that removes notes. } - else if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ) - { - m_soundAddNote.Play(); - SetDirty( true ); - SaveUndo(); - TapNote tn = TAP_ORIGINAL_MINE; - tn.pn = m_InputPlayerNumber; - m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn ); - CheckNumberOfNotesAndUndo(); - } else if( EditIsBeingPressed(EDIT_BUTTON_LAY_TAP_ATTACK) ) { g_iLastInsertTapAttackTrack = iCol; EditMiniMenu( &g_InsertTapAttack, SM_BackFromInsertTapAttack ); } - else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) ) - { - m_soundAddNote.Play(); - SetDirty( true ); - SaveUndo(); - TapNote tn = TAP_ORIGINAL_LIFT; - tn.pn = m_InputPlayerNumber; - m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn ); - CheckNumberOfNotesAndUndo(); - } else { m_soundAddNote.Play(); SetDirty( true ); SaveUndo(); - TapNote tn = TAP_ORIGINAL_TAP; + TapNote tn = m_selectedTap; tn.pn = m_InputPlayerNumber; m_NoteDataEdit.SetTapNote(iCol, iSongIndex, tn ); CheckNumberOfNotesAndUndo(); } } break; + + case EDIT_BUTTON_CYCLE_TAP_LEFT: + { + switch ( m_selectedTap.type ) + { + case TapNote::tap: m_selectedTap = TAP_ORIGINAL_FAKE; break; + case TapNote::mine: m_selectedTap = TAP_ORIGINAL_TAP; break; + case TapNote::lift: m_selectedTap = TAP_ORIGINAL_MINE; break; + case TapNote::fake: m_selectedTap = TAP_ORIGINAL_LIFT; break; + DEFAULT_FAIL( m_selectedTap.type ); + } + break; + } + case EDIT_BUTTON_CYCLE_TAP_RIGHT: + { + switch ( m_selectedTap.type ) + { + case TapNote::tap: m_selectedTap = TAP_ORIGINAL_MINE; break; + case TapNote::mine: m_selectedTap = TAP_ORIGINAL_LIFT; break; + case TapNote::lift: m_selectedTap = TAP_ORIGINAL_FAKE; break; + case TapNote::fake: m_selectedTap = TAP_ORIGINAL_TAP; break; + DEFAULT_FAIL( m_selectedTap.type ); + } + break; + } case EDIT_BUTTON_SCROLL_SPEED_UP: case EDIT_BUTTON_SCROLL_SPEED_DOWN: { diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index d68d2dafd4..fae15b9f5b 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -9,6 +9,7 @@ #include "Background.h" #include "Foreground.h" #include "NoteField.h" +#include "NoteTypes.h" #include "Song.h" #include "Steps.h" #include "ThemeMetric.h" @@ -236,6 +237,9 @@ protected: SnapDisplay m_SnapDisplay; BitmapText m_textInputTips; + + /** @brief The current TapNote that would be inserted. */ + TapNote m_selectedTap; void UpdateTextInfo(); BitmapText m_textInfo; // status information that changes From 247782b7260ab2a6a25369e7aa0a863f5f55af14 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 22:45:19 -0400 Subject: [PATCH 09/37] sm124futures: simplify attempt. Caveat: recording mode is back to basics: taps and holds. If demand is high, this can be restored. --- src/ScreenEdit.cpp | 20 +++++--------------- src/ScreenEdit.h | 3 +-- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 7a9d0cf0c1..2920784b4b 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -266,10 +266,8 @@ void ScreenEdit::InitEditMappings() m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); - m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); // m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_TAP_ATTACK][0] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); - m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); - m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_LEFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cn); m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_RIGHT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cm); @@ -331,10 +329,8 @@ void ScreenEdit::InitEditMappings() m_PlayMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); m_PlayMappingsMenuButton.button[EDIT_BUTTON_RETURN_TO_EDIT][1] = GAME_BUTTON_BACK; - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); + m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); + m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); @@ -960,7 +956,7 @@ void ScreenEdit::Update( float fDeltaTime ) else if( fSecsHeld > RECORD_HOLD_SECONDS ) { // create or extend a hold or roll note - TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD; + TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD; tn.pn = m_InputPlayerNumber; m_NoteDataRecord.AddHoldNote( t, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat), tn ); @@ -2120,10 +2116,6 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB ) m_NoteDataRecord.SetTapNote( iCol, iHeadRow, TAP_EMPTY ); TapNote tn = TAP_ORIGINAL_TAP; - if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ) - tn = TAP_ORIGINAL_MINE; - else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) ) - tn = TAP_ORIGINAL_LIFT; tn.pn = m_InputPlayerNumber; m_NoteDataRecord.SetTapNote( iCol, iRow, tn ); m_NoteFieldRecord.Step( iCol, TNS_W1 ); @@ -2516,7 +2508,7 @@ void ScreenEdit::ScrollTo( float fDestinationBeat ) // Don't SaveUndo. We want to undo the whole hold, not just the last segment // that the user made. Dragging the hold bigger can only absorb and remove // other taps, so dragging won't cause us to exceed the note limit. - TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ? TAP_ORIGINAL_ROLL_HEAD : TAP_ORIGINAL_HOLD_HEAD; + TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD : TAP_ORIGINAL_HOLD_HEAD; tn.pn = m_InputPlayerNumber; m_NoteDataEdit.AddHoldNote( iCol, iStartRow, iEndRow, tn ); @@ -4050,8 +4042,6 @@ static const EditHelpLine g_EditHelpLines[] = EditHelpLine( "Delete beat and shift up", EDIT_BUTTON_DELETE ), EditHelpLine( "Shift BPM changes and stops up one beat", EDIT_BUTTON_DELETE_SHIFT_PAUSES ), EditHelpLine( "Cycle between tap notes", EDIT_BUTTON_CYCLE_TAP_LEFT, EDIT_BUTTON_CYCLE_TAP_RIGHT ), - EditHelpLine( "Lay mine", EDIT_BUTTON_LAY_MINE_OR_ROLL ), - EditHelpLine( "Lay lift", EDIT_BUTTON_LAY_LIFT ), EditHelpLine( "Add to/remove from right half", EDIT_BUTTON_RIGHT_SIDE ), EditHelpLine( "Switch player (Routine only)", EDIT_BUTTON_SWITCH_PLAYERS ), }; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index fae15b9f5b..fe77602a96 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -51,9 +51,8 @@ enum EditButton // These are modifiers to EDIT_BUTTON_COLUMN_*. EDIT_BUTTON_RIGHT_SIDE, - EDIT_BUTTON_LAY_MINE_OR_ROLL, + EDIT_BUTTON_LAY_ROLL, EDIT_BUTTON_LAY_TAP_ATTACK, - EDIT_BUTTON_LAY_LIFT, EDIT_BUTTON_REMOVE_NOTE, // These are modifiers to change the present tap note. From 17299dd3be7e8d0736882bc5dfd7832ecd494d98 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 22:56:30 -0400 Subject: [PATCH 10/37] sm124futures: add directions to make rolls. We may want to see about breaking this one up. --- Themes/_fallback/Languages/en.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index c25622c8a6..7314f129ad 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1223,7 +1223,7 @@ Enter a new sub title transliteration.=Enter a new sub title transliteration. Enter a new sub title.=Enter a new sub title. More than %d notes per measure is not allowed. This change has been reverted.=More than %d notes per measure is not allowed. This change has been reverted. No backgrounds available=No backgrounds available -EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nSpace bar:\n Set area\n marker\nEnter:\n Area Menu\nEscape:\n Main Menu\nF1:\n Show help\n +EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nCreate roll note:\n Hold Shift,\n then create a\n hold note.\nSpace bar:\n Set area\n marker\nEnter:\n Area Menu\nEscape:\n Main Menu\nF1:\n Show help\n PlayRecordHelpText=Press START to end Save successful.=Save successful. Saved as SM and DWI.=Saved as SM and DWI. From 297c1943bf048f20583177038c768267d901d35c Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 13 Mar 2011 22:57:38 -0400 Subject: [PATCH 11/37] sm124futures: changelog. --- Docs/Changelog_sm-ssc.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 29fa2edf1f..9f5cfa6b44 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -17,6 +17,8 @@ sm-ssc v1.2.4 | 20110??? -------- * [NotesWriterSM] Allow for either the #DESCRIPTION or #CREDIT tags to be used for the .sm format's description token. [Wolfman2000] +* [ScreenEdit] Add Tap Note Cycling to allow inputting all of the taps. The way + to make holds and rolls are still the same as before. [Wolfman2000] ================================================================================ sm-ssc v1.2.3 | 201103?? From 72d21bec63ded5b88d04b2b1093695cdbe7fe593 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sun, 13 Mar 2011 22:48:10 -0500 Subject: [PATCH 12/37] we are now sm-ssc 1.2.3 --- src/ProductInfo.h | 2 +- src/ProductInfo.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ProductInfo.h b/src/ProductInfo.h index 2083e30323..8470d29ae5 100644 --- a/src/ProductInfo.h +++ b/src/ProductInfo.h @@ -35,7 +35,7 @@ * */ #ifndef PRODUCT_VER_BARE -#define PRODUCT_VER_BARE v1.2.2 +#define PRODUCT_VER_BARE v1.2.3 #endif /** diff --git a/src/ProductInfo.inc b/src/ProductInfo.inc index e77a3c743b..e47653133d 100644 --- a/src/ProductInfo.inc +++ b/src/ProductInfo.inc @@ -5,7 +5,7 @@ ; see ProductInfo.h for use descriptions !define PRODUCT_ID "sm-ssc" -!define PRODUCT_VER "v1.2.2" +!define PRODUCT_VER "v1.2.3" !define PRODUCT_DISPLAY "${PRODUCT_ID} ${PRODUCT_VER}" !define PRODUCT_BITMAP "ssc" From 66c8b0625714f7675b255b45eea042c692c8dfc4 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Mon, 14 Mar 2011 00:36:08 -0500 Subject: [PATCH 13/37] forgot to update the changelog after reverting. --- Docs/Changelog_sm-ssc.txt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 1026dd5286..88fbc31966 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -25,20 +25,6 @@ sm-ssc v1.2.3 | 20110323 * [MeterDisplay] Add Lua binding. "Allow setting and changing the width dynamically. Phase out the "StreamWidth" node property; set it with SetStreamWidth instead." [Glenn Maynard] -* sm5svn r28280: "Previously, we didn't create MusicWheel sorts when the screen - loads; it was delayed until the screen begins. This allowed preloading before - the style is set. However, it caused a major skip when the screen starts, - because creating the sorts is fairly expensive. - - Refactor this. Load the sorts when the screen is loaded, and then go through - them and quickly filter out unplayable data and handle other initialization - on begin. This is much faster, so we can more easily transition seamlessly - from the previous menu. - - One known limitation: the sorts are created before we know the style, so we - have to guess. This means if you're in a style like dance-solo or - pump-halfdouble, sorts will still be based on regular mode. This affects the - difficulty, top grade and roulette sorts." [Glenn Maynard] 20110305 -------- From d855d8c7e8de927880aacbd8747ede375cf98c80 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 02:36:48 -0400 Subject: [PATCH 14/37] Bring light into the shadow...variables. Yeah, yeah, can't make a good joke at 2:30 AM. --- src/Course.cpp | 4 +-- src/ModIconRow.cpp | 6 ++-- src/NoteData.cpp | 4 +-- src/NotesLoaderBMS.cpp | 24 ++++++++-------- src/NotesLoaderMidi.cpp | 10 +++---- src/NotesLoaderPMS.cpp | 28 +++++++++---------- src/NotesLoaderSM.cpp | 4 +-- src/OptionRow.cpp | 2 +- src/OptionsList.cpp | 24 ++++++++-------- src/Player.cpp | 10 +++---- src/RageMath.cpp | 4 +-- src/ScreenOptionsEditCourse.cpp | 6 ++-- src/ScreenOptionsManageCourses.cpp | 2 +- src/ScreenOptionsManageEditSteps.cpp | 2 +- src/ScreenOptionsMemoryCard.cpp | 5 ++-- src/XmlFileUtil.cpp | 12 ++++---- .../InputHandler/InputHandler_MacOSX_HID.cpp | 4 +-- src/arch/MovieTexture/MovieTexture_Theora.cpp | 10 +++---- 18 files changed, 81 insertions(+), 80 deletions(-) diff --git a/src/Course.cpp b/src/Course.cpp index 3dbd02ed67..5c515e7c94 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -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 &vpSongs = mapSongToSteps[resolved.pSong]; - resolved.pSteps = vpSongs[ RandomInt(vpSongs.size()) ]; + const vector &mappedSongs = mapSongToSteps[resolved.pSong]; + resolved.pSteps = mappedSongs[ RandomInt(mappedSongs.size()) ]; } else { diff --git a/src/ModIconRow.cpp b/src/ModIconRow.cpp index 996b0da158..39286362a0 100644 --- a/src/ModIconRow.cpp +++ b/src/ModIconRow.cpp @@ -155,15 +155,15 @@ void ModIconRow::SetFromGameState() continue; // skip // search for a vacant spot - for( int i=iPerferredCol; isecond.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; } } diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index acd4dabf37..4832fa78da 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -476,9 +476,9 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo if( sNoteId != "00" ) { vTapNotes.push_back( TAP_ORIGINAL_TAP ); - map::const_iterator it = idToKeySoundIndex.find( sNoteId ); - if( it != idToKeySoundIndex.end() ) - vTapNotes.back().iKeysoundIndex = it->second; + map::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 ) diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index 96f5375e1e..fb8dfbe298 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -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 ); diff --git a/src/NotesLoaderPMS.cpp b/src/NotesLoaderPMS.cpp index 1b9f7a68d6..32555f71d0 100644 --- a/src/NotesLoaderPMS.cpp +++ b/src/NotesLoaderPMS.cpp @@ -408,9 +408,9 @@ static bool LoadFromPMSFile( const RString &sPath, const NameToData_t &mapNameTo if( sNoteId != "00" ) { vTapNotes.push_back( TAP_ORIGINAL_TAP ); - map::const_iterator it = idToKeySoundIndex.find( sNoteId ); - if( it != idToKeySoundIndex.end() ) - vTapNotes.back().iKeysoundIndex = it->second; + map::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 ); diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 9b3b3e9ff8..768222430f 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -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; im_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 ) { diff --git a/src/OptionsList.cpp b/src/OptionsList.cpp index 1a09c1378e..1a85dd7e53 100644 --- a/src/OptionsList.cpp +++ b/src/OptionsList.cpp @@ -146,9 +146,9 @@ void OptionListRow::SetUnderlines( const vector &aSelections, const Option else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE ) { const vector &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second; - for( unsigned i=0; iBroadcast( 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 ) diff --git a/src/Player.cpp b/src/Player.cpp index 47a70ce28d..b93d373e80 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -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; diff --git a/src/RageMath.cpp b/src/RageMath.cpp index cdeeced8d0..317e8fe50a 100644 --- a/src/RageMath.cpp +++ b/src/RageMath.cpp @@ -575,8 +575,8 @@ float RageFastSin( float x ) bInited = true; for( unsigned i=0; i::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 ); } } diff --git a/src/ScreenOptionsManageEditSteps.cpp b/src/ScreenOptionsManageEditSteps.cpp index 7fc0b1f7de..10043777ad 100644 --- a/src/ScreenOptionsManageEditSteps.cpp +++ b/src/ScreenOptionsManageEditSteps.cpp @@ -110,7 +110,7 @@ void ScreenOptionsManageEditSteps::BeginScreen() vector::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 ); } } diff --git a/src/ScreenOptionsMemoryCard.cpp b/src/ScreenOptionsMemoryCard.cpp index 02e1ed832b..a3f265febf 100644 --- a/src/ScreenOptionsMemoryCard.cpp +++ b/src/ScreenOptionsMemoryCard.cpp @@ -197,8 +197,9 @@ void ScreenOptionsMemoryCard::ProcessMenuStart( const InputEventPlus &input ) const vector &v = m_CurrentUsbStorageDevices; if( iCurRow < int(v.size()) ) // a card { - const vector &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 &vUSB = m_CurrentUsbStorageDevices; + const UsbStorageDevice &dev = vUSB[iCurRow]; MEMCARDMAN->m_sEditorMemoryCardOsMountPoint.Set( dev.sOsMountDir ); /* The destination screen must UnmountCard. XXX: brittle */ diff --git a/src/XmlFileUtil.cpp b/src/XmlFileUtil.cpp index 0fb328f9d5..df65416143 100644 --- a/src/XmlFileUtil.cpp +++ b/src/XmlFileUtil.cpp @@ -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 ); diff --git a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp index dd8b9dc9ab..e79a40ac9a 100644 --- a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp +++ b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp @@ -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 ); diff --git a/src/arch/MovieTexture/MovieTexture_Theora.cpp b/src/arch/MovieTexture/MovieTexture_Theora.cpp index fe4fe86638..b39abb6ede 100644 --- a/src/arch/MovieTexture/MovieTexture_Theora.cpp +++ b/src/arch/MovieTexture/MovieTexture_Theora.cpp @@ -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 ); From e9df4832f6ec9de7798c2ccec02ffd3d1906ddec Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 02:54:11 -0400 Subject: [PATCH 15/37] Bring shadowed variables back from the dark side. Alright Colby, happy now? --- src/Attack.cpp | 4 ++-- src/BGAnimation.cpp | 6 +++--- src/Background.cpp | 6 +++--- src/Foreground.cpp | 10 +++++----- src/InputMapper.cpp | 6 +++--- src/NoteDataUtil.cpp | 13 +++++-------- src/NoteField.cpp | 30 +++++++++++++++--------------- src/RageFileManager.cpp | 4 ++-- src/ScreenBookkeeping.cpp | 2 +- src/ScreenGameplay.cpp | 6 +++--- src/ScreenJukebox.cpp | 14 +++++++------- src/ScreenRanking.cpp | 3 ++- src/ScreenSelectMusic.cpp | 12 ++++++------ src/SongManager.cpp | 10 +++++----- 14 files changed, 62 insertions(+), 64 deletions(-) diff --git a/src/Attack.cpp b/src/Attack.cpp index 76eab656bc..f15fdb7cae 100644 --- a/src/Attack.cpp +++ b/src/Attack.cpp @@ -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; diff --git a/src/BGAnimation.cpp b/src/BGAnimation.cpp index dd93e73a8a..eb4fc80c4e 100644 --- a/src/BGAnimation.cpp +++ b/src/BGAnimation.cpp @@ -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 ); } } } diff --git a/src/Background.cpp b/src/Background.cpp index 0d3e398506..0c4005c1a7 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -746,9 +746,9 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus if( !change.m_sTransition.empty() ) { - map::const_iterator iter = mapNameToTransition.find( change.m_sTransition ); - ASSERT( iter != mapNameToTransition.end() ); - const BackgroundTransition &bt = iter->second; + map::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 ); } diff --git a/src/Foreground.cpp b/src/Foreground.cpp index 84caac9025..4e75cd0b79 100644 --- a/src/Foreground.cpp +++ b/src/Foreground.cpp @@ -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 ) { diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index 34c82c783e..d1a40a3d76 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -1093,12 +1093,12 @@ void InputMappings::ReadMappings( const InputScheme *pInputScheme, RString sFile vector sDeviceInputStrings; split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false ); - for( unsigned i=0; isecond; @@ -629,12 +629,9 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ) int iMaxTailRow = -1; for( int t=0; tm_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin; + RString sNoteSkinLC = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin; // XXX: Re-setup sNoteSkinLower. Unsure if inserting the skin again is needed. - if (sNoteSkinLower.empty()) + if (sNoteSkinLC.empty()) { - sNoteSkinLower = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetPreferred().m_sNoteSkin; + sNoteSkinLC = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetPreferred().m_sNoteSkin; - if (sNoteSkinLower.empty()) + if (sNoteSkinLC.empty()) { - sNoteSkinLower = "default"; + sNoteSkinLC = "default"; } - m_NoteDisplays.insert(pair (sNoteSkinLower, badIdea)); + m_NoteDisplays.insert(pair (sNoteSkinLC, badIdea)); } - sNoteSkinLower.MakeLower(); - it = m_NoteDisplays.find( sNoteSkinLower ); - ASSERT_M( it != m_NoteDisplays.end(), sNoteSkinLower ); + sNoteSkinLC.MakeLower(); + it = m_NoteDisplays.find( sNoteSkinLC ); + ASSERT_M( it != m_NoteDisplays.end(), sNoteSkinLC ); m_pDisplays[pn] = it->second; } } @@ -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 j = begin->first; + const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, j); // Switch modified by Wolfman2000, tested by Saturn2888 // Fixes hold head overlapping issue, but not the rolls. @@ -1031,10 +1031,10 @@ 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(j), 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(j) > -2000, ssprintf("%i %i %i, %f %f", j, 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 +1043,7 @@ void NoteField::DrawPrimitives() { for( int c2=0; c2GetNumTracks(); c2++ ) { - if( m_pNoteData->GetTapNote(c2, i).type == TapNote::hold_head) + if( m_pNoteData->GetTapNote(c2, j).type == TapNote::hold_head) { bHoldNoteBeginsOnThisBeat = true; break; @@ -1061,7 +1061,7 @@ void NoteField::DrawPrimitives() 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 ); - bool bNoteIsUpcoming = NoteRowToBeat(i) > GAMESTATE->m_fSongBeat; + bool bNoteIsUpcoming = NoteRowToBeat(j) > GAMESTATE->m_fSongBeat; bAnyUpcomingInThisCol |= bNoteIsUpcoming; } diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index f1fad415d4..fde2f79bdf 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -377,8 +377,8 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector &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 ); } } } diff --git a/src/ScreenBookkeeping.cpp b/src/ScreenBookkeeping.cpp index 0e379589dc..4e12142e63 100644 --- a/src/ScreenBookkeeping.cpp +++ b/src/ScreenBookkeeping.cpp @@ -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) + "..."; diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 6d37d74d3a..f1f10c32d3 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -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 ); diff --git a/src/ScreenJukebox.cpp b/src/ScreenJukebox.cpp index 7ad7555687..c1e59aaa4d 100644 --- a/src/ScreenJukebox.cpp +++ b/src/ScreenJukebox.cpp @@ -106,10 +106,10 @@ void ScreenJukebox::SetSong() SONGMAN->GetAllCourses( apCourses, false ); vector apOptions; vector 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] ); } } diff --git a/src/ScreenRanking.cpp b/src/ScreenRanking.cpp index f1c2d0dbea..595e29850f 100644 --- a/src/ScreenRanking.cpp +++ b/src/ScreenRanking.cpp @@ -244,7 +244,8 @@ float ScreenRanking::SetPage( const PageToShow &pts ) for( int l=0; lGetMachineProfile()->GetCategoryHighScoreList(st, pts.category); HighScore hs; bool bRecentHighScore = false; diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index b88038f109..c0ad565963 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -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(); diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 5f5376b8b7..91332d0232 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -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 From 81ccc7daba76a6e38cebf7a7d12d3ead9f9d3c44 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 03:32:07 -0400 Subject: [PATCH 16/37] Quickly variables! Into the magic mirror! --- src/AutoKeysounds.cpp | 4 ++-- src/BeginnerHelper.cpp | 2 ++ src/Course.cpp | 4 ++-- src/Font.cpp | 12 +++++----- src/GameCommand.cpp | 4 ++-- src/GameState.cpp | 4 ++-- src/NoteSkinManager.cpp | 14 +++++------ src/OptionRowHandler.cpp | 14 +++++------ src/OptionsList.cpp | 4 ++-- src/Profile.cpp | 14 +++++------ src/ProfileManager.cpp | 6 ++--- src/RageFileDriverDeflate.cpp | 6 ++--- src/RageSoundReader_Chain.cpp | 3 --- src/RageSoundReader_MP3.cpp | 2 +- src/RageSoundReader_Merge.cpp | 1 - src/RageSurfaceUtils.cpp | 4 ++-- src/RageSurfaceUtils_Palettize.cpp | 12 +++++----- src/ScreenDebugOverlay.cpp | 38 +++++++++++++++--------------- src/ScreenGameplay.cpp | 4 ---- src/ScreenNetSelectBase.cpp | 10 ++++---- src/ScreenTestInput.cpp | 1 - src/StatsManager.cpp | 4 ++-- 22 files changed, 80 insertions(+), 87 deletions(-) diff --git a/src/AutoKeysounds.cpp b/src/AutoKeysounds.cpp index 8a7fed000c..76d6955598 100644 --- a/src/AutoKeysounds.cpp +++ b/src/AutoKeysounds.cpp @@ -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); } diff --git a/src/BeginnerHelper.cpp b/src/BeginnerHelper.cpp index 2372cd1ca7..1154b0b96c 100644 --- a/src/BeginnerHelper.cpp +++ b/src/BeginnerHelper.cpp @@ -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 ); diff --git a/src/Course.cpp b/src/Course.cpp index 5c515e7c94..50c75ec04f 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -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; } diff --git a/src/Font.cpp b/src/Font.cpp index ca95e58605..d8c7d142eb 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -311,15 +311,15 @@ const glyph &Font::GetGlyph( wchar_t c ) const bool Font::FontCompleteForString( const wstring &str ) const { - map::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); - if( m_pDefault == m_iCharToGlyph.end() ) + map::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); } diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index 4083307c14..43783b8b41 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -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; } diff --git a/src/GameState.cpp b/src/GameState.cpp index 989e31c234..72fb165a55 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -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; diff --git a/src/NoteSkinManager.cpp b/src/NoteSkinManager.cpp index 4607d43529..0ec178b3ab 100644 --- a/src/NoteSkinManager.cpp +++ b/src/NoteSkinManager.cpp @@ -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 } diff --git a/src/OptionRowHandler.cpp b/src/OptionRowHandler.cpp index 2962f963c3..8010b10d3a 100644 --- a/src/OptionRowHandler.cpp +++ b/src/OptionRowHandler.cpp @@ -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 &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; } diff --git a/src/Profile.cpp b/src/Profile.cpp index b3d48827d6..4c12baf2f7 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -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] ); } } } diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 81f1f40ff9..2418821c60 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -489,10 +489,10 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID ) g_vLocalProfile.erase( i ); // Delete all references to this profileID - FOREACH_CONST( Preference*, m_sDefaultLocalProfileID.m_v, i ) + FOREACH_CONST( Preference*, m_sDefaultLocalProfileID.m_v, j ) { - if( (*i)->Get() == sProfileID ) - (*i)->Set( "" ); + if( (*j)->Get() == sProfileID ) + (*j)->Set( "" ); } return true; } diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index b0107a1997..8be422efac 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -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; diff --git a/src/RageSoundReader_Chain.cpp b/src/RageSoundReader_Chain.cpp index 29a73c0feb..6b3a1b9ae2 100644 --- a/src/RageSoundReader_Chain.cpp +++ b/src/RageSoundReader_Chain.cpp @@ -33,7 +33,6 @@ RageSoundReader_Chain::~RageSoundReader_Chain() while( !m_apActiveSounds.empty() ) ReleaseSound( m_apActiveSounds.front() ); - map::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::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::iterator it; FOREACH( RageSoundReader *, m_apLoadedSounds, it ) m_iChannels = max( m_iChannels, (*it)->GetNumChannels() ); diff --git a/src/RageSoundReader_MP3.cpp b/src/RageSoundReader_MP3.cpp index 7fc389bc89..7af0a70c9b 100644 --- a/src/RageSoundReader_MP3.cpp +++ b/src/RageSoundReader_MP3.cpp @@ -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; diff --git a/src/RageSoundReader_Merge.cpp b/src/RageSoundReader_Merge.cpp index 78c3e2b93f..f6c25e6a17 100644 --- a/src/RageSoundReader_Merge.cpp +++ b/src/RageSoundReader_Merge.cpp @@ -18,7 +18,6 @@ RageSoundReader_Merge::RageSoundReader_Merge() RageSoundReader_Merge::~RageSoundReader_Merge() { - map::iterator it; FOREACH( RageSoundReader *, m_aSounds, it ) delete *it; } diff --git a/src/RageSurfaceUtils.cpp b/src/RageSurfaceUtils.cpp index d9258633d0..e759d45449 100644 --- a/src/RageSurfaceUtils.cpp +++ b/src/RageSurfaceUtils.cpp @@ -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. diff --git a/src/RageSurfaceUtils_Palettize.cpp b/src/RageSurfaceUtils_Palettize.cpp index 6a0a0aabc2..9103ea6591 100644 --- a/src/RageSurfaceUtils_Palettize.cpp +++ b/src/RageSurfaceUtils_Palettize.cpp @@ -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 diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index f4610870d6..ffe3e4e664 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -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); diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index f1f10c32d3..9bed46df4f 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -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 ) diff --git a/src/ScreenNetSelectBase.cpp b/src/ScreenNetSelectBase.cpp index 8dfd75f7c3..40f9c5c9ac 100644 --- a/src/ScreenNetSelectBase.cpp +++ b/src/ScreenNetSelectBase.cpp @@ -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; } diff --git a/src/ScreenTestInput.cpp b/src/ScreenTestInput.cpp index 8ce0e2028d..255aa291d9 100644 --- a/src/ScreenTestInput.cpp +++ b/src/ScreenTestInput.cpp @@ -38,7 +38,6 @@ class InputList: public BitmapText // Update input texts vector asInputs; - DeviceInput di; vector DeviceInputs; INPUTFILTER->GetPressedButtons( DeviceInputs ); FOREACH( DeviceInput, DeviceInputs, di ) diff --git a/src/StatsManager.cpp b/src/StatsManager.cpp index f3cc714ba0..a50ef882bb 100644 --- a/src/StatsManager.cpp +++ b/src/StatsManager.cpp @@ -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. From 3fc85f6a5864cb6975012aad06664bcf57a21f55 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 03:41:37 -0400 Subject: [PATCH 17/37] Put in all warning checks for now. Time to go back in time. --- Xcode/stepmania.xcodeproj/project.pbxproj | 28 ++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index a218726db4..44897f0e1d 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -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; From d739e9a422073d05115b85e1c1d7e9f32555ffb7 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 04:11:04 -0400 Subject: [PATCH 18/37] The nonbelievers have been purged. --- src/NoteField.cpp | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/NoteField.cpp b/src/NoteField.cpp index f1e85ad126..2d193df715 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -209,23 +209,23 @@ void NoteField::Load( memset( m_pDisplays, 0, sizeof(m_pDisplays) ); FOREACH_EnabledPlayer( pn ) { - RString sNoteSkinLC = 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 (sNoteSkinLC.empty()) + if (sNoteSkinLower.empty()) { - sNoteSkinLC = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetPreferred().m_sNoteSkin; + sNoteSkinLower = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetPreferred().m_sNoteSkin; - if (sNoteSkinLC.empty()) + if (sNoteSkinLower.empty()) { - sNoteSkinLC = "default"; + sNoteSkinLower = "default"; } - m_NoteDisplays.insert(pair (sNoteSkinLC, badIdea)); + m_NoteDisplays.insert(pair (sNoteSkinLower, badIdea)); } - sNoteSkinLC.MakeLower(); - it = m_NoteDisplays.find( sNoteSkinLC ); - ASSERT_M( it != m_NoteDisplays.end(), sNoteSkinLC ); + sNoteSkinLower.MakeLower(); + it = m_NoteDisplays.find( sNoteSkinLower ); + ASSERT_M( it != m_NoteDisplays.end(), sNoteSkinLower ); m_pDisplays[pn] = it->second; } } @@ -1005,8 +1005,8 @@ void NoteField::DrawPrimitives() m_pNoteData->GetTapNoteRange( c, iFirstRowToDraw, iLastRowToDraw+1, begin, end ); for( ; begin != end; ++begin ) { - int j = begin->first; - const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, j); + 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(j), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) ) + if( !IsOnScreen( NoteRowToBeat(q), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) ) continue; // skip - ASSERT_M( NoteRowToBeat(j) > -2000, ssprintf("%i %i %i, %f %f", j, 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; c2GetNumTracks(); c2++ ) { - if( m_pNoteData->GetTapNote(c2, j).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 && idisplay[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(j) > GAMESTATE->m_fSongBeat; + bool bNoteIsUpcoming = NoteRowToBeat(q) > GAMESTATE->m_fSongBeat; bAnyUpcomingInThisCol |= bNoteIsUpcoming; } From 33af1ba2940bd7a36f6e700e6ca4aa1cb78ecb77 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 10:40:05 -0400 Subject: [PATCH 19/37] Fix some Effective C++ Violations. This part may be easier to work with from the command line at this rate... --- src/RageTypes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RageTypes.h b/src/RageTypes.h index d4afc81358..f367114b8b 100644 --- a/src/RageTypes.h +++ b/src/RageTypes.h @@ -100,7 +100,7 @@ struct lua_State; struct RageVector2 { public: - RageVector2() {} + RageVector2() : x(0), y(0) {} RageVector2( const float * f ) { x=f[0]; y=f[1]; } RageVector2( float x1, float y1 ) { x=x1; y=y1; } @@ -129,7 +129,7 @@ public: struct RageVector3 { public: - RageVector3() {} + 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; } @@ -158,7 +158,7 @@ public: struct RageVector4 { public: - RageVector4() {} + 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; } From e090631b4c9058f3c7d7f87b9e0f2da85cf85d64 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 10:50:39 -0400 Subject: [PATCH 20/37] Make the others behave the same way. Almost 10K warnings were removed from these two commits. Can we find the others? --- src/RageTypes.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/RageTypes.h b/src/RageTypes.h index f367114b8b..388a1d1580 100644 --- a/src/RageTypes.h +++ b/src/RageTypes.h @@ -100,9 +100,9 @@ struct lua_State; struct RageVector2 { public: - RageVector2() : x(0), y(0) {} - 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; }; @@ -130,8 +130,8 @@ struct RageVector3 { public: 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; } + 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; }; @@ -159,8 +159,8 @@ struct RageVector4 { public: 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; } + 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; }; From d03e6a89fb3f4b23d8defec60af1de767a8b7203 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 11:14:29 -0400 Subject: [PATCH 21/37] Got more of them, but not all. Time to move onto a new file I think. --- src/RageTypes.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/RageTypes.h b/src/RageTypes.h index 388a1d1580..9f86c6eb7a 100644 --- a/src/RageTypes.h +++ b/src/RageTypes.h @@ -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; }; @@ -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 From c5fda590808d8326f3bd0a94fb52d96f6cee78df Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 12:15:33 -0400 Subject: [PATCH 22/37] More warning reductions, even if not noticed. We're in the lower 40Ks now with Effective C++ Violations being checked. --- src/Attack.h | 20 +++++++++----------- src/ModelTypes.h | 9 +++------ src/RageSurface.h | 2 +- src/RageTextureID.h | 11 +++++++++-- src/RageTextureManager.h | 29 +++++++++++------------------ src/RageTypes.h | 4 ++-- src/RageUtil.cpp | 8 +++----- 7 files changed, 38 insertions(+), 45 deletions(-) diff --git a/src/Attack.h b/src/Attack.h index 8ce4b7942c..30f87589cf 100644 --- a/src/Attack.h +++ b/src/Attack.h @@ -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; diff --git a/src/ModelTypes.h b/src/ModelTypes.h index 9ede50dd02..d2943e565c 100644 --- a/src/ModelTypes.h +++ b/src/ModelTypes.h @@ -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; diff --git a/src/RageSurface.h b/src/RageSurface.h index e6eb8fa92b..73c873133c 100644 --- a/src/RageSurface.h +++ b/src/RageSurface.h @@ -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_) { } diff --git a/src/RageTextureID.h b/src/RageTextureID.h index 4d3b1c43ed..0825b7e626 100644 --- a/src/RageTextureID.h +++ b/src/RageTextureID.h @@ -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 ); }; diff --git a/src/RageTextureManager.h b/src/RageTextureManager.h index 06c0f525ec..33ab3e81bc 100644 --- a/src/RageTextureManager.h +++ b/src/RageTextureManager.h @@ -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 { diff --git a/src/RageTypes.h b/src/RageTypes.h index 9f86c6eb7a..5c328908b6 100644 --- a/src/RageTypes.h +++ b/src/RageTypes.h @@ -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); diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp index 2433a8335f..257a7925d0 100644 --- a/src/RageUtil.cpp +++ b/src/RageUtil.cpp @@ -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 ); } From 61d36671dadef2e7328b19ba4688ad8f644adfde Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 13:40:38 -0400 Subject: [PATCH 23/37] Effective C++ violations being weeded out. Not yet below 40K. --- src/RageDisplay.h | 46 +++++++++++++++++--------------- src/RageInputDevice.h | 25 ++++++++--------- src/RageLog.cpp | 9 ++----- src/RageSound.cpp | 27 +++++-------------- src/RageSound.h | 21 +++++++-------- src/RageTimer.h | 2 +- src/arch/Sound/RageSoundDriver.h | 3 ++- 7 files changed, 58 insertions(+), 75 deletions(-) diff --git a/src/RageDisplay.h b/src/RageDisplay.h index efb47d9687..6ff505ffd9 100644 --- a/src/RageDisplay.h +++ b/src/RageDisplay.h @@ -71,6 +71,7 @@ enum PixelFormat }; const RString& PixelFormatToString( PixelFormat i ); +/** @brief The parameters used for the present Video Mode. */ class VideoModeParams { public: @@ -91,24 +92,27 @@ public: RString sIconFile_, bool PAL_, float fDisplayAspectRatio_ - ) - { - windowed = windowed_; - width = width_; - height = height_; - bpp = bpp_; - rate = rate_; - vsync = vsync_; - interlaced = interlaced_; - bSmoothLines = bSmoothLines_; - bTrilinearFiltering = bTrilinearFiltering_; - bAnisotropicFiltering = bAnisotropicFiltering_; - sWindowTitle = sWindowTitle_; - sIconFile = sIconFile_; - PAL = PAL_; - fDisplayAspectRatio = fDisplayAspectRatio_; - } - VideoModeParams() {} + ): + windowed(windowed_), + width(width_), + height(height_), + bpp(bpp_), + rate(rate_), + vsync(vsync_), + interlaced(interlaced_), + bSmoothLines(bSmoothLines_), + bTrilinearFiltering(bTrilinearFiltering_), + bAnisotropicFiltering(bAnisotropicFiltering_), + sWindowTitle(sWindowTitle_), + sIconFile(sIconFile_), + PAL(PAL_), + fDisplayAspectRatio(fDisplayAspectRatio_) {} + + VideoModeParams(): windowed(false), width(0), height(0), + bpp(0), rate(0), vsync(false), interlaced(false), + bSmoothLines(false), bTrilinearFiltering(false), + bAnisotropicFiltering(false), sWindowTitle(RString()), + sIconFile(RString()), PAL(false), fDisplayAspectRatio(0.0) {} bool windowed; int width; @@ -116,14 +120,14 @@ public: int bpp; int rate; bool vsync; + bool interlaced; bool bSmoothLines; bool bTrilinearFiltering; bool bAnisotropicFiltering; - bool interlaced; - bool PAL; - float fDisplayAspectRatio; RString sWindowTitle; RString sIconFile; + bool PAL; + float fDisplayAspectRatio; }; struct RenderTargetParam diff --git a/src/RageInputDevice.h b/src/RageInputDevice.h index d27e76134b..84230edd81 100644 --- a/src/RageInputDevice.h +++ b/src/RageInputDevice.h @@ -60,12 +60,9 @@ inline bool IsMouse( InputDevice id ) { return id == DEVICE_MOUSE; } struct InputDeviceInfo { - InputDeviceInfo( InputDevice id_, RString sDesc_ ) - { - id = id_; - sDesc = sDesc_; - } - + InputDeviceInfo( InputDevice id_, RString sDesc_ ): + id(id_), sDesc(sDesc_) {} + InputDevice id; RString sDesc; @@ -317,22 +314,22 @@ public: * (0..1). This should be 0 for analog axes within the dead zone. */ float level; - /* Whether this button is pressed. This is level with a threshold and - * debouncing applied. */ - bool bDown; - // Mouse coordinates unsigned x; unsigned y; + /* Whether this button is pressed. This is level with a threshold and + * debouncing applied. */ + bool bDown; + RageTimer ts; - DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), bDown(false), ts(RageZeroTimer) { } - DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), bDown(l > 0.5f), ts(RageZeroTimer) { } + DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), x(0), y(0), bDown(false), ts(RageZeroTimer) { } + DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), x(0), y(0), bDown(l > 0.5f), ts(RageZeroTimer) { } DeviceInput( InputDevice d, DeviceButton b, float l, const RageTimer &t ): - device(d), button(b), level(l), bDown(level > 0.5f), ts(t) { } + device(d), button(b), level(l), x(0), y(0), bDown(level > 0.5f), ts(t) { } DeviceInput( InputDevice d, DeviceButton b, const RageTimer &t, unsigned xPos=0, unsigned yPos=0 ): - device(d), button(b), x(xPos), y(yPos), bDown(false), ts(t) { } + device(d), button(b), level(0), x(xPos), y(yPos), bDown(false), ts(t) { } bool operator==( const DeviceInput &other ) const { diff --git a/src/RageLog.cpp b/src/RageLog.cpp index 700f66c79a..4cedc14c11 100644 --- a/src/RageLog.cpp +++ b/src/RageLog.cpp @@ -78,19 +78,14 @@ enum WRITE_LOUD = 0x04 }; -RageLog::RageLog() +RageLog::RageLog(): m_bLogToDisk(false), m_bInfoToDisk(false), +m_bUserLogToDisk(false), m_bFlush(false), m_bShowLogOutput(false) { g_fileLog = new RageFile; g_fileInfo = new RageFile; g_fileUserLog = new RageFile; g_Mutex = new RageMutex( "Log" ); - - m_bLogToDisk = false; - m_bInfoToDisk = false; - m_bUserLogToDisk = false; - m_bFlush = false; - m_bShowLogOutput = false; } RageLog::~RageLog() diff --git a/src/RageSound.cpp b/src/RageSound.cpp index fa19d74b6c..71ec55518b 100644 --- a/src/RageSound.cpp +++ b/src/RageSound.cpp @@ -39,19 +39,10 @@ #define samplerate() m_pSource->GetSampleRate() RageSoundParams::RageSoundParams(): - m_StartTime( RageZeroTimer ) -{ - m_StartSecond = 0; - m_LengthSeconds = -1; - m_fFadeInSeconds = 0; - m_fFadeOutSeconds = 0; - m_Volume = 1.0f; - m_fAttractVolume = 1.0f; - m_fPitch = 1.0f; - m_fSpeed = 1.0f; - StopMode = M_AUTO; - m_bIsCriticalSound = false; -} + m_StartSecond(0), m_LengthSeconds(-1), m_fFadeInSeconds(0), + m_fFadeOutSeconds(0), m_Volume(1.0f), m_fAttractVolume(1.0f), + m_fPitch(1.0f), m_fSpeed(1.0f), m_StartTime( RageZeroTimer ), + StopMode(M_AUTO), m_bIsCriticalSound(false) {} RageSoundLoadParams::RageSoundLoadParams() { @@ -60,15 +51,11 @@ RageSoundLoadParams::RageSoundLoadParams() } RageSound::RageSound(): - m_Mutex( "RageSound" ) + m_Mutex( "RageSound" ), m_pSource(NULL), m_iStreamFrame(0), + m_iStoppedSourceFrame(0), m_bPlaying(false), + m_bDeleteWhenFinished(false) { ASSERT( SOUNDMAN ); - - m_pSource = NULL; - m_iStreamFrame = 0; - m_iStoppedSourceFrame = 0; - m_bPlaying = false; - m_bDeleteWhenFinished = false; } RageSound::~RageSound() diff --git a/src/RageSound.h b/src/RageSound.h index 71b6662a6f..69cbe49a12 100644 --- a/src/RageSound.h +++ b/src/RageSound.h @@ -22,7 +22,10 @@ public: virtual RString GetLoadedFilePath() const = 0; }; -/* These are parameters to play a sound. These are normally changed before playing begins, +/** + * @brief The parameters to play a sound. + * + * These are normally changed before playing begins, * and are constant from then on. */ struct RageSoundParams { @@ -50,17 +53,13 @@ struct RageSoundParams * If zero, or if not supported, the sound will start immediately. */ RageTimer m_StartTime; - /* M_STOP stops the sound at the end. - * M_LOOP restarts. - * M_CONTINUE feeds silence, which is useful to continue timing longer than the actual sound. - * M_AUTO (default) stops, obeying filename hints. - */ + /** @brief How does the sound stop itself, if it does? */ enum StopMode_t { - M_STOP, - M_LOOP, - M_CONTINUE, - M_AUTO - } StopMode; + M_STOP, /**< The sound is stopped at the end. */ + M_LOOP, /**< The sound restarts itself. */ + M_CONTINUE, /**< Silence is fed at the end to continue timing longer than the sound. */ + M_AUTO /**< The default, the sound stops while obeying filename hints. */ + } /** @brief How does the sound stop itself, if it does? */ StopMode; bool m_bIsCriticalSound; // "is a sound that should be played even during attract" }; diff --git a/src/RageTimer.h b/src/RageTimer.h index d0dd7935aa..d1d27201a2 100644 --- a/src/RageTimer.h +++ b/src/RageTimer.h @@ -6,7 +6,7 @@ class RageTimer { public: - RageTimer() { Touch(); } + RageTimer(): m_secs(0), m_us(0) { Touch(); } RageTimer( int secs, int us ): m_secs(secs), m_us(us) { } /* Time ago this RageTimer represents. */ diff --git a/src/arch/Sound/RageSoundDriver.h b/src/arch/Sound/RageSoundDriver.h index a95ca5e083..212cc2b138 100644 --- a/src/arch/Sound/RageSoundDriver.h +++ b/src/arch/Sound/RageSoundDriver.h @@ -150,7 +150,8 @@ private: float *m_BufferNext; // beginning of the unread data int m_FramesInBuffer; // total number of frames at m_BufferNext int64_t m_iPosition; // stream frame of m_BufferNext - sound_block() { m_FramesInBuffer = 0; m_iPosition = 0; m_BufferNext = m_Buffer; } + sound_block(): m_BufferNext(m_Buffer), + m_FramesInBuffer(0), m_iPosition(0) {} }; struct Sound From 87b61d9bdc5e434be42cbd516ad1599c0efcc086 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 13:42:44 -0400 Subject: [PATCH 24/37] Thanks Xcode: force the YES/NO on me now. --- Xcode/stepmania.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 44897f0e1d..97d4084dcc 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -7116,6 +7116,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -7651,6 +7652,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -7985,6 +7987,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -8113,6 +8116,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; From b7a5fd9e90f27f5779539b13330c859c07acda9d Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 14:26:29 -0400 Subject: [PATCH 25/37] More warning squishing. Make a note of LuaManager: either define the needed items or hide them away. --- Xcode/stepmania.xcodeproj/project.pbxproj | 8 ++++---- src/Course.h | 15 +++------------ src/LuaManager.h | 6 ++++++ src/RageUtil_CachedObject.h | 3 +-- src/StepsUtil.h | 9 +++------ src/UnlockManager.h | 16 ++++++++-------- 6 files changed, 25 insertions(+), 32 deletions(-) diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 97d4084dcc..877b9051bc 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -7116,7 +7116,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -7652,7 +7652,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -7987,7 +7987,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -8116,7 +8116,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; diff --git a/src/Course.h b/src/Course.h index b83b627334..772871ab30 100644 --- a/src/Course.h +++ b/src/Course.h @@ -55,18 +55,9 @@ public: float fGainSeconds; // time gained back at the beginning of the song. LifeMeterTime only. int iGainLives; // lives gained back at the beginning of the next song - CourseEntry() - { - bSecret = false; - bNoDifficult = false; - - songSort = SongSort_Randomize; - iChooseIndex = 0; - - sModifiers = ""; - fGainSeconds = 0; - iGainLives = -1; - } + CourseEntry(): bSecret(false), bNoDifficult(false), + songSort(SongSort_Randomize), iChooseIndex(0), + sModifiers(RString("")), fGainSeconds(0), iGainLives(-1) {} bool IsFixedSong() const { return songID.IsValid(); } diff --git a/src/LuaManager.h b/src/LuaManager.h index 08beb9aa0d..0a55d343ab 100644 --- a/src/LuaManager.h +++ b/src/LuaManager.h @@ -42,6 +42,9 @@ public: private: lua_State *m_pLuaMain; + // Swallow up warnings. If they must be used, define them. + LuaManager& operator=(const LuaManager& rhs); + LuaManager(const LuaManager& rhs); }; extern LuaManager *LUA; @@ -155,6 +158,9 @@ private: LuaReference *m_Name; LuaReference *m_pOldValue; + + // Swallow up warnings. If they must be used, define them. + LuaThreadVariable& operator=(const LuaThreadVariable& rhs); }; /** diff --git a/src/RageUtil_CachedObject.h b/src/RageUtil_CachedObject.h index a7b1e94180..421c8d3328 100644 --- a/src/RageUtil_CachedObject.h +++ b/src/RageUtil_CachedObject.h @@ -112,9 +112,8 @@ class CachedObjectPointer public: typedef CachedObject Object; - CachedObjectPointer() + CachedObjectPointer() : m_pCache(NULL), m_bCacheIsSet(false) { - m_bCacheIsSet = false; Object::Register( this ); } diff --git a/src/StepsUtil.h b/src/StepsUtil.h index 628f01c6ed..cae7cdb1c3 100644 --- a/src/StepsUtil.h +++ b/src/StepsUtil.h @@ -48,15 +48,12 @@ public: } /** @brief The Song's locked status. */ m_Locked; /** @brief Set up the initial criteria. */ - StepsCriteria() + StepsCriteria(): m_difficulty(Difficulty_Invalid), + m_iLowMeter(-1), m_iHighMeter(-1), + m_st(StepsType_Invalid), m_Locked(Locked_DontCare) { - m_difficulty = Difficulty_Invalid; - m_iLowMeter = -1; - m_iHighMeter = -1; //m_fLowBPM = -1; //m_fHighBPM = -1; - m_st = StepsType_Invalid; - m_Locked = Locked_DontCare; } /** diff --git a/src/UnlockManager.h b/src/UnlockManager.h index 9eaaad40cf..06b3ed7b3e 100644 --- a/src/UnlockManager.h +++ b/src/UnlockManager.h @@ -52,16 +52,16 @@ enum UnlockEntryStatus { class UnlockEntry { public: - UnlockEntry() + /** + * @brief Set up the UnlockEntry with default values. + * + * m_sEntryID starts as an empty string. It will be filled automatically + * if not specified. */ + UnlockEntry(): m_Type(UnlockRewardType_Invalid), + m_dc(Difficulty_Invalid), m_bRequirePassHardSteps(false), + m_bRoulette(false), m_sEntryID(RString("")) { - m_Type = UnlockRewardType_Invalid; - - m_dc = Difficulty_Invalid; - ZERO( m_fRequirement ); - m_bRequirePassHardSteps = false; - m_bRoulette = false; - m_sEntryID = ""; // "" means not yet filled. This will be filled in automatically if not specified. } UnlockRewardType m_Type; From 68fe6b3a321c219f6528a8938e1896f14354c52a Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 14:29:33 -0400 Subject: [PATCH 26/37] NO! Do NOT force Effective C++ Violations on other Mac users. --- Xcode/stepmania.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 877b9051bc..97d4084dcc 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -7116,7 +7116,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -7652,7 +7652,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -7987,7 +7987,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -8116,7 +8116,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; From 8a7877f9d1ef9936856f4a37306d146919c8ca36 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 15:30:04 -0400 Subject: [PATCH 27/37] More warning fixes. RageThreads.h is right now clear of Effective Violations. It may be worth studying. --- src/InputMapper.h | 20 +++++----------- src/RageSoundManager.cpp | 7 ++---- src/RageSoundReader_Preload.cpp | 3 ++- src/RageTexture.cpp | 15 ++++-------- src/RageTextureManager.cpp | 11 ++++----- src/RageThreads.cpp | 35 ++++++++-------------------- src/RageThreads.h | 21 +++++++++++++++++ src/RageUtil_AutoPtr.h | 13 ++++------- src/Trail.h | 10 ++++++-- src/arch/InputHandler/InputHandler.h | 2 +- 10 files changed, 63 insertions(+), 74 deletions(-) diff --git a/src/InputMapper.h b/src/InputMapper.h index 25f86c996c..cceaf2a5bf 100644 --- a/src/InputMapper.h +++ b/src/InputMapper.h @@ -12,20 +12,12 @@ const int NUM_USER_GAME_TO_DEVICE_SLOTS = 2; struct AutoMappingEntry { - AutoMappingEntry( int i, DeviceButton db, GameButton gb, bool b ) - { - m_iSlotIndex = i; - m_deviceButton = db; - m_gb = gb; - m_bSecondController = b; - } - AutoMappingEntry() - { - m_iSlotIndex = -1; - m_deviceButton = DeviceButton_Invalid; - m_gb = GameButton_Invalid; - m_bSecondController = false; - } + AutoMappingEntry( int i, DeviceButton db, GameButton gb, bool b ): + m_iSlotIndex(i), m_deviceButton(db), + m_gb(gb), m_bSecondController(b) {} + AutoMappingEntry(): m_iSlotIndex(-1), + m_deviceButton(DeviceButton_Invalid), m_gb(GameButton_Invalid), + m_bSecondController(false) {} bool IsEmpty() const { return m_deviceButton == DeviceButton_Invalid && m_gb == GameButton_Invalid; } int m_iSlotIndex; diff --git a/src/RageSoundManager.cpp b/src/RageSoundManager.cpp index a389f9d641..77034bd1e0 100644 --- a/src/RageSoundManager.cpp +++ b/src/RageSoundManager.cpp @@ -35,11 +35,8 @@ static Preference g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAU RageSoundManager *SOUNDMAN = NULL; -RageSoundManager::RageSoundManager() -{ - m_fMixVolume = 1.0f; - m_fVolumeOfNonCriticalSounds = 1.0f; -} +RageSoundManager::RageSoundManager(): m_pDriver(NULL), m_fMixVolume(1.0f), + m_fVolumeOfNonCriticalSounds(1.0f) {} static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" ); void RageSoundManager::Init() diff --git a/src/RageSoundReader_Preload.cpp b/src/RageSoundReader_Preload.cpp index 04dae7c10b..2358681331 100644 --- a/src/RageSoundReader_Preload.cpp +++ b/src/RageSoundReader_Preload.cpp @@ -34,7 +34,8 @@ bool RageSoundReader_Preload::PreloadSound( RageSoundReader *&pSound ) } RageSoundReader_Preload::RageSoundReader_Preload(): - m_Buffer( new RString ) + m_Buffer( new RString ), m_bBufferIs16Bit(false), + m_iPosition(0), m_iSampleRate(0), m_iChannels(0), m_fRate(0.0f) { m_bBufferIs16Bit = g_bSoundPreload16bit.Get(); } diff --git a/src/RageTexture.cpp b/src/RageTexture.cpp index c1eed7d324..ecad7eb785 100644 --- a/src/RageTexture.cpp +++ b/src/RageTexture.cpp @@ -7,16 +7,11 @@ RageTexture::RageTexture( RageTextureID name ): - m_ID(name) -{ - m_iRefCount = 1; - m_bWasUsed = false; - - m_iSourceWidth = m_iSourceHeight = 0; - m_iTextureWidth = m_iTextureHeight = 0; - m_iImageWidth = m_iImageHeight = 0; - m_iFramesWide = m_iFramesHigh = 1; -} + m_ID(name), m_iRefCount(1), m_bWasUsed(false), + m_iSourceWidth(0), m_iSourceHeight(0), + m_iTextureWidth(0), m_iTextureHeight(0), + m_iImageWidth(0), m_iImageHeight(0), + m_iFramesWide(1), m_iFramesHigh(1) {} RageTexture::~RageTexture() diff --git a/src/RageTextureManager.cpp b/src/RageTextureManager.cpp index 9cdb2570ee..9e3af1eed5 100644 --- a/src/RageTextureManager.cpp +++ b/src/RageTextureManager.cpp @@ -36,11 +36,9 @@ namespace map m_mapPathToTexture; }; -RageTextureManager::RageTextureManager() -{ - m_iNoWarnAboutOddDimensions = 0; - m_TexturePolicy = RageTextureID::TEX_DEFAULT; -} +RageTextureManager::RageTextureManager(): + m_iNoWarnAboutOddDimensions(0), + m_TexturePolicy(RageTextureID::TEX_DEFAULT) {} RageTextureManager::~RageTextureManager() { @@ -106,9 +104,8 @@ class RageTexture_Default: public RageTexture { public: RageTexture_Default(): - RageTexture( RageTextureID() ) + RageTexture( RageTextureID() ), m_uTexHandle(0) { - m_uTexHandle = 0; m_iSourceWidth = m_iSourceHeight = 1; m_iTextureWidth = m_iTextureHeight = 1; m_iImageWidth = m_iImageHeight = 1; diff --git a/src/RageThreads.cpp b/src/RageThreads.cpp index 3f3caf6305..0d6e1044a0 100644 --- a/src/RageThreads.cpp +++ b/src/RageThreads.cpp @@ -206,18 +206,11 @@ static ThreadSlot *GetUnknownThreadSlot() return g_pUnknownThreadSlot; } -RageThread::RageThread() -{ - m_pSlot = NULL; - m_sName = "unnamed"; -} +RageThread::RageThread(): m_pSlot(NULL), m_sName("unnamed") {} -RageThread::RageThread( const RageThread &cpy ) -{ - /* Copying a thread does not start the copy. */ - m_pSlot = NULL; - m_sName = cpy.m_sName; -} +/* Copying a thread does not start the copy. */ +RageThread::RageThread( const RageThread &cpy ): + m_pSlot(NULL), m_sName(cpy.m_sName) {} RageThread::~RageThread() { @@ -520,12 +513,9 @@ static set *g_FreeMutexIDs = NULL; #endif RageMutex::RageMutex( const RString &name ): - m_sName( name ) + m_sName( name ), m_pMutex( MakeMutex (this ) ), + m_LockedBy(GetInvalidThreadId()), m_LockCnt(0) { - m_pMutex = MakeMutex( this ); - m_LockedBy = GetInvalidThreadId(); - m_LockCnt = 0; - /* if( g_FreeMutexIDs == NULL ) { @@ -659,7 +649,8 @@ LockMutex::LockMutex( RageMutex &pMutex, const char *file_, int line_ ): mutex( pMutex ), file( file_ ), line( line_ ), - locked_at( RageTimer::GetTimeSinceStart() ) + locked_at( RageTimer::GetTimeSinceStart() ), + locked(false) // ensure it gets locked inside. { mutex.Lock(); locked = true; @@ -687,10 +678,7 @@ void LockMutex::Unlock() } RageEvent::RageEvent( RString name ): - RageMutex( name ) -{ - m_pEvent = MakeEvent( m_pMutex ); -} + RageMutex( name ), m_pEvent(MakeEvent(m_pMutex)) {} RageEvent::~RageEvent() { @@ -732,10 +720,7 @@ bool RageEvent::WaitTimeoutSupported() const } RageSemaphore::RageSemaphore( RString sName, int iInitialValue ): - m_sName( sName ) -{ - m_pSema = MakeSemaphore( iInitialValue ); -} + m_sName( sName ), m_pSema(MakeSemaphore( iInitialValue )) {} RageSemaphore::~RageSemaphore() { diff --git a/src/RageThreads.h b/src/RageThreads.h index 3de42782d1..86f7f55313 100644 --- a/src/RageThreads.h +++ b/src/RageThreads.h @@ -46,6 +46,9 @@ private: static bool s_bSystemSupportsTLS; static bool s_bIsShowingDialog; + + // Swallow up warnings. If they must be used, define them. + RageThread& operator=(const RageThread& rhs); }; /** @@ -61,6 +64,9 @@ public: private: ThreadSlot *m_pSlot; + // Swallow up warnings. If they must be used, define them. + RageThreadRegister& operator=(const RageThreadRegister& rhs); + RageThreadRegister(const RageThreadRegister& rhs); }; namespace Checkpoints @@ -102,6 +108,10 @@ protected: int m_LockCnt; void MarkLockedMutex(); +private: + // Swallow up warnings. If they must be used, define them. + RageMutex& operator=(const RageMutex& rhs); + RageMutex(const RageMutex& rhs); }; /** @@ -128,6 +138,10 @@ public: * * This can only be called once. */ void Unlock(); +private: + // Swallow up warnings. If they must be used, define them. + LockMutex& operator=(const LockMutex& rhs); + LockMutex(const LockMutex& rhs); }; #define LockMut(m) LockMutex UNIQUE_NAME(LocalLock) (m, __FILE__, __LINE__) @@ -149,6 +163,9 @@ public: void Signal(); void Broadcast(); bool WaitTimeoutSupported() const; + // Swallow up warnings. If they must be used, define them. + RageEvent& operator=(const RageEvent& rhs); + RageEvent(const RageEvent& rhs); private: EventImpl *m_pEvent; @@ -170,6 +187,10 @@ public: private: SemaImpl *m_pSema; RString m_sName; + + // Swallow up warnings. If they must be used, define them. + RageSemaphore& operator=(const RageSemaphore& rhs); + RageSemaphore(const RageSemaphore& rhs); }; #endif diff --git a/src/RageUtil_AutoPtr.h b/src/RageUtil_AutoPtr.h index 5b56eac08c..4cd03bdad6 100644 --- a/src/RageUtil_AutoPtr.h +++ b/src/RageUtil_AutoPtr.h @@ -27,22 +27,17 @@ class AutoPtrCopyOnWrite { public: /* This constructor only exists to make us work with STL containers. */ - inline AutoPtrCopyOnWrite() + inline AutoPtrCopyOnWrite(): m_pPtr(NULL), m_iRefCount(new int(1)) { - m_pPtr = NULL; - m_iRefCount = new int(1); } - explicit inline AutoPtrCopyOnWrite( T *p ) + explicit inline AutoPtrCopyOnWrite( T *p ): m_pPtr(p), m_iRefCount(new int(1)) { - m_pPtr = p; - m_iRefCount = new int(1); } - inline AutoPtrCopyOnWrite( const AutoPtrCopyOnWrite &rhs ) + inline AutoPtrCopyOnWrite( const AutoPtrCopyOnWrite &rhs ): + m_pPtr(rhs.m_pPtr), m_iRefCount(rhs.m_iRefCount) { - m_pPtr = rhs.m_pPtr; - m_iRefCount = rhs.m_iRefCount; ++(*m_iRefCount); } diff --git a/src/Trail.h b/src/Trail.h index f0f9fb040f..f69dd56faf 100644 --- a/src/Trail.h +++ b/src/Trail.h @@ -64,9 +64,15 @@ public: mutable bool m_bRadarValuesCached; mutable RadarValues m_CachedRadarValues; - Trail() + /** + * @brief Set up the Trail with default values. + * + * This used to call Init(), which is still available. */ + Trail(): m_StepsType(StepsType_Invalid), + m_CourseDifficulty(Difficulty_Invalid), + m_iSpecifiedMeter(-1), m_bRadarValuesCached(false) { - Init(); + m_vEntries.clear(); } void Init() { diff --git a/src/arch/InputHandler/InputHandler.h b/src/arch/InputHandler/InputHandler.h index 5bb41914e3..0eeed81982 100644 --- a/src/arch/InputHandler/InputHandler.h +++ b/src/arch/InputHandler/InputHandler.h @@ -25,7 +25,7 @@ public: static void Create( const RString &sDrivers, vector &apAdd ); static DriverList m_pDriverList; - InputHandler() { m_iInputsSinceUpdate = 0; } + InputHandler(): m_iInputsSinceUpdate(0) {} virtual ~InputHandler() { } virtual void Update() { } virtual bool DevicesChanged() { return false; } From 4a04a84d4c2e5948abceca3b9c675fb1114c1082 Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Mon, 14 Mar 2011 13:08:48 -0700 Subject: [PATCH 28/37] kidnap themekit. --- Themes/default/metrics.ini | 1 + .../default.lua | 66 +++++++++++++++-- .../default.lua | 2 - .../Graphics/ScreenTitleMenu scroll.lua | 6 +- .../ScreenWithMenuElements footer.lua | 3 - .../ScreenWithMenuElements header.lua | 3 - Themes/themekit/metrics.ini | 70 +++++++------------ 7 files changed, 87 insertions(+), 64 deletions(-) delete mode 100644 Themes/themekit/Graphics/ScreenWithMenuElements footer.lua delete mode 100644 Themes/themekit/Graphics/ScreenWithMenuElements header.lua diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index ab23f589d8..9f57baa9f3 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -649,6 +649,7 @@ MeterSetCommand=%function(self,param) \ end; \ if param.Meter then \ if param.Meter >= 10 then \ + self:textglowmode('TextGlowMode_Inner'); \ self:glowshift(); \ else \ self:stopeffect(); \ diff --git a/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua b/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua index b97fb0767e..d3ebaea695 100644 --- a/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua +++ b/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua @@ -1,8 +1,62 @@ -return Def.ActorFrame { +local t = Def.ActorFrame {}; +-- +--[[ local tGridSizeMajor = { 32, 32 }; +local tGridSizeMinor = { 16, 16 }; +local function CreateDebugGrid() + local t = Def.ActorFrame {}; + local numX = math.ceil(SCREEN_WIDTH/tGridSizeMajor[1]) + local numY = math.ceil(SCREEN_HEIGHT/tGridSizeMajor[2]) + local offset = ( math.ceil(SCREEN_WIDTH/tGridSizeMajor[1]) - SCREEN_WIDTH ) + SCREEN_WIDTH; + for a=1,numY do + for b=1,numX do + t[#t+1] = Def.Quad { + InitCommand=cmd(x,b*tGridSizeMajor[1]-(tGridSizeMajor[1]/2);y,a*tGridSizeMajor[2]-(tGridSizeMajor[2]/2)); + OnCommand=cmd(zoomto,tGridSizeMajor[1]-2,tGridSizeMajor[2]-2;diffuse,color("1,1,1,0.25")); + }; + end; + end; + return t +end --]] + +-- +t[#t+1] = Def.ActorFrame { InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); - - Def.Quad { - InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("0.25,0.15,0.25,1")); + LoadActor("VOL1-29-NTSC") .. { + InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); + OnCommand=cmd(diffusealpha,0.75); }; -}; \ No newline at end of file +}; +-- +local bShow = 0; +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(visible,false); + ToggleConsoleDisplayMessageCommand=function(self) + bShow = 1 - bShow; + self:visible( bShow == 1 ); + end; + -- Grid + LoadActor("_32") .. { + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/32,SCREEN_HEIGHT/32); + OnCommand=cmd(diffuse,color("0,0,0,0.5")); + }; + LoadActor("_16") .. { + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/16,SCREEN_HEIGHT/16); + OnCommand=cmd(diffuse,color("1,1,1,0.125")); + }; +--[[ LoadActor("_8") .. { + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/8,SCREEN_HEIGHT/8); + OnCommand=cmd(diffuse,color("#00BFE833")); + }; --]] + -- Left + Def.Quad { + InitCommand=cmd(horizalign,left;x,SCREEN_LEFT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0,0,0,0.5")); + }; + -- Right + Def.Quad { + InitCommand=cmd(horizalign,right;x,SCREEN_RIGHT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0,0,0,0.5")); + }; +}; +-- +return t \ No newline at end of file diff --git a/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua b/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua index 9d64c662cd..d69d08b791 100644 --- a/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua +++ b/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua @@ -2,8 +2,6 @@ -- I prefer to keep these optional, incase another screen wants to hide -- these elements. local t = Def.ActorFrame {}; - t[#t+1] = StandardDecorationFromFileOptional("Header","Header"); t[#t+1] = StandardDecorationFromFileOptional("Footer","Footer"); - return t \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua b/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua index 13448248c9..84e2da8460 100644 --- a/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua +++ b/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua @@ -4,10 +4,8 @@ local t = Def.ActorFrame {}; t[#t+1] = LoadFont("Common Normal") .. { Text=gc:GetText(); - InitCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemInitCommand"); - GainFocusCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemGainFocusCommand"); - LoseFocusCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemGainFocusCommand"); }; - +t.GainFocusCommand=cmd(diffusealpha,1); +t.LoseFocusCommand=cmd(diffusealpha,0.5); return t; \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua b/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua deleted file mode 100644 index a68467c3ba..0000000000 --- a/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua +++ /dev/null @@ -1,3 +0,0 @@ -return Def.Quad { - InitCommand=cmd(zoomto,SCREEN_WIDTH,32); -}; \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenWithMenuElements header.lua b/Themes/themekit/Graphics/ScreenWithMenuElements header.lua deleted file mode 100644 index 82ac56aec3..0000000000 --- a/Themes/themekit/Graphics/ScreenWithMenuElements header.lua +++ /dev/null @@ -1,3 +0,0 @@ -return Def.Quad { - InitCommand=cmd(zoomto,SCREEN_WIDTH,48); -}; \ No newline at end of file diff --git a/Themes/themekit/metrics.ini b/Themes/themekit/metrics.ini index 0606f0540b..ffd154d4d0 100644 --- a/Themes/themekit/metrics.ini +++ b/Themes/themekit/metrics.ini @@ -1,59 +1,37 @@ [Global] FallbackTheme=_fallback - -[CustomScoring] -ComboAboveThresholdAddsToScoreBonus=0 -ComboScoreBonusThreshold=50 -ComboScoreBonusValue=+1000 - -ComboMultiplier=0.0 - -DoubleNoteScoreMultiplier=2.0 -TripleNoteScoreMultiplier=3.0 -QuadOrHigherNoteScoreMultiplier=4.0 - -PointsW1=+50 -PointsW2=+20 -PointsW3=+10 -PointsW4=+5 -PointsW5=0 -PointsMiss=-5 -PointsHitMine=-5 -PointsCheckpointHit=+5 -PointsCheckpointMiss=-5 -PointsNone=0 -PointsHoldHeld=+5 -PointsHoldLetGo=-5 - [ScreenWithMenuElements] -WaitForChildrenBeforeTweeningOut=true - ShowHeader=true HeaderX=SCREEN_CENTER_X HeaderY=SCREEN_TOP -HeaderOnCommand=vertalign,top;diffuse,color("0.5,0.25,0.35,1"); +HeaderOnCommand= HeaderOffCommand= - +# ShowFooter=true FooterX=SCREEN_CENTER_X FooterY=SCREEN_BOTTOM -FooterOnCommand=vertalign,bottom;diffuse,color("0.5,0.25,0.35,1"); +FooterOnCommand= FooterOffCommand= +# +TimerX=SCREEN_WIDTH-64 +TimerY=SCREEN_TOP+48-4.5 +TimerOnCommand= +TimerOffCommand= +[MenuTimer] +# Text +Text1OnCommand=stopeffect;stoptweening;vertalign,bottom;horizalign,right +Text1FormatFunction=function(fSeconds) \ + return string.format("%0.1f", fSeconds); \ +end +FrameOnCommand= +# Warning +Warning10Command=diffuseshift;effectperiod,1;effectcolor2,Color("Red");effectcolor1,color("0.5,0,0,1"); [ScreenTitleMenu] -ScrollerY=SCREEN_CENTER_Y*1.5 -ScrollerOnCommand= -# New: Load ScrollerItem SpacingX/Y -ScrollerTransform=function(self,offset,itemIndex,numItems) \ - local fSpaceX = THEME:GetMetric( Var "LoadingScreen","ScrollerItemSpacingX"); \ - local fSpaceY = THEME:GetMetric( Var "LoadingScreen","ScrollerItemSpacingY"); \ - self:x( (i-1) * fSpaceX ); \ - self:y( (i-1) * fSpaceY ); \ -end; -# New: Adjust menu items -ScrollerItemSpacingX=0 -ScrollerItemSpacingY=24 -ScrollerItemInitCommand=zoom,1;shadowlength,1 -ScrollerItemGainFocusCommand=finishtweening;linear,0.125;zoom,1.25 -ScrollerItemLoseFocusCommand=finishtweening;linear,0.125;zoom,1 +ShowHeader=true +ShowFooter=true [ScreenSelectMusic] - +MusicWheelX=SCREEN_RIGHT-128-18 +MusicWheelOnCommand=draworder,-1 +[MusicWheel] +ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) self:x( (1-math.cos(offsetFromCenter/math.pi))*0 ); self:y( offsetFromCenter*48 ); end +NumWheelItems=13 \ No newline at end of file From 7168b07e409e774e31d47db580494fc18429ba51 Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Mon, 14 Mar 2011 13:10:28 -0700 Subject: [PATCH 29/37] glow em' bigga, dan --- Themes/default/metrics.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index ab23f589d8..9f57baa9f3 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -649,6 +649,7 @@ MeterSetCommand=%function(self,param) \ end; \ if param.Meter then \ if param.Meter >= 10 then \ + self:textglowmode('TextGlowMode_Inner'); \ self:glowshift(); \ else \ self:stopeffect(); \ From 628a74a792ebd6043220d611164f503fc191bbf2 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 16:25:53 -0400 Subject: [PATCH 30/37] Effective C++ Violations down by over 5000. I think that was the biggest batch. --- src/OptionRowHandler.h | 13 ++++++++++++- src/PlayerOptions.cpp | 2 -- src/PlayerOptions.h | 31 ++++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/OptionRowHandler.h b/src/OptionRowHandler.h index 0ad0957959..aa92663865 100644 --- a/src/OptionRowHandler.h +++ b/src/OptionRowHandler.h @@ -75,7 +75,18 @@ struct OptionRowDefinition return m_vEnabledForPlayers.find(pn) != m_vEnabledForPlayers.end(); } - OptionRowDefinition() { Init(); } + OptionRowDefinition(): m_sName(""), m_sExplanationName(""), + m_bOneChoiceForAllPlayers(false), m_selectType(SELECT_ONE), + m_layoutType(LAYOUT_SHOW_ALL_IN_ROW), m_iDefault(-1), + m_bExportOnChange(false), m_bAllowThemeItems(true), + m_bAllowThemeTitle(true), m_bAllowExplanation(true), + m_bShowChoicesListOnSelect(false) + { + m_vsChoices.clear(); + m_vEnabledForPlayers.clear(); + FOREACH_PlayerNumber( pn ) + m_vEnabledForPlayers.insert( pn ); + } void Init() { m_sName = ""; diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index 62a4dab610..76a1b30650 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -12,8 +12,6 @@ #include "CommonMetrics.h" #include -#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; } - ThemeMetric RANDOM_SPEED_CHANCE ( "PlayerOptions", "RandomSpeedChance" ); ThemeMetric RANDOM_REVERSE_CHANCE ( "PlayerOptions", "RandomReverseChance" ); ThemeMetric RANDOM_DARK_CHANCE ( "PlayerOptions", "RandomDarkChance" ); diff --git a/src/PlayerOptions.h b/src/PlayerOptions.h index e18095b008..aeb1c49b08 100644 --- a/src/PlayerOptions.h +++ b/src/PlayerOptions.h @@ -7,13 +7,42 @@ class Steps; class Trail; struct lua_State; +#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; } + #include "GameConstantsAndTypes.h" #include "PlayerNumber.h" /** @brief Per-player options that are not saved between sessions. */ class PlayerOptions { public: - PlayerOptions() { Init(); }; + /** + * @brief Set up the PlayerOptions with some reasonable defaults. + * + * This code was taken from Init() to use proper initialization. */ + PlayerOptions(): m_bSetScrollSpeed(false), + m_fTimeSpacing(0), m_SpeedfTimeSpacing(1.0f), + m_fScrollSpeed(1.0f), m_SpeedfScrollSpeed(1.0f), + m_fScrollBPM(200), m_SpeedfScrollBPM(1.0f), + m_fDark(0), m_SpeedfDark(1.0f), + m_fBlind(0), m_SpeedfBlind(1.0f), + m_fCover(0), m_SpeedfCover(1.0f), + m_fRandAttack(0), m_SpeedfRandAttack(1.0f), + m_fSongAttack(0), m_SpeedfSongAttack(1.0f), + m_fPlayerAutoPlay(0), m_SpeedfPlayerAutoPlay(1.0f), + m_bSetTiltOrSkew(false), + m_fPerspectiveTilt(0), m_SpeedfPerspectiveTilt(1.0f), + m_fSkew(0), m_SpeedfSkew(1.0f), + m_fPassmark(0), m_SpeedfPassmark(1.0f), + m_fRandomSpeed(0), m_SpeedfRandomSpeed(1.0f), + m_bMuteOnError(false), m_FailType(FAIL_IMMEDIATE), + m_ScoreDisplay(SCORING_ADD), m_sNoteSkin("") + { + ZERO( m_fAccels ); ONE( m_SpeedfAccels ); + ZERO( m_fEffects ); ONE( m_SpeedfEffects ); + ZERO( m_fAppearances ); ONE( m_SpeedfAppearances ); + ZERO( m_fScrolls ); ONE( m_SpeedfScrolls ); + ZERO( m_bTurns ); ZERO( m_bTransforms ); + }; void Init(); void Approach( const PlayerOptions& other, float fDeltaSeconds ); RString GetString( bool bForceNoteSkin = false ) const; From 49f14d2b35b86305685c1cbda0c20f21c06724b6 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 17:03:02 -0400 Subject: [PATCH 31/37] More warnings being taken care of. --- src/Character.cpp | 7 +++---- src/LocalizedString.h | 2 ++ src/RageFile.h | 10 ++++++++-- src/RageFileBasic.h | 3 +++ src/RageSound.cpp | 7 ++----- src/RageSoundManager.h | 3 +++ src/RageSoundReader_PitchChange.h | 2 ++ src/RageSoundReader_ThreadedBuffer.h | 3 ++- src/RageThreads.cpp | 3 ++- src/RageUtil_AutoPtr.h | 11 +++-------- src/SongOptions.h | 15 +++++++++++++-- 11 files changed, 43 insertions(+), 23 deletions(-) diff --git a/src/Character.cpp b/src/Character.cpp index a925c8b563..82146c5b69 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -5,10 +5,9 @@ #include "RageTextureID.h" #include "ActorUtil.h" -Character::Character() -{ - m_iPreloadRefcount = 0; -} +Character::Character(): m_sCharDir(""), m_sCharacterID(""), + m_sDisplayName(""), m_sCardPath(""), m_sIconPath(""), + m_bUsableInRave(false), m_iPreloadRefcount(0) {} bool Character::Load( RString sCharDir ) { diff --git a/src/LocalizedString.h b/src/LocalizedString.h index 1e5c7256e8..9e6de64dd3 100644 --- a/src/LocalizedString.h +++ b/src/LocalizedString.h @@ -25,6 +25,8 @@ private: void CreateImpl(); RString m_sGroup, m_sName; ILocalizedStringImpl *m_pImpl; + // Swallow up warnings. If they must be used, define them. + LocalizedString& operator=(const LocalizedString& rhs); }; #endif diff --git a/src/RageFile.h b/src/RageFile.h index 700f4de36f..0db14ca949 100644 --- a/src/RageFile.h +++ b/src/RageFile.h @@ -6,8 +6,11 @@ #include "RageFileBasic.h" struct lua_State; -/* This is the high-level interface, which interfaces with RageFileObj implementations - * and RageFileManager. */ +/** + * @brief High-level file access. + * + * This is the high-level interface, which interfaces with RageFileObj + * implementations and RageFileManager. */ class RageFile: public RageFileBasic { public: @@ -81,6 +84,9 @@ private: RString m_Path; RString m_sError; int m_Mode; + + // Swallow up warnings. If they must be used, define them. + RageFile& operator=(const RageFile& rhs); }; /** @brief Convenience wrappers for reading binary files. */ diff --git a/src/RageFileBasic.h b/src/RageFileBasic.h index 8e42cb7c01..dfefaec812 100644 --- a/src/RageFileBasic.h +++ b/src/RageFileBasic.h @@ -152,6 +152,9 @@ private: * file, and no seeking is performed. */ bool m_bCRC32Enabled; uint32_t m_iCRC32; + + // Swallow up warnings. If they must be used, define them. + RageFileObj& operator=(const RageFileObj& rhs); }; #endif diff --git a/src/RageSound.cpp b/src/RageSound.cpp index 71ec55518b..836082b904 100644 --- a/src/RageSound.cpp +++ b/src/RageSound.cpp @@ -44,11 +44,8 @@ RageSoundParams::RageSoundParams(): m_fPitch(1.0f), m_fSpeed(1.0f), m_StartTime( RageZeroTimer ), StopMode(M_AUTO), m_bIsCriticalSound(false) {} -RageSoundLoadParams::RageSoundLoadParams() -{ - m_bSupportRateChanging = false; - m_bSupportPan = false; -} +RageSoundLoadParams::RageSoundLoadParams(): + m_bSupportRateChanging(false), m_bSupportPan(false) {} RageSound::RageSound(): m_Mutex( "RageSound" ), m_pSource(NULL), m_iStreamFrame(0), diff --git a/src/RageSoundManager.h b/src/RageSoundManager.h index 37525356ab..e558eb32d2 100644 --- a/src/RageSoundManager.h +++ b/src/RageSoundManager.h @@ -53,6 +53,9 @@ private: /* Prefs: */ float m_fMixVolume; float m_fVolumeOfNonCriticalSounds; + // Swallow up warnings. If they must be used, define them. + RageSoundManager& operator=(const RageSoundManager& rhs); + RageSoundManager(const RageSoundManager& rhs); }; extern RageSoundManager *SOUNDMAN; diff --git a/src/RageSoundReader_PitchChange.h b/src/RageSoundReader_PitchChange.h index 454ec12102..c7168f85ce 100644 --- a/src/RageSoundReader_PitchChange.h +++ b/src/RageSoundReader_PitchChange.h @@ -29,6 +29,8 @@ private: float m_fPitchRatio; float m_fLastSetSpeedRatio; float m_fLastSetPitchRatio; + // Swallow up warnings. If they must be used, define them. + RageSoundReader_PitchChange& operator=(const RageSoundReader_PitchChange& rhs); }; #endif diff --git a/src/RageSoundReader_ThreadedBuffer.h b/src/RageSoundReader_ThreadedBuffer.h index f13069251d..edb5295c5d 100644 --- a/src/RageSoundReader_ThreadedBuffer.h +++ b/src/RageSoundReader_ThreadedBuffer.h @@ -53,7 +53,8 @@ private: int iFramesBuffered; int iPositionOfFirstFrame; float fRate; - Mapping() { iFramesBuffered = iPositionOfFirstFrame = 0; fRate = 1.0f; } + Mapping(): iFramesBuffered(0), iPositionOfFirstFrame(0), + fRate(1.0f) {} }; list m_StreamPosition; diff --git a/src/RageThreads.cpp b/src/RageThreads.cpp index 0d6e1044a0..f806c6867b 100644 --- a/src/RageThreads.cpp +++ b/src/RageThreads.cpp @@ -65,7 +65,8 @@ struct ThreadSlot int m_iCurCheckpoint, m_iNumCheckpoints; const char *GetFormattedCheckpoint( int lineno ); - ThreadSlot() { Init(); } + ThreadSlot(): m_bUsed(false), m_iID(GetInvalidThreadId()), + m_pImpl(NULL), m_iCurCheckpoint(0), m_iNumCheckpoints(0) {} void Init() { m_iID = GetInvalidThreadId(); diff --git a/src/RageUtil_AutoPtr.h b/src/RageUtil_AutoPtr.h index 4cd03bdad6..01005c1724 100644 --- a/src/RageUtil_AutoPtr.h +++ b/src/RageUtil_AutoPtr.h @@ -127,16 +127,11 @@ public: T& operator*() { return *m_pPtr; } T* operator->() { return m_pPtr; } - explicit HiddenPtr( T *p = NULL ) - { - m_pPtr = p; - } + explicit HiddenPtr( T *p = NULL ): m_pPtr(p) {} - HiddenPtr( const HiddenPtr &cpy ) + HiddenPtr( const HiddenPtr &cpy ): m_pPtr(NULL) { - if( cpy.m_pPtr == NULL ) - m_pPtr = NULL; - else + if( cpy.m_pPtr != NULL ) m_pPtr = HiddenPtrTraits::Copy( cpy.m_pPtr ); } diff --git a/src/SongOptions.h b/src/SongOptions.h index 7a81c9fc45..a690b56ccd 100644 --- a/src/SongOptions.h +++ b/src/SongOptions.h @@ -46,8 +46,19 @@ public: }; SoundEffectType m_SoundEffectType; - - SongOptions() { Init(); }; + /** + * @brief Set up the SongOptions with reasonable defaults. + * + * This is taken from Init(), but uses the intended + * initialization lists. */ + SongOptions(): m_LifeType(LIFE_BAR), m_DrainType(DRAIN_NORMAL), + m_iBatteryLives(4), m_bAssistClap(false), + m_bAssistMetronome(false), m_fMusicRate(1.0f), + m_SpeedfMusicRate(1.0f), m_fHaste(0.0f), + m_SpeedfHaste(1.0f), m_AutosyncType(AUTOSYNC_OFF), + m_SoundEffectType(SOUNDEFFECT_OFF), + m_bStaticBackground(false), m_bRandomBGOnly(false), + m_bSaveScore(true), m_bSaveReplay(false) {}; void Init(); void Approach( const SongOptions& other, float fDeltaSeconds ); void GetMods( vector &AddTo ) const; From 797d94c5b35aaf1915830b678f7b3ad5a935417b Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 17:55:07 -0400 Subject: [PATCH 32/37] Right, overdid it there. --- src/RageThreads.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/RageThreads.h b/src/RageThreads.h index 86f7f55313..d0af4fcc6e 100644 --- a/src/RageThreads.h +++ b/src/RageThreads.h @@ -141,7 +141,6 @@ public: private: // Swallow up warnings. If they must be used, define them. LockMutex& operator=(const LockMutex& rhs); - LockMutex(const LockMutex& rhs); }; #define LockMut(m) LockMutex UNIQUE_NAME(LocalLock) (m, __FILE__, __LINE__) From 4efd7886edea83287770de0d585366e4c57ee150 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Mon, 14 Mar 2011 19:30:41 -0500 Subject: [PATCH 33/37] fuckin merges reverted --- .hgignore | 1 - Docs/Changelog_sm-ssc.txt | 27 +++-- Themes/_fallback/Languages/en.ini | 4 +- Themes/_fallback/metrics.ini | 4 - .../CombinedLifeMeterTug stream p1.redir | 1 + .../CombinedLifeMeterTug stream p2.redir | 1 + Themes/default/metrics.ini | 1 - .../default.lua | 64 +--------- .../default.lua | 2 + .../Graphics/ScreenTitleMenu scroll.lua | 6 +- .../ScreenWithMenuElements footer.lua | 3 + .../ScreenWithMenuElements header.lua | 3 + Themes/themekit/metrics.ini | 70 +++++++---- Xcode/Info-StepMania.plist | 114 +++++++++--------- Xcode/stepmania.xcodeproj/project.pbxproj | 32 ++--- src/ArrowEffects.cpp | 2 +- src/Attack.cpp | 4 +- src/Attack.h | 20 +-- src/AutoKeysounds.cpp | 4 +- src/BGAnimation.cpp | 6 +- src/Background.cpp | 6 +- src/BeginnerHelper.cpp | 2 - src/Character.cpp | 7 +- src/Course.cpp | 8 +- src/Course.h | 15 ++- src/CourseUtil.cpp | 2 +- src/Font.cpp | 12 +- src/Foreground.cpp | 10 +- src/GameCommand.cpp | 4 +- src/GameState.cpp | 4 +- src/InputMapper.cpp | 6 +- src/InputMapper.h | 20 ++- src/LocalizedString.h | 2 - src/LuaManager.h | 6 - src/ModIconRow.cpp | 6 +- src/ModelTypes.h | 9 +- src/NoteData.cpp | 4 +- src/NoteDataUtil.cpp | 13 +- src/NoteField.cpp | 22 ++-- src/NoteSkinManager.cpp | 14 +-- src/NoteTypes.h | 23 ---- src/NotesLoaderBMS.cpp | 24 ++-- src/NotesLoaderMidi.cpp | 10 +- src/NotesLoaderPMS.cpp | 28 ++--- src/NotesLoaderSM.cpp | 5 +- src/NotesWriterSM.cpp | 6 +- src/OptionRow.cpp | 2 +- src/OptionRowHandler.cpp | 14 +-- src/OptionRowHandler.h | 13 +- src/OptionsCursor.cpp | 8 +- src/OptionsList.cpp | 28 ++--- src/Player.cpp | 21 ++-- src/PlayerOptions.cpp | 2 + src/PlayerOptions.h | 31 +---- src/Profile.cpp | 14 +-- src/ProfileManager.cpp | 6 +- src/RageDisplay.cpp | 2 +- src/RageDisplay.h | 46 ++++--- src/RageFile.h | 10 +- src/RageFileBasic.h | 3 - src/RageFileDriverDeflate.cpp | 6 +- src/RageFileManager.cpp | 4 +- src/RageInputDevice.h | 25 ++-- src/RageLog.cpp | 9 +- src/RageMath.cpp | 4 +- src/RageSound.cpp | 34 ++++-- src/RageSound.h | 21 ++-- src/RageSoundManager.cpp | 7 +- src/RageSoundManager.h | 3 - src/RageSoundReader_Chain.cpp | 3 + src/RageSoundReader_MP3.cpp | 2 +- src/RageSoundReader_Merge.cpp | 1 + src/RageSoundReader_PitchChange.h | 2 - src/RageSoundReader_Preload.cpp | 3 +- src/RageSoundReader_ThreadedBuffer.h | 3 +- src/RageSurface.h | 2 +- src/RageSurfaceUtils.cpp | 4 +- src/RageSurfaceUtils_Palettize.cpp | 12 +- src/RageTexture.cpp | 15 ++- src/RageTextureID.h | 11 +- src/RageTextureManager.cpp | 11 +- src/RageTextureManager.h | 29 +++-- src/RageThreads.cpp | 38 ++++-- src/RageThreads.h | 20 --- src/RageTimer.h | 2 +- src/RageTypes.h | 33 +++-- src/RageUtil.cpp | 8 +- src/RageUtil_AutoPtr.h | 26 ++-- src/RageUtil_CachedObject.h | 3 +- src/ScoreKeeperNormal.cpp | 2 +- src/ScreenBookkeeping.cpp | 2 +- src/ScreenDebugOverlay.cpp | 38 +++--- src/ScreenEdit.cpp | 77 ++++++------ src/ScreenEdit.h | 11 +- src/ScreenGameplay.cpp | 10 +- src/ScreenJukebox.cpp | 14 +-- src/ScreenNetSelectBase.cpp | 10 +- src/ScreenOptionsEditCourse.cpp | 8 +- src/ScreenOptionsManageCourses.cpp | 2 +- src/ScreenOptionsManageEditSteps.cpp | 2 +- src/ScreenOptionsMemoryCard.cpp | 5 +- src/ScreenRanking.cpp | 3 +- src/ScreenSelectMusic.cpp | 12 +- src/ScreenTestInput.cpp | 1 + src/ScrollBar.cpp | 2 +- src/SongManager.cpp | 10 +- src/SongOptions.h | 15 +-- src/StatsManager.cpp | 4 +- src/StepMania-net2008.vcproj | 13 +- src/StepMania.cpp | 4 +- src/StepsUtil.h | 9 +- src/StreamDisplay.cpp | 2 +- src/TimingData.cpp | 8 +- src/TimingData.h | 2 +- src/Trail.h | 10 +- src/UnlockManager.h | 16 +-- src/XmlFileUtil.cpp | 12 +- src/arch/InputHandler/InputHandler.h | 2 +- .../InputHandler/InputHandler_MacOSX_HID.cpp | 4 +- src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 2 - src/arch/MovieTexture/MovieTexture_Theora.cpp | 10 +- src/arch/Sound/RageSoundDriver.h | 3 +- 122 files changed, 701 insertions(+), 802 deletions(-) create mode 100644 Themes/default/Graphics/CombinedLifeMeterTug stream p1.redir create mode 100644 Themes/default/Graphics/CombinedLifeMeterTug stream p2.redir create mode 100644 Themes/themekit/Graphics/ScreenWithMenuElements footer.lua create mode 100644 Themes/themekit/Graphics/ScreenWithMenuElements header.lua diff --git a/.hgignore b/.hgignore index 3382b3a54d..0b3bfcf250 100644 --- a/.hgignore +++ b/.hgignore @@ -37,7 +37,6 @@ src/libtomcrypt/Release-* src/libtommath/build-* src/libtommath/Release-* src/*.old -src/.deps ver.cpp lib*_link.a Data/UserPrefs diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index df79bf320c..7be1d02092 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -10,18 +10,7 @@ supported but exist anyways.) _____________________________________________________________________________ ================================================================================ -sm-ssc v1.2.4 | 20110??? --------------------------------------------------------------------------------- - -20110313 --------- -* [NotesWriterSM] Allow for either the #DESCRIPTION or #CREDIT tags to be used - for the .sm format's description token. [Wolfman2000] -* [ScreenEdit] Add Tap Note Cycling to allow inputting all of the taps. The way - to make holds and rolls are still the same as before. [Wolfman2000] - -================================================================================ -sm-ssc v1.2.3 | 20110323 +sm-ssc v1.2.3 | 201103?? -------------------------------------------------------------------------------- 20110309 @@ -36,6 +25,20 @@ sm-ssc v1.2.3 | 20110323 * [MeterDisplay] Add Lua binding. "Allow setting and changing the width dynamically. Phase out the "StreamWidth" node property; set it with SetStreamWidth instead." [Glenn Maynard] +* sm5svn r28280: "Previously, we didn't create MusicWheel sorts when the screen + loads; it was delayed until the screen begins. This allowed preloading before + the style is set. However, it caused a major skip when the screen starts, + because creating the sorts is fairly expensive. + + Refactor this. Load the sorts when the screen is loaded, and then go through + them and quickly filter out unplayable data and handle other initialization + on begin. This is much faster, so we can more easily transition seamlessly + from the previous menu. + + One known limitation: the sorts are created before we know the style, so we + have to guess. This means if you're in a style like dance-solo or + pump-halfdouble, sorts will still be based on regular mode. This affects the + difficulty, top grade and roulette sorts." [Glenn Maynard] 20110305 -------- diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 7314f129ad..984de88fc7 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1223,7 +1223,7 @@ Enter a new sub title transliteration.=Enter a new sub title transliteration. Enter a new sub title.=Enter a new sub title. More than %d notes per measure is not allowed. This change has been reverted.=More than %d notes per measure is not allowed. This change has been reverted. No backgrounds available=No backgrounds available -EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nCreate roll note:\n Hold Shift,\n then create a\n hold note.\nSpace bar:\n Set area\n marker\nEnter:\n Area Menu\nEscape:\n Main Menu\nF1:\n Show help\n +EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nSpace bar:\n Set area\n marker\nEnter:\n Area Menu\nEscape:\n Main Menu\nF1:\n Show help\n PlayRecordHelpText=Press START to end Save successful.=Save successful. Saved as SM and DWI.=Saved as SM and DWI. @@ -1244,7 +1244,6 @@ Description=Description Chart Style=Chart Style Main title=Main title Subtitle=Subtitle -Tap Note=Tap Note Tap Steps=Tap Steps Jumps=Jumps Hands=Hands @@ -1926,7 +1925,6 @@ Insert beat and shift down=Insert beat and shift down Shift BPM changes and stops down one beat=Shift BPM changes and stops down one beat Delete beat and shift up=Delete beat and shift up Shift BPM changes and stops up one beat=Shift BPM changes and stops up one beat -Cycle between tap notes=Cycle between tap notes Lay mine=Lay mine Lay lift=Lay lift Add to/remove from right half=Add to/remove from right half diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 3fc779c3b6..18418ebc07 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -647,9 +647,6 @@ LyricBackChangedCommand=LyricCommand,"Back" InLength=0 OutLength=0 -[NotesWriterSM] -DescriptionUsesCreditField=false - [OptionRow] ShowModIcons=false ShowUnderlines=true @@ -3652,7 +3649,6 @@ DescriptionFormat="%s:\n %s\n" ChartStyleFormat="%s:\n %s\n" MainTitleFormat="%s:\n %s\n" SubtitleFormat="%s:\n %s\n" -TapNoteTypeFormat="%s: %s\n" NumStepsFormat="%s: %d\n" NumJumpsFormat="%s: %d\n" NumHoldsFormat="%s: %d\n" diff --git a/Themes/default/Graphics/CombinedLifeMeterTug stream p1.redir b/Themes/default/Graphics/CombinedLifeMeterTug stream p1.redir new file mode 100644 index 0000000000..4d26295a4a --- /dev/null +++ b/Themes/default/Graphics/CombinedLifeMeterTug stream p1.redir @@ -0,0 +1 @@ +_CombinedLifeMeterTug stream p1 \ No newline at end of file diff --git a/Themes/default/Graphics/CombinedLifeMeterTug stream p2.redir b/Themes/default/Graphics/CombinedLifeMeterTug stream p2.redir new file mode 100644 index 0000000000..5189a43350 --- /dev/null +++ b/Themes/default/Graphics/CombinedLifeMeterTug stream p2.redir @@ -0,0 +1 @@ +_CombinedLifeMeterTug stream p2 \ No newline at end of file diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 9f57baa9f3..ab23f589d8 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -649,7 +649,6 @@ MeterSetCommand=%function(self,param) \ end; \ if param.Meter then \ if param.Meter >= 10 then \ - self:textglowmode('TextGlowMode_Inner'); \ self:glowshift(); \ else \ self:stopeffect(); \ diff --git a/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua b/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua index d3ebaea695..b97fb0767e 100644 --- a/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua +++ b/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua @@ -1,62 +1,8 @@ -local t = Def.ActorFrame {}; --- ---[[ local tGridSizeMajor = { 32, 32 }; -local tGridSizeMinor = { 16, 16 }; -local function CreateDebugGrid() - local t = Def.ActorFrame {}; - local numX = math.ceil(SCREEN_WIDTH/tGridSizeMajor[1]) - local numY = math.ceil(SCREEN_HEIGHT/tGridSizeMajor[2]) - local offset = ( math.ceil(SCREEN_WIDTH/tGridSizeMajor[1]) - SCREEN_WIDTH ) + SCREEN_WIDTH; - for a=1,numY do - for b=1,numX do - t[#t+1] = Def.Quad { - InitCommand=cmd(x,b*tGridSizeMajor[1]-(tGridSizeMajor[1]/2);y,a*tGridSizeMajor[2]-(tGridSizeMajor[2]/2)); - OnCommand=cmd(zoomto,tGridSizeMajor[1]-2,tGridSizeMajor[2]-2;diffuse,color("1,1,1,0.25")); - }; - end; - end; - return t -end --]] - --- -t[#t+1] = Def.ActorFrame { +return Def.ActorFrame { InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); - LoadActor("VOL1-29-NTSC") .. { - InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); - OnCommand=cmd(diffusealpha,0.75); - }; -}; --- -local bShow = 0; -t[#t+1] = Def.ActorFrame { - InitCommand=cmd(visible,false); - ToggleConsoleDisplayMessageCommand=function(self) - bShow = 1 - bShow; - self:visible( bShow == 1 ); - end; - -- Grid - LoadActor("_32") .. { - InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/32,SCREEN_HEIGHT/32); - OnCommand=cmd(diffuse,color("0,0,0,0.5")); - }; - LoadActor("_16") .. { - InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/16,SCREEN_HEIGHT/16); - OnCommand=cmd(diffuse,color("1,1,1,0.125")); - }; ---[[ LoadActor("_8") .. { - InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/8,SCREEN_HEIGHT/8); - OnCommand=cmd(diffuse,color("#00BFE833")); - }; --]] - -- Left + Def.Quad { - InitCommand=cmd(horizalign,left;x,SCREEN_LEFT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("0,0,0,0.5")); + InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0.25,0.15,0.25,1")); }; - -- Right - Def.Quad { - InitCommand=cmd(horizalign,right;x,SCREEN_RIGHT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("0,0,0,0.5")); - }; -}; --- -return t \ No newline at end of file +}; \ No newline at end of file diff --git a/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua b/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua index d69d08b791..9d64c662cd 100644 --- a/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua +++ b/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua @@ -2,6 +2,8 @@ -- I prefer to keep these optional, incase another screen wants to hide -- these elements. local t = Def.ActorFrame {}; + t[#t+1] = StandardDecorationFromFileOptional("Header","Header"); t[#t+1] = StandardDecorationFromFileOptional("Footer","Footer"); + return t \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua b/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua index 84e2da8460..13448248c9 100644 --- a/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua +++ b/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua @@ -4,8 +4,10 @@ local t = Def.ActorFrame {}; t[#t+1] = LoadFont("Common Normal") .. { Text=gc:GetText(); + InitCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemInitCommand"); + GainFocusCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemGainFocusCommand"); + LoseFocusCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemGainFocusCommand"); }; -t.GainFocusCommand=cmd(diffusealpha,1); -t.LoseFocusCommand=cmd(diffusealpha,0.5); + return t; \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua b/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua new file mode 100644 index 0000000000..a68467c3ba --- /dev/null +++ b/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua @@ -0,0 +1,3 @@ +return Def.Quad { + InitCommand=cmd(zoomto,SCREEN_WIDTH,32); +}; \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenWithMenuElements header.lua b/Themes/themekit/Graphics/ScreenWithMenuElements header.lua new file mode 100644 index 0000000000..82ac56aec3 --- /dev/null +++ b/Themes/themekit/Graphics/ScreenWithMenuElements header.lua @@ -0,0 +1,3 @@ +return Def.Quad { + InitCommand=cmd(zoomto,SCREEN_WIDTH,48); +}; \ No newline at end of file diff --git a/Themes/themekit/metrics.ini b/Themes/themekit/metrics.ini index ffd154d4d0..0606f0540b 100644 --- a/Themes/themekit/metrics.ini +++ b/Themes/themekit/metrics.ini @@ -1,37 +1,59 @@ [Global] FallbackTheme=_fallback + +[CustomScoring] +ComboAboveThresholdAddsToScoreBonus=0 +ComboScoreBonusThreshold=50 +ComboScoreBonusValue=+1000 + +ComboMultiplier=0.0 + +DoubleNoteScoreMultiplier=2.0 +TripleNoteScoreMultiplier=3.0 +QuadOrHigherNoteScoreMultiplier=4.0 + +PointsW1=+50 +PointsW2=+20 +PointsW3=+10 +PointsW4=+5 +PointsW5=0 +PointsMiss=-5 +PointsHitMine=-5 +PointsCheckpointHit=+5 +PointsCheckpointMiss=-5 +PointsNone=0 +PointsHoldHeld=+5 +PointsHoldLetGo=-5 + [ScreenWithMenuElements] +WaitForChildrenBeforeTweeningOut=true + ShowHeader=true HeaderX=SCREEN_CENTER_X HeaderY=SCREEN_TOP -HeaderOnCommand= +HeaderOnCommand=vertalign,top;diffuse,color("0.5,0.25,0.35,1"); HeaderOffCommand= -# + ShowFooter=true FooterX=SCREEN_CENTER_X FooterY=SCREEN_BOTTOM -FooterOnCommand= +FooterOnCommand=vertalign,bottom;diffuse,color("0.5,0.25,0.35,1"); FooterOffCommand= -# -TimerX=SCREEN_WIDTH-64 -TimerY=SCREEN_TOP+48-4.5 -TimerOnCommand= -TimerOffCommand= -[MenuTimer] -# Text -Text1OnCommand=stopeffect;stoptweening;vertalign,bottom;horizalign,right -Text1FormatFunction=function(fSeconds) \ - return string.format("%0.1f", fSeconds); \ -end -FrameOnCommand= -# Warning -Warning10Command=diffuseshift;effectperiod,1;effectcolor2,Color("Red");effectcolor1,color("0.5,0,0,1"); [ScreenTitleMenu] -ShowHeader=true -ShowFooter=true +ScrollerY=SCREEN_CENTER_Y*1.5 +ScrollerOnCommand= +# New: Load ScrollerItem SpacingX/Y +ScrollerTransform=function(self,offset,itemIndex,numItems) \ + local fSpaceX = THEME:GetMetric( Var "LoadingScreen","ScrollerItemSpacingX"); \ + local fSpaceY = THEME:GetMetric( Var "LoadingScreen","ScrollerItemSpacingY"); \ + self:x( (i-1) * fSpaceX ); \ + self:y( (i-1) * fSpaceY ); \ +end; +# New: Adjust menu items +ScrollerItemSpacingX=0 +ScrollerItemSpacingY=24 +ScrollerItemInitCommand=zoom,1;shadowlength,1 +ScrollerItemGainFocusCommand=finishtweening;linear,0.125;zoom,1.25 +ScrollerItemLoseFocusCommand=finishtweening;linear,0.125;zoom,1 [ScreenSelectMusic] -MusicWheelX=SCREEN_RIGHT-128-18 -MusicWheelOnCommand=draworder,-1 -[MusicWheel] -ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) self:x( (1-math.cos(offsetFromCenter/math.pi))*0 ); self:y( offsetFromCenter*48 ); end -NumWheelItems=13 \ No newline at end of file + diff --git a/Xcode/Info-StepMania.plist b/Xcode/Info-StepMania.plist index 580247540e..bb5906c43a 100644 --- a/Xcode/Info-StepMania.plist +++ b/Xcode/Info-StepMania.plist @@ -1,57 +1,57 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - smzip - - CFBundleTypeIconFile - smicon.icns - CFBundleTypeMIMETypes - - application/zip - - CFBundleTypeName - SMZip - CFBundleTypeRole - Editor - LSTypeIsPackage - - NSPersistentStoreTypeKey - Binary - - - CFBundleExecutable - EXECUTABLE_NAME - CFBundleGetInfoString - PRODUCT_FAMILY_BARE PRODUCT_VER_BARE - CFBundleIconFile - smicon.icns - CFBundleIdentifier - com.PRODUCT_ID_BARE - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - PRODUCT_FAMILY_BARE - CFBundlePackageType - APPL - CFBundleShortVersionString - PRODUCT_VER_BARE - CFBundleSignature - Step - CFBundleVersion - PRODUCT_VER_BARE - LSMinimumSystemVersion - 10.4.10 - NSHumanReadableCopyright - Copyright 2001-2011 - NSPrincipalClass - SMApplication - - + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + smzip + + CFBundleTypeIconFile + smicon.icns + CFBundleTypeMIMETypes + + application/zip + + CFBundleTypeName + SMZip + CFBundleTypeRole + Editor + LSTypeIsPackage + + NSPersistentStoreTypeKey + Binary + + + CFBundleExecutable + EXECUTABLE_NAME + CFBundleGetInfoString + PRODUCT_FAMILY_BARE PRODUCT_VER_BARE + CFBundleIconFile + smicon.icns + CFBundleIdentifier + com.PRODUCT_ID_BARE + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + PRODUCT_FAMILY_BARE + CFBundlePackageType + APPL + CFBundleShortVersionString + PRODUCT_VER_BARE + CFBundleSignature + Step + CFBundleVersion + PRODUCT_VER_BARE + LSMinimumSystemVersion + 10.4.10 + NSHumanReadableCopyright + Copyright 2001-2010 + NSPrincipalClass + SMApplication + + diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 97d4084dcc..a218726db4 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -7099,7 +7099,7 @@ GCC_DYNAMIC_NO_PIC = YES; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_SYMBOL_SEPARATION = NO; - GCC_FAST_MATH = NO; + GCC_FAST_MATH = YES; GCC_FAST_OBJC_DISPATCH = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; @@ -7112,20 +7112,16 @@ 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; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_PROTOTYPE_CONVERSION = YES; - GCC_WARN_SHADOW = YES; + GCC_WARN_SHADOW = NO; 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; @@ -7636,7 +7632,7 @@ GCC_DYNAMIC_NO_PIC = YES; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_SYMBOL_SEPARATION = NO; - GCC_FAST_MATH = NO; + GCC_FAST_MATH = YES; GCC_FAST_OBJC_DISPATCH = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; @@ -7648,20 +7644,16 @@ 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; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_PROTOTYPE_CONVERSION = YES; - GCC_WARN_SHADOW = YES; + GCC_WARN_SHADOW = NO; 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; @@ -7971,7 +7963,7 @@ GCC_DYNAMIC_NO_PIC = YES; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_SYMBOL_SEPARATION = NO; - GCC_FAST_MATH = NO; + GCC_FAST_MATH = YES; GCC_FAST_OBJC_DISPATCH = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; @@ -7983,20 +7975,16 @@ 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; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_PROTOTYPE_CONVERSION = YES; - GCC_WARN_SHADOW = YES; + GCC_WARN_SHADOW = NO; 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; @@ -8100,7 +8088,7 @@ GCC_DYNAMIC_NO_PIC = YES; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_SYMBOL_SEPARATION = NO; - GCC_FAST_MATH = NO; + GCC_FAST_MATH = YES; GCC_FAST_OBJC_DISPATCH = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; @@ -8112,20 +8100,16 @@ 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; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_PROTOTYPE_CONVERSION = YES; - GCC_WARN_SHADOW = YES; + GCC_WARN_SHADOW = NO; 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; diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index 61c9dc0db5..9bd4271627 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -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 = static_cast(floor(pStyle->m_iColsPerPlayer/2.0f)); + const int iMiddleColumn = floor(pStyle->m_iColsPerPlayer/2.0f); if( iColNum > iMiddleColumn-1 ) fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*-(fYOffset); else diff --git a/src/Attack.cpp b/src/Attack.cpp index f15fdb7cae..76eab656bc 100644 --- a/src/Attack.cpp +++ b/src/Attack.cpp @@ -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 lStartSecond = pSong->GetElapsedTimeFromBeat( fStartBeat ); - const float fEndSecond = lStartSecond + fSecsRemaining; + const float fStartSecond = pSong->GetElapsedTimeFromBeat( fStartBeat ); + const float fEndSecond = fStartSecond + fSecsRemaining; fEndBeat = pSong->GetBeatFromElapsedTime( fEndSecond ); fEndBeat = truncf(fEndBeat)+1; diff --git a/src/Attack.h b/src/Attack.h index 30f87589cf..8ce4b7942c 100644 --- a/src/Attack.h +++ b/src/Attack.h @@ -32,10 +32,7 @@ struct Attack bGlobal = false; bShowInAttackList = true; } - Attack(): level(ATTACK_LEVEL_1), fStartSecond(-1), - fSecsRemaining(0), sModifiers(RString()), - bOn(false), bGlobal(false), bShowInAttackList(true) - {} // MakeBlank() is effectively called here. + Attack() { MakeBlank(); } Attack( AttackLevel level_, float fStartSecond_, @@ -43,11 +40,16 @@ 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; diff --git a/src/AutoKeysounds.cpp b/src/AutoKeysounds.cpp index 76d6955598..8a7fed000c 100644 --- a/src/AutoKeysounds.cpp +++ b/src/AutoKeysounds.cpp @@ -80,11 +80,11 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain ) bool bSoundIsGlobal = true; { PlayerNumber pn = GetNextEnabledPlayer((PlayerNumber)-1); - const TapNote &tap = tn[pn]; + const TapNote &t = tn[pn]; pn = GetNextEnabledPlayer(pn); while( pn != PLAYER_INVALID ) { - if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != tap.iKeysoundIndex ) + if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != t.iKeysoundIndex ) bSoundIsGlobal = false; pn = GetNextEnabledPlayer(pn); } diff --git a/src/BGAnimation.cpp b/src/BGAnimation.cpp index eb4fc80c4e..dd93e73a8a 100644 --- a/src/BGAnimation.cpp +++ b/src/BGAnimation.cpp @@ -77,9 +77,9 @@ void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNo else { // import as a single layer - BGAnimationLayer* bgLayer = new BGAnimationLayer; - bgLayer->LoadFromNode( pKey ); - this->AddChild( bgLayer ); + BGAnimationLayer* pLayer = new BGAnimationLayer; + pLayer->LoadFromNode( pKey ); + this->AddChild( pLayer ); } } } diff --git a/src/Background.cpp b/src/Background.cpp index 0c4005c1a7..0d3e398506 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -746,9 +746,9 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus if( !change.m_sTransition.empty() ) { - map::const_iterator lIter = mapNameToTransition.find( change.m_sTransition ); - ASSERT( lIter != mapNameToTransition.end() ); - const BackgroundTransition &bt = lIter->second; + map::const_iterator iter = mapNameToTransition.find( change.m_sTransition ); + ASSERT( iter != mapNameToTransition.end() ); + const BackgroundTransition &bt = iter->second; m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves ); m_pFadingBGA->RunCommands( *bt.cmdRoot ); } diff --git a/src/BeginnerHelper.cpp b/src/BeginnerHelper.cpp index 1154b0b96c..2372cd1ca7 100644 --- a/src/BeginnerHelper.cpp +++ b/src/BeginnerHelper.cpp @@ -250,11 +250,9 @@ 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 ); diff --git a/src/Character.cpp b/src/Character.cpp index 82146c5b69..a925c8b563 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -5,9 +5,10 @@ #include "RageTextureID.h" #include "ActorUtil.h" -Character::Character(): m_sCharDir(""), m_sCharacterID(""), - m_sDisplayName(""), m_sCardPath(""), m_sIconPath(""), - m_bUsableInRave(false), m_iPreloadRefcount(0) {} +Character::Character() +{ + m_iPreloadRefcount = 0; +} bool Character::Load( RString sCharDir ) { diff --git a/src/Course.cpp b/src/Course.cpp index 50c75ec04f..3dbd02ed67 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -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 &mappedSongs = mapSongToSteps[resolved.pSong]; - resolved.pSteps = mappedSongs[ RandomInt(mappedSongs.size()) ]; + const vector &vpSongs = mapSongToSteps[resolved.pSong]; + resolved.pSteps = vpSongs[ RandomInt(vpSongs.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 *lSong = entry.songID.ToSong(); - if( pSong == lSong ) + Song *pSong = entry.songID.ToSong(); + if( pSong == pSong ) return &entry; } diff --git a/src/Course.h b/src/Course.h index 772871ab30..b83b627334 100644 --- a/src/Course.h +++ b/src/Course.h @@ -55,9 +55,18 @@ public: float fGainSeconds; // time gained back at the beginning of the song. LifeMeterTime only. int iGainLives; // lives gained back at the beginning of the next song - CourseEntry(): bSecret(false), bNoDifficult(false), - songSort(SongSort_Randomize), iChooseIndex(0), - sModifiers(RString("")), fGainSeconds(0), iGainLives(-1) {} + CourseEntry() + { + bSecret = false; + bNoDifficult = false; + + songSort = SongSort_Randomize; + iChooseIndex = 0; + + sModifiers = ""; + fGainSeconds = 0; + iGainLives = -1; + } bool IsFixedSong() const { return songID.IsValid(); } diff --git a/src/CourseUtil.cpp b/src/CourseUtil.cpp index 23a74dbe23..38278bc31f 100644 --- a/src/CourseUtil.cpp +++ b/src/CourseUtil.cpp @@ -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 = static_cast(pCourse->m_fGoalSeconds); + PROFILEMAN->GetProfile(ProfileSlot_Player1)->m_iGoalSeconds = pCourse->m_fGoalSeconds; } void EditCourseUtil::GetAllEditCourses( vector &vpCoursesOut ) diff --git a/src/Font.cpp b/src/Font.cpp index d8c7d142eb..ca95e58605 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -311,15 +311,15 @@ const glyph &Font::GetGlyph( wchar_t c ) const bool Font::FontCompleteForString( const wstring &str ) const { - map::const_iterator mapDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); - if( mapDefault == m_iCharToGlyph.end() ) + map::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); + if( m_pDefault == 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 == mapDefault->second ) + if( &g == m_pDefault->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 fPath = THEME->GetPathF( "", ImportList[i], true ); - if( fPath == "" ) + RString path = THEME->GetPathF( "", ImportList[i], true ); + if( path == "" ) { 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(fPath,""); + subfont.Load(path,""); MergeFont(subfont); //FONT->UnloadFont(subfont); } diff --git a/src/Foreground.cpp b/src/Foreground.cpp index 4e75cd0b79..84caac9025 100644 --- a/src/Foreground.cpp +++ b/src/Foreground.cpp @@ -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 lDeltaTime; + float fDeltaTime; if( !bga.m_bga->GetVisible() ) { bga.m_bga->SetVisible( true ); const float fStartSecond = m_pSong->m_Timing.GetElapsedTimeFromBeat( bga.m_fStartBeat ); - lDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond; + fDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond; } else { - lDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; + fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; } // This shouldn't go down, but be safe: - lDeltaTime = max( lDeltaTime, 0 ); + fDeltaTime = max( fDeltaTime, 0 ); - bga.m_bga->Update( lDeltaTime / fRate ); + bga.m_bga->Update( fDeltaTime / fRate ); if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat ) { diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index 43783b8b41..4083307c14 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -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( human ) - if( GAMESTATE->m_PreferredDifficulty[human] != m_dc ) + FOREACH_HumanPlayer( pn ) + if( GAMESTATE->m_PreferredDifficulty[pn] != m_dc ) return false; } diff --git a/src/GameState.cpp b/src/GameState.cpp index 72fb165a55..989e31c234 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -2361,9 +2361,9 @@ public: return 1; } - static int GetCurrentStepsCredits( T* t, lua_State *L ) + static int GetCurrentStepsCredits( T* p, lua_State *L ) { - const Song* pSong = t->m_pCurSong; + const Song* pSong = p->m_pCurSong; if( pSong == NULL ) return 0; diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index d1a40a3d76..34c82c783e 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -1093,12 +1093,12 @@ void InputMappings::ReadMappings( const InputScheme *pInputScheme, RString sFile vector sDeviceInputStrings; split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false ); - for( unsigned j=0; jsecond.type == TapNote::hold_head ) { - int localStartRow = prev->first; + int iStartRow = prev->first; const TapNote &tn = prev->second; - if( localStartRow + tn.iDuration >= iEndRow ) + if( iStartRow + tn.iDuration >= iEndRow ) end = prev; } } diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index f557955492..aa2a9df622 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -250,8 +250,8 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS for( int t=0; tsecond; @@ -629,9 +629,12 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ) int iMaxTailRow = -1; for( int t=0; tm_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin; + RString 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 q = begin->first; - const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, q); + int i = begin->first; + const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, i); // Switch modified by Wolfman2000, tested by Saturn2888 // Fixes hold head overlapping issue, but not the rolls. @@ -1031,11 +1031,10 @@ 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(q), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) ) + if( !IsOnScreen( NoteRowToBeat(i), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) ) continue; // skip - ASSERT_M( NoteRowToBeat(q) > -2000, ssprintf("%i %i %i, %f %f", q, iLastRowToDraw, - iFirstRowToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) ); + ASSERT_M( NoteRowToBeat(i) > -2000, ssprintf("%i %i %i, %f %f", i, 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. @@ -1044,7 +1043,7 @@ void NoteField::DrawPrimitives() { for( int c2=0; c2GetNumTracks(); c2++ ) { - if( m_pNoteData->GetTapNote(c2, q).type == TapNote::hold_head) + if( m_pNoteData->GetTapNote(c2, i).type == TapNote::hold_head) { bHoldNoteBeginsOnThisBeat = true; break; @@ -1054,18 +1053,15 @@ void NoteField::DrawPrimitives() bool bIsInSelectionRange = false; if( m_iBeginMarker!=-1 && m_iEndMarker!=-1 ) - bIsInSelectionRange = m_iBeginMarker<=q && qdisplay[c].DrawTap( tn, c, NoteRowToBeat(q), bHoldNoteBeginsOnThisBeat, - bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, - m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels, - FADE_BEFORE_TARGETS_PERCENT ); + displayCols->display[c].DrawTap( tn, c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels, FADE_BEFORE_TARGETS_PERCENT ); - bool bNoteIsUpcoming = NoteRowToBeat(q) > GAMESTATE->m_fSongBeat; + bool bNoteIsUpcoming = NoteRowToBeat(i) > GAMESTATE->m_fSongBeat; bAnyUpcomingInThisCol |= bNoteIsUpcoming; } diff --git a/src/NoteSkinManager.cpp b/src/NoteSkinManager.cpp index 0ec178b3ab..4607d43529 100644 --- a/src/NoteSkinManager.cpp +++ b/src/NoteSkinManager.cpp @@ -282,22 +282,22 @@ try_again: const NoteSkinData &data = iter->second; RString sPath; // fill this in below - FOREACH_CONST( RString, data.vsDirSearchOrder, lIter ) + FOREACH_CONST( RString, data.vsDirSearchOrder, iter ) { if( sButtonName.empty() ) - sPath = GetPathFromDirAndFile( *lIter, sElement ); + sPath = GetPathFromDirAndFile( *iter, sElement ); else - sPath = GetPathFromDirAndFile( *lIter, sButtonName+" "+sElement ); + sPath = GetPathFromDirAndFile( *iter, sButtonName+" "+sElement ); if( !sPath.empty() ) break; // done searching } if( sPath.empty() ) { - FOREACH_CONST( RString, data.vsDirSearchOrder, lIter ) + FOREACH_CONST( RString, data.vsDirSearchOrder, iter ) { if( !sButtonName.empty() ) - sPath = GetPathFromDirAndFile( *lIter, "Fallback "+sElement ); + sPath = GetPathFromDirAndFile( *iter, "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, lIter ) + FOREACH_CONST( RString, data.vsDirSearchOrder, iter ) { - sRealPath = GetPathFromDirAndFile( *lIter, sNewFileName ); + sRealPath = GetPathFromDirAndFile( *iter, sNewFileName ); if( !sRealPath.empty() ) break; // done searching } diff --git a/src/NoteTypes.h b/src/NoteTypes.h index 4c23f1576f..9bee6d5b54 100644 --- a/src/NoteTypes.h +++ b/src/NoteTypes.h @@ -204,29 +204,6 @@ extern TapNote TAP_ORIGINAL_FAKE; // 'F' extern TapNote TAP_ADDITION_TAP; extern TapNote TAP_ADDITION_MINE; -/** - * @brief Retrieve the string representing the TapNote Type. - * - * TODO: Find a way to standardize this with the other enum string calls. - * @param tn the TapNote's type. - * @return the intended string. */ -inline const RString TapNoteTypeToString( TapNote::Type tn ) -{ - switch( tn ) - { - case TapNote::empty: return RString("empty"); - case TapNote::tap: return RString("tap"); - case TapNote::hold_head: return RString("hold_head"); - case TapNote::hold_tail: return RString("hold_tail"); - case TapNote::mine: return RString("mine"); - case TapNote::lift: return RString("lift"); - case TapNote::attack: return RString("attack"); - case TapNote::autoKeysound: return RString("autoKeysound"); - case TapNote::fake: return RString("fake"); - default: return RString(); - } -} - /** * @brief The number of tracks allowed. * diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index 4832fa78da..acd4dabf37 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -476,9 +476,9 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo if( sNoteId != "00" ) { vTapNotes.push_back( TAP_ORIGINAL_TAP ); - map::const_iterator rInt = idToKeySoundIndex.find( sNoteId ); - if( rInt != idToKeySoundIndex.end() ) - vTapNotes.back().iKeysoundIndex = rInt->second; + map::const_iterator it = idToKeySoundIndex.find( sNoteId ); + if( it != idToKeySoundIndex.end() ) + vTapNotes.back().iKeysoundIndex = it->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 nData = it->second; + RString sData = 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()+nData) ) + if( !IsAFile(out.GetSongDir()+sData) ) { const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere for( unsigned i = 0; exts[i] != NULL; ++i ) { - RString fn = SetExtension( nData, exts[i] ); + RString fn = SetExtension( sData, exts[i] ); if( IsAFile(out.GetSongDir()+fn) ) { - nData = fn; + sData = fn; break; } } } - if( !IsAFile(out.GetSongDir()+nData) ) - LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() ); + if( !IsAFile(out.GetSongDir()+sData) ) + LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.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 nData = it->second; - int totalPairs = nData.size() / 2; + RString sData = it->second; + int totalPairs = sData.size() / 2; for( int i = 0; i < totalPairs; ++i ) { - RString sPair = nData.substr( i*2, 2 ); + RString sPair = sData.substr( i*2, 2 ); int iVal = 0; if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 ) diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index fb8dfbe298..96f5375e1e 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -750,9 +750,9 @@ static bool LoadFromMidi( const RString &sPath, Song &songOut ) if( uVelocity == 0 ) midiEventType = note_off; - MidiEvent mEvent = { count, midiEventType }; + MidiEvent event = { count, midiEventType }; //float fBeat = NoteRowToBeat( MidiCountToNoteRow(count) ); - vMidiEvent[uNoteNumber].push_back( mEvent ); + vMidiEvent[uNoteNumber].push_back( event ); } 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 lIter = begin; lIter != end; lIter++ ) + for( NoteData::TrackMap::iterator iter = begin; iter != end; iter++ ) { // if( gd == expert && fBeat >= 27*4-2 && nnt == green ) // LOG->Trace( "shortening hold at %f, length %d", fBeat, length ); - ASSERT( lIter->second.type == TapNote::hold_head ); - lIter->second.iDuration = MidiCountToNoteRow(count) - lIter->first - 2; + ASSERT( iter->second.type == TapNote::hold_head ); + iter->second.iDuration = MidiCountToNoteRow(count) - iter->first - 2; } noteData.SetTapNote( nnt, MidiCountToNoteRow(count), tn ); diff --git a/src/NotesLoaderPMS.cpp b/src/NotesLoaderPMS.cpp index 32555f71d0..1b9f7a68d6 100644 --- a/src/NotesLoaderPMS.cpp +++ b/src/NotesLoaderPMS.cpp @@ -408,9 +408,9 @@ static bool LoadFromPMSFile( const RString &sPath, const NameToData_t &mapNameTo if( sNoteId != "00" ) { vTapNotes.push_back( TAP_ORIGINAL_TAP ); - map::const_iterator rInt = idToKeySoundIndex.find( sNoteId ); - if( rInt != idToKeySoundIndex.end() ) - vTapNotes.back().iKeysoundIndex = rInt->second; + map::const_iterator it = idToKeySoundIndex.find( sNoteId ); + if( it != idToKeySoundIndex.end() ) + vTapNotes.back().iKeysoundIndex = it->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 nData = it->second; + RString sData = 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()+nData) ) + if( !IsAFile(out.GetSongDir()+sData) ) { const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere for( unsigned i = 0; exts[i] != NULL; ++i ) { - RString fn = SetExtension( nData, exts[i] ); + RString fn = SetExtension( sData, exts[i] ); if( IsAFile(out.GetSongDir()+fn) ) { - nData = fn; + sData = fn; break; } } } - if( !IsAFile(out.GetSongDir()+nData) ) - LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() ); + if( !IsAFile(out.GetSongDir()+sData) ) + LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() ); sWavID.MakeUpper(); // HACK: undo the MakeLower() - out.m_vsKeysoundFile.push_back( nData ); + out.m_vsKeysoundFile.push_back( sData ); 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 nData = it->second; - int totalPairs = nData.size() / 2; + RString sData = it->second; + int totalPairs = sData.size() / 2; for( int i = 0; i < totalPairs; ++i ) { - RString sPair = nData.substr( i*2, 2 ); + RString sPair = sData.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( nData, "%x", &iBPMNo ); // data is in hexadecimal + sscanf( sData, "%x", &iBPMNo ); // data is in hexadecimal RString sBPM; RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo ); diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index c2aa663825..9b3b3e9ff8 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -37,7 +37,6 @@ void SMLoader::LoadFromSMTokens( // insert stepstype hacks from GameManager.cpp here? -aj out.m_StepsType = GAMEMAN->StringToStepsType( sStepsType ); out.SetDescription( sDescription ); - out.SetCredit( sDescription ); // this is often used for both. out.SetDifficulty( DwiCompatibleStringToDifficulty(sDifficulty) ); // Handle hacks that originated back when StepMania didn't have @@ -414,9 +413,9 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) if(arrayWarpsFromNegativeBPMs.size() > 0) { // zomg we already have some warps... - for( unsigned j=0; j USE_CREDIT ( "NotesWriterSM", "DescriptionUsesCreditField" ); /** * @brief Turn the BackgroundChange into a string. @@ -271,8 +268,7 @@ static RString GetSMNotesTag( const Song &song, const Steps &in ) GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName, SmEscape(in.GetDescription()).c_str()) ); lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" ); lines.push_back( ssprintf( " %s:", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) ); - RString desc = (USE_CREDIT ? in.GetCredit() : in.GetDescription()); - lines.push_back( ssprintf( " %s:", SmEscape(desc).c_str() ) ); + lines.push_back( ssprintf( " %s:", SmEscape(in.GetDescription()).c_str() ) ); lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); diff --git a/src/OptionRow.cpp b/src/OptionRow.cpp index dc72b34e47..f6d699af8a 100644 --- a/src/OptionRow.cpp +++ b/src/OptionRow.cpp @@ -603,7 +603,7 @@ void OptionRow::UpdateEnabledDisabled() case LAYOUT_SHOW_ONE_IN_ROW: FOREACH_HumanPlayer( pn ) { - bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end(); + bool bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end(); if( !m_pHand->m_Def.m_bOneChoiceForAllPlayers ) { diff --git a/src/OptionRowHandler.cpp b/src/OptionRowHandler.cpp index 8010b10d3a..2962f963c3 100644 --- a/src/OptionRowHandler.cpp +++ b/src/OptionRowHandler.cpp @@ -149,15 +149,15 @@ public: { // Parse the basic configuration metric. - Commands lCmds = ParseCommands( ENTRY(sParam) ); - if( lCmds.v.size() < 1 ) + Commands cmds = ParseCommands( ENTRY(sParam) ); + if( cmds.v.size() < 1 ) RageException::Throw( "Parse error in \"ScreenOptionsMaster::%s\".", sParam.c_str() ); m_Def.m_bOneChoiceForAllPlayers = false; - const int NumCols = atoi( lCmds.v[0].m_vsArgs[0] ); - for( unsigned i=1; i(m_sprLeft->GetX()); - m_iOriginalRightX = static_cast(m_sprRight->GetX()); + m_iOriginalLeftX = m_sprLeft->GetX(); + m_iOriginalRightX = m_sprRight->GetX(); if( bLoadCanGos ) { - m_iOriginalCanGoLeftX = static_cast(m_sprCanGoLeft->GetX()); - m_iOriginalCanGoRightX = static_cast(m_sprCanGoRight->GetX()); + m_iOriginalCanGoLeftX = m_sprCanGoLeft->GetX(); + m_iOriginalCanGoRightX = m_sprCanGoRight->GetX(); } SetCanGo( false, false ); diff --git a/src/OptionsList.cpp b/src/OptionsList.cpp index 791729e492..1a09c1378e 100644 --- a/src/OptionsList.cpp +++ b/src/OptionsList.cpp @@ -138,17 +138,17 @@ void OptionListRow::SetUnderlines( const vector &aSelections, const Option if( pTarget->m_Def.m_selectType == SELECT_ONE ) { int iSelection = m_pOptions->GetOneSelection(sDest); - const OptionRowHandler *lHandler = m_pOptions->m_Rows.find(sDest)->second; - int iDefault = lHandler->GetDefaultOption(); + const OptionRowHandler *pHandler = m_pOptions->m_Rows.find(sDest)->second; + int iDefault = pHandler->GetDefaultOption(); if( iDefault != -1 && iSelection != iDefault ) bSelected |= true; } else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE ) { const vector &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second; - for( unsigned j=0; jBroadcast( lMsg ); + Message msg("OptionsListQuickChange"); + msg.SetParam( "Player", pn ); + msg.SetParam( "Direction", iDir ); + MESSAGEMAN->Broadcast( msg ); } } 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 lMsg("OptionsListLeft"); - lMsg.SetParam( "Player", input.pn ); - MESSAGEMAN->Broadcast( lMsg ); + Message msg("OptionsListLeft"); + msg.SetParam( "Player", input.pn ); + MESSAGEMAN->Broadcast( msg ); 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 lMsg("OptionsListRight"); - lMsg.SetParam( "Player", input.pn ); - MESSAGEMAN->Broadcast( lMsg ); + Message msg("OptionsListRight"); + msg.SetParam( "Player", input.pn ); + MESSAGEMAN->Broadcast( msg ); return; } else if( input.MenuI == GAME_BUTTON_START ) diff --git a/src/Player.cpp b/src/Player.cpp index 6b90b9468e..cc2d2fafa2 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -175,15 +175,8 @@ ThemeMetric REQUIRE_STEP_ON_MINES ( "Player", "RequireStepOnMines" ); * For those wishing to make a theme very accurate to In The Groove 2, set this to false. */ ThemeMetric ROLL_BODY_INCREMENTS_COMBO ( "Player", "RollBodyIncrementsCombo" ); ThemeMetric CHECKPOINTS_TAPS_SEPARATE_JUDGMENT ( "Player", "CheckpointsTapsSeparateJudgment" ); -/** - * @brief Do we score missed holds and rolls with HoldNoteScores? - * - * If set to true, missed holds and rolls are given LetGo judgments. - * If set to false, missed holds and rolls are given no judgment on the hold side of things. */ -ThemeMetric SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" ); -/** @brief How much of the song/course must have gone by before a Player's combo is colored? */ +ThemeMetric SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" ); // sm-ssc addition ThemeMetric PERCENT_UNTIL_COLOR_COMBO ( "Player", "PercentUntilColorCombo" ); -/** @brief How much combo must be earned before the announcer says "Combo Stopped"? */ ThemeMetric COMBO_STOPPED_AT ( "Player", "ComboStoppedAt" ); ThemeMetric ATTACK_RUN_TIME_RANDOM ( "Player", "AttackRunTimeRandom" ); ThemeMetric ATTACK_RUN_TIME_MINE ( "Player", "AttackRunTimeMine" ); @@ -2817,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 nIter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true ); - for( ; !nIter.IsAtEnd(); ++nIter ) + NoteData::all_tracks_iterator iter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true ); + for( ; !iter.IsAtEnd(); ++iter ) { - TapNote &tn = *nIter; + TapNote &tn = *iter; if( tn.type != TapNote::hold_head ) continue; - int iStartRow = nIter.Row(); + int iStartRow = iter.Row(); int iEndRow = iStartRow + tn.iDuration; - int iTrack = nIter.Track(); + int iTrack = iter.Track(); // "the first row after the hold head that lands on a beat" int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; @@ -3200,7 +3193,7 @@ void Player::SetCombo( int iCombo, int iMisses ) if( GAMESTATE->IsCourseMode() ) { int iSongIndexStartColoring = GAMESTATE->m_pCurCourse->GetEstimatedNumStages(); - iSongIndexStartColoring = static_cast(floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO)); + iSongIndexStartColoring = floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO); bPastBeginning = GAMESTATE->GetCourseSongIndex() >= iSongIndexStartColoring; } else diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index 76a1b30650..62a4dab610 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -12,6 +12,8 @@ #include "CommonMetrics.h" #include +#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; } + ThemeMetric RANDOM_SPEED_CHANCE ( "PlayerOptions", "RandomSpeedChance" ); ThemeMetric RANDOM_REVERSE_CHANCE ( "PlayerOptions", "RandomReverseChance" ); ThemeMetric RANDOM_DARK_CHANCE ( "PlayerOptions", "RandomDarkChance" ); diff --git a/src/PlayerOptions.h b/src/PlayerOptions.h index aeb1c49b08..e18095b008 100644 --- a/src/PlayerOptions.h +++ b/src/PlayerOptions.h @@ -7,42 +7,13 @@ class Steps; class Trail; struct lua_State; -#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; } - #include "GameConstantsAndTypes.h" #include "PlayerNumber.h" /** @brief Per-player options that are not saved between sessions. */ class PlayerOptions { public: - /** - * @brief Set up the PlayerOptions with some reasonable defaults. - * - * This code was taken from Init() to use proper initialization. */ - PlayerOptions(): m_bSetScrollSpeed(false), - m_fTimeSpacing(0), m_SpeedfTimeSpacing(1.0f), - m_fScrollSpeed(1.0f), m_SpeedfScrollSpeed(1.0f), - m_fScrollBPM(200), m_SpeedfScrollBPM(1.0f), - m_fDark(0), m_SpeedfDark(1.0f), - m_fBlind(0), m_SpeedfBlind(1.0f), - m_fCover(0), m_SpeedfCover(1.0f), - m_fRandAttack(0), m_SpeedfRandAttack(1.0f), - m_fSongAttack(0), m_SpeedfSongAttack(1.0f), - m_fPlayerAutoPlay(0), m_SpeedfPlayerAutoPlay(1.0f), - m_bSetTiltOrSkew(false), - m_fPerspectiveTilt(0), m_SpeedfPerspectiveTilt(1.0f), - m_fSkew(0), m_SpeedfSkew(1.0f), - m_fPassmark(0), m_SpeedfPassmark(1.0f), - m_fRandomSpeed(0), m_SpeedfRandomSpeed(1.0f), - m_bMuteOnError(false), m_FailType(FAIL_IMMEDIATE), - m_ScoreDisplay(SCORING_ADD), m_sNoteSkin("") - { - ZERO( m_fAccels ); ONE( m_SpeedfAccels ); - ZERO( m_fEffects ); ONE( m_SpeedfEffects ); - ZERO( m_fAppearances ); ONE( m_SpeedfAppearances ); - ZERO( m_fScrolls ); ONE( m_SpeedfScrolls ); - ZERO( m_bTurns ); ZERO( m_bTransforms ); - }; + PlayerOptions() { Init(); }; void Init(); void Approach( const PlayerOptions& other, float fDeltaSeconds ); RString GetString( bool bForceNoteSkin = false ) const; diff --git a/src/Profile.cpp b/src/Profile.cpp index 4c12baf2f7..b3d48827d6 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -363,8 +363,8 @@ float Profile::GetSongsActual( StepsType st, Difficulty dc ) const FOREACHM_CONST( StepsID, HighScoresForASteps, hsfas.m_StepsHighScores, j ) { - const StepsID &sid = j->first; - Steps* pSteps = sid.ToSteps( pSong, true ); + const StepsID &id = j->first; + Steps* pSteps = id.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", sid.ToString().c_str(), pSteps) ); + CHECKPOINT_M( ssprintf("Profile::GetSongsActual: n %s = %p", id.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 sID; - sID.LoadFromNode( style ); + StyleID s; + s.LoadFromNode( style ); - if( !sID.IsValid() ) + if( !s.IsValid() ) WARN_AND_CONTINUE; - style->GetTextValue( m_iNumSongsPlayedByStyle[sID] ); + style->GetTextValue( m_iNumSongsPlayedByStyle[s] ); } } } diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 2418821c60..81f1f40ff9 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -489,10 +489,10 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID ) g_vLocalProfile.erase( i ); // Delete all references to this profileID - FOREACH_CONST( Preference*, m_sDefaultLocalProfileID.m_v, j ) + FOREACH_CONST( Preference*, m_sDefaultLocalProfileID.m_v, i ) { - if( (*j)->Get() == sProfileID ) - (*j)->Set( "" ); + if( (*i)->Get() == sProfileID ) + (*i)->Set( "" ); } return true; } diff --git a/src/RageDisplay.cpp b/src/RageDisplay.cpp index a3ba6bd2c8..c027ebddb6 100644 --- a/src/RageDisplay.cpp +++ b/src/RageDisplay.cpp @@ -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 = static_cast(ceilf( iHeight * GetActualVideoModeParams().fDisplayAspectRatio )); + int iWidth = 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() ); diff --git a/src/RageDisplay.h b/src/RageDisplay.h index 6ff505ffd9..efb47d9687 100644 --- a/src/RageDisplay.h +++ b/src/RageDisplay.h @@ -71,7 +71,6 @@ enum PixelFormat }; const RString& PixelFormatToString( PixelFormat i ); -/** @brief The parameters used for the present Video Mode. */ class VideoModeParams { public: @@ -92,27 +91,24 @@ public: RString sIconFile_, bool PAL_, float fDisplayAspectRatio_ - ): - windowed(windowed_), - width(width_), - height(height_), - bpp(bpp_), - rate(rate_), - vsync(vsync_), - interlaced(interlaced_), - bSmoothLines(bSmoothLines_), - bTrilinearFiltering(bTrilinearFiltering_), - bAnisotropicFiltering(bAnisotropicFiltering_), - sWindowTitle(sWindowTitle_), - sIconFile(sIconFile_), - PAL(PAL_), - fDisplayAspectRatio(fDisplayAspectRatio_) {} - - VideoModeParams(): windowed(false), width(0), height(0), - bpp(0), rate(0), vsync(false), interlaced(false), - bSmoothLines(false), bTrilinearFiltering(false), - bAnisotropicFiltering(false), sWindowTitle(RString()), - sIconFile(RString()), PAL(false), fDisplayAspectRatio(0.0) {} + ) + { + windowed = windowed_; + width = width_; + height = height_; + bpp = bpp_; + rate = rate_; + vsync = vsync_; + interlaced = interlaced_; + bSmoothLines = bSmoothLines_; + bTrilinearFiltering = bTrilinearFiltering_; + bAnisotropicFiltering = bAnisotropicFiltering_; + sWindowTitle = sWindowTitle_; + sIconFile = sIconFile_; + PAL = PAL_; + fDisplayAspectRatio = fDisplayAspectRatio_; + } + VideoModeParams() {} bool windowed; int width; @@ -120,14 +116,14 @@ public: int bpp; int rate; bool vsync; - bool interlaced; bool bSmoothLines; bool bTrilinearFiltering; bool bAnisotropicFiltering; - RString sWindowTitle; - RString sIconFile; + bool interlaced; bool PAL; float fDisplayAspectRatio; + RString sWindowTitle; + RString sIconFile; }; struct RenderTargetParam diff --git a/src/RageFile.h b/src/RageFile.h index 0db14ca949..700f4de36f 100644 --- a/src/RageFile.h +++ b/src/RageFile.h @@ -6,11 +6,8 @@ #include "RageFileBasic.h" struct lua_State; -/** - * @brief High-level file access. - * - * This is the high-level interface, which interfaces with RageFileObj - * implementations and RageFileManager. */ +/* This is the high-level interface, which interfaces with RageFileObj implementations + * and RageFileManager. */ class RageFile: public RageFileBasic { public: @@ -84,9 +81,6 @@ private: RString m_Path; RString m_sError; int m_Mode; - - // Swallow up warnings. If they must be used, define them. - RageFile& operator=(const RageFile& rhs); }; /** @brief Convenience wrappers for reading binary files. */ diff --git a/src/RageFileBasic.h b/src/RageFileBasic.h index dfefaec812..8e42cb7c01 100644 --- a/src/RageFileBasic.h +++ b/src/RageFileBasic.h @@ -152,9 +152,6 @@ private: * file, and no seeking is performed. */ bool m_bCRC32Enabled; uint32_t m_iCRC32; - - // Swallow up warnings. If they must be used, define them. - RageFileObj& operator=(const RageFileObj& rhs); }; #endif diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index 8be422efac..b0107a1997 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -245,14 +245,14 @@ int RageFileObjDeflate::WriteInternal( const void *pBuffer, size_t iBytes ) if( m_pDeflate->avail_out < sizeof(buf) ) { - int lBytes = sizeof(buf)-m_pDeflate->avail_out; - int iRet = m_pFile->Write( buf, lBytes ); + int iBytes = sizeof(buf)-m_pDeflate->avail_out; + int iRet = m_pFile->Write( buf, iBytes ); if( iRet == -1 ) { SetError( m_pFile->GetError() ); return -1; } - if( iRet < lBytes ) + if( iRet < iBytes ) { SetError( "Partial write" ); return -1; diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index fde2f79bdf..f1fad415d4 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -377,8 +377,8 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector &Add for( unsigned j = OldStart; j < AddTo.size(); ++j ) { /* Skip the trailing slash on the mountpoint; there's already a slash there. */ - RString &lPath = AddTo[j]; - lPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 ); + RString &sPath = AddTo[j]; + sPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 ); } } } diff --git a/src/RageInputDevice.h b/src/RageInputDevice.h index 84230edd81..d27e76134b 100644 --- a/src/RageInputDevice.h +++ b/src/RageInputDevice.h @@ -60,9 +60,12 @@ inline bool IsMouse( InputDevice id ) { return id == DEVICE_MOUSE; } struct InputDeviceInfo { - InputDeviceInfo( InputDevice id_, RString sDesc_ ): - id(id_), sDesc(sDesc_) {} - + InputDeviceInfo( InputDevice id_, RString sDesc_ ) + { + id = id_; + sDesc = sDesc_; + } + InputDevice id; RString sDesc; @@ -314,22 +317,22 @@ public: * (0..1). This should be 0 for analog axes within the dead zone. */ float level; + /* Whether this button is pressed. This is level with a threshold and + * debouncing applied. */ + bool bDown; + // Mouse coordinates unsigned x; unsigned y; - /* Whether this button is pressed. This is level with a threshold and - * debouncing applied. */ - bool bDown; - RageTimer ts; - DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), x(0), y(0), bDown(false), ts(RageZeroTimer) { } - DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), x(0), y(0), bDown(l > 0.5f), ts(RageZeroTimer) { } + DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), bDown(false), ts(RageZeroTimer) { } + DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), bDown(l > 0.5f), ts(RageZeroTimer) { } DeviceInput( InputDevice d, DeviceButton b, float l, const RageTimer &t ): - device(d), button(b), level(l), x(0), y(0), bDown(level > 0.5f), ts(t) { } + device(d), button(b), level(l), bDown(level > 0.5f), ts(t) { } DeviceInput( InputDevice d, DeviceButton b, const RageTimer &t, unsigned xPos=0, unsigned yPos=0 ): - device(d), button(b), level(0), x(xPos), y(yPos), bDown(false), ts(t) { } + device(d), button(b), x(xPos), y(yPos), bDown(false), ts(t) { } bool operator==( const DeviceInput &other ) const { diff --git a/src/RageLog.cpp b/src/RageLog.cpp index 4cedc14c11..700f66c79a 100644 --- a/src/RageLog.cpp +++ b/src/RageLog.cpp @@ -78,14 +78,19 @@ enum WRITE_LOUD = 0x04 }; -RageLog::RageLog(): m_bLogToDisk(false), m_bInfoToDisk(false), -m_bUserLogToDisk(false), m_bFlush(false), m_bShowLogOutput(false) +RageLog::RageLog() { g_fileLog = new RageFile; g_fileInfo = new RageFile; g_fileUserLog = new RageFile; g_Mutex = new RageMutex( "Log" ); + + m_bLogToDisk = false; + m_bInfoToDisk = false; + m_bUserLogToDisk = false; + m_bFlush = false; + m_bShowLogOutput = false; } RageLog::~RageLog() diff --git a/src/RageMath.cpp b/src/RageMath.cpp index 317e8fe50a..cdeeced8d0 100644 --- a/src/RageMath.cpp +++ b/src/RageMath.cpp @@ -575,8 +575,8 @@ float RageFastSin( float x ) bInited = true; for( unsigned i=0; iGetSampleRate() RageSoundParams::RageSoundParams(): - m_StartSecond(0), m_LengthSeconds(-1), m_fFadeInSeconds(0), - m_fFadeOutSeconds(0), m_Volume(1.0f), m_fAttractVolume(1.0f), - m_fPitch(1.0f), m_fSpeed(1.0f), m_StartTime( RageZeroTimer ), - StopMode(M_AUTO), m_bIsCriticalSound(false) {} + m_StartTime( RageZeroTimer ) +{ + m_StartSecond = 0; + m_LengthSeconds = -1; + m_fFadeInSeconds = 0; + m_fFadeOutSeconds = 0; + m_Volume = 1.0f; + m_fAttractVolume = 1.0f; + m_fPitch = 1.0f; + m_fSpeed = 1.0f; + StopMode = M_AUTO; + m_bIsCriticalSound = false; +} -RageSoundLoadParams::RageSoundLoadParams(): - m_bSupportRateChanging(false), m_bSupportPan(false) {} +RageSoundLoadParams::RageSoundLoadParams() +{ + m_bSupportRateChanging = false; + m_bSupportPan = false; +} RageSound::RageSound(): - m_Mutex( "RageSound" ), m_pSource(NULL), m_iStreamFrame(0), - m_iStoppedSourceFrame(0), m_bPlaying(false), - m_bDeleteWhenFinished(false) + m_Mutex( "RageSound" ) { ASSERT( SOUNDMAN ); + + m_pSource = NULL; + m_iStreamFrame = 0; + m_iStoppedSourceFrame = 0; + m_bPlaying = false; + m_bDeleteWhenFinished = false; } RageSound::~RageSound() diff --git a/src/RageSound.h b/src/RageSound.h index 69cbe49a12..71b6662a6f 100644 --- a/src/RageSound.h +++ b/src/RageSound.h @@ -22,10 +22,7 @@ public: virtual RString GetLoadedFilePath() const = 0; }; -/** - * @brief The parameters to play a sound. - * - * These are normally changed before playing begins, +/* These are parameters to play a sound. These are normally changed before playing begins, * and are constant from then on. */ struct RageSoundParams { @@ -53,13 +50,17 @@ struct RageSoundParams * If zero, or if not supported, the sound will start immediately. */ RageTimer m_StartTime; - /** @brief How does the sound stop itself, if it does? */ + /* M_STOP stops the sound at the end. + * M_LOOP restarts. + * M_CONTINUE feeds silence, which is useful to continue timing longer than the actual sound. + * M_AUTO (default) stops, obeying filename hints. + */ enum StopMode_t { - M_STOP, /**< The sound is stopped at the end. */ - M_LOOP, /**< The sound restarts itself. */ - M_CONTINUE, /**< Silence is fed at the end to continue timing longer than the sound. */ - M_AUTO /**< The default, the sound stops while obeying filename hints. */ - } /** @brief How does the sound stop itself, if it does? */ StopMode; + M_STOP, + M_LOOP, + M_CONTINUE, + M_AUTO + } StopMode; bool m_bIsCriticalSound; // "is a sound that should be played even during attract" }; diff --git a/src/RageSoundManager.cpp b/src/RageSoundManager.cpp index 77034bd1e0..a389f9d641 100644 --- a/src/RageSoundManager.cpp +++ b/src/RageSoundManager.cpp @@ -35,8 +35,11 @@ static Preference g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAU RageSoundManager *SOUNDMAN = NULL; -RageSoundManager::RageSoundManager(): m_pDriver(NULL), m_fMixVolume(1.0f), - m_fVolumeOfNonCriticalSounds(1.0f) {} +RageSoundManager::RageSoundManager() +{ + m_fMixVolume = 1.0f; + m_fVolumeOfNonCriticalSounds = 1.0f; +} static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" ); void RageSoundManager::Init() diff --git a/src/RageSoundManager.h b/src/RageSoundManager.h index e558eb32d2..37525356ab 100644 --- a/src/RageSoundManager.h +++ b/src/RageSoundManager.h @@ -53,9 +53,6 @@ private: /* Prefs: */ float m_fMixVolume; float m_fVolumeOfNonCriticalSounds; - // Swallow up warnings. If they must be used, define them. - RageSoundManager& operator=(const RageSoundManager& rhs); - RageSoundManager(const RageSoundManager& rhs); }; extern RageSoundManager *SOUNDMAN; diff --git a/src/RageSoundReader_Chain.cpp b/src/RageSoundReader_Chain.cpp index 6b3a1b9ae2..29a73c0feb 100644 --- a/src/RageSoundReader_Chain.cpp +++ b/src/RageSoundReader_Chain.cpp @@ -33,6 +33,7 @@ RageSoundReader_Chain::~RageSoundReader_Chain() while( !m_apActiveSounds.empty() ) ReleaseSound( m_apActiveSounds.front() ); + map::iterator it; FOREACH( RageSoundReader *, m_apLoadedSounds, it ) delete *it; } @@ -102,6 +103,7 @@ int RageSoundReader_Chain::GetSampleRateInternal() const if( m_apLoadedSounds.empty() ) return m_iPreferredSampleRate; + map::const_iterator it; int iRate = -1; FOREACH_CONST( RageSoundReader *, m_apLoadedSounds, it ) { @@ -118,6 +120,7 @@ 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::iterator it; FOREACH( RageSoundReader *, m_apLoadedSounds, it ) m_iChannels = max( m_iChannels, (*it)->GetNumChannels() ); diff --git a/src/RageSoundReader_MP3.cpp b/src/RageSoundReader_MP3.cpp index 7af0a70c9b..7fc389bc89 100644 --- a/src/RageSoundReader_MP3.cpp +++ b/src/RageSoundReader_MP3.cpp @@ -426,7 +426,7 @@ int RageSoundReader_MP3::do_mad_frame_decode( bool headers_only ) return -1; } - ret = fill_buffer(); + int ret = fill_buffer(); if( ret <= 0 ) return ret; bytes_read += ret; diff --git a/src/RageSoundReader_Merge.cpp b/src/RageSoundReader_Merge.cpp index f6c25e6a17..78c3e2b93f 100644 --- a/src/RageSoundReader_Merge.cpp +++ b/src/RageSoundReader_Merge.cpp @@ -18,6 +18,7 @@ RageSoundReader_Merge::RageSoundReader_Merge() RageSoundReader_Merge::~RageSoundReader_Merge() { + map::iterator it; FOREACH( RageSoundReader *, m_aSounds, it ) delete *it; } diff --git a/src/RageSoundReader_PitchChange.h b/src/RageSoundReader_PitchChange.h index c7168f85ce..454ec12102 100644 --- a/src/RageSoundReader_PitchChange.h +++ b/src/RageSoundReader_PitchChange.h @@ -29,8 +29,6 @@ private: float m_fPitchRatio; float m_fLastSetSpeedRatio; float m_fLastSetPitchRatio; - // Swallow up warnings. If they must be used, define them. - RageSoundReader_PitchChange& operator=(const RageSoundReader_PitchChange& rhs); }; #endif diff --git a/src/RageSoundReader_Preload.cpp b/src/RageSoundReader_Preload.cpp index 2358681331..04dae7c10b 100644 --- a/src/RageSoundReader_Preload.cpp +++ b/src/RageSoundReader_Preload.cpp @@ -34,8 +34,7 @@ bool RageSoundReader_Preload::PreloadSound( RageSoundReader *&pSound ) } RageSoundReader_Preload::RageSoundReader_Preload(): - m_Buffer( new RString ), m_bBufferIs16Bit(false), - m_iPosition(0), m_iSampleRate(0), m_iChannels(0), m_fRate(0.0f) + m_Buffer( new RString ) { m_bBufferIs16Bit = g_bSoundPreload16bit.Get(); } diff --git a/src/RageSoundReader_ThreadedBuffer.h b/src/RageSoundReader_ThreadedBuffer.h index edb5295c5d..f13069251d 100644 --- a/src/RageSoundReader_ThreadedBuffer.h +++ b/src/RageSoundReader_ThreadedBuffer.h @@ -53,8 +53,7 @@ private: int iFramesBuffered; int iPositionOfFirstFrame; float fRate; - Mapping(): iFramesBuffered(0), iPositionOfFirstFrame(0), - fRate(1.0f) {} + Mapping() { iFramesBuffered = iPositionOfFirstFrame = 0; fRate = 1.0f; } }; list m_StreamPosition; diff --git a/src/RageSurface.h b/src/RageSurface.h index 73c873133c..e6eb8fa92b 100644 --- a/src/RageSurface.h +++ b/src/RageSurface.h @@ -7,7 +7,7 @@ struct RageSurfaceColor { uint8_t r, g, b, a; - RageSurfaceColor(): r(0), g(0), b(0), a(0) { } + RageSurfaceColor() { } RageSurfaceColor( uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_ ): r(r_), g(g_), b(b_), a(a_) { } diff --git a/src/RageSurfaceUtils.cpp b/src/RageSurfaceUtils.cpp index e759d45449..d9258633d0 100644 --- a/src/RageSurfaceUtils.cpp +++ b/src/RageSurfaceUtils.cpp @@ -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 lSrc = (pixel & src_masks[c]) >> src_shifts[c]; - opixel |= lookup[c][lSrc] << dst_shifts[c]; + int src = (pixel & src_masks[c]) >> src_shifts[c]; + opixel |= lookup[c][src] << dst_shifts[c]; } // Store it. diff --git a/src/RageSurfaceUtils_Palettize.cpp b/src/RageSurfaceUtils_Palettize.cpp index 9103ea6591..6a0a0aabc2 100644 --- a/src/RageSurfaceUtils_Palettize.cpp +++ b/src/RageSurfaceUtils_Palettize.cpp @@ -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, lSum = 0; + long r = 0, g = 0, b = 0, a = 0, sum = 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; - lSum += achv[indx + i].value; + sum += achv[indx + i].value; } - r = r / lSum; + r = r / sum; r = min( r, (long) maxval ); - g = g / lSum; + g = g / sum; g = min( g, (long) maxval ); - b = b / lSum; + b = b / sum; b = min( b, (long) maxval ); - a = a / lSum; + a = a / sum; 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 diff --git a/src/RageTexture.cpp b/src/RageTexture.cpp index ecad7eb785..c1eed7d324 100644 --- a/src/RageTexture.cpp +++ b/src/RageTexture.cpp @@ -7,11 +7,16 @@ RageTexture::RageTexture( RageTextureID name ): - m_ID(name), m_iRefCount(1), m_bWasUsed(false), - m_iSourceWidth(0), m_iSourceHeight(0), - m_iTextureWidth(0), m_iTextureHeight(0), - m_iImageWidth(0), m_iImageHeight(0), - m_iFramesWide(1), m_iFramesHigh(1) {} + m_ID(name) +{ + m_iRefCount = 1; + m_bWasUsed = false; + + m_iSourceWidth = m_iSourceHeight = 0; + m_iTextureWidth = m_iTextureHeight = 0; + m_iImageWidth = m_iImageHeight = 0; + m_iFramesWide = m_iFramesHigh = 1; +} RageTexture::~RageTexture() diff --git a/src/RageTextureID.h b/src/RageTextureID.h index 0825b7e626..4d3b1c43ed 100644 --- a/src/RageTextureID.h +++ b/src/RageTextureID.h @@ -59,15 +59,8 @@ struct RageTextureID void Init(); - 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); } + RageTextureID() { Init(); } + RageTextureID( const RString &fn ) { Init(); SetFilename(fn); } void SetFilename( const RString &fn ); }; diff --git a/src/RageTextureManager.cpp b/src/RageTextureManager.cpp index 9e3af1eed5..9cdb2570ee 100644 --- a/src/RageTextureManager.cpp +++ b/src/RageTextureManager.cpp @@ -36,9 +36,11 @@ namespace map m_mapPathToTexture; }; -RageTextureManager::RageTextureManager(): - m_iNoWarnAboutOddDimensions(0), - m_TexturePolicy(RageTextureID::TEX_DEFAULT) {} +RageTextureManager::RageTextureManager() +{ + m_iNoWarnAboutOddDimensions = 0; + m_TexturePolicy = RageTextureID::TEX_DEFAULT; +} RageTextureManager::~RageTextureManager() { @@ -104,8 +106,9 @@ class RageTexture_Default: public RageTexture { public: RageTexture_Default(): - RageTexture( RageTextureID() ), m_uTexHandle(0) + RageTexture( RageTextureID() ) { + m_uTexHandle = 0; m_iSourceWidth = m_iSourceHeight = 1; m_iTextureWidth = m_iTextureHeight = 1; m_iImageWidth = m_iImageHeight = 1; diff --git a/src/RageTextureManager.h b/src/RageTextureManager.h index 33ab3e81bc..06c0f525ec 100644 --- a/src/RageTextureManager.h +++ b/src/RageTextureManager.h @@ -14,23 +14,30 @@ struct RageTextureManagerPrefs bool m_bHighResolutionTextures; bool m_bMipMaps; - RageTextureManagerPrefs(): m_iTextureColorDepth(16), - m_iMovieColorDepth(16), m_bDelayedDelete(false), - m_iMaxTextureResolution(1024), - m_bHighResolutionTextures(true), m_bMipMaps(false) {} + RageTextureManagerPrefs() + { + m_bDelayedDelete = false; + m_iMovieColorDepth = 16; + m_iTextureColorDepth = 16; + m_iMaxTextureResolution = 1024; + m_bHighResolutionTextures = true; + m_bMipMaps = false; + } RageTextureManagerPrefs( int iTextureColorDepth, int iMovieColorDepth, bool bDelayedDelete, int iMaxTextureResolution, bool bHighResolutionTextures, - bool bMipMaps ): - m_iTextureColorDepth(iTextureColorDepth), - m_iMovieColorDepth(iMovieColorDepth), - m_bDelayedDelete(bDelayedDelete), - m_iMaxTextureResolution(iMaxTextureResolution), - m_bHighResolutionTextures(bHighResolutionTextures), - m_bMipMaps(bMipMaps) {} + bool bMipMaps ) + { + m_bDelayedDelete = bDelayedDelete; + m_iMovieColorDepth = iMovieColorDepth; + m_iTextureColorDepth = iTextureColorDepth; + m_iMaxTextureResolution = iMaxTextureResolution; + m_bHighResolutionTextures = bHighResolutionTextures; + m_bMipMaps = bMipMaps; + } bool operator!=( const RageTextureManagerPrefs& rhs ) const { diff --git a/src/RageThreads.cpp b/src/RageThreads.cpp index f806c6867b..3f3caf6305 100644 --- a/src/RageThreads.cpp +++ b/src/RageThreads.cpp @@ -65,8 +65,7 @@ struct ThreadSlot int m_iCurCheckpoint, m_iNumCheckpoints; const char *GetFormattedCheckpoint( int lineno ); - ThreadSlot(): m_bUsed(false), m_iID(GetInvalidThreadId()), - m_pImpl(NULL), m_iCurCheckpoint(0), m_iNumCheckpoints(0) {} + ThreadSlot() { Init(); } void Init() { m_iID = GetInvalidThreadId(); @@ -207,11 +206,18 @@ static ThreadSlot *GetUnknownThreadSlot() return g_pUnknownThreadSlot; } -RageThread::RageThread(): m_pSlot(NULL), m_sName("unnamed") {} +RageThread::RageThread() +{ + m_pSlot = NULL; + m_sName = "unnamed"; +} -/* Copying a thread does not start the copy. */ -RageThread::RageThread( const RageThread &cpy ): - m_pSlot(NULL), m_sName(cpy.m_sName) {} +RageThread::RageThread( const RageThread &cpy ) +{ + /* Copying a thread does not start the copy. */ + m_pSlot = NULL; + m_sName = cpy.m_sName; +} RageThread::~RageThread() { @@ -514,9 +520,12 @@ static set *g_FreeMutexIDs = NULL; #endif RageMutex::RageMutex( const RString &name ): - m_sName( name ), m_pMutex( MakeMutex (this ) ), - m_LockedBy(GetInvalidThreadId()), m_LockCnt(0) + m_sName( name ) { + m_pMutex = MakeMutex( this ); + m_LockedBy = GetInvalidThreadId(); + m_LockCnt = 0; + /* if( g_FreeMutexIDs == NULL ) { @@ -650,8 +659,7 @@ LockMutex::LockMutex( RageMutex &pMutex, const char *file_, int line_ ): mutex( pMutex ), file( file_ ), line( line_ ), - locked_at( RageTimer::GetTimeSinceStart() ), - locked(false) // ensure it gets locked inside. + locked_at( RageTimer::GetTimeSinceStart() ) { mutex.Lock(); locked = true; @@ -679,7 +687,10 @@ void LockMutex::Unlock() } RageEvent::RageEvent( RString name ): - RageMutex( name ), m_pEvent(MakeEvent(m_pMutex)) {} + RageMutex( name ) +{ + m_pEvent = MakeEvent( m_pMutex ); +} RageEvent::~RageEvent() { @@ -721,7 +732,10 @@ bool RageEvent::WaitTimeoutSupported() const } RageSemaphore::RageSemaphore( RString sName, int iInitialValue ): - m_sName( sName ), m_pSema(MakeSemaphore( iInitialValue )) {} + m_sName( sName ) +{ + m_pSema = MakeSemaphore( iInitialValue ); +} RageSemaphore::~RageSemaphore() { diff --git a/src/RageThreads.h b/src/RageThreads.h index d0af4fcc6e..3de42782d1 100644 --- a/src/RageThreads.h +++ b/src/RageThreads.h @@ -46,9 +46,6 @@ private: static bool s_bSystemSupportsTLS; static bool s_bIsShowingDialog; - - // Swallow up warnings. If they must be used, define them. - RageThread& operator=(const RageThread& rhs); }; /** @@ -64,9 +61,6 @@ public: private: ThreadSlot *m_pSlot; - // Swallow up warnings. If they must be used, define them. - RageThreadRegister& operator=(const RageThreadRegister& rhs); - RageThreadRegister(const RageThreadRegister& rhs); }; namespace Checkpoints @@ -108,10 +102,6 @@ protected: int m_LockCnt; void MarkLockedMutex(); -private: - // Swallow up warnings. If they must be used, define them. - RageMutex& operator=(const RageMutex& rhs); - RageMutex(const RageMutex& rhs); }; /** @@ -138,9 +128,6 @@ public: * * This can only be called once. */ void Unlock(); -private: - // Swallow up warnings. If they must be used, define them. - LockMutex& operator=(const LockMutex& rhs); }; #define LockMut(m) LockMutex UNIQUE_NAME(LocalLock) (m, __FILE__, __LINE__) @@ -162,9 +149,6 @@ public: void Signal(); void Broadcast(); bool WaitTimeoutSupported() const; - // Swallow up warnings. If they must be used, define them. - RageEvent& operator=(const RageEvent& rhs); - RageEvent(const RageEvent& rhs); private: EventImpl *m_pEvent; @@ -186,10 +170,6 @@ public: private: SemaImpl *m_pSema; RString m_sName; - - // Swallow up warnings. If they must be used, define them. - RageSemaphore& operator=(const RageSemaphore& rhs); - RageSemaphore(const RageSemaphore& rhs); }; #endif diff --git a/src/RageTimer.h b/src/RageTimer.h index d1d27201a2..d0dd7935aa 100644 --- a/src/RageTimer.h +++ b/src/RageTimer.h @@ -6,7 +6,7 @@ class RageTimer { public: - RageTimer(): m_secs(0), m_us(0) { Touch(); } + RageTimer() { Touch(); } RageTimer( int secs, int us ): m_secs(secs), m_us(us) { } /* Time ago this RageTimer represents. */ diff --git a/src/RageTypes.h b/src/RageTypes.h index 5c328908b6..d4afc81358 100644 --- a/src/RageTypes.h +++ b/src/RageTypes.h @@ -100,9 +100,9 @@ struct lua_State; struct RageVector2 { public: - RageVector2(): x(0), y(0) {} - RageVector2( const float * f ): x(f[0]), y(f[1]) {} - RageVector2( float x1, float y1 ): x(x1), y(y1) {} + RageVector2() {} + 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(): 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) {} + 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; } // casting operator float* () { return &x; }; @@ -158,9 +158,9 @@ public: struct RageVector4 { public: - 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) {} + 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; } // 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(): b(0), g(0), r(0), a(0) { } - RageVColor(const RageColor &rc): b(0), g(0), r(0), a(0) { *this = rc; } + RageVColor() { } + RageVColor(const RageColor &rc) { *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(): 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) {} + Rect() {}; + 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,7 +349,6 @@ 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 diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp index 257a7925d0..2433a8335f 100644 --- a/src/RageUtil.cpp +++ b/src/RageUtil.cpp @@ -17,7 +17,7 @@ RandomGen g_RandomNumberGenerator; -MersenneTwister::MersenneTwister( int iSeed ) : m_iNext(0) +MersenneTwister::MersenneTwister( int iSeed ) { Reset( iSeed ); } @@ -1315,13 +1315,15 @@ void Regex::Release() m_sPattern = RString(); } -Regex::Regex( const RString &sStr ): m_pReg(NULL), m_iBackrefs(0), m_sPattern(RString()) +Regex::Regex( const RString &sStr ) { + m_pReg = NULL; Set( sStr ); } -Regex::Regex( const Regex &rhs ): m_pReg(NULL), m_iBackrefs(0), m_sPattern(RString()) +Regex::Regex( const Regex &rhs ) { + m_pReg = NULL; Set( rhs.m_sPattern ); } diff --git a/src/RageUtil_AutoPtr.h b/src/RageUtil_AutoPtr.h index 01005c1724..5b56eac08c 100644 --- a/src/RageUtil_AutoPtr.h +++ b/src/RageUtil_AutoPtr.h @@ -27,17 +27,22 @@ class AutoPtrCopyOnWrite { public: /* This constructor only exists to make us work with STL containers. */ - inline AutoPtrCopyOnWrite(): m_pPtr(NULL), m_iRefCount(new int(1)) + inline AutoPtrCopyOnWrite() { + m_pPtr = NULL; + m_iRefCount = new int(1); } - explicit inline AutoPtrCopyOnWrite( T *p ): m_pPtr(p), m_iRefCount(new int(1)) + explicit inline AutoPtrCopyOnWrite( T *p ) { + m_pPtr = p; + m_iRefCount = new int(1); } - inline AutoPtrCopyOnWrite( const AutoPtrCopyOnWrite &rhs ): - m_pPtr(rhs.m_pPtr), m_iRefCount(rhs.m_iRefCount) + inline AutoPtrCopyOnWrite( const AutoPtrCopyOnWrite &rhs ) { + m_pPtr = rhs.m_pPtr; + m_iRefCount = rhs.m_iRefCount; ++(*m_iRefCount); } @@ -127,11 +132,16 @@ public: T& operator*() { return *m_pPtr; } T* operator->() { return m_pPtr; } - explicit HiddenPtr( T *p = NULL ): m_pPtr(p) {} - - HiddenPtr( const HiddenPtr &cpy ): m_pPtr(NULL) + explicit HiddenPtr( T *p = NULL ) { - if( cpy.m_pPtr != NULL ) + m_pPtr = p; + } + + HiddenPtr( const HiddenPtr &cpy ) + { + if( cpy.m_pPtr == NULL ) + m_pPtr = NULL; + else m_pPtr = HiddenPtrTraits::Copy( cpy.m_pPtr ); } diff --git a/src/RageUtil_CachedObject.h b/src/RageUtil_CachedObject.h index 421c8d3328..a7b1e94180 100644 --- a/src/RageUtil_CachedObject.h +++ b/src/RageUtil_CachedObject.h @@ -112,8 +112,9 @@ class CachedObjectPointer public: typedef CachedObject Object; - CachedObjectPointer() : m_pCache(NULL), m_bCacheIsSet(false) + CachedObjectPointer() { + m_bCacheIsSet = false; Object::Register( this ); } diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index aff049768e..109587ac00 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -488,7 +488,7 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) p += m_CustomComboBonusValue; } - p += static_cast(m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier); + p += m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier; if( m_iNumNotesHitThisRow == 2 ) p = (int)(p * m_DoubleNoteMultiplier); diff --git a/src/ScreenBookkeeping.cpp b/src/ScreenBookkeeping.cpp index 4e12142e63..0e379589dc 100644 --- a/src/ScreenBookkeeping.cpp +++ b/src/ScreenBookkeeping.cpp @@ -165,7 +165,7 @@ void ScreenBookkeeping::UpdateView() if( iSongIndex < (int)vpSongs.size() ) { Song *pSong = vpSongs[iSongIndex]; - iCount = pProfile->GetSongNumTimesPlayed( pSong ); + int iCount = pProfile->GetSongNumTimesPlayed( pSong ); RString sTitle = ssprintf("%4d",iCount) + " " + pSong->GetDisplayFullTitle(); if( sTitle.length() > 22 ) sTitle = sTitle.Left(20) + "..."; diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index ffe3e4e664..f4610870d6 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -273,30 +273,30 @@ void ScreenDebugOverlay::Init() FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p ) { { - BitmapText *bt = new BitmapText; - bt->SetName( "ButtonText" ); - bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); - bt->SetHorizAlign( align_right ); - bt->SetText( "blah" ); + BitmapText *p = new BitmapText; + p->SetName( "ButtonText" ); + p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); + p->SetHorizAlign( align_right ); + p->SetText( "blah" ); //p->SetShadowLength( 2 ); - LOAD_ALL_COMMANDS( *bt ); + LOAD_ALL_COMMANDS( *p ); // xxx: I shouldn't have to do this: - ON_COMMAND( bt ); - m_vptextButton.push_back( bt ); - this->AddChild( bt ); + ON_COMMAND( p ); + m_vptextButton.push_back( p ); + this->AddChild( p ); } { - BitmapText *bt = new BitmapText; - bt->SetName( "FunctionText" ); - bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); - bt->SetHorizAlign( align_left ); - bt->SetText( "blah" ); + BitmapText *p = new BitmapText; + p->SetName( "FunctionText" ); + p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); + p->SetHorizAlign( align_left ); + p->SetText( "blah" ); //p->SetShadowLength( 2 ); - LOAD_ALL_COMMANDS( *bt ); + LOAD_ALL_COMMANDS( *p ); // xxx: I shouldn't have to do this: - ON_COMMAND( bt ); - m_vptextFunction.push_back( bt ); - this->AddChild( bt ); + ON_COMMAND( p ); + m_vptextFunction.push_back( p ); + this->AddChild( p ); } } @@ -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( i=0; i<5; i++ ) + for( int i=0; i<5; i++ ) { bt.SetGlow( RageColor(1,0,0,1) ); bt.Sleep(0.1f); diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 2920784b4b..5fba445970 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -16,7 +16,6 @@ #include "LocalizedString.h" #include "NoteDataUtil.h" #include "NoteSkinManager.h" -#include "NoteTypes.h" #include "NotesWriterSM.h" #include "PrefsManager.h" #include "RageSoundManager.h" @@ -266,11 +265,10 @@ void ScreenEdit::InitEditMappings() m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); - m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); // m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_TAP_ATTACK][0] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); - - m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_LEFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cn); - m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_RIGHT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cm); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); m_EditMappingsDeviceInput.button [EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_UP); m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); @@ -329,8 +327,10 @@ void ScreenEdit::InitEditMappings() m_PlayMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); m_PlayMappingsMenuButton.button[EDIT_BUTTON_RETURN_TO_EDIT][1] = GAME_BUTTON_BACK; - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); + m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); + m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); + m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); + m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); @@ -730,8 +730,6 @@ void ScreenEdit::Init() m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; m_bReturnToRecordMenuAfterPlay = false; m_fBeatToReturnTo = 0; - - m_selectedTap = TAP_ORIGINAL_TAP; GAMESTATE->m_bGameplayLeadIn.Set( true ); GAMESTATE->m_EditMode = EDIT_MODE.GetValue(); @@ -956,7 +954,7 @@ void ScreenEdit::Update( float fDeltaTime ) else if( fSecsHeld > RECORD_HOLD_SECONDS ) { // create or extend a hold or roll note - TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD; + TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD; tn.pn = m_InputPlayerNumber; m_NoteDataRecord.AddHoldNote( t, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat), tn ); @@ -1026,7 +1024,6 @@ static LocalizedString DESCRIPTION("ScreenEdit", "Description"); static LocalizedString CHART_STYLE("ScreenEdit", "Chart Style"); static LocalizedString MAIN_TITLE("ScreenEdit", "Main title"); static LocalizedString SUBTITLE("ScreenEdit", "Subtitle"); -static LocalizedString TAP_NOTE_TYPE("ScreenEdit", "Tap Note"); static LocalizedString TAP_STEPS("ScreenEdit", "Tap Steps"); static LocalizedString JUMPS("ScreenEdit", "Jumps"); static LocalizedString HANDS("ScreenEdit", "Hands"); @@ -1051,7 +1048,6 @@ static ThemeMetric DESCRIPTION_FORMAT("ScreenEdit", "DescriptionFormat" static ThemeMetric CHART_STYLE_FORMAT("ScreenEdit", "ChartStyleFormat"); static ThemeMetric MAIN_TITLE_FORMAT("ScreenEdit", "MainTitleFormat"); static ThemeMetric SUBTITLE_FORMAT("ScreenEdit", "SubtitleFormat"); -static ThemeMetric TAP_NOTE_TYPE_FORMAT("ScreenEdit", "TapNoteTypeFormat"); static ThemeMetric NUM_STEPS_FORMAT("ScreenEdit", "NumStepsFormat"); static ThemeMetric NUM_JUMPS_FORMAT("ScreenEdit", "NumJumpsFormat"); static ThemeMetric NUM_HOLDS_FORMAT("ScreenEdit", "NumHoldsFormat"); @@ -1120,7 +1116,6 @@ void ScreenEdit::UpdateTextInfo() sText += ssprintf( MAIN_TITLE_FORMAT.GetValue(), MAIN_TITLE.GetValue().c_str(), m_pSong->m_sMainTitle.c_str() ); if( m_pSong->m_sSubTitle.size() ) sText += ssprintf( SUBTITLE_FORMAT.GetValue(), SUBTITLE.GetValue().c_str(), m_pSong->m_sSubTitle.c_str() ); - sText += ssprintf( TAP_NOTE_TYPE_FORMAT.GetValue(), TAP_NOTE_TYPE.GetValue().c_str(), TapNoteTypeToString( m_selectedTap.type ).c_str() ); break; } sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() ); @@ -1301,48 +1296,43 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) m_NoteDataEdit.SetTapNote( iCol, iSongIndex, TAP_EMPTY ); // Don't CheckNumberOfNotesAndUndo. We don't want to revert any change that removes notes. } + else if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ) + { + m_soundAddNote.Play(); + SetDirty( true ); + SaveUndo(); + TapNote tn = TAP_ORIGINAL_MINE; + tn.pn = m_InputPlayerNumber; + m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn ); + CheckNumberOfNotesAndUndo(); + } else if( EditIsBeingPressed(EDIT_BUTTON_LAY_TAP_ATTACK) ) { g_iLastInsertTapAttackTrack = iCol; EditMiniMenu( &g_InsertTapAttack, SM_BackFromInsertTapAttack ); } + else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) ) + { + m_soundAddNote.Play(); + SetDirty( true ); + SaveUndo(); + TapNote tn = TAP_ORIGINAL_LIFT; + tn.pn = m_InputPlayerNumber; + m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn ); + CheckNumberOfNotesAndUndo(); + } else { m_soundAddNote.Play(); SetDirty( true ); SaveUndo(); - TapNote tn = m_selectedTap; + TapNote tn = TAP_ORIGINAL_TAP; tn.pn = m_InputPlayerNumber; m_NoteDataEdit.SetTapNote(iCol, iSongIndex, tn ); CheckNumberOfNotesAndUndo(); } } break; - - case EDIT_BUTTON_CYCLE_TAP_LEFT: - { - switch ( m_selectedTap.type ) - { - case TapNote::tap: m_selectedTap = TAP_ORIGINAL_FAKE; break; - case TapNote::mine: m_selectedTap = TAP_ORIGINAL_TAP; break; - case TapNote::lift: m_selectedTap = TAP_ORIGINAL_MINE; break; - case TapNote::fake: m_selectedTap = TAP_ORIGINAL_LIFT; break; - DEFAULT_FAIL( m_selectedTap.type ); - } - break; - } - case EDIT_BUTTON_CYCLE_TAP_RIGHT: - { - switch ( m_selectedTap.type ) - { - case TapNote::tap: m_selectedTap = TAP_ORIGINAL_MINE; break; - case TapNote::mine: m_selectedTap = TAP_ORIGINAL_LIFT; break; - case TapNote::lift: m_selectedTap = TAP_ORIGINAL_FAKE; break; - case TapNote::fake: m_selectedTap = TAP_ORIGINAL_TAP; break; - DEFAULT_FAIL( m_selectedTap.type ); - } - break; - } case EDIT_BUTTON_SCROLL_SPEED_UP: case EDIT_BUTTON_SCROLL_SPEED_DOWN: { @@ -2116,6 +2106,10 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB ) m_NoteDataRecord.SetTapNote( iCol, iHeadRow, TAP_EMPTY ); TapNote tn = TAP_ORIGINAL_TAP; + if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ) + tn = TAP_ORIGINAL_MINE; + else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) ) + tn = TAP_ORIGINAL_LIFT; tn.pn = m_InputPlayerNumber; m_NoteDataRecord.SetTapNote( iCol, iRow, tn ); m_NoteFieldRecord.Step( iCol, TNS_W1 ); @@ -2508,7 +2502,7 @@ void ScreenEdit::ScrollTo( float fDestinationBeat ) // Don't SaveUndo. We want to undo the whole hold, not just the last segment // that the user made. Dragging the hold bigger can only absorb and remove // other taps, so dragging won't cause us to exceed the note limit. - TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD : TAP_ORIGINAL_HOLD_HEAD; + TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ? TAP_ORIGINAL_ROLL_HEAD : TAP_ORIGINAL_HOLD_HEAD; tn.pn = m_InputPlayerNumber; m_NoteDataEdit.AddHoldNote( iCol, iStartRow, iEndRow, tn ); @@ -4041,7 +4035,8 @@ static const EditHelpLine g_EditHelpLines[] = EditHelpLine( "Shift BPM changes and stops down one beat", EDIT_BUTTON_INSERT_SHIFT_PAUSES ), EditHelpLine( "Delete beat and shift up", EDIT_BUTTON_DELETE ), EditHelpLine( "Shift BPM changes and stops up one beat", EDIT_BUTTON_DELETE_SHIFT_PAUSES ), - EditHelpLine( "Cycle between tap notes", EDIT_BUTTON_CYCLE_TAP_LEFT, EDIT_BUTTON_CYCLE_TAP_RIGHT ), + EditHelpLine( "Lay mine", EDIT_BUTTON_LAY_MINE_OR_ROLL ), + EditHelpLine( "Lay lift", EDIT_BUTTON_LAY_LIFT ), EditHelpLine( "Add to/remove from right half", EDIT_BUTTON_RIGHT_SIDE ), EditHelpLine( "Switch player (Routine only)", EDIT_BUTTON_SWITCH_PLAYERS ), }; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index fe77602a96..f32e6940ac 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -9,7 +9,6 @@ #include "Background.h" #include "Foreground.h" #include "NoteField.h" -#include "NoteTypes.h" #include "Song.h" #include "Steps.h" #include "ThemeMetric.h" @@ -51,13 +50,10 @@ enum EditButton // These are modifiers to EDIT_BUTTON_COLUMN_*. EDIT_BUTTON_RIGHT_SIDE, - EDIT_BUTTON_LAY_ROLL, + EDIT_BUTTON_LAY_MINE_OR_ROLL, EDIT_BUTTON_LAY_TAP_ATTACK, + EDIT_BUTTON_LAY_LIFT, EDIT_BUTTON_REMOVE_NOTE, - - // These are modifiers to change the present tap note. - EDIT_BUTTON_CYCLE_TAP_LEFT, - EDIT_BUTTON_CYCLE_TAP_RIGHT, EDIT_BUTTON_SCROLL_UP_LINE, EDIT_BUTTON_SCROLL_UP_PAGE, @@ -236,9 +232,6 @@ protected: SnapDisplay m_SnapDisplay; BitmapText m_textInputTips; - - /** @brief The current TapNote that would be inserted. */ - TapNote m_selectedTap; void UpdateTextInfo(); BitmapText m_textInfo; // status information that changes diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 9bed46df4f..6d37d74d3a 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -797,12 +797,12 @@ void ScreenGameplay::InitSongQueues() FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) { - Trail *lTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ]; - ASSERT( lTrail ); + Trail *pTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ]; + ASSERT( pTrail ); pi->m_vpStepsQueue.clear(); pi->m_asModifiersQueue.clear(); - FOREACH_CONST( TrailEntry, lTrail->m_vEntries, e ) + FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e ) { ASSERT( e->pSteps ); pi->m_vpStepsQueue.push_back( e->pSteps ); @@ -1270,6 +1270,8 @@ 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 ) @@ -1303,6 +1305,8 @@ 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 ) diff --git a/src/ScreenJukebox.cpp b/src/ScreenJukebox.cpp index c1e59aaa4d..7ad7555687 100644 --- a/src/ScreenJukebox.cpp +++ b/src/ScreenJukebox.cpp @@ -106,10 +106,10 @@ void ScreenJukebox::SetSong() SONGMAN->GetAllCourses( apCourses, false ); vector apOptions; vector apPossibleCourses; - for( unsigned j = 0; j < apCourses.size(); ++j ) + for( unsigned i = 0; i < apCourses.size(); ++i ) { - Course *lCourse = apCourses[j]; - const CourseEntry *pEntry = lCourse->FindFixedSong( pSong ); + Course *pCourse = apCourses[i]; + const CourseEntry *pEntry = pCourse->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 *lCourse = apPossibleCourses[iIndex]; + Course *pCourse = apPossibleCourses[iIndex]; - PlayMode pm = CourseTypeToPlayMode( lCourse->GetCourseType() ); + PlayMode pm = CourseTypeToPlayMode( pCourse->GetCourseType() ); GAMESTATE->m_PlayMode.Set( pm ); - GAMESTATE->m_pCurCourse.Set( lCourse ); + GAMESTATE->m_pCurCourse.Set( pCourse ); FOREACH_PlayerNumber( p ) { - GAMESTATE->m_pCurTrail[p].Set( lCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) ); + GAMESTATE->m_pCurTrail[p].Set( pCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) ); ASSERT( GAMESTATE->m_pCurTrail[p] ); } } diff --git a/src/ScreenNetSelectBase.cpp b/src/ScreenNetSelectBase.cpp index 40f9c5c9ac..8dfd75f7c3 100644 --- a/src/ScreenNetSelectBase.cpp +++ b/src/ScreenNetSelectBase.cpp @@ -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 cChange; + ColorChange change; unsigned int r, g, b; sscanf( m_sText.substr( i, 9 ).c_str(), "|%*c0%2x%2x%2x", &r, &g, &b ); - cChange.c = RageColor( r/255.f, g/255.f, b/255.f, 1.f ); - cChange.l = iGlyphsSoFar; + change.c = RageColor( r/255.f, g/255.f, b/255.f, 1.f ); + change.l = iGlyphsSoFar; if( iGlyphsSoFar == 0 ) - m_vColors[0] = cChange; + m_vColors[0] = change; else - m_vColors.push_back( cChange ); + m_vColors.push_back( change ); i+=8; continue; } diff --git a/src/ScreenOptionsEditCourse.cpp b/src/ScreenOptionsEditCourse.cpp index eaa3c479c1..82ee683d89 100644 --- a/src/ScreenOptionsEditCourse.cpp +++ b/src/ScreenOptionsEditCourse.cpp @@ -261,7 +261,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector(GAMESTATE->m_pCurCourse->m_fGoalSeconds)/60) ); + row.SetOneSharedSelectionIfPresent( MakeMinutesString(GAMESTATE->m_pCurCourse->m_fGoalSeconds/60) ); break; default: { @@ -383,14 +383,14 @@ void ScreenOptionsEditCourse::SetCurrentSong() } else { - iRow = m_iCurrentRow[PLAYER_1]; + int iRow = m_iCurrentRow[PLAYER_1]; int iEntryIndex = RowToEntryIndex( iRow ); Song *pSong = NULL; if( iEntryIndex != -1 ) { int iCurrentSongRow = EntryIndexAndRowTypeToRow(iEntryIndex,RowType_Song); - OptionRow &oRow = *m_pRows[ iCurrentSongRow ]; - int index = oRow.GetOneSelection(PLAYER_1); + OptionRow &row = *m_pRows[ iCurrentSongRow ]; + int index = row.GetOneSelection(PLAYER_1); if( index != 0 ) pSong = m_vpSongs[ index - 1 ]; } diff --git a/src/ScreenOptionsManageCourses.cpp b/src/ScreenOptionsManageCourses.cpp index 37e9833f8a..cbf20336d9 100644 --- a/src/ScreenOptionsManageCourses.cpp +++ b/src/ScreenOptionsManageCourses.cpp @@ -142,7 +142,7 @@ void ScreenOptionsManageCourses::BeginScreen() vector::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse ); if( iter != m_vpCourses.end() ) { - iIndex = iter - m_vpCourses.begin(); + int iIndex = iter - m_vpCourses.begin(); this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex ); } } diff --git a/src/ScreenOptionsManageEditSteps.cpp b/src/ScreenOptionsManageEditSteps.cpp index 10043777ad..7fc0b1f7de 100644 --- a/src/ScreenOptionsManageEditSteps.cpp +++ b/src/ScreenOptionsManageEditSteps.cpp @@ -110,7 +110,7 @@ void ScreenOptionsManageEditSteps::BeginScreen() vector::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] ); if( iter != m_vpSteps.end() ) { - iIndex = iter - m_vpSteps.begin(); + int iIndex = iter - m_vpSteps.begin(); this->MoveRowAbsolute( PLAYER_1, 1 + iIndex ); } } diff --git a/src/ScreenOptionsMemoryCard.cpp b/src/ScreenOptionsMemoryCard.cpp index a3f265febf..02e1ed832b 100644 --- a/src/ScreenOptionsMemoryCard.cpp +++ b/src/ScreenOptionsMemoryCard.cpp @@ -197,9 +197,8 @@ void ScreenOptionsMemoryCard::ProcessMenuStart( const InputEventPlus &input ) const vector &v = m_CurrentUsbStorageDevices; if( iCurRow < int(v.size()) ) // a card { - // Why is this statement in twice? Doubt it would change right after the if. -Wolfman2000 - const vector &vUSB = m_CurrentUsbStorageDevices; - const UsbStorageDevice &dev = vUSB[iCurRow]; + const vector &v = m_CurrentUsbStorageDevices; + const UsbStorageDevice &dev = v[iCurRow]; MEMCARDMAN->m_sEditorMemoryCardOsMountPoint.Set( dev.sOsMountDir ); /* The destination screen must UnmountCard. XXX: brittle */ diff --git a/src/ScreenRanking.cpp b/src/ScreenRanking.cpp index 595e29850f..f1c2d0dbea 100644 --- a/src/ScreenRanking.cpp +++ b/src/ScreenRanking.cpp @@ -244,8 +244,7 @@ float ScreenRanking::SetPage( const PageToShow &pts ) for( int l=0; lGetMachineProfile()->GetCategoryHighScoreList(st, pts.category); HighScore hs; bool bRecentHighScore = false; diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index c0ad565963..b88038f109 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -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 lMsg("StepsChosen"); - lMsg.SetParam( "Player", p ); - MESSAGEMAN->Broadcast( lMsg ); + Message msg("StepsChosen"); + msg.SetParam( "Player", p ); + MESSAGEMAN->Broadcast( msg ); } } @@ -1781,19 +1781,19 @@ void ScreenSelectMusic::AfterMusicChange() case TYPE_COURSE: { - const Course *lCourse = m_MusicWheel.GetSelectedCourse(); + const Course *pCourse = 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(); - lCourse->GetTrails( m_vpTrails, pStyle->m_StepsType ); + pCourse->GetTrails( m_vpTrails, pStyle->m_StepsType ); m_sSampleMusicToPlay = m_sCourseMusicPath; m_fSampleStartSeconds = 0; m_fSampleLengthSeconds = -1; - g_sBannerPath = lCourse->GetBannerPath(); + g_sBannerPath = pCourse->GetBannerPath(); if( g_sBannerPath.empty() ) m_Banner.LoadFallback(); diff --git a/src/ScreenTestInput.cpp b/src/ScreenTestInput.cpp index 255aa291d9..8ce0e2028d 100644 --- a/src/ScreenTestInput.cpp +++ b/src/ScreenTestInput.cpp @@ -38,6 +38,7 @@ class InputList: public BitmapText // Update input texts vector asInputs; + DeviceInput di; vector DeviceInputs; INPUTFILTER->GetPressedButtons( DeviceInputs ); FOREACH( DeviceInput, DeviceInputs, di ) diff --git a/src/ScrollBar.cpp b/src/ScrollBar.cpp index da25c145df..67e95a878a 100644 --- a/src/ScrollBar.cpp +++ b/src/ScrollBar.cpp @@ -46,7 +46,7 @@ void ScrollBar::SetPercentage( float fCenterPercent, float fSizePercent ) { wrap( fCenterPercent, 1.0f ); - const int iBarContentHeight = static_cast(m_sprMiddle->GetZoomedHeight()); + const int iBarContentHeight = m_sprMiddle->GetZoomedHeight(); ASSERT( iBarContentHeight != 0 ); /* Set tick thumb */ diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 91332d0232..5f5376b8b7 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -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 PFSection; - PFSection.sName = "Unlocks"; + PreferredSortSection section; + section.sName = "Unlocks"; FOREACH( UnlockEntry, UNLOCKMAN->m_UnlockEntries, ue ) { if( ue->m_Type == UnlockRewardType_Song ) { Song *pSong = ue->m_Song.ToSong(); if( pSong ) - PFSection.vpSongs.push_back( pSong ); + section.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(PFSection.vpSongs.begin(),PFSection.vpSongs.end(),pSong) != PFSection.vpSongs.end() ) + if( find(section.vpSongs.begin(),section.vpSongs.end(),pSong) != section.vpSongs.end() ) { v->vpSongs.erase( v->vpSongs.begin()+i ); } } } - m_vPreferredSongSort.push_back( PFSection ); + m_vPreferredSongSort.push_back( section ); } // prune empty groups diff --git a/src/SongOptions.h b/src/SongOptions.h index a690b56ccd..7a81c9fc45 100644 --- a/src/SongOptions.h +++ b/src/SongOptions.h @@ -46,19 +46,8 @@ public: }; SoundEffectType m_SoundEffectType; - /** - * @brief Set up the SongOptions with reasonable defaults. - * - * This is taken from Init(), but uses the intended - * initialization lists. */ - SongOptions(): m_LifeType(LIFE_BAR), m_DrainType(DRAIN_NORMAL), - m_iBatteryLives(4), m_bAssistClap(false), - m_bAssistMetronome(false), m_fMusicRate(1.0f), - m_SpeedfMusicRate(1.0f), m_fHaste(0.0f), - m_SpeedfHaste(1.0f), m_AutosyncType(AUTOSYNC_OFF), - m_SoundEffectType(SOUNDEFFECT_OFF), - m_bStaticBackground(false), m_bRandomBGOnly(false), - m_bSaveScore(true), m_bSaveReplay(false) {}; + + SongOptions() { Init(); }; void Init(); void Approach( const SongOptions& other, float fDeltaSeconds ); void GetMods( vector &AddTo ) const; diff --git a/src/StatsManager.cpp b/src/StatsManager.cpp index a50ef882bb..f3cc714ba0 100644 --- a/src/StatsManager.cpp +++ b/src/StatsManager.cpp @@ -396,11 +396,11 @@ public: return 1; } - static int GetBestFinalGrade( T* t, lua_State *L ) + static int GetBestFinalGrade( T* p, lua_State *L ) { Grade top_grade = Grade_Failed; StageStats stats; - t->GetFinalEvalStageStats( stats ); + p->GetFinalEvalStageStats( stats ); FOREACH_HumanPlayer( p ) { // If this player failed any stage, then their final grade is an F. diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index db3c4a01c2..4393682851 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -1480,14 +1480,15 @@ RelativePath="NotesWriterSM.h" > - - - + - + + diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 8b5830d7cb..8c92f28ec2 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -103,7 +103,7 @@ void StepMania::GetPreferredVideoModeParams( VideoModeParams ¶msOut ) { //float fRatio = PREFSMAN->m_iDisplayWidth / PREFSMAN->m_iDisplayHeight; //iWidth = PREFSMAN->m_iDisplayHeight * fRatio; - iWidth = static_cast(ceilf(PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio)); + iWidth = 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; diff --git a/src/StepsUtil.h b/src/StepsUtil.h index cae7cdb1c3..628f01c6ed 100644 --- a/src/StepsUtil.h +++ b/src/StepsUtil.h @@ -48,12 +48,15 @@ public: } /** @brief The Song's locked status. */ m_Locked; /** @brief Set up the initial criteria. */ - StepsCriteria(): m_difficulty(Difficulty_Invalid), - m_iLowMeter(-1), m_iHighMeter(-1), - m_st(StepsType_Invalid), m_Locked(Locked_DontCare) + StepsCriteria() { + m_difficulty = Difficulty_Invalid; + m_iLowMeter = -1; + m_iHighMeter = -1; //m_fLowBPM = -1; //m_fHighBPM = -1; + m_st = StepsType_Invalid; + m_Locked = Locked_DontCare; } /** diff --git a/src/StreamDisplay.cpp b/src/StreamDisplay.cpp index c972e5832b..185028e209 100644 --- a/src/StreamDisplay.cpp +++ b/src/StreamDisplay.cpp @@ -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 = static_cast(THEME->GetMetricF(sMetricsGroup,"NumPills")); + int iNumPills = THEME->GetMetricF(sMetricsGroup,"NumPills"); m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar"); FOREACH_ENUM( StreamType, st ) diff --git a/src/TimingData.cpp b/src/TimingData.cpp index 02abd33c7e..3e03b64351 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -569,11 +569,11 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const int iRow = BeatToNoteRow(fBeat); for( unsigned j=0; j=) - * A Pump delay acts differently: the pause is before the beat. (>) + /* A traditional stop has the beat happening before the stop (>=) + * A Pump delay acts differently. [aj: how?] (>) */ - if( ( m_StopSegments[j].m_iStartRow >= iRow && !m_StopSegments[j].m_bDelay ) || - ( m_StopSegments[j].m_iStartRow > iRow && m_StopSegments[j].m_bDelay ) ) + if( m_StopSegments[j].m_iStartRow >= iRow && !m_StopSegments[j].m_bDelay || + m_StopSegments[j].m_iStartRow > iRow && m_StopSegments[j].m_bDelay ) break; fElapsedTime += m_StopSegments[j].m_fStopSeconds; } diff --git a/src/TimingData.h b/src/TimingData.h index 4ae8c8b50c..afbe71d3e1 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -174,7 +174,7 @@ struct StopSegment { return ( m_iStartRow < other.m_iStartRow ) || ( m_iStartRow == other.m_iStartRow && - ( ( m_bDelay && !other.m_bDelay ) || m_fStopSeconds < other.m_fStopSeconds )); + ( m_bDelay && !other.m_bDelay || m_fStopSeconds < other.m_fStopSeconds )); } /** * @brief Compares two StopSegments to see if one is less than or equal to the other. diff --git a/src/Trail.h b/src/Trail.h index f69dd56faf..f0f9fb040f 100644 --- a/src/Trail.h +++ b/src/Trail.h @@ -64,15 +64,9 @@ public: mutable bool m_bRadarValuesCached; mutable RadarValues m_CachedRadarValues; - /** - * @brief Set up the Trail with default values. - * - * This used to call Init(), which is still available. */ - Trail(): m_StepsType(StepsType_Invalid), - m_CourseDifficulty(Difficulty_Invalid), - m_iSpecifiedMeter(-1), m_bRadarValuesCached(false) + Trail() { - m_vEntries.clear(); + Init(); } void Init() { diff --git a/src/UnlockManager.h b/src/UnlockManager.h index 06b3ed7b3e..9eaaad40cf 100644 --- a/src/UnlockManager.h +++ b/src/UnlockManager.h @@ -52,16 +52,16 @@ enum UnlockEntryStatus { class UnlockEntry { public: - /** - * @brief Set up the UnlockEntry with default values. - * - * m_sEntryID starts as an empty string. It will be filled automatically - * if not specified. */ - UnlockEntry(): m_Type(UnlockRewardType_Invalid), - m_dc(Difficulty_Invalid), m_bRequirePassHardSteps(false), - m_bRoulette(false), m_sEntryID(RString("")) + UnlockEntry() { + m_Type = UnlockRewardType_Invalid; + + m_dc = Difficulty_Invalid; + ZERO( m_fRequirement ); + m_bRequirePassHardSteps = false; + m_bRoulette = false; + m_sEntryID = ""; // "" means not yet filled. This will be filled in automatically if not specified. } UnlockRewardType m_Type; diff --git a/src/XmlFileUtil.cpp b/src/XmlFileUtil.cpp index df65416143..0fb328f9d5 100644 --- a/src/XmlFileUtil.cpp +++ b/src/XmlFileUtil.cpp @@ -669,21 +669,21 @@ namespace continue; } - RString nName; - LuaHelpers::Pop( L, nName ); - NodeNamesToAdd.push_back( nName ); + RString sName; + LuaHelpers::Pop( L, sName ); + NodeNamesToAdd.push_back( sName ); NodesToAdd.push_back( LuaReference() ); NodesToAdd.back().SetFromStack( L ); continue; } - RString nName; - LuaHelpers::Pop( L, nName ); + RString sName; + LuaHelpers::Pop( L, sName ); // Otherwise, add an attribute. XNodeLuaValue *pValue = new XNodeLuaValue; pValue->SetValueFromStack( L ); - pNode->AppendAttrFrom( nName, pValue ); + pNode->AppendAttrFrom( sName, pValue ); } lua_pop( L, 1 ); diff --git a/src/arch/InputHandler/InputHandler.h b/src/arch/InputHandler/InputHandler.h index 0eeed81982..5bb41914e3 100644 --- a/src/arch/InputHandler/InputHandler.h +++ b/src/arch/InputHandler/InputHandler.h @@ -25,7 +25,7 @@ public: static void Create( const RString &sDrivers, vector &apAdd ); static DriverList m_pDriverList; - InputHandler(): m_iInputsSinceUpdate(0) {} + InputHandler() { m_iInputsSinceUpdate = 0; } virtual ~InputHandler() { } virtual void Update() { } virtual bool DevicesChanged() { return false; } diff --git a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp index e79a40ac9a..dd8b9dc9ab 100644 --- a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp +++ b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp @@ -425,10 +425,10 @@ wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool b if( KeyLayout ) { UInt32 keyboardType = LMGetKbdType(); - UInt32 nModifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0; + UInt32 modifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0; UniChar unicodeInputString[4]; UniCharCount length; - OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, nModifiers, + OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, modifiers, keyboardType, 0, &iDeadKeyState, ARRAYLEN(unicodeInputString), &length, unicodeInputString ); diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 43c56d2a10..bddafb3b79 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -28,7 +28,6 @@ namespace avcodec #endif }; -/* #if defined(_MSC_VER) && !defined(XBOX) #pragma comment(lib, "ffmpeg/lib/avcodec.lib") #pragma comment(lib, "ffmpeg/lib/avformat.lib") @@ -36,7 +35,6 @@ namespace avcodec #pragma comment(lib, "ffmpeg/lib/swscale.lib") #endif #endif // _MSC_VER && !XBOX -*/ #if defined(XBOX) /* NOTES: ffmpeg static libraries arent included in SVN. You have to build diff --git a/src/arch/MovieTexture/MovieTexture_Theora.cpp b/src/arch/MovieTexture/MovieTexture_Theora.cpp index b39abb6ede..fe4fe86638 100644 --- a/src/arch/MovieTexture/MovieTexture_Theora.cpp +++ b/src/arch/MovieTexture/MovieTexture_Theora.cpp @@ -193,10 +193,10 @@ RString MovieDecoder_Theora::ProcessHeaders() while(1) { ogg_packet op; - int ret2 = ogg_stream_packetpeek( &m_OggStream, &op ); - if( ret2 == 0 ) + int ret = ogg_stream_packetpeek( &m_OggStream, &op ); + if( ret == 0 ) break; - if( ret2 < 0 ) + if( ret < 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(); } - ret2 = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op); - if( ret2 < 0 && ret2 != OC_NEWPACKET ) + ret = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op); + if( ret < 0 && ret != OC_NEWPACKET ) return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() ); ogg_stream_packetout( &m_OggStream, NULL ); diff --git a/src/arch/Sound/RageSoundDriver.h b/src/arch/Sound/RageSoundDriver.h index 212cc2b138..a95ca5e083 100644 --- a/src/arch/Sound/RageSoundDriver.h +++ b/src/arch/Sound/RageSoundDriver.h @@ -150,8 +150,7 @@ private: float *m_BufferNext; // beginning of the unread data int m_FramesInBuffer; // total number of frames at m_BufferNext int64_t m_iPosition; // stream frame of m_BufferNext - sound_block(): m_BufferNext(m_Buffer), - m_FramesInBuffer(0), m_iPosition(0) {} + sound_block() { m_FramesInBuffer = 0; m_iPosition = 0; m_BufferNext = m_Buffer; } }; struct Sound From 067f5d967b8409e7e92e0c7e31401e1caf14dfde Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Mon, 14 Mar 2011 19:35:09 -0500 Subject: [PATCH 34/37] once and for all --- .hgignore | 1 + Docs/Changelog_sm-ssc.txt | 27 ++--- Themes/_fallback/Languages/en.ini | 4 +- Themes/_fallback/metrics.ini | 4 + .../CombinedLifeMeterTug stream p1.redir | 1 - .../CombinedLifeMeterTug stream p2.redir | 1 - Themes/default/metrics.ini | 1 + .../default.lua | 66 +++++++++- .../default.lua | 2 - .../Graphics/ScreenTitleMenu scroll.lua | 6 +- .../ScreenWithMenuElements footer.lua | 3 - .../ScreenWithMenuElements header.lua | 3 - Themes/themekit/metrics.ini | 70 ++++------- Xcode/Info-StepMania.plist | 114 +++++++++--------- Xcode/stepmania.xcodeproj/project.pbxproj | 32 +++-- src/ArrowEffects.cpp | 2 +- src/Attack.cpp | 4 +- src/Attack.h | 20 ++- src/AutoKeysounds.cpp | 4 +- src/BGAnimation.cpp | 6 +- src/Background.cpp | 6 +- src/BeginnerHelper.cpp | 2 + src/Character.cpp | 7 +- src/Course.cpp | 8 +- src/Course.h | 15 +-- src/CourseUtil.cpp | 2 +- src/Font.cpp | 12 +- src/Foreground.cpp | 10 +- src/GameCommand.cpp | 4 +- src/GameState.cpp | 4 +- src/InputMapper.cpp | 6 +- src/InputMapper.h | 20 +-- src/LocalizedString.h | 2 + src/LuaManager.h | 6 + src/ModIconRow.cpp | 6 +- src/ModelTypes.h | 9 +- src/NoteData.cpp | 4 +- src/NoteDataUtil.cpp | 13 +- src/NoteField.cpp | 22 ++-- src/NoteSkinManager.cpp | 14 +-- src/NoteTypes.h | 23 ++++ src/NotesLoaderBMS.cpp | 24 ++-- src/NotesLoaderMidi.cpp | 10 +- src/NotesLoaderPMS.cpp | 28 ++--- src/NotesLoaderSM.cpp | 5 +- src/NotesWriterSM.cpp | 6 +- src/OptionRow.cpp | 2 +- src/OptionRowHandler.cpp | 14 +-- src/OptionRowHandler.h | 13 +- src/OptionsCursor.cpp | 8 +- src/OptionsList.cpp | 28 ++--- src/Player.cpp | 21 ++-- src/PlayerOptions.cpp | 2 - src/PlayerOptions.h | 31 ++++- src/Profile.cpp | 14 +-- src/ProfileManager.cpp | 6 +- src/RageDisplay.cpp | 2 +- src/RageDisplay.h | 46 +++---- src/RageFile.h | 10 +- src/RageFileBasic.h | 3 + src/RageFileDriverDeflate.cpp | 6 +- src/RageFileManager.cpp | 4 +- src/RageInputDevice.h | 25 ++-- src/RageLog.cpp | 9 +- src/RageMath.cpp | 4 +- src/RageSound.cpp | 34 ++---- src/RageSound.h | 21 ++-- src/RageSoundManager.cpp | 7 +- src/RageSoundManager.h | 3 + src/RageSoundReader_Chain.cpp | 3 - src/RageSoundReader_MP3.cpp | 2 +- src/RageSoundReader_Merge.cpp | 1 - src/RageSoundReader_PitchChange.h | 2 + src/RageSoundReader_Preload.cpp | 3 +- src/RageSoundReader_ThreadedBuffer.h | 3 +- src/RageSurface.h | 2 +- src/RageSurfaceUtils.cpp | 4 +- src/RageSurfaceUtils_Palettize.cpp | 12 +- src/RageTexture.cpp | 15 +-- src/RageTextureID.h | 11 +- src/RageTextureManager.cpp | 11 +- src/RageTextureManager.h | 29 ++--- src/RageThreads.cpp | 38 ++---- src/RageThreads.h | 20 +++ src/RageTimer.h | 2 +- src/RageTypes.h | 33 ++--- src/RageUtil.cpp | 8 +- src/RageUtil_AutoPtr.h | 24 ++-- src/RageUtil_CachedObject.h | 3 +- src/ScoreKeeperNormal.cpp | 2 +- src/ScreenBookkeeping.cpp | 2 +- src/ScreenDebugOverlay.cpp | 38 +++--- src/ScreenEdit.cpp | 77 ++++++------ src/ScreenEdit.h | 11 +- src/ScreenGameplay.cpp | 10 +- src/ScreenJukebox.cpp | 14 +-- src/ScreenNetSelectBase.cpp | 10 +- src/ScreenOptionsEditCourse.cpp | 8 +- src/ScreenOptionsManageCourses.cpp | 2 +- src/ScreenOptionsManageEditSteps.cpp | 2 +- src/ScreenOptionsMemoryCard.cpp | 5 +- src/ScreenRanking.cpp | 3 +- src/ScreenSelectMusic.cpp | 12 +- src/ScreenTestInput.cpp | 1 - src/ScrollBar.cpp | 2 +- src/SongManager.cpp | 10 +- src/SongOptions.h | 15 ++- src/StatsManager.cpp | 4 +- src/StepMania-net2008.vcproj | 13 +- src/StepMania.cpp | 4 +- src/StepsUtil.h | 9 +- src/StreamDisplay.cpp | 2 +- src/TimingData.cpp | 8 +- src/TimingData.h | 2 +- src/Trail.h | 10 +- src/UnlockManager.h | 16 +-- src/XmlFileUtil.cpp | 12 +- src/arch/InputHandler/InputHandler.h | 2 +- .../InputHandler/InputHandler_MacOSX_HID.cpp | 4 +- src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 2 + src/arch/MovieTexture/MovieTexture_Theora.cpp | 10 +- src/arch/Sound/RageSoundDriver.h | 3 +- 122 files changed, 802 insertions(+), 701 deletions(-) delete mode 100644 Themes/default/Graphics/CombinedLifeMeterTug stream p1.redir delete mode 100644 Themes/default/Graphics/CombinedLifeMeterTug stream p2.redir delete mode 100644 Themes/themekit/Graphics/ScreenWithMenuElements footer.lua delete mode 100644 Themes/themekit/Graphics/ScreenWithMenuElements header.lua diff --git a/.hgignore b/.hgignore index 0b3bfcf250..3382b3a54d 100644 --- a/.hgignore +++ b/.hgignore @@ -37,6 +37,7 @@ src/libtomcrypt/Release-* src/libtommath/build-* src/libtommath/Release-* src/*.old +src/.deps ver.cpp lib*_link.a Data/UserPrefs diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 7be1d02092..df79bf320c 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -10,7 +10,18 @@ supported but exist anyways.) _____________________________________________________________________________ ================================================================================ -sm-ssc v1.2.3 | 201103?? +sm-ssc v1.2.4 | 20110??? +-------------------------------------------------------------------------------- + +20110313 +-------- +* [NotesWriterSM] Allow for either the #DESCRIPTION or #CREDIT tags to be used + for the .sm format's description token. [Wolfman2000] +* [ScreenEdit] Add Tap Note Cycling to allow inputting all of the taps. The way + to make holds and rolls are still the same as before. [Wolfman2000] + +================================================================================ +sm-ssc v1.2.3 | 20110323 -------------------------------------------------------------------------------- 20110309 @@ -25,20 +36,6 @@ sm-ssc v1.2.3 | 201103?? * [MeterDisplay] Add Lua binding. "Allow setting and changing the width dynamically. Phase out the "StreamWidth" node property; set it with SetStreamWidth instead." [Glenn Maynard] -* sm5svn r28280: "Previously, we didn't create MusicWheel sorts when the screen - loads; it was delayed until the screen begins. This allowed preloading before - the style is set. However, it caused a major skip when the screen starts, - because creating the sorts is fairly expensive. - - Refactor this. Load the sorts when the screen is loaded, and then go through - them and quickly filter out unplayable data and handle other initialization - on begin. This is much faster, so we can more easily transition seamlessly - from the previous menu. - - One known limitation: the sorts are created before we know the style, so we - have to guess. This means if you're in a style like dance-solo or - pump-halfdouble, sorts will still be based on regular mode. This affects the - difficulty, top grade and roulette sorts." [Glenn Maynard] 20110305 -------- diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 984de88fc7..7314f129ad 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1223,7 +1223,7 @@ Enter a new sub title transliteration.=Enter a new sub title transliteration. Enter a new sub title.=Enter a new sub title. More than %d notes per measure is not allowed. This change has been reverted.=More than %d notes per measure is not allowed. This change has been reverted. No backgrounds available=No backgrounds available -EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nSpace bar:\n Set area\n marker\nEnter:\n Area Menu\nEscape:\n Main Menu\nF1:\n Show help\n +EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nCreate roll note:\n Hold Shift,\n then create a\n hold note.\nSpace bar:\n Set area\n marker\nEnter:\n Area Menu\nEscape:\n Main Menu\nF1:\n Show help\n PlayRecordHelpText=Press START to end Save successful.=Save successful. Saved as SM and DWI.=Saved as SM and DWI. @@ -1244,6 +1244,7 @@ Description=Description Chart Style=Chart Style Main title=Main title Subtitle=Subtitle +Tap Note=Tap Note Tap Steps=Tap Steps Jumps=Jumps Hands=Hands @@ -1925,6 +1926,7 @@ Insert beat and shift down=Insert beat and shift down Shift BPM changes and stops down one beat=Shift BPM changes and stops down one beat Delete beat and shift up=Delete beat and shift up Shift BPM changes and stops up one beat=Shift BPM changes and stops up one beat +Cycle between tap notes=Cycle between tap notes Lay mine=Lay mine Lay lift=Lay lift Add to/remove from right half=Add to/remove from right half diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 18418ebc07..3fc779c3b6 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -647,6 +647,9 @@ LyricBackChangedCommand=LyricCommand,"Back" InLength=0 OutLength=0 +[NotesWriterSM] +DescriptionUsesCreditField=false + [OptionRow] ShowModIcons=false ShowUnderlines=true @@ -3649,6 +3652,7 @@ DescriptionFormat="%s:\n %s\n" ChartStyleFormat="%s:\n %s\n" MainTitleFormat="%s:\n %s\n" SubtitleFormat="%s:\n %s\n" +TapNoteTypeFormat="%s: %s\n" NumStepsFormat="%s: %d\n" NumJumpsFormat="%s: %d\n" NumHoldsFormat="%s: %d\n" diff --git a/Themes/default/Graphics/CombinedLifeMeterTug stream p1.redir b/Themes/default/Graphics/CombinedLifeMeterTug stream p1.redir deleted file mode 100644 index 4d26295a4a..0000000000 --- a/Themes/default/Graphics/CombinedLifeMeterTug stream p1.redir +++ /dev/null @@ -1 +0,0 @@ -_CombinedLifeMeterTug stream p1 \ No newline at end of file diff --git a/Themes/default/Graphics/CombinedLifeMeterTug stream p2.redir b/Themes/default/Graphics/CombinedLifeMeterTug stream p2.redir deleted file mode 100644 index 5189a43350..0000000000 --- a/Themes/default/Graphics/CombinedLifeMeterTug stream p2.redir +++ /dev/null @@ -1 +0,0 @@ -_CombinedLifeMeterTug stream p2 \ No newline at end of file diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index ab23f589d8..9f57baa9f3 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -649,6 +649,7 @@ MeterSetCommand=%function(self,param) \ end; \ if param.Meter then \ if param.Meter >= 10 then \ + self:textglowmode('TextGlowMode_Inner'); \ self:glowshift(); \ else \ self:stopeffect(); \ diff --git a/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua b/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua index b97fb0767e..d3ebaea695 100644 --- a/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua +++ b/Themes/themekit/BGAnimations/ScreenWithMenuElements background/default.lua @@ -1,8 +1,62 @@ -return Def.ActorFrame { +local t = Def.ActorFrame {}; +-- +--[[ local tGridSizeMajor = { 32, 32 }; +local tGridSizeMinor = { 16, 16 }; +local function CreateDebugGrid() + local t = Def.ActorFrame {}; + local numX = math.ceil(SCREEN_WIDTH/tGridSizeMajor[1]) + local numY = math.ceil(SCREEN_HEIGHT/tGridSizeMajor[2]) + local offset = ( math.ceil(SCREEN_WIDTH/tGridSizeMajor[1]) - SCREEN_WIDTH ) + SCREEN_WIDTH; + for a=1,numY do + for b=1,numX do + t[#t+1] = Def.Quad { + InitCommand=cmd(x,b*tGridSizeMajor[1]-(tGridSizeMajor[1]/2);y,a*tGridSizeMajor[2]-(tGridSizeMajor[2]/2)); + OnCommand=cmd(zoomto,tGridSizeMajor[1]-2,tGridSizeMajor[2]-2;diffuse,color("1,1,1,0.25")); + }; + end; + end; + return t +end --]] + +-- +t[#t+1] = Def.ActorFrame { InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); - - Def.Quad { - InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("0.25,0.15,0.25,1")); + LoadActor("VOL1-29-NTSC") .. { + InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); + OnCommand=cmd(diffusealpha,0.75); }; -}; \ No newline at end of file +}; +-- +local bShow = 0; +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(visible,false); + ToggleConsoleDisplayMessageCommand=function(self) + bShow = 1 - bShow; + self:visible( bShow == 1 ); + end; + -- Grid + LoadActor("_32") .. { + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/32,SCREEN_HEIGHT/32); + OnCommand=cmd(diffuse,color("0,0,0,0.5")); + }; + LoadActor("_16") .. { + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/16,SCREEN_HEIGHT/16); + OnCommand=cmd(diffuse,color("1,1,1,0.125")); + }; +--[[ LoadActor("_8") .. { + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/8,SCREEN_HEIGHT/8); + OnCommand=cmd(diffuse,color("#00BFE833")); + }; --]] + -- Left + Def.Quad { + InitCommand=cmd(horizalign,left;x,SCREEN_LEFT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0,0,0,0.5")); + }; + -- Right + Def.Quad { + InitCommand=cmd(horizalign,right;x,SCREEN_RIGHT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0,0,0,0.5")); + }; +}; +-- +return t \ No newline at end of file diff --git a/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua b/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua index 9d64c662cd..d69d08b791 100644 --- a/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua +++ b/Themes/themekit/BGAnimations/ScreenWithMenuElements decorations/default.lua @@ -2,8 +2,6 @@ -- I prefer to keep these optional, incase another screen wants to hide -- these elements. local t = Def.ActorFrame {}; - t[#t+1] = StandardDecorationFromFileOptional("Header","Header"); t[#t+1] = StandardDecorationFromFileOptional("Footer","Footer"); - return t \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua b/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua index 13448248c9..84e2da8460 100644 --- a/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua +++ b/Themes/themekit/Graphics/ScreenTitleMenu scroll.lua @@ -4,10 +4,8 @@ local t = Def.ActorFrame {}; t[#t+1] = LoadFont("Common Normal") .. { Text=gc:GetText(); - InitCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemInitCommand"); - GainFocusCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemGainFocusCommand"); - LoseFocusCommand=THEME:GetMetric(Var "LoadingScreen","ScrollerItemGainFocusCommand"); }; - +t.GainFocusCommand=cmd(diffusealpha,1); +t.LoseFocusCommand=cmd(diffusealpha,0.5); return t; \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua b/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua deleted file mode 100644 index a68467c3ba..0000000000 --- a/Themes/themekit/Graphics/ScreenWithMenuElements footer.lua +++ /dev/null @@ -1,3 +0,0 @@ -return Def.Quad { - InitCommand=cmd(zoomto,SCREEN_WIDTH,32); -}; \ No newline at end of file diff --git a/Themes/themekit/Graphics/ScreenWithMenuElements header.lua b/Themes/themekit/Graphics/ScreenWithMenuElements header.lua deleted file mode 100644 index 82ac56aec3..0000000000 --- a/Themes/themekit/Graphics/ScreenWithMenuElements header.lua +++ /dev/null @@ -1,3 +0,0 @@ -return Def.Quad { - InitCommand=cmd(zoomto,SCREEN_WIDTH,48); -}; \ No newline at end of file diff --git a/Themes/themekit/metrics.ini b/Themes/themekit/metrics.ini index 0606f0540b..ffd154d4d0 100644 --- a/Themes/themekit/metrics.ini +++ b/Themes/themekit/metrics.ini @@ -1,59 +1,37 @@ [Global] FallbackTheme=_fallback - -[CustomScoring] -ComboAboveThresholdAddsToScoreBonus=0 -ComboScoreBonusThreshold=50 -ComboScoreBonusValue=+1000 - -ComboMultiplier=0.0 - -DoubleNoteScoreMultiplier=2.0 -TripleNoteScoreMultiplier=3.0 -QuadOrHigherNoteScoreMultiplier=4.0 - -PointsW1=+50 -PointsW2=+20 -PointsW3=+10 -PointsW4=+5 -PointsW5=0 -PointsMiss=-5 -PointsHitMine=-5 -PointsCheckpointHit=+5 -PointsCheckpointMiss=-5 -PointsNone=0 -PointsHoldHeld=+5 -PointsHoldLetGo=-5 - [ScreenWithMenuElements] -WaitForChildrenBeforeTweeningOut=true - ShowHeader=true HeaderX=SCREEN_CENTER_X HeaderY=SCREEN_TOP -HeaderOnCommand=vertalign,top;diffuse,color("0.5,0.25,0.35,1"); +HeaderOnCommand= HeaderOffCommand= - +# ShowFooter=true FooterX=SCREEN_CENTER_X FooterY=SCREEN_BOTTOM -FooterOnCommand=vertalign,bottom;diffuse,color("0.5,0.25,0.35,1"); +FooterOnCommand= FooterOffCommand= +# +TimerX=SCREEN_WIDTH-64 +TimerY=SCREEN_TOP+48-4.5 +TimerOnCommand= +TimerOffCommand= +[MenuTimer] +# Text +Text1OnCommand=stopeffect;stoptweening;vertalign,bottom;horizalign,right +Text1FormatFunction=function(fSeconds) \ + return string.format("%0.1f", fSeconds); \ +end +FrameOnCommand= +# Warning +Warning10Command=diffuseshift;effectperiod,1;effectcolor2,Color("Red");effectcolor1,color("0.5,0,0,1"); [ScreenTitleMenu] -ScrollerY=SCREEN_CENTER_Y*1.5 -ScrollerOnCommand= -# New: Load ScrollerItem SpacingX/Y -ScrollerTransform=function(self,offset,itemIndex,numItems) \ - local fSpaceX = THEME:GetMetric( Var "LoadingScreen","ScrollerItemSpacingX"); \ - local fSpaceY = THEME:GetMetric( Var "LoadingScreen","ScrollerItemSpacingY"); \ - self:x( (i-1) * fSpaceX ); \ - self:y( (i-1) * fSpaceY ); \ -end; -# New: Adjust menu items -ScrollerItemSpacingX=0 -ScrollerItemSpacingY=24 -ScrollerItemInitCommand=zoom,1;shadowlength,1 -ScrollerItemGainFocusCommand=finishtweening;linear,0.125;zoom,1.25 -ScrollerItemLoseFocusCommand=finishtweening;linear,0.125;zoom,1 +ShowHeader=true +ShowFooter=true [ScreenSelectMusic] - +MusicWheelX=SCREEN_RIGHT-128-18 +MusicWheelOnCommand=draworder,-1 +[MusicWheel] +ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) self:x( (1-math.cos(offsetFromCenter/math.pi))*0 ); self:y( offsetFromCenter*48 ); end +NumWheelItems=13 \ No newline at end of file diff --git a/Xcode/Info-StepMania.plist b/Xcode/Info-StepMania.plist index bb5906c43a..580247540e 100644 --- a/Xcode/Info-StepMania.plist +++ b/Xcode/Info-StepMania.plist @@ -1,57 +1,57 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - smzip - - CFBundleTypeIconFile - smicon.icns - CFBundleTypeMIMETypes - - application/zip - - CFBundleTypeName - SMZip - CFBundleTypeRole - Editor - LSTypeIsPackage - - NSPersistentStoreTypeKey - Binary - - - CFBundleExecutable - EXECUTABLE_NAME - CFBundleGetInfoString - PRODUCT_FAMILY_BARE PRODUCT_VER_BARE - CFBundleIconFile - smicon.icns - CFBundleIdentifier - com.PRODUCT_ID_BARE - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - PRODUCT_FAMILY_BARE - CFBundlePackageType - APPL - CFBundleShortVersionString - PRODUCT_VER_BARE - CFBundleSignature - Step - CFBundleVersion - PRODUCT_VER_BARE - LSMinimumSystemVersion - 10.4.10 - NSHumanReadableCopyright - Copyright 2001-2010 - NSPrincipalClass - SMApplication - - + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + smzip + + CFBundleTypeIconFile + smicon.icns + CFBundleTypeMIMETypes + + application/zip + + CFBundleTypeName + SMZip + CFBundleTypeRole + Editor + LSTypeIsPackage + + NSPersistentStoreTypeKey + Binary + + + CFBundleExecutable + EXECUTABLE_NAME + CFBundleGetInfoString + PRODUCT_FAMILY_BARE PRODUCT_VER_BARE + CFBundleIconFile + smicon.icns + CFBundleIdentifier + com.PRODUCT_ID_BARE + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + PRODUCT_FAMILY_BARE + CFBundlePackageType + APPL + CFBundleShortVersionString + PRODUCT_VER_BARE + CFBundleSignature + Step + CFBundleVersion + PRODUCT_VER_BARE + LSMinimumSystemVersion + 10.4.10 + NSHumanReadableCopyright + Copyright 2001-2011 + NSPrincipalClass + SMApplication + + diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index a218726db4..97d4084dcc 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -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,16 +7112,20 @@ 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; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; 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 +7636,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,16 +7648,20 @@ 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; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; 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 +7971,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,16 +7983,20 @@ 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; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; 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 +8100,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,16 +8112,20 @@ 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; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; 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; diff --git a/src/ArrowEffects.cpp b/src/ArrowEffects.cpp index 9bd4271627..61c9dc0db5 100644 --- a/src/ArrowEffects.cpp +++ b/src/ArrowEffects.cpp @@ -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(floor(pStyle->m_iColsPerPlayer/2.0f)); if( iColNum > iMiddleColumn-1 ) fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*-(fYOffset); else diff --git a/src/Attack.cpp b/src/Attack.cpp index 76eab656bc..f15fdb7cae 100644 --- a/src/Attack.cpp +++ b/src/Attack.cpp @@ -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; diff --git a/src/Attack.h b/src/Attack.h index 8ce4b7942c..30f87589cf 100644 --- a/src/Attack.h +++ b/src/Attack.h @@ -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; diff --git a/src/AutoKeysounds.cpp b/src/AutoKeysounds.cpp index 8a7fed000c..76d6955598 100644 --- a/src/AutoKeysounds.cpp +++ b/src/AutoKeysounds.cpp @@ -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); } diff --git a/src/BGAnimation.cpp b/src/BGAnimation.cpp index dd93e73a8a..eb4fc80c4e 100644 --- a/src/BGAnimation.cpp +++ b/src/BGAnimation.cpp @@ -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 ); } } } diff --git a/src/Background.cpp b/src/Background.cpp index 0d3e398506..0c4005c1a7 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -746,9 +746,9 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus if( !change.m_sTransition.empty() ) { - map::const_iterator iter = mapNameToTransition.find( change.m_sTransition ); - ASSERT( iter != mapNameToTransition.end() ); - const BackgroundTransition &bt = iter->second; + map::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 ); } diff --git a/src/BeginnerHelper.cpp b/src/BeginnerHelper.cpp index 2372cd1ca7..1154b0b96c 100644 --- a/src/BeginnerHelper.cpp +++ b/src/BeginnerHelper.cpp @@ -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 ); diff --git a/src/Character.cpp b/src/Character.cpp index a925c8b563..82146c5b69 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -5,10 +5,9 @@ #include "RageTextureID.h" #include "ActorUtil.h" -Character::Character() -{ - m_iPreloadRefcount = 0; -} +Character::Character(): m_sCharDir(""), m_sCharacterID(""), + m_sDisplayName(""), m_sCardPath(""), m_sIconPath(""), + m_bUsableInRave(false), m_iPreloadRefcount(0) {} bool Character::Load( RString sCharDir ) { diff --git a/src/Course.cpp b/src/Course.cpp index 3dbd02ed67..50c75ec04f 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -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 &vpSongs = mapSongToSteps[resolved.pSong]; - resolved.pSteps = vpSongs[ RandomInt(vpSongs.size()) ]; + const vector &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; } diff --git a/src/Course.h b/src/Course.h index b83b627334..772871ab30 100644 --- a/src/Course.h +++ b/src/Course.h @@ -55,18 +55,9 @@ public: float fGainSeconds; // time gained back at the beginning of the song. LifeMeterTime only. int iGainLives; // lives gained back at the beginning of the next song - CourseEntry() - { - bSecret = false; - bNoDifficult = false; - - songSort = SongSort_Randomize; - iChooseIndex = 0; - - sModifiers = ""; - fGainSeconds = 0; - iGainLives = -1; - } + CourseEntry(): bSecret(false), bNoDifficult(false), + songSort(SongSort_Randomize), iChooseIndex(0), + sModifiers(RString("")), fGainSeconds(0), iGainLives(-1) {} bool IsFixedSong() const { return songID.IsValid(); } diff --git a/src/CourseUtil.cpp b/src/CourseUtil.cpp index 38278bc31f..23a74dbe23 100644 --- a/src/CourseUtil.cpp +++ b/src/CourseUtil.cpp @@ -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(pCourse->m_fGoalSeconds); } void EditCourseUtil::GetAllEditCourses( vector &vpCoursesOut ) diff --git a/src/Font.cpp b/src/Font.cpp index ca95e58605..d8c7d142eb 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -311,15 +311,15 @@ const glyph &Font::GetGlyph( wchar_t c ) const bool Font::FontCompleteForString( const wstring &str ) const { - map::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); - if( m_pDefault == m_iCharToGlyph.end() ) + map::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); } diff --git a/src/Foreground.cpp b/src/Foreground.cpp index 84caac9025..4e75cd0b79 100644 --- a/src/Foreground.cpp +++ b/src/Foreground.cpp @@ -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 ) { diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index 4083307c14..43783b8b41 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -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; } diff --git a/src/GameState.cpp b/src/GameState.cpp index 989e31c234..72fb165a55 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -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; diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index 34c82c783e..d1a40a3d76 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -1093,12 +1093,12 @@ void InputMappings::ReadMappings( const InputScheme *pInputScheme, RString sFile vector sDeviceInputStrings; split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false ); - for( unsigned i=0; isecond.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; } } diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index aa2a9df622..f557955492 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -250,8 +250,8 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS for( int t=0; tsecond; @@ -629,12 +629,9 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ) int iMaxTailRow = -1; for( int t=0; tm_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; c2GetNumTracks(); 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 && idisplay[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; } diff --git a/src/NoteSkinManager.cpp b/src/NoteSkinManager.cpp index 4607d43529..0ec178b3ab 100644 --- a/src/NoteSkinManager.cpp +++ b/src/NoteSkinManager.cpp @@ -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 } diff --git a/src/NoteTypes.h b/src/NoteTypes.h index 9bee6d5b54..4c23f1576f 100644 --- a/src/NoteTypes.h +++ b/src/NoteTypes.h @@ -204,6 +204,29 @@ extern TapNote TAP_ORIGINAL_FAKE; // 'F' extern TapNote TAP_ADDITION_TAP; extern TapNote TAP_ADDITION_MINE; +/** + * @brief Retrieve the string representing the TapNote Type. + * + * TODO: Find a way to standardize this with the other enum string calls. + * @param tn the TapNote's type. + * @return the intended string. */ +inline const RString TapNoteTypeToString( TapNote::Type tn ) +{ + switch( tn ) + { + case TapNote::empty: return RString("empty"); + case TapNote::tap: return RString("tap"); + case TapNote::hold_head: return RString("hold_head"); + case TapNote::hold_tail: return RString("hold_tail"); + case TapNote::mine: return RString("mine"); + case TapNote::lift: return RString("lift"); + case TapNote::attack: return RString("attack"); + case TapNote::autoKeysound: return RString("autoKeysound"); + case TapNote::fake: return RString("fake"); + default: return RString(); + } +} + /** * @brief The number of tracks allowed. * diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index acd4dabf37..4832fa78da 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -476,9 +476,9 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo if( sNoteId != "00" ) { vTapNotes.push_back( TAP_ORIGINAL_TAP ); - map::const_iterator it = idToKeySoundIndex.find( sNoteId ); - if( it != idToKeySoundIndex.end() ) - vTapNotes.back().iKeysoundIndex = it->second; + map::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 ) diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index 96f5375e1e..fb8dfbe298 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -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 ); diff --git a/src/NotesLoaderPMS.cpp b/src/NotesLoaderPMS.cpp index 1b9f7a68d6..32555f71d0 100644 --- a/src/NotesLoaderPMS.cpp +++ b/src/NotesLoaderPMS.cpp @@ -408,9 +408,9 @@ static bool LoadFromPMSFile( const RString &sPath, const NameToData_t &mapNameTo if( sNoteId != "00" ) { vTapNotes.push_back( TAP_ORIGINAL_TAP ); - map::const_iterator it = idToKeySoundIndex.find( sNoteId ); - if( it != idToKeySoundIndex.end() ) - vTapNotes.back().iKeysoundIndex = it->second; + map::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 ); diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 9b3b3e9ff8..c2aa663825 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -37,6 +37,7 @@ void SMLoader::LoadFromSMTokens( // insert stepstype hacks from GameManager.cpp here? -aj out.m_StepsType = GAMEMAN->StringToStepsType( sStepsType ); out.SetDescription( sDescription ); + out.SetCredit( sDescription ); // this is often used for both. out.SetDifficulty( DwiCompatibleStringToDifficulty(sDifficulty) ); // Handle hacks that originated back when StepMania didn't have @@ -413,9 +414,9 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) if(arrayWarpsFromNegativeBPMs.size() > 0) { // zomg we already have some warps... - for( unsigned i=0; i USE_CREDIT ( "NotesWriterSM", "DescriptionUsesCreditField" ); /** * @brief Turn the BackgroundChange into a string. @@ -268,7 +271,8 @@ static RString GetSMNotesTag( const Song &song, const Steps &in ) GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName, SmEscape(in.GetDescription()).c_str()) ); lines.push_back( song.m_vsKeysoundFile.empty() ? "#NOTES:" : "#NOTES2:" ); lines.push_back( ssprintf( " %s:", GAMEMAN->GetStepsTypeInfo(in.m_StepsType).szName ) ); - lines.push_back( ssprintf( " %s:", SmEscape(in.GetDescription()).c_str() ) ); + RString desc = (USE_CREDIT ? in.GetCredit() : in.GetDescription()); + lines.push_back( ssprintf( " %s:", SmEscape(desc).c_str() ) ); lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); diff --git a/src/OptionRow.cpp b/src/OptionRow.cpp index f6d699af8a..dc72b34e47 100644 --- a/src/OptionRow.cpp +++ b/src/OptionRow.cpp @@ -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 ) { diff --git a/src/OptionRowHandler.cpp b/src/OptionRowHandler.cpp index 2962f963c3..8010b10d3a 100644 --- a/src/OptionRowHandler.cpp +++ b/src/OptionRowHandler.cpp @@ -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; iGetX(); - m_iOriginalRightX = m_sprRight->GetX(); + m_iOriginalLeftX = static_cast(m_sprLeft->GetX()); + m_iOriginalRightX = static_cast(m_sprRight->GetX()); if( bLoadCanGos ) { - m_iOriginalCanGoLeftX = m_sprCanGoLeft->GetX(); - m_iOriginalCanGoRightX = m_sprCanGoRight->GetX(); + m_iOriginalCanGoLeftX = static_cast(m_sprCanGoLeft->GetX()); + m_iOriginalCanGoRightX = static_cast(m_sprCanGoRight->GetX()); } SetCanGo( false, false ); diff --git a/src/OptionsList.cpp b/src/OptionsList.cpp index 1a09c1378e..791729e492 100644 --- a/src/OptionsList.cpp +++ b/src/OptionsList.cpp @@ -138,17 +138,17 @@ void OptionListRow::SetUnderlines( const vector &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 &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second; - for( unsigned i=0; iBroadcast( 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 ) diff --git a/src/Player.cpp b/src/Player.cpp index cc2d2fafa2..6b90b9468e 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -175,8 +175,15 @@ ThemeMetric REQUIRE_STEP_ON_MINES ( "Player", "RequireStepOnMines" ); * For those wishing to make a theme very accurate to In The Groove 2, set this to false. */ ThemeMetric ROLL_BODY_INCREMENTS_COMBO ( "Player", "RollBodyIncrementsCombo" ); ThemeMetric CHECKPOINTS_TAPS_SEPARATE_JUDGMENT ( "Player", "CheckpointsTapsSeparateJudgment" ); -ThemeMetric SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" ); // sm-ssc addition +/** + * @brief Do we score missed holds and rolls with HoldNoteScores? + * + * If set to true, missed holds and rolls are given LetGo judgments. + * If set to false, missed holds and rolls are given no judgment on the hold side of things. */ +ThemeMetric SCORE_MISSED_HOLDS_AND_ROLLS ( "Player", "ScoreMissedHoldsAndRolls" ); +/** @brief How much of the song/course must have gone by before a Player's combo is colored? */ ThemeMetric PERCENT_UNTIL_COLOR_COMBO ( "Player", "PercentUntilColorCombo" ); +/** @brief How much combo must be earned before the announcer says "Combo Stopped"? */ ThemeMetric COMBO_STOPPED_AT ( "Player", "ComboStoppedAt" ); ThemeMetric ATTACK_RUN_TIME_RANDOM ( "Player", "AttackRunTimeRandom" ); ThemeMetric ATTACK_RUN_TIME_MINE ( "Player", "AttackRunTimeMine" ); @@ -2810,16 +2817,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 +3200,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(floor(iSongIndexStartColoring*PERCENT_UNTIL_COLOR_COMBO)); bPastBeginning = GAMESTATE->GetCourseSongIndex() >= iSongIndexStartColoring; } else diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index 62a4dab610..76a1b30650 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -12,8 +12,6 @@ #include "CommonMetrics.h" #include -#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; } - ThemeMetric RANDOM_SPEED_CHANCE ( "PlayerOptions", "RandomSpeedChance" ); ThemeMetric RANDOM_REVERSE_CHANCE ( "PlayerOptions", "RandomReverseChance" ); ThemeMetric RANDOM_DARK_CHANCE ( "PlayerOptions", "RandomDarkChance" ); diff --git a/src/PlayerOptions.h b/src/PlayerOptions.h index e18095b008..aeb1c49b08 100644 --- a/src/PlayerOptions.h +++ b/src/PlayerOptions.h @@ -7,13 +7,42 @@ class Steps; class Trail; struct lua_State; +#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYLEN(arr); ++Z ) arr[Z]=1.0f; } + #include "GameConstantsAndTypes.h" #include "PlayerNumber.h" /** @brief Per-player options that are not saved between sessions. */ class PlayerOptions { public: - PlayerOptions() { Init(); }; + /** + * @brief Set up the PlayerOptions with some reasonable defaults. + * + * This code was taken from Init() to use proper initialization. */ + PlayerOptions(): m_bSetScrollSpeed(false), + m_fTimeSpacing(0), m_SpeedfTimeSpacing(1.0f), + m_fScrollSpeed(1.0f), m_SpeedfScrollSpeed(1.0f), + m_fScrollBPM(200), m_SpeedfScrollBPM(1.0f), + m_fDark(0), m_SpeedfDark(1.0f), + m_fBlind(0), m_SpeedfBlind(1.0f), + m_fCover(0), m_SpeedfCover(1.0f), + m_fRandAttack(0), m_SpeedfRandAttack(1.0f), + m_fSongAttack(0), m_SpeedfSongAttack(1.0f), + m_fPlayerAutoPlay(0), m_SpeedfPlayerAutoPlay(1.0f), + m_bSetTiltOrSkew(false), + m_fPerspectiveTilt(0), m_SpeedfPerspectiveTilt(1.0f), + m_fSkew(0), m_SpeedfSkew(1.0f), + m_fPassmark(0), m_SpeedfPassmark(1.0f), + m_fRandomSpeed(0), m_SpeedfRandomSpeed(1.0f), + m_bMuteOnError(false), m_FailType(FAIL_IMMEDIATE), + m_ScoreDisplay(SCORING_ADD), m_sNoteSkin("") + { + ZERO( m_fAccels ); ONE( m_SpeedfAccels ); + ZERO( m_fEffects ); ONE( m_SpeedfEffects ); + ZERO( m_fAppearances ); ONE( m_SpeedfAppearances ); + ZERO( m_fScrolls ); ONE( m_SpeedfScrolls ); + ZERO( m_bTurns ); ZERO( m_bTransforms ); + }; void Init(); void Approach( const PlayerOptions& other, float fDeltaSeconds ); RString GetString( bool bForceNoteSkin = false ) const; diff --git a/src/Profile.cpp b/src/Profile.cpp index b3d48827d6..4c12baf2f7 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -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] ); } } } diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 81f1f40ff9..2418821c60 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -489,10 +489,10 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID ) g_vLocalProfile.erase( i ); // Delete all references to this profileID - FOREACH_CONST( Preference*, m_sDefaultLocalProfileID.m_v, i ) + FOREACH_CONST( Preference*, m_sDefaultLocalProfileID.m_v, j ) { - if( (*i)->Get() == sProfileID ) - (*i)->Set( "" ); + if( (*j)->Get() == sProfileID ) + (*j)->Set( "" ); } return true; } diff --git a/src/RageDisplay.cpp b/src/RageDisplay.cpp index c027ebddb6..a3ba6bd2c8 100644 --- a/src/RageDisplay.cpp +++ b/src/RageDisplay.cpp @@ -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(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() ); diff --git a/src/RageDisplay.h b/src/RageDisplay.h index efb47d9687..6ff505ffd9 100644 --- a/src/RageDisplay.h +++ b/src/RageDisplay.h @@ -71,6 +71,7 @@ enum PixelFormat }; const RString& PixelFormatToString( PixelFormat i ); +/** @brief The parameters used for the present Video Mode. */ class VideoModeParams { public: @@ -91,24 +92,27 @@ public: RString sIconFile_, bool PAL_, float fDisplayAspectRatio_ - ) - { - windowed = windowed_; - width = width_; - height = height_; - bpp = bpp_; - rate = rate_; - vsync = vsync_; - interlaced = interlaced_; - bSmoothLines = bSmoothLines_; - bTrilinearFiltering = bTrilinearFiltering_; - bAnisotropicFiltering = bAnisotropicFiltering_; - sWindowTitle = sWindowTitle_; - sIconFile = sIconFile_; - PAL = PAL_; - fDisplayAspectRatio = fDisplayAspectRatio_; - } - VideoModeParams() {} + ): + windowed(windowed_), + width(width_), + height(height_), + bpp(bpp_), + rate(rate_), + vsync(vsync_), + interlaced(interlaced_), + bSmoothLines(bSmoothLines_), + bTrilinearFiltering(bTrilinearFiltering_), + bAnisotropicFiltering(bAnisotropicFiltering_), + sWindowTitle(sWindowTitle_), + sIconFile(sIconFile_), + PAL(PAL_), + fDisplayAspectRatio(fDisplayAspectRatio_) {} + + VideoModeParams(): windowed(false), width(0), height(0), + bpp(0), rate(0), vsync(false), interlaced(false), + bSmoothLines(false), bTrilinearFiltering(false), + bAnisotropicFiltering(false), sWindowTitle(RString()), + sIconFile(RString()), PAL(false), fDisplayAspectRatio(0.0) {} bool windowed; int width; @@ -116,14 +120,14 @@ public: int bpp; int rate; bool vsync; + bool interlaced; bool bSmoothLines; bool bTrilinearFiltering; bool bAnisotropicFiltering; - bool interlaced; - bool PAL; - float fDisplayAspectRatio; RString sWindowTitle; RString sIconFile; + bool PAL; + float fDisplayAspectRatio; }; struct RenderTargetParam diff --git a/src/RageFile.h b/src/RageFile.h index 700f4de36f..0db14ca949 100644 --- a/src/RageFile.h +++ b/src/RageFile.h @@ -6,8 +6,11 @@ #include "RageFileBasic.h" struct lua_State; -/* This is the high-level interface, which interfaces with RageFileObj implementations - * and RageFileManager. */ +/** + * @brief High-level file access. + * + * This is the high-level interface, which interfaces with RageFileObj + * implementations and RageFileManager. */ class RageFile: public RageFileBasic { public: @@ -81,6 +84,9 @@ private: RString m_Path; RString m_sError; int m_Mode; + + // Swallow up warnings. If they must be used, define them. + RageFile& operator=(const RageFile& rhs); }; /** @brief Convenience wrappers for reading binary files. */ diff --git a/src/RageFileBasic.h b/src/RageFileBasic.h index 8e42cb7c01..dfefaec812 100644 --- a/src/RageFileBasic.h +++ b/src/RageFileBasic.h @@ -152,6 +152,9 @@ private: * file, and no seeking is performed. */ bool m_bCRC32Enabled; uint32_t m_iCRC32; + + // Swallow up warnings. If they must be used, define them. + RageFileObj& operator=(const RageFileObj& rhs); }; #endif diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index b0107a1997..8be422efac 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -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; diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index f1fad415d4..fde2f79bdf 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -377,8 +377,8 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector &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 ); } } } diff --git a/src/RageInputDevice.h b/src/RageInputDevice.h index d27e76134b..84230edd81 100644 --- a/src/RageInputDevice.h +++ b/src/RageInputDevice.h @@ -60,12 +60,9 @@ inline bool IsMouse( InputDevice id ) { return id == DEVICE_MOUSE; } struct InputDeviceInfo { - InputDeviceInfo( InputDevice id_, RString sDesc_ ) - { - id = id_; - sDesc = sDesc_; - } - + InputDeviceInfo( InputDevice id_, RString sDesc_ ): + id(id_), sDesc(sDesc_) {} + InputDevice id; RString sDesc; @@ -317,22 +314,22 @@ public: * (0..1). This should be 0 for analog axes within the dead zone. */ float level; - /* Whether this button is pressed. This is level with a threshold and - * debouncing applied. */ - bool bDown; - // Mouse coordinates unsigned x; unsigned y; + /* Whether this button is pressed. This is level with a threshold and + * debouncing applied. */ + bool bDown; + RageTimer ts; - DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), bDown(false), ts(RageZeroTimer) { } - DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), bDown(l > 0.5f), ts(RageZeroTimer) { } + DeviceInput(): device(InputDevice_Invalid), button(DeviceButton_Invalid), level(0), x(0), y(0), bDown(false), ts(RageZeroTimer) { } + DeviceInput( InputDevice d, DeviceButton b, float l=0 ): device(d), button(b), level(l), x(0), y(0), bDown(l > 0.5f), ts(RageZeroTimer) { } DeviceInput( InputDevice d, DeviceButton b, float l, const RageTimer &t ): - device(d), button(b), level(l), bDown(level > 0.5f), ts(t) { } + device(d), button(b), level(l), x(0), y(0), bDown(level > 0.5f), ts(t) { } DeviceInput( InputDevice d, DeviceButton b, const RageTimer &t, unsigned xPos=0, unsigned yPos=0 ): - device(d), button(b), x(xPos), y(yPos), bDown(false), ts(t) { } + device(d), button(b), level(0), x(xPos), y(yPos), bDown(false), ts(t) { } bool operator==( const DeviceInput &other ) const { diff --git a/src/RageLog.cpp b/src/RageLog.cpp index 700f66c79a..4cedc14c11 100644 --- a/src/RageLog.cpp +++ b/src/RageLog.cpp @@ -78,19 +78,14 @@ enum WRITE_LOUD = 0x04 }; -RageLog::RageLog() +RageLog::RageLog(): m_bLogToDisk(false), m_bInfoToDisk(false), +m_bUserLogToDisk(false), m_bFlush(false), m_bShowLogOutput(false) { g_fileLog = new RageFile; g_fileInfo = new RageFile; g_fileUserLog = new RageFile; g_Mutex = new RageMutex( "Log" ); - - m_bLogToDisk = false; - m_bInfoToDisk = false; - m_bUserLogToDisk = false; - m_bFlush = false; - m_bShowLogOutput = false; } RageLog::~RageLog() diff --git a/src/RageMath.cpp b/src/RageMath.cpp index cdeeced8d0..317e8fe50a 100644 --- a/src/RageMath.cpp +++ b/src/RageMath.cpp @@ -575,8 +575,8 @@ float RageFastSin( float x ) bInited = true; for( unsigned i=0; iGetSampleRate() RageSoundParams::RageSoundParams(): - m_StartTime( RageZeroTimer ) -{ - m_StartSecond = 0; - m_LengthSeconds = -1; - m_fFadeInSeconds = 0; - m_fFadeOutSeconds = 0; - m_Volume = 1.0f; - m_fAttractVolume = 1.0f; - m_fPitch = 1.0f; - m_fSpeed = 1.0f; - StopMode = M_AUTO; - m_bIsCriticalSound = false; -} + m_StartSecond(0), m_LengthSeconds(-1), m_fFadeInSeconds(0), + m_fFadeOutSeconds(0), m_Volume(1.0f), m_fAttractVolume(1.0f), + m_fPitch(1.0f), m_fSpeed(1.0f), m_StartTime( RageZeroTimer ), + StopMode(M_AUTO), m_bIsCriticalSound(false) {} -RageSoundLoadParams::RageSoundLoadParams() -{ - m_bSupportRateChanging = false; - m_bSupportPan = false; -} +RageSoundLoadParams::RageSoundLoadParams(): + m_bSupportRateChanging(false), m_bSupportPan(false) {} RageSound::RageSound(): - m_Mutex( "RageSound" ) + m_Mutex( "RageSound" ), m_pSource(NULL), m_iStreamFrame(0), + m_iStoppedSourceFrame(0), m_bPlaying(false), + m_bDeleteWhenFinished(false) { ASSERT( SOUNDMAN ); - - m_pSource = NULL; - m_iStreamFrame = 0; - m_iStoppedSourceFrame = 0; - m_bPlaying = false; - m_bDeleteWhenFinished = false; } RageSound::~RageSound() diff --git a/src/RageSound.h b/src/RageSound.h index 71b6662a6f..69cbe49a12 100644 --- a/src/RageSound.h +++ b/src/RageSound.h @@ -22,7 +22,10 @@ public: virtual RString GetLoadedFilePath() const = 0; }; -/* These are parameters to play a sound. These are normally changed before playing begins, +/** + * @brief The parameters to play a sound. + * + * These are normally changed before playing begins, * and are constant from then on. */ struct RageSoundParams { @@ -50,17 +53,13 @@ struct RageSoundParams * If zero, or if not supported, the sound will start immediately. */ RageTimer m_StartTime; - /* M_STOP stops the sound at the end. - * M_LOOP restarts. - * M_CONTINUE feeds silence, which is useful to continue timing longer than the actual sound. - * M_AUTO (default) stops, obeying filename hints. - */ + /** @brief How does the sound stop itself, if it does? */ enum StopMode_t { - M_STOP, - M_LOOP, - M_CONTINUE, - M_AUTO - } StopMode; + M_STOP, /**< The sound is stopped at the end. */ + M_LOOP, /**< The sound restarts itself. */ + M_CONTINUE, /**< Silence is fed at the end to continue timing longer than the sound. */ + M_AUTO /**< The default, the sound stops while obeying filename hints. */ + } /** @brief How does the sound stop itself, if it does? */ StopMode; bool m_bIsCriticalSound; // "is a sound that should be played even during attract" }; diff --git a/src/RageSoundManager.cpp b/src/RageSoundManager.cpp index a389f9d641..77034bd1e0 100644 --- a/src/RageSoundManager.cpp +++ b/src/RageSoundManager.cpp @@ -35,11 +35,8 @@ static Preference g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAU RageSoundManager *SOUNDMAN = NULL; -RageSoundManager::RageSoundManager() -{ - m_fMixVolume = 1.0f; - m_fVolumeOfNonCriticalSounds = 1.0f; -} +RageSoundManager::RageSoundManager(): m_pDriver(NULL), m_fMixVolume(1.0f), + m_fVolumeOfNonCriticalSounds(1.0f) {} static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" ); void RageSoundManager::Init() diff --git a/src/RageSoundManager.h b/src/RageSoundManager.h index 37525356ab..e558eb32d2 100644 --- a/src/RageSoundManager.h +++ b/src/RageSoundManager.h @@ -53,6 +53,9 @@ private: /* Prefs: */ float m_fMixVolume; float m_fVolumeOfNonCriticalSounds; + // Swallow up warnings. If they must be used, define them. + RageSoundManager& operator=(const RageSoundManager& rhs); + RageSoundManager(const RageSoundManager& rhs); }; extern RageSoundManager *SOUNDMAN; diff --git a/src/RageSoundReader_Chain.cpp b/src/RageSoundReader_Chain.cpp index 29a73c0feb..6b3a1b9ae2 100644 --- a/src/RageSoundReader_Chain.cpp +++ b/src/RageSoundReader_Chain.cpp @@ -33,7 +33,6 @@ RageSoundReader_Chain::~RageSoundReader_Chain() while( !m_apActiveSounds.empty() ) ReleaseSound( m_apActiveSounds.front() ); - map::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::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::iterator it; FOREACH( RageSoundReader *, m_apLoadedSounds, it ) m_iChannels = max( m_iChannels, (*it)->GetNumChannels() ); diff --git a/src/RageSoundReader_MP3.cpp b/src/RageSoundReader_MP3.cpp index 7fc389bc89..7af0a70c9b 100644 --- a/src/RageSoundReader_MP3.cpp +++ b/src/RageSoundReader_MP3.cpp @@ -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; diff --git a/src/RageSoundReader_Merge.cpp b/src/RageSoundReader_Merge.cpp index 78c3e2b93f..f6c25e6a17 100644 --- a/src/RageSoundReader_Merge.cpp +++ b/src/RageSoundReader_Merge.cpp @@ -18,7 +18,6 @@ RageSoundReader_Merge::RageSoundReader_Merge() RageSoundReader_Merge::~RageSoundReader_Merge() { - map::iterator it; FOREACH( RageSoundReader *, m_aSounds, it ) delete *it; } diff --git a/src/RageSoundReader_PitchChange.h b/src/RageSoundReader_PitchChange.h index 454ec12102..c7168f85ce 100644 --- a/src/RageSoundReader_PitchChange.h +++ b/src/RageSoundReader_PitchChange.h @@ -29,6 +29,8 @@ private: float m_fPitchRatio; float m_fLastSetSpeedRatio; float m_fLastSetPitchRatio; + // Swallow up warnings. If they must be used, define them. + RageSoundReader_PitchChange& operator=(const RageSoundReader_PitchChange& rhs); }; #endif diff --git a/src/RageSoundReader_Preload.cpp b/src/RageSoundReader_Preload.cpp index 04dae7c10b..2358681331 100644 --- a/src/RageSoundReader_Preload.cpp +++ b/src/RageSoundReader_Preload.cpp @@ -34,7 +34,8 @@ bool RageSoundReader_Preload::PreloadSound( RageSoundReader *&pSound ) } RageSoundReader_Preload::RageSoundReader_Preload(): - m_Buffer( new RString ) + m_Buffer( new RString ), m_bBufferIs16Bit(false), + m_iPosition(0), m_iSampleRate(0), m_iChannels(0), m_fRate(0.0f) { m_bBufferIs16Bit = g_bSoundPreload16bit.Get(); } diff --git a/src/RageSoundReader_ThreadedBuffer.h b/src/RageSoundReader_ThreadedBuffer.h index f13069251d..edb5295c5d 100644 --- a/src/RageSoundReader_ThreadedBuffer.h +++ b/src/RageSoundReader_ThreadedBuffer.h @@ -53,7 +53,8 @@ private: int iFramesBuffered; int iPositionOfFirstFrame; float fRate; - Mapping() { iFramesBuffered = iPositionOfFirstFrame = 0; fRate = 1.0f; } + Mapping(): iFramesBuffered(0), iPositionOfFirstFrame(0), + fRate(1.0f) {} }; list m_StreamPosition; diff --git a/src/RageSurface.h b/src/RageSurface.h index e6eb8fa92b..73c873133c 100644 --- a/src/RageSurface.h +++ b/src/RageSurface.h @@ -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_) { } diff --git a/src/RageSurfaceUtils.cpp b/src/RageSurfaceUtils.cpp index d9258633d0..e759d45449 100644 --- a/src/RageSurfaceUtils.cpp +++ b/src/RageSurfaceUtils.cpp @@ -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. diff --git a/src/RageSurfaceUtils_Palettize.cpp b/src/RageSurfaceUtils_Palettize.cpp index 6a0a0aabc2..9103ea6591 100644 --- a/src/RageSurfaceUtils_Palettize.cpp +++ b/src/RageSurfaceUtils_Palettize.cpp @@ -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 diff --git a/src/RageTexture.cpp b/src/RageTexture.cpp index c1eed7d324..ecad7eb785 100644 --- a/src/RageTexture.cpp +++ b/src/RageTexture.cpp @@ -7,16 +7,11 @@ RageTexture::RageTexture( RageTextureID name ): - m_ID(name) -{ - m_iRefCount = 1; - m_bWasUsed = false; - - m_iSourceWidth = m_iSourceHeight = 0; - m_iTextureWidth = m_iTextureHeight = 0; - m_iImageWidth = m_iImageHeight = 0; - m_iFramesWide = m_iFramesHigh = 1; -} + m_ID(name), m_iRefCount(1), m_bWasUsed(false), + m_iSourceWidth(0), m_iSourceHeight(0), + m_iTextureWidth(0), m_iTextureHeight(0), + m_iImageWidth(0), m_iImageHeight(0), + m_iFramesWide(1), m_iFramesHigh(1) {} RageTexture::~RageTexture() diff --git a/src/RageTextureID.h b/src/RageTextureID.h index 4d3b1c43ed..0825b7e626 100644 --- a/src/RageTextureID.h +++ b/src/RageTextureID.h @@ -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 ); }; diff --git a/src/RageTextureManager.cpp b/src/RageTextureManager.cpp index 9cdb2570ee..9e3af1eed5 100644 --- a/src/RageTextureManager.cpp +++ b/src/RageTextureManager.cpp @@ -36,11 +36,9 @@ namespace map m_mapPathToTexture; }; -RageTextureManager::RageTextureManager() -{ - m_iNoWarnAboutOddDimensions = 0; - m_TexturePolicy = RageTextureID::TEX_DEFAULT; -} +RageTextureManager::RageTextureManager(): + m_iNoWarnAboutOddDimensions(0), + m_TexturePolicy(RageTextureID::TEX_DEFAULT) {} RageTextureManager::~RageTextureManager() { @@ -106,9 +104,8 @@ class RageTexture_Default: public RageTexture { public: RageTexture_Default(): - RageTexture( RageTextureID() ) + RageTexture( RageTextureID() ), m_uTexHandle(0) { - m_uTexHandle = 0; m_iSourceWidth = m_iSourceHeight = 1; m_iTextureWidth = m_iTextureHeight = 1; m_iImageWidth = m_iImageHeight = 1; diff --git a/src/RageTextureManager.h b/src/RageTextureManager.h index 06c0f525ec..33ab3e81bc 100644 --- a/src/RageTextureManager.h +++ b/src/RageTextureManager.h @@ -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 { diff --git a/src/RageThreads.cpp b/src/RageThreads.cpp index 3f3caf6305..f806c6867b 100644 --- a/src/RageThreads.cpp +++ b/src/RageThreads.cpp @@ -65,7 +65,8 @@ struct ThreadSlot int m_iCurCheckpoint, m_iNumCheckpoints; const char *GetFormattedCheckpoint( int lineno ); - ThreadSlot() { Init(); } + ThreadSlot(): m_bUsed(false), m_iID(GetInvalidThreadId()), + m_pImpl(NULL), m_iCurCheckpoint(0), m_iNumCheckpoints(0) {} void Init() { m_iID = GetInvalidThreadId(); @@ -206,18 +207,11 @@ static ThreadSlot *GetUnknownThreadSlot() return g_pUnknownThreadSlot; } -RageThread::RageThread() -{ - m_pSlot = NULL; - m_sName = "unnamed"; -} +RageThread::RageThread(): m_pSlot(NULL), m_sName("unnamed") {} -RageThread::RageThread( const RageThread &cpy ) -{ - /* Copying a thread does not start the copy. */ - m_pSlot = NULL; - m_sName = cpy.m_sName; -} +/* Copying a thread does not start the copy. */ +RageThread::RageThread( const RageThread &cpy ): + m_pSlot(NULL), m_sName(cpy.m_sName) {} RageThread::~RageThread() { @@ -520,12 +514,9 @@ static set *g_FreeMutexIDs = NULL; #endif RageMutex::RageMutex( const RString &name ): - m_sName( name ) + m_sName( name ), m_pMutex( MakeMutex (this ) ), + m_LockedBy(GetInvalidThreadId()), m_LockCnt(0) { - m_pMutex = MakeMutex( this ); - m_LockedBy = GetInvalidThreadId(); - m_LockCnt = 0; - /* if( g_FreeMutexIDs == NULL ) { @@ -659,7 +650,8 @@ LockMutex::LockMutex( RageMutex &pMutex, const char *file_, int line_ ): mutex( pMutex ), file( file_ ), line( line_ ), - locked_at( RageTimer::GetTimeSinceStart() ) + locked_at( RageTimer::GetTimeSinceStart() ), + locked(false) // ensure it gets locked inside. { mutex.Lock(); locked = true; @@ -687,10 +679,7 @@ void LockMutex::Unlock() } RageEvent::RageEvent( RString name ): - RageMutex( name ) -{ - m_pEvent = MakeEvent( m_pMutex ); -} + RageMutex( name ), m_pEvent(MakeEvent(m_pMutex)) {} RageEvent::~RageEvent() { @@ -732,10 +721,7 @@ bool RageEvent::WaitTimeoutSupported() const } RageSemaphore::RageSemaphore( RString sName, int iInitialValue ): - m_sName( sName ) -{ - m_pSema = MakeSemaphore( iInitialValue ); -} + m_sName( sName ), m_pSema(MakeSemaphore( iInitialValue )) {} RageSemaphore::~RageSemaphore() { diff --git a/src/RageThreads.h b/src/RageThreads.h index 3de42782d1..d0af4fcc6e 100644 --- a/src/RageThreads.h +++ b/src/RageThreads.h @@ -46,6 +46,9 @@ private: static bool s_bSystemSupportsTLS; static bool s_bIsShowingDialog; + + // Swallow up warnings. If they must be used, define them. + RageThread& operator=(const RageThread& rhs); }; /** @@ -61,6 +64,9 @@ public: private: ThreadSlot *m_pSlot; + // Swallow up warnings. If they must be used, define them. + RageThreadRegister& operator=(const RageThreadRegister& rhs); + RageThreadRegister(const RageThreadRegister& rhs); }; namespace Checkpoints @@ -102,6 +108,10 @@ protected: int m_LockCnt; void MarkLockedMutex(); +private: + // Swallow up warnings. If they must be used, define them. + RageMutex& operator=(const RageMutex& rhs); + RageMutex(const RageMutex& rhs); }; /** @@ -128,6 +138,9 @@ public: * * This can only be called once. */ void Unlock(); +private: + // Swallow up warnings. If they must be used, define them. + LockMutex& operator=(const LockMutex& rhs); }; #define LockMut(m) LockMutex UNIQUE_NAME(LocalLock) (m, __FILE__, __LINE__) @@ -149,6 +162,9 @@ public: void Signal(); void Broadcast(); bool WaitTimeoutSupported() const; + // Swallow up warnings. If they must be used, define them. + RageEvent& operator=(const RageEvent& rhs); + RageEvent(const RageEvent& rhs); private: EventImpl *m_pEvent; @@ -170,6 +186,10 @@ public: private: SemaImpl *m_pSema; RString m_sName; + + // Swallow up warnings. If they must be used, define them. + RageSemaphore& operator=(const RageSemaphore& rhs); + RageSemaphore(const RageSemaphore& rhs); }; #endif diff --git a/src/RageTimer.h b/src/RageTimer.h index d0dd7935aa..d1d27201a2 100644 --- a/src/RageTimer.h +++ b/src/RageTimer.h @@ -6,7 +6,7 @@ class RageTimer { public: - RageTimer() { Touch(); } + RageTimer(): m_secs(0), m_us(0) { Touch(); } RageTimer( int secs, int us ): m_secs(secs), m_us(us) { } /* Time ago this RageTimer represents. */ diff --git a/src/RageTypes.h b/src/RageTypes.h index d4afc81358..5c328908b6 100644 --- a/src/RageTypes.h +++ b/src/RageTypes.h @@ -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 diff --git a/src/RageUtil.cpp b/src/RageUtil.cpp index 2433a8335f..257a7925d0 100644 --- a/src/RageUtil.cpp +++ b/src/RageUtil.cpp @@ -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 ); } diff --git a/src/RageUtil_AutoPtr.h b/src/RageUtil_AutoPtr.h index 5b56eac08c..01005c1724 100644 --- a/src/RageUtil_AutoPtr.h +++ b/src/RageUtil_AutoPtr.h @@ -27,22 +27,17 @@ class AutoPtrCopyOnWrite { public: /* This constructor only exists to make us work with STL containers. */ - inline AutoPtrCopyOnWrite() + inline AutoPtrCopyOnWrite(): m_pPtr(NULL), m_iRefCount(new int(1)) { - m_pPtr = NULL; - m_iRefCount = new int(1); } - explicit inline AutoPtrCopyOnWrite( T *p ) + explicit inline AutoPtrCopyOnWrite( T *p ): m_pPtr(p), m_iRefCount(new int(1)) { - m_pPtr = p; - m_iRefCount = new int(1); } - inline AutoPtrCopyOnWrite( const AutoPtrCopyOnWrite &rhs ) + inline AutoPtrCopyOnWrite( const AutoPtrCopyOnWrite &rhs ): + m_pPtr(rhs.m_pPtr), m_iRefCount(rhs.m_iRefCount) { - m_pPtr = rhs.m_pPtr; - m_iRefCount = rhs.m_iRefCount; ++(*m_iRefCount); } @@ -132,16 +127,11 @@ public: T& operator*() { return *m_pPtr; } T* operator->() { return m_pPtr; } - explicit HiddenPtr( T *p = NULL ) - { - m_pPtr = p; - } + explicit HiddenPtr( T *p = NULL ): m_pPtr(p) {} - HiddenPtr( const HiddenPtr &cpy ) + HiddenPtr( const HiddenPtr &cpy ): m_pPtr(NULL) { - if( cpy.m_pPtr == NULL ) - m_pPtr = NULL; - else + if( cpy.m_pPtr != NULL ) m_pPtr = HiddenPtrTraits::Copy( cpy.m_pPtr ); } diff --git a/src/RageUtil_CachedObject.h b/src/RageUtil_CachedObject.h index a7b1e94180..421c8d3328 100644 --- a/src/RageUtil_CachedObject.h +++ b/src/RageUtil_CachedObject.h @@ -112,9 +112,8 @@ class CachedObjectPointer public: typedef CachedObject Object; - CachedObjectPointer() + CachedObjectPointer() : m_pCache(NULL), m_bCacheIsSet(false) { - m_bCacheIsSet = false; Object::Register( this ); } diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index 109587ac00..aff049768e 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -488,7 +488,7 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) p += m_CustomComboBonusValue; } - p += m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier; + p += static_cast(m_pPlayerStageStats->m_iCurCombo * m_CustomComboMultiplier); if( m_iNumNotesHitThisRow == 2 ) p = (int)(p * m_DoubleNoteMultiplier); diff --git a/src/ScreenBookkeeping.cpp b/src/ScreenBookkeeping.cpp index 0e379589dc..4e12142e63 100644 --- a/src/ScreenBookkeeping.cpp +++ b/src/ScreenBookkeeping.cpp @@ -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) + "..."; diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index f4610870d6..ffe3e4e664 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -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); diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 5fba445970..2920784b4b 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -16,6 +16,7 @@ #include "LocalizedString.h" #include "NoteDataUtil.h" #include "NoteSkinManager.h" +#include "NoteTypes.h" #include "NotesWriterSM.h" #include "PrefsManager.h" #include "RageSoundManager.h" @@ -265,10 +266,11 @@ void ScreenEdit::InitEditMappings() m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_EditMappingsDeviceInput.button[EDIT_BUTTON_RIGHT_SIDE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); - m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); // m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_TAP_ATTACK][0] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); - m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); - m_EditMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); + + m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_LEFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cn); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_CYCLE_TAP_RIGHT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_Cm); m_EditMappingsDeviceInput.button [EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_UP); m_EditMappingsDeviceInput.hold[EDIT_BUTTON_SCROLL_SPEED_UP][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); @@ -327,10 +329,8 @@ void ScreenEdit::InitEditMappings() m_PlayMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); m_PlayMappingsMenuButton.button[EDIT_BUTTON_RETURN_TO_EDIT][1] = GAME_BUTTON_BACK; - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_MINE_OR_ROLL][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); - m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_LIFT][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); + m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT); + m_RecordMappingsDeviceInput.button[EDIT_BUTTON_LAY_ROLL][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LALT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_REMOVE_NOTE][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RALT); m_RecordMappingsDeviceInput.button[EDIT_BUTTON_RETURN_TO_EDIT][0] = DeviceInput(DEVICE_KEYBOARD, KEY_ESC); @@ -730,6 +730,8 @@ void ScreenEdit::Init() m_pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; m_bReturnToRecordMenuAfterPlay = false; m_fBeatToReturnTo = 0; + + m_selectedTap = TAP_ORIGINAL_TAP; GAMESTATE->m_bGameplayLeadIn.Set( true ); GAMESTATE->m_EditMode = EDIT_MODE.GetValue(); @@ -954,7 +956,7 @@ void ScreenEdit::Update( float fDeltaTime ) else if( fSecsHeld > RECORD_HOLD_SECONDS ) { // create or extend a hold or roll note - TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD; + TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD; tn.pn = m_InputPlayerNumber; m_NoteDataRecord.AddHoldNote( t, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat), tn ); @@ -1024,6 +1026,7 @@ static LocalizedString DESCRIPTION("ScreenEdit", "Description"); static LocalizedString CHART_STYLE("ScreenEdit", "Chart Style"); static LocalizedString MAIN_TITLE("ScreenEdit", "Main title"); static LocalizedString SUBTITLE("ScreenEdit", "Subtitle"); +static LocalizedString TAP_NOTE_TYPE("ScreenEdit", "Tap Note"); static LocalizedString TAP_STEPS("ScreenEdit", "Tap Steps"); static LocalizedString JUMPS("ScreenEdit", "Jumps"); static LocalizedString HANDS("ScreenEdit", "Hands"); @@ -1048,6 +1051,7 @@ static ThemeMetric DESCRIPTION_FORMAT("ScreenEdit", "DescriptionFormat" static ThemeMetric CHART_STYLE_FORMAT("ScreenEdit", "ChartStyleFormat"); static ThemeMetric MAIN_TITLE_FORMAT("ScreenEdit", "MainTitleFormat"); static ThemeMetric SUBTITLE_FORMAT("ScreenEdit", "SubtitleFormat"); +static ThemeMetric TAP_NOTE_TYPE_FORMAT("ScreenEdit", "TapNoteTypeFormat"); static ThemeMetric NUM_STEPS_FORMAT("ScreenEdit", "NumStepsFormat"); static ThemeMetric NUM_JUMPS_FORMAT("ScreenEdit", "NumJumpsFormat"); static ThemeMetric NUM_HOLDS_FORMAT("ScreenEdit", "NumHoldsFormat"); @@ -1116,6 +1120,7 @@ void ScreenEdit::UpdateTextInfo() sText += ssprintf( MAIN_TITLE_FORMAT.GetValue(), MAIN_TITLE.GetValue().c_str(), m_pSong->m_sMainTitle.c_str() ); if( m_pSong->m_sSubTitle.size() ) sText += ssprintf( SUBTITLE_FORMAT.GetValue(), SUBTITLE.GetValue().c_str(), m_pSong->m_sSubTitle.c_str() ); + sText += ssprintf( TAP_NOTE_TYPE_FORMAT.GetValue(), TAP_NOTE_TYPE.GetValue().c_str(), TapNoteTypeToString( m_selectedTap.type ).c_str() ); break; } sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() ); @@ -1296,43 +1301,48 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) m_NoteDataEdit.SetTapNote( iCol, iSongIndex, TAP_EMPTY ); // Don't CheckNumberOfNotesAndUndo. We don't want to revert any change that removes notes. } - else if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ) - { - m_soundAddNote.Play(); - SetDirty( true ); - SaveUndo(); - TapNote tn = TAP_ORIGINAL_MINE; - tn.pn = m_InputPlayerNumber; - m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn ); - CheckNumberOfNotesAndUndo(); - } else if( EditIsBeingPressed(EDIT_BUTTON_LAY_TAP_ATTACK) ) { g_iLastInsertTapAttackTrack = iCol; EditMiniMenu( &g_InsertTapAttack, SM_BackFromInsertTapAttack ); } - else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) ) - { - m_soundAddNote.Play(); - SetDirty( true ); - SaveUndo(); - TapNote tn = TAP_ORIGINAL_LIFT; - tn.pn = m_InputPlayerNumber; - m_NoteDataEdit.SetTapNote( iCol, iSongIndex, tn ); - CheckNumberOfNotesAndUndo(); - } else { m_soundAddNote.Play(); SetDirty( true ); SaveUndo(); - TapNote tn = TAP_ORIGINAL_TAP; + TapNote tn = m_selectedTap; tn.pn = m_InputPlayerNumber; m_NoteDataEdit.SetTapNote(iCol, iSongIndex, tn ); CheckNumberOfNotesAndUndo(); } } break; + + case EDIT_BUTTON_CYCLE_TAP_LEFT: + { + switch ( m_selectedTap.type ) + { + case TapNote::tap: m_selectedTap = TAP_ORIGINAL_FAKE; break; + case TapNote::mine: m_selectedTap = TAP_ORIGINAL_TAP; break; + case TapNote::lift: m_selectedTap = TAP_ORIGINAL_MINE; break; + case TapNote::fake: m_selectedTap = TAP_ORIGINAL_LIFT; break; + DEFAULT_FAIL( m_selectedTap.type ); + } + break; + } + case EDIT_BUTTON_CYCLE_TAP_RIGHT: + { + switch ( m_selectedTap.type ) + { + case TapNote::tap: m_selectedTap = TAP_ORIGINAL_MINE; break; + case TapNote::mine: m_selectedTap = TAP_ORIGINAL_LIFT; break; + case TapNote::lift: m_selectedTap = TAP_ORIGINAL_FAKE; break; + case TapNote::fake: m_selectedTap = TAP_ORIGINAL_TAP; break; + DEFAULT_FAIL( m_selectedTap.type ); + } + break; + } case EDIT_BUTTON_SCROLL_SPEED_UP: case EDIT_BUTTON_SCROLL_SPEED_DOWN: { @@ -2106,10 +2116,6 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB ) m_NoteDataRecord.SetTapNote( iCol, iHeadRow, TAP_EMPTY ); TapNote tn = TAP_ORIGINAL_TAP; - if( EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ) - tn = TAP_ORIGINAL_MINE; - else if( EditIsBeingPressed(EDIT_BUTTON_LAY_LIFT) ) - tn = TAP_ORIGINAL_LIFT; tn.pn = m_InputPlayerNumber; m_NoteDataRecord.SetTapNote( iCol, iRow, tn ); m_NoteFieldRecord.Step( iCol, TNS_W1 ); @@ -2502,7 +2508,7 @@ void ScreenEdit::ScrollTo( float fDestinationBeat ) // Don't SaveUndo. We want to undo the whole hold, not just the last segment // that the user made. Dragging the hold bigger can only absorb and remove // other taps, so dragging won't cause us to exceed the note limit. - TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_MINE_OR_ROLL) ? TAP_ORIGINAL_ROLL_HEAD : TAP_ORIGINAL_HOLD_HEAD; + TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD : TAP_ORIGINAL_HOLD_HEAD; tn.pn = m_InputPlayerNumber; m_NoteDataEdit.AddHoldNote( iCol, iStartRow, iEndRow, tn ); @@ -4035,8 +4041,7 @@ static const EditHelpLine g_EditHelpLines[] = EditHelpLine( "Shift BPM changes and stops down one beat", EDIT_BUTTON_INSERT_SHIFT_PAUSES ), EditHelpLine( "Delete beat and shift up", EDIT_BUTTON_DELETE ), EditHelpLine( "Shift BPM changes and stops up one beat", EDIT_BUTTON_DELETE_SHIFT_PAUSES ), - EditHelpLine( "Lay mine", EDIT_BUTTON_LAY_MINE_OR_ROLL ), - EditHelpLine( "Lay lift", EDIT_BUTTON_LAY_LIFT ), + EditHelpLine( "Cycle between tap notes", EDIT_BUTTON_CYCLE_TAP_LEFT, EDIT_BUTTON_CYCLE_TAP_RIGHT ), EditHelpLine( "Add to/remove from right half", EDIT_BUTTON_RIGHT_SIDE ), EditHelpLine( "Switch player (Routine only)", EDIT_BUTTON_SWITCH_PLAYERS ), }; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index f32e6940ac..fe77602a96 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -9,6 +9,7 @@ #include "Background.h" #include "Foreground.h" #include "NoteField.h" +#include "NoteTypes.h" #include "Song.h" #include "Steps.h" #include "ThemeMetric.h" @@ -50,10 +51,13 @@ enum EditButton // These are modifiers to EDIT_BUTTON_COLUMN_*. EDIT_BUTTON_RIGHT_SIDE, - EDIT_BUTTON_LAY_MINE_OR_ROLL, + EDIT_BUTTON_LAY_ROLL, EDIT_BUTTON_LAY_TAP_ATTACK, - EDIT_BUTTON_LAY_LIFT, EDIT_BUTTON_REMOVE_NOTE, + + // These are modifiers to change the present tap note. + EDIT_BUTTON_CYCLE_TAP_LEFT, + EDIT_BUTTON_CYCLE_TAP_RIGHT, EDIT_BUTTON_SCROLL_UP_LINE, EDIT_BUTTON_SCROLL_UP_PAGE, @@ -232,6 +236,9 @@ protected: SnapDisplay m_SnapDisplay; BitmapText m_textInputTips; + + /** @brief The current TapNote that would be inserted. */ + TapNote m_selectedTap; void UpdateTextInfo(); BitmapText m_textInfo; // status information that changes diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 6d37d74d3a..9bed46df4f 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -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 ) diff --git a/src/ScreenJukebox.cpp b/src/ScreenJukebox.cpp index 7ad7555687..c1e59aaa4d 100644 --- a/src/ScreenJukebox.cpp +++ b/src/ScreenJukebox.cpp @@ -106,10 +106,10 @@ void ScreenJukebox::SetSong() SONGMAN->GetAllCourses( apCourses, false ); vector apOptions; vector 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] ); } } diff --git a/src/ScreenNetSelectBase.cpp b/src/ScreenNetSelectBase.cpp index 8dfd75f7c3..40f9c5c9ac 100644 --- a/src/ScreenNetSelectBase.cpp +++ b/src/ScreenNetSelectBase.cpp @@ -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; } diff --git a/src/ScreenOptionsEditCourse.cpp b/src/ScreenOptionsEditCourse.cpp index 82ee683d89..eaa3c479c1 100644 --- a/src/ScreenOptionsEditCourse.cpp +++ b/src/ScreenOptionsEditCourse.cpp @@ -261,7 +261,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vectorm_pCurCourse->m_fGoalSeconds/60) ); + row.SetOneSharedSelectionIfPresent( MakeMinutesString(static_cast(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 ]; } diff --git a/src/ScreenOptionsManageCourses.cpp b/src/ScreenOptionsManageCourses.cpp index cbf20336d9..37e9833f8a 100644 --- a/src/ScreenOptionsManageCourses.cpp +++ b/src/ScreenOptionsManageCourses.cpp @@ -142,7 +142,7 @@ void ScreenOptionsManageCourses::BeginScreen() vector::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 ); } } diff --git a/src/ScreenOptionsManageEditSteps.cpp b/src/ScreenOptionsManageEditSteps.cpp index 7fc0b1f7de..10043777ad 100644 --- a/src/ScreenOptionsManageEditSteps.cpp +++ b/src/ScreenOptionsManageEditSteps.cpp @@ -110,7 +110,7 @@ void ScreenOptionsManageEditSteps::BeginScreen() vector::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 ); } } diff --git a/src/ScreenOptionsMemoryCard.cpp b/src/ScreenOptionsMemoryCard.cpp index 02e1ed832b..a3f265febf 100644 --- a/src/ScreenOptionsMemoryCard.cpp +++ b/src/ScreenOptionsMemoryCard.cpp @@ -197,8 +197,9 @@ void ScreenOptionsMemoryCard::ProcessMenuStart( const InputEventPlus &input ) const vector &v = m_CurrentUsbStorageDevices; if( iCurRow < int(v.size()) ) // a card { - const vector &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 &vUSB = m_CurrentUsbStorageDevices; + const UsbStorageDevice &dev = vUSB[iCurRow]; MEMCARDMAN->m_sEditorMemoryCardOsMountPoint.Set( dev.sOsMountDir ); /* The destination screen must UnmountCard. XXX: brittle */ diff --git a/src/ScreenRanking.cpp b/src/ScreenRanking.cpp index f1c2d0dbea..595e29850f 100644 --- a/src/ScreenRanking.cpp +++ b/src/ScreenRanking.cpp @@ -244,7 +244,8 @@ float ScreenRanking::SetPage( const PageToShow &pts ) for( int l=0; lGetMachineProfile()->GetCategoryHighScoreList(st, pts.category); HighScore hs; bool bRecentHighScore = false; diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index b88038f109..c0ad565963 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -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(); diff --git a/src/ScreenTestInput.cpp b/src/ScreenTestInput.cpp index 8ce0e2028d..255aa291d9 100644 --- a/src/ScreenTestInput.cpp +++ b/src/ScreenTestInput.cpp @@ -38,7 +38,6 @@ class InputList: public BitmapText // Update input texts vector asInputs; - DeviceInput di; vector DeviceInputs; INPUTFILTER->GetPressedButtons( DeviceInputs ); FOREACH( DeviceInput, DeviceInputs, di ) diff --git a/src/ScrollBar.cpp b/src/ScrollBar.cpp index 67e95a878a..da25c145df 100644 --- a/src/ScrollBar.cpp +++ b/src/ScrollBar.cpp @@ -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(m_sprMiddle->GetZoomedHeight()); ASSERT( iBarContentHeight != 0 ); /* Set tick thumb */ diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 5f5376b8b7..91332d0232 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -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 diff --git a/src/SongOptions.h b/src/SongOptions.h index 7a81c9fc45..a690b56ccd 100644 --- a/src/SongOptions.h +++ b/src/SongOptions.h @@ -46,8 +46,19 @@ public: }; SoundEffectType m_SoundEffectType; - - SongOptions() { Init(); }; + /** + * @brief Set up the SongOptions with reasonable defaults. + * + * This is taken from Init(), but uses the intended + * initialization lists. */ + SongOptions(): m_LifeType(LIFE_BAR), m_DrainType(DRAIN_NORMAL), + m_iBatteryLives(4), m_bAssistClap(false), + m_bAssistMetronome(false), m_fMusicRate(1.0f), + m_SpeedfMusicRate(1.0f), m_fHaste(0.0f), + m_SpeedfHaste(1.0f), m_AutosyncType(AUTOSYNC_OFF), + m_SoundEffectType(SOUNDEFFECT_OFF), + m_bStaticBackground(false), m_bRandomBGOnly(false), + m_bSaveScore(true), m_bSaveReplay(false) {}; void Init(); void Approach( const SongOptions& other, float fDeltaSeconds ); void GetMods( vector &AddTo ) const; diff --git a/src/StatsManager.cpp b/src/StatsManager.cpp index f3cc714ba0..a50ef882bb 100644 --- a/src/StatsManager.cpp +++ b/src/StatsManager.cpp @@ -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. diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index 4393682851..db3c4a01c2 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -1480,15 +1480,14 @@ RelativePath="NotesWriterSM.h" > - - - + - - + diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 8c92f28ec2..8b5830d7cb 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -103,7 +103,7 @@ void StepMania::GetPreferredVideoModeParams( VideoModeParams ¶msOut ) { //float fRatio = PREFSMAN->m_iDisplayWidth / PREFSMAN->m_iDisplayHeight; //iWidth = PREFSMAN->m_iDisplayHeight * fRatio; - iWidth = ceilf(PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio); + iWidth = static_cast(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; diff --git a/src/StepsUtil.h b/src/StepsUtil.h index 628f01c6ed..cae7cdb1c3 100644 --- a/src/StepsUtil.h +++ b/src/StepsUtil.h @@ -48,15 +48,12 @@ public: } /** @brief The Song's locked status. */ m_Locked; /** @brief Set up the initial criteria. */ - StepsCriteria() + StepsCriteria(): m_difficulty(Difficulty_Invalid), + m_iLowMeter(-1), m_iHighMeter(-1), + m_st(StepsType_Invalid), m_Locked(Locked_DontCare) { - m_difficulty = Difficulty_Invalid; - m_iLowMeter = -1; - m_iHighMeter = -1; //m_fLowBPM = -1; //m_fHighBPM = -1; - m_st = StepsType_Invalid; - m_Locked = Locked_DontCare; } /** diff --git a/src/StreamDisplay.cpp b/src/StreamDisplay.cpp index 185028e209..c972e5832b 100644 --- a/src/StreamDisplay.cpp +++ b/src/StreamDisplay.cpp @@ -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(THEME->GetMetricF(sMetricsGroup,"NumPills")); m_bAlwaysBounce = THEME->GetMetricB(sMetricsGroup,"AlwaysBounceNormalBar"); FOREACH_ENUM( StreamType, st ) diff --git a/src/TimingData.cpp b/src/TimingData.cpp index 3e03b64351..02abd33c7e 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -569,11 +569,11 @@ float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const int iRow = BeatToNoteRow(fBeat); for( unsigned j=0; j=) - * A Pump delay acts differently. [aj: how?] (>) + /* A traditional stop has the beat happening before the stop. (>=) + * A Pump delay acts differently: the pause is before the beat. (>) */ - if( m_StopSegments[j].m_iStartRow >= iRow && !m_StopSegments[j].m_bDelay || - m_StopSegments[j].m_iStartRow > iRow && m_StopSegments[j].m_bDelay ) + if( ( m_StopSegments[j].m_iStartRow >= iRow && !m_StopSegments[j].m_bDelay ) || + ( m_StopSegments[j].m_iStartRow > iRow && m_StopSegments[j].m_bDelay ) ) break; fElapsedTime += m_StopSegments[j].m_fStopSeconds; } diff --git a/src/TimingData.h b/src/TimingData.h index afbe71d3e1..4ae8c8b50c 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -174,7 +174,7 @@ struct StopSegment { return ( m_iStartRow < other.m_iStartRow ) || ( m_iStartRow == other.m_iStartRow && - ( m_bDelay && !other.m_bDelay || m_fStopSeconds < other.m_fStopSeconds )); + ( ( m_bDelay && !other.m_bDelay ) || m_fStopSeconds < other.m_fStopSeconds )); } /** * @brief Compares two StopSegments to see if one is less than or equal to the other. diff --git a/src/Trail.h b/src/Trail.h index f0f9fb040f..f69dd56faf 100644 --- a/src/Trail.h +++ b/src/Trail.h @@ -64,9 +64,15 @@ public: mutable bool m_bRadarValuesCached; mutable RadarValues m_CachedRadarValues; - Trail() + /** + * @brief Set up the Trail with default values. + * + * This used to call Init(), which is still available. */ + Trail(): m_StepsType(StepsType_Invalid), + m_CourseDifficulty(Difficulty_Invalid), + m_iSpecifiedMeter(-1), m_bRadarValuesCached(false) { - Init(); + m_vEntries.clear(); } void Init() { diff --git a/src/UnlockManager.h b/src/UnlockManager.h index 9eaaad40cf..06b3ed7b3e 100644 --- a/src/UnlockManager.h +++ b/src/UnlockManager.h @@ -52,16 +52,16 @@ enum UnlockEntryStatus { class UnlockEntry { public: - UnlockEntry() + /** + * @brief Set up the UnlockEntry with default values. + * + * m_sEntryID starts as an empty string. It will be filled automatically + * if not specified. */ + UnlockEntry(): m_Type(UnlockRewardType_Invalid), + m_dc(Difficulty_Invalid), m_bRequirePassHardSteps(false), + m_bRoulette(false), m_sEntryID(RString("")) { - m_Type = UnlockRewardType_Invalid; - - m_dc = Difficulty_Invalid; - ZERO( m_fRequirement ); - m_bRequirePassHardSteps = false; - m_bRoulette = false; - m_sEntryID = ""; // "" means not yet filled. This will be filled in automatically if not specified. } UnlockRewardType m_Type; diff --git a/src/XmlFileUtil.cpp b/src/XmlFileUtil.cpp index 0fb328f9d5..df65416143 100644 --- a/src/XmlFileUtil.cpp +++ b/src/XmlFileUtil.cpp @@ -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 ); diff --git a/src/arch/InputHandler/InputHandler.h b/src/arch/InputHandler/InputHandler.h index 5bb41914e3..0eeed81982 100644 --- a/src/arch/InputHandler/InputHandler.h +++ b/src/arch/InputHandler/InputHandler.h @@ -25,7 +25,7 @@ public: static void Create( const RString &sDrivers, vector &apAdd ); static DriverList m_pDriverList; - InputHandler() { m_iInputsSinceUpdate = 0; } + InputHandler(): m_iInputsSinceUpdate(0) {} virtual ~InputHandler() { } virtual void Update() { } virtual bool DevicesChanged() { return false; } diff --git a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp index dd8b9dc9ab..e79a40ac9a 100644 --- a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp +++ b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp @@ -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 ); diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index bddafb3b79..43c56d2a10 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -28,6 +28,7 @@ namespace avcodec #endif }; +/* #if defined(_MSC_VER) && !defined(XBOX) #pragma comment(lib, "ffmpeg/lib/avcodec.lib") #pragma comment(lib, "ffmpeg/lib/avformat.lib") @@ -35,6 +36,7 @@ namespace avcodec #pragma comment(lib, "ffmpeg/lib/swscale.lib") #endif #endif // _MSC_VER && !XBOX +*/ #if defined(XBOX) /* NOTES: ffmpeg static libraries arent included in SVN. You have to build diff --git a/src/arch/MovieTexture/MovieTexture_Theora.cpp b/src/arch/MovieTexture/MovieTexture_Theora.cpp index fe4fe86638..b39abb6ede 100644 --- a/src/arch/MovieTexture/MovieTexture_Theora.cpp +++ b/src/arch/MovieTexture/MovieTexture_Theora.cpp @@ -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 ); diff --git a/src/arch/Sound/RageSoundDriver.h b/src/arch/Sound/RageSoundDriver.h index a95ca5e083..212cc2b138 100644 --- a/src/arch/Sound/RageSoundDriver.h +++ b/src/arch/Sound/RageSoundDriver.h @@ -150,7 +150,8 @@ private: float *m_BufferNext; // beginning of the unread data int m_FramesInBuffer; // total number of frames at m_BufferNext int64_t m_iPosition; // stream frame of m_BufferNext - sound_block() { m_FramesInBuffer = 0; m_iPosition = 0; m_BufferNext = m_Buffer; } + sound_block(): m_BufferNext(m_Buffer), + m_FramesInBuffer(0), m_iPosition(0) {} }; struct Sound From 873a60a9a3fba2a06b52051a903c83d2e0bf76f3 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Mon, 14 Mar 2011 19:39:33 -0500 Subject: [PATCH 35/37] fix what appears to be a FFMpeg blocker --- src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 43c56d2a10..08c4c10df1 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -690,7 +690,7 @@ int URLRageFile_read( avcodec::URLContext *h, unsigned char *buf, int size ) #if defined(MACOSX) || defined(_MSC_VER) // still using older ffmpeg versions int URLRageFile_write( avcodec::URLContext *h, unsigned char *buf, int size ) #else // assume ffmpeg 0.6 on *nix - int URLRageFile_write( avcodec::URLContext *h, const unsigned char *buf, int size ) + int URLRageFile_write( avcodec::URLContext *h, unsigned char *buf, int size ) #endif { RageFileBasic *f = (RageFileBasic *) h->priv_data; From 18caa1ae913775a8c5efad3f8a43e7dc8ea24be6 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 20:55:37 -0400 Subject: [PATCH 36/37] More of the violations being dealt with. --- src/TimingData.h | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/src/TimingData.h b/src/TimingData.h index 4ae8c8b50c..6190494cfb 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -24,7 +24,7 @@ struct BPMSegment * @param s the starting row of this segment. * @param b the beats per second to be turned into beats per minute. */ - BPMSegment( int s, float b ) { m_iStartRow = max( 0, s ); SetBPM( b ); } + BPMSegment( int s, float b ): m_iStartRow(max(0, s)), m_fBPS(0) { SetBPM( b ); } /** * @brief The row in which the BPMSegment activates. */ @@ -115,10 +115,10 @@ struct StopSegment * @param s the starting row of this segment. * @param f the length of time to pause the note scrolling. */ - StopSegment( int s, float f ) { - m_iStartRow = max( 0, s ); - m_fStopSeconds = PREFSMAN->m_bQuirksMode ? f : max( 0.0f, f ); - m_bDelay = false; + StopSegment( int s, float f ) : m_iStartRow(max(0, s)), + m_fStopSeconds(f), m_bDelay(false) + { + if (!PREFSMAN->m_bQuirksMode) m_fStopSeconds = max( 0.0f, f ); } /** * @brief Creates a Stop (or Delay) Segment at the specified row for the specified length of time. @@ -126,10 +126,10 @@ struct StopSegment * @param f the length of time to pause the note scrolling. * @param d the flag that makes this Stop Segment a Delay Segment. */ - StopSegment( int s, float f, bool d ) { - m_iStartRow = max( 0, s ); - m_fStopSeconds = PREFSMAN->m_bQuirksMode ? f : max( 0.0f, f ); - m_bDelay = d; + StopSegment( int s, float f, bool d ) : m_iStartRow(max(0, s)), + m_fStopSeconds(f), m_bDelay(d) + { + if (!PREFSMAN->m_bQuirksMode) m_fStopSeconds = max( 0.0f, f ); } /** * @brief The row in which the StopSegment activates. @@ -221,22 +221,16 @@ struct TimeSignatureSegment * @param r the starting row of the segment. * @param n the numerator for the segment. */ - TimeSignatureSegment( int r, int n ) { - m_iStartRow = max( 0, r ); - m_iNumerator = n; - m_iDenominator = 4; - } + TimeSignatureSegment( int r, int n ): m_iStartRow(max(0, r)), + m_iNumerator(n), m_iDenominator(4) {} /** * @brief Creates a Time Signature Segment at the given row with a supplied numerator & denominator. * @param r the starting row of the segment. * @param n the numerator for the segment. * @param d the denonimator for the segment. */ - TimeSignatureSegment( int r, int n, int d ) { - m_iStartRow = max( 0, r ); - m_iNumerator = n; - m_iDenominator = d; - } + TimeSignatureSegment( int r, int n, int d ): m_iStartRow(max(0, r)), + m_iNumerator(n), m_iDenominator(d) {} /** * @brief The row in which the TimeSignatureSegment activates. */ @@ -334,17 +328,15 @@ struct WarpSegment * @param s the starting row of this segment. * @param r the row to warp to. */ - WarpSegment( int s, int r ) - { - m_iStartRow = max( 0, s ); - m_fWarpBeats = max( 0, NoteRowToBeat( r ) ); - } + WarpSegment( int s, int r ): m_iStartRow(max(0, s)), + m_fWarpBeats(max(0, NoteRowToBeat(r))) {} /** * @brief Creates a Warp Segment with the specified starting row and beat to warp to. * @param s the starting row of this segment. * @param b the beat to warp to. */ - WarpSegment( int s, float b ){ m_iStartRow = max( 0, s ); m_fWarpBeats = max( 0, b ); } + WarpSegment( int s, float b ): m_iStartRow(max(0, s)), + m_fWarpBeats(max(0, b)) {} /** * @brief The row in which the WarpSegment activates. */ @@ -423,7 +415,8 @@ struct TickcountSegment * @param s the starting row of this segment. * @param t the amount of ticks counted per beat. */ - TickcountSegment( int s, int t ){ m_iStartRow = max( 0, s ); m_iTicks = max( 0, t ); } + TickcountSegment( int s, int t ): m_iStartRow(max(0, s)), + m_iTicks(max(0, t)) {} /** * @brief The row in which the TickcountSegment activates. */ @@ -498,7 +491,8 @@ struct ComboSegment * @param s the starting row of this segment. * @param t the amount the combo increases on a succesful hit. */ - ComboSegment( int s, int t ){ m_iStartRow = max( 0, s ); m_iCombo = max( 1, t ); } + ComboSegment( int s, int t ): m_iStartRow(max(0, s)), + m_iCombo(max(1,t)) {} /** * @brief The row in which the ComboSegment activates. */ From d1272b001c9b60e0671c6ae69eb37e2c9dcc8407 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 21:42:07 -0400 Subject: [PATCH 37/37] Another batch of these. I think I need to look into adding a feature soon. Either that, or take a minor break. --- src/Font.cpp | 7 +++---- src/Font.h | 3 +++ src/GameState.h | 3 +++ src/InputFilter.h | 5 ++++- src/InputMapper.h | 8 +++++--- src/NoteTypes.h | 26 ++++++++++---------------- src/SongUtil.h | 17 +++++++++-------- src/arch/Threads/Threads.h | 6 +++++- 8 files changed, 42 insertions(+), 33 deletions(-) diff --git a/src/Font.cpp b/src/Font.cpp index d8c7d142eb..4fd73591d2 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -11,10 +11,9 @@ #include "FontCharAliases.h" #include "arch/Dialog/Dialog.h" -FontPage::FontPage() -{ - m_iDrawExtraPixelsLeft = m_iDrawExtraPixelsRight = 0; -} +FontPage::FontPage(): m_iHeight(0), m_iLineSpacing(0), m_fVshift(0), + m_iDrawExtraPixelsLeft(0), m_iDrawExtraPixelsRight(0), + m_sTexturePath("") {} void FontPage::Load( const FontPageSettings &cfg ) { diff --git a/src/Font.h b/src/Font.h index 3582556655..b83c6da1a9 100644 --- a/src/Font.h +++ b/src/Font.h @@ -204,6 +204,9 @@ private: void LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RString &sTexturePath, const RString &PageName, RString sChars ); static void GetFontPaths( const RString &sFontOrTextureFilePath, vector &sTexturePaths ); RString GetPageNameFromFileName( const RString &sFilename ); + + Font(const Font& rhs); + Font& operator=(const Font& rhs); }; /** diff --git a/src/GameState.h b/src/GameState.h index 00a10baed5..3bcf583902 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -348,6 +348,9 @@ private: EarnedExtraStage CalculateEarnedExtraStage() const; int m_iAwardedExtraStages[NUM_PLAYERS]; bool m_bEarnedExtraStage; + + GameState(const GameState& rhs); + GameState& operator=(const GameState& rhs); }; diff --git a/src/InputFilter.h b/src/InputFilter.h index 65fb47bed9..35ee9c7cdb 100644 --- a/src/InputFilter.h +++ b/src/InputFilter.h @@ -24,7 +24,7 @@ enum InputEventType struct InputEvent { - InputEvent() { type=IET_FIRST_PRESS; }; + InputEvent(): type(IET_FIRST_PRESS) {} DeviceInput di; InputEventType type; @@ -84,6 +84,9 @@ private: vector queue; RageMutex *queuemutex; MouseCoordinates m_MouseCoords; + + InputFilter(const InputFilter& rhs); + InputFilter& operator=(const InputFilter& rhs); }; extern InputFilter* INPUTFILTER; // global and accessable from anywhere in our program diff --git a/src/InputMapper.h b/src/InputMapper.h index cceaf2a5bf..34d85f09fd 100644 --- a/src/InputMapper.h +++ b/src/InputMapper.h @@ -78,10 +78,8 @@ struct AutoMappings AutoMappingEntry im37 = AutoMappingEntry(), AutoMappingEntry im38 = AutoMappingEntry(), AutoMappingEntry im39 = AutoMappingEntry() ) + : m_sGame(s1), m_sDriverRegex(s2), m_sControllerName(s3) { - m_sGame = s1; - m_sDriverRegex = s2; - m_sControllerName = s3; #define PUSH( im ) if(!im.IsEmpty()) m_vMaps.push_back(im); PUSH(im0);PUSH(im1);PUSH(im2);PUSH(im3);PUSH(im4);PUSH(im5);PUSH(im6);PUSH(im7);PUSH(im8);PUSH(im9);PUSH(im10);PUSH(im11);PUSH(im12);PUSH(im13);PUSH(im14);PUSH(im15);PUSH(im16);PUSH(im17);PUSH(im18);PUSH(im19); PUSH(im20);PUSH(im21);PUSH(im22);PUSH(im23);PUSH(im24);PUSH(im25);PUSH(im26);PUSH(im27);PUSH(im28);PUSH(im29);PUSH(im30);PUSH(im31);PUSH(im32);PUSH(im33);PUSH(im34);PUSH(im35);PUSH(im36);PUSH(im37);PUSH(im38);PUSH(im39); @@ -198,6 +196,10 @@ protected: void UpdateTempDItoGI(); const InputScheme *m_pInputScheme; + +private: + InputMapper(const InputMapper& rhs); + InputMapper& operator=(const InputMapper& rhs); }; extern InputMapper* INPUTMAPPER; // global and accessable from anywhere in our program diff --git a/src/NoteTypes.h b/src/NoteTypes.h index 4c23f1576f..f2cfb96e7b 100644 --- a/src/NoteTypes.h +++ b/src/NoteTypes.h @@ -133,10 +133,10 @@ struct TapNote XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); - TapNote() - { - Init(); - } + TapNote(): type(empty), subType(SubType_Invalid), source(original), + pn(PLAYER_INVALID), bHopoPossible(false), + sAttackModifiers(""), fAttackDurationSeconds(0), + iKeysoundIndex(-1), iDuration(0) {} void Init() { type = empty; @@ -154,18 +154,12 @@ struct TapNote Source source_, RString sAttackModifiers_, float fAttackDurationSeconds_, - int iKeysoundIndex_ ) - { - Init(); - type = type_; - subType = subType_; - source = source_; - sAttackModifiers = sAttackModifiers_; - fAttackDurationSeconds = fAttackDurationSeconds_; - iKeysoundIndex = iKeysoundIndex_; - iDuration = 0; - pn = PLAYER_INVALID; - } + int iKeysoundIndex_ ): + type(type_), subType(subType_), source(source_), + pn(PLAYER_INVALID), sAttackModifiers(sAttackModifiers_), + fAttackDurationSeconds(fAttackDurationSeconds_), + iKeysoundIndex(iKeysoundIndex_), iDuration(0) {} + /** * @brief Determine if the two TapNotes are equal to each other. * @param other the other TapNote we're checking. diff --git a/src/SongUtil.h b/src/SongUtil.h index 3d2aa5956e..ea91a6d4cb 100644 --- a/src/SongUtil.h +++ b/src/SongUtil.h @@ -17,7 +17,11 @@ class XNode; class SongCriteria { public: - RString m_sGroupName; // "" means don't match + /** + * @brief What group name are we searching for for Songs? + * + * If an empty string, don't bother using this for searching. */ + RString m_sGroupName; bool m_bUseSongGenreAllowedList; vector m_vsSongGenreAllowedList; enum Selectable { Selectable_Yes, Selectable_No, Selectable_DontCare } m_Selectable; @@ -43,16 +47,13 @@ public: } m_Locked; /** @brief Set up some initial song criteria. */ - SongCriteria() + SongCriteria(): m_sGroupName(""), m_bUseSongGenreAllowedList(false), + m_Selectable(Selectable_DontCare), m_bUseSongAllowedList(false), + m_iMaxStagesForSong(-1), m_Tutorial(Tutorial_DontCare), + m_Locked(Locked_DontCare) { - m_bUseSongGenreAllowedList = false; - m_Selectable = Selectable_DontCare; - m_bUseSongAllowedList = false; - m_iMaxStagesForSong = -1; // m_fMinBPM = -1; // m_fMaxBPM = -1; - m_Tutorial = Tutorial_DontCare; - m_Locked = Locked_DontCare; } /** diff --git a/src/arch/Threads/Threads.h b/src/arch/Threads/Threads.h index e8f0e94a4f..184bddc5ab 100644 --- a/src/arch/Threads/Threads.h +++ b/src/arch/Threads/Threads.h @@ -25,7 +25,7 @@ class MutexImpl public: RageMutex *m_Parent; - MutexImpl( RageMutex *pParent ) { m_Parent = pParent; } + MutexImpl( RageMutex *pParent ): m_Parent(pParent) {} virtual ~MutexImpl() { } /* Lock the mutex. If mutex timeouts are implemented, and the mutex times out, @@ -40,6 +40,10 @@ public: /* Unlock the mutex. This must only be called when the mutex is locked; implementations * may fail with an assertion if the mutex is not locked. */ virtual void Unlock() = 0; + +private: + MutexImpl(const MutexImpl& rhs); + MutexImpl& operator=(const MutexImpl& rhs); }; class EventImpl