File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < Geode/Geode.hpp>
2
+
3
+ // TODO: this affects every platform :P, but i cant be bothered rn
4
+ #ifdef GEODE_IS_WINDOWS
5
+
6
+ #include < loader/LoaderImpl.hpp>
7
+
8
+ using namespace geode ::prelude;
9
+
10
+ $execute {
11
+ if (LoaderImpl::get ()->isForwardCompatMode ()) return ;
12
+
13
+ #if GEODE_COMP_GD_VERSION == 22074
14
+ // patch an abort() call to "return false;" in CCGLProgram::compileShader
15
+ // for some reason cocos only properly returns false on winRT, everywhere
16
+ // else it just closes the whole game
17
+
18
+ auto addr = reinterpret_cast <uintptr_t >(
19
+ GetProcAddress (
20
+ GetModuleHandle (" libcocos2d.dll" ), " ?compileShader@CCGLProgram@cocos2d@@AEAA_NPEAIIPEBD@Z"
21
+ )
22
+ ) + 0xbb ;
23
+
24
+ (void ) Mod::get ()->patch (reinterpret_cast <void *>(addr), {
25
+ 0x31 , 0xc0 , // xor eax, eax
26
+ 0xeb , 0x07 // jmp +7 (to a nearby ret)
27
+ });
28
+ #else
29
+ #pragma message("Unsupported GD version!")
30
+ #endif
31
+ };
32
+
33
+ #endif
You can’t perform that action at this time.
0 commit comments