mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-17 00:47:05 +00:00
Added preliminary support for building new ISOs
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "Core/Resource/Factory/CTemplateLoader.h"
|
||||
#include "Core/Resource/Script/CMasterTemplate.h"
|
||||
#include <Common/Serialization/XML.h>
|
||||
#include <nod/nod.hpp>
|
||||
|
||||
CGameProject::~CGameProject()
|
||||
{
|
||||
@@ -94,6 +95,30 @@ void CGameProject::Serialize(IArchive& rArc)
|
||||
}
|
||||
}
|
||||
|
||||
void ProgressDummy(size_t, const nod::SystemString&, size_t) {}
|
||||
|
||||
bool CGameProject::BuildISO(const TString& rkIsoPath)
|
||||
{
|
||||
ASSERT( FileUtil::IsValidPath(rkIsoPath, false) );
|
||||
|
||||
if (IsWiiBuild())
|
||||
{
|
||||
Log::Error("Wii ISO building not supported!");
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
nod::DiscBuilderGCN *pBuilder = new nod::DiscBuilderGCN(*rkIsoPath.ToUTF16(), *mGameID, *mProjectName, mFilesystemAddress, &ProgressDummy);
|
||||
|
||||
TWideString ProjRoot = ProjectRoot().ToUTF16();
|
||||
TWideString DiscRoot = DiscDir(false).ToUTF16();
|
||||
TWideString DolPath = ProjRoot + mDolPath.ToUTF16();
|
||||
TWideString ApploaderPath = ProjRoot + mApploaderPath.ToUTF16();
|
||||
return pBuilder->buildFromDirectory(*DiscRoot, *DolPath, *ApploaderPath);
|
||||
}
|
||||
}
|
||||
|
||||
void CGameProject::GetWorldList(std::list<CAssetID>& rOut) const
|
||||
{
|
||||
for (u32 iPkg = 0; iPkg < mPackages.size(); iPkg++)
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
|
||||
bool Save();
|
||||
void Serialize(IArchive& rArc);
|
||||
bool BuildISO(const TString& rkIsoPath);
|
||||
void GetWorldList(std::list<CAssetID>& rOut) const;
|
||||
CAssetID FindNamedResource(const TString& rkName) const;
|
||||
CPackage* FindPackage(const TString& rkName) const;
|
||||
@@ -108,6 +109,7 @@ public:
|
||||
inline TString GameID() const { return mGameID; }
|
||||
inline float BuildVersion() const { return mBuildVersion; }
|
||||
inline bool IsWiiBuild() const { return mBuildVersion >= 3.f; }
|
||||
inline bool IsTrilogy() const { return mGame <= eCorruption && mBuildVersion >= 3.593f; }
|
||||
};
|
||||
|
||||
#endif // CGAMEPROJECT_H
|
||||
|
||||
Reference in New Issue
Block a user