mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
clang
This commit is contained in:
parent
f4653d40cf
commit
32edcd4301
@ -447,18 +447,18 @@ int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) {
|
||||
|
||||
// Only do this on handle 1 for now
|
||||
if (engine && handle == 1) {
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
float deltaTime =
|
||||
std::chrono::duration_cast<std::chrono::microseconds>(now - controller->GetLastUpdate())
|
||||
.count() /
|
||||
1000000.0f;
|
||||
controller->SetLastUpdate(now);
|
||||
Libraries::Pad::OrbisFQuaternion lastOrientation = controller->GetLastOrientation();
|
||||
Libraries::Pad::OrbisFQuaternion outputOrientation = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
.count() /
|
||||
1000000.0f;
|
||||
controller->SetLastUpdate(now);
|
||||
Libraries::Pad::OrbisFQuaternion lastOrientation = controller->GetLastOrientation();
|
||||
Libraries::Pad::OrbisFQuaternion outputOrientation = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
GameController::CalculateOrientation(pData->acceleration, pData->angularVelocity, deltaTime,
|
||||
lastOrientation, outputOrientation);
|
||||
pData->orientation = outputOrientation;
|
||||
controller->SetLastOrientation(outputOrientation);
|
||||
pData->orientation = outputOrientation;
|
||||
controller->SetLastOrientation(outputOrientation);
|
||||
}
|
||||
pData->touchData.touchNum =
|
||||
(state.touchpad[0].state ? 1 : 0) + (state.touchpad[1].state ? 1 : 0);
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "common/types.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/types.h"
|
||||
#include "input/controller.h"
|
||||
#include "input_mouse.h"
|
||||
|
||||
@ -20,7 +20,7 @@ MouseMode mouse_mode = MouseMode::Off;
|
||||
// Switches mouse to a set mode or turns mouse emulation off if it was already in that mode.
|
||||
// Returns whether the mode is turned on.
|
||||
bool ToggleMouseModeTo(MouseMode m) {
|
||||
if(mouse_mode == m) {
|
||||
if (mouse_mode == m) {
|
||||
mouse_mode = MouseMode::Off;
|
||||
} else {
|
||||
mouse_mode = m;
|
||||
@ -85,8 +85,7 @@ void EmulateGyro(GameController* controller, u32 interval) {
|
||||
|
||||
Uint32 MousePolling(void* param, Uint32 id, Uint32 interval) {
|
||||
auto* controller = (GameController*)param;
|
||||
switch (mouse_mode)
|
||||
{
|
||||
switch (mouse_mode) {
|
||||
case MouseMode::Joystick:
|
||||
EmulateJoystick(controller, interval);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user