Skip to content

Commit

Permalink
fix: 🐛 build issues in 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
JaydenMaalouf committed Dec 18, 2024
1 parent 903bd7e commit 22e8d08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions Source/JoystickPlugin/Private/JoystickInputDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions Source/JoystickPlugin/Private/JoystickSubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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
{
Expand Down Expand Up @@ -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<int>(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());
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 22e8d08

Please sign in to comment.