diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-03-03 22:25:13 +0000 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-03-24 16:10:04 +0100 |
commit | af7d9020a15c1b1a14b3981ac73c70d2e58cc877 (patch) | |
tree | 1dcff3e01382ea3a0a4733a4637659dbbfd4bad5 /src/video | |
parent | 31260e66252fb4d0dda6f992520faeeb96929cfe (diff) | |
download | openttd-af7d9020a15c1b1a14b3981ac73c70d2e58cc877.tar.xz |
Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.
Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
Diffstat (limited to 'src/video')
-rw-r--r-- | src/video/allegro_v.h | 20 | ||||
-rw-r--r-- | src/video/cocoa/cocoa_v.h | 20 | ||||
-rw-r--r-- | src/video/dedicated_v.h | 18 | ||||
-rw-r--r-- | src/video/null_v.h | 18 | ||||
-rw-r--r-- | src/video/sdl_v.h | 24 | ||||
-rw-r--r-- | src/video/win32_v.h | 26 |
6 files changed, 63 insertions, 63 deletions
diff --git a/src/video/allegro_v.h b/src/video/allegro_v.h index a770635da..f68ce5781 100644 --- a/src/video/allegro_v.h +++ b/src/video/allegro_v.h @@ -17,30 +17,30 @@ /** The allegro video driver. */ class VideoDriver_Allegro : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); + bool ToggleFullscreen(bool fullscreen) override; - /* virtual */ bool AfterBlitterChange(); + bool AfterBlitterChange() override; - /* virtual */ bool ClaimMousePointer(); + bool ClaimMousePointer() override; - /* virtual */ const char *GetName() const { return "allegro"; } + const char *GetName() const override { return "allegro"; } }; /** Factory for the allegro video driver. */ class FVideoDriver_Allegro : public DriverFactoryBase { public: FVideoDriver_Allegro() : DriverFactoryBase(Driver::DT_VIDEO, 4, "allegro", "Allegro Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Allegro(); } + Driver *CreateInstance() const override { return new VideoDriver_Allegro(); } }; #endif /* VIDEO_ALLEGRO_H */ diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h index 564daefe0..2614eef53 100644 --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -16,10 +16,10 @@ class VideoDriver_Cocoa : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; /** Stop the video driver */ - /* virtual */ void Stop(); + void Stop() override; /** Mark dirty a screen region * @param left x-coordinate of left border @@ -27,44 +27,44 @@ public: * @param width width or dirty rectangle * @param height height of dirty rectangle */ - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; /** Programme main loop */ - /* virtual */ void MainLoop(); + void MainLoop() override; /** Change window resolution * @param w New window width * @param h New window height * @return Whether change was successful */ - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; /** Set a new window mode * @param fullscreen Whether to set fullscreen mode or not * @return Whether changing the screen mode was successful */ - /* virtual */ bool ToggleFullscreen(bool fullscreen); + bool ToggleFullscreen(bool fullscreen) override; /** Callback invoked after the blitter was changed. * @return True if no error. */ - /* virtual */ bool AfterBlitterChange(); + bool AfterBlitterChange() override; /** * An edit box lost the input focus. Abort character compositing if necessary. */ - /* virtual */ void EditBoxLostFocus(); + void EditBoxLostFocus() override; /** Return driver name * @return driver name */ - /* virtual */ const char *GetName() const { return "cocoa"; } + const char *GetName() const override { return "cocoa"; } }; class FVideoDriver_Cocoa : public DriverFactoryBase { public: FVideoDriver_Cocoa() : DriverFactoryBase(Driver::DT_VIDEO, 10, "cocoa", "Cocoa Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Cocoa(); } + Driver *CreateInstance() const override { return new VideoDriver_Cocoa(); } }; diff --git a/src/video/dedicated_v.h b/src/video/dedicated_v.h index 0c1477d66..bdf873c3d 100644 --- a/src/video/dedicated_v.h +++ b/src/video/dedicated_v.h @@ -17,19 +17,19 @@ /** The dedicated server video driver. */ class VideoDriver_Dedicated : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); - /* virtual */ const char *GetName() const { return "dedicated"; } - /* virtual */ bool HasGUI() const { return false; } + bool ToggleFullscreen(bool fullscreen) override; + const char *GetName() const override { return "dedicated"; } + bool HasGUI() const override { return false; } }; /** Factory for the dedicated server video driver. */ @@ -43,7 +43,7 @@ public: static const int PRIORITY = 0; #endif FVideoDriver_Dedicated() : DriverFactoryBase(Driver::DT_VIDEO, PRIORITY, "dedicated", "Dedicated Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Dedicated(); } + Driver *CreateInstance() const override { return new VideoDriver_Dedicated(); } }; #endif /* VIDEO_DEDICATED_H */ diff --git a/src/video/null_v.h b/src/video/null_v.h index 9e04e177e..a3b2cb5a8 100644 --- a/src/video/null_v.h +++ b/src/video/null_v.h @@ -20,26 +20,26 @@ private: uint ticks; ///< Amount of ticks to run. public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); - /* virtual */ const char *GetName() const { return "null"; } - /* virtual */ bool HasGUI() const { return false; } + bool ToggleFullscreen(bool fullscreen) override; + const char *GetName() const override { return "null"; } + bool HasGUI() const override { return false; } }; /** Factory the null video driver. */ class FVideoDriver_Null : public DriverFactoryBase { public: FVideoDriver_Null() : DriverFactoryBase(Driver::DT_VIDEO, 0, "null", "Null Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Null(); } + Driver *CreateInstance() const override { return new VideoDriver_Null(); } }; #endif /* VIDEO_NULL_H */ diff --git a/src/video/sdl_v.h b/src/video/sdl_v.h index 8855c3566..cafdbbc61 100644 --- a/src/video/sdl_v.h +++ b/src/video/sdl_v.h @@ -17,27 +17,27 @@ /** The SDL video driver. */ class VideoDriver_SDL : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); + bool ToggleFullscreen(bool fullscreen) override; - /* virtual */ bool AfterBlitterChange(); + bool AfterBlitterChange() override; - /* virtual */ void AcquireBlitterLock(); + void AcquireBlitterLock() override; - /* virtual */ void ReleaseBlitterLock(); + void ReleaseBlitterLock() override; - /* virtual */ bool ClaimMousePointer(); + bool ClaimMousePointer() override; - /* virtual */ const char *GetName() const { return "sdl"; } + const char *GetName() const override { return "sdl"; } private: int PollEvent(); bool CreateMainSurface(uint w, uint h); @@ -48,7 +48,7 @@ private: class FVideoDriver_SDL : public DriverFactoryBase { public: FVideoDriver_SDL() : DriverFactoryBase(Driver::DT_VIDEO, 5, "sdl", "SDL Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_SDL(); } + Driver *CreateInstance() const override { return new VideoDriver_SDL(); } }; #endif /* VIDEO_SDL_H */ diff --git a/src/video/win32_v.h b/src/video/win32_v.h index 7609d0422..aa6bb7c0d 100644 --- a/src/video/win32_v.h +++ b/src/video/win32_v.h @@ -17,29 +17,29 @@ /** The video driver for windows. */ class VideoDriver_Win32 : public VideoDriver { public: - /* virtual */ const char *Start(const char * const *param); + const char *Start(const char * const *param) override; - /* virtual */ void Stop(); + void Stop() override; - /* virtual */ void MakeDirty(int left, int top, int width, int height); + void MakeDirty(int left, int top, int width, int height) override; - /* virtual */ void MainLoop(); + void MainLoop() override; - /* virtual */ bool ChangeResolution(int w, int h); + bool ChangeResolution(int w, int h) override; - /* virtual */ bool ToggleFullscreen(bool fullscreen); + bool ToggleFullscreen(bool fullscreen) override; - /* virtual */ bool AfterBlitterChange(); + bool AfterBlitterChange() override; - /* virtual */ void AcquireBlitterLock(); + void AcquireBlitterLock() override; - /* virtual */ void ReleaseBlitterLock(); + void ReleaseBlitterLock() override; - /* virtual */ bool ClaimMousePointer(); + bool ClaimMousePointer() override; - /* virtual */ void EditBoxLostFocus(); + void EditBoxLostFocus() override; - /* virtual */ const char *GetName() const { return "win32"; } + const char *GetName() const override { return "win32"; } bool MakeWindow(bool full_screen); }; @@ -48,7 +48,7 @@ public: class FVideoDriver_Win32 : public DriverFactoryBase { public: FVideoDriver_Win32() : DriverFactoryBase(Driver::DT_VIDEO, 10, "win32", "Win32 GDI Video Driver") {} - /* virtual */ Driver *CreateInstance() const { return new VideoDriver_Win32(); } + Driver *CreateInstance() const override { return new VideoDriver_Win32(); } }; #endif /* VIDEO_WIN32_H */ |