gzdoom-gles/src/cycler.h
Christoph Oelckers c05e3ebf31 Made several classes trivially copyable,
Many had leftover non-default constructors/ assignment operators, and some were initialized, even though the initialized data was never used.

In case of FCycler this even caused a default setting to be overwritten when used inside FDynamicLight.

# Conflicts:
#	src/g_shared/a_dynlight.cpp
#	src/sound/s_sndseq.cpp
2020-01-04 21:32:10 +01:00

43 lines
952 B
C++

#ifndef __GL_CYCLER_H
#define __GL_CYCLER_H
class FSerializer;
enum CycleType
{
CYCLE_Linear,
CYCLE_Sin,
CYCLE_Cos,
CYCLE_SawTooth,
CYCLE_Square
};
class FCycler;
FSerializer &Serialize(FSerializer &arc, const char *key, FCycler &c, FCycler *def);
class FCycler
{
friend FSerializer &Serialize(FSerializer &arc, const char *key, FCycler &c, FCycler *def);
public:
FCycler() = default;
FCycler(const FCycler &other) = default;
FCycler &operator=(const FCycler &other) = default;
void Update(double diff);
void SetParams(double start, double end, double cycle, bool update = false);
void ShouldCycle(bool sc) { m_shouldCycle = sc; }
void SetCycleType(CycleType ct) { m_cycleType = ct; }
double GetVal() { return m_current; }
inline operator double () const { return m_current; }
double m_start, m_end, m_current;
double m_time, m_cycle;
bool m_increment, m_shouldCycle;
CycleType m_cycleType;
};
#endif