--- a/hedgewars/uStore.pas Mon Jan 09 20:33:12 2006 +0000
+++ b/hedgewars/uStore.pas Tue Jan 10 19:53:18 2006 +0000
@@ -47,6 +47,7 @@
procedure DrawGear(Stuff : TStuff; X, Y: integer; Surface: PSDL_Surface);
procedure DrawSpriteFromRect(r: TSDL_Rect; X, Y, Height, Position: integer; Surface: PSDL_Surface);
procedure DrawSprite (Sprite: TSprite; X, Y, Position: integer; Surface: PSDL_Surface);
+procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: integer; Surface: PSDL_Surface);
procedure DrawLand (X, Y: integer; Surface: PSDL_Surface);
procedure DXOutText(X, Y: Integer; Font: THWFont; s: string; Surface: PSDL_Surface);
procedure DrawCaption(X, Y: integer; Rect: TSDL_Rect; Surface: PSDL_Surface; const fromTempSurf: boolean = false);
@@ -531,7 +532,7 @@
rr.h:= r.h;
if SDL_UpperBlit(SourceSurface, r, DestSurface, @rr) < 0 then
begin
- Writeln('Blit: ', SDL_GetError);
+ OutError('Blit: ' + SDL_GetError, true);
exit
end;
end;
@@ -558,6 +559,16 @@
DrawFromRect(X, Y, @r, SpritesData[Sprite].Surface, Surface)
end;
+procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: integer; Surface: PSDL_Surface);
+var r: TSDL_Rect;
+begin
+r.x:= FrameX * SpritesData[Sprite].Width;
+r.w:= SpritesData[Sprite].Width;
+r.y:= FrameY * SpritesData[Sprite].Height;
+r.h:= SpritesData[Sprite].Height;
+DrawFromRect(X, Y, @r, SpritesData[Sprite].Surface, Surface)
+end;
+
procedure DXOutText(X, Y: Integer; Font: THWFont; s: string; Surface: PSDL_Surface);
var clr: TSDL_Color;
tmpsurf: PSDL_Surface;