Skip to content

Commit

Permalink
🚑️ Fix raw mode impl
Browse files Browse the repository at this point in the history
  • Loading branch information
yhs0602 committed Jan 6, 2025
1 parent 772a699 commit ad77347
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "craftground"
version = "2.5.34"
version = "2.5.35"
description = "Lightweight Minecraft Environment for Reinforcement Learning"
readme = "README.md"
license = { file = "LICENSE" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_initializeZerocopyImpl(
return byteStringObject;
}

extern "C" JNIEXPORT void JNICALL
extern "C" JNIEXPORT jobject JNICALL
Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_captureFramebufferZerocopyImpl(
JNIEnv *env,
jclass clazz,
Expand Down Expand Up @@ -452,6 +452,7 @@ Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_captureFramebufferZerocop
// but the original texture is TEXTURE_2D, so we need to convert to
// TEXTURE_2D_RECTANGLE_ARB
copyFramebufferToIOSurface(targetSizeX, targetSizeY);
return nullptr;
}

#elif defined(HAS_CUDA)
Expand Down Expand Up @@ -522,7 +523,7 @@ Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_initializeZerocopyImpl(
return byteStringObject;
}

extern "C" JNIEXPORT void JNICALL
extern "C" JNIEXPORT jobject JNICALL
Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_captureFramebufferZerocopyImpl(
JNIEnv *env,
jclass clazz,
Expand Down Expand Up @@ -554,6 +555,7 @@ Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_captureFramebufferZerocop
// CUDA IPC handles are used to share the framebuffer with the Python side
// However copy is required anyway
copyFramebufferToCudaSharedMemory(targetSizeX, targetSizeY);
return nullptr;
}

#else
Expand Down Expand Up @@ -587,7 +589,7 @@ Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_initializeZerocopyImpl(

// TODO: Implement this function for normal mmap IPC based one copy. (GPU ->
// CPU)
extern "C" JNIEXPORT void JNICALL
extern "C" JNIEXPORT jobject JNICALL
Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_captureFramebufferZerocopyImpl(
JNIEnv *env,
jclass clazz,
Expand All @@ -598,7 +600,7 @@ Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_captureFramebufferZerocop
jint mouseX,
jint mouseY
) {
Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_captureFramebuffer(
return Java_com_kyhsgeekcode_minecraftenv_FramebufferCapturer_captureFramebufferImpl(
env,
clazz,
0,
Expand Down

0 comments on commit ad77347

Please sign in to comment.