hedgewars/uStore.pas
changeset 1865 ebc6dfca60d4
parent 1854 6e05013899b2
child 1896 fdacad5d0acc
equal deleted inserted replaced
1864:71c2310a6f41 1865:ebc6dfca60d4
    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, Dir: LongInt; Angle: real);
    34 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: 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 DrawCentered(X, Top: LongInt; Source: PTexture);
    36 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
    37 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    37 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    38 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real; Invulnerable: boolean);
    38 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    39 procedure DrawFillRect(r: TSDL_Rect);
    39 procedure DrawFillRect(r: TSDL_Rect);
    40 function  RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture;
    40 function  RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture;
    41 procedure RenderHealth(var Hedgehog: THedgehog);
    41 procedure RenderHealth(var Hedgehog: THedgehog);
    42 procedure AddProgress;
    42 procedure AddProgress;
    43 procedure FinishProgress;
    43 procedure FinishProgress;
   494 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
   494 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
   495 begin
   495 begin
   496 DrawTexture(X - Source^.w div 2, Top, Source)
   496 DrawTexture(X - Source^.w div 2, Top, Source)
   497 end;
   497 end;
   498 
   498 
   499 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real; Invulnerable: boolean);
   499 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
   500 var l, r, t, b: real;
   500 var l, r, t, b: real;
   501 begin
   501 begin
   502 
   502 
   503 t:= Pos * 32 / HHTexture^.h;
   503 t:= Pos * 32 / HHTexture^.h;
   504 b:= (Pos + 1) * 32 / HHTexture^.h;
   504 b:= (Pos + 1) * 32 / HHTexture^.h;
   519 glRotatef(Angle, 0, 0, 1);
   519 glRotatef(Angle, 0, 0, 1);
   520 
   520 
   521 glBindTexture(GL_TEXTURE_2D, HHTexture^.id);
   521 glBindTexture(GL_TEXTURE_2D, HHTexture^.id);
   522 
   522 
   523 glBegin(GL_QUADS);
   523 glBegin(GL_QUADS);
   524 
       
   525 if Invulnerable then // twiddling the channels a bit. perhaps a pixmap or something would be better.
       
   526     glColor4ub($CC, $FF, $0, $C0);
       
   527 
   524 
   528 glTexCoord2f(l, t);
   525 glTexCoord2f(l, t);
   529 glVertex2i(-16, -16);
   526 glVertex2i(-16, -16);
   530 
   527 
   531 glTexCoord2f(r, t);
   528 glTexCoord2f(r, t);