diff --git a/android/native/jni/Android.mk b/android/native/jni/Android.mk index e0bad48fad..961d1438d3 100644 --- a/android/native/jni/Android.mk +++ b/android/native/jni/Android.mk @@ -1,8 +1,21 @@ RARCH_VERSION = "0.9.7" LOCAL_PATH := $(call my-dir) +PERF_TEST := 1 include $(CLEAR_VARS) +ifeq ($(TARGET_ARCH),arm) +LOCAL_CFLAGS += -DANDROID_ARM -marm +endif + +ifeq ($(TARGET_ARCH),x86) +LOCAL_CFLAGS += -DANDROID_X86 +endif + +ifeq ($(TARGET_ARCH),mips) +LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__ +endif + LOCAL_MODULE := retroarch-activity HAVE_OPENSL := 1 @@ -44,8 +57,12 @@ LOCAL_SRC_FILES = $(RARCH_PATH)/retroarch.c \ $(RARCH_PATH)/thread.c \ main.c +ifeq ($(PERF_TEST), 1) +LOCAL_SRC_FILES += $(RARCH_PATH)/benchmark.c +LOCAL_CFLAGS += -DPERF_TEST +endif -LOCAL_CFLAGS = -marm -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99 +LOCAL_CFLAGS += -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99 LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL -lGLESv2 -llog -ldl -lz diff --git a/android/native/jni/Application.mk b/android/native/jni/Application.mk index 22d188e595..30248dff01 100644 --- a/android/native/jni/Application.mk +++ b/android/native/jni/Application.mk @@ -1 +1,2 @@ APP_PLATFORM := android-9 +APP_ABI := armeabi armeabi-v7a diff --git a/gfx/context/androidegl_ctx.c b/gfx/context/androidegl_ctx.c index dfb3433a91..2cfef26f90 100644 --- a/gfx/context/androidegl_ctx.c +++ b/gfx/context/androidegl_ctx.c @@ -171,31 +171,33 @@ static void gfx_ctx_check_window(bool *quit, // If not animating, we will block forever waiting for events. // If animating, we loop until all events are read, then continue // to draw the next frame of animation. - while ((ident=ALooper_pollAll(g_android.animating ? 0 : -1, NULL, &events, - (void**)&source)) >= 0) + ident=ALooper_pollAll(g_android.animating ? 0 : -1, NULL, &events, + (void**)&source); + + // Process this event. + if (source != NULL) + source->process(state, source); + + // If a sensor has data, process it now. + /* + if (ident == LOOPER_ID_USER && g_android.accelerometerSensor != NULL) { - // Process this event. - if (source != NULL) - source->process(state, source); - - // If a sensor has data, process it now. - if (ident == LOOPER_ID_USER && g_android.accelerometerSensor != NULL) + ASensorEvent event; + while (ASensorEventQueue_getEvents(g_android.sensorEventQueue, &event, 1) > 0) { - ASensorEvent event; - while (ASensorEventQueue_getEvents(g_android.sensorEventQueue, &event, 1) > 0) - { - //RARCH_LOG("accelerometer: x=%f y=%f z=%f.\n", event.acceleration.x, event.acceleration.y, event.acceleration.z); - } + RARCH_LOG("accelerometer: x=%f y=%f z=%f.\n", event.acceleration.x, + event.acceleration.y, event.acceleration.z); } + } + */ - // Check if we are exiting. - if (state->destroyRequested != 0) - { - gl->quitting = true; - *quit = true; - gfx_ctx_destroy(); - return; - } + // Check if we are exiting. + if (state->destroyRequested != 0) + { + gl->quitting = true; + *quit = true; + gfx_ctx_destroy(); + return; } if (g_android.animating)