# HG changeset patch # User Ryan C. Gordon # Date 1000888314 0 # Node ID f6e679afe88bd294701c85dc2e7f12b404c9b752 # Parent d9b9d60cf9a91e47c816af0055c60b3b37836e28 Byte ordering fix, changed voc_read to voc_read_waveform, and cleaned up some header includes. diff -r d9b9d60cf9a9 -r f6e679afe88b decoders/voc.c --- a/decoders/voc.c Wed Sep 19 08:30:46 2001 +0000 +++ b/decoders/voc.c Wed Sep 19 08:31:54 2001 +0000 @@ -41,9 +41,6 @@ #include #include #include - -#include "SDL.h" -#include "SDL_endian.h" #include "SDL_sound.h" #define __SDL_SOUND_INTERNAL__ @@ -362,7 +359,7 @@ } -static int voc_read(Sound_Sample *sample) +static int voc_read_waveform(Sound_Sample *sample) { Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; SDL_RWops *src = internal->rw; @@ -398,20 +395,10 @@ done = SDL_RWread(src, buf + v->bufpos, 1, max); v->rest -= done; v->bufpos += done; - if (v->size == ST_SIZE_WORD) - { - #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - for (; v->rest > 0; v->rest -= 2) - { - *((Uint16 *) buf) = SDL_SwapLE16(*((Uint16 *) buf)); - ((Uint16 *) buf)++; - } - #endif - } } return done; -} /* voc_read */ +} /* voc_read_waveform */ static int VOC_open(Sound_Sample *sample, const char *ext) @@ -464,7 +451,7 @@ v->bufpos = 0; while (v->bufpos < internal->buffer_size) { - Uint32 rc = voc_read(sample); + Uint32 rc = voc_read_waveform(sample); if (rc == 0) /* !!! FIXME: Could be an error... */ { sample->flags |= SOUND_SAMPLEFLAG_EOF;