Ticket #4870: GLTeapot-integer-FPS.2.patch

File GLTeapot-integer-FPS.2.patch, 704 bytes (added by mmadia, 10 years ago)

updated patch. removes unnecessary multiplication of frameRate

  • src/apps/glteapot/FPS.cpp

     
    9494FPS::drawCounter(GLfloat frameRate)
    9595{
    9696    GLfloat pos = 0;
    97     int ifps = (int)(frameRate * 10 + 0.5);
     97    int ifps = (int)frameRate;
    9898
    9999    int count = 0;
    100     int number = 10;
     100    int number = 1;
    101101    while (ifps > number) {
    102102        number *= 10;
    103103        count++;
     
    112112        number /= 10;
    113113    }
    114114
    115     pos -= 0.5;
    116     glBegin(GL_POINTS);
    117     glVertex2f(pos, -0.5);
    118     glEnd();
    119115    pos += 0.5;
    120 
    121     drawChar(pos, 0, (ifps / number) % 10);
    122     pos += 1.5;
    123 
    124116    drawChar(pos, 0, 10);
    125117    pos += 1;
    126118    drawChar(pos, 0, 11);