hedgewars/uStore.pas
changeset 71 5f56c6979496
parent 70 82d93eeecebe
child 74 42257fee61ae
equal deleted inserted replaced
70:82d93eeecebe 71:5f56c6979496
   460 end;
   460 end;
   461 
   461 
   462 procedure AddProgress;
   462 procedure AddProgress;
   463 const Step: Longword = 0;
   463 const Step: Longword = 0;
   464       ProgrSurf: PSDL_Surface = nil;
   464       ProgrSurf: PSDL_Surface = nil;
   465       MaxCalls = 10; // MaxCalls should be the count of calls to AddProgress to prevent memory leakage
   465       MaxCalls = 11; // MaxCalls should be the count of calls to AddProgress to prevent memory leakage
   466 var r: TSDL_Rect;
   466 var r: TSDL_Rect;
   467 begin
   467 begin
   468 if Step = 0 then
   468 if Step = 0 then
   469    begin
   469    begin
   470    WriteToConsole(msgLoading + 'progress sprite... ');
   470    WriteToConsole(msgLoading + 'progress sprite... ');
   474    end;
   474    end;
   475 SDL_FillRect(SDLPrimSurface, nil, 0);
   475 SDL_FillRect(SDLPrimSurface, nil, 0);
   476 r.x:= 0;
   476 r.x:= 0;
   477 r.w:= 32;
   477 r.w:= 32;
   478 r.h:= 32;
   478 r.h:= 32;
   479 r.y:= Step * 32;
   479 r.y:= (Step mod 10) * 32;
   480 DrawFromRect(cScreenWidth div 2 - 16, cScreenHeight div 2 - 16, @r, ProgrSurf, SDLPrimSurface);
   480 DrawFromRect(cScreenWidth div 2 - 16, cScreenHeight div 2 - 16, @r, ProgrSurf, SDLPrimSurface);
   481 SDL_Flip(SDLPrimSurface);
   481 SDL_Flip(SDLPrimSurface);
   482 inc(Step);
   482 inc(Step);
   483 if Step = MaxCalls then
   483 if Step = MaxCalls then
   484    begin
   484    begin