]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.h
added more validation of clipnodes loaded from a q1bsp file
[xonotic/darkplaces.git] / snd_main.h
index 4c674daa90706cb349191e6b1bacfab385070d41..ec097d22d795e7bb92db06f41fd77dce70616804 100644 (file)
@@ -28,7 +28,7 @@ typedef struct sfxbuffer_s
 {
        unsigned int    length;
        unsigned int    offset;
-       qbyte   data[4];        // variable sized
+       unsigned char   data[4];        // variable sized
 } sfxbuffer_t;
 
 typedef struct snd_format_s
@@ -67,19 +67,24 @@ struct sfx_s
 typedef struct dma_s
 {
        snd_format_t    format;
+       int                             sampleframes;   // frames in buffer (frame = samples for all speakers)
        int                             samples;                // mono samples in buffer
        int                             samplepos;              // in mono samples
        unsigned char   *buffer;
        int                             bufferlength;   // used only by certain drivers
 } dma_t;
 
+// maximum supported speakers constant
+#define SND_LISTENERS 8
+
 typedef struct channel_s
 {
+       int pad[8];
        sfx_t                   *sfx;                   // sfx number
+       int pad2[8];
        unsigned int    flags;                  // cf CHANNELFLAG_* defines
        int                             master_vol;             // 0-255 master volume
-       int                             leftvol;                // 0-255 volume
-       int                             rightvol;               // 0-255 volume
+       short                   listener_volume[SND_LISTENERS];         // 0-255 volume per speaker
        int                             end;                    // end time in global paintsamples
        int                             lastptime;              // last time this channel was painted
        int                             pos;                    // sample position in sfx
@@ -121,7 +126,7 @@ void S_UnlockSfx (sfx_t *sfx);
 void *S_LockBuffer(void);
 void S_UnlockBuffer(void);
 
-extern size_t ResampleSfx (const qbyte *in_data, size_t in_length, const snd_format_t* in_format, qbyte *out_data, const char* sfxname);
+extern size_t ResampleSfx (const unsigned char *in_data, size_t in_length, const snd_format_t* in_format, unsigned char *out_data, const char* sfxname);
 
 // ====================================================================