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
This commit is contained in:
Philippe Houdoin 2009-11-25 06:03:44 +00:00
parent 259b620cc6
commit 1cf43f239c

View File

@ -94,10 +94,10 @@ void
FPS::drawCounter(GLfloat frameRate) FPS::drawCounter(GLfloat frameRate)
{ {
GLfloat pos = 0; GLfloat pos = 0;
int ifps = (int)(frameRate * 10 + 0.5); int ifps = (int)frameRate;
int count = 0; int count = 0;
int number = 10; int number = 1;
while (ifps > number) { while (ifps > number) {
number *= 10; number *= 10;
count++; count++;
@ -112,15 +112,7 @@ FPS::drawCounter(GLfloat frameRate)
number /= 10; number /= 10;
} }
pos -= 0.5;
glBegin(GL_POINTS);
glVertex2f(pos, -0.5);
glEnd();
pos += 0.5; pos += 0.5;
drawChar(pos, 0, (ifps / number) % 10);
pos += 1.5;
drawChar(pos, 0, 10); drawChar(pos, 0, 10);
pos += 1; pos += 1;
drawChar(pos, 0, 11); drawChar(pos, 0, 11);