Skip to content

Commit 3308e81

Browse files
author
Roberto De Ioris
committed
ported to 4.16
1 parent 3ae8c1c commit 3308e81

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

Source/UnrealEnginePython/Private/Slate/UEPyFGeometry.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ static PyObject *py_ue_fgeometry_get_local_size(ue_PyFGeometry *self, PyObject *
1010

1111
static PyObject *py_ue_fgeometry_get_absolute_position(ue_PyFGeometry *self, PyObject * args)
1212
{
13+
#if ENGINE_MINOR_VERSION < 17
14+
FVector2D size = self->geometry.AbsolutePosition;
15+
#else
1316
FVector2D size = self->geometry.GetAbsolutePosition();
17+
#endif
1418
return Py_BuildValue("(ff)", size.X, size.Y);
1519
}
1620

Source/UnrealEnginePython/Private/UObject/UEPyCapture.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ struct FInEditorCapture : TSharedFromThis<FInEditorCapture>
120120
PlayInEditorSettings->GameGetsMouseControl = false;
121121
PlayInEditorSettings->ShowMouseControlLabel = false;
122122
PlayInEditorSettings->ViewportGetsHMDControl = false;
123+
#if ENGINE_MINOR_VERSION >= 17
123124
PlayInEditorSettings->ShouldMinimizeEditorOnVRPIE = true;
125+
#endif
124126
PlayInEditorSettings->EnableGameSound = false;
125127
PlayInEditorSettings->bOnlyLoadVisibleLevelsInPIE = false;
126128
PlayInEditorSettings->bPreferToStreamLevelsInPIE = false;

Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,9 @@ PyObject *py_ue_from_bytes(ue_PyUObject * self, PyObject * args)
18691869

18701870
ue_py_check(self);
18711871

1872-
TArray<uint8> Bytes((const uint8 *)py_buf.buf, py_buf.len);
1872+
TArray<uint8> Bytes;
1873+
Bytes.AddUninitialized(py_buf.len);
1874+
FMemory::Memcpy(Bytes.GetData(), py_buf.buf, py_buf.len);
18731875

18741876
FObjectReader(self->ue_object, Bytes);
18751877

Source/UnrealEnginePython/Public/PythonHouseKeeper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ class FUnrealEnginePythonHouseKeeper
6666
{
6767
Singleton = new FUnrealEnginePythonHouseKeeper();
6868
// register a new delegate for the GC
69+
#if ENGINE_MINOR_VERSION >= 18
6970
FCoreUObjectDelegates::GetPostGarbageCollect().AddRaw(Singleton, &FUnrealEnginePythonHouseKeeper::RunGCDelegate);
71+
#else
72+
FCoreUObjectDelegates::PostGarbageCollect.AddRaw(Singleton, &FUnrealEnginePythonHouseKeeper::RunGCDelegate);
73+
#endif
7074
}
7175
return Singleton;
7276
}

0 commit comments

Comments
 (0)