# HG changeset patch # User nemo # Date 1307932478 14400 # Node ID f34f391a223bca09267ad2b40ea97857dedcf9ef # Parent 46ddaf14509dcda335e8dbec65c144d7e10e6cbe Bit more reusability diff -r 46ddaf14509d -r f34f391a223b hedgewars/ArgParsers.inc --- a/hedgewars/ArgParsers.inc Sun Jun 12 21:06:48 2011 -0400 +++ b/hedgewars/ArgParsers.inc Sun Jun 12 22:34:38 2011 -0400 @@ -34,7 +34,7 @@ procedure internalStartGameWithParameters(); var tmp: LongInt; begin - UserPathPrefix:= ParamStr(1)+'/Data'; + UserPathPrefix:= ParamStr(1); val(ParamStr(2), cScreenWidth); val(ParamStr(3), cScreenHeight); val(ParamStr(4), cBits); @@ -147,7 +147,7 @@ var paramIndex: LongInt; wrongParameter: boolean; begin - UserPathPrefix:= ParamStr(1)+'/Data'; + UserPathPrefix:= ParamStr(1); PathPrefix:= ParamStr(2); recordFileName:= ParamStr(3); paramIndex:= 4; diff -r 46ddaf14509d -r f34f391a223b hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Sun Jun 12 21:06:48 2011 -0400 +++ b/hedgewars/hwengine.pas Sun Jun 12 22:34:38 2011 -0400 @@ -214,7 +214,7 @@ cFullScreen:= false; cTimerInterval:= 8; PathPrefix:= 'Data'; - UserPathPrefix:= 'Data'; + UserPathPrefix:= '.'; cShowFPS:= {$IFDEF DEBUGFILE}true{$ELSE}false{$ENDIF}; val(gameArgs[0], ipcPort); val(gameArgs[1], cScreenWidth); @@ -240,7 +240,7 @@ AddFileLog(inttostr(i) + ': ' + ParamStr(i)); for p:= Succ(Low(TPathType)) to High(TPathType) do - if p <> ptMapCurrent then UserPathz[p]:= UserPathPrefix + '/' + Pathz[p]; + if p <> ptMapCurrent then UserPathz[p]:= UserPathPrefix + '/Data/' + Pathz[p]; for p:= Succ(Low(TPathType)) to High(TPathType) do if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p]; diff -r 46ddaf14509d -r f34f391a223b hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Sun Jun 12 21:06:48 2011 -0400 +++ b/hedgewars/uMisc.pas Sun Jun 12 22:34:38 2011 -0400 @@ -79,7 +79,7 @@ // update header information and file name -filename:= ParamStr(1) + '/Screenshots/' + filename + '.bmp'; +filename:= UserPathPrefix + '/Screenshots/' + filename + '.bmp'; head[$02]:= (size + 54) and $ff; head[$03]:= ((size + 54) shr 8) and $ff; diff -r 46ddaf14509d -r f34f391a223b hedgewars/uSound.pas --- a/hedgewars/uSound.pas Sun Jun 12 21:06:48 2011 -0400 +++ b/hedgewars/uSound.pas Sun Jun 12 22:34:38 2011 -0400 @@ -375,7 +375,7 @@ if (not isSoundEnabled) or (MusicFN = '') or (not isMusicEnabled) then exit; - s:= UserPathPrefix + '/Music/' + MusicFN; + s:= UserPathPrefix + '/Data/Music/' + MusicFN; if not FileExists(s) then s:= PathPrefix + '/Music/' + MusicFN; WriteToConsole(msgLoading + s + ' '); diff -r 46ddaf14509d -r f34f391a223b hedgewars/uUtils.pas --- a/hedgewars/uUtils.pas Sun Jun 12 21:06:48 2011 -0400 +++ b/hedgewars/uUtils.pas Sun Jun 12 22:34:38 2011 -0400 @@ -359,7 +359,7 @@ i:= 0; while(i < 7) do begin - assign(f, ParamStr(1) + '/Logs/' + cLogfileBase + inttostr(i) + '.log'); + assign(f, UserPathPrefix + '/Logs/' + cLogfileBase + inttostr(i) + '.log'); rewrite(f); if IOResult = 0 then break; inc(i)