mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-02 00:00:26 +02:00
Reformat the code, using:
find -type f | # list all regular files grep -E '\.(h|cpp|mm)$' | # filter for source files grep -v '/mt_' | # filter out generated files grep -v '/vendor/' | # and vendored GL grep -v '/test/image_loader_test.cpp' | # and this file (has giant literals arrays) xargs -n 1 -P $(nproc) clang-format -i # reformat everything Co-authored-by: numzero <numzer0@yandex.ru>
This commit is contained in:
@ -14,7 +14,7 @@ namespace irr
|
||||
|
||||
namespace video
|
||||
{
|
||||
class ITexture;
|
||||
class ITexture;
|
||||
} // end namespace video
|
||||
|
||||
namespace gui
|
||||
@ -24,12 +24,13 @@ namespace gui
|
||||
// Note for implementer: Can't fix variable names to uppercase as this is a public interface used since a while
|
||||
struct SGUISpriteFrame
|
||||
{
|
||||
SGUISpriteFrame() : textureNumber(0), rectNumber(0)
|
||||
SGUISpriteFrame() :
|
||||
textureNumber(0), rectNumber(0)
|
||||
{
|
||||
}
|
||||
|
||||
SGUISpriteFrame(u32 textureIndex, u32 positionIndex)
|
||||
: textureNumber(textureIndex), rectNumber(positionIndex)
|
||||
SGUISpriteFrame(u32 textureIndex, u32 positionIndex) :
|
||||
textureNumber(textureIndex), rectNumber(positionIndex)
|
||||
{
|
||||
}
|
||||
|
||||
@ -44,8 +45,10 @@ struct SGUISpriteFrame
|
||||
// Note for implementer: Can't fix variable names to uppercase as this is a public interface used since a while
|
||||
struct SGUISprite
|
||||
{
|
||||
SGUISprite() : frameTime(0) {}
|
||||
SGUISprite(const SGUISpriteFrame& firstFrame) : frameTime(0)
|
||||
SGUISprite() :
|
||||
frameTime(0) {}
|
||||
SGUISprite(const SGUISpriteFrame &firstFrame) :
|
||||
frameTime(0)
|
||||
{
|
||||
Frames.push_back(firstFrame);
|
||||
}
|
||||
@ -54,37 +57,35 @@ struct SGUISprite
|
||||
u32 frameTime;
|
||||
};
|
||||
|
||||
|
||||
//! Sprite bank interface.
|
||||
/** See http://http://irrlicht.sourceforge.net/forum//viewtopic.php?f=9&t=25742
|
||||
* for more information how to use the spritebank.
|
||||
*/
|
||||
* for more information how to use the spritebank.
|
||||
*/
|
||||
class IGUISpriteBank : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Returns the list of rectangles held by the sprite bank
|
||||
virtual core::array< core::rect<s32> >& getPositions() = 0;
|
||||
virtual core::array<core::rect<s32>> &getPositions() = 0;
|
||||
|
||||
//! Returns the array of animated sprites within the sprite bank
|
||||
virtual core::array< SGUISprite >& getSprites() = 0;
|
||||
virtual core::array<SGUISprite> &getSprites() = 0;
|
||||
|
||||
//! Returns the number of textures held by the sprite bank
|
||||
virtual u32 getTextureCount() const = 0;
|
||||
|
||||
//! Gets the texture with the specified index
|
||||
virtual video::ITexture* getTexture(u32 index) const = 0;
|
||||
virtual video::ITexture *getTexture(u32 index) const = 0;
|
||||
|
||||
//! Adds a texture to the sprite bank
|
||||
virtual void addTexture(video::ITexture* texture) = 0;
|
||||
virtual void addTexture(video::ITexture *texture) = 0;
|
||||
|
||||
//! Changes one of the textures in the sprite bank
|
||||
virtual void setTexture(u32 index, video::ITexture* texture) = 0;
|
||||
virtual void setTexture(u32 index, video::ITexture *texture) = 0;
|
||||
|
||||
//! Add the texture and use it for a single non-animated sprite.
|
||||
/** The texture and the corresponding rectangle and sprite will all be added to the end of each array.
|
||||
\returns The index of the sprite or -1 on failure */
|
||||
virtual s32 addTextureAsSprite(video::ITexture* texture) = 0;
|
||||
virtual s32 addTextureAsSprite(video::ITexture *texture) = 0;
|
||||
|
||||
//! Clears sprites, rectangles and textures
|
||||
virtual void clear() = 0;
|
||||
@ -102,11 +103,11 @@ public:
|
||||
\param loop When true animations are looped
|
||||
\param center When true pivot is set to the sprite-center. So it affects pos.
|
||||
*/
|
||||
virtual void draw2DSprite(u32 index, const core::position2di& pos,
|
||||
const core::rect<s32>* clip=0,
|
||||
const video::SColor& color= video::SColor(255,255,255,255),
|
||||
u32 starttime=0, u32 currenttime=0,
|
||||
bool loop=true, bool center=false) = 0;
|
||||
virtual void draw2DSprite(u32 index, const core::position2di &pos,
|
||||
const core::rect<s32> *clip = 0,
|
||||
const video::SColor &color = video::SColor(255, 255, 255, 255),
|
||||
u32 starttime = 0, u32 currenttime = 0,
|
||||
bool loop = true, bool center = false) = 0;
|
||||
|
||||
//! Draws a sprite in 2d with destination rectangle and colors
|
||||
/**
|
||||
@ -119,20 +120,19 @@ public:
|
||||
(same as currenttime-starttime in other draw2DSprite function)
|
||||
\param loop When true animations are looped
|
||||
*/
|
||||
virtual void draw2DSprite(u32 index, const core::rect<s32>& destRect,
|
||||
const core::rect<s32>* clip=0,
|
||||
const video::SColor * const colors=0,
|
||||
virtual void draw2DSprite(u32 index, const core::rect<s32> &destRect,
|
||||
const core::rect<s32> *clip = 0,
|
||||
const video::SColor *const colors = 0,
|
||||
u32 timeTicks = 0,
|
||||
bool loop=true) = 0;
|
||||
bool loop = true) = 0;
|
||||
|
||||
//! Draws a sprite batch in 2d using an array of positions and a color
|
||||
virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
|
||||
const core::rect<s32>* clip=0,
|
||||
const video::SColor& color= video::SColor(255,255,255,255),
|
||||
u32 starttime=0, u32 currenttime=0,
|
||||
bool loop=true, bool center=false) = 0;
|
||||
virtual void draw2DSpriteBatch(const core::array<u32> &indices, const core::array<core::position2di> &pos,
|
||||
const core::rect<s32> *clip = 0,
|
||||
const video::SColor &color = video::SColor(255, 255, 255, 255),
|
||||
u32 starttime = 0, u32 currenttime = 0,
|
||||
bool loop = true, bool center = false) = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
Reference in New Issue
Block a user