From c91745c71451150634ecd64a890ecb7635a5a56f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 24 Apr 2015 17:42:56 +0200 Subject: [PATCH] - some fixes to make OpenAL branch compile with VC++ 2013 and OpenAL support. --- FindMPG123.cmake | 2 +- src/sound/i_musicinterns.h | 1 + src/sound/sndfile_decoder.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/FindMPG123.cmake b/FindMPG123.cmake index 9b871d439ee..a9b6dd8b220 100644 --- a/FindMPG123.cmake +++ b/FindMPG123.cmake @@ -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 diff --git a/src/sound/i_musicinterns.h b/src/sound/i_musicinterns.h index 2f30b95ab00..62561aa95df 100644 --- a/src/sound/i_musicinterns.h +++ b/src/sound/i_musicinterns.h @@ -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 (); diff --git a/src/sound/sndfile_decoder.cpp b/src/sound/sndfile_decoder.cpp index 4f86515b1a1..1eba863d483 100644 --- a/src/sound/sndfile_decoder.cpp +++ b/src/sound/sndfile_decoder.cpp @@ -15,7 +15,7 @@ sf_count_t SndFileDecoder::file_seek(sf_count_t offset, int whence, void *user_d { FileReader *reader = reinterpret_cast(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(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(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 SndFileDecoder::readAll() int framesize = 2 * SndInfo.channels; TArray 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