From: <man...@us...> - 2013-04-10 22:27:21
|
Revision: 1826 http://sourceforge.net/p/modplug/code/1826 Author: manxorist Date: 2013-04-10 22:27:14 +0000 (Wed, 10 Apr 2013) Log Message: ----------- [Ref] Replace superfluous flag m_bITBidiMode with a member function IsITPingPongMode(). Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/soundlib/Fastmix.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-10 21:34:00 UTC (rev 1825) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-10 22:27:14 UTC (rev 1826) @@ -1414,8 +1414,6 @@ const bool bPatLoop = m_pSndFile->m_SongFlags[SONG_PATTERNLOOP]; m_pSndFile->ResetChannels(); - // Select correct bidi loop mode when playing a module. - m_pSndFile->SetupITBidiMode(); if(!bPatLoop && bPaused) pSndFile->m_SongFlags.set(SONG_PAUSED); pSndFile->SetRepeatCount((TrackerSettings::Instance().gbLoopSong) ? -1 : 0); Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2013-04-10 21:34:00 UTC (rev 1825) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2013-04-10 22:27:14 UTC (rev 1826) @@ -378,8 +378,6 @@ sndFile.m_nDefaultRowsPerBeat = GetDlgItemInt(IDC_ROWSPERBEAT); sndFile.m_nDefaultRowsPerMeasure = GetDlgItemInt(IDC_ROWSPERMEASURE); - sndFile.SetupITBidiMode(); - if(CChannelManagerDlg::sharedInstance(FALSE) && CChannelManagerDlg::sharedInstance()->IsDisplayed()) CChannelManagerDlg::sharedInstance()->Update(); CDialog::OnOK(); Modified: trunk/OpenMPT/soundlib/Fastmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Fastmix.cpp 2013-04-10 21:34:00 UTC (rev 1825) +++ trunk/OpenMPT/soundlib/Fastmix.cpp 2013-04-10 22:27:14 UTC (rev 1826) @@ -1461,6 +1461,7 @@ if (!count) return 0; BOOL bSurround; + bool ITPingPongMode = IsITPingPongMode(); if (gnChannels > 2) X86_InitMixBuffer(MixRearBuffer, count*2); nchused = nchmixed = 0; for (UINT nChn=0; nChn<m_nMixChannels; nChn++) @@ -1559,7 +1560,7 @@ { if ((LONG)nrampsamples > pChannel->nRampLength) nrampsamples = pChannel->nRampLength; } - if ((nSmpCount = GetSampleCount(pChannel, nrampsamples, m_bITBidiMode)) <= 0) + if ((nSmpCount = GetSampleCount(pChannel, nrampsamples, ITPingPongMode)) <= 0) { // Stopping the channel pChannel->pCurrentSample = NULL; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-10 21:34:00 UTC (rev 1825) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-10 22:27:14 UTC (rev 1826) @@ -445,7 +445,6 @@ #endif // MODPLUG_TRACKER m_ModFlags.reset(); - m_bITBidiMode = false; m_dwLastSavedWithVersion=0; m_dwCreatedWithVersion=0; @@ -1698,7 +1697,6 @@ return; SetupMODPanning(); // Setup LRRL panning scheme if needed - SetupITBidiMode(); // Setup IT bidi mode m_ModFlags = m_ModFlags & GetModFlagMask(oldtype, newType); @@ -1943,14 +1941,6 @@ } -// Set or unset the IT bidi loop mode (see Fastmix.cpp for an explanation). The variable has to be static... -void CSoundFile::SetupITBidiMode() -//-------------------------------- -{ - m_bITBidiMode = IsCompatibleMode(TRK_IMPULSETRACKER); -} - - // For old files made with MPT that don't have m_ModFlags set yet, set the flags appropriately. void CSoundFile::UpgradeModFlags() //-------------------------------- Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-10 21:34:00 UTC (rev 1825) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-10 22:27:14 UTC (rev 1826) @@ -188,6 +188,12 @@ return ((GetType() & type) && GetModFlag(MSF_COMPATIBLE_PLAY)); } + // Process pingpong loops like Impulse Tracker (see Fastmix.cpp for an explanation) + bool IsITPingPongMode() const + { + return IsCompatibleMode(TRK_IMPULSETRACKER); + } + // Check whether a filter algorithm closer to IT's should be used. bool UseITFilterMode() const { return IsCompatibleMode(TRK_IMPULSETRACKER) && !m_SongFlags[SONG_EXFILTERRANGE]; } @@ -235,7 +241,6 @@ private: //Misc data FlagSet<ModSpecificFlag, uint16> m_ModFlags; const CModSpecifications* m_pModSpecs; - bool m_bITBidiMode; // Process bidi loops like Impulse Tracker (see Fastmix.cpp for an explanation) public: // Static Members #ifndef NO_REVERB @@ -398,8 +403,6 @@ bool IsPaused() const { return m_SongFlags[SONG_PAUSED | SONG_STEP]; } // Added SONG_STEP as it seems to be desirable in most cases to check for this as well. void LoopPattern(PATTERNINDEX nPat, ROWINDEX nRow = 0); - void SetupITBidiMode(); - bool InitChannel(CHANNELINDEX nChn); // Module Loaders This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |