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

@ -47,56 +47,56 @@ namespace irr
virtual ~CIrrDeviceMacOSX();
//! runs the device. Returns false if device wants to be deleted
virtual bool run() _IRR_OVERRIDE_;
bool run() override;
//! Cause the device to temporarily pause execution and let other processes to run
// This should bring down processor usage without major performance loss for Irrlicht
virtual void yield() _IRR_OVERRIDE_;
void yield() override;
//! Pause execution and let other processes to run for a specified amount of 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;
//! Checks if the Irrlicht window has focus
virtual bool isWindowFocused() const _IRR_OVERRIDE_;
bool isWindowFocused() const override;
//! Checks if the Irrlicht window is minimized
virtual bool isWindowMinimized() const _IRR_OVERRIDE_;
bool isWindowMinimized() 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) _IRR_OVERRIDE_;
void setResizable(bool resize) override;
//! Returns true if the window is resizable, false if not
virtual bool isResizable() const;
//! Minimizes the window if possible
virtual void minimizeWindow() _IRR_OVERRIDE_;
void minimizeWindow() override;
//! Maximizes the window if possible.
virtual void maximizeWindow() _IRR_OVERRIDE_;
void maximizeWindow() override;
//! Restore the window to normal size if possible.
virtual void restoreWindow() _IRR_OVERRIDE_;
void restoreWindow() 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_OSX;
}
@ -127,39 +127,39 @@ namespace irr
}
//! Changes the visible state of the mouse cursor.
virtual void setVisible(bool visible) _IRR_OVERRIDE_
void setVisible(bool visible) override
{
IsVisible = visible;
Device->setCursorVisible(visible);
}
//! 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*WindowSize.Width), (s32)(y*WindowSize.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
{
if (CursorPos.X != pos.X || CursorPos.Y != pos.Y)
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
{
if (UseReferenceRect)
{
@ -172,13 +172,13 @@ namespace irr
}
//! 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
{
return CursorPos;
}
//! 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 (!UseReferenceRect)
{
@ -191,7 +191,7 @@ namespace irr
}
//! Sets an absolute reference rect for calculating the cursor position.
virtual void setReferenceRect(core::rect<s32>* rect=0) _IRR_OVERRIDE_
void setReferenceRect(core::rect<s32>* rect=0) override
{
if (rect)
{