mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -04:00
Replace sprintf with asprintf for auto allocation
This commit is contained in:
parent
b1fc61648b
commit
06b9393ad0
@ -668,16 +668,15 @@ void pojavTerminate() {
|
|||||||
|
|
||||||
JNIEXPORT void JNICALL Java_net_kdt_pojavlaunch_utils_JREUtils_setupBridgeWindow(JNIEnv* env, jclass clazz, jobject surface) {
|
JNIEXPORT void JNICALL Java_net_kdt_pojavlaunch_utils_JREUtils_setupBridgeWindow(JNIEnv* env, jclass clazz, jobject surface) {
|
||||||
potatoBridge.androidWindow = ANativeWindow_fromSurface(env, surface);
|
potatoBridge.androidWindow = ANativeWindow_fromSurface(env, surface);
|
||||||
char *ptrStr = malloc(sizeof(long));
|
char *ptrStr = asprintf("%ld", (long) potatoBridge.androidWindow);
|
||||||
sprintf(ptrStr, "%ld", (long) potatoBridge.androidWindow);
|
|
||||||
setenv("POJAV_WINDOW_PTR", ptrStr, 1);
|
setenv("POJAV_WINDOW_PTR", ptrStr, 1);
|
||||||
|
free(ptrStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* pojavGetCurrentContext() {
|
void* pojavGetCurrentContext() {
|
||||||
switch (config_renderer) {
|
switch (config_renderer) {
|
||||||
case RENDERER_GL4ES:
|
case RENDERER_GL4ES:
|
||||||
return (void *)eglGetCurrentContext_p();
|
return (void *)eglGetCurrentContext_p();
|
||||||
|
|
||||||
case RENDERER_VIRGL:
|
case RENDERER_VIRGL:
|
||||||
case RENDERER_VK_ZINK:
|
case RENDERER_VK_ZINK:
|
||||||
return (void *)OSMesaGetCurrentContext_p();
|
return (void *)OSMesaGetCurrentContext_p();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user