mirror of
				https://git.suyu.dev/suyu/suyu.git
				synced 2025-11-04 12:34:39 +08:00 
			
		
		
		
	Minor cleanup
This commit is contained in:
		
							parent
							
								
									6ee8eab670
								
							
						
					
					
						commit
						797564599f
					
				@ -138,7 +138,7 @@ Client::Client() {
 | 
				
			|||||||
                           Settings::values.udp_input_port, pad, 24872);
 | 
					                           Settings::values.udp_input_port, pad, 24872);
 | 
				
			||||||
        // Set motion parameters
 | 
					        // Set motion parameters
 | 
				
			||||||
        // SetGyroThreshold value should be dependent on GyroscopeZeroDriftMode
 | 
					        // SetGyroThreshold value should be dependent on GyroscopeZeroDriftMode
 | 
				
			||||||
        // Real HW values are unkown, 0.0001 is an aproximate to Standard
 | 
					        // Real HW values are unknown, 0.0001 is an approximate to Standard
 | 
				
			||||||
        clients[client].motion.SetGyroThreshold(0.0001f);
 | 
					        clients[client].motion.SetGyroThreshold(0.0001f);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -153,8 +153,7 @@ std::vector<Common::ParamPackage> Client::GetInputDevices() const {
 | 
				
			|||||||
        if (!DeviceConnected(client)) {
 | 
					        if (!DeviceConnected(client)) {
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        std::string name = fmt::format("UDP Controller{} {} {}", clients[client].active,
 | 
					        std::string name = fmt::format("UDP Controller {}", client);
 | 
				
			||||||
                                       clients[client].active == 1, client);
 | 
					 | 
				
			||||||
        devices.emplace_back(Common::ParamPackage{
 | 
					        devices.emplace_back(Common::ParamPackage{
 | 
				
			||||||
            {"class", "cemuhookudp"},
 | 
					            {"class", "cemuhookudp"},
 | 
				
			||||||
            {"display", std::move(name)},
 | 
					            {"display", std::move(name)},
 | 
				
			||||||
@ -215,7 +214,7 @@ void Client::OnPadData(Response::PadData data) {
 | 
				
			|||||||
    Common::Vec3f raw_gyroscope = {data.gyro.pitch, data.gyro.roll, -data.gyro.yaw};
 | 
					    Common::Vec3f raw_gyroscope = {data.gyro.pitch, data.gyro.roll, -data.gyro.yaw};
 | 
				
			||||||
    clients[client].motion.SetAcceleration({data.accel.x, -data.accel.z, data.accel.y});
 | 
					    clients[client].motion.SetAcceleration({data.accel.x, -data.accel.z, data.accel.y});
 | 
				
			||||||
    // Gyroscope values are not it the correct scale from better joy.
 | 
					    // Gyroscope values are not it the correct scale from better joy.
 | 
				
			||||||
    // By dividing by 312 allow us to make one full turn = 1 turn
 | 
					    // Dividing by 312 allows us to make one full turn = 1 turn
 | 
				
			||||||
    // This must be a configurable valued called sensitivity
 | 
					    // This must be a configurable valued called sensitivity
 | 
				
			||||||
    clients[client].motion.SetGyroscope(raw_gyroscope / 312.0f);
 | 
					    clients[client].motion.SetGyroscope(raw_gyroscope / 312.0f);
 | 
				
			||||||
    clients[client].motion.UpdateRotation(time_difference);
 | 
					    clients[client].motion.UpdateRotation(time_difference);
 | 
				
			||||||
@ -275,7 +274,6 @@ void Client::Reset() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void Client::UpdateYuzuSettings(std::size_t client, const Common::Vec3<float>& acc,
 | 
					void Client::UpdateYuzuSettings(std::size_t client, const Common::Vec3<float>& acc,
 | 
				
			||||||
                                const Common::Vec3<float>& gyro, bool touch) {
 | 
					                                const Common::Vec3<float>& gyro, bool touch) {
 | 
				
			||||||
    if (configuring) {
 | 
					 | 
				
			||||||
    UDPPadStatus pad;
 | 
					    UDPPadStatus pad;
 | 
				
			||||||
    if (touch) {
 | 
					    if (touch) {
 | 
				
			||||||
        pad.touch = PadTouch::Click;
 | 
					        pad.touch = PadTouch::Click;
 | 
				
			||||||
@ -293,7 +291,6 @@ void Client::UpdateYuzuSettings(std::size_t client, const Common::Vec3<float>& a
 | 
				
			|||||||
            pad_queue[client].Push(pad);
 | 
					            pad_queue[client].Push(pad);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Client::BeginConfiguration() {
 | 
					void Client::BeginConfiguration() {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user