Ignore:
Timestamp:
Aug 22, 2010, 7:52:12 PM (10 years ago)
Author:
sam
Message:

Store the frame number in the Ticker instead of duplicating the information
in each class that uses it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ticker.cpp

    r154 r167  
    2424public:
    2525    TickerData() :
    26         todo(0),
    27         nentities(0)
     26        todo(0), nentities(0),
     27        frame(0), deltams(0), bias(0)
    2828    {
    2929        for (int i = 0; i < Entity::GROUP_COUNT; i++)
    3030            list[i] = NULL;
    31         bias = 0.0f;
    3231    }
    3332
     
    4746
    4847    /* Fixed framerate management */
     48    int frame;
    4949    Timer timer;
    5050    float deltams, bias;
     
    7373
    7474    Profiler::Start(Profiler::STAT_TICK_GAME);
     75
     76    data->frame++;
    7577
    7678    data->deltams = data->timer.GetMs();
     
    163165}
    164166
     167int Ticker::GetFrameNum()
     168{
     169    return data->frame;
     170}
     171
Note: See TracChangeset for help on using the changeset viewer.