- Init physfs before creating debug log
authorunc0rr
Sat, 02 Apr 2016 23:32:57 +0300
changeset 11644 f17df78181d8
parent 11643 3bff941c035f
child 11645 e80fc50457a2
- Init physfs before creating debug log - Remove addfilelog calls from physfs init code
hedgewars/hwengine.pas
hedgewars/uPhysFSLayer.pas
--- a/hedgewars/hwengine.pas	Sat Apr 02 10:45:33 2016 +0300
+++ b/hedgewars/hwengine.pas	Sat Apr 02 23:32:57 2016 +0300
@@ -457,6 +457,12 @@
 
 procedure initEverything (complete:boolean);
 begin
+    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);
+
     uUtils.initModule(complete);    // opens the debug file, must be the first
     uVariables.initModule;          // inits all global variables
     uCommands.initModule;           // helps below
@@ -466,12 +472,6 @@
     uLandPainted.initModule;        // computes drawn land
     uIO.initModule;                 // sets up sockets
 
-    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
--- a/hedgewars/uPhysFSLayer.pas	Sat Apr 02 10:45:33 2016 +0300
+++ b/hedgewars/uPhysFSLayer.pas	Sat Apr 02 23:32:57 2016 +0300
@@ -181,10 +181,7 @@
 
 procedure pfsMount(path: PChar; mountpoint: PChar);
 begin
-    if PHYSFS_mount(path, mountpoint, false) then
-        AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : ok')
-    else
-        AddFileLog('[PhysFS] mount ' + shortstring(path) + ' at ' + shortstring(mountpoint) + ' : FAILED ("' + shortstring(PHYSFS_getLastError()) + '")');
+    PHYSFS_mount(path, mountpoint, false)
 end;
 
 procedure pfsMountAtRoot(path: PChar);
@@ -207,7 +204,7 @@
 {$ENDIF}
 
     i:= PHYSFS_init(Str2PChar(cPhysfsId));
-    AddFileLog('[PhysFS] init: ' + inttostr(i));
+    //AddFileLog('[PhysFS] init: ' + inttostr(i));
 
 {$IFNDEF MOBILE}
     // mount system fonts paths first