From 7e5264f4b43d1068a9cc680c777bfc935d2520b6 Mon Sep 17 00:00:00 2001 From: Johannes Schultz Date: Mon, 30 Sep 2024 21:33:18 +0000 Subject: [PATCH] Merged revision(s) 21776-21777 from trunk/OpenMPT: [Mod] Update tooltip: Make message less ambiguous. ........ [Fix] When importing instruments or converting to IT, restrict fadeout precision to multiples of 32. [Fix] Find MPT Hacks: Detect IT instruments with fadeout values that are not multiples of 32. ........ git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@21778 56274372-70c3-4bfc-bfc3-4c3a0b034d27 --- mptrack/MPTHacks.cpp | 7 +++++++ mptrack/UpdateToolTip.cpp | 2 +- soundlib/Load_it.cpp | 2 +- soundlib/ModInstrument.cpp | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mptrack/MPTHacks.cpp b/mptrack/MPTHacks.cpp index cb5dc2b22e..7eb571365d 100644 --- a/mptrack/MPTHacks.cpp +++ b/mptrack/MPTHacks.cpp @@ -327,6 +327,13 @@ bool CModDoc::HasMPTHacks(const bool autofix) instr->VolEnv.nReleaseNode = instr->PanEnv.nReleaseNode = instr->PitchEnv.nReleaseNode = ENV_RELEASE_NODE_UNSET; } } + if((m_SndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (instr->nFadeOut % 32u) != 0) + { + foundHere = foundHacks = true; + if(autofix) + instr->nFadeOut = ((instr->nFadeOut + 16) / 32) * 32; + } + // Incompatible envelope shape foundEnvelopes |= FindIncompatibleEnvelopes(instr->VolEnv, autofix); foundEnvelopes |= FindIncompatibleEnvelopes(instr->PanEnv, autofix); diff --git a/mptrack/UpdateToolTip.cpp b/mptrack/UpdateToolTip.cpp index 2045f40e7b..70e6bc73d1 100644 --- a/mptrack/UpdateToolTip.cpp +++ b/mptrack/UpdateToolTip.cpp @@ -32,7 +32,7 @@ bool UpdateToolTip::ShowUpdate(CWnd &parent, const CString &newVersion, const CS m_infoURL = infoURL; - CString message = MPT_CFORMAT("OpenMPT {} has been released.\nClick here to see what's new.")(newVersion); + CString message = MPT_CFORMAT("OpenMPT {} has been released.\nClick on this message to install the update,\nor click here to see what's new.")(newVersion); TOOLINFO ti{}; ti.cbSize = TTTOOLINFO_V1_SIZE; ti.uFlags = TTF_TRACK | TTF_PARSELINKS; diff --git a/soundlib/Load_it.cpp b/soundlib/Load_it.cpp index 966688d52c..80d2bb9018 100644 --- a/soundlib/Load_it.cpp +++ b/soundlib/Load_it.cpp @@ -1144,7 +1144,7 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags) m.command = CMD_DUMMY; // Fix handling of commands V81-VFF in ITs made with old Schism Tracker versions // (fixed in https://github.com/schismtracker/schismtracker/commit/ab5517d4730d4c717f7ebffb401445679bd30888 - one of the last versions to identify as v0.50) - if(m.command == CMD_GLOBALVOLUME && m.param > 0x80 && fileHeader.cwtv >= 0x1000 && fileHeader.cwtv <= 0x1050) + else if(m.command == CMD_GLOBALVOLUME && m.param > 0x80 && fileHeader.cwtv >= 0x1000 && fileHeader.cwtv <= 0x1050) m.param = 0x80; // In some IT-compatible trackers, it is possible to input a parameter without a command. diff --git a/soundlib/ModInstrument.cpp b/soundlib/ModInstrument.cpp index 7439be538f..d6d4058483 100644 --- a/soundlib/ModInstrument.cpp +++ b/soundlib/ModInstrument.cpp @@ -226,10 +226,11 @@ void ModInstrument::Convert(MODTYPE fromType, MODTYPE toType) } } - // Limit fadeout length for IT + // Limit fadeout length and precision for IT if(toType & MOD_TYPE_IT) { LimitMax(nFadeOut, 8192u); + nFadeOut = ((nFadeOut + 16) / 32) * 32; } // MPT-specific features - remove instrument tunings, Pitch/Tempo Lock, cutoff / resonance swing and filter mode for other formats