Skip to content

Commit 3b4cf3d

Browse files
committed
refactor(Core): Add override keyword to virtual function overrides in GameEngine
1 parent 38ab05d commit 3b4cf3d

57 files changed

Lines changed: 821 additions & 821 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Core/GameEngine/Include/Common/ArchiveFileSystem.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ class ArchiveFileSystem : public SubsystemInterface
124124
{
125125
public:
126126
ArchiveFileSystem();
127-
virtual ~ArchiveFileSystem();
127+
virtual ~ArchiveFileSystem() override;
128128

129-
virtual void init() = 0;
130-
virtual void update() = 0;
131-
virtual void reset() = 0;
132-
virtual void postProcessLoad() = 0;
129+
virtual void init() override = 0;
130+
virtual void update() override = 0;
131+
virtual void reset() override = 0;
132+
virtual void postProcessLoad() override = 0;
133133

134134
// ArchiveFile operations
135135
virtual ArchiveFile* openArchiveFile( const Char *filename ) = 0; ///< Create new or return existing Archive file from file name

Core/GameEngine/Include/Common/DynamicAudioEventInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class DynamicAudioEventInfo : public AudioEventInfo
5151
explicit DynamicAudioEventInfo( const AudioEventInfo & baseInfo );
5252

5353
// DynamicAudioEventInfo interfacing function overrides
54-
virtual Bool isLevelSpecific() const;
55-
virtual DynamicAudioEventInfo * getDynamicAudioEventInfo();
56-
virtual const DynamicAudioEventInfo * getDynamicAudioEventInfo() const;
54+
virtual Bool isLevelSpecific() const override;
55+
virtual DynamicAudioEventInfo * getDynamicAudioEventInfo() override;
56+
virtual const DynamicAudioEventInfo * getDynamicAudioEventInfo() const override;
5757

5858
// Change various fields from their default (INI) values
5959
void overrideAudioName( const AsciiString & newName );

Core/GameEngine/Include/Common/FileSystem.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ class FileSystem : public SubsystemInterface
142142

143143
public:
144144
FileSystem();
145-
virtual ~FileSystem();
145+
virtual ~FileSystem() override;
146146

147-
void init();
148-
void reset();
149-
void update();
147+
virtual void init() override;
148+
virtual void reset() override;
149+
virtual void update() override;
150150

151151
File* openFile( const Char *filename, Int access = File::NONE, size_t bufferSize = File::BUFFERSIZE, FileInstance instance = 0 ); ///< opens a File interface to the specified file
152152
Bool doesFileExist(const Char *filename, FileInstance instance = 0) const; ///< returns TRUE if the file exists. filename should have no directory.

Core/GameEngine/Include/Common/GameAudio.h

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ class AudioManager : public SubsystemInterface
143143
static const char *const MuteAudioReasonNames[];
144144

145145
AudioManager();
146-
virtual ~AudioManager();
146+
virtual ~AudioManager() override;
147147
#if defined(RTS_DEBUG)
148148
virtual void audioDebugDisplay(DebugDisplayInterface *dd, void *userData, FILE *fp = nullptr ) = 0;
149149
#endif
150150

151151
// From SubsystemInterface
152-
virtual void init();
153-
virtual void postProcessLoad();
154-
virtual void reset();
155-
virtual void update();
152+
virtual void init() override;
153+
virtual void postProcessLoad() override;
154+
virtual void reset() override;
155+
virtual void update() override;
156156

157157
// device dependent stop, pause and resume
158158
virtual void stopAudio( AudioAffect which ) = 0;
@@ -390,47 +390,47 @@ class AudioManagerDummy : public AudioManager
390390
#if defined(RTS_DEBUG)
391391
virtual void audioDebugDisplay(DebugDisplayInterface* dd, void* userData, FILE* fp) {}
392392
#endif
393-
virtual void stopAudio(AudioAffect which) {}
394-
virtual void pauseAudio(AudioAffect which) {}
395-
virtual void resumeAudio(AudioAffect which) {}
396-
virtual void pauseAmbient(Bool shouldPause) {}
397-
virtual void killAudioEventImmediately(AudioHandle audioEvent) {}
398-
virtual void nextMusicTrack() {}
399-
virtual void prevMusicTrack() {}
400-
virtual Bool isMusicPlaying() const { return false; }
401-
virtual Bool hasMusicTrackCompleted(const AsciiString& trackName, Int numberOfTimes) const { return false; }
402-
virtual AsciiString getMusicTrackName() const { return ""; }
403-
virtual void openDevice() {}
404-
virtual void closeDevice() {}
405-
virtual void* getDevice() { return nullptr; }
406-
virtual void notifyOfAudioCompletion(UnsignedInt audioCompleted, UnsignedInt flags) {}
407-
virtual UnsignedInt getProviderCount() const { return 0; };
408-
virtual AsciiString getProviderName(UnsignedInt providerNum) const { return ""; }
409-
virtual UnsignedInt getProviderIndex(AsciiString providerName) const { return 0; }
410-
virtual void selectProvider(UnsignedInt providerNdx) {}
411-
virtual void unselectProvider() {}
412-
virtual UnsignedInt getSelectedProvider() const { return 0; }
413-
virtual void setSpeakerType(UnsignedInt speakerType) {}
414-
virtual UnsignedInt getSpeakerType() { return 0; }
415-
virtual UnsignedInt getNum2DSamples() const { return 0; }
416-
virtual UnsignedInt getNum3DSamples() const { return 0; }
417-
virtual UnsignedInt getNumStreams() const { return 0; }
418-
virtual Bool doesViolateLimit(AudioEventRTS* event) const { return false; }
419-
virtual Bool isPlayingLowerPriority(AudioEventRTS* event) const { return false; }
420-
virtual Bool isPlayingAlready(AudioEventRTS* event) const { return false; }
421-
virtual Bool isObjectPlayingVoice(UnsignedInt objID) const { return false; }
422-
virtual void adjustVolumeOfPlayingAudio(AsciiString eventName, Real newVolume) {}
423-
virtual void removePlayingAudio(AsciiString eventName) {}
424-
virtual void removeAllDisabledAudio() {}
425-
virtual Bool has3DSensitiveStreamsPlaying() const { return false; }
426-
virtual void* getHandleForBink() { return nullptr; }
427-
virtual void releaseHandleForBink() {}
428-
virtual void friend_forcePlayAudioEventRTS(const AudioEventRTS* eventToPlay) {}
429-
virtual void setPreferredProvider(AsciiString providerNdx) {}
430-
virtual void setPreferredSpeaker(AsciiString speakerType) {}
431-
virtual Real getFileLengthMS(AsciiString strToLoad) const { return -1; }
432-
virtual void closeAnySamplesUsingFile(const void* fileToClose) {}
433-
virtual void setDeviceListenerPosition() {}
393+
virtual void stopAudio(AudioAffect which) override {}
394+
virtual void pauseAudio(AudioAffect which) override {}
395+
virtual void resumeAudio(AudioAffect which) override {}
396+
virtual void pauseAmbient(Bool shouldPause) override {}
397+
virtual void killAudioEventImmediately(AudioHandle audioEvent) override {}
398+
virtual void nextMusicTrack() override {}
399+
virtual void prevMusicTrack() override {}
400+
virtual Bool isMusicPlaying() const override { return false; }
401+
virtual Bool hasMusicTrackCompleted(const AsciiString& trackName, Int numberOfTimes) const override { return false; }
402+
virtual AsciiString getMusicTrackName() const override { return ""; }
403+
virtual void openDevice() override {}
404+
virtual void closeDevice() override {}
405+
virtual void* getDevice() override { return nullptr; }
406+
virtual void notifyOfAudioCompletion(UnsignedInt audioCompleted, UnsignedInt flags) override {}
407+
virtual UnsignedInt getProviderCount() const override { return 0; };
408+
virtual AsciiString getProviderName(UnsignedInt providerNum) const override { return ""; }
409+
virtual UnsignedInt getProviderIndex(AsciiString providerName) const override { return 0; }
410+
virtual void selectProvider(UnsignedInt providerNdx) override {}
411+
virtual void unselectProvider() override {}
412+
virtual UnsignedInt getSelectedProvider() const override { return 0; }
413+
virtual void setSpeakerType(UnsignedInt speakerType) override {}
414+
virtual UnsignedInt getSpeakerType() override { return 0; }
415+
virtual UnsignedInt getNum2DSamples() const override { return 0; }
416+
virtual UnsignedInt getNum3DSamples() const override { return 0; }
417+
virtual UnsignedInt getNumStreams() const override { return 0; }
418+
virtual Bool doesViolateLimit(AudioEventRTS* event) const override { return false; }
419+
virtual Bool isPlayingLowerPriority(AudioEventRTS* event) const override { return false; }
420+
virtual Bool isPlayingAlready(AudioEventRTS* event) const override { return false; }
421+
virtual Bool isObjectPlayingVoice(UnsignedInt objID) const override { return false; }
422+
virtual void adjustVolumeOfPlayingAudio(AsciiString eventName, Real newVolume) override {}
423+
virtual void removePlayingAudio(AsciiString eventName) override {}
424+
virtual void removeAllDisabledAudio() override {}
425+
virtual Bool has3DSensitiveStreamsPlaying() const override { return false; }
426+
virtual void* getHandleForBink() override { return nullptr; }
427+
virtual void releaseHandleForBink() override {}
428+
virtual void friend_forcePlayAudioEventRTS(const AudioEventRTS* eventToPlay) override {}
429+
virtual void setPreferredProvider(AsciiString providerNdx) override {}
430+
virtual void setPreferredSpeaker(AsciiString speakerType) override {}
431+
virtual Real getFileLengthMS(AsciiString strToLoad) const override { return -1; }
432+
virtual void closeAnySamplesUsingFile(const void* fileToClose) override {}
433+
virtual void setDeviceListenerPosition() override {}
434434
};
435435

436436

Core/GameEngine/Include/Common/GameSounds.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ class SoundManager : public SubsystemInterface
5252
{
5353
public:
5454
SoundManager();
55-
virtual ~SoundManager();
55+
virtual ~SoundManager() override;
5656

57-
virtual void init(); ///< Initializes the sounds system
58-
virtual void postProcessLoad();
59-
virtual void update(); ///< Services sounds tasks. Called by AudioInterface
60-
virtual void reset(); ///< Reset the sounds system
57+
virtual void init() override; ///< Initializes the sounds system
58+
virtual void postProcessLoad() override;
59+
virtual void update() override; ///< Services sounds tasks. Called by AudioInterface
60+
virtual void reset() override; ///< Reset the sounds system
6161

6262
virtual void loseFocus(); ///< Called when application loses focus
6363
virtual void regainFocus(); ///< Called when application regains focus

Core/GameEngine/Include/Common/LocalFile.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,31 +91,31 @@ class LocalFile : public File
9191
//virtual ~LocalFile();
9292

9393

94-
virtual Bool open( const Char *filename, Int access = NONE, size_t bufferSize = BUFFERSIZE ); ///< Open a file for access
95-
virtual void close(); ///< Close the file
96-
virtual Int read( void *buffer, Int bytes ); ///< Read the specified number of bytes in to buffer: See File::read
97-
virtual Int readChar(); ///< Read a character from the file
98-
virtual Int readWideChar(); ///< Read a wide character from the file
99-
virtual Int write( const void *buffer, Int bytes ); ///< Write the specified number of bytes from the buffer: See File::write
100-
virtual Int writeFormat( const Char* format, ... ); ///< Write an unterminated formatted string to the file
101-
virtual Int writeFormat( const WideChar* format, ... ); ///< Write an unterminated formatted string to the file
102-
virtual Int writeChar( const Char* character ); ///< Write a character to the file
103-
virtual Int writeChar( const WideChar* character ); ///< Write a wide character to the file
104-
virtual Int seek( Int new_pos, seekMode mode = CURRENT ); ///< Set file position: See File::seek
105-
virtual Bool flush(); ///< flush data to disk
106-
virtual void nextLine(Char *buf = nullptr, Int bufSize = 0); ///< moves file position to after the next new-line
107-
virtual Bool scanInt(Int &newInt); ///< return what gets read in as an integer at the current file position.
108-
virtual Bool scanReal(Real &newReal); ///< return what gets read in as a float at the current file position.
109-
virtual Bool scanString(AsciiString &newString); ///< return what gets read in as a string at the current file position.
94+
virtual Bool open( const Char *filename, Int access = NONE, size_t bufferSize = BUFFERSIZE ) override; ///< Open a file for access
95+
virtual void close() override; ///< Close the file
96+
virtual Int read( void *buffer, Int bytes ) override; ///< Read the specified number of bytes in to buffer: See File::read
97+
virtual Int readChar() override; ///< Read a character from the file
98+
virtual Int readWideChar() override; ///< Read a wide character from the file
99+
virtual Int write( const void *buffer, Int bytes ) override; ///< Write the specified number of bytes from the buffer: See File::write
100+
virtual Int writeFormat( const Char* format, ... ) override; ///< Write an unterminated formatted string to the file
101+
virtual Int writeFormat( const WideChar* format, ... ) override; ///< Write an unterminated formatted string to the file
102+
virtual Int writeChar( const Char* character ) override; ///< Write a character to the file
103+
virtual Int writeChar( const WideChar* character ) override; ///< Write a wide character to the file
104+
virtual Int seek( Int new_pos, seekMode mode = CURRENT ) override; ///< Set file position: See File::seek
105+
virtual Bool flush() override; ///< flush data to disk
106+
virtual void nextLine(Char *buf = nullptr, Int bufSize = 0) override; ///< moves file position to after the next new-line
107+
virtual Bool scanInt(Int &newInt) override; ///< return what gets read in as an integer at the current file position.
108+
virtual Bool scanReal(Real &newReal) override; ///< return what gets read in as a float at the current file position.
109+
virtual Bool scanString(AsciiString &newString) override; ///< return what gets read in as a string at the current file position.
110110
/**
111111
Allocate a buffer large enough to hold entire file, read
112112
the entire file into the buffer, then close the file.
113113
the buffer is owned by the caller, who is responsible
114114
for freeing is (via delete[]). This is a Good Thing to
115115
use because it minimizes memory copies for BIG files.
116116
*/
117-
virtual char* readEntireAndClose();
118-
virtual File* convertToRAMFile();
117+
virtual char* readEntireAndClose() override;
118+
virtual File* convertToRAMFile() override;
119119

120120
protected:
121121

Core/GameEngine/Include/Common/LocalFileSystem.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
class LocalFileSystem : public SubsystemInterface
3535
{
3636
public:
37-
virtual ~LocalFileSystem() {}
37+
virtual ~LocalFileSystem() override {}
3838

39-
virtual void init() = 0;
40-
virtual void reset() = 0;
41-
virtual void update() = 0;
39+
virtual void init() override = 0;
40+
virtual void reset() override = 0;
41+
virtual void update() override = 0;
4242

4343
virtual File * openFile(const Char *filename, Int access = File::NONE, size_t bufferSize = File::BUFFERSIZE) = 0;
4444
virtual Bool doesFileExist(const Char *filename) const = 0;

Core/GameEngine/Include/Common/OptionPreferences.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class OptionPreferences : public UserPreferences
4242
{
4343
public:
4444
OptionPreferences();
45-
virtual ~OptionPreferences();
45+
virtual ~OptionPreferences() override;
4646

4747
Bool loadFromIniFile();
4848

Core/GameEngine/Include/Common/RAMFile.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,23 @@ class RAMFile : public File
8282
//virtual ~RAMFile();
8383

8484

85-
virtual Bool open( const Char *filename, Int access = NONE, size_t bufferSize = 0 ); ///< Open a file for access
86-
virtual void close(); ///< Close the file
87-
virtual Int read( void *buffer, Int bytes ); ///< Read the specified number of bytes in to buffer: See File::read
88-
virtual Int readChar(); ///< Read a character from the file
89-
virtual Int readWideChar(); ///< Read a wide character from the file
90-
virtual Int write( const void *buffer, Int bytes ); ///< Write the specified number of bytes from the buffer: See File::write
91-
virtual Int writeFormat( const Char* format, ... ); ///< Write the formatted string to the file
92-
virtual Int writeFormat( const WideChar* format, ... ); ///< Write the formatted string to the file
93-
virtual Int writeChar( const Char* character ); ///< Write a character to the file
94-
virtual Int writeChar( const WideChar* character ); ///< Write a wide character to the file
95-
virtual Int seek( Int new_pos, seekMode mode = CURRENT ); ///< Set file position: See File::seek
96-
virtual Bool flush(); ///< flush data to disk
97-
virtual void nextLine(Char *buf = nullptr, Int bufSize = 0); ///< moves current position to after the next new-line
98-
99-
virtual Bool scanInt(Int &newInt); ///< return what gets read as an integer from the current memory position.
100-
virtual Bool scanReal(Real &newReal); ///< return what gets read as a float from the current memory position.
101-
virtual Bool scanString(AsciiString &newString); ///< return what gets read as a string from the current memory position.
85+
virtual Bool open( const Char *filename, Int access = NONE, size_t bufferSize = 0 ) override; ///< Open a file for access
86+
virtual void close() override; ///< Close the file
87+
virtual Int read( void *buffer, Int bytes ) override; ///< Read the specified number of bytes in to buffer: See File::read
88+
virtual Int readChar() override; ///< Read a character from the file
89+
virtual Int readWideChar() override; ///< Read a wide character from the file
90+
virtual Int write( const void *buffer, Int bytes ) override; ///< Write the specified number of bytes from the buffer: See File::write
91+
virtual Int writeFormat( const Char* format, ... ) override; ///< Write the formatted string to the file
92+
virtual Int writeFormat( const WideChar* format, ... ) override; ///< Write the formatted string to the file
93+
virtual Int writeChar( const Char* character ) override; ///< Write a character to the file
94+
virtual Int writeChar( const WideChar* character ) override; ///< Write a wide character to the file
95+
virtual Int seek( Int new_pos, seekMode mode = CURRENT ) override; ///< Set file position: See File::seek
96+
virtual Bool flush() override; ///< flush data to disk
97+
virtual void nextLine(Char *buf = nullptr, Int bufSize = 0) override; ///< moves current position to after the next new-line
98+
99+
virtual Bool scanInt(Int &newInt) override; ///< return what gets read as an integer from the current memory position.
100+
virtual Bool scanReal(Real &newReal) override; ///< return what gets read as a float from the current memory position.
101+
virtual Bool scanString(AsciiString &newString) override; ///< return what gets read as a string from the current memory position.
102102

103103
virtual Bool open( File *file ); ///< Open file for fast RAM access
104104
virtual Bool openFromArchive(File *archiveFile, const AsciiString& filename, Int offset, Int size); ///< copy file data from the given file at the given offset for the given size.
@@ -111,8 +111,8 @@ class RAMFile : public File
111111
for freeing is (via delete[]). This is a Good Thing to
112112
use because it minimizes memory copies for BIG files.
113113
*/
114-
virtual char* readEntireAndClose();
115-
virtual File* convertToRAMFile();
114+
virtual char* readEntireAndClose() override;
115+
virtual File* convertToRAMFile() override;
116116

117117
protected:
118118

Core/GameEngine/Include/Common/Radar.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ class RadarObject : public MemoryPoolObject,
110110
protected:
111111

112112
// snapshot methods
113-
virtual void crc( Xfer *xfer );
114-
virtual void xfer( Xfer *xfer );
115-
virtual void loadPostProcess();
113+
virtual void crc( Xfer *xfer ) override;
114+
virtual void xfer( Xfer *xfer ) override;
115+
virtual void loadPostProcess() override;
116116

117117
Object *m_object; ///< the object
118118
RadarObject *m_next; ///< next radar object
@@ -157,11 +157,11 @@ class Radar : public Snapshot,
157157
public:
158158

159159
Radar();
160-
virtual ~Radar();
160+
virtual ~Radar() override;
161161

162-
virtual void init() { } ///< subsystem initialization
163-
virtual void reset(); ///< subsystem reset
164-
virtual void update(); ///< subsystem per frame update
162+
virtual void init() override { } ///< subsystem initialization
163+
virtual void reset() override; ///< subsystem reset
164+
virtual void update() override; ///< subsystem per frame update
165165

166166
// is the game window parameter the radar window
167167
Bool isRadarWindow( GameWindow *window ) { return (m_radarWindow == window) && (m_radarWindow != nullptr); }
@@ -228,9 +228,9 @@ class Radar : public Snapshot,
228228
protected:
229229

230230
// snapshot methods
231-
virtual void crc( Xfer *xfer );
232-
virtual void xfer( Xfer *xfer );
233-
virtual void loadPostProcess();
231+
virtual void crc( Xfer *xfer ) override;
232+
virtual void xfer( Xfer *xfer ) override;
233+
virtual void loadPostProcess() override;
234234

235235
/// internal method for creating a radar event with specific colors
236236
void internalCreateEvent( const Coord3D *world, RadarEventType type, Real secondsToLive,
@@ -304,7 +304,7 @@ extern Radar *TheRadar; ///< the radar singleton extern
304304
class RadarDummy : public Radar
305305
{
306306
public:
307-
virtual void draw(Int pixelX, Int pixelY, Int width, Int height) { }
308-
virtual void clearShroud() { }
309-
virtual void setShroudLevel(Int x, Int y, CellShroudStatus setting) { }
307+
virtual void draw(Int pixelX, Int pixelY, Int width, Int height) override { }
308+
virtual void clearShroud() override { }
309+
virtual void setShroudLevel(Int x, Int y, CellShroudStatus setting) override { }
310310
};

0 commit comments

Comments
 (0)