fix build and permissions problems when launching hwengine from command line
authorkoda
Tue, 22 Jun 2010 17:10:27 +0200
changeset 3533 03892fb97ab3
parent 3532 04e2fea3e83a
child 3534 51521238724f
fix build and permissions problems when launching hwengine from command line
hedgewars/uMisc.pas
misc/libopenalbridge/openalbridge.h
--- a/hedgewars/uMisc.pas	Mon Jun 21 22:45:52 2010 +0200
+++ b/hedgewars/uMisc.pas	Tue Jun 22 17:10:27 2010 +0200
@@ -170,7 +170,7 @@
 {$ENDIF}
 
 implementation
-uses Math, uConsole, uStore, uIO, uSound, typinfo;
+uses Math, uConsole, uStore, uIO, uSound, typinfo, sysutils;
 
 var KBnum: Longword;
 {$IFDEF DEBUGFILE}
@@ -775,11 +775,11 @@
     Assign(f,'../Documents/debug.txt');
     Rewrite(f);
 {$ELSE}
-    if ParamStr(1) <> '' then
+    if (ParamStr(1) <> '') and (ParamStr(2) <> '') then
         begin
         for i:= 0 to 7 do
         begin
-            assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
+            assign(f, ExtractFileDir(ParamStr(2)) + '/debug' + inttostr(i) + '.txt');
             rewrite(f);
             if IOResult = 0 then break;
         end;
--- a/misc/libopenalbridge/openalbridge.h	Mon Jun 21 22:45:52 2010 +0200
+++ b/misc/libopenalbridge/openalbridge.h	Tue Jun 22 17:10:27 2010 +0200
@@ -39,7 +39,7 @@
     int  openal_loadfile          (const char *filename);
 
     // unloads data from memory and marks a free spot
-    int  openal_unloadfile        (unsigned int index)
+    void openal_unloadfile        (unsigned int index);
     
     /******* other functions continue in commands.h *******/