Skip to content

Commit

Permalink
- some fixes to make OpenAL branch compile with VC++ 2013 and OpenAL …
Browse files Browse the repository at this point in the history
…support.
  • Loading branch information
Christoph Oelckers committed Apr 24, 2015
1 parent 1f2a431 commit c91745c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion FindMPG123.cmake
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/sound/i_musicinterns.h
Expand Up @@ -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 ();
Expand Down
12 changes: 6 additions & 6 deletions src/sound/sndfile_decoder.cpp
Expand Up @@ -15,15 +15,15 @@ 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();
}

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)
Expand Down Expand Up @@ -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++)
Expand All @@ -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);

Expand All @@ -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

0 comments on commit c91745c

Please sign in to comment.