From: <sag...@us...> - 2010-11-06 16:11:03
|
Revision: 757 http://modplug.svn.sourceforge.net/modplug/?rev=757&view=rev Author: saga-games Date: 2010-11-06 16:10:57 +0000 (Sat, 06 Nov 2010) Log Message: ----------- [Imp] Order list: When jumpin to an order that is never played, tempo/speed/global volume are now reset. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-11-05 23:06:56 UTC (rev 756) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-11-06 16:10:57 UTC (rev 757) @@ -431,22 +431,32 @@ } // Store final variables - if (bAdjust && (targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID)) + if (bAdjust) { - m_nGlobalVolume = nGlbVol; - m_nOldGlbVolSlide = nOldGlbVolSlide; - m_nMusicSpeed = nMusicSpeed; - m_nMusicTempo = nMusicTempo; - for (CHANNELINDEX n = 0; n < m_nChannels; n++) + if (targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID) { - Chn[n].nGlobalVol = chnvols[n]; - if (notes[n]) Chn[n].nNewNote = notes[n]; - if (instr[n]) Chn[n].nNewIns = instr[n]; - if (vols[n] != 0xFF) + // Target found, or there is no target (i.e. play whole song)... + m_nGlobalVolume = nGlbVol; + m_nOldGlbVolSlide = nOldGlbVolSlide; + m_nMusicSpeed = nMusicSpeed; + m_nMusicTempo = nMusicTempo; + for (CHANNELINDEX n = 0; n < m_nChannels; n++) { - if (vols[n] > 64) vols[n] = 64; - Chn[n].nVolume = vols[n] << 2; + Chn[n].nGlobalVol = chnvols[n]; + if (notes[n]) Chn[n].nNewNote = notes[n]; + if (instr[n]) Chn[n].nNewIns = instr[n]; + if (vols[n] != 0xFF) + { + if (vols[n] > 64) vols[n] = 64; + Chn[n].nVolume = vols[n] << 2; + } } + } else + { + // Target not found (f.e. when jumping to a hidden sub song), reset global variables... + m_nMusicSpeed = m_nDefaultSpeed; + m_nMusicTempo = m_nDefaultTempo; + m_nGlobalVolume = m_nDefaultGlobalVolume; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |