Renaming X_RESULT to be consistent.
This commit is contained in:
parent
06d9f7989a
commit
7a2032b693
|
@ -26,11 +26,11 @@ public:
|
|||
|
||||
virtual X_STATUS Setup() = 0;
|
||||
|
||||
virtual XRESULT GetCapabilities(
|
||||
virtual X_RESULT GetCapabilities(
|
||||
uint32_t user_index, uint32_t flags, X_INPUT_CAPABILITIES& out_caps) = 0;
|
||||
virtual XRESULT GetState(
|
||||
virtual X_RESULT GetState(
|
||||
uint32_t user_index, X_INPUT_STATE& out_state) = 0;
|
||||
virtual XRESULT SetState(
|
||||
virtual X_RESULT SetState(
|
||||
uint32_t user_index, X_INPUT_VIBRATION& vibration) = 0;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -42,7 +42,7 @@ void InputSystem::AddDriver(InputDriver* driver) {
|
|||
drivers_.push_back(driver);
|
||||
}
|
||||
|
||||
XRESULT InputSystem::GetCapabilities(
|
||||
X_RESULT InputSystem::GetCapabilities(
|
||||
uint32_t user_index, uint32_t flags, X_INPUT_CAPABILITIES& out_caps) {
|
||||
for (std::vector<InputDriver*>::iterator it = drivers_.begin();
|
||||
it != drivers_.end(); ++it) {
|
||||
|
@ -54,7 +54,7 @@ XRESULT InputSystem::GetCapabilities(
|
|||
return X_ERROR_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
XRESULT InputSystem::GetState(uint32_t user_index, X_INPUT_STATE& out_state) {
|
||||
X_RESULT InputSystem::GetState(uint32_t user_index, X_INPUT_STATE& out_state) {
|
||||
for (std::vector<InputDriver*>::iterator it = drivers_.begin();
|
||||
it != drivers_.end(); ++it) {
|
||||
InputDriver* driver = *it;
|
||||
|
@ -65,7 +65,7 @@ XRESULT InputSystem::GetState(uint32_t user_index, X_INPUT_STATE& out_state) {
|
|||
return X_ERROR_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
XRESULT InputSystem::SetState(
|
||||
X_RESULT InputSystem::SetState(
|
||||
uint32_t user_index, X_INPUT_VIBRATION& vibration) {
|
||||
for (std::vector<InputDriver*>::iterator it = drivers_.begin();
|
||||
it != drivers_.end(); ++it) {
|
||||
|
|
|
@ -37,10 +37,10 @@ public:
|
|||
|
||||
void AddDriver(InputDriver* driver);
|
||||
|
||||
XRESULT GetCapabilities(
|
||||
X_RESULT GetCapabilities(
|
||||
uint32_t user_index, uint32_t flags, X_INPUT_CAPABILITIES& out_caps);
|
||||
XRESULT GetState(uint32_t user_index, X_INPUT_STATE& out_state);
|
||||
XRESULT SetState(uint32_t user_index, X_INPUT_VIBRATION& vibration);
|
||||
X_RESULT GetState(uint32_t user_index, X_INPUT_STATE& out_state);
|
||||
X_RESULT SetState(uint32_t user_index, X_INPUT_VIBRATION& vibration);
|
||||
|
||||
private:
|
||||
Emulator* emulator_;
|
||||
|
|
|
@ -31,17 +31,17 @@ X_STATUS NopInputDriver::Setup() {
|
|||
// TODO(benvanik): spoof a device so that games don't stop waiting for
|
||||
// a controller to be plugged in.
|
||||
|
||||
XRESULT NopInputDriver::GetCapabilities(
|
||||
X_RESULT NopInputDriver::GetCapabilities(
|
||||
uint32_t user_index, uint32_t flags, X_INPUT_CAPABILITIES& out_caps) {
|
||||
return X_ERROR_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
XRESULT NopInputDriver::GetState(
|
||||
X_RESULT NopInputDriver::GetState(
|
||||
uint32_t user_index, X_INPUT_STATE& out_state) {
|
||||
return X_ERROR_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
XRESULT NopInputDriver::SetState(
|
||||
X_RESULT NopInputDriver::SetState(
|
||||
uint32_t user_index, X_INPUT_VIBRATION& vibration) {
|
||||
return X_ERROR_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
|
|
|
@ -28,11 +28,11 @@ public:
|
|||
|
||||
virtual X_STATUS Setup();
|
||||
|
||||
virtual XRESULT GetCapabilities(
|
||||
virtual X_RESULT GetCapabilities(
|
||||
uint32_t user_index, uint32_t flags, X_INPUT_CAPABILITIES& out_caps);
|
||||
virtual XRESULT GetState(
|
||||
virtual X_RESULT GetState(
|
||||
uint32_t user_index, X_INPUT_STATE& out_state);
|
||||
virtual XRESULT SetState(
|
||||
virtual X_RESULT SetState(
|
||||
uint32_t user_index, X_INPUT_VIBRATION& vibration);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -32,7 +32,7 @@ X_STATUS XInputInputDriver::Setup() {
|
|||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
XRESULT XInputInputDriver::GetCapabilities(
|
||||
X_RESULT XInputInputDriver::GetCapabilities(
|
||||
uint32_t user_index, uint32_t flags, X_INPUT_CAPABILITIES& out_caps) {
|
||||
XINPUT_CAPABILITIES native_caps;
|
||||
DWORD result = XInputGetCapabilities(user_index, flags, &native_caps);
|
||||
|
@ -58,7 +58,7 @@ XRESULT XInputInputDriver::GetCapabilities(
|
|||
return result;
|
||||
}
|
||||
|
||||
XRESULT XInputInputDriver::GetState(
|
||||
X_RESULT XInputInputDriver::GetState(
|
||||
uint32_t user_index, X_INPUT_STATE& out_state) {
|
||||
XINPUT_STATE native_state;
|
||||
DWORD result = XInputGetState(user_index, &native_state);
|
||||
|
@ -78,7 +78,7 @@ XRESULT XInputInputDriver::GetState(
|
|||
return result;
|
||||
}
|
||||
|
||||
XRESULT XInputInputDriver::SetState(
|
||||
X_RESULT XInputInputDriver::SetState(
|
||||
uint32_t user_index, X_INPUT_VIBRATION& vibration) {
|
||||
XINPUT_VIBRATION native_vibration;
|
||||
native_vibration.wLeftMotorSpeed = vibration.left_motor_speed;
|
||||
|
|
|
@ -28,11 +28,11 @@ public:
|
|||
|
||||
virtual X_STATUS Setup();
|
||||
|
||||
virtual XRESULT GetCapabilities(
|
||||
virtual X_RESULT GetCapabilities(
|
||||
uint32_t user_index, uint32_t flags, X_INPUT_CAPABILITIES& out_caps);
|
||||
virtual XRESULT GetState(
|
||||
virtual X_RESULT GetState(
|
||||
uint32_t user_index, X_INPUT_STATE& out_state);
|
||||
virtual XRESULT SetState(
|
||||
virtual X_RESULT SetState(
|
||||
uint32_t user_index, X_INPUT_VIBRATION& vibration);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -48,7 +48,7 @@ SHIM_CALL XamInputGetCapabilities_shim(
|
|||
InputSystem* input_system = state->emulator()->input_system();
|
||||
|
||||
X_INPUT_CAPABILITIES caps;
|
||||
XRESULT result = input_system->GetCapabilities(user_index, flags, caps);
|
||||
X_RESULT result = input_system->GetCapabilities(user_index, flags, caps);
|
||||
if (XSUCCEEDED(result)) {
|
||||
caps.Write(SHIM_MEM_BASE, caps_ptr);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ SHIM_CALL XamInputGetState_shim(
|
|||
InputSystem* input_system = state->emulator()->input_system();
|
||||
|
||||
X_INPUT_STATE input_state;
|
||||
XRESULT result = input_system->GetState(user_index, input_state);
|
||||
X_RESULT result = input_system->GetState(user_index, input_state);
|
||||
if (XSUCCEEDED(result)) {
|
||||
input_state.Write(SHIM_MEM_BASE, state_ptr);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ SHIM_CALL XamInputSetState_shim(
|
|||
InputSystem* input_system = state->emulator()->input_system();
|
||||
|
||||
X_INPUT_VIBRATION vibration(SHIM_MEM_BASE, vibration_ptr);
|
||||
XRESULT result = input_system->SetState(user_index, vibration);
|
||||
X_RESULT result = input_system->SetState(user_index, vibration);
|
||||
SHIM_SET_RETURN(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ typedef uint32_t X_STATUS;
|
|||
|
||||
// HRESULT (ERROR_*)
|
||||
// Adding as needed.
|
||||
typedef uint32_t XRESULT;
|
||||
typedef uint32_t X_RESULT;
|
||||
#define X_ERROR_SUCCESS ((uint32_t)0x00000000L)
|
||||
#define X_ERROR_ACCESS_DENIED ((uint32_t)0x80070005L)
|
||||
#define X_ERROR_BAD_ARGUMENTS ((uint32_t)0x800700A0L)
|
||||
|
|
Loading…
Reference in New Issue