Remove dead legacy storage fallback and hide GLFW state

This commit is contained in:
2026-06-17 10:34:26 +02:00
parent 5491ed4bf5
commit f45fc8226c
8 changed files with 43 additions and 51 deletions

View File

@@ -142,13 +142,6 @@ void execute_legacy_app_init_log(App& app)
app.rec_path,
app.tmp_path,
});
#else
pp::platform::legacy::set_legacy_storage_paths({
app.data_path,
app.work_path,
app.rec_path,
app.tmp_path,
});
#endif
//LogRemote::I.start();

View File

@@ -86,7 +86,7 @@ public:
#elif defined(__ANDROID__)
return pp::platform::legacy::active_legacy_android_storage_paths();
#else
return pp::platform::legacy::active_legacy_storage_paths();
return {};
#endif
}

View File

@@ -15,26 +15,22 @@ void webgl_sync();
namespace pp::platform::legacy {
namespace {
struct RetainedLegacyStoragePaths final {
pp::platform::PlatformStoragePaths storage_paths;
};
#ifdef __ANDROID__
struct RetainedLegacyAndroidStoragePaths final {
pp::platform::PlatformStoragePaths storage_paths;
};
#endif
#if defined(__LINUX__) || defined(__WEB__)
struct RetainedLegacyGlfwPlatformState final {
GLFWwindow* window = nullptr;
};
#endif
struct RetainedLegacyWebPlatformServicesBinding final {
pp::platform::WebPlatformServices* services = nullptr;
};
[[nodiscard]] RetainedLegacyStoragePaths& retained_legacy_storage_paths()
{
static RetainedLegacyStoragePaths state;
return state;
}
#ifdef __ANDROID__
[[nodiscard]] RetainedLegacyAndroidStoragePaths& retained_legacy_android_storage_paths()
{
@@ -43,6 +39,14 @@ struct RetainedLegacyWebPlatformServicesBinding final {
}
#endif
#if defined(__LINUX__) || defined(__WEB__)
[[nodiscard]] RetainedLegacyGlfwPlatformState& retained_legacy_glfw_platform_state()
{
static RetainedLegacyGlfwPlatformState state;
return state;
}
#endif
[[nodiscard]] RetainedLegacyWebPlatformServicesBinding& retained_legacy_web_platform_services_binding()
{
static RetainedLegacyWebPlatformServicesBinding state;
@@ -89,20 +93,14 @@ public:
}
#if defined(__LINUX__) || defined(__WEB__)
[[nodiscard]] RetainedLegacyGlfwWindowState& active_legacy_glfw_window_state()
{
static RetainedLegacyGlfwWindowState state;
return state;
}
void set_legacy_glfw_window(GLFWwindow* window)
{
active_legacy_glfw_window_state().window = window;
retained_legacy_glfw_platform_state().window = window;
}
void set_legacy_glfw_window_title(std::string_view title)
{
auto* const window = active_legacy_glfw_window_state().window;
auto* const window = retained_legacy_glfw_platform_state().window;
if (!window)
return;
@@ -112,17 +110,17 @@ void set_legacy_glfw_window_title(std::string_view title)
void acquire_legacy_glfw_render_context()
{
glfwMakeContextCurrent(active_legacy_glfw_window_state().window);
glfwMakeContextCurrent(retained_legacy_glfw_platform_state().window);
}
void present_legacy_glfw_render_context()
{
glfwSwapBuffers(active_legacy_glfw_window_state().window);
glfwSwapBuffers(retained_legacy_glfw_platform_state().window);
}
void request_legacy_glfw_app_close()
{
glfwSetWindowShouldClose(active_legacy_glfw_window_state().window, GLFW_TRUE);
glfwSetWindowShouldClose(retained_legacy_glfw_platform_state().window, GLFW_TRUE);
}
#endif
@@ -220,16 +218,6 @@ void save_legacy_web_prepared_file(
return true;
}
[[nodiscard]] const pp::platform::PlatformStoragePaths& active_legacy_storage_paths()
{
return retained_legacy_storage_paths().storage_paths;
}
void set_legacy_storage_paths(pp::platform::PlatformStoragePaths paths)
{
retained_legacy_storage_paths().storage_paths = std::move(paths);
}
#ifdef __ANDROID__
[[nodiscard]] const pp::platform::PlatformStoragePaths& active_legacy_android_storage_paths()
{

View File

@@ -12,11 +12,6 @@ struct GLFWwindow;
namespace pp::platform::legacy {
#if defined(__LINUX__) || defined(__WEB__)
struct RetainedLegacyGlfwWindowState final {
GLFWwindow* window = nullptr;
};
[[nodiscard]] RetainedLegacyGlfwWindowState& active_legacy_glfw_window_state();
void set_legacy_glfw_window(GLFWwindow* window);
void set_legacy_glfw_window_title(std::string_view title);
void acquire_legacy_glfw_render_context();
@@ -49,9 +44,6 @@ void save_legacy_web_prepared_file(
std::string_view suggested_name,
pp::platform::PreparedFileCallback callback);
[[nodiscard]] const pp::platform::PlatformStoragePaths& active_legacy_storage_paths();
void set_legacy_storage_paths(pp::platform::PlatformStoragePaths paths);
#ifdef __ANDROID__
[[nodiscard]] const pp::platform::PlatformStoragePaths& active_legacy_android_storage_paths();
void set_legacy_android_storage_paths(pp::platform::PlatformStoragePaths paths);