DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
smooth_time.h
Go to the documentation of this file.
1
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2
/* If you are missing that file, acquire a complete release at teeworlds.com. */
3
4
#ifndef ENGINE_CLIENT_SMOOTH_TIME_H
5
#define ENGINE_CLIENT_SMOOTH_TIME_H
6
7
#include <cstdint>
8
9
class
CGraph
;
10
11
class
CSmoothTime
12
{
13
public
:
14
enum
EAdjustDirection
15
{
16
ADJUSTDIRECTION_DOWN
= 0,
17
ADJUSTDIRECTION_UP
,
18
NUM_ADJUSTDIRECTIONS
,
19
};
20
21
private
:
22
int64_t
m_Snap
;
23
int64_t
m_Current
;
24
int64_t
m_Target
;
25
int64_t
m_Margin
;
26
27
int
m_SpikeCounter
;
28
float
m_aAdjustSpeed
[
NUM_ADJUSTDIRECTIONS
];
29
30
public
:
31
void
Init
(int64_t Target);
32
void
SetAdjustSpeed
(
EAdjustDirection
Direction
,
float
Value);
33
34
int64_t
Get
(int64_t Now)
const
;
35
36
void
UpdateInt
(int64_t Target);
37
void
Update
(
CGraph
*pGraph, int64_t Target,
int
TimeLeft,
EAdjustDirection
AdjustDirection);
38
39
void
UpdateMargin
(int64_t Margin);
40
};
41
42
#endif
CGraph
Definition
graph.h:17
CSmoothTime
Definition
smooth_time.h:12
CSmoothTime::Get
int64_t Get(int64_t Now) const
Definition
smooth_time.cpp:27
CSmoothTime::m_Snap
int64_t m_Snap
Definition
smooth_time.h:22
CSmoothTime::Update
void Update(CGraph *pGraph, int64_t Target, int TimeLeft, EAdjustDirection AdjustDirection)
Definition
smooth_time.cpp:55
CSmoothTime::UpdateMargin
void UpdateMargin(int64_t Margin)
Definition
smooth_time.cpp:100
CSmoothTime::m_Target
int64_t m_Target
Definition
smooth_time.h:24
CSmoothTime::SetAdjustSpeed
void SetAdjustSpeed(EAdjustDirection Direction, float Value)
Definition
smooth_time.cpp:22
CSmoothTime::EAdjustDirection
EAdjustDirection
Definition
smooth_time.h:15
CSmoothTime::ADJUSTDIRECTION_DOWN
@ ADJUSTDIRECTION_DOWN
Definition
smooth_time.h:16
CSmoothTime::NUM_ADJUSTDIRECTIONS
@ NUM_ADJUSTDIRECTIONS
Definition
smooth_time.h:18
CSmoothTime::ADJUSTDIRECTION_UP
@ ADJUSTDIRECTION_UP
Definition
smooth_time.h:17
CSmoothTime::m_Current
int64_t m_Current
Definition
smooth_time.h:23
CSmoothTime::m_Margin
int64_t m_Margin
Definition
smooth_time.h:25
CSmoothTime::Init
void Init(int64_t Target)
Definition
smooth_time.cpp:11
CSmoothTime::UpdateInt
void UpdateInt(int64_t Target)
Definition
smooth_time.cpp:47
CSmoothTime::m_SpikeCounter
int m_SpikeCounter
Definition
smooth_time.h:27
CSmoothTime::m_aAdjustSpeed
float m_aAdjustSpeed[NUM_ADJUSTDIRECTIONS]
Definition
smooth_time.h:28
Direction
Direction
Definition
nameplates.cpp:211
src
engine
client
smooth_time.h
Generated by
1.18.0