Exemple #1
0
PBYTE *T5( PBYTE *pMem )
{
      ODS( WIDE("Starting Defrag test\n"));
      DumpStats();
      {

         int i, r;
         for( i = 0; i < MAX_I/2; i++ )
         {
            r = i*2;
            if( r >= MAX_I )
               r -= (MAX_I - 1);
            pMem[r] = Release( pMem[r] );
         }
      DumpStats();
         for( i = 0; i < (MAX_I)/2; i++ )
         {
            r = i*2;
            Defragment( &pMem[r+1] );
         }
      DumpStats();
         for( ; i < MAX_I; i++ )
         {
            r = i*2;
            if( r >= MAX_I )
               r -= (MAX_I - 1);
            pMem[r] = Release( pMem[r] );
         }
      DumpStats();
      }
   IsDone();
   return pMem;
}
  virtual void AdvanceFrame(MotiveTime delta_time) {
    Defragment();

    // Loop through every motivator one at a time.
    // TODO: change this to a closed-form equation.
    // TODO OPT: reorder data and then optimize with SIMD to process in groups
    // of 4 floating-point or 8 fixed-point values.
    for (auto d = data_.begin(); d < data_.end(); ++d) {
      for (MotiveTime time_remaining = delta_time; time_remaining > 0;) {
        MotiveTime dt = std::min(time_remaining, d->init.max_delta_time());

        d->velocity = CalculateVelocity(dt, *d);
        d->value = CalculateValue(dt, *d);

        time_remaining -= dt;
      }
    }
  }
Exemple #3
0
 virtual void AdvanceFrame(MotiveTime delta_time) {
   Defragment();
   interpolator_.AdvanceFrame(static_cast<float>(delta_time));
 }