From fcbf1f881e7a27d0051f05e6eb358c19f1854b66 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 12 Jul 2023 11:16:33 -0700 Subject: [PATCH] Latest public/internal sync. --- .efrocachemap | 88 +++++++-------- CHANGELOG.md | 6 +- src/assets/ba_data/python/baenv.py | 4 +- src/ballistica/core/core.cc | 100 +++++++++--------- src/ballistica/core/core.h | 3 +- src/ballistica/core/python/core_python.cc | 2 +- src/ballistica/core/support/core_config.cc | 6 ++ src/ballistica/core/support/core_config.h | 3 + .../scene_v1/support/scene_v1_app_mode.cc | 3 +- src/ballistica/shared/ballistica.cc | 4 +- 10 files changed, 116 insertions(+), 103 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index b48e339d..a60f082c 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4068,50 +4068,50 @@ "build/assets/windows/Win32/ucrtbased.dll": "https://files.ballistica.net/cache/ba1/2d/ef/5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/b0/8a/55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/86/5b/2af4d1e26a1a8073c89acb06e599", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/1d/0f/70a89ae3502347d236e378b96478", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/95/1c/66da52726fded0d10fceaac6bdfb", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/7b/45/1ff4d4db9287f0bfb42b7985a50d", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b5/d0/7f72be8d8333e65bf6e1336ea337", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/3b/d7/15bbf535dad9ab0919cbdfabc060", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/47/a9/402b59ac65251689f294fbd58279", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/42/77/80bde1040987656495825cb3a88a", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/43/33/060081505fc18876aeab4cd4f80e", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/6f/2f/2ca892a9d9329fa6a2f1f2f19616", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/7f/5b/c23e5960ba2f2fede0bd2ab550ce", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/91/95/5d004ab02d197d9c21e171c03757", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a7/3e/f18397067b466d4444710235b925", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/1d/1f/85e0365f349cc8c290fa16066c52", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/9b/d7/6356440b07526010df042aab1b71", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/da/0f/7cf9fb220f15928e650a1bfaf6a0", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/0c/e6/463117d06d455a1af122f56c49ba", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/bd/4f/4906878dd86169d1adf6a285c706", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/e0/9e/a183475d559473a9c09d826be487", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/97/c2/9fdbefefc7e9eea8400c09cffec0", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/ec/04/773b6ac1941c2efd3fc9aa36f08a", - "build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/69/6c/da91eefb50528ce9bfbdc058a40e", - "build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/29/ea/f0379258c5ed179ccb3ac26a8efb", - "build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/69/6c/da91eefb50528ce9bfbdc058a40e", - "build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/29/ea/f0379258c5ed179ccb3ac26a8efb", - "build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a5/e2/c4d222bf67a79595a057f270f59e", - "build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f7/a6/00e23403bf63888378746fa917b4", - "build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a5/e2/c4d222bf67a79595a057f270f59e", - "build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f7/a6/00e23403bf63888378746fa917b4", - "build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/6f/f5/fc698e25298568f0a604c2781116", - "build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/2d/07/4ea1598affd99542fd23066f8bb2", - "build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/6f/f5/fc698e25298568f0a604c2781116", - "build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/2d/07/4ea1598affd99542fd23066f8bb2", - "build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/9f/cf/6bd3295b6410ab60098095e60016", - "build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/30/1b/7a4da727c2f949d79aa0cbe9db4a", - "build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/29/04/fd9f3d6188c40d787cfb8ea6179f", - "build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/30/1b/7a4da727c2f949d79aa0cbe9db4a", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/1b/49/76d9f72d6ea7e687ec66d1046607", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/66/95/543f2d0d4cdd2318c06c1b5440d8", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/a6/d1/7dff5844f3411876f5bd3c1da597", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/25/78/36ab7acadece48db6fb87934ad7e", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/72/b3/5b9836fd4954c9aba8ae52459ee2", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/a2/3d/1a259518360dfac8c0b1d6c5e96c", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/96/0e/65e69416d3bc6ae5e22beef49154", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/ad/9d/bdd2d65375d381ccba6f5ec10cc6", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/b9/b3/2fa4ee60a830770b0fdfd27d0662", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/58/5d/aafcd4e057f4048e0ab4b097b614", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/49/96/45734d046f665c33cf041c5e0751", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/49/e3/e76596a602fec3be164171b678f8", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/24/6c/b0e065c2d5ee684ef782e940c815", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/af/ef/f3c900b2b76b3483ba67feab931f", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/65/9b/b420fd2a80e6293340e93bace338", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a5/47/434af2120591774986a41e84bc1d", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/08/48/6c1af81372a988542ff82704eb95", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/7a/d1/cf9ef6bdf9d7c0fd99deedb54170", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a6/30/1279e53155667db8b5c9a2bbf7d0", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/4c/a5/6a2334a97a6c48dc04403e29274e", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/9f/60/6159ef28401646f9e654c29e0673", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/09/cb/4eeb647b2bb083ab7056a1231bd7", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/08/dd/37874122d5d465c62deac533b648", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/6e/fd/00e796c943776ae69971931d249b", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/9a/e4/2fea9c0d36d3b7238eda94783b6f", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/fc/31/d7c0f7629642530d41c4d209ecef", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/98/41/f5401e303ed81ad91d7f4022e572", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/4f/3e/a371bc2c1946057f5053342643e0", + "build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/84/aa/534f35b6499762739646ea173382", + "build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/25/2f/3bd787d6debb2c4073fd6c2e8098", + "build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/84/aa/534f35b6499762739646ea173382", + "build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/25/2f/3bd787d6debb2c4073fd6c2e8098", + "build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b8/01/153180116f1ab302aa8e6fd9ca9c", + "build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/93/1c/1aba110dcf69d8651b428f2927ed", + "build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b8/01/153180116f1ab302aa8e6fd9ca9c", + "build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/93/1c/1aba110dcf69d8651b428f2927ed", + "build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4b/1a/21983185f7bdd78842b572535dad", + "build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/3c/1d/d7864d7822c64ee06cee0dde659e", + "build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4b/1a/21983185f7bdd78842b572535dad", + "build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/3c/1d/d7864d7822c64ee06cee0dde659e", + "build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/65/ab/524fe2f6a339b6480173c2c1624a", + "build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/47/61/eca0961c54b2eae2cf65fac7848d", + "build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/06/5c/90c3a49e16a004e2db71909af919", + "build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/47/61/eca0961c54b2eae2cf65fac7848d", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/72/70/aab14b866e1c3562421a757abfeb", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/0a/df/c8bb059be642ad2a905ef2da6679", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/1d/47/3441b90233f32aca5657acc410f7", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/3d/54/f255fe1f8eced421101a4ae392bf", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/34/5d/f1544e97b2677c9ef3aef62e569e", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/9b/f7/e821d0e43e2f7a34980b6556e69d", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/07/af/60dfd76561968bee5a00d2530ba4", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/65/e9/338ef36cbefafd0f718bb42417d1", "src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/f8/85/fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/f8/cd/3af311ac63147882590123b78318", "src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/3e/7a/203e2a5d2b5bb42cfe3fd2fe16c2", diff --git a/CHANGELOG.md b/CHANGELOG.md index a5c365f2..7fe3663a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ -### 1.7.23 (build 21164, api 8, 2023-07-11) +### 1.7.23 (build 21165, api 8, 2023-07-11) - Network security improvements. -### 1.7.22 (build 21162, api 8, 2023-07-11) +### 1.7.22 (build 21165, api 8, 2023-07-11) - Fixed a very rare race condition when launching threads or sending synchronous cross-thread messages. This was manifesting as one out of several thousand @@ -14,7 +14,7 @@ see any graphics wonkiness with this update. - Added SoK's explodinary icon to the game's custom text drawing because SoK is awesome. -- (build 21161) Fixed an issue on Android that could lead to crashes if device +- (build 21165) Fixed an issue on Android that could lead to crashes if device events occurred very early at launch (button presses, joystick movement, etc.) ### 1.7.21 (build 21152, api 8, 2023-06-27) diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index d7d6ffab..afdec83a 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -28,8 +28,8 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21164 -TARGET_BALLISTICA_VERSION = '1.7.23' +TARGET_BALLISTICA_BUILD = 21165 +TARGET_BALLISTICA_VERSION = '1.7.22' _g_env_config: EnvConfig | None = None g_paths_set_failed = False # pylint: disable=invalid-name diff --git a/src/ballistica/core/core.cc b/src/ballistica/core/core.cc index 39d8cb5c..c2d38850 100644 --- a/src/ballistica/core/core.cc +++ b/src/ballistica/core/core.cc @@ -64,9 +64,58 @@ CoreFeatureSet::CoreFeatureSet(CoreConfig config) } void CoreFeatureSet::PostInit() { - // Some of this stuff accesses g_core so we need to run it *after* - // assigning our singleton. + // Some of this stuff might access g_core so we run most of our init + // *after* assigning our singleton to be safe. + RunSanityChecks(); + + build_src_dir_ = CalcBuildSrcDir(); + + // Note: this checks g_core->main_thread_id which is why it must run in + // PostInit and not our constructor. + main_event_loop_ = new EventLoop(EventLoopID::kMain, ThreadSource::kWrapMain); + + // On monolithic builds we need to bring up Python itself. + if (g_buildconfig.monolithic_build()) { + python->InitPython(); + } + + // Make sure we're running an acceptable Python version/etc. + python->VerifyPythonEnvironment(); + + // Grab whatever Python stuff we use. + python->ImportPythonObjs(); + + // Normally we wait until later to start pushing logs through to Python + // (so that our log handling system is fully bootstrapped), but + // technically we can push our log calls out to Python any time now since + // we grabbed the logging calls above. Do so immediately here if asked. + if (!g_core->core_config().hold_early_logs) { + python->EnablePythonLoggingCalls(); + } + + // FIXME: MOVE THIS TO A RUN_APP_TO_COMPLETION() SORT OF PLACE. + // For now it does the right thing here since all we have is monolithic + // builds but this will need to account for more situations later. + python->ReleaseMainThreadGIL(); +} + +auto CoreFeatureSet::CalcBuildSrcDir() -> std::string { + // Let's grab a string of the portion of __FILE__ before our project root. + // We can use it to make error messages/etc. more pretty by stripping out + // all but sub-project paths. + const char* f = __FILE__; + auto* f_end = strstr(f, "src" BA_DIRSLASH "ballistica" BA_DIRSLASH + "core" BA_DIRSLASH "core.cc"); + if (!f_end) { + Log(LogLevel::kWarning, "Unable to calc build source dir from __FILE__."); + return ""; + } else { + return std::string(f).substr(0, f_end - f); + } +} + +void CoreFeatureSet::RunSanityChecks() { // Test our static-type-name functionality. This code runs at compile time // and extracts human readable type names using __PRETTY_FUNCTION__ type // functionality. However, it is dependent on specific compiler output and @@ -109,56 +158,9 @@ void CoreFeatureSet::PostInit() { + static_type_name(true) + "'"); } - // Enable extra timing logs via env var. - // FIXME: Kill this or move it to CoreConfig. - const char* debug_timing_env = getenv("BA_DEBUG_TIMING"); - if (debug_timing_env != nullptr && !strcmp(debug_timing_env, "1")) { - debug_timing = true; - } - if (vr_mode && !g_buildconfig.vr_build()) { FatalError("vr_mode enabled in core-config but we are not a vr build."); } - - // Let's grab a string of the portion of __FILE__ before our project root. - // We can use it to make error messages/etc. more pretty by stripping out - // all but sub-project paths. - const char* f = __FILE__; - auto* f_end = strstr(f, "src" BA_DIRSLASH "ballistica" BA_DIRSLASH - "core" BA_DIRSLASH "core.cc"); - if (!f_end) { - Log(LogLevel::kWarning, "Unable to calc build source dir from __FILE__."); - } else { - build_src_dir_ = std::string(f).substr(0, f_end - f); - } - - // Note: this checks g_core->main_thread_id which is why it must run in - // PostInit and not our constructor. - main_event_loop_ = new EventLoop(EventLoopID::kMain, ThreadSource::kWrapMain); - - // On monolithic builds we need to bring up Python itself. - if (g_buildconfig.monolithic_build()) { - python->InitPython(); - } - - // Make sure we're running an acceptable Python version/etc. - python->VerifyPythonEnvironment(); - - // Grab whatever Python stuff we use. - python->ImportPythonObjs(); - - // Normally we wait until babase is imported to push early logs through to - // Python (so that our log handling system is fully bootstrapped), but - // technically we can push our log calls out to Python any time now since - // we grabbed the logging calls above. Do so immediately here if asked. - if (!g_core->core_config().hold_early_logs) { - python->EnablePythonLoggingCalls(); - } - - // FIXME: MOVE THIS TO A RUN_APP_TO_COMPLETION() SORT OF PLACE. - // For now it does the right thing here since all we have is monolithic - // builds but this will need to account for more situations later. - python->ReleaseMainThreadGIL(); } auto CoreFeatureSet::SoftImportBase() -> BaseSoftInterface* { diff --git a/src/ballistica/core/core.h b/src/ballistica/core/core.h index 5e727163..bedfdb6d 100644 --- a/src/ballistica/core/core.h +++ b/src/ballistica/core/core.h @@ -130,7 +130,6 @@ class CoreFeatureSet { bool reset_vr_orientation{}; bool user_ran_commands{}; int return_value{}; - bool debug_timing{}; std::thread::id main_thread_id{}; bool vr_mode; @@ -144,6 +143,8 @@ class CoreFeatureSet { #endif private: + static auto CalcBuildSrcDir() -> std::string; + void RunSanityChecks(); static void DoImport(const CoreConfig& config); void UpdateAppTime(); explicit CoreFeatureSet(CoreConfig config); diff --git a/src/ballistica/core/python/core_python.cc b/src/ballistica/core/python/core_python.cc index 1e022af9..a92ca1c7 100644 --- a/src/ballistica/core/python/core_python.cc +++ b/src/ballistica/core/python/core_python.cc @@ -317,7 +317,7 @@ void CorePython::LoggingCall(LogLevel loglevel, const std::string& msg) { void CorePython::AcquireGIL() { assert(g_base_soft && g_base_soft->InLogicThread()); - auto debug_timing{g_core->debug_timing}; + auto debug_timing{g_core->core_config().debug_timing}; millisecs_t startms{debug_timing ? CorePlatform::GetCurrentMillisecs() : 0}; if (logic_thread_state_) { diff --git a/src/ballistica/core/support/core_config.cc b/src/ballistica/core/support/core_config.cc index a870499e..62373cb9 100644 --- a/src/ballistica/core/support/core_config.cc +++ b/src/ballistica/core/support/core_config.cc @@ -13,6 +13,7 @@ namespace ballistica::core { // Kicks out of arg processing and tells the app to return an error code. class BadArgsException : public ::std::exception {}; +/// Look for a special case such as --help. static auto IsSingleArgSpecialCase(int argc, char** argv, const char* arg_long, const char* arg_short = nullptr) -> bool { // See if the args exists *anywhere*. @@ -90,6 +91,11 @@ auto CoreConfig::FromCommandLineAndEnv(int argc, char** argv) -> CoreConfig { cfg.debugger_attached = true; } } + if (auto* envval = getenv("BA_DEBUG_TIMING")) { + if (!strcmp(envval, "1")) { + cfg.debug_timing = true; + } + } // REMOVE ME FOR 1.7.20 FINAL. if (explicit_bool(false)) { diff --git a/src/ballistica/core/support/core_config.h b/src/ballistica/core/support/core_config.h index 34566f3d..27e73e65 100644 --- a/src/ballistica/core/support/core_config.h +++ b/src/ballistica/core/support/core_config.h @@ -54,6 +54,9 @@ class CoreConfig { /// Let the engine know there's a debugger attached so it should do things /// like abort() instead of exiting with error codes. bool debugger_attached{}; + + /// Enables some extra timing logs/prints. + bool debug_timing{}; }; } // namespace ballistica::core diff --git a/src/ballistica/scene_v1/support/scene_v1_app_mode.cc b/src/ballistica/scene_v1/support/scene_v1_app_mode.cc index e241eb02..8871c393 100644 --- a/src/ballistica/scene_v1/support/scene_v1_app_mode.cc +++ b/src/ballistica/scene_v1/support/scene_v1_app_mode.cc @@ -501,7 +501,8 @@ void SceneV1AppMode::StepDisplayTime() { in_update_ = false; // Report excessively long updates. - if (g_core->debug_timing && app_time >= next_long_update_report_time_) { + if (g_core->core_config().debug_timing + && app_time >= next_long_update_report_time_) { auto duration{core::CorePlatform::GetCurrentMillisecs() - startms}; // Complain when our full update takes longer than 1/60th second. diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index f9c9ecd6..3bed55a3 100644 --- a/src/ballistica/shared/ballistica.cc +++ b/src/ballistica/shared/ballistica.cc @@ -39,8 +39,8 @@ auto main(int argc, char** argv) -> int { namespace ballistica { // These are set automatically via script; don't modify them here. -const int kEngineBuildNumber = 21164; -const char* kEngineVersion = "1.7.23"; +const int kEngineBuildNumber = 21165; +const char* kEngineVersion = "1.7.22"; auto MonolithicMain(const core::CoreConfig& core_config) -> int { // This code is meant to be run standalone so won't inherit any