mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 16:24:55 +00:00
Use StringView in MultiProgressPrinter
Also fixes the SpecMP1/2/3 using string_view instead of SystemStringView
This commit is contained in:
@@ -486,7 +486,7 @@ void SpecBase::copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>&
|
||||
int loadIdx = 0;
|
||||
for (const auto& tag : buildList) {
|
||||
hecl::SystemString str = fmt::format(FMT_STRING(_SYS_STR("Copying {}")), tag);
|
||||
progress.print(str.c_str(), nullptr, ++loadIdx / float(buildList.size()));
|
||||
progress.print(str, std::nullopt, ++loadIdx / float(buildList.size()));
|
||||
|
||||
auto& [positionOut, sizeOut, compressedOut] = fileIndex.emplace_back();
|
||||
|
||||
|
||||
@@ -325,9 +325,8 @@ struct SpecMP1 : SpecBase {
|
||||
progress.startNewLine();
|
||||
progress.print(_SYS_STR("MP1 Root"), _SYS_STR(""), 0.0);
|
||||
int prog = 0;
|
||||
ctx.progressCB = [&](std::string_view name, float) {
|
||||
hecl::SystemStringConv nameView(name);
|
||||
progress.print(_SYS_STR("MP1 Root"), nameView.c_str(), prog / (float)m_nonPaks.size());
|
||||
ctx.progressCB = [&](nod::SystemStringView name, float) {
|
||||
progress.print(_SYS_STR("MP1 Root"), name, prog / (float)m_nonPaks.size());
|
||||
};
|
||||
for (const nod::Node* node : m_nonPaks) {
|
||||
node->extractToDirectory(mp1OutPath.getAbsolutePath(), ctx);
|
||||
@@ -367,7 +366,7 @@ struct SpecMP1 : SpecBase {
|
||||
int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx();
|
||||
m_pakRouter.extractResources(pak, force, btok,
|
||||
[&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor) {
|
||||
progress.print(pakName.c_str(), substr, factor, threadIdx);
|
||||
progress.print(pakName, substr, factor, threadIdx);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -285,9 +285,8 @@ struct SpecMP2 : SpecBase {
|
||||
progress.startNewLine();
|
||||
progress.print(_SYS_STR("MP2 Root"), _SYS_STR(""), 0.0);
|
||||
int prog = 0;
|
||||
ctx.progressCB = [&prog, &progress](std::string_view name, float) {
|
||||
hecl::SystemStringConv nameView(name);
|
||||
progress.print(_SYS_STR("MP2 Root"), nameView.c_str(), prog);
|
||||
ctx.progressCB = [&prog, &progress](nod::SystemStringView name, float) {
|
||||
progress.print(_SYS_STR("MP2 Root"), name, prog);
|
||||
};
|
||||
for (const nod::Node* node : m_nonPaks) {
|
||||
node->extractToDirectory(mp2OutPath.getAbsolutePath(), ctx);
|
||||
@@ -310,7 +309,7 @@ struct SpecMP2 : SpecBase {
|
||||
int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx();
|
||||
m_pakRouter.extractResources(pak, force, btok,
|
||||
[&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor) {
|
||||
progress.print(pakName.c_str(), substr, factor, threadIdx);
|
||||
progress.print(pakName, substr, factor, threadIdx);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -372,9 +372,8 @@ struct SpecMP3 : SpecBase {
|
||||
hecl::SystemString currentTarget;
|
||||
size_t nodeCount = 0;
|
||||
int prog = 0;
|
||||
nod::ExtractionContext ctx = {force, [&](std::string_view name, float) {
|
||||
hecl::SystemStringConv nameView(name);
|
||||
progress.print(currentTarget.c_str(), nameView.c_str(), prog / (float)nodeCount);
|
||||
nod::ExtractionContext ctx = {force, [&](nod::SystemStringView name, float) {
|
||||
progress.print(currentTarget, name, prog / (float)nodeCount);
|
||||
}};
|
||||
if (doMP3) {
|
||||
m_workPath.makeDir();
|
||||
@@ -420,7 +419,7 @@ struct SpecMP3 : SpecBase {
|
||||
process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok) {
|
||||
m_pakRouter.extractResources(pak, force, btok,
|
||||
[&progress, &pakName](const hecl::SystemChar* substr, float factor) {
|
||||
progress.print(pakName.c_str(), substr, factor);
|
||||
progress.print(pakName, substr, factor);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -470,7 +469,7 @@ struct SpecMP3 : SpecBase {
|
||||
process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok) {
|
||||
m_fePakRouter.extractResources(pak, force, btok,
|
||||
[&progress, &pakName](const hecl::SystemChar* substr, float factor) {
|
||||
progress.print(pakName.c_str(), substr, factor);
|
||||
progress.print(pakName, substr, factor);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user