From b2f47c926e5c261b4e3aaa0123799869ec6f93f7 Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Sat, 21 Aug 2021 19:51:56 +0200 Subject: [PATCH] fixes after merge, update librw --- Makefile | 2 +- src/audio/oal/stream.cpp | 19 ++++++++++++++++++- src/audio/sampman_oal.cpp | 10 +++------- src/skel/wiiu/wiiu.cpp | 10 ++++++---- vendor/librw | 2 +- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 09f95ac3..5c22798c 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ SOURCES := src \ src/modelinfo \ src/objects \ src/peds \ - src/render \ + src/renderer \ src/rw \ src/save \ src/skel \ diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 01cddf17..523b87b1 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -2,6 +2,8 @@ #ifdef AUDIO_OAL +#include + #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); diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 73703276..922da91a 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -18,6 +18,8 @@ #include #include #include +#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); diff --git a/src/skel/wiiu/wiiu.cpp b/src/skel/wiiu/wiiu.cpp index ca52741e..7beb90f3 100644 --- a/src/skel/wiiu/wiiu.cpp +++ b/src/skel/wiiu/wiiu.cpp @@ -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 } diff --git a/vendor/librw b/vendor/librw index 2e731f8d..4d094c41 160000 --- a/vendor/librw +++ b/vendor/librw @@ -1 +1 @@ -Subproject commit 2e731f8d94013662ed62b4689e5873cc1189ac1d +Subproject commit 4d094c41d2f19dae2a6efc082a77256d01584414