summaryrefslogtreecommitdiff
path: root/src/mixer.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-03-03 04:04:22 +0000
committerbelugas <belugas@openttd.org>2007-03-03 04:04:22 +0000
commitb71354dc406340a0d9b57b64b17ea5f3758e4309 (patch)
treea56d1e1d13bc7d618e33a50ed711f4c5387a5c21 /src/mixer.cpp
parent6887fbbaaf73751fe0675e322c83fddcdb9f09d8 (diff)
downloadopenttd-b71354dc406340a0d9b57b64b17ea5f3758e4309.tar.xz
(svn r8987) -Cleanup: doxygen changes. Again. Mostly (still) @files missing tags and (more than just) a few comments style.
Diffstat (limited to 'src/mixer.cpp')
-rw-r--r--src/mixer.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mixer.cpp b/src/mixer.cpp
index 5037f771b..9ae831ae5 100644
--- a/src/mixer.cpp
+++ b/src/mixer.cpp
@@ -1,5 +1,7 @@
/* $Id$ */
+/** @file mixer.cpp*/
+
#include "stdafx.h"
#include "openttd.h"
#include "mixer.h"
@@ -7,16 +9,16 @@
struct MixerChannel {
bool active;
- // pointer to allocated buffer memory
+ /* pointer to allocated buffer memory */
int8 *memory;
- // current position in memory
+ /* current position in memory */
uint32 pos;
uint32 frac_pos;
uint32 frac_speed;
uint32 samples_left;
- // Mixing volume
+ /* Mixing volume */
uint volume_left;
uint volume_right;
@@ -46,7 +48,7 @@ static void mix_int8_to_int16(MixerChannel *sc, int16 *buffer, uint samples)
volume_right = sc->volume_right;
if (frac_speed == 0x10000) {
- // Special case when frac_speed is 0x10000
+ /* Special case when frac_speed is 0x10000 */
do {
buffer[0] += *b * volume_left >> 8;
buffer[1] += *b * volume_right >> 8;
@@ -79,10 +81,10 @@ void MxMixSamples(void *buffer, uint samples)
{
MixerChannel *mc;
- // Clear the buffer
+ /* Clear the buffer */
memset(buffer, 0, sizeof(int16) * 2 * samples);
- // Mix each channel
+ /* Mix each channel */
for (mc = _channels; mc != endof(_channels); mc++) {
if (mc->active) {
mix_int8_to_int16(mc, (int16*)buffer, samples);
@@ -111,7 +113,7 @@ void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, uint size, uint rate, uint
mc->frac_speed = (rate << 16) / _play_rate;
- // adjust the magnitude to prevent overflow
+ /* adjust the magnitude to prevent overflow */
while (size & 0xFFFF0000) {
size >>= 1;
rate = (rate >> 1) + 1;