# HG changeset patch # User unc0rr # Date 1459278034 -10800 # Node ID b3db79b56f28fc42419a4426a47841e714c47aca # Parent c2e6df2cfac77e7f532ed19b94afa4659f8b3209 Pass paths to initModule of uPhysFSLayer (as in 4be6cd55f1cf from qmlfrontend branch) diff -r c2e6df2cfac7 -r b3db79b56f28 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Tue Mar 29 16:54:07 2016 +0200 +++ b/hedgewars/hwengine.pas Tue Mar 29 22:00:34 2016 +0300 @@ -465,7 +465,13 @@ uLand.initModule; // computes land uLandPainted.initModule; // computes drawn land uIO.initModule; // sets up sockets - uPhysFSLayer.initModule; + + PathPrefix:= PathPrefix + #0; + UserPathPrefix:= UserPathPrefix + #0; + uPhysFSLayer.initModule(@PathPrefix[1], @UserPathPrefix[1]); + PathPrefix:= copy(PathPrefix, 1, length(PathPrefix) - 1); + UserPathPrefix:= copy(UserPathPrefix, 1, length(UserPathPrefix) - 1); + uScript.initModule; if complete then diff -r c2e6df2cfac7 -r b3db79b56f28 hedgewars/uPhysFSLayer.pas --- a/hedgewars/uPhysFSLayer.pas Tue Mar 29 16:54:07 2016 +0200 +++ b/hedgewars/uPhysFSLayer.pas Tue Mar 29 22:00:34 2016 +0300 @@ -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,7 +148,7 @@ pfsMount(path, PChar(_S'/')); end; -procedure initModule; +procedure initModule(localPrefix, userPrefix: PChar); var i: LongInt; cPhysfsId: shortstring; {$IFNDEF MOBILE} @@ -171,17 +171,17 @@ begin fp := cFontsPaths[i]; if fp <> nil then - pfsMount(ansistring(fp), PChar('/Fonts')); + pfsMount(ansistring(fp), _P'/Fonts'); end; {$ENDIF} - 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); if cTestLua then begin