(Show FPS) Fix issue with DRM EGL context showing corrupted

string - check if buf_fps is not null before pushing string to message
queue - do this for all context files from now on
This commit is contained in:
twinaphex 2013-10-08 03:14:34 +02:00
parent c2b55b9974
commit 10baf8456d
10 changed files with 13 additions and 9 deletions

View File

@ -200,7 +200,7 @@ static void gfx_ctx_update_window_title(void)
bool fps_draw = g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW);
gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps));
if (fps_draw)
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}

View File

@ -323,7 +323,11 @@ static void gfx_ctx_set_resize(unsigned width, unsigned height)
static void gfx_ctx_update_window_title(void)
{
char buf[128], buf_fps[128];
bool fps_draw = g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW);
gfx_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps));
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}
static bool gfx_ctx_set_video_mode(

View File

@ -219,7 +219,7 @@ static void gfx_ctx_update_window_title(void)
bool fps_draw = g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW);
gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps));
if (fps_draw)
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}

View File

@ -86,7 +86,7 @@ static void gfx_ctx_update_window_title(void)
bool fps_draw = g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW);
gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps));
if (fps_draw)
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}

View File

@ -170,7 +170,7 @@ static void gfx_ctx_update_window_title(void)
if (gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps)))
XStoreName(g_dpy, g_win, buf);
if (fps_draw)
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}

View File

@ -192,7 +192,7 @@ static void gfx_ctx_update_window_title(void)
bool fps_draw = g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW);
gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps));
if (fps_draw)
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}

View File

@ -113,7 +113,7 @@ static void gfx_ctx_update_window_title(void)
bool fps_draw = g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW);
gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps));
if (fps_draw)
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}

View File

@ -282,7 +282,7 @@ static void gfx_ctx_update_window_title(void)
if (gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps)))
SetWindowText(g_hwnd, buf);
if (fps_draw)
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}

View File

@ -87,7 +87,7 @@ static void gfx_ctx_xdk_update_window_title(void)
bool fps_draw = g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW);
gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps));
if (fps_draw)
if (fps_draw && buf_fps != NULL)
{
char mem[128];
MEMORYSTATUS stat;

View File

@ -184,7 +184,7 @@ static void gfx_ctx_update_window_title(void)
if (gfx_get_fps(buf, sizeof(buf), fps_draw ? buf_fps : NULL, sizeof(buf_fps)))
XStoreName(g_dpy, g_win, buf);
if (fps_draw)
if (fps_draw && buf_fps != NULL)
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
}