hedgewars/uRender.pas
changeset 5235 e30b06ffea3a
parent 4976 088d40d8aba2
child 5441 39962b855540
equal deleted inserted replaced
5233:e0b78b11d223 5235:e30b06ffea3a
   264 end;
   264 end;
   265 
   265 
   266 procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt);
   266 procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt);
   267 var row, col, numFramesFirstCol: LongInt;
   267 var row, col, numFramesFirstCol: LongInt;
   268 begin
   268 begin
       
   269 if SpritesData[Sprite].imageHeight = 0 then exit;
   269 numFramesFirstCol:= SpritesData[Sprite].imageHeight div SpritesData[Sprite].Height;
   270 numFramesFirstCol:= SpritesData[Sprite].imageHeight div SpritesData[Sprite].Height;
   270 row:= Frame mod numFramesFirstCol;
   271 row:= Frame mod numFramesFirstCol;
   271 col:= Frame div numFramesFirstCol;
   272 col:= Frame div numFramesFirstCol;
   272 DrawSprite2 (Sprite, X, Y, col, row);
   273 DrawSprite2 (Sprite, X, Y, col, row);
   273 end;
   274 end;