From: <sag...@us...> - 2010-03-13 22:34:58
|
Revision: 530 http://modplug.svn.sourceforge.net/modplug/?rev=530&view=rev Author: saga-games Date: 2010-03-13 22:34:51 +0000 (Sat, 13 Mar 2010) Log Message: ----------- [Fix] IT compatibility: ignore slide commands with both nibbles set (f.e. D55, PA1, ...) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-13 16:02:46 UTC (rev 529) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-13 22:34:51 UTC (rev 530) @@ -2408,7 +2408,10 @@ void CSoundFile::VolumeSlide(MODCHANNEL *pChn, UINT param) //-------------------------------------------------------- { - if (param) pChn->nOldVolumeSlide = param; else param = pChn->nOldVolumeSlide; + if (param) + pChn->nOldVolumeSlide = param; + else + param = pChn->nOldVolumeSlide; LONG newvolume = pChn->nVolume; if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM|MOD_TYPE_AMF)) { @@ -2443,9 +2446,18 @@ } if ((!(m_dwSongFlags & SONG_FIRSTTICK)) || (m_dwSongFlags & SONG_FASTVOLSLIDES)) { - if (param & 0x0F) newvolume -= (int)((param & 0x0F) * 4); - else newvolume += (int)((param & 0xF0) >> 2); - if (m_nType & MOD_TYPE_MOD) pChn->dwFlags |= CHN_FASTVOLRAMP; + // IT compatibility: Ignore slide commands with both nibbles set. + if (param & 0x0F) + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0xF0) == 0) + newvolume -= (int)((param & 0x0F) * 4); + } + else + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0) + newvolume += (int)((param & 0xF0) >> 2); + } + if (m_nType == MOD_TYPE_MOD) pChn->dwFlags |= CHN_FASTVOLRAMP; } newvolume = CLAMP(newvolume, 0, 256); @@ -2457,7 +2469,10 @@ //--------------------------------------------------------- { LONG nPanSlide = 0; - if (param) pChn->nOldPanSlide = param; else param = pChn->nOldPanSlide; + if (param) + pChn->nOldPanSlide = param; + else + param = pChn->nOldPanSlide; if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM)) { if (((param & 0x0F) == 0x0F) && (param & 0xF0)) @@ -2486,8 +2501,17 @@ { if (!(m_dwSongFlags & SONG_FIRSTTICK)) { - if (param & 0x0F) nPanSlide = -(int)((param & 0x0F) << 2); - else nPanSlide = (int)((param & 0xF0) >> 2); + // IT compatibility: Ignore slide commands with both nibbles set. + if (param & 0x0F) + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0xF0) == 0) + nPanSlide = -(int)((param & 0x0F) << 2); + } + else + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0) + nPanSlide = (int)((param & 0xF0) >> 2); + } // XM compatibility: FT2's panning slide is not as deep if(IsCompatibleMode(TRK_FASTTRACKER2)) nPanSlide >>= 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |