From 1cf43f239cd201e49e140d71a476e53589c4f683 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Wed, 25 Nov 2009 06:03:44 +0000 Subject: [PATCH] Applied patch by mmadia to truncate FPS to an integer. Fixed #4870. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34232 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/glteapot/FPS.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/apps/glteapot/FPS.cpp b/src/apps/glteapot/FPS.cpp index 9fb81e788b..d578cf138e 100644 --- a/src/apps/glteapot/FPS.cpp +++ b/src/apps/glteapot/FPS.cpp @@ -94,10 +94,10 @@ void FPS::drawCounter(GLfloat frameRate) { GLfloat pos = 0; - int ifps = (int)(frameRate * 10 + 0.5); + int ifps = (int)frameRate; int count = 0; - int number = 10; + int number = 1; while (ifps > number) { number *= 10; count++; @@ -112,15 +112,7 @@ FPS::drawCounter(GLfloat frameRate) number /= 10; } - pos -= 0.5; - glBegin(GL_POINTS); - glVertex2f(pos, -0.5); - glEnd(); pos += 0.5; - - drawChar(pos, 0, (ifps / number) % 10); - pos += 1.5; - drawChar(pos, 0, 10); pos += 1; drawChar(pos, 0, 11);