mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-02 00:00:26 +02:00
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:
@ -38,14 +38,14 @@ namespace scene
|
||||
|
||||
//! Gets the frame count of the animated mesh.
|
||||
/** \return Amount of frames. If the amount is 1, it is a static, non animated mesh. */
|
||||
virtual u32 getFrameCount() const _IRR_OVERRIDE_
|
||||
u32 getFrameCount() const override
|
||||
{
|
||||
return Meshes.size();
|
||||
}
|
||||
|
||||
//! Gets the default animation speed of the animated mesh.
|
||||
/** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */
|
||||
virtual f32 getAnimationSpeed() const _IRR_OVERRIDE_
|
||||
f32 getAnimationSpeed() const override
|
||||
{
|
||||
return FramesPerSecond;
|
||||
}
|
||||
@ -53,7 +53,7 @@ namespace scene
|
||||
//! Gets the frame count of the animated mesh.
|
||||
/** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated.
|
||||
The actual speed is set in the scene node the mesh is instantiated in.*/
|
||||
virtual void setAnimationSpeed(f32 fps) _IRR_OVERRIDE_
|
||||
void setAnimationSpeed(f32 fps) override
|
||||
{
|
||||
FramesPerSecond=fps;
|
||||
}
|
||||
@ -66,7 +66,7 @@ namespace scene
|
||||
\param startFrameLoop: start frame
|
||||
\param endFrameLoop: end frame
|
||||
\return The animated mesh based on a detail level. */
|
||||
virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) _IRR_OVERRIDE_
|
||||
IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) override
|
||||
{
|
||||
if (Meshes.empty())
|
||||
return 0;
|
||||
@ -86,13 +86,13 @@ namespace scene
|
||||
|
||||
//! Returns an axis aligned bounding box of the mesh.
|
||||
/** \return A bounding box of this mesh is returned. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override
|
||||
{
|
||||
return Box;
|
||||
}
|
||||
|
||||
//! set user axis aligned bounding box
|
||||
virtual void setBoundingBox(const core::aabbox3df& box) _IRR_OVERRIDE_
|
||||
void setBoundingBox(const core::aabbox3df& box) override
|
||||
{
|
||||
Box = box;
|
||||
}
|
||||
@ -112,13 +112,13 @@ namespace scene
|
||||
}
|
||||
|
||||
//! Returns the type of the animated mesh.
|
||||
virtual E_ANIMATED_MESH_TYPE getMeshType() const _IRR_OVERRIDE_
|
||||
E_ANIMATED_MESH_TYPE getMeshType() const override
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
|
||||
//! returns amount of mesh buffers.
|
||||
virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_
|
||||
u32 getMeshBufferCount() const override
|
||||
{
|
||||
if (Meshes.empty())
|
||||
return 0;
|
||||
@ -127,7 +127,7 @@ namespace scene
|
||||
}
|
||||
|
||||
//! returns pointer to a mesh buffer
|
||||
virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_
|
||||
IMeshBuffer* getMeshBuffer(u32 nr) const override
|
||||
{
|
||||
if (Meshes.empty())
|
||||
return 0;
|
||||
@ -139,7 +139,7 @@ namespace scene
|
||||
/** \param material: material to search for
|
||||
\return Returns the pointer to the mesh buffer or
|
||||
NULL if there is no such mesh buffer. */
|
||||
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const _IRR_OVERRIDE_
|
||||
IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const override
|
||||
{
|
||||
if (Meshes.empty())
|
||||
return 0;
|
||||
@ -148,21 +148,21 @@ namespace scene
|
||||
}
|
||||
|
||||
//! Set a material flag for all meshbuffers of this mesh.
|
||||
virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) _IRR_OVERRIDE_
|
||||
void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) override
|
||||
{
|
||||
for (u32 i=0; i<Meshes.size(); ++i)
|
||||
Meshes[i]->setMaterialFlag(flag, newvalue);
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) _IRR_OVERRIDE_
|
||||
void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) override
|
||||
{
|
||||
for (u32 i=0; i<Meshes.size(); ++i)
|
||||
Meshes[i]->setHardwareMappingHint(newMappingHint, buffer);
|
||||
}
|
||||
|
||||
//! flags the meshbuffer as changed, reloads hardware buffers
|
||||
virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
|
||||
void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) override
|
||||
{
|
||||
for (u32 i=0; i<Meshes.size(); ++i)
|
||||
Meshes[i]->setDirty(buffer);
|
||||
|
Reference in New Issue
Block a user