hedgewars/uStore.pas
changeset 42 72ffe21f027c
parent 38 c1ec4b15d70e
child 43 e297fea1a2f3
equal deleted inserted replaced
41:5d7a505875cd 42:72ffe21f027c
    35 interface
    35 interface
    36 uses uConsts, uTeams, SDLh;
    36 uses uConsts, uTeams, SDLh;
    37 {$INCLUDE options.inc}
    37 {$INCLUDE options.inc}
    38 
    38 
    39 type PRangeArray = ^TRangeArray;
    39 type PRangeArray = ^TRangeArray;
    40      TRangeArray = array[byte] of record
    40      TRangeArray = array[0..31] of record
    41                                   Left, Right: integer;
    41                                    Left, Right: integer;
    42                                   end;
    42                                    end;
    43 
    43 
    44 procedure StoreInit;
    44 procedure StoreInit;
    45 procedure StoreLoad;
    45 procedure StoreLoad;
    46 procedure StoreRelease;
    46 procedure StoreRelease;
    47 procedure DrawGear(Stuff : TStuff; X, Y: integer; Surface: PSDL_Surface);
    47 procedure DrawGear(Stuff : TStuff; X, Y: integer; Surface: PSDL_Surface);
    50 procedure DrawLand (X, Y: integer; Surface: PSDL_Surface);
    50 procedure DrawLand (X, Y: integer; Surface: PSDL_Surface);
    51 procedure DXOutText(X, Y: Integer; Font: THWFont; s: string; Surface: PSDL_Surface);
    51 procedure DXOutText(X, Y: Integer; Font: THWFont; s: string; Surface: PSDL_Surface);
    52 procedure DrawCaption(X, Y: integer; Rect: TSDL_Rect; Surface: PSDL_Surface; const fromTempSurf: boolean = false);
    52 procedure DrawCaption(X, Y: integer; Rect: TSDL_Rect; Surface: PSDL_Surface; const fromTempSurf: boolean = false);
    53 procedure DrawHedgehog(X, Y: integer; Dir: integer; Pos, Step: LongWord; Surface: PSDL_Surface);
    53 procedure DrawHedgehog(X, Y: integer; Dir: integer; Pos, Step: LongWord; Surface: PSDL_Surface);
    54 procedure DrawExplosion(X, Y, Radius: integer);
    54 procedure DrawExplosion(X, Y, Radius: integer);
    55 procedure DrawHLineExplosions(ar: PRangeArray; Radius: Longword; y, dY: integer; Count: Byte);
    55 procedure DrawHLinesExplosions(ar: PRangeArray; Radius: Longword; y, dY: integer; Count: Byte);
    56 procedure DrawTunnel(X, Y, dX, dY: real; ticks, HalfWidth: integer);
    56 procedure DrawTunnel(X, Y, dX, dY: real; ticks, HalfWidth: integer);
    57 procedure RenderHealth(var Hedgehog: THedgehog);
    57 procedure RenderHealth(var Hedgehog: THedgehog);
    58 function  RenderString(var s: shortstring; Color, Pos: integer): TSDL_Rect;
    58 function  RenderString(var s: shortstring; Color, Pos: integer): TSDL_Rect;
    59 procedure AddProgress;
    59 procedure AddProgress;
    60 function  LoadImage(filename: string; hasAlpha: boolean): PSDL_Surface;
    60 function  LoadImage(filename: string; hasAlpha: boolean): PSDL_Surface;
   123    SDL_UnlockSurface(LandSurface);
   123    SDL_UnlockSurface(LandSurface);
   124 
   124 
   125 SDL_UpdateRect(LandSurface, X - Radius, Y - Radius, Radius * 2, Radius * 2)
   125 SDL_UpdateRect(LandSurface, X - Radius, Y - Radius, Radius * 2, Radius * 2)
   126 end;
   126 end;
   127 
   127 
   128 procedure DrawHLineExplosions(ar: PRangeArray; Radius: Longword; y, dY: integer; Count: Byte);
   128 procedure DrawHLinesExplosions(ar: PRangeArray; Radius: Longword; y, dY: integer; Count: Byte);
   129 var tx, ty, i, p: integer;
   129 var tx, ty, i, p: integer;
   130 begin
   130 begin
   131 if SDL_MustLock(LandSurface) then
   131 if SDL_MustLock(LandSurface) then
   132    SDL_LockSurface(LandSurface);
   132    SDL_LockSurface(LandSurface);
   133 
   133