(Apple) Get rid of g_initialized variable

This commit is contained in:
Twinaphex 2014-07-11 02:24:11 +02:00
parent 10f25672a0
commit 74f36b3878

View File

@ -1,7 +1,7 @@
#include "../../gfx/gfx_common.h" #include "../../gfx/gfx_common.h"
#include "../../gfx/gfx_context.h" #include "../../gfx/gfx_context.h"
#include "../../gfx/gl_common.h"
static bool g_initialized;
static int g_fast_forward_skips; static int g_fast_forward_skips;
static bool g_is_syncing = true; static bool g_is_syncing = true;
@ -30,14 +30,12 @@ static bool apple_gfx_ctx_init(void *data)
(void)data; (void)data;
// Make sure the view was created // Make sure the view was created
[RAGameView get]; [RAGameView get];
g_initialized = true;
return true; return true;
} }
static void apple_gfx_ctx_destroy(void *data) static void apple_gfx_ctx_destroy(void *data)
{ {
(void)data; (void)data;
g_initialized = false;
[GLContextClass clearCurrentContext]; [GLContextClass clearCurrentContext];
@ -132,10 +130,9 @@ static void apple_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned*
{ {
RAScreen *screen = (RAScreen*)get_chosen_screen(); RAScreen *screen = (RAScreen*)get_chosen_screen();
CGRect size = screen.bounds; CGRect size = screen.bounds;
gl_t *gl = (gl_t*)data;
(void)data;
if (g_initialized) if (gl)
{ {
#if defined(OSX) #if defined(OSX)
CGRect cgrect = (CGRect)NSRectToCGRect([g_view frame]); CGRect cgrect = (CGRect)NSRectToCGRect([g_view frame]);