|
From: <sag...@us...> - 2015-07-13 20:44:27
|
Revision: 5413
http://sourceforge.net/p/modplug/code/5413
Author: saga-games
Date: 2015-07-13 20:44:21 +0000 (Mon, 13 Jul 2015)
Log Message:
-----------
[Imp] Song Properties: Show current tempo swing config in tempo swing button context menu.
[Fix] IT Compatiblity: Position jump effect on the same row as a pattern loop end immediately cuts the pattern loop. Test case: LoopBreak.it
[Fix] Song length estimation: Pattern breaks leading to a row greater than the current pattern's size were not computed correctly.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-07-12 11:46:40 UTC (rev 5412)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-07-13 20:44:21 UTC (rev 5413)
@@ -465,6 +465,22 @@
if(!GetDlgItem(IDC_BUTTON1)->IsWindowEnabled())
{
text = _T("Tempo swing is only available in modern tempo mode.");
+ } else
+ {
+ CString s = _T("Swing setting: ");
+ if(m_tempoSwing.empty())
+ {
+ s += _T("Default");
+ } else
+ {
+ for(size_t i = 0; i < m_tempoSwing.size(); i++)
+ {
+ if(i > 0) s += _T(" / ");
+ s.AppendFormat(_T("%u%%"), Util::muldivr(m_tempoSwing[i], 100, TempoSwing::Unity));
+ }
+ }
+ mpt::String::CopyN(pTTT->szText, s);
+ return TRUE;
}
}
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-07-12 11:46:40 UTC (rev 5412)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-07-13 20:44:21 UTC (rev 5413)
@@ -741,7 +741,7 @@
}
}
- if(memory.state.m_nNextRow >= Patterns[memory.state.m_nPattern].GetNumRows())
+ if(memory.state.m_nNextOrder > Order.size() || Order[memory.state.m_nNextOrder] > Patterns.Size() || memory.state.m_nNextRow >= Patterns[Order[memory.state.m_nNextOrder]].GetNumRows())
{
memory.state.m_nNextOrder = memory.state.m_nCurrentOrder + 1;
memory.state.m_nNextRow = 0;
@@ -930,7 +930,13 @@
}
oldTickDuration = tickDuration;
- if(patternLoopEndedOnThisRow)
+ // Pattern loop is not executed in FT2 if there are any position jump or pattern break commands on the same row.
+ // Pattern loop is not executed in IT if there are any position jump commands on the same row.
+ // Test case for FT2 exception: PatLoop-Jumps.xm, PatLoop-Various.xm
+ // Test case for IT: exception: LoopBreak.it
+ if(patternLoopEndedOnThisRow
+ && (!IsCompatibleMode(TRK_FASTTRACKER2) || !(positionJumpOnThisRow || patternBreakOnThisRow))
+ && (!IsCompatibleMode(TRK_IMPULSETRACKER) || !positionJumpOnThisRow))
{
std::map<double, int> startTimes;
// This is really just a simple estimation for nested pattern loops. It should handle cases correctly where all parallel loops start and end on the same row.
@@ -3087,6 +3093,8 @@
if(m_SongFlags[SONG_FIRSTTICK])
{
const bool doPatternLoop = (nPatLoopRow != ROWINDEX_INVALID);
+ const bool doBreakRow = (nBreakRow != ROWINDEX_INVALID);
+ const bool doPosJump = (nPosJump != ORDERINDEX_INVALID);
// Pattern Loop
if(doPatternLoop)
@@ -3103,12 +3111,14 @@
}
// 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
- if((nBreakRow != ROWINDEX_INVALID || nPosJump != ORDERINDEX_INVALID)
- && (!doPatternLoop || IsCompatibleMode(TRK_FASTTRACKER2)))
+ // Test case for IT: exception: LoopBreak.it
+ if((doBreakRow || doPosJump)
+ && (!doPatternLoop || IsCompatibleMode(TRK_FASTTRACKER2) || (IsCompatibleMode(TRK_IMPULSETRACKER) && doPosJump)))
{
- if(nPosJump == ORDERINDEX_INVALID) nPosJump = m_PlayState.m_nCurrentOrder + 1;
- if(nBreakRow == ROWINDEX_INVALID) nBreakRow = 0;
+ if(!doPosJump) nPosJump = m_PlayState.m_nCurrentOrder + 1;
+ if(!doBreakRow) nBreakRow = 0;
m_SongFlags.set(SONG_BREAKTOROW);
if(nPosJump >= Order.size())
@@ -3128,7 +3138,6 @@
m_PlayState.m_nNextOrder = nPosJump;
m_PlayState.m_nNextRow = nBreakRow;
m_PlayState.m_bPatternTransitionOccurred = true;
-
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|