Commit 942f6221 authored by bitplane's avatar bitplane

Fixed a bug in sprite bank, non-looping sprites cause a crash.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1179 dfc29bdd-3216-0410-991c-e03cc46cb475
parent bb7479ba
......@@ -103,7 +103,7 @@ void CGUISpriteBank::draw2DSprite(u32 index, const core::position2di& pos,
if (loop)
frame = f % Sprites[index].Frames.size();
else
frame = (f >= Sprites[index].Frames.size()) ? Sprites[index].Frames.size() : f;
frame = (f >= Sprites[index].Frames.size()) ? Sprites[index].Frames.size()-1 : f;
}
const video::ITexture* tex = Textures[Sprites[index].Frames[frame].textureNumber];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment