summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-03-03 22:25:13 +0000
committerMichael Lutz <michi@icosahedron.de>2019-03-24 16:10:04 +0100
commitaf7d9020a15c1b1a14b3981ac73c70d2e58cc877 (patch)
tree1dcff3e01382ea3a0a4733a4637659dbbfd4bad5 /src
parent31260e66252fb4d0dda6f992520faeeb96929cfe (diff)
downloadopenttd-af7d9020a15c1b1a14b3981ac73c70d2e58cc877.tar.xz
Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual member declaration overrides a base-class member with the same signature. Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked as virtual despite being a template.
Diffstat (limited to 'src')
-rw-r--r--src/ai/ai_config.hpp12
-rw-r--r--src/ai/ai_gui.cpp2
-rw-r--r--src/ai/ai_instance.hpp12
-rw-r--r--src/ai/ai_scanner.hpp24
-rw-r--r--src/base_media_base.h2
-rw-r--r--src/blitter/32bpp_anim.hpp30
-rw-r--r--src/blitter/32bpp_anim_sse2.hpp6
-rw-r--r--src/blitter/32bpp_anim_sse4.hpp10
-rw-r--r--src/blitter/32bpp_base.hpp26
-rw-r--r--src/blitter/32bpp_optimized.hpp8
-rw-r--r--src/blitter/32bpp_simple.hpp10
-rw-r--r--src/blitter/32bpp_sse2.hpp8
-rw-r--r--src/blitter/32bpp_sse4.hpp6
-rw-r--r--src/blitter/32bpp_ssse3.hpp6
-rw-r--r--src/blitter/8bpp_base.hpp28
-rw-r--r--src/blitter/8bpp_optimized.hpp8
-rw-r--r--src/blitter/8bpp_simple.hpp8
-rw-r--r--src/blitter/null.hpp38
-rw-r--r--src/fileio_func.h2
-rw-r--r--src/fios.cpp4
-rw-r--r--src/game/game_config.hpp2
-rw-r--r--src/game/game_info.hpp2
-rw-r--r--src/game/game_instance.hpp12
-rw-r--r--src/game/game_scanner.hpp24
-rw-r--r--src/game/game_text.cpp4
-rw-r--r--src/goal_gui.cpp20
-rw-r--r--src/ground_vehicle.hpp4
-rw-r--r--src/music/allegro_m.h16
-rw-r--r--src/music/bemidi.h16
-rw-r--r--src/music/cocoa_m.h16
-rw-r--r--src/music/dmusic.h16
-rw-r--r--src/music/extmidi.h16
-rw-r--r--src/music/fluidsynth.h16
-rw-r--r--src/music/null_m.h16
-rw-r--r--src/music/os2_m.h16
-rw-r--r--src/music/qtmidi.h16
-rw-r--r--src/music/win32_m.h16
-rw-r--r--src/network/network_client.cpp4
-rw-r--r--src/network/network_content_gui.cpp2
-rw-r--r--src/network/network_gui.cpp8
-rw-r--r--src/network/network_server.cpp4
-rw-r--r--src/newgrf_airport.cpp10
-rw-r--r--src/newgrf_airporttiles.h6
-rw-r--r--src/newgrf_canal.cpp8
-rw-r--r--src/newgrf_cargo.cpp2
-rw-r--r--src/newgrf_config.cpp2
-rw-r--r--src/newgrf_engine.h10
-rw-r--r--src/newgrf_generic.cpp6
-rw-r--r--src/newgrf_gui.cpp2
-rw-r--r--src/newgrf_house.h8
-rw-r--r--src/newgrf_industries.h10
-rw-r--r--src/newgrf_industrytiles.h8
-rw-r--r--src/newgrf_object.h6
-rw-r--r--src/newgrf_railtype.h8
-rw-r--r--src/newgrf_station.h10
-rw-r--r--src/newgrf_town.h2
-rw-r--r--src/os/macosx/crashlog_osx.cpp6
-rw-r--r--src/os/unix/crashlog_unix.cpp6
-rw-r--r--src/os/windows/crashlog_win.cpp12
-rw-r--r--src/saveload/saveload.cpp28
-rw-r--r--src/script/api/script_text.hpp2
-rw-r--r--src/script/script_scanner.hpp2
-rw-r--r--src/settings_gui.cpp2
-rw-r--r--src/sound/allegro_s.h8
-rw-r--r--src/sound/cocoa_s.h8
-rw-r--r--src/sound/null_s.h8
-rw-r--r--src/sound/sdl_s.h8
-rw-r--r--src/sound/win32_s.h8
-rw-r--r--src/sound/xaudio2_s.h8
-rw-r--r--src/station_base.h12
-rw-r--r--src/strgen/strgen.cpp6
-rw-r--r--src/strings.cpp10
-rw-r--r--src/table/newgrf_debug_data.h154
-rw-r--r--src/thread/thread_os2.cpp14
-rw-r--r--src/thread/thread_pthread.cpp14
-rw-r--r--src/thread/thread_win32.cpp16
-rw-r--r--src/toolbar_gui.cpp14
-rw-r--r--src/video/allegro_v.h20
-rw-r--r--src/video/cocoa/cocoa_v.h20
-rw-r--r--src/video/dedicated_v.h18
-rw-r--r--src/video/null_v.h18
-rw-r--r--src/video/sdl_v.h24
-rw-r--r--src/video/win32_v.h26
-rw-r--r--src/waypoint_base.h12
-rw-r--r--src/widget_type.h72
85 files changed, 575 insertions, 575 deletions
diff --git a/src/ai/ai_config.hpp b/src/ai/ai_config.hpp
index 30c6f84bb..9f667a612 100644
--- a/src/ai/ai_config.hpp
+++ b/src/ai/ai_config.hpp
@@ -30,9 +30,9 @@ public:
class AIInfo *GetInfo() const;
- /* virtual */ int GetSetting(const char *name) const;
- /* virtual */ void SetSetting(const char *name, int value);
- /* virtual */ void AddRandomDeviation();
+ int GetSetting(const char *name) const override;
+ void SetSetting(const char *name, int value) override;
+ void AddRandomDeviation() override;
/**
* When ever the AI Scanner is reloaded, all infos become invalid. This
@@ -45,9 +45,9 @@ public:
bool ResetInfo(bool force_exact_match);
protected:
- /* virtual */ void PushExtraConfigList();
- /* virtual */ void ClearConfigList();
- /* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match);
+ void PushExtraConfigList() override;
+ void ClearConfigList() override;
+ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match) override;
};
#endif /* AI_CONFIG_HPP */
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index 8e7e12a63..5a4c77246 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -646,7 +646,7 @@ struct ScriptTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR);
}
- /* virtual */ void SetStringParameters(int widget) const
+ void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, (slot == OWNER_DEITY) ? STR_CONTENT_TYPE_GAME_SCRIPT : STR_CONTENT_TYPE_AI);
diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp
index 204bf9712..06998558b 100644
--- a/src/ai/ai_instance.hpp
+++ b/src/ai/ai_instance.hpp
@@ -25,14 +25,14 @@ public:
*/
void Initialize(class AIInfo *info);
- /* virtual */ int GetSetting(const char *name);
- /* virtual */ ScriptInfo *FindLibrary(const char *library, int version);
+ int GetSetting(const char *name) override;
+ ScriptInfo *FindLibrary(const char *library, int version) override;
private:
- /* virtual */ void RegisterAPI();
- /* virtual */ void Died();
- /* virtual */ CommandCallback *GetDoCommandCallback();
- /* virtual */ void LoadDummyScript();
+ void RegisterAPI() override;
+ void Died() override;
+ CommandCallback *GetDoCommandCallback() override;
+ void LoadDummyScript() override;
};
#endif /* AI_INSTANCE_HPP */
diff --git a/src/ai/ai_scanner.hpp b/src/ai/ai_scanner.hpp
index d8e8a6993..dafc340be 100644
--- a/src/ai/ai_scanner.hpp
+++ b/src/ai/ai_scanner.hpp
@@ -19,7 +19,7 @@ public:
AIScannerInfo();
~AIScannerInfo();
- /* virtual */ void Initialize();
+ void Initialize() override;
/**
* Select a random AI.
@@ -42,11 +42,11 @@ public:
void SetDummyAI(class AIInfo *info);
protected:
- /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
- /* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; }
- /* virtual */ Subdirectory GetDirectory() const { return AI_DIR; }
- /* virtual */ const char *GetScannerName() const { return "AIs"; }
- /* virtual */ void RegisterAPI(class Squirrel *engine);
+ void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
+ const char *GetFileName() const override { return PATHSEP "info.nut"; }
+ Subdirectory GetDirectory() const override { return AI_DIR; }
+ const char *GetScannerName() const override { return "AIs"; }
+ void RegisterAPI(class Squirrel *engine) override;
private:
AIInfo *info_dummy; ///< The dummy AI.
@@ -54,7 +54,7 @@ private:
class AIScannerLibrary : public ScriptScanner {
public:
- /* virtual */ void Initialize();
+ void Initialize() override;
/**
* Find a library in the pool.
@@ -65,11 +65,11 @@ public:
class AILibrary *FindLibrary(const char *library, int version);
protected:
- /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
- /* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; }
- /* virtual */ Subdirectory GetDirectory() const { return AI_LIBRARY_DIR; }
- /* virtual */ const char *GetScannerName() const { return "AI Libraries"; }
- /* virtual */ void RegisterAPI(class Squirrel *engine);
+ void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
+ const char *GetFileName() const override { return PATHSEP "library.nut"; }
+ Subdirectory GetDirectory() const override { return AI_LIBRARY_DIR; }
+ const char *GetScannerName() const override { return "AI Libraries"; }
+ void RegisterAPI(class Squirrel *engine) override;
};
#endif /* AI_SCANNER_HPP */
diff --git a/src/base_media_base.h b/src/base_media_base.h
index b040abcf9..bcffa11a0 100644
--- a/src/base_media_base.h
+++ b/src/base_media_base.h
@@ -176,7 +176,7 @@ protected:
static Tbase_set *duplicate_sets; ///< All sets that aren't available, but needed for not downloading base sets when a newer version than the one on BaNaNaS is loaded.
static const Tbase_set *used_set; ///< The currently used set
- /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
+ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
/**
* Get the extension that is used to identify this set.
diff --git a/src/blitter/32bpp_anim.hpp b/src/blitter/32bpp_anim.hpp
index ecf6dcfca..f8fd89281 100644
--- a/src/blitter/32bpp_anim.hpp
+++ b/src/blitter/32bpp_anim.hpp
@@ -37,21 +37,21 @@ public:
~Blitter_32bppAnim();
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
- /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
- /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
- /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash);
- /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
- /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
- /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
- /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
- /* virtual */ int BufferSize(int width, int height);
- /* virtual */ void PaletteAnimate(const Palette &palette);
- /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
+ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
+ void SetPixel(void *video, int x, int y, uint8 colour) override;
+ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override;
+ void DrawRect(void *video, int width, int height, uint8 colour) override;
+ void CopyFromBuffer(void *video, const void *src, int width, int height) override;
+ void CopyToBuffer(const void *video, void *dst, int width, int height) override;
+ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
+ int BufferSize(int width, int height) override;
+ void PaletteAnimate(const Palette &palette) override;
+ Blitter::PaletteAnimation UsePaletteAnimation() override;
- /* virtual */ const char *GetName() { return "32bpp-anim"; }
- /* virtual */ int GetBytesPerPixel() { return 6; }
- /* virtual */ void PostResize();
+ const char *GetName() override { return "32bpp-anim"; }
+ int GetBytesPerPixel() override { return 6; }
+ void PostResize() override;
/**
* Look up the colour in the current palette.
@@ -77,7 +77,7 @@ public:
class FBlitter_32bppAnim : public BlitterFactory {
public:
FBlitter_32bppAnim() : BlitterFactory("32bpp-anim", "32bpp Animation Blitter (palette animation)") {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); }
+ Blitter *CreateInstance() override { return new Blitter_32bppAnim(); }
};
#endif /* BLITTER_32BPP_ANIM_HPP */
diff --git a/src/blitter/32bpp_anim_sse2.hpp b/src/blitter/32bpp_anim_sse2.hpp
index 0d4a5f1e6..aed11026c 100644
--- a/src/blitter/32bpp_anim_sse2.hpp
+++ b/src/blitter/32bpp_anim_sse2.hpp
@@ -28,15 +28,15 @@
/** A partially 32 bpp blitter with palette animation. */
class Blitter_32bppSSE2_Anim : public Blitter_32bppAnim {
public:
- /* virtual */ void PaletteAnimate(const Palette &palette);
- /* virtual */ const char *GetName() { return "32bpp-sse2-anim"; }
+ void PaletteAnimate(const Palette &palette) override;
+ const char *GetName() override { return "32bpp-sse2-anim"; }
};
/** Factory for the partially 32bpp blitter with animation. */
class FBlitter_32bppSSE2_Anim : public BlitterFactory {
public:
FBlitter_32bppSSE2_Anim() : BlitterFactory("32bpp-sse2-anim", "32bpp partially SSE2 Animation Blitter (palette animation)", HasCPUIDFlag(1, 3, 26)) {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE2_Anim(); }
+ Blitter *CreateInstance() override { return new Blitter_32bppSSE2_Anim(); }
};
#endif /* WITH_SSE */
diff --git a/src/blitter/32bpp_anim_sse4.hpp b/src/blitter/32bpp_anim_sse4.hpp
index 5ff1fb01b..2fefd3001 100644
--- a/src/blitter/32bpp_anim_sse4.hpp
+++ b/src/blitter/32bpp_anim_sse4.hpp
@@ -35,19 +35,19 @@ private:
public:
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent, bool animated>
- /* virtual */ void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
- /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) {
+ void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
+ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override {
return Blitter_32bppSSE_Base::Encode(sprite, allocator);
}
- /* virtual */ const char *GetName() { return "32bpp-sse4-anim"; }
+ const char *GetName() override { return "32bpp-sse4-anim"; }
};
/** Factory for the SSE4 32 bpp blitter (with palette animation). */
class FBlitter_32bppSSE4_Anim: public BlitterFactory {
public:
FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4_Anim(); }
+ Blitter *CreateInstance() override { return new Blitter_32bppSSE4_Anim(); }
};
#endif /* WITH_SSE */
diff --git a/src/blitter/32bpp_base.hpp b/src/blitter/32bpp_base.hpp
index 697593da6..e481c15cc 100644
--- a/src/blitter/32bpp_base.hpp
+++ b/src/blitter/32bpp_base.hpp
@@ -20,19 +20,19 @@
/** Base for all 32bpp blitters. */
class Blitter_32bppBase : public Blitter {
public:
- /* virtual */ uint8 GetScreenDepth() { return 32; }
- /* virtual */ void *MoveTo(void *video, int x, int y);
- /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
- /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash);
- /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
- /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
- /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
- /* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch);
- /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
- /* virtual */ int BufferSize(int width, int height);
- /* virtual */ void PaletteAnimate(const Palette &palette);
- /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
- /* virtual */ int GetBytesPerPixel() { return 4; }
+ uint8 GetScreenDepth() override { return 32; }
+ void *MoveTo(void *video, int x, int y) override;
+ void SetPixel(void *video, int x, int y, uint8 colour) override;
+ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override;
+ void DrawRect(void *video, int width, int height, uint8 colour) override;
+ void CopyFromBuffer(void *video, const void *src, int width, int height) override;
+ void CopyToBuffer(const void *video, void *dst, int width, int height) override;
+ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
+ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
+ int BufferSize(int width, int height) override;
+ void PaletteAnimate(const Palette &palette) override;
+ Blitter::PaletteAnimation UsePaletteAnimation() override;
+ int GetBytesPerPixel() override { return 4; }
/**
* Look up the colour in the current palette.
diff --git a/src/blitter/32bpp_optimized.hpp b/src/blitter/32bpp_optimized.hpp
index c261aa33d..fc8a40653 100644
--- a/src/blitter/32bpp_optimized.hpp
+++ b/src/blitter/32bpp_optimized.hpp
@@ -23,10 +23,10 @@ public:
byte data[]; ///< Data, all zoomlevels.
};
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
- /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
+ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
- /* virtual */ const char *GetName() { return "32bpp-optimized"; }
+ const char *GetName() override { return "32bpp-optimized"; }
template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
};
@@ -35,7 +35,7 @@ public:
class FBlitter_32bppOptimized : public BlitterFactory {
public:
FBlitter_32bppOptimized() : BlitterFactory("32bpp-optimized", "32bpp Optimized Blitter (no palette animation)") {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppOptimized(); }
+ Blitter *CreateInstance() override { return new Blitter_32bppOptimized(); }
};
#endif /* BLITTER_32BPP_OPTIMIZED_HPP */
diff --git a/src/blitter/32bpp_simple.hpp b/src/blitter/32bpp_simple.hpp
index 0751f6f75..3d43971e9 100644
--- a/src/blitter/32bpp_simple.hpp
+++ b/src/blitter/32bpp_simple.hpp
@@ -26,18 +26,18 @@ class Blitter_32bppSimple : public Blitter_32bppBase {
uint8 v; ///< Brightness-channel
};
public:
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
- /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
- /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
+ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
+ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
- /* virtual */ const char *GetName() { return "32bpp-simple"; }
+ const char *GetName() override { return "32bpp-simple"; }
};
/** Factory for the simple 32 bpp blitter. */
class FBlitter_32bppSimple : public BlitterFactory {
public:
FBlitter_32bppSimple() : BlitterFactory("32bpp-simple", "32bpp Simple Blitter (no palette animation)") {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSimple(); }
+ Blitter *CreateInstance() override { return new Blitter_32bppSimple(); }
};
#endif /* BLITTER_32BPP_SIMPLE_HPP */
diff --git a/src/blitter/32bpp_sse2.hpp b/src/blitter/32bpp_sse2.hpp
index d6b17f679..1628f1fa2 100644
--- a/src/blitter/32bpp_sse2.hpp
+++ b/src/blitter/32bpp_sse2.hpp
@@ -82,22 +82,22 @@ DECLARE_ENUM_AS_BIT_SET(Blitter_32bppSSE_Base::SpriteFlags);
/** The SSE2 32 bpp blitter (without palette animation). */
class Blitter_32bppSSE2 : public Blitter_32bppSimple, public Blitter_32bppSSE_Base {
public:
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
- /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) {
+ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override {
return Blitter_32bppSSE_Base::Encode(sprite, allocator);
}
- /* virtual */ const char *GetName() { return "32bpp-sse2"; }
+ const char *GetName() override { return "32bpp-sse2"; }
};
/** Factory for the SSE2 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSE2 : public BlitterFactory {
public:
FBlitter_32bppSSE2() : BlitterFactory("32bpp-sse2", "32bpp SSE2 Blitter (no palette animation)", HasCPUIDFlag(1, 3, 26)) {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE2(); }
+ Blitter *CreateInstance() override { return new Blitter_32bppSSE2(); }
};
#endif /* WITH_SSE */
diff --git a/src/blitter/32bpp_sse4.hpp b/src/blitter/32bpp_sse4.hpp
index 9c59d253f..36b5b16d4 100644
--- a/src/blitter/32bpp_sse4.hpp
+++ b/src/blitter/32bpp_sse4.hpp
@@ -27,17 +27,17 @@
/** The SSE4 32 bpp blitter (without palette animation). */
class Blitter_32bppSSE4 : public Blitter_32bppSSSE3 {
public:
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
- /* virtual */ const char *GetName() { return "32bpp-sse4"; }
+ const char *GetName() override { return "32bpp-sse4"; }
};
/** Factory for the SSE4 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSE4: public BlitterFactory {
public:
FBlitter_32bppSSE4() : BlitterFactory("32bpp-sse4", "32bpp SSE4 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 19)) {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4(); }
+ Blitter *CreateInstance() override { return new Blitter_32bppSSE4(); }
};
#endif /* WITH_SSE */
diff --git a/src/blitter/32bpp_ssse3.hpp b/src/blitter/32bpp_ssse3.hpp
index e9cac8ff0..3d6152e9e 100644
--- a/src/blitter/32bpp_ssse3.hpp
+++ b/src/blitter/32bpp_ssse3.hpp
@@ -27,17 +27,17 @@
/** The SSSE3 32 bpp blitter (without palette animation). */
class Blitter_32bppSSSE3 : public Blitter_32bppSSE2 {
public:
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
- /* virtual */ const char *GetName() { return "32bpp-ssse3"; }
+ const char *GetName() override { return "32bpp-ssse3"; }
};
/** Factory for the SSSE3 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSSE3: public BlitterFactory {
public:
FBlitter_32bppSSSE3() : BlitterFactory("32bpp-ssse3", "32bpp SSSE3 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 9)) {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSSE3(); }
+ Blitter *CreateInstance() override { return new Blitter_32bppSSSE3(); }
};
#endif /* WITH_SSE */
diff --git a/src/blitter/8bpp_base.hpp b/src/blitter/8bpp_base.hpp
index 8f75dda5d..7ab3f6378 100644
--- a/src/blitter/8bpp_base.hpp
+++ b/src/blitter/8bpp_base.hpp
@@ -17,20 +17,20 @@
/** Base for all 8bpp blitters. */
class Blitter_8bppBase : public Blitter {
public:
- /* virtual */ uint8 GetScreenDepth() { return 8; }
- /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
- /* virtual */ void *MoveTo(void *video, int x, int y);
- /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
- /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash);
- /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
- /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
- /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
- /* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch);
- /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
- /* virtual */ int BufferSize(int width, int height);
- /* virtual */ void PaletteAnimate(const Palette &palette);
- /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
- /* virtual */ int GetBytesPerPixel() { return 1; }
+ uint8 GetScreenDepth() override { return 8; }
+ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
+ void *MoveTo(void *video, int x, int y) override;
+ void SetPixel(void *video, int x, int y, uint8 colour) override;
+ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override;
+ void DrawRect(void *video, int width, int height, uint8 colour) override;
+ void CopyFromBuffer(void *video, const void *src, int width, int height) override;
+ void CopyToBuffer(const void *video, void *dst, int width, int height) override;
+ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
+ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
+ int BufferSize(int width, int height) override;
+ void PaletteAnimate(const Palette &palette) override;
+ Blitter::PaletteAnimation UsePaletteAnimation() override;
+ int GetBytesPerPixel() override { return 1; }
};
#endif /* BLITTER_8BPP_BASE_HPP */
diff --git a/src/blitter/8bpp_optimized.hpp b/src/blitter/8bpp_optimized.hpp
index b5b5324b9..509edb8c4 100644
--- a/src/blitter/8bpp_optimized.hpp
+++ b/src/blitter/8bpp_optimized.hpp
@@ -24,17 +24,17 @@ public:
byte data[]; ///< Data, all zoomlevels.
};
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
- /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
+ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
- /* virtual */ const char *GetName() { return "8bpp-optimized"; }
+ const char *GetName() override { return "8bpp-optimized"; }
};
/** Factory for the 8bpp blitter optimised for speed. */
class FBlitter_8bppOptimized : public BlitterFactory {
public:
FBlitter_8bppOptimized() : BlitterFactory("8bpp-optimized", "8bpp Optimized Blitter (compression + all-ZoomLevel cache)") {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_8bppOptimized(); }
+ Blitter *CreateInstance() override { return new Blitter_8bppOptimized(); }
};
#endif /* BLITTER_8BPP_OPTIMIZED_HPP */
diff --git a/src/blitter/8bpp_simple.hpp b/src/blitter/8bpp_simple.hpp
index c00c75ac0..e48bc3758 100644
--- a/src/blitter/8bpp_simple.hpp
+++ b/src/blitter/8bpp_simple.hpp
@@ -18,17 +18,17 @@
/** Most trivial 8bpp blitter. */
class Blitter_8bppSimple FINAL : public Blitter_8bppBase {
public:
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
- /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
+ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
- /* virtual */ const char *GetName() { return "8bpp-simple"; }
+ const char *GetName() override { return "8bpp-simple"; }
};
/** Factory for the most trivial 8bpp blitter. */
class FBlitter_8bppSimple : public BlitterFactory {
public:
FBlitter_8bppSimple() : BlitterFactory("8bpp-simple", "8bpp Simple Blitter (relative slow, but never wrong)") {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_8bppSimple(); }
+ Blitter *CreateInstance() override { return new Blitter_8bppSimple(); }
};
#endif /* BLITTER_8BPP_SIMPLE_HPP */
diff --git a/src/blitter/null.hpp b/src/blitter/null.hpp
index a6fed2ebc..8dc98646c 100644
--- a/src/blitter/null.hpp
+++ b/src/blitter/null.hpp
@@ -17,31 +17,31 @@
/** Blitter that does nothing. */
class Blitter_Null : public Blitter {
public:
- /* virtual */ uint8 GetScreenDepth() { return 0; }
- /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {};
- /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) {};
- /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator);
- /* virtual */ void *MoveTo(void *video, int x, int y) { return NULL; };
- /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {};
- /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {};
- /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) {};
- /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height) {};
- /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height) {};
- /* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) {};
- /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) {};
- /* virtual */ int BufferSize(int width, int height) { return 0; };
- /* virtual */ void PaletteAnimate(const Palette &palette) { };
- /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation() { return Blitter::PALETTE_ANIMATION_NONE; };
-
- /* virtual */ const char *GetName() { return "null"; }
- /* virtual */ int GetBytesPerPixel() { return 0; }
+ uint8 GetScreenDepth() override { return 0; }
+ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override {};
+ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override {};
+ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
+ void *MoveTo(void *video, int x, int y) override { return NULL; };
+ void SetPixel(void *video, int x, int y, uint8 colour) override {};
+ void DrawRect(void *video, int width, int height, uint8 colour) override {};
+ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override {};
+ void CopyFromBuffer(void *video, const void *src, int width, int height) override {};
+ void CopyToBuffer(const void *video, void *dst, int width, int height) override {};
+ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override {};
+ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override {};
+ int BufferSize(int width, int height) override { return 0; };
+ void PaletteAnimate(const Palette &palette) override { };
+ Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; };
+
+ const char *GetName() override { return "null"; }
+ int GetBytesPerPixel() override { return 0; }
};
/** Factory for the blitter that does nothing. */
class FBlitter_Null : public BlitterFactory {
public:
FBlitter_Null() : BlitterFactory("null", "Null Blitter (does nothing)") {}
- /* virtual */ Blitter *CreateInstance() { return new Blitter_Null(); }
+ Blitter *CreateInstance() override { return new Blitter_Null(); }
};
#endif /* BLITTER_NULL_HPP */
diff --git a/src/fileio_func.h b/src/fileio_func.h
index f5ef58ac0..8263b7872 100644
--- a/src/fileio_func.h
+++ b/src/fileio_func.h
@@ -107,7 +107,7 @@ public:
ALL = BASESET | NEWGRF | AI | SCENARIO | GAME, ///< Scan for everything.
};
- /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename = NULL);
+ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename = NULL) override;
bool AddFile(Subdirectory sd, const char *filename);
diff --git a/src/fios.cpp b/src/fios.cpp
index 835c04ddb..f849b9a16 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -276,7 +276,7 @@ public:
fop(fop), callback_proc(callback_proc), file_list(file_list)
{}
- /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
+ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
};
/**
@@ -673,7 +673,7 @@ public:
this->scanned = true;
}
- /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename)
+ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override
{
FILE *f = FioFOpenFile(filename, "r", SCENARIO_DIR);
if (f == NULL) return false;
diff --git a/src/game/game_config.hpp b/src/game/game_config.hpp
index e9ebdc38c..dfae62c3a 100644
--- a/src/game/game_config.hpp
+++ b/src/game/game_config.hpp
@@ -42,7 +42,7 @@ public:
bool ResetInfo(bool force_exact_match);
protected:
- /* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match);
+ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match) override;
};
#endif /* GAME_CONFIG_HPP */
diff --git a/src/game/game_info.hpp b/src/game/game_info.hpp
index f4fc5ed86..a799ed7d6 100644
--- a/src/game/game_info.hpp
+++ b/src/game/game_info.hpp
@@ -40,7 +40,7 @@ public:
*/
const char *GetAPIVersion() const { return this->api_version; }
- /* virtual */ bool IsDeveloperOnly() const { return this->is_developer_only; }
+ bool IsDeveloperOnly() const override { return this->is_developer_only; }
private:
int min_loadable_version; ///< The Game can load savegame data if the version is equal or greater than this.
diff --git a/src/game/game_instance.hpp b/src/game/game_instance.hpp
index 08ce34424..dd0e7950a 100644
--- a/src/game/game_instance.hpp
+++ b/src/game/game_instance.hpp
@@ -25,14 +25,14 @@ public:
*/
void Initialize(class GameInfo *info);
- /* virtual */ int GetSetting(const char *name);
- /* virtual */ ScriptInfo *FindLibrary(const char *library, int version);
+ int GetSetting(const char *name) override;
+ ScriptInfo *FindLibrary(const char *library, int version) override;
private:
- /* virtual */ void RegisterAPI();
- /* virtual */ void Died();
- /* virtual */ CommandCallback *GetDoCommandCallback();
- /* virtual */ void LoadDummyScript() {}
+ void RegisterAPI() override;
+ void Died() override;
+ CommandCallback *GetDoCommandCallback() override;
+ void LoadDummyScript() override {}
};
#endif /* GAME_INSTANCE_HPP */
diff --git a/src/game/game_scanner.hpp b/src/game/game_scanner.hpp
index 071d19d38..492545c2b 100644
--- a/src/game/game_scanner.hpp
+++ b/src/game/game_scanner.hpp
@@ -16,7 +16,7 @@
class GameScannerInfo : public ScriptScanner {
public:
- /* virtual */ void Initialize();
+ void Initialize() override;
/**
* Check if we have a game by name and version available in our list.
@@ -28,17 +28,17 @@ public:
class GameInfo *FindInfo(const char *nameParam, int versionParam, bool force_exact_match);
protected:
- /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
- /* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; }
- /* virtual */ Subdirectory GetDirectory() const { return GAME_DIR; }
- /* virtual */ const char *GetScannerName() const { return "Game Scripts"; }
- /* virtual */ void RegisterAPI(class Squirrel *engine);
+ void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
+ const char *GetFileName() const override { return PATHSEP "info.nut"; }
+ Subdirectory GetDirectory() const override { return GAME_DIR; }
+ const char *GetScannerName() const override { return "Game Scripts"; }
+ void RegisterAPI(class Squirrel *engine) override;
};
class GameScannerLibrary : public ScriptScanner {
public:
- /* virtual */ void Initialize();
+ void Initialize() override;
/**
* Find a library in the pool.
@@ -49,11 +49,11 @@ public:
class GameLibrary *FindLibrary(const char *library, int version);
protected:
- /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
- /* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; }
- /* virtual */ Subdirectory GetDirectory() const { return GAME_LIBRARY_DIR; }
- /* virtual */ const char *GetScannerName() const { return "GS Libraries"; }
- /* virtual */ void RegisterAPI(class Squirrel *engine);
+ void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
+ const char *GetFileName() const override { return PATHSEP "library.nut"; }
+ Subdirectory GetDirectory() const override { return GAME_LIBRARY_DIR; }
+ const char *GetScannerName() const override { return "GS Libraries"; }
+ void RegisterAPI(class Squirrel *engine) override;
};
#endif /* GAME_SCANNER_HPP */
diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp
index a32e5b41d..4673e732c 100644
--- a/src/game/game_text.cpp
+++ b/src/game/game_text.cpp
@@ -151,7 +151,7 @@ struct StringListReader : StringReader {
{
}
- /* virtual */ char *ReadLine(char *buffer, const char *last)
+ char *ReadLine(char *buffer, const char *last) override
{
if (this->p == this->end) return NULL;
@@ -242,7 +242,7 @@ public:
this->FileScanner::Scan(".txt", directory, false);
}
- /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename)
+ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override
{
if (strcmp(filename, exclude) == 0) return true;
diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp
index ee4d8170e..7c3e33004 100644
--- a/src/goal_gui.cpp
+++ b/src/goal_gui.cpp
@@ -50,7 +50,7 @@ struct GoalListWindow : public Window {
this->OnInvalidateData(0);
}
- /* virtual */ void SetStringParameters(int widget) const
+ void SetStringParameters(int widget) const override
{
if (widget != WID_GOAL_CAPTION) return;
@@ -62,7 +62,7 @@ struct GoalListWindow : public Window {
}
}
- /* virtual */ void OnClick(Point pt, int widget, int click_count)
+ void OnClick(Point pt, int widget, int click_count) override
{
if (widget != WID_GOAL_LIST) return;
@@ -177,7 +177,7 @@ struct GoalListWindow : public Window {
return 3 + num_global + num_company;
}
- /* virtual */ void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
+ void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
if (widget != WID_GOAL_LIST) return;
Dimension d = maxdim(GetStringBoundingBox(STR_GOALS_GLOBAL_TITLE), GetStringBoundingBox(STR_GOALS_COMPANY_TITLE));
@@ -272,7 +272,7 @@ struct GoalListWindow : public Window {
DrawPartialGoalList(pos, cap, x, y, right, progress_col_width, false, column);
}
- /* virtual */ void OnPaint()
+ void OnPaint() override
{
this->DrawWidgets();
@@ -299,7 +299,7 @@ struct GoalListWindow : public Window {
}
- /* virtual */ void OnResize()
+ void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_GOAL_LIST);
}
@@ -309,7 +309,7 @@ struct GoalListWindow : public Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
- /* virtual */ void OnInvalidateData(int data = 0, bool gui_scope = true)
+ void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (!gui_scope) return;
this->vscroll->SetCount(this->CountLines());
@@ -388,7 +388,7 @@ struct GoalQuestionWindow : public Window {
free(this->question);
}
- /* virtual */ void SetStringParameters(int widget) const
+ void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_GQ_CAPTION:
@@ -409,7 +409,7 @@ struct GoalQuestionWindow : public Window {
}
}
- /* virtual */ void OnClick(Point pt, int widget, int click_count)
+ void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_GQ_BUTTON_1:
@@ -429,7 +429,7 @@ struct GoalQuestionWindow : public Window {
}
}
- /* virtual */ void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
+ void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
if (widget != WID_GQ_QUESTION) return;
@@ -437,7 +437,7 @@ struct GoalQuestionWindow : public Window {
size->height = GetStringHeight(STR_JUST_RAW_STRING, size->width) + WD_PAR_VSEP_WIDE;
}
- /* virtual */ void DrawWidget(const Rect &r, int widget) const
+ void DrawWidget(const Rect &r, int widget) const override
{
if (widget != WID_GQ_QUESTION) return;
diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp
index 56b97875f..25106ab1c 100644
--- a/src/ground_vehicle.hpp
+++ b/src/ground_vehicle.hpp
@@ -92,14 +92,14 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> {
void PowerChanged();
void CargoChanged();
int GetAcceleration() const;
- bool IsChainInDepot() const;
+ bool IsChainInDepot() const override;
/**
* Common code executed for crashed ground vehicles
* @param flooded was this vehicle flooded?
* @return number of victims
*/
- /* virtual */ uint Crash(bool flooded)
+ uint Crash(bool flooded) override
{
/* Crashed vehicles aren't going up or down */
for (T *v = T::From(this); v != NULL; v = v->Next()) {
diff --git a/src/music/allegro_m.h b/src/music/allegro_m.h
index 65d8ab811..9451162a2 100644
--- a/src/music/allegro_m.h
+++ b/src/music/allegro_m.h
@@ -17,18 +17,18 @@
/** Allegro's music player. */
class MusicDriver_Allegro : public MusicDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "allegro"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "allegro"; }
};
/** Factory for allegro's music player. */
@@ -43,7 +43,7 @@ public:
static const int PRIORITY = 2;
#endif
FMusicDriver_Allegro() : DriverFactoryBase(Driver::DT_MUSIC, PRIORITY, "allegro", "Allegro MIDI Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_Allegro(); }
+ Driver *CreateInstance() const override { return new MusicDriver_Allegro(); }
};
#endif /* MUSIC_ALLEGRO_H */
diff --git a/src/music/bemidi.h b/src/music/bemidi.h
index 7c546525d..8591ec015 100644
--- a/src/music/bemidi.h
+++ b/src/music/bemidi.h
@@ -17,25 +17,25 @@
/** The midi player for BeOS. */
class MusicDriver_BeMidi : public MusicDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "bemidi"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "bemidi"; }
};
/** Factory for the BeOS midi player. */
class FMusicDriver_BeMidi : public DriverFactoryBase {
public:
FMusicDriver_BeMidi() : DriverFactoryBase(Driver::DT_MUSIC, 10, "bemidi", "BeOS MIDI Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_BeMidi(); }
+ Driver *CreateInstance() const override { return new MusicDriver_BeMidi(); }
};
#endif /* MUSIC_BEMIDI_H */
diff --git a/src/music/cocoa_m.h b/src/music/cocoa_m.h
index fdb10b84e..769492799 100644
--- a/src/music/cocoa_m.h
+++ b/src/music/cocoa_m.h
@@ -16,24 +16,24 @@
class MusicDriver_Cocoa : public MusicDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "cocoa"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "cocoa"; }
};
class FMusicDriver_Cocoa : public DriverFactoryBase {
public:
FMusicDriver_Cocoa() : DriverFactoryBase(Driver::DT_MUSIC, 10, "cocoa", "Cocoa MIDI Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_Cocoa(); }
+ Driver *CreateInstance() const override { return new MusicDriver_Cocoa(); }
};
#endif /* MUSIC_MACOSX_COCOA_H */
diff --git a/src/music/dmusic.h b/src/music/dmusic.h
index 527e064e4..5b363b891 100644
--- a/src/music/dmusic.h
+++ b/src/music/dmusic.h
@@ -19,25 +19,25 @@ class MusicDriver_DMusic : public MusicDriver {
public:
virtual ~MusicDriver_DMusic();
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "dmusic"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "dmusic"; }
};
/** Factory for the DirectX music player. */
class FMusicDriver_DMusic : public DriverFactoryBase {
public:
FMusicDriver_DMusic() : DriverFactoryBase(Driver::DT_MUSIC, 10, "dmusic", "DirectMusic MIDI Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_DMusic(); }
+ Driver *CreateInstance() const override { return new MusicDriver_DMusic(); }
};
#endif /* MUSIC_DMUSIC_H */
diff --git a/src/music/extmidi.h b/src/music/extmidi.h
index e174dc9b0..55050c0d2 100644
--- a/src/music/extmidi.h
+++ b/src/music/extmidi.h
@@ -24,24 +24,24 @@ private:
void DoStop();
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "extmidi"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "extmidi"; }
};
class FMusicDriver_ExtMidi : public DriverFactoryBase {
public:
FMusicDriver_ExtMidi() : DriverFactoryBase(Driver::DT_MUSIC, 3, "extmidi", "External MIDI Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_ExtMidi(); }
+ Driver *CreateInstance() const override { return new MusicDriver_ExtMidi(); }
};
#endif /* MUSIC_EXTERNAL_H */
diff --git a/src/music/fluidsynth.h b/src/music/fluidsynth.h
index 171128a8e..e8a294b77 100644
--- a/src/music/fluidsynth.h
+++ b/src/music/fluidsynth.h
@@ -17,25 +17,25 @@
/** Music driver making use of FluidSynth. */
class MusicDriver_FluidSynth : public MusicDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "fluidsynth"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "fluidsynth"; }
};
/** Factory for the fluidsynth driver. */
class FMusicDriver_FluidSynth : public DriverFactoryBase {
public:
FMusicDriver_FluidSynth() : DriverFactoryBase(Driver::DT_MUSIC, 5, "fluidsynth", "FluidSynth MIDI Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_FluidSynth(); }
+ Driver *CreateInstance() const override { return new MusicDriver_FluidSynth(); }
};
#endif /* MUSIC_FLUIDSYNTH_H */
diff --git a/src/music/null_m.h b/src/music/null_m.h
index 51e1a0665..837eeb092 100644
--- a/src/music/null_m.h
+++ b/src/music/null_m.h
@@ -17,25 +17,25 @@
/** The music player that does nothing. */
class MusicDriver_Null : public MusicDriver {
public:
- /* virtual */ const char *Start(const char * const *param) { return NULL; }
+ const char *Start(const char * const *param) override { return NULL; }
- /* virtual */ void Stop() { }
+ void Stop() override { }
- /* virtual */ void PlaySong(const MusicSongInfo &song) { }
+ void PlaySong(const MusicSongInfo &song) override { }
- /* virtual */ void StopSong() { }
+ void StopSong() override { }
- /* virtual */ bool IsSongPlaying() { return true; }
+ bool IsSongPlaying() override { return true; }
- /* virtual */ void SetVolume(byte vol) { }
- /* virtual */ const char *GetName() const { return "null"; }
+ void SetVolume(byte vol) override { }
+ const char *GetName() const override { return "null"; }
};
/** Factory for the null music player. */
class FMusicDriver_Null : public DriverFactoryBase {
public:
FMusicDriver_Null() : DriverFactoryBase(Driver::DT_MUSIC, 1, "null", "Null Music Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_Null(); }
+ Driver *CreateInstance() const override { return new MusicDriver_Null(); }
};
#endif /* MUSIC_NULL_H */
diff --git a/src/music/os2_m.h b/src/music/os2_m.h
index ac7cd0319..e320946ed 100644
--- a/src/music/os2_m.h
+++ b/src/music/os2_m.h
@@ -17,25 +17,25 @@
/** OS/2's music player. */
class MusicDriver_OS2 : public MusicDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "os2"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "os2"; }
};
/** Factory for OS/2's music player. */
class FMusicDriver_OS2 : public DriverFactoryBase {
public:
FMusicDriver_OS2() : DriverFactoryBase(Driver::DT_MUSIC, 10, "os2", "OS/2 Music Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_OS2(); }
+ Driver *CreateInstance() const override { return new MusicDriver_OS2(); }
};
#endif /* MUSIC_OS2_H */
diff --git a/src/music/qtmidi.h b/src/music/qtmidi.h
index 32163db93..631f04d2d 100644
--- a/src/music/qtmidi.h
+++ b/src/music/qtmidi.h
@@ -16,24 +16,24 @@
class MusicDriver_QtMidi : public MusicDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "qt"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "qt"; }
};
class FMusicDriver_QtMidi : public DriverFactoryBase {
public:
FMusicDriver_QtMidi() : DriverFactoryBase(Driver::DT_MUSIC, 5, "qt", "QuickTime MIDI Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_QtMidi(); }
+ Driver *CreateInstance() const override { return new MusicDriver_QtMidi(); }
};
#endif /* MUSIC_MACOSX_QUICKTIME_H */
diff --git a/src/music/win32_m.h b/src/music/win32_m.h
index 1ac8ae69e..5366cf5d7 100644
--- a/src/music/win32_m.h
+++ b/src/music/win32_m.h
@@ -17,25 +17,25 @@
/** The Windows music player. */
class MusicDriver_Win32 : public MusicDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void PlaySong(const MusicSongInfo &song);
+ void PlaySong(const MusicSongInfo &song) override;
- /* virtual */ void StopSong();
+ void StopSong() override;
- /* virtual */ bool IsSongPlaying();
+ bool IsSongPlaying() override;
- /* virtual */ void SetVolume(byte vol);
- /* virtual */ const char *GetName() const { return "win32"; }
+ void SetVolume(byte vol) override;
+ const char *GetName() const override { return "win32"; }
};
/** Factory for Windows' music player. */
class FMusicDriver_Win32 : public DriverFactoryBase {
public:
FMusicDriver_Win32() : DriverFactoryBase(Driver::DT_MUSIC, 5, "win32", "Win32 Music Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new MusicDriver_Win32(); }
+ Driver *CreateInstance() const override { return new MusicDriver_Win32(); }
};
#endif /* MUSIC_WIN32_H */
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 0bb42c86f..a99a5069a 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -84,7 +84,7 @@ struct PacketReader : LoadFilter {
this->buf += to_write;
}
- /* virtual */ size_t Read(byte *rbuf, size_t size)
+ size_t Read(byte *rbuf, size_t size) override
{
/* Limit the amount to read to whatever we still have. */
size_t ret_size = size = min(this->written_bytes - this->read_bytes, size);
@@ -106,7 +106,7 @@ struct PacketReader : LoadFilter {
return ret_size;
}
- /* virtual */ void Reset()
+ void Reset() override
{
this->read_bytes = 0;
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 230a62134..321a53bc7 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -64,7 +64,7 @@ struct ContentTextfileWindow : public TextfileWindow {
}
}
- /* virtual */ void SetStringParameters(int widget) const
+ void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, this->GetTypeString());
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index cb6426142..f90370312 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -117,7 +117,7 @@ public:
*lastof(this->visible) = true;
}
- void SetupSmallestSize(Window *w, bool init_array)
+ void SetupSmallestSize(Window *w, bool init_array) override
{
/* Oh yeah, we ought to be findable! */
w->nested_array[WID_NG_HEADER] = this;
@@ -143,7 +143,7 @@ public:
this->smallest_x = this->head->smallest_x + this->tail->smallest_x; // First and last are always shown, rest not
}
- void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl)
+ void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override
{
assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
@@ -183,7 +183,7 @@ public:
}
}
- /* virtual */ void Draw(const Window *w)
+ void Draw(const Window *w) override
{
int i = 0;
for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
@@ -193,7 +193,7 @@ public:
}
}
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y)
+ NWidgetCore *GetWidgetFromPos(int x, int y) override
{
if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL;
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index bd78acf92..67f4c6fd9 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -163,7 +163,7 @@ struct PacketWriter : SaveFilter {
this->current = NULL;
}
- /* virtual */ void Write(byte *buf, size_t size)
+ void Write(byte *buf, size_t size) override
{
/* We want to abort the saving when the socket is closed. */
if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);
@@ -190,7 +190,7 @@ struct PacketWriter : SaveFilter {
this->total_size += size;
}
- /* virtual */ void Finish()
+ void Finish() override
{
/* We want to abort the saving when the socket is closed. */
if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);
diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp
index 6213097bd..14af15a37 100644
--- a/src/newgrf_airport.cpp
+++ b/src/newgrf_airport.cpp
@@ -39,9 +39,9 @@ struct AirportScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
- /* virtual */ void StorePSA(uint pos, int32 value);
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
+ void StorePSA(uint pos, int32 value) override;
};
/** Resolver object for airports. */
@@ -51,7 +51,7 @@ struct AirportResolverObject : public ResolverObject {
AirportResolverObject(TileIndex tile, Station *st, byte airport_id, byte layout,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->airport_scope;
@@ -59,7 +59,7 @@ struct AirportResolverObject : public ResolverObject {
}
}
- /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
+ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
/**
diff --git a/src/newgrf_airporttiles.h b/src/newgrf_airporttiles.h
index dc0464203..e55409c1b 100644
--- a/src/newgrf_airporttiles.h
+++ b/src/newgrf_airporttiles.h
@@ -38,8 +38,8 @@ struct AirportTileScopeResolver : public ScopeResolver {
this->airport_id = st->airport.type;
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
};
/** Resolver for tiles of an airport. */
@@ -49,7 +49,7 @@ struct AirportTileResolverObject : public ResolverObject {
AirportTileResolverObject(const AirportTileSpec *ats, TileIndex tile, Station *st,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &tiles_scope;
diff --git a/src/newgrf_canal.cpp b/src/newgrf_canal.cpp
index 3438bb985..32180ee1a 100644
--- a/src/newgrf_canal.cpp
+++ b/src/newgrf_canal.cpp
@@ -30,8 +30,8 @@ struct CanalScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
};
/** Resolver object for canals. */
@@ -41,7 +41,7 @@ struct CanalResolverObject : public ResolverObject {
CanalResolverObject(CanalFeature feature, TileIndex tile,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->canal_scope;
@@ -49,7 +49,7 @@ struct CanalResolverObject : public ResolverObject {
}
}
- /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
+ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
/* virtual */ uint32 CanalScopeResolver::GetRandomBits() const
diff --git a/src/newgrf_cargo.cpp b/src/newgrf_cargo.cpp
index 7d830c573..97db4855e 100644
--- a/src/newgrf_cargo.cpp
+++ b/src/newgrf_cargo.cpp
@@ -19,7 +19,7 @@
struct CargoResolverObject : public ResolverObject {
CargoResolverObject(const CargoSpec *cs, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
- /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
+ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
/* virtual */ const SpriteGroup *CargoResolverObject::ResolveReal(const RealSpriteGroup *group) const
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index f19c79c9a..d21d767cd 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -633,7 +633,7 @@ public:
{
}
- /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
+ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
/** Do the scan for GRFs. */
static uint DoScan()
diff --git a/src/newgrf_engine.h b/src/newgrf_engine.h
index 51adb0b7f..644ff5f01 100644
--- a/src/newgrf_engine.h
+++ b/src/newgrf_engine.h
@@ -40,9 +40,9 @@ struct VehicleScopeResolver : public ScopeResolver {
void SetVehicle(const Vehicle *v) { this->v = v; }
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
- /* virtual */ uint32 GetTriggers() const;
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
+ uint32 GetTriggers() const override;
};
/** Resolver for a vehicle (chain) */
@@ -64,9 +64,9 @@ struct VehicleResolverObject : public ResolverObject {
VehicleResolverObject(EngineID engine_type, const Vehicle *v, WagonOverride wagon_override, bool info_view = false,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0);
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override;
- /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
+ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
static const uint TRAININFO_DEFAULT_VEHICLE_WIDTH = 29;
diff --git a/src/newgrf_generic.cpp b/src/newgrf_generic.cpp
index eb2cbf08f..d29a03929 100644
--- a/src/newgrf_generic.cpp
+++ b/src/newgrf_generic.cpp
@@ -42,7 +42,7 @@ struct GenericScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
private:
bool ai_callback; ///< Callback comes from the AI.
@@ -55,7 +55,7 @@ struct GenericResolverObject : public ResolverObject {
GenericResolverObject(bool ai_callback, CallbackID callback = CBID_NO_CALLBACK);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->generic_scope;
@@ -63,7 +63,7 @@ struct GenericResolverObject : public ResolverObject {
}
}
- /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
+ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
struct GenericCallback {
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 1af2c7246..adf38b164 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -550,7 +550,7 @@ struct NewGRFTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, NEWGRF_DIR);
}
- /* virtual */ void SetStringParameters(int widget) const
+ void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, STR_CONTENT_TYPE_NEWGRF);
diff --git a/src/newgrf_house.h b/src/newgrf_house.h
index bb364f6fc..10d61a9e9 100644
--- a/src/newgrf_house.h
+++ b/src/newgrf_house.h
@@ -44,9 +44,9 @@ struct HouseScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
- /* virtual */ uint32 GetTriggers() const;
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
+ uint32 GetTriggers() const override;
};
/** Resolver object to be used for houses (feature 07 spritegroups). */
@@ -58,7 +58,7 @@ struct HouseResolverObject : public ResolverObject {
CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0,
bool not_yet_constructed = false, uint8 initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->house_scope;
diff --git a/src/newgrf_industries.h b/src/newgrf_industries.h
index fa809fcd7..2fa8f7d36 100644
--- a/src/newgrf_industries.h
+++ b/src/newgrf_industries.h
@@ -34,10 +34,10 @@ struct IndustriesScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
- /* virtual */ uint32 GetTriggers() const;
- /* virtual */ void StorePSA(uint pos, int32 value);
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
+ uint32 GetTriggers() const override;
+ void StorePSA(uint pos, int32 value) override;
};
/** Resolver for industries. */
@@ -51,7 +51,7 @@ struct IndustriesResolverObject : public ResolverObject {
TownScopeResolver *GetTown();
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &industries_scope;
diff --git a/src/newgrf_industrytiles.h b/src/newgrf_industrytiles.h
index 6051c1062..8b7293233 100644
--- a/src/newgrf_industrytiles.h
+++ b/src/newgrf_industrytiles.h
@@ -32,9 +32,9 @@ struct IndustryTileScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
- /* virtual */ uint32 GetTriggers() const;
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
+ uint32 GetTriggers() const override;
};
/** Resolver for industry tiles. */
@@ -45,7 +45,7 @@ struct IndustryTileResolverObject : public ResolverObject {
IndustryTileResolverObject(IndustryGfx gfx, TileIndex tile, Industry *indus,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &indtile_scope;
diff --git a/src/newgrf_object.h b/src/newgrf_object.h
index 43c8de031..1ab351be9 100644
--- a/src/newgrf_object.h
+++ b/src/newgrf_object.h
@@ -116,8 +116,8 @@ struct ObjectScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
};
/** A resolver object to be used with feature 0F spritegroups. */
@@ -129,7 +129,7 @@ struct ObjectResolverObject : public ResolverObject {
CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0);
~ObjectResolverObject();
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF:
diff --git a/src/newgrf_railtype.h b/src/newgrf_railtype.h
index 5fadcd2ab..829c166cb 100644
--- a/src/newgrf_railtype.h
+++ b/src/newgrf_railtype.h
@@ -32,8 +32,8 @@ struct RailTypeScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
+ uint32 GetRandomBits() const override;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
};
/** Resolver object for rail types. */
@@ -42,7 +42,7 @@ struct RailTypeResolverObject : public ResolverObject {
RailTypeResolverObject(const RailtypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1 = 0, uint32 param2 = 0);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->railtype_scope;
@@ -50,7 +50,7 @@ struct RailTypeResolverObject : public ResolverObject {
}
}
- /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
+ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL, uint *num_results = NULL);
diff --git a/src/newgrf_station.h b/src/newgrf_station.h
index 123330d0a..2a19b5811 100644
--- a/src/newgrf_station.h
+++ b/src/newgrf_station.h
@@ -42,10 +42,10 @@ struct StationScopeResolver : public ScopeResolver {
{
}
- /* virtual */ uint32 GetRandomBits() const;
- /* virtual */ uint32 GetTriggers() const;
+ uint32 GetRandomBits() const override;
+ uint32 GetTriggers() const override;
- /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
+ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
};
/** Station resolver. */
@@ -59,7 +59,7 @@ struct StationResolverObject : public ResolverObject {
TownScopeResolver *GetTown();
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF:
@@ -76,7 +76,7 @@ struct StationResolverObject : public ResolverObject {
}
}
- /* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
+ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
enum StationClassID {
diff --git a/src/newgrf_town.h b/src/newgrf_town.h
index 7c4fb5395..a55f71f36 100644
--- a/src/newgrf_town.h
+++ b/src/newgrf_town.h
@@ -46,7 +46,7 @@ struct TownResolverObject : public ResolverObject {
TownResolverObject(const struct GRFFile *grffile, Town *t, bool readonly);
- /* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
+ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &town_scope;
diff --git a/src/os/macosx/crashlog_osx.cpp b/src/os/macosx/crashlog_osx.cpp
index ad258bbc9..c1b321340 100644
--- a/src/os/macosx/crashlog_osx.cpp
+++ b/src/os/macosx/crashlog_osx.cpp
@@ -52,7 +52,7 @@ class CrashLogOSX : public CrashLog {
char filename_save[MAX_PATH]; ///< Path of crash.sav
char filename_screenshot[MAX_PATH]; ///< Path of crash.(png|bmp|pcx)
- /* virtual */ char *LogOSVersion(char *buffer, const char *last) const
+ char *LogOSVersion(char *buffer, const char *last) const override
{
int ver_maj, ver_min, ver_bug;
GetMacOSVersion(&ver_maj, &ver_min, &ver_bug);
@@ -71,7 +71,7 @@ class CrashLogOSX : public CrashLog {
);
}
- /* virtual */ char *LogError(char *buffer, const char *last, const char *message) const
+ char *LogError(char *buffer, const char *last, const char *message) const override
{
return buffer + seprintf(buffer, last,
"Crash reason:\n"
@@ -83,7 +83,7 @@ class CrashLogOSX : public CrashLog {
);
}
- /* virtual */ char *LogStacktrace(char *buffer, const char *last) const
+ char *LogStacktrace(char *buffer, const char *last) const override
{
/* As backtrace() is only implemented in 10.5 or later,
* we're rolling our own here. Mostly based on
diff --git a/src/os/unix/crashlog_unix.cpp b/src/os/unix/crashlog_unix.cpp
index 47de057f7..2e9f4215f 100644
--- a/src/os/unix/crashlog_unix.cpp
+++ b/src/os/unix/crashlog_unix.cpp
@@ -40,7 +40,7 @@ class CrashLogUnix : public CrashLog {
/** Signal that has been thrown. */
int signum;
- /* virtual */ char *LogOSVersion(char *buffer, const char *last) const
+ char *LogOSVersion(char *buffer, const char *last) const override
{
struct utsname name;
if (uname(&name) < 0) {
@@ -60,7 +60,7 @@ class CrashLogUnix : public CrashLog {
);
}
- /* virtual */ char *LogError(char *buffer, const char *last, const char *message) const
+ char *LogError(char *buffer, const char *last, const char *message) const override
{
return buffer + seprintf(buffer, last,
"Crash reason:\n"
@@ -105,7 +105,7 @@ class CrashLogUnix : public CrashLog {
}
#endif
- /* virtual */ char *LogStacktrace(char *buffer, const char *last) const
+ char *LogStacktrace(char *buffer, const char *last) const override
{
buffer += seprintf(buffer, last, "Stacktrace:\n");
#if defined(__GLIBC__)
diff --git a/src/os/windows/crashlog_win.cpp b/src/os/windows/crashlog_win.cpp
index 1abb0e725..6bcaed837 100644
--- a/src/os/windows/crashlog_win.cpp
+++ b/src/os/windows/crashlog_win.cpp
@@ -43,14 +43,14 @@ class CrashLogWindows : public CrashLog {
/** Information about the encountered exception */
EXCEPTION_POINTERS *ep;
- /* virtual */ char *LogOSVersion(char *buffer, const char *last) const;
- /* virtual */ char *LogError(char *buffer, const char *last, const char *message) const;
- /* virtual */ char *LogStacktrace(char *buffer, const char *last) const;
- /* virtual */ char *LogRegisters(char *buffer, const char *last) const;
- /* virtual */ char *LogModules(char *buffer, const char *last) const;
+ char *LogOSVersion(char *buffer, const char *last) const override;
+ char *LogError(char *buffer, const char *last, const char *message) const override;
+ char *LogStacktrace(char *buffer, const char *last) const override;
+ char *LogRegisters(char *buffer, const char *last) const override;
+ char *LogModules(char *buffer, const char *last) const override;
public:
#if defined(_MSC_VER)
- /* virtual */ int WriteCrashDump(char *filename, const char *filename_last) const;
+ int WriteCrashDump(char *filename, const char *filename_last) const override;
char *AppendDecodedStacktrace(char *buffer, const char *last) const;
#else
char *AppendDecodedStacktrace(char *buffer, const char *last) const { return buffer; }
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index cd30ed859..f066d014d 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -1844,7 +1844,7 @@ struct FileReader : LoadFilter {
_sl.sf = NULL;
}
- /* virtual */ size_t Read(byte *buf, size_t size)
+ size_t Read(byte *buf, size_t size) override
{
/* We're in the process of shutting down, i.e. in "failure" mode. */
if (this->file == NULL) return 0;
@@ -1852,7 +1852,7 @@ struct FileReader : LoadFilter {
return fread(buf, 1, size, this->file);
}
- /* virtual */ void Reset()
+ void Reset() override
{
clearerr(this->file);
if (fseek(this->file, this->begin, SEEK_SET)) {
@@ -1882,7 +1882,7 @@ struct FileWriter : SaveFilter {
_sl.sf = NULL;
}
- /* virtual */ void Write(byte *buf, size_t size)
+ void Write(byte *buf, size_t size) override
{
/* We're in the process of shutting down, i.e. in "failure" mode. */
if (this->file == NULL) return;
@@ -1890,7 +1890,7 @@ struct FileWriter : SaveFilter {
if (fwrite(buf, 1, size, this->file) != size) SlError(STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE);
}
- /* virtual */ void Finish()
+ void Finish() override
{
if (this->file != NULL) fclose(this->file);
this->file = NULL;
@@ -1918,7 +1918,7 @@ struct LZOLoadFilter : LoadFilter {
if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize decompressor");
}
- /* virtual */ size_t Read(byte *buf, size_t ssize)
+ size_t Read(byte *buf, size_t ssize) override
{
assert(ssize >= LZO_BUFFER_SIZE);
@@ -1966,7 +1966,7 @@ struct LZOSaveFilter : SaveFilter {
if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor");
}
- /* virtual */ void Write(byte *buf, size_t size)
+ void Write(byte *buf, size_t size) override
{
const lzo_bytep in = buf;
/* Buffer size is from the LZO docs plus the chunk header size. */
@@ -2005,7 +2005,7 @@ struct NoCompLoadFilter : LoadFilter {
{
}
- /* virtual */ size_t Read(byte *buf, size_t size)
+ size_t Read(byte *buf, size_t size) override
{
return this->chain->Read(buf, size);
}
@@ -2022,7 +2022,7 @@ struct NoCompSaveFilter : SaveFilter {
{
}
- /* virtual */ void Write(byte *buf, size_t size)
+ void Write(byte *buf, size_t size) override
{
this->chain->Write(buf, size);
}
@@ -2056,7 +2056,7 @@ struct ZlibLoadFilter : LoadFilter {
inflateEnd(&this->z);
}
- /* virtual */ size_t Read(byte *buf, size_t size)
+ size_t Read(byte *buf, size_t size) override
{
this->z.next_out = buf;
this->z.avail_out = (uint)size;
@@ -2135,12 +2135,12 @@ struct ZlibSaveFilter : SaveFilter {
} while (this->z.avail_in || !this->z.avail_out);
}
- /* virtual */ void Write(byte *buf, size_t size)
+ void Write(byte *buf, size_t size) override
{
this->WriteLoop(buf, size, 0);
}
- /* virtual */ void Finish()
+ void Finish() override
{
this->WriteLoop(NULL, 0, Z_FINISH);
this->chain->Finish();
@@ -2185,7 +2185,7 @@ struct LZMALoadFilter : LoadFilter {
lzma_end(&this->lzma);
}
- /* virtual */ size_t Read(byte *buf, size_t size)
+ size_t Read(byte *buf, size_t size) override
{
this->lzma.next_out = buf;
this->lzma.avail_out = size;
@@ -2254,12 +2254,12 @@ struct LZMASaveFilter : SaveFilter {
} while (this->lzma.avail_in || !this->lzma.avail_out);
}
- /* virtual */ void Write(byte *buf, size_t size)
+ void Write(byte *buf, size_t size) override
{
this->WriteLoop(buf, size, LZMA_RUN);
}
- /* virtual */ void Finish()
+ void Finish() override
{
this->WriteLoop(NULL, 0, LZMA_FINISH);
this->chain->Finish();
diff --git a/src/script/api/script_text.hpp b/src/script/api/script_text.hpp
index ed14e391d..0b82ffb20 100644
--- a/src/script/api/script_text.hpp
+++ b/src/script/api/script_text.hpp
@@ -45,7 +45,7 @@ public:
RawText(const char *text);
~RawText();
- /* virtual */ const char *GetEncodedText() { return this->text; }
+ const char *GetEncodedText() override { return this->text; }
private:
const char *text;
};
diff --git a/src/script/script_scanner.hpp b/src/script/script_scanner.hpp
index 50dad02ad..7fecf6eb2 100644
--- a/src/script/script_scanner.hpp
+++ b/src/script/script_scanner.hpp
@@ -77,7 +77,7 @@ public:
*/
const char *FindMainScript(const ContentInfo *ci, bool md5sum);
- /* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
+ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
/**
* Rescan the script dir.
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 60430b490..c92701f0d 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -152,7 +152,7 @@ struct BaseSetTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, BASESET_DIR);
}
- /* virtual */ void SetStringParameters(int widget) const
+ void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, content_type);
diff --git a/src/sound/allegro_s.h b/src/sound/allegro_s.h
index e0a247f7b..255be66c7 100644
--- a/src/sound/allegro_s.h
+++ b/src/sound/allegro_s.h
@@ -17,12 +17,12 @@
/** Implementation of the allegro sound driver. */
class SoundDriver_Allegro : public SoundDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param);
- /* virtual */ void Stop();
+ void Stop();
- /* virtual */ void MainLoop();
- /* virtual */ const char *GetName() const { return "allegro"; }
+ void MainLoop();
+ const char *GetName() const { return "allegro"; }
};
/** Factory for the allegro sound driver. */
diff --git a/src/sound/cocoa_s.h b/src/sound/cocoa_s.h
index 701091425..dd2d74020 100644
--- a/src/sound/cocoa_s.h
+++ b/src/sound/cocoa_s.h
@@ -16,16 +16,16 @@
class SoundDriver_Cocoa : public SoundDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
- /* virtual */ const char *GetName() const { return "cocoa"; }
+ void Stop() override;
+ const char *GetName() const override { return "cocoa"; }
};
class FSoundDriver_Cocoa : public DriverFactoryBase {
public:
FSoundDriver_Cocoa() : DriverFactoryBase(Driver::DT_SOUND, 10, "cocoa", "Cocoa Sound Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new SoundDriver_Cocoa(); }
+ Driver *CreateInstance() const override { return new SoundDriver_Cocoa(); }
};
#endif /* SOUND_COCOA_H */
diff --git a/src/sound/null_s.h b/src/sound/null_s.h
index b2acd9093..ca9adb546 100644
--- a/src/sound/null_s.h
+++ b/src/sound/null_s.h
@@ -17,17 +17,17 @@
/** Implementation of the null sound driver. */
class SoundDriver_Null : public SoundDriver {
public:
- /* virtual */ const char *Start(const char * const *param) { return NULL; }
+ const char *Start(const char * const *param) override { return NULL; }
- /* virtual */ void Stop() { }
- /* virtual */ const char *GetName() const { return "null"; }
+ void Stop() override { }
+ const char *GetName() const override { return "null"; }
};
/** Factory for the null sound driver. */
class FSoundDriver_Null : public DriverFactoryBase {
public:
FSoundDriver_Null() : DriverFactoryBase(Driver::DT_SOUND, 1, "null", "Null Sound Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new SoundDriver_Null(); }
+ Driver *CreateInstance() const override { return new SoundDriver_Null(); }
};
#endif /* SOUND_NULL_H */
diff --git a/src/sound/sdl_s.h b/src/sound/sdl_s.h
index 544ce2070..2d36b4629 100644
--- a/src/sound/sdl_s.h
+++ b/src/sound/sdl_s.h
@@ -17,17 +17,17 @@
/** Implementation of the SDL sound driver. */
class SoundDriver_SDL : public SoundDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
- /* virtual */ const char *GetName() const { return "sdl"; }
+ void Stop() override;
+ const char *GetName() const override { return "sdl"; }
};
/** Factory for the SDL sound driver. */
class FSoundDriver_SDL : public DriverFactoryBase {
public:
FSoundDriver_SDL() : DriverFactoryBase(Driver::DT_SOUND, 5, "sdl", "SDL Sound Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new SoundDriver_SDL(); }
+ Driver *CreateInstance() const override { return new SoundDriver_SDL(); }
};
#endif /* SOUND_SDL_H */
diff --git a/src/sound/win32_s.h b/src/sound/win32_s.h
index c6c8e8d14..a0d53a2da 100644
--- a/src/sound/win32_s.h
+++ b/src/sound/win32_s.h
@@ -17,17 +17,17 @@
/** Implementation of the sound driver for Windows. */
class SoundDriver_Win32 : public SoundDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
- /* virtual */ const char *GetName() const { return "win32"; }
+ void Stop() override;
+ const char *GetName() const override { return "win32"; }
};
/** Factory for the sound driver for Windows. */
class FSoundDriver_Win32 : public DriverFactoryBase {
public:
FSoundDriver_Win32() : DriverFactoryBase(Driver::DT_SOUND, 9, "win32", "Win32 WaveOut Sound Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new SoundDriver_Win32(); }
+ Driver *CreateInstance() const override { return new SoundDriver_Win32(); }
};
#endif /* SOUND_WIN32_H */
diff --git a/src/sound/xaudio2_s.h b/src/sound/xaudio2_s.h
index 2385f49ee..f3525251c 100644
--- a/src/sound/xaudio2_s.h
+++ b/src/sound/xaudio2_s.h
@@ -17,17 +17,17 @@
/** Implementation of the XAudio2 sound driver. */
class SoundDriver_XAudio2 : public SoundDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
- /* virtual */ const char *GetName() const { return "xaudio2"; }
+ void Stop() override;
+ const char *GetName() const override { return "xaudio2"; }
};
/** Factory for the XAudio2 sound driver. */
class FSoundDriver_XAudio2 : public DriverFactoryBase {
public:
FSoundDriver_XAudio2() : DriverFactoryBase(Driver::DT_SOUND, 10, "xaudio2", "XAudio2 Sound Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new SoundDriver_XAudio2(); }
+ Driver *CreateInstance() const override { return new SoundDriver_XAudio2(); }
};
#endif /* SOUND_XAUDIO2_H */
diff --git a/src/station_base.h b/src/station_base.h
index b3a4a76c7..243a2f0ce 100644
--- a/src/station_base.h
+++ b/src/station_base.h
@@ -490,12 +490,12 @@ public:
void MarkTilesDirty(bool cargo_change) const;
- void UpdateVirtCoord();
+ void UpdateVirtCoord() override;
void AfterStationTileSetChange(bool adding, StationType type);
- /* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const;
- /* virtual */ uint GetPlatformLength(TileIndex tile) const;
+ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const override;
+ uint GetPlatformLength(TileIndex tile) const override;
void RecomputeCatchment();
static void RecomputeCatchmentForAll();
@@ -509,7 +509,7 @@ public:
return this->catchment_tiles.HasTile(tile);
}
- /* virtual */ inline bool TileBelongsToRailStation(TileIndex tile) const
+ inline bool TileBelongsToRailStation(TileIndex tile) const override
{
return IsRailStationTile(tile) && GetStationIndex(tile) == this->index;
}
@@ -519,9 +519,9 @@ public:
return IsAirportTile(tile) && GetStationIndex(tile) == this->index;
}
- /* virtual */ uint32 GetNewGRFVariable(const ResolverObject &object, byte variable, byte parameter, bool *available) const;
+ uint32 GetNewGRFVariable(const ResolverObject &object, byte variable, byte parameter, bool *available) const override;
- /* virtual */ void GetTileArea(TileArea *ta, StationType type) const;
+ void GetTileArea(TileArea *ta, StationType type) const override;
};
#define FOR_ALL_STATIONS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Station, var)
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 11e6b8dbd..5b361430f 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -115,14 +115,14 @@ struct FileStringReader : StringReader {
fclose(this->fh);
}
- /* virtual */ char *ReadLine(char *buffer, const char *last)
+ char *ReadLine(char *buffer, const char *last) override
{
return fgets(buffer, ClampToU16(last - buffer + 1), this->fh);
}
- /* virtual */ void HandlePragma(char *str);
+ void HandlePragma(char *str) override;
- /* virtual */ void ParseFile()
+ void ParseFile() override
{
this->StringReader::ParseFile();
diff --git a/src/strings.cpp b/src/strings.cpp
index c4ae5218a..57a175702 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -2032,18 +2032,18 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
uint i; ///< Iterator for the primary language tables.
uint j; ///< Iterator for the secondary language tables.
- /* virtual */ void Reset()
+ void Reset() override
{
this->i = 0;
this->j = 0;
}
- /* virtual */ FontSize DefaultSize()
+ FontSize DefaultSize() override
{
return FS_NORMAL;
}
- /* virtual */ const char *NextString()
+ const char *NextString() override
{
if (this->i >= TEXT_TAB_END) return NULL;
@@ -2058,12 +2058,12 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
return ret;
}
- /* virtual */ bool Monospace()
+ bool Monospace() override
{
return false;
}
- /* virtual */ void SetFontNames(FreeTypeSettings *settings, const char *font_name)
+ void SetFontNames(FreeTypeSettings *settings, const char *font_name) override
{
#ifdef WITH_FREETYPE
strecpy(settings->small.font, font_name, lastof(settings->small.font));
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h
index 19b411fed..d04827c77 100644
--- a/src/table/newgrf_debug_data.h
+++ b/src/table/newgrf_debug_data.h
@@ -69,14 +69,14 @@ static const NIVariable _niv_vehicles[] = {
};
class NIHVehicle : public NIHelper {
- bool IsInspectable(uint index) const { return Vehicle::Get(index)->GetGRF() != NULL; }
- uint GetParent(uint index) const { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); }
- const void *GetInstance(uint index)const { return Vehicle::Get(index); }
- const void *GetSpec(uint index) const { return Vehicle::Get(index)->GetEngine(); }
- void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
- uint32 GetGRFID(uint index) const { return Vehicle::Get(index)->GetGRFID(); }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return Vehicle::Get(index)->GetGRF() != NULL; }
+ uint GetParent(uint index) const override { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); }
+ const void *GetInstance(uint index)const override { return Vehicle::Get(index); }
+ const void *GetSpec(uint index) const override { return Vehicle::Get(index)->GetEngine(); }
+ void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
+ uint32 GetGRFID(uint index) const override { return Vehicle::Get(index)->GetGRFID(); }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
Vehicle *v = Vehicle::Get(index);
VehicleResolverObject ro(v->engine_type, v, VehicleResolverObject::WO_CACHED);
@@ -132,14 +132,14 @@ static const NIVariable _niv_stations[] = {
};
class NIHStation : public NIHelper {
- bool IsInspectable(uint index) const { return GetStationSpec(index) != NULL; }
- uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
- const void *GetInstance(uint index)const { return NULL; }
- const void *GetSpec(uint index) const { return GetStationSpec(index); }
- void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
- uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return GetStationSpec(index) != NULL; }
+ uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
+ const void *GetInstance(uint index)const override { return NULL; }
+ const void *GetSpec(uint index) const override { return GetStationSpec(index); }
+ void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
+ uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
StationResolverObject ro(GetStationSpec(index), Station::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -197,14 +197,14 @@ static const NIVariable _niv_house[] = {
};
class NIHHouse : public NIHelper {
- bool IsInspectable(uint index) const { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; }
- uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
- const void *GetInstance(uint index)const { return NULL; }
- const void *GetSpec(uint index) const { return HouseSpec::Get(GetHouseType(index)); }
- void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); }
- uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; }
+ uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
+ const void *GetInstance(uint index)const override { return NULL; }
+ const void *GetSpec(uint index) const override { return HouseSpec::Get(GetHouseType(index)); }
+ void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); }
+ uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -247,14 +247,14 @@ static const NIVariable _niv_industrytiles[] = {
};
class NIHIndustryTile : public NIHelper {
- bool IsInspectable(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; }
- uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
- const void *GetInstance(uint index)const { return NULL; }
- const void *GetSpec(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index)); }
- void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); }
- uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; }
+ uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
+ const void *GetInstance(uint index)const override { return NULL; }
+ const void *GetSpec(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index)); }
+ void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); }
+ uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
IndustryTileResolverObject ro(GetIndustryGfx(index), index, Industry::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -346,23 +346,23 @@ static const NIVariable _niv_industries[] = {
};
class NIHIndustry : public NIHelper {
- bool IsInspectable(uint index) const { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; }
- uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
- const void *GetInstance(uint index)const { return Industry::Get(index); }
- const void *GetSpec(uint index) const { return GetIndustrySpec(Industry::Get(index)->type); }
- void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
- uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; }
+ uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
+ const void *GetInstance(uint index)const override { return Industry::Get(index); }
+ const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); }
+ void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
+ uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
Industry *i = Industry::Get(index);
IndustriesResolverObject ro(i->location.tile, i, i->type);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
- uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); }
+ uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); }
- const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
+ const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override
{
const Industry *i = (const Industry *)this->GetInstance(index);
if (i->psa == NULL) return NULL;
@@ -411,14 +411,14 @@ static const NIVariable _niv_objects[] = {
};
class NIHObject : public NIHelper {
- bool IsInspectable(uint index) const { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; }
- uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
- const void *GetInstance(uint index)const { return Object::GetByTile(index); }
- const void *GetSpec(uint index) const { return ObjectSpec::GetByTile(index); }
- void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); }
- uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; }
+ uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
+ const void *GetInstance(uint index)const override { return Object::GetByTile(index); }
+ const void *GetSpec(uint index) const override { return ObjectSpec::GetByTile(index); }
+ void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); }
+ uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
ObjectResolverObject ro(ObjectSpec::GetByTile(index), Object::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -445,14 +445,14 @@ static const NIVariable _niv_railtypes[] = {
};
class NIHRailType : public NIHelper {
- bool IsInspectable(uint index) const { return true; }
- uint GetParent(uint index) const { return UINT32_MAX; }
- const void *GetInstance(uint index)const { return NULL; }
- const void *GetSpec(uint index) const { return NULL; }
- void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
- uint32 GetGRFID(uint index) const { return 0; }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return true; }
+ uint GetParent(uint index) const override { return UINT32_MAX; }
+ const void *GetInstance(uint index)const override { return NULL; }
+ const void *GetSpec(uint index) const override { return NULL; }
+ void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
+ uint32 GetGRFID(uint index) const override { return 0; }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
/* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
* However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
@@ -481,14 +481,14 @@ static const NICallback _nic_airporttiles[] = {
};
class NIHAirportTile : public NIHelper {
- bool IsInspectable(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; }
- uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
- const void *GetInstance(uint index)const { return NULL; }
- const void *GetSpec(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index)); }
- void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
- uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; }
+ uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
+ const void *GetInstance(uint index)const override { return NULL; }
+ const void *GetSpec(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index)); }
+ void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
+ uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
AirportTileResolverObject ro(AirportTileSpec::GetByTile(index), index, Station::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@@ -519,22 +519,22 @@ static const NIVariable _niv_towns[] = {
};
class NIHTown : public NIHelper {
- bool IsInspectable(uint index) const { return Town::IsValidID(index); }
- uint GetParent(uint index) const { return UINT32_MAX; }
- const void *GetInstance(uint index)const { return Town::Get(index); }
- const void *GetSpec(uint index) const { return NULL; }
- void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
- uint32 GetGRFID(uint index) const { return 0; }
- bool PSAWithParameter() const { return true; }
- uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); }
-
- /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ bool IsInspectable(uint index) const override { return Town::IsValidID(index); }
+ uint GetParent(uint index) const override { return UINT32_MAX; }
+ const void *GetInstance(uint index)const override { return Town::Get(index); }
+ const void *GetSpec(uint index) const override { return NULL; }
+ void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
+ uint32 GetGRFID(uint index) const override { return 0; }
+ bool PSAWithParameter() const override { return true; }
+ uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); }
+
+ uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
TownResolverObject ro(NULL, Town::Get(index), true);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
- const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
+ const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override
{
Town *t = Town::Get(index);
diff --git a/src/thread/thread_os2.cpp b/src/thread/thread_os2.cpp
index c66e2ad64..976283f23 100644
--- a/src/thread/thread_os2.cpp
+++ b/src/thread/thread_os2.cpp
@@ -41,13 +41,13 @@ public:
thread = _beginthread(stThreadProc, NULL, 1048576, this);
}
- /* virtual */ bool Exit()
+ bool Exit() override
{
_endthread();
return true;
}
- /* virtual */ void Join()
+ void Join() override
{
DosWaitThread(&this->thread, DCWW_WAIT);
this->thread = 0;
@@ -106,13 +106,13 @@ public:
DosCreateEventSem(NULL, &event, 0, FALSE);
}
- /* virtual */ ~ThreadMutex_OS2()
+ ~ThreadMutex_OS2() override
{
DosCloseMutexSem(mutex);
DosCloseEventSem(event);
}
- /* virtual */ void BeginCritical(bool allow_recursive = false)
+ void BeginCritical(bool allow_recursive = false) override
{
/* os2 mutex is recursive by itself */
DosRequestMutexSem(mutex, (unsigned long) SEM_INDEFINITE_WAIT);
@@ -120,14 +120,14 @@ public:
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
}
- /* virtual */ void EndCritical(bool allow_recursive = false)
+ void EndCritical(bool allow_recursive = false) override
{
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
this->recursive_count--;
DosReleaseMutexSem(mutex);
}
- /* virtual */ void WaitForSignal()
+ void WaitForSignal() override
{
assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise?
this->EndCritical();
@@ -135,7 +135,7 @@ public:
this->BeginCritical();
}
- /* virtual */ void SendSignal()
+ void SendSignal() override
{
DosPostEventSem(event);
}
diff --git a/src/thread/thread_pthread.cpp b/src/thread/thread_pthread.cpp
index 8aed5ee13..afb259183 100644
--- a/src/thread/thread_pthread.cpp
+++ b/src/thread/thread_pthread.cpp
@@ -45,14 +45,14 @@ public:
pthread_create(&this->thread, NULL, &stThreadProc, this);
}
- /* virtual */ bool Exit()
+ bool Exit() override
{
assert(pthread_self() == this->thread);
/* For now we terminate by throwing an error, gives much cleaner cleanup */
throw OTTDThreadExitSignal();
}
- /* virtual */ void Join()
+ void Join() override
{
/* You cannot join yourself */
assert(pthread_self() != this->thread);
@@ -129,7 +129,7 @@ public:
pthread_cond_init(&this->condition, NULL);
}
- /* virtual */ ~ThreadMutex_pthread()
+ ~ThreadMutex_pthread() override
{
int err = pthread_cond_destroy(&this->condition);
assert(err != EBUSY);
@@ -142,7 +142,7 @@ public:
return this->owner == pthread_self();
}
- /* virtual */ void BeginCritical(bool allow_recursive = false)
+ void BeginCritical(bool allow_recursive = false) override
{
/* pthread mutex is not recursive by itself */
if (this->IsOwnedByCurrentThread()) {
@@ -156,7 +156,7 @@ public:
this->recursive_count++;
}
- /* virtual */ void EndCritical(bool allow_recursive = false)
+ void EndCritical(bool allow_recursive = false) override
{
assert(this->IsOwnedByCurrentThread());
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
@@ -167,7 +167,7 @@ public:
assert(err == 0);
}
- /* virtual */ void WaitForSignal()
+ void WaitForSignal() override
{
uint old_recursive_count = this->recursive_count;
this->recursive_count = 0;
@@ -178,7 +178,7 @@ public:
this->recursive_count = old_recursive_count;
}
- /* virtual */ void SendSignal()
+ void SendSignal() override
{
int err = pthread_cond_signal(&this->condition);
assert(err == 0);
diff --git a/src/thread/thread_win32.cpp b/src/thread/thread_win32.cpp
index a01ea8e10..506faa069 100644
--- a/src/thread/thread_win32.cpp
+++ b/src/thread/thread_win32.cpp
@@ -49,7 +49,7 @@ public:
ResumeThread(this->thread);
}
- /* virtual */ ~ThreadObject_Win32()
+ ~ThreadObject_Win32() override
{
if (this->thread != NULL) {
CloseHandle(this->thread);
@@ -57,14 +57,14 @@ public:
}
}
- /* virtual */ bool Exit()
+ bool Exit() override
{
assert(GetCurrentThreadId() == this->id);
/* For now we terminate by throwing an error, gives much cleaner cleanup */
throw OTTDThreadExitSignal();
}
- /* virtual */ void Join()
+ void Join() override
{
/* You cannot join yourself */
assert(GetCurrentThreadId() != this->id);
@@ -126,13 +126,13 @@ public:
this->event = CreateEvent(NULL, FALSE, FALSE, NULL);
}
- /* virtual */ ~ThreadMutex_Win32()
+ ~ThreadMutex_Win32() override
{
DeleteCriticalSection(&this->critical_section);
CloseHandle(this->event);
}
- /* virtual */ void BeginCritical(bool allow_recursive = false)
+ void BeginCritical(bool allow_recursive = false) override
{
/* windows mutex is recursive by itself */
EnterCriticalSection(&this->critical_section);
@@ -140,14 +140,14 @@ public:
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
}
- /* virtual */ void EndCritical(bool allow_recursive = false)
+ void EndCritical(bool allow_recursive = false) override
{
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
this->recursive_count--;
LeaveCriticalSection(&this->critical_section);
}
- /* virtual */ void WaitForSignal()
+ void WaitForSignal() override
{
assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise?
this->EndCritical();
@@ -155,7 +155,7 @@ public:
this->BeginCritical();
}
- /* virtual */ void SendSignal()
+ void SendSignal() override
{
SetEvent(this->event);
}
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 2277a5cf6..c3bf5953d 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -1332,7 +1332,7 @@ public:
return type == WWT_IMGBTN || type == WWT_IMGBTN_2 || type == WWT_PUSHIMGBTN;
}
- void SetupSmallestSize(Window *w, bool init_array)
+ void SetupSmallestSize(Window *w, bool init_array) override
{
this->smallest_x = 0; // Biggest child
this->smallest_y = 0; // Biggest child
@@ -1365,7 +1365,7 @@ public:
_toolbar_width = nbuttons * this->smallest_x;
}
- void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl)
+ void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override
{
assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
@@ -1428,7 +1428,7 @@ public:
}
}
- /* virtual */ void Draw(const Window *w)
+ void Draw(const Window *w) override
{
/* Draw brown-red toolbar bg. */
GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, PC_VERY_DARK_RED);
@@ -1443,7 +1443,7 @@ public:
}
}
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y)
+ NWidgetCore *GetWidgetFromPos(int x, int y) override
{
if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL;
@@ -1470,7 +1470,7 @@ public:
/** Container for the 'normal' main toolbar */
class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
- /* virtual */ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const
+ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override
{
static const uint SMALLEST_ARRANGEMENT = 14;
static const uint BIGGEST_ARRANGEMENT = 20;
@@ -1793,7 +1793,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer {
uint panel_widths[2]; ///< The width of the two panels (the text panel and date panel)
- void SetupSmallestSize(Window *w, bool init_array)
+ void SetupSmallestSize(Window *w, bool init_array) override
{
this->NWidgetToolbarContainer::SetupSmallestSize(w, init_array);
@@ -1808,7 +1808,7 @@ class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer {
}
}
- /* virtual */ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const
+ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override
{
static const byte arrange_all[] = {
WID_TE_PAUSE,
diff --git a/src/video/allegro_v.h b/src/video/allegro_v.h
index a770635da..f68ce5781 100644
--- a/src/video/allegro_v.h
+++ b/src/video/allegro_v.h
@@ -17,30 +17,30 @@
/** The allegro video driver. */
class VideoDriver_Allegro : public VideoDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void MakeDirty(int left, int top, int width, int height);
+ void MakeDirty(int left, int top, int width, int height) override;
- /* virtual */ void MainLoop();
+ void MainLoop() override;
- /* virtual */ bool ChangeResolution(int w, int h);
+ bool ChangeResolution(int w, int h) override;
- /* virtual */ bool ToggleFullscreen(bool fullscreen);
+ bool ToggleFullscreen(bool fullscreen) override;
- /* virtual */ bool AfterBlitterChange();
+ bool AfterBlitterChange() override;
- /* virtual */ bool ClaimMousePointer();
+ bool ClaimMousePointer() override;
- /* virtual */ const char *GetName() const { return "allegro"; }
+ const char *GetName() const override { return "allegro"; }
};
/** Factory for the allegro video driver. */
class FVideoDriver_Allegro : public DriverFactoryBase {
public:
FVideoDriver_Allegro() : DriverFactoryBase(Driver::DT_VIDEO, 4, "allegro", "Allegro Video Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Allegro(); }
+ Driver *CreateInstance() const override { return new VideoDriver_Allegro(); }
};
#endif /* VIDEO_ALLEGRO_H */
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h
index 564daefe0..2614eef53 100644
--- a/src/video/cocoa/cocoa_v.h
+++ b/src/video/cocoa/cocoa_v.h
@@ -16,10 +16,10 @@
class VideoDriver_Cocoa : public VideoDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
/** Stop the video driver */
- /* virtual */ void Stop();
+ void Stop() override;
/** Mark dirty a screen region
* @param left x-coordinate of left border
@@ -27,44 +27,44 @@ public:
* @param width width or dirty rectangle
* @param height height of dirty rectangle
*/
- /* virtual */ void MakeDirty(int left, int top, int width, int height);
+ void MakeDirty(int left, int top, int width, int height) override;
/** Programme main loop */
- /* virtual */ void MainLoop();
+ void MainLoop() override;
/** Change window resolution
* @param w New window width
* @param h New window height
* @return Whether change was successful
*/
- /* virtual */ bool ChangeResolution(int w, int h);
+ bool ChangeResolution(int w, int h) override;
/** Set a new window mode
* @param fullscreen Whether to set fullscreen mode or not
* @return Whether changing the screen mode was successful
*/
- /* virtual */ bool ToggleFullscreen(bool fullscreen);
+ bool ToggleFullscreen(bool fullscreen) override;
/** Callback invoked after the blitter was changed.
* @return True if no error.
*/
- /* virtual */ bool AfterBlitterChange();
+ bool AfterBlitterChange() override;
/**
* An edit box lost the input focus. Abort character compositing if necessary.
*/
- /* virtual */ void EditBoxLostFocus();
+ void EditBoxLostFocus() override;
/** Return driver name
* @return driver name
*/
- /* virtual */ const char *GetName() const { return "cocoa"; }
+ const char *GetName() const override { return "cocoa"; }
};
class FVideoDriver_Cocoa : public DriverFactoryBase {
public:
FVideoDriver_Cocoa() : DriverFactoryBase(Driver::DT_VIDEO, 10, "cocoa", "Cocoa Video Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Cocoa(); }
+ Driver *CreateInstance() const override { return new VideoDriver_Cocoa(); }
};
diff --git a/src/video/dedicated_v.h b/src/video/dedicated_v.h
index 0c1477d66..bdf873c3d 100644
--- a/src/video/dedicated_v.h
+++ b/src/video/dedicated_v.h
@@ -17,19 +17,19 @@
/** The dedicated server video driver. */
class VideoDriver_Dedicated : public VideoDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void MakeDirty(int left, int top, int width, int height);
+ void MakeDirty(int left, int top, int width, int height) override;
- /* virtual */ void MainLoop();
+ void MainLoop() override;
- /* virtual */ bool ChangeResolution(int w, int h);
+ bool ChangeResolution(int w, int h) override;
- /* virtual */ bool ToggleFullscreen(bool fullscreen);
- /* virtual */ const char *GetName() const { return "dedicated"; }
- /* virtual */ bool HasGUI() const { return false; }
+ bool ToggleFullscreen(bool fullscreen) override;
+ const char *GetName() const override { return "dedicated"; }
+ bool HasGUI() const override { return false; }
};
/** Factory for the dedicated server video driver. */
@@ -43,7 +43,7 @@ public:
static const int PRIORITY = 0;
#endif
FVideoDriver_Dedicated() : DriverFactoryBase(Driver::DT_VIDEO, PRIORITY, "dedicated", "Dedicated Video Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Dedicated(); }
+ Driver *CreateInstance() const override { return new VideoDriver_Dedicated(); }
};
#endif /* VIDEO_DEDICATED_H */
diff --git a/src/video/null_v.h b/src/video/null_v.h
index 9e04e177e..a3b2cb5a8 100644
--- a/src/video/null_v.h
+++ b/src/video/null_v.h
@@ -20,26 +20,26 @@ private:
uint ticks; ///< Amount of ticks to run.
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void MakeDirty(int left, int top, int width, int height);
+ void MakeDirty(int left, int top, int width, int height) override;
- /* virtual */ void MainLoop();
+ void MainLoop() override;
- /* virtual */ bool ChangeResolution(int w, int h);
+ bool ChangeResolution(int w, int h) override;
- /* virtual */ bool ToggleFullscreen(bool fullscreen);
- /* virtual */ const char *GetName() const { return "null"; }
- /* virtual */ bool HasGUI() const { return false; }
+ bool ToggleFullscreen(bool fullscreen) override;
+ const char *GetName() const override { return "null"; }
+ bool HasGUI() const override { return false; }
};
/** Factory the null video driver. */
class FVideoDriver_Null : public DriverFactoryBase {
public:
FVideoDriver_Null() : DriverFactoryBase(Driver::DT_VIDEO, 0, "null", "Null Video Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Null(); }
+ Driver *CreateInstance() const override { return new VideoDriver_Null(); }
};
#endif /* VIDEO_NULL_H */
diff --git a/src/video/sdl_v.h b/src/video/sdl_v.h
index 8855c3566..cafdbbc61 100644
--- a/src/video/sdl_v.h
+++ b/src/video/sdl_v.h
@@ -17,27 +17,27 @@
/** The SDL video driver. */
class VideoDriver_SDL : public VideoDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void MakeDirty(int left, int top, int width, int height);
+ void MakeDirty(int left, int top, int width, int height) override;
- /* virtual */ void MainLoop();
+ void MainLoop() override;
- /* virtual */ bool ChangeResolution(int w, int h);
+ bool ChangeResolution(int w, int h) override;
- /* virtual */ bool ToggleFullscreen(bool fullscreen);
+ bool ToggleFullscreen(bool fullscreen) override;
- /* virtual */ bool AfterBlitterChange();
+ bool AfterBlitterChange() override;
- /* virtual */ void AcquireBlitterLock();
+ void AcquireBlitterLock() override;
- /* virtual */ void ReleaseBlitterLock();
+ void ReleaseBlitterLock() override;
- /* virtual */ bool ClaimMousePointer();
+ bool ClaimMousePointer() override;
- /* virtual */ const char *GetName() const { return "sdl"; }
+ const char *GetName() const override { return "sdl"; }
private:
int PollEvent();
bool CreateMainSurface(uint w, uint h);
@@ -48,7 +48,7 @@ private:
class FVideoDriver_SDL : public DriverFactoryBase {
public:
FVideoDriver_SDL() : DriverFactoryBase(Driver::DT_VIDEO, 5, "sdl", "SDL Video Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new VideoDriver_SDL(); }
+ Driver *CreateInstance() const override { return new VideoDriver_SDL(); }
};
#endif /* VIDEO_SDL_H */
diff --git a/src/video/win32_v.h b/src/video/win32_v.h
index 7609d0422..aa6bb7c0d 100644
--- a/src/video/win32_v.h
+++ b/src/video/win32_v.h
@@ -17,29 +17,29 @@
/** The video driver for windows. */
class VideoDriver_Win32 : public VideoDriver {
public:
- /* virtual */ const char *Start(const char * const *param);
+ const char *Start(const char * const *param) override;
- /* virtual */ void Stop();
+ void Stop() override;
- /* virtual */ void MakeDirty(int left, int top, int width, int height);
+ void MakeDirty(int left, int top, int width, int height) override;
- /* virtual */ void MainLoop();
+ void MainLoop() override;
- /* virtual */ bool ChangeResolution(int w, int h);
+ bool ChangeResolution(int w, int h) override;
- /* virtual */ bool ToggleFullscreen(bool fullscreen);
+ bool ToggleFullscreen(bool fullscreen) override;
- /* virtual */ bool AfterBlitterChange();
+ bool AfterBlitterChange() override;
- /* virtual */ void AcquireBlitterLock();
+ void AcquireBlitterLock() override;
- /* virtual */ void ReleaseBlitterLock();
+ void ReleaseBlitterLock() override;
- /* virtual */ bool ClaimMousePointer();
+ bool ClaimMousePointer() override;
- /* virtual */ void EditBoxLostFocus();
+ void EditBoxLostFocus() override;
- /* virtual */ const char *GetName() const { return "win32"; }
+ const char *GetName() const override { return "win32"; }
bool MakeWindow(bool full_screen);
};
@@ -48,7 +48,7 @@ public:
class FVideoDriver_Win32 : public DriverFactoryBase {
public:
FVideoDriver_Win32() : DriverFactoryBase(Driver::DT_VIDEO, 10, "win32", "Win32 GDI Video Driver") {}
- /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Win32(); }
+ Driver *CreateInstance() const override { return new VideoDriver_Win32(); }
};
#endif /* VIDEO_WIN32_H */
diff --git a/src/waypoint_base.h b/src/waypoint_base.h
index 8d544a3b9..c11c2f2b2 100644
--- a/src/waypoint_base.h
+++ b/src/waypoint_base.h
@@ -25,23 +25,23 @@ struct Waypoint FINAL : SpecializedStation<Waypoint, true> {
Waypoint(TileIndex tile = INVALID_TILE) : SpecializedStation<Waypoint, true>(tile) { }
~Waypoint();
- void UpdateVirtCoord();
+ void UpdateVirtCoord() override;
- /* virtual */ inline bool TileBelongsToRailStation(TileIndex tile) const
+ inline bool TileBelongsToRailStation(TileIndex tile) const override
{
return IsRailWaypointTile(tile) && GetStationIndex(tile) == this->index;
}
- /* virtual */ uint32 GetNewGRFVariable(const struct ResolverObject &object, byte variable, byte parameter, bool *available) const;
+ uint32 GetNewGRFVariable(const struct ResolverObject &object, byte variable, byte parameter, bool *available) const override;
- /* virtual */ void GetTileArea(TileArea *ta, StationType type) const;
+ void GetTileArea(TileArea *ta, StationType type) const override;
- /* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const
+ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const override
{
return 1;
}
- /* virtual */ uint GetPlatformLength(TileIndex tile) const
+ uint GetPlatformLength(TileIndex tile) const override
{
return 1;
}
diff --git a/src/widget_type.h b/src/widget_type.h
index 33fb8bce0..0467630c9 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -293,11 +293,11 @@ public:
inline void SetDisabled(bool disabled);
inline bool IsDisabled() const;
- /* virtual */ void FillNestedArray(NWidgetBase **array, uint length);
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y);
- /* virtual */ bool IsHighlighted() const;
- /* virtual */ TextColour GetHighlightColour() const;
- /* virtual */ void SetHighlighted(TextColour highlight_colour);
+ void FillNestedArray(NWidgetBase **array, uint length) override;
+ NWidgetCore *GetWidgetFromPos(int x, int y) override;
+ bool IsHighlighted() const override;
+ TextColour GetHighlightColour() const override;
+ void SetHighlighted(TextColour highlight_colour) override;
NWidgetDisplay disp_flags; ///< Flags that affect display and interaction with the widget.
Colours colour; ///< Colour of this widget.
@@ -371,12 +371,12 @@ public:
~NWidgetContainer();
void Add(NWidgetBase *wid);
- /* virtual */ void FillNestedArray(NWidgetBase **array, uint length);
+ void FillNestedArray(NWidgetBase **array, uint length) override;
/** Return whether the container is empty. */
inline bool IsEmpty() { return head == NULL; }
- /* virtual */ NWidgetBase *GetWidgetOfType(WidgetType tp);
+ NWidgetBase *GetWidgetOfType(WidgetType tp) override;
protected:
NWidgetBase *head; ///< Pointer to first widget in container.
@@ -408,12 +408,12 @@ public:
void SetIndex(int index);
- void SetupSmallestSize(Window *w, bool init_array);
- void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl);
- /* virtual */ void FillNestedArray(NWidgetBase **array, uint length);
+ void SetupSmallestSize(Window *w, bool init_array) override;
+ void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override;
+ void FillNestedArray(NWidgetBase **array, uint length) override;
- /* virtual */ void Draw(const Window *w);
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y);
+ void Draw(const Window *w) override;
+ NWidgetCore *GetWidgetFromPos(int x, int y) override;
void SetDisplayedPlane(int plane);
@@ -437,8 +437,8 @@ public:
void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
- /* virtual */ void Draw(const Window *w);
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y);
+ void Draw(const Window *w) override;
+ NWidgetCore *GetWidgetFromPos(int x, int y) override;
protected:
NWidContainerFlags flags; ///< Flags of the container.
@@ -500,12 +500,12 @@ public:
void SetCount(int count);
void SetScrollbar(Scrollbar *sb);
- void SetupSmallestSize(Window *w, bool init_array);
- void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl);
- /* virtual */ void FillNestedArray(NWidgetBase **array, uint length);
+ void SetupSmallestSize(Window *w, bool init_array) override;
+ void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override;
+ void FillNestedArray(NWidgetBase **array, uint length) override;
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y);
- /* virtual */ void Draw(const Window *w);
+ NWidgetCore *GetWidgetFromPos(int x, int y) override;
+ void Draw(const Window *w) override;
protected:
int index; ///< If non-negative, index in the #Window::nested_array.
Colours colour; ///< Colour of this widget.
@@ -530,12 +530,12 @@ class NWidgetSpacer : public NWidgetResizeBase {
public:
NWidgetSpacer(int length, int height);
- void SetupSmallestSize(Window *w, bool init_array);
- /* virtual */ void FillNestedArray(NWidgetBase **array, uint length);
+ void SetupSmallestSize(Window *w, bool init_array) override;
+ void FillNestedArray(NWidgetBase **array, uint length) override;
- /* virtual */ void Draw(const Window *w);
- /* virtual */ void SetDirty(const Window *w) const;
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y);
+ void Draw(const Window *w) override;
+ void SetDirty(const Window *w) const override;
+ NWidgetCore *GetWidgetFromPos(int x, int y) override;
};
/**
@@ -550,14 +550,14 @@ public:
void Add(NWidgetBase *nwid);
void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
- void SetupSmallestSize(Window *w, bool init_array);
- void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl);
+ void SetupSmallestSize(Window *w, bool init_array) override;
+ void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override;
- /* virtual */ void FillNestedArray(NWidgetBase **array, uint length);
+ void FillNestedArray(NWidgetBase **array, uint length) override;
- /* virtual */ void Draw(const Window *w);
- /* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y);
- /* virtual */ NWidgetBase *GetWidgetOfType(WidgetType tp);
+ void Draw(const Window *w) override;
+ NWidgetCore *GetWidgetFromPos(int x, int y) override;
+ NWidgetBase *GetWidgetOfType(WidgetType tp) override;
private:
NWidgetPIPContainer *child; ///< Child widget.
@@ -576,8 +576,8 @@ class NWidgetViewport : public NWidgetCore {
public:
NWidgetViewport(int index);
- /* virtual */ void SetupSmallestSize(Window *w, bool init_array);
- /* virtual */ void Draw(const Window *w);
+ void SetupSmallestSize(Window *w, bool init_array) override;
+ void Draw(const Window *w) override;
void InitializeViewport(Window *w, uint32 follow_flags, ZoomLevel zoom);
void UpdateViewportCoordinates(Window *w);
@@ -751,8 +751,8 @@ class NWidgetScrollbar : public NWidgetCore, public Scrollbar {
public:
NWidgetScrollbar(WidgetType tp, Colours colour, int index);
- /* virtual */ void SetupSmallestSize(Window *w, bool init_array);
- /* virtual */ void Draw(const Window *w);
+ void SetupSmallestSize(Window *w, bool init_array) override;
+ void Draw(const Window *w) override;
static void InvalidateDimensionCache();
static Dimension GetVerticalDimension();
@@ -771,8 +771,8 @@ class NWidgetLeaf : public NWidgetCore {
public:
NWidgetLeaf(WidgetType tp, Colours colour, int index, uint32 data, StringID tip);
- /* virtual */ void SetupSmallestSize(Window *w, bool init_array);
- /* virtual */ void Draw(const Window *w);
+ void SetupSmallestSize(Window *w, bool init_array) override;
+ void Draw(const Window *w) override;
bool ButtonHit(const Point &pt);