DDraceNetwork Docs
envelope.h
Go to the documentation of this file.
1#ifndef GAME_EDITOR_MAPITEMS_ENVELOPE_H
2#define GAME_EDITOR_MAPITEMS_ENVELOPE_H
3
5#include <game/mapitems.h>
6
8{
9public:
10 std::vector<CEnvPoint_runtime> m_vPoints;
11 char m_aName[32] = "";
12 bool m_Synchronized = false;
13
14 enum class EType
15 {
16 POSITION,
17 COLOR,
18 SOUND
19 };
20 explicit CEnvelope(EType Type);
21 explicit CEnvelope(int NumChannels);
22
23 std::pair<float, float> GetValueRange(int ChannelMask);
24 void Eval(float Time, ColorRGBA &Result, size_t Channels);
25 void AddPoint(int Time, int v0, int v1 = 0, int v2 = 0, int v3 = 0);
26 float EndTime() const;
27 int GetChannels() const;
28 EType Type() const { return m_Type; }
29
30private:
31 void Resort();
32
34
36 {
37 std::vector<CEnvPoint_runtime> *m_pvPoints;
38
39 public:
40 CEnvelopePointAccess(std::vector<CEnvPoint_runtime> *pvPoints);
41
42 int NumPoints() const override;
43 const CEnvPoint *GetPoint(int Index) const override;
44 const CEnvPointBezier *GetBezier(int Index) const override;
45 };
47};
48
49#endif
Definition: envelope.h:36
CEnvelopePointAccess(std::vector< CEnvPoint_runtime > *pvPoints)
Definition: envelope.cpp:9
const CEnvPointBezier * GetBezier(int Index) const override
Definition: envelope.cpp:26
int NumPoints() const override
Definition: envelope.cpp:14
std::vector< CEnvPoint_runtime > * m_pvPoints
Definition: envelope.h:37
const CEnvPoint * GetPoint(int Index) const override
Definition: envelope.cpp:19
Definition: envelope.h:8
CEnvelope(EType Type)
Definition: envelope.cpp:33
void AddPoint(int Time, int v0, int v1=0, int v2=0, int v3=0)
Definition: envelope.cpp:107
CEnvelopePointAccess m_PointsAccess
Definition: envelope.h:46
EType Type() const
Definition: envelope.h:28
char m_aName[32]
Definition: envelope.h:11
float EndTime() const
Definition: envelope.cpp:127
int GetChannels() const
Definition: envelope.cpp:134
void Eval(float Time, ColorRGBA &Result, size_t Channels)
Definition: envelope.cpp:101
bool m_Synchronized
Definition: envelope.h:12
std::pair< float, float > GetValueRange(int ChannelMask)
Definition: envelope.cpp:60
std::vector< CEnvPoint_runtime > m_vPoints
Definition: envelope.h:10
EType
Definition: envelope.h:15
EType m_Type
Definition: envelope.h:33
void Resort()
Definition: envelope.cpp:55
Definition: color.h:210
Definition: render.h:157
Definition: mapitems.h:395
Definition: mapitems.h:378