Skip to content

Commit a607cb5

Browse files
AliceLRsezero
authored andcommitted
libmodplug: 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/libmodplug#51 See also: #123 https://github.com/AliceLR/megazeux/blob/f83d897dc7df808ed4ad3eb31b5abb6a7b479d08/contrib/patches/libmodplug/01-libmodplug-0.8.9.0-fix-looping.diff Mainstream pull request: Konstanty/libmodplug#102 Fixes: #123. (cherry picked from commit 427281b)
1 parent 8a0b23d commit a607cb5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/libmodplug/sndmix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ BOOL CSoundFile_ProcessRow(CSoundFile *_this)
219219
// End of song ?
220220
if ((_this->m_nPattern == 0xFF) || (_this->m_nCurrentPattern >= MAX_ORDERS))
221221
{
222-
//if (!_this->m_nRepeatCount)
222+
if (!_this->m_nRepeatCount)
223223
return FALSE; //never repeat entire song
224224
if (!_this->m_nRestartPos)
225225
{
@@ -253,7 +253,7 @@ BOOL CSoundFile_ProcessRow(CSoundFile *_this)
253253
}
254254
}
255255
}
256-
// if (_this->m_nRepeatCount > 0) _this->m_nRepeatCount--;
256+
if (_this->m_nRepeatCount > 0) _this->m_nRepeatCount--;
257257
_this->m_nCurrentPattern = _this->m_nRestartPos;
258258
_this->m_nRow = 0;
259259
if ((_this->Order[_this->m_nCurrentPattern] >= MAX_PATTERNS) || (!_this->Patterns[_this->Order[_this->m_nCurrentPattern]])) return FALSE;

0 commit comments

Comments
 (0)