# HG changeset patch
# User nemo
# Date 1244767176 0
# Node ID 3d2917be12c320fb342933fa17bb2ba1817e4a2c
# Parent  e41fdfaa8edd6941b9e2a6ab4c6285c16aec807d
Change default output to stderr since /tmp doesn't exist under windows and is useless under iphoneos, add a couple of extra parameters

diff -r e41fdfaa8edd -r 3d2917be12c3 hedgewars/hwengine.dpr
--- a/hedgewars/hwengine.dpr	Thu Jun 11 15:57:51 2009 +0000
+++ b/hedgewars/hwengine.dpr	Fri Jun 12 00:39:36 2009 +0000
@@ -305,6 +305,8 @@
 			if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p]
 	end;
  15: begin
+		PathPrefix:= ParamStr(1);
+		recordFileName:= ParamStr(2);
 		if ParamStr(3) = '--set-everything' then
 		begin
 			val(ParamStr(4), cScreenWidth);
@@ -368,7 +370,9 @@
 if recordFileName = '' then
 	SendIPCAndWaitReply('C')        // ask for game config
 else
+ begin
 	LoadRecordFromFile(recordFileName);
+ end;
 
 s:= 'eproto ' + inttostr(cNetProtoVersion);
 SendIPCRaw(@s[0], Length(s) + 1); // send proto version
diff -r e41fdfaa8edd -r 3d2917be12c3 hedgewars/uIO.pas
--- a/hedgewars/uIO.pas	Thu Jun 11 15:57:51 2009 +0000
+++ b/hedgewars/uIO.pas	Fri Jun 12 00:39:36 2009 +0000
@@ -256,7 +256,7 @@
 		or (headcmd^.cmd = 'F')) do
 	begin
 	case headcmd^.cmd of
-		'+': ; // do nothing - it's just empty packet
+		'+': ; // do nothing - it is just empty packet
 		'L': ParseCommand('+left', true);
 		'l': ParseCommand('-left', true);
 		'R': ParseCommand('+right', true);
diff -r e41fdfaa8edd -r 3d2917be12c3 hedgewars/uLand.pas
--- a/hedgewars/uLand.pas	Thu Jun 11 15:57:51 2009 +0000
+++ b/hedgewars/uLand.pas	Fri Jun 12 00:39:36 2009 +0000
@@ -78,7 +78,7 @@
    digest:= s
 else
 {$IFDEF IPHONEOS}
-   //TryDo(s = digest, 'Different maps generated, sorry', false)
+   //TryDo(s = digest, 'Different maps generated, sorry', false)  FIXME - digest calc needs endian handling
 {$ELSE}
    TryDo(s = digest, 'Different maps generated, sorry', true)
 {$ENDIF}
@@ -632,8 +632,8 @@
 // Hi unC0Rr.
 // This is a function that Tiy assures me would not be good for gameplay.
 // It allows the setting of arbitrary portions of landscape as indestructible, or regular, or even blank.
-// He said I could add it here only when I swore it wouldn't impact gameplay.  Which, as far as I can tell, is true.
-// I'd just like to play with it with my friends if you don't mind.
+// He said I could add it here only when I swore it would not impact gameplay.  Which, as far as I can tell, is true.
+// I would just like to play with it with my friends if you do not mind.
 // Can allow for amusing maps.
 procedure LoadMask;
 var tmpsurf: PSDL_Surface;
@@ -677,7 +677,7 @@
 tmpsurf:= LoadImage(Pathz[ptMapCurrent] + '/map', true, true, true);
 TryDo((tmpsurf^.w <= LAND_WIDTH) and (tmpsurf^.h <= LAND_HEIGHT), 'Map dimensions too big!', true);
 
-// unC0Rr - should this be passed from the GUI? I'm not sure which layer does what
+// unC0Rr - should this be passed from the GUI? I am not sure which layer does what
 s:= Pathz[ptMapCurrent] + '/map.cfg';
 WriteLnToConsole('Fetching map HH limit');
 Assign(f, s);
diff -r e41fdfaa8edd -r 3d2917be12c3 hedgewars/uMisc.pas
--- a/hedgewars/uMisc.pas	Thu Jun 11 15:57:51 2009 +0000
+++ b/hedgewars/uMisc.pas	Fri Jun 12 00:39:36 2009 +0000
@@ -536,6 +536,10 @@
 {$IFDEF DEBUGFILE}
 procedure AddFileLog(s: shortstring);
 begin
+{$IFDEF IPHONEOS}
+//we are not able (and it is useless) to write a file on device, so we will print on the computer console instead
+f:=stderr;
+{$ENDIF}
 writeln(f, GameTicks: 6, ': ', s);
 flush(f)
 end;
@@ -560,28 +564,26 @@
 
 {$IFDEF DEBUGFILE}
 {$I-}
-if ParamCount >= 0 then
- //this check prevents a crash in Mac OS X
- if ParamCount = 0 then
- begin
-	Assign(f, '/tmp/debug.txt');
-    rewrite(f);
- end else
- begin
-  for i:= 0 to 7 do
-    begin
-    Assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
-    rewrite(f);
-    if IOResult = 0 then break
+f:=stderr;
+rewrite(f);
+{$IFNDEF IPHONEOS}
+if ParamCount <> 0 then
+   for i:= 0 to 7 do
+    begin 
+	  assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
+      rewrite(f);
+      if IOResult = 0 then break
     end;
- end;
+{$ENDIF}
 {$I+}
 
 finalization
 //uRandom.DumpBuffer;
-writeln(f, '-= halt at ',GameTicks,' ticks =-');
-Flush(f);
+
+writeln(f, 'halt at ',GameTicks,' ticks');
+flush(f);
 close(f)
+
 {$ENDIF}
 
 end.
diff -r e41fdfaa8edd -r 3d2917be12c3 hedgewars/uStore.pas
--- a/hedgewars/uStore.pas	Thu Jun 11 15:57:51 2009 +0000
+++ b/hedgewars/uStore.pas	Fri Jun 12 00:39:36 2009 +0000
@@ -714,7 +714,7 @@
 cornerHeight:= SpritesData[corner].Height;
 // This one screws up WrapText
 //s:= 'This is the song that never ends.  ''cause it goes on and on my friends. Some people, started singing it not knowing what it was. And they''ll just go on singing it forever just because... This is the song that never ends...';
-// This one doesn't
+// This one does not
 //s:= 'This is the song that never ends.  cause it goes on and on my friends. Some people, started singing it not knowing what it was. And they will go on singing it forever just because... This is the song that never ends... ';
 
 numLines:= 0;