From: <sag...@us...> - 2013-04-27 18:37:40
|
Revision: 1984 http://sourceforge.net/p/modplug/code/1984 Author: saga-games Date: 2013-04-27 18:37:32 +0000 (Sat, 27 Apr 2013) Log Message: ----------- [Fix] Channel flags were not reset when resetting channel settings. Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/soundlib/Load_digi.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_ult.cpp trunk/OpenMPT/soundlib/ModChannel.h trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -845,10 +845,7 @@ sndFile.Instruments[i]->nResSwing = 0; } - for(CHANNELINDEX i = 0; i <= sndFile.GetNumChannels(); i++) - { - sndFile.ChnSettings[i].Reset(); - } + sndFile.InitializeChannels(); // reset samples ctrlSmp::ResetSamples(sndFile, ctrlSmp::SmpResetCompo); Modified: trunk/OpenMPT/soundlib/Load_digi.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Load_digi.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -171,7 +171,6 @@ } else { // ...but uncompressed patterns are stored in column-major order. WTF! - ASSERT(false); for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) { for(ROWINDEX row = 0; row < 64; row++) Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -415,8 +415,6 @@ { ChnSettings[i].Reset(); ChnSettings[i].nVolume = Clamp(fileHeader.chnvol[i], uint8(0), uint8(64)); - ChnSettings[i].nPan = 128; - ChnSettings[i].dwFlags.reset(); if(fileHeader.chnpan[i] & 0x80) ChnSettings[i].dwFlags.set(CHN_MUTE); uint8 n = fileHeader.chnpan[i] & 0x7F; if(n <= 64) ChnSettings[i].nPan = n * 4; Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -1171,8 +1171,7 @@ { ChnSettings[i].Reset(); ChnSettings[i].nPan = ((15 - (file.ReadUint8() & 0x0F)) * 256 + 8) / 15; // 15 seems to be left and 0 seems to be right... - ChnSettings[i].nVolume = 64; - ChnSettings[i].dwFlags.reset(); // (i >= fileHeader.numChannelsPlay) ? CHN_MUTE : 0; // don't mute channels, as muted channels are completely ignored in S3M + // ChnSettings[i].dwFlags = (i >= fileHeader.numChannelsPlay) ? CHN_MUTE : 0; // don't mute channels, as muted channels are completely ignored in S3M } } Modified: trunk/OpenMPT/soundlib/Load_ult.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ult.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Load_ult.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -432,20 +432,13 @@ if(GetNumChannels() > MAX_BASECHANNELS || numPats > MAX_PATTERNS) return false; - if(fileHeader.version >= '3') + for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) { - for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) - { - ChnSettings[chn].Reset(); + ChnSettings[chn].Reset(); + if(fileHeader.version >= '3') ChnSettings[chn].nPan = ((file.ReadUint8() & 0x0F) << 4) + 8; - } - } else - { - for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) - { - ChnSettings[chn].Reset(); + else ChnSettings[chn].nPan = (chn & 1) ? 192 : 64; - } } for(PATTERNINDEX pat = 0; pat < numPats; pat++) Modified: trunk/OpenMPT/soundlib/ModChannel.h =================================================================== --- trunk/OpenMPT/soundlib/ModChannel.h 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/ModChannel.h 2013-04-27 18:37:32 UTC (rev 1984) @@ -195,6 +195,7 @@ void Reset() { + dwFlags.reset(); nPan = 128; nVolume = 64; nMixPlugin = 0; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-27 18:08:54 UTC (rev 1983) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-27 18:37:32 UTC (rev 1984) @@ -1238,12 +1238,7 @@ { if(nChn >= MAX_BASECHANNELS) return true; - ChnSettings[nChn].nPan = 128; - ChnSettings[nChn].nVolume = 64; - ChnSettings[nChn].dwFlags.reset(); - ChnSettings[nChn].nMixPlugin = 0; - strcpy(ChnSettings[nChn].szName, ""); - + ChnSettings[nChn].Reset(); Chn[nChn].Reset(ModChannel::resetTotal, *this, nChn); #ifdef MODPLUG_TRACKER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |