|
From: <sag...@us...> - 2014-05-01 22:59:13
|
Revision: 4028
http://sourceforge.net/p/modplug/code/4028
Author: saga-games
Date: 2014-05-01 22:59:06 +0000 (Thu, 01 May 2014)
Log Message:
-----------
[Fix] Global volume slides were not limited properly when jumping around in a module.
[Fix] Sample sync on jump could break if there was an EDx command in MOD/XM.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-05-01 19:07:49 UTC (rev 4027)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-05-01 22:59:06 UTC (rev 4028)
@@ -523,7 +523,7 @@
if (!(GetType() & GLOBALVOL_7BIT_FORMATS)) param <<= 1;
memory.state.m_nGlobalVolume -= param * (memory.state.m_nMusicSpeed - 1);
}
- memory.state.m_nGlobalVolume = Clamp(memory.state.m_nGlobalVolume, 0u, 256u);
+ memory.state.m_nGlobalVolume = Clamp(memory.state.m_nGlobalVolume, 0, 256);
break;
case CMD_CHANNELVOLUME:
if (param <= 64) pChn->nGlobalVol = param;
@@ -679,12 +679,14 @@
if(p->command == CMD_MODCMDEX)
{
switch(p->param & 0xF0)
+ {
case 0x10:
case 0x20:
case 0xA0:
case 0xB0:
stopNote = true;
- break;
+ break;
+ }
}
}
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2014-05-01 19:07:49 UTC (rev 4027)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2014-05-01 22:59:06 UTC (rev 4028)
@@ -872,7 +872,7 @@
if (!m_nDefaultSpeed) m_nDefaultSpeed = 6;
m_PlayState.m_nMusicSpeed = m_nDefaultSpeed;
m_PlayState.m_nMusicTempo = m_nDefaultTempo;
- m_PlayState.m_nGlobalVolume = m_nDefaultGlobalVolume;
+ m_PlayState.m_nGlobalVolume = static_cast<int32>(m_nDefaultGlobalVolume);
m_PlayState.m_lHighResRampingGlobalVolume = m_PlayState.m_nGlobalVolume<<VOLUMERAMPPRECISION;
m_PlayState.m_nGlobalVolumeDestination = m_PlayState.m_nGlobalVolume;
m_PlayState.m_nSamplesToGlobalVolRampDest = 0;
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2014-05-01 19:07:49 UTC (rev 4027)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2014-05-01 22:59:06 UTC (rev 4028)
@@ -446,9 +446,9 @@
// Global volume
public:
- uint32 m_nGlobalVolume;
+ int32 m_nGlobalVolume;
protected:
- uint32 m_nSamplesToGlobalVolRampDest, m_nGlobalVolumeRampAmount,
+ int32 m_nSamplesToGlobalVolRampDest, m_nGlobalVolumeRampAmount,
m_nGlobalVolumeDestination;
int32 m_lHighResRampingGlobalVolume;
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2014-05-01 19:07:49 UTC (rev 4027)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2014-05-01 22:59:06 UTC (rev 4028)
@@ -2219,7 +2219,7 @@
template<int channels>
-forceinline void ApplyGlobalVolumeWithRamping(int *SoundBuffer, int *RearBuffer, int32 lCount, uint32 m_nGlobalVolume, int32 step, uint32 &m_nSamplesToGlobalVolRampDest, int32 &m_lHighResRampingGlobalVolume)
+forceinline void ApplyGlobalVolumeWithRamping(int *SoundBuffer, int *RearBuffer, int32 lCount, int32 m_nGlobalVolume, int32 step, int32 &m_nSamplesToGlobalVolRampDest, int32 &m_lHighResRampingGlobalVolume)
{
const bool isStereo = (channels >= 2);
const bool hasRear = (channels >= 4);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|