Seed legacy platform storage explicitly and drop Android app handles

This commit is contained in:
2026-06-17 01:34:05 +02:00
parent 3ce365fc15
commit fd462dc406
9 changed files with 72 additions and 29 deletions

View File

@@ -31,6 +31,7 @@
#include "pch.h"
#include "app.h"
#include "platform_legacy/legacy_platform_state.h"
#include "asset.h"
#include "keymap.h"
#include "main.h"
@@ -274,6 +275,12 @@ JNIEXPORT void JNICALL Java_com_omixlab_panopainter_MainActivity_pickExternalCal
App::I->data_path = file_path;
App::I->work_path = file_path;
App::I->rec_path = file_path + "/frames";
pp::platform::legacy::set_legacy_storage_paths({
App::I->data_path,
App::I->work_path,
App::I->rec_path,
App::I->tmp_path,
});
App::I->initLog();
}
@@ -605,7 +612,6 @@ static int engine_init_display(struct engine* engine) {
if (resuming_context)
{
LOG("RESUME APP");
App::I->and_app = engine->app;
LOG("release egl context");
eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
mutex.unlock();
@@ -703,14 +709,18 @@ static int engine_init_display(struct engine* engine) {
LOG("PROP Mode: %s", os_props["ro.product.model"].c_str());
Asset::set_android_asset_manager(engine->app->activity->assetManager);
App::I->and_app = engine->app;
App::I->and_engine = engine;
//std::string base_path = engine->app->activity->externalDataPath ?
// engine->app->activity->externalDataPath : get_data_path(engine->app);
if (App::I->data_path.empty() || App::I->data_path == ".")
App::I->data_path = get_data_path();
LOG("data_path %s", App::I->data_path.c_str());
pp::platform::legacy::set_legacy_storage_paths({
App::I->data_path,
App::I->work_path.empty() ? App::I->data_path : App::I->work_path,
App::I->rec_path,
App::I->tmp_path,
});
#ifdef __QUEST__