hedgewars/uStore.pas
changeset 1854 6e05013899b2
parent 1806 3c4f0886c123
child 1865 ebc6dfca60d4
equal deleted inserted replaced
1853:5618915f9ea4 1854:6e05013899b2
    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);
    38 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real; Invulnerable: boolean);
    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);
   499 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real; Invulnerable: boolean);
   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;
   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 
   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 
   525 glTexCoord2f(l, t);
   528 glTexCoord2f(l, t);
   526 glVertex2i(-16, -16);
   529 glVertex2i(-16, -16);
   527 
   530 
   528 glTexCoord2f(r, t);
   531 glTexCoord2f(r, t);
   529 glVertex2i(16, -16);
   532 glVertex2i(16, -16);
   532 glVertex2i(16, 16);
   535 glVertex2i(16, 16);
   533 
   536 
   534 glTexCoord2f(l, b);
   537 glTexCoord2f(l, b);
   535 glVertex2i(-16, 16);
   538 glVertex2i(-16, 16);
   536 
   539 
       
   540 
   537 glEnd();
   541 glEnd();
       
   542 glColor4f(1,1,1,1);
   538 
   543 
   539 glPopMatrix
   544 glPopMatrix
   540 end;
   545 end;
   541 
   546 
   542 procedure DrawFillRect(r: TSDL_Rect);
   547 procedure DrawFillRect(r: TSDL_Rect);