summaryrefslogtreecommitdiff
path: root/soundlib/Snd_fx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'soundlib/Snd_fx.cpp')
-rw-r--r--soundlib/Snd_fx.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/soundlib/Snd_fx.cpp b/soundlib/Snd_fx.cpp
index 16e52a6..c00b92e 100644
--- a/soundlib/Snd_fx.cpp
+++ b/soundlib/Snd_fx.cpp
@@ -3394,29 +3394,6 @@ bool CSoundFile::ProcessEffects()
const bool doBreakRow = (nBreakRow != ROWINDEX_INVALID);
const bool doPosJump = (nPosJump != ORDERINDEX_INVALID);
- // Pattern Loop
- if(doPatternLoop)
- {
- m_PlayState.m_nNextOrder = m_PlayState.m_nCurrentOrder;
- m_PlayState.m_nNextRow = nPatLoopRow;
- if(m_PlayState.m_nPatternDelay)
- {
- m_PlayState.m_nNextRow++;
- }
-
- // IT Compatibility: If the restart row is past the end of the current pattern
- // (e.g. when continued from a previous pattern without explicit SB0 effect), continue the next pattern.
- // Test case: LoopStartAfterPatternEnd.it
- if(nPatLoopRow >= Patterns[m_PlayState.m_nPattern].GetNumRows())
- {
- m_PlayState.m_nNextOrder++;
- m_PlayState.m_nNextRow = 0;
- }
-
- // As long as the pattern loop is running, mark the looped rows as not visited yet
- visitedSongRows.ResetPatternLoop(m_PlayState.m_nCurrentOrder, nPatLoopRow);
- }
-
// Pattern Break / Position Jump only if no loop running
// Exception: FastTracker 2 in all cases, Impulse Tracker in case of position jump
// Test case for FT2 exception: PatLoop-Jumps.xm, PatLoop-Various.xm
@@ -3447,8 +3424,28 @@ bool CSoundFile::ProcessEffects()
m_PlayState.m_nNextRow = nBreakRow;
if(!m_SongFlags[SONG_PATTERNLOOP])
m_PlayState.m_nNextOrder = nPosJump;
- }
+ } else if(doPatternLoop)
+ {
+ // Pattern Loop
+ m_PlayState.m_nNextOrder = m_PlayState.m_nCurrentOrder;
+ m_PlayState.m_nNextRow = nPatLoopRow;
+ if(m_PlayState.m_nPatternDelay)
+ {
+ m_PlayState.m_nNextRow++;
+ }
+ // IT Compatibility: If the restart row is past the end of the current pattern
+ // (e.g. when continued from a previous pattern without explicit SB0 effect), continue the next pattern.
+ // Test case: LoopStartAfterPatternEnd.it
+ if(nPatLoopRow >= Patterns[m_PlayState.m_nPattern].GetNumRows())
+ {
+ m_PlayState.m_nNextOrder++;
+ m_PlayState.m_nNextRow = 0;
+ }
+
+ // As long as the pattern loop is running, mark the looped rows as not visited yet
+ visitedSongRows.ResetPatternLoop(m_PlayState.m_nCurrentOrder, nPatLoopRow);
+ }
}
return true;
}
@@ -5463,7 +5460,12 @@ void CSoundFile::SetTempo(TEMPO param, bool setFromUI)
// 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
+#if MPT_MSVC_AT_LEAST(2017,8)
+ // Work-around MSVC getting confused about deduced const input type in noexcept operator inside noexcept condition.
+ m_PlayState.m_nMusicTempo.SetRaw(std::min(param.GetRaw(), specs.GetTempoMax().GetRaw()));
+#else
m_PlayState.m_nMusicTempo = std::min(param, specs.GetTempoMax());
+#endif
} else if(param < minTempo && !m_SongFlags[SONG_FIRSTTICK])
{
// Tempo Slide