From: <sag...@us...> - 2011-11-21 20:59:08
|
Revision: 1140 http://modplug.svn.sourceforge.net/modplug/?rev=1140&view=rev Author: saga-games Date: 2011-11-21 20:58:57 +0000 (Mon, 21 Nov 2011) Log Message: ----------- [Fix] IT Compatibility: If a sample is shorter than the retrig time (i.e. it stops before the retrig counter hits zero), it is not retriggered. [Fix] Note Properties: Plugin indices for PC Notes were off by one. Modified Paths: -------------- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-11-19 23:57:16 UTC (rev 1139) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-11-21 20:58:57 UTC (rev 1140) @@ -1080,8 +1080,11 @@ if(m_bIsParamControl) { // plugin param control note - AddPluginParameternamesToCombobox(*combo, pSndFile->m_MixPlugins[m_nPlugin]); - combo->SetCurSel(m_nPluginParam); + if(m_nPlugin > 0 && m_nPlugin <= MAX_MIXPLUGINS) + { + AddPluginParameternamesToCombobox(*combo, pSndFile->m_MixPlugins[m_nPlugin - 1]); + combo->SetCurSel(m_nPluginParam); + } } else { // process as effect Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-11-19 23:57:16 UTC (rev 1139) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-11-21 20:58:57 UTC (rev 1140) @@ -3677,7 +3677,7 @@ } else { // old routines - if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) + if (GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) { if (!nRetrigSpeed) nRetrigSpeed = 1; if ((nRetrigCount) && (!(nRetrigCount % nRetrigSpeed))) bDoRetrig = true; @@ -3692,7 +3692,7 @@ if (!realspeed) realspeed = 1; if ((!(param & 0x100)) && (m_nMusicSpeed) && (!(m_nTickCount % realspeed))) bDoRetrig = true; nRetrigCount++; - } else if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) nRetrigCount = 0; + } else if (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) nRetrigCount = 0; if (nRetrigCount >= realspeed) { if ((m_nTickCount) || ((param & 0x100) && (!pChn->rowCommand.note))) bDoRetrig = true; @@ -3700,6 +3700,13 @@ } } + // IT compatibility: If a sample is shorter than the retrig time (i.e. it stops before the retrig counter hits zero), it is not retriggered. + // Test case: retrig-short.it + if(pChn->nLength == 0 && IsCompatibleMode(TRK_IMPULSETRACKER)) + { + return; + } + if (bDoRetrig) { UINT dv = (param >> 4) & 0x0F; @@ -3716,7 +3723,7 @@ vol += ((int)retrigTable2[dv]) << 2; } - vol = CLAMP(vol, 0, 256); + Limit(vol, 0, 256); pChn->nVolume = vol; pChn->dwFlags |= CHN_FASTVOLRAMP; @@ -3725,7 +3732,7 @@ LONG nOldPeriod = pChn->nPeriod; if ((nNote) && (nNote <= NOTE_MAX) && (pChn->nLength)) CheckNNA(nChn, 0, nNote, TRUE); bool bResetEnv = false; - if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) + if (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) { if ((pChn->rowCommand.instr) && (param < 0x100)) { @@ -3740,8 +3747,8 @@ { ProcessMidiOut(nChn, pChn); //Send retrig to Midi } - if ((m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!pChn->rowCommand.note) && (nOldPeriod)) pChn->nPeriod = nOldPeriod; - if (!(m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) nRetrigCount = 0; + if ((GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!pChn->rowCommand.note) && (nOldPeriod)) pChn->nPeriod = nOldPeriod; + if (!(GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) nRetrigCount = 0; // IT compatibility: see previous IT compatibility comment =) if(IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nPos = pChn->nPosLo = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |