mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-02 11:03:34 -06:00
use motion controls for move
This commit is contained in:
parent
d229ab4d8b
commit
97e2367db4
@ -86,8 +86,12 @@ s32 PS4_SYSV_ABI sceMoveReadStateLatest(s32 handle, OrbisMoveData* data) {
|
||||
m->ReadState(&s, &connected, &connected_count);
|
||||
data->button_data.trigger_data = u16(s.axes[std::to_underlying(Input::Axis::TriggerRight)]);
|
||||
data->button_data.button_data = std::to_underlying(PadToMoveOffset(s.buttonsState));
|
||||
data->accelerometer[1] = m->accel_buf[1];
|
||||
data->accelerometer[2] = m->accel_buf[2];
|
||||
data->accelerometer[0] = s.acceleration.x;
|
||||
data->accelerometer[1] = s.acceleration.y;
|
||||
data->accelerometer[2] = s.acceleration.z;
|
||||
data->gyro[0] = s.angularVelocity.x;
|
||||
data->gyro[1] = s.angularVelocity.y;
|
||||
data->gyro[2] = s.angularVelocity.z;
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ static Uint32 SDLCALL PollController(void* userdata, SDL_TimerID timer_id, Uint3
|
||||
controller->UpdateAxisSmoothing();
|
||||
controller->Gyro(0);
|
||||
controller->Acceleration(0);
|
||||
return 4;
|
||||
return interval;
|
||||
}
|
||||
|
||||
WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameControllers* controllers_,
|
||||
@ -285,6 +285,7 @@ void WindowSDL::WaitEvent() {
|
||||
void WindowSDL::InitTimers() {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
SDL_AddTimer(4, &PollController, controllers[i]);
|
||||
SDL_AddTimer(13, &PollController, controllers.moves(i));
|
||||
}
|
||||
SDL_AddTimer(33, Input::MousePolling, (void*)controllers[0]);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user