2015-07-25 03:43:49 +00:00
|
|
|
#ifndef _DNAMP1_CMDL_HPP_
|
|
|
|
#define _DNAMP1_CMDL_HPP_
|
|
|
|
|
|
|
|
#include "../DNACommon/DNACommon.hpp"
|
2015-08-10 01:53:24 +00:00
|
|
|
#include "../DNACommon/CMDL.hpp"
|
2015-07-25 03:43:49 +00:00
|
|
|
#include "CMDLMaterials.hpp"
|
2015-08-04 02:14:47 +00:00
|
|
|
#include "DNAMP1.hpp"
|
2015-08-13 07:29:00 +00:00
|
|
|
#include "CINF.hpp"
|
|
|
|
#include "CSKR.hpp"
|
2015-07-25 03:43:49 +00:00
|
|
|
|
|
|
|
namespace Retro
|
|
|
|
{
|
|
|
|
namespace DNAMP1
|
|
|
|
{
|
|
|
|
|
2015-07-28 02:24:36 +00:00
|
|
|
struct CMDL
|
2015-07-25 03:43:49 +00:00
|
|
|
{
|
2015-08-05 21:46:07 +00:00
|
|
|
static bool Extract(const SpecBase& dataSpec,
|
|
|
|
PAKEntryReadStream& rs,
|
2015-08-04 02:14:47 +00:00
|
|
|
const HECL::ProjectPath& outPath,
|
2015-08-04 21:35:41 +00:00
|
|
|
PAKRouter<PAKBridge>& pakRouter,
|
2015-08-11 23:32:02 +00:00
|
|
|
const PAK::Entry& entry,
|
2015-09-03 01:45:15 +00:00
|
|
|
bool force,
|
|
|
|
std::function<void(const HECL::SystemChar*)> fileChanged)
|
2015-07-28 02:24:36 +00:00
|
|
|
{
|
2015-09-06 05:34:30 +00:00
|
|
|
/* Check for RigPair */
|
|
|
|
const PAKRouter<PAKBridge>::RigPair* rp = pakRouter.lookupCMDLRigPair(entry.id);
|
|
|
|
CINF cinf;
|
|
|
|
CSKR cskr;
|
|
|
|
std::pair<CSKR*,CINF*> loadRp(nullptr, nullptr);
|
|
|
|
if (rp)
|
|
|
|
{
|
|
|
|
pakRouter.lookupAndReadDNA(rp->first, cskr);
|
|
|
|
pakRouter.lookupAndReadDNA(rp->second, cinf);
|
|
|
|
loadRp.first = &cskr;
|
|
|
|
loadRp.second = &cinf;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Do extract */
|
2015-07-28 02:24:36 +00:00
|
|
|
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
|
2015-10-07 01:17:17 +00:00
|
|
|
if (!conn.createBlend(outPath, HECL::BlenderConnection::TypeMesh))
|
2015-07-28 02:24:36 +00:00
|
|
|
return false;
|
2015-09-26 03:12:08 +00:00
|
|
|
DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_1_2, 2>
|
2015-09-06 05:34:30 +00:00
|
|
|
(conn, rs, pakRouter, entry, dataSpec, loadRp);
|
2015-08-05 21:46:07 +00:00
|
|
|
return conn.saveBlend();
|
2015-07-28 02:24:36 +00:00
|
|
|
}
|
2015-10-07 01:17:17 +00:00
|
|
|
|
|
|
|
static bool Cook(const DNACMDL::Mesh& mesh,
|
|
|
|
const HECL::ProjectPath& outPath)
|
|
|
|
{
|
2015-10-11 05:56:42 +00:00
|
|
|
|
2015-10-07 01:17:17 +00:00
|
|
|
return true;
|
|
|
|
}
|
2015-07-25 03:43:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _DNAMP1_CMDL_HPP_
|