From 84baf0b7114c380203d695eb66e4bfc3a68ab092 Mon Sep 17 00:00:00 2001 From: getnamo Date: Sun, 13 Dec 2020 23:14:11 -0800 Subject: [PATCH] Cleaner construction and missing RHI command fix --- Source/Blu/Private/BluBluprintFunctionLibrary.cpp | 3 +-- Source/Blu/Private/BluEye.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Blu/Private/BluBluprintFunctionLibrary.cpp b/Source/Blu/Private/BluBluprintFunctionLibrary.cpp index b19c682..a358af0 100644 --- a/Source/Blu/Private/BluBluprintFunctionLibrary.cpp +++ b/Source/Blu/Private/BluBluprintFunctionLibrary.cpp @@ -12,8 +12,7 @@ UBluEye* UBluBlueprintFunctionLibrary::NewBluEye(UObject* WorldContextObject) { UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); - FStaticConstructObjectParameters Params(UBluEye::StaticClass()); - UBluEye* Eye = Cast(StaticConstructObject_Internal(Params)); + UBluEye* Eye = NewObject(WorldContextObject); return Eye; diff --git a/Source/Blu/Private/BluEye.cpp b/Source/Blu/Private/BluEye.cpp index 081fb5c..2adcd0f 100644 --- a/Source/Blu/Private/BluEye.cpp +++ b/Source/Blu/Private/BluEye.cpp @@ -175,7 +175,7 @@ void UBluEye::TextureUpdate(const void *buffer, FUpdateTextureRegion2D *updateRe { for (uint32 RegionIndex = 0; RegionIndex < RegionData->NumRegions; RegionIndex++) { - (RegionData->Texture2DResource->TextureRHI->GetTexture2D(), 0, RegionData->Regions[RegionIndex], RegionData->SrcPitch, RegionData->SrcData.GetData() + RHIUpdateTexture2D(RegionData->Texture2DResource->TextureRHI->GetTexture2D(), 0, RegionData->Regions[RegionIndex], RegionData->SrcPitch, RegionData->SrcData.GetData() + RegionData->Regions[RegionIndex].SrcY * RegionData->SrcPitch + RegionData->Regions[RegionIndex].SrcX * RegionData->SrcBpp); }