Timer.inl
上传用户:royluo
上传日期:2007-01-05
资源大小:1584k
文件大小:2k
源码类别:

游戏

开发平台:

Visual C++

  1. /*****************************************************************************
  2. *                                                                             
  3. *   Timer.inl
  4. *                                                                             
  5. *   Electrical Engineering Faculty - Software Lab                             
  6. *   Spring semester 1998                                                      
  7. *                                                                             
  8. *   Tanks game                                                                
  9. *                                                                             
  10. *   Contents: Inline functions implementations.
  11. *                                                                             
  12. *   Authors: Eran Yariv - 28484475                                           
  13. *            Moshe Zur  - 24070856                                           
  14. *                                                                            
  15. *                                                                            
  16. *   Date: 23/09/98                                                           
  17. *                                                                            
  18. ******************************************************************************/
  19. /****************** CTimer **********************/
  20. inline DWORD 
  21. CTimer::GetRemoteTime ()
  22. {
  23.     return DWORD(LONG(GetLocalTime()) - m_lLastDelta);
  24. }
  25. inline DWORD 
  26. CTimer::GetLocalTime (DWORD dwRemoteTime)
  27. {   // Converts remote time (server's game timer) to local time (client's time)
  28.     // and returns local time    
  29.     return UpdateDelta (dwRemoteTime);
  30. }
  31. inline DWORD
  32. CTimer::GetLocalTime ()
  33. {
  34.     return m_pActualSampleFunction ();
  35. }
  36. /****************** CVanJacobsonTimer **********************/
  37. inline 
  38. CVanJacobsonTimer::CVanJacobsonTimer  (BOOL bForceLowResTimers) :
  39.     CTimer (bForceLowResTimers),
  40.     m_dPrevSRTT (0.0),
  41.     m_dPrevSDEV (0.0)
  42. {}