|
From: <sag...@us...> - 2015-03-02 00:25:55
|
Revision: 4805
http://sourceforge.net/p/modplug/code/4805
Author: saga-games
Date: 2015-03-02 00:25:42 +0000 (Mon, 02 Mar 2015)
Log Message:
-----------
[Fix] PLM: 16 bit samples didn't load correclty.
[Mod] Load PLM files as IT instead of S3M again because of increased channel count and sample global volume.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_plm.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
Modified: trunk/OpenMPT/soundlib/Load_plm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_plm.cpp 2015-03-01 22:01:31 UTC (rev 4804)
+++ trunk/OpenMPT/soundlib/Load_plm.cpp 2015-03-02 00:25:42 UTC (rev 4805)
@@ -185,6 +185,14 @@
sample.nLoopStart = sampleHeader.loopStart;
sample.nLoopEnd = sampleHeader.loopEnd;
sample.nLength = sampleHeader.length;
+ if(sampleHeader.flags & PLMSampleHeader::smp16Bit)
+ {
+ sample.nLoopStart /= 2;
+ sample.nLoopEnd /= 2;
+ sample.nLength /= 2;
+ // Apparently there is a bug in DT2 which adds an extra byte before the sample data.
+ sampleHeader.headerSize++;
+ }
if(sample.nLoopEnd > sample.nLoopStart) sample.uFlags.set(CHN_LOOP);
sample.SanitizeLoops();
file.Seek(samplePos[smp] + sampleHeader.headerSize);
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2015-03-01 22:01:31 UTC (rev 4804)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2015-03-02 00:25:42 UTC (rev 4805)
@@ -1331,7 +1331,6 @@
case MOD_TYPE_DSM:
case MOD_TYPE_AMF:
case MOD_TYPE_MTM:
- case MOD_TYPE_PLM:
return MOD_TYPE_S3M;
case MOD_TYPE_AMS:
case MOD_TYPE_AMS2:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|