diff --git a/.efrocachemap b/.efrocachemap index a2eea1a7..f7724b84 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4096,50 +4096,50 @@ "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": "059baedbe0b66d30d0aa6689da4d63f3", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "3ed7b000a1ab91e479752a3888c83667", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "36c737e7702d8c06bc4fd2cfb07da351", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "6f487cdb9ba97fab91f04146afafe7dd", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "2c65291868c5d663aed8e091b3918560", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "907e310432844bc1a81e16cf2520e9b3", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "057e48bb93965e035ce5a41f86efef46", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "3a0831e5e874d7dae4698c726c522a27", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "5510a4efe5876817d7378f4c7c7eeb34", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "40535aed4289ab6c6cb2b1fb2756c510", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "762777a4a85b1306fb7cc66de9fe930f", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "4559fca91a2e663714f65c88960a8550", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "d9b8e42c9a51b803d7fd8d79b0c1089a", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "2bbda26d94f3c42eb50ae38f36736c41", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "28501bcf6678e9828b7c93d7124cb895", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "6f333b02870caea43e8b47b751e31c41", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "8df10a5d0119225f0ed1168380df70db", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "354f163cc24b1196fcf43c2949c7cabe", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "064aa919dda3f74787751c4c82133bd8", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "36eeeac892119b8080c99e8cc97ed825", - "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "8390ede3c9748e859f23db258289abf5", - "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "8361f4adc958e914301959ca55680fd5", - "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "8390ede3c9748e859f23db258289abf5", - "build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "8361f4adc958e914301959ca55680fd5", - "build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "5149cfef7284e1ba8ca9ec9cae4070a5", - "build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "4f5a0efc253ad90fb543214449b853f8", - "build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "5149cfef7284e1ba8ca9ec9cae4070a5", - "build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "4f5a0efc253ad90fb543214449b853f8", - "build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "6f0409237172a162c07e3c413d2969ab", - "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "d11a17346662df85b844afa7bc1afb56", - "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "6f0409237172a162c07e3c413d2969ab", - "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "d11a17346662df85b844afa7bc1afb56", - "build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "2a0eb5631a45c5724713e5e6cdc2b06e", - "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "af3468e5de5a0c2cb4e431239a5c0f2d", - "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "2405fb09f9d1f85f23f6ea3734913aa3", - "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "af3468e5de5a0c2cb4e431239a5c0f2d", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "000e8ab249264b6757fe9a5d80ac2954", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "9c37a69f926d48fc442e4fce842db161", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "e135d9e45e063a6eae61b8d8e621452e", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "edae00044408aeb1e2c8bf8df14dbbec", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "78b57913e94e8106c443b15b14264c43", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "1d1dc16cc03ba9ed0330cf3e2d069b94", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "25aaf8090719e05b7a76a0c9cd10f6d1", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "e3593efe1a6c48977d70bc51f72e419e", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "16c5eddc745dc4a601cb2ee364b71e31", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "51a65b326094cf210be9d7d085e57c2b", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "96e368ec6da34e00222328f3e2821320", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b7a33145dfe3f18adf42133a0843be2d", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "e7642737ca3a0ff3f034a073e657ef42", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "376c2361f94219726a082b745f500db7", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "339b5cc93d9db484800f488cf1b2f4b9", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "cf9527c43d75f7a51f483e17a59eab82", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "758b91a1374bfbd8489b2cc68ec18bd2", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "33d824f0b6f30446167636ad68e9a4ae", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "7203b89f81d3315822156e0041429aef", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "0d4048eccd45dbf7a6269722def6accd", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "06481d98907f976a3f9ee0273ceaff38", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "db76906a502c58fedb79ebe9237cd8ec", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "91ce9cf92332763823df13fec765da78", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "a8e9aadab42b687abd5c3c299f3373e4", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "a354c943a42e737044029f746df3e74b", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "7936c43cf14fa0912c9261d03d478a91", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "0d82db33672ec85d7e720e9233b22e84", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "d041406d19983269b8ba5e576186521d", + "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "47cd40a453b5e7c8031c36afe51cfc74", + "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "61b8d712130f831f049179bf25c96b86", + "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "47cd40a453b5e7c8031c36afe51cfc74", + "build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "61b8d712130f831f049179bf25c96b86", + "build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "a26331b58f4511138f90106ce28a595e", + "build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "3292f6eaed1c1715754b15cf9dac3108", + "build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "a26331b58f4511138f90106ce28a595e", + "build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "3292f6eaed1c1715754b15cf9dac3108", + "build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "b89d6a533de222a7cd988d575ffb0b65", + "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "d4a9e505da7243d9418d99805ccd0550", + "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "b89d6a533de222a7cd988d575ffb0b65", + "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "d4a9e505da7243d9418d99805ccd0550", + "build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "c551a02dc318a7f665a727f88cf2b1c1", + "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "8911877eeeabd36033f4552c84d18f96", + "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "7cc7fd84cf143a1e4e1429ef7cb8bf18", + "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "8911877eeeabd36033f4552c84d18f96", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "c48af47c5fbbb085a65d00598050d30d", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "03fd14ef8f7baf3d25612a9d31792f4b", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "5aea1501b99692a6675f7566944f4523", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "a3198455822b3576a17e0e57bf79e9ee", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "d18789c1c44f7bc9d9c808385df18555", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "8de2be3f0402065db2a75708d1ba08af", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "591e71334f4da572cfdae7c603e25f55", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "87461e54837ca42f9e45dc0926746133", "src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "794d258d59fd17a61752843a9a0551ad", "src/ballistica/base/mgen/pyembed/binding_base.inc": "efa61468cf098f77cc6a234461d8b86d", diff --git a/CHANGELOG.md b/CHANGELOG.md index 949b149e..0f9a8f1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 22057, api 9, 2024-10-22) +### 1.7.37 (build 22062, api 9, 2024-10-22) - Bumping api version to 9. As you'll see below, there's some UI changes that will require a bit of work for any UI mods to adapt to. If your mods don't touch UI stuff at all you can simply bump your api version and call it a day. diff --git a/src/assets/ba_data/python/babase/_accountv2.py b/src/assets/ba_data/python/babase/_accountv2.py index 9d313dc6..0d96a380 100644 --- a/src/assets/ba_data/python/babase/_accountv2.py +++ b/src/assets/ba_data/python/babase/_accountv2.py @@ -19,8 +19,7 @@ if TYPE_CHECKING: from babase._login import LoginAdapter, LoginInfo - -DEBUG_LOG = False +logger = logging.getLogger('ba.accountv2') class AccountV2Subsystem: @@ -255,13 +254,12 @@ class AccountV2Subsystem: # generally this means the user has explicitly signed in/out or # switched accounts within that back-end. if prev_state != new_state: - if DEBUG_LOG: - logging.debug( - 'AccountV2: Implicit state changed (%s -> %s);' - ' will update app sign-in state accordingly.', - prev_state, - new_state, - ) + logger.debug( + 'Implicit state changed (%s -> %s);' + ' will update app sign-in state accordingly.', + prev_state, + new_state, + ) self._implicit_state_changed = True # We may want to auto-sign-in based on this new state. @@ -292,11 +290,9 @@ class AccountV2Subsystem: if self._implicit_signed_in_adapter is None: # If implicit back-end has signed out, we follow suit # immediately; no need to wait for network connectivity. - if DEBUG_LOG: - logging.debug( - 'AccountV2: Signing out as result' - ' of implicit state change...', - ) + logger.debug( + 'Signing out as result of implicit state change...', + ) plus.accounts.set_primary_credentials(None) self._implicit_state_changed = False @@ -313,11 +309,9 @@ class AccountV2Subsystem: # switching accounts via the back-end). NOTE: should # test case where we don't have connectivity here. if plus.cloud.is_connected(): - if DEBUG_LOG: - logging.debug( - 'AccountV2: Signing in as result' - ' of implicit state change...', - ) + logger.debug( + 'Signing in as result of implicit state change...', + ) self._implicit_signed_in_adapter.sign_in( self._on_explicit_sign_in_completed, description='implicit state change', @@ -348,10 +342,9 @@ class AccountV2Subsystem: and not signed_in_v2 and self._implicit_signed_in_adapter is not None ): - if DEBUG_LOG: - logging.debug( - 'AccountV2: Signing in due to on-launch-auto-sign-in...', - ) + logger.debug( + 'Signing in due to on-launch-auto-sign-in...', + ) self._can_do_auto_sign_in = False # Only ATTEMPT once self._implicit_signed_in_adapter.sign_in( self._on_implicit_sign_in_completed, description='auto-sign-in' diff --git a/src/assets/ba_data/python/babase/_login.py b/src/assets/ba_data/python/babase/_login.py index 0f3d1c4c..eb0cc89f 100644 --- a/src/assets/ba_data/python/babase/_login.py +++ b/src/assets/ba_data/python/babase/_login.py @@ -17,8 +17,7 @@ import _babase if TYPE_CHECKING: from typing import Callable - -DEBUG_LOG = False +logger = logging.getLogger('ba.loginadapter') @dataclass @@ -94,20 +93,17 @@ class LoginAdapter: if state == self._implicit_login_state: return - if DEBUG_LOG: - if state is None: - logging.debug( - 'LoginAdapter: %s implicit state changed;' - ' now signed out.', - self.login_type.name, - ) - else: - logging.debug( - 'LoginAdapter: %s implicit state changed;' - ' now signed in as %s.', - self.login_type.name, - state.display_name, - ) + if state is None: + logger.debug( + '%s implicit state changed; now signed out.', + self.login_type.name, + ) + else: + logger.debug( + '%s implicit state changed; now signed in as %s.', + self.login_type.name, + state.display_name, + ) self._implicit_login_state = state self._implicit_login_state_dirty = True @@ -128,12 +124,11 @@ class LoginAdapter: only a reference to it is stored, not a copy. """ assert _babase.in_logic_thread() - if DEBUG_LOG: - logging.debug( - 'LoginAdapter: %s adapter got active logins %s.', - self.login_type.name, - {k: v[:4] + '...' + v[-4:] for k, v in logins.items()}, - ) + logger.debug( + '%s adapter got active logins %s.', + self.login_type.name, + {k: v[:4] + '...' + v[-4:] for k, v in logins.items()}, + ) self._active_login_id = logins.get(self.login_type) self._update_back_end_active() @@ -197,24 +192,21 @@ class LoginAdapter: self._last_sign_in_desc = description self._last_sign_in_time = now - if DEBUG_LOG: - logging.debug( - 'LoginAdapter: %s adapter sign_in() called;' - ' fetching sign-in-token...', - self.login_type.name, - ) + logger.debug( + '%s adapter sign_in() called; fetching sign-in-token...', + self.login_type.name, + ) def _got_sign_in_token_result(result: str | None) -> None: import bacommon.cloud # Failed to get a sign-in-token. if result is None: - if DEBUG_LOG: - logging.debug( - 'LoginAdapter: %s adapter sign-in-token fetch failed;' - ' aborting sign-in.', - self.login_type.name, - ) + logger.debug( + '%s adapter sign-in-token fetch failed;' + ' aborting sign-in.', + self.login_type.name, + ) _babase.pushcall( partial( result_cb, @@ -227,25 +219,22 @@ class LoginAdapter: # Got a sign-in token! Now pass it to the cloud which will use # it to verify our identity and give us app credentials on # success. - if DEBUG_LOG: - logging.debug( - 'LoginAdapter: %s adapter sign-in-token fetch succeeded;' - ' passing to cloud for verification...', - self.login_type.name, - ) + logger.debug( + '%s adapter sign-in-token fetch succeeded;' + ' passing to cloud for verification...', + self.login_type.name, + ) def _got_sign_in_response( response: bacommon.cloud.SignInResponse | Exception, ) -> None: # This likely means we couldn't communicate with the server. if isinstance(response, Exception): - if DEBUG_LOG: - logging.debug( - 'LoginAdapter: %s adapter got error' - ' sign-in response: %s', - self.login_type.name, - response, - ) + logger.debug( + '%s adapter got error sign-in response: %s', + self.login_type.name, + response, + ) _babase.pushcall(partial(result_cb, self, response)) else: # This means our credentials were explicitly rejected. @@ -254,12 +243,10 @@ class LoginAdapter: RuntimeError('Sign-in-token was rejected.') ) else: - if DEBUG_LOG: - logging.debug( - 'LoginAdapter: %s adapter got successful' - ' sign-in response', - self.login_type.name, - ) + logger.debug( + '%s adapter got successful sign-in response', + self.login_type.name, + ) result2 = self.SignInResult( credentials=response.credentials ) @@ -305,12 +292,10 @@ class LoginAdapter: # any existing state so it can properly respond to this. if self._implicit_login_state_dirty and self._on_app_loading_called: - if DEBUG_LOG: - logging.debug( - 'LoginAdapter: %s adapter sending' - ' implicit-state-changed to app.', - self.login_type.name, - ) + logger.debug( + '%s adapter sending implicit-state-changed to app.', + self.login_type.name, + ) assert _babase.app.plus is not None _babase.pushcall( @@ -331,12 +316,11 @@ class LoginAdapter: self._implicit_login_state.login_id == self._active_login_id ) if was_active != is_active: - if DEBUG_LOG: - logging.debug( - 'LoginAdapter: %s adapter back-end-active is now %s.', - self.login_type.name, - is_active, - ) + logger.debug( + '%s adapter back-end-active is now %s.', + self.login_type.name, + is_active, + ) self.on_back_end_active_change(is_active) self._back_end_active = is_active diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index fbabfb34..99921968 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -53,7 +53,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 22057 +TARGET_BALLISTICA_BUILD = 22062 TARGET_BALLISTICA_VERSION = '1.7.37' diff --git a/src/assets/ba_data/python/baplus/_cloud.py b/src/assets/ba_data/python/baplus/_cloud.py index ca446705..9d24d3f5 100644 --- a/src/assets/ba_data/python/baplus/_cloud.py +++ b/src/assets/ba_data/python/baplus/_cloud.py @@ -15,7 +15,7 @@ if TYPE_CHECKING: from efro.message import Message, Response import bacommon.cloud -DEBUG_LOG = False +logger = logging.getLogger('ba.cloud') # TODO: Should make it possible to define a protocol in bacommon.cloud and # autogenerate this. That would give us type safety between this and @@ -40,8 +40,7 @@ class CloudSubsystem(babase.AppSubsystem): def on_connectivity_changed(self, connected: bool) -> None: """Called when cloud connectivity state changes.""" - if DEBUG_LOG: - logging.debug('CloudSubsystem: Connectivity is now %s.', connected) + logger.debug('Connectivity is now %s.', connected) plus = babase.app.plus assert plus is not None diff --git a/src/ballistica/base/app_adapter/app_adapter_sdl.cc b/src/ballistica/base/app_adapter/app_adapter_sdl.cc index c8397f6c..beec9de7 100644 --- a/src/ballistica/base/app_adapter/app_adapter_sdl.cc +++ b/src/ballistica/base/app_adapter/app_adapter_sdl.cc @@ -46,12 +46,6 @@ class AppAdapterSDL::ScopedAllowGraphics_ { AppAdapterSDL::AppAdapterSDL() { assert(!g_core->HeadlessMode()); assert(g_core->InMainThread()); - - // Enable display-time debug logs via env var. - auto val = g_core->platform->GetEnv("BA_DEBUG_LOG_SDL_FRAME_TIMING"); - if (val && *val == "1") { - debug_log_sdl_frame_timing_ = true; - } } void AppAdapterSDL::OnMainThreadStartApp() { @@ -286,16 +280,15 @@ void AppAdapterSDL::SleepUntilNextEventCycle_(microsecs_t cycle_start_time) { // Special case: if we've got vsync enabled, let's tweak our drawing to // happen just a *tiny* bit faster than requested. This means, if our - // max-fps matches the refresh rate, we'll be trying to render just a - // *bit* faster than vsync which should push us up against the vsync wall - // and keep vsync doing most of the delay work. In that case the logging - // below should show mostly 'no sleep.'. Without this delay, our render - // kick-offs tend to drift around the middle of the vsync cycle and I - // worry there could be bad interference patterns in certain spots close - // to the edges. Note that we want this tweak to be small enough that it - // won't be noticable in situations where vsync and max-fps *don't* match. - // For instance, limiting to 60hz on a 120hz vsynced monitor should still - // work as expected. + // max-fps matches the refresh rate, we should gently push us up against + // the vsync wall and keep vsync doing most of the delay work. In that + // case the logging below should show mostly 'no sleep.'. Without this + // delay, our render kick-offs tend to drift around the middle of the + // vsync cycle and I worry there could be bad interference patterns in + // certain spots close to the edges. Note that we want this tweak to be + // small enough that it won't be noticable in situations where vsync and + // max-fps *don't* match. For instance, limiting to 60hz on a 120hz + // vsynced monitor should still work as expected. if (vsync_actually_enabled_) { millisecs_per_frame = 99 * millisecs_per_frame / 100; } @@ -307,19 +300,19 @@ void AppAdapterSDL::SleepUntilNextEventCycle_(microsecs_t cycle_start_time) { // oversleep system will compensate for our earliness just as it does if // we sleep too long. const microsecs_t min_sleep{2000}; + if (now + min_sleep >= target_time) { - if (debug_log_sdl_frame_timing_) { - g_core->Log(LogName::kBaNetworking, LogLevel::kDebug, - "no sleep."); // 'till brooklyn! - } + g_core->Log(LogName::kBaGraphics, LogLevel::kDebug, + "no sleep."); // 'till brooklyn! } else { - if (debug_log_sdl_frame_timing_) { - char buf[256]; - snprintf(buf, sizeof(buf), "render %.1f sleep %.1f", - (now - cycle_start_time) / 1000.0f, - (target_time - now) / 1000.0f); - g_core->Log(LogName::kBaNetworking, LogLevel::kDebug, buf); - } + g_core->Log(LogName::kBaGraphics, LogLevel::kDebug, + [now, cycle_start_time, target_time] { + char buf[256]; + snprintf(buf, sizeof(buf), "render %.1fms sleep %.1fms", + (now - cycle_start_time) / 1000.0f, + (target_time - now) / 1000.0f); + return std::string(buf); + }); g_core->platform->SleepMicrosecs(target_time - now); } diff --git a/src/ballistica/base/app_adapter/app_adapter_sdl.h b/src/ballistica/base/app_adapter/app_adapter_sdl.h index 3151df45..6fd8d672 100644 --- a/src/ballistica/base/app_adapter/app_adapter_sdl.h +++ b/src/ballistica/base/app_adapter/app_adapter_sdl.h @@ -80,7 +80,6 @@ class AppAdapterSDL : public AppAdapter { bool done_{}; bool fullscreen_{}; bool vsync_actually_enabled_{}; - bool debug_log_sdl_frame_timing_{}; bool hidden_{}; /// With this off, graphics call pushes simply get pushed to the main diff --git a/src/ballistica/core/core.h b/src/ballistica/core/core.h index 6dfc3487..1766396c 100644 --- a/src/ballistica/core/core.h +++ b/src/ballistica/core/core.h @@ -212,6 +212,10 @@ class CoreFeatureSet { void Log(LogName name, LogLevel level, const char* msg); void Log(LogName name, LogLevel level, char* msg); + /// Log call variant taking a call returning a string instead of a string + /// directly. This can be useful for log strings requiring significant + /// effort to construct, as the call will be skipped if the log level is + /// not currently visible. template void Log(LogName name, LogLevel level, C getmsgcall) { if (!LogLevelEnabled(name, level)) { diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index e4be6bd0..58c87d83 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 = 22057; +const int kEngineBuildNumber = 22062; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9;