Fixed small problems in sound loading.
authorFlorian Schulze <crow@icculus.org>
Fri, 19 Apr 2002 12:38:36 +0000 (12:38 +0000)
committerFlorian Schulze <crow@icculus.org>
Fri, 19 Apr 2002 12:38:36 +0000 (12:38 +0000)
sdl/sound.c

index 4461273..5515198 100644 (file)
@@ -411,7 +411,7 @@ void dj_stop_sfx_channel(char channel_num)
 
 char dj_load_sfx(FILE * file_handle, char *filename, int file_length, char sfx_type, unsigned char sfx_num)
 {
-       int i;
+       unsigned int i;
        unsigned char *src;
        unsigned short *dest;
        
@@ -422,12 +422,12 @@ char dj_load_sfx(FILE * file_handle, char *filename, int file_length, char sfx_t
        fread(sounds[sfx_num].buf, 1, file_length, file_handle);
        sounds[sfx_num].length = file_length / 2;
        src = sounds[sfx_num].buf;
-       dest = sounds[sfx_num].buf;
+       dest = (unsigned short *)sounds[sfx_num].buf;
        for (i=0; i<sounds[sfx_num].length; i++)
        {
                unsigned short temp;
                temp = src[0] + (src[1] << 8);
-               dest = temp;
+               *dest = temp;
                src += 2;
                dest++;
        }