mirror of
https://github.com/halpz/re3.git
synced 2025-07-25 16:52:44 +00:00
Linux build support
This commit is contained in:
@ -23,6 +23,12 @@
|
||||
*/
|
||||
|
||||
#include "aldlist.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#define _stricmp strcasecmp
|
||||
#define _strnicmp strncasecmp
|
||||
#endif
|
||||
|
||||
#ifdef AUDIO_OAL
|
||||
/*
|
||||
* Init call
|
||||
@ -67,7 +73,7 @@ ALDeviceList::ALDeviceList()
|
||||
if ((bNewName) && (actualDeviceName != NULL) && (strlen(actualDeviceName) > 0)) {
|
||||
memset(&ALDeviceInfo, 0, sizeof(ALDEVICEINFO));
|
||||
ALDeviceInfo.bSelected = true;
|
||||
ALDeviceInfo.strDeviceName = std::string(actualDeviceName, strlen(actualDeviceName));
|
||||
ALDeviceInfo.strDeviceName.assign(actualDeviceName, strlen(actualDeviceName));
|
||||
alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(int), &ALDeviceInfo.iMajorVersion);
|
||||
alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(int), &ALDeviceInfo.iMinorVersion);
|
||||
|
||||
@ -326,4 +332,4 @@ unsigned int ALDeviceList::GetMaxNumSources()
|
||||
|
||||
return iSourceCount;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -4,6 +4,10 @@
|
||||
#include "common.h"
|
||||
#include "sampman.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <float.h>
|
||||
#endif
|
||||
|
||||
extern bool IsFXSupported();
|
||||
|
||||
CChannel::CChannel()
|
||||
@ -207,4 +211,4 @@ void CChannel::UpdateReverb(ALuint slot)
|
||||
alSource3i(alSource, AL_AUXILIARY_SEND_FILTER, slot, 0, alFilter);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -4,13 +4,15 @@
|
||||
#include "common.h"
|
||||
#include "sampman.h"
|
||||
|
||||
typedef long ssize_t;
|
||||
|
||||
#include <sndfile.h>
|
||||
#include <mpg123.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef long ssize_t;
|
||||
#pragma comment( lib, "libsndfile-1.lib" )
|
||||
#pragma comment( lib, "libmpg123.lib" )
|
||||
#else
|
||||
#include "crossplatform.h"
|
||||
#endif
|
||||
|
||||
class CSndFile : public IDecoder
|
||||
{
|
||||
@ -192,7 +194,22 @@ CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUF
|
||||
m_nPosBeforeReset(0)
|
||||
|
||||
{
|
||||
strcpy(m_aFilename, filename);
|
||||
// Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/)
|
||||
#if !defined(_WIN32)
|
||||
FILE *test = fopen(filename, "r");
|
||||
if (!test) {
|
||||
char *r = (char*)alloca(strlen(filename) + 2);
|
||||
if (casepath(filename, r))
|
||||
{
|
||||
strcpy(m_aFilename, r);
|
||||
}
|
||||
} else {
|
||||
fclose(test);
|
||||
#else
|
||||
{
|
||||
#endif
|
||||
strcpy(m_aFilename, filename);
|
||||
}
|
||||
|
||||
DEV("Stream %s\n", m_aFilename);
|
||||
|
||||
@ -517,4 +534,4 @@ void CStream::ProviderTerm()
|
||||
ClearBuffers();
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user