|
From: Yoda-JM <yo...@us...> - 2010-08-15 14:52:26
|
Module: performous
Branch: joinmenu
Commit: 34aaed0a09c83565b5481f6744cb3ba0f7c4c486
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Jul 5 19:58:53 2010 +0200
Implemented audio volume
---
game/audio.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 67b1ec9..ac93f15 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -45,7 +45,7 @@ public:
if (fadeLevel <= 0.0) return false;
if (fadeLevel > 1.0) { fadeLevel = 1.0; fadeRate = 0.0; }
}
- begin[i] += mixbuf[i] * fadeLevel;
+ begin[i] += mixbuf[i] * fadeLevel * static_cast<float>(m_preview ? config["audio/preview_volume"].i() : config["audio/music_volume"].i())/100.0;
}
return !eof;
}
@@ -92,7 +92,7 @@ struct Sample {
eof = true;
}
for (size_t i = 0, iend = end - begin; i != iend; ++i) {
- begin[i] += mixbuf[i];
+ begin[i] += mixbuf[i] * static_cast<float>(config["audio/fail_volume"].i())/100.0;
}
m_pos += end - begin;
}
|