From d1272b001c9b60e0671c6ae69eb37e2c9dcc8407 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 21:42:07 -0400 Subject: [PATCH] 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