From: <sv...@op...> - 2024-09-19 14:17:39
|
Author: sagamusix Date: Thu Sep 19 16:17:27 2024 New Revision: 21629 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21629 Log: [Mod] Revert merge of r21572. The required fixups to make this work are too much work to backport to this branch. Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.31/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Thu Sep 19 16:10:38 2024 (r21628) +++ branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Thu Sep 19 16:17:27 2024 (r21629) @@ -3216,16 +3216,18 @@ if(m_playBehaviour[kMODVBlankTiming]) { // ProTracker MODs with VBlank timing: All Fxx parameters set the tick count. - if(m_SongFlags[SONG_FIRSTTICK] && param != 0) - SetSpeed(m_PlayState, param); - } else + if(m_SongFlags[SONG_FIRSTTICK] && param != 0) SetSpeed(m_PlayState, param); + break; + } { param = CalculateXParam(m_PlayState.m_nPattern, m_PlayState.m_nRow, nChn); - if (GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)) + if (GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) { if (param) chn.nOldTempo = static_cast<ModCommand::PARAM>(param); else param = chn.nOldTempo; } - SetTempo(TEMPO(param, 0)); + TEMPO t(param, 0); + LimitMax(t, GetModSpecifications().GetTempoMax()); + SetTempo(t); } break; @@ -5976,24 +5978,17 @@ // Anything lower than the minimum tempo is considered to be a tempo slide const TEMPO minTempo = GetMinimumTempoParam(GetType()); - TEMPO maxTempo = specs.GetTempoMax(); - // MED files may be imported with #xx parameter extension for tempos above 255, but they may be imported as either MOD or XM. - // As regular MOD files cannot contain effect #xx, the tempo parameter cannot exceed 255 anyway, so we simply ignore their max tempo in CModSpecifications here. - if(!(GetType() & (MOD_TYPE_XM | MOD_TYPE_IT | MOD_TYPE_MPT))) - maxTempo = GetModSpecifications(MOD_TYPE_MPT).GetTempoMax(); - if(m_playBehaviour[kTempoClamp]) - maxTempo.Set(255); if(setFromUI) { // Set tempo from UI - ignore slide commands and such. - m_PlayState.m_nMusicTempo = Clamp(param, specs.GetTempoMin(), maxTempo); + m_PlayState.m_nMusicTempo = Clamp(param, specs.GetTempoMin(), specs.GetTempoMax()); } else if(param >= minTempo && m_SongFlags[SONG_FIRSTTICK] == !m_playBehaviour[kMODTempoOnSecondTick]) { // ProTracker sets the tempo after the first tick. // Note: The case of one tick per row is handled in ProcessRow() instead. // Test case: TempoChange.mod - m_PlayState.m_nMusicTempo = std::min(param, maxTempo); + m_PlayState.m_nMusicTempo = std::min(param, specs.GetTempoMax()); } else if(param < minTempo && !m_SongFlags[SONG_FIRSTTICK]) { // Tempo Slide @@ -6003,8 +5998,12 @@ else m_PlayState.m_nMusicTempo -= tempDiff; - TEMPO tempoMin = specs.GetTempoMin(); - Limit(m_PlayState.m_nMusicTempo, tempoMin, maxTempo); + TEMPO tempoMin = specs.GetTempoMin(), tempoMax = specs.GetTempoMax(); + if(m_playBehaviour[kTempoClamp]) // clamp tempo correctly in compatible mode + { + tempoMax.Set(255); + } + Limit(m_PlayState.m_nMusicTempo, tempoMin, tempoMax); } } |