Mercurial > fife-parpg
comparison engine/core/model/metamodel/timeprovider.h @ 181:56ac89189bc4
fixed time handling in fife:
- the time scaling method was unreliable when changing the time factors (jumping in the moment of the change)
- replaced much calls to SDL_GetTicks with TimerManager::instance()->getTime()
- some other time related cleanup
author | spq@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 31 Jan 2009 04:15:43 +0000 |
parents | 90005975cdbb |
children | 5816ab527da8 |
comparison
equal
deleted
inserted
replaced
180:66bd7f8c541e | 181:56ac89189bc4 |
---|---|
58 /** @see setMultiplier. Returns mutliplier for whole chain of timeproviders | 58 /** @see setMultiplier. Returns mutliplier for whole chain of timeproviders |
59 * E.g. if master has multiplier 2.0 and this has 0.5, end result = 1.0 | 59 * E.g. if master has multiplier 2.0 and this has 0.5, end result = 1.0 |
60 */ | 60 */ |
61 float getTotalMultiplier() const; | 61 float getTotalMultiplier() const; |
62 | 62 |
63 /** Returns current game ticks. Fetched from furthest master to reduce system calls. | 63 /** Returns current game ticks, already scaled. |
64 */ | 64 */ |
65 unsigned int getGameTicks() const; | 65 unsigned int getGameTime() const; |
66 | 66 |
67 private: | 67 private: |
68 TimeProvider* m_master; | 68 TimeProvider* m_master; |
69 float m_multiplier; | 69 float m_multiplier; |
70 double m_time_static, m_time_scaled; | |
71 | |
72 /** Returns current game ticks, already scaled, more precise. | |
73 */ | |
74 double getPreciseGameTime() const; | |
70 }; | 75 }; |
71 | 76 |
72 /** Utility function to calculate time scaling. Mostly done to avoid littering other code | 77 /** Utility function to calculate time scaling. Mostly done to avoid littering other code |
73 * with related casting | 78 * with related casting |
74 * @return multiplier * ticks | 79 * @return multiplier * ticks |