From 2cf33eff014e7de2dab04d15159c75a976f337f9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 8 Dec 2014 12:39:02 -0600 Subject: Travel: Fix more initialization errors, mostly related to file path problems --- apps/graphics/traveler/src/trv_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'apps/graphics/traveler/src/trv_main.c') diff --git a/apps/graphics/traveler/src/trv_main.c b/apps/graphics/traveler/src/trv_main.c index 078a5aef9..53cc1cca8 100644 --- a/apps/graphics/traveler/src/trv_main.c +++ b/apps/graphics/traveler/src/trv_main.c @@ -169,7 +169,6 @@ int traveler_main(int argc, char *argv[]) FAR const char *wldfile; #ifdef CONFIG_GRAPHICS_TRAVELER_PERFMON int32_t frame_count = 0; - double elapsed_time = 0.0; double start_time; #endif int ret; @@ -265,14 +264,20 @@ int traveler_main(int argc, char *argv[]) /* Display the world. */ trv_display_update(&g_trv_ginfo); + #ifdef CONFIG_GRAPHICS_TRAVELER_PERFMON + /* Show the frame rate */ + frame_count++; - elapsed_time += trv_current_time() - start_time; if (frame_count == 100) { - fprintf(stderr, "fps = %3.2f\n", (double) frame_count / elapsed_time); + double now = trv_current_time(); + double elapsed = now - start_time; + + fprintf(stderr, "fps = %3.2f\n", (double)frame_count / elapsed); + frame_count = 0; - elapsed_time = 0.0; + start_time = now; } #endif } -- cgit v1.2.3