diff --git a/src/ticker.cpp b/src/ticker.cpp index 0519eaf8..03be4b5a 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -54,6 +54,8 @@ public: Log::Debug("%i frames required to quit\n", frame - quitframe); #endif + gametick.Push(0); + delete gamethread; } private: @@ -418,9 +420,6 @@ void Ticker::Shutdown() data->quit = 1; data->quitframe = data->frame; - - data->gametick.Push(0); - delete data->gamethread; } int Ticker::Finished() diff --git a/src/video.cpp b/src/video.cpp index f1a103d7..e87e7c13 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -35,17 +35,13 @@ class VideoData private: static mat4 proj_matrix, view_matrix; -#if defined __ANDROID__ || defined __CELLOS_LV2__ || defined __APPLE__ static ivec2 saved_viewport; -#endif }; mat4 VideoData::proj_matrix; mat4 VideoData::view_matrix; -#if defined __ANDROID__ || defined __CELLOS_LV2__ || defined __APPLE__ ivec2 VideoData::saved_viewport(0, 0); -#endif /* * Public Video class @@ -65,10 +61,7 @@ void Video::Setup(ivec2 size) /* Initialise OpenGL */ glViewport(0, 0, size.x, size.y); - -#if defined __ANDROID__ || defined __CELLOS_LV2__ || defined __APPLE__ VideoData::saved_viewport = size; -#endif glClearColor(0.1f, 0.2f, 0.3f, 1.0f); glClearDepth(1.0); @@ -178,13 +171,12 @@ void Video::Capture(uint32_t *buffer) ivec2 Video::GetSize() { -#if defined __ANDROID__ + /* GetSize() is called too often on the game thread; we cannot rely on + * the GL context at this point */ +#if 1 return VideoData::saved_viewport; #elif defined __CELLOS_LV2__ // FIXME: use psglCreateDeviceAuto && psglGetDeviceDimensions - return VideoData::saved_viewport; -#elif defined __APPLE__ - return VideoData::saved_viewport; #else GLint v[4]; glGetIntegerv(GL_VIEWPORT, v);