engine: soundlib: pass XASH_BIG_ENDIAN to ov_read in vorbis loader

This commit is contained in:
Alibek Omarov
2026-04-25 00:29:19 +05:00
committed by a1batross
parent 22ecec095e
commit 800725453a
4 changed files with 5 additions and 5 deletions

View File

@@ -243,7 +243,7 @@ typedef int qboolean;
#define Swap32Store( x ) ( x = Swap32( x ))
#define Swap16Store( x ) ( x = Swap16( x ))
#ifdef XASH_BIG_ENDIAN
#if XASH_BIG_ENDIAN
#define LittleLong( x ) Swap32( x )
#define LittleShort( x ) Swap16( x )
#define LittleLongSW( x ) Swap32Store( x )

View File

@@ -157,7 +157,7 @@ qboolean Sound_LoadOggVorbis( const char *name, const byte *buffer, fs_offset_t
SetBits( sound.flags, SOUND_RESAMPLE );
Sound_ScanVorbisComments( &vorbisFile );
while(( ret = ov_read( &vorbisFile, (char *)sound.wav + written, sound.size - written, 0, sound.width, 1, &section )) != 0 )
while(( ret = ov_read( &vorbisFile, (char *)sound.wav + written, sound.size - written, XASH_BIG_ENDIAN, sound.width, 1, &section )) != 0 )
{
if( ret < 0 )
{
@@ -232,7 +232,7 @@ int Stream_ReadOggVorbis( stream_t *stream, int needBytes, void *buffer )
if( !stream->buffsize )
{
stream->pos = ov_read( &ctx->vf, (char *)stream->temp, OUTBUF_SIZE, 0, stream->width, 1, &section );
stream->pos = ov_read( &ctx->vf, (char *)stream->temp, OUTBUF_SIZE, XASH_BIG_ENDIAN, stream->width, 1, &section );
if( stream->pos == 0 )
{
break; // end of file

View File

@@ -111,7 +111,7 @@ static inline void swap_array_( byte *data, int32_t elem_size, uint32_t count )
// this is done in macros so we can completely avoid defining this
// in little endian targets
#ifdef XASH_LITTLE_ENDIAN
#if XASH_LITTLE_ENDIAN
#define be_struct_begin( x ) swap_struct_begin( x )
#define be_struct_field( x, y ) swap_struct_field( x, y )
#define be_struct_child( x, y, z ) swap_struct_child( x, y, z )