Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build errors in UE 4.27 #660

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- Fix build errors in UE 4.27 ([#660](https://github.com/getsentry/sentry-unreal/pull/660))

### Dependencies

- Bump Cocoa SDK (iOS) from v8.37.0 to v8.38.0 ([#659](https://github.com/getsentry/sentry-unreal/pull/659))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Misc/FileHelper.h"
#include "Engine/GameViewportClient.h"
#include "Framework/Application/SlateApplication.h"
#include "Runtime/Launch/Resources/Version.h"

bool SentryScreenshotUtils::CaptureScreenshot(const FString& ScreenshotSavePath)
{
Expand Down Expand Up @@ -47,10 +48,16 @@ bool SentryScreenshotUtils::CaptureScreenshot(const FString& ScreenshotSavePath)
return false;
}

#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1
GetHighResScreenshotConfig().MergeMaskIntoAlpha(Bitmap, FIntRect());

TArray64<uint8> CompressedBitmap;
FImageUtils::PNGCompressImageArray(ViewportSize.X, ViewportSize.Y, Bitmap, CompressedBitmap);
#else
GetHighResScreenshotConfig().MergeMaskIntoAlpha(Bitmap);
TArray<uint8> CompressedBitmap;
FImageUtils::CompressImageArray(ViewportSize.X, ViewportSize.Y, Bitmap, CompressedBitmap);
#endif

FFileHelper::SaveArrayToFile(CompressedBitmap, *ScreenshotSavePath);

UE_LOG(LogSentrySdk, Log, TEXT("Screenshot saved to: %s"), *ScreenshotSavePath);
Expand Down
5 changes: 5 additions & 0 deletions plugin-dev/Source/Sentry/Public/SentryOutputDeviceError.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#pragma once

#include "Runtime/Launch/Resources/Version.h"
#include "Misc/OutputDeviceError.h"
#include "Delegates/Delegate.h"

Expand All @@ -15,7 +16,11 @@ class FSentryOutputDeviceError : public FOutputDeviceError

FOutputDeviceError* GetParentDevice();

#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 3
TMulticastDelegate<void(const FString&), FDefaultTSDelegateUserPolicy> OnAssert;
#else
TMulticastDelegate<void(const FString&)> OnAssert;
#endif

private:
FOutputDeviceError* ParentDevice;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,16 @@ TSharedRef<SWidget> FSentrySettingsCustomization::MakeLinuxBinariesStatusRow(FNa

FString CommandLine = FString::Printf(TEXT("BuildPlugin -Plugin=\"%s/Sentry.uplugin\" -Package=\"%s\" -CreateSubFolder -TargetPlatforms=Linux"), *PluginPath, *TempLinuxBinariesPath);

IUATHelperModule::Get().CreateUatTask(CommandLine, FText::FromString("Windows"), FText::FromString("Compiling Sentry for Linux"), FText::FromString("Compile Sentry Linux"),
FAppStyle::GetBrush(TEXT("MainFrame.CookContent")), nullptr, [this, TempLinuxBinariesPath](FString result, double X)
IUATHelperModule::Get().CreateUatTask(CommandLine, FText::FromString("Windows"),
FText::FromString("Compiling Sentry for Linux"),
FText::FromString("Compile Sentry Linux"),
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1
FAppStyle::GetBrush(TEXT("MainFrame.CookContent")),
nullptr,
#else
FEditorStyle::GetBrush(TEXT("MainFrame.CookContent")),
#endif
[this, TempLinuxBinariesPath](FString result, double X)
{
if (result.Equals(TEXT("Completed")))
{
Expand Down
Loading