Changeset 620


Ignore:
Timestamp:
Feb 9, 2011, 1:33:59 AM (10 years ago)
Author:
sam
Message:

Get rid of benchmarking mode, it's useless: Ticker::Setup(0) does the same.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ticker.cpp

    r619 r620  
    3131        todolist(0), autolist(0),
    3232        nentities(0),
    33         frame(0), benchmark(0), recording(0), deltams(0), bias(0), fps(0),
     33        frame(0), recording(0), deltams(0), bias(0), fps(0),
    3434        quit(0), quitframe(0), quitdelay(20), panic(0)
    3535    {
     
    6262
    6363    /* Fixed framerate management */
    64     int frame, benchmark, recording;
     64    int frame, recording;
    6565    Timer timer;
    6666    float deltams, bias, fps;
     
    169169    data->frame++;
    170170
     171    /* If recording with fixed framerate, set deltams to a fixed value */
    171172    if (data->recording && data->fps)
    172173    {
     
    325326    Profiler::Stop(Profiler::STAT_TICK_BLIT);
    326327
    327     /* If benchmarking, set wait time to 0. If FPS are fixed, force wait
    328      * time to 1/FPS. Otherwise, set wait time to 0. */
    329     float framems = (!data->benchmark && data->fps) ? 1000.0f / data->fps
    330                                                     : 0.0f;
    331 
    332     if (!data->benchmark)
    333     {
    334         if (framems > data->bias + 200.0f)
    335             framems = data->bias + 200.0f; // Don't go below 5 fps
    336         if (framems > data->bias)
    337             data->timer.WaitMs(framems - data->bias);
    338     }
    339 
     328    /* If framerate is fixed, force wait time to 1/FPS. Otherwise, set wait
     329     * time to 0. */
     330    float framems = data->fps ? 1000.0f / data->fps : 0.0f;
     331
     332    if (framems > data->bias + 200.0f)
     333        framems = data->bias + 200.0f; // Don't go below 5 fps
     334    if (framems > data->bias)
     335        data->timer.WaitMs(framems - data->bias);
     336
     337    /* If recording, do not try to compensate for lag. */
    340338    if (!data->recording)
    341339        data->bias -= framems;
    342340}
    343341
    344 void Ticker::StartBenchmark()
    345 {
    346     data->benchmark++;
    347 }
    348 
    349 void Ticker::StopBenchmark()
    350 {
    351     data->benchmark--;
    352 }
    353 
    354342void Ticker::StartRecording()
    355343{
Note: See TracChangeset for help on using the changeset viewer.