|
@@ -1,58 +1,60 @@
|
|
|
diff --git a/methods.py b/methods.py
|
|
|
-index fe84641e9d0625b4f0c4d90a65839337d6120ff8..51ef8550d3a9def0a2ff88a2fde4fa096c085de9 100644
|
|
|
+index 7ede259..4e0b2e6 100644
|
|
|
--- a/methods.py
|
|
|
+++ b/methods.py
|
|
|
-@@ -734,6 +734,7 @@ def generate_vs_project(env, num_jobs):
|
|
|
+@@ -809,6 +809,7 @@ def generate_vs_project(env, num_jobs):
|
|
|
+ "platform=windows",
|
|
|
f"target={configuration_getter}",
|
|
|
"progress=no",
|
|
|
- "tools=!tools!",
|
|
|
+ "livepp=%s" % env["livepp"],
|
|
|
"-j%s" % num_jobs,
|
|
|
]
|
|
|
|
|
|
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
|
|
|
-index 0b18fb74fb145e4d2e88ee91abe99f8f39312a46..04880a8fa8209c4002b49f964d86227974ce9ca8 100644
|
|
|
+index 1b55574..8bc0fb1 100644
|
|
|
--- a/platform/windows/detect.py
|
|
|
+++ b/platform/windows/detect.py
|
|
|
-@@ -44,7 +44,7 @@ def can_build():
|
|
|
+@@ -164,7 +164,7 @@ def detect_build_env_arch():
|
|
|
|
|
|
|
|
|
def get_opts():
|
|
|
- from SCons.Variables import BoolVariable, EnumVariable
|
|
|
+ from SCons.Variables import BoolVariable, EnumVariable, PathVariable
|
|
|
|
|
|
- mingw32 = ""
|
|
|
- mingw64 = ""
|
|
|
-@@ -73,6 +73,7 @@ def get_opts():
|
|
|
- BoolVariable("use_thinlto", "Use ThinLTO", False),
|
|
|
+ mingw = os.getenv("MINGW_PREFIX", "")
|
|
|
+
|
|
|
+@@ -189,6 +189,7 @@ def get_opts():
|
|
|
BoolVariable("use_static_cpp", "Link MinGW/MSVC C++ runtime libraries statically", True),
|
|
|
BoolVariable("use_asan", "Use address sanitizer (ASAN)", False),
|
|
|
+ BoolVariable("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False),
|
|
|
+ PathVariable("livepp", "Path to the Live++ installation", "", PathVariable.PathAccept),
|
|
|
]
|
|
|
|
|
|
|
|
|
-@@ -310,6 +311,19 @@ def configure_msvc(env, manual_msvc_config):
|
|
|
+@@ -458,6 +459,21 @@ def configure_msvc(env, vcvars_msvc_config):
|
|
|
|
|
|
env.AppendUnique(LINKFLAGS=["/STACK:" + str(STACK_SIZE)])
|
|
|
|
|
|
+ # Check if LIVEPP_PATH is set and add #define. Perform
|
|
|
+ # some sanity checks.
|
|
|
+ if env.get("livepp"):
|
|
|
-+ if env["target"] == "release_debug" or env["target"] == "debug":
|
|
|
-+ print("Found Live++ at %s" % env.get("livepp"))
|
|
|
-+ env.AppendUnique(CPPDEFINES=["LIVEPP_PATH=%s" % env.get("livepp")])
|
|
|
-+ env.AppendUnique(CPPPATH=[env.get("livepp")])
|
|
|
-+ env.AppendUnique(LINKFLAGS=["/FUNCTIONPADMIN"])
|
|
|
++ if env["target"] == "editor":
|
|
|
++ if os.path.exists(env.get("livepp")):
|
|
|
++ print("Found Live++ at %s" % env.get("livepp"))
|
|
|
++ env.AppendUnique(CPPDEFINES=["LIVEPP_PATH=%s" % env.get("livepp")])
|
|
|
++ env.AppendUnique(CPPPATH=[env.get("livepp")])
|
|
|
++ env.AppendUnique(LINKFLAGS=["/FUNCTIONPADMIN"])
|
|
|
++ else:
|
|
|
++ printf("Specified Live++ path does not exist")
|
|
|
+ else:
|
|
|
-+ print("Live++ can only be used with targets 'debug' and 'release_debug'")
|
|
|
++ print("Live++ can only be used with targets 'editor'")
|
|
|
+ else:
|
|
|
+ print("No Live++ specified.")
|
|
|
-+
|
|
|
|
|
|
def configure_mingw(env):
|
|
|
# Workaround for MinGW. See:
|
|
|
diff --git a/platform/windows/godot_windows.cpp b/platform/windows/godot_windows.cpp
|
|
|
-index 8de3ef294a99c6f02f6f1380e331e4bb598864ce..8e4c15dd66d1b640a352ed826b25b23917f72cc4 100644
|
|
|
+index a26d3ba..8b8e2a8 100644
|
|
|
--- a/platform/windows/godot_windows.cpp
|
|
|
+++ b/platform/windows/godot_windows.cpp
|
|
|
@@ -34,6 +34,11 @@
|
|
@@ -67,7 +69,7 @@ index 8de3ef294a99c6f02f6f1380e331e4bb598864ce..8e4c15dd66d1b640a352ed826b25b239
|
|
|
// For export templates, add a section; the exporter will patch it to enclose
|
|
|
// the data appended to the executable (bundled PCK)
|
|
|
#ifndef TOOLS_ENABLED
|
|
|
-@@ -147,6 +152,16 @@ char *wc_to_utf8(const wchar_t *wc) {
|
|
|
+@@ -149,6 +154,16 @@ char *wc_to_utf8(const wchar_t *wc) {
|
|
|
}
|
|
|
|
|
|
int widechar_main(int argc, wchar_t **argv) {
|
|
@@ -84,7 +86,7 @@ index 8de3ef294a99c6f02f6f1380e331e4bb598864ce..8e4c15dd66d1b640a352ed826b25b239
|
|
|
OS_Windows os(nullptr);
|
|
|
|
|
|
setlocale(LC_CTYPE, "");
|
|
|
-@@ -179,6 +194,11 @@ int widechar_main(int argc, wchar_t **argv) {
|
|
|
+@@ -185,6 +200,11 @@ int widechar_main(int argc, wchar_t **argv) {
|
|
|
}
|
|
|
delete[] argv_utf8;
|
|
|
|
|
@@ -97,12 +99,12 @@ index 8de3ef294a99c6f02f6f1380e331e4bb598864ce..8e4c15dd66d1b640a352ed826b25b239
|
|
|
}
|
|
|
|
|
|
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
|
|
|
-index 8755bc65dce7e4b88fd509d0cbdbec576356c5f5..50e0d8d0b06bf76d5f4d085d010cf6a683a9e64f 100644
|
|
|
+index 08299d9..362de3b 100644
|
|
|
--- a/platform/windows/os_windows.cpp
|
|
|
+++ b/platform/windows/os_windows.cpp
|
|
|
-@@ -53,6 +53,11 @@
|
|
|
- #include <regstr.h>
|
|
|
+@@ -55,6 +55,11 @@
|
|
|
#include <shlobj.h>
|
|
|
+ #include <wbemcli.h>
|
|
|
|
|
|
+#ifdef LIVEPP_PATH
|
|
|
+#include "API/LPP_API.h"
|
|
@@ -112,10 +114,11 @@ index 8755bc65dce7e4b88fd509d0cbdbec576356c5f5..50e0d8d0b06bf76d5f4d085d010cf6a6
|
|
|
extern "C" {
|
|
|
__declspec(dllexport) DWORD NvOptimusEnablement = 1;
|
|
|
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
|
|
-@@ -677,6 +682,9 @@ void OS_Windows::run() {
|
|
|
+@@ -1296,6 +1301,10 @@ void OS_Windows::run() {
|
|
|
if (Main::iteration()) {
|
|
|
break;
|
|
|
}
|
|
|
++
|
|
|
+#ifdef LIVEPP_PATH
|
|
|
+ lpp::lppSyncPoint(livePP);
|
|
|
+#endif
|