Skip to content

Commit 3e42242

Browse files
committed
Fix start.c for pygame bootstrap and reduce specific code for pygame bootstrap
1 parent a06421f commit 3e42242

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

pythonforandroid/bootstraps/common/build/jni/application/src/start.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
#include "bootstrap_name.h"
1818
#ifndef BOOTSTRAP_USES_NO_SDL_HEADERS
1919
#include "SDL.h"
20+
#ifndef BOOTSTRAP_NAME_PYGAME
2021
#include "SDL_opengles2.h"
2122
#endif
23+
#endif
2224
#ifdef BOOTSTRAP_NAME_PYGAME
2325
#include "jniwrapperstuff.h"
2426
#endif
@@ -335,10 +337,8 @@ JNIEXPORT void JNICALL Java_org_kivy_android_PythonService_nativeStart(
335337
jobject thiz,
336338
jstring j_android_private,
337339
jstring j_android_argument,
338-
#if (!defined(BOOTSTRAP_NAME_PYGAME))
339340
jstring j_service_entrypoint,
340341
jstring j_python_name,
341-
#endif
342342
jstring j_python_home,
343343
jstring j_python_path,
344344
jstring j_arg) {
@@ -347,14 +347,10 @@ JNIEXPORT void JNICALL Java_org_kivy_android_PythonService_nativeStart(
347347
(*env)->GetStringUTFChars(env, j_android_private, &iscopy);
348348
const char *android_argument =
349349
(*env)->GetStringUTFChars(env, j_android_argument, &iscopy);
350-
#if (!defined(BOOTSTRAP_NAME_PYGAME))
351350
const char *service_entrypoint =
352351
(*env)->GetStringUTFChars(env, j_service_entrypoint, &iscopy);
353352
const char *python_name =
354353
(*env)->GetStringUTFChars(env, j_python_name, &iscopy);
355-
#else
356-
const char python_name[] = "python2";
357-
#endif
358354
const char *python_home =
359355
(*env)->GetStringUTFChars(env, j_python_home, &iscopy);
360356
const char *python_path =
@@ -364,10 +360,7 @@ JNIEXPORT void JNICALL Java_org_kivy_android_PythonService_nativeStart(
364360
setenv("ANDROID_PRIVATE", android_private, 1);
365361
setenv("ANDROID_ARGUMENT", android_argument, 1);
366362
setenv("ANDROID_APP_PATH", android_argument, 1);
367-
368-
#if (!defined(BOOTSTRAP_NAME_PYGAME))
369363
setenv("ANDROID_ENTRYPOINT", service_entrypoint, 1);
370-
#endif
371364
setenv("PYTHONOPTIMIZE", "2", 1);
372365
setenv("PYTHON_NAME", python_name, 1);
373366
setenv("PYTHONHOME", python_home, 1);

pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/SDLSurfaceView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,8 @@ public void run() {
707707
nativeInitJavaCallbacks();
708708
nativeSetEnv("ANDROID_PRIVATE", mFilesDirectory);
709709
nativeSetEnv("ANDROID_UNPACK", mFilesDirectory);
710+
nativeSetEnv("ANDROID_ENTRYPOINT", mArgument + "/main.py");
711+
nativeSetEnv("PYTHON_NAME", "python");
710712
nativeSetEnv("ANDROID_ARGUMENT", mArgument);
711713
nativeSetEnv("ANDROID_APP_PATH", mArgument);
712714
nativeSetEnv("PYTHONOPTIMIZE", "2");

0 commit comments

Comments
 (0)