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:
engineer_apple
2022-05-01 09:50:32 +00:00
committed by sfan5
parent 263f243523
commit 15e3f15b48
2 changed files with 35 additions and 32 deletions

View File

@ -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
{