hedgewars/uStore.pas
changeset 842 fae2fae2fe8d
parent 841 0700e3d3474d
child 843 27b5180d0988
equal deleted inserted replaced
841:0700e3d3474d 842:fae2fae2fe8d
    31 procedure DrawLand (X, Y: LongInt);
    31 procedure DrawLand (X, Y: LongInt);
    32 procedure DrawTexture(X, Y: LongInt; Texture: PTexture);
    32 procedure DrawTexture(X, Y: LongInt; Texture: PTexture);
    33 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
    33 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real);
    34 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame: LongInt; Angle: real);
    34 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame: LongInt; Angle: real);
    35 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
    35 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
    36 procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface);
       
    37 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
    36 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
    38 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    37 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    39 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    38 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    40 function  RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture;
    39 function  RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture;
    41 procedure RenderHealth(var Hedgehog: THedgehog);
    40 procedure RenderHealth(var Hedgehog: THedgehog);
   445 r.y:= Frame * Height;
   444 r.y:= Frame * Height;
   446 r.h:= Height;
   445 r.h:= Height;
   447 DrawFromRect(X, Y, @r, Source)
   446 DrawFromRect(X, Y, @r, Source)
   448 end;
   447 end;
   449 
   448 
   450 procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface);
       
   451 var clr: TSDL_Color;
       
   452     tmpsurf: PSDL_Surface;
       
   453     r: TSDL_Rect;
       
   454 begin
       
   455 r.x:= X;
       
   456 r.y:= Y;
       
   457 clr.r:= $FF;
       
   458 clr.g:= $FF;
       
   459 clr.b:= $FF;
       
   460 tmpsurf:= TTF_RenderUTF8_Solid(Fontz[Font].Handle, Str2PChar(s), clr.value);
       
   461 if tmpsurf = nil then
       
   462    begin
       
   463    SetKB(1);
       
   464    exit
       
   465    end;
       
   466 SDL_UpperBlit(tmpsurf, nil, Surface, @r);
       
   467 SDL_FreeSurface(tmpsurf)
       
   468 end;
       
   469 
       
   470 procedure DrawLand(X, Y: LongInt);
   449 procedure DrawLand(X, Y: LongInt);
   471 begin
   450 begin
   472 DrawTexture(X, Y, LandTexture)
   451 DrawTexture(X, Y, LandTexture)
   473 end;
   452 end;
   474 
   453