diff --git a/src/AutoActor.h b/src/AutoActor.h index c2223e6711..3ee95bec09 100644 --- a/src/AutoActor.h +++ b/src/AutoActor.h @@ -12,7 +12,7 @@ class XNode; class AutoActor { public: - AutoActor() { m_pActor = NULL; } + AutoActor(): m_pActor(NULL) {} ~AutoActor() { Unload(); } AutoActor( const AutoActor &cpy ); AutoActor &operator =( const AutoActor &cpy ); diff --git a/src/BitmapText.h b/src/BitmapText.h index 2647dda970..bc06c5c406 100644 --- a/src/BitmapText.h +++ b/src/BitmapText.h @@ -51,7 +51,7 @@ public: struct Attribute { - Attribute() : length(-1) { } + Attribute() : length(-1), glow() { } int length; RageColor diffuse[4]; RageColor glow; diff --git a/src/CommonMetrics.h b/src/CommonMetrics.h index f2e4e629c5..ba0529b361 100644 --- a/src/CommonMetrics.h +++ b/src/CommonMetrics.h @@ -11,7 +11,7 @@ class ThemeMetricDifficultiesToShow : public ThemeMetric { public: - ThemeMetricDifficultiesToShow() { } + ThemeMetricDifficultiesToShow(): m_v() { } ThemeMetricDifficultiesToShow( const RString& sGroup, const RString& sName ); void Read(); const vector &GetValue() const; @@ -21,7 +21,7 @@ private: class ThemeMetricCourseDifficultiesToShow : public ThemeMetric { public: - ThemeMetricCourseDifficultiesToShow() { } + ThemeMetricCourseDifficultiesToShow(): m_v() { } ThemeMetricCourseDifficultiesToShow( const RString& sGroup, const RString& sName ); void Read(); const vector &GetValue() const; @@ -31,7 +31,7 @@ private: class ThemeMetricStepsTypesToShow : public ThemeMetric { public: - ThemeMetricStepsTypesToShow() { } + ThemeMetricStepsTypesToShow(): m_v() { } ThemeMetricStepsTypesToShow( const RString& sGroup, const RString& sName ); void Read(); const vector &GetValue() const; diff --git a/src/Course.cpp b/src/Course.cpp index ce37abc628..dd39fdaa86 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -248,6 +248,9 @@ struct SortTrailEntry { TrailEntry entry; int SortMeter; + + SortTrailEntry(): entry(), SortMeter(0) {} + bool operator< ( const SortTrailEntry &rhs ) const { return SortMeter < rhs.SortMeter; } }; diff --git a/src/Course.h b/src/Course.h index 7ba37eb3f0..23c91e5630 100644 --- a/src/Course.h +++ b/src/Course.h @@ -189,6 +189,8 @@ public: { Trail trail; bool null; + + CacheData(): trail(), null(false) {} }; typedef map TrailCache_t; mutable TrailCache_t m_TrailCache; diff --git a/src/GameCommand.h b/src/GameCommand.h index f04f97da6f..8cd135dde4 100644 --- a/src/GameCommand.h +++ b/src/GameCommand.h @@ -22,7 +22,27 @@ struct lua_State; class GameCommand { public: - GameCommand() { Init(); } + GameCommand(): m_Commands(), m_sName(""), m_sText(""), + m_bInvalid(true), m_sInvalidReason(""), + m_iIndex(-1), m_MultiPlayer(MultiPlayer_Invalid), + m_pStyle(NULL), m_pm(PlayMode_Invalid), + m_dc(Difficulty_Invalid), + m_CourseDifficulty(Difficulty_Invalid), + m_sAnnouncer(""), m_sPreferredModifiers(""), + m_sStageModifiers(""), m_sScreen(""), m_LuaFunction(), + m_pSong(NULL), m_pSteps(NULL), m_pCourse(NULL), + m_pTrail(NULL), m_pCharacter(NULL), m_SetEnv(), + m_sSongGroup(""), m_SortOrder(SortOrder_Invalid), + m_sSoundPath(""), m_vsScreensToPrepare(), m_iWeightPounds(-1), + m_iGoalCalories(-1), m_GoalType(GoalType_Invalid), + m_sProfileID(""), m_sUrl(""), m_bUrlExits(true), + m_bInsertCredit(false), m_bClearCredits(false), + m_bStopMusic(false), m_bApplyDefaultOptions(false), + m_bFadeMusic(false), m_fMusicFadeOutVolume(-1), + m_fMusicFadeOutSeconds(-1), m_bApplyCommitsScreens(true) + { + m_LuaFunction.Unset(); + } void Init(); void Load( int iIndex, const Commands& cmds ); diff --git a/src/HighScore.h b/src/HighScore.h index c3f9b0f94c..3673c98e37 100644 --- a/src/HighScore.h +++ b/src/HighScore.h @@ -104,10 +104,9 @@ public: * @brief Set up the HighScore List with default values. * * This used to call Init(), but it's better to be explicit here. */ - HighScoreList(): HighGrade(Grade_NoData), iNumTimesPlayed(0) - { - vHighScores.clear(); - } + HighScoreList(): vHighScores(), HighGrade(Grade_NoData), + iNumTimesPlayed(0), dtLastPlayed() {} + void Init(); int GetNumTimesPlayed() const diff --git a/src/InputEventPlus.h b/src/InputEventPlus.h index 0907b55ed6..2ba00ae493 100644 --- a/src/InputEventPlus.h +++ b/src/InputEventPlus.h @@ -9,10 +9,11 @@ class InputEventPlus { public: InputEventPlus(): + DeviceI(), GameI(), type(IET_FIRST_PRESS), MenuI(GameButton_Invalid), pn(PLAYER_INVALID), - mp(MultiPlayer_Invalid) { } + mp(MultiPlayer_Invalid), InputList() { } DeviceInput DeviceI; GameInput GameI; InputEventType type; diff --git a/src/InputMapper.h b/src/InputMapper.h index 271d682465..d09f23c53e 100644 --- a/src/InputMapper.h +++ b/src/InputMapper.h @@ -78,7 +78,7 @@ 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), m_vMaps() { #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); diff --git a/src/InputQueue.h b/src/InputQueue.h index 8ee93be3d7..cb7498470b 100644 --- a/src/InputQueue.h +++ b/src/InputQueue.h @@ -27,11 +27,19 @@ struct InputQueueCode public: bool Load( RString sButtonsNames ); bool EnteredCode( GameController controller ) const; + + InputQueueCode(): m_aPresses() {} private: struct ButtonPress { - ButtonPress() { m_bAllowIntermediatePresses = false; memset( m_InputTypes, 0, sizeof(m_InputTypes) ); m_InputTypes[IET_FIRST_PRESS] = true; } + ButtonPress(): m_aButtonsToHold(), m_aButtonsToNotHold(), + m_aButtonsToPress(), + m_bAllowIntermediatePresses(false) + { + memset( m_InputTypes, 0, sizeof(m_InputTypes) ); + m_InputTypes[IET_FIRST_PRESS] = true; + } vector m_aButtonsToHold; vector m_aButtonsToNotHold; vector m_aButtonsToPress; diff --git a/src/MsdFile.h b/src/MsdFile.h index aaae912b14..7d43d2aec4 100644 --- a/src/MsdFile.h +++ b/src/MsdFile.h @@ -23,6 +23,8 @@ public: */ RString operator[]( unsigned i ) const { if( i >= params.size() ) return RString(); return params[i]; } }; + + MsdFile(): values(), error("") {} /** @brief Remove the MSDFile. */ virtual ~MsdFile() { } diff --git a/src/NoteData.h b/src/NoteData.h index a8c59f0bd9..5de742eb30 100644 --- a/src/NoteData.h +++ b/src/NoteData.h @@ -32,6 +32,8 @@ public: typedef map::const_iterator const_iterator; typedef map::reverse_iterator reverse_iterator; typedef map::const_reverse_iterator const_reverse_iterator; + + NoteData(): m_TapNotes() {} iterator begin( int iTrack ) { return m_TapNotes[iTrack].begin(); } const_iterator begin( int iTrack ) const { return m_TapNotes[iTrack].begin(); } diff --git a/src/OptionRowHandler.h b/src/OptionRowHandler.h index 2fe5a5b624..3a443849ce 100644 --- a/src/OptionRowHandler.h +++ b/src/OptionRowHandler.h @@ -77,15 +77,14 @@ struct OptionRowDefinition OptionRowDefinition(): m_sName(""), m_sExplanationName(""), m_bOneChoiceForAllPlayers(false), m_selectType(SELECT_ONE), - m_layoutType(LAYOUT_SHOW_ALL_IN_ROW), m_iDefault(-1), + m_layoutType(LAYOUT_SHOW_ALL_IN_ROW), m_vsChoices(), + m_vEnabledForPlayers(), 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 ); + m_vEnabledForPlayers.insert( pn ); } void Init() { @@ -106,13 +105,33 @@ struct OptionRowDefinition m_bShowChoicesListOnSelect = false; } - OptionRowDefinition( const char *n, bool b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) + OptionRowDefinition( const char *n, bool b, const char *c0=NULL, + const char *c1=NULL, const char *c2=NULL, + const char *c3=NULL, const char *c4=NULL, + const char *c5=NULL, const char *c6=NULL, + const char *c7=NULL, const char *c8=NULL, + const char *c9=NULL, const char *c10=NULL, + const char *c11=NULL, const char *c12=NULL, + const char *c13=NULL, const char *c14=NULL, + const char *c15=NULL, const char *c16=NULL, + const char *c17=NULL, const char *c18=NULL, + const char *c19=NULL ): m_sName(n), + m_sExplanationName(""), m_bOneChoiceForAllPlayers(b), + m_selectType(SELECT_ONE), + m_layoutType(LAYOUT_SHOW_ALL_IN_ROW), m_vsChoices(), + m_vEnabledForPlayers(), m_iDefault(-1), + m_bExportOnChange(false), m_bAllowThemeItems(true), + m_bAllowThemeTitle(true), m_bAllowExplanation(true), + m_bShowChoicesListOnSelect(false) { - Init(); - m_sName=n; - m_bOneChoiceForAllPlayers=b; + FOREACH_PlayerNumber( pn ) + m_vEnabledForPlayers.insert( pn ); + #define PUSH( c ) if(c) m_vsChoices.push_back(c); - PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19); + PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5); + PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11); + PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17); + PUSH(c18);PUSH(c19); #undef PUSH } }; @@ -124,7 +143,7 @@ public: OptionRowDefinition m_Def; vector m_vsReloadRowMessages; // refresh this row on on these messages - OptionRowHandler() { Init(); } + OptionRowHandler(): m_Def(), m_vsReloadRowMessages() { } virtual ~OptionRowHandler() { } virtual void Init() { diff --git a/src/Profile.h b/src/Profile.h index 1a4d022319..b95fd8d3a7 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -67,9 +67,49 @@ class Game; class Profile { public: - Profile() + /** + * @brief Set up the Profile with default values. + * + * Note: there are probably a lot of variables. */ + Profile(): m_sDisplayName(""), m_sCharacterID(""), + m_sLastUsedHighScoreName(""), m_iWeightPounds(0), + m_sGuid(MakeGuid()), m_sDefaultModifiers(), + m_SortOrder(SortOrder_Invalid), + m_LastDifficulty(Difficulty_Invalid), + m_LastCourseDifficulty(Difficulty_Invalid), + m_LastStepsType(StepsType_Invalid), m_lastSong(), + m_lastCourse(), m_iTotalSessions(0), + m_iTotalSessionSeconds(0), m_iTotalGameplaySeconds(0), + m_fTotalCaloriesBurned(0), m_GoalType(GoalType_Calories), + m_iGoalCalories(0), m_iGoalSeconds(0), m_iTotalDancePoints(0), + m_iNumExtraStagesPassed(0), m_iNumExtraStagesFailed(0), + m_iNumToasties(0), m_iTotalTapsAndHolds(0), m_iTotalJumps(0), + m_iTotalHolds(0), m_iTotalRolls(0), m_iTotalMines(0), + m_iTotalHands(0), m_iTotalLifts(0), m_UnlockedEntryIDs(), + m_sLastPlayedMachineGuid(""), m_LastPlayedDate(), + m_iNumSongsPlayedByStyle(), m_iNumTotalSongsPlayed(0), + m_UserData(), m_SongHighScores(), m_CourseHighScores(), + m_vScreenshots(), m_mapDayToCaloriesBurned() { - InitAll(); + m_lastSong.Unset(); + m_lastCourse.Unset(); + + m_LastPlayedDate.Init(); + + FOREACH_ENUM( PlayMode, i ) + m_iNumSongsPlayedByPlayMode[i] = 0; + FOREACH_ENUM( Difficulty, i ) + m_iNumSongsPlayedByDifficulty[i] = 0; + for( int i=0; i m_StepsHighScores; int GetNumTimesPlayed() const; + HighScoresForASong(): m_StepsHighScores() {} }; std::map m_SongHighScores; @@ -196,11 +238,13 @@ public: struct HighScoresForATrail { HighScoreList hsl; + HighScoresForATrail(): hsl() {} }; struct HighScoresForACourse { std::map m_TrailHighScores; int GetNumTimesPlayed() const; + HighScoresForACourse(): m_TrailHighScores() {} }; std::map m_CourseHighScores; @@ -240,7 +284,7 @@ public: * insert some garbage entries into the map. */ struct Calories { - Calories() { fCals = 0; } + Calories(): fCals(0) {} float fCals; }; map m_mapDayToCaloriesBurned; diff --git a/src/RageTexturePreloader.h b/src/RageTexturePreloader.h index 1a45ffe28b..4f893ffe9a 100644 --- a/src/RageTexturePreloader.h +++ b/src/RageTexturePreloader.h @@ -8,7 +8,8 @@ class RageTexturePreloader { public: RageTexturePreloader(): m_apTextures() { } - RageTexturePreloader( const RageTexturePreloader &cpy ) { *this = cpy; } + RageTexturePreloader( const RageTexturePreloader &cpy ): + m_apTextures(cpy.m_apTextures) { } RageTexturePreloader &operator=( const RageTexturePreloader &rhs ); ~RageTexturePreloader(); void Load( const RageTextureID &ID ); diff --git a/src/RageUtil_CachedObject.h b/src/RageUtil_CachedObject.h index a74c80e2a7..1fee1a6397 100644 --- a/src/RageUtil_CachedObject.h +++ b/src/RageUtil_CachedObject.h @@ -114,11 +114,10 @@ public: Object::Register( this ); } - CachedObjectPointer( const CachedObjectPointer &cpy ) + CachedObjectPointer( const CachedObjectPointer &cpy ): + m_pCache(cpy.m_pCache), m_bCacheIsSet(cpy.m_bCacheIsSet) { CachedObjectHelpers::Lock(); - m_pCache = cpy.m_pCache; - m_bCacheIsSet = cpy.m_bCacheIsSet; Object::Register( this ); CachedObjectHelpers::Unlock(); } diff --git a/src/ScreenMiniMenu.h b/src/ScreenMiniMenu.h index 313166efd9..5bdd85ee2b 100644 --- a/src/ScreenMiniMenu.h +++ b/src/ScreenMiniMenu.h @@ -20,33 +20,60 @@ struct MenuRowDef bool bThemeTitle; bool bThemeItems; - MenuRowDef() {} - MenuRowDef( int r, RString n, MenuRowUpdateEnabled pe, EditMode s, bool bTT, bool bTI, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL, const char *c20=NULL, const char *c21=NULL, const char *c22=NULL, const char *c23=NULL, const char *c24=NULL, const char *c25=NULL ) + MenuRowDef(): iRowCode(0), sName(""), bEnabled(false), + pfnEnabled(), emShowIn(), iDefaultChoice(0), + choices(), bThemeTitle(false), bThemeItems(false) {} + MenuRowDef( int r, RString n, MenuRowUpdateEnabled pe, EditMode s, + bool bTT, bool bTI, int d, const char *c0=NULL, + const char *c1=NULL, const char *c2=NULL, + const char *c3=NULL, const char *c4=NULL, + const char *c5=NULL, const char *c6=NULL, + const char *c7=NULL, const char *c8=NULL, + const char *c9=NULL, const char *c10=NULL, + const char *c11=NULL, const char *c12=NULL, + const char *c13=NULL, const char *c14=NULL, + const char *c15=NULL, const char *c16=NULL, + const char *c17=NULL, const char *c18=NULL, + const char *c19=NULL, const char *c20=NULL, + const char *c21=NULL, const char *c22=NULL, + const char *c23=NULL, const char *c24=NULL, + const char *c25=NULL ): iRowCode(r), sName(n), + bEnabled(true), pfnEnabled(pe), emShowIn(s), + iDefaultChoice(d), choices(), + bThemeTitle(bTT), bThemeItems(bTI) { - iRowCode = r; - sName = n; - bEnabled = true; - pfnEnabled = pe; - emShowIn = s; - bThemeTitle = bTT; - bThemeItems = bTI; - iDefaultChoice = d; #define PUSH( c ) if(c) choices.push_back(c); - PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);PUSH(c20);PUSH(c21);PUSH(c22);PUSH(c22);PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25); + PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5); + PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11); + PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17); + PUSH(c18);PUSH(c19);PUSH(c20);PUSH(c21);PUSH(c22);PUSH(c22); + PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25); #undef PUSH } - MenuRowDef( int r, RString n, bool e, EditMode s, bool bTT, bool bTI, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL, const char *c20=NULL, const char *c21=NULL, const char *c22=NULL, const char *c23=NULL, const char *c24=NULL, const char *c25=NULL ) + MenuRowDef( int r, RString n, bool e, EditMode s, bool bTT, bool bTI, + int d, const char *c0=NULL, const char *c1=NULL, + const char *c2=NULL, const char *c3=NULL, + const char *c4=NULL, const char *c5=NULL, + const char *c6=NULL, const char *c7=NULL, + const char *c8=NULL, const char *c9=NULL, + const char *c10=NULL, const char *c11=NULL, + const char *c12=NULL, const char *c13=NULL, + const char *c14=NULL, const char *c15=NULL, + const char *c16=NULL, const char *c17=NULL, + const char *c18=NULL, const char *c19=NULL, + const char *c20=NULL, const char *c21=NULL, + const char *c22=NULL, const char *c23=NULL, + const char *c24=NULL, const char *c25=NULL ): + iRowCode(r), sName(n), bEnabled(e), pfnEnabled(NULL), + emShowIn(s), iDefaultChoice(d), choices(), + bThemeTitle(bTT), bThemeItems(bTI) { - iRowCode = r; - sName = n; - bEnabled = e; - pfnEnabled = NULL; - emShowIn = s; - bThemeTitle = bTT; - bThemeItems = bTI; - iDefaultChoice = d; #define PUSH( c ) if(c) choices.push_back(c); - PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);PUSH(c20);PUSH(c21);PUSH(c22);PUSH(c22);PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25); + PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5); + PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11); + PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17); + PUSH(c18);PUSH(c19);PUSH(c20);PUSH(c21);PUSH(c22);PUSH(c22); + PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25); #undef PUSH } @@ -76,11 +103,29 @@ struct MenuDef RString sClassName; vector rows; - MenuDef( RString c, MenuRowDef r0=MenuRowDef(), MenuRowDef r1=MenuRowDef(), MenuRowDef r2=MenuRowDef(), MenuRowDef r3=MenuRowDef(), MenuRowDef r4=MenuRowDef(), MenuRowDef r5=MenuRowDef(), MenuRowDef r6=MenuRowDef(), MenuRowDef r7=MenuRowDef(), MenuRowDef r8=MenuRowDef(), MenuRowDef r9=MenuRowDef(), MenuRowDef r10=MenuRowDef(), MenuRowDef r11=MenuRowDef(), MenuRowDef r12=MenuRowDef(), MenuRowDef r13=MenuRowDef(), MenuRowDef r14=MenuRowDef(), MenuRowDef r15=MenuRowDef(), MenuRowDef r16=MenuRowDef(), MenuRowDef r17=MenuRowDef(), MenuRowDef r18=MenuRowDef(), MenuRowDef r19=MenuRowDef(), MenuRowDef r20=MenuRowDef(), MenuRowDef r21=MenuRowDef(), MenuRowDef r22=MenuRowDef(), MenuRowDef r23=MenuRowDef(), MenuRowDef r24=MenuRowDef(), MenuRowDef r25=MenuRowDef(), MenuRowDef r26=MenuRowDef(), MenuRowDef r27=MenuRowDef(), MenuRowDef r28=MenuRowDef(), MenuRowDef r29=MenuRowDef() ) + MenuDef( RString c, MenuRowDef r0=MenuRowDef(), + MenuRowDef r1=MenuRowDef(), MenuRowDef r2=MenuRowDef(), + MenuRowDef r3=MenuRowDef(), MenuRowDef r4=MenuRowDef(), + MenuRowDef r5=MenuRowDef(), MenuRowDef r6=MenuRowDef(), + MenuRowDef r7=MenuRowDef(), MenuRowDef r8=MenuRowDef(), + MenuRowDef r9=MenuRowDef(), MenuRowDef r10=MenuRowDef(), + MenuRowDef r11=MenuRowDef(), MenuRowDef r12=MenuRowDef(), + MenuRowDef r13=MenuRowDef(), MenuRowDef r14=MenuRowDef(), + MenuRowDef r15=MenuRowDef(), MenuRowDef r16=MenuRowDef(), + MenuRowDef r17=MenuRowDef(), MenuRowDef r18=MenuRowDef(), + MenuRowDef r19=MenuRowDef(), MenuRowDef r20=MenuRowDef(), + MenuRowDef r21=MenuRowDef(), MenuRowDef r22=MenuRowDef(), + MenuRowDef r23=MenuRowDef(), MenuRowDef r24=MenuRowDef(), + MenuRowDef r25=MenuRowDef(), MenuRowDef r26=MenuRowDef(), + MenuRowDef r27=MenuRowDef(), MenuRowDef r28=MenuRowDef(), + MenuRowDef r29=MenuRowDef() ): sClassName(c), rows() { - sClassName = c; #define PUSH( r ) if(!r.sName.empty()) rows.push_back(r); - PUSH(r0);PUSH(r1);PUSH(r2);PUSH(r3);PUSH(r4);PUSH(r5);PUSH(r6);PUSH(r7);PUSH(r8);PUSH(r9);PUSH(r10);PUSH(r11);PUSH(r12);PUSH(r13);PUSH(r14);PUSH(r15);PUSH(r16);PUSH(r17);PUSH(r18);PUSH(r19);PUSH(r20);PUSH(r21);PUSH(r22);PUSH(r23);PUSH(r24);PUSH(r25);PUSH(r26);PUSH(r27);PUSH(r28);PUSH(r29); + PUSH(r0);PUSH(r1);PUSH(r2);PUSH(r3);PUSH(r4);PUSH(r5);PUSH(r6); + PUSH(r7);PUSH(r8);PUSH(r9);PUSH(r10);PUSH(r11);PUSH(r12); + PUSH(r13);PUSH(r14);PUSH(r15);PUSH(r16);PUSH(r17);PUSH(r18); + PUSH(r19);PUSH(r20);PUSH(r21);PUSH(r22);PUSH(r23);PUSH(r24); + PUSH(r25);PUSH(r26);PUSH(r27);PUSH(r28);PUSH(r29); #undef PUSH } }; @@ -89,7 +134,9 @@ struct MenuDef class ScreenMiniMenu : public ScreenOptions { public: - static void MiniMenu( const MenuDef* pDef, ScreenMessage smSendOnOK, ScreenMessage smSendOnCancel = SM_None, float fX = 0, float fY = 0 ); + static void MiniMenu( const MenuDef* pDef, ScreenMessage smSendOnOK, + ScreenMessage smSendOnCancel = SM_None, + float fX = 0, float fY = 0 ); void Init(); void BeginScreen(); @@ -110,6 +157,8 @@ protected: vector m_vMenuRows; public: + ScreenMiniMenu(): m_SMSendOnOK(), m_SMSendOnCancel(), m_vMenuRows() {} + static bool s_bCancelled; static int s_iLastRowCode; static vector s_viLastAnswers; diff --git a/src/ScreenTextEntry.h b/src/ScreenTextEntry.h index 1ed5136c41..c3dad0bbb6 100644 --- a/src/ScreenTextEntry.h +++ b/src/ScreenTextEntry.h @@ -71,7 +71,10 @@ public: } struct TextEntrySettings { - TextEntrySettings() { } + TextEntrySettings(): smSendOnPop(), sQuestion(""), + sInitialAnswer(""), iMaxInputLength(0), + bPassword(false), Validate(), OnOK(), OnCancel(), + ValidateAppend(), FormatAnswerForDisplay() { } ScreenMessage smSendOnPop; RString sQuestion; RString sInitialAnswer; diff --git a/src/StyleUtil.h b/src/StyleUtil.h index f2a93b4cf8..6051d17617 100644 --- a/src/StyleUtil.h +++ b/src/StyleUtil.h @@ -11,7 +11,7 @@ class StyleID RString sStyle; public: - StyleID() { Unset(); } + StyleID(): sGame(""), sStyle("") { } void Unset() { FromStyle(NULL); } void FromStyle( const Style *p ); const Style *ToStyle() const; diff --git a/src/ThemeMetric.h b/src/ThemeMetric.h index 80e445797e..5ef34f9abe 100644 --- a/src/ThemeMetric.h +++ b/src/ThemeMetric.h @@ -53,9 +53,9 @@ public: * (everything except screens). */ ThemeMetric( const RString& sGroup = "", const RString& sName = "" ): m_sGroup( sGroup ), - m_sName( sName ) + m_sName( sName ), + m_Value(), m_currentValue(T()), m_bCallEachTime(false) { - m_currentValue = T(); ThemeManager::Subscribe( this ); } @@ -64,6 +64,7 @@ public: m_sGroup( cpy.m_sGroup ), m_sName( cpy.m_sName ), m_Value( cpy.m_Value ) + // do we transfer the current value or bCallEachTime? { ThemeManager::Subscribe( this ); } diff --git a/src/TrailUtil.h b/src/TrailUtil.h index adaa71b6b3..12c4a7dd76 100644 --- a/src/TrailUtil.h +++ b/src/TrailUtil.h @@ -33,7 +33,8 @@ class TrailID mutable CachedObjectPointer m_Cache; public: - TrailID() { Unset(); } + TrailID(): st(StepsType_Invalid), cd(Difficulty_Invalid), + m_Cache() { m_Cache.Unset(); } void Unset() { FromTrail(NULL); } void FromTrail( const Trail *p ); Trail *ToTrail( const Course *p, bool bAllowNull ) const;