hedgewars/uStore.pas
changeset 3963 6090d2a2472e
parent 3940 cc29628976cc
child 3971 5c82ee165ed5
equal deleted inserted replaced
3962:e9ee2bd51e08 3963:6090d2a2472e
    18 
    18 
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 
    20 
    21 unit uStore;
    21 unit uStore;
    22 interface
    22 interface
    23 uses sysutils, uConsts, uTeams, SDLh, GLunit;
    23 uses sysutils, uConsts, uTeams, SDLh, GLunit, uWorld;
    24 
    24 
    25 
    25 
    26 var PixelFormat: PSDL_PixelFormat;
    26 var PixelFormat: PSDL_PixelFormat;
    27     SDLPrimSurface: PSDL_Surface;
    27     SDLPrimSurface: PSDL_Surface;
    28     PauseTexture,
    28     PauseTexture,
    56 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
    56 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
    57 procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    57 procedure DrawFromRect(X, Y, W, H: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    58 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    58 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture);
    59 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    59 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    60 procedure DrawFillRect(r: TSDL_Rect);
    60 procedure DrawFillRect(r: TSDL_Rect);
       
    61 procedure DrawCircle(X, Y, Radius: LongInt; Width: Single; r, g, b, a: Byte); 
    61 procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
    62 procedure DrawRoundRect(rect: PSDL_Rect; BorderColor, FillColor: Longword; Surface: PSDL_Surface; Clear: boolean);
    62 function  CheckCJKFont(s: ansistring; font: THWFont): THWFont;
    63 function  CheckCJKFont(s: ansistring; font: THWFont): THWFont;
    63 function  RenderStringTex(s: ansistring; Color: Longword; font: THWFont): PTexture;
    64 function  RenderStringTex(s: ansistring; Color: Longword; font: THWFont): PTexture;
    64 function  RenderSpeechBubbleTex(s: ansistring; SpeechType: Longword; font: THWFont): PTexture;
    65 function  RenderSpeechBubbleTex(s: ansistring; SpeechType: Longword; font: THWFont): PTexture;
    65 procedure flipSurface(Surface: PSDL_Surface; Vertical: Boolean);
    66 procedure flipSurface(Surface: PSDL_Surface; Vertical: Boolean);
   817 
   818 
   818 Tint($FF, $FF, $FF, $FF);
   819 Tint($FF, $FF, $FF, $FF);
   819 glEnable(GL_TEXTURE_2D)
   820 glEnable(GL_TEXTURE_2D)
   820 end;
   821 end;
   821 
   822 
       
   823 procedure DrawCircle(X, Y, Radius: LongInt; Width: Single; r, g, b, a: Byte); 
       
   824 var
       
   825     i: LongInt;
       
   826     CircleVertex: array [0..359] of TVertex2f;
       
   827 begin
       
   828     for i := 0 to 359 do begin
       
   829         CircleVertex[i].X := X + Radius*cos(i*pi/180);
       
   830         CircleVertex[i].Y := Y + Radius*sin(i*pi/180);
       
   831     end;
       
   832     glDisable(GL_TEXTURE_2D);
       
   833     glEnable(GL_LINE_SMOOTH);
       
   834     glPushMatrix;
       
   835     glTranslatef(WorldDx, WorldDy, 0);
       
   836     glLineWidth(Width);
       
   837     Tint(r, g, b, a);
       
   838     glVertexPointer(2, GL_FLOAT, 0, @CircleVertex[0]);
       
   839     glDrawArrays(GL_LINE_LOOP, 0, 360);
       
   840     Tint($FF, $FF, $FF, $FF);
       
   841     glPopMatrix;
       
   842     glEnable(GL_TEXTURE_2D);
       
   843     glDisable(GL_LINE_SMOOTH);
       
   844 end;
       
   845 
   822 procedure StoreRelease;
   846 procedure StoreRelease;
   823 var ii: TSprite;
   847 var ii: TSprite;
   824 begin
   848 begin
   825     for ii:= Low(TSprite) to High(TSprite) do
   849     for ii:= Low(TSprite) to High(TSprite) do
   826     begin
   850     begin