Skip to content

Commit 7496a66

Browse files
AliceLRsezero
authored andcommitted
Fix mLoopCount global setting.
The module repeat count is supposed to be configured via mLoopCount in the Modplug global settings. Setting this to a negative value is supposed to enable looping forever (what game engines are most likely to expect), but for some reason, this feature was *deliberately broken* despite the default being 0. There's no reason for this to be commented out. Fixes Konstanty#51 See also: icculus/SDL_sound#123 https://github.com/AliceLR/megazeux/blob/f83d897dc7df808ed4ad3eb31b5abb6a7b479d08/contrib/patches/libmodplug/01-libmodplug-0.8.9.0-fix-looping.diff Mainstream pull request: Konstanty#102
1 parent 4af4b98 commit 7496a66

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/sndmix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ BOOL CSoundFile::ProcessRow()
360360
// End of song ?
361361
if ((m_nPattern == 0xFF) || (m_nCurrentPattern >= MAX_ORDERS))
362362
{
363-
//if (!m_nRepeatCount)
363+
if (!m_nRepeatCount)
364364
return FALSE; //never repeat entire song
365365
if (!m_nRestartPos)
366366
{
@@ -393,7 +393,7 @@ BOOL CSoundFile::ProcessRow()
393393
}
394394
}
395395
}
396-
// if (m_nRepeatCount > 0) m_nRepeatCount--;
396+
if (m_nRepeatCount > 0) m_nRepeatCount--;
397397
m_nCurrentPattern = m_nRestartPos;
398398
m_nRow = 0;
399399
if ((Order[m_nCurrentPattern] >= MAX_PATTERNS) || (!Patterns[Order[m_nCurrentPattern]])) return FALSE;

0 commit comments

Comments
 (0)