API BREAKER: Replacing defines in irrTypes.h which are conflicting with c++ reserved identifier rules.

C++ has undefined behavior for identifiers starting with __ or with _ followed by an uppercase letter.
We still have many more (in IrrCompileConfig.h and in all header-guards), will likely replace those later as well.
As a workaround for users which might use irrlicht defines in their code, I've added the header irrLegacyDefines.h
Including that allows to continue using old defines for a while - or make it easier to have code which compiles 
with old and new Irrlicht library versions.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6251 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2021-08-27 12:55:10 +00:00
parent ee180dbd24
commit ffd7b63af0
289 changed files with 3401 additions and 3379 deletions

View File

@ -39,80 +39,80 @@ namespace irr
virtual ~CIrrDeviceWin32();
//! runs the device. Returns false if device wants to be deleted
virtual bool run() _IRR_OVERRIDE_;
virtual bool run() IRR_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_;
virtual void yield() IRR_OVERRIDE;
//! Pause execution and let other processes to run for a specified amount of time.
virtual void sleep(u32 timeMs, bool pauseTimer) _IRR_OVERRIDE_;
virtual void sleep(u32 timeMs, bool pauseTimer) IRR_OVERRIDE;
//! sets the caption of the window
virtual void setWindowCaption(const wchar_t* text) _IRR_OVERRIDE_;
virtual void setWindowCaption(const wchar_t* text) IRR_OVERRIDE;
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive() const _IRR_OVERRIDE_;
virtual bool isWindowActive() const IRR_OVERRIDE;
//! returns if window has focus
virtual bool isWindowFocused() const _IRR_OVERRIDE_;
virtual bool isWindowFocused() const IRR_OVERRIDE;
//! returns if window is minimized
virtual bool isWindowMinimized() const _IRR_OVERRIDE_;
virtual bool isWindowMinimized() const IRR_OVERRIDE;
//! presents a surface in the client area
virtual bool present(video::IImage* surface, void* windowId=0, core::rect<s32>* src=0) _IRR_OVERRIDE_;
virtual bool present(video::IImage* surface, void* windowId=0, core::rect<s32>* src=0) IRR_OVERRIDE;
//! notifies the device that it should close itself
virtual void closeDevice() _IRR_OVERRIDE_;
virtual void closeDevice() IRR_OVERRIDE;
//! \return Returns a pointer to a list with all video modes
//! supported by the gfx adapter.
virtual video::IVideoModeList* getVideoModeList() _IRR_OVERRIDE_;
virtual video::IVideoModeList* getVideoModeList() IRR_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_;
virtual void setResizable(bool resize=false) IRR_OVERRIDE;
//! Resize the render window.
virtual void setWindowSize(const irr::core::dimension2d<u32>& size) _IRR_OVERRIDE_;
virtual void setWindowSize(const irr::core::dimension2d<u32>& size) IRR_OVERRIDE;
//! Minimizes the window.
virtual void minimizeWindow() _IRR_OVERRIDE_;
virtual void minimizeWindow() IRR_OVERRIDE;
//! Maximizes the window.
virtual void maximizeWindow() _IRR_OVERRIDE_;
virtual void maximizeWindow() IRR_OVERRIDE;
//! Restores the window size.
virtual void restoreWindow() _IRR_OVERRIDE_;
virtual void restoreWindow() IRR_OVERRIDE;
//! Get the position of the window on screen
virtual core::position2di getWindowPosition() _IRR_OVERRIDE_;
virtual core::position2di getWindowPosition() IRR_OVERRIDE;
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_;
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) IRR_OVERRIDE;
//! Set the current Gamma Value for the Display
virtual bool setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast ) _IRR_OVERRIDE_;
virtual bool setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast ) IRR_OVERRIDE;
//! Get the current Gamma Value for the Display
virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast ) _IRR_OVERRIDE_;
virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast ) IRR_OVERRIDE;
//! Remove all messages pending in the system message loop
virtual void clearSystemMessages() _IRR_OVERRIDE_;
virtual void clearSystemMessages() IRR_OVERRIDE;
//! Get the device type
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
virtual E_DEVICE_TYPE getType() const IRR_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_
virtual u32 checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_EVENT inputEvent ) IRR_OVERRIDE
{
// we just have to make it public
return CIrrDeviceStub::checkSuccessiveClicks(mouseX, mouseY, inputEvent );
@ -140,7 +140,7 @@ namespace irr
~CCursorControl();
//! Changes the visible state of the mouse cursor.
virtual void setVisible(bool visible) _IRR_OVERRIDE_
virtual void setVisible(bool visible) IRR_OVERRIDE
{
CURSORINFO info;
info.cbSize = sizeof(CURSORINFO);
@ -186,19 +186,19 @@ namespace irr
}
//! Returns if the cursor is currently visible.
virtual bool isVisible() const _IRR_OVERRIDE_
virtual bool isVisible() const IRR_OVERRIDE
{
return IsVisible;
}
//! Sets the new position of the cursor.
virtual void setPosition(const core::position2d<f32> &pos) _IRR_OVERRIDE_
virtual void setPosition(const core::position2d<f32> &pos) IRR_OVERRIDE
{
setPosition(pos.X, pos.Y);
}
//! Sets the new position of the cursor.
virtual void setPosition(f32 x, f32 y) _IRR_OVERRIDE_
virtual void setPosition(f32 x, f32 y) IRR_OVERRIDE
{
if (!UseReferenceRect)
setPosition(core::round32(x*WindowSize.Width), core::round32(y*WindowSize.Height));
@ -207,13 +207,13 @@ namespace irr
}
//! Sets the new position of the cursor.
virtual void setPosition(const core::position2d<s32> &pos) _IRR_OVERRIDE_
virtual void setPosition(const core::position2d<s32> &pos) IRR_OVERRIDE
{
setPosition(pos.X, pos.Y);
}
//! Sets the new position of the cursor.
virtual void setPosition(s32 x, s32 y) _IRR_OVERRIDE_
virtual void setPosition(s32 x, s32 y) IRR_OVERRIDE
{
if (UseReferenceRect)
{
@ -232,7 +232,7 @@ namespace irr
}
//! Returns the current position of the mouse cursor.
virtual const core::position2d<s32>& getPosition(bool updateCursor) _IRR_OVERRIDE_
virtual const core::position2d<s32>& getPosition(bool updateCursor) IRR_OVERRIDE
{
if ( updateCursor )
updateInternalCursorPosition();
@ -240,7 +240,7 @@ namespace irr
}
//! Returns the current position of the mouse cursor.
virtual core::position2d<f32> getRelativePosition(bool updateCursor) _IRR_OVERRIDE_
virtual core::position2d<f32> getRelativePosition(bool updateCursor) IRR_OVERRIDE
{
if ( updateCursor )
updateInternalCursorPosition();
@ -256,7 +256,7 @@ namespace irr
}
//! Sets an absolute reference rect for calculating the cursor position.
virtual void setReferenceRect(core::rect<s32>* rect=0) _IRR_OVERRIDE_
virtual void setReferenceRect(core::rect<s32>* rect=0) IRR_OVERRIDE
{
if (rect)
{
@ -320,22 +320,22 @@ namespace irr
//! Sets the active cursor icon
virtual void setActiveIcon(gui::ECURSOR_ICON iconId) _IRR_OVERRIDE_;
virtual void setActiveIcon(gui::ECURSOR_ICON iconId) IRR_OVERRIDE;
//! Gets the currently active icon
virtual gui::ECURSOR_ICON getActiveIcon() const _IRR_OVERRIDE_
virtual gui::ECURSOR_ICON getActiveIcon() const IRR_OVERRIDE
{
return ActiveIcon;
}
//! Add a custom sprite as cursor icon.
virtual gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) _IRR_OVERRIDE_;
virtual gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) IRR_OVERRIDE;
//! replace the given cursor icon.
virtual void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon) _IRR_OVERRIDE_;
virtual void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon) IRR_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_;
virtual core::dimension2di getSupportedIconSize() const IRR_OVERRIDE;
void update();