From: <sag...@us...> - 2010-03-29 20:00:13
|
Revision: 563 http://modplug.svn.sourceforge.net/modplug/?rev=563&view=rev Author: saga-games Date: 2010-03-29 20:00:06 +0000 (Mon, 29 Mar 2010) Log Message: ----------- [Fix] IT Compatibility: Always reset autovibrato settings when there's an instrument number (fix from SchismTracker) [Imp] Instrument Editor: When pasting an envelope, it's now also automatically enabled. [Ref] Simplified the IsCompatibleMode macro. This was unnecessarily confusing. Modified Paths: -------------- trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-29 14:19:36 UTC (rev 562) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-03-29 20:00:06 UTC (rev 563) @@ -1602,7 +1602,7 @@ pEnv->nLoopStart = loopBegin; pEnv->nLoopEnd = loopEnd; pEnv->nReleaseNode = releaseNode; - pEnv->dwFlags = (pEnv->dwFlags & ~(ENV_LOOP|ENV_SUSTAIN|ENV_CARRY)) | (bLoop ? ENV_LOOP : 0) | (bSus ? ENV_SUSTAIN : 0) | (bCarry ? ENV_CARRY: 0); + pEnv->dwFlags = (pEnv->dwFlags & ~(ENV_LOOP|ENV_SUSTAIN|ENV_CARRY)) | (bLoop ? ENV_LOOP : 0) | (bSus ? ENV_SUSTAIN : 0) | (bCarry ? ENV_CARRY: 0) | ENV_ENABLED; int oldn = 0; for (UINT i=0; i<nPoints; i++) Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-29 14:19:36 UTC (rev 562) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-29 20:00:06 UTC (rev 563) @@ -553,8 +553,12 @@ } else { resetEnvelopes(pChn); } - pChn->nAutoVibDepth = 0; - pChn->nAutoVibPos = 0; + // IT Compatibility: Always reset autovibrato settings when there's an instrument number + if(!IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nAutoVibDepth = 0; + pChn->nAutoVibPos = 0; + } } else if ((pIns) && (!(pIns->VolEnv.dwFlags & ENV_ENABLED))) { resetEnvelopes(pChn); @@ -568,6 +572,13 @@ return; } + // IT Compatibility: Always reset autovibrato settings when there's an instrument number + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nAutoVibDepth = 0; + pChn->nAutoVibPos = 0; + } + // Tone-Portamento doesn't reset the pingpong direction flag if ((bPorta) && (pSmp == pChn->pModSample)) { Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-03-29 14:19:36 UTC (rev 562) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-03-29 20:00:06 UTC (rev 563) @@ -485,12 +485,13 @@ void SetModFlag(BYTE i, bool val) {if(i < 8*sizeof(m_ModFlags)) {m_ModFlags = (val) ? m_ModFlags |= (1 << i) : m_ModFlags &= ~(1 << i);}} // Is compatible mode for a specific tracker turned on? - // Hint 1: No need to poll for MOD_TYPE_MPT, as it will automatically be linked with MOD_TYPE_IT - // Hint 2: Always returns true for MOD / S3M format (if that is the format of the current file) - bool IsCompatibleMode(MODTYPE type) { + // Hint 1: No need to poll for MOD_TYPE_MPT, as it will automatically be linked with MOD_TYPE_IT when using TRK_IMPULSETRACKER + // Hint 2: Always returns true for MOD / S3M format (if that is the format of the current file) + bool IsCompatibleMode(MODTYPE type) + { if(GetType() & type & (MOD_TYPE_MOD | MOD_TYPE_S3M)) - return true; // those formats don't have flags so we will always return true - return ((GetType() & ((type & MOD_TYPE_IT) ? type | MOD_TYPE_MPT : type)) && GetModFlag(MSF_COMPATIBLE_PLAY)) ? true : false; + return true; // S3M and MOD format don't have compatibility flags, so we will always return true + return ((GetType() & type) && GetModFlag(MSF_COMPATIBLE_PLAY)) ? true : false; } //Tuning--> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |