2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 14:27:42 +00:00

re-balancing of DataSpec/DNA systems

This commit is contained in:
Jack Andersen
2015-07-16 14:01:05 -10:00
parent 94a6707dd3
commit 94d84d8991
17 changed files with 364 additions and 175 deletions

View File

@@ -6,6 +6,7 @@
#include <angelscript.h>
#include <HECL/HECL.hpp>
#include <HECL/Database.hpp>
#include <Athena/FileWriter.hpp>
#include "DNACommon.hpp"
namespace Retro
@@ -22,6 +23,29 @@ struct ISTRG
virtual bool readAngelScript(const AngelScript::asIScriptModule& in)=0;
virtual void writeAngelScript(std::ofstream& out) const=0;
template <class SUBCLS>
static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath)
{
SUBCLS strg;
strg.read(rs);
std::ofstream strgOut(outPath.getAbsolutePath());
strg.writeAngelScript(strgOut);
return true;
}
template <class SUBCLS>
static bool Cook(const HECL::ProjectPath& inPath, const HECL::ProjectPath& outPath)
{
SUBCLS strg;
HECL::Database::ASUniqueModule mod = HECL::Database::ASUniqueModule::CreateFromPath(inPath);
if (!mod)
return false;
strg.readAngelScript(mod);
Athena::io::FileWriter ws(outPath.getAbsolutePath());
strg.write(ws);
return true;
}
};
std::unique_ptr<ISTRG> LoadSTRG(Athena::io::IStreamReader& reader);