equal
deleted
inserted
replaced
524 DrawSprite2 (Sprite, X, Y, col, row); |
524 DrawSprite2 (Sprite, X, Y, col, row); |
525 end; |
525 end; |
526 |
526 |
527 procedure DrawSpriteClipped(Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt); |
527 procedure DrawSpriteClipped(Sprite: TSprite; X, Y, TopY, RightX, BottomY, LeftX: LongInt); |
528 var r: TSDL_Rect; |
528 var r: TSDL_Rect; |
529 numFramesFirstCol: LongInt; |
529 begin |
530 begin |
|
531 numFramesFirstCol:= SpritesData[Sprite].imageHeight div SpritesData[Sprite].Height; |
|
532 |
|
533 r.x:= 0; |
530 r.x:= 0; |
534 r.y:= 0; |
531 r.y:= 0; |
535 r.w:= SpritesData[Sprite].Width; |
532 r.w:= SpritesData[Sprite].Width; |
536 r.h:= SpritesData[Sprite].Height; |
533 r.h:= SpritesData[Sprite].Height; |
537 |
534 |
545 if (X + SpritesData[Sprite].Width > RightX) then |
542 if (X + SpritesData[Sprite].Width > RightX) then |
546 r.w:= RightX - X + 1; |
543 r.w:= RightX - X + 1; |
547 |
544 |
548 dec(r.h, r.y); |
545 dec(r.h, r.y); |
549 dec(r.w, r.x); |
546 dec(r.w, r.x); |
|
547 |
550 DrawFromRect(X + r.x, Y + r.y, @r, SpritesData[Sprite].Texture) |
548 DrawFromRect(X + r.x, Y + r.y, @r, SpritesData[Sprite].Texture) |
551 end; |
549 end; |
552 |
550 |
553 procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt); |
551 procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt); |
554 var r: TSDL_Rect; |
552 var r: TSDL_Rect; |