|
From: <sag...@us...> - 2011-02-12 20:40:34
|
Revision: 798
http://modplug.svn.sourceforge.net/modplug/?rev=798&view=rev
Author: saga-games
Date: 2011-02-12 20:40:27 +0000 (Sat, 12 Feb 2011)
Log Message:
-----------
[Mod] Made the IT bidi loop flag non-static as loading another IT file reset the flag. I guess passing another parameter won't make the mixer slower...
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Fastmix.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/soundlib/Fastmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Fastmix.cpp 2011-02-11 23:28:58 UTC (rev 797)
+++ trunk/OpenMPT/soundlib/Fastmix.cpp 2011-02-12 20:40:27 UTC (rev 798)
@@ -1425,8 +1425,8 @@
/////////////////////////////////////////////////////////////////////////
-static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples)
-//---------------------------------------------------------------------
+static LONG MPPFASTCALL GetSampleCount(MODCHANNEL *pChn, LONG nSamples, bool bITBidiMode)
+//---------------------------------------------------------------------------------------
{
LONG nLoopStart = (pChn->dwFlags & CHN_LOOP) ? pChn->nLoopStart : 0;
LONG nInc = pChn->nInc;
@@ -1479,8 +1479,7 @@
pChn->nPos = pChn->nLength - nDeltaHi - (nDeltaLo>>16);
pChn->nPosLo = nDeltaLo & 0xffff;
// Impulse Tracker's software mixer would put a -2 (instead of -1) in the following line (doesn't happen on a GUS)
- // The bidi mode flag is stored in a static CSoundFile variable. Dirty!
- if ((pChn->nPos <= pChn->nLoopStart) || (pChn->nPos >= pChn->nLength)) pChn->nPos = pChn->nLength - (CSoundFile::m_bITBidiMode ? 2 : 1);
+ if ((pChn->nPos <= pChn->nLoopStart) || (pChn->nPos >= pChn->nLength)) pChn->nPos = pChn->nLength - (bITBidiMode ? 2 : 1);
} else
{
if (nInc < 0) // This is a bug
@@ -1663,7 +1662,7 @@
{
if ((LONG)nrampsamples > pChannel->nRampLength) nrampsamples = pChannel->nRampLength;
}
- if ((nSmpCount = GetSampleCount(pChannel, nrampsamples)) <= 0)
+ if ((nSmpCount = GetSampleCount(pChannel, nrampsamples, m_bITBidiMode)) <= 0)
{
// Stopping the channel
pChannel->pCurrentSample = NULL;
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-02-11 23:28:58 UTC (rev 797)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-02-12 20:40:27 UTC (rev 798)
@@ -438,7 +438,6 @@
CTuningCollection* CSoundFile::s_pTuningsSharedBuiltIn(0);
CTuningCollection* CSoundFile::s_pTuningsSharedLocal(0);
uint8 CSoundFile::s_DefaultPlugVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE;
-bool CSoundFile::m_bITBidiMode = false;
#pragma warning(disable : 4355) // "'this' : used in base member initializer list"
CSoundFile::CSoundFile() :
@@ -473,6 +472,7 @@
m_nMaxSample = 0;
m_ModFlags = 0;
+ m_bITBidiMode = false;
m_pModDoc = NULL;
m_dwLastSavedWithVersion=0;
@@ -3096,5 +3096,5 @@
void CSoundFile::SetupITBidiMode()
//--------------------------------
{
- CSoundFile::m_bITBidiMode = IsCompatibleMode(TRK_IMPULSETRACKER);
+ m_bITBidiMode = IsCompatibleMode(TRK_IMPULSETRACKER);
}
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-02-11 23:28:58 UTC (rev 797)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-02-12 20:40:27 UTC (rev 798)
@@ -574,12 +574,12 @@
private: //Misc data
uint16 m_ModFlags;
const CModSpecifications* m_pModSpecs;
+ bool m_bITBidiMode; // Process bidi loops like Impulse Tracker (see Fastmix.cpp for an explanation)
// For handling backwards jumps and stuff to prevent infinite loops when counting the mod length or rendering to wav.
VisitedRowsType m_VisitedRows;
-
public: // Static Members
static UINT m_nXBassDepth, m_nXBassRange;
static float m_nMaxSample;
@@ -593,10 +593,8 @@
static LPSNDMIXHOOKPROC gpSndMixHook;
static PMIXPLUGINCREATEPROC gpMixPluginCreateProc;
static uint8 s_DefaultPlugVolumeHandling;
- static bool m_bITBidiMode; // Process bidi loops like Impulse Tracker (see Fastmix.cpp for an explanation)
-
public: // for Editing
CModDoc* m_pModDoc; // Can be a null pointer f.e. when previewing samples from the treeview.
MODTYPE m_nType;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|