From: <sag...@us...> - 2013-01-01 21:03:38
|
Revision: 1481 http://sourceforge.net/p/modplug/code/1481 Author: saga-games Date: 2013-01-01 21:03:28 +0000 (Tue, 01 Jan 2013) Log Message: ----------- [Fix] IT Compatibility: Envelope reset should now work correctly (http://bugs.openmpt.org/view.php?id=330) (copied from Schism Tracker) [Var] Fixed VS2008 zlib project. [Mod] OpenMPT: Version is now 1.21.01.03 Modified Paths: -------------- trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp Removed Paths: ------------- trunk/OpenMPT/include/zlib/contrib/vstudio/vc7/ trunk/OpenMPT/include/zlib/contrib/vstudio/vc8/ Modified: trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj =================================================================== --- trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2012-12-27 10:12:32 UTC (rev 1480) +++ trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2013-01-01 21:03:28 UTC (rev 1481) @@ -25,7 +25,7 @@ OutputDirectory="x86\ZlibStat$(ConfigurationName)" IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" + InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > @@ -98,7 +98,7 @@ OutputDirectory="x86\ZlibStat$(ConfigurationName)" IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" + InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > @@ -172,7 +172,7 @@ OutputDirectory="x86\ZlibStat$(ConfigurationName)" IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" + InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2012-12-27 10:12:32 UTC (rev 1480) +++ trunk/OpenMPT/mptrack/version.h 2013-01-01 21:03:28 UTC (rev 1481) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 21 #define VER_MINOR 01 -#define VER_MINORMINOR 02 +#define VER_MINORMINOR 03 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-27 10:12:32 UTC (rev 1480) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-01-01 21:03:28 UTC (rev 1481) @@ -641,10 +641,10 @@ if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) { ASSERT(false); - return; - } + return; + } UINT n = pIns->Keyboard[note-1]; - pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr; + pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr; if(pSmp != pChn->pModSample) { ASSERT(false); @@ -774,23 +774,48 @@ // Reset envelopes - if (bResetEnv) + if(bResetEnv) { - if(!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] - || !pChn->nLength || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) - // IT compatibility tentative fix: Reset envelopes when instrument changes. - || (IsCompatibleMode(TRK_IMPULSETRACKER) && instrumentChanged)) + // Blurb by Storlek (from the SchismTracker code): + // Conditions experimentally determined to cause envelope reset in Impulse Tracker: + // - no note currently playing (of course) + // - note given, no portamento + // - instrument number given, portamento, compat gxx enabled + // - instrument number given, no portamento, after keyoff, old effects enabled + // If someone can enlighten me to what the logic really is here, I'd appreciate it. + // Seems like it's just a total mess though, probably to get XMs to play right. + + bool reset, resetAlways; + + // IT Compatibility: Envelope reset + // Test case: EnvReset.it + if(IsCompatibleMode(TRK_IMPULSETRACKER)) { + reset = (!pChn->nLength + || (instrumentChanged && bPorta && m_SongFlags[SONG_ITCOMPATGXX]) + || (instrumentChanged && !bPorta && pChn->dwFlags[CHN_NOTEFADE | CHN_KEYOFF] && m_SongFlags[SONG_ITOLDEFFECTS])); + resetAlways = (instrumentChanged || pChn->dwFlags[CHN_KEYOFF]); + } else + { + reset = (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] + || !pChn->nLength || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol)); + resetAlways = !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || instrumentChanged || pIns == nullptr || pChn->dwFlags[CHN_KEYOFF | CHN_NOTEFADE]; + } + + if(reset) + { pChn->dwFlags.set(CHN_FASTVOLRAMP); - - if((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (!instrumentChanged) && (pIns) && !pChn->dwFlags[CHN_KEYOFF | CHN_NOTEFADE]) + if(pIns != nullptr) { - if(!pIns->VolEnv.dwFlags[ENV_CARRY]) pChn->VolEnv.Reset(); - if(!pIns->PanEnv.dwFlags[ENV_CARRY]) pChn->PanEnv.Reset(); - if(!pIns->PitchEnv.dwFlags[ENV_CARRY]) pChn->PitchEnv.Reset(); - } else - { - pChn->ResetEnvelopes(); + if(resetAlways) + { + pChn->ResetEnvelopes(); + } else + { + if(!pIns->VolEnv.dwFlags[ENV_CARRY]) pChn->VolEnv.Reset(); + if(!pIns->PanEnv.dwFlags[ENV_CARRY]) pChn->PanEnv.Reset(); + if(!pIns->PitchEnv.dwFlags[ENV_CARRY]) pChn->PitchEnv.Reset(); + } } // IT Compatibility: Autovibrato reset @@ -1325,7 +1350,7 @@ n = pIns->Keyboard[note - 1]; note = pIns->NoteMap[note - 1]; if(n > 0 && n < MAX_SAMPLES) pSample = Samples[n].pSample; - } + } } else pSample = nullptr; } ModChannel *p = pChn; @@ -1864,7 +1889,7 @@ // Note Cut/Off/Fade => ignore instrument if (note >= NOTE_MIN_SPECIAL) instr = 0; - if (ModCommand::IsNote(note)) + if(ModCommand::IsNote(note)) { pChn->nNewNote = pChn->nLastNote = note; @@ -1896,18 +1921,18 @@ } // Instrument Change ? - if (instr) + if(instr) { ModSample *psmp = pChn->pModSample; InstrumentChange(pChn, instr, bPorta, true); pChn->nNewIns = 0; - // Special IT case: portamento+note causes sample change -> ignore portamento - if ((GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) + // Special IT case: portamento+note causes sample change -> ignore portamento + if ((GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)) && (psmp != pChn->pModSample) && (note) && (note < 0x80)) - { - bPorta = false; + { + bPorta = false; + } } - } // New Note ? if (note) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |