diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-06-16 15:03:08 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-06-16 15:03:08 +0200 |
| commit | 8428fafd3ac1b5dd347227af3b6d7b58cb25b37a (patch) | |
| tree | f27a66cacf9b1737c8332e86341679169f04aea2 | |
| parent | 3074846477c7168884d291f58b56f1957a42e033 (diff) | |
| download | box64-8428fafd3ac1b5dd347227af3b6d7b58cb25b37a.tar.gz box64-8428fafd3ac1b5dd347227af3b6d7b58cb25b37a.zip | |
Added some hack to try detect SDL_sound custom build for SDL2 and use emulated one first (fixing some sound in To The Moon)
| -rwxr-xr-x | src/librarian/library.c | 3 | ||||
| -rwxr-xr-x | src/wrapped/wrappedsdl2image.c | 7 | ||||
| -rwxr-xr-x | src/wrapped/wrappedsdl2ttf.c | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/librarian/library.c b/src/librarian/library.c index 0e9f48cc..7ca96e0a 100755 --- a/src/librarian/library.c +++ b/src/librarian/library.c @@ -264,6 +264,9 @@ library_t *NewLibrary(const char* path, box64context_t* context) } } int notwrapped = FindInCollection(lib->name, &context->box64_emulated_libs); + // check if name is libSDL_sound-1.0.so.1 but with SDL2 loaded, then try emulated first... + if(!notwrapped && !strcmp(lib->name, "libSDL_sound-1.0.so.1") && my_context->sdl2lib) + notwrapped = 1; // And now, actually loading a library // look for native(wrapped) libs first if(!notwrapped) diff --git a/src/wrapped/wrappedsdl2image.c b/src/wrapped/wrappedsdl2image.c index 6c514abf..5b531167 100755 --- a/src/wrapped/wrappedsdl2image.c +++ b/src/wrapped/wrappedsdl2image.c @@ -153,8 +153,11 @@ const char* sdl2imageName = "libSDL2_image-2.0.so.0"; #define CUSTOM_INIT \ my_lib = lib; \ - lib->priv.w.p2 = getSDL2ImageMy(lib); \ - lib->altmy = strdup("my2_"); + lib->priv.w.p2 = getSDL2ImageMy(lib); \ + lib->altmy = strdup("my2_"); \ + lib->priv.w.needed = 1; \ + lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \ + lib->priv.w.neededlibs[0] = strdup("libSDL2-2.0.so.0"); #define CUSTOM_FINI \ free(lib->priv.w.p2); \ diff --git a/src/wrapped/wrappedsdl2ttf.c b/src/wrapped/wrappedsdl2ttf.c index 9e92b871..c0944858 100755 --- a/src/wrapped/wrappedsdl2ttf.c +++ b/src/wrapped/wrappedsdl2ttf.c @@ -61,7 +61,10 @@ const char* sdl2ttfName = "libSDL2_ttf-2.0.so.0"; #define CUSTOM_INIT \ my_lib = lib; \ lib->altmy = strdup("my2_"); \ - lib->priv.w.p2 = getSDL2TTFMy(lib); + lib->priv.w.p2 = getSDL2TTFMy(lib); \ + lib->priv.w.needed = 1; \ + lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \ + lib->priv.w.neededlibs[0] = strdup("libSDL2-2.0.so.0"); #define CUSTOM_FINI \ free(lib->priv.w.p2); \ |