DEADSOFTWARE

Sound: Initial OpenAL driver impl
[d2df-sdl.git] / src / game / Doom2DF.lpr
index 3239be1e6fd0bd800cee48c3a34d2d362f708093..546cabf9f423cee29481327d8b4f4fca3b5a6190 100644 (file)
@@ -51,6 +51,11 @@ uses
   SDL2 in '../lib/sdl2/sdl2.pas',
 {$IFDEF USE_SDLMIXER}
   SDL2_mixer in '../lib/sdl2/SDL2_mixer.pas',
+{$ENDIF}
+{$IFDEF USE_OPENAL}
+  AL in '../lib/openal/al.pas',
+  e_soundfile in '../engine/e_soundfile.pas',
+  e_soundfile_wav in '../engine/e_soundfile_wav.pas',
 {$ENDIF}
   ENet in '../lib/enet/enet.pp',
   e_graphics in '../engine/e_graphics.pas',
@@ -172,12 +177,32 @@ begin
   SetEnvVar('TIMIDITY_CFG', 'timidity.cfg');
 {$ENDIF ANDROID}
 
-  for f := 1 to ParamCount do
+  f := 1;
+  while f <= ParamCount do
+  begin
+    case ParamStr(f) of
+    '--gdb': noct := true;
+    '--log': conbufDumpToStdOut := true;
+    '--safe-log': e_SetSafeSlowLog(true);
+    '--log-file':
+      if f + 1 <= ParamCount then
+      begin
+        Inc(f);
+        LogFileName := ParamStr(f)
+      end;
+    end;
+    Inc(f)
+  end;
+
+  if LogFileName = '' then
   begin
-         if ParamStr(f) = '--gdb' then noct := true
-    else if ParamStr(f) = '--log' then conbufDumpToStdOut := true
-    else if ParamStr(f) = '--safe-log' then e_SetSafeSlowLog(true);
+{$IFDEF HEADLESS}
+    LogFileName := 'Doom2DF_H.log';
+{$ELSE}
+    LogFileName := 'Doom2DF.log';
+{$ENDIF}
   end;
+
   if noct then
   begin
     Main()