android fix
This commit is contained in:
parent
f7ae724c14
commit
7cac0321aa
13
src/sdl-instead/adroid.h
Normal file
13
src/sdl-instead/adroid.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include <jni.h>
|
||||
#ifndef SDL_JAVA_PACKAGE_PATH
|
||||
#error You have to define SDL_JAVA_PACKAGE_PATH to your package path with dots replaced with underscores, for example "com_example_SanAngeles"
|
||||
#endif
|
||||
#define JAVA_EXPORT_NAME2(name,package) Java_##package##_##name
|
||||
#define JAVA_EXPORT_NAME1(name,package) JAVA_EXPORT_NAME2(name,package)
|
||||
#define JAVA_EXPORT_NAME(name) JAVA_EXPORT_NAME1(name,SDL_JAVA_PACKAGE_PATH)
|
||||
|
||||
extern void JNICALL JAVA_EXPORT_NAME(MainActivity_nativeStop)(JNIEnv *env, jobject obj) {
|
||||
cfg_save();
|
||||
game_done(0);
|
||||
exit(0);
|
||||
}
|
|
@ -9,6 +9,10 @@
|
|||
#include <gtk/gtk.h>
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
#include "android.h"
|
||||
#endif
|
||||
|
||||
extern int debug_init(void);
|
||||
extern void debug_done(void);
|
||||
|
||||
|
@ -283,7 +287,9 @@ int main(int argc, char *argv[])
|
|||
game_loop();
|
||||
cfg_save();
|
||||
game_done(0);
|
||||
#ifndef ANDROID
|
||||
gfx_done();
|
||||
#endif
|
||||
out:
|
||||
if (debug_sw)
|
||||
debug_done();
|
||||
|
|
Reference in a new issue