Skip to content

Commit 7f7f797

Browse files
committed
added support for 4.25
1 parent c9eb2e5 commit 7f7f797

File tree

4 files changed

+173
-44
lines changed

4 files changed

+173
-44
lines changed

Source/LuaMachine/Private/LuaBlueprintFunctionLibrary.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,11 @@ UTexture2D* ULuaBlueprintFunctionLibrary::LuaValueToTransientTexture(int32 Width
356356
UE_LOG(LogLuaMachine, Error, TEXT("Unable to parse image data"));
357357
return nullptr;
358358
}
359+
#if ENGINE_MINOR_VERSION >= 25
360+
TArray<uint8> UncompressedBytes;
361+
#else
359362
const TArray<uint8>* UncompressedBytes = nullptr;
363+
#endif
360364
if (!ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBytes))
361365
{
362366
UE_LOG(LogLuaMachine, Error, TEXT("Unable to get raw image data"));
@@ -365,7 +369,11 @@ UTexture2D* ULuaBlueprintFunctionLibrary::LuaValueToTransientTexture(int32 Width
365369
PixelFormat = EPixelFormat::PF_B8G8R8A8;
366370
Width = ImageWrapper->GetWidth();
367371
Height = ImageWrapper->GetHeight();
372+
#if ENGINE_MINOR_VERSION >= 25
373+
Bytes = UncompressedBytes;
374+
#else
368375
Bytes = *UncompressedBytes;
376+
#endif
369377
}
370378

371379
UTexture2D* Texture = UTexture2D::CreateTransient(Width, Height, PixelFormat);
@@ -599,8 +607,11 @@ void ULuaBlueprintFunctionLibrary::LuaTableFillObject(FLuaValue InTable, UObject
599607
{
600608
FLuaValue Key = L->ToLuaValue(-2);
601609
FLuaValue Value = L->ToLuaValue(-1);
602-
610+
#if ENGINE_MINOR_VERSION >= 25
611+
FProperty* Property = Class->FindPropertyByName(*Key.ToString());
612+
#else
603613
UProperty* Property = Class->FindPropertyByName(*Key.ToString());
614+
#endif
604615
if (Property)
605616
{
606617
bool bSuccess = false;

0 commit comments

Comments
 (0)