From: <sag...@us...> - 2015-04-19 14:52:09
|
Revision: 4950 http://sourceforge.net/p/modplug/code/4950 Author: saga-games Date: 2015-04-19 14:51:57 +0000 (Sun, 19 Apr 2015) Log Message: ----------- [Fix] PT1/2 mode: Instrument swapping also works if there was an empty sample slot "playing". Test case: PTEmptySwap.mod Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-04-19 12:49:07 UTC (rev 4949) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-04-19 14:51:57 UTC (rev 4950) @@ -2273,7 +2273,9 @@ // Apparently, any note number in a pattern causes instruments to recall their original volume settings - no matter if there's a Note Off next to it or whatever. // Test cases: keyoff+instr.xm, delay.xm bool reloadSampleSettings = (IsCompatibleMode(TRK_FASTTRACKER2) && instr != 0); - bool keepInstr = (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)); + // ProTracker Compatibility: If a sample was stopped before, lone instrument numbers can retrigger it + // Test case: PTSwapEmpty.mod + bool keepInstr = (GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (m_SongFlags[SONG_PT1XMODE] && pChn->nInc == 0); // Now it's time for some FT2 crap... if (GetType() & (MOD_TYPE_XM | MOD_TYPE_MT2)) @@ -2438,14 +2440,15 @@ //const bool newInstrument = oldInstrument != pChn->pModInstrument && pChn->pModInstrument->Keyboard[pChn->nNewNote - NOTE_MIN] != 0; pChn->nPos = pChn->nPosLo = 0; } - } else + } else if ((GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT) && oldSample != pChn->pModSample && ModCommand::IsNote(note))) { // Special IT case: portamento+note causes sample change -> ignore portamento - if ((GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)) - && oldSample != pChn->pModSample && ModCommand::IsNote(note)) - { - bPorta = false; - } + bPorta = false; + } else if(m_SongFlags[SONG_PT1XMODE] && pChn->nInc == 0) + { + // If channel was paused and is resurrected by a lone instrument number, reset the sample position. + // Test case: PTSwapEmpty.mod + pChn->nPos = pChn->nPosLo = 0; } } // New Note ? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |