|
From: <sag...@us...> - 2013-02-04 16:32:04
|
Revision: 1514
http://sourceforge.net/p/modplug/code/1514
Author: saga-games
Date: 2013-02-04 16:31:55 +0000 (Mon, 04 Feb 2013)
Log Message:
-----------
[Ref] Removed more unused CPU-limiting code.
[Mod] XM tempo limits were accidentally set to 10000 a while ago (this will come... but not now.)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_defs.h
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2013-02-03 20:58:24 UTC (rev 1513)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2013-02-04 16:31:55 UTC (rev 1514)
@@ -253,7 +253,7 @@
SONG_FADINGSONG = 0x0100, // Song is fading out
SONG_ENDREACHED = 0x0200, // Song is finished
SONG_GLOBALFADE = 0x0400, // Song is fading out
- SONG_CPUVERYHIGH = 0x0800, // High CPU usage
+ //SONG_CPUVERYHIGH = 0x0800, // High CPU usage
SONG_FIRSTTICK = 0x1000, // Is set when the current tick is the first tick of the row
SONG_MPTFILTERMODE = 0x2000, // Local filter mode (reset filter on each note)
SONG_SURROUNDPAN = 0x4000, // Pan in the rear channels
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-02-03 20:58:24 UTC (rev 1513)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-02-04 16:31:55 UTC (rev 1514)
@@ -1303,8 +1303,8 @@
}
-void CSoundFile::CheckNNA(CHANNELINDEX nChn, UINT instr, int note, BOOL bForceCut)
-//--------------------------------------------------------------------------------
+void CSoundFile::CheckNNA(CHANNELINDEX nChn, UINT instr, int note, bool forceCut)
+//-------------------------------------------------------------------------------
{
ModChannel *pChn = &Chn[nChn];
ModInstrument *pIns = nullptr;
@@ -1314,23 +1314,24 @@
return;
}
// Always NNA cut - using
- if ((!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_MT2))) || (!m_nInstruments) || (bForceCut))
+ if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_MT2)) || !m_nInstruments || forceCut)
{
- if (m_SongFlags[SONG_CPUVERYHIGH]
- || (!pChn->nLength) || pChn->dwFlags[CHN_MUTE]
- | ((!pChn->nLeftVol) && (!pChn->nRightVol))) return;
+ if(!pChn->nLength || pChn->dwFlags[CHN_MUTE] || !(pChn->nLeftVol | pChn->nRightVol))
+ {
+ return;
+ }
- UINT n = GetNNAChannel(nChn);
- if (!n) return;
- ModChannel *p = &Chn[n];
+ CHANNELINDEX n = GetNNAChannel(nChn);
+ if(!n) return;
+ ModChannel &chn = Chn[n];
// Copy Channel
- *p = *pChn;
- p->dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO | CHN_PANBRELLO | CHN_MUTE | CHN_PORTAMENTO);
- p->nMasterChn = nChn + 1;
- p->nCommand = CMD_NONE;
+ chn = *pChn;
+ chn.dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO | CHN_PANBRELLO | CHN_MUTE | CHN_PORTAMENTO);
+ chn.nMasterChn = nChn + 1;
+ chn.nCommand = CMD_NONE;
// Cut the note
- p->nFadeOutVol = 0;
- p->dwFlags.set(CHN_NOTEFADE | CHN_FASTVOLRAMP);
+ chn.nFadeOutVol = 0;
+ chn.dwFlags.set(CHN_NOTEFADE | CHN_FASTVOLRAMP);
// Stop this channel
pChn->nLength = pChn->nPos = pChn->nPosLo = 0;
pChn->nROfs = pChn->nLOfs = 0;
@@ -1351,7 +1352,7 @@
n = pIns->Keyboard[note - 1];
note = pIns->NoteMap[note - 1];
if(n > 0 && n < MAX_SAMPLES) pSample = Samples[n].pSample;
- }
+ }
} else pSample = nullptr;
}
ModChannel *p = pChn;
@@ -1895,9 +1896,9 @@
pChn->nNewNote = pChn->nLastNote = note;
// New Note Action ?
- if (!bPorta)
+ if(!bPorta)
{
- CheckNNA(nChn, instr, note, FALSE);
+ CheckNNA(nChn, instr, note, false);
}
}
@@ -4136,7 +4137,7 @@
}
UINT nNote = pChn->nNewNote;
int32 nOldPeriod = pChn->nPeriod;
- if ((nNote) && (nNote <= NOTE_MAX) && (pChn->nLength)) CheckNNA(nChn, 0, nNote, TRUE);
+ if ((nNote) && (nNote <= NOTE_MAX) && (pChn->nLength)) CheckNNA(nChn, 0, nNote, true);
bool bResetEnv = false;
if (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2))
{
@@ -4172,7 +4173,7 @@
// Now we can also store the retrig value for IT...
if(!IsCompatibleMode(TRK_IMPULSETRACKER))
- pChn->nRetrigCount = (BYTE)nRetrigCount;
+ pChn->nRetrigCount = nRetrigCount;
}
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-02-03 20:58:24 UTC (rev 1513)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-02-04 16:31:55 UTC (rev 1514)
@@ -1024,7 +1024,7 @@
m_nMusicTempo = m_nDefaultTempo;
visitedSongRows.Initialize(true);
}
- m_SongFlags.reset(SONG_CPUVERYHIGH | SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
+ m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
for (nPattern = 0; nPattern < Order.size(); nPattern++)
{
UINT ord = Order[nPattern];
@@ -1121,7 +1121,7 @@
m_nNextPatStartRow = 0;
}
- m_SongFlags.reset(SONG_CPUVERYHIGH | SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
+ m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
}
//rewbs.VSTCompliance
@@ -1199,7 +1199,7 @@
void CSoundFile::ResetChannels()
//------------------------------
{
- m_SongFlags.reset(SONG_CPUVERYHIGH | SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
+ m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
m_nBufferCount = 0;
for (UINT i=0; i<MAX_CHANNELS; i++)
{
@@ -1378,36 +1378,6 @@
}
-void CSoundFile::CheckCPUUsage(UINT nCPU)
-//---------------------------------------
-{
- if (nCPU > 100) nCPU = 100;
- gnCPUUsage = nCPU;
- if (nCPU < 90)
- {
- m_SongFlags.reset(SONG_CPUVERYHIGH);
- } else
- if(m_SongFlags[SONG_CPUVERYHIGH] && nCPU >= 94)
- {
- UINT i=MAX_CHANNELS;
- while (i >= 8)
- {
- i--;
- if (Chn[i].nLength)
- {
- Chn[i].nLength = Chn[i].nPos = 0;
- nCPU -= 2;
- if (nCPU < 94) break;
- }
- }
- } else
- if (nCPU > 90)
- {
- m_SongFlags.set(SONG_CPUVERYHIGH);
- }
-}
-
-
// Check whether a sample is used.
// In sample mode, the sample numbers in all patterns are checked.
// In instrument mode, it is only checked if a sample is referenced by an instrument (but not if the sample is actually played anywhere)
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2013-02-03 20:58:24 UTC (rev 1513)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2013-02-04 16:31:55 UTC (rev 1514)
@@ -380,7 +380,6 @@
int GetRepeatCount() const { return m_nRepeatCount; }
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 CheckCPUUsage(UINT nCPU);
void SetupITBidiMode();
@@ -517,7 +516,7 @@
BOOL ProcessRow();
BOOL ProcessEffects();
CHANNELINDEX GetNNAChannel(CHANNELINDEX nChn) const;
- void CheckNNA(CHANNELINDEX nChn, UINT instr, int note, BOOL bForceCut);
+ void CheckNNA(CHANNELINDEX nChn, UINT instr, int note, bool forceCut);
void NoteChange(CHANNELINDEX nChn, int note, bool bPorta = false, bool bResetEnv = true, bool bManual = false);
void InstrumentChange(ModChannel *pChn, UINT instr, bool bPorta = false, bool bUpdVol = true, bool bResetEnv = true);
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2013-02-03 20:58:24 UTC (rev 1513)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2013-02-04 16:31:55 UTC (rev 1514)
@@ -182,7 +182,7 @@
1, // Channel min
32, // Channel max
32, // Min tempo
- 10000, // Max tempo
+ 512, // Max tempo
1, // Min pattern rows
256, // Max pattern rows
20, // Max mod name length
@@ -225,7 +225,7 @@
1, // Channel min
127, // Channel max
32, // Min tempo
- 10000, // Max tempo
+ 512, // Max tempo
1, // Min pattern rows
1024, // Max pattern rows
20, // Max mod name length
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|