From e218a8c9e3bd45717847d9d63b052a6d0a7d1e67 Mon Sep 17 00:00:00 2001 From: Richard Rauch Date: Fri, 7 Nov 2003 07:57:03 +0000 Subject: [PATCH] Further normalization of the code's style. No substantial changes. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@312 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_display.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/freeglut_display.c b/src/freeglut_display.c index 3db6cb5..a2168a3 100644 --- a/src/freeglut_display.c +++ b/src/freeglut_display.c @@ -64,16 +64,19 @@ void FGAPIENTRY glutSwapBuffers( void ) #endif /* GLUT_FPS env var support */ - if (fgState.FPSInterval) { - GLint t = glutGet(GLUT_ELAPSED_TIME); + if( fgState.FPSInterval ) + { + GLint t = glutGet( GLUT_ELAPSED_TIME ); fgState.SwapCount++; - if (fgState.SwapTime == 0) + if( fgState.SwapTime == 0 ) fgState.SwapTime = t; - else if (t - fgState.SwapTime > fgState.FPSInterval) { - float time = 0.001f * (t - fgState.SwapTime); - float fps = (float) fgState.SwapCount / time; - fprintf(stderr, "freeglut: %d frames in %.2f seconds = %.2f FPS\n", - fgState.SwapCount, time, fps); + else if( t - fgState.SwapTime > fgState.FPSInterval ) + { + float time = 0.001f * ( t - fgState.SwapTime ); + float fps = ( float )fgState.SwapCount / time; + fprintf( stderr, + "freeglut: %d frames in %.2f seconds = %.2f FPS\n", + fgState.SwapCount, time, fps ); fgState.SwapTime = t; fgState.SwapCount = 0; } @@ -89,7 +92,7 @@ void FGAPIENTRY glutPostWindowRedisplay( int windowID ) freeglut_assert_ready; window = fgWindowByID( windowID ); - freeglut_return_if_fail( window != NULL ); + freeglut_return_if_fail( window ); window->State.Redisplay = TRUE; } -- 1.7.10.4