diff --git a/.efrocachemap b/.efrocachemap index b3c99a23..1a8ce3af 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4072,26 +4072,26 @@ "build/assets/workspace/ninjafightplug.py": "https://files.ballistica.net/cache/ba1/c5/09/4f10b8a21ba87aa5509cff7a164b", "build/assets/workspace/onslaughtplug.py": "https://files.ballistica.net/cache/ba1/ff/0a/a354984f9c074dab0676ac7e4877", "build/assets/workspace/runaroundplug.py": "https://files.ballistica.net/cache/ba1/2a/1c/9ee5db6d1bceca7fa6638fb8abde", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/55/6b/e121957fd82e859978fa3f4af422", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/31/72/7e8a9913cf35dee3c6fe58ca3b68", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/73/95/f4282112234f1ee6bf85b002f7a1", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a0/03/493c9adbc287bdf78e7805d4dadb", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/35/80/396064bdf00d3fac806deb8bcb98", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/dc/70/7bdbc05f71bd2b4baee0583c5c10", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3c/37/224b7f44e3b8a05246a93372707b", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/7a/2a/0ba6681061dc5b37ab8b22956866", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/0e/00/800c35d813cca3e2e3e63466c27e", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/75/30/2aa812a882602a68cd8964fb1342", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3a/df/1ab366d634b98658c1cc0777deab", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/06/cf/c55480c3becf6a6c2fb25fc4c7dd", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/9a/d7/ac988919c775fe9cbd94e8dcc4b8", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/f7/ba/833d780e8a18a259fbe718b6da39", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/6d/e2/2a90fc6f49aeb39c2faece177666", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/92/80/e65efc75286312b059e796dcdc3e", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/9a/ac/dbe17c7907ac15a338ef7cae89f8", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/06/2b/bb13f4dd9ff4671a5142f56d3c6b", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/0b/b6/db6ca3469a280a6ba15ae8e554c8", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/72/3a/5c2a8e5e3b0152de7141397a50cc", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/22/bb/d5dce7f90a2e2f87549b6a7eecaa", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/a2/96/c13dfed4e1d4be509fe72cf7c314", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/95/a3/bb1bf77e376a94b2131550db2dad", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a9/a6/c483cbf9e8b61038b2fe88c4c42a", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/9a/14/89284125966308f437b64f5084d7", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/69/1f/2d6454eddcb455c7d705f6393027", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e1/fa/bbbc8fef4e36f0f297c010010d82", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d3/0c/5b6a7b836748e0efe640527851ff", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/3a/a9/fabf92aae1ee3a9013a7bdd861f0", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/d4/4f/c6c6c60cd17a7c83a947126ae37d", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/83/0e/b2ff5bc9205c79645fbad2763ca4", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/c6/66/45ac0b0a0d22c3eb33a96144336b", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/31/15/e7bff599483e5bfbac3d78e7e7b5", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/e7/61/dd5fe09a41835aac73ba8f669184", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/be/17/2bc120813d6b2dc7e9381e680e88", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b8/9e/96eee674cbcfdad7d58953840b05", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/e8/27/8dfe45ee42fe20dd2b1fb3b48428", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/bb/86/9fca7226049258bd2576cc71a227", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/77/9a/96e5cadd06ba0d0247ce258a0c3d", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/6a/c9/0eebb41928d1ea8f7b4cb564b93d", "build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d4/6a/dd303a200b98a56ba3b100277057", "build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/fc/2c/2996c558fb408a548fdd37398c9a", "build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ed/28/b7a72be7ae1bd2b58dda4b6902a0", @@ -4108,20 +4108,20 @@ "build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/71/f6/691482915ad58ea1e953cc23d74c", "build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b8/2b/6ec8c78980a62e3e0ee4b36ece04", "build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4e/56/a95c987b2a371759896b037fea86", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/3a/61/2d09cedad6dd6ad3b754cb11dd82", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/a6/70/a1d5515282cd1ecbd9eced7914d2", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/ce/22/f66d8ff129799e94b46762d756ec", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/66/27/69c082147bb67cc08d5b9ac25a7d", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/e8/19/ad053e8755fbcfaa056d3682ebd7", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/1c/5b/677ae1098e3cd199d09fe8a8cd3e", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/a0/00/de0c7e8f73dd1d5f77d8cd8fd4de", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/1d/46/a0500598a1a66f898fea906420e8", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/fb/c1/c0b83862890aab10b24b3c39fcf7", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/9f/f8/b2c717e67ecf30e337ba7f8968aa", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/45/02/4e159c2a17f244afddb5eafbce1f", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/30/69/041ab1c77ccd5d7740046ece931a", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/d8/35/3c8a170d5a046e694d64b605d741", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/e7/0f/39d461f8f3832c1105711b965a8c", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/6c/b7/fa45a53f280f7fff6fbf4d9d7dcf", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/97/14/e30f320294f6363ecc0b7fcf2ff8", "src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa", "src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1", "src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/d5/4a/0e480a855ce83709bd7f6761107d", "src/ballistica/classic/mgen/pyembed/binding_classic.inc": "https://files.ballistica.net/cache/ba1/b2/fd/f5c362e9093b2d0721fb59fc0056", "src/ballistica/core/mgen/pyembed/binding_core.inc": "https://files.ballistica.net/cache/ba1/71/b8/c020cbb7f9a7ce3f347ccadd3df1", - "src/ballistica/core/mgen/pyembed/env.inc": "https://files.ballistica.net/cache/ba1/7c/74/9b014c32c937757bf3ed36a4f848", + "src/ballistica/core/mgen/pyembed/env.inc": "https://files.ballistica.net/cache/ba1/49/37/a092e0e385093479c14d47c86b27", "src/ballistica/core/mgen/python_modules_monolithic.h": "https://files.ballistica.net/cache/ba1/e4/87/ca448e63b14d8c292e2c32c35d5d", "src/ballistica/scene_v1/mgen/pyembed/binding_scene_v1.inc": "https://files.ballistica.net/cache/ba1/4d/d5/a6e9feabfdf60ac6d78ee7983427", "src/ballistica/template_fs/mgen/pyembed/binding_template_fs.inc": "https://files.ballistica.net/cache/ba1/fe/97/a8e045105bf910b8921daf3fad83", diff --git a/CHANGELOG.md b/CHANGELOG.md index 19d18ca6..597fe9c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.20 (build 21034, api 8, 2023-06-01) +### 1.7.20 (build 21035, api 8, 2023-06-01) - This seems like a good time for a `refactoring` release in anticipation of changes coming in 1.8. Basically this means that a lot of things will be diff --git a/Makefile b/Makefile index a7d2be13..e450bd02 100644 --- a/Makefile +++ b/Makefile @@ -591,6 +591,12 @@ build/prefab/lib/windows/Release_%/BallisticaKitHeadlessPlus.pdb: .efrocachemap spinoff-test-empty: tools/pcommand spinoff_test empty $(SPINOFF_TEST_EXTRA_ARGS) +spinoff-test-base: + tools/pcommand spinoff_test base $(SPINOFF_TEST_EXTRA_ARGS) + +spinoff-test-clean: + rm -rf build/spinofftest + # Grab the current parent project and sync it into ourself. spinoff-update: @tools/pcommand spinoff_check_submodule_parent diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 278773f0..5fb29ad2 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -30,7 +30,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21034 +TARGET_BALLISTICA_BUILD = 21035 TARGET_BALLISTICA_VERSION = '1.7.20' _g_env_config: EnvConfig | None = None @@ -217,18 +217,3 @@ def configure( os.environ['SSL_CERT_FILE'] = os.environ[ 'REQUESTS_CA_BUNDLE' ] = certifi.where() - - -def on_babase_import() -> None: - """Should be called just after _babase is imported. - - Sets up logging and issue warnings if anything in the running - _babase environment seems wonky. Many significant environment - modifications such as interrupt handling do not happen until - on_babase_start_app(). This allows bits of _babase to be used under - existing environments without messing things up too badly. - """ - - -def on_babase_start_app() -> None: - """Called when ballistica's babase module is spinning up an app.""" diff --git a/src/ballistica/base/app/app.cc b/src/ballistica/base/app/app.cc index c51f105c..835b0447 100644 --- a/src/ballistica/base/app/app.cc +++ b/src/ballistica/base/app/app.cc @@ -188,7 +188,9 @@ void App::OnAppResume() { // If we've been completely backgrounded, // send a menu-press command to the game; this will // bring up a pause menu if we're in the game/etc. - g_base->ui->PushMainMenuPressCall(nullptr); + if (!g_base->ui->MainMenuVisible()) { + g_base->ui->PushMainMenuPressCall(nullptr); + } } } diff --git a/src/ballistica/base/assets/texture_asset_preload_data.cc b/src/ballistica/base/assets/texture_asset_preload_data.cc index 85dcea00..5934ab62 100644 --- a/src/ballistica/base/assets/texture_asset_preload_data.cc +++ b/src/ballistica/base/assets/texture_asset_preload_data.cc @@ -6,8 +6,8 @@ #include #endif +#include "ballistica/base/assets/texture_asset.h" #include "ballistica/base/graphics/texture/ktx.h" -#include "ballistica/scene_v1/assets/scene_texture.h" namespace ballistica::base { diff --git a/src/ballistica/base/base.cc b/src/ballistica/base/base.cc index 1d47f6b1..ad400a9e 100644 --- a/src/ballistica/base/base.cc +++ b/src/ballistica/base/base.cc @@ -27,7 +27,6 @@ #include "ballistica/base/support/stdio_console.h" #include "ballistica/base/ui/console.h" #include "ballistica/base/ui/ui.h" -#include "ballistica/classic/classic.h" #include "ballistica/core/platform/core_platform.h" #include "ballistica/core/python/core_python.h" #include "ballistica/shared/foundation/event_loop.h" @@ -110,9 +109,6 @@ void BaseFeatureSet::OnModuleExec(PyObject* module) { g_base->python->ImportPythonObjs(); - // let baenv know it can now feed us logs and run some checks. - g_core->python->RunBaEnvOnBaBaseImport(); - // Run some sanity checks/etc. auto result = g_base->python->objs() .Get(BasePython::ObjID::kOnNativeModuleImportCall) diff --git a/src/ballistica/base/dynamics/bg/bg_dynamics.cc b/src/ballistica/base/dynamics/bg/bg_dynamics.cc index 86c6697f..5def66d4 100644 --- a/src/ballistica/base/dynamics/bg/bg_dynamics.cc +++ b/src/ballistica/base/dynamics/bg/bg_dynamics.cc @@ -2,6 +2,7 @@ #include "ballistica/base/dynamics/bg/bg_dynamics.h" +#include "ballistica/base/assets/collision_mesh_asset.h" #include "ballistica/base/dynamics/bg/bg_dynamics_draw_snapshot.h" #include "ballistica/base/dynamics/bg/bg_dynamics_fuse_data.h" #include "ballistica/base/dynamics/bg/bg_dynamics_shadow_data.h" @@ -9,7 +10,6 @@ #include "ballistica/base/graphics/component/object_component.h" #include "ballistica/base/graphics/component/smoke_component.h" #include "ballistica/base/graphics/component/sprite_component.h" -#include "ballistica/scene_v1/assets/scene_collision_mesh.h" #include "ballistica/shared/foundation/event_loop.h" namespace ballistica::base { diff --git a/src/ballistica/base/dynamics/bg/bg_dynamics_server.cc b/src/ballistica/base/dynamics/bg/bg_dynamics_server.cc index dccdc139..b2f88e50 100644 --- a/src/ballistica/base/dynamics/bg/bg_dynamics_server.cc +++ b/src/ballistica/base/dynamics/bg/bg_dynamics_server.cc @@ -2,6 +2,7 @@ #include "ballistica/base/dynamics/bg/bg_dynamics_server.h" +#include "ballistica/base/assets/collision_mesh_asset.h" #include "ballistica/base/dynamics/bg/bg_dynamics_draw_snapshot.h" #include "ballistica/base/dynamics/bg/bg_dynamics_fuse_data.h" #include "ballistica/base/dynamics/bg/bg_dynamics_height_cache.h" @@ -10,7 +11,6 @@ #include "ballistica/base/dynamics/collision_cache.h" #include "ballistica/base/graphics/graphics_server.h" #include "ballistica/base/logic/logic.h" -#include "ballistica/scene_v1/assets/scene_collision_mesh.h" #include "ballistica/shared/foundation/event_loop.h" #include "ballistica/shared/generic/utils.h" diff --git a/src/ballistica/base/graphics/component/render_component.cc b/src/ballistica/base/graphics/component/render_component.cc index f79a1811..c1e938a9 100644 --- a/src/ballistica/base/graphics/component/render_component.cc +++ b/src/ballistica/base/graphics/component/render_component.cc @@ -2,8 +2,6 @@ #include "ballistica/base/graphics/component/render_component.h" -#include "ballistica/scene_v1/dynamics/rigid_body.h" - namespace ballistica::base { void RenderComponent::ScissorPush(const Rect& rIn) { diff --git a/src/ballistica/base/graphics/graphics.cc b/src/ballistica/base/graphics/graphics.cc index 0e4af3ba..ccbda395 100644 --- a/src/ballistica/base/graphics/graphics.cc +++ b/src/ballistica/base/graphics/graphics.cc @@ -26,8 +26,6 @@ #include "ballistica/shared/foundation/event_loop.h" #include "ballistica/shared/generic/utils.h" #include "ballistica/shared/python/python.h" -#include "ballistica/ui_v1/support/root_ui.h" -#include "ballistica/ui_v1/widget/root_widget.h" namespace ballistica::base { diff --git a/src/ballistica/base/graphics/graphics.h b/src/ballistica/base/graphics/graphics.h index 31367ed2..3626f3e3 100644 --- a/src/ballistica/base/graphics/graphics.h +++ b/src/ballistica/base/graphics/graphics.h @@ -11,7 +11,6 @@ #include #include "ballistica/base/base.h" -#include "ballistica/scene_v1/scene_v1.h" #include "ballistica/shared/foundation/object.h" #include "ballistica/shared/math/matrix44f.h" #include "ballistica/shared/math/rect.h" diff --git a/src/ballistica/base/graphics/renderer/renderer.h b/src/ballistica/base/graphics/renderer/renderer.h index 85dce947..8a525496 100644 --- a/src/ballistica/base/graphics/renderer/renderer.h +++ b/src/ballistica/base/graphics/renderer/renderer.h @@ -37,7 +37,6 @@ #include "ballistica/base/graphics/support/frame_def.h" #include "ballistica/base/graphics/support/render_command_buffer.h" #include "ballistica/base/graphics/text/text_group.h" -#include "ballistica/scene_v1/assets/scene_texture.h" #include "ballistica/shared/foundation/object.h" #include "ballistica/shared/math/matrix44f.h" #include "ballistica/shared/math/vector3f.h" diff --git a/src/ballistica/base/graphics/support/render_command_buffer.h b/src/ballistica/base/graphics/support/render_command_buffer.h index ab4854a3..304725b0 100644 --- a/src/ballistica/base/graphics/support/render_command_buffer.h +++ b/src/ballistica/base/graphics/support/render_command_buffer.h @@ -5,10 +5,9 @@ #include +#include "ballistica/base/assets/texture_asset.h" #include "ballistica/base/graphics/mesh/mesh.h" #include "ballistica/base/graphics/support/frame_def.h" -#include "ballistica/scene_v1/assets/scene_mesh.h" -#include "ballistica/scene_v1/assets/scene_texture.h" #include "ballistica/shared/ballistica.h" #include "ballistica/shared/math/matrix44f.h" diff --git a/src/ballistica/base/input/device/joystick_input.cc b/src/ballistica/base/input/device/joystick_input.cc index 944334dc..cca5c4a0 100644 --- a/src/ballistica/base/input/device/joystick_input.cc +++ b/src/ballistica/base/input/device/joystick_input.cc @@ -759,10 +759,7 @@ void JoystickInput::HandleSDLEvent(const SDL_Event* e) { || e->jbutton.button == start_button_2_) { // If there's some UI up already, we just pass this along to it. // otherwise we request a main menu. - if (g_base && g_base->ui->screen_root_widget() - && g_base->ui->screen_root_widget()->HasChildren()) { - // Do nothing in this case. - } else { + if (!g_base->ui->MainMenuVisible()) { // If there's no menu up, // tell the game to pop it up and snag menu ownership for ourself. g_base->ui->PushMainMenuPressCall(this); @@ -770,7 +767,7 @@ void JoystickInput::HandleSDLEvent(const SDL_Event* e) { } } - // On our oculus build, select presses reset the orientation. + // On our Oculus build, select presses reset the orientation. if (e->jbutton.button == vr_reorient_button_ && g_core->IsVRMode()) { ScreenMessage(g_base->assets->GetResourceString("vrOrientationResetText"), {0, 1, 0}); diff --git a/src/ballistica/base/input/device/keyboard_input.cc b/src/ballistica/base/input/device/keyboard_input.cc index d74f3d49..062a68cb 100644 --- a/src/ballistica/base/input/device/keyboard_input.cc +++ b/src/ballistica/base/input/device/keyboard_input.cc @@ -3,9 +3,8 @@ #include "ballistica/base/input/device/keyboard_input.h" #include "ballistica/base/platform/base_platform.h" +#include "ballistica/base/support/classic_soft.h" #include "ballistica/base/ui/ui.h" -#include "ballistica/classic/python/classic_python.h" -#include "ballistica/ui_v1/widget/container_widget.h" namespace ballistica::base { @@ -136,9 +135,7 @@ auto KeyboardInput::HandleKey(const SDL_Keysym* keysym, bool repeat, bool down) } // Bring up menu if start is pressed. - if (keysym->sym == start_key_ && !repeat && g_base->ui - && g_base->ui->screen_root_widget() - && g_base->ui->screen_root_widget()->GetChildCount() == 0) { + if (keysym->sym == start_key_ && !repeat && !g_base->ui->MainMenuVisible()) { g_base->ui->PushMainMenuPressCall(this); return true; } diff --git a/src/ballistica/base/input/input.cc b/src/ballistica/base/input/input.cc index 1e1762d0..d27466a7 100644 --- a/src/ballistica/base/input/input.cc +++ b/src/ballistica/base/input/input.cc @@ -967,12 +967,8 @@ void Input::HandleKeyPress(const SDL_Keysym* keysym) { switch (keysym->sym) { // Menu button on android/etc. pops up the menu. case SDLK_MENU: { - if (g_base && g_base->ui->screen_root_widget()) { - // If there's no dialogs/windows up, ask for a menu (owned by the - // touch-screen if available). - if (g_base->ui->screen_root_widget()->GetChildCount() == 0) { - g_base->ui->PushMainMenuPressCall(touch_input_); - } + if (!g_base->ui->MainMenuVisible()) { + g_base->ui->PushMainMenuPressCall(touch_input_); } handled = true; break; @@ -1025,15 +1021,19 @@ void Input::HandleKeyPress(const SDL_Keysym* keysym) { && g_base->ui->root_widget() && g_base->ui->overlay_root_widget()) { // If there's no dialogs/windows up, ask for a menu owned by the // keyboard. - if (g_base->ui->screen_root_widget()->GetChildCount() == 0 - && g_base->ui->overlay_root_widget()->GetChildCount() == 0) { + if (!g_base->ui->MainMenuVisible()) { if (keyboard_input_) { g_base->ui->PushMainMenuPressCall(keyboard_input_); } } else { // Ok there's a UI up.. send along a cancel message. - g_base->ui->root_widget()->HandleMessage( - WidgetMessage(WidgetMessage::Type::kCancel)); + if (g_base->ui->overlay_root_widget()->HasChildren()) { + g_base->ui->overlay_root_widget()->HandleMessage( + WidgetMessage(WidgetMessage::Type::kCancel)); + } else if (g_base->ui->root_widget()->HasChildren()) { + g_base->ui->root_widget()->HandleMessage( + WidgetMessage(WidgetMessage::Type::kCancel)); + } } } handled = true; diff --git a/src/ballistica/base/python/base_python.cc b/src/ballistica/base/python/base_python.cc index e95c11a1..37b03b64 100644 --- a/src/ballistica/base/python/base_python.cc +++ b/src/ballistica/base/python/base_python.cc @@ -111,23 +111,11 @@ void BasePython::Reset() { } void BasePython::OnMainThreadStartApp() { - // Let the baenv Python module know we're starting the app. - // This allows it to make significant env modifications such as capturing - // interrupt signals or tweaking garbage collection that we may not want to - // do until we know we're actually running an app (and not just using bit of - // _babase functionality for some other purpose). auto gil{Python::ScopedInterpreterLock()}; - auto result = g_core->python->objs() - .Get(core::CorePython::ObjID::kBaEnvOnBaBaseStartAppCall) - .Call(); - if (!result.Exists()) { - FatalError("baenv.on_babase_start_app() failed."); - } - // Set up some env stuff (interrupt handlers, etc.) - result = g_base->python->objs() - .Get(BasePython::ObjID::kSetupEnvForAppRunCall) - .Call(); + auto result = g_base->python->objs() + .Get(BasePython::ObjID::kSetupEnvForAppRunCall) + .Call(); if (!result.Exists()) { FatalError("babase._env.setup_env_for_app_run() failed."); } diff --git a/src/ballistica/base/support/ui_v1_soft.h b/src/ballistica/base/support/ui_v1_soft.h index 1b3240c0..34eb0ccc 100644 --- a/src/ballistica/base/support/ui_v1_soft.h +++ b/src/ballistica/base/support/ui_v1_soft.h @@ -20,6 +20,7 @@ class UIV1SoftInterface { virtual void DoShowURL(const std::string& url) = 0; virtual void DoQuitWindow() = 0; virtual auto NewRootUI() -> ui_v1::RootUI* = 0; + virtual auto MainMenuVisible() -> bool = 0; }; } // namespace ballistica::base diff --git a/src/ballistica/base/ui/console.cc b/src/ballistica/base/ui/console.cc index d204085a..45b2ddcb 100644 --- a/src/ballistica/base/ui/console.cc +++ b/src/ballistica/base/ui/console.cc @@ -8,6 +8,7 @@ #include "ballistica/base/graphics/text/text_graphics.h" #include "ballistica/base/input/input.h" #include "ballistica/base/logic/logic.h" +#include "ballistica/base/support/context.h" #include "ballistica/core/core.h" #include "ballistica/core/platform/support/min_sdl.h" #include "ballistica/shared/foundation/event_loop.h" diff --git a/src/ballistica/base/ui/ui.cc b/src/ballistica/base/ui/ui.cc index 7ab7bd1d..d0cd6bc8 100644 --- a/src/ballistica/base/ui/ui.cc +++ b/src/ballistica/base/ui/ui.cc @@ -93,6 +93,13 @@ void UI::ApplyAppConfig() { AppConfig::BoolID::kAlwaysUseInternalKeyboard)); } +auto UI::MainMenuVisible() -> bool { + if (g_base->HaveUIV1()) { + return g_base->ui_v1()->MainMenuVisible(); + } + return false; +} + void UI::PushBackButtonCall(InputDevice* input_device) { g_base->logic->event_loop()->PushCall([this, input_device] { assert(g_base->InLogicThread()); diff --git a/src/ballistica/base/ui/ui.h b/src/ballistica/base/ui/ui.h index ea60e45e..403b52f3 100644 --- a/src/ballistica/base/ui/ui.h +++ b/src/ballistica/base/ui/ui.h @@ -7,8 +7,8 @@ #include #include "ballistica/base/support/context.h" +#include "ballistica/base/ui/widget_message.h" #include "ballistica/shared/generic/timer_list.h" -#include "ballistica/ui_v1/widget/widget.h" // UI-Locks: make sure widget-lists don't change under you. // Use a read-lock if you just need to ensure lists remain intact but won't be @@ -23,6 +23,14 @@ #define BA_UI_READ_LOCK UI::UILock ui_lock(false) #define BA_UI_WRITE_LOCK UI::UILock ui_lock(true) +// Predeclare a few things from ui_v1. +namespace ballistica::ui_v1 { +class ContainerWidget; +class RootWidget; +class Widget; +class RootUI; +} // namespace ballistica::ui_v1 + namespace ballistica::base { // Our global UI subsystem. This wrangles all app @@ -52,6 +60,8 @@ class UI { /// This can be called from any thread. void ConfirmQuit(); + auto MainMenuVisible() -> bool; + // Return the root widget containing all windows & dialogs // Whenever this contains children, the UI is considered to be in focus auto screen_root_widget() -> ui_v1::ContainerWidget* { diff --git a/src/ballistica/core/python/core_python.cc b/src/ballistica/core/python/core_python.cc index 7f46e1bc..fcec90e9 100644 --- a/src/ballistica/core/python/core_python.cc +++ b/src/ballistica/core/python/core_python.cc @@ -17,15 +17,6 @@ void CorePython::ApplyBaEnvConfig() { g_core->platform->SetBaEnvVals(envcfg); } -void CorePython::RunBaEnvOnBaBaseImport() { - // Runs at the end of our import; just for checks/etc. - auto result = - objs().Get(core::CorePython::ObjID::kBaEnvOnBaBaseImportCall).Call(); - if (!result.Exists()) { - FatalError("baenv.on_babase_import() failed."); - } -} - void CorePython::InitPython() { assert(g_core->InMainThread()); assert(g_buildconfig.monolithic_build()); @@ -177,10 +168,6 @@ void CorePython::ImportPythonObjs() { *ctx.DictGetItem("import_baenv_and_run_configure")); objs_.StoreCallable(ObjID::kBaEnvGetConfigCall, *ctx.DictGetItem("get_env_config")); - objs_.StoreCallable(ObjID::kBaEnvOnBaBaseImportCall, - *ctx.DictGetItem("on_babase_import")); - objs_.StoreCallable(ObjID::kBaEnvOnBaBaseStartAppCall, - *ctx.DictGetItem("on_babase_start_app")); } } diff --git a/src/ballistica/core/python/core_python.h b/src/ballistica/core/python/core_python.h index 98811832..619f6eca 100644 --- a/src/ballistica/core/python/core_python.h +++ b/src/ballistica/core/python/core_python.h @@ -30,8 +30,6 @@ class CorePython { kPrependSysPathCall, kBaEnvConfigureCall, kBaEnvGetConfigCall, - kBaEnvOnBaBaseImportCall, - kBaEnvOnBaBaseStartAppCall, kLast // Sentinel; must be at end. }; @@ -49,10 +47,6 @@ class CorePython { /// baenv environment and runs some checks. void ApplyBaEnvConfig(); - /// Should be called at the end of base import; runs a few checks/etc. - /// that cannot be run until _babase is actually imported. - void RunBaEnvOnBaBaseImport(); - /// Calls Python logging function (logging.error, logging.warning, etc.) /// Can be called from any thread at any time. If called before Python /// logging is available, logs locally using Logging::DisplayLog() diff --git a/src/ballistica/scene_v1/node/flag_node.cc b/src/ballistica/scene_v1/node/flag_node.cc index 2a79c3a5..902003df 100644 --- a/src/ballistica/scene_v1/node/flag_node.cc +++ b/src/ballistica/scene_v1/node/flag_node.cc @@ -8,6 +8,7 @@ #include "ballistica/base/graphics/graphics_server.h" #include "ballistica/base/graphics/support/area_of_interest.h" #include "ballistica/base/graphics/support/camera.h" +#include "ballistica/scene_v1/assets/scene_texture.h" #include "ballistica/scene_v1/node/node_attribute.h" #include "ballistica/scene_v1/node/node_type.h" #include "ballistica/scene_v1/support/scene.h" diff --git a/src/ballistica/scene_v1/node/spaz_node.cc b/src/ballistica/scene_v1/node/spaz_node.cc index cf8e2a29..7cd1cdd3 100644 --- a/src/ballistica/scene_v1/node/spaz_node.cc +++ b/src/ballistica/scene_v1/node/spaz_node.cc @@ -15,7 +15,9 @@ #include "ballistica/base/input/device/input_device.h" #include "ballistica/base/ui/ui.h" #include "ballistica/core/core.h" +#include "ballistica/scene_v1/assets/scene_mesh.h" #include "ballistica/scene_v1/assets/scene_sound.h" +#include "ballistica/scene_v1/assets/scene_texture.h" #include "ballistica/scene_v1/dynamics/collision.h" #include "ballistica/scene_v1/dynamics/dynamics.h" #include "ballistica/scene_v1/dynamics/material/material_action.h" diff --git a/src/ballistica/scene_v1/node/terrain_node.cc b/src/ballistica/scene_v1/node/terrain_node.cc index eb7faec2..06a2d009 100644 --- a/src/ballistica/scene_v1/node/terrain_node.cc +++ b/src/ballistica/scene_v1/node/terrain_node.cc @@ -6,6 +6,8 @@ #include "ballistica/base/graphics/component/object_component.h" #include "ballistica/core/core.h" #include "ballistica/scene_v1/assets/scene_collision_mesh.h" +#include "ballistica/scene_v1/assets/scene_mesh.h" +#include "ballistica/scene_v1/assets/scene_texture.h" #include "ballistica/scene_v1/dynamics/material/material.h" #include "ballistica/scene_v1/node/node_attribute.h" #include "ballistica/scene_v1/node/node_type.h" diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index cecff518..4a6e9e3e 100644 --- a/src/ballistica/shared/ballistica.cc +++ b/src/ballistica/shared/ballistica.cc @@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int { namespace ballistica { // These are set automatically via script; don't modify them here. -const int kEngineBuildNumber = 21034; +const int kEngineBuildNumber = 21035; const char* kEngineVersion = "1.7.20"; auto MonolithicMain(const core::CoreConfig& core_config) -> int { diff --git a/src/ballistica/ui_v1/support/root_ui.cc b/src/ballistica/ui_v1/support/root_ui.cc index e1362ca3..70b84d08 100644 --- a/src/ballistica/ui_v1/support/root_ui.cc +++ b/src/ballistica/ui_v1/support/root_ui.cc @@ -123,6 +123,8 @@ void RootUI::HandleMouseButtonUp(float x, float y) { } else if (keyboard_input) { input_device = keyboard_input; } + + // Handle top right corner menu button. if ((g_base->graphics->screen_virtual_width() - x < menu_button_size_) && (g_base->graphics->screen_virtual_height() - y < menu_button_size_)) { diff --git a/src/ballistica/ui_v1/ui_v1.cc b/src/ballistica/ui_v1/ui_v1.cc index 30685611..a3602d48 100644 --- a/src/ballistica/ui_v1/ui_v1.cc +++ b/src/ballistica/ui_v1/ui_v1.cc @@ -2,8 +2,10 @@ #include "ballistica/ui_v1/ui_v1.h" +#include "ballistica/base/ui/ui.h" #include "ballistica/ui_v1/python/ui_v1_python.h" #include "ballistica/ui_v1/support/root_ui.h" +#include "ballistica/ui_v1/widget/container_widget.h" namespace ballistica::ui_v1 { @@ -70,4 +72,12 @@ void UIV1FeatureSet::DoQuitWindow() { } RootUI* UIV1FeatureSet::NewRootUI() { return new RootUI(); } + +bool UIV1FeatureSet::MainMenuVisible() { + auto* screen_root = g_base->ui->screen_root_widget(); + auto* overlay_root = g_base->ui->overlay_root_widget(); + return ((screen_root && screen_root->HasChildren()) + || (overlay_root && overlay_root->HasChildren())); +} + } // namespace ballistica::ui_v1 diff --git a/src/ballistica/ui_v1/ui_v1.h b/src/ballistica/ui_v1/ui_v1.h index 7a819cf8..6998cd09 100644 --- a/src/ballistica/ui_v1/ui_v1.h +++ b/src/ballistica/ui_v1/ui_v1.h @@ -58,6 +58,7 @@ class UIV1FeatureSet : public FeatureSetNativeComponent, void DoShowURL(const std::string& url) override; void DoQuitWindow() override; auto NewRootUI() -> ui_v1::RootUI* override; + auto MainMenuVisible() -> bool override; UIV1Python* const python; diff --git a/src/meta/bacoremeta/pyembed/env.py b/src/meta/bacoremeta/pyembed/env.py index 2545df49..fde574a8 100644 --- a/src/meta/bacoremeta/pyembed/env.py +++ b/src/meta/bacoremeta/pyembed/env.py @@ -40,17 +40,3 @@ def get_env_config() -> baenv.EnvConfig: import baenv return baenv.get_config() - - -def on_babase_import() -> None: - """Called when _babase is execing.""" - import baenv - - baenv.on_babase_import() - - -def on_babase_start_app() -> None: - """Called when starting the app.""" - import baenv - - baenv.on_babase_start_app() diff --git a/tools/batools/pcommand2.py b/tools/batools/pcommand2.py index f1775316..090c489d 100644 --- a/tools/batools/pcommand2.py +++ b/tools/batools/pcommand2.py @@ -325,8 +325,8 @@ def spinoff_test() -> None: if len(args) != 1: raise CleanError('Expected 1 arg.') testtype = args[0] - if testtype == 'empty': - path = 'build/spinofftest/empty' + if testtype in {'empty', 'base'}: + path = f'build/spinofftest/{testtype}' print( f'{Clr.SBLU}{Clr.BLD}Running spinoff test' f" {Clr.RST}{Clr.BLD}'{testtype}'{Clr.RST}{Clr.SBLU}{Clr.BLD}" @@ -357,7 +357,7 @@ def spinoff_test() -> None: 'SpinoffTest', path, '--featuresets', - 'none', + 'none' if testtype == 'empty' else testtype, ] + (['--submodule-parent'] if submodule_parent else []) # Show the spinoff command we'd use here. diff --git a/tools/batools/spinoff/_context.py b/tools/batools/spinoff/_context.py index c4209d84..ed9e8751 100644 --- a/tools/batools/spinoff/_context.py +++ b/tools/batools/spinoff/_context.py @@ -33,7 +33,7 @@ if TYPE_CHECKING: # Tags that default_filter_file() looks for; these can be used to strip # out sections that should never be included in spinoff projects. -STRIP_TAG_PAIRS = [ +STRIP_TAG_PAIRS: list[tuple[str, str]] = [ ('# __SPINOFF_STRIP_BEGIN__', '# __SPINOFF_STRIP_END__'), ('// __SPINOFF_STRIP_BEGIN__', '// __SPINOFF_STRIP_END__'), ]