From d2b22ba84068c5c463769f5d0a43b2ea76745ec7 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Wed, 7 Sep 2022 06:42:25 +0200 Subject: [PATCH] Fix UTF-8 incompatible characters --- src/audio/XAudio27API.cpp | 7 +++++-- src/audio/XAudio2API.cpp | 7 +++++-- src/input/motion/MotionSample.h | 28 ++++++++++++---------------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/audio/XAudio27API.cpp b/src/audio/XAudio27API.cpp index 4a99bfa2..eaeb8ad3 100644 --- a/src/audio/XAudio27API.cpp +++ b/src/audio/XAudio27API.cpp @@ -34,8 +34,11 @@ XAudio27API::XAudio27API(uint32 device_id, uint32 samplerate, uint32 channels, u m_wfx.Format.nChannels = channels; m_wfx.Format.nSamplesPerSec = samplerate; m_wfx.Format.wBitsPerSample = bits_per_sample; - m_wfx.Format.nBlockAlign = (m_wfx.Format.nChannels * m_wfx.Format.wBitsPerSample) / 8; // must equal (nChannels × wBitsPerSample) / 8 - m_wfx.Format.nAvgBytesPerSec = m_wfx.Format.nSamplesPerSec * m_wfx.Format.nBlockAlign; // must equal nSamplesPerSec × nBlockAlign. + m_wfx.Format.nBlockAlign = (m_wfx.Format.nChannels * m_wfx.Format.wBitsPerSample) / + 8; // must equal (nChannels * wBitsPerSample) / 8 + m_wfx.Format.nAvgBytesPerSec = + m_wfx.Format.nSamplesPerSec * + m_wfx.Format.nBlockAlign; // must equal nSamplesPerSec * nBlockAlign. m_wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); m_wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; diff --git a/src/audio/XAudio2API.cpp b/src/audio/XAudio2API.cpp index 795a0ebe..bdd70abe 100644 --- a/src/audio/XAudio2API.cpp +++ b/src/audio/XAudio2API.cpp @@ -50,8 +50,11 @@ XAudio2API::XAudio2API(std::wstring device_id, uint32 samplerate, uint32 channel m_wfx.Format.nChannels = channels; m_wfx.Format.nSamplesPerSec = samplerate; m_wfx.Format.wBitsPerSample = bits_per_sample; - m_wfx.Format.nBlockAlign = (m_wfx.Format.nChannels * m_wfx.Format.wBitsPerSample) / 8; // must equal (nChannels × wBitsPerSample) / 8 - m_wfx.Format.nAvgBytesPerSec = m_wfx.Format.nSamplesPerSec * m_wfx.Format.nBlockAlign; // must equal nSamplesPerSec × nBlockAlign. + m_wfx.Format.nBlockAlign = (m_wfx.Format.nChannels * m_wfx.Format.wBitsPerSample) / + 8; // must equal (nChannels * wBitsPerSample) / 8 + m_wfx.Format.nAvgBytesPerSec = + m_wfx.Format.nSamplesPerSec * + m_wfx.Format.nBlockAlign; // must equal nSamplesPerSec * nBlockAlign. m_wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); m_wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; diff --git a/src/input/motion/MotionSample.h b/src/input/motion/MotionSample.h index f4015afb..7aa5bc13 100644 --- a/src/input/motion/MotionSample.h +++ b/src/input/motion/MotionSample.h @@ -260,48 +260,44 @@ DRC flat on table, screen facing up. Top pointing away (away from person, pointi 0.03 0.99 -0.13 0.01 0.13 0.99 -Turned 45° to the right: +Turned 45° to the right: 0.71 -0.03 0.71 0.12 0.99 -0.08 -0.70 0.14 0.70 -Turned 45° to the right (top of GamePad pointing right now): +Turned 45° to the right (top of GamePad pointing right now): 0.08 -0.03 1.00 -> Z points towards person 0.15 0.99 0.01 -0.99 0.15 0.09 -> DRC Z-Axis now points towards X-minus -Turned 90° to the right (top of gamepad now pointing towards holder, away from monitor): +Turned 90° to the right (top of gamepad now pointing towards holder, away from monitor): -1.00 -0.01 0.06 0.00 0.99 0.15 -0.06 0.15 -0.99 -Turned 90° to the right (pointing left): +Turned 90° to the right (pointing left): -0.17 -0.01 -0.99 -0.13 0.99 0.02 0.98 0.13 -0.17 -After another 90° we end up in the initial position: +After another 90° we end up in the initial position: 0.99 -0.03 -0.11 0.01 0.99 -0.13 0.12 0.12 0.99 ------ -From initial position, lean the GamePad on its left side. 45° up. So the screen is pointing to the top left - 0.66 -0.75 -0.03 - 0.74 0.66 -0.11 - 0.10 0.05 0.99 +From initial position, lean the GamePad on its left side. 45° up. So the screen is pointing to the +top left 0.66 -0.75 -0.03 0.74 0.66 -0.11 0.10 0.05 0.99 -Further 45°, GamePad now on its left, screen pointing left: +Further 45°, GamePad now on its left, screen pointing left: -0.03 -1.00 -0.00 0.99 -0.03 -0.15 0.15 -0.01 0.99 -From initial position, lean the GamePad on its right side. 45° up. So the screen is pointing to the top right - 0.75 0.65 -0.11 --0.65 0.76 0.07 - 0.12 0.02 0.99 +From initial position, lean the GamePad on its right side. 45° up. So the screen is pointing to the +top right 0.75 0.65 -0.11 -0.65 0.76 0.07 0.12 0.02 0.99 -From initial position, tilt the GamePad up 90° (bottom side remains in touch with surface): +From initial position, tilt the GamePad up 90° (bottom side remains in touch with surface): 0.99 -0.05 -0.10 -0.10 0.01 -0.99 0.05 1.00 0.01 @@ -311,7 +307,7 @@ From initial position, stand the GamePad on its top side: 0.09 -0.01 1.00 -0.01 -1.00 -0.01 -Rotate GamePad 180° around x axis, so it now lies on its screen (top of GamePad pointing to holder): +Rotate GamePad 180° around x axis, so it now lies on its screen (top of GamePad pointing to holder): 0.99 -0.03 -0.15 -0.04 -1.00 -0.08 -0.15 0.09 -0.99