Replace _IRR_OVERRIDE_ macro with override keyword

The commit also establishes a precedent of leaving off the `virtual`
keyword in overrides. Although not strictly necessary, I believe this is
good for readability because it makes it clear it is an override and not
a pure virtual function, and it helps keep line lengths shorter. We
should move towards eliminating the macro altogether, but the definition
has been left in with a note on deprecation so that in-progress work
will not suffer merge conflicts.
This commit is contained in:
JosiahWI
2022-10-09 13:57:28 -05:00
committed by sfan5
parent f3a1f9f656
commit 59fc4401f1
87 changed files with 1471 additions and 1474 deletions

View File

@ -37,59 +37,59 @@ namespace irr
virtual ~CIrrDeviceSDL();
//! runs the device. Returns false if device wants to be deleted
virtual bool run() _IRR_OVERRIDE_;
bool run() override;
//! pause execution temporarily
virtual void yield() _IRR_OVERRIDE_;
void yield() override;
//! pause execution for a specified time
virtual void sleep(u32 timeMs, bool pauseTimer) _IRR_OVERRIDE_;
void sleep(u32 timeMs, bool pauseTimer) override;
//! sets the caption of the window
virtual void setWindowCaption(const wchar_t* text) _IRR_OVERRIDE_;
void setWindowCaption(const wchar_t* text) override;
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive() const _IRR_OVERRIDE_;
bool isWindowActive() const override;
//! returns if window has focus.
bool isWindowFocused() const _IRR_OVERRIDE_;
bool isWindowFocused() const override;
//! returns if window is minimized.
bool isWindowMinimized() const _IRR_OVERRIDE_;
bool isWindowMinimized() const override;
//! returns color format of the window.
video::ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_;
video::ECOLOR_FORMAT getColorFormat() const override;
//! presents a surface in the client area
virtual bool present(video::IImage* surface, void* windowId=0, core::rect<s32>* src=0) _IRR_OVERRIDE_;
bool present(video::IImage* surface, void* windowId=0, core::rect<s32>* src=0) override;
//! notifies the device that it should close itself
virtual void closeDevice() _IRR_OVERRIDE_;
void closeDevice() override;
//! Sets if the window should be resizable in windowed mode.
virtual void setResizable(bool resize=false) _IRR_OVERRIDE_;
void setResizable(bool resize=false) override;
//! Minimizes the window.
virtual void minimizeWindow() _IRR_OVERRIDE_;
void minimizeWindow() override;
//! Maximizes the window.
virtual void maximizeWindow() _IRR_OVERRIDE_;
void maximizeWindow() override;
//! Restores the window size.
virtual void restoreWindow() _IRR_OVERRIDE_;
void restoreWindow() override;
//! Checks if the Irrlicht window is running in fullscreen mode
/** \return True if window is fullscreen. */
virtual bool isFullscreen() const _IRR_OVERRIDE_;
bool isFullscreen() const override;
//! Get the position of this window on screen
virtual core::position2di getWindowPosition() _IRR_OVERRIDE_;
core::position2di getWindowPosition() override;
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_;
bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) override;
//! Get the device type
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
E_DEVICE_TYPE getType() const override
{
return EIDT_SDL;
}
@ -107,7 +107,7 @@ namespace irr
}
//! Changes the visible state of the mouse cursor.
virtual void setVisible(bool visible) _IRR_OVERRIDE_
void setVisible(bool visible) override
{
IsVisible = visible;
if ( visible )
@ -119,37 +119,37 @@ namespace irr
}
//! Returns if the cursor is currently visible.
virtual bool isVisible() const _IRR_OVERRIDE_
bool isVisible() const override
{
return IsVisible;
}
//! Sets the new position of the cursor.
virtual void setPosition(const core::position2d<f32> &pos) _IRR_OVERRIDE_
void setPosition(const core::position2d<f32> &pos) override
{
setPosition(pos.X, pos.Y);
}
//! Sets the new position of the cursor.
virtual void setPosition(f32 x, f32 y) _IRR_OVERRIDE_
void setPosition(f32 x, f32 y) override
{
setPosition((s32)(x*Device->Width), (s32)(y*Device->Height));
}
//! Sets the new position of the cursor.
virtual void setPosition(const core::position2d<s32> &pos) _IRR_OVERRIDE_
void setPosition(const core::position2d<s32> &pos) override
{
setPosition(pos.X, pos.Y);
}
//! Sets the new position of the cursor.
virtual void setPosition(s32 x, s32 y) _IRR_OVERRIDE_
void setPosition(s32 x, s32 y) override
{
SDL_WarpMouseInWindow(Device->Window, x, y);
}
//! Returns the current position of the mouse cursor.
virtual const core::position2d<s32>& getPosition(bool updateCursor) _IRR_OVERRIDE_
const core::position2d<s32>& getPosition(bool updateCursor) override
{
if ( updateCursor )
updateCursorPos();
@ -157,7 +157,7 @@ namespace irr
}
//! Returns the current position of the mouse cursor.
virtual core::position2d<f32> getRelativePosition(bool updateCursor) _IRR_OVERRIDE_
core::position2d<f32> getRelativePosition(bool updateCursor) override
{
if ( updateCursor )
updateCursorPos();
@ -165,7 +165,7 @@ namespace irr
CursorPos.Y / (f32)Device->Height);
}
virtual void setReferenceRect(core::rect<s32>* rect=0) _IRR_OVERRIDE_
void setReferenceRect(core::rect<s32>* rect=0) override
{
}