Added support for building Wii ISOs

This commit is contained in:
Aruki 2017-07-09 15:44:42 -06:00
parent 665a098d50
commit 096ef45bac
2 changed files with 29 additions and 18 deletions

View File

@ -81,24 +81,23 @@ bool CGameProject::BuildISO(const TString& rkIsoPath, IProgressNotifier *pProgre
{
ASSERT( FileUtil::IsValidPath(rkIsoPath, false) );
if (IsWiiBuild())
auto ProgressCallback = [&](float ProgressPercent, const nod::SystemString& rkInfoString, size_t)
{
Log::Error("Wii ISO building not supported!");
return false;
}
pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString).ToUTF8());
};
pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName());
TWideString DiscRoot = DiscDir(false).ToUTF16();
if (!IsWiiBuild())
{
nod::DiscBuilderGCN Builder(*rkIsoPath.ToUTF16(), ProgressCallback);
return Builder.buildFromDirectory(*DiscRoot) == nod::EBuildResult::Success;
}
else
{
auto ProgressCallback = [&](float ProgressPercent, const nod::SystemString& rkInfoString, size_t)
{
pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString).ToUTF8());
};
nod::DiscBuilderGCN *pBuilder = new nod::DiscBuilderGCN(*rkIsoPath.ToUTF16(), ProgressCallback);
pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName());
TWideString DiscRoot = DiscDir(false).ToUTF16();
return pBuilder->buildFromDirectory(*DiscRoot) == nod::EBuildResult::Success;
nod::DiscBuilderWii Builder(*rkIsoPath.ToUTF16(), IsTrilogy(), ProgressCallback);
return Builder.buildFromDirectory(*DiscRoot) == nod::EBuildResult::Success;
}
}

View File

@ -69,7 +69,6 @@ void CProjectSettingsDialog::ActiveProjectChanged(CGameProject *pProj)
close();
}
mpUI->BuildIsoButton->setEnabled( pProj && !pProj->IsWiiBuild() );
SetupPackagesList();
}
@ -108,10 +107,23 @@ void CProjectSettingsDialog::CookAllDirtyPackages()
void CProjectSettingsDialog::BuildISO()
{
CGameProject *pProj = gpEdApp->ActiveProject();
ASSERT(pProj && !pProj->IsWiiBuild());
ASSERT(pProj);
QString DefaultPath = TO_QSTRING( pProj->ProjectRoot() + FileUtil::SanitizeName(pProj->Name(), false) + ".gcm" );
QString IsoPath = UICommon::SaveFileDialog(this, "Choose output ISO path", "*.gcm", DefaultPath);
QString DefaultExtension, FilterString;
if (!pProj->IsWiiBuild())
{
DefaultExtension = ".gcm";
FilterString = "*.gcm;*.iso";
}
else
{
DefaultExtension = ".iso";
FilterString = "*.iso";
}
QString DefaultPath = TO_QSTRING( pProj->ProjectRoot() + FileUtil::SanitizeName(pProj->Name(), false) ) + DefaultExtension;
QString IsoPath = UICommon::SaveFileDialog(this, "Choose output ISO path", FilterString, DefaultPath);
if (!IsoPath.isEmpty())
{