world converter threading

This commit is contained in:
MihailRis
2024-04-15 19:44:21 +03:00
parent ab110dcdf5
commit cc58ea29bc
10 changed files with 122 additions and 63 deletions
+4 -8
View File
@@ -116,7 +116,7 @@ void show_process_panel(Engine* engine, std::shared_ptr<Task> task, std::wstring
auto label = std::make_shared<Label>(L"0%");
panel->add(label);
uint initialWork = task->getWorkRemaining();
uint initialWork = task->getWorkTotal();
panel->listenInterval(0.01f, [=]() {
task->update();
@@ -134,25 +134,21 @@ void show_process_panel(Engine* engine, std::shared_ptr<Task> task, std::wstring
menu->setPage("process", false);
}
std::shared_ptr<WorldConverter> create_converter(
std::shared_ptr<Task> create_converter(
Engine* engine,
fs::path folder,
const Content* content,
std::shared_ptr<ContentLUT> lut,
runnable postRunnable)
{
auto converter = std::make_shared<WorldConverter>(folder, content, lut);
converter->setOnComplete([=](){
converter->write();
return WorldConverter::startTask(folder, content, lut, [=](){
auto menu = engine->getGUI()->getMenu();
menu->reset();
menu->setPage("main", false);
engine->getGUI()->postRunnable([=]() {
postRunnable();
});
});
return converter;
}, true);
}
void show_convert_request(
+1 -2
View File
@@ -34,7 +34,7 @@ static void create_controls_panel(Engine* engine) {
}
auto scrollPanel = std::dynamic_pointer_cast<Panel>(guiutil::create(
"<panel size='400,200' padding='2' interval='1' max-length='400' color='#0000004C'>"
"<panel size='380,200' padding='2' interval='1' max-length='400' color='#0000004C'>"
"</panel>"
));
for (auto& entry : Events::bindings){
@@ -55,7 +55,6 @@ static void create_controls_panel(Engine* engine) {
}
void menus::create_settings_panel(Engine* engine) {
//create_audio_settings_panel(engine);
create_controls_panel(engine);
auto menu = engine->getGUI()->getMenu();