]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_mix.c
gave names to nearly all structs and enums which should make for better C++ error...
[xonotic/darkplaces.git] / snd_mix.c
index 2315f7c9fc22aeeb83efaeecfea6d27ff827a490..e7396cb8b81a239600a17f41f44339a8230aa050 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 #include "snd_main.h"
 
-typedef struct
+typedef struct portable_samplepair_s
 {
        int left;
        int right;
@@ -277,7 +277,7 @@ void S_PaintChannels(int endtime)
 
                                // paint up to end
                                if (ch->end < end)
-                                       count = ch->end - ltime;
+                                       count = (int)ch->end - ltime;
                                else
                                        count = end - ltime;
 
@@ -355,7 +355,7 @@ qboolean SND_PaintChannelFrom8 (channel_t *ch, int count)
        // Stereo sound support
        if (ch->sfx->format.channels == 2)
        {
-               sfx = sb->data + (ch->pos - sb->offset) * 2;
+               sfx = (signed char *)sb->data + (ch->pos - sb->offset) * 2;
                for (i = 0;i < count;i++)
                {
                        paintbuffer[i].left += (*sfx++ * leftvol) >> 8;
@@ -364,13 +364,12 @@ qboolean SND_PaintChannelFrom8 (channel_t *ch, int count)
        }
        else
        {
-               sfx = sb->data + ch->pos - sb->offset;
+               sfx = (signed char *)sb->data + ch->pos - sb->offset;
                for (i = 0;i < count;i++)
                {
                        paintbuffer[i].left += (*sfx * leftvol) >> 8;
                        paintbuffer[i].right += (*sfx++ * rightvol) >> 8;
                }
-
        }
        ch->pos += count;
        return true;