mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: soundlib: pass XASH_BIG_ENDIAN to ov_read in vorbis loader
This commit is contained in:
2
3rdparty/library_suffix
vendored
2
3rdparty/library_suffix
vendored
Submodule 3rdparty/library_suffix updated: 6e14ae31e8...2cb2a0e120
@@ -243,7 +243,7 @@ typedef int qboolean;
|
|||||||
#define Swap32Store( x ) ( x = Swap32( x ))
|
#define Swap32Store( x ) ( x = Swap32( x ))
|
||||||
#define Swap16Store( x ) ( x = Swap16( x ))
|
#define Swap16Store( x ) ( x = Swap16( x ))
|
||||||
|
|
||||||
#ifdef XASH_BIG_ENDIAN
|
#if XASH_BIG_ENDIAN
|
||||||
#define LittleLong( x ) Swap32( x )
|
#define LittleLong( x ) Swap32( x )
|
||||||
#define LittleShort( x ) Swap16( x )
|
#define LittleShort( x ) Swap16( x )
|
||||||
#define LittleLongSW( x ) Swap32Store( x )
|
#define LittleLongSW( x ) Swap32Store( x )
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ qboolean Sound_LoadOggVorbis( const char *name, const byte *buffer, fs_offset_t
|
|||||||
SetBits( sound.flags, SOUND_RESAMPLE );
|
SetBits( sound.flags, SOUND_RESAMPLE );
|
||||||
Sound_ScanVorbisComments( &vorbisFile );
|
Sound_ScanVorbisComments( &vorbisFile );
|
||||||
|
|
||||||
while(( ret = ov_read( &vorbisFile, (char *)sound.wav + written, sound.size - written, 0, sound.width, 1, §ion )) != 0 )
|
while(( ret = ov_read( &vorbisFile, (char *)sound.wav + written, sound.size - written, XASH_BIG_ENDIAN, sound.width, 1, §ion )) != 0 )
|
||||||
{
|
{
|
||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
{
|
{
|
||||||
@@ -232,7 +232,7 @@ int Stream_ReadOggVorbis( stream_t *stream, int needBytes, void *buffer )
|
|||||||
|
|
||||||
if( !stream->buffsize )
|
if( !stream->buffsize )
|
||||||
{
|
{
|
||||||
stream->pos = ov_read( &ctx->vf, (char *)stream->temp, OUTBUF_SIZE, 0, stream->width, 1, §ion );
|
stream->pos = ov_read( &ctx->vf, (char *)stream->temp, OUTBUF_SIZE, XASH_BIG_ENDIAN, stream->width, 1, §ion );
|
||||||
if( stream->pos == 0 )
|
if( stream->pos == 0 )
|
||||||
{
|
{
|
||||||
break; // end of file
|
break; // end of 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
|
// this is done in macros so we can completely avoid defining this
|
||||||
// in little endian targets
|
// in little endian targets
|
||||||
#ifdef XASH_LITTLE_ENDIAN
|
#if XASH_LITTLE_ENDIAN
|
||||||
#define be_struct_begin( x ) swap_struct_begin( x )
|
#define be_struct_begin( x ) swap_struct_begin( x )
|
||||||
#define be_struct_field( x, y ) swap_struct_field( x, y )
|
#define be_struct_field( x, y ) swap_struct_field( x, y )
|
||||||
#define be_struct_child( x, y, z ) swap_struct_child( x, y, z )
|
#define be_struct_child( x, y, z ) swap_struct_child( x, y, z )
|
||||||
|
|||||||
Reference in New Issue
Block a user