|
From: <sag...@us...> - 2012-03-20 16:27:25
|
Revision: 1225
http://modplug.svn.sourceforge.net/modplug/?rev=1225&view=rev
Author: saga-games
Date: 2012-03-20 16:27:14 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
[Fix] FT2 note limit was not always applied properly (test case: note-limit 2.xm)
[Fix] FT2 envelope loop escape check was not applied properly.
[Mod] Removed zero-volume envelope loop optimisation (it can break stuff in some of my rewritten code and I can't see a point in it).
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-03-18 18:02:50 UTC (rev 1224)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-03-20 16:27:14 UTC (rev 1225)
@@ -721,7 +721,10 @@
{
pChn->nInsVol = pSmp->nGlobalVol;
}
- if (pSmp->uFlags & CHN_PANNING) pChn->nPan = pSmp->nPan;
+ if((pSmp->uFlags & CHN_PANNING) || (GetType() & MOD_TYPE_XM))
+ {
+ pChn->nPan = pSmp->nPan;
+ }
}
@@ -1622,11 +1625,35 @@
UINT note = pChn->rowCommand.note;
if (instr) pChn->nNewIns = instr;
- // Notes that exceed FT2's limit are completely ignored.
- // Test case: note-limit.xm
if(ModCommand::IsNote(note) && IsCompatibleMode(TRK_FASTTRACKER2))
{
- const int computedNote = note + pChn->nTranspose;
+ // Notes that exceed FT2's limit are completely ignored.
+ // Test case: note-limit.xm
+ int transpose = pChn->nTranspose;
+ if(instr && !bPorta)
+ {
+ // Refresh transpose
+ // Test case: note-limit 2.xm
+ SAMPLEINDEX sample = SAMPLEINDEX_INVALID;
+ if(GetNumInstruments())
+ {
+ // Instrument mode
+ if(instr <= GetNumInstruments() && Instruments[instr] != nullptr)
+ {
+ sample = Instruments[instr]->Keyboard[note];
+ }
+ } else
+ {
+ // Sample mode
+ sample = instr;
+ }
+ if(sample <= GetNumSamples())
+ {
+ transpose = GetSample(instr).RelativeTone;
+ }
+ }
+
+ const int computedNote = note + transpose;
if((computedNote < NOTE_MIN + 11 || computedNote > NOTE_MIN + 130))
{
note = NOTE_NONE;
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2012-03-18 18:02:50 UTC (rev 1224)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2012-03-20 16:27:14 UTC (rev 1225)
@@ -1238,7 +1238,7 @@
// FT2 compatibility: If the sustain point is at the loop end and the sustain loop has been released, don't loop anymore.
// Test case: EnvLoops.xm
- const bool escapeLoop = (insEnv.nLoopEnd == insEnv.nSustainEnd && (pChn->dwFlags & CHN_KEYOFF) && IsCompatibleMode(TRK_FASTTRACKER2));
+ const bool escapeLoop = (insEnv.nLoopEnd == insEnv.nSustainEnd && (insEnv.dwFlags & ENV_SUSTAIN) && (pChn->dwFlags & CHN_KEYOFF) && IsCompatibleMode(TRK_FASTTRACKER2));
if(position == end && !escapeLoop)
{
@@ -1248,8 +1248,9 @@
&& (!(GetType() & MOD_TYPE_XM) || (insEnv.nLoopEnd + 1u == insEnv.nNodes)))
{
// Stop channel if the envelope loop only covers the last silent envelope point.
- pChn->dwFlags |= CHN_NOTEFADE;
- pChn->nFadeOutVol = 0;
+ // Can't see a point in this, and it breaks doommix3.xm if you allow loading one-point loops, so disabling it for now.
+ //pChn->dwFlags |= CHN_NOTEFADE;
+ //pChn->nFadeOutVol = 0;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|