Changeset 223 in flair-src for trunk/lib/FlairCore


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

add delta time to io_data

Location:
trunk/lib/FlairCore/src
Files:
4 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
  • trunk/lib/FlairCore/src/io_data.h

    r51 r223  
    116116
    117117  /*!
    118   * \brief Set data time
    119   *
     118  * \brief Set data time, also caluculates the delta time based on last call
     119  *
     120  * TIME_INFINITE represents an unitialized time
     121  *
    120122  * \param time time
    121123  */
    122124  void SetDataTime(Time time);
     125 
     126  /*!
     127  * \brief Set data time and  delta time (thus delta time is not based on last call)
     128  *
     129  * TIME_INFINITE represents an unitialized time
     130  *
     131  * \param time time
     132  * \param deltaTime delta time
     133  */
     134  void SetDataTime(Time time,Time deltaTime);
    123135
    124136  /*!
    125137  * \brief Data time
    126138  *
     139  * TIME_INFINITE represents an unitialized time.
     140  *
    127141  * \return data time
    128142  */
    129143  Time DataTime(void) const;
     144 
     145  /*!
     146  * \brief Data delta time
     147  *
     148  * TIME_INFINITE represents an unitialized time.
     149  *
     150  * \return data delta time
     151  */
     152  Time DataDeltaTime(void) const;
     153 
     154  /*!
     155  * \brief Get data time and  delta time
     156  *
     157  * TIME_INFINITE represents an unitialized time
     158  *
     159  * \param time time
     160  * \param deltaTime delta time
     161  */
     162  void GetDataTime(Time &time,Time &deltaTime) const;
    130163
    131164  /*!
  • trunk/lib/FlairCore/src/io_data_impl.cpp

    r122 r223  
    3131  is_consistent = false;
    3232  circle_ptr = NULL;
     33  deltaTime=TIME_INFINITE;//init
     34  time=TIME_INFINITE;//init
    3335}
    3436
  • trunk/lib/FlairCore/src/unexported/io_data_impl.h

    r15 r223  
    3737                            flair::core::DataType const &datatype);
    3838  size_t size;
    39   flair::core::Time time;
     39  flair::core::Time time,deltaTime;
    4040  void **circle_ptr;
    4141
Note: See TracChangeset for help on using the changeset viewer.