|
From: <man...@us...> - 2014-03-18 09:43:40
|
Revision: 3898
http://sourceforge.net/p/modplug/code/3898
Author: manxorist
Date: 2014-03-18 09:43:33 +0000 (Tue, 18 Mar 2014)
Log Message:
-----------
[Ref] Replace CLAMP with Clamp in soundlib/ .
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_dmf.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/modcommand.cpp
Modified: trunk/OpenMPT/soundlib/Load_dmf.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_dmf.cpp 2014-03-18 08:56:19 UTC (rev 3897)
+++ trunk/OpenMPT/soundlib/Load_dmf.cpp 2014-03-18 09:43:33 UTC (rev 3898)
@@ -279,8 +279,8 @@
{
uint8 ontime = (val >> 4);
uint8 offtime = (val & 0x0F);
- ontime = CLAMP(ontime * internalTicks / 15, 1, 15);
- offtime = CLAMP(offtime * internalTicks / 15, 1, 15);
+ ontime = Clamp(ontime * internalTicks / 15, 1, 15);
+ offtime = Clamp(offtime * internalTicks / 15, 1, 15);
return (ontime << 4) | offtime;
}
@@ -302,7 +302,7 @@
// MPT: 1 vibrato period == 64 ticks... we have internalTicks ticks per row.
// X-Tracker: Period length specified in rows!
const int periodInTicks = MAX(1, (val >> 4)) * internalTicks;
- const uint8 matchingPeriod = (uint8)CLAMP((128 / periodInTicks), 1, 15);
+ const uint8 matchingPeriod = (uint8)Clamp((128 / periodInTicks), 1, 15);
return (matchingPeriod << 4) | MAX(1, (val & 0x0F));
}
@@ -742,7 +742,7 @@
useMem2 = true;
break;
case 7: // Scratch to Note (neat! but we don't have such an effect...)
- m->note = CLAMP(effectParam2 + 25, NOTE_MIN, NOTE_MAX);
+ m->note = Clamp(effectParam2 + 25, NOTE_MIN, NOTE_MAX);
effect2 = CMD_TONEPORTAMENTO;
effectParam2 = 0xFF;
useMem2 = true;
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-03-18 08:56:19 UTC (rev 3897)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-03-18 09:43:33 UTC (rev 3898)
@@ -374,9 +374,9 @@
// -> CODE#0010
// -> DESC="add extended parameter mechanism to pattern effects"
if(IsCompatibleMode(TRK_ALLTRACKERS)) // clamp tempo correctly in compatible mode
- memory.state.m_nMusicTempo = CLAMP(memory.state.m_nMusicTempo, 32, 255);
+ memory.state.m_nMusicTempo = Clamp(memory.state.m_nMusicTempo, 32u, 255u);
else
- memory.state.m_nMusicTempo = CLAMP(memory.state.m_nMusicTempo, GetModSpecifications().tempoMin, GetModSpecifications().tempoMax);
+ memory.state.m_nMusicTempo = Clamp(memory.state.m_nMusicTempo, GetModSpecifications().tempoMin, GetModSpecifications().tempoMax);
// -! NEW_FEATURE#0010
break;
@@ -1271,7 +1271,7 @@
if(IsCompatibleMode(TRK_IMPULSETRACKER))
{
// need to memorize the original note for various effects (e.g. PPS)
- pChn->nNote = CLAMP(realnote, NOTE_MIN, NOTE_MAX);
+ pChn->nNote = Clamp(realnote, NOTE_MIN, NOTE_MAX);
} else
{
pChn->nNote = note;
@@ -3637,7 +3637,7 @@
if (nChnSlide)
{
nChnSlide += pChn->nGlobalVol;
- nChnSlide = CLAMP(nChnSlide, 0, 64);
+ nChnSlide = Clamp(nChnSlide, 0, 64);
pChn->nGlobalVol = nChnSlide;
}
}
@@ -4728,7 +4728,7 @@
if(setAsNonModcommand)
{
// Set tempo from UI - ignore slide commands and such.
- m_PlayState.m_nMusicTempo = CLAMP(param, specs.tempoMin, specs.tempoMax);
+ m_PlayState.m_nMusicTempo = Clamp(param, specs.tempoMin, specs.tempoMax);
}
else
{
@@ -4747,9 +4747,9 @@
// -> CODE#0016
// -> DESC="default tempo update"
if(IsCompatibleMode(TRK_ALLTRACKERS)) // clamp tempo correctly in compatible mode
- m_PlayState.m_nMusicTempo = CLAMP(m_PlayState.m_nMusicTempo, 32, 255);
+ m_PlayState.m_nMusicTempo = Clamp(m_PlayState.m_nMusicTempo, 32u, 255u);
else
- m_PlayState.m_nMusicTempo = CLAMP(m_PlayState.m_nMusicTempo, specs.tempoMin, specs.tempoMax);
+ m_PlayState.m_nMusicTempo = Clamp(m_PlayState.m_nMusicTempo, specs.tempoMin, specs.tempoMax);
// -! BEHAVIOUR_CHANGE#0016
}
}
Modified: trunk/OpenMPT/soundlib/modcommand.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.cpp 2014-03-18 08:56:19 UTC (rev 3897)
+++ trunk/OpenMPT/soundlib/modcommand.cpp 2014-03-18 09:43:33 UTC (rev 3898)
@@ -556,7 +556,7 @@
case VOLCMD_PANNING:
command = CMD_PANNING8;
- param = CLAMP(vol << 2, 0, 0xFF);
+ param = Clamp(vol << 2, 0, 0xFF);
break;
case VOLCMD_VOLSLIDEDOWN:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|