2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CRUMBLEGENERATOR
|
|
|
|
#define _CRUMBLEGENERATOR
|
2022-08-13 02:48:34 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "Kyoto/Input/CRumbleVoice.hpp"
|
2022-10-05 00:16:03 +00:00
|
|
|
#include "Kyoto/Input/InputTypes.hpp"
|
2022-08-13 02:48:34 +00:00
|
|
|
|
|
|
|
class CRumbleGenerator {
|
|
|
|
private:
|
|
|
|
CRumbleVoice x0_voices[4];
|
2022-10-09 05:37:23 +00:00
|
|
|
float xc0_periodTime[4];
|
|
|
|
float xd0_onTime[4];
|
2022-08-13 02:48:34 +00:00
|
|
|
EMotorState xe0_commandArray[4];
|
|
|
|
bool xf0_24_disabled : 1;
|
2022-10-17 11:10:16 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CRumbleGenerator();
|
|
|
|
~CRumbleGenerator();
|
|
|
|
|
|
|
|
s16 Rumble(const SAdsrData& adsr, float, ERumblePriority prio, EIOPort port);
|
|
|
|
void Stop(short id, EIOPort port) {
|
|
|
|
if (id == -1)
|
|
|
|
return;
|
|
|
|
CRumbleVoice& vox = x0_voices[size_t(port)];
|
|
|
|
vox.Deactivate(id, false);
|
|
|
|
}
|
|
|
|
void Deactivate(short, bool);
|
|
|
|
void Update(float);
|
|
|
|
void HardStopAll();
|
2022-08-13 02:48:34 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CRUMBLEGENERATOR
|