From: <sag...@us...> - 2011-10-05 17:20:05
|
Revision: 1085 http://modplug.svn.sourceforge.net/modplug/?rev=1085&view=rev Author: saga-games Date: 2011-10-05 17:19:58 +0000 (Wed, 05 Oct 2011) Log Message: ----------- [Fix] Sample Editor: Sometimes, the correct sample was not displayed after switching from another tab. [Imp] Mod Conversion: Instrument numbers next to Note-Offs are now removed when converting to XM. [Mod] XM portamento vs. offset priority is not a compatibility setting anymore. Tracks made with older versions of MPT are fixed during loading. [Fix] Sustain loop after normal loop behaviour in samples was still not quite correct. [Mod] OpenMPT: Version is now 1.20.00.37 Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/modcommand.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-10-05 16:48:14 UTC (rev 1084) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-10-05 17:19:58 UTC (rev 1085) @@ -369,9 +369,9 @@ if (lParam < 0) { int nIns = m_pParent->GetInstrumentChange(); - if (pSndFile->m_nInstruments) + if (pSndFile->GetNumInstruments()) { - if ((nIns > 0) && (!pModDoc->IsChildSample(m_nSample, nIns))) + if ((nIns > 0) && (!pModDoc->IsChildSample(nIns, m_nSample))) { UINT k = pModDoc->FindInstrumentChild(nIns); if (k > 0) lParam = k; @@ -384,7 +384,7 @@ } else if (lParam > 0) { - if (pSndFile->m_nInstruments) + if (pSndFile->GetNumInstruments()) { UINT k = m_pParent->GetInstrumentChange(); if (!pModDoc->IsChildSample(k, lParam)) Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-10-05 16:48:14 UTC (rev 1084) +++ trunk/OpenMPT/mptrack/version.h 2011-10-05 17:19:58 UTC (rev 1085) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 00 -#define VER_MINORMINOR 36 +#define VER_MINORMINOR 37 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-10-05 16:48:14 UTC (rev 1084) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-10-05 17:19:58 UTC (rev 1085) @@ -1437,9 +1437,9 @@ bool retrigEnv = (!note) && (instr); // Now it's time for some FT2 crap... - if (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) + if (GetType() & (MOD_TYPE_XM | MOD_TYPE_MT2)) { - if(IsCompatibleMode(TRK_FASTTRACKER2) && instr) + if(IsCompatibleMode(TRK_FASTTRACKER2) && instr != 0) { // Apparently, any note number in a pattern causes instruments to retrigger - no matter if there's a Note Off next to it or whatever. // Test cases: keyoff+instr.xm, delay.xm @@ -1454,7 +1454,7 @@ } // XM: Key-Off + Sample == Note Cut (BUT: Only if no instr number or volume effect is present!) - if ((note == NOTE_KEYOFF) && ((!instr && !vol && cmd != CMD_VOLUME) || !IsCompatibleMode(TRK_FASTTRACKER2)) && ((!pChn->pModInstrument) || (!(pChn->pModInstrument->VolEnv.dwFlags & ENV_ENABLED)))) + if ((note == NOTE_KEYOFF) && ((!instr && volcmd == VOLCMD_NONE && cmd != CMD_VOLUME) || !IsCompatibleMode(TRK_FASTTRACKER2)) && ((!pChn->pModInstrument) || (!(pChn->pModInstrument->VolEnv.dwFlags & ENV_ENABLED)))) { pChn->dwFlags |= CHN_FASTVOLRAMP; pChn->nVolume = 0; @@ -3421,7 +3421,8 @@ if(m_nRow < Patterns[m_nPattern].GetNumRows()-1) m = Patterns[m_nPattern] + (m_nRow+1) * m_nChannels + nChn; - if(m && m->command == CMD_XPARAM){ + if(m && m->command == CMD_XPARAM) + { UINT tmp = m->param; m = NULL; if(m_nRow < Patterns[m_nPattern].GetNumRows()-2) m = Patterns[m_nPattern] + (m_nRow+2) * m_nChannels + nChn; @@ -3429,7 +3430,8 @@ if(m && m->command == CMD_XPARAM) param = (param<<16) + (tmp<<8) + m->param; else param = (param<<8) + tmp; } - else{ + else + { if (param) pChn->nOldOffset = param; else param = pChn->nOldOffset; param <<= 8; param |= (UINT)(pChn->nOldHiOffset) << 16; @@ -3439,7 +3441,7 @@ if ((pChn->rowCommand.note >= NOTE_MIN) && (pChn->rowCommand.note <= NOTE_MAX)) { // XM compatibility: Portamento + Offset = Ignore offset - if(bPorta && IsCompatibleMode(TRK_FASTTRACKER2)) + if(bPorta && GetType() == MOD_TYPE_XM) { return; } @@ -3725,7 +3727,7 @@ if (pChn->nLength > pChn->nLoopEnd) pChn->nLength = pChn->nLoopEnd; if(pChn->nPos > pChn->nLength) { - pChn->nPos = pChn->nLength; + pChn->nPos = pChn->nPos - pChn->nLength + pChn->nLoopStart; pChn->nPosLo = 0; } } else Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-10-05 16:48:14 UTC (rev 1084) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-10-05 17:19:58 UTC (rev 1085) @@ -2946,7 +2946,21 @@ } } } - + + if(pSndFile->GetType() == MOD_TYPE_XM) + { + if(pSndFile->m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 19, 00, 00) || + (!pSndFile->IsCompatibleMode(TRK_FASTTRACKER2) && pSndFile->m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 20, 00, 00))) + { + if(m.command == CMD_OFFSET && m.volcmd == VOLCMD_TONEPORTAMENTO) + { + // If there are both a portamento and an offset effect, the portamento should be preferred in XM files. + // OpenMPT 1.19 fixed this in compatible mode, OpenMPT 1.20 fixes it in normal mode as well. + m.command = CMD_NONE; + } + } + } + } CSoundFile *pSndFile; Modified: trunk/OpenMPT/soundlib/modcommand.cpp =================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp 2011-10-05 16:48:14 UTC (rev 1084) +++ trunk/OpenMPT/soundlib/modcommand.cpp 2011-10-05 17:19:58 UTC (rev 1085) @@ -597,6 +597,12 @@ m->command = m->param = 0; } + // Instrument numbers next to Key-Off reset instrument settings + if(m->note >= NOTE_MIN_SPECIAL) + { + m->instr = 0; + } + if(!m->command) switch(m->volcmd) { case VOLCMD_PORTADOWN: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |