Seed legacy platform storage explicitly and drop Android app handles
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "platform_legacy/legacy_platform_state.h"
|
||||
|
||||
#include "app.h"
|
||||
|
||||
#if defined(__LINUX__) || defined(__WEB__)
|
||||
#include <GLFW/glfw3.h>
|
||||
#endif
|
||||
@@ -14,6 +12,12 @@ struct RetainedLegacyStoragePaths final {
|
||||
pp::platform::PlatformStoragePaths storage_paths;
|
||||
};
|
||||
|
||||
[[nodiscard]] RetainedLegacyStoragePaths& retained_legacy_storage_paths()
|
||||
{
|
||||
static RetainedLegacyStoragePaths state;
|
||||
return state;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if defined(__LINUX__) || defined(__WEB__)
|
||||
@@ -78,17 +82,12 @@ void set_legacy_apple_state(
|
||||
|
||||
[[nodiscard]] const pp::platform::PlatformStoragePaths& active_legacy_storage_paths()
|
||||
{
|
||||
static RetainedLegacyStoragePaths state = [] {
|
||||
RetainedLegacyStoragePaths retained;
|
||||
retained.storage_paths = {
|
||||
App::I->data_path,
|
||||
App::I->work_path,
|
||||
App::I->rec_path,
|
||||
App::I->tmp_path,
|
||||
};
|
||||
return retained;
|
||||
}();
|
||||
return state.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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user