2023-10-05 20:42:24 +00:00
|
|
|
#ifndef GAME_EDITOR_MAPITEMS_ENVELOPE_H
|
|
|
|
#define GAME_EDITOR_MAPITEMS_ENVELOPE_H
|
|
|
|
|
2023-10-05 20:54:51 +00:00
|
|
|
#include <game/client/render.h>
|
|
|
|
#include <game/mapitems.h>
|
2023-10-05 20:42:24 +00:00
|
|
|
|
|
|
|
class CEnvelope
|
|
|
|
{
|
|
|
|
class CEnvelopePointAccess : public IEnvelopePointAccess
|
|
|
|
{
|
|
|
|
std::vector<CEnvPoint_runtime> *m_pvPoints;
|
|
|
|
|
|
|
|
public:
|
2023-10-05 20:54:51 +00:00
|
|
|
CEnvelopePointAccess(std::vector<CEnvPoint_runtime> *pvPoints);
|
2023-10-05 20:42:24 +00:00
|
|
|
|
2023-10-05 20:54:51 +00:00
|
|
|
int NumPoints() const override;
|
|
|
|
const CEnvPoint *GetPoint(int Index) const override;
|
|
|
|
const CEnvPointBezier *GetBezier(int Index) const override;
|
2023-10-05 20:42:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
std::vector<CEnvPoint_runtime> m_vPoints;
|
|
|
|
CEnvelopePointAccess m_PointsAccess;
|
|
|
|
char m_aName[32];
|
|
|
|
float m_Bottom, m_Top;
|
|
|
|
bool m_Synchronized;
|
|
|
|
|
2023-10-05 21:16:47 +00:00
|
|
|
enum class EType
|
|
|
|
{
|
|
|
|
POSITION,
|
|
|
|
COLOR,
|
|
|
|
SOUND
|
|
|
|
};
|
|
|
|
explicit CEnvelope(EType Type);
|
|
|
|
explicit CEnvelope(int NumChannels);
|
2023-10-05 20:42:24 +00:00
|
|
|
|
2023-10-05 20:54:51 +00:00
|
|
|
void Resort();
|
|
|
|
void FindTopBottom(int ChannelMask);
|
|
|
|
int Eval(float Time, ColorRGBA &Color);
|
|
|
|
void AddPoint(int Time, int v0, int v1 = 0, int v2 = 0, int v3 = 0);
|
|
|
|
float EndTime() const;
|
|
|
|
int GetChannels() const;
|
2023-10-05 21:16:47 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
EType m_Type;
|
2023-10-05 20:42:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|