|
From: <sag...@us...> - 2012-05-17 12:00:24
|
Revision: 1273
http://modplug.svn.sourceforge.net/modplug/?rev=1273&view=rev
Author: saga-games
Date: 2012-05-17 12:00:13 +0000 (Thu, 17 May 2012)
Log Message:
-----------
[Fix] MDL Loader was severely broken (what have I been smoking / drinking / thinking?)
[Fix] MED Loader: Sample transpose should work as intended (at least for MMD1 modules, should it be any different for MMD0?), MMD2 order list works again as well.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mdl.cpp
trunk/OpenMPT/soundlib/Load_med.cpp
Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mdl.cpp 2012-05-14 23:05:24 UTC (rev 1272)
+++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2012-05-17 12:00:13 UTC (rev 1273)
@@ -517,6 +517,10 @@
continue;
}
+ if(m_nSamples < info->sampleIndex)
+ {
+ m_nSamples = info->sampleIndex;
+ }
ModSample &sample = Samples[info->sampleIndex];
StringFixer::ReadString<StringFixer::maybeNullTerminated>(m_szNames[info->sampleIndex], info->name);
@@ -539,7 +543,7 @@
}
}
sample.nGlobalVol = 64;
- sample.nVolume = 256;
+ //sample.nVolume = 256;
if((sampleHeader->flags & 0x01))
{
Modified: trunk/OpenMPT/soundlib/Load_med.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_med.cpp 2012-05-14 23:05:24 UTC (rev 1272)
+++ trunk/OpenMPT/soundlib/Load_med.cpp 2012-05-17 12:00:13 UTC (rev 1273)
@@ -300,7 +300,7 @@
} else command = 0;
}
break;
- case 0x09: command = (param < 0x20) ? CMD_SPEED : CMD_TEMPO; break;
+ case 0x09: command = (param <= 0x20) ? CMD_SPEED : CMD_TEMPO; break;
case 0x0D: if (param & 0xF0) param &= 0xF0; command = CMD_VOLUMESLIDE; if (!param) command = 0; break;
case 0x0F: // Set Tempo / Special
// F.00 = Pattern Break
@@ -619,7 +619,9 @@
pSmp->nVolume = (pmsh->sample[iSHdr].svol << 2);
pSmp->nGlobalVol = 64;
if (pSmp->nVolume > 256) pSmp->nVolume = 256;
- pSmp->RelativeTone = -12 * pmsh->sample[iSHdr].strans;
+ // Was: pSmp->RelativeTone = -12 * pmsh->sample[iSHdr].strans;
+ // But that breaks MMD1 modules (f.e. "94' summer.mmd1" from Modland)
+ pSmp->RelativeTone = pmsh->sample[iSHdr].strans;
pSmp->nPan = 128;
if (pSmp->nLoopEnd <= 2) pSmp->nLoopEnd = 0;
if (pSmp->nLoopEnd) pSmp->uFlags |= CHN_LOOP;
@@ -647,6 +649,7 @@
DWORD sectiontable = BigEndian(pmsh2->sectiontable);
if ((!nSections) || (!sectiontable) || (sectiontable >= dwMemLength-2)) nSections = 1;
nOrders = 0;
+ Order.resize(0);
for (UINT iSection=0; iSection<nSections; iSection++)
{
UINT nplayseq = 0;
@@ -671,7 +674,7 @@
UINT n = BigEndianW(pmps->length);
if (pseq+n <= dwMemLength)
{
- Order.resize(nOrders++);
+ Order.resize(nOrders + n);
for (UINT i=0; i<n; i++)
{
WORD seqval = BigEndianW(pmps->seq[i]);
@@ -684,7 +687,6 @@
}
}
playtransp = pmsh2->playtransp;
- while (nOrders < MAX_ORDERS) Order[nOrders++] = Order.GetInvalidPatIndex();
}
// Reading Expansion structure
if (pmex)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|