Changeset 223 in flair-src for trunk/lib/FlairCore/src/io_data.cpp


Ignore:
Timestamp:
Feb 27, 2018, 12:20:03 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

add delta time to io_data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/io_data.cpp

    r51 r223  
    4646void io_data::SetDataTime(Time time) {
    4747  GetMutex();
     48  if(pimpl_->time!=TIME_INFINITE) pimpl_->deltaTime = time-pimpl_->time;
     49  pimpl_->time = time;
     50  ReleaseMutex();
     51}
     52
     53void io_data::SetDataTime(Time time,Time deltaTime) {
     54  GetMutex();
     55  pimpl_->deltaTime = deltaTime;
    4856  pimpl_->time = time;
    4957  ReleaseMutex();
     
    5664  ReleaseMutex();
    5765  return tmp;
     66}
     67
     68Time io_data::DataDeltaTime(void) const {
     69  Time tmp;
     70  GetMutex();
     71  tmp = pimpl_->deltaTime;
     72  ReleaseMutex();
     73  return tmp;
     74}
     75
     76void io_data::GetDataTime(Time &time,Time &deltaTime) const{
     77  GetMutex();
     78  deltaTime=pimpl_->deltaTime ;
     79  time=pimpl_->time ;
     80  ReleaseMutex();
    5881}
    5982
Note: See TracChangeset for help on using the changeset viewer.