From: <sv...@op...> - 2024-07-08 20:56:37
|
Author: sagamusix Date: Mon Jul 8 22:56:27 2024 New Revision: 21129 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21129 Log: [Fix] GMC: Loop length is in words, not bytes (but confusingly, "no loop" is still implied by a stored loop length value of 2, not 1 like in MOD...). Modified: trunk/OpenMPT/soundlib/Load_gmc.cpp Modified: trunk/OpenMPT/soundlib/Load_gmc.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_gmc.cpp Sat Jul 6 12:27:06 2024 (r21128) +++ trunk/OpenMPT/soundlib/Load_gmc.cpp Mon Jul 8 22:56:27 2024 (r21129) @@ -32,7 +32,7 @@ if(loopLength > 2) { - mptSmp.nLoopStart = mptSmp.nLength - loopLength; + mptSmp.nLoopStart = mptSmp.nLength - loopLength * 2u; mptSmp.nLoopEnd = mptSmp.nLength; mptSmp.uFlags.set(CHN_LOOP); } @@ -44,7 +44,7 @@ return false; if(length > 0x7FFF || dataStart > 0x7FFF || (dataStart & 1)) return false; - if(loopLength > 2 && loopLength > (length * 2u)) + if(loopLength > 2 && loopLength > length) return false; if(volume > 64) return false; |