hedgewars/uWorld.pas
changeset 2851 a9a5ce1d9f23
parent 2850 f6f8db825ce7
child 2855 7e6adeb57427
equal deleted inserted replaced
2850:f6f8db825ce7 2851:a9a5ce1d9f23
   651 offset:= 10;
   651 offset:= 10;
   652 {$ENDIF}
   652 {$ENDIF}
   653 inc(Frames);
   653 inc(Frames);
   654 
   654 
   655 if cShowFPS or (GameType = gmtDemo) then inc(CountTicks, Lag);
   655 if cShowFPS or (GameType = gmtDemo) then inc(CountTicks, Lag);
   656 if (GameType = gmtDemo) and (not isSpeed) and (CountTicks >= 1000) then
   656 if (GameType = gmtDemo) and (CountTicks >= 1000) then
   657    begin
   657    begin
   658    i:=GameTicks div 60000;
   658    i:=GameTicks div 60000;
   659    t:=(GameTicks-(i*60000)) div 1000;
   659    t:=(GameTicks-(i*60000)) div 1000;
   660    s:='';
   660    s:='';
   661    if i<10 then s:='0';
   661    if i<10 then s:='0';
   662    s:= s+inttostr(i)+':';
   662    s:= s+inttostr(i)+':';
   663    if t<10 then s:=s+'0';
   663    if t<10 then s:=s+'0';
   664    s:= s+inttostr(t);
   664    s:= s+inttostr(t);
       
   665    if timeTexture <> nil then FreeTexture(timeTexture);
   665    tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(s), cWhiteColorChannels);
   666    tmpSurface:= TTF_RenderUTF8_Blended(Fontz[fnt16].Handle, Str2PChar(s), cWhiteColorChannels);
   666    tmpSurface:= doSurfaceConversion(tmpSurface);
   667    tmpSurface:= doSurfaceConversion(tmpSurface);
   667    timeTexture:= Surface2Tex(tmpSurface, false);
   668    timeTexture:= Surface2Tex(tmpSurface, false);
   668    SDL_FreeSurface(tmpSurface)
   669    SDL_FreeSurface(tmpSurface)
   669    end;
   670    end;