diff --git a/.efrocachemap b/.efrocachemap index 35d2bad2..6554ee30 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -421,7 +421,7 @@ "build/assets/ba_data/audio/zoeOw.ogg": "74befe45a8417e95b6a2233c51992a26", "build/assets/ba_data/audio/zoePickup01.ogg": "48ab8cddfcde36a750856f3f81dd20c8", "build/assets/ba_data/audio/zoeScream01.ogg": "2b468aedfa8741090247f04eb9e6df55", - "build/assets/ba_data/data/langdata.json": "1a960da2db069ca3926b8ee6b8f82df7", + "build/assets/ba_data/data/langdata.json": "35edefb8290f4fb38c5e3e70395fc449", "build/assets/ba_data/data/languages/arabic.json": "295c559911fa251f401f8cdcad91c226", "build/assets/ba_data/data/languages/belarussian.json": "e151808b6b4f6dc159cf55ee62adad3c", "build/assets/ba_data/data/languages/chinese.json": "b0d4e874ba8d22c8fd0d7a0eaaf96ac9", @@ -430,12 +430,12 @@ "build/assets/ba_data/data/languages/czech.json": "93c5fe0d884d95435da6c675f64e30e0", "build/assets/ba_data/data/languages/danish.json": "3fd69080783d5c9dcc0af737f02b6f1e", "build/assets/ba_data/data/languages/dutch.json": "22b44a33bf81142ba2befad14eb5746e", - "build/assets/ba_data/data/languages/english.json": "550aecdf2530832a8c095c2bda9ea8f0", + "build/assets/ba_data/data/languages/english.json": "6fb6ec37e79064edb4b8864eabdd024d", "build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880", "build/assets/ba_data/data/languages/filipino.json": "347f38524816691170d266708fe25894", "build/assets/ba_data/data/languages/french.json": "4e218dcd488fa63e7db5b4da2261b9e1", "build/assets/ba_data/data/languages/german.json": "450fa41ae264f29a5d1af22143d0d0ad", - "build/assets/ba_data/data/languages/gibberish.json": "517e9c79ce8242af82366bbdaaf678a4", + "build/assets/ba_data/data/languages/gibberish.json": "63c6212c774622346f3ad0d87ff31e80", "build/assets/ba_data/data/languages/greek.json": "287c0ec437b38772284ef9d3e4fb2fc3", "build/assets/ba_data/data/languages/hindi.json": "8ea0c58a44a24edb131d0e53b074d1f6", "build/assets/ba_data/data/languages/hungarian.json": "796a290a8c44a1e7635208c2ff5fdc6e", @@ -445,12 +445,12 @@ "build/assets/ba_data/data/languages/malay.json": "832562ce997fc70704b9234c95fb2e38", "build/assets/ba_data/data/languages/persian.json": "a391d80ff58ea22926499e4b19d2c0d0", "build/assets/ba_data/data/languages/polish.json": "e1a1a801851924748ad38fa68216439a", - "build/assets/ba_data/data/languages/portuguese.json": "9fcd6b4da9e5d0dc0e337ab00b5debe2", + "build/assets/ba_data/data/languages/portuguese.json": "51e362956f89da3eec980f587c092253", "build/assets/ba_data/data/languages/romanian.json": "aeebdd54f65939c2facc6ac50c117826", - "build/assets/ba_data/data/languages/russian.json": "70f79c606ccc5ec7bd6ce0303fdece70", + "build/assets/ba_data/data/languages/russian.json": "561504cca28eb3204ac194950029e565", "build/assets/ba_data/data/languages/serbian.json": "d7452dd72ac0e51680cb39b5ebaa1c69", "build/assets/ba_data/data/languages/slovak.json": "27962d53dc3f7dd4e877cd40faafeeef", - "build/assets/ba_data/data/languages/spanish.json": "e72e394f94b99d3e838c1b81a9d17615", + "build/assets/ba_data/data/languages/spanish.json": "5a4dbd505060dd02d634bd4de4d5faab", "build/assets/ba_data/data/languages/swedish.json": "77d671f10613291ebf9c71da66f18a18", "build/assets/ba_data/data/languages/tamil.json": "65ab7798d637fa62a703750179eeb723", "build/assets/ba_data/data/languages/thai.json": "33f63753c9af9a5b238d229a0bf23fbc", @@ -4056,26 +4056,26 @@ "build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "f029c0682da29f46e5c9782bd2567f82", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "d2fe151ab5836d1f60b85bdc7d7880b1", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "ca6b96c7c6f77ab6ca93698da0022cb6", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "5342b4e44c8f414b34582ceec0ef0c8d", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "67e06b38ba6e5fa44fcb0b196618dda7", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "5a1a366e4458f48230a8856a04e3d15a", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "c1f9b4a7e4d8aef89de664fd19178b17", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "7608557c57d636c81213afe0a68cd921", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "31465c3f4b869d6d2a4a004bcf43c058", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "4092f2c09d4717cbe22a9847733458ea", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "a98776c44ceae70a5582fa3a31894f42", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "107c108da827cc647d26ea8e20e5a02a", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "d4e3d6b79648d478003282e20b583cf3", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "396f882b13a97bec718222d14be7a825", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "118e5039eb06c8d641baa3a94c511a20", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "2c4b12f038ad8eb9838860b8cce2f491", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "650b1181dda309c492abe2a26cedfd9a", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "32ac6359eb0296a319ddfcba3fcd04bc", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "731540517a251db7332d0f841d686d01", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "a19df9a09272d486666a4cb28702cf2b", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "8944236c082e32b7efc83fdd1d2bb430", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "7d78e977704b352be09dc49ae159c0ac", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "1c587e1330b55458dfc200f08bf6e6fc", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b9f429f8cbc3961dde9bae4344ec74f5", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "91876ba2b9041ac6b6fbfcdc058342dd", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "8c2dd693f97a910a70e82efdeff1b9d4", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "590edd47cf70f08866b9ced6c46751f1", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "e0ddb169dce06925d6b3fbde8a2cda45", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "8bc979f113254f1329d0219809bca9f1", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "674d3495c9b3483d712673219383888d", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "c219bdcb9d0897650b72708ba3a17e5e", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "c2a9c82807644a4676dae69630ff8237", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "aa12830328b2c64b8d4970197ba5c49f", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "8569f2c15b113f206846152a49dbcd6d", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "49b7f50beed3e8c5abfd7f6faa4d7b90", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "78fbc9b9503b30231b9effd281322829", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "c88f1beb143dd3306b556b5490e8b381", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "110bf4b9e5c99d4b354ace22272e902e", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "9d62f0c0fed46365b203728079580085", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "c2ccf9cec0af9b12620eb74237647583", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "473e7e6c0cf90b9e6ac653552b18f68d", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "4e11b895cbf2e1339cf34bc06c54a4ea", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "473e7e6c0cf90b9e6ac653552b18f68d", @@ -4092,14 +4092,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "48c4873dae2344c1d4092a1d85dab424", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "abcede4e60fa8877f18e66e086fb7387", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "48c4873dae2344c1d4092a1d85dab424", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "13615b9d10736d72e3b3bec605518645", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "99369ccd4edfe5cc2d54b18aa77ca1cb", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "33a19e9eb9bd9b655cbe70d8e250425b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "021114e14a72c621dc6fb7d4b3e41b5f", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "cff4a800e4ea1cdb7690d088a4db0abb", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "107e289fb15a0d3177ed16aa8f076041", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "4d031e12072278cf78570b64a2f7e533", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "d7e631f313c7b99d92c41efaf6305b65", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "235ff7a30762e89fce4142e4150d46a4", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "e13e823133fcdcf8409ee8978892162b", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "0388a3c7a202c13466d20d2e45d7645e", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "a1fb2d14a0876f5759dc825c10723b17", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "5eb03f1247c6cd2e0bc75a4e459712f6", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "4d49ef90fbde5813d4b9dd22f0f8c55b", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "2782be4d66289e98fa93076e953d4488", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "f3b6ea4d34a50620e26f6d4ef6ddad17", "src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "28323912b56ec07701eda3d41a6a4101", "src/ballistica/base/mgen/pyembed/binding_base.inc": "6df0f34207346d89a72924249ddd4706", diff --git a/CHANGELOG.md b/CHANGELOG.md index 72a3dce1..5e8b2b13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.28 (build 21488, api 8, 2023-10-20) +### 1.7.28 (build 21489, api 8, 2023-10-21) - Massively cleaned up code related to rendering and window systems (OpenGL, SDL, etc). This code had been growing into a nasty tangle for 15 years diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 1b03a2f8..3c8ce180 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -52,7 +52,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21488 +TARGET_BALLISTICA_BUILD = 21489 TARGET_BALLISTICA_VERSION = '1.7.28' diff --git a/src/assets/ba_data/python/bauiv1lib/settings/gamepadselect.py b/src/assets/ba_data/python/bauiv1lib/settings/gamepadselect.py index 9534ec8d..b576d422 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/gamepadselect.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/gamepadselect.py @@ -29,16 +29,16 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None: logging.exception('Error transitioning out main_menu_window.') bui.getsound('activateBeep').play() bui.getsound('swish').play() - inputdevice = event['input_device'] - assert isinstance(inputdevice, bs.InputDevice) - if inputdevice.allows_configuring: + device = event['input_device'] + assert isinstance(device, bs.InputDevice) + if device.allows_configuring: bui.app.ui_v1.set_main_menu_window( - gamepad.GamepadSettingsWindow(inputdevice).get_root_widget() + gamepad.GamepadSettingsWindow(device).get_root_widget() ) else: width = 700 height = 200 - button_width = 100 + button_width = 80 uiscale = bui.app.ui_v1.uiscale dlg = bui.containerwidget( scale=( @@ -52,8 +52,13 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None: transition='in_right', ) bui.app.ui_v1.set_main_menu_window(dlg) - device_name = inputdevice.name - if device_name == 'iDevice': + + if device.allows_configuring_in_system_settings: + msg = bui.Lstr( + resource='configureDeviceInSystemSettingsText', + subs=[('${DEVICE}', device.name)], + ) + elif device.is_controller_app: msg = bui.Lstr( resource='bsRemoteConfigureInAppText', subs=[('${REMOTE_APP_NAME}', bui.get_remote_app_name())], @@ -61,7 +66,7 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None: else: msg = bui.Lstr( resource='cantConfigureDeviceText', - subs=[('${DEVICE}', device_name)], + subs=[('${DEVICE}', device.name)], ) bui.textwidget( parent=dlg, diff --git a/src/ballistica/base/graphics/graphics.cc b/src/ballistica/base/graphics/graphics.cc index 773e85dd..cc01e49f 100644 --- a/src/ballistica/base/graphics/graphics.cc +++ b/src/ballistica/base/graphics/graphics.cc @@ -1521,10 +1521,10 @@ void Graphics::DoDrawFade(FrameDef* frame_def, float amt) { void Graphics::DrawCursor(FrameDef* frame_def) { assert(g_base->InLogicThread()); - millisecs_t app_time_millisecs = frame_def->app_time_millisecs(); + auto app_time = frame_def->app_time(); - bool can_show_cursor = g_base->app_adapter->ShouldUseCursor(); - bool should_show_cursor = + auto can_show_cursor = g_base->app_adapter->ShouldUseCursor(); + auto should_show_cursor = camera_->manual() || g_base->input->IsCursorVisible(); if (g_base->app_adapter->HasHardwareCursor()) { @@ -1538,9 +1538,9 @@ void Graphics::DrawCursor(FrameDef* frame_def) { // Ship this state when it changes and also every now and then just in // case things go wonky. if (new_cursor_visibility != hardware_cursor_visible_ - || app_time_millisecs - last_cursor_visibility_event_time_ > 2000) { + || app_time - last_cursor_visibility_event_time_ > 2.137) { hardware_cursor_visible_ = new_cursor_visibility; - last_cursor_visibility_event_time_ = app_time_millisecs; + last_cursor_visibility_event_time_ = app_time; g_base->app_adapter->PushMainThreadCall([this] { assert(g_core && g_core->InMainThread()); g_base->app_adapter->SetHardwareCursorVisible(hardware_cursor_visible_); diff --git a/src/ballistica/base/graphics/graphics.h b/src/ballistica/base/graphics/graphics.h index 022e58d8..f04ff79c 100644 --- a/src/ballistica/base/graphics/graphics.h +++ b/src/ballistica/base/graphics/graphics.h @@ -485,7 +485,7 @@ class Graphics { millisecs_t last_progress_bar_draw_time_{}; millisecs_t last_progress_bar_start_time_{}; microsecs_t last_suppress_gyro_time_{}; - millisecs_t last_cursor_visibility_event_time_{}; + seconds_t last_cursor_visibility_event_time_{}; microsecs_t next_frame_number_filtered_increment_time_{}; microsecs_t last_create_frame_def_time_microsecs_{}; millisecs_t last_create_frame_def_time_millisecs_{}; diff --git a/src/ballistica/base/graphics/support/frame_def.h b/src/ballistica/base/graphics/support/frame_def.h index d839c52e..828095fa 100644 --- a/src/ballistica/base/graphics/support/frame_def.h +++ b/src/ballistica/base/graphics/support/frame_def.h @@ -44,8 +44,8 @@ class FrameDef { return app_time_microsecs_ / 1000; } auto app_time_microsecs() const -> microsecs_t { return app_time_microsecs_; } - auto app_time() const -> double { - return static_cast(app_time_microsecs_) / 1000000.0; + auto app_time() const { + return static_cast(app_time_microsecs_) / 1000000.0; } // A number incremented for each frame renderered. Note that graphics code diff --git a/src/ballistica/base/input/input.cc b/src/ballistica/base/input/input.cc index 551b499c..acefa84b 100644 --- a/src/ballistica/base/input/input.cc +++ b/src/ballistica/base/input/input.cc @@ -1297,7 +1297,7 @@ void Input::HandleSmoothMouseScroll_(const Vector2f& velocity, bool momentum) { WidgetMessage(WidgetMessage::Type::kMouseWheelVelocityH, nullptr, cursor_pos_x_, cursor_pos_y_, velocity.x, momentum)); - last_mouse_move_time_ = g_core->GetAppTimeMillisecs(); + last_mouse_move_time_ = g_core->GetAppTimeSeconds(); mouse_move_count_++; Camera* camera = g_base->graphics->camera(); @@ -1333,7 +1333,7 @@ void Input::HandleMouseMotion_(const Vector2f& position) { cursor_pos_y_ = g_base->graphics->PixelToVirtualY( position.y * g_base->graphics->screen_pixel_height()); - last_mouse_move_time_ = g_core->GetAppTimeMillisecs(); + last_mouse_move_time_ = g_core->GetAppTimeSeconds(); mouse_move_count_++; // If we have a touch-input in editing mode, pass along events to it. @@ -1374,7 +1374,7 @@ void Input::HandleMouseDown_(int button, const Vector2f& position) { return; } - last_mouse_move_time_ = g_core->GetAppTimeMillisecs(); + last_mouse_move_time_ = g_core->GetAppTimeSeconds(); mouse_move_count_++; // Convert normalized view coords to our virtual ones. @@ -1439,8 +1439,8 @@ void Input::HandleMouseUp_(int button, const Vector2f& position) { position.y * g_base->graphics->screen_pixel_height()); // If we have a touch-input in editing mode, pass along events to it. - // (it usually handles its own events but here we want it to play nice - // with stuff under it by blocking touches, etc) + // It usually handles its own events but here we want it to play nice + // with stuff under it by blocking touches, etc. if (touch_input_ && touch_input_->editing()) { touch_input_->HandleTouchUp(reinterpret_cast(1), cursor_pos_x_, cursor_pos_y_); @@ -1481,9 +1481,6 @@ void Input::HandleTouchEvent_(const TouchEvent& e) { MarkInputActive(); - // float x = e.x; - // float y = e.y; - if (g_buildconfig.ostype_ios_tvos()) { printf("FIXME: update touch handling\n"); } @@ -1513,8 +1510,8 @@ void Input::HandleTouchEvent_(const TouchEvent& e) { } } - // We keep track of one 'single' touch which we pass along as - // mouse events which covers most UI stuff. + // We keep track of one 'single' touch which we pass along as mouse events + // which covers most UI stuff. if (e.type == TouchEvent::Type::kDown && single_touch_ == nullptr) { single_touch_ = e.touch; HandleMouseDown_(SDL_BUTTON_LEFT, Vector2f(e.x, e.y)); @@ -1524,8 +1521,8 @@ void Input::HandleTouchEvent_(const TouchEvent& e) { HandleMouseMotion_(Vector2f(e.x, e.y)); } - // Currently just applying touch-cancel the same as touch-up here; - // perhaps should be smarter in the future. + // Currently just applying touch-cancel the same as touch-up here; perhaps + // should be smarter in the future. if ((e.type == TouchEvent::Type::kUp || e.type == TouchEvent::Type::kCanceled) && (e.touch == single_touch_ || e.overall)) { single_touch_ = nullptr; @@ -1579,13 +1576,9 @@ auto Input::IsCursorVisible() const -> bool { } bool val; - // Show our cursor if any dialogs/windows are up or else if its been moved - // very recently. - if (g_base->ui->MainMenuVisible()) { - val = (g_core->GetAppTimeMillisecs() - last_mouse_move_time_ < 5000); - } else { - val = (g_core->GetAppTimeMillisecs() - last_mouse_move_time_ < 1000); - } + // Show our cursor only if its been moved recently. + val = (g_core->GetAppTimeSeconds() - last_mouse_move_time_ < 2.071); + return val; } diff --git a/src/ballistica/base/input/input.h b/src/ballistica/base/input/input.h index b38aea5c..e256a2ff 100644 --- a/src/ballistica/base/input/input.h +++ b/src/ballistica/base/input/input.h @@ -11,6 +11,7 @@ #include "ballistica/base/base.h" #include "ballistica/shared/foundation/object.h" +#include "ballistica/shared/foundation/types.h" namespace ballistica::base { @@ -179,49 +180,49 @@ class Input { void DestroyKeyboardInputDevices_(); void AddFakeMods_(SDL_Keysym* sym); - HandleKeyPressCall* keyboard_input_capture_press_{}; - HandleKeyReleaseCall* keyboard_input_capture_release_{}; - HandleJoystickEventCall* joystick_input_capture_{}; - bool input_active_{}; - millisecs_t input_idle_time_{}; - int local_active_input_device_count_{}; - millisecs_t last_get_local_active_input_device_count_check_time_{}; - std::unordered_map > - reserved_identifiers_; - int max_controller_count_so_far_{}; - std::list newly_connected_controllers_; - std::list newly_disconnected_controllers_; int connect_print_timer_id_{}; int disconnect_print_timer_id_{}; - bool have_button_using_inputs_{}; - bool have_start_activated_default_button_inputs_{}; - bool have_non_touch_inputs_{}; + int max_controller_count_so_far_{}; + int local_active_input_device_count_{}; + int mouse_move_count_{}; + int input_lock_count_temp_{}; + int input_lock_count_permanent_{}; + bool input_active_ : 1 {}; + bool have_button_using_inputs_ : 1 {}; + bool have_start_activated_default_button_inputs_ : 1 {}; + bool have_non_touch_inputs_ : 1 {}; + bool ignore_mfi_controllers_ : 1 {}; + bool ignore_sdl_controllers_ : 1 {}; + millisecs_t input_idle_time_{}; + millisecs_t last_get_local_active_input_device_count_check_time_{}; float cursor_pos_x_{}; float cursor_pos_y_{}; millisecs_t last_click_time_{}; millisecs_t double_click_time_{200}; - millisecs_t last_mouse_move_time_{}; - int mouse_move_count_{}; - std::vector > input_devices_; - KeyboardInput* keyboard_input_{}; - KeyboardInput* keyboard_input_2_{}; - TouchInput* touch_input_{}; - int input_lock_count_temp_{}; - int input_lock_count_permanent_{}; + seconds_t last_mouse_move_time_{}; std::list input_lock_temp_labels_; std::list input_unlock_temp_labels_; std::list input_lock_permanent_labels_; std::list input_unlock_permanent_labels_; std::list recent_input_locks_unlocks_; + std::list test_inputs_; + std::list newly_connected_controllers_; + std::list newly_disconnected_controllers_; + std::unordered_map > + reserved_identifiers_; + std::vector > input_devices_; std::set keys_held_; millisecs_t last_input_device_count_update_time_{}; millisecs_t last_input_temp_lock_time_{}; - bool ignore_mfi_controllers_{}; - bool ignore_sdl_controllers_{}; - std::list test_inputs_; millisecs_t stress_test_time_{}; millisecs_t stress_test_last_leave_time_{}; void* single_touch_{}; + KeyboardInput* keyboard_input_{}; + KeyboardInput* keyboard_input_2_{}; + TouchInput* touch_input_{}; + HandleKeyPressCall* keyboard_input_capture_press_{}; + HandleKeyReleaseCall* keyboard_input_capture_release_{}; + HandleJoystickEventCall* joystick_input_capture_{}; }; } // namespace ballistica::base diff --git a/src/ballistica/base/platform/apple/base_platform_apple.cc b/src/ballistica/base/platform/apple/base_platform_apple.cc index fc18f79c..55226812 100644 --- a/src/ballistica/base/platform/apple/base_platform_apple.cc +++ b/src/ballistica/base/platform/apple/base_platform_apple.cc @@ -5,9 +5,7 @@ #if BA_XCODE_BUILD #include -#include #endif -#include #if BA_XCODE_BUILD #include "ballistica/base/platform/apple/apple_utils.h" @@ -15,12 +13,7 @@ namespace ballistica::base { -#if BA_OSTYPE_MACOS && BA_XCODE_BUILD && BA_SDL_BUILD -extern void DoSetCursor(bool show); -#endif - -BasePlatformApple::BasePlatformApple() { // NOLINT: trivial constructor false - // positive +BasePlatformApple::BasePlatformApple() { // On iOS, keep the device from falling asleep in our app #if BA_OSTYPE_IOS_TVOS AppleUtils::DisableIdleTimer(); @@ -58,25 +51,13 @@ void BasePlatformApple::DoOpenURL(const std::string& url) { BallisticaKit::CocoaFromCppOpenURL(url); #else BallisticaKit::UIKitFromCppOpenURL(url); -#endif - // Go ahead and do this ourself. Though perhaps the default - // Python path would be fine. - // AppleUtils::OpenURL(url.c_str()); -#else - // Otherwise go with the default (Python webbrowser module). - BasePlatform::DoOpenURL(url); -#endif -} +#endif // BA_OSTYPE_MACOS -// void BasePlatformApple::SetHardwareCursorVisible(bool visible) { -// // Set our nifty custom hardware cursor on mac; -// // otherwise fall back to default. -// #if BA_OSTYPE_MACOS && BA_XCODE_BUILD && !BA_HEADLESS_BUILD && BA_SDL_BUILD -// base::DoSetCursor(visible); -// #else -// return BasePlatform::SetHardwareCursorVisible(visible); -// #endif -// } +#else + // For non-xcode builds, go with the default (Python webbrowser module). + BasePlatform::DoOpenURL(url); +#endif // BA_XCODE_BUILD +} } // namespace ballistica::base diff --git a/src/ballistica/base/platform/apple/base_platform_apple.h b/src/ballistica/base/platform/apple/base_platform_apple.h index 50cf78cc..d0fbaad8 100644 --- a/src/ballistica/base/platform/apple/base_platform_apple.h +++ b/src/ballistica/base/platform/apple/base_platform_apple.h @@ -11,15 +11,11 @@ namespace ballistica::base { class BasePlatformApple : public BasePlatform { public: BasePlatformApple(); - void DoPurchase(const std::string& item) override; void RestorePurchases() override; void PurchaseAck(const std::string& purchase, const std::string& order_id) override; - void DoOpenURL(const std::string& url) override; - - private: }; } // namespace ballistica::base diff --git a/src/ballistica/scene_v1/node/flag_node.cc b/src/ballistica/scene_v1/node/flag_node.cc index d0bae293..05b26746 100644 --- a/src/ballistica/scene_v1/node/flag_node.cc +++ b/src/ballistica/scene_v1/node/flag_node.cc @@ -311,8 +311,6 @@ void FlagNode::Draw(base::FrameDef* frame_def) { c.SetTexture(g_base->assets->SysTexture(base::SysTextureID::kShadow)); c.SetTransparent(true); - FullShadowSet* full_shadows = full_shadow_set_.Get(); - // Update our shadow objects. if (!g_core->HeadlessMode()) { dBodyID b = body_->body(); diff --git a/src/ballistica/scene_v1/python/class/python_class_input_device.cc b/src/ballistica/scene_v1/python/class/python_class_input_device.cc index 77e473bf..515f2c35 100644 --- a/src/ballistica/scene_v1/python/class/python_class_input_device.cc +++ b/src/ballistica/scene_v1/python/class/python_class_input_device.cc @@ -32,7 +32,12 @@ void PythonClassInputDevice::SetupType(PyTypeObject* cls) { "Attributes:\n" "\n" " allows_configuring (bool):\n" - " Whether the input-device can be configured.\n" + " Whether the input-device can be configured in the app.\n" + "\n" + " allows_configuring_in_system_settings (bool):\n" + " Whether the input-device can be configured in the system.\n" + " setings app. This can be used to redirect the user to go there\n" + " if they attempt to configure the device.\n" "\n" " has_meaningful_button_names (bool):\n" " Whether button names returned by this instance match labels\n" @@ -189,6 +194,16 @@ auto PythonClassInputDevice::tp_getattro(PythonClassInputDevice* self, } else { Py_RETURN_FALSE; } + } else if (!strcmp(s, "allows_configuring_in_system_settings")) { + auto* d = self->input_device_delegate_->Get(); + if (!d) { + throw Exception(PyExcType::kInputDeviceNotFound); + } + if (d->input_device().IsMFiController()) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } } else if (!strcmp(s, "has_meaningful_button_names")) { auto* d = self->input_device_delegate_->Get(); if (!d) { diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 4d5638db..6580892d 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 = 21488; +const int kEngineBuildNumber = 21489; const char* kEngineVersion = "1.7.28"; const int kEngineApiVersion = 8;