mirror of
https://github.com/geode-sdk/geode.git
synced 2024-12-02 12:17:10 -05:00
5af15fba7c
Don't use macros where not necessary! This deprecates the old macro by way of a weird alias namespace.
37 lines
968 B
C++
37 lines
968 B
C++
|
|
#include <Geode/DefaultInclude.hpp>
|
|
|
|
#ifdef GEODE_IS_WINDOWS
|
|
|
|
#include <Geode/loader/Mod.hpp>
|
|
#include <Geode/modify/Modify.hpp>
|
|
|
|
using namespace geode::prelude;
|
|
|
|
// for some reason RobTop uses MessageBoxW in his GLFW error handler.
|
|
// no one knows how this is possible (he passes char* to wchar_t*).
|
|
// so anyway, here's a fix for it
|
|
|
|
static void __cdecl fixedErrorHandler(int code, char const* description) {
|
|
log::error("GLFW Error {}: {}", code, description);
|
|
MessageBoxA(
|
|
nullptr,
|
|
fmt::format(
|
|
"GLFWError #{}: {}\nPlease contact the "
|
|
"Geode Development Team for more information.",
|
|
code,
|
|
description
|
|
)
|
|
.c_str(),
|
|
"OpenGL Error",
|
|
MB_ICONERROR
|
|
);
|
|
}
|
|
|
|
$execute {
|
|
(void)Mod::get()->patch(
|
|
reinterpret_cast<void*>(geode::base::getCocos() + 0x19feec), toByteArray(&fixedErrorHandler)
|
|
);
|
|
}
|
|
|
|
#endif
|