hedgewars/uStore.pas
changeset 3895 e7c202c08ac1
parent 3881 e570268a9d52
child 3897 27e115fa1143
equal deleted inserted replaced
3893:568bfd083465 3895:e7c202c08ac1
   730     r.h:= SpritesData[Sprite].Height;
   730     r.h:= SpritesData[Sprite].Height;
   731     DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
   731     DrawFromRect(X, Y, @r, SpritesData[Sprite].Texture)
   732 end;
   732 end;
   733 
   733 
   734 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
   734 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
   735 begin
   735 var scale: GLfloat;
   736 DrawTexture(X - Source^.w shr 1, Top, Source)
   736 begin
       
   737     if (Source^.w + 20) > cScreenWidth then
       
   738         scale:= cScreenWidth / (Source^.w + 20)
       
   739     else
       
   740         scale:= 1.0;
       
   741     DrawTexture(X - round((Source^.w * scale) div 2, Top, Source, scale)
   737 end;
   742 end;
   738 
   743 
   739 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
   744 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
   740 const VertexBuffer: array [0..3] of TVertex2f = (
   745 const VertexBuffer: array [0..3] of TVertex2f = (
   741         (x: -16; y: -16),
   746         (x: -16; y: -16),