hedgewars/uUtils.pas
changeset 14951 23fc5022bdea
parent 14901 63357ed39886
child 14953 f27f00fabc0d
equal deleted inserted replaced
14950:00cf807b7faa 14951:23fc5022bdea
   524 
   524 
   525 {$ENDIF}
   525 {$ENDIF}
   526 end;
   526 end;
   527 
   527 
   528 procedure AddFileLogRaw(s: pchar); cdecl;
   528 procedure AddFileLogRaw(s: pchar); cdecl;
       
   529 var tmp: shortstring;
   529 begin
   530 begin
   530 s:= s;
   531 s:= s;
   531 {$IFNDEF PAS2C}
   532 {$IFNDEF PAS2C}
   532 {$IFDEF DEBUGFILE}
   533 {$IFDEF DEBUGFILE}
   533 {$IFDEF USE_VIDEO_RECORDING}
   534 {$IFDEF USE_VIDEO_RECORDING}
   534 if SDL_LockMutex(logMutex) <> 0 then
   535 if SDL_LockMutex(logMutex) <> 0 then
   535     OutError('Logging mutex could not be locked!', true);
   536     OutError('Logging mutex could not be locked!', true);
   536 {$ENDIF}
   537 {$ENDIF}
   537 // TODO: uncomment next two lines
   538 tmp:= IntToStr(GameTicks) + ': ';
   538 // write(logFile, s);
   539 if (logFile <> nil) then
   539 // flush(logFile);
   540     begin
       
   541     pfsWriteRaw(logFile, Str2PChar(tmp), StrLen(Str2PChar(tmp)));
       
   542     pfsWriteRaw(logFile, s, StrLen(s));
       
   543     end
       
   544 else
       
   545     begin
       
   546     Write(stdout, Str2PChar(tmp));
       
   547     Flush(stdout);
       
   548     end;
   540 {$IFDEF USE_VIDEO_RECORDING}
   549 {$IFDEF USE_VIDEO_RECORDING}
   541 if SDL_UnlockMutex(logMutex) <> 0 then
   550 if SDL_UnlockMutex(logMutex) <> 0 then
   542     OutError('Logging mutex could not be unlocked!', true);
   551     OutError('Logging mutex could not be unlocked!', true);
   543 {$ENDIF}
   552 {$ENDIF}
   544 {$ENDIF}
   553 {$ENDIF}