diff -r 50fe80adbfcb -r 0b4ac686fc44 hedgewars/uPhysFSLayer.pas --- a/hedgewars/uPhysFSLayer.pas Tue Dec 18 20:48:37 2012 +0400 +++ b/hedgewars/uPhysFSLayer.pas Fri Jan 04 21:44:40 2013 +0400 @@ -40,7 +40,7 @@ procedure physfsReaderSetBuffer(buf: pointer); cdecl; external PhysfsLibName; implementation -uses uUtils, uVariables; +uses uUtils, uVariables, sysutils; function PHYSFS_init(argv0: PChar) : LongInt; cdecl; external PhysfsLibName; function PHYSFS_deinit() : LongInt; cdecl; external PhysfsLibName; @@ -135,8 +135,16 @@ procedure initModule; var i: LongInt; + cPhysfsId: shortstring; begin - i:= PHYSFS_init(Str2PChar(ParamStr(0))); +{$IFDEF HWLIBRARY} + //TODO: http://icculus.org/pipermail/physfs/2011-August/001006.html + cPhysfsId:= GetCurrentDir() + {$IFDEF DARWIN}'/Hedgewars.app/Contents/MacOS/' + {$ENDIF} ' hedgewars'; +{$ELSE} + cPhysfsId:= ParamStr(0); +{$ENDIF} + + i:= PHYSFS_init(Str2PChar(cPhysfsId)); AddFileLog('[PhysFS] init: ' + inttostr(i)); i:= PHYSFS_mount(Str2PChar(PathPrefix), nil, true);