hedgewars/uMisc.pas
changeset 3533 03892fb97ab3
parent 3513 f589230fa21b
child 3534 51521238724f
equal deleted inserted replaced
3532:04e2fea3e83a 3533:03892fb97ab3
   168 {$IFNDEF IPHONEOS}
   168 {$IFNDEF IPHONEOS}
   169 procedure MakeScreenshot(filename: shortstring);
   169 procedure MakeScreenshot(filename: shortstring);
   170 {$ENDIF}
   170 {$ENDIF}
   171 
   171 
   172 implementation
   172 implementation
   173 uses Math, uConsole, uStore, uIO, uSound, typinfo;
   173 uses Math, uConsole, uStore, uIO, uSound, typinfo, sysutils;
   174 
   174 
   175 var KBnum: Longword;
   175 var KBnum: Longword;
   176 {$IFDEF DEBUGFILE}
   176 {$IFDEF DEBUGFILE}
   177     f: textfile;
   177     f: textfile;
   178 {$ENDIF}
   178 {$ENDIF}
   773 {$I-}
   773 {$I-}
   774 {$IFDEF IPHONEOS}
   774 {$IFDEF IPHONEOS}
   775     Assign(f,'../Documents/debug.txt');
   775     Assign(f,'../Documents/debug.txt');
   776     Rewrite(f);
   776     Rewrite(f);
   777 {$ELSE}
   777 {$ELSE}
   778     if ParamStr(1) <> '' then
   778     if (ParamStr(1) <> '') and (ParamStr(2) <> '') then
   779         begin
   779         begin
   780         for i:= 0 to 7 do
   780         for i:= 0 to 7 do
   781         begin
   781         begin
   782             assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
   782             assign(f, ExtractFileDir(ParamStr(2)) + '/debug' + inttostr(i) + '.txt');
   783             rewrite(f);
   783             rewrite(f);
   784             if IOResult = 0 then break;
   784             if IOResult = 0 then break;
   785         end;
   785         end;
   786         if IOResult <> 0 then f:= stderr; // if everything fails, write to stderr
   786         if IOResult <> 0 then f:= stderr; // if everything fails, write to stderr
   787         end
   787         end