Merge pull request #107 from notaz/android

Android fixes
This commit is contained in:
Squarepusher 2012-12-25 21:49:34 -08:00
commit 17bd018cde
6 changed files with 12 additions and 23 deletions

View File

@ -58,7 +58,7 @@ ifeq ($(DEBUG_INPUT), 1)
LOCAL_CFLAGS += -DRARCH_INPUT_DEBUG
endif
LOCAL_CFLAGS += -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_ZLIB -DWANT_RZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREAD -D__LIBRETRO__ -DRARCH_PERFORMANCE_MODE -DRARCH_GPU_PERFORMANCE_MODE -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99
LOCAL_CFLAGS += -Wall -Wno-unused-function -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_ZLIB -DWANT_RZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREAD -D__LIBRETRO__ -DRARCH_PERFORMANCE_MODE -DRARCH_GPU_PERFORMANCE_MODE -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL -lGLESv2 $(LOGGER_LDLIBS) -ldl
#LOCAL_C_INCLUDES += $(LIBXML_PATH)

View File

@ -129,7 +129,7 @@ extract_cpuinfo_field(char* buffer, int buflen, const char* field)
int fieldlen = strlen(field);
char* bufend = buffer + buflen;
char* result = NULL;
int len, ignore;
int len;
const char *p, *q;
/* Look for first field occurence, and ensures it starts the line.
@ -400,9 +400,6 @@ android_cpuInit(void)
#ifdef __ARM_ARCH__
{
char* features = NULL;
char* architecture = NULL;
/* Extract architecture from the "CPU Architecture" field.
* The list is well-known, unlike the the output of
* the 'Processor' field which can vary greatly.

View File

@ -338,7 +338,6 @@ static void android_input_poll(void *data)
if(type_event == AINPUT_EVENT_TYPE_MOTION)
{
action = AMotionEvent_getAction(event);
int8_t motion_action = action & AMOTION_EVENT_ACTION_MASK;
size_t motion_pointer = action >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
float x = AMotionEvent_getX(event, motion_pointer);

View File

@ -4,6 +4,7 @@ PERF_TEST := 1
HAVE_OPENSL := 1
HAVE_NEON := 1
HAVE_SINC := 1
HAVE_LOGGER := 1
include $(CLEAR_VARS)
@ -44,12 +45,16 @@ RARCH_PATH := ../../..
LIBXML_PATH := ../../../deps/libxml2
LOCAL_SRC_FILES += $(RARCH_PATH)/console/griffin/griffin.c
ifeq ($(HAVE_LOGGER), 1)
LOCAL_CFLAGS += -DHAVE_LOGGER
LOGGER_LDLIBS := -llog
endif
ifeq ($(PERF_TEST), 1)
LOCAL_CFLAGS += -DPERF_TEST
endif
LOCAL_CFLAGS += -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_ZLIB -DWANT_RZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREAD -D__LIBRETRO__ -DRARCH_PERFORMANCE_MODE -DRARCH_GPU_PERFORMANCE_MODE -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99
LOCAL_CFLAGS += -Wall -Wno-unused-function -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_ZLIB -DWANT_RZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREAD -D__LIBRETRO__ -DRARCH_PERFORMANCE_MODE -DRARCH_GPU_PERFORMANCE_MODE -DHAVE_OVERLAY -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL -lGLESv2 -llog -ldl
LOCAL_C_INCLUDES += $(LIBXML_PATH)

View File

@ -19,7 +19,6 @@
#include "../gl_common.h"
#include <EGL/egl.h> /* Requires NDK r5 or newer */
#include <GLES/gl.h>
#include "../../android/native/jni/android_general.h"
#include "../image.h"
@ -85,9 +84,11 @@ static void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
}
}
static bool gfx_ctx_orientation_update(void)
static void gfx_ctx_orientation_update(void)
{
gl_t *gl = (gl_t*)driver.video_data;
if (!gl)
return;
// Get real known video size, which might have been altered by context.
gfx_ctx_get_video_size(&gl->win_width, &gl->win_height);
@ -123,9 +124,6 @@ static bool gfx_ctx_init(void)
EGLint num_config;
EGLint egl_version_major, egl_version_minor;
EGLint format;
EGLint width;
EGLint height;
GLfloat ratio;
EGLint context_attributes[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
@ -182,13 +180,6 @@ static bool gfx_ctx_init(void)
goto error;
}
if (!eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_WIDTH, &width) ||
!eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_HEIGHT, &height))
{
RARCH_ERR("eglQuerySurface failed.\n");
goto error;
}
if (g_extern.lifecycle_state & (1ULL << RARCH_REENTRANT))
{
RARCH_LOG("[ANDROID/EGL]: Setting up reentrant state.\n");
@ -329,9 +320,9 @@ static void gfx_ctx_set_filtering(unsigned index, bool set_smooth)
static void gfx_ctx_set_fbo(unsigned mode)
{
#ifdef HAVE_FBO
gl_t *gl = driver.video_data;
#ifdef HAVE_FBO
switch(mode)
{
case FBO_DEINIT:

View File

@ -1279,8 +1279,6 @@ static void gl_free(void *data)
static void gl_set_nonblock_state(void *data, bool state)
{
gl_t *gl = (gl_t*)data;
RARCH_LOG("GL VSync => %s\n", state ? "off" : "on");
context_swap_interval_func(state ? 0 : 1);
}
@ -1598,7 +1596,6 @@ static bool gl_alive(void *data)
static bool gl_focus(void *data)
{
gl_t *gl = (gl_t*)data;
return context_has_focus_func();
}