hedgewars/uUtils.pas
branchwebgl
changeset 9966 01e198990211
parent 9950 2759212a27de
child 10015 4feced261c68
equal deleted inserted replaced
9964:12b0ed9910cd 9966:01e198990211
   349 end;
   349 end;
   350 
   350 
   351 procedure AddFileLogRaw(s: pchar); cdecl;
   351 procedure AddFileLogRaw(s: pchar); cdecl;
   352 begin
   352 begin
   353 s:= s;
   353 s:= s;
       
   354 {$IFNDEF PAS2C}
   354 {$IFDEF DEBUGFILE}
   355 {$IFDEF DEBUGFILE}
   355 {$IFDEF USE_VIDEO_RECORDING}
   356 {$IFDEF USE_VIDEO_RECORDING}
   356 EnterCriticalSection(logMutex);
   357 EnterCriticalSection(logMutex);
   357 {$ENDIF}
   358 {$ENDIF}
   358 write(f, s);
   359 write(f, s);
   359 flush(f);
   360 flush(f);
   360 {$IFDEF USE_VIDEO_RECORDING}
   361 {$IFDEF USE_VIDEO_RECORDING}
   361 LeaveCriticalSection(logMutex);
   362 LeaveCriticalSection(logMutex);
       
   363 {$ENDIF}
   362 {$ENDIF}
   364 {$ENDIF}
   363 {$ENDIF}
   365 {$ENDIF}
   364 end;
   366 end;
   365 
   367 
   366 function CheckCJKFont(s: ansistring; font: THWFont): THWFont;
   368 function CheckCJKFont(s: ansistring; font: THWFont): THWFont;
   505         logfileBase:= 'preview';
   507         logfileBase:= 'preview';
   506 {$IFDEF USE_VIDEO_RECORDING}
   508 {$IFDEF USE_VIDEO_RECORDING}
   507     InitCriticalSection(logMutex);
   509     InitCriticalSection(logMutex);
   508 {$ENDIF}
   510 {$ENDIF}
   509 {$I-}
   511 {$I-}
       
   512 {$IFNDEF PAS2C}
   510     f:= stderr; // if everything fails, write to stderr
   513     f:= stderr; // if everything fails, write to stderr
       
   514 {$ENDIF}
   511     if (UserPathPrefix <> '') then
   515     if (UserPathPrefix <> '') then
   512         begin
   516         begin
       
   517         {$IFNDEF PAS2C}
   513         // create directory if it doesn't exist
   518         // create directory if it doesn't exist
   514         if not FileExists(UserPathPrefix + '/Logs/') then
   519         if not FileExists(UserPathPrefix + '/Logs/') then
   515             CreateDir(UserPathPrefix + '/Logs/');
   520             CreateDir(UserPathPrefix + '/Logs/');
   516 
   521         {$ENDIF}
   517         // if log is locked, write to the next one
   522         // if log is locked, write to the next one
   518         i:= 0;
   523         i:= 0;
   519         while(i < 7) do
   524         while(i < 7) do
   520             begin
   525             begin
   521             assign(f, UserPathPrefix + '/Logs/' + logfileBase + inttostr(i) + '.log');
   526             assign(f, UserPathPrefix + '/Logs/' + logfileBase + inttostr(i) + '.log');