hedgewars/uPhysFSLayer.pas
branchqmlfrontend
changeset 10424 4be6cd55f1cf
parent 10129 cd2a64a1f4aa
child 10434 1614b13ad35e
--- a/hedgewars/uPhysFSLayer.pas	Fri Sep 26 00:56:36 2014 +0400
+++ b/hedgewars/uPhysFSLayer.pas	Sat Sep 27 12:49:08 2014 +0400
@@ -13,7 +13,7 @@
     {$linklib physlayer}
 {$ENDIF}
 
-procedure initModule;
+procedure initModule(localPrefix, userPrefix: PChar);
 procedure freeModule;
 
 type PFSFile = pointer;
@@ -138,9 +138,9 @@
 procedure pfsMount(path: ansistring; mountpoint: PChar);
 begin
     if PHYSFS_mount(PChar(path), mountpoint, false) then
-        AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : ok')
+        //AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : ok')
     else
-        AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : FAILED ("' + shortstring(PHYSFS_getLastError()) + '")');
+        //AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : FAILED ("' + shortstring(PHYSFS_getLastError()) + '")');
 end;
 
 procedure pfsMountAtRoot(path: ansistring);
@@ -148,20 +148,16 @@
     pfsMount(path, PChar(_S'/'));
 end;
 
-procedure initModule;
+procedure initModule(localPrefix, userPrefix: PChar);
 var i: LongInt;
     cPhysfsId: shortstring;
     fp: PChar;
 begin
-{$IFDEF HWLIBRARY}
     //TODO: http://icculus.org/pipermail/physfs/2011-August/001006.html
     cPhysfsId:= GetCurrentDir() + {$IFDEF DARWIN}{$IFNDEF IPHONEOS}'/Hedgewars.app/Contents/MacOS/' + {$ENDIF}{$ENDIF} ' hedgewars';
-{$ELSE}
-    cPhysfsId:= ParamStr(0);
-{$ENDIF}
 
     i:= PHYSFS_init(Str2PChar(cPhysfsId));
-    AddFileLog('[PhysFS] init: ' + inttostr(i));
+    //AddFileLog('[PhysFS] init: ' + inttostr(i));
 
     // mount system fonts paths first
     for i:= low(cFontsPaths) to high(cFontsPaths) do
@@ -171,13 +167,13 @@
                 pfsMount(ansistring(fp), PChar('/Fonts'));
         end;
 
-    pfsMountAtRoot(PathPrefix);
-    pfsMountAtRoot(UserPathPrefix + ansistring('/Data'));
+    pfsMountAtRoot(localPrefix);
+    pfsMountAtRoot(userPrefix + ansistring('/Data'));
 
     hedgewarsMountPackages;
 
     // need access to teams and frontend configs (for bindings)
-    pfsMountAtRoot(UserPathPrefix);
+    pfsMountAtRoot(userPrefix);
 
     {$IFNDEF PAS2C}
     if cTestLua then