mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-23 20:42:24 +00:00
- some fixes to make OpenAL branch compile with VC++ 2013 and OpenAL support.
This commit is contained in:
parent
1f2a431d15
commit
c91745c714
3 changed files with 8 additions and 7 deletions
|
@ -20,7 +20,7 @@ FIND_LIBRARY(MPG123_LIBRARIES NAMES mpg123 mpg123-0
|
||||||
PATH_SUFFIXES lib
|
PATH_SUFFIXES lib
|
||||||
)
|
)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(MPG123_LIBRARIES MPG123_INCLUDE_DIR)
|
# MARK_AS_ADVANCED(MPG123_LIBRARIES MPG123_INCLUDE_DIR)
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set MPG123_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set MPG123_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "i_sound.h"
|
#include "i_sound.h"
|
||||||
#include "i_music.h"
|
#include "i_music.h"
|
||||||
#include "s_sound.h"
|
#include "s_sound.h"
|
||||||
|
#include "files.h"
|
||||||
|
|
||||||
void I_InitMusicWin32 ();
|
void I_InitMusicWin32 ();
|
||||||
void I_ShutdownMusicWin32 ();
|
void I_ShutdownMusicWin32 ();
|
||||||
|
|
|
@ -15,7 +15,7 @@ sf_count_t SndFileDecoder::file_seek(sf_count_t offset, int whence, void *user_d
|
||||||
{
|
{
|
||||||
FileReader *reader = reinterpret_cast<SndFileDecoder*>(user_data)->Reader;
|
FileReader *reader = reinterpret_cast<SndFileDecoder*>(user_data)->Reader;
|
||||||
|
|
||||||
if(reader->Seek(offset, whence) != 0)
|
if(reader->Seek((long)offset, whence) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
return reader->Tell();
|
return reader->Tell();
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ sf_count_t SndFileDecoder::file_seek(sf_count_t offset, int whence, void *user_d
|
||||||
sf_count_t SndFileDecoder::file_read(void *ptr, sf_count_t count, void *user_data)
|
sf_count_t SndFileDecoder::file_read(void *ptr, sf_count_t count, void *user_data)
|
||||||
{
|
{
|
||||||
FileReader *reader = reinterpret_cast<SndFileDecoder*>(user_data)->Reader;
|
FileReader *reader = reinterpret_cast<SndFileDecoder*>(user_data)->Reader;
|
||||||
return reader->Read(ptr, count);
|
return reader->Read(ptr, (long)count);
|
||||||
}
|
}
|
||||||
|
|
||||||
sf_count_t SndFileDecoder::file_write(const void *ptr, sf_count_t count, void *user_data)
|
sf_count_t SndFileDecoder::file_write(const void *ptr, sf_count_t count, void *user_data)
|
||||||
|
@ -93,7 +93,7 @@ size_t SndFileDecoder::read(char *buffer, size_t bytes)
|
||||||
size_t todo = std::min<size_t>(frames-total, 64/SndInfo.channels);
|
size_t todo = std::min<size_t>(frames-total, 64/SndInfo.channels);
|
||||||
float tmp[64];
|
float tmp[64];
|
||||||
|
|
||||||
size_t got = sf_readf_float(SndFile, tmp, todo);
|
size_t got = (size_t)sf_readf_float(SndFile, tmp, todo);
|
||||||
if(got < todo) frames = total + got;
|
if(got < todo) frames = total + got;
|
||||||
|
|
||||||
for(size_t i = 0;i < got*SndInfo.channels;i++)
|
for(size_t i = 0;i < got*SndInfo.channels;i++)
|
||||||
|
@ -111,7 +111,7 @@ TArray<char> SndFileDecoder::readAll()
|
||||||
int framesize = 2 * SndInfo.channels;
|
int framesize = 2 * SndInfo.channels;
|
||||||
TArray<char> output;
|
TArray<char> output;
|
||||||
|
|
||||||
output.Resize(SndInfo.frames * framesize);
|
output.Resize((unsigned)(SndInfo.frames * framesize));
|
||||||
size_t got = read(&output[0], output.Size());
|
size_t got = read(&output[0], output.Size());
|
||||||
output.Resize(got);
|
output.Resize(got);
|
||||||
|
|
||||||
|
@ -128,12 +128,12 @@ bool SndFileDecoder::seek(size_t ms_offset)
|
||||||
|
|
||||||
size_t SndFileDecoder::getSampleOffset()
|
size_t SndFileDecoder::getSampleOffset()
|
||||||
{
|
{
|
||||||
return sf_seek(SndFile, 0, SEEK_CUR);
|
return (size_t)sf_seek(SndFile, 0, SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t SndFileDecoder::getSampleLength()
|
size_t SndFileDecoder::getSampleLength()
|
||||||
{
|
{
|
||||||
return (SndInfo.frames > 0) ? SndInfo.frames : 0;
|
return (size_t)((SndInfo.frames > 0) ? SndInfo.frames : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue