mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 15:50:27 +02:00
SpriteBank: error check on non existing textureNumber
seen in broken Fonts. unified getFrameNr git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6368 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -64,19 +64,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
inline u32 getFrameNr(u32 index, u32 time, bool loop) const
|
||||
{
|
||||
u32 frame = 0;
|
||||
if (Sprites[index].frameTime && Sprites[index].Frames.size() )
|
||||
{
|
||||
u32 f = (time / Sprites[index].frameTime);
|
||||
if (loop)
|
||||
frame = f % Sprites[index].Frames.size();
|
||||
else
|
||||
frame = (f >= Sprites[index].Frames.size()) ? Sprites[index].Frames.size()-1 : f;
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
bool getFrameNr(u32& frameNr, u32 index, u32 time, bool loop) const;
|
||||
|
||||
struct SDrawBatch
|
||||
{
|
||||
|
Reference in New Issue
Block a user