metaforce/Runtime/Input/CRumbleVoice.hpp

87 lines
1.6 KiB
C++
Raw Normal View History

2016-02-21 06:34:42 +00:00
#ifndef CRUMBLEVOICE_HPP
#define CRUMBLEVOICE_HPP
#include "RetroTypes.hpp"
2016-03-04 23:04:53 +00:00
namespace urde
2016-02-21 06:34:42 +00:00
{
enum class ERumbleFxId
{
Six = 6,
2017-03-26 05:53:04 +00:00
Seven = 7,
2017-06-12 04:23:34 +00:00
Eleven = 11,
2017-09-02 04:06:05 +00:00
Twelve = 12,
2017-09-10 00:36:21 +00:00
Thirteen = 13,
2017-09-04 02:22:46 +00:00
Fourteen = 14,
Fifteen = 15,
Seventeen = 17
2016-02-21 06:34:42 +00:00
};
enum class ERumblePriority
{
None = 0,
One = 1,
2017-09-02 04:06:05 +00:00
Two = 2,
Three = 3
2016-02-21 06:34:42 +00:00
};
struct SAdsrData;
class CRumbleVoice
{
public:
CRumbleVoice() {}
CRumbleVoice(const SAdsrData& data);
};
struct SAdsrData
{
float x0 = 0.f;
float x4 = 0.f;
float x8 = 0.f;
float xc = 0.f;
float x10 = 0.f;
float x14 = 0.f;
union
{
struct { bool x18_24 : 1; bool x18_25 : 1; };
u8 dummy = 0;
};
SAdsrData() = default;
SAdsrData(float a, float b, float c, float d, float e, float f, bool g, bool h)
: x0(a), x4(b), x8(c), xc(d), x10(e), x14(f)
{
x18_24 = g;
x18_25 = h;
}
};
struct SAdsrDelta
{
enum class EPhase
{
Stop,
Start,
};
float x0 = 0.f;
float x4 = 0.f;
float x8 = 0.f;
float xc = 0.f;
float x10 = 0.f;
ERumblePriority x1c_priority;
EPhase x20_phase;
SAdsrDelta(EPhase phase, ERumblePriority priority)
: x1c_priority(priority), x20_phase(phase)
{}
SAdsrDelta(EPhase phase)
: x1c_priority(ERumblePriority::None), x20_phase(phase)
{}
static SAdsrDelta Stopped() { return SAdsrDelta(EPhase::Stop); }
static SAdsrDelta Start(ERumblePriority priority) { return SAdsrDelta(EPhase::Start, priority); }
};
}
#endif // CRUMBLEVOICE_HPP