137 var i: LongInt; |
137 var i: LongInt; |
138 cPhysfsId: shortstring; |
138 cPhysfsId: shortstring; |
139 begin |
139 begin |
140 {$IFDEF HWLIBRARY} |
140 {$IFDEF HWLIBRARY} |
141 //TODO: http://icculus.org/pipermail/physfs/2011-August/001006.html |
141 //TODO: http://icculus.org/pipermail/physfs/2011-August/001006.html |
142 cPhysfsId:= GetCurrentDir() + {$IFDEF DARWIN}'/Hedgewars.app/Contents/MacOS/' + {$ENDIF} ' hedgewars'; |
142 cPhysfsId:= GetCurrentDir() + {$IFDEF DARWIN}{$IFNDEF IPHONEOS}'/Hedgewars.app/Contents/MacOS/' + {$ENDIF}{$ENDIF} ' hedgewars'; |
143 {$ELSE} |
143 {$ELSE} |
144 cPhysfsId:= ParamStr(0); |
144 cPhysfsId:= ParamStr(0); |
145 {$ENDIF} |
145 {$ENDIF} |
146 |
146 |
147 i:= PHYSFS_init(Str2PChar(cPhysfsId)); |
147 i:= PHYSFS_init(Str2PChar(cPhysfsId)); |
148 AddFileLog('[PhysFS] init: ' + inttostr(i)); |
148 AddFileLog('[PhysFS] init: ' + inttostr(i)); |
149 |
149 |
150 i:= PHYSFS_mount(Str2PChar(PathPrefix), nil, false); |
150 i:= PHYSFS_mount(Str2PChar(PathPrefix), nil, false); |
151 AddFileLog('[PhysFS] mount ' + PathPrefix + ': ' + inttostr(i)); |
151 AddFileLog('[PhysFS] mount ' + PathPrefix + ': ' + inttostr(i)); |
152 i:= PHYSFS_mount(Str2PChar(UserPathPrefix + '/Data'), nil, false); |
152 i:= PHYSFS_mount(Str2PChar(UserPathPrefix + '/'), '/', false); |
153 AddFileLog('[PhysFS] mount ' + UserPathPrefix + '/Data: ' + inttostr(i)); |
153 AddFileLog('[PhysFS] mount ' + UserPathPrefix + '/: ' + inttostr(i)); |
154 |
154 |
155 hedgewarsMountPackages; |
155 hedgewarsMountPackages; |
156 end; |
156 end; |
157 |
157 |
158 procedure freeModule; |
158 procedure freeModule; |