Skip to content

Commit

Permalink
1.13.0.15 support
Browse files Browse the repository at this point in the history
  • Loading branch information
MCMrARM committed Oct 30, 2019
1 parent 6e38c60 commit a9ca551
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/http_request_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
#include <mcpelauncher/patch_utils.h>
#include <hybris/dlfcn.h>
#include <log.h>
#include <mcpelauncher/minecraft_version.h>

void LinuxHttpRequestHelper::install(void* handle) {
if (MinecraftVersion::isAtLeast(1, 13, 0, 9))
return;

void* ptr = hybris_dlsym(handle, "_ZN26HTTPRequestInternalAndroidC2ER11HTTPRequest");
PatchUtils::patchCallInstruction(ptr, (void *) (void (*)(LinuxHttpRequestInternal*, HTTPRequest*)) [](
LinuxHttpRequestInternal* th, HTTPRequest* request) {
Expand Down
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ int main(int argc, char *argv[]) {
if (MinecraftVersion::isAtLeast(0, 16))
mce::Platform::OGL::InitBindings();

Log::info("Launcher", "OpenGL: version: %s, renderer: %s, vendor: %s",
gl::getOpenGLVersion().c_str(), gl::getOpenGLRenderer().c_str(), gl::getOpenGLVendor().c_str());
if (!MinecraftVersion::isAtLeast(1, 13, 0, 9))
Log::info("Launcher", "OpenGL: version: %s, renderer: %s, vendor: %s",
gl::getOpenGLVersion().c_str(), gl::getOpenGLRenderer().c_str(), gl::getOpenGLVendor().c_str());

Log::trace("Launcher", "Initializing MinecraftGame (create instance)");
std::unique_ptr<MinecraftGameWrapper> game (MinecraftGameWrapper::create(argc, argv));
Expand Down
1 change: 1 addition & 0 deletions src/store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ void LauncherStore::initVtable(void *lib) {
Log::trace("Store", "Vtable size = %u", myVtableSize);

myVtable = (void**) ::operator new((myVtableSize + 1) * sizeof(void*));
memcpy(myVtable, vta, myVtableSize * sizeof(void*));
myVtable[myVtableSize] = nullptr;
myVtable[0] = (void*) (void (*) (LauncherStore* p)) [](LauncherStore* p) { p->~LauncherStore(); };
myVtable[1] = (void*) (void (*) (LauncherStore* p)) [](LauncherStore* p) { delete p; };
Expand Down
3 changes: 1 addition & 2 deletions src/tts_patch.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include "tts_patch.h"

#include <mcpelauncher/patch_utils.h>
#include <hybris/dlfcn.h>
#include <mcpelauncher/minecraft_version.h>

void TTSPatch::install(void* handle) {
if (!MinecraftVersion::isAtLeast(1, 8))
return;
void* sym = hybris_dlsym(handle, "_ZN18TextToSpeechSystem15createTTSClientEb");
void* sym = minecraft_dlsym(handle, "_ZN18TextToSpeechSystem15createTTSClientEb");
PatchUtils::patchCallInstruction(sym, (void*) &TTSPatch::createTTSClient, true);
}

Expand Down

0 comments on commit a9ca551

Please sign in to comment.