mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-19 21:37:57 +08:00
Merge branch 'efroemling:master' into master
This commit is contained in:
commit
322992f4d1
88
.efrocachemap
generated
88
.efrocachemap
generated
@ -4056,50 +4056,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": "f0961021482a27c4904f33cf85ab86bb",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "b04eefee14228822208b6143048867de",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "83bde2fb0374153d753f917d6ab693d9",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "6765c40945fdecd8fd0eae796c2a1075",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "839e1cecbdec8364aea5b1c31fe1cf7b",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "2b3c91667b63f9fa6ecf807e021367e2",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "b8486cc3705974cf880a0c7bbd210902",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "a04084a19bbb6ef8111113ff7c003198",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "aef8e462af8e1d0439bf72ec84778611",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "f85863b0ea0145e7a51dd3f85d37663f",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "0dbc09374baeabbf20cf0a052be94b8b",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "67545befcd59c6764d2868c1aae24776",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "7b1a4d61fd25efb514dbc005c20369b5",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "5c755b14c9ec4938504cbffcd0369a25",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "b8229bd1716bd4787d1efd58f476c21f",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "146eb16386394bfc34baa40b31007c5d",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "d08c8a35cc951adb8c78f6b5ed61a41e",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "ecd356d753266666d36b67b018ed2b6e",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "2c9ad739ec8a2b0f333ef7d0f38cd7b0",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "e9c2a5c54ecc34cf35a8db42367ddb3d",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "58946f3534363d88f713c54d3d643d6d",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "be356d05ecccd68043258d87b1892805",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "58946f3534363d88f713c54d3d643d6d",
|
||||
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "be356d05ecccd68043258d87b1892805",
|
||||
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "bf7d793d62416db7273590a796001cb6",
|
||||
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "b309e0cc3ec04024712c4ca938efdb92",
|
||||
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "bf7d793d62416db7273590a796001cb6",
|
||||
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "b309e0cc3ec04024712c4ca938efdb92",
|
||||
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "a86b09c31abf0b5ec934ef28c8bd9fa3",
|
||||
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "87be7a2f6e83c495f99024bb68660e17",
|
||||
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "a86b09c31abf0b5ec934ef28c8bd9fa3",
|
||||
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "87be7a2f6e83c495f99024bb68660e17",
|
||||
"build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "9fb5d3cb36dd53bd18c7ca831e7c73ee",
|
||||
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "88332859e6e9ee70848f5252e5ee6ce0",
|
||||
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "55b6db8700acfc573cc3db31c6b210f7",
|
||||
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "88332859e6e9ee70848f5252e5ee6ce0",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "cf40ba3bce2391e82978b08785405a5e",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "a8a74156e04932a2a5cc6d2d4b202acf",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "a135f9210a1c3be6b5d5d8228c8f6184",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "e412e20e4a0ac33b9f83c7750cde7109",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "cfcae11dab1c6752f821f0816706fa47",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "16daa37287a6d9d3404461da8565aadb",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "b3faf8b8925145f121b09e67d6114fb8",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "ed7ec02978df94f92168c5990cb6c78c",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "4129fd84c3c64b770c4343d347bff97a",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "76b293b2d942716c2606c56e13483e66",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "9cc2a5d464da1e0822ecf5493ac28b64",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "40e605e595f00286805cf15ffc096813",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "bdc47e8dd94bcfc2a7b8268ea366f9b5",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "6b57b2de2d4aefcb3a5f7df6cef53a9d",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "34c65f2a9f280420387af135d5bc6a2d",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "79e4d857fbd0871940c7fd6985d11af1",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "ce179db11df98c7dc53bd2fd2a710909",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "d47c86f2654185ab0690949c3b8f2913",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "a33fb01bdbeb7be34046d7b64673991c",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "5f4cb90415aed9415231e95394384d2a",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "26540ab81b0ad717818e077efcb9029d",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "11fc4a0cdf83c362b2f5c0c62a53014e",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "ba10cfebc435f211be18dbdc7416097d",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "551b8dba96bfc65c5166cde6bec37539",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "bc18f0765c9d96731a1b1a7acf5151db",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "1f1a8227190894db122fb43691371a92",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "9d546413ee365044d77e0e9c39ed77bb",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "470b427c4e51254538291ac56298c212",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "a61cf6ac9afd43081df7f63ff81f4036",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "f93bc8f98ee31f39b54ab46264eccb22",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "a61cf6ac9afd43081df7f63ff81f4036",
|
||||
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "f93bc8f98ee31f39b54ab46264eccb22",
|
||||
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "117f4fc8b60372763ecae00d332947a8",
|
||||
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "d8d74c6c40db43054ccc7d27920cfbfe",
|
||||
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "117f4fc8b60372763ecae00d332947a8",
|
||||
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "d8d74c6c40db43054ccc7d27920cfbfe",
|
||||
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "ba3a67e11c268a5b81b3416bc90cc297",
|
||||
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "d935dc21becdfd65bec51c5f5b2fd770",
|
||||
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "ba3a67e11c268a5b81b3416bc90cc297",
|
||||
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "d935dc21becdfd65bec51c5f5b2fd770",
|
||||
"build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "c5fb4b7f765cfd68ff09bcef3c5f84e6",
|
||||
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "c8715c85010ea431d7346f40f5421819",
|
||||
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "737778fc5e6a6ed5ca154c7953fcb377",
|
||||
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "c8715c85010ea431d7346f40f5421819",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "dfd5dca061d6eacaccc38c12d391cc82",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "96ab39f16820a39fa7c42af6779c3556",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "d87f20b0a0192b90687b936b6c2ad103",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "4a336c3e976924b70b39d18af6040e41",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "77d10f03566f29816de9b2ff806cc905",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "d90ef473768f7ba232ae3ca58c5c8c04",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "743d872f2c848a84e4e5d49ca6b426e9",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "36272a00b45729022167baa81749a37e",
|
||||
"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": "ba8ce3ca3858b4c2d20db68f99b788b2",
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
### 1.7.28 (build 21443, api 8, 2023-10-11)
|
||||
### 1.7.28 (build 21447, api 8, 2023-10-12)
|
||||
|
||||
- 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
|
||||
attempting to support various old/hacked versions of SDL, etc. I ripped out
|
||||
huge chunks of it and put back still-relevant pieces in a much more cleanly
|
||||
designed way. This should put us in a much better place for supporting various
|
||||
platforms and making graphical improvements going forward. See
|
||||
platforms and making graphical improvements going forward.
|
||||
`ballistica/base/app_adapter/app_adapter_sdl.cc` for an example of the now
|
||||
nicely implemented system.
|
||||
- The engine now requires OpenGL 3.0 or newer on desktop and OpenGL ES 3.0 or
|
||||
|
||||
@ -52,7 +52,7 @@ if TYPE_CHECKING:
|
||||
|
||||
# Build number and version of the ballistica binary we expect to be
|
||||
# using.
|
||||
TARGET_BALLISTICA_BUILD = 21443
|
||||
TARGET_BALLISTICA_BUILD = 21447
|
||||
TARGET_BALLISTICA_VERSION = '1.7.28'
|
||||
|
||||
|
||||
|
||||
@ -34,8 +34,8 @@ class AppAdapterApple::ScopedAllowGraphics_ {
|
||||
};
|
||||
|
||||
auto AppAdapterApple::ManagesMainThreadEventLoop() const -> bool {
|
||||
// Nope; we run under a standard Cocoa/UIKit environment and they call us; we
|
||||
// don't call them.
|
||||
// Nope; we run under a standard Cocoa/UIKit environment and they call us;
|
||||
// we don't call them.
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ void AppAdapterApple::SetScreen_(
|
||||
|
||||
auto* gs = g_base->graphics_server;
|
||||
|
||||
// We need a full renderer reload if quality values have changed
|
||||
// or if we don't have one yet.
|
||||
// We need a full renderer reload if quality values have changed or if we
|
||||
// don't have one yet.
|
||||
bool need_full_reload =
|
||||
((gs->texture_quality_requested() != texture_quality_requested)
|
||||
|| (gs->graphics_quality_requested() != graphics_quality_requested)
|
||||
@ -105,10 +105,10 @@ void AppAdapterApple::ReloadRenderer_(
|
||||
gs->set_renderer(new RendererGL());
|
||||
}
|
||||
|
||||
// Set a dummy screen resolution to start with.
|
||||
// The main thread will kick along the latest real resolution just before
|
||||
// each frame draw, but we need *something* here or else we'll get errors due
|
||||
// to framebuffers getting made at size 0/etc.
|
||||
// Set a dummy screen resolution to start with. The main thread will kick
|
||||
// along the latest real resolution just before each frame draw, but we
|
||||
// need *something* here or else we'll get errors due to framebuffers
|
||||
// getting made at size 0/etc.
|
||||
g_base->graphics_server->SetScreenResolution(320.0, 240.0);
|
||||
|
||||
// Update graphics quality based on request.
|
||||
@ -135,8 +135,8 @@ auto AppAdapterApple::TryRender() -> bool {
|
||||
// Run & release any pending runnables.
|
||||
std::vector<Runnable*> calls;
|
||||
{
|
||||
// Pull calls off the list before running them; this way we only need
|
||||
// to grab the list lock for a moment.
|
||||
// Pull calls off the list before running them; this way we only need to
|
||||
// grab the list lock for a moment.
|
||||
auto lock = std::scoped_lock(graphics_calls_mutex_);
|
||||
if (!graphics_calls_.empty()) {
|
||||
graphics_calls_.swap(calls);
|
||||
@ -157,7 +157,6 @@ auto AppAdapterApple::InGraphicsContext() -> bool {
|
||||
}
|
||||
|
||||
void AppAdapterApple::DoPushGraphicsContextRunnable(Runnable* runnable) {
|
||||
// In strict mode, make sure we're in our TryRender() call.
|
||||
auto lock = std::scoped_lock(graphics_calls_mutex_);
|
||||
if (graphics_calls_.size() > 1000) {
|
||||
BA_LOG_ONCE(LogLevel::kError, "graphics_calls_ got too big.");
|
||||
@ -171,10 +170,10 @@ auto AppAdapterApple::ShouldUseCursor() -> bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Anywhere else (iOS, tvOS, etc.) just say no cursor for now. The OS
|
||||
// may draw one in some cases (trackpad connected to iPad, etc.) but we
|
||||
// don't interfere and just let the OS draw its normal cursor in that
|
||||
// case. Can revisit this later if that becomes a more common scenario.
|
||||
// Anywhere else (iOS, tvOS, etc.) just say no cursor for now. The OS may
|
||||
// draw one in some cases (trackpad connected to iPad, etc.) but we don't
|
||||
// interfere and just let the OS draw its normal cursor in that case. Can
|
||||
// revisit this later if that becomes a more common scenario.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ void AppAdapterSDL::DoApplyAppConfig() {
|
||||
// g_base->app_config->Resolve(AppConfig::StringID::kResolutionAndroid);
|
||||
|
||||
bool fullscreen = g_base->app_config->Resolve(AppConfig::BoolID::kFullscreen);
|
||||
fullscreen = false;
|
||||
|
||||
auto vsync = g_base->graphics->VSyncFromAppConfig();
|
||||
int max_fps = g_base->app_config->Resolve(AppConfig::IntID::kMaxFPS);
|
||||
|
||||
@ -747,7 +747,6 @@ void AppAdapterSDL::UpdateScreenSizes_() {
|
||||
static_cast<float>(pixels_y));
|
||||
}
|
||||
|
||||
/// As a default, allow graphics stuff in the main thread.
|
||||
auto AppAdapterSDL::InGraphicsContext() -> bool {
|
||||
// In strict mode, make sure we're in the right thread *and* within our
|
||||
// render call.
|
||||
|
||||
@ -89,7 +89,7 @@ void Logic::OnGraphicsReady() {
|
||||
// Let the Python layer know the native layer is now fully functional.
|
||||
// This will probably result in the Python layer flipping to the INITING
|
||||
// state.
|
||||
CompleteAppBootstrapping();
|
||||
CompleteAppBootstrapping_();
|
||||
|
||||
if (g_core->HeadlessMode()) {
|
||||
// Normally we step display-time as part of our frame-drawing process.
|
||||
@ -100,7 +100,7 @@ void Logic::OnGraphicsReady() {
|
||||
// variety of rates anyway. NOTE: This length is currently milliseconds.
|
||||
headless_display_time_step_timer_ = event_loop()->NewTimer(
|
||||
kAppModeMinHeadlessDisplayStep / 1000, true,
|
||||
NewLambdaRunnable([this] { StepDisplayTime(); }));
|
||||
NewLambdaRunnable([this] { StepDisplayTime_(); }));
|
||||
} else {
|
||||
// In gui mode, push an initial frame to the graphics server. From this
|
||||
// point it will be self-sustaining, sending us a frame request each
|
||||
@ -109,7 +109,7 @@ void Logic::OnGraphicsReady() {
|
||||
}
|
||||
}
|
||||
|
||||
void Logic::CompleteAppBootstrapping() {
|
||||
void Logic::CompleteAppBootstrapping_() {
|
||||
assert(g_base->InLogicThread());
|
||||
assert(g_base->CurrentContext().IsEmpty());
|
||||
|
||||
@ -133,7 +133,7 @@ void Logic::CompleteAppBootstrapping() {
|
||||
|
||||
// Set up our timers.
|
||||
process_pending_work_timer_ = event_loop()->NewTimer(
|
||||
0, true, NewLambdaRunnable([this] { ProcessPendingWork(); }));
|
||||
0, true, NewLambdaRunnable([this] { ProcessPendingWork_(); }));
|
||||
asset_prune_timer_ = event_loop()->NewTimer(
|
||||
2345, true, NewLambdaRunnable([] { g_base->assets->Prune(); }));
|
||||
|
||||
@ -153,7 +153,7 @@ void Logic::CompleteAppBootstrapping() {
|
||||
.Get(BasePython::ObjID::kAppOnNativeBootstrappingCompleteCall)
|
||||
.Call();
|
||||
|
||||
UpdatePendingWorkTimer();
|
||||
UpdatePendingWorkTimer_();
|
||||
}
|
||||
|
||||
void Logic::OnAppRunning() {
|
||||
@ -333,7 +333,7 @@ void Logic::OnScreenSizeChange(float virtual_width, float virtual_height,
|
||||
}
|
||||
|
||||
// Bring all logic-thread stuff up to date for a new visual frame.
|
||||
void Logic::StepDisplayTime() {
|
||||
void Logic::StepDisplayTime_() {
|
||||
assert(g_base->InLogicThread());
|
||||
|
||||
// We have two different modes of operation here. When running in headless
|
||||
@ -343,9 +343,9 @@ void Logic::StepDisplayTime() {
|
||||
// real draw times and is intended to keep frame intervals as visually
|
||||
// consistent and smooth looking as possible.
|
||||
if (g_core->HeadlessMode()) {
|
||||
UpdateDisplayTimeForHeadlessMode();
|
||||
UpdateDisplayTimeForHeadlessMode_();
|
||||
} else {
|
||||
UpdateDisplayTimeForFrameDraw();
|
||||
UpdateDisplayTimeForFrameDraw_();
|
||||
}
|
||||
|
||||
// Give all our subsystems some update love.
|
||||
@ -366,7 +366,7 @@ void Logic::StepDisplayTime() {
|
||||
display_timers_->Run(display_time_microsecs_);
|
||||
|
||||
if (g_core->HeadlessMode()) {
|
||||
PostUpdateDisplayTimeForHeadlessMode();
|
||||
PostUpdateDisplayTimeForHeadlessMode_();
|
||||
}
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@ void Logic::OnAppModeChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
void Logic::UpdateDisplayTimeForHeadlessMode() {
|
||||
void Logic::UpdateDisplayTimeForHeadlessMode_() {
|
||||
assert(g_base->InLogicThread());
|
||||
// In this case we just keep display time synced up with app time; we
|
||||
// don't care about keeping the increments smooth or consistent.
|
||||
@ -418,7 +418,7 @@ void Logic::UpdateDisplayTimeForHeadlessMode() {
|
||||
}
|
||||
}
|
||||
|
||||
void Logic::PostUpdateDisplayTimeForHeadlessMode() {
|
||||
void Logic::PostUpdateDisplayTimeForHeadlessMode_() {
|
||||
assert(g_base->InLogicThread());
|
||||
// At this point we've stepped our app-mode, so let's ask it how long
|
||||
// we've got until the next event. We'll plug this into our display-update
|
||||
@ -443,7 +443,7 @@ void Logic::PostUpdateDisplayTimeForHeadlessMode() {
|
||||
headless_display_time_step_timer_->SetLength(sleep_millisecs);
|
||||
}
|
||||
|
||||
void Logic::UpdateDisplayTimeForFrameDraw() {
|
||||
void Logic::UpdateDisplayTimeForFrameDraw_() {
|
||||
// Here we update our smoothed display-time-increment based on how fast we
|
||||
// are currently rendering frames. We want display-time to basically be
|
||||
// progressing at the same rate as app-time but in as constant of a manner
|
||||
@ -568,7 +568,7 @@ void Logic::UpdateDisplayTimeForFrameDraw() {
|
||||
}
|
||||
|
||||
// Set up our sleeping based on what we're doing.
|
||||
void Logic::UpdatePendingWorkTimer() {
|
||||
void Logic::UpdatePendingWorkTimer_() {
|
||||
assert(g_base->InLogicThread());
|
||||
|
||||
// This might get called before we set up our timer in some cases. (such
|
||||
@ -626,13 +626,13 @@ void Logic::Draw() {
|
||||
// drawn. But as high frame rates are becoming more normal this becomes
|
||||
// less and less meaningful and its probably best to prioritize smooth
|
||||
// visuals.
|
||||
StepDisplayTime();
|
||||
StepDisplayTime_();
|
||||
}
|
||||
|
||||
void Logic::NotifyOfPendingAssetLoads() {
|
||||
assert(g_base->InLogicThread());
|
||||
have_pending_loads_ = true;
|
||||
UpdatePendingWorkTimer();
|
||||
UpdatePendingWorkTimer_();
|
||||
}
|
||||
|
||||
auto Logic::NewAppTimer(millisecs_t length, bool repeat,
|
||||
@ -687,9 +687,9 @@ void Logic::SetDisplayTimerLength(int timer_id, microsecs_t length) {
|
||||
}
|
||||
}
|
||||
|
||||
void Logic::ProcessPendingWork() {
|
||||
void Logic::ProcessPendingWork_() {
|
||||
have_pending_loads_ = g_base->assets->RunPendingLoadsLogicThread();
|
||||
UpdatePendingWorkTimer();
|
||||
UpdatePendingWorkTimer_();
|
||||
}
|
||||
|
||||
} // namespace ballistica::base
|
||||
|
||||
@ -109,17 +109,17 @@ class Logic {
|
||||
auto shutdown_completed() const { return shutdown_completed_; }
|
||||
|
||||
private:
|
||||
void UpdateDisplayTimeForFrameDraw();
|
||||
void UpdateDisplayTimeForHeadlessMode();
|
||||
void PostUpdateDisplayTimeForHeadlessMode();
|
||||
void CompleteAppBootstrapping();
|
||||
void ProcessPendingWork();
|
||||
void UpdatePendingWorkTimer();
|
||||
void StepDisplayTime();
|
||||
void UpdateDisplayTimeForFrameDraw_();
|
||||
void UpdateDisplayTimeForHeadlessMode_();
|
||||
void PostUpdateDisplayTimeForHeadlessMode_();
|
||||
void CompleteAppBootstrapping_();
|
||||
void ProcessPendingWork_();
|
||||
void UpdatePendingWorkTimer_();
|
||||
void StepDisplayTime_();
|
||||
|
||||
double display_time_{};
|
||||
microsecs_t display_time_microsecs_{};
|
||||
double display_time_increment_{1.0 / 60.0};
|
||||
microsecs_t display_time_microsecs_{};
|
||||
microsecs_t display_time_increment_microsecs_{1000000 / 60};
|
||||
|
||||
// GUI scheduling.
|
||||
@ -128,20 +128,20 @@ class Logic {
|
||||
int recent_display_time_increments_index_{-1};
|
||||
|
||||
// Headless scheduling.
|
||||
|
||||
std::unique_ptr<TimerList> display_timers_;
|
||||
EventLoop* event_loop_{};
|
||||
Timer* process_pending_work_timer_{};
|
||||
Timer* headless_display_time_step_timer_{};
|
||||
|
||||
Timer* process_pending_work_timer_{};
|
||||
Timer* asset_prune_timer_{};
|
||||
Timer* debug_timer_{};
|
||||
bool app_bootstrapping_complete_{};
|
||||
bool have_pending_loads_{};
|
||||
bool debug_log_display_time_{};
|
||||
bool applied_app_config_{};
|
||||
bool shutting_down_{};
|
||||
bool shutdown_completed_{};
|
||||
bool on_initial_screen_creation_complete_called_{};
|
||||
EventLoop* event_loop_{};
|
||||
std::unique_ptr<TimerList> display_timers_;
|
||||
bool app_bootstrapping_complete_ : 1 {};
|
||||
bool have_pending_loads_ : 1 {};
|
||||
bool debug_log_display_time_ : 1 {};
|
||||
bool applied_app_config_ : 1 {};
|
||||
bool shutting_down_ : 1 {};
|
||||
bool shutdown_completed_ : 1 {};
|
||||
bool on_initial_screen_creation_complete_called_ : 1 {};
|
||||
};
|
||||
|
||||
} // namespace ballistica::base
|
||||
|
||||
@ -485,7 +485,7 @@ auto BasePython::GetPyEnum_InputType(PyObject* obj) -> InputType {
|
||||
|
||||
// TODO(ericf): Make this a template.
|
||||
auto BasePython::PyQuitType(QuitType val) -> PythonRef {
|
||||
auto args = PythonRef::Stolen(Py_BuildValue("(d)", static_cast<int>(val)));
|
||||
auto args = PythonRef::Stolen(Py_BuildValue("(i)", static_cast<int>(val)));
|
||||
auto out = objs().Get(BasePython::ObjID::kQuitTypeClass).Call(args);
|
||||
BA_PRECONDITION(out.Exists());
|
||||
return out;
|
||||
|
||||
@ -533,7 +533,7 @@ static PyMethodDef PyQuitDef = {
|
||||
METH_VARARGS | METH_KEYWORDS, // flags
|
||||
|
||||
"quit(confirm: bool = False,\n"
|
||||
" quit_type: babase.QuitType = babase.QuitType.SOFT\n"
|
||||
" quit_type: babase.QuitType | None = None\n"
|
||||
") -> None\n"
|
||||
"\n"
|
||||
"Quit the app.\n"
|
||||
@ -542,7 +542,8 @@ static PyMethodDef PyQuitDef = {
|
||||
"\n"
|
||||
"If 'confirm' is True, a confirm dialog will be presented if conditions\n"
|
||||
"allow; otherwise the quit will still be immediate.\n"
|
||||
"See docs for babase.QuitType for explanations of its behavior."};
|
||||
"See docs for babase.QuitType for explanations of the optional\n"
|
||||
"'quit_type' arg."};
|
||||
|
||||
// ----------------------------- apply_config ----------------------------------
|
||||
|
||||
|
||||
@ -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 = 21443;
|
||||
const int kEngineBuildNumber = 21447;
|
||||
const char* kEngineVersion = "1.7.28";
|
||||
const int kEngineApiVersion = 8;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user