Skip to content

Commit

Permalink
[Fix] IMF: It was still possible that we were shifting by 64 bits.
Browse files Browse the repository at this point in the history
git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22229 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Nov 18, 2024
1 parent 67c985c commit a56fae3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions soundlib/Load_imf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ bool CSoundFile::ReadIMF(FileReader &file, ModLoadingFlags loadFlags)

// Read channel configuration
std::bitset<32> ignoreChannels; // bit set for each channel that's completely disabled
uint64 channelMuteStatus = static_cast<uint64>(0xAAAA'AAAA) << (GetNumChannels() * 2);
uint64 channelMuteStatus = 0;
for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++)
{
ChnSettings[chn].nPan = static_cast<uint16>(fileHeader.channels[chn].panning * 256 / 255);
Expand All @@ -459,7 +459,7 @@ bool CSoundFile::ReadIMF(FileReader &file, ModLoadingFlags loadFlags)
}
// BEHIND.IMF: All channels but the first are muted
// mikmod refers to this as an Orpheus bug, but I haven't seen any other files like this, so maybe it's just an incorrectly saved file?
if(channelMuteStatus == 0xAAAA'AAAA'5555'5554)
if(GetNumChannels() == 16 && channelMuteStatus == 0x5555'5554)
{
for(CHANNELINDEX chn = 1; chn < GetNumChannels(); chn++)
ChnSettings[chn].dwFlags.reset(CHN_MUTE);
Expand Down

0 comments on commit a56fae3

Please sign in to comment.