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/82/head
Henry Wilson 5 years ago committed by Michael Lutz
parent 31260e6625
commit af7d9020a1

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

@ -646,7 +646,7 @@ struct ScriptTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR);
}
/* virtual */ void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, (slot == OWNER_DEITY) ? STR_CONTENT_TYPE_GAME_SCRIPT : STR_CONTENT_TYPE_AI);

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

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

@ -176,7 +176,7 @@ protected:
static Tbase_set *duplicate_sets; ///< All sets that aren't available, but needed for not downloading base sets when a newer version than the one on BaNaNaS is loaded.
static const Tbase_set *used_set; ///< The currently used set
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
/**
* Get the extension that is used to identify this set.

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

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

@ -35,19 +35,19 @@ private:
public:
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent, bool animated>
/* virtual */ void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) {
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override {
return Blitter_32bppSSE_Base::Encode(sprite, allocator);
}
/* virtual */ const char *GetName() { return "32bpp-sse4-anim"; }
const char *GetName() override { return "32bpp-sse4-anim"; }
};
/** Factory for the SSE4 32 bpp blitter (with palette animation). */
class FBlitter_32bppSSE4_Anim: public BlitterFactory {
public:
FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4_Anim(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSE4_Anim(); }
};
#endif /* WITH_SSE */

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

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

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

@ -82,22 +82,22 @@ DECLARE_ENUM_AS_BIT_SET(Blitter_32bppSSE_Base::SpriteFlags);
/** The SSE2 32 bpp blitter (without palette animation). */
class Blitter_32bppSSE2 : public Blitter_32bppSimple, public Blitter_32bppSSE_Base {
public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) {
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override {
return Blitter_32bppSSE_Base::Encode(sprite, allocator);
}
/* virtual */ const char *GetName() { return "32bpp-sse2"; }
const char *GetName() override { return "32bpp-sse2"; }
};
/** Factory for the SSE2 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSE2 : public BlitterFactory {
public:
FBlitter_32bppSSE2() : BlitterFactory("32bpp-sse2", "32bpp SSE2 Blitter (no palette animation)", HasCPUIDFlag(1, 3, 26)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE2(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSE2(); }
};
#endif /* WITH_SSE */

@ -27,17 +27,17 @@
/** The SSE4 32 bpp blitter (without palette animation). */
class Blitter_32bppSSE4 : public Blitter_32bppSSSE3 {
public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ const char *GetName() { return "32bpp-sse4"; }
const char *GetName() override { return "32bpp-sse4"; }
};
/** Factory for the SSE4 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSE4: public BlitterFactory {
public:
FBlitter_32bppSSE4() : BlitterFactory("32bpp-sse4", "32bpp SSE4 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 19)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSE4(); }
};
#endif /* WITH_SSE */

@ -27,17 +27,17 @@
/** The SSSE3 32 bpp blitter (without palette animation). */
class Blitter_32bppSSSE3 : public Blitter_32bppSSE2 {
public:
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last, bool translucent>
void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
/* virtual */ const char *GetName() { return "32bpp-ssse3"; }
const char *GetName() override { return "32bpp-ssse3"; }
};
/** Factory for the SSSE3 32 bpp blitter (without palette animation). */
class FBlitter_32bppSSSE3: public BlitterFactory {
public:
FBlitter_32bppSSSE3() : BlitterFactory("32bpp-ssse3", "32bpp SSSE3 Blitter (no palette animation)", HasCPUIDFlag(1, 2, 9)) {}
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSSE3(); }
Blitter *CreateInstance() override { return new Blitter_32bppSSSE3(); }
};
#endif /* WITH_SSE */

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

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

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

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

@ -107,7 +107,7 @@ public:
ALL = BASESET | NEWGRF | AI | SCENARIO | GAME, ///< Scan for everything.
};
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename = NULL);
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename = NULL) override;
bool AddFile(Subdirectory sd, const char *filename);

@ -276,7 +276,7 @@ public:
fop(fop), callback_proc(callback_proc), file_list(file_list)
{}
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
};
/**
@ -673,7 +673,7 @@ public:
this->scanned = true;
}
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename)
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override
{
FILE *f = FioFOpenFile(filename, "r", SCENARIO_DIR);
if (f == NULL) return false;

@ -42,7 +42,7 @@ public:
bool ResetInfo(bool force_exact_match);
protected:
/* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match);
ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match) override;
};
#endif /* GAME_CONFIG_HPP */

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

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

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

@ -151,7 +151,7 @@ struct StringListReader : StringReader {
{
}
/* virtual */ char *ReadLine(char *buffer, const char *last)
char *ReadLine(char *buffer, const char *last) override
{
if (this->p == this->end) return NULL;
@ -242,7 +242,7 @@ public:
this->FileScanner::Scan(".txt", directory, false);
}
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename)
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override
{
if (strcmp(filename, exclude) == 0) return true;

@ -50,7 +50,7 @@ struct GoalListWindow : public Window {
this->OnInvalidateData(0);
}
/* virtual */ void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
if (widget != WID_GOAL_CAPTION) return;
@ -62,7 +62,7 @@ struct GoalListWindow : public Window {
}
}
/* virtual */ void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
if (widget != WID_GOAL_LIST) return;
@ -177,7 +177,7 @@ struct GoalListWindow : public Window {
return 3 + num_global + num_company;
}
/* virtual */ void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
if (widget != WID_GOAL_LIST) return;
Dimension d = maxdim(GetStringBoundingBox(STR_GOALS_GLOBAL_TITLE), GetStringBoundingBox(STR_GOALS_COMPANY_TITLE));
@ -272,7 +272,7 @@ struct GoalListWindow : public Window {
DrawPartialGoalList(pos, cap, x, y, right, progress_col_width, false, column);
}
/* virtual */ void OnPaint()
void OnPaint() override
{
this->DrawWidgets();
@ -299,7 +299,7 @@ struct GoalListWindow : public Window {
}
/* virtual */ void OnResize()
void OnResize() override
{
this->vscroll->SetCapacityFromWidget(this, WID_GOAL_LIST);
}
@ -309,7 +309,7 @@ struct GoalListWindow : public Window {
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
/* virtual */ void OnInvalidateData(int data = 0, bool gui_scope = true)
void OnInvalidateData(int data = 0, bool gui_scope = true) override
{
if (!gui_scope) return;
this->vscroll->SetCount(this->CountLines());
@ -388,7 +388,7 @@ struct GoalQuestionWindow : public Window {
free(this->question);
}
/* virtual */ void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
switch (widget) {
case WID_GQ_CAPTION:
@ -409,7 +409,7 @@ struct GoalQuestionWindow : public Window {
}
}
/* virtual */ void OnClick(Point pt, int widget, int click_count)
void OnClick(Point pt, int widget, int click_count) override
{
switch (widget) {
case WID_GQ_BUTTON_1:
@ -429,7 +429,7 @@ struct GoalQuestionWindow : public Window {
}
}
/* virtual */ void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
if (widget != WID_GQ_QUESTION) return;
@ -437,7 +437,7 @@ struct GoalQuestionWindow : public Window {
size->height = GetStringHeight(STR_JUST_RAW_STRING, size->width) + WD_PAR_VSEP_WIDE;
}
/* virtual */ void DrawWidget(const Rect &r, int widget) const
void DrawWidget(const Rect &r, int widget) const override
{
if (widget != WID_GQ_QUESTION) return;

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

@ -17,18 +17,18 @@
/** Allegro's music player. */
class MusicDriver_Allegro : public MusicDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "allegro"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "allegro"; }
};
/** Factory for allegro's music player. */
@ -43,7 +43,7 @@ public:
static const int PRIORITY = 2;
#endif
FMusicDriver_Allegro() : DriverFactoryBase(Driver::DT_MUSIC, PRIORITY, "allegro", "Allegro MIDI Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_Allegro(); }
Driver *CreateInstance() const override { return new MusicDriver_Allegro(); }
};
#endif /* MUSIC_ALLEGRO_H */

@ -17,25 +17,25 @@
/** The midi player for BeOS. */
class MusicDriver_BeMidi : public MusicDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "bemidi"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "bemidi"; }
};
/** Factory for the BeOS midi player. */
class FMusicDriver_BeMidi : public DriverFactoryBase {
public:
FMusicDriver_BeMidi() : DriverFactoryBase(Driver::DT_MUSIC, 10, "bemidi", "BeOS MIDI Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_BeMidi(); }
Driver *CreateInstance() const override { return new MusicDriver_BeMidi(); }
};
#endif /* MUSIC_BEMIDI_H */

@ -16,24 +16,24 @@
class MusicDriver_Cocoa : public MusicDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "cocoa"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "cocoa"; }
};
class FMusicDriver_Cocoa : public DriverFactoryBase {
public:
FMusicDriver_Cocoa() : DriverFactoryBase(Driver::DT_MUSIC, 10, "cocoa", "Cocoa MIDI Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_Cocoa(); }
Driver *CreateInstance() const override { return new MusicDriver_Cocoa(); }
};
#endif /* MUSIC_MACOSX_COCOA_H */

@ -19,25 +19,25 @@ class MusicDriver_DMusic : public MusicDriver {
public:
virtual ~MusicDriver_DMusic();
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "dmusic"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "dmusic"; }
};
/** Factory for the DirectX music player. */
class FMusicDriver_DMusic : public DriverFactoryBase {
public:
FMusicDriver_DMusic() : DriverFactoryBase(Driver::DT_MUSIC, 10, "dmusic", "DirectMusic MIDI Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_DMusic(); }
Driver *CreateInstance() const override { return new MusicDriver_DMusic(); }
};
#endif /* MUSIC_DMUSIC_H */

@ -24,24 +24,24 @@ private:
void DoStop();
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "extmidi"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "extmidi"; }
};
class FMusicDriver_ExtMidi : public DriverFactoryBase {
public:
FMusicDriver_ExtMidi() : DriverFactoryBase(Driver::DT_MUSIC, 3, "extmidi", "External MIDI Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_ExtMidi(); }
Driver *CreateInstance() const override { return new MusicDriver_ExtMidi(); }
};
#endif /* MUSIC_EXTERNAL_H */

@ -17,25 +17,25 @@
/** Music driver making use of FluidSynth. */
class MusicDriver_FluidSynth : public MusicDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "fluidsynth"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "fluidsynth"; }
};
/** Factory for the fluidsynth driver. */
class FMusicDriver_FluidSynth : public DriverFactoryBase {
public:
FMusicDriver_FluidSynth() : DriverFactoryBase(Driver::DT_MUSIC, 5, "fluidsynth", "FluidSynth MIDI Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_FluidSynth(); }
Driver *CreateInstance() const override { return new MusicDriver_FluidSynth(); }
};
#endif /* MUSIC_FLUIDSYNTH_H */

@ -17,25 +17,25 @@
/** The music player that does nothing. */
class MusicDriver_Null : public MusicDriver {
public:
/* virtual */ const char *Start(const char * const *param) { return NULL; }
const char *Start(const char * const *param) override { return NULL; }
/* virtual */ void Stop() { }
void Stop() override { }
/* virtual */ void PlaySong(const MusicSongInfo &song) { }
void PlaySong(const MusicSongInfo &song) override { }
/* virtual */ void StopSong() { }
void StopSong() override { }
/* virtual */ bool IsSongPlaying() { return true; }
bool IsSongPlaying() override { return true; }
/* virtual */ void SetVolume(byte vol) { }
/* virtual */ const char *GetName() const { return "null"; }
void SetVolume(byte vol) override { }
const char *GetName() const override { return "null"; }
};
/** Factory for the null music player. */
class FMusicDriver_Null : public DriverFactoryBase {
public:
FMusicDriver_Null() : DriverFactoryBase(Driver::DT_MUSIC, 1, "null", "Null Music Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_Null(); }
Driver *CreateInstance() const override { return new MusicDriver_Null(); }
};
#endif /* MUSIC_NULL_H */

@ -17,25 +17,25 @@
/** OS/2's music player. */
class MusicDriver_OS2 : public MusicDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "os2"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "os2"; }
};
/** Factory for OS/2's music player. */
class FMusicDriver_OS2 : public DriverFactoryBase {
public:
FMusicDriver_OS2() : DriverFactoryBase(Driver::DT_MUSIC, 10, "os2", "OS/2 Music Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_OS2(); }
Driver *CreateInstance() const override { return new MusicDriver_OS2(); }
};
#endif /* MUSIC_OS2_H */

@ -16,24 +16,24 @@
class MusicDriver_QtMidi : public MusicDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "qt"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "qt"; }
};
class FMusicDriver_QtMidi : public DriverFactoryBase {
public:
FMusicDriver_QtMidi() : DriverFactoryBase(Driver::DT_MUSIC, 5, "qt", "QuickTime MIDI Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_QtMidi(); }
Driver *CreateInstance() const override { return new MusicDriver_QtMidi(); }
};
#endif /* MUSIC_MACOSX_QUICKTIME_H */

@ -17,25 +17,25 @@
/** The Windows music player. */
class MusicDriver_Win32 : public MusicDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void PlaySong(const MusicSongInfo &song);
void PlaySong(const MusicSongInfo &song) override;
/* virtual */ void StopSong();
void StopSong() override;
/* virtual */ bool IsSongPlaying();
bool IsSongPlaying() override;
/* virtual */ void SetVolume(byte vol);
/* virtual */ const char *GetName() const { return "win32"; }
void SetVolume(byte vol) override;
const char *GetName() const override { return "win32"; }
};
/** Factory for Windows' music player. */
class FMusicDriver_Win32 : public DriverFactoryBase {
public:
FMusicDriver_Win32() : DriverFactoryBase(Driver::DT_MUSIC, 5, "win32", "Win32 Music Driver") {}
/* virtual */ Driver *CreateInstance() const { return new MusicDriver_Win32(); }
Driver *CreateInstance() const override { return new MusicDriver_Win32(); }
};
#endif /* MUSIC_WIN32_H */

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

@ -64,7 +64,7 @@ struct ContentTextfileWindow : public TextfileWindow {
}
}
/* virtual */ void SetStringParameters(int widget) const
void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, this->GetTypeString());

@ -117,7 +117,7 @@ public:
*lastof(this->visible) = true;
}
void SetupSmallestSize(Window *w, bool init_array)
void SetupSmallestSize(Window *w, bool init_array) override
{
/* Oh yeah, we ought to be findable! */
w->nested_array[WID_NG_HEADER] = this;
@ -143,7 +143,7 @@ public:
this->smallest_x = this->head->smallest_x + this->tail->smallest_x; // First and last are always shown, rest not
}
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl)
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override
{
assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
@ -183,7 +183,7 @@ public:
}
}
/* virtual */ void Draw(const Window *w)
void Draw(const Window *w) override
{
int i = 0;
for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
@ -193,7 +193,7 @@ public:
}
}
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y)
NWidgetCore *GetWidgetFromPos(int x, int y) override
{
if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL;

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

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

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

@ -30,8 +30,8 @@ struct CanalScopeResolver : public ScopeResolver {
{
}
/* virtual */ uint32 GetRandomBits() const;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
uint32 GetRandomBits() const override;
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
};
/** Resolver object for canals. */
@ -41,7 +41,7 @@ struct CanalResolverObject : public ResolverObject {
CanalResolverObject(CanalFeature feature, TileIndex tile,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->canal_scope;
@ -49,7 +49,7 @@ struct CanalResolverObject : public ResolverObject {
}
}
/* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
/* virtual */ uint32 CanalScopeResolver::GetRandomBits() const

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

@ -633,7 +633,7 @@ public:
{
}
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
/** Do the scan for GRFs. */
static uint DoScan()

@ -40,9 +40,9 @@ struct VehicleScopeResolver : public ScopeResolver {
void SetVehicle(const Vehicle *v) { this->v = v; }
/* virtual */ uint32 GetRandomBits() const;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
/* virtual */ uint32 GetTriggers() const;
uint32 GetRandomBits() const override;
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
uint32 GetTriggers() const override;
};
/** Resolver for a vehicle (chain) */
@ -64,9 +64,9 @@ struct VehicleResolverObject : public ResolverObject {
VehicleResolverObject(EngineID engine_type, const Vehicle *v, WagonOverride wagon_override, bool info_view = false,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0);
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override;
/* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
static const uint TRAININFO_DEFAULT_VEHICLE_WIDTH = 29;

@ -42,7 +42,7 @@ struct GenericScopeResolver : public ScopeResolver {
{
}
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
private:
bool ai_callback; ///< Callback comes from the AI.
@ -55,7 +55,7 @@ struct GenericResolverObject : public ResolverObject {
GenericResolverObject(bool ai_callback, CallbackID callback = CBID_NO_CALLBACK);
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->generic_scope;
@ -63,7 +63,7 @@ struct GenericResolverObject : public ResolverObject {
}
}
/* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
struct GenericCallback {

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

@ -44,9 +44,9 @@ struct HouseScopeResolver : public ScopeResolver {
{
}
/* virtual */ uint32 GetRandomBits() const;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
/* virtual */ uint32 GetTriggers() const;
uint32 GetRandomBits() const override;
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
uint32 GetTriggers() const override;
};
/** Resolver object to be used for houses (feature 07 spritegroups). */
@ -58,7 +58,7 @@ struct HouseResolverObject : public ResolverObject {
CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0,
bool not_yet_constructed = false, uint8 initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0);
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->house_scope;

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

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

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

@ -32,8 +32,8 @@ struct RailTypeScopeResolver : public ScopeResolver {
{
}
/* virtual */ uint32 GetRandomBits() const;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
uint32 GetRandomBits() const override;
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
};
/** Resolver object for rail types. */
@ -42,7 +42,7 @@ struct RailTypeResolverObject : public ResolverObject {
RailTypeResolverObject(const RailtypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1 = 0, uint32 param2 = 0);
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &this->railtype_scope;
@ -50,7 +50,7 @@ struct RailTypeResolverObject : public ResolverObject {
}
}
/* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context = TCX_NORMAL, uint *num_results = NULL);

@ -42,10 +42,10 @@ struct StationScopeResolver : public ScopeResolver {
{
}
/* virtual */ uint32 GetRandomBits() const;
/* virtual */ uint32 GetTriggers() const;
uint32 GetRandomBits() const override;
uint32 GetTriggers() const override;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override;
};
/** Station resolver. */
@ -59,7 +59,7 @@ struct StationResolverObject : public ResolverObject {
TownScopeResolver *GetTown();
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF:
@ -76,7 +76,7 @@ struct StationResolverObject : public ResolverObject {
}
}
/* virtual */ const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const override;
};
enum StationClassID {

@ -46,7 +46,7 @@ struct TownResolverObject : public ResolverObject {
TownResolverObject(const struct GRFFile *grffile, Town *t, bool readonly);
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0) override
{
switch (scope) {
case VSG_SCOPE_SELF: return &town_scope;

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

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

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

@ -1844,7 +1844,7 @@ struct FileReader : LoadFilter {
_sl.sf = NULL;
}
/* virtual */ size_t Read(byte *buf, size_t size)
size_t Read(byte *buf, size_t size) override
{
/* We're in the process of shutting down, i.e. in "failure" mode. */
if (this->file == NULL) return 0;
@ -1852,7 +1852,7 @@ struct FileReader : LoadFilter {
return fread(buf, 1, size, this->file);
}
/* virtual */ void Reset()
void Reset() override
{
clearerr(this->file);
if (fseek(this->file, this->begin, SEEK_SET)) {
@ -1882,7 +1882,7 @@ struct FileWriter : SaveFilter {
_sl.sf = NULL;
}
/* virtual */ void Write(byte *buf, size_t size)
void Write(byte *buf, size_t size) override
{
/* We're in the process of shutting down, i.e. in "failure" mode. */
if (this->file == NULL) return;
@ -1890,7 +1890,7 @@ struct FileWriter : SaveFilter {
if (fwrite(buf, 1, size, this->file) != size) SlError(STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE);
}
/* virtual */ void Finish()
void Finish() override
{
if (this->file != NULL) fclose(this->file);
this->file = NULL;
@ -1918,7 +1918,7 @@ struct LZOLoadFilter : LoadFilter {
if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize decompressor");
}
/* virtual */ size_t Read(byte *buf, size_t ssize)
size_t Read(byte *buf, size_t ssize) override
{
assert(ssize >= LZO_BUFFER_SIZE);
@ -1966,7 +1966,7 @@ struct LZOSaveFilter : SaveFilter {
if (lzo_init() != LZO_E_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "cannot initialize compressor");
}
/* virtual */ void Write(byte *buf, size_t size)
void Write(byte *buf, size_t size) override
{
const lzo_bytep in = buf;
/* Buffer size is from the LZO docs plus the chunk header size. */
@ -2005,7 +2005,7 @@ struct NoCompLoadFilter : LoadFilter {
{
}
/* virtual */ size_t Read(byte *buf, size_t size)
size_t Read(byte *buf, size_t size) override
{
return this->chain->Read(buf, size);
}
@ -2022,7 +2022,7 @@ struct NoCompSaveFilter : SaveFilter {
{
}
/* virtual */ void Write(byte *buf, size_t size)
void Write(byte *buf, size_t size) override
{
this->chain->Write(buf, size);
}
@ -2056,7 +2056,7 @@ struct ZlibLoadFilter : LoadFilter {
inflateEnd(&this->z);
}
/* virtual */ size_t Read(byte *buf, size_t size)
size_t Read(byte *buf, size_t size) override
{
this->z.next_out = buf;
this->z.avail_out = (uint)size;
@ -2135,12 +2135,12 @@ struct ZlibSaveFilter : SaveFilter {
} while (this->z.avail_in || !this->z.avail_out);
}
/* virtual */ void Write(byte *buf, size_t size)
void Write(byte *buf, size_t size) override
{
this->WriteLoop(buf, size, 0);
}
/* virtual */ void Finish()
void Finish() override
{
this->WriteLoop(NULL, 0, Z_FINISH);
this->chain->Finish();
@ -2185,7 +2185,7 @@ struct LZMALoadFilter : LoadFilter {
lzma_end(&this->lzma);
}
/* virtual */ size_t Read(byte *buf, size_t size)
size_t Read(byte *buf, size_t size) override
{
this->lzma.next_out = buf;
this->lzma.avail_out = size;
@ -2254,12 +2254,12 @@ struct LZMASaveFilter : SaveFilter {
} while (this->lzma.avail_in || !this->lzma.avail_out);
}
/* virtual */ void Write(byte *buf, size_t size)
void Write(byte *buf, size_t size) override
{
this->WriteLoop(buf, size, LZMA_RUN);
}
/* virtual */ void Finish()
void Finish() override
{
this->WriteLoop(NULL, 0, LZMA_FINISH);
this->chain->Finish();

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

@ -77,7 +77,7 @@ public:
*/
const char *FindMainScript(const ContentInfo *ci, bool md5sum);
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
/**
* Rescan the script dir.

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

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

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

@ -17,17 +17,17 @@
/** Implementation of the null sound driver. */
class SoundDriver_Null : public SoundDriver {
public:
/* virtual */ const char *Start(const char * const *param) { return NULL; }
const char *Start(const char * const *param) override { return NULL; }
/* virtual */ void Stop() { }
/* virtual */ const char *GetName() const { return "null"; }
void Stop() override { }
const char *GetName() const override { return "null"; }
};
/** Factory for the null sound driver. */
class FSoundDriver_Null : public DriverFactoryBase {
public:
FSoundDriver_Null() : DriverFactoryBase(Driver::DT_SOUND, 1, "null", "Null Sound Driver") {}
/* virtual */ Driver *CreateInstance() const { return new SoundDriver_Null(); }
Driver *CreateInstance() const override { return new SoundDriver_Null(); }
};
#endif /* SOUND_NULL_H */

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

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

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

@ -490,12 +490,12 @@ public:
void MarkTilesDirty(bool cargo_change) const;
void UpdateVirtCoord();
void UpdateVirtCoord() override;
void AfterStationTileSetChange(bool adding, StationType type);
/* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const;
/* virtual */ uint GetPlatformLength(TileIndex tile) const;
uint GetPlatformLength(TileIndex tile, DiagDirection dir) const override;
uint GetPlatformLength(TileIndex tile) const override;
void RecomputeCatchment();
static void RecomputeCatchmentForAll();
@ -509,7 +509,7 @@ public:
return this->catchment_tiles.HasTile(tile);
}
/* virtual */ inline bool TileBelongsToRailStation(TileIndex tile) const
inline bool TileBelongsToRailStation(TileIndex tile) const override
{
return IsRailStationTile(tile) && GetStationIndex(tile) == this->index;
}
@ -519,9 +519,9 @@ public:
return IsAirportTile(tile) && GetStationIndex(tile) == this->index;
}
/* virtual */ uint32 GetNewGRFVariable(const ResolverObject &object, byte variable, byte parameter, bool *available) const;
uint32 GetNewGRFVariable(const ResolverObject &object, byte variable, byte parameter, bool *available) const override;
/* virtual */ void GetTileArea(TileArea *ta, StationType type) const;
void GetTileArea(TileArea *ta, StationType type) const override;
};
#define FOR_ALL_STATIONS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Station, var)

@ -115,14 +115,14 @@ struct FileStringReader : StringReader {
fclose(this->fh);
}
/* virtual */ char *ReadLine(char *buffer, const char *last)
char *ReadLine(char *buffer, const char *last) override
{
return fgets(buffer, ClampToU16(last - buffer + 1), this->fh);
}
/* virtual */ void HandlePragma(char *str);
void HandlePragma(char *str) override;
/* virtual */ void ParseFile()
void ParseFile() override
{
this->StringReader::ParseFile();

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

@ -69,14 +69,14 @@ static const NIVariable _niv_vehicles[] = {
};
class NIHVehicle : public NIHelper {
bool IsInspectable(uint index) const { return Vehicle::Get(index)->GetGRF() != NULL; }
uint GetParent(uint index) const { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); }
const void *GetInstance(uint index)const { return Vehicle::Get(index); }
const void *GetSpec(uint index) const { return Vehicle::Get(index)->GetEngine(); }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
uint32 GetGRFID(uint index) const { return Vehicle::Get(index)->GetGRFID(); }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return Vehicle::Get(index)->GetGRF() != NULL; }
uint GetParent(uint index) const override { const Vehicle *first = Vehicle::Get(index)->First(); return GetInspectWindowNumber(GetGrfSpecFeature(first->type), first->index); }
const void *GetInstance(uint index)const override { return Vehicle::Get(index); }
const void *GetSpec(uint index) const override { return Vehicle::Get(index)->GetEngine(); }
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_VEHICLE_NAME, index); }
uint32 GetGRFID(uint index) const override { return Vehicle::Get(index)->GetGRFID(); }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
Vehicle *v = Vehicle::Get(index);
VehicleResolverObject ro(v->engine_type, v, VehicleResolverObject::WO_CACHED);
@ -132,14 +132,14 @@ static const NIVariable _niv_stations[] = {
};
class NIHStation : public NIHelper {
bool IsInspectable(uint index) const { return GetStationSpec(index) != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return GetStationSpec(index); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return GetStationSpec(index) != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return GetStationSpec(index); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetStationSpec(index)->grf_prop.grffile->grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
StationResolverObject ro(GetStationSpec(index), Station::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -197,14 +197,14 @@ static const NIVariable _niv_house[] = {
};
class NIHHouse : public NIHelper {
bool IsInspectable(uint index) const { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return HouseSpec::Get(GetHouseType(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return HouseSpec::Get(GetHouseType(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, GetTownIndex(index)); }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return HouseSpec::Get(GetHouseType(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_TOWN_NAME, GetTownIndex(index), index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? HouseSpec::Get(GetHouseType(index))->grf_prop.grffile->grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
HouseResolverObject ro(GetHouseType(index), index, Town::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -247,14 +247,14 @@ static const NIVariable _niv_industrytiles[] = {
};
class NIHIndustryTile : public NIHelper {
bool IsInspectable(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return GetIndustryTileSpec(GetIndustryGfx(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_INDUSTRIES, GetIndustryIndex(index)); }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return GetIndustryTileSpec(GetIndustryGfx(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_INDUSTRY_NAME, GetIndustryIndex(index), index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustryTileSpec(GetIndustryGfx(index))->grf_prop.grffile->grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
IndustryTileResolverObject ro(GetIndustryGfx(index), index, Industry::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -346,23 +346,23 @@ static const NIVariable _niv_industries[] = {
};
class NIHIndustry : public NIHelper {
bool IsInspectable(uint index) const { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
const void *GetInstance(uint index)const { return Industry::Get(index); }
const void *GetSpec(uint index) const { return GetIndustrySpec(Industry::Get(index)->type); }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Industry::Get(index)->town->index); }
const void *GetInstance(uint index)const override { return Industry::Get(index); }
const void *GetSpec(uint index) const override { return GetIndustrySpec(Industry::Get(index)->type); }
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_INDUSTRY_NAME, index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? GetIndustrySpec(Industry::Get(index)->type)->grf_prop.grffile->grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
Industry *i = Industry::Get(index);
IndustriesResolverObject ro(i->location.tile, i, i->type);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); }
uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); }
const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override
{
const Industry *i = (const Industry *)this->GetInstance(index);
if (i->psa == NULL) return NULL;
@ -411,14 +411,14 @@ static const NIVariable _niv_objects[] = {
};
class NIHObject : public NIHelper {
bool IsInspectable(uint index) const { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return Object::GetByTile(index); }
const void *GetSpec(uint index) const { return ObjectSpec::GetByTile(index); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const override { return Object::GetByTile(index); }
const void *GetSpec(uint index) const override { return ObjectSpec::GetByTile(index); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? ObjectSpec::GetByTile(index)->grf_prop.grffile->grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
ObjectResolverObject ro(ObjectSpec::GetByTile(index), Object::GetByTile(index), index);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -445,14 +445,14 @@ static const NIVariable _niv_railtypes[] = {
};
class NIHRailType : public NIHelper {
bool IsInspectable(uint index) const { return true; }
uint GetParent(uint index) const { return UINT32_MAX; }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return NULL; }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const { return 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return true; }
uint GetParent(uint index) const override { return UINT32_MAX; }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return NULL; }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const override { return 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
/* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
* However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
@ -481,14 +481,14 @@ static const NICallback _nic_airporttiles[] = {
};
class NIHAirportTile : public NIHelper {
bool IsInspectable(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const { return NULL; }
const void *GetSpec(uint index) const { return AirportTileSpec::Get(GetAirportGfx(index)); }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != NULL; }
uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Station::GetByTile(index)->town->index); }
const void *GetInstance(uint index)const override { return NULL; }
const void *GetSpec(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index)); }
void SetStringParameters(uint index) const override { this->SetObjectAtStringParameters(STR_STATION_NAME, GetStationIndex(index), index); }
uint32 GetGRFID(uint index) const override { return (this->IsInspectable(index)) ? AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile->grfid : 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
AirportTileResolverObject ro(AirportTileSpec::GetByTile(index), index, Station::GetByTile(index));
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
@ -519,22 +519,22 @@ static const NIVariable _niv_towns[] = {
};
class NIHTown : public NIHelper {
bool IsInspectable(uint index) const { return Town::IsValidID(index); }
uint GetParent(uint index) const { return UINT32_MAX; }
const void *GetInstance(uint index)const { return Town::Get(index); }
const void *GetSpec(uint index) const { return NULL; }
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
uint32 GetGRFID(uint index) const { return 0; }
bool PSAWithParameter() const { return true; }
uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); }
/* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
bool IsInspectable(uint index) const override { return Town::IsValidID(index); }
uint GetParent(uint index) const override { return UINT32_MAX; }
const void *GetInstance(uint index)const override { return Town::Get(index); }
const void *GetSpec(uint index) const override { return NULL; }
void SetStringParameters(uint index) const override { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
uint32 GetGRFID(uint index) const override { return 0; }
bool PSAWithParameter() const override { return true; }
uint GetPSASize(uint index, uint32 grfid) const override { return cpp_lengthof(PersistentStorage, storage); }
uint Resolve(uint index, uint var, uint param, bool *avail) const override
{
TownResolverObject ro(NULL, Town::Get(index), true);
return ro.GetScope(VSG_SCOPE_SELF)->GetVariable(var, param, avail);
}
const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
const int32 *GetPSAFirstPosition(uint index, uint32 grfid) const override
{
Town *t = Town::Get(index);

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

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

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

@ -1332,7 +1332,7 @@ public:
return type == WWT_IMGBTN || type == WWT_IMGBTN_2 || type == WWT_PUSHIMGBTN;
}
void SetupSmallestSize(Window *w, bool init_array)
void SetupSmallestSize(Window *w, bool init_array) override
{
this->smallest_x = 0; // Biggest child
this->smallest_y = 0; // Biggest child
@ -1365,7 +1365,7 @@ public:
_toolbar_width = nbuttons * this->smallest_x;
}
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl)
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) override
{
assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
@ -1428,7 +1428,7 @@ public:
}
}
/* virtual */ void Draw(const Window *w)
void Draw(const Window *w) override
{
/* Draw brown-red toolbar bg. */
GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, PC_VERY_DARK_RED);
@ -1443,7 +1443,7 @@ public:
}
}
/* virtual */ NWidgetCore *GetWidgetFromPos(int x, int y)
NWidgetCore *GetWidgetFromPos(int x, int y) override
{
if (!IsInsideBS(x, this->pos_x, this->current_x) || !IsInsideBS(y, this->pos_y, this->current_y)) return NULL;
@ -1470,7 +1470,7 @@ public:
/** Container for the 'normal' main toolbar */
class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
/* virtual */ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const
const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override
{
static const uint SMALLEST_ARRANGEMENT = 14;
static const uint BIGGEST_ARRANGEMENT = 20;
@ -1793,7 +1793,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer {
uint panel_widths[2]; ///< The width of the two panels (the text panel and date panel)
void SetupSmallestSize(Window *w, bool init_array)
void SetupSmallestSize(Window *w, bool init_array) override
{
this->NWidgetToolbarContainer::SetupSmallestSize(w, init_array);
@ -1808,7 +1808,7 @@ class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer {
}
}
/* virtual */ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const
const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override
{
static const byte arrange_all[] = {
WID_TE_PAUSE,

@ -17,30 +17,30 @@
/** The allegro video driver. */
class VideoDriver_Allegro : public VideoDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void MakeDirty(int left, int top, int width, int height);
void MakeDirty(int left, int top, int width, int height) override;
/* virtual */ void MainLoop();
void MainLoop() override;
/* virtual */ bool ChangeResolution(int w, int h);
bool ChangeResolution(int w, int h) override;
/* virtual */ bool ToggleFullscreen(bool fullscreen);
bool ToggleFullscreen(bool fullscreen) override;
/* virtual */ bool AfterBlitterChange();
bool AfterBlitterChange() override;
/* virtual */ bool ClaimMousePointer();
bool ClaimMousePointer() override;
/* virtual */ const char *GetName() const { return "allegro"; }
const char *GetName() const override { return "allegro"; }
};
/** Factory for the allegro video driver. */
class FVideoDriver_Allegro : public DriverFactoryBase {
public:
FVideoDriver_Allegro() : DriverFactoryBase(Driver::DT_VIDEO, 4, "allegro", "Allegro Video Driver") {}
/* virtual */ Driver *CreateInstance() const { return new VideoDriver_Allegro(); }
Driver *CreateInstance() const override { return new VideoDriver_Allegro(); }
};
#endif /* VIDEO_ALLEGRO_H */

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

@ -17,19 +17,19 @@
/** The dedicated server video driver. */
class VideoDriver_Dedicated : public VideoDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void MakeDirty(int left, int top, int width, int height);
void MakeDirty(int left, int top, int width, int height) override;
/* virtual */ void MainLoop();
void MainLoop() override;
/* virtual */ bool ChangeResolution(int w, int h);
bool ChangeResolution(int w, int h) override;
/* virtual */ bool ToggleFullscreen(bool fullscreen);
/* virtual */ const char *GetName() const { return "dedicated"; }
/* virtual */ bool HasGUI() const { return false; }
bool ToggleFullscreen(bool fullscreen) override;
const char *GetName() const override { return "dedicated"; }
bool HasGUI() const override { return false; }
};
/** Factory for the dedicated server video driver. */
@ -43,7 +43,7 @@ public:
static const int PRIORITY = 0;
#endif
FVideoDriver_Dedicated() : DriverFactoryBase(Driver::DT_VIDEO, PRIORITY, "dedicated", "Dedicated Video Driver") {}
/* virtual */ Driver *CreateInstance() const { return new VideoDriver_Dedicated(); }
Driver *CreateInstance() const override { return new VideoDriver_Dedicated(); }
};
#endif /* VIDEO_DEDICATED_H */

@ -20,26 +20,26 @@ private:
uint ticks; ///< Amount of ticks to run.
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void MakeDirty(int left, int top, int width, int height);
void MakeDirty(int left, int top, int width, int height) override;
/* virtual */ void MainLoop();
void MainLoop() override;
/* virtual */ bool ChangeResolution(int w, int h);
bool ChangeResolution(int w, int h) override;
/* virtual */ bool ToggleFullscreen(bool fullscreen);
/* virtual */ const char *GetName() const { return "null"; }
/* virtual */ bool HasGUI() const { return false; }
bool ToggleFullscreen(bool fullscreen) override;
const char *GetName() const override { return "null"; }
bool HasGUI() const override { return false; }
};
/** Factory the null video driver. */
class FVideoDriver_Null : public DriverFactoryBase {
public:
FVideoDriver_Null() : DriverFactoryBase(Driver::DT_VIDEO, 0, "null", "Null Video Driver") {}
/* virtual */ Driver *CreateInstance() const { return new VideoDriver_Null(); }
Driver *CreateInstance() const override { return new VideoDriver_Null(); }
};
#endif /* VIDEO_NULL_H */

@ -17,27 +17,27 @@
/** The SDL video driver. */
class VideoDriver_SDL : public VideoDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void MakeDirty(int left, int top, int width, int height);
void MakeDirty(int left, int top, int width, int height) override;
/* virtual */ void MainLoop();
void MainLoop() override;
/* virtual */ bool ChangeResolution(int w, int h);
bool ChangeResolution(int w, int h) override;
/* virtual */ bool ToggleFullscreen(bool fullscreen);
bool ToggleFullscreen(bool fullscreen) override;
/* virtual */ bool AfterBlitterChange();
bool AfterBlitterChange() override;
/* virtual */ void AcquireBlitterLock();
void AcquireBlitterLock() override;
/* virtual */ void ReleaseBlitterLock();
void ReleaseBlitterLock() override;
/* virtual */ bool ClaimMousePointer();
bool ClaimMousePointer() override;
/* virtual */ const char *GetName() const { return "sdl"; }
const char *GetName() const override { return "sdl"; }
private:
int PollEvent();
bool CreateMainSurface(uint w, uint h);
@ -48,7 +48,7 @@ private:
class FVideoDriver_SDL : public DriverFactoryBase {
public:
FVideoDriver_SDL() : DriverFactoryBase(Driver::DT_VIDEO, 5, "sdl", "SDL Video Driver") {}
/* virtual */ Driver *CreateInstance() const { return new VideoDriver_SDL(); }
Driver *CreateInstance() const override { return new VideoDriver_SDL(); }
};
#endif /* VIDEO_SDL_H */

@ -17,29 +17,29 @@
/** The video driver for windows. */
class VideoDriver_Win32 : public VideoDriver {
public:
/* virtual */ const char *Start(const char * const *param);
const char *Start(const char * const *param) override;
/* virtual */ void Stop();
void Stop() override;
/* virtual */ void MakeDirty(int left, int top, int width, int height);
void MakeDirty(int left, int top, int width, int height) override;
/* virtual */ void MainLoop();
void MainLoop() override;
/* virtual */ bool ChangeResolution(int w, int h);
bool ChangeResolution(int w, int h) override;
/* virtual */ bool ToggleFullscreen(bool fullscreen);
bool ToggleFullscreen(bool fullscreen) override;
/* virtual */ bool AfterBlitterChange();
bool AfterBlitterChange() override;
/* virtual */ void AcquireBlitterLock();
void AcquireBlitterLock() override;
/* virtual */ void ReleaseBlitterLock();
void ReleaseBlitterLock() override;
/* virtual */ bool ClaimMousePointer();
bool ClaimMousePointer() override;
/* virtual */ void EditBoxLostFocus();
void EditBoxLostFocus() override;
/* virtual */ const char *GetName() const { return "win32"; }
const char *GetName() const override { return "win32"; }
bool MakeWindow(bool full_screen);
};
@ -48,7 +48,7 @@ public:
class FVideoDriver_Win32 : public DriverFactoryBase {
public:
FVideoDriver_Win32() : DriverFactoryBase(Driver::DT_VIDEO, 10, "win32", "Win32 GDI Video Driver") {}
/* virtual */ Driver *CreateInstance() const { return new VideoDriver_Win32(); }
Driver *CreateInstance() const override { return new VideoDriver_Win32(); }
};
#endif /* VIDEO_WIN32_H */

@ -25,23 +25,23 @@ struct Waypoint FINAL : SpecializedStation<Waypoint, true> {
Waypoint(TileIndex tile = INVALID_TILE) : SpecializedStation<Waypoint, true>(tile) { }
~Waypoint();
void UpdateVirtCoord();
void UpdateVirtCoord() override;
/* virtual */ inline bool TileBelongsToRailStation(TileIndex tile) const
inline bool TileBelongsToRailStation(TileIndex tile) const override
{
return IsRailWaypointTile(tile) && GetStationIndex(tile) == this->index;
}
/* virtual */ uint32 GetNewGRFVariable(const struct ResolverObject &object, byte variable, byte parameter, bool *available) const;
uint32 GetNewGRFVariable(const struct ResolverObject &object, byte variable, byte parameter, bool *available) const override;
/* virtual */ void GetTileArea(TileArea *ta, StationType type) const;
void GetTileArea(TileArea *ta, StationType type) const override;
/* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const
uint GetPlatformLength(TileIndex tile, DiagDirection dir) const override
{
return 1;
}
/* virtual */ uint GetPlatformLength(TileIndex tile) const
uint GetPlatformLength(TileIndex tile) const override
{
return 1;
}

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

Loading…
Cancel
Save