2015-07-13 06:29:12 +00:00
|
|
|
#include "STRG.hpp"
|
|
|
|
#include "../DNAMP1/STRG.hpp"
|
|
|
|
#include "../DNAMP2/STRG.hpp"
|
|
|
|
#include "../DNAMP3/STRG.hpp"
|
|
|
|
|
2016-02-13 09:02:47 +00:00
|
|
|
namespace DataSpec
|
2015-07-13 06:29:12 +00:00
|
|
|
{
|
2015-07-16 01:57:34 +00:00
|
|
|
|
2016-10-02 22:41:36 +00:00
|
|
|
void ISTRG::gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const
|
|
|
|
{
|
|
|
|
/* TODO: parse out resource tokens */
|
|
|
|
}
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
std::unique_ptr<ISTRG> LoadSTRG(athena::io::IStreamReader& reader)
|
2015-07-13 06:29:12 +00:00
|
|
|
{
|
2015-08-14 03:00:51 +00:00
|
|
|
uint32_t magic = reader.readUint32Big();
|
2015-07-13 06:29:12 +00:00
|
|
|
if (magic != 0x87654321)
|
|
|
|
{
|
2016-03-04 23:04:53 +00:00
|
|
|
LogDNACommon.report(logvisor::Error, "invalid STRG magic");
|
2015-07-13 06:29:12 +00:00
|
|
|
return std::unique_ptr<ISTRG>();
|
|
|
|
}
|
|
|
|
|
2015-08-14 03:00:51 +00:00
|
|
|
uint32_t version = reader.readUint32Big();
|
2015-07-13 06:29:12 +00:00
|
|
|
switch (version)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
2015-07-16 01:57:34 +00:00
|
|
|
DNAMP1::STRG* newStrg = new DNAMP1::STRG;
|
2015-07-13 06:29:12 +00:00
|
|
|
newStrg->_read(reader);
|
|
|
|
return std::unique_ptr<ISTRG>(newStrg);
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
2015-07-16 01:57:34 +00:00
|
|
|
DNAMP2::STRG* newStrg = new DNAMP2::STRG;
|
2015-07-13 06:29:12 +00:00
|
|
|
newStrg->_read(reader);
|
|
|
|
return std::unique_ptr<ISTRG>(newStrg);
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
2015-07-16 01:57:34 +00:00
|
|
|
DNAMP3::STRG* newStrg = new DNAMP3::STRG;
|
2015-07-13 06:29:12 +00:00
|
|
|
newStrg->_read(reader);
|
|
|
|
return std::unique_ptr<ISTRG>(newStrg);
|
|
|
|
}
|
2017-01-26 08:09:22 +00:00
|
|
|
default: break;
|
2015-07-13 06:29:12 +00:00
|
|
|
}
|
|
|
|
return std::unique_ptr<ISTRG>();
|
|
|
|
}
|
|
|
|
}
|