1
0
Fork 0

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.
pull/7301/head
Henry Wilson 2019-03-03 22:25:13 +00:00 committed by Michael Lutz
parent 31260e6625
commit af7d9020a1
85 changed files with 565 additions and 565 deletions

View File

@ -30,9 +30,9 @@ public:
class AIInfo *GetInfo() const; class AIInfo *GetInfo() const;
/* virtual */ int GetSetting(const char *name) const; int GetSetting(const char *name) const override;
/* virtual */ void SetSetting(const char *name, int value); void SetSetting(const char *name, int value) override;
/* virtual */ void AddRandomDeviation(); void AddRandomDeviation() override;
/** /**
* When ever the AI Scanner is reloaded, all infos become invalid. This * When ever the AI Scanner is reloaded, all infos become invalid. This
@ -45,9 +45,9 @@ public:
bool ResetInfo(bool force_exact_match); bool ResetInfo(bool force_exact_match);
protected: protected:
/* virtual */ void PushExtraConfigList(); void PushExtraConfigList() override;
/* virtual */ void ClearConfigList(); void ClearConfigList() override;
/* 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 /* AI_CONFIG_HPP */ #endif /* AI_CONFIG_HPP */

View File

@ -646,7 +646,7 @@ struct ScriptTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR); 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) { if (widget == WID_TF_CAPTION) {
SetDParam(0, (slot == OWNER_DEITY) ? STR_CONTENT_TYPE_GAME_SCRIPT : STR_CONTENT_TYPE_AI); SetDParam(0, (slot == OWNER_DEITY) ? STR_CONTENT_TYPE_GAME_SCRIPT : STR_CONTENT_TYPE_AI);

View File

@ -25,14 +25,14 @@ public:
*/ */
void Initialize(class AIInfo *info); void Initialize(class AIInfo *info);
/* virtual */ int GetSetting(const char *name); int GetSetting(const char *name) override;
/* virtual */ ScriptInfo *FindLibrary(const char *library, int version); ScriptInfo *FindLibrary(const char *library, int version) override;
private: private:
/* virtual */ void RegisterAPI(); void RegisterAPI() override;
/* virtual */ void Died(); void Died() override;
/* virtual */ CommandCallback *GetDoCommandCallback(); CommandCallback *GetDoCommandCallback() override;
/* virtual */ void LoadDummyScript(); void LoadDummyScript() override;
}; };
#endif /* AI_INSTANCE_HPP */ #endif /* AI_INSTANCE_HPP */

View File

@ -19,7 +19,7 @@ public:
AIScannerInfo(); AIScannerInfo();
~AIScannerInfo(); ~AIScannerInfo();
/* virtual */ void Initialize(); void Initialize() override;
/** /**
* Select a random AI. * Select a random AI.
@ -42,11 +42,11 @@ public:
void SetDummyAI(class AIInfo *info); void SetDummyAI(class AIInfo *info);
protected: protected:
/* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last); void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
/* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; } const char *GetFileName() const override { return PATHSEP "info.nut"; }
/* virtual */ Subdirectory GetDirectory() const { return AI_DIR; } Subdirectory GetDirectory() const override { return AI_DIR; }
/* virtual */ const char *GetScannerName() const { return "AIs"; } const char *GetScannerName() const override { return "AIs"; }
/* virtual */ void RegisterAPI(class Squirrel *engine); void RegisterAPI(class Squirrel *engine) override;
private: private:
AIInfo *info_dummy; ///< The dummy AI. AIInfo *info_dummy; ///< The dummy AI.
@ -54,7 +54,7 @@ private:
class AIScannerLibrary : public ScriptScanner { class AIScannerLibrary : public ScriptScanner {
public: public:
/* virtual */ void Initialize(); void Initialize() override;
/** /**
* Find a library in the pool. * Find a library in the pool.
@ -65,11 +65,11 @@ public:
class AILibrary *FindLibrary(const char *library, int version); class AILibrary *FindLibrary(const char *library, int version);
protected: protected:
/* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last); void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
/* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; } const char *GetFileName() const override { return PATHSEP "library.nut"; }
/* virtual */ Subdirectory GetDirectory() const { return AI_LIBRARY_DIR; } Subdirectory GetDirectory() const override { return AI_LIBRARY_DIR; }
/* virtual */ const char *GetScannerName() const { return "AI Libraries"; } const char *GetScannerName() const override { return "AI Libraries"; }
/* virtual */ void RegisterAPI(class Squirrel *engine); void RegisterAPI(class Squirrel *engine) override;
}; };
#endif /* AI_SCANNER_HPP */ #endif /* AI_SCANNER_HPP */

View File

@ -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 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 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. * Get the extension that is used to identify this set.

View File

@ -37,21 +37,21 @@ public:
~Blitter_32bppAnim(); ~Blitter_32bppAnim();
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour); void SetPixel(void *video, int x, int y, uint8 colour) override;
/* 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); 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;
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour); void DrawRect(void *video, int width, int height, uint8 colour) override;
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height); void CopyFromBuffer(void *video, const void *src, int width, int height) override;
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height); void CopyToBuffer(const void *video, void *dst, int width, int height) override;
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y); void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
/* virtual */ int BufferSize(int width, int height); int BufferSize(int width, int height) override;
/* virtual */ void PaletteAnimate(const Palette &palette); void PaletteAnimate(const Palette &palette) override;
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation(); Blitter::PaletteAnimation UsePaletteAnimation() override;
/* virtual */ const char *GetName() { return "32bpp-anim"; } const char *GetName() override { return "32bpp-anim"; }
/* virtual */ int GetBytesPerPixel() { return 6; } int GetBytesPerPixel() override { return 6; }
/* virtual */ void PostResize(); void PostResize() override;
/** /**
* Look up the colour in the current palette. * Look up the colour in the current palette.
@ -77,7 +77,7 @@ public:
class FBlitter_32bppAnim : public BlitterFactory { class FBlitter_32bppAnim : public BlitterFactory {
public: public:
FBlitter_32bppAnim() : BlitterFactory("32bpp-anim", "32bpp Animation Blitter (palette animation)") {} 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 */ #endif /* BLITTER_32BPP_ANIM_HPP */

View File

@ -28,15 +28,15 @@
/** A partially 32 bpp blitter with palette animation. */ /** A partially 32 bpp blitter with palette animation. */
class Blitter_32bppSSE2_Anim : public Blitter_32bppAnim { class Blitter_32bppSSE2_Anim : public Blitter_32bppAnim {
public: public:
/* virtual */ void PaletteAnimate(const Palette &palette); void PaletteAnimate(const Palette &palette) override;
/* virtual */ const char *GetName() { return "32bpp-sse2-anim"; } const char *GetName() override { return "32bpp-sse2-anim"; }
}; };
/** Factory for the partially 32bpp blitter with animation. */ /** Factory for the partially 32bpp blitter with animation. */
class FBlitter_32bppSSE2_Anim : public BlitterFactory { class FBlitter_32bppSSE2_Anim : public BlitterFactory {
public: public:
FBlitter_32bppSSE2_Anim() : BlitterFactory("32bpp-sse2-anim", "32bpp partially SSE2 Animation Blitter (palette animation)", HasCPUIDFlag(1, 3, 26)) {} 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 */ #endif /* WITH_SSE */

View File

@ -35,19 +35,19 @@ private:
public: public:
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent, bool animated> 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); void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
/* 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); 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). */ /** Factory for the SSE4 32 bpp blitter (with palette animation). */
class FBlitter_32bppSSE4_Anim: public BlitterFactory { class FBlitter_32bppSSE4_Anim: public BlitterFactory {
public: public:
FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {} 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 */ #endif /* WITH_SSE */

View File

@ -20,19 +20,19 @@
/** Base for all 32bpp blitters. */ /** Base for all 32bpp blitters. */
class Blitter_32bppBase : public Blitter { class Blitter_32bppBase : public Blitter {
public: public:
/* virtual */ uint8 GetScreenDepth() { return 32; } uint8 GetScreenDepth() override { return 32; }
/* virtual */ void *MoveTo(void *video, int x, int y); void *MoveTo(void *video, int x, int y) override;
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour); void SetPixel(void *video, int x, int y, uint8 colour) override;
/* 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); 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;
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour); void DrawRect(void *video, int width, int height, uint8 colour) override;
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height); void CopyFromBuffer(void *video, const void *src, int width, int height) override;
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height); void CopyToBuffer(const void *video, void *dst, int width, int height) override;
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch); void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y); void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
/* virtual */ int BufferSize(int width, int height); int BufferSize(int width, int height) override;
/* virtual */ void PaletteAnimate(const Palette &palette); void PaletteAnimate(const Palette &palette) override;
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation(); Blitter::PaletteAnimation UsePaletteAnimation() override;
/* virtual */ int GetBytesPerPixel() { return 4; } int GetBytesPerPixel() override { return 4; }
/** /**
* Look up the colour in the current palette. * Look up the colour in the current palette.

View File

@ -23,10 +23,10 @@ public:
byte data[]; ///< Data, all zoomlevels. byte data[]; ///< Data, all zoomlevels.
}; };
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); 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); template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
}; };
@ -35,7 +35,7 @@ public:
class FBlitter_32bppOptimized : public BlitterFactory { class FBlitter_32bppOptimized : public BlitterFactory {
public: public:
FBlitter_32bppOptimized() : BlitterFactory("32bpp-optimized", "32bpp Optimized Blitter (no palette animation)") {} 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 */ #endif /* BLITTER_32BPP_OPTIMIZED_HPP */

View File

@ -26,18 +26,18 @@ class Blitter_32bppSimple : public Blitter_32bppBase {
uint8 v; ///< Brightness-channel uint8 v; ///< Brightness-channel
}; };
public: public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); 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. */ /** Factory for the simple 32 bpp blitter. */
class FBlitter_32bppSimple : public BlitterFactory { class FBlitter_32bppSimple : public BlitterFactory {
public: public:
FBlitter_32bppSimple() : BlitterFactory("32bpp-simple", "32bpp Simple Blitter (no palette animation)") {} 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 */ #endif /* BLITTER_32BPP_SIMPLE_HPP */

View File

@ -82,22 +82,22 @@ DECLARE_ENUM_AS_BIT_SET(Blitter_32bppSSE_Base::SpriteFlags);
/** The SSE2 32 bpp blitter (without palette animation). */ /** The SSE2 32 bpp blitter (without palette animation). */
class Blitter_32bppSSE2 : public Blitter_32bppSimple, public Blitter_32bppSSE_Base { class Blitter_32bppSSE2 : public Blitter_32bppSimple, public Blitter_32bppSSE_Base {
public: 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> 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); 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); 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). */ /** Factory for the SSE2 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSE2 : public BlitterFactory { class FBlitter_32bppSSE2 : public BlitterFactory {
public: public:
FBlitter_32bppSSE2() : BlitterFactory("32bpp-sse2", "32bpp SSE2 Blitter (no palette animation)", HasCPUIDFlag(1, 3, 26)) {} 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 */ #endif /* WITH_SSE */

View File

@ -27,17 +27,17 @@
/** The SSE4 32 bpp blitter (without palette animation). */ /** The SSE4 32 bpp blitter (without palette animation). */
class Blitter_32bppSSE4 : public Blitter_32bppSSSE3 { class Blitter_32bppSSE4 : public Blitter_32bppSSSE3 {
public: 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> 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); 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). */ /** Factory for the SSE4 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSE4: public BlitterFactory { class FBlitter_32bppSSE4: public BlitterFactory {
public: public:
FBlitter_32bppSSE4() : BlitterFactory("32bpp-sse4", "32bpp SSE4 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 19)) {} 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 */ #endif /* WITH_SSE */

View File

@ -27,17 +27,17 @@
/** The SSSE3 32 bpp blitter (without palette animation). */ /** The SSSE3 32 bpp blitter (without palette animation). */
class Blitter_32bppSSSE3 : public Blitter_32bppSSE2 { class Blitter_32bppSSSE3 : public Blitter_32bppSSE2 {
public: 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> 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); 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). */ /** Factory for the SSSE3 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSSE3: public BlitterFactory { class FBlitter_32bppSSSE3: public BlitterFactory {
public: public:
FBlitter_32bppSSSE3() : BlitterFactory("32bpp-ssse3", "32bpp SSSE3 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 9)) {} 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 */ #endif /* WITH_SSE */

View File

@ -17,20 +17,20 @@
/** Base for all 8bpp blitters. */ /** Base for all 8bpp blitters. */
class Blitter_8bppBase : public Blitter { class Blitter_8bppBase : public Blitter {
public: public:
/* virtual */ uint8 GetScreenDepth() { return 8; } uint8 GetScreenDepth() override { return 8; }
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal); void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
/* virtual */ void *MoveTo(void *video, int x, int y); void *MoveTo(void *video, int x, int y) override;
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour); void SetPixel(void *video, int x, int y, uint8 colour) override;
/* 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); 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;
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour); void DrawRect(void *video, int width, int height, uint8 colour) override;
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height); void CopyFromBuffer(void *video, const void *src, int width, int height) override;
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height); void CopyToBuffer(const void *video, void *dst, int width, int height) override;
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch); void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y); void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
/* virtual */ int BufferSize(int width, int height); int BufferSize(int width, int height) override;
/* virtual */ void PaletteAnimate(const Palette &palette); void PaletteAnimate(const Palette &palette) override;
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation(); Blitter::PaletteAnimation UsePaletteAnimation() override;
/* virtual */ int GetBytesPerPixel() { return 1; } int GetBytesPerPixel() override { return 1; }
}; };
#endif /* BLITTER_8BPP_BASE_HPP */ #endif /* BLITTER_8BPP_BASE_HPP */

View File

@ -24,17 +24,17 @@ public:
byte data[]; ///< Data, all zoomlevels. byte data[]; ///< Data, all zoomlevels.
}; };
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); 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. */ /** Factory for the 8bpp blitter optimised for speed. */
class FBlitter_8bppOptimized : public BlitterFactory { class FBlitter_8bppOptimized : public BlitterFactory {
public: public:
FBlitter_8bppOptimized() : BlitterFactory("8bpp-optimized", "8bpp Optimized Blitter (compression + all-ZoomLevel cache)") {} 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 */ #endif /* BLITTER_8BPP_OPTIMIZED_HPP */

View File

@ -18,17 +18,17 @@
/** Most trivial 8bpp blitter. */ /** Most trivial 8bpp blitter. */
class Blitter_8bppSimple FINAL : public Blitter_8bppBase { class Blitter_8bppSimple FINAL : public Blitter_8bppBase {
public: public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); 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. */ /** Factory for the most trivial 8bpp blitter. */
class FBlitter_8bppSimple : public BlitterFactory { class FBlitter_8bppSimple : public BlitterFactory {
public: public:
FBlitter_8bppSimple() : BlitterFactory("8bpp-simple", "8bpp Simple Blitter (relative slow, but never wrong)") {} 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 */ #endif /* BLITTER_8BPP_SIMPLE_HPP */

View File

@ -17,31 +17,31 @@
/** Blitter that does nothing. */ /** Blitter that does nothing. */
class Blitter_Null : public Blitter { class Blitter_Null : public Blitter {
public: public:
/* virtual */ uint8 GetScreenDepth() { return 0; } uint8 GetScreenDepth() override { return 0; }
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {}; void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override {};
/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) {}; void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override {};
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator); Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
/* virtual */ void *MoveTo(void *video, int x, int y) { return NULL; }; void *MoveTo(void *video, int x, int y) override { return NULL; };
/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {}; void SetPixel(void *video, int x, int y, uint8 colour) override {};
/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {}; void DrawRect(void *video, int width, int height, uint8 colour) override {};
/* 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) {}; 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 {};
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height) {}; void CopyFromBuffer(void *video, const void *src, int width, int height) override {};
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height) {}; void CopyToBuffer(const void *video, void *dst, int width, int height) override {};
/* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) {}; void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override {};
/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) {}; void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override {};
/* virtual */ int BufferSize(int width, int height) { return 0; }; int BufferSize(int width, int height) override { return 0; };
/* virtual */ void PaletteAnimate(const Palette &palette) { }; void PaletteAnimate(const Palette &palette) override { };
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation() { return Blitter::PALETTE_ANIMATION_NONE; }; Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; };
/* virtual */ const char *GetName() { return "null"; } const char *GetName() override { return "null"; }
/* virtual */ int GetBytesPerPixel() { return 0; } int GetBytesPerPixel() override { return 0; }
}; };
/** Factory for the blitter that does nothing. */ /** Factory for the blitter that does nothing. */
class FBlitter_Null : public BlitterFactory { class FBlitter_Null : public BlitterFactory {
public: public:
FBlitter_Null() : BlitterFactory("null", "Null Blitter (does nothing)") {} 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 */ #endif /* BLITTER_NULL_HPP */

View File

@ -107,7 +107,7 @@ public:
ALL = BASESET | NEWGRF | AI | SCENARIO | GAME, ///< Scan for everything. 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); bool AddFile(Subdirectory sd, const char *filename);

View File

@ -276,7 +276,7 @@ public:
fop(fop), callback_proc(callback_proc), file_list(file_list) 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; 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); FILE *f = FioFOpenFile(filename, "r", SCENARIO_DIR);
if (f == NULL) return false; if (f == NULL) return false;

View File

@ -42,7 +42,7 @@ public:
bool ResetInfo(bool force_exact_match); bool ResetInfo(bool force_exact_match);
protected: 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 */ #endif /* GAME_CONFIG_HPP */

View File

@ -40,7 +40,7 @@ public:
*/ */
const char *GetAPIVersion() const { return this->api_version; } 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: private:
int min_loadable_version; ///< The Game can load savegame data if the version is equal or greater than this. int min_loadable_version; ///< The Game can load savegame data if the version is equal or greater than this.

View File

@ -25,14 +25,14 @@ public:
*/ */
void Initialize(class GameInfo *info); void Initialize(class GameInfo *info);
/* virtual */ int GetSetting(const char *name); int GetSetting(const char *name) override;
/* virtual */ ScriptInfo *FindLibrary(const char *library, int version); ScriptInfo *FindLibrary(const char *library, int version) override;
private: private:
/* virtual */ void RegisterAPI(); void RegisterAPI() override;
/* virtual */ void Died(); void Died() override;
/* virtual */ CommandCallback *GetDoCommandCallback(); CommandCallback *GetDoCommandCallback() override;
/* virtual */ void LoadDummyScript() {} void LoadDummyScript() override {}
}; };
#endif /* GAME_INSTANCE_HPP */ #endif /* GAME_INSTANCE_HPP */

View File

@ -16,7 +16,7 @@
class GameScannerInfo : public ScriptScanner { class GameScannerInfo : public ScriptScanner {
public: public:
/* virtual */ void Initialize(); void Initialize() override;
/** /**
* Check if we have a game by name and version available in our list. * 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); class GameInfo *FindInfo(const char *nameParam, int versionParam, bool force_exact_match);
protected: protected:
/* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last); void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
/* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; } const char *GetFileName() const override { return PATHSEP "info.nut"; }
/* virtual */ Subdirectory GetDirectory() const { return GAME_DIR; } Subdirectory GetDirectory() const override { return GAME_DIR; }
/* virtual */ const char *GetScannerName() const { return "Game Scripts"; } const char *GetScannerName() const override { return "Game Scripts"; }
/* virtual */ void RegisterAPI(class Squirrel *engine); void RegisterAPI(class Squirrel *engine) override;
}; };
class GameScannerLibrary : public ScriptScanner { class GameScannerLibrary : public ScriptScanner {
public: public:
/* virtual */ void Initialize(); void Initialize() override;
/** /**
* Find a library in the pool. * Find a library in the pool.
@ -49,11 +49,11 @@ public:
class GameLibrary *FindLibrary(const char *library, int version); class GameLibrary *FindLibrary(const char *library, int version);
protected: protected:
/* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last); void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
/* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; } const char *GetFileName() const override { return PATHSEP "library.nut"; }
/* virtual */ Subdirectory GetDirectory() const { return GAME_LIBRARY_DIR; } Subdirectory GetDirectory() const override { return GAME_LIBRARY_DIR; }
/* virtual */ const char *GetScannerName() const { return "GS Libraries"; } const char *GetScannerName() const override { return "GS Libraries"; }
/* virtual */ void RegisterAPI(class Squirrel *engine); void RegisterAPI(class Squirrel *engine) override;
}; };
#endif /* GAME_SCANNER_HPP */ #endif /* GAME_SCANNER_HPP */

View File

@ -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; if (this->p == this->end) return NULL;
@ -242,7 +242,7 @@ public:
this->FileScanner::Scan(".txt", directory, false); 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; if (strcmp(filename, exclude) == 0) return true;

View File

@ -50,7 +50,7 @@ struct GoalListWindow : public Window {
this->OnInvalidateData(0); this->OnInvalidateData(0);
} }
/* virtual */ void SetStringParameters(int widget) const void SetStringParameters(int widget) const override
{ {
if (widget != WID_GOAL_CAPTION) return; 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; if (widget != WID_GOAL_LIST) return;
@ -177,7 +177,7 @@ struct GoalListWindow : public Window {
return 3 + num_global + num_company; 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; if (widget != WID_GOAL_LIST) return;
Dimension d = maxdim(GetStringBoundingBox(STR_GOALS_GLOBAL_TITLE), GetStringBoundingBox(STR_GOALS_COMPANY_TITLE)); 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); DrawPartialGoalList(pos, cap, x, y, right, progress_col_width, false, column);
} }
/* virtual */ void OnPaint() void OnPaint() override
{ {
this->DrawWidgets(); this->DrawWidgets();
@ -299,7 +299,7 @@ struct GoalListWindow : public Window {
} }
/* virtual */ void OnResize() void OnResize() override
{ {
this->vscroll->SetCapacityFromWidget(this, WID_GOAL_LIST); this->vscroll->SetCapacityFromWidget(this, WID_GOAL_LIST);
} }
@ -309,7 +309,7 @@ struct GoalListWindow : public Window {
* @param data Information about the changed data. * @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. * @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; if (!gui_scope) return;
this->vscroll->SetCount(this->CountLines()); this->vscroll->SetCount(this->CountLines());
@ -388,7 +388,7 @@ struct GoalQuestionWindow : public Window {
free(this->question); free(this->question);
} }
/* virtual */ void SetStringParameters(int widget) const void SetStringParameters(int widget) const override
{ {
switch (widget) { switch (widget) {
case WID_GQ_CAPTION: 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) { switch (widget) {
case WID_GQ_BUTTON_1: 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; 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; 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; if (widget != WID_GQ_QUESTION) return;

View File

@ -92,14 +92,14 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> {
void PowerChanged(); void PowerChanged();
void CargoChanged(); void CargoChanged();
int GetAcceleration() const; int GetAcceleration() const;
bool IsChainInDepot() const; bool IsChainInDepot() const override;
/** /**
* Common code executed for crashed ground vehicles * Common code executed for crashed ground vehicles
* @param flooded was this vehicle flooded? * @param flooded was this vehicle flooded?
* @return number of victims * @return number of victims
*/ */
/* virtual */ uint Crash(bool flooded) uint Crash(bool flooded) override
{ {
/* Crashed vehicles aren't going up or down */ /* Crashed vehicles aren't going up or down */
for (T *v = T::From(this); v != NULL; v = v->Next()) { for (T *v = T::From(this); v != NULL; v = v->Next()) {

View File

@ -17,18 +17,18 @@
/** Allegro's music player. */ /** Allegro's music player. */
class MusicDriver_Allegro : public MusicDriver { class MusicDriver_Allegro : public MusicDriver {
public: 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "allegro"; } const char *GetName() const override { return "allegro"; }
}; };
/** Factory for allegro's music player. */ /** Factory for allegro's music player. */
@ -43,7 +43,7 @@ public:
static const int PRIORITY = 2; static const int PRIORITY = 2;
#endif #endif
FMusicDriver_Allegro() : DriverFactoryBase(Driver::DT_MUSIC, PRIORITY, "allegro", "Allegro MIDI Driver") {} 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 */ #endif /* MUSIC_ALLEGRO_H */

View File

@ -17,25 +17,25 @@
/** The midi player for BeOS. */ /** The midi player for BeOS. */
class MusicDriver_BeMidi : public MusicDriver { class MusicDriver_BeMidi : public MusicDriver {
public: 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "bemidi"; } const char *GetName() const override { return "bemidi"; }
}; };
/** Factory for the BeOS midi player. */ /** Factory for the BeOS midi player. */
class FMusicDriver_BeMidi : public DriverFactoryBase { class FMusicDriver_BeMidi : public DriverFactoryBase {
public: public:
FMusicDriver_BeMidi() : DriverFactoryBase(Driver::DT_MUSIC, 10, "bemidi", "BeOS MIDI Driver") {} 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 */ #endif /* MUSIC_BEMIDI_H */

View File

@ -16,24 +16,24 @@
class MusicDriver_Cocoa : public MusicDriver { class MusicDriver_Cocoa : public MusicDriver {
public: 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "cocoa"; } const char *GetName() const override { return "cocoa"; }
}; };
class FMusicDriver_Cocoa : public DriverFactoryBase { class FMusicDriver_Cocoa : public DriverFactoryBase {
public: public:
FMusicDriver_Cocoa() : DriverFactoryBase(Driver::DT_MUSIC, 10, "cocoa", "Cocoa MIDI Driver") {} 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 */ #endif /* MUSIC_MACOSX_COCOA_H */

View File

@ -19,25 +19,25 @@ class MusicDriver_DMusic : public MusicDriver {
public: public:
virtual ~MusicDriver_DMusic(); 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "dmusic"; } const char *GetName() const override { return "dmusic"; }
}; };
/** Factory for the DirectX music player. */ /** Factory for the DirectX music player. */
class FMusicDriver_DMusic : public DriverFactoryBase { class FMusicDriver_DMusic : public DriverFactoryBase {
public: public:
FMusicDriver_DMusic() : DriverFactoryBase(Driver::DT_MUSIC, 10, "dmusic", "DirectMusic MIDI Driver") {} 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 */ #endif /* MUSIC_DMUSIC_H */

View File

@ -24,24 +24,24 @@ private:
void DoStop(); void DoStop();
public: 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "extmidi"; } const char *GetName() const override { return "extmidi"; }
}; };
class FMusicDriver_ExtMidi : public DriverFactoryBase { class FMusicDriver_ExtMidi : public DriverFactoryBase {
public: public:
FMusicDriver_ExtMidi() : DriverFactoryBase(Driver::DT_MUSIC, 3, "extmidi", "External MIDI Driver") {} 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 */ #endif /* MUSIC_EXTERNAL_H */

View File

@ -17,25 +17,25 @@
/** Music driver making use of FluidSynth. */ /** Music driver making use of FluidSynth. */
class MusicDriver_FluidSynth : public MusicDriver { class MusicDriver_FluidSynth : public MusicDriver {
public: 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "fluidsynth"; } const char *GetName() const override { return "fluidsynth"; }
}; };
/** Factory for the fluidsynth driver. */ /** Factory for the fluidsynth driver. */
class FMusicDriver_FluidSynth : public DriverFactoryBase { class FMusicDriver_FluidSynth : public DriverFactoryBase {
public: public:
FMusicDriver_FluidSynth() : DriverFactoryBase(Driver::DT_MUSIC, 5, "fluidsynth", "FluidSynth MIDI Driver") {} 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 */ #endif /* MUSIC_FLUIDSYNTH_H */

View File

@ -17,25 +17,25 @@
/** The music player that does nothing. */ /** The music player that does nothing. */
class MusicDriver_Null : public MusicDriver { class MusicDriver_Null : public MusicDriver {
public: 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) { } void SetVolume(byte vol) override { }
/* virtual */ const char *GetName() const { return "null"; } const char *GetName() const override { return "null"; }
}; };
/** Factory for the null music player. */ /** Factory for the null music player. */
class FMusicDriver_Null : public DriverFactoryBase { class FMusicDriver_Null : public DriverFactoryBase {
public: public:
FMusicDriver_Null() : DriverFactoryBase(Driver::DT_MUSIC, 1, "null", "Null Music Driver") {} 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 */ #endif /* MUSIC_NULL_H */

View File

@ -17,25 +17,25 @@
/** OS/2's music player. */ /** OS/2's music player. */
class MusicDriver_OS2 : public MusicDriver { class MusicDriver_OS2 : public MusicDriver {
public: 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "os2"; } const char *GetName() const override { return "os2"; }
}; };
/** Factory for OS/2's music player. */ /** Factory for OS/2's music player. */
class FMusicDriver_OS2 : public DriverFactoryBase { class FMusicDriver_OS2 : public DriverFactoryBase {
public: public:
FMusicDriver_OS2() : DriverFactoryBase(Driver::DT_MUSIC, 10, "os2", "OS/2 Music Driver") {} 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 */ #endif /* MUSIC_OS2_H */

View File

@ -16,24 +16,24 @@
class MusicDriver_QtMidi : public MusicDriver { class MusicDriver_QtMidi : public MusicDriver {
public: 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "qt"; } const char *GetName() const override { return "qt"; }
}; };
class FMusicDriver_QtMidi : public DriverFactoryBase { class FMusicDriver_QtMidi : public DriverFactoryBase {
public: public:
FMusicDriver_QtMidi() : DriverFactoryBase(Driver::DT_MUSIC, 5, "qt", "QuickTime MIDI Driver") {} 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 */ #endif /* MUSIC_MACOSX_QUICKTIME_H */

View File

@ -17,25 +17,25 @@
/** The Windows music player. */ /** The Windows music player. */
class MusicDriver_Win32 : public MusicDriver { class MusicDriver_Win32 : public MusicDriver {
public: 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); void SetVolume(byte vol) override;
/* virtual */ const char *GetName() const { return "win32"; } const char *GetName() const override { return "win32"; }
}; };
/** Factory for Windows' music player. */ /** Factory for Windows' music player. */
class FMusicDriver_Win32 : public DriverFactoryBase { class FMusicDriver_Win32 : public DriverFactoryBase {
public: public:
FMusicDriver_Win32() : DriverFactoryBase(Driver::DT_MUSIC, 5, "win32", "Win32 Music Driver") {} 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 */ #endif /* MUSIC_WIN32_H */

View File

@ -84,7 +84,7 @@ struct PacketReader : LoadFilter {
this->buf += to_write; 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. */ /* Limit the amount to read to whatever we still have. */
size_t ret_size = size = min(this->written_bytes - this->read_bytes, size); size_t ret_size = size = min(this->written_bytes - this->read_bytes, size);
@ -106,7 +106,7 @@ struct PacketReader : LoadFilter {
return ret_size; return ret_size;
} }
/* virtual */ void Reset() void Reset() override
{ {
this->read_bytes = 0; this->read_bytes = 0;

View File

@ -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) { if (widget == WID_TF_CAPTION) {
SetDParam(0, this->GetTypeString()); SetDParam(0, this->GetTypeString());

View File

@ -117,7 +117,7 @@ public:
*lastof(this->visible) = true; *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! */ /* Oh yeah, we ought to be findable! */
w->nested_array[WID_NG_HEADER] = this; 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 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); 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; int i = 0;
for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) { 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; if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL;

View File

@ -163,7 +163,7 @@ struct PacketWriter : SaveFilter {
this->current = NULL; 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. */ /* We want to abort the saving when the socket is closed. */
if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION); if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);
@ -190,7 +190,7 @@ struct PacketWriter : SaveFilter {
this->total_size += size; this->total_size += size;
} }
/* virtual */ void Finish() void Finish() override
{ {
/* We want to abort the saving when the socket is closed. */ /* We want to abort the saving when the socket is closed. */
if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION); if (this->cs == NULL) SlError(STR_NETWORK_ERROR_LOSTCONNECTION);

View File

@ -39,9 +39,9 @@ struct AirportScopeResolver : public ScopeResolver {
{ {
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
/* virtual */ void StorePSA(uint pos, int32 value); void StorePSA(uint pos, int32 value) override;
}; };
/** Resolver object for airports. */ /** Resolver object for airports. */
@ -51,7 +51,7 @@ struct AirportResolverObject : public ResolverObject {
AirportResolverObject(TileIndex tile, Station *st, byte airport_id, byte layout, AirportResolverObject(TileIndex tile, Station *st, byte airport_id, byte layout,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &this->airport_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;
}; };
/** /**

View File

@ -38,8 +38,8 @@ struct AirportTileScopeResolver : public ScopeResolver {
this->airport_id = st->airport.type; this->airport_id = st->airport.type;
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
}; };
/** Resolver for tiles of an airport. */ /** Resolver for tiles of an airport. */
@ -49,7 +49,7 @@ struct AirportTileResolverObject : public ResolverObject {
AirportTileResolverObject(const AirportTileSpec *ats, TileIndex tile, Station *st, AirportTileResolverObject(const AirportTileSpec *ats, TileIndex tile, Station *st,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &tiles_scope; case VSG_SCOPE_SELF: return &tiles_scope;

View File

@ -30,8 +30,8 @@ struct CanalScopeResolver : public ScopeResolver {
{ {
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
}; };
/** Resolver object for canals. */ /** Resolver object for canals. */
@ -41,7 +41,7 @@ struct CanalResolverObject : public ResolverObject {
CanalResolverObject(CanalFeature feature, TileIndex tile, CanalResolverObject(CanalFeature feature, TileIndex tile,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &this->canal_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 /* virtual */ uint32 CanalScopeResolver::GetRandomBits() const

View File

@ -19,7 +19,7 @@
struct CargoResolverObject : public ResolverObject { struct CargoResolverObject : public ResolverObject {
CargoResolverObject(const CargoSpec *cs, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); 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 /* virtual */ const SpriteGroup *CargoResolverObject::ResolveReal(const RealSpriteGroup *group) const

View File

@ -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. */ /** Do the scan for GRFs. */
static uint DoScan() static uint DoScan()

View File

@ -40,9 +40,9 @@ struct VehicleScopeResolver : public ScopeResolver {
void SetVehicle(const Vehicle *v) { this->v = v; } void SetVehicle(const Vehicle *v) { this->v = v; }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
/* virtual */ uint32 GetTriggers() const; uint32 GetTriggers() const override;
}; };
/** Resolver for a vehicle (chain) */ /** 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, 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); 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; static const uint TRAININFO_DEFAULT_VEHICLE_WIDTH = 29;

View File

@ -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: private:
bool ai_callback; ///< Callback comes from the AI. 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); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &this->generic_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 { struct GenericCallback {

View File

@ -550,7 +550,7 @@ struct NewGRFTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, NEWGRF_DIR); this->LoadTextfile(textfile, NEWGRF_DIR);
} }
/* virtual */ void SetStringParameters(int widget) const void SetStringParameters(int widget) const override
{ {
if (widget == WID_TF_CAPTION) { if (widget == WID_TF_CAPTION) {
SetDParam(0, STR_CONTENT_TYPE_NEWGRF); SetDParam(0, STR_CONTENT_TYPE_NEWGRF);

View File

@ -44,9 +44,9 @@ struct HouseScopeResolver : public ScopeResolver {
{ {
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
/* virtual */ uint32 GetTriggers() const; uint32 GetTriggers() const override;
}; };
/** Resolver object to be used for houses (feature 07 spritegroups). */ /** 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, 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); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &this->house_scope; case VSG_SCOPE_SELF: return &this->house_scope;

View File

@ -34,10 +34,10 @@ struct IndustriesScopeResolver : public ScopeResolver {
{ {
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
/* virtual */ uint32 GetTriggers() const; uint32 GetTriggers() const override;
/* virtual */ void StorePSA(uint pos, int32 value); void StorePSA(uint pos, int32 value) override;
}; };
/** Resolver for industries. */ /** Resolver for industries. */
@ -51,7 +51,7 @@ struct IndustriesResolverObject : public ResolverObject {
TownScopeResolver *GetTown(); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &industries_scope; case VSG_SCOPE_SELF: return &industries_scope;

View File

@ -32,9 +32,9 @@ struct IndustryTileScopeResolver : public ScopeResolver {
{ {
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
/* virtual */ uint32 GetTriggers() const; uint32 GetTriggers() const override;
}; };
/** Resolver for industry tiles. */ /** Resolver for industry tiles. */
@ -45,7 +45,7 @@ struct IndustryTileResolverObject : public ResolverObject {
IndustryTileResolverObject(IndustryGfx gfx, TileIndex tile, Industry *indus, IndustryTileResolverObject(IndustryGfx gfx, TileIndex tile, Industry *indus,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &indtile_scope; case VSG_SCOPE_SELF: return &indtile_scope;

View File

@ -116,8 +116,8 @@ struct ObjectScopeResolver : public ScopeResolver {
{ {
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
}; };
/** A resolver object to be used with feature 0F spritegroups. */ /** 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); CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0);
~ObjectResolverObject(); ~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) { switch (scope) {
case VSG_SCOPE_SELF: case VSG_SCOPE_SELF:

View File

@ -32,8 +32,8 @@ struct RailTypeScopeResolver : public ScopeResolver {
{ {
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
}; };
/** Resolver object for rail types. */ /** 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); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &this->railtype_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); SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL, uint *num_results = NULL);

View File

@ -42,10 +42,10 @@ struct StationScopeResolver : public ScopeResolver {
{ {
} }
/* virtual */ uint32 GetRandomBits() const; uint32 GetRandomBits() const override;
/* virtual */ uint32 GetTriggers() const; 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. */ /** Station resolver. */
@ -59,7 +59,7 @@ struct StationResolverObject : public ResolverObject {
TownScopeResolver *GetTown(); 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) { switch (scope) {
case VSG_SCOPE_SELF: 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 { enum StationClassID {

View File

@ -46,7 +46,7 @@ struct TownResolverObject : public ResolverObject {
TownResolverObject(const struct GRFFile *grffile, Town *t, bool readonly); 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) { switch (scope) {
case VSG_SCOPE_SELF: return &town_scope; case VSG_SCOPE_SELF: return &town_scope;

View File

@ -52,7 +52,7 @@ class CrashLogOSX : public CrashLog {
char filename_save[MAX_PATH]; ///< Path of crash.sav char filename_save[MAX_PATH]; ///< Path of crash.sav
char filename_screenshot[MAX_PATH]; ///< Path of crash.(png|bmp|pcx) 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; int ver_maj, ver_min, ver_bug;
GetMacOSVersion(&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, return buffer + seprintf(buffer, last,
"Crash reason:\n" "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, /* As backtrace() is only implemented in 10.5 or later,
* we're rolling our own here. Mostly based on * we're rolling our own here. Mostly based on

View File

@ -40,7 +40,7 @@ class CrashLogUnix : public CrashLog {
/** Signal that has been thrown. */ /** Signal that has been thrown. */
int signum; int signum;
/* virtual */ char *LogOSVersion(char *buffer, const char *last) const char *LogOSVersion(char *buffer, const char *last) const override
{ {
struct utsname name; struct utsname name;
if (uname(&name) < 0) { 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, return buffer + seprintf(buffer, last,
"Crash reason:\n" "Crash reason:\n"
@ -105,7 +105,7 @@ class CrashLogUnix : public CrashLog {
} }
#endif #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"); buffer += seprintf(buffer, last, "Stacktrace:\n");
#if defined(__GLIBC__) #if defined(__GLIBC__)

View File

@ -43,14 +43,14 @@ class CrashLogWindows : public CrashLog {
/** Information about the encountered exception */ /** Information about the encountered exception */
EXCEPTION_POINTERS *ep; EXCEPTION_POINTERS *ep;
/* virtual */ char *LogOSVersion(char *buffer, const char *last) const; char *LogOSVersion(char *buffer, const char *last) const override;
/* virtual */ char *LogError(char *buffer, const char *last, const char *message) const; char *LogError(char *buffer, const char *last, const char *message) const override;
/* virtual */ char *LogStacktrace(char *buffer, const char *last) const; char *LogStacktrace(char *buffer, const char *last) const override;
/* virtual */ char *LogRegisters(char *buffer, const char *last) const; char *LogRegisters(char *buffer, const char *last) const override;
/* virtual */ char *LogModules(char *buffer, const char *last) const; char *LogModules(char *buffer, const char *last) const override;
public: public:
#if defined(_MSC_VER) #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; char *AppendDecodedStacktrace(char *buffer, const char *last) const;
#else #else
char *AppendDecodedStacktrace(char *buffer, const char *last) const { return buffer; } char *AppendDecodedStacktrace(char *buffer, const char *last) const { return buffer; }

View File

@ -1844,7 +1844,7 @@ struct FileReader : LoadFilter {
_sl.sf = NULL; _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. */ /* We're in the process of shutting down, i.e. in "failure" mode. */
if (this->file == NULL) return 0; if (this->file == NULL) return 0;
@ -1852,7 +1852,7 @@ struct FileReader : LoadFilter {
return fread(buf, 1, size, this->file); return fread(buf, 1, size, this->file);
} }
/* virtual */ void Reset() void Reset() override
{ {
clearerr(this->file); clearerr(this->file);
if (fseek(this->file, this->begin, SEEK_SET)) { if (fseek(this->file, this->begin, SEEK_SET)) {
@ -1882,7 +1882,7 @@ struct FileWriter : SaveFilter {
_sl.sf = NULL; _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. */ /* We're in the process of shutting down, i.e. in "failure" mode. */
if (this->file == NULL) return; 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); 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); if (this->file != NULL) fclose(this->file);
this->file = NULL; 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"); 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); 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"); 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; const lzo_bytep in = buf;
/* Buffer size is from the LZO docs plus the chunk header size. */ /* 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); 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); this->chain->Write(buf, size);
} }
@ -2056,7 +2056,7 @@ struct ZlibLoadFilter : LoadFilter {
inflateEnd(&this->z); 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.next_out = buf;
this->z.avail_out = (uint)size; this->z.avail_out = (uint)size;
@ -2135,12 +2135,12 @@ struct ZlibSaveFilter : SaveFilter {
} while (this->z.avail_in || !this->z.avail_out); } 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); this->WriteLoop(buf, size, 0);
} }
/* virtual */ void Finish() void Finish() override
{ {
this->WriteLoop(NULL, 0, Z_FINISH); this->WriteLoop(NULL, 0, Z_FINISH);
this->chain->Finish(); this->chain->Finish();
@ -2185,7 +2185,7 @@ struct LZMALoadFilter : LoadFilter {
lzma_end(&this->lzma); 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.next_out = buf;
this->lzma.avail_out = size; this->lzma.avail_out = size;
@ -2254,12 +2254,12 @@ struct LZMASaveFilter : SaveFilter {
} while (this->lzma.avail_in || !this->lzma.avail_out); } 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); this->WriteLoop(buf, size, LZMA_RUN);
} }
/* virtual */ void Finish() void Finish() override
{ {
this->WriteLoop(NULL, 0, LZMA_FINISH); this->WriteLoop(NULL, 0, LZMA_FINISH);
this->chain->Finish(); this->chain->Finish();

View File

@ -45,7 +45,7 @@ public:
RawText(const char *text); RawText(const char *text);
~RawText(); ~RawText();
/* virtual */ const char *GetEncodedText() { return this->text; } const char *GetEncodedText() override { return this->text; }
private: private:
const char *text; const char *text;
}; };

View File

@ -77,7 +77,7 @@ public:
*/ */
const char *FindMainScript(const ContentInfo *ci, bool md5sum); 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. * Rescan the script dir.

View File

@ -152,7 +152,7 @@ struct BaseSetTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, BASESET_DIR); this->LoadTextfile(textfile, BASESET_DIR);
} }
/* virtual */ void SetStringParameters(int widget) const void SetStringParameters(int widget) const override
{ {
if (widget == WID_TF_CAPTION) { if (widget == WID_TF_CAPTION) {
SetDParam(0, content_type); SetDParam(0, content_type);

View File

@ -17,12 +17,12 @@
/** Implementation of the allegro sound driver. */ /** Implementation of the allegro sound driver. */
class SoundDriver_Allegro : public SoundDriver { class SoundDriver_Allegro : public SoundDriver {
public: public:
/* virtual */ const char *Start(const char * const *param); const char *Start(const char * const *param);
/* virtual */ void Stop(); void Stop();
/* virtual */ void MainLoop(); void MainLoop();
/* virtual */ const char *GetName() const { return "allegro"; } const char *GetName() const { return "allegro"; }
}; };
/** Factory for the allegro sound driver. */ /** Factory for the allegro sound driver. */

View File

@ -16,16 +16,16 @@
class SoundDriver_Cocoa : public SoundDriver { class SoundDriver_Cocoa : public SoundDriver {
public: public:
/* virtual */ const char *Start(const char * const *param); const char *Start(const char * const *param) override;
/* virtual */ void Stop(); void Stop() override;
/* virtual */ const char *GetName() const { return "cocoa"; } const char *GetName() const override { return "cocoa"; }
}; };
class FSoundDriver_Cocoa : public DriverFactoryBase { class FSoundDriver_Cocoa : public DriverFactoryBase {
public: public:
FSoundDriver_Cocoa() : DriverFactoryBase(Driver::DT_SOUND, 10, "cocoa", "Cocoa Sound Driver") {} 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 */ #endif /* SOUND_COCOA_H */

View File

@ -17,17 +17,17 @@
/** Implementation of the null sound driver. */ /** Implementation of the null sound driver. */
class SoundDriver_Null : public SoundDriver { class SoundDriver_Null : public SoundDriver {
public: 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 */ const char *GetName() const { return "null"; } const char *GetName() const override { return "null"; }
}; };
/** Factory for the null sound driver. */ /** Factory for the null sound driver. */
class FSoundDriver_Null : public DriverFactoryBase { class FSoundDriver_Null : public DriverFactoryBase {
public: public:
FSoundDriver_Null() : DriverFactoryBase(Driver::DT_SOUND, 1, "null", "Null Sound Driver") {} 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 */ #endif /* SOUND_NULL_H */

View File

@ -17,17 +17,17 @@
/** Implementation of the SDL sound driver. */ /** Implementation of the SDL sound driver. */
class SoundDriver_SDL : public SoundDriver { class SoundDriver_SDL : public SoundDriver {
public: public:
/* virtual */ const char *Start(const char * const *param); const char *Start(const char * const *param) override;
/* virtual */ void Stop(); void Stop() override;
/* virtual */ const char *GetName() const { return "sdl"; } const char *GetName() const override { return "sdl"; }
}; };
/** Factory for the SDL sound driver. */ /** Factory for the SDL sound driver. */
class FSoundDriver_SDL : public DriverFactoryBase { class FSoundDriver_SDL : public DriverFactoryBase {
public: public:
FSoundDriver_SDL() : DriverFactoryBase(Driver::DT_SOUND, 5, "sdl", "SDL Sound Driver") {} 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 */ #endif /* SOUND_SDL_H */

View File

@ -17,17 +17,17 @@
/** Implementation of the sound driver for Windows. */ /** Implementation of the sound driver for Windows. */
class SoundDriver_Win32 : public SoundDriver { class SoundDriver_Win32 : public SoundDriver {
public: public:
/* virtual */ const char *Start(const char * const *param); const char *Start(const char * const *param) override;
/* virtual */ void Stop(); void Stop() override;
/* virtual */ const char *GetName() const { return "win32"; } const char *GetName() const override { return "win32"; }
}; };
/** Factory for the sound driver for Windows. */ /** Factory for the sound driver for Windows. */
class FSoundDriver_Win32 : public DriverFactoryBase { class FSoundDriver_Win32 : public DriverFactoryBase {
public: public:
FSoundDriver_Win32() : DriverFactoryBase(Driver::DT_SOUND, 9, "win32", "Win32 WaveOut Sound Driver") {} 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 */ #endif /* SOUND_WIN32_H */

View File

@ -17,17 +17,17 @@
/** Implementation of the XAudio2 sound driver. */ /** Implementation of the XAudio2 sound driver. */
class SoundDriver_XAudio2 : public SoundDriver { class SoundDriver_XAudio2 : public SoundDriver {
public: public:
/* virtual */ const char *Start(const char * const *param); const char *Start(const char * const *param) override;
/* virtual */ void Stop(); void Stop() override;
/* virtual */ const char *GetName() const { return "xaudio2"; } const char *GetName() const override { return "xaudio2"; }
}; };
/** Factory for the XAudio2 sound driver. */ /** Factory for the XAudio2 sound driver. */
class FSoundDriver_XAudio2 : public DriverFactoryBase { class FSoundDriver_XAudio2 : public DriverFactoryBase {
public: public:
FSoundDriver_XAudio2() : DriverFactoryBase(Driver::DT_SOUND, 10, "xaudio2", "XAudio2 Sound Driver") {} 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 */ #endif /* SOUND_XAUDIO2_H */

View File

@ -490,12 +490,12 @@ public:
void MarkTilesDirty(bool cargo_change) const; void MarkTilesDirty(bool cargo_change) const;
void UpdateVirtCoord(); void UpdateVirtCoord() override;
void AfterStationTileSetChange(bool adding, StationType type); void AfterStationTileSetChange(bool adding, StationType type);
/* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const; uint GetPlatformLength(TileIndex tile, DiagDirection dir) const override;
/* virtual */ uint GetPlatformLength(TileIndex tile) const; uint GetPlatformLength(TileIndex tile) const override;
void RecomputeCatchment(); void RecomputeCatchment();
static void RecomputeCatchmentForAll(); static void RecomputeCatchmentForAll();
@ -509,7 +509,7 @@ public:
return this->catchment_tiles.HasTile(tile); 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; return IsRailStationTile(tile) && GetStationIndex(tile) == this->index;
} }
@ -519,9 +519,9 @@ public:
return IsAirportTile(tile) && GetStationIndex(tile) == this->index; 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) #define FOR_ALL_STATIONS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Station, var)

View File

@ -115,14 +115,14 @@ struct FileStringReader : StringReader {
fclose(this->fh); 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); 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(); this->StringReader::ParseFile();

View File

@ -2032,18 +2032,18 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
uint i; ///< Iterator for the primary language tables. uint i; ///< Iterator for the primary language tables.
uint j; ///< Iterator for the secondary language tables. uint j; ///< Iterator for the secondary language tables.
/* virtual */ void Reset() void Reset() override
{ {
this->i = 0; this->i = 0;
this->j = 0; this->j = 0;
} }
/* virtual */ FontSize DefaultSize() FontSize DefaultSize() override
{ {
return FS_NORMAL; return FS_NORMAL;
} }
/* virtual */ const char *NextString() const char *NextString() override
{ {
if (this->i >= TEXT_TAB_END) return NULL; if (this->i >= TEXT_TAB_END) return NULL;
@ -2058,12 +2058,12 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
return ret; return ret;
} }
/* virtual */ bool Monospace() bool Monospace() override
{ {
return false; return false;
} }
/* virtual */ void SetFontNames(FreeTypeSettings *settings, const char *font_name) void SetFontNames(FreeTypeSettings *settings, const char *font_name) override
{ {
#ifdef WITH_FREETYPE #ifdef WITH_FREETYPE
strecpy(settings->small.font, font_name, lastof(settings->small.font)); strecpy(settings->small.font, font_name, lastof(settings->small.font));

View File

@ -69,14 +69,14 @@ static const NIVariable _niv_vehicles[] = {
}; };
class NIHVehicle : public NIHelper { class NIHVehicle : public NIHelper {
bool IsInspectable(uint index) const { return Vehicle::Get(index)->GetGRF() != NULL; } bool IsInspectable(uint index) const override { 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); } 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 { return Vehicle::Get(index); } const void *GetInstance(uint index)const override { return Vehicle::Get(index); }
const void *GetSpec(uint index) const { return Vehicle::Get(index)->GetEngine(); } const void *GetSpec(uint index) const override { return Vehicle::Get(index)->GetEngine(); }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); } void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
uint32 GetGRFID(uint index) const { return Vehicle::Get(index)->GetGRFID(); } uint32 GetGRFID(uint index) const override { return Vehicle::Get(index)->GetGRFID(); }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const uint Resolve(uint index, uint var, uint param, bool *avail) const override
{ {
Vehicle *v = Vehicle::Get(index); Vehicle *v = Vehicle::Get(index);
VehicleResolverObject ro(v->engine_type, v, VehicleResolverObject::WO_CACHED); VehicleResolverObject ro(v->engine_type, v, VehicleResolverObject::WO_CACHED);
@ -132,14 +132,14 @@ static const NIVariable _niv_stations[] = {
}; };
class NIHStation : public NIHelper { class NIHStation : public NIHelper {
bool IsInspectable(uint index) const { return GetStationSpec(index) != NULL; } bool IsInspectable(uint index) const override { return GetStationSpec(index) != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); } uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return NULL; } const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const { return GetStationSpec(index); } const void *GetSpec(uint index) const override { return GetStationSpec(index); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); } void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; } uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const uint Resolve(uint index, uint var, uint param, bool *avail) const override
{ {
StationResolverObject ro(GetStationSpec(index), Station::GetByTile(index), index); StationResolverObject ro(GetStationSpec(index), Station::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -197,14 +197,14 @@ static const NIVariable _niv_house[] = {
}; };
class NIHHouse : public NIHelper { class NIHHouse : public NIHelper {
bool IsInspectable(uint index) const { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; } bool IsInspectable(uint index) const override { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); } uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
const void *GetInstance(uint index)const { return NULL; } const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const { return HouseSpec::Get(GetHouseType(index)); } const void *GetSpec(uint index) const override { return HouseSpec::Get(GetHouseType(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); } void SetStringParameters(uint index) const override { 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; } uint32 GetGRFID(uint index) const override { 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 uint Resolve(uint index, uint var, uint param, bool *avail) const override
{ {
HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index)); HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -247,14 +247,14 @@ static const NIVariable _niv_industrytiles[] = {
}; };
class NIHIndustryTile : public NIHelper { class NIHIndustryTile : public NIHelper {
bool IsInspectable(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; } bool IsInspectable(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); } uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
const void *GetInstance(uint index)const { return NULL; } const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index)); } const void *GetSpec(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); } void SetStringParameters(uint index) const override { 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; } uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const uint Resolve(uint index, uint var, uint param, bool *avail) const override
{ {
IndustryTileResolverObject ro(GetIndustryGfx(index), index, Industry::GetByTile(index)); IndustryTileResolverObject ro(GetIndustryGfx(index), index, Industry::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -346,23 +346,23 @@ static const NIVariable _niv_industries[] = {
}; };
class NIHIndustry : public NIHelper { class NIHIndustry : public NIHelper {
bool IsInspectable(uint index) const { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; } bool IsInspectable(uint index) const override { 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); } uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
const void *GetInstance(uint index)const { return Industry::Get(index); } const void *GetInstance(uint index)const override { return Industry::Get(index); }
const void *GetSpec(uint index) const { return GetIndustrySpec(Industry::Get(index)->type); } const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); } void SetStringParameters(uint index) const override { 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; } uint32 GetGRFID(uint index) const override { 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 uint Resolve(uint index, uint var, uint param, bool *avail) const override
{ {
Industry *i = Industry::Get(index); Industry *i = Industry::Get(index);
IndustriesResolverObject ro(i->location.tile, i, i->type); IndustriesResolverObject ro(i->location.tile, i, i->type);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); 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); const Industry *i = (const Industry *)this->GetInstance(index);
if (i->psa == NULL) return NULL; if (i->psa == NULL) return NULL;
@ -411,14 +411,14 @@ static const NIVariable _niv_objects[] = {
}; };
class NIHObject : public NIHelper { class NIHObject : public NIHelper {
bool IsInspectable(uint index) const { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; } bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); } uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return Object::GetByTile(index); } const void *GetInstance(uint index)const override { return Object::GetByTile(index); }
const void *GetSpec(uint index) const { return ObjectSpec::GetByTile(index); } const void *GetSpec(uint index) const override { return ObjectSpec::GetByTile(index); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, 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 { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; } uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const uint Resolve(uint index, uint var, uint param, bool *avail) const override
{ {
ObjectResolverObject ro(ObjectSpec::GetByTile(index), Object::GetByTile(index), index); ObjectResolverObject ro(ObjectSpec::GetByTile(index), Object::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -445,14 +445,14 @@ static const NIVariable _niv_railtypes[] = {
}; };
class NIHRailType : public NIHelper { class NIHRailType : public NIHelper {
bool IsInspectable(uint index) const { return true; } bool IsInspectable(uint index) const override { return true; }
uint GetParent(uint index) const { return UINT32_MAX; } uint GetParent(uint index) const override { return UINT32_MAX; }
const void *GetInstance(uint index)const { return NULL; } const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const { return NULL; } const void *GetSpec(uint index) const override { return NULL; }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); } 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 { return 0; } uint32 GetGRFID(uint index) const override { return 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const 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. /* 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. */ * 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 { class NIHAirportTile : public NIHelper {
bool IsInspectable(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; } bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); } uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return NULL; } const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index)); } const void *GetSpec(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); } void SetStringParameters(uint index) const override { 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; } uint32 GetGRFID(uint index) const override { 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 uint Resolve(uint index, uint var, uint param, bool *avail) const override
{ {
AirportTileResolverObject ro(AirportTileSpec::GetByTile(index), index, Station::GetByTile(index)); AirportTileResolverObject ro(AirportTileSpec::GetByTile(index), index, Station::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -519,22 +519,22 @@ static const NIVariable _niv_towns[] = {
}; };
class NIHTown : public NIHelper { class NIHTown : public NIHelper {
bool IsInspectable(uint index) const { return Town::IsValidID(index); } bool IsInspectable(uint index) const override { return Town::IsValidID(index); }
uint GetParent(uint index) const { return UINT32_MAX; } uint GetParent(uint index) const override { return UINT32_MAX; }
const void *GetInstance(uint index)const { return Town::Get(index); } const void *GetInstance(uint index)const override { return Town::Get(index); }
const void *GetSpec(uint index) const { return NULL; } const void *GetSpec(uint index) const override { return NULL; }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_TOWN_NAME, index); } void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
uint32 GetGRFID(uint index) const { return 0; } uint32 GetGRFID(uint index) const override { return 0; }
bool PSAWithParameter() const { return true; } bool PSAWithParameter() const override { return true; }
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); }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const uint Resolve(uint index, uint var, uint param, bool *avail) const override
{ {
TownResolverObject ro(NULL, Town::Get(index), true); TownResolverObject ro(NULL, Town::Get(index), true);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail); 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); Town *t = Town::Get(index);

View File

@ -41,13 +41,13 @@ public:
thread = _beginthread(stThreadProc, NULL, 1048576, this); thread = _beginthread(stThreadProc, NULL, 1048576, this);
} }
/* virtual */ bool Exit() bool Exit() override
{ {
_endthread(); _endthread();
return true; return true;
} }
/* virtual */ void Join() void Join() override
{ {
DosWaitThread(&this->thread, DCWW_WAIT); DosWaitThread(&this->thread, DCWW_WAIT);
this->thread = 0; this->thread = 0;
@ -106,13 +106,13 @@ public:
DosCreateEventSem(NULL, &event, 0, FALSE); DosCreateEventSem(NULL, &event, 0, FALSE);
} }
/* virtual */ ~ThreadMutex_OS2() ~ThreadMutex_OS2() override
{ {
DosCloseMutexSem(mutex); DosCloseMutexSem(mutex);
DosCloseEventSem(event); DosCloseEventSem(event);
} }
/* virtual */ void BeginCritical(bool allow_recursive = false) void BeginCritical(bool allow_recursive = false) override
{ {
/* os2 mutex is recursive by itself */ /* os2 mutex is recursive by itself */
DosRequestMutexSem(mutex, (unsigned long) SEM_INDEFINITE_WAIT); DosRequestMutexSem(mutex, (unsigned long) SEM_INDEFINITE_WAIT);
@ -120,14 +120,14 @@ public:
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); 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(); if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
this->recursive_count--; this->recursive_count--;
DosReleaseMutexSem(mutex); DosReleaseMutexSem(mutex);
} }
/* virtual */ void WaitForSignal() void WaitForSignal() override
{ {
assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise? assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise?
this->EndCritical(); this->EndCritical();
@ -135,7 +135,7 @@ public:
this->BeginCritical(); this->BeginCritical();
} }
/* virtual */ void SendSignal() void SendSignal() override
{ {
DosPostEventSem(event); DosPostEventSem(event);
} }

View File

@ -45,14 +45,14 @@ public:
pthread_create(&this->thread, NULL, &stThreadProc, this); pthread_create(&this->thread, NULL, &stThreadProc, this);
} }
/* virtual */ bool Exit() bool Exit() override
{ {
assert(pthread_self() == this->thread); assert(pthread_self() == this->thread);
/* For now we terminate by throwing an error, gives much cleaner cleanup */ /* For now we terminate by throwing an error, gives much cleaner cleanup */
throw OTTDThreadExitSignal(); throw OTTDThreadExitSignal();
} }
/* virtual */ void Join() void Join() override
{ {
/* You cannot join yourself */ /* You cannot join yourself */
assert(pthread_self() != this->thread); assert(pthread_self() != this->thread);
@ -129,7 +129,7 @@ public:
pthread_cond_init(&this->condition, NULL); pthread_cond_init(&this->condition, NULL);
} }
/* virtual */ ~ThreadMutex_pthread() ~ThreadMutex_pthread() override
{ {
int err = pthread_cond_destroy(&this->condition); int err = pthread_cond_destroy(&this->condition);
assert(err != EBUSY); assert(err != EBUSY);
@ -142,7 +142,7 @@ public:
return this->owner == pthread_self(); 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 */ /* pthread mutex is not recursive by itself */
if (this->IsOwnedByCurrentThread()) { if (this->IsOwnedByCurrentThread()) {
@ -156,7 +156,7 @@ public:
this->recursive_count++; this->recursive_count++;
} }
/* virtual */ void EndCritical(bool allow_recursive = false) void EndCritical(bool allow_recursive = false) override
{ {
assert(this->IsOwnedByCurrentThread()); assert(this->IsOwnedByCurrentThread());
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
@ -167,7 +167,7 @@ public:
assert(err == 0); assert(err == 0);
} }
/* virtual */ void WaitForSignal() void WaitForSignal() override
{ {
uint old_recursive_count = this->recursive_count; uint old_recursive_count = this->recursive_count;
this->recursive_count = 0; this->recursive_count = 0;
@ -178,7 +178,7 @@ public:
this->recursive_count = old_recursive_count; this->recursive_count = old_recursive_count;
} }
/* virtual */ void SendSignal() void SendSignal() override
{ {
int err = pthread_cond_signal(&this->condition); int err = pthread_cond_signal(&this->condition);
assert(err == 0); assert(err == 0);

View File

@ -49,7 +49,7 @@ public:
ResumeThread(this->thread); ResumeThread(this->thread);
} }
/* virtual */ ~ThreadObject_Win32() ~ThreadObject_Win32() override
{ {
if (this->thread != NULL) { if (this->thread != NULL) {
CloseHandle(this->thread); CloseHandle(this->thread);
@ -57,14 +57,14 @@ public:
} }
} }
/* virtual */ bool Exit() bool Exit() override
{ {
assert(GetCurrentThreadId() == this->id); assert(GetCurrentThreadId() == this->id);
/* For now we terminate by throwing an error, gives much cleaner cleanup */ /* For now we terminate by throwing an error, gives much cleaner cleanup */
throw OTTDThreadExitSignal(); throw OTTDThreadExitSignal();
} }
/* virtual */ void Join() void Join() override
{ {
/* You cannot join yourself */ /* You cannot join yourself */
assert(GetCurrentThreadId() != this->id); assert(GetCurrentThreadId() != this->id);
@ -126,13 +126,13 @@ public:
this->event = CreateEvent(NULL, FALSE, FALSE, NULL); this->event = CreateEvent(NULL, FALSE, FALSE, NULL);
} }
/* virtual */ ~ThreadMutex_Win32() ~ThreadMutex_Win32() override
{ {
DeleteCriticalSection(&this->critical_section); DeleteCriticalSection(&this->critical_section);
CloseHandle(this->event); CloseHandle(this->event);
} }
/* virtual */ void BeginCritical(bool allow_recursive = false) void BeginCritical(bool allow_recursive = false) override
{ {
/* windows mutex is recursive by itself */ /* windows mutex is recursive by itself */
EnterCriticalSection(&this->critical_section); EnterCriticalSection(&this->critical_section);
@ -140,14 +140,14 @@ public:
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); 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(); if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
this->recursive_count--; this->recursive_count--;
LeaveCriticalSection(&this->critical_section); 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? assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise?
this->EndCritical(); this->EndCritical();
@ -155,7 +155,7 @@ public:
this->BeginCritical(); this->BeginCritical();
} }
/* virtual */ void SendSignal() void SendSignal() override
{ {
SetEvent(this->event); SetEvent(this->event);
} }

View File

@ -1332,7 +1332,7 @@ public:
return type == WWT_IMGBTN || type == WWT_IMGBTN_2 || type == WWT_PUSHIMGBTN; 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_x = 0; // Biggest child
this->smallest_y = 0; // Biggest child this->smallest_y = 0; // Biggest child
@ -1365,7 +1365,7 @@ public:
_toolbar_width = nbuttons * this->smallest_x; _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); 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. */ /* 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); 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; 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 */ /** Container for the 'normal' main toolbar */
class NWidgetMainToolbarContainer : public NWidgetToolbarContainer { 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 SMALLEST_ARRANGEMENT = 14;
static const uint BIGGEST_ARRANGEMENT = 20; static const uint BIGGEST_ARRANGEMENT = 20;
@ -1793,7 +1793,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer { class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer {
uint panel_widths[2]; ///< The width of the two panels (the text panel and date panel) 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); 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[] = { static const byte arrange_all[] = {
WID_TE_PAUSE, WID_TE_PAUSE,

View File

@ -17,30 +17,30 @@
/** The allegro video driver. */ /** The allegro video driver. */
class VideoDriver_Allegro : public VideoDriver { class VideoDriver_Allegro : public VideoDriver {
public: 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. */ /** Factory for the allegro video driver. */
class FVideoDriver_Allegro : public DriverFactoryBase { class FVideoDriver_Allegro : public DriverFactoryBase {
public: public:
FVideoDriver_Allegro() : DriverFactoryBase(Driver::DT_VIDEO, 4, "allegro", "Allegro Video Driver") {} 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 */ #endif /* VIDEO_ALLEGRO_H */

View File

@ -16,10 +16,10 @@
class VideoDriver_Cocoa : public VideoDriver { class VideoDriver_Cocoa : public VideoDriver {
public: public:
/* virtual */ const char *Start(const char * const *param); const char *Start(const char * const *param) override;
/** Stop the video driver */ /** Stop the video driver */
/* virtual */ void Stop(); void Stop() override;
/** Mark dirty a screen region /** Mark dirty a screen region
* @param left x-coordinate of left border * @param left x-coordinate of left border
@ -27,44 +27,44 @@ public:
* @param width width or dirty rectangle * @param width width or dirty rectangle
* @param height height of 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 */ /** Programme main loop */
/* virtual */ void MainLoop(); void MainLoop() override;
/** Change window resolution /** Change window resolution
* @param w New window width * @param w New window width
* @param h New window height * @param h New window height
* @return Whether change was successful * @return Whether change was successful
*/ */
/* virtual */ bool ChangeResolution(int w, int h); bool ChangeResolution(int w, int h) override;
/** Set a new window mode /** Set a new window mode
* @param fullscreen Whether to set fullscreen mode or not * @param fullscreen Whether to set fullscreen mode or not
* @return Whether changing the screen mode was successful * @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. /** Callback invoked after the blitter was changed.
* @return True if no error. * @return True if no error.
*/ */
/* virtual */ bool AfterBlitterChange(); bool AfterBlitterChange() override;
/** /**
* An edit box lost the input focus. Abort character compositing if necessary. * An edit box lost the input focus. Abort character compositing if necessary.
*/ */
/* virtual */ void EditBoxLostFocus(); void EditBoxLostFocus() override;
/** Return driver name /** Return driver name
* @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 { class FVideoDriver_Cocoa : public DriverFactoryBase {
public: public:
FVideoDriver_Cocoa() : DriverFactoryBase(Driver::DT_VIDEO, 10, "cocoa", "Cocoa Video Driver") {} 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(); }
}; };

View File

@ -17,19 +17,19 @@
/** The dedicated server video driver. */ /** The dedicated server video driver. */
class VideoDriver_Dedicated : public VideoDriver { class VideoDriver_Dedicated : public VideoDriver {
public: 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 */ const char *GetName() const { return "dedicated"; } const char *GetName() const override { return "dedicated"; }
/* virtual */ bool HasGUI() const { return false; } bool HasGUI() const override { return false; }
}; };
/** Factory for the dedicated server video driver. */ /** Factory for the dedicated server video driver. */
@ -43,7 +43,7 @@ public:
static const int PRIORITY = 0; static const int PRIORITY = 0;
#endif #endif
FVideoDriver_Dedicated() : DriverFactoryBase(Driver::DT_VIDEO, PRIORITY, "dedicated", "Dedicated Video Driver") {} 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 */ #endif /* VIDEO_DEDICATED_H */

View File

@ -20,26 +20,26 @@ private:
uint ticks; ///< Amount of ticks to run. uint ticks; ///< Amount of ticks to run.
public: 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 */ const char *GetName() const { return "null"; } const char *GetName() const override { return "null"; }
/* virtual */ bool HasGUI() const { return false; } bool HasGUI() const override { return false; }
}; };
/** Factory the null video driver. */ /** Factory the null video driver. */
class FVideoDriver_Null : public DriverFactoryBase { class FVideoDriver_Null : public DriverFactoryBase {
public: public:
FVideoDriver_Null() : DriverFactoryBase(Driver::DT_VIDEO, 0, "null", "Null Video Driver") {} 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 */ #endif /* VIDEO_NULL_H */

View File

@ -17,27 +17,27 @@
/** The SDL video driver. */ /** The SDL video driver. */
class VideoDriver_SDL : public VideoDriver { class VideoDriver_SDL : public VideoDriver {
public: 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: private:
int PollEvent(); int PollEvent();
bool CreateMainSurface(uint w, uint h); bool CreateMainSurface(uint w, uint h);
@ -48,7 +48,7 @@ private:
class FVideoDriver_SDL : public DriverFactoryBase { class FVideoDriver_SDL : public DriverFactoryBase {
public: public:
FVideoDriver_SDL() : DriverFactoryBase(Driver::DT_VIDEO, 5, "sdl", "SDL Video Driver") {} 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 */ #endif /* VIDEO_SDL_H */

View File

@ -17,29 +17,29 @@
/** The video driver for windows. */ /** The video driver for windows. */
class VideoDriver_Win32 : public VideoDriver { class VideoDriver_Win32 : public VideoDriver {
public: 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); bool MakeWindow(bool full_screen);
}; };
@ -48,7 +48,7 @@ public:
class FVideoDriver_Win32 : public DriverFactoryBase { class FVideoDriver_Win32 : public DriverFactoryBase {
public: public:
FVideoDriver_Win32() : DriverFactoryBase(Driver::DT_VIDEO, 10, "win32", "Win32 GDI Video Driver") {} 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 */ #endif /* VIDEO_WIN32_H */

View File

@ -25,23 +25,23 @@ struct Waypoint FINAL : SpecializedStation<Waypoint, true> {
Waypoint(TileIndex tile = INVALID_TILE) : SpecializedStation<Waypoint, true>(tile) { } Waypoint(TileIndex tile = INVALID_TILE) : SpecializedStation<Waypoint, true>(tile) { }
~Waypoint(); ~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; 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; return 1;
} }
/* virtual */ uint GetPlatformLength(TileIndex tile) const uint GetPlatformLength(TileIndex tile) const override
{ {
return 1; return 1;
} }

View File

@ -293,11 +293,11 @@ public:
inline void SetDisabled(bool disabled); inline void SetDisabled(bool disabled);
inline bool IsDisabled() const; inline bool IsDisabled() const;
/* virtual */ void FillNestedArray(NWidgetBase **array, uint length); void FillNestedArray(NWidgetBase **array, uint length) override;
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); NWidgetCore *GetWidgetFromPos(int x, int y) override;
/* virtual */ bool IsHighlighted() const; bool IsHighlighted() const override;
/* virtual */ TextColour GetHighlightColour() const; TextColour GetHighlightColour() const override;
/* virtual */ void SetHighlighted(TextColour highlight_colour); void SetHighlighted(TextColour highlight_colour) override;
NWidgetDisplay disp_flags; ///< Flags that affect display and interaction with the widget. NWidgetDisplay disp_flags; ///< Flags that affect display and interaction with the widget.
Colours colour; ///< Colour of this widget. Colours colour; ///< Colour of this widget.
@ -371,12 +371,12 @@ public:
~NWidgetContainer(); ~NWidgetContainer();
void Add(NWidgetBase *wid); void Add(NWidgetBase *wid);
/* virtual */ void FillNestedArray(NWidgetBase **array, uint length); void FillNestedArray(NWidgetBase **array, uint length) override;
/** Return whether the container is empty. */ /** Return whether the container is empty. */
inline bool IsEmpty() { return head == NULL; } inline bool IsEmpty() { return head == NULL; }
/* virtual */ NWidgetBase *GetWidgetOfType(WidgetType tp); NWidgetBase *GetWidgetOfType(WidgetType tp) override;
protected: protected:
NWidgetBase *head; ///< Pointer to first widget in container. NWidgetBase *head; ///< Pointer to first widget in container.
@ -408,12 +408,12 @@ public:
void SetIndex(int index); void SetIndex(int index);
void SetupSmallestSize(Window *w, bool init_array); void SetupSmallestSize(Window *w, bool init_array) override;
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;
/* virtual */ void FillNestedArray(NWidgetBase **array, uint length); void FillNestedArray(NWidgetBase **array, uint length) override;
/* virtual */ void Draw(const Window *w); void Draw(const Window *w) override;
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); NWidgetCore *GetWidgetFromPos(int x, int y) override;
void SetDisplayedPlane(int plane); void SetDisplayedPlane(int plane);
@ -437,8 +437,8 @@ public:
void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post); void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
/* virtual */ void Draw(const Window *w); void Draw(const Window *w) override;
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); NWidgetCore *GetWidgetFromPos(int x, int y) override;
protected: protected:
NWidContainerFlags flags; ///< Flags of the container. NWidContainerFlags flags; ///< Flags of the container.
@ -500,12 +500,12 @@ public:
void SetCount(int count); void SetCount(int count);
void SetScrollbar(Scrollbar *sb); void SetScrollbar(Scrollbar *sb);
void SetupSmallestSize(Window *w, bool init_array); void SetupSmallestSize(Window *w, bool init_array) override;
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;
/* virtual */ void FillNestedArray(NWidgetBase **array, uint length); void FillNestedArray(NWidgetBase **array, uint length) override;
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); NWidgetCore *GetWidgetFromPos(int x, int y) override;
/* virtual */ void Draw(const Window *w); void Draw(const Window *w) override;
protected: protected:
int index; ///< If non-negative, index in the #Window::nested_array. int index; ///< If non-negative, index in the #Window::nested_array.
Colours colour; ///< Colour of this widget. Colours colour; ///< Colour of this widget.
@ -530,12 +530,12 @@ class NWidgetSpacer : public NWidgetResizeBase {
public: public:
NWidgetSpacer(int length, int height); NWidgetSpacer(int length, int height);
void SetupSmallestSize(Window *w, bool init_array); void SetupSmallestSize(Window *w, bool init_array) override;
/* virtual */ void FillNestedArray(NWidgetBase **array, uint length); void FillNestedArray(NWidgetBase **array, uint length) override;
/* virtual */ void Draw(const Window *w); void Draw(const Window *w) override;
/* virtual */ void SetDirty(const Window *w) const; void SetDirty(const Window *w) const override;
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); NWidgetCore *GetWidgetFromPos(int x, int y) override;
}; };
/** /**
@ -550,14 +550,14 @@ public:
void Add(NWidgetBase *nwid); void Add(NWidgetBase *nwid);
void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post); void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
void SetupSmallestSize(Window *w, bool init_array); void SetupSmallestSize(Window *w, bool init_array) override;
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;
/* virtual */ void FillNestedArray(NWidgetBase **array, uint length); void FillNestedArray(NWidgetBase **array, uint length) override;
/* virtual */ void Draw(const Window *w); void Draw(const Window *w) override;
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y); NWidgetCore *GetWidgetFromPos(int x, int y) override;
/* virtual */ NWidgetBase *GetWidgetOfType(WidgetType tp); NWidgetBase *GetWidgetOfType(WidgetType tp) override;
private: private:
NWidgetPIPContainer *child; ///< Child widget. NWidgetPIPContainer *child; ///< Child widget.
@ -576,8 +576,8 @@ class NWidgetViewport : public NWidgetCore {
public: public:
NWidgetViewport(int index); NWidgetViewport(int index);
/* virtual */ void SetupSmallestSize(Window *w, bool init_array); void SetupSmallestSize(Window *w, bool init_array) override;
/* virtual */ void Draw(const Window *w); void Draw(const Window *w) override;
void InitializeViewport(Window *w, uint32 follow_flags, ZoomLevel zoom); void InitializeViewport(Window *w, uint32 follow_flags, ZoomLevel zoom);
void UpdateViewportCoordinates(Window *w); void UpdateViewportCoordinates(Window *w);
@ -751,8 +751,8 @@ class NWidgetScrollbar : public NWidgetCore, public Scrollbar {
public: public:
NWidgetScrollbar(WidgetType tp, Colours colour, int index); NWidgetScrollbar(WidgetType tp, Colours colour, int index);
/* virtual */ void SetupSmallestSize(Window *w, bool init_array); void SetupSmallestSize(Window *w, bool init_array) override;
/* virtual */ void Draw(const Window *w); void Draw(const Window *w) override;
static void InvalidateDimensionCache(); static void InvalidateDimensionCache();
static Dimension GetVerticalDimension(); static Dimension GetVerticalDimension();
@ -771,8 +771,8 @@ class NWidgetLeaf : public NWidgetCore {
public: public:
NWidgetLeaf(WidgetType tp, Colours colour, int index, uint32 data, StringID tip); NWidgetLeaf(WidgetType tp, Colours colour, int index, uint32 data, StringID tip);
/* virtual */ void SetupSmallestSize(Window *w, bool init_array); void SetupSmallestSize(Window *w, bool init_array) override;
/* virtual */ void Draw(const Window *w); void Draw(const Window *w) override;
bool ButtonHit(const Point &pt); bool ButtonHit(const Point &pt);