fixes after merge, update librw

This commit is contained in:
GaryOderNichts 2021-08-21 19:51:56 +02:00
parent fc5bc0cb18
commit b2f47c926e
5 changed files with 29 additions and 14 deletions

View File

@ -38,7 +38,7 @@ SOURCES := src \
src/modelinfo \
src/objects \
src/peds \
src/render \
src/renderer \
src/rw \
src/save \
src/skel \

View File

@ -2,6 +2,8 @@
#ifdef AUDIO_OAL
#include <malloc.h>
#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
#ifdef AUDIO_OAL_USE_SNDFILE
#pragma comment( lib, "libsndfile-1.lib" )
@ -679,6 +681,21 @@ public:
#endif
#ifdef AUDIO_OAL_USE_MPG123
static ssize_t mpg123_read_replacement(void* handle, void* data, size_t size)
{
return fread(data, 1, size, (FILE*)handle);
}
static off_t mpg123_seek_replacement(void* handle, off_t offset, int whence)
{
fseek((FILE*)handle, offset, whence);
return ftell((FILE*)handle);
}
static void mpg123_close_replacement(void* handle)
{
fclose((FILE*)handle);
}
class CMP3File : public IDecoder
{
@ -1383,7 +1400,7 @@ bool CStream::Open(const char* filename, uint32 overrideSampleRate)
// Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/)
#if !defined(_WIN32)
char *real = casepath(filename);
char *real = casepath(filename, false);
if (real) {
strcpy(m_aFilename, real);
free(real);

View File

@ -18,6 +18,8 @@
#include <direct.h>
#include <shlobj.h>
#include <shlguid.h>
#elif defined(__WIIU__)
extern "C" char *_getcwd (char *__buf, size_t __size);
#else
#define _getcwd getcwd
#endif
@ -53,12 +55,6 @@
//TODO: fix eax3 reverb
#ifdef __WIIU__
extern "C" char *_getcwd (char *__buf, size_t __size);
#else
#define _getcwd getcwd
#endif
cSampleManager SampleManager;
bool8 _bSampmanInitialised = FALSE;
@ -481,7 +477,7 @@ _FindMP3s(void)
strcat(path, "\\MP3\\");
#if !defined(_WIN32)
char *actualPath = casepath(path);
char *actualPath = casepath(path, false);
if (actualPath) {
strcpy(path, actualPath);
free(actualPath);

View File

@ -951,10 +951,12 @@ main(int argc, char *argv[])
#ifdef LOAD_INI_SETTINGS
LoadINIControllerSettings();
if (connectedPadButtons != 0) {
ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons);
SaveINIControllerSettings();
}
if (connectedPadButtons != 0)
ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons); // add (connected-saved) amount of new button assignments on top of ours
// these have 2 purposes: creating .ini at the start, and adding newly introduced settings to old .ini at the start
SaveINISettings();
SaveINIControllerSettings();
#endif
}

2
vendor/librw vendored

@ -1 +1 @@
Subproject commit 2e731f8d94013662ed62b4689e5873cc1189ac1d
Subproject commit 4d094c41d2f19dae2a6efc082a77256d01584414