summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-31 19:59:01 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-31 19:59:01 +0200
commitc1c163d78c7f822b62aa6b0f5c7b00642b961700 (patch)
tree7a586e9878b6725e52f92e0efbc6576828b18696 /src/audio
parentbetter name (diff)
downloadre3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar
re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.gz
re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.bz2
re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.lz
re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.xz
re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.zst
re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.zip
Diffstat (limited to '')
-rw-r--r--src/audio/sampman.h4
-rw-r--r--src/audio/sampman_miles.cpp11
-rw-r--r--src/audio/sampman_null.cpp4
-rw-r--r--src/audio/sampman_oal.cpp12
4 files changed, 20 insertions, 11 deletions
diff --git a/src/audio/sampman.h b/src/audio/sampman.h
index 655efb5c..b539854c 100644
--- a/src/audio/sampman.h
+++ b/src/audio/sampman.h
@@ -126,10 +126,10 @@ public:
void StartChannel (uint32 nChannel);
void StopChannel (uint32 nChannel);
- void PreloadStreamedFile (uint8 nFile, uint8 nStream);
+ void PreloadStreamedFile (uint32 nFile, uint8 nStream);
void PauseStream (uint8 nPauseFlag, uint8 nStream);
void StartPreloadedStreamedFile (uint8 nStream);
- bool StartStreamedFile (uint8 nFile, uint32 nPos, uint8 nStream);
+ bool StartStreamedFile (uint32 nFile, uint32 nPos, uint8 nStream);
void StopStreamedFile (uint8 nStream);
int32 GetStreamedFilePosition (uint8 nStream);
void SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffectFlag, uint8 nStream);
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp
index 63e89cac..406e8716 100644
--- a/src/audio/sampman_miles.cpp
+++ b/src/audio/sampman_miles.cpp
@@ -2030,7 +2030,7 @@ cSampleManager::StopChannel(uint32 nChannel)
}
void
-cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream)
+cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream)
{
if ( m_bInitialised )
{
@@ -2081,7 +2081,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
}
bool
-cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
+cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{
uint32 position = nPos;
char filename[MAX_PATH];
@@ -2287,7 +2287,12 @@ cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffect
if ( mp3Stream[nStream] )
{
if ( nEffectFlag )
- AIL_set_stream_volume(mp3Stream[nStream], m_nEffectsFadeVolume*vol*m_nEffectsVolume >> 14);
+ {
+ if ( nStream == 1 ) // TODO(MIAMI): || nStream == 2 when we have second mission channel?
+ AIL_set_stream_volume(mp3Stream[nStream], 64*vol*m_nEffectsVolume >> 14);
+ else
+ AIL_set_stream_volume(mp3Stream[nStream], m_nEffectsFadeVolume*vol*m_nEffectsVolume >> 14);
+ }
else
AIL_set_stream_volume(mp3Stream[nStream], m_nMusicFadeVolume*vol*m_nMusicVolume >> 14);
diff --git a/src/audio/sampman_null.cpp b/src/audio/sampman_null.cpp
index 6ec8a521..3638e6fb 100644
--- a/src/audio/sampman_null.cpp
+++ b/src/audio/sampman_null.cpp
@@ -297,7 +297,7 @@ cSampleManager::StopChannel(uint32 nChannel)
}
void
-cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream)
+cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
}
@@ -315,7 +315,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
}
bool
-cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
+cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index 5092a4b1..210d128e 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -1168,7 +1168,7 @@ cSampleManager::StopChannel(uint32 nChannel)
}
void
-cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream)
+cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream)
{
char filename[256];
@@ -1226,7 +1226,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
}
bool
-cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
+cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{
char filename[256];
@@ -1317,8 +1317,12 @@ cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffect
if ( stream )
{
- if ( nEffectFlag )
- stream->SetVolume(m_nEffectsFadeVolume*nVolume*m_nEffectsVolume >> 14);
+ if ( nEffectFlag ) {
+ if ( nStream == 1 ) // TODO(MIAMI): || nStream == 2 when we have second mission channel?
+ stream->SetVolume(64*vol*m_nEffectsVolume >> 14)
+ else
+ stream->SetVolume(m_nEffectsFadeVolume*nVolume*m_nEffectsVolume >> 14);
+ }
else
stream->SetVolume(m_nMusicFadeVolume*nVolume*m_nMusicVolume >> 14);