- some fixes to make OpenAL branch compile with VC++ 2013 and OpenAL support.

This commit is contained in:
Christoph Oelckers 2015-04-24 17:42:56 +02:00
parent 1f2a431d15
commit c91745c714
3 changed files with 8 additions and 7 deletions

View file

@ -20,7 +20,7 @@ FIND_LIBRARY(MPG123_LIBRARIES NAMES mpg123 mpg123-0
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
# all listed variables are TRUE

View file

@ -23,6 +23,7 @@
#include "i_sound.h"
#include "i_music.h"
#include "s_sound.h"
#include "files.h"
void I_InitMusicWin32 ();
void I_ShutdownMusicWin32 ();

View file

@ -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;
if(reader->Seek(offset, whence) != 0)
if(reader->Seek((long)offset, whence) != 0)
return -1;
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)
{
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)
@ -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);
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;
for(size_t i = 0;i < got*SndInfo.channels;i++)
@ -111,7 +111,7 @@ TArray<char> SndFileDecoder::readAll()
int framesize = 2 * SndInfo.channels;
TArray<char> output;
output.Resize(SndInfo.frames * framesize);
output.Resize((unsigned)(SndInfo.frames * framesize));
size_t got = read(&output[0], output.Size());
output.Resize(got);
@ -128,12 +128,12 @@ bool SndFileDecoder::seek(size_t ms_offset)
size_t SndFileDecoder::getSampleOffset()
{
return sf_seek(SndFile, 0, SEEK_CUR);
return (size_t)sf_seek(SndFile, 0, SEEK_CUR);
}
size_t SndFileDecoder::getSampleLength()
{
return (SndInfo.frames > 0) ? SndInfo.frames : 0;
return (size_t)((SndInfo.frames > 0) ? SndInfo.frames : 0);
}
#endif