DEADSOFTWARE

changed license to GPLv3 only; sorry, no trust to FSF anymore
[d2df-sdl.git] / src / engine / e_soundfile_modplug.pas
index 01fd45544a05e7f9590bb10dc6a3abd0e32ecf34..0a2c280c656d0a111e50cae9e1b231b2b503bd9a 100644 (file)
@@ -2,8 +2,7 @@
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,7 +20,7 @@ interface
 uses e_soundfile, modplug;
 
 type
-  // a module loader that uses libxmp-lite
+  // a module loader that uses libmodplug
 
   TModPlugLoader = class (TSoundLoader)
   public
@@ -36,6 +35,7 @@ type
   end;
 
   TModPlugLoaderFactory = class (TSoundLoaderFactory)
+  public
     function MatchHeader(Data: Pointer; Len: LongWord): Boolean; override;
     function MatchExtension(FName: string): Boolean; override;
     function GetLoader(): TSoundLoader; override;
@@ -89,7 +89,12 @@ end;
 
 function TModPlugLoaderFactory.GetLoader(): TSoundLoader;
 begin
-  ModPlug_SetSettings(@Settings); // update settings just in case
+  // update interpolation setting
+  if e_MusicLerp then
+    Settings.mResamplingMode := MODPLUG_RESAMPLE_LINEAR
+  else
+    Settings.mResamplingMode := MODPLUG_RESAMPLE_NEAREST;
+  ModPlug_SetSettings(@Settings);
   Result := TModPlugLoader.Create();
 end;