From: <sag...@us...> - 2015-03-11 15:56:57
|
Revision: 4871 http://sourceforge.net/p/modplug/code/4871 Author: saga-games Date: 2015-03-11 15:56:44 +0000 (Wed, 11 Mar 2015) Log Message: ----------- [Fix] xparam values were searched in entirely wrong pattern locations. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-03-11 15:55:10 UTC (rev 4870) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-03-11 15:56:44 UTC (rev 4871) @@ -378,26 +378,28 @@ if(param != 0) memory.state.m_nMusicSpeed = param; break; } - param = CalculateXParam(memory.state.m_nPattern, memory.state.m_nRow, nChn); - if ((adjustMode & eAdjust) && (GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))) { - if (param) pChn->nOldTempo = param; else param = pChn->nOldTempo; - } - - if (param >= 0x20) memory.state.m_nMusicTempo = param; - else - { - // Tempo Slide - uint32_t tempoDiff = (param & 0x0F) * (memory.state.m_nMusicSpeed - 1); - if ((param & 0xF0) == 0x10) + uint32_t tempo = CalculateXParam(memory.state.m_nPattern, memory.state.m_nRow, nChn); + if ((adjustMode & eAdjust) && (GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))) { - memory.state.m_nMusicTempo += tempoDiff; - } else + if (tempo) pChn->nOldTempo = tempo; else tempo = pChn->nOldTempo; + } + + if (tempo >= 0x20) memory.state.m_nMusicTempo = tempo; + else { - if(tempoDiff < memory.state.m_nMusicTempo) - memory.state.m_nMusicTempo -= tempoDiff; - else - memory.state.m_nMusicTempo = 0; + // Tempo Slide + uint32_t tempoDiff = (tempo & 0x0F) * (memory.state.m_nMusicSpeed - 1); + if ((tempo & 0xF0) == 0x10) + { + memory.state.m_nMusicTempo += tempoDiff; + } else + { + if(tempoDiff < memory.state.m_nMusicTempo) + memory.state.m_nMusicTempo -= tempoDiff; + else + memory.state.m_nMusicTempo = 0; + } } } if(IsCompatibleMode(TRK_ALLTRACKERS)) // clamp tempo correctly in compatible mode @@ -1866,9 +1868,6 @@ return true; } -// -> CODE#0010 -// -> DESC="add extended parameter mechanism to pattern effects" -// -! NEW_FEATURE#0010 for(CHANNELINDEX nChn = 0; nChn < GetNumChannels(); nChn++, pChn++) { UINT instr = pChn->rowCommand.instr; @@ -3012,7 +3011,7 @@ { if(isExtended != nullptr) *isExtended = false; ROWINDEX maxCommands = 4; - const ModCommand *m = Patterns[pat].GetpModCommand(chn, row); + const ModCommand *m = Patterns[pat].GetpModCommand(row, chn); uint32_t val = m->param; switch(m->command) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |