DigitalController: Store button state/transfer state in save states
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "digital_controller.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/state_wrapper.h"
|
||||
|
||||
DigitalController::DigitalController() = default;
|
||||
|
||||
@ -20,6 +21,21 @@ std::optional<s32> DigitalController::GetButtonCodeByName(std::string_view butto
|
||||
return StaticGetButtonCodeByName(button_name);
|
||||
}
|
||||
|
||||
void DigitalController::Reset()
|
||||
{
|
||||
m_transfer_state = TransferState::Idle;
|
||||
}
|
||||
|
||||
bool DigitalController::DoState(StateWrapper& sw)
|
||||
{
|
||||
if (!Controller::DoState(sw))
|
||||
return false;
|
||||
|
||||
sw.Do(&m_button_state);
|
||||
sw.Do(&m_transfer_state);
|
||||
return true;
|
||||
}
|
||||
|
||||
void DigitalController::SetAxisState(s32 axis_code, float value) {}
|
||||
|
||||
void DigitalController::SetButtonState(Button button, bool pressed)
|
||||
|
||||
Reference in New Issue
Block a user