hedgewars/uStore.pas
changeset 6492 71db3c0daa0a
parent 6453 11c578d30bd3
child 6515 74a04089bb56
equal deleted inserted replaced
6491:736479f3d348 6492:71db3c0daa0a
   116     end;
   116     end;
   117 
   117 
   118 SDL_FreeSurface(tmpsurf)
   118 SDL_FreeSurface(tmpsurf)
   119 end;
   119 end;
   120 
   120 
   121 procedure StoreLoad(reload: boolean);
   121 
   122 var s: shortstring;
   122 procedure WriteNames(Font: THWFont);
   123 
   123 var t: LongInt;
   124     procedure WriteNames(Font: THWFont);
   124     i: LongInt;
   125     var t: LongInt;
   125     r, rr: TSDL_Rect;
   126         i: LongInt;
   126     drY: LongInt;
   127         r, rr: TSDL_Rect;
   127     texsurf, flagsurf, iconsurf: PSDL_Surface;
   128         drY: LongInt;
   128     s: shortstring;
   129         texsurf, flagsurf, iconsurf: PSDL_Surface;
   129 begin
   130     begin
       
   131     r.x:= 0;
   130     r.x:= 0;
   132     r.y:= 0;
   131     r.y:= 0;
   133     drY:= - 4;
   132     drY:= - 4;
   134     for t:= 0 to Pred(TeamsCount) do
   133     for t:= 0 to Pred(TeamsCount) do
   135         with TeamsArray[t]^ do
   134         with TeamsArray[t]^ do
   218         DrawRoundRect(@r, cWhiteColor, cNearBlackColor, iconsurf, true);
   217         DrawRoundRect(@r, cWhiteColor, cNearBlackColor, iconsurf, true);
   219         ropeIconTex:= Surface2Tex(iconsurf, false);
   218         ropeIconTex:= Surface2Tex(iconsurf, false);
   220         SDL_FreeSurface(iconsurf);
   219         SDL_FreeSurface(iconsurf);
   221         iconsurf:= nil;
   220         iconsurf:= nil;
   222         end;
   221         end;
   223     end;
   222 end;
   224 
   223 
   225     procedure InitHealth;
   224 procedure InitHealth;
   226     var i, t: LongInt;
   225 var i, t: LongInt;
   227     begin
   226 begin
   228     for t:= 0 to Pred(TeamsCount) do
   227     for t:= 0 to Pred(TeamsCount) do
   229         if TeamsArray[t] <> nil then
   228         if TeamsArray[t] <> nil then
   230             with TeamsArray[t]^ do
   229             with TeamsArray[t]^ do
   231                 begin
   230                 begin
   232                 for i:= 0 to cMaxHHIndex do
   231                 for i:= 0 to cMaxHHIndex do
   233                     if Hedgehogs[i].Gear <> nil then
   232                     if Hedgehogs[i].Gear <> nil then
   234                         RenderHealth(Hedgehogs[i]);
   233                         RenderHealth(Hedgehogs[i]);
   235                 end
   234                 end
   236     end;
   235 end;
   237 
   236 
   238     procedure LoadGraves;
   237 procedure LoadGraves;
   239     var t: LongInt;
   238 var t: LongInt;
   240         texsurf: PSDL_Surface;
   239     texsurf: PSDL_Surface;
   241     begin
   240 begin
   242     for t:= 0 to Pred(TeamsCount) do
   241     for t:= 0 to Pred(TeamsCount) do
   243     if TeamsArray[t] <> nil then
   242     if TeamsArray[t] <> nil then
   244         with TeamsArray[t]^ do
   243         with TeamsArray[t]^ do
   245             begin
   244             begin
   246             if GraveName = '' then GraveName:= 'Statue';
   245             if GraveName = '' then GraveName:= 'Statue';
   249             if texsurf = nil then texsurf:= LoadImage(UserPathz[ptGraves] + '/Statue', ifTransparent);
   248             if texsurf = nil then texsurf:= LoadImage(UserPathz[ptGraves] + '/Statue', ifTransparent);
   250             if texsurf = nil then texsurf:= LoadImage(Pathz[ptGraves] + '/Statue', ifCritical or ifTransparent);
   249             if texsurf = nil then texsurf:= LoadImage(Pathz[ptGraves] + '/Statue', ifCritical or ifTransparent);
   251             GraveTex:= Surface2Tex(texsurf, false);
   250             GraveTex:= Surface2Tex(texsurf, false);
   252             SDL_FreeSurface(texsurf)
   251             SDL_FreeSurface(texsurf)
   253             end
   252             end
   254     end;
   253 end;
   255 
   254 
   256 var ii: TSprite;
   255 procedure StoreLoad(reload: boolean);
       
   256 var s: shortstring;
       
   257     ii: TSprite;
   257     fi: THWFont;
   258     fi: THWFont;
   258     ai: TAmmoType;
   259     ai: TAmmoType;
   259     tmpsurf: PSDL_Surface;
   260     tmpsurf: PSDL_Surface;
   260     i: LongInt;
   261     i: LongInt;
   261 begin
   262 begin