| 2279 | } |
| 2280 | |
| 2281 | static void SetCursor(SpriteComponent* component, float cursor) |
| 2282 | { |
| 2283 | const dmGameSystemDDF::Playback playback = (dmGameSystemDDF::Playback)component->m_AnimationPlayback; |
| 2284 | cursor = dmMath::Clamp(cursor, 0.0f, 1.0f); |
| 2285 | if (playback == dmGameSystemDDF::PLAYBACK_ONCE_PINGPONG |
| 2286 | || playback == dmGameSystemDDF::PLAYBACK_LOOP_PINGPONG) |
| 2287 | { |
| 2288 | cursor /= 2.0f; |
| 2289 | } |
| 2290 | else if (playback == dmGameSystemDDF::PLAYBACK_ONCE_BACKWARD |
| 2291 | || playback == dmGameSystemDDF::PLAYBACK_LOOP_BACKWARD) |
| 2292 | { |
| 2293 | cursor = 1.0f - cursor; |
| 2294 | } |
| 2295 | |
| 2296 | component->m_AnimTimer = cursor; |
| 2297 | component->m_DoTick = 1; |
| 2298 | } |
| 2299 | |
| 2300 | static float GetCursor(SpriteComponent* component) |
| 2301 | { |
no test coverage detected