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,70 +37,70 @@ namespace irr
virtual ~CIrrDeviceWin32();
//! 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;
//! returns if window has focus
virtual bool isWindowFocused() const _IRR_OVERRIDE_;
bool isWindowFocused() const override;
//! returns if 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;
//! Notifies the device, that it has been resized
/** Must be publis as it is called from free function (event handler) */
void OnResized();
//! Sets if the window should be resizable in windowed mode.
virtual void setResizable(bool resize=false) _IRR_OVERRIDE_;
void setResizable(bool resize=false) override;
//! Resize the render window.
virtual void setWindowSize(const irr::core::dimension2d<u32>& size) _IRR_OVERRIDE_;
void setWindowSize(const irr::core::dimension2d<u32>& size) 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;
//! Get the position of the 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;
//! Remove all messages pending in the system message loop
virtual void clearSystemMessages() _IRR_OVERRIDE_;
void clearSystemMessages() override;
//! Get the device type
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
E_DEVICE_TYPE getType() const override
{
return EIDT_WIN32;
}
//! Compares to the last call of this function to return double and triple clicks.
//! \return Returns only 1,2 or 3. A 4th click will start with 1 again.
virtual u32 checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_EVENT inputEvent ) _IRR_OVERRIDE_
u32 checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_EVENT inputEvent ) override
{
// we just have to make it public
return CIrrDeviceStub::checkSuccessiveClicks(mouseX, mouseY, inputEvent );
@ -121,7 +121,7 @@ namespace irr
~CCursorControl();
//! Changes the visible state of the mouse cursor.
virtual void setVisible(bool visible) _IRR_OVERRIDE_
void setVisible(bool visible) override
{
CURSORINFO info;
info.cbSize = sizeof(CURSORINFO);
@ -167,19 +167,19 @@ 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
{
if (!UseReferenceRect)
setPosition(core::round32(x*WindowSize.Width), core::round32(y*WindowSize.Height));
@ -188,13 +188,13 @@ namespace irr
}
//! 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
{
if (UseReferenceRect)
{
@ -213,7 +213,7 @@ 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
{
if ( updateCursor )
updateInternalCursorPosition();
@ -221,7 +221,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 )
updateInternalCursorPosition();
@ -237,7 +237,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)
{
@ -300,22 +300,22 @@ namespace irr
//! Sets the active cursor icon
virtual void setActiveIcon(gui::ECURSOR_ICON iconId) _IRR_OVERRIDE_;
void setActiveIcon(gui::ECURSOR_ICON iconId) override;
//! Gets the currently active icon
virtual gui::ECURSOR_ICON getActiveIcon() const _IRR_OVERRIDE_
gui::ECURSOR_ICON getActiveIcon() const override
{
return ActiveIcon;
}
//! Add a custom sprite as cursor icon.
virtual gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) _IRR_OVERRIDE_;
gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) override;
//! replace the given cursor icon.
virtual void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon) _IRR_OVERRIDE_;
void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon) override;
//! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.
virtual core::dimension2di getSupportedIconSize() const _IRR_OVERRIDE_;
core::dimension2di getSupportedIconSize() const override;
void update();