Ignore:
Timestamp:
Aug 16, 2010, 11:40:15 PM (11 years ago)
Author:
sam
Message:

Try to detect assets not calling their super tick methods. Already spotted
one bug thanks to that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ticker.cpp

    r129 r130  
    112112        for (Asset *a = data->list[i]; a; a = a->next)
    113113            if (!a->destroy)
     114            {
     115#if !FINAL_RELEASE
     116                if (a->state != Asset::STATE_IDLE)
     117                    fprintf(stderr, "ERROR: asset not idle for game tick\n");
     118                a->state = Asset::STATE_PRETICK_GAME;
     119#endif
    114120                a->TickGame(data->delta_time);
     121#if !FINAL_RELEASE
     122                if (a->state != Asset::STATE_POSTTICK_GAME)
     123                    fprintf(stderr, "ERROR: asset missed super game tick\n");
     124                a->state = Asset::STATE_IDLE;
     125#endif
     126            }
    115127
    116128    Profiler::Stop(Profiler::STAT_TICK_GAME);
     
    125137        for (Asset *a = data->list[i]; a; a = a->next)
    126138            if (!a->destroy)
     139            {
     140#if !FINAL_RELEASE
     141                if (a->state != Asset::STATE_IDLE)
     142                    fprintf(stderr, "ERROR: asset not idle for render tick\n");
     143                a->state = Asset::STATE_PRETICK_RENDER;
     144#endif
    127145                a->TickRender(data->delta_time);
     146#if !FINAL_RELEASE
     147                if (a->state != Asset::STATE_POSTTICK_RENDER)
     148                    fprintf(stderr, "ERROR: asset missed super render tick\n");
     149                a->state = Asset::STATE_IDLE;
     150#endif
     151            }
    128152
    129153    Profiler::Stop(Profiler::STAT_TICK_RENDER);
Note: See TracChangeset for help on using the changeset viewer.