diff --git a/src/fake_egl.cpp b/src/fake_egl.cpp index 2dc4cc18..4f58a171 100644 --- a/src/fake_egl.cpp +++ b/src/fake_egl.cpp @@ -154,12 +154,19 @@ void FakeEGL::installLibrary() { syms["eglSwapInterval"] = (void *) fake_egl::eglSwapInterval; syms["eglQuerySurface"] = (void *) fake_egl::eglQuerySurface; syms["eglGetProcAddress"] = (void *) fake_egl::eglGetProcAddress; + linker::load_library("libEGL.so", syms); +} +void FakeEGL::setupGLOverrides() { +#ifdef USE_ARMHF_SUPPORT + ArmhfSupport::install(fake_egl::hostProcOverrides); +#endif + fake_egl::hostProcOverrides["glInvalidateFramebuffer"] = (void *) +[]() {}; // Stub for a NVIDIA bug if (FakeEGL::enableTexturePatch) { // Minecraft Intel/Amd Texture Bug 1.16.210-1.17.2 and beyond // This patch reduces the visual glitch of blocks, does not work with high resolution textures // TODO improve Bugdetection - syms["glTexSubImage2D"] = (void *) +[](unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void * data) { + fake_egl::hostProcOverrides["glTexSubImage2D"] = (void *) +[](unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void * data) { if (width == 1024 && height == 1024) { size_t z = 0; for (long long y = 0; y < height; ++y) { @@ -243,14 +250,5 @@ void FakeEGL::installLibrary() { ((void(*)(unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void * data))(fake_egl::hostProcAddrFn("glTexSubImage2D"))) (target, level, xoffset, yoffset, width, height, format, type, data); }; } - linker::load_library("libEGL.so", syms); -} - -void FakeEGL::setupGLOverrides() { -#ifdef USE_ARMHF_SUPPORT - ArmhfSupport::install(fake_egl::hostProcOverrides); -#endif - fake_egl::hostProcOverrides["glInvalidateFramebuffer"] = (void *) +[]() {}; // Stub for a NVIDIA bug - GLCorePatch::installGL(fake_egl::hostProcOverrides, fake_egl::eglGetProcAddress); } \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 2e73359d..e2da40d6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) { argparser::arg forceEgl (p, "--force-opengles", "-fes", "Force creating an OpenGL ES surface instead of using the glcorepatch hack", !GLCorePatch::mustUseDesktopGL()); argparser::arg forceGooglePlayStoreUnverified(p, "--force-google-play-store-unverified", "-fguv", "Force telling the game that the license isn't verified, Google Play Store version", false); argparser::arg forceAmazonAppStoreUnverified(p, "--force-amazon-app-store-unverified", "-fauv", "Force telling the game that the license isn't verified, Amazon App Store version", false); - argparser::arg texturePatch(p, "--texturepatch", "-tp", "Rewrite textures of the game for Minecraft 1.16.210-1.17.2", + argparser::arg texturePatch(p, "--texture-patch", "-tp", "Rewrite textures of the game for Minecraft 1.16.210-1.17.2", #if defined(__i386__) || defined(__x86_64__) true #else