diff --git a/Source/JoystickPlugin/Private/JoystickInputDevice.cpp b/Source/JoystickPlugin/Private/JoystickInputDevice.cpp index d391b9f..bf20aa4 100644 --- a/Source/JoystickPlugin/Private/JoystickInputDevice.cpp +++ b/Source/JoystickPlugin/Private/JoystickInputDevice.cpp @@ -106,7 +106,7 @@ void FJoystickInputDevice::InitialiseAxis(const FJoystickInstanceId& InstanceId, if (!EKeys::GetKeyDetails(AxisKey).IsValid()) { EKeys::AddKey(AxisKeyDetails); - FJoystickLogManager::Get()->LogDebug(TEXT("Added Axis %s (%s) %d"), *AxisKeyName, *AxisDisplayName, InstanceId); + FJoystickLogManager::Get()->LogDebug(TEXT("Added Axis %s (%s) %d"), *AxisKeyName, *AxisDisplayName, &InstanceId); } const FKey& MappedKey = AxisKeyDetails.GetKey(); @@ -138,7 +138,7 @@ void FJoystickInputDevice::InitialiseButtons(const FJoystickInstanceId& Instance if (!EKeys::GetKeyDetails(ButtonKey).IsValid()) { EKeys::AddKey(ButtonKeyDetails); - FJoystickLogManager::Get()->LogDebug(TEXT("Added Button %s (%s) %d"), *ButtonKeyName, *ButtonDisplayName, InstanceId); + FJoystickLogManager::Get()->LogDebug(TEXT("Added Button %s (%s) %d"), *ButtonKeyName, *ButtonDisplayName, &InstanceId); } const FKey& MappedKey = ButtonKeyDetails.GetKey(); @@ -179,7 +179,7 @@ void FJoystickInputDevice::InitialiseHats(const FJoystickInstanceId& InstanceId, if (!EKeys::GetKeyDetails(HatKey).IsValid()) { EKeys::AddKey(HatKeyDetails); - FJoystickLogManager::Get()->LogDebug(TEXT("Added Hat %s (%s) %d"), *HatKeyName, *HatDisplayName, InstanceId); + FJoystickLogManager::Get()->LogDebug(TEXT("Added Hat %s (%s) %d"), *HatKeyName, *HatDisplayName, &InstanceId); } const FKey& MappedKey = HatKeyDetails.GetKey(); @@ -219,7 +219,7 @@ void FJoystickInputDevice::InitialiseBalls(const FJoystickInstanceId& InstanceId if (!EKeys::GetKeyDetails(BallKey).IsValid()) { EKeys::AddKey(BallKeyDetails); - FJoystickLogManager::Get()->LogDebug(TEXT("Added Ball %s (%s) %d"), *BallKeyName, *BallDisplayName, InstanceId); + FJoystickLogManager::Get()->LogDebug(TEXT("Added Ball %s (%s) %d"), *BallKeyName, *BallDisplayName, &InstanceId); } const FKey& MappedKey = BallKeyDetails.GetKey(); @@ -290,7 +290,7 @@ void FJoystickInputDevice::JoystickPluggedIn(const FDeviceInfoSDL& Device) UpdateAxisProperties(); - FJoystickLogManager::Get()->LogInformation(TEXT("Device Ready: %s (%d) - Instance Id: %d"), *Device.DeviceName, Device.InternalDeviceIndex, Device.InstanceId); + FJoystickLogManager::Get()->LogInformation(TEXT("Device Ready: %s (%d) - Instance Id: %d"), *Device.DeviceName, Device.InternalDeviceIndex, &Device.InstanceId); } void FJoystickInputDevice::JoystickUnplugged(const FJoystickInstanceId& InstanceId) const @@ -320,7 +320,7 @@ void FJoystickInputDevice::JoystickButton(const FJoystickInstanceId& InstanceId, FButtonData& State = DeviceData.Buttons[Button]; State.Update(Pressed); - FJoystickLogManager::Get()->LogDebug(TEXT("Event JoystickButton Device=%d Button=%d State=%d"), InstanceId, Button, Pressed); + FJoystickLogManager::Get()->LogDebug(TEXT("Event JoystickButton Device=%d Button=%d State=%d"), &InstanceId, Button, Pressed); } void FJoystickInputDevice::JoystickAxis(const FJoystickInstanceId& InstanceId, const int Axis, const float Value) diff --git a/Source/JoystickPlugin/Private/JoystickSubsystem.cpp b/Source/JoystickPlugin/Private/JoystickSubsystem.cpp index 9233c94..e469d51 100644 --- a/Source/JoystickPlugin/Private/JoystickSubsystem.cpp +++ b/Source/JoystickPlugin/Private/JoystickSubsystem.cpp @@ -427,7 +427,7 @@ bool UJoystickSubsystem::AddDevice(const int DeviceIndex) if (Device.SDLJoystick == nullptr) { const FString ErrorMessage = FString(SDL_GetError()); - FJoystickLogManager::Get()->LogError(TEXT("Joystick %d Open Error: %s"), Device.InstanceId, *ErrorMessage); + FJoystickLogManager::Get()->LogError(TEXT("Joystick %d Open Error: %s"), &Device.InstanceId, *ErrorMessage); return false; } @@ -437,7 +437,7 @@ bool UJoystickSubsystem::AddDevice(const int DeviceIndex) if (Device.SDLGameController == nullptr) { const FString ErrorMessage = FString(SDL_GetError()); - FJoystickLogManager::Get()->LogError(TEXT("Game Controller %d Open Error: %s"), Device.InstanceId, *ErrorMessage); + FJoystickLogManager::Get()->LogError(TEXT("Game Controller %d Open Error: %s"), &Device.InstanceId, *ErrorMessage); } else { @@ -466,7 +466,7 @@ bool UJoystickSubsystem::AddDevice(const int DeviceIndex) } FJoystickLogManager::Get()->LogDebug(TEXT("%s:"), *Device.DeviceName); - FJoystickLogManager::Get()->LogDebug(TEXT("\tInstance Id: %d"), static_cast(Device.InstanceId)); + FJoystickLogManager::Get()->LogDebug(TEXT("\tInstance Id: %d"), &Device.InstanceId); FJoystickLogManager::Get()->LogDebug(TEXT("\tSDL Device Index: %d"), DeviceIndex); FJoystickLogManager::Get()->LogDebug(TEXT("\tProduct: %d"), Device.ProductId); FJoystickLogManager::Get()->LogDebug(TEXT("\tProduct Id: %s"), *Device.ProductGuid.ToString()); @@ -552,25 +552,25 @@ bool UJoystickSubsystem::RemoveDevice(const FJoystickInstanceId& InstanceId) if (DeviceInfo->SDLHaptic != nullptr) { - FJoystickLogManager::Get()->LogDebug(TEXT("Closing Haptic for Device %d"), InstanceId); + FJoystickLogManager::Get()->LogDebug(TEXT("Closing Haptic for Device %d"), &InstanceId); SDL_HapticClose(DeviceInfo->SDLHaptic); DeviceInfo->SDLHaptic = nullptr; } if (DeviceInfo->SDLJoystick != nullptr) { - FJoystickLogManager::Get()->LogDebug(TEXT("Closing Joystick for Device %d"), InstanceId); + FJoystickLogManager::Get()->LogDebug(TEXT("Closing Joystick for Device %d"), &InstanceId); SDL_JoystickClose(DeviceInfo->SDLJoystick); DeviceInfo->SDLJoystick = nullptr; } if (DeviceInfo->SDLGameController != nullptr) { - FJoystickLogManager::Get()->LogDebug(TEXT("Closing Game Controller for Device %d"), InstanceId); + FJoystickLogManager::Get()->LogDebug(TEXT("Closing Game Controller for Device %d"), &InstanceId); SDL_GameControllerClose(DeviceInfo->SDLGameController); DeviceInfo->SDLGameController = nullptr; } DeviceInfo->Connected = false; - FJoystickLogManager::Get()->LogInformation(TEXT("Device Removed %d"), InstanceId); + FJoystickLogManager::Get()->LogInformation(TEXT("Device Removed %d"), &InstanceId); return true; }