|
From: <sag...@us...> - 2015-01-24 18:04:21
|
Revision: 4733
http://sourceforge.net/p/modplug/code/4733
Author: saga-games
Date: 2015-01-24 18:04:15 +0000 (Sat, 24 Jan 2015)
Log Message:
-----------
[Fix] In IT linear slide mode, frequency fixes were done the wrong way around when sliding less than 1Hz up or down and prevent pointless note stopping in IT files if the frequency drops below a certain point (there is no reason for this behaviour).
[Mod] Allow loading IT files with tempo 31 normally.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2015-01-23 22:51:31 UTC (rev 4732)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2015-01-24 18:04:15 UTC (rev 4733)
@@ -431,7 +431,7 @@
m_nDefaultGlobalVolume = fileHeader.globalvol << 1;
if(m_nDefaultGlobalVolume > MAX_GLOBAL_VOLUME) m_nDefaultGlobalVolume = MAX_GLOBAL_VOLUME;
if(fileHeader.speed) m_nDefaultSpeed = fileHeader.speed;
- m_nDefaultTempo = std::max(uint8(32), fileHeader.tempo); // Tempo 31 is possible. due to conflicts with the rest of the engine, let's just clamp it to 32.
+ m_nDefaultTempo = std::max(uint8(31), fileHeader.tempo);
m_nSamplePreAmp = std::min(fileHeader.mv, uint8(128));
// Reading Channels Pan Positions
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-01-23 22:51:31 UTC (rev 4732)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-01-24 18:04:15 UTC (rev 4733)
@@ -4712,7 +4712,7 @@
{
if (n > 255) n = 255;
pChn->nPeriod = Util::muldivr(pChn->nPeriod, LinearSlideUpTable[n], 65536);
- if (pChn->nPeriod == nOldPeriod) pChn->nPeriod = nOldPeriod-1;
+ if (pChn->nPeriod == nOldPeriod) pChn->nPeriod = nOldPeriod + 1;
}
} else
{
@@ -4721,22 +4721,14 @@
{
if (n > 255) n = 255;
pChn->nPeriod = Util::muldivr(pChn->nPeriod, LinearSlideDownTable[n], 65536);
- if (pChn->nPeriod == nOldPeriod) pChn->nPeriod = nOldPeriod+1;
+ if (pChn->nPeriod == nOldPeriod) pChn->nPeriod = nOldPeriod - 1;
}
}
} else
{
pChn->nPeriod += nFreqSlide;
}
- if(pChn->nPeriod < 1)
- {
- pChn->nPeriod = 1;
- if(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))
- {
- pChn->dwFlags.set(CHN_NOTEFADE);
- pChn->nFadeOutVol = 0;
- }
- }
+ if(pChn->nPeriod < 1) pChn->nPeriod = 1;
}
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2015-01-23 22:51:31 UTC (rev 4732)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2015-01-24 18:04:15 UTC (rev 4733)
@@ -899,7 +899,7 @@
// Check invalid instruments
while ((m_nInstruments > 0) && (!Instruments[m_nInstruments])) m_nInstruments--;
// Set default values
- if (m_nDefaultTempo < 32) m_nDefaultTempo = 125;
+ if (!m_nDefaultTempo) m_nDefaultTempo = 125;
if (!m_nDefaultSpeed) m_nDefaultSpeed = 6;
m_PlayState.m_nMusicSpeed = m_nDefaultSpeed;
m_PlayState.m_nMusicTempo = m_nDefaultTempo;
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2015-01-23 22:51:31 UTC (rev 4732)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2015-01-24 18:04:15 UTC (rev 4733)
@@ -1743,14 +1743,6 @@
freq = Util::muldivr(freq, m_PlayState.m_nMusicTempo, pIns->wPitchToTempoLock);
}
- if ((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (freq < 256))
- {
- pChn->nFadeOutVol = 0;
- pChn->dwFlags.set(CHN_NOTEFADE);
- pChn->nRealVolume = 0;
- pChn->nCalcVolume = 0;
- }
-
return Util::muldivr(freq, 0x10000, m_MixerSettings.gdwMixingFreq << FREQ_FRACBITS);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|