This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
/
UnrealEngine.patch
207 lines (194 loc) · 7.78 KB
/
UnrealEngine.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
diff --git a/Engine/Plugins/ScriptPlugin/ScriptPlugin.uplugin b/Engine/Plugins/ScriptPlugin/ScriptPlugin.uplugin
index 13729f1..9fe6c28 100644
--- a/Engine/Plugins/ScriptPlugin/ScriptPlugin.uplugin
+++ b/Engine/Plugins/ScriptPlugin/ScriptPlugin.uplugin
@@ -10,10 +10,10 @@
"DocsURL" : "",
"MarketplaceURL" : "",
"SupportURL" : "",
- "EnabledByDefault" : false,
+ "EnabledByDefault" : true,
"CanContainContent" : false,
"IsBetaVersion" : false,
- "Installed" : false,
+ "Installed" : true,
"CanBeUsedWithUnrealHeaderTool" : true,
"Modules" :
@@ -26,20 +26,12 @@
{
"Name" : "ScriptPlugin",
"Type" : "Runtime",
- "LoadingPhase" : "PreDefault",
- "BlacklistPlatforms" :
- [
- "Linux"
- ]
+ "LoadingPhase" : "PreDefault"
},
{
"Name" : "ScriptEditorPlugin",
"Type" : "Editor",
- "LoadingPhase" : "Default",
- "BlacklistPlatforms" :
- [
- "Linux"
- ]
+ "LoadingPhase" : "Default"
}
]
-}
\ No newline at end of file
+}
diff --git a/Engine/Plugins/ScriptPlugin/Source/ScriptGeneratorPlugin/Private/ScriptGeneratorPlugin.cpp b/Engine/Plugins/ScriptPlugin/Source/ScriptGeneratorPlugin/Private/ScriptGeneratorPlugin.cpp
index aa41365..aad84a3 100644
--- a/Engine/Plugins/ScriptPlugin/Source/ScriptGeneratorPlugin/Private/ScriptGeneratorPlugin.cpp
+++ b/Engine/Plugins/ScriptPlugin/Source/ScriptGeneratorPlugin/Private/ScriptGeneratorPlugin.cpp
@@ -97,6 +97,7 @@ void FScriptGeneratorPlugin::FinishExport()
bool FScriptGeneratorPlugin::SupportsTarget(const FString& TargetName) const
{
+#if 0
// We only support the target if it explicitly enables the required script plugin in its uproject file
bool bSupportsTarget = false;
if (FPaths::IsProjectFilePathSet())
@@ -116,5 +117,7 @@ bool FScriptGeneratorPlugin::SupportsTarget(const FString& TargetName) const
}
}
}
- return bSupportsTarget;
+#else
+ return true;
+#endif
}
\ No newline at end of file
diff --git a/Engine/Plugins/ScriptPlugin/Source/ScriptGeneratorPlugin/ScriptGeneratorPlugin.Build.cs b/Engine/Plugins/ScriptPlugin/Source/ScriptGeneratorPlugin/ScriptGeneratorPlugin.Build.cs
index a907246..d25f310 100644
--- a/Engine/Plugins/ScriptPlugin/Source/ScriptGeneratorPlugin/ScriptGeneratorPlugin.Build.cs
+++ b/Engine/Plugins/ScriptPlugin/Source/ScriptGeneratorPlugin/ScriptGeneratorPlugin.Build.cs
@@ -46,20 +46,7 @@ namespace UnrealBuildTool.Rules
}
);
- // This checks only for UHT target platform, not the target platform of the game we're building so it's important
- // to make sure Lua is compiled for all supported platforms
- var LuaLibDirectory = Path.Combine("..", "Plugins", "ScriptPlugin", "Source", "Lua", "Lib", Target.Platform.ToString(), "Release");
- var LuaLibPath = Path.Combine(LuaLibDirectory, "Lua.lib");
- if (File.Exists(LuaLibPath))
- {
- Log.TraceVerbose("ScriptGenerator LUA Integration enabled");
- Definitions.Add("WITH_LUA=1");
- }
- else
- {
- Log.TraceVerbose("ScriptGenerator LUA Integration NOT enabled");
- }
-
+ Definitions.Add("WITH_LUA=1");
Definitions.Add("HACK_HEADER_GENERATOR=1");
}
}
diff --git a/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/LuaIntegration.cpp b/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/LuaIntegration.cpp
index 6ce7beb..d26a00a 100644
--- a/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/LuaIntegration.cpp
+++ b/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/LuaIntegration.cpp
@@ -612,7 +612,8 @@ bool FLuaContext::Initialize(const FString& Code, UObject* Owner)
bool bResult = false;
LuaState = LuaNewState();
luaL_openlibs(LuaState);
- LuaRegisterExportedClasses(LuaState);
+ // FIXME: get ScriptGeneratorPlugin to work :(
+ // LuaRegisterExportedClasses(LuaState);
LuaRegisterUnrealUtilities(LuaState);
if (luaL_loadstring(LuaState, TCHAR_TO_ANSI(*Code)) == 0)
diff --git a/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/LuaIntegration.h b/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/LuaIntegration.h
index ac7a50e..a183b52 100644
--- a/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/LuaIntegration.h
+++ b/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/Private/LuaIntegration.h
@@ -13,6 +13,7 @@ extern "C"
class FLuaContext : public FScriptContextBase
{
+protected:
bool bHasTick;
bool bHasDestroy;
bool bHasBeginPlay;
diff --git a/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/ScriptPlugin.Build.cs b/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/ScriptPlugin.Build.cs
index 4d27de3..887dc1e 100644
--- a/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/ScriptPlugin.Build.cs
+++ b/Engine/Plugins/ScriptPlugin/Source/ScriptPlugin/ScriptPlugin.Build.cs
@@ -10,7 +10,7 @@ namespace UnrealBuildTool.Rules
{
PublicIncludePaths.AddRange(
new string[] {
- //"Programs/UnrealHeaderTool/Public",
+ //"Programs/UnrealHeaderTool/Public"
// ... add other public include paths required here ...
}
);
@@ -45,7 +45,6 @@ namespace UnrealBuildTool.Rules
}
-
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
@@ -53,27 +52,21 @@ namespace UnrealBuildTool.Rules
}
);
- var LuaPath = Path.Combine("..", "Plugins", "ScriptPlugin", "Source", "Lua");
- var LuaLibDirectory = Path.Combine(LuaPath, "Lib", Target.Platform.ToString(), "Release");
- var LuaLibPath = Path.Combine(LuaLibDirectory, "Lua.lib");
- if (File.Exists(LuaLibPath))
- {
- Definitions.Add("WITH_LUA=1");
+ var LuaPath = Path.GetFullPath(Path.Combine("..", "Plugins", "ScriptPlugin", "Source", "Lua"));
+ var LuaInstallDirectory = Path.Combine(LuaPath, "install");
+ var LuaLibDirectory = Path.Combine(LuaInstallDirectory, "lib");
+ var LuaLibPath = Path.Combine(LuaLibDirectory, "liblua.so");
+ Definitions.Add("WITH_LUA=1");
- // Path to Lua include files
- var IncludePath = Path.GetFullPath(Path.Combine(LuaPath, "Include"));
- PrivateIncludePaths.Add(IncludePath);
+ // Path to Lua include files
+ var IncludePath = Path.GetFullPath(Path.Combine(LuaInstallDirectory, "include"));
+ PrivateIncludePaths.Add(IncludePath);
- // Lib file
- PublicLibraryPaths.Add(LuaLibDirectory);
- PublicAdditionalLibraries.Add(LuaLibPath);
+ // Lib file
+ PublicLibraryPaths.Add(LuaLibDirectory);
+ PublicAdditionalLibraries.Add(LuaLibPath);
- Log.TraceVerbose("LUA Integration enabled: {0}", IncludePath);
- }
- else
- {
- Log.TraceVerbose("LUA Integration NOT enabled");
- }
+ Log.TraceVerbose("LUA Integration enabled: {0}", IncludePath);
}
}
-}
\ No newline at end of file
+}
diff --git a/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformProcess.cpp b/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformProcess.cpp
index a8d7a32..122ce3b 100644
--- a/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformProcess.cpp
+++ b/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformProcess.cpp
@@ -26,14 +26,15 @@ void* FLinuxPlatformProcess::GetDllHandle( const TCHAR* Filename )
FString AbsolutePath = FPaths::ConvertRelativePathToFull(Filename);
int DlOpenMode = RTLD_LAZY;
- if (AbsolutePath.EndsWith(TEXT("libsteam_api.so")))
- {
- DlOpenMode |= RTLD_GLOBAL; //Global symbol resolution when loading shared objects - Needed for Steam to work when its library is loaded by a plugin
- }
- else
- {
- DlOpenMode |= RTLD_LOCAL; //Local symbol resolution when loading shared objects - Needed for Hot-Reload
- }
+ // if (AbsolutePath.EndsWith(TEXT("libsteam_api.so")))
+ // {
+ // DlOpenMode |= RTLD_GLOBAL; //Global symbol resolution when loading shared objects - Needed for Steam to work when its library is loaded by a plugin
+ // }
+ // else
+ // {
+ // DlOpenMode |= RTLD_LOCAL; //Local symbol resolution when loading shared objects - Needed for Hot-Reload
+ // }
+ DlOpenMode |= RTLD_GLOBAL;
void *Handle = dlopen( TCHAR_TO_UTF8(*AbsolutePath), DlOpenMode );
if (!Handle)