From daa2f571ce2d3a101e149912f5437348657b2b88 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 20 Oct 2023 18:27:17 -0700 Subject: [PATCH] tidying --- .efrocachemap | 56 ++++++------ CHANGELOG.md | 2 +- src/assets/ba_data/python/baenv.py | 2 +- src/ballistica/base/app_adapter/app_adapter.h | 5 -- .../base/app_adapter/app_adapter_apple.cc | 6 -- .../base/app_adapter/app_adapter_apple.h | 4 - .../base/app_adapter/app_adapter_sdl.cc | 89 ------------------- .../base/graphics/graphics_server.cc | 19 ---- .../base/graphics/graphics_server.h | 10 --- src/ballistica/shared/ballistica.cc | 2 +- 10 files changed, 31 insertions(+), 164 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 4f28e4fe..018b6d0c 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -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": "48b5a58b401a2b22b88491f7bcd0e22a", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "6d83849db3e1398503e2bb682eb4323e", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "b054c284b778dc77edc9c9b046303f46", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b16789743a603fac02763c09bbca446b", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "ab0a78d42cc511b4041478205e892897", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "4bbb41936ffe72a7fe9bdc803761b937", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "a1427251545496f84c4d4e2d90e6e25a", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "729bec30bafe25cac07f920c0cc30ab8", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "f8b086fdf6bca929ebc75b117b80f522", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "7d8f3ffe791e5a665ecbb2c517483814", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "5f4207138b152a110593c6c5ea8a9b32", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "4211f250197995e7df6942d32cffd202", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "40be1e38cbac3baf88dee161eeb912e1", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "d4aacb95a1855e969d1cc8db33732c40", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "570f49dc1de66e3fe75d76ee5f9306e0", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "ad319e6fb3cd7043a597f0780de42a98", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "4c15b26f43b4cb81f433beeb927c8aa6", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "a06aaa7a95abb56d49ba7925cc503a28", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "82619b88184faf3ef7ae4bf41ea282ce", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "61251e6fe58347224750fdf30d4bf8bc", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "a88d77584445b56200f7a4d8114479e8", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "4e88d22f136619fefd64f6ae0fd7e52c", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "a955ca7a92a1e76c93a3af5ffd0fcdf8", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "1d00f4ee25aff23dd1a12fa08a1427c7", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "8917a834461b62e8e31baf6d31f50dc6", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "a1292d9dfb8880ddfac6d6b0313ad9e9", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "b417628417ee7c7d652da528ab0df59f", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "7d5f3261fa944c79e3b5e80751c4ec02", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "afcc34bd2e482a0913ca9105413840ab", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "c4c62a908705df5c136a3df2eb58f67a", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "3e25752aea8cdc0ae68fb49869dfe79f", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "64ccbd2e2d2f3322663ca1b496b362ba", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "ab7725c946a92f76e0eb739d6c0e5c74", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "5190ee608b6b5b62a97620cae58241d3", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "aa29ab65e0c4d22bc81f85198c74c39f", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "89dddd6606408d3d9990992b8ae52deb", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "330b671091d23f4259dff471a006e40b", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "709017df7f0de395cc2c8ec2d22b5fac", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "d4f9a706114fdb3763f4982c87608ed6", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "d6532d25e4f8541402fcf1d7b0160048", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "bbd5b31cd9b4d30e48ce46e2cf968fcf", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "4e11b895cbf2e1339cf34bc06c54a4ea", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "bbd5b31cd9b4d30e48ce46e2cf968fcf", @@ -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": "d0940a2237c33b922cf3747cbf3910ef", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "48c4873dae2344c1d4092a1d85dab424", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "52ccfcbba95dcf3d06620748690446be", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "8369a217dc8cd95db308851de9f35d86", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "6bc8e9e67a0cbe50ab2c6891d454570f", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "2ce9d1659647bca4725f404d192c3554", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "8fd2fd1ec12170942823e809332e8cb9", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "f40bd1a61620168791b88901975ea8ee", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "4e3f244ac43cd400ffdbd2ac2e887399", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "a5e5e62c259e23429eca4af7054cc7cb", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "dbb1863afd32a5624a5ef949fe8b48aa", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "11cd1f5e8099c505f429d224e0d8dcbf", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "bb9c8c00b6ef5b66422910f8cf9ccc83", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "fe8dfa263afab3982571178b0f2cff68", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "7f83d9986e6f0d66ed54692e740c2769", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "6f67485c14b38415888360bb3122a721", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "ea6d6a2bcdf18995af09452be534c947", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "3290cee0f4d306788ebd8a60c608e5f5", "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": "bb96031e3f844704fcc9a0549a6d2c41", diff --git a/CHANGELOG.md b/CHANGELOG.md index eda3bcdd..81e96b70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.28 (build 21486, api 8, 2023-10-20) +### 1.7.28 (build 21487, api 8, 2023-10-20) - 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 b34bebc9..7b8bcc0d 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 = 21486 +TARGET_BALLISTICA_BUILD = 21487 TARGET_BALLISTICA_VERSION = '1.7.28' diff --git a/src/ballistica/base/app_adapter/app_adapter.h b/src/ballistica/base/app_adapter/app_adapter.h index 606b5113..25fb83de 100644 --- a/src/ballistica/base/app_adapter/app_adapter.h +++ b/src/ballistica/base/app_adapter/app_adapter.h @@ -195,11 +195,6 @@ class AppAdapter { /// the logic subsystem. This will be called initially to jump-start the /// graphics system as well as before frame draws to update any new /// settings coming in. - /// - /// Whenever graphics settings will result in a change to the graphics - /// context (ie: something visible to rendering code in the logic thread) - /// the adapter should call g_base->graphics_server->set_context() with - /// the updated context. virtual void ApplyGraphicsSettings(const GraphicsSettings* settings); protected: diff --git a/src/ballistica/base/app_adapter/app_adapter_apple.cc b/src/ballistica/base/app_adapter/app_adapter_apple.cc index 69b36034..aaefa65e 100644 --- a/src/ballistica/base/app_adapter/app_adapter_apple.cc +++ b/src/ballistica/base/app_adapter/app_adapter_apple.cc @@ -74,12 +74,6 @@ void AppAdapterApple::ReloadRenderer_(const GraphicsSettings* settings) { 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. - // g_base->graphics_server->SetScreenResolution(320.0, 240.0); - // Update graphics quality based on request. gs->set_graphics_quality_requested(settings->graphics_quality); gs->set_texture_quality_requested(settings->texture_quality); diff --git a/src/ballistica/base/app_adapter/app_adapter_apple.h b/src/ballistica/base/app_adapter/app_adapter_apple.h index d800759d..9217299b 100644 --- a/src/ballistica/base/app_adapter/app_adapter_apple.h +++ b/src/ballistica/base/app_adapter/app_adapter_apple.h @@ -32,9 +32,6 @@ class AppAdapterApple : public AppAdapter { /// Called by FromSwift. auto TryRender() -> bool; - /// Called by FromSwift. - // void SetScreenResolution(float pixel_width, float pixel_height); - auto FullscreenControlAvailable() const -> bool override; auto FullscreenControlGet() const -> bool override; void FullscreenControlSet(bool fullscreen) override; @@ -42,7 +39,6 @@ class AppAdapterApple : public AppAdapter { -> std::optional override; auto HasDirectKeyboardInput() -> bool override; - void EnableResizeFriendlyMode(int width, int height); protected: diff --git a/src/ballistica/base/app_adapter/app_adapter_sdl.cc b/src/ballistica/base/app_adapter/app_adapter_sdl.cc index a77ee149..b43f8397 100644 --- a/src/ballistica/base/app_adapter/app_adapter_sdl.cc +++ b/src/ballistica/base/app_adapter/app_adapter_sdl.cc @@ -629,95 +629,6 @@ auto AppAdapterSDL::GetSDLJoystickInput_(int sdl_joystick_id) const return nullptr; // Epic fail. } -// void AppAdapterSDL::ApplyGraphicsSettings_(const GraphicsSettings_* settings) -// { -// assert(g_core->InMainThread()); -// assert(!g_core->HeadlessMode()); - -// // In strict mode, allow graphics stuff while in here. -// auto allow = ScopedAllowGraphics_(this); - -// bool do_toggle_fs{}; -// bool do_set_existing_fullscreen{}; - -// auto* graphics_server = g_base->graphics_server; - -// // We need a full renderer reload if quality values have changed -// // or if we don't have a renderer yet. -// bool need_full_reload = ((sdl_window_ == nullptr -// || graphics_server->texture_quality_requested() -// != settings->texture_quality) -// || (graphics_server->graphics_quality_requested() -// != settings->graphics_quality)); - -// if (need_full_reload) { -// ReloadRenderer_(settings->fullscreen, settings->graphics_quality, -// settings->texture_quality); -// } else if (settings->fullscreen != fullscreen_) { -// SDL_SetWindowFullscreen( -// sdl_window_, settings->fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : -// 0); -// fullscreen_ = settings->fullscreen; -// } - -// // VSync always gets set independent of the screen (though we set it down -// // here to make sure we have a screen when its set). -// VSync vsync; -// switch (settings->vsync) { -// case VSyncRequest::kNever: -// vsync = VSync::kNever; -// break; -// case VSyncRequest::kAlways: -// vsync = VSync::kAlways; -// break; -// case VSyncRequest::kAuto: -// vsync = VSync::kAdaptive; -// break; -// default: -// vsync = VSync::kNever; -// break; -// } -// if (vsync != vsync_) { -// switch (vsync) { -// case VSync::kUnset: -// case VSync::kNever: { -// SDL_GL_SetSwapInterval(0); -// vsync_actually_enabled_ = false; -// break; -// } -// case VSync::kAlways: { -// SDL_GL_SetSwapInterval(1); -// vsync_actually_enabled_ = true; -// break; -// } -// case VSync::kAdaptive: { -// // In this case, let's try setting to 'adaptive' and turn it off if -// // that is unsupported. -// auto result = SDL_GL_SetSwapInterval(-1); -// if (result == 0) { -// vsync_actually_enabled_ = true; -// } else { -// SDL_GL_SetSwapInterval(0); -// vsync_actually_enabled_ = false; -// } -// break; -// } -// } -// vsync_ = vsync; -// } - -// // This we can set anytime. Probably could have just set it from the logic -// // thread where we read it, but let's be pedantic and keep everything to -// // the main thread. -// max_fps_ = settings->max_fps; - -// // Take -1 to mean no max. Otherwise clamp to a reasonable range. -// if (max_fps_ != -1) { -// max_fps_ = std::max(10, max_fps_); -// max_fps_ = std::min(99999, max_fps_); -// } -// } - void AppAdapterSDL::ReloadRenderer_(const GraphicsSettings_* settings) { assert(g_base->app_adapter->InGraphicsContext()); diff --git a/src/ballistica/base/graphics/graphics_server.cc b/src/ballistica/base/graphics/graphics_server.cc index 33025a94..98351f47 100644 --- a/src/ballistica/base/graphics/graphics_server.cc +++ b/src/ballistica/base/graphics/graphics_server.cc @@ -311,25 +311,6 @@ void GraphicsServer::ReloadLostRenderer() { }); } -void GraphicsServer::SetNullGraphics() { - // We don't actually make or update a renderer in headless, but we - // still need to set our list of supported textures types/etc. to avoid - // complaints. - std::list c_types; - SetTextureCompressionTypes(c_types); - graphics_quality_requested_ = GraphicsQualityRequest::kLow; - graphics_quality_ = GraphicsQuality::kLow; - // graphics_quality_set_ = true; - texture_quality_requested_ = TextureQualityRequest::kLow; - texture_quality_ = TextureQuality::kLow; - // texture_quality_set_ = true; - - FatalError("FIXME REWORK THIS"); - // Let the logic thread know screen creation is done (or lack thereof). - // g_base->logic->event_loop()->PushCall( - // [] { g_base->logic->OnGraphicsReady(); }); -} - void GraphicsServer::set_renderer(Renderer* renderer) { assert(g_base->app_adapter->InGraphicsContext()); assert(!renderer_loaded_); diff --git a/src/ballistica/base/graphics/graphics_server.h b/src/ballistica/base/graphics/graphics_server.h index abc333f2..ed2cbd5b 100644 --- a/src/ballistica/base/graphics/graphics_server.h +++ b/src/ballistica/base/graphics/graphics_server.h @@ -54,16 +54,6 @@ class GraphicsServer { void ApplySettings(const GraphicsSettings* settings); - /// The AppAdapter should call this to inform the engine of screen size - /// changes. Changes will be applied to the server and then sent to the - /// logic thread to apply to various app systems (ui, etc.). - // void SetScreenResolution(float h, float v); - - /// Used by headless builds to init the graphics-server into a - /// non-functional state. - void SetNullGraphics(); - - // void PushSetScreenPixelScaleCall(float pixel_scale); void PushReloadMediaCall(); void PushRemoveRenderHoldCall(); void PushComponentUnloadCall( diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 0be21980..06a5ad67 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 = 21486; +const int kEngineBuildNumber = 21487; const char* kEngineVersion = "1.7.28"; const int kEngineApiVersion = 8;