Merge branch 'master' of ssh://git.axiodl.com:6431/AxioDL/urde

This commit is contained in:
Jack Andersen 2019-08-31 10:40:41 -10:00
commit ca0ca94b18
616 changed files with 6419 additions and 5156 deletions

View File

@ -1,11 +1,16 @@
#include "ANCS.hpp" #include "DataSpec/DNACommon/ANCS.hpp"
#include "DataSpec/DNACommon/CMDL.hpp"
#include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/RigInverter.hpp"
#include "DataSpec/DNAMP1/DNAMP1.hpp" #include "DataSpec/DNAMP1/DNAMP1.hpp"
#include "DataSpec/DNAMP1/ANCS.hpp" #include "DataSpec/DNAMP1/ANCS.hpp"
#include "DataSpec/DNAMP2/DNAMP2.hpp" #include "DataSpec/DNAMP2/DNAMP2.hpp"
#include "DataSpec/DNAMP2/ANCS.hpp" #include "DataSpec/DNAMP2/ANCS.hpp"
#include "DataSpec/DNAMP3/DNAMP3.hpp" #include "DataSpec/DNAMP3/DNAMP3.hpp"
#include "DataSpec/DNAMP3/CHAR.hpp" #include "DataSpec/DNAMP3/CHAR.hpp"
#include "hecl/Blender/Connection.hpp"
#include <hecl/Blender/Connection.hpp>
namespace DataSpec::DNAANCS { namespace DataSpec::DNAANCS {

View File

@ -1,9 +1,21 @@
#pragma once #pragma once
#include <unordered_set> #include <functional>
#include "DNACommon.hpp" #include <string>
#include "CMDL.hpp" #include <utility>
#include "RigInverter.hpp" #include <vector>
#include <athena/Types.hpp>
#include <hecl/Blender/Connection.hpp>
#include <hecl/SystemChar.hpp>
namespace DataSpec {
struct SpecBase;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAANCS { namespace DataSpec::DNAANCS {

View File

@ -1,8 +1,20 @@
#include "zeus/Math.hpp" #include "DataSpec/DNACommon/ANIM.hpp"
#include "ANIM.hpp"
#include <cfloat>
#include <cmath>
#include <cstring>
#include <hecl/hecl.hpp>
#include <zeus/Global.hpp>
#include <zeus/Math.hpp>
#define DUMP_KEYS 0 #define DUMP_KEYS 0
#if DUMP_KEYS
#include <cstdio>
#include <fmt/format.h>
#endif
namespace DataSpec::DNAANIM { namespace DataSpec::DNAANIM {
size_t ComputeBitstreamSize(size_t keyFrameCount, const std::vector<Channel>& channels) { size_t ComputeBitstreamSize(size_t keyFrameCount, const std::vector<Channel>& channels) {
@ -163,7 +175,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
for (size_t f = 0; f < keyFrameCount; ++f) { for (size_t f = 0; f < keyFrameCount; ++f) {
#if DUMP_KEYS #if DUMP_KEYS
fprintf(stderr, "\nFRAME %" PRISize " %u %u\n", f, (m_bitCur / 32) * 4, m_bitCur % 32); fmt::print(stderr, fmt("\nFRAME {} {} {}\n"), f, (m_bitCur / 32) * 4, m_bitCur % 32);
int lastId = -1; int lastId = -1;
#endif #endif
auto kit = chanKeys.begin(); auto kit = chanKeys.begin();
@ -172,7 +184,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
#if DUMP_KEYS #if DUMP_KEYS
if (chan.id != lastId) { if (chan.id != lastId) {
lastId = chan.id; lastId = chan.id;
fprintf(stderr, "\n"); std::fputc('\n', stderr);
} }
#endif #endif
QuantizedValue& p = *ait; QuantizedValue& p = *ait;
@ -185,7 +197,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
QuantizedRot qr = {{p[0], p[1], p[2]}, wBit}; QuantizedRot qr = {{p[0], p[1], p[2]}, wBit};
kit->emplace_back(DequantizeRotation(qr, rotDiv)); kit->emplace_back(DequantizeRotation(qr, rotDiv));
#if DUMP_KEYS #if DUMP_KEYS
fprintf(stderr, "%d R: %d %d %d %d\t", chan.id, wBit, p[0], p[1], p[2]); fmt::print(stderr, fmt("{} R: {} {} {} {}\t"), chan.id, wBit, p[0], p[1], p[2]);
#endif #endif
break; break;
} }
@ -198,7 +210,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
p[2] += val3; p[2] += val3;
kit->push_back({p[0] * transMult, p[1] * transMult, p[2] * transMult}); kit->push_back({p[0] * transMult, p[1] * transMult, p[2] * transMult});
#if DUMP_KEYS #if DUMP_KEYS
fprintf(stderr, "%d T: %d %d %d\t", chan.id, p[0], p[1], p[2]); fmt::print(stderr, fmt("{} T: {} {} {}\t"), chan.id, p[0], p[1], p[2]);
#endif #endif
break; break;
} }
@ -208,7 +220,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
p[2] += dequantize(data, chan.q[2]); p[2] += dequantize(data, chan.q[2]);
kit->push_back({p[0] * scaleMult, p[1] * scaleMult, p[2] * scaleMult}); kit->push_back({p[0] * scaleMult, p[1] * scaleMult, p[2] * scaleMult});
#if DUMP_KEYS #if DUMP_KEYS
fprintf(stderr, "%d S: %d %d %d\t", chan.id, p[0], p[1], p[2]); fmt::print(stderr, fmt("{} S: {} {} {}\t"), chan.id, p[0], p[1], p[2]);
#endif #endif
break; break;
} }
@ -236,7 +248,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
++ait; ++ait;
} }
#if DUMP_KEYS #if DUMP_KEYS
fprintf(stderr, "\n"); std::fputc('\n', stderr);
#endif #endif
} }

View File

@ -1,7 +1,12 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <cassert>
#include <cmath> #include <cmath>
#include <cstddef>
#include <memory>
#include <vector>
#include <athena/Types.hpp>
namespace DataSpec::DNAANIM { namespace DataSpec::DNAANIM {

View File

@ -1,4 +1,19 @@
#include "ATBL.hpp" #include "DataSpec/DNACommon/ATBL.hpp"
#include <algorithm>
#include <cstdint>
#include <cstdlib>
#include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
#include <athena/FileReader.hpp>
#include <athena/FileWriter.hpp>
#include <athena/YAMLDocReader.hpp>
#include <athena/YAMLDocWriter.hpp>
#include <fmt/format.h>
namespace DataSpec::DNAAudio { namespace DataSpec::DNAAudio {

View File

@ -1,7 +1,12 @@
#pragma once #pragma once
#include "DNACommon.hpp" namespace DataSpec {
#include "PAK.hpp" class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAAudio { namespace DataSpec::DNAAudio {

View File

@ -1,8 +1,15 @@
#include "BabeDead.hpp" #include "DataSpec/DNACommon/BabeDead.hpp"
#include "DataSpec/DNAMP1/MREA.hpp" #include "DataSpec/DNAMP1/MREA.hpp"
#include "DataSpec/DNAMP3/MREA.hpp" #include "DataSpec/DNAMP3/MREA.hpp"
#include "zeus/CTransform.hpp"
#include "hecl/Blender/Connection.hpp" #include <cfloat>
#include <hecl/Blender/Connection.hpp>
#include <zeus/CTransform.hpp>
#include <zeus/Math.hpp>
#include <fmt/format.h>
namespace DataSpec { namespace DataSpec {

View File

@ -1,8 +1,9 @@
#pragma once #pragma once
#include "zeus/Math.hpp" namespace hecl::blender {
#include "hecl/hecl.hpp" struct Light;
#include <cfloat> class PyOutStream;
}
namespace DataSpec { namespace DataSpec {

View File

@ -1,13 +1,18 @@
#include "CMDL.hpp" #include "DataSpec/DNACommon/CMDL.hpp"
#include "../DNAMP1/CMDLMaterials.hpp"
#include "../DNAMP1/CSKR.hpp" #include <utility>
#include "../DNAMP1/MREA.hpp"
#include "../DNAMP2/CMDLMaterials.hpp" #include "DataSpec/DNAMP1/CMDLMaterials.hpp"
#include "../DNAMP2/CSKR.hpp" #include "DataSpec/DNAMP1/CSKR.hpp"
#include "../DNAMP3/CMDLMaterials.hpp" #include "DataSpec/DNAMP1/MREA.hpp"
#include "../DNAMP3/CSKR.hpp" #include "DataSpec/DNAMP2/CMDLMaterials.hpp"
#include "zeus/CAABox.hpp" #include "DataSpec/DNAMP2/CSKR.hpp"
#include "hecl/Blender/Connection.hpp" #include "DataSpec/DNAMP3/CMDLMaterials.hpp"
#include "DataSpec/DNAMP3/CSKR.hpp"
#include <fmt/format.h>
#include <hecl/Blender/Connection.hpp>
#include <zeus/CAABox.hpp>
namespace DataSpec::DNACMDL { namespace DataSpec::DNACMDL {
@ -208,7 +213,7 @@ public:
m_cur = m_dl.get(); m_cur = m_dl.get();
} }
operator bool() { return ((m_cur - m_dl.get()) < intptr_t(m_dlSize)) && *m_cur; } explicit operator bool() const { return ((m_cur - m_dl.get()) < intptr_t(m_dlSize)) && *m_cur; }
GX::Primitive readPrimitive() { return GX::Primitive(*m_cur++ & 0xf8); } GX::Primitive readPrimitive() { return GX::Primitive(*m_cur++ & 0xf8); }
@ -1634,14 +1639,14 @@ bool WriteMREASecs(std::vector<std::vector<uint8_t>>& secsOut, const hecl::Proje
/* Iterate meshes */ /* Iterate meshes */
auto matIt = surfToGlobalMats.cbegin(); auto matIt = surfToGlobalMats.cbegin();
for (const Mesh& mesh : meshes) { for (const Mesh& mesh : meshes) {
zeus::CTransform meshXf(mesh.sceneXf.val); zeus::CTransform meshXf(mesh.sceneXf.val.data());
meshXf.basis.transpose(); meshXf.basis.transpose();
/* Header */ /* Header */
{ {
MeshHeader meshHeader = {}; MeshHeader meshHeader = {};
meshHeader.visorFlags.setFromBlenderProps(mesh.customProps); meshHeader.visorFlags.setFromBlenderProps(mesh.customProps);
memmove(meshHeader.xfMtx, &mesh.sceneXf, 48); memmove(meshHeader.xfMtx, mesh.sceneXf.val.data(), 48);
zeus::CAABox aabb(zeus::CVector3f(mesh.aabbMin), zeus::CVector3f(mesh.aabbMax)); zeus::CAABox aabb(zeus::CVector3f(mesh.aabbMin), zeus::CVector3f(mesh.aabbMax));
aabb = aabb.getTransformedAABox(meshXf); aabb = aabb.getTransformedAABox(meshXf);
@ -1912,14 +1917,14 @@ bool WriteHMDLMREASecs(std::vector<std::vector<uint8_t>>& secsOut, const hecl::P
/* Iterate meshes */ /* Iterate meshes */
auto matIt = surfToGlobalMats.cbegin(); auto matIt = surfToGlobalMats.cbegin();
for (const Mesh& mesh : meshes) { for (const Mesh& mesh : meshes) {
zeus::CTransform meshXf(mesh.sceneXf.val); zeus::CTransform meshXf(mesh.sceneXf.val.data());
meshXf.basis.transpose(); meshXf.basis.transpose();
/* Header */ /* Header */
{ {
MeshHeader meshHeader = {}; MeshHeader meshHeader = {};
meshHeader.visorFlags.setFromBlenderProps(mesh.customProps); meshHeader.visorFlags.setFromBlenderProps(mesh.customProps);
memmove(meshHeader.xfMtx, &mesh.sceneXf, 48); memmove(meshHeader.xfMtx, mesh.sceneXf.val.data(), 48);
zeus::CAABox aabb(zeus::CVector3f(mesh.aabbMin), zeus::CVector3f(mesh.aabbMax)); zeus::CAABox aabb(zeus::CVector3f(mesh.aabbMin), zeus::CVector3f(mesh.aabbMax));
aabb = aabb.getTransformedAABox(meshXf); aabb = aabb.getTransformedAABox(meshXf);

View File

@ -1,10 +1,23 @@
#pragma once #pragma once
#include "athena/FileWriter.hpp" #include <cstddef>
#include "PAK.hpp" #include <cstdint>
#include "GX.hpp" #include <vector>
#include "TXTR.hpp"
#include "zeus/CAABox.hpp" #include "DataSpec/DNACommon/GX.hpp"
#include "DataSpec/DNACommon/TXTR.hpp"
#include <athena/DNA.hpp>
#include <athena/Types.hpp>
#include <hecl/Blender/Connection.hpp>
namespace hecl {
class ProjectPath;
}
namespace zeus {
class CAABox;
}
namespace DataSpec::DNACMDL { namespace DataSpec::DNACMDL {

View File

@ -4,6 +4,7 @@ make_dnalist(CMDL
FSM2 FSM2
MAPA MAPA
MAPU MAPU
MayaSpline
EGMC EGMC
SAVWCommon SAVWCommon
ParticleCommon ParticleCommon

View File

@ -1,4 +1,10 @@
#include "CRSC.hpp" #include "DataSpec/DNACommon/CRSC.hpp"
#include <algorithm>
#include "DataSpec/DNACommon/PAK.hpp"
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {
static const std::vector<FourCC> GeneratorTypes = { static const std::vector<FourCC> GeneratorTypes = {

View File

@ -1,9 +1,21 @@
#pragma once #pragma once
#include "ParticleCommon.hpp" #include <cstdint>
#include "PAK.hpp" #include <unordered_map>
#include "athena/FileWriter.hpp" #include <vector>
#include <optional>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/ParticleCommon.hpp"
#include <athena/DNA.hpp>
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {
template <class IDType> template <class IDType>

View File

@ -1,7 +1,10 @@
#include "athena/IStreamReader.hpp" #include "DataSpec/DNACommon/DGRP.hpp"
#include "athena/IStreamWriter.hpp"
#include "athena/FileWriter.hpp" #include <athena/DNAYaml.hpp>
#include "DGRP.hpp" #include <athena/FileWriter.hpp>
#include <athena/IStreamWriter.hpp>
#include <hecl/hecl.hpp>
namespace DataSpec::DNADGRP { namespace DataSpec::DNADGRP {

View File

@ -1,7 +1,9 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <vector>
#include "PAK.hpp"
#include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
namespace DataSpec::DNADGRP { namespace DataSpec::DNADGRP {

View File

@ -246,23 +246,15 @@ public:
UniqueID64(const hecl::ProjectPath& path) { *this = path; } UniqueID64(const hecl::ProjectPath& path) { *this = path; }
UniqueID64(const char* hexStr) { UniqueID64(const char* hexStr) {
char copy[17]; char copy[17];
strncpy(copy, hexStr, 16); std::strncpy(copy, hexStr, 16);
copy[16] = '\0'; copy[16] = '\0';
#if _WIN32 assign(std::strtoull(copy, nullptr, 16));
assign(_strtoui64(copy, nullptr, 16));
#else
assign(strtouq(copy, nullptr, 16));
#endif
} }
UniqueID64(const wchar_t* hexStr) { UniqueID64(const wchar_t* hexStr) {
wchar_t copy[17]; wchar_t copy[17];
wcsncpy(copy, hexStr, 16); std::wcsncpy(copy, hexStr, 16);
copy[16] = L'\0'; copy[16] = L'\0';
#if _WIN32 assign(std::wcstoull(copy, nullptr, 16));
assign(_wcstoui64(copy, nullptr, 16));
#else
assign(wcstoull(copy, nullptr, 16));
#endif
} }
static constexpr size_t BinarySize() { return 8; } static constexpr size_t BinarySize() { return 8; }
@ -396,7 +388,7 @@ public:
++m_idx; ++m_idx;
return *this; return *this;
} }
bool operator*() { return m_bmp.getBit(m_idx); } bool operator*() const { return m_bmp.getBit(m_idx); }
bool operator!=(const Iterator& other) const { return m_idx != other.m_idx; } bool operator!=(const Iterator& other) const { return m_idx != other.m_idx; }
}; };
Iterator begin() const { return Iterator(*this, 0); } Iterator begin() const { return Iterator(*this, 0); }

View File

@ -1,4 +1,9 @@
#include "DPSC.hpp" #include "DataSpec/DNACommon/DPSC.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
#include <athena/DNAYaml.hpp>
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {

View File

@ -1,8 +1,21 @@
#pragma once #pragma once
#include "ParticleCommon.hpp" #include <cstddef>
#include "PAK.hpp" #include <cstdint>
#include "athena/FileWriter.hpp" #include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/ParticleCommon.hpp"
#include <athena/FileWriter.hpp>
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {

View File

@ -1,10 +1,18 @@
#include "DeafBabe.hpp" #include "DataSpec/DNACommon/DeafBabe.hpp"
#include "AROTBuilder.hpp"
#include "DataSpec/DNAMP1/DeafBabe.hpp"
#include "DataSpec/DNAMP2/DeafBabe.hpp"
#include "DataSpec/DNAMP1/DCLN.hpp"
#include "hecl/Blender/Connection.hpp"
#include <cinttypes> #include <cinttypes>
#include <cstddef>
#include <memory>
#include <type_traits>
#include "DataSpec/DNACommon/AROTBuilder.hpp"
#include "DataSpec/DNAMP1/DeafBabe.hpp"
#include "DataSpec/DNAMP1/DCLN.hpp"
#include "DataSpec/DNAMP2/DeafBabe.hpp"
#include <fmt/format.h>
#include <hecl/Blender/Connection.hpp>
#include <zeus/Global.hpp>
namespace DataSpec { namespace DataSpec {

View File

@ -1,6 +1,11 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <athena/Types.hpp>
namespace hecl::blender {
class PyOutStream;
struct ColMesh;
} // namespace hecl::blender
namespace DataSpec { namespace DataSpec {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include "DataSpec/DNACommon/DNACommon.hpp"
namespace DataSpec::DNACommon { namespace DataSpec::DNACommon {
struct EGMC : public BigDNA { struct EGMC : public BigDNA {

View File

@ -1,4 +1,6 @@
#include "ELSC.hpp" #include "DataSpec/DNACommon/ELSC.hpp"
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {

View File

@ -1,8 +1,15 @@
#pragma once #pragma once
#include "ParticleCommon.hpp" #include <vector>
#include "PAK.hpp"
#include "athena/FileWriter.hpp" #include "DataSpec/DNACommon/ParticleCommon.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
#include <athena/FileWriter.hpp>
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {
template <class IDType> template <class IDType>

View File

@ -1,4 +1,8 @@
#include "FONT.hpp" #include "DataSpec/DNACommon/FONT.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAFont { namespace DataSpec::DNAFont {
logvisor::Module LogModule("urde::DNAFont"); logvisor::Module LogModule("urde::DNAFont");

View File

@ -1,7 +1,19 @@
#pragma once #pragma once
#include "PAK.hpp" #include <memory>
#include "athena/FileWriter.hpp" #include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <athena/FileWriter.hpp>
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAFont { namespace DataSpec::DNAFont {
struct GlyphRect : BigDNA { struct GlyphRect : BigDNA {
@ -12,7 +24,7 @@ struct GlyphRect : BigDNA {
Value<float> bottom; Value<float> bottom;
}; };
struct IGlyph : BigDNAVYaml { struct IGlyph : BigDNAVYaml {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
Value<atUint16> m_character; Value<atUint16> m_character;
GlyphRect m_glyphRect; GlyphRect m_glyphRect;
@ -34,8 +46,7 @@ struct IGlyph : BigDNAVYaml {
}; };
struct GlyphMP1 : IGlyph { struct GlyphMP1 : IGlyph {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
Value<atInt32> m_leftPadding; Value<atInt32> m_leftPadding;
Value<atInt32> m_advance; Value<atInt32> m_advance;
Value<atInt32> m_rightPadding; Value<atInt32> m_rightPadding;
@ -44,18 +55,17 @@ struct GlyphMP1 : IGlyph {
Value<atInt32> m_baseline; Value<atInt32> m_baseline;
Value<atInt32> m_kerningIndex; Value<atInt32> m_kerningIndex;
atInt32 leftPadding() const { return m_leftPadding; } atInt32 leftPadding() const override { return m_leftPadding; }
atInt32 advance() const { return m_advance; } atInt32 advance() const override { return m_advance; }
atInt32 rightPadding() const { return m_rightPadding; } atInt32 rightPadding() const override { return m_rightPadding; }
atInt32 width() const { return m_width; } atInt32 width() const override { return m_width; }
atInt32 height() const { return m_height; } atInt32 height() const override { return m_height; }
atInt32 baseline() const { return m_baseline; } atInt32 baseline() const override { return m_baseline; }
atInt32 kerningIndex() const { return m_kerningIndex; } atInt32 kerningIndex() const override { return m_kerningIndex; }
}; };
struct GlyphMP2 : IGlyph { struct GlyphMP2 : IGlyph {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
Value<atInt8> m_layer; Value<atInt8> m_layer;
Value<atInt8> m_leftPadding; Value<atInt8> m_leftPadding;
Value<atInt8> m_advance; Value<atInt8> m_advance;
@ -65,14 +75,14 @@ struct GlyphMP2 : IGlyph {
Value<atInt8> m_baseline; Value<atInt8> m_baseline;
Value<atInt16> m_kerningIndex; Value<atInt16> m_kerningIndex;
atInt32 layer() const { return m_layer; } atInt32 layer() const override { return m_layer; }
atInt32 leftPadding() const { return m_leftPadding; } atInt32 leftPadding() const override { return m_leftPadding; }
atInt32 advance() const { return m_advance; } atInt32 advance() const override { return m_advance; }
atInt32 rightPadding() const { return m_rightPadding; } atInt32 rightPadding() const override { return m_rightPadding; }
atInt32 width() const { return m_width; } atInt32 width() const override { return m_width; }
atInt32 height() const { return m_height; } atInt32 height() const override { return m_height; }
atInt32 baseline() const { return m_baseline; } atInt32 baseline() const override { return m_baseline; }
atInt32 kerningIndex() const { return m_kerningIndex; } atInt32 kerningIndex() const override { return m_kerningIndex; }
}; };
struct KerningInfo : BigDNA { struct KerningInfo : BigDNA {

View File

@ -1,8 +1,12 @@
#include "DataSpec/DNACommon/FSM2.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
#include <athena/FileWriter.hpp>
#include <athena/Global.hpp> #include <athena/Global.hpp>
#include <athena/IStreamReader.hpp>
#include <athena/IStreamWriter.hpp> #include <athena/IStreamWriter.hpp>
#include "FSM2.hpp" #include <logvisor/logvisor.hpp>
namespace DataSpec::DNAFSM2 { namespace DataSpec::DNAFSM2 {
logvisor::Module LogDNAFSM2("urde::DNAFSM2"); logvisor::Module LogDNAFSM2("urde::DNAFSM2");
@ -10,7 +14,7 @@ logvisor::Module LogDNAFSM2("urde::DNAFSM2");
template <class IDType> template <class IDType>
template <class Op> template <class Op>
void FSM2<IDType>::Enumerate(typename Op::StreamT& s) { void FSM2<IDType>::Enumerate(typename Op::StreamT& s) {
Do<Op>({"header"}, header, s); Do<Op>(athena::io::PropId{"header"}, header, s);
if (header.magic != SBIG('FSM2')) { if (header.magic != SBIG('FSM2')) {
LogDNAFSM2.report(logvisor::Fatal, fmt("Invalid FSM2 magic '{}' expected 'FSM2'"), header.magic); LogDNAFSM2.report(logvisor::Fatal, fmt("Invalid FSM2 magic '{}' expected 'FSM2'"), header.magic);
return; return;
@ -19,11 +23,11 @@ void FSM2<IDType>::Enumerate(typename Op::StreamT& s) {
if (header.version == 1) { if (header.version == 1) {
if (!detail) if (!detail)
detail.reset(new FSMV1); detail.reset(new FSMV1);
Do<Op>({"detail"}, static_cast<FSMV1&>(*detail), s); Do<Op>(athena::io::PropId{"detail"}, static_cast<FSMV1&>(*detail), s);
} else if (header.version == 2) { } else if (header.version == 2) {
if (!detail) if (!detail)
detail.reset(new FSMV2); detail.reset(new FSMV2);
Do<Op>({"detail"}, static_cast<FSMV2&>(*detail), s); Do<Op>(athena::io::PropId{"detail"}, static_cast<FSMV2&>(*detail), s);
} else { } else {
LogDNAFSM2.report(logvisor::Fatal, fmt("Invalid FSM2 version '{}'"), header.version); LogDNAFSM2.report(logvisor::Fatal, fmt("Invalid FSM2 version '{}'"), header.version);
return; return;

View File

@ -1,8 +1,18 @@
#pragma once #pragma once
#include "PAK.hpp" #include <memory>
#include "DNACommon.hpp"
#include "athena/FileWriter.hpp" #include "DataSpec/DNACommon/DNACommon.hpp"
#include <athena/DNA.hpp>
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAFSM2 { namespace DataSpec::DNAFSM2 {
struct IFSM : BigDNAVYaml { struct IFSM : BigDNAVYaml {
@ -24,8 +34,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
}; };
struct FSMV1 : IFSM { struct FSMV1 : IFSM {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
Value<atUint32> stateCount; Value<atUint32> stateCount;
Value<atUint32> unknown1Count; Value<atUint32> unknown1Count;
Value<atUint32> unknown2Count; Value<atUint32> unknown2Count;
@ -68,8 +77,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
}; };
struct FSMV2 : IFSM { struct FSMV2 : IFSM {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
Value<atUint32> stateCount; Value<atUint32> stateCount;
Value<atUint32> unknown1Count; Value<atUint32> unknown1Count;
Value<atUint32> unknown2Count; Value<atUint32> unknown2Count;

View File

@ -1,5 +1,8 @@
#pragma once #pragma once
#include "athena/DNA.hpp"
#include <cstdint>
#include <athena/DNA.hpp>
namespace GX { namespace GX {
enum AttrType { NONE, DIRECT, INDEX8, INDEX16 }; enum AttrType { NONE, DIRECT, INDEX8, INDEX16 };

View File

@ -1,13 +1,16 @@
#include "MAPA.hpp" #include "DataSpec/DNACommon/MAPA.hpp"
#include "../DNAMP1/DNAMP1.hpp"
#include "../DNAMP2/DNAMP2.hpp" #include "DataSpec/DNACommon/GX.hpp"
#include "../DNAMP3/DNAMP3.hpp" #include "DataSpec/DNAMP1/DNAMP1.hpp"
#include "../DNAMP1/MAPA.hpp" #include "DataSpec/DNAMP2/DNAMP2.hpp"
#include "../DNAMP2/MAPA.hpp" #include "DataSpec/DNAMP3/DNAMP3.hpp"
#include "../DNAMP3/MAPA.hpp" #include "DataSpec/DNAMP1/MAPA.hpp"
#include "zeus/CTransform.hpp" #include "DataSpec/DNAMP2/MAPA.hpp"
#include "zeus/CAABox.hpp" #include "DataSpec/DNAMP3/MAPA.hpp"
#include "hecl/Blender/Connection.hpp"
#include <hecl/Blender/Connection.hpp>
#include <logvisor/logvisor.hpp>
#include <zeus/CAABox.hpp>
namespace DataSpec::DNAMAPA { namespace DataSpec::DNAMAPA {

View File

@ -1,7 +1,18 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <memory>
#include "GX.hpp" #include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
namespace hecl {
class ProjectPath;
}
namespace hecl::blender {
class Connection;
struct MapArea;
} // namespace hecl::blender
namespace DataSpec::DNAMAPA { namespace DataSpec::DNAMAPA {
struct MAPA : BigDNA { struct MAPA : BigDNA {
@ -17,7 +28,6 @@ struct MAPA : BigDNA {
}; };
struct HeaderMP1 : IMAPAHeader { struct HeaderMP1 : IMAPAHeader {
AT_DECL_DNA
AT_DECL_DNAV AT_DECL_DNAV
Value<atUint32> unknown1 = 0; Value<atUint32> unknown1 = 0;
Value<atUint32> mapVisMode = 0; Value<atUint32> mapVisMode = 0;
@ -25,14 +35,13 @@ struct MAPA : BigDNA {
Value<atUint32> moCount = 0; Value<atUint32> moCount = 0;
Value<atUint32> vtxCount = 0; Value<atUint32> vtxCount = 0;
Value<atUint32> surfCount = 0; Value<atUint32> surfCount = 0;
atUint32 visMode() const { return mapVisMode; } atUint32 visMode() const override { return mapVisMode; }
atUint32 mappableObjectCount() const { return moCount; } atUint32 mappableObjectCount() const override { return moCount; }
atUint32 vertexCount() const { return vtxCount; } atUint32 vertexCount() const override { return vtxCount; }
atUint32 surfaceCount() const { return surfCount; } atUint32 surfaceCount() const override { return surfCount; }
}; };
struct HeaderMP2 : IMAPAHeader { struct HeaderMP2 : IMAPAHeader {
AT_DECL_DNA
AT_DECL_DNAV AT_DECL_DNAV
Value<atUint32> unknown1 = 0; Value<atUint32> unknown1 = 0;
Value<atUint32> mapVisMode = 0; Value<atUint32> mapVisMode = 0;
@ -43,14 +52,13 @@ struct MAPA : BigDNA {
Value<atUint32> moCount = 0; Value<atUint32> moCount = 0;
Value<atUint32> vtxCount = 0; Value<atUint32> vtxCount = 0;
Value<atUint32> surfCount = 0; Value<atUint32> surfCount = 0;
atUint32 visMode() const { return mapVisMode; } atUint32 visMode() const override { return mapVisMode; }
atUint32 mappableObjectCount() const { return moCount; } atUint32 mappableObjectCount() const override { return moCount; }
atUint32 vertexCount() const { return vtxCount; } atUint32 vertexCount() const override { return vtxCount; }
atUint32 surfaceCount() const { return surfCount; } atUint32 surfaceCount() const override { return surfCount; }
}; };
struct HeaderMP3 : IMAPAHeader { struct HeaderMP3 : IMAPAHeader {
AT_DECL_DNA
AT_DECL_DNAV AT_DECL_DNAV
Value<atUint32> unknown1 = 0; Value<atUint32> unknown1 = 0;
Value<atUint32> mapVisMode = 0; Value<atUint32> mapVisMode = 0;
@ -65,10 +73,10 @@ struct MAPA : BigDNA {
Value<atUint32> internalNameLength = 0; Value<atUint32> internalNameLength = 0;
Value<atUint32> unknown7 = 0; Value<atUint32> unknown7 = 0;
String<AT_DNA_COUNT(internalNameLength)> internalName; String<AT_DNA_COUNT(internalNameLength)> internalName;
atUint32 visMode() const { return mapVisMode; } atUint32 visMode() const override { return mapVisMode; }
atUint32 mappableObjectCount() const { return moCount; } atUint32 mappableObjectCount() const override { return moCount; }
atUint32 vertexCount() const { return vtxCount; } atUint32 vertexCount() const override { return vtxCount; }
atUint32 surfaceCount() const { return surfCount; } atUint32 surfaceCount() const override { return surfCount; }
}; };
std::unique_ptr<IMAPAHeader> header; std::unique_ptr<IMAPAHeader> header;
@ -102,7 +110,6 @@ struct MAPA : BigDNA {
}; };
struct MappableObjectMP1_2 : IMappableObject { struct MappableObjectMP1_2 : IMappableObject {
AT_DECL_DNA
AT_DECL_DNAV AT_DECL_DNAV
Value<Type> type; Value<Type> type;
Value<atUint32> visMode; Value<atUint32> visMode;
@ -113,7 +120,6 @@ struct MAPA : BigDNA {
}; };
struct MappableObjectMP3 : IMappableObject { struct MappableObjectMP3 : IMappableObject {
AT_DECL_DNA
AT_DECL_DNAV AT_DECL_DNAV
Value<Type> type; Value<Type> type;
Value<atUint32> visMode; Value<atUint32> visMode;

View File

@ -1,9 +1,11 @@
#include "MAPU.hpp" #include "DataSpec/DNACommon/MAPU.hpp"
#include "../DNAMP1/DNAMP1.hpp"
#include "../DNAMP2/DNAMP2.hpp" #include "DataSpec/DNAMP1/DNAMP1.hpp"
#include "../DNAMP3/DNAMP3.hpp" #include "DataSpec/DNAMP2/DNAMP2.hpp"
#include "zeus/CTransform.hpp" #include "DataSpec/DNAMP3/DNAMP3.hpp"
#include "hecl/Blender/Connection.hpp"
#include <hecl/Blender/Connection.hpp>
#include <zeus/Global.hpp>
namespace DataSpec::DNAMAPU { namespace DataSpec::DNAMAPU {

View File

@ -1,6 +1,17 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <cstdint>
#include "DataSpec/DNACommon/DNACommon.hpp"
namespace hecl {
class ProjectPath;
}
namespace hecl::blender {
class Connection;
struct MapUniverse;
} // namespce hecl::blender
namespace DataSpec::DNAMAPU { namespace DataSpec::DNAMAPU {
struct MAPU : BigDNA { struct MAPU : BigDNA {

View File

@ -1,8 +1,11 @@
#include "MLVL.hpp" #include "DataSpec/DNACommon/MLVL.hpp"
#include "../DNAMP1/MLVL.hpp"
#include "../DNAMP2/MLVL.hpp" #include "DataSpec/DNAMP1/MLVL.hpp"
#include "../DNAMP3/MLVL.hpp" #include "DataSpec/DNAMP2/MLVL.hpp"
#include "hecl/Blender/Connection.hpp" #include "DataSpec/DNAMP3/MLVL.hpp"
#include <hecl/Blender/Connection.hpp>
#include <zeus/Global.hpp>
namespace DataSpec::DNAMLVL { namespace DataSpec::DNAMLVL {

View File

@ -1,7 +1,18 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <functional>
#include "zeus/CVector3f.hpp"
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <hecl/SystemChar.hpp>
namespace hecl {
class ProjectPath;
}
namespace hecl::blender {
class Connection;
}
namespace DataSpec::DNAMLVL { namespace DataSpec::DNAMLVL {

View File

@ -0,0 +1,24 @@
#pragma once
#include "DataSpec/DNACommon/DNACommon.hpp"
namespace DataSpec {
struct MayaSpline : public BigDNA {
AT_DECL_DNA_YAML
Value<atUint8> preInf;
Value<atUint8> postInf;
Value<atUint32> knotCount;
struct Knot : BigDNA {
AT_DECL_DNA_YAML
Value<float> time;
Value<float> amplitude;
Value<atUint8> unk1;
Value<atUint8> unk2;
};
Vector<Knot, AT_DNA_COUNT(knotCount)> knots;
Value<atUint8> clampMode;
Value<float> minAmp;
Value<float> maxAmp;
};
}

View File

@ -1,9 +1,15 @@
#include "athena/Types.hpp" #include "DataSpec/DNACommon/OBBTreeBuilder.hpp"
#include "OBBTreeBuilder.hpp"
#include "zeus/CTransform.hpp" #include <cstddef>
#include <unordered_set>
#include <vector>
#include "DataSpec/DNAMP1/DCLN.hpp" #include "DataSpec/DNAMP1/DCLN.hpp"
#include "gmm/gmm.h"
#include "hecl/Blender/Connection.hpp" #include <athena/Types.hpp>
#include <gmm/gmm.h>
#include <hecl/Blender/Connection.hpp>
#include <zeus/CTransform.hpp>
namespace DataSpec { namespace DataSpec {

View File

@ -1,6 +1,8 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <memory>
#include <hecl/Blender/Connection.hpp>
namespace DataSpec { namespace DataSpec {

View File

@ -1,7 +1,8 @@
#include "PAK.hpp" #include "DataSpec/DNACommon/PAK.hpp"
#include "../DNAMP1/DNAMP1.hpp"
#include "../DNAMP2/DNAMP2.hpp" #include "DataSpec/DNAMP1/DNAMP1.hpp"
#include "../DNAMP3/DNAMP3.hpp" #include "DataSpec/DNAMP2/DNAMP2.hpp"
#include "DataSpec/DNAMP3/DNAMP3.hpp"
namespace DataSpec { namespace DataSpec {
@ -465,9 +466,8 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
if (force || cooked.isNone()) { if (force || cooked.isNone()) {
cooked.makeDirChain(false); cooked.makeDirChain(false);
PAKEntryReadStream s = entryPtr->beginReadStream(*node); PAKEntryReadStream s = entryPtr->beginReadStream(*node);
FILE* fout = hecl::Fopen(cooked.getAbsolutePath().data(), _SYS_STR("wb")); const auto fout = hecl::FopenUnique(cooked.getAbsolutePath().data(), _SYS_STR("wb"));
fwrite(s.data(), 1, s.length(), fout); std::fwrite(s.data(), 1, s.length(), fout.get());
fclose(fout);
} }
if (extractor.func_a) /* Doesn't need PAKRouter access */ if (extractor.func_a) /* Doesn't need PAKRouter access */

View File

@ -1,9 +1,17 @@
#pragma once #pragma once
#include "DNACommon.hpp"
#include "boo/ThreadLocalPtr.hpp"
#include <array> #include <array>
#include "zeus/CMatrix4f.hpp" #include <cstring>
#include <functional>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <boo/ThreadLocalPtr.hpp>
#include <zeus/CMatrix4f.hpp>
#include <zeus/Global.hpp>
namespace DataSpec { namespace DataSpec {
@ -25,7 +33,7 @@ public:
if (m_pos >= m_sz) if (m_pos >= m_sz)
LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun")); LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun"));
} }
void seek(atInt64 pos, athena::SeekOrigin origin) { void seek(atInt64 pos, athena::SeekOrigin origin) override {
if (origin == athena::Begin) if (origin == athena::Begin)
m_pos = pos; m_pos = pos;
else if (origin == athena::Current) else if (origin == athena::Current)
@ -35,10 +43,10 @@ public:
if (m_pos > m_sz) if (m_pos > m_sz)
LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun")); LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun"));
} }
atUint64 position() const { return m_pos; } atUint64 position() const override { return m_pos; }
atUint64 length() const { return m_sz; } atUint64 length() const override { return m_sz; }
const atUint8* data() const { return m_buf.get(); } const atUint8* data() const { return m_buf.get(); }
atUint64 readUBytesToBuf(void* buf, atUint64 len) { atUint64 readUBytesToBuf(void* buf, atUint64 len) override {
atUint64 bufEnd = m_pos + len; atUint64 bufEnd = m_pos + len;
if (bufEnd > m_sz) if (bufEnd > m_sz)
len -= bufEnd - m_sz; len -= bufEnd - m_sz;
@ -172,7 +180,7 @@ public:
using PAKRouterBase::getWorking; using PAKRouterBase::getWorking;
hecl::ProjectPath getWorking(const EntryType* entry, const ResExtractor<BRIDGETYPE>& extractor) const; hecl::ProjectPath getWorking(const EntryType* entry, const ResExtractor<BRIDGETYPE>& extractor) const;
hecl::ProjectPath getWorking(const EntryType* entry) const; hecl::ProjectPath getWorking(const EntryType* entry) const;
hecl::ProjectPath getWorking(const IDType& id, bool silenceWarnings = false) const; hecl::ProjectPath getWorking(const IDType& id, bool silenceWarnings = false) const override;
hecl::ProjectPath getCooked(const EntryType* entry) const; hecl::ProjectPath getCooked(const EntryType* entry) const;
hecl::ProjectPath getCooked(const IDType& id, bool silenceWarnings = false) const; hecl::ProjectPath getCooked(const IDType& id, bool silenceWarnings = false) const;
@ -198,6 +206,12 @@ public:
return true; return true;
} }
PAKEntryReadStream beginReadStreamForId(const IDType& id, bool silenceWarnings = false) {
const nod::Node* node;
const EntryType* entry = lookupEntry(id, &node, silenceWarnings);
return entry->beginReadStream(*node);
}
const typename CharacterAssociations<IDType>::RigPair* lookupCMDLRigPair(const IDType& id) const; const typename CharacterAssociations<IDType>::RigPair* lookupCMDLRigPair(const IDType& id) const;
const typename CharacterAssociations<IDType>::MultimapIteratorPair const typename CharacterAssociations<IDType>::MultimapIteratorPair
lookupCharacterAttachmentRigs(const IDType& id) const; lookupCharacterAttachmentRigs(const IDType& id) const;

View File

@ -1,4 +1,6 @@
#include "PART.hpp" #include "DataSpec/DNACommon/PART.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {

View File

@ -1,8 +1,18 @@
#pragma once #pragma once
#include "ParticleCommon.hpp" #include <cstdint>
#include "PAK.hpp" #include <vector>
#include "athena/FileWriter.hpp"
#include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/ParticleCommon.hpp"
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {

View File

@ -1329,10 +1329,10 @@ const char* SpawnSystemKeyframeData<UniqueID64>::SpawnSystemKeyframeInfo::DNATyp
template <class IDType> template <class IDType>
template <class Op> template <class Op>
void SpawnSystemKeyframeData<IDType>::SpawnSystemKeyframeInfo::Enumerate(typename Op::StreamT& s) { void SpawnSystemKeyframeData<IDType>::SpawnSystemKeyframeInfo::Enumerate(typename Op::StreamT& s) {
Do<Op>({"id"}, id, s); Do<Op>(athena::io::PropId{"id"}, id, s);
Do<Op>({"a"}, a, s); Do<Op>(athena::io::PropId{"a"}, a, s);
Do<Op>({"b"}, b, s); Do<Op>(athena::io::PropId{"b"}, b, s);
Do<Op>({"c"}, c, s); Do<Op>(athena::io::PropId{"c"}, c, s);
} }
template <> template <>

View File

@ -1,15 +1,20 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <memory>
#include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {
extern logvisor::Module LogModule; extern logvisor::Module LogModule;
struct IElement : BigDNAVYaml { struct IElement : BigDNAVYaml {
Delete _d; Delete _d;
virtual ~IElement() = default; ~IElement() override = default;
virtual const char* ClassID() const = 0; virtual const char* ClassID() const = 0;
const char* DNATypeV() const { return ClassID(); } const char* DNATypeV() const override { return ClassID(); }
}; };
struct IRealElement : IElement { struct IRealElement : IElement {
@ -72,54 +77,54 @@ struct IUVElement : IElement {
}; };
struct BoolHelper : IElement { struct BoolHelper : IElement {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
bool value = false; bool value = false;
operator bool() const { return value; } operator bool() const { return value; }
BoolHelper& operator=(bool val) { BoolHelper& operator=(bool val) {
value = val; value = val;
return *this; return *this;
} }
const char* ClassID() const { return "BoolHelper"; } const char* ClassID() const override { return "BoolHelper"; }
}; };
struct RELifetimeTween : IRealElement { struct RELifetimeTween : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "LFTW"; } const char* ClassID() const override { return "LFTW"; }
}; };
struct REConstant : IRealElement { struct REConstant : IRealElement {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
Value<float> val; Value<float> val;
const char* ClassID() const { return "CNST"; } const char* ClassID() const override { return "CNST"; }
}; };
struct RETimeChain : IRealElement { struct RETimeChain : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
IntElementFactory thresholdFrame; IntElementFactory thresholdFrame;
const char* ClassID() const { return "CHAN"; } const char* ClassID() const override { return "CHAN"; }
}; };
struct REAdd : IRealElement { struct REAdd : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "ADD_"; } const char* ClassID() const override { return "ADD_"; }
}; };
struct REClamp : IRealElement { struct REClamp : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory min; RealElementFactory min;
RealElementFactory max; RealElementFactory max;
RealElementFactory val; RealElementFactory val;
const char* ClassID() const { return "CLMP"; } const char* ClassID() const override { return "CLMP"; }
}; };
struct REKeyframeEmitter : IRealElement { struct REKeyframeEmitter : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
Value<atUint32> percentageTween; Value<atUint32> percentageTween;
Value<atUint32> unk1; Value<atUint32> unk1;
Value<bool> loop; Value<bool> loop;
@ -128,180 +133,180 @@ struct REKeyframeEmitter : IRealElement {
Value<atUint32> loopStart; Value<atUint32> loopStart;
Value<atUint32> count; Value<atUint32> count;
Vector<float, AT_DNA_COUNT(count)> keys; Vector<float, AT_DNA_COUNT(count)> keys;
const char* ClassID() const { return percentageTween ? "KEYP" : "KEYE"; } const char* ClassID() const override { return percentageTween ? "KEYP" : "KEYE"; }
}; };
struct REInitialRandom : IRealElement { struct REInitialRandom : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "IRND"; } const char* ClassID() const override { return "IRND"; }
}; };
struct RERandom : IRealElement { struct RERandom : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "RAND"; } const char* ClassID() const override { return "RAND"; }
}; };
struct REMultiply : IRealElement { struct REMultiply : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "MULT"; } const char* ClassID() const override { return "MULT"; }
}; };
struct REPulse : IRealElement { struct REPulse : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory aDuration; IntElementFactory aDuration;
IntElementFactory bDuration; IntElementFactory bDuration;
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "PULS"; } const char* ClassID() const override { return "PULS"; }
}; };
struct RETimeScale : IRealElement { struct RETimeScale : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory dv; RealElementFactory dv;
const char* ClassID() const { return "SCAL"; } const char* ClassID() const override { return "SCAL"; }
}; };
struct RELifetimePercent : IRealElement { struct RELifetimePercent : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory percent; RealElementFactory percent;
const char* ClassID() const { return "RLPT"; } const char* ClassID() const override { return "RLPT"; }
}; };
struct RESineWave : IRealElement { struct RESineWave : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory frequency; RealElementFactory frequency;
RealElementFactory amplitude; RealElementFactory amplitude;
RealElementFactory phase; RealElementFactory phase;
const char* ClassID() const { return "SINE"; } const char* ClassID() const override { return "SINE"; }
}; };
struct REInitialSwitch : IRealElement { struct REInitialSwitch : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "ISWT"; } const char* ClassID() const override { return "ISWT"; }
}; };
struct RECompareLessThan : IRealElement { struct RECompareLessThan : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory ca; RealElementFactory ca;
RealElementFactory cb; RealElementFactory cb;
RealElementFactory pass; RealElementFactory pass;
RealElementFactory fail; RealElementFactory fail;
const char* ClassID() const { return "CLTN"; } const char* ClassID() const override { return "CLTN"; }
}; };
struct RECompareEquals : IRealElement { struct RECompareEquals : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory ca; RealElementFactory ca;
RealElementFactory cb; RealElementFactory cb;
RealElementFactory pass; RealElementFactory pass;
RealElementFactory fail; RealElementFactory fail;
const char* ClassID() const { return "CEQL"; } const char* ClassID() const override { return "CEQL"; }
}; };
struct REParticleAdvanceParam1 : IRealElement { struct REParticleAdvanceParam1 : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PAP1"; } const char* ClassID() const override { return "PAP1"; }
}; };
struct REParticleAdvanceParam2 : IRealElement { struct REParticleAdvanceParam2 : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PAP2"; } const char* ClassID() const override { return "PAP2"; }
}; };
struct REParticleAdvanceParam3 : IRealElement { struct REParticleAdvanceParam3 : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PAP3"; } const char* ClassID() const override { return "PAP3"; }
}; };
struct REParticleAdvanceParam4 : IRealElement { struct REParticleAdvanceParam4 : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PAP4"; } const char* ClassID() const override { return "PAP4"; }
}; };
struct REParticleAdvanceParam5 : IRealElement { struct REParticleAdvanceParam5 : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PAP5"; } const char* ClassID() const override { return "PAP5"; }
}; };
struct REParticleAdvanceParam6 : IRealElement { struct REParticleAdvanceParam6 : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PAP6"; } const char* ClassID() const override { return "PAP6"; }
}; };
struct REParticleAdvanceParam7 : IRealElement { struct REParticleAdvanceParam7 : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PAP7"; } const char* ClassID() const override { return "PAP7"; }
}; };
struct REParticleAdvanceParam8 : IRealElement { struct REParticleAdvanceParam8 : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PAP8"; } const char* ClassID() const override { return "PAP8"; }
}; };
struct REParticleSizeOrLineLength : IRealElement { struct REParticleSizeOrLineLength : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PSLL"; } const char* ClassID() const override { return "PSLL"; }
}; };
struct REParticleRotationOrLineWidth : IRealElement { struct REParticleRotationOrLineWidth : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PRLW"; } const char* ClassID() const override { return "PRLW"; }
}; };
struct RESubtract : IRealElement { struct RESubtract : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "SUB_"; } const char* ClassID() const override { return "SUB_"; }
}; };
struct REVectorMagnitude : IRealElement { struct REVectorMagnitude : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory vec; VectorElementFactory vec;
const char* ClassID() const { return "VMAG"; } const char* ClassID() const override { return "VMAG"; }
}; };
struct REVectorXToReal : IRealElement { struct REVectorXToReal : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory vec; VectorElementFactory vec;
const char* ClassID() const { return "VXTR"; } const char* ClassID() const override { return "VXTR"; }
}; };
struct REVectorYToReal : IRealElement { struct REVectorYToReal : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory vec; VectorElementFactory vec;
const char* ClassID() const { return "VYTR"; } const char* ClassID() const override { return "VYTR"; }
}; };
struct REVectorZToReal : IRealElement { struct REVectorZToReal : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory vec; VectorElementFactory vec;
const char* ClassID() const { return "VZTR"; } const char* ClassID() const override { return "VZTR"; }
}; };
struct RECEXT : IRealElement { struct RECEXT : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory index; IntElementFactory index;
const char* ClassID() const { return "CEXT"; } const char* ClassID() const override { return "CEXT"; }
}; };
struct REIntTimesReal : IRealElement { struct REIntTimesReal : IRealElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory a; IntElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "ITRL"; } const char* ClassID() const override { return "ITRL"; }
}; };
struct IEKeyframeEmitter : IIntElement { struct IEKeyframeEmitter : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
Value<atUint32> percentageTween; Value<atUint32> percentageTween;
Value<atUint32> unk1; Value<atUint32> unk1;
Value<bool> loop; Value<bool> loop;
@ -310,179 +315,179 @@ struct IEKeyframeEmitter : IIntElement {
Value<atUint32> loopStart; Value<atUint32> loopStart;
Value<atUint32> count; Value<atUint32> count;
Vector<atUint32, AT_DNA_COUNT(count)> keys; Vector<atUint32, AT_DNA_COUNT(count)> keys;
const char* ClassID() const { return percentageTween ? "KEYP" : "KEYE"; } const char* ClassID() const override { return percentageTween ? "KEYP" : "KEYE"; }
}; };
struct IEDeath : IIntElement { struct IEDeath : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory passthrough; IntElementFactory passthrough;
IntElementFactory thresholdFrame; IntElementFactory thresholdFrame;
const char* ClassID() const { return "DETH"; } const char* ClassID() const override { return "DETH"; }
}; };
struct IEClamp : IIntElement { struct IEClamp : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory min; IntElementFactory min;
IntElementFactory max; IntElementFactory max;
IntElementFactory val; IntElementFactory val;
const char* ClassID() const { return "CLMP"; } const char* ClassID() const override { return "CLMP"; }
}; };
struct IETimeChain : IIntElement { struct IETimeChain : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory a; IntElementFactory a;
IntElementFactory b; IntElementFactory b;
IntElementFactory thresholdFrame; IntElementFactory thresholdFrame;
const char* ClassID() const { return "CHAN"; } const char* ClassID() const override { return "CHAN"; }
}; };
struct IEAdd : IIntElement { struct IEAdd : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory a; IntElementFactory a;
IntElementFactory b; IntElementFactory b;
const char* ClassID() const { return "ADD_"; } const char* ClassID() const override { return "ADD_"; }
}; };
struct IEConstant : IIntElement { struct IEConstant : IIntElement {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
Value<atUint32> val; Value<atUint32> val;
const char* ClassID() const { return "CNST"; } const char* ClassID() const override { return "CNST"; }
}; };
struct IEImpulse : IIntElement { struct IEImpulse : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory val; IntElementFactory val;
const char* ClassID() const { return "IMPL"; } const char* ClassID() const override { return "IMPL"; }
}; };
struct IELifetimePercent : IIntElement { struct IELifetimePercent : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory percent; IntElementFactory percent;
const char* ClassID() const { return "ILPT"; } const char* ClassID() const override { return "ILPT"; }
}; };
struct IEInitialRandom : IIntElement { struct IEInitialRandom : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory a; IntElementFactory a;
IntElementFactory b; IntElementFactory b;
const char* ClassID() const { return "IRND"; } const char* ClassID() const override { return "IRND"; }
}; };
struct IEPulse : IIntElement { struct IEPulse : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory aDuration; IntElementFactory aDuration;
IntElementFactory bDuration; IntElementFactory bDuration;
IntElementFactory a; IntElementFactory a;
IntElementFactory b; IntElementFactory b;
const char* ClassID() const { return "PULS"; } const char* ClassID() const override { return "PULS"; }
}; };
struct IEMultiply : IIntElement { struct IEMultiply : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory a; IntElementFactory a;
IntElementFactory b; IntElementFactory b;
const char* ClassID() const { return "MULT"; } const char* ClassID() const override { return "MULT"; }
}; };
struct IESampleAndHold : IIntElement { struct IESampleAndHold : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory val; IntElementFactory val;
IntElementFactory waitMin; IntElementFactory waitMin;
IntElementFactory waitMax; IntElementFactory waitMax;
const char* ClassID() const { return "SPAH"; } const char* ClassID() const override { return "SPAH"; }
}; };
struct IERandom : IIntElement { struct IERandom : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory a; IntElementFactory a;
IntElementFactory b; IntElementFactory b;
const char* ClassID() const { return "RAND"; } const char* ClassID() const override { return "RAND"; }
}; };
struct IETimeScale : IIntElement { struct IETimeScale : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory dv; RealElementFactory dv;
const char* ClassID() const { return "TSCL"; } const char* ClassID() const override { return "TSCL"; }
}; };
struct IEGTCP : IIntElement { struct IEGTCP : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "GTCP"; } const char* ClassID() const override { return "GTCP"; }
}; };
struct IEModulo : IIntElement { struct IEModulo : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory a; IntElementFactory a;
IntElementFactory b; IntElementFactory b;
const char* ClassID() const { return "MODU"; } const char* ClassID() const override { return "MODU"; }
}; };
struct IESubtract : IIntElement { struct IESubtract : IIntElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory direction; IntElementFactory direction;
IntElementFactory baseRadius; IntElementFactory baseRadius;
const char* ClassID() const { return "SUB_"; } const char* ClassID() const override { return "SUB_"; }
}; };
struct VECone : IVectorElement { struct VECone : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory a; VectorElementFactory a;
RealElementFactory b; RealElementFactory b;
const char* ClassID() const { return "CONE"; } const char* ClassID() const override { return "CONE"; }
}; };
struct VETimeChain : IVectorElement { struct VETimeChain : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory a; VectorElementFactory a;
VectorElementFactory b; VectorElementFactory b;
IntElementFactory thresholdFrame; IntElementFactory thresholdFrame;
const char* ClassID() const { return "CHAN"; } const char* ClassID() const override { return "CHAN"; }
}; };
struct VEAngleCone : IVectorElement { struct VEAngleCone : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory angleXBias; RealElementFactory angleXBias;
RealElementFactory angleYBias; RealElementFactory angleYBias;
RealElementFactory angleXRange; RealElementFactory angleXRange;
RealElementFactory angleYRange; RealElementFactory angleYRange;
RealElementFactory magnitude; RealElementFactory magnitude;
const char* ClassID() const { return "ANGC"; } const char* ClassID() const override { return "ANGC"; }
}; };
struct VEAdd : IVectorElement { struct VEAdd : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory a; VectorElementFactory a;
VectorElementFactory b; VectorElementFactory b;
const char* ClassID() const { return "ADD_"; } const char* ClassID() const override { return "ADD_"; }
}; };
struct VECircleCluster : IVectorElement { struct VECircleCluster : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory circleOffset; VectorElementFactory circleOffset;
VectorElementFactory circleNormal; VectorElementFactory circleNormal;
IntElementFactory cycleFrames; IntElementFactory cycleFrames;
RealElementFactory randomFactor; RealElementFactory randomFactor;
const char* ClassID() const { return "CCLU"; } const char* ClassID() const override { return "CCLU"; }
}; };
struct VEConstant : IVectorElement { struct VEConstant : IVectorElement {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
RealElementFactory comps[3]; RealElementFactory comps[3];
const char* ClassID() const { return "CNST"; } const char* ClassID() const override { return "CNST"; }
}; };
struct VECircle : IVectorElement { struct VECircle : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory circleOffset; VectorElementFactory circleOffset;
VectorElementFactory circleNormal; VectorElementFactory circleNormal;
RealElementFactory angleConstant; RealElementFactory angleConstant;
RealElementFactory angleLinear; RealElementFactory angleLinear;
RealElementFactory circleRadius; RealElementFactory circleRadius;
const char* ClassID() const { return "CIRC"; } const char* ClassID() const override { return "CIRC"; }
}; };
struct VEKeyframeEmitter : IVectorElement { struct VEKeyframeEmitter : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
Value<atUint32> percentageTween; Value<atUint32> percentageTween;
Value<atUint32> unk1; Value<atUint32> unk1;
Value<bool> loop; Value<bool> loop;
@ -491,64 +496,64 @@ struct VEKeyframeEmitter : IVectorElement {
Value<atUint32> loopStart; Value<atUint32> loopStart;
Value<atUint32> count; Value<atUint32> count;
Vector<atVec3f, AT_DNA_COUNT(count)> keys; Vector<atVec3f, AT_DNA_COUNT(count)> keys;
const char* ClassID() const { return percentageTween ? "KEYP" : "KEYE"; } const char* ClassID() const override { return percentageTween ? "KEYP" : "KEYE"; }
}; };
struct VEMultiply : IVectorElement { struct VEMultiply : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory a; VectorElementFactory a;
VectorElementFactory b; VectorElementFactory b;
const char* ClassID() const { return "MULT"; } const char* ClassID() const override { return "MULT"; }
}; };
struct VERealToVector : IVectorElement { struct VERealToVector : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory a; RealElementFactory a;
const char* ClassID() const { return "RTOV"; } const char* ClassID() const override { return "RTOV"; }
}; };
struct VEPulse : IVectorElement { struct VEPulse : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory aDuration; IntElementFactory aDuration;
IntElementFactory bDuration; IntElementFactory bDuration;
VectorElementFactory a; VectorElementFactory a;
VectorElementFactory b; VectorElementFactory b;
const char* ClassID() const { return "PULS"; } const char* ClassID() const override { return "PULS"; }
}; };
struct VEParticleVelocity : IVectorElement { struct VEParticleVelocity : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PVEL"; } const char* ClassID() const override { return "PVEL"; }
}; };
struct VESPOS : IVectorElement { struct VESPOS : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory a; VectorElementFactory a;
const char* ClassID() const { return "SPOS"; } const char* ClassID() const override { return "SPOS"; }
}; };
struct VEPLCO : IVectorElement { struct VEPLCO : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PLCO"; } const char* ClassID() const override { return "PLCO"; }
}; };
struct VEPLOC : IVectorElement { struct VEPLOC : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PLOC"; } const char* ClassID() const override { return "PLOC"; }
}; };
struct VEPSOR : IVectorElement { struct VEPSOR : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PSOR"; } const char* ClassID() const override { return "PSOR"; }
}; };
struct VEPSOF : IVectorElement { struct VEPSOF : IVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "PSOF"; } const char* ClassID() const override { return "PSOF"; }
}; };
struct CEKeyframeEmitter : IColorElement { struct CEKeyframeEmitter : IColorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
Value<atUint32> percentageTween; Value<atUint32> percentageTween;
Value<atUint32> unk1; Value<atUint32> unk1;
Value<bool> loop; Value<bool> loop;
@ -557,164 +562,164 @@ struct CEKeyframeEmitter : IColorElement {
Value<atUint32> loopStart; Value<atUint32> loopStart;
Value<atUint32> count; Value<atUint32> count;
Vector<atVec4f, AT_DNA_COUNT(count)> keys; Vector<atVec4f, AT_DNA_COUNT(count)> keys;
const char* ClassID() const { return percentageTween ? "KEYP" : "KEYE"; } const char* ClassID() const override { return percentageTween ? "KEYP" : "KEYE"; }
}; };
struct CEConstant : IColorElement { struct CEConstant : IColorElement {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
RealElementFactory comps[4]; RealElementFactory comps[4];
const char* ClassID() const { return "CNST"; } const char* ClassID() const override { return "CNST"; }
}; };
struct CETimeChain : IColorElement { struct CETimeChain : IColorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
ColorElementFactory a; ColorElementFactory a;
ColorElementFactory b; ColorElementFactory b;
IntElementFactory thresholdFrame; IntElementFactory thresholdFrame;
const char* ClassID() const { return "CHAN"; } const char* ClassID() const override { return "CHAN"; }
}; };
struct CEFadeEnd : IColorElement { struct CEFadeEnd : IColorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
ColorElementFactory a; ColorElementFactory a;
ColorElementFactory b; ColorElementFactory b;
RealElementFactory startFrame; RealElementFactory startFrame;
RealElementFactory endFrame; RealElementFactory endFrame;
const char* ClassID() const { return "CFDE"; } const char* ClassID() const override { return "CFDE"; }
}; };
struct CEFade : IColorElement { struct CEFade : IColorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
ColorElementFactory a; ColorElementFactory a;
ColorElementFactory b; ColorElementFactory b;
RealElementFactory endFrame; RealElementFactory endFrame;
const char* ClassID() const { return "FADE"; } const char* ClassID() const override { return "FADE"; }
}; };
struct CEPulse : IColorElement { struct CEPulse : IColorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory aDuration; IntElementFactory aDuration;
IntElementFactory bDuration; IntElementFactory bDuration;
ColorElementFactory a; ColorElementFactory a;
ColorElementFactory b; ColorElementFactory b;
const char* ClassID() const { return "PULS"; } const char* ClassID() const override { return "PULS"; }
}; };
struct MVEImplosion : IModVectorElement { struct MVEImplosion : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory implodePoint; VectorElementFactory implodePoint;
RealElementFactory velocityScale; RealElementFactory velocityScale;
RealElementFactory maxRadius; RealElementFactory maxRadius;
RealElementFactory minRadius; RealElementFactory minRadius;
BoolHelper enableMinRadius; BoolHelper enableMinRadius;
const char* ClassID() const { return "IMPL"; } const char* ClassID() const override { return "IMPL"; }
}; };
struct MVEExponentialImplosion : IModVectorElement { struct MVEExponentialImplosion : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory implodePoint; VectorElementFactory implodePoint;
RealElementFactory velocityScale; RealElementFactory velocityScale;
RealElementFactory maxRadius; RealElementFactory maxRadius;
RealElementFactory minRadius; RealElementFactory minRadius;
BoolHelper enableMinRadius; BoolHelper enableMinRadius;
const char* ClassID() const { return "EMPL"; } const char* ClassID() const override { return "EMPL"; }
}; };
struct MVETimeChain : IModVectorElement { struct MVETimeChain : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
ModVectorElementFactory a; ModVectorElementFactory a;
ModVectorElementFactory b; ModVectorElementFactory b;
IntElementFactory thresholdFrame; IntElementFactory thresholdFrame;
const char* ClassID() const { return "CHAN"; } const char* ClassID() const override { return "CHAN"; }
}; };
struct MVEBounce : IModVectorElement { struct MVEBounce : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory planePoint; VectorElementFactory planePoint;
VectorElementFactory planeNormal; VectorElementFactory planeNormal;
RealElementFactory friction; RealElementFactory friction;
RealElementFactory restitution; RealElementFactory restitution;
BoolHelper dieOnPenetrate; BoolHelper dieOnPenetrate;
const char* ClassID() const { return "BNCE"; } const char* ClassID() const override { return "BNCE"; }
}; };
struct MVEConstant : IModVectorElement { struct MVEConstant : IModVectorElement {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
RealElementFactory comps[3]; RealElementFactory comps[3];
const char* ClassID() const { return "CNST"; } const char* ClassID() const override { return "CNST"; }
}; };
struct MVEGravity : IModVectorElement { struct MVEGravity : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory acceleration; VectorElementFactory acceleration;
const char* ClassID() const { return "GRAV"; } const char* ClassID() const override { return "GRAV"; }
}; };
struct MVEExplode : IModVectorElement { struct MVEExplode : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
RealElementFactory impulseMagnitude; RealElementFactory impulseMagnitude;
RealElementFactory falloffFactor; RealElementFactory falloffFactor;
const char* ClassID() const { return "EXPL"; } const char* ClassID() const override { return "EXPL"; }
}; };
struct MVESetPosition : IModVectorElement { struct MVESetPosition : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory position; VectorElementFactory position;
const char* ClassID() const { return "SPOS"; } const char* ClassID() const override { return "SPOS"; }
}; };
struct MVELinearImplosion : IModVectorElement { struct MVELinearImplosion : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory implodePoint; VectorElementFactory implodePoint;
RealElementFactory velocityScale; RealElementFactory velocityScale;
RealElementFactory maxRadius; RealElementFactory maxRadius;
RealElementFactory minRadius; RealElementFactory minRadius;
BoolHelper enableMinRadius; BoolHelper enableMinRadius;
const char* ClassID() const { return "LMPL"; } const char* ClassID() const override { return "LMPL"; }
}; };
struct MVEPulse : IModVectorElement { struct MVEPulse : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
IntElementFactory aDuration; IntElementFactory aDuration;
IntElementFactory bDuration; IntElementFactory bDuration;
ModVectorElementFactory a; ModVectorElementFactory a;
ModVectorElementFactory b; ModVectorElementFactory b;
const char* ClassID() const { return "PULS"; } const char* ClassID() const override { return "PULS"; }
}; };
struct MVEWind : IModVectorElement { struct MVEWind : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory windVelocity; VectorElementFactory windVelocity;
RealElementFactory factor; RealElementFactory factor;
const char* ClassID() const { return "WIND"; } const char* ClassID() const override { return "WIND"; }
}; };
struct MVESwirl : IModVectorElement { struct MVESwirl : IModVectorElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory helixPoint; VectorElementFactory helixPoint;
VectorElementFactory curveBinormal; VectorElementFactory curveBinormal;
RealElementFactory filterGain; RealElementFactory filterGain;
RealElementFactory tangentialVelocity; RealElementFactory tangentialVelocity;
const char* ClassID() const { return "SWRL"; } const char* ClassID() const override { return "SWRL"; }
}; };
struct EESimpleEmitter : IEmitterElement { struct EESimpleEmitter : IEmitterElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory position; VectorElementFactory position;
VectorElementFactory velocity; VectorElementFactory velocity;
const char* ClassID() const { return "SEMR"; } const char* ClassID() const override { return "SEMR"; }
}; };
struct VESphere : IEmitterElement { struct VESphere : IEmitterElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory sphereOrigin; VectorElementFactory sphereOrigin;
RealElementFactory sphereRadius; RealElementFactory sphereRadius;
RealElementFactory magnitude; RealElementFactory magnitude;
const char* ClassID() const { return "SPHE"; } const char* ClassID() const override { return "SPHE"; }
}; };
struct VEAngleSphere : IEmitterElement { struct VEAngleSphere : IEmitterElement {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV_NO_TYPE
VectorElementFactory sphereOrigin; VectorElementFactory sphereOrigin;
RealElementFactory sphereRadius; RealElementFactory sphereRadius;
RealElementFactory magnitude; RealElementFactory magnitude;
@ -722,29 +727,29 @@ struct VEAngleSphere : IEmitterElement {
RealElementFactory angleYBias; RealElementFactory angleYBias;
RealElementFactory angleXRange; RealElementFactory angleXRange;
RealElementFactory angleYRange; RealElementFactory angleYRange;
const char* ClassID() const { return "ASPH"; } const char* ClassID() const override { return "ASPH"; }
}; };
struct EESimpleEmitterTR : EESimpleEmitter { struct EESimpleEmitterTR : EESimpleEmitter {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
const char* ClassID() const { return "SETR"; } const char* ClassID() const override { return "SETR"; }
}; };
template <class IDType> template <class IDType>
struct UVEConstant : IUVElement { struct UVEConstant : IUVElement {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
AT_SUBDECL_DNA AT_SUBDECL_DNA
CastIDToZero<IDType> tex; CastIDToZero<IDType> tex;
const char* ClassID() const { return "CNST"; } const char* ClassID() const override { return "CNST"; }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const override {
g_curSpec->flattenDependencies(tex, pathsOut); g_curSpec->flattenDependencies(tex, pathsOut);
} }
}; };
template <class IDType> template <class IDType>
struct UVEAnimTexture : IUVElement { struct UVEAnimTexture : IUVElement {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV_NO_TYPE
AT_SUBDECL_DNA AT_SUBDECL_DNA
CastIDToZero<IDType> tex; CastIDToZero<IDType> tex;
IntElementFactory tileW; IntElementFactory tileW;
@ -753,9 +758,9 @@ struct UVEAnimTexture : IUVElement {
IntElementFactory strideH; IntElementFactory strideH;
IntElementFactory cycleFrames; IntElementFactory cycleFrames;
Value<bool> loop = false; Value<bool> loop = false;
const char* ClassID() const { return "ATEX"; } const char* ClassID() const override { return "ATEX"; }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const override {
g_curSpec->flattenDependencies(tex, pathsOut); g_curSpec->flattenDependencies(tex, pathsOut);
} }
}; };

View File

@ -1,8 +1,10 @@
#include "RigInverter.hpp" #include "DataSpec/DNACommon/RigInverter.hpp"
#include "DataSpec/DNAMP1/CINF.hpp" #include "DataSpec/DNAMP1/CINF.hpp"
#include "DataSpec/DNAMP2/CINF.hpp" #include "DataSpec/DNAMP2/CINF.hpp"
#include "DataSpec/DNAMP3/CINF.hpp" #include "DataSpec/DNAMP3/CINF.hpp"
#include "hecl/Blender/Connection.hpp"
#include <hecl/Blender/Connection.hpp>
namespace DataSpec::DNAANIM { namespace DataSpec::DNAANIM {

View File

@ -1,10 +1,12 @@
#pragma once #pragma once
#include "zeus/CVector3f.hpp" #include <string>
#include "zeus/CMatrix3f.hpp"
#include "zeus/CQuaternion.hpp"
#include "hecl/hecl.hpp"
#include <unordered_map> #include <unordered_map>
#include <vector>
#include <hecl/hecl.hpp>
#include <zeus/CQuaternion.hpp>
#include <zeus/CVector3f.hpp>
namespace DataSpec::DNAANIM { namespace DataSpec::DNAANIM {

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "DNACommon.hpp"
#include "PAK.hpp" #include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
namespace DataSpec::SAVWCommon { namespace DataSpec::SAVWCommon {
enum class EScanCategory { None, Data, Lore, Creature, Research, Artifact }; enum class EScanCategory { None, Data, Lore, Creature, Research, Artifact };

View File

@ -1,7 +1,10 @@
#include "STRG.hpp" #include "DataSpec/DNACommon/STRG.hpp"
#include "../DNAMP1/STRG.hpp"
#include "../DNAMP2/STRG.hpp" #include "DataSpec/DNAMP1/STRG.hpp"
#include "../DNAMP3/STRG.hpp" #include "DataSpec/DNAMP2/STRG.hpp"
#include "DataSpec/DNAMP3/STRG.hpp"
#include <logvisor/logvisor.hpp>
namespace DataSpec { namespace DataSpec {

View File

@ -1,15 +1,22 @@
#pragma once #pragma once
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string> #include <string>
#include <fstream> #include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <hecl/hecl.hpp> #include <hecl/hecl.hpp>
#include <hecl/Database.hpp>
#include <athena/FileWriter.hpp> namespace athena::io {
#include "DNACommon.hpp" class IStreamReader;
}
namespace DataSpec { namespace DataSpec {
struct ISTRG : BigDNAVYaml { struct ISTRG : BigDNAVYaml {
virtual ~ISTRG() = default; ~ISTRG() override = default;
virtual size_t count() const = 0; virtual size_t count() const = 0;
virtual std::string getUTF8(const FourCC& lang, size_t idx) const = 0; virtual std::string getUTF8(const FourCC& lang, size_t idx) const = 0;

View File

@ -1,4 +1,8 @@
#include "SWHC.hpp" #include "DataSpec/DNACommon/SWHC.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {

View File

@ -1,8 +1,17 @@
#pragma once #pragma once
#include "ParticleCommon.hpp" #include <vector>
#include "PAK.hpp"
#include "athena/FileWriter.hpp" #include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/ParticleCommon.hpp"
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {

View File

@ -1,9 +1,15 @@
#include "DataSpec/DNACommon/TXTR.hpp"
#include <cstdint>
#include <memory>
#include "DataSpec/DNACommon/PAK.hpp"
#include <athena/FileWriter.hpp>
#include <hecl/hecl.hpp>
#include <logvisor/logvisor.hpp>
#include <png.h> #include <png.h>
#include <squish.h> #include <squish.h>
#include "TXTR.hpp"
#include "PAK.hpp"
#include "athena/FileWriter.hpp"
#include "hecl/hecl.hpp"
namespace DataSpec { namespace DataSpec {
@ -806,13 +812,13 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
uint16_t height = rs.readUint16Big(); uint16_t height = rs.readUint16Big();
uint32_t numMips = rs.readUint32Big(); uint32_t numMips = rs.readUint32Big();
FILE* fp = hecl::Fopen(outPath.getAbsolutePath().data(), _SYS_STR("wb")); auto fp = hecl::FopenUnique(outPath.getAbsolutePath().data(), _SYS_STR("wb"));
if (!fp) { if (fp == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath());
return false; return false;
} }
png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, PNGErr, PNGWarn); png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, PNGErr, PNGWarn);
png_init_io(png, fp); png_init_io(png, fp.get());
png_infop info = png_create_info_struct(png); png_infop info = png_create_info_struct(png);
png_text textStruct = {}; png_text textStruct = {};
@ -856,7 +862,6 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
png_write_end(png, info); png_write_end(png, info);
png_write_flush(png); png_write_flush(png);
png_destroy_write_struct(&png, &info); png_destroy_write_struct(&png, &info);
fclose(fp);
return true; return true;
} }
@ -1011,18 +1016,17 @@ static int GetNumPaletteEntriesForGCN(png_structp png, png_infop info) {
} }
bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) { bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) {
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _SYS_STR("rb")); auto inf = hecl::FopenUnique(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (!inf) { if (inf == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath());
return false; return false;
} }
/* Validate PNG */ /* Validate PNG */
char header[8]; char header[8];
fread(header, 1, 8, inf); std::fread(header, 1, sizeof(header), inf.get());
if (png_sig_cmp((png_const_bytep)header, 0, 8)) { if (png_sig_cmp((png_const_bytep)header, 0, 8)) {
Log.report(logvisor::Error, fmt(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath());
fclose(inf);
return false; return false;
} }
@ -1030,25 +1034,22 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
png_structp pngRead = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); png_structp pngRead = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (!pngRead) { if (!pngRead) {
Log.report(logvisor::Error, fmt("unable to initialize libpng")); Log.report(logvisor::Error, fmt("unable to initialize libpng"));
fclose(inf);
return false; return false;
} }
png_infop info = png_create_info_struct(pngRead); png_infop info = png_create_info_struct(pngRead);
if (!info) { if (!info) {
Log.report(logvisor::Error, fmt("unable to initialize libpng info")); Log.report(logvisor::Error, fmt("unable to initialize libpng info"));
fclose(inf);
png_destroy_read_struct(&pngRead, nullptr, nullptr); png_destroy_read_struct(&pngRead, nullptr, nullptr);
return false; return false;
} }
if (setjmp(png_jmpbuf(pngRead))) { if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
png_init_io(pngRead, inf); png_init_io(pngRead, inf.get());
png_set_sig_bytes(pngRead, 8); png_set_sig_bytes(pngRead, 8);
png_read_info(pngRead, info); png_read_info(pngRead, info);
@ -1060,7 +1061,6 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (width < 4 || height < 4) { if (width < 4 || height < 4) {
Log.report(logvisor::Error, fmt("image must be 4x4 or larger")); Log.report(logvisor::Error, fmt("image must be 4x4 or larger"));
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
@ -1086,7 +1086,6 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (bitDepth != 8) { if (bitDepth != 8) {
Log.report(logvisor::Error, fmt(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
@ -1118,7 +1117,6 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
break; break;
default: default:
Log.report(logvisor::Error, fmt(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
@ -1139,7 +1137,6 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (setjmp(png_jmpbuf(pngRead))) { if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath()); Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
@ -1172,7 +1169,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
} }
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
fclose(inf); inf.reset();
/* Reduce mipmaps to minimum allowed dimensions */ /* Reduce mipmaps to minimum allowed dimensions */
unsigned minDimX, minDimY; unsigned minDimX, minDimY;
@ -1332,18 +1329,17 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
} }
bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) { bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) {
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _SYS_STR("rb")); auto inf = hecl::FopenUnique(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (!inf) { if (inf == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath());
return false; return false;
} }
/* Validate PNG */ /* Validate PNG */
char header[8]; char header[8];
fread(header, 1, 8, inf); std::fread(header, 1, sizeof(header), inf.get());
if (png_sig_cmp((png_const_bytep)header, 0, 8)) { if (png_sig_cmp((png_const_bytep)header, 0, 8)) {
Log.report(logvisor::Error, fmt(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath());
fclose(inf);
return false; return false;
} }
@ -1351,25 +1347,22 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
png_structp pngRead = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); png_structp pngRead = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (!pngRead) { if (!pngRead) {
Log.report(logvisor::Error, fmt("unable to initialize libpng")); Log.report(logvisor::Error, fmt("unable to initialize libpng"));
fclose(inf);
return false; return false;
} }
png_infop info = png_create_info_struct(pngRead); png_infop info = png_create_info_struct(pngRead);
if (!info) { if (!info) {
Log.report(logvisor::Error, fmt("unable to initialize libpng info")); Log.report(logvisor::Error, fmt("unable to initialize libpng info"));
fclose(inf);
png_destroy_read_struct(&pngRead, nullptr, nullptr); png_destroy_read_struct(&pngRead, nullptr, nullptr);
return false; return false;
} }
if (setjmp(png_jmpbuf(pngRead))) { if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Error, fmt(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("unable to initialize libpng I/O for '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
png_init_io(pngRead, inf); png_init_io(pngRead, inf.get());
png_set_sig_bytes(pngRead, 8); png_set_sig_bytes(pngRead, 8);
png_read_info(pngRead, info); png_read_info(pngRead, info);
@ -1400,7 +1393,6 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (bitDepth != 8) { if (bitDepth != 8) {
Log.report(logvisor::Error, fmt(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
@ -1430,7 +1422,6 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
break; break;
default: default:
Log.report(logvisor::Error, fmt(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath()); Log.report(logvisor::Error, fmt(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
@ -1449,7 +1440,6 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (setjmp(png_jmpbuf(pngRead))) { if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath()); Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
return false; return false;
} }
@ -1515,7 +1505,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
} }
png_destroy_read_struct(&pngRead, &info, nullptr); png_destroy_read_struct(&pngRead, &info, nullptr);
fclose(inf); inf.reset();
/* Perform box-filter mipmap */ /* Perform box-filter mipmap */
if (numMips > 1) { if (numMips > 1) {
@ -1595,33 +1585,66 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
return true; return true;
} }
template <class Op>
void DataSpec::TXTR::PaletteMeta::Enumerate(typename Op::StreamT& s) {
Do<Op>(athena::io::PropId{"format"}, format, s);
Do<Op>(athena::io::PropId{"elementCount"}, elementCount, s);
Do<Op>(athena::io::PropId{"dolphinHash"}, dolphinHash, s);
}
AT_SPECIALIZE_DNA_YAML(DataSpec::TXTR::PaletteMeta)
const char* DataSpec::TXTR::PaletteMeta::DNAType() {
return "DataSpec::TXTR::PaletteMeta";
}
template <class Op>
void DataSpec::TXTR::Meta::Enumerate(typename Op::StreamT& s) {
Do<Op>(athena::io::PropId{"format"}, format, s);
Do<Op>(athena::io::PropId{"mips"}, mips, s);
Do<Op>(athena::io::PropId{"width"}, width, s);
Do<Op>(athena::io::PropId{"height"}, height, s);
Do<Op>(athena::io::PropId{"dolphinHash"}, dolphinHash, s);
Do<Op>(athena::io::PropId{"hasPalette"}, hasPalette, s);
if (hasPalette)
Do<Op>(athena::io::PropId{"palette"}, palette, s);
}
AT_SPECIALIZE_DNA_YAML(DataSpec::TXTR::Meta)
const char* DataSpec::TXTR::Meta::DNAType() {
return "DataSpec::TXTR::Meta";
}
static const atInt32 RetroToDol[11] { static const atInt32 RetroToDol[11] {
0, 1, 2, 3, 8, 9, -1, 4, 5, 6, 14 0, 1, 2, 3, 8, 9, -1, 4, 5, 6, 14
}; };
std::string TXTR::CalculateDolphinName(DataSpec::PAKEntryReadStream& rs) { TXTR::Meta TXTR::GetMetaData(DataSpec::PAKEntryReadStream& rs) {
atUint32 format = RetroToDol[rs.readUint32Big()]; atUint32 retroFormat = rs.readUint32Big();
atUint32 format = RetroToDol[retroFormat];
if (format == UINT32_MAX) if (format == UINT32_MAX)
return {}; return {};
atUint16 width = rs.readUint16Big(); Meta meta;
atUint16 height = rs.readUint16Big(); meta.format = retroFormat;
atUint32 mips = rs.readUint32Big(); meta.width = rs.readUint16Big();
std::string res = fmt::format(fmt("tex1_{}x{}{}"), width, height, mips > 1 ? "_m" : ""); meta.height = rs.readUint16Big();
atUint64 palHash = 0; meta.mips = rs.readUint32Big();
bool hasPalette = false; atUint32 textureSize = meta.width * meta.height;
atUint32 textureSize = width * height;
if (format == 8 || format == 9) { if (format == 8 || format == 9) {
hasPalette = true; meta.hasPalette = true;
atUint32 paletteFormat = rs.readUint32Big(); PaletteMeta& palMeta = meta.palette;
palMeta.format = rs.readUint32Big();
atUint16 palWidth = rs.readUint16Big(); atUint16 palWidth = rs.readUint16Big();
atUint16 palHeight = rs.readUint16Big(); atUint16 palHeight = rs.readUint16Big();
palMeta.elementCount = palWidth * palHeight;
atUint32 palSize = atUint32(palWidth * palHeight * 2); atUint32 palSize = atUint32(palWidth * palHeight * 2);
if (format == 4) if (format == 8)
textureSize /= 2; textureSize /= 2;
std::unique_ptr<u8[]> palData(new u8[palSize]); std::unique_ptr<u8[]> palData(new u8[palSize]);
rs.readUBytesToBuf(palData.get(), palSize); rs.readUBytesToBuf(palData.get(), palSize);
palHash = XXH64(palData.get(), palSize, 0); palMeta.dolphinHash = XXH64(palData.get(), palSize, 0);
} else { } else {
switch(format) { switch(format) {
case 0: // I4 case 0: // I4
@ -1642,13 +1665,9 @@ std::string TXTR::CalculateDolphinName(DataSpec::PAKEntryReadStream& rs) {
} }
std::unique_ptr<u8[]> textureData(new u8[textureSize]); std::unique_ptr<u8[]> textureData(new u8[textureSize]);
rs.readUBytesToBuf(textureData.get(), textureSize); rs.readUBytesToBuf(textureData.get(), textureSize);
atUint64 texHash = XXH64(textureData.get(), textureSize, 0); meta.dolphinHash = XXH64(textureData.get(), textureSize, 0);
res += fmt::format(fmt("_{:016X}"), texHash);
if (hasPalette)
res += fmt::format(fmt("_{:016X}"), palHash);
res += fmt::format(fmt("_{}"), format);
return res; return meta;
} }
} // namespace DataSpec } // namespace DataSpec

View File

@ -1,15 +1,38 @@
#pragma once #pragma once
#include "DNACommon.hpp" #include <climits>
#include "DataSpec/DNACommon/DNACommon.hpp"
namespace hecl {
class ProjectPath;
}
namespace DataSpec { namespace DataSpec {
class PAKEntryReadStream; class PAKEntryReadStream;
struct TXTR { struct TXTR {
struct PaletteMeta : BigDNAVYaml {
AT_DECL_EXPLICIT_DNA_YAMLV
Value<atUint32> format = UINT_MAX;
Value<atUint32> elementCount = 0;
Value<atUint64> dolphinHash = 0;
};
struct Meta : BigDNAVYaml {
AT_DECL_EXPLICIT_DNA_YAMLV
Value<atUint32> format = UINT_MAX;
Value<atUint32> mips = 0;
Value<atUint16> width = 0;
Value<atUint16> height = 0;
Value<atUint64> dolphinHash = 0;
Value<bool> hasPalette = false;
PaletteMeta palette;
};
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath); static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath);
static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath); static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath);
static bool CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath); static bool CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath);
static std::string CalculateDolphinName(PAKEntryReadStream& rs); static TXTR::Meta GetMetaData(PAKEntryReadStream& rs);
}; };
} // namespace DataSpec } // namespace DataSpec

View File

@ -1,4 +1,8 @@
#include "WPSC.hpp" #include "DataSpec/DNACommon/WPSC.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {

View File

@ -1,8 +1,15 @@
#pragma once #pragma once
#include "ParticleCommon.hpp" #include "DataSpec/DNACommon/DNACommon.hpp"
#include "PAK.hpp" #include "DataSpec/DNACommon/ParticleCommon.hpp"
#include "athena/FileWriter.hpp"
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {
template <class IDType> template <class IDType>

View File

@ -145,8 +145,7 @@ struct ANCS : BigDNA {
std::unique_ptr<IMetaAnim> m_anim; std::unique_ptr<IMetaAnim> m_anim;
}; };
struct MetaAnimPrimitive : IMetaAnim { struct MetaAnimPrimitive : IMetaAnim {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
MetaAnimPrimitive() : IMetaAnim(Type::Primitive, "Primitive") {} MetaAnimPrimitive() : IMetaAnim(Type::Primitive, "Primitive") {}
UniqueID32 animId; UniqueID32 animId;
@ -156,26 +155,27 @@ struct ANCS : BigDNA {
Value<atUint32> unk2; Value<atUint32> unk2;
void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter, void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter,
std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out); std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) override;
bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) { return func(*this); } bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) override {
return func(*this);
}
}; };
struct MetaAnimBlend : IMetaAnim { struct MetaAnimBlend : IMetaAnim {
MetaAnimBlend() : IMetaAnim(Type::Blend, "Blend") {} MetaAnimBlend() : IMetaAnim(Type::Blend, "Blend") {}
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
MetaAnimFactory animA; MetaAnimFactory animA;
MetaAnimFactory animB; MetaAnimFactory animB;
Value<float> unkFloat; Value<float> unkFloat;
Value<atUint8> unk; Value<atUint8> unk;
void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter, void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter,
std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) { std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) override {
animA.m_anim->gatherPrimitives(pakRouter, out); animA.m_anim->gatherPrimitives(pakRouter, out);
animB.m_anim->gatherPrimitives(pakRouter, out); animB.m_anim->gatherPrimitives(pakRouter, out);
} }
bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) { bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) override {
if (!animA.m_anim->enumeratePrimitives(func)) if (!animA.m_anim->enumeratePrimitives(func))
return false; return false;
if (!animB.m_anim->enumeratePrimitives(func)) if (!animB.m_anim->enumeratePrimitives(func))
@ -185,20 +185,19 @@ struct ANCS : BigDNA {
}; };
struct MetaAnimPhaseBlend : IMetaAnim { struct MetaAnimPhaseBlend : IMetaAnim {
MetaAnimPhaseBlend() : IMetaAnim(Type::PhaseBlend, "PhaseBlend") {} MetaAnimPhaseBlend() : IMetaAnim(Type::PhaseBlend, "PhaseBlend") {}
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
MetaAnimFactory animA; MetaAnimFactory animA;
MetaAnimFactory animB; MetaAnimFactory animB;
Value<float> unkFloat; Value<float> unkFloat;
Value<atUint8> unk; Value<atUint8> unk;
void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter, void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter,
std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) { std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) override {
animA.m_anim->gatherPrimitives(pakRouter, out); animA.m_anim->gatherPrimitives(pakRouter, out);
animB.m_anim->gatherPrimitives(pakRouter, out); animB.m_anim->gatherPrimitives(pakRouter, out);
} }
bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) { bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) override {
if (!animA.m_anim->enumeratePrimitives(func)) if (!animA.m_anim->enumeratePrimitives(func))
return false; return false;
if (!animB.m_anim->enumeratePrimitives(func)) if (!animB.m_anim->enumeratePrimitives(func))
@ -208,8 +207,7 @@ struct ANCS : BigDNA {
}; };
struct MetaAnimRandom : IMetaAnim { struct MetaAnimRandom : IMetaAnim {
MetaAnimRandom() : IMetaAnim(Type::Random, "Random") {} MetaAnimRandom() : IMetaAnim(Type::Random, "Random") {}
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
Value<atUint32> animCount; Value<atUint32> animCount;
struct Child : BigDNA { struct Child : BigDNA {
AT_DECL_DNA AT_DECL_DNA
@ -219,12 +217,12 @@ struct ANCS : BigDNA {
Vector<Child, AT_DNA_COUNT(animCount)> children; Vector<Child, AT_DNA_COUNT(animCount)> children;
void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter, void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter,
std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) { std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) override {
for (const auto& child : children) for (const auto& child : children)
child.anim.m_anim->gatherPrimitives(pakRouter, out); child.anim.m_anim->gatherPrimitives(pakRouter, out);
} }
bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) { bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) override {
for (auto& child : children) for (auto& child : children)
if (!child.anim.m_anim->enumeratePrimitives(func)) if (!child.anim.m_anim->enumeratePrimitives(func))
return false; return false;
@ -233,18 +231,17 @@ struct ANCS : BigDNA {
}; };
struct MetaAnimSequence : IMetaAnim { struct MetaAnimSequence : IMetaAnim {
MetaAnimSequence() : IMetaAnim(Type::Sequence, "Sequence") {} MetaAnimSequence() : IMetaAnim(Type::Sequence, "Sequence") {}
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
Value<atUint32> animCount; Value<atUint32> animCount;
Vector<MetaAnimFactory, AT_DNA_COUNT(animCount)> children; Vector<MetaAnimFactory, AT_DNA_COUNT(animCount)> children;
void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter, void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter,
std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) { std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) override {
for (const auto& child : children) for (const auto& child : children)
child.m_anim->gatherPrimitives(pakRouter, out); child.m_anim->gatherPrimitives(pakRouter, out);
} }
bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) { bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) override {
for (auto& child : children) for (auto& child : children)
if (!child.m_anim->enumeratePrimitives(func)) if (!child.m_anim->enumeratePrimitives(func))
return false; return false;
@ -280,23 +277,21 @@ struct ANCS : BigDNA {
}; };
struct MetaTransMetaAnim : IMetaTrans { struct MetaTransMetaAnim : IMetaTrans {
MetaTransMetaAnim() : IMetaTrans(Type::MetaAnim, "MetaAnim") {} MetaTransMetaAnim() : IMetaTrans(Type::MetaAnim, "MetaAnim") {}
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
MetaAnimFactory anim; MetaAnimFactory anim;
void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter, void gatherPrimitives(PAKRouter<PAKBridge>* pakRouter,
std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) { std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out) override {
anim.m_anim->gatherPrimitives(pakRouter, out); anim.m_anim->gatherPrimitives(pakRouter, out);
} }
bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) { bool enumeratePrimitives(const std::function<bool(MetaAnimPrimitive& prim)>& func) override {
return anim.m_anim->enumeratePrimitives(func); return anim.m_anim->enumeratePrimitives(func);
} }
}; };
struct MetaTransTrans : IMetaTrans { struct MetaTransTrans : IMetaTrans {
MetaTransTrans() : IMetaTrans(Type::Trans, "Trans") {} MetaTransTrans() : IMetaTrans(Type::Trans, "Trans") {}
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
Value<float> transDurTime; Value<float> transDurTime;
Value<atUint32> transDurTimeMode; Value<atUint32> transDurTimeMode;
Value<bool> unk2; Value<bool> unk2;
@ -305,8 +300,7 @@ struct ANCS : BigDNA {
}; };
struct MetaTransPhaseTrans : IMetaTrans { struct MetaTransPhaseTrans : IMetaTrans {
MetaTransPhaseTrans() : IMetaTrans(Type::PhaseTrans, "PhaseTrans") {} MetaTransPhaseTrans() : IMetaTrans(Type::PhaseTrans, "PhaseTrans") {}
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
Value<float> transDurTime; Value<float> transDurTime;
Value<atUint32> transDurTimeMode; Value<atUint32> transDurTimeMode;
Value<bool> unk2; Value<bool> unk2;

View File

@ -31,8 +31,7 @@ struct ANIM : BigDNA {
}; };
struct ANIM0 : IANIM { struct ANIM0 : IANIM {
AT_DECL_EXPLICIT_DNA AT_DECL_EXPLICIT_DNAV
AT_DECL_DNAV
ANIM0() : IANIM(0) {} ANIM0() : IANIM(0) {}
struct Header : BigDNA { struct Header : BigDNA {
@ -48,8 +47,7 @@ struct ANIM : BigDNA {
}; };
struct ANIM2 : IANIM { struct ANIM2 : IANIM {
AT_DECL_EXPLICIT_DNA AT_DECL_EXPLICIT_DNAV
AT_DECL_DNAV
ANIM2(bool pc) : IANIM(pc ? 3 : 2) {} ANIM2(bool pc) : IANIM(pc ? 3 : 2) {}
struct Header : BigDNA { struct Header : BigDNA {

View File

@ -454,6 +454,7 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
out.format(fmt("new_material = bpy.data.materials.new('MAT_{}_{}')\n"), groupIdx, matIdx); out.format(fmt("new_material = bpy.data.materials.new('MAT_{}_{}')\n"), groupIdx, matIdx);
out << "new_material.use_fake_user = True\n" out << "new_material.use_fake_user = True\n"
"new_material.use_nodes = True\n" "new_material.use_nodes = True\n"
"new_material.use_backface_culling = True\n"
"new_nodetree = new_material.node_tree\n" "new_nodetree = new_material.node_tree\n"
"for n in new_nodetree.nodes:\n" "for n in new_nodetree.nodes:\n"
" new_nodetree.nodes.remove(n)\n" " new_nodetree.nodes.remove(n)\n"
@ -578,6 +579,8 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, TexLink("Alpha", 1, true)); break; _GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, TexLink("Alpha", 1, true)); break;
case 0x54A92F25: /* RetroShader: ObjLightmap, KColorDiffuse, Alpha=KAlpha */ case 0x54A92F25: /* RetroShader: ObjLightmap, KColorDiffuse, Alpha=KAlpha */
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola); break; _GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola); break;
case 0x54C6204C:
_GenerateRootShader(out, "RetroShader"); break;
case 0x5A62D5F0: /* RetroShader: Lightmap, Diffuse, UnusedExtendedSpecular?, Alpha=DiffuseAlpha */ case 0x5A62D5F0: /* RetroShader: Lightmap, Diffuse, UnusedExtendedSpecular?, Alpha=DiffuseAlpha */
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true)); break; _GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true)); break;
case 0x5CB59821: /* RetroShader: Diffuse, UnusedSpecular?, Alpha=KAlpha */ case 0x5CB59821: /* RetroShader: Diffuse, UnusedSpecular?, Alpha=KAlpha */
@ -606,6 +609,8 @@ static void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupI
_GenerateRootShader(out, "RetroShader", WhiteColorLink("Specular"), "Reflection"_tex); break; _GenerateRootShader(out, "RetroShader", WhiteColorLink("Specular"), "Reflection"_tex); break;
case 0x846215DA: /* RetroShader: Diffuse, Specular, Reflection, Alpha=DiffuseAlpha, IndirectTex */ case 0x846215DA: /* RetroShader: Diffuse, Specular, Reflection, Alpha=DiffuseAlpha, IndirectTex */
_GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex, TexLink("Alpha", 0, true)); break; _GenerateRootShader(out, "RetroShader", "Diffuse"_tex, "Specular"_tex, "Reflection"_tex, "IndirectTex"_tex, TexLink("Alpha", 0, true)); break;
case 0x8E916C01: /* RetroShader: NULL, all inputs 0 */
_GenerateRootShader(out, "RetroShader"); break;
case 0x957709F8: /* RetroShader: Emissive, Alpha=1.0 */ case 0x957709F8: /* RetroShader: Emissive, Alpha=1.0 */
_GenerateRootShader(out, "RetroShader", "Emissive"_tex); break; _GenerateRootShader(out, "RetroShader", "Emissive"_tex); break;
case 0x96ABB2D3: /* RetroShader: Lightmap, Diffuse, Alpha=DiffuseAlpha */ case 0x96ABB2D3: /* RetroShader: Lightmap, Diffuse, Alpha=DiffuseAlpha */
@ -1065,14 +1070,14 @@ AT_SPECIALIZE_DNA(MaterialSet::Material::UVAnimation)
template <class Op> template <class Op>
void HMDLMaterialSet::Material::PASS::Enumerate(typename Op::StreamT& s) { void HMDLMaterialSet::Material::PASS::Enumerate(typename Op::StreamT& s) {
Do<Op>({"type"}, type, s); Do<Op>(athena::io::PropId{"type"}, type, s);
Do<Op>({"texId"}, texId, s); Do<Op>(athena::io::PropId{"texId"}, texId, s);
Do<Op>({"source"}, source, s); Do<Op>(athena::io::PropId{"source"}, source, s);
Do<Op>({"uvAnimType"}, uvAnimType, s); Do<Op>(athena::io::PropId{"uvAnimType"}, uvAnimType, s);
size_t uvParmCount = uvAnimParamsCount(); size_t uvParmCount = uvAnimParamsCount();
for (size_t i = 0; i < uvParmCount; ++i) for (size_t i = 0; i < uvParmCount; ++i)
Do<Op>({}, uvAnimParms[i], s); Do<Op>({}, uvAnimParms[i], s);
Do<Op>({"alpha"}, alpha, s); Do<Op>(athena::io::PropId{"alpha"}, alpha, s);
} }
AT_SPECIALIZE_DNA(HMDLMaterialSet::Material::PASS) AT_SPECIALIZE_DNA(HMDLMaterialSet::Material::PASS)

View File

@ -74,7 +74,7 @@ struct DCLN : BigDNA {
#endif #endif
}; };
Node root; Node root;
size_t getMemoryUsage() { return root.getMemoryUsage(); } size_t getMemoryUsage() const { return root.getMemoryUsage(); }
/* Dummy MP2 member */ /* Dummy MP2 member */
void insertNoClimb(hecl::blender::PyOutStream&) const {} void insertNoClimb(hecl::blender::PyOutStream&) const {}
@ -93,22 +93,22 @@ struct DCLN : BigDNA {
template <class Op> template <class Op>
void DCLN::Collision::Node::Enumerate(typename Op::StreamT& s) { void DCLN::Collision::Node::Enumerate(typename Op::StreamT& s) {
Do<Op>({"xf[0]"}, xf[0], s); Do<Op>(athena::io::PropId{"xf[0]"}, xf[0], s);
Do<Op>({"xf[1]"}, xf[1], s); Do<Op>(athena::io::PropId{"xf[1]"}, xf[1], s);
Do<Op>({"xf[2]"}, xf[2], s); Do<Op>(athena::io::PropId{"xf[2]"}, xf[2], s);
Do<Op>({"halfExtent"}, halfExtent, s); Do<Op>(athena::io::PropId{"halfExtent"}, halfExtent, s);
Do<Op>({"isLeaf"}, isLeaf, s); Do<Op>(athena::io::PropId{"isLeaf"}, isLeaf, s);
if (isLeaf) { if (isLeaf) {
if (!leafData) if (!leafData)
leafData.reset(new LeafData); leafData.reset(new LeafData);
Do<Op>({"leafData"}, *leafData, s); Do<Op>(athena::io::PropId{"leafData"}, *leafData, s);
} else { } else {
if (!left) if (!left)
left.reset(new Node); left.reset(new Node);
Do<Op>({"left"}, *left, s); Do<Op>(athena::io::PropId{"left"}, *left, s);
if (!right) if (!right)
right.reset(new Node); right.reset(new Node);
Do<Op>({"right"}, *right, s); Do<Op>(athena::io::PropId{"right"}, *right, s);
} }
} }

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "DataSpec/DNACommon/DeafBabe.hpp" #include "DataSpec/DNACommon/DeafBabe.hpp"
#include "DataSpec/DNACommon/DNACommon.hpp"
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {

View File

@ -4,20 +4,20 @@ namespace DataSpec::DNAMP1 {
template <class Op> template <class Op>
void EVNT::Enumerate(typename Op::StreamT& s) { void EVNT::Enumerate(typename Op::StreamT& s) {
Do<Op>({"version"}, version, s); Do<Op>(athena::io::PropId{"version"}, version, s);
DoSize<Op>({"boolPOICount"}, boolPOICount, s); DoSize<Op>(athena::io::PropId{"boolPOICount"}, boolPOICount, s);
Do<Op>({"boolPOINodes"}, boolPOINodes, boolPOICount, s); Do<Op>(athena::io::PropId{"boolPOINodes"}, boolPOINodes, boolPOICount, s);
DoSize<Op>({"int32POICount"}, int32POICount, s); DoSize<Op>(athena::io::PropId{"int32POICount"}, int32POICount, s);
Do<Op>({"int32POINodes"}, int32POINodes, int32POICount, s); Do<Op>(athena::io::PropId{"int32POINodes"}, int32POINodes, int32POICount, s);
DoSize<Op>({"particlePOICount"}, particlePOICount, s); DoSize<Op>(athena::io::PropId{"particlePOICount"}, particlePOICount, s);
Do<Op>({"particlePOINodes"}, particlePOINodes, particlePOICount, s); Do<Op>(athena::io::PropId{"particlePOINodes"}, particlePOINodes, particlePOICount, s);
if (version == 2) { if (version == 2) {
DoSize<Op>({"soundPOICount"}, soundPOICount, s); DoSize<Op>(athena::io::PropId{"soundPOICount"}, soundPOICount, s);
Do<Op>({"soundPOINodes"}, soundPOINodes, soundPOICount, s); Do<Op>(athena::io::PropId{"soundPOINodes"}, soundPOINodes, soundPOICount, s);
} }
} }

View File

@ -251,21 +251,21 @@ void FRME::Widget::LITEInfo::Enumerate<BigDNA::BinarySize>(size_t& __isz) {
template <class Op> template <class Op>
void FRME::Widget::TXPNInfo::Enumerate(typename Op::StreamT& s) { void FRME::Widget::TXPNInfo::Enumerate(typename Op::StreamT& s) {
Do<Op>({"xDim"}, xDim, s); Do<Op>(athena::io::PropId{"xDim"}, xDim, s);
Do<Op>({"zDim"}, zDim, s); Do<Op>(athena::io::PropId{"zDim"}, zDim, s);
Do<Op>({"scaleCenter"}, scaleCenter, s); Do<Op>(athena::io::PropId{"scaleCenter"}, scaleCenter, s);
Do<Op>({"font"}, font, s); Do<Op>(athena::io::PropId{"font"}, font, s);
Do<Op>({"wordWrap"}, wordWrap, s); Do<Op>(athena::io::PropId{"wordWrap"}, wordWrap, s);
Do<Op>({"horizontal"}, horizontal, s); Do<Op>(athena::io::PropId{"horizontal"}, horizontal, s);
Do<Op>({"justification"}, justification, s); Do<Op>(athena::io::PropId{"justification"}, justification, s);
Do<Op>({"verticalJustification"}, verticalJustification, s); Do<Op>(athena::io::PropId{"verticalJustification"}, verticalJustification, s);
Do<Op>({"fillColor"}, fillColor, s); Do<Op>(athena::io::PropId{"fillColor"}, fillColor, s);
Do<Op>({"outlineColor"}, outlineColor, s); Do<Op>(athena::io::PropId{"outlineColor"}, outlineColor, s);
Do<Op>({"blockExtent"}, blockExtent, s); Do<Op>(athena::io::PropId{"blockExtent"}, blockExtent, s);
if (version == 1) { if (version == 1) {
Do<Op>({"jpnFont"}, jpnFont, s); Do<Op>(athena::io::PropId{"jpnFont"}, jpnFont, s);
Do<Op>({"jpnPointScale[0]"}, jpnPointScale[0], s); Do<Op>(athena::io::PropId{"jpnPointScale[0]"}, jpnPointScale[0], s);
Do<Op>({"jpnPointScale[1]"}, jpnPointScale[1], s); Do<Op>(athena::io::PropId{"jpnPointScale[1]"}, jpnPointScale[1], s);
} }
} }

View File

@ -45,20 +45,20 @@ struct FRME : BigDNA {
Value<atInt16> unk2; Value<atInt16> unk2;
struct BWIGInfo : IWidgetInfo { struct BWIGInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::BWIG"; } const char* DNATypeV() const override { return "FRME::BWIG"; }
FourCC fourcc() const { return FOURCC('BWIG'); } FourCC fourcc() const override { return FOURCC('BWIG'); }
}; };
struct HWIGInfo : IWidgetInfo { struct HWIGInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::HWIG"; } const char* DNATypeV() const override { return "FRME::HWIG"; }
FourCC fourcc() const { return FOURCC('HWIG'); } FourCC fourcc() const override { return FOURCC('HWIG'); }
}; };
struct CAMRInfo : IWidgetInfo { struct CAMRInfo : IWidgetInfo {
AT_DECL_EXPLICIT_DNA AT_DECL_EXPLICIT_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::CAMR"; } const char* DNATypeV() const override { return "FRME::CAMR"; }
enum class ProjectionType { Perspective, Orthographic }; enum class ProjectionType { Perspective, Orthographic };
Value<ProjectionType> projectionType; Value<ProjectionType> projectionType;
@ -69,7 +69,6 @@ struct FRME : BigDNA {
}; };
struct PerspectiveProjection : IProjection { struct PerspectiveProjection : IProjection {
AT_DECL_DNA
AT_DECL_DNAV AT_DECL_DNAV
PerspectiveProjection() : IProjection(ProjectionType::Perspective) {} PerspectiveProjection() : IProjection(ProjectionType::Perspective) {}
Value<float> fov; Value<float> fov;
@ -79,7 +78,6 @@ struct FRME : BigDNA {
}; };
struct OrthographicProjection : IProjection { struct OrthographicProjection : IProjection {
AT_DECL_DNA
AT_DECL_DNAV AT_DECL_DNAV
OrthographicProjection() : IProjection(ProjectionType::Orthographic) {} OrthographicProjection() : IProjection(ProjectionType::Orthographic) {}
Value<float> left; Value<float> left;
@ -91,24 +89,24 @@ struct FRME : BigDNA {
}; };
std::unique_ptr<IProjection> projection; std::unique_ptr<IProjection> projection;
FourCC fourcc() const { return FOURCC('CAMR'); } FourCC fourcc() const override { return FOURCC('CAMR'); }
}; };
struct MODLInfo : IWidgetInfo { struct MODLInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::MODL"; } const char* DNATypeV() const override { return "FRME::MODL"; }
UniqueID32 model; UniqueID32 model;
enum class BlendMode { Unknown0, Unknown1, Unknown2, Additive }; enum class BlendMode { Unknown0, Unknown1, Unknown2, Additive };
Value<atUint32> blendMode; Value<atUint32> blendMode;
Value<atUint32> lightMask; Value<atUint32> lightMask;
FourCC fourcc() const { return FOURCC('MODL'); } FourCC fourcc() const override { return FOURCC('MODL'); }
}; };
struct LITEInfo : IWidgetInfo { struct LITEInfo : IWidgetInfo {
AT_DECL_EXPLICIT_DNA AT_DECL_EXPLICIT_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::LITE"; } const char* DNATypeV() const override { return "FRME::LITE"; }
enum class ELightType : atUint32 { enum class ELightType : atUint32 {
Spot = 0, Spot = 0,
Point = 1, Point = 1,
@ -127,40 +125,40 @@ struct FRME : BigDNA {
Value<atUint32> loadedIdx; Value<atUint32> loadedIdx;
Value<float> cutoff; /* Spot only */ Value<float> cutoff; /* Spot only */
FourCC fourcc() const { return FOURCC('LITE'); } FourCC fourcc() const override { return FOURCC('LITE'); }
}; };
struct ENRGInfo : IWidgetInfo { struct ENRGInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::ENRG"; } const char* DNATypeV() const override { return "FRME::ENRG"; }
UniqueID32 texture; UniqueID32 texture;
FourCC fourcc() const { return FOURCC('ENRG'); } FourCC fourcc() const override { return FOURCC('ENRG'); }
}; };
struct METRInfo : IWidgetInfo { struct METRInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::METR"; } const char* DNATypeV() const override { return "FRME::METR"; }
Value<bool> unk1; Value<bool> unk1;
Value<bool> noRoundUp; Value<bool> noRoundUp;
Value<atUint32> maxCapacity; Value<atUint32> maxCapacity;
Value<atUint32> workerCount; Value<atUint32> workerCount;
FourCC fourcc() const { return FOURCC('METR'); } FourCC fourcc() const override { return FOURCC('METR'); }
}; };
struct GRUPInfo : IWidgetInfo { struct GRUPInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::GRUP"; } const char* DNATypeV() const override { return "FRME::GRUP"; }
Value<atInt16> defaultWorker; Value<atInt16> defaultWorker;
Value<bool> unk3; Value<bool> unk3;
FourCC fourcc() const { return FOURCC('GRUP'); } FourCC fourcc() const override { return FOURCC('GRUP'); }
}; };
struct TBGPInfo : IWidgetInfo { struct TBGPInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::TBGP"; } const char* DNATypeV() const override { return "FRME::TBGP"; }
Value<atUint16> elementCount; Value<atUint16> elementCount;
Value<atUint16> unk2; Value<atUint16> unk2;
Value<atUint32> unkEnum; Value<atUint32> unkEnum;
@ -177,32 +175,32 @@ struct FRME : BigDNA {
Value<atUint16> unk10; Value<atUint16> unk10;
Value<atUint16> unk11; Value<atUint16> unk11;
FourCC fourcc() const { return FOURCC('TBGP'); } FourCC fourcc() const override { return FOURCC('TBGP'); }
}; };
struct SLGPInfo : IWidgetInfo { struct SLGPInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::SLGP"; } const char* DNATypeV() const override { return "FRME::SLGP"; }
Value<float> min; Value<float> min;
Value<float> max; Value<float> max;
Value<float> cur; Value<float> cur;
Value<float> increment; Value<float> increment;
FourCC fourcc() const { return FOURCC('SLGP'); } FourCC fourcc() const override { return FOURCC('SLGP'); }
}; };
struct PANEInfo : IWidgetInfo { struct PANEInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::PANE"; } const char* DNATypeV() const override { return "FRME::PANE"; }
Value<float> xDim; Value<float> xDim;
Value<float> zDim; Value<float> zDim;
Value<atVec3f> scaleCenter; Value<atVec3f> scaleCenter;
FourCC fourcc() const { return FOURCC('PANE'); } FourCC fourcc() const override { return FOURCC('PANE'); }
}; };
struct TXPNInfo : IWidgetInfo { struct TXPNInfo : IWidgetInfo {
const char* DNATypeV() const { return "FRME::TXPN"; } const char* DNATypeV() const override { return "FRME::TXPN"; }
enum class Justification : atUint32 { enum class Justification : atUint32 {
Left = 0, Left = 0,
Center, Center,
@ -229,7 +227,7 @@ struct FRME : BigDNA {
RightMono RightMono
}; };
AT_DECL_EXPLICIT_DNA AT_DECL_EXPLICIT_DNAV_NO_TYPE
atUint32 version = 0; atUint32 version = 0;
TXPNInfo() {} TXPNInfo() {}
@ -249,12 +247,12 @@ struct FRME : BigDNA {
UniqueID32 jpnFont; UniqueID32 jpnFont;
Value<atInt32> jpnPointScale[2] = {}; Value<atInt32> jpnPointScale[2] = {};
FourCC fourcc() const { return FOURCC('TXPN'); } FourCC fourcc() const override { return FOURCC('TXPN'); }
}; };
struct IMGPInfo : IWidgetInfo { struct IMGPInfo : IWidgetInfo {
AT_DECL_DNA AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const { return "FRME::IMGP"; } const char* DNATypeV() const override { return "FRME::IMGP"; }
UniqueID32 texture; UniqueID32 texture;
Value<atUint32> unk1; Value<atUint32> unk1;
Value<atUint32> unk2; Value<atUint32> unk2;
@ -263,7 +261,7 @@ struct FRME : BigDNA {
Value<atUint32> uvCoordCount; Value<atUint32> uvCoordCount;
Vector<atVec2f, AT_DNA_COUNT(uvCoordCount)> uvCoords; Vector<atVec2f, AT_DNA_COUNT(uvCoordCount)> uvCoords;
FourCC fourcc() const { return FOURCC('IMGP'); } FourCC fourcc() const override { return FOURCC('IMGP'); }
}; };
}; };

View File

@ -98,7 +98,7 @@ struct SCAN : BigDNA {
} }
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const {
g_curSpec->flattenDependencies(frame, pathsOut); g_curSpec->flattenDependencies(frame, pathsOut);
g_curSpec->flattenDependencies(string, pathsOut); g_curSpec->flattenDependencies(string, pathsOut);
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)

View File

@ -42,8 +42,8 @@ void SCLY::exportToLayerDirectories(const PAK::Entry& entry, PAKRouter<PAKBridge
layerPath.makeDirChain(true); layerPath.makeDirChain(true);
if (active) { if (active) {
hecl::ProjectPath activePath(layerPath, "!defaultactive"); const hecl::ProjectPath activePath(layerPath, "!defaultactive");
fclose(hecl::Fopen(activePath.getAbsolutePath().data(), _SYS_STR("wb"))); [[maybe_unused]] const auto fp = hecl::FopenUnique(activePath.getAbsolutePath().data(), _SYS_STR("wb"));
} }
hecl::ProjectPath yamlFile(layerPath, _SYS_STR("!objects.yaml")); hecl::ProjectPath yamlFile(layerPath, _SYS_STR("!objects.yaml"));
@ -77,7 +77,7 @@ void SCLY::ScriptLayer::nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
template <> template <>
void SCLY::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& docin) { void SCLY::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& docin) {
Do<BigDNA::ReadYaml>({"fourCC"}, fourCC, docin); Do<BigDNA::ReadYaml>(athena::io::PropId{"fourCC"}, fourCC, docin);
version = docin.readUint32("version"); version = docin.readUint32("version");
layerCount = docin.enumerate("layerSizes", layerSizes); layerCount = docin.enumerate("layerSizes", layerSizes);
docin.enumerate("layers", layers); docin.enumerate("layers", layers);
@ -85,7 +85,7 @@ void SCLY::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& docin) {
template <> template <>
void SCLY::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& docout) { void SCLY::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& docout) {
Do<BigDNA::WriteYaml>({"fourCC"}, fourCC, docout); Do<BigDNA::WriteYaml>(athena::io::PropId{"fourCC"}, fourCC, docout);
docout.writeUint32("version", version); docout.writeUint32("version", version);
docout.enumerate("layerSizes", layerSizes); docout.enumerate("layerSizes", layerSizes);
docout.enumerate("layers", layers); docout.enumerate("layers", layers);

View File

@ -8,15 +8,14 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct STRG : ISTRG { struct STRG : ISTRG {
AT_DECL_EXPLICIT_DNA_YAML AT_DECL_EXPLICIT_DNA_YAMLV
AT_DECL_DNAV
void _read(athena::io::IStreamReader& reader); void _read(athena::io::IStreamReader& reader);
std::vector<std::pair<FourCC, std::vector<std::u16string>>> langs; std::vector<std::pair<FourCC, std::vector<std::u16string>>> langs;
std::unordered_map<FourCC, std::vector<std::u16string>*> langMap; std::unordered_map<FourCC, std::vector<std::u16string>*> langMap;
int32_t lookupIdx(std::string_view name) const { return -1; } int32_t lookupIdx(std::string_view name) const override { return -1; }
size_t count() const { size_t count() const override {
size_t retval = 0; size_t retval = 0;
for (const auto& item : langs) { for (const auto& item : langs) {
size_t sz = item.second.size(); size_t sz = item.second.size();
@ -25,19 +24,19 @@ struct STRG : ISTRG {
} }
return retval; return retval;
} }
std::string getUTF8(const FourCC& lang, size_t idx) const { std::string getUTF8(const FourCC& lang, size_t idx) const override {
auto search = langMap.find(lang); auto search = langMap.find(lang);
if (search != langMap.end()) if (search != langMap.end())
return hecl::Char16ToUTF8(search->second->at(idx)); return hecl::Char16ToUTF8(search->second->at(idx));
return std::string(); return std::string();
} }
std::u16string getUTF16(const FourCC& lang, size_t idx) const { std::u16string getUTF16(const FourCC& lang, size_t idx) const override {
auto search = langMap.find(lang); auto search = langMap.find(lang);
if (search != langMap.end()) if (search != langMap.end())
return search->second->at(idx); return search->second->at(idx);
return std::u16string(); return std::u16string();
} }
hecl::SystemString getSystemString(const FourCC& lang, size_t idx) const { hecl::SystemString getSystemString(const FourCC& lang, size_t idx) const override {
auto search = langMap.find(lang); auto search = langMap.find(lang);
if (search != langMap.end()) if (search != langMap.end())
#if HECL_UCS2 #if HECL_UCS2
@ -71,7 +70,7 @@ struct STRG : ISTRG {
return true; return true;
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const; void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const override;
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct AIJumpPoint : IScriptObject { struct AIJumpPoint : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct AIKeyframe : IScriptObject { struct AIKeyframe : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atUint32> animationId; Value<atUint32> animationId;
Value<bool> looping; Value<bool> looping;

View File

@ -5,8 +5,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct Actor : IScriptObject { struct Actor : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name SO_NAME_SPECPROP(); String<-1> name SO_NAME_SPECPROP();
Value<atVec3f> location SO_LOCATION_SPECPROP(); Value<atVec3f> location SO_LOCATION_SPECPROP();
Value<atVec3f> orientation SO_ORIENTATION_SPECPROP(); Value<atVec3f> orientation SO_ORIENTATION_SPECPROP();
@ -32,11 +31,11 @@ struct Actor : IScriptObject {
Value<bool> scaleAdvancementDelta; Value<bool> scaleAdvancementDelta;
Value<bool> materialFlag54; Value<bool> materialFlag54;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (model.isValid()) { if (model.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model);
ent->name = name + "_model"; ent->name = name + "_model";
@ -45,14 +44,15 @@ struct Actor : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(model, pathsOut); g_curSpec->flattenDependencies(model, pathsOut);
animationParameters.depANCS(pathsOut); animationParameters.depANCS(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
zeus::CAABox getVISIAABB(hecl::blender::Token& btok) const; zeus::CAABox getVISIAABB(hecl::blender::Token& btok) const override;
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct ActorContraption : IScriptObject { struct ActorContraption : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -24,11 +23,11 @@ struct ActorContraption : IScriptObject {
DamageInfo damageInfo; DamageInfo damageInfo;
Value<bool> active; // needs verification Value<bool> active; // needs verification
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (particle.isValid()) { if (particle.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle);
ent->name = name + "_part"; ent->name = name + "_part";
@ -37,12 +36,13 @@ struct ActorContraption : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(particle, pathsOut); g_curSpec->flattenDependencies(particle, pathsOut);
animationParameters.depANCS(pathsOut); animationParameters.depANCS(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct ActorKeyframe : IScriptObject { struct ActorKeyframe : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atUint32> animationId; Value<atUint32> animationId;
Value<bool> looping; Value<bool> looping;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct ActorRotate : IScriptObject { struct ActorRotate : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> rotationOffset; Value<atVec3f> rotationOffset;
Value<float> timeScale; Value<float> timeScale;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct AmbientAI : IScriptObject { struct AmbientAI : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -25,20 +24,21 @@ struct AmbientAI : IScriptObject {
Value<atInt32> impactAnim; Value<atInt32> impactAnim;
Value<bool> active; Value<bool> active;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
animationParameters.nameANCS(pakRouter, name + "_animp"); animationParameters.nameANCS(pakRouter, name + "_animp");
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
animationParameters.depANCS(pathsOut); animationParameters.depANCS(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct AreaAttributes : IScriptObject { struct AreaAttributes : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
enum class EWeatherType : atUint32 { None, Snow, Rain }; enum class EWeatherType : atUint32 { None, Snow, Rain };
Value<atUint32> load; /* 0 causes the loader to bail and return null */ Value<atUint32> load; /* 0 causes the loader to bail and return null */
@ -20,7 +19,8 @@ struct AreaAttributes : IScriptObject {
UniqueID32 skybox; UniqueID32 skybox;
Value<atUint32> phazonType; Value<atUint32> phazonType;
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(skybox, pathsOut); g_curSpec->flattenDependencies(skybox, pathsOut);
} }
}; };

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct AtomicAlpha : IScriptObject { struct AtomicAlpha : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -23,11 +22,11 @@ struct AtomicAlpha : IScriptObject {
Value<bool> invisible; Value<bool> invisible;
Value<bool> applyBeamAttraction; Value<bool> applyBeamAttraction;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (wpsc.isValid()) { if (wpsc.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc);
ent->name = name + "_wpsc"; ent->name = name + "_wpsc";
@ -40,13 +39,14 @@ struct AtomicAlpha : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(wpsc, pathsOut); g_curSpec->flattenDependencies(wpsc, pathsOut);
g_curSpec->flattenDependencies(model, pathsOut); g_curSpec->flattenDependencies(model, pathsOut);
patternedInfo.depIDs(pathsOut); patternedInfo.depIDs(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct AtomicBeta : IScriptObject { struct AtomicBeta : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -30,11 +29,11 @@ struct AtomicBeta : IScriptObject {
Value<atUint32> unknown9; Value<atUint32> unknown9;
Value<float> unknown10; Value<float> unknown10;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (elsc.isValid()) { if (elsc.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc);
ent->name = name + "_elsc"; ent->name = name + "_elsc";
@ -51,7 +50,8 @@ struct AtomicBeta : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(elsc, pathsOut); g_curSpec->flattenDependencies(elsc, pathsOut);
g_curSpec->flattenDependencies(wpsc, pathsOut); g_curSpec->flattenDependencies(wpsc, pathsOut);
g_curSpec->flattenDependencies(part, pathsOut); g_curSpec->flattenDependencies(part, pathsOut);
@ -59,6 +59,6 @@ struct AtomicBeta : IScriptObject {
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct Babygoth : IScriptObject { struct Babygoth : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -42,7 +41,7 @@ struct Babygoth : IScriptObject {
Value<atUint32> flamePlayerHitSfx; Value<atUint32> flamePlayerHitSfx;
UniqueID32 flamePlayerIceTxtr; UniqueID32 flamePlayerIceTxtr;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
UniqueID32 cinf = patternedInfo.animationParameters.getCINF(pakRouter); UniqueID32 cinf = patternedInfo.animationParameters.getCINF(pakRouter);
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters);
@ -54,7 +53,7 @@ struct Babygoth : IScriptObject {
} }
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (fireballWeapon.isValid()) { if (fireballWeapon.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(fireballWeapon); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(fireballWeapon);
ent->name = name + "_wpsc1"; ent->name = name + "_wpsc1";
@ -103,7 +102,8 @@ struct Babygoth : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(fireballWeapon, pathsOut); g_curSpec->flattenDependencies(fireballWeapon, pathsOut);
g_curSpec->flattenDependencies(fireBreathWeapon, pathsOut); g_curSpec->flattenDependencies(fireBreathWeapon, pathsOut);
g_curSpec->flattenDependencies(fireBreathRes, pathsOut); g_curSpec->flattenDependencies(fireBreathRes, pathsOut);
@ -119,6 +119,6 @@ struct Babygoth : IScriptObject {
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct BallTrigger : IScriptObject { struct BallTrigger : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> volume; Value<atVec3f> volume;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct Beetle : IScriptObject { struct Beetle : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atUint32> flavor; Value<atUint32> flavor;
Value<atVec3f> location; Value<atVec3f> location;
@ -25,11 +24,11 @@ struct Beetle : IScriptObject {
Value<float> initialAttackDelay; Value<float> initialAttackDelay;
Value<float> retreatTime; Value<float> retreatTime;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (tailModel.isValid()) { if (tailModel.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(tailModel); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(tailModel);
ent->name = name + "_tailModel"; ent->name = name + "_tailModel";
@ -38,12 +37,13 @@ struct Beetle : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(tailModel, pathsOut); g_curSpec->flattenDependencies(tailModel, pathsOut);
patternedInfo.depIDs(pathsOut); patternedInfo.depIDs(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct BloodFlower : IScriptObject { struct BloodFlower : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -27,11 +26,11 @@ struct BloodFlower : IScriptObject {
UniqueID32 particle5; UniqueID32 particle5;
Value<atUint32> unknown2; Value<atUint32> unknown2;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (wpsc1.isValid()) { if (wpsc1.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1);
ent->name = name + "_wpsc1"; ent->name = name + "_wpsc1";
@ -64,7 +63,8 @@ struct BloodFlower : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(wpsc1, pathsOut); g_curSpec->flattenDependencies(wpsc1, pathsOut);
g_curSpec->flattenDependencies(wpsc2, pathsOut); g_curSpec->flattenDependencies(wpsc2, pathsOut);
g_curSpec->flattenDependencies(particle1, pathsOut); g_curSpec->flattenDependencies(particle1, pathsOut);
@ -76,6 +76,6 @@ struct BloodFlower : IScriptObject {
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct Burrower : IScriptObject { struct Burrower : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -22,11 +21,11 @@ struct Burrower : IScriptObject {
Value<atUint32> unknown; // always FF Value<atUint32> unknown; // always FF
UniqueID32 particle4; UniqueID32 particle4;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (wpsc.isValid()) { if (wpsc.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc);
ent->name = name + "_wpsc"; ent->name = name + "_wpsc";
@ -51,7 +50,8 @@ struct Burrower : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(wpsc, pathsOut); g_curSpec->flattenDependencies(wpsc, pathsOut);
g_curSpec->flattenDependencies(particle1, pathsOut); g_curSpec->flattenDependencies(particle1, pathsOut);
g_curSpec->flattenDependencies(particle2, pathsOut); g_curSpec->flattenDependencies(particle2, pathsOut);
@ -61,6 +61,6 @@ struct Burrower : IScriptObject {
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct Camera : IScriptObject { struct Camera : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct CameraBlurKeyframe : IScriptObject { struct CameraBlurKeyframe : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<bool> active; Value<bool> active;
Value<atUint32> btype; Value<atUint32> btype;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct CameraFilterKeyframe : IScriptObject { struct CameraFilterKeyframe : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<bool> active; Value<bool> active;
Value<atUint32> ftype; Value<atUint32> ftype;
@ -19,14 +18,15 @@ struct CameraFilterKeyframe : IScriptObject {
Value<float> timeOut; Value<float> timeOut;
UniqueID32 texture; UniqueID32 texture;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (texture.isValid()) { if (texture.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture);
ent->name = name + "_texture"; ent->name = name + "_texture";
} }
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(texture, pathsOut); g_curSpec->flattenDependencies(texture, pathsOut);
} }
}; };

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct CameraHint : IScriptObject { struct CameraHint : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct CameraHintTrigger : IScriptObject { struct CameraHintTrigger : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct CameraPitchVolume : IScriptObject { struct CameraPitchVolume : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct CameraShaker : IScriptObject { struct CameraShaker : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<float> xMag; Value<float> xMag;
Value<float> xB; Value<float> xB;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct CameraWaypoint : IScriptObject { struct CameraWaypoint : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct ChozoGhost : IScriptObject { struct ChozoGhost : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -40,11 +39,11 @@ struct ChozoGhost : IScriptObject {
Value<atUint32> unknown12; Value<atUint32> unknown12;
Value<atUint32> unknown13; Value<atUint32> unknown13;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const override {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters); actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters);
} }
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (wpsc1.isValid()) { if (wpsc1.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1);
ent->name = name + "_wpsc1"; ent->name = name + "_wpsc1";
@ -61,7 +60,8 @@ struct ChozoGhost : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(wpsc1, pathsOut); g_curSpec->flattenDependencies(wpsc1, pathsOut);
g_curSpec->flattenDependencies(wpsc2, pathsOut); g_curSpec->flattenDependencies(wpsc2, pathsOut);
g_curSpec->flattenDependencies(particle, pathsOut); g_curSpec->flattenDependencies(particle, pathsOut);
@ -69,6 +69,6 @@ struct ChozoGhost : IScriptObject {
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct ColorModulate : IScriptObject { struct ColorModulate : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec4f> colorA; Value<atVec4f> colorA;
Value<atVec4f> colorB; Value<atVec4f> colorB;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct ControllerAction : IScriptObject { struct ControllerAction : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<bool> active; Value<bool> active;
Value<atUint32> command; Value<atUint32> command;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct Counter : IScriptObject { struct Counter : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atUint32> initial; Value<atUint32> initial;
Value<atUint32> maxValue; Value<atUint32> maxValue;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct CoverPoint : IScriptObject { struct CoverPoint : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct DamageableTrigger : IScriptObject { struct DamageableTrigger : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> volume; Value<atVec3f> volume;
@ -21,7 +20,7 @@ struct DamageableTrigger : IScriptObject {
Value<bool> active; Value<bool> active;
VisorParameters visorParameters; VisorParameters visorParameters;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (patternTex1.isValid()) { if (patternTex1.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(patternTex1); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(patternTex1);
ent->name = name + "_patternTex1"; ent->name = name + "_patternTex1";
@ -36,13 +35,14 @@ struct DamageableTrigger : IScriptObject {
} }
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(patternTex1, pathsOut); g_curSpec->flattenDependencies(patternTex1, pathsOut);
g_curSpec->flattenDependencies(patternTex2, pathsOut); g_curSpec->flattenDependencies(patternTex2, pathsOut);
g_curSpec->flattenDependencies(colorTex, pathsOut); g_curSpec->flattenDependencies(colorTex, pathsOut);
} }
zeus::CAABox getVISIAABB(hecl::blender::Token& btok) const { zeus::CAABox getVISIAABB(hecl::blender::Token& btok) const override {
zeus::CVector3f halfExtent = zeus::CVector3f(volume) / 2.f; zeus::CVector3f halfExtent = zeus::CVector3f(volume) / 2.f;
zeus::CVector3f loc(location); zeus::CVector3f loc(location);
return zeus::CAABox(loc - halfExtent, loc + halfExtent); return zeus::CAABox(loc - halfExtent, loc + halfExtent);

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct Debris : IScriptObject { struct Debris : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -27,7 +26,7 @@ struct Debris : IScriptObject {
Value<bool> b1; Value<bool> b1;
Value<bool> active; Value<bool> active;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (model.isValid()) { if (model.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model);
ent->name = name + "_model"; ent->name = name + "_model";
@ -39,12 +38,13 @@ struct Debris : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(model, pathsOut); g_curSpec->flattenDependencies(model, pathsOut);
g_curSpec->flattenDependencies(particle, pathsOut); g_curSpec->flattenDependencies(particle, pathsOut);
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct DebrisExtended : IScriptObject { struct DebrisExtended : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;
@ -48,7 +47,7 @@ struct DebrisExtended : IScriptObject {
Value<bool> noBounce; Value<bool> noBounce;
Value<bool> active; Value<bool> active;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const { void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (model.isValid()) { if (model.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model); PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model);
ent->name = name + "_model"; ent->name = name + "_model";
@ -68,7 +67,8 @@ struct DebrisExtended : IScriptObject {
actorParameters.nameIDs(pakRouter, name + "_actp"); actorParameters.nameIDs(pakRouter, name + "_actp");
} }
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const { void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut,
std::vector<hecl::ProjectPath>& lazyOut) const override {
g_curSpec->flattenDependencies(model, pathsOut); g_curSpec->flattenDependencies(model, pathsOut);
g_curSpec->flattenDependencies(particle1, pathsOut); g_curSpec->flattenDependencies(particle1, pathsOut);
g_curSpec->flattenDependencies(particle2, pathsOut); g_curSpec->flattenDependencies(particle2, pathsOut);
@ -76,6 +76,6 @@ struct DebrisExtended : IScriptObject {
actorParameters.depIDs(pathsOut, lazyOut); actorParameters.depIDs(pathsOut, lazyOut);
} }
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); } void gatherScans(std::vector<Scan>& scansOut) const override { actorParameters.scanIDs(scansOut); }
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct DebugCameraWaypoint : IScriptObject { struct DebugCameraWaypoint : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atVec3f> location; Value<atVec3f> location;
Value<atVec3f> orientation; Value<atVec3f> orientation;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct DistanceFog : IScriptObject { struct DistanceFog : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atUint32> fogMode; Value<atUint32> fogMode;
Value<atVec4f> fogColor; // CColor Value<atVec4f> fogColor; // CColor

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct Dock : IScriptObject { struct Dock : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<bool> active; Value<bool> active;
Value<atVec3f> location; Value<atVec3f> location;

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
struct DockAreaChange : IScriptObject { struct DockAreaChange : IScriptObject {
AT_DECL_DNA_YAML AT_DECL_DNA_YAMLV
AT_DECL_DNAV
String<-1> name; String<-1> name;
Value<atUint32> dockReference; Value<atUint32> dockReference;
Value<bool> active; Value<bool> active;

Some files were not shown because too many files have changed in this diff Show More