(Android) Get rid of unused width/height/animated in g_android struct
This commit is contained in:
parent
291280670d
commit
cbcffbb5cf
|
@ -22,9 +22,6 @@ struct droid
|
|||
|
||||
bool init_quit;
|
||||
bool window_inited;
|
||||
unsigned animating;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
struct saved_state state;
|
||||
};
|
||||
|
||||
|
|
|
@ -91,9 +91,6 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd)
|
|||
ASensorEventQueue_disableSensor(g_android.sensorEventQueue,
|
||||
g_android.accelerometerSensor);
|
||||
#endif
|
||||
|
||||
// Also stop animating.
|
||||
g_android.animating = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -178,45 +175,28 @@ void android_main(struct android_app* state)
|
|||
argv[argc++] = strdup(libretro_path);
|
||||
argv[argc++] = strdup("-v");
|
||||
|
||||
g_android.animating = 1;
|
||||
|
||||
g_extern.verbose = true;
|
||||
|
||||
while(!g_android.window_inited)
|
||||
{
|
||||
// Read all pending events.
|
||||
int ident;
|
||||
int events;
|
||||
struct android_poll_source* source;
|
||||
|
||||
// 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)
|
||||
// Block forever waiting for events.
|
||||
while ((ident=ALooper_pollAll(0, NULL, 0, (void**)&source)) >= 0)
|
||||
{
|
||||
// Process this event.
|
||||
if (source != NULL)
|
||||
source->process(g_android.app, 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)
|
||||
{
|
||||
//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 (g_android.app->destroyRequested != 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
RARCH_LOG("Start RetroArch...\n");
|
||||
RARCH_LOG("Starting RetroArch...\n");
|
||||
|
||||
rarch_main(argc, argv);
|
||||
exit(0);
|
||||
|
|
|
@ -57,10 +57,6 @@ static void gfx_ctx_destroy(void)
|
|||
g_egl_surf = EGL_NO_SURFACE;
|
||||
g_egl_ctx = EGL_NO_CONTEXT;
|
||||
g_config = 0;
|
||||
|
||||
g_android.width = 0;
|
||||
g_android.height = 0;
|
||||
g_android.animating = 0;
|
||||
}
|
||||
|
||||
static bool gfx_ctx_init(void)
|
||||
|
@ -118,8 +114,6 @@ static bool gfx_ctx_init(void)
|
|||
!eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_HEIGHT, &height))
|
||||
goto error;
|
||||
|
||||
g_android.width = width;
|
||||
g_android.height = height;
|
||||
g_android.state.angle = 0;
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue