Change default output to stderr since /tmp doesn't exist under windows and is useless under iphoneos, add a couple of extra parameters
--- 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
--- 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);
--- 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);
--- 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.
--- 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;