DEADSOFTWARE

show map loading update once per 300 msec; it nearly halves loading times for huge...
[d2df-sdl.git] / src / game / g_map.pas
index f2922d4a9622c4f47d342a973a4e58b79d8b4694..bd2b4508903eba80ee82a6956af853c201594878 100644 (file)
@@ -1505,6 +1505,7 @@ var
   rec, texrec: TDynRecord;
   pttit: PTRec;
   pannum, trignum, cnt, tgpid: Integer;
+  stt: UInt64;
 begin
   mapGrid.Free();
   mapGrid := nil;
@@ -1554,6 +1555,8 @@ begin
     e_LogWritefln('Loading map: %s', [mapResName], MSG_NOTIFY);
     g_Game_SetLoadingText(_lc[I_LOAD_MAP], 0, False);
 
+    stt := curTimeMicro();
+
     try
       mapReader := g_Map_ParseMap(Data, Len);
     except
@@ -2004,6 +2007,9 @@ begin
     begin
       gMusic.SetByName('');
     end;
+
+    stt := curTimeMicro()-stt;
+    e_LogWritefln('map loaded in %s.%s milliseconds', [Integer(stt div 1000), Integer(stt mod 1000)]);
   finally
     sfsGCEnable(); // enable releasing unused volumes
     mapReader.Free();