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/ANCS.hpp"
#include "DataSpec/DNAMP2/DNAMP2.hpp"
#include "DataSpec/DNAMP2/ANCS.hpp"
#include "DataSpec/DNAMP3/DNAMP3.hpp"
#include "DataSpec/DNAMP3/CHAR.hpp"
#include "hecl/Blender/Connection.hpp"
#include <hecl/Blender/Connection.hpp>
namespace DataSpec::DNAANCS {

View File

@ -1,9 +1,21 @@
#pragma once
#include <unordered_set>
#include "DNACommon.hpp"
#include "CMDL.hpp"
#include "RigInverter.hpp"
#include <functional>
#include <string>
#include <utility>
#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 {

View File

@ -1,8 +1,20 @@
#include "zeus/Math.hpp"
#include "ANIM.hpp"
#include "DataSpec/DNACommon/ANIM.hpp"
#include <cfloat>
#include <cmath>
#include <cstring>
#include <hecl/hecl.hpp>
#include <zeus/Global.hpp>
#include <zeus/Math.hpp>
#define DUMP_KEYS 0
#if DUMP_KEYS
#include <cstdio>
#include <fmt/format.h>
#endif
namespace DataSpec::DNAANIM {
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) {
#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;
#endif
auto kit = chanKeys.begin();
@ -172,7 +184,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
#if DUMP_KEYS
if (chan.id != lastId) {
lastId = chan.id;
fprintf(stderr, "\n");
std::fputc('\n', stderr);
}
#endif
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};
kit->emplace_back(DequantizeRotation(qr, rotDiv));
#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
break;
}
@ -198,7 +210,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
p[2] += val3;
kit->push_back({p[0] * transMult, p[1] * transMult, p[2] * transMult});
#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
break;
}
@ -208,7 +220,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
p[2] += dequantize(data, chan.q[2]);
kit->push_back({p[0] * scaleMult, p[1] * scaleMult, p[2] * scaleMult});
#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
break;
}
@ -236,7 +248,7 @@ std::vector<std::vector<Value>> BitstreamReader::read(const atUint8* data, size_
++ait;
}
#if DUMP_KEYS
fprintf(stderr, "\n");
std::fputc('\n', stderr);
#endif
}

View File

@ -1,7 +1,12 @@
#pragma once
#include "DNACommon.hpp"
#include <cassert>
#include <cmath>
#include <cstddef>
#include <memory>
#include <vector>
#include <athena/Types.hpp>
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 {

View File

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

View File

@ -1,8 +1,15 @@
#include "BabeDead.hpp"
#include "DataSpec/DNACommon/BabeDead.hpp"
#include "DataSpec/DNAMP1/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 {

View File

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

View File

@ -1,13 +1,18 @@
#include "CMDL.hpp"
#include "../DNAMP1/CMDLMaterials.hpp"
#include "../DNAMP1/CSKR.hpp"
#include "../DNAMP1/MREA.hpp"
#include "../DNAMP2/CMDLMaterials.hpp"
#include "../DNAMP2/CSKR.hpp"
#include "../DNAMP3/CMDLMaterials.hpp"
#include "../DNAMP3/CSKR.hpp"
#include "zeus/CAABox.hpp"
#include "hecl/Blender/Connection.hpp"
#include "DataSpec/DNACommon/CMDL.hpp"
#include <utility>
#include "DataSpec/DNAMP1/CMDLMaterials.hpp"
#include "DataSpec/DNAMP1/CSKR.hpp"
#include "DataSpec/DNAMP1/MREA.hpp"
#include "DataSpec/DNAMP2/CMDLMaterials.hpp"
#include "DataSpec/DNAMP2/CSKR.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 {
@ -208,7 +213,7 @@ public:
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); }
@ -1634,14 +1639,14 @@ bool WriteMREASecs(std::vector<std::vector<uint8_t>>& secsOut, const hecl::Proje
/* Iterate meshes */
auto matIt = surfToGlobalMats.cbegin();
for (const Mesh& mesh : meshes) {
zeus::CTransform meshXf(mesh.sceneXf.val);
zeus::CTransform meshXf(mesh.sceneXf.val.data());
meshXf.basis.transpose();
/* Header */
{
MeshHeader meshHeader = {};
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));
aabb = aabb.getTransformedAABox(meshXf);
@ -1912,14 +1917,14 @@ bool WriteHMDLMREASecs(std::vector<std::vector<uint8_t>>& secsOut, const hecl::P
/* Iterate meshes */
auto matIt = surfToGlobalMats.cbegin();
for (const Mesh& mesh : meshes) {
zeus::CTransform meshXf(mesh.sceneXf.val);
zeus::CTransform meshXf(mesh.sceneXf.val.data());
meshXf.basis.transpose();
/* Header */
{
MeshHeader meshHeader = {};
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));
aabb = aabb.getTransformedAABox(meshXf);

View File

@ -1,10 +1,23 @@
#pragma once
#include "athena/FileWriter.hpp"
#include "PAK.hpp"
#include "GX.hpp"
#include "TXTR.hpp"
#include "zeus/CAABox.hpp"
#include <cstddef>
#include <cstdint>
#include <vector>
#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 {

View File

@ -4,6 +4,7 @@ make_dnalist(CMDL
FSM2
MAPA
MAPU
MayaSpline
EGMC
SAVWCommon
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 {
static const std::vector<FourCC> GeneratorTypes = {

View File

@ -1,9 +1,21 @@
#pragma once
#include "ParticleCommon.hpp"
#include "PAK.hpp"
#include "athena/FileWriter.hpp"
#include <optional>
#include <cstdint>
#include <unordered_map>
#include <vector>
#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 {
template <class IDType>

View File

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

View File

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

View File

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

View File

@ -1,8 +1,21 @@
#pragma once
#include "ParticleCommon.hpp"
#include "PAK.hpp"
#include "athena/FileWriter.hpp"
#include <cstddef>
#include <cstdint>
#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 {

View File

@ -1,10 +1,18 @@
#include "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 "DataSpec/DNACommon/DeafBabe.hpp"
#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 {

View File

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

View File

@ -1,6 +1,6 @@
#pragma once
#include "DNACommon.hpp"
#include "DataSpec/DNACommon/DNACommon.hpp"
namespace DataSpec::DNACommon {
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 {

View File

@ -1,8 +1,15 @@
#pragma once
#include "ParticleCommon.hpp"
#include "PAK.hpp"
#include "athena/FileWriter.hpp"
#include <vector>
#include "DataSpec/DNACommon/ParticleCommon.hpp"
#include "DataSpec/DNACommon/PAK.hpp"
#include <athena/FileWriter.hpp>
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAParticle {
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 {
logvisor::Module LogModule("urde::DNAFont");

View File

@ -1,7 +1,19 @@
#pragma once
#include "PAK.hpp"
#include "athena/FileWriter.hpp"
#include <memory>
#include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <athena/FileWriter.hpp>
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
namespace DataSpec::DNAFont {
struct GlyphRect : BigDNA {
@ -12,7 +24,7 @@ struct GlyphRect : BigDNA {
Value<float> bottom;
};
struct IGlyph : BigDNAVYaml {
AT_DECL_DNA_YAML
AT_DECL_DNA_YAMLV
Value<atUint16> m_character;
GlyphRect m_glyphRect;
@ -34,8 +46,7 @@ struct IGlyph : BigDNAVYaml {
};
struct GlyphMP1 : IGlyph {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
Value<atInt32> m_leftPadding;
Value<atInt32> m_advance;
Value<atInt32> m_rightPadding;
@ -44,18 +55,17 @@ struct GlyphMP1 : IGlyph {
Value<atInt32> m_baseline;
Value<atInt32> m_kerningIndex;
atInt32 leftPadding() const { return m_leftPadding; }
atInt32 advance() const { return m_advance; }
atInt32 rightPadding() const { return m_rightPadding; }
atInt32 width() const { return m_width; }
atInt32 height() const { return m_height; }
atInt32 baseline() const { return m_baseline; }
atInt32 kerningIndex() const { return m_kerningIndex; }
atInt32 leftPadding() const override { return m_leftPadding; }
atInt32 advance() const override { return m_advance; }
atInt32 rightPadding() const override { return m_rightPadding; }
atInt32 width() const override { return m_width; }
atInt32 height() const override { return m_height; }
atInt32 baseline() const override { return m_baseline; }
atInt32 kerningIndex() const override { return m_kerningIndex; }
};
struct GlyphMP2 : IGlyph {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
Value<atInt8> m_layer;
Value<atInt8> m_leftPadding;
Value<atInt8> m_advance;
@ -65,14 +75,14 @@ struct GlyphMP2 : IGlyph {
Value<atInt8> m_baseline;
Value<atInt16> m_kerningIndex;
atInt32 layer() const { return m_layer; }
atInt32 leftPadding() const { return m_leftPadding; }
atInt32 advance() const { return m_advance; }
atInt32 rightPadding() const { return m_rightPadding; }
atInt32 width() const { return m_width; }
atInt32 height() const { return m_height; }
atInt32 baseline() const { return m_baseline; }
atInt32 kerningIndex() const { return m_kerningIndex; }
atInt32 layer() const override { return m_layer; }
atInt32 leftPadding() const override { return m_leftPadding; }
atInt32 advance() const override { return m_advance; }
atInt32 rightPadding() const override { return m_rightPadding; }
atInt32 width() const override { return m_width; }
atInt32 height() const override { return m_height; }
atInt32 baseline() const override { return m_baseline; }
atInt32 kerningIndex() const override { return m_kerningIndex; }
};
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/IStreamReader.hpp>
#include <athena/IStreamWriter.hpp>
#include "FSM2.hpp"
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAFSM2 {
logvisor::Module LogDNAFSM2("urde::DNAFSM2");
@ -10,7 +14,7 @@ logvisor::Module LogDNAFSM2("urde::DNAFSM2");
template <class IDType>
template <class Op>
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')) {
LogDNAFSM2.report(logvisor::Fatal, fmt("Invalid FSM2 magic '{}' expected 'FSM2'"), header.magic);
return;
@ -19,11 +23,11 @@ void FSM2<IDType>::Enumerate(typename Op::StreamT& s) {
if (header.version == 1) {
if (!detail)
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) {
if (!detail)
detail.reset(new FSMV2);
Do<Op>({"detail"}, static_cast<FSMV2&>(*detail), s);
Do<Op>(athena::io::PropId{"detail"}, static_cast<FSMV2&>(*detail), s);
} else {
LogDNAFSM2.report(logvisor::Fatal, fmt("Invalid FSM2 version '{}'"), header.version);
return;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,17 @@
#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 {
struct MAPU : BigDNA {

View File

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

View File

@ -1,7 +1,18 @@
#pragma once
#include "DNACommon.hpp"
#include "zeus/CVector3f.hpp"
#include <functional>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <hecl/SystemChar.hpp>
namespace hecl {
class ProjectPath;
}
namespace hecl::blender {
class Connection;
}
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 "OBBTreeBuilder.hpp"
#include "zeus/CTransform.hpp"
#include "DataSpec/DNACommon/OBBTreeBuilder.hpp"
#include <cstddef>
#include <unordered_set>
#include <vector>
#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 {

View File

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

View File

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

View File

@ -1,9 +1,17 @@
#pragma once
#include "DNACommon.hpp"
#include "boo/ThreadLocalPtr.hpp"
#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 {
@ -25,7 +33,7 @@ public:
if (m_pos >= m_sz)
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)
m_pos = pos;
else if (origin == athena::Current)
@ -35,10 +43,10 @@ public:
if (m_pos > m_sz)
LogDNACommon.report(logvisor::Fatal, fmt("PAK stream cursor overrun"));
}
atUint64 position() const { return m_pos; }
atUint64 length() const { return m_sz; }
atUint64 position() const override { return m_pos; }
atUint64 length() const override { return m_sz; }
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;
if (bufEnd > m_sz)
len -= bufEnd - m_sz;
@ -172,7 +180,7 @@ public:
using PAKRouterBase::getWorking;
hecl::ProjectPath getWorking(const EntryType* entry, const ResExtractor<BRIDGETYPE>& extractor) 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 IDType& id, bool silenceWarnings = false) const;
@ -198,6 +206,12 @@ public:
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>::MultimapIteratorPair
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 {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,15 +1,22 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <fstream>
#include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include <hecl/hecl.hpp>
#include <hecl/Database.hpp>
#include <athena/FileWriter.hpp>
#include "DNACommon.hpp"
namespace athena::io {
class IStreamReader;
}
namespace DataSpec {
struct ISTRG : BigDNAVYaml {
virtual ~ISTRG() = default;
~ISTRG() override = default;
virtual size_t count() 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 {

View File

@ -1,8 +1,17 @@
#pragma once
#include "ParticleCommon.hpp"
#include "PAK.hpp"
#include "athena/FileWriter.hpp"
#include <vector>
#include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/ParticleCommon.hpp"
namespace DataSpec {
class PAKEntryReadStream;
}
namespace hecl {
class ProjectPath;
}
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 <squish.h>
#include "TXTR.hpp"
#include "PAK.hpp"
#include "athena/FileWriter.hpp"
#include "hecl/hecl.hpp"
namespace DataSpec {
@ -806,13 +812,13 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
uint16_t height = rs.readUint16Big();
uint32_t numMips = rs.readUint32Big();
FILE* fp = hecl::Fopen(outPath.getAbsolutePath().data(), _SYS_STR("wb"));
if (!fp) {
auto fp = hecl::FopenUnique(outPath.getAbsolutePath().data(), _SYS_STR("wb"));
if (fp == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for writing")), outPath.getAbsolutePath());
return false;
}
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_text textStruct = {};
@ -856,7 +862,6 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
png_write_end(png, info);
png_write_flush(png);
png_destroy_write_struct(&png, &info);
fclose(fp);
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) {
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (!inf) {
auto inf = hecl::FopenUnique(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (inf == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath());
return false;
}
/* Validate PNG */
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)) {
Log.report(logvisor::Error, fmt(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath());
fclose(inf);
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);
if (!pngRead) {
Log.report(logvisor::Error, fmt("unable to initialize libpng"));
fclose(inf);
return false;
}
png_infop info = png_create_info_struct(pngRead);
if (!info) {
Log.report(logvisor::Error, fmt("unable to initialize libpng info"));
fclose(inf);
png_destroy_read_struct(&pngRead, nullptr, nullptr);
return false;
}
if (setjmp(png_jmpbuf(pngRead))) {
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);
return false;
}
png_init_io(pngRead, inf);
png_init_io(pngRead, inf.get());
png_set_sig_bytes(pngRead, 8);
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) {
Log.report(logvisor::Error, fmt("image must be 4x4 or larger"));
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1086,7 +1086,6 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (bitDepth != 8) {
Log.report(logvisor::Error, fmt(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1118,7 +1117,6 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
break;
default:
Log.report(logvisor::Error, fmt(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1139,7 +1137,6 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1172,7 +1169,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
}
png_destroy_read_struct(&pngRead, &info, nullptr);
fclose(inf);
inf.reset();
/* Reduce mipmaps to minimum allowed dimensions */
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) {
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (!inf) {
auto inf = hecl::FopenUnique(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (inf == nullptr) {
Log.report(logvisor::Error, fmt(_SYS_STR("Unable to open '{}' for reading")), inPath.getAbsolutePath());
return false;
}
/* Validate PNG */
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)) {
Log.report(logvisor::Error, fmt(_SYS_STR("invalid PNG signature in '{}'")), inPath.getAbsolutePath());
fclose(inf);
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);
if (!pngRead) {
Log.report(logvisor::Error, fmt("unable to initialize libpng"));
fclose(inf);
return false;
}
png_infop info = png_create_info_struct(pngRead);
if (!info) {
Log.report(logvisor::Error, fmt("unable to initialize libpng info"));
fclose(inf);
png_destroy_read_struct(&pngRead, nullptr, nullptr);
return false;
}
if (setjmp(png_jmpbuf(pngRead))) {
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);
return false;
}
png_init_io(pngRead, inf);
png_init_io(pngRead, inf.get());
png_set_sig_bytes(pngRead, 8);
png_read_info(pngRead, info);
@ -1400,7 +1393,6 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (bitDepth != 8) {
Log.report(logvisor::Error, fmt(_SYS_STR("'{}' is not 8 bits-per-channel")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1430,7 +1422,6 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
break;
default:
Log.report(logvisor::Error, fmt(_SYS_STR("unsupported color type in '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1449,7 +1440,6 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (setjmp(png_jmpbuf(pngRead))) {
Log.report(logvisor::Fatal, fmt(_SYS_STR("unable to read image in '{}'")), inPath.getAbsolutePath());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
return false;
}
@ -1515,7 +1505,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
}
png_destroy_read_struct(&pngRead, &info, nullptr);
fclose(inf);
inf.reset();
/* Perform box-filter mipmap */
if (numMips > 1) {
@ -1595,33 +1585,66 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
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] {
0, 1, 2, 3, 8, 9, -1, 4, 5, 6, 14
};
std::string TXTR::CalculateDolphinName(DataSpec::PAKEntryReadStream& rs) {
atUint32 format = RetroToDol[rs.readUint32Big()];
TXTR::Meta TXTR::GetMetaData(DataSpec::PAKEntryReadStream& rs) {
atUint32 retroFormat = rs.readUint32Big();
atUint32 format = RetroToDol[retroFormat];
if (format == UINT32_MAX)
return {};
atUint16 width = rs.readUint16Big();
atUint16 height = rs.readUint16Big();
atUint32 mips = rs.readUint32Big();
std::string res = fmt::format(fmt("tex1_{}x{}{}"), width, height, mips > 1 ? "_m" : "");
atUint64 palHash = 0;
bool hasPalette = false;
atUint32 textureSize = width * height;
Meta meta;
meta.format = retroFormat;
meta.width = rs.readUint16Big();
meta.height = rs.readUint16Big();
meta.mips = rs.readUint32Big();
atUint32 textureSize = meta.width * meta.height;
if (format == 8 || format == 9) {
hasPalette = true;
atUint32 paletteFormat = rs.readUint32Big();
meta.hasPalette = true;
PaletteMeta& palMeta = meta.palette;
palMeta.format = rs.readUint32Big();
atUint16 palWidth = rs.readUint16Big();
atUint16 palHeight = rs.readUint16Big();
palMeta.elementCount = palWidth * palHeight;
atUint32 palSize = atUint32(palWidth * palHeight * 2);
if (format == 4)
if (format == 8)
textureSize /= 2;
std::unique_ptr<u8[]> palData(new u8[palSize]);
rs.readUBytesToBuf(palData.get(), palSize);
palHash = XXH64(palData.get(), palSize, 0);
palMeta.dolphinHash = XXH64(palData.get(), palSize, 0);
} else {
switch(format) {
case 0: // I4
@ -1642,13 +1665,9 @@ std::string TXTR::CalculateDolphinName(DataSpec::PAKEntryReadStream& rs) {
}
std::unique_ptr<u8[]> textureData(new u8[textureSize]);
rs.readUBytesToBuf(textureData.get(), textureSize);
atUint64 texHash = XXH64(textureData.get(), textureSize, 0);
res += fmt::format(fmt("_{:016X}"), texHash);
if (hasPalette)
res += fmt::format(fmt("_{:016X}"), palHash);
res += fmt::format(fmt("_{}"), format);
meta.dolphinHash = XXH64(textureData.get(), textureSize, 0);
return res;
return meta;
}
} // namespace DataSpec

View File

@ -1,15 +1,38 @@
#pragma once
#include "DNACommon.hpp"
#include <climits>
#include "DataSpec/DNACommon/DNACommon.hpp"
namespace hecl {
class ProjectPath;
}
namespace DataSpec {
class PAKEntryReadStream;
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 Cook(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

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 {

View File

@ -1,8 +1,15 @@
#pragma once
#include "ParticleCommon.hpp"
#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 {
template <class IDType>

View File

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

View File

@ -31,8 +31,7 @@ struct ANIM : BigDNA {
};
struct ANIM0 : IANIM {
AT_DECL_EXPLICIT_DNA
AT_DECL_DNAV
AT_DECL_EXPLICIT_DNAV
ANIM0() : IANIM(0) {}
struct Header : BigDNA {
@ -48,8 +47,7 @@ struct ANIM : BigDNA {
};
struct ANIM2 : IANIM {
AT_DECL_EXPLICIT_DNA
AT_DECL_DNAV
AT_DECL_EXPLICIT_DNAV
ANIM2(bool pc) : IANIM(pc ? 3 : 2) {}
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 << "new_material.use_fake_user = True\n"
"new_material.use_nodes = True\n"
"new_material.use_backface_culling = True\n"
"new_nodetree = new_material.node_tree\n"
"for n in new_nodetree.nodes:\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;
case 0x54A92F25: /* RetroShader: ObjLightmap, KColorDiffuse, Alpha=KAlpha */
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_kcol, "Alpha"_kcola); break;
case 0x54C6204C:
_GenerateRootShader(out, "RetroShader"); break;
case 0x5A62D5F0: /* RetroShader: Lightmap, Diffuse, UnusedExtendedSpecular?, Alpha=DiffuseAlpha */
_GenerateRootShader(out, "RetroShader", "Lightmap"_tex, "Diffuse"_tex, TexLink("Alpha", 1, true)); break;
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;
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;
case 0x8E916C01: /* RetroShader: NULL, all inputs 0 */
_GenerateRootShader(out, "RetroShader"); break;
case 0x957709F8: /* RetroShader: Emissive, Alpha=1.0 */
_GenerateRootShader(out, "RetroShader", "Emissive"_tex); break;
case 0x96ABB2D3: /* RetroShader: Lightmap, Diffuse, Alpha=DiffuseAlpha */
@ -1065,14 +1070,14 @@ AT_SPECIALIZE_DNA(MaterialSet::Material::UVAnimation)
template <class Op>
void HMDLMaterialSet::Material::PASS::Enumerate(typename Op::StreamT& s) {
Do<Op>({"type"}, type, s);
Do<Op>({"texId"}, texId, s);
Do<Op>({"source"}, source, s);
Do<Op>({"uvAnimType"}, uvAnimType, s);
Do<Op>(athena::io::PropId{"type"}, type, s);
Do<Op>(athena::io::PropId{"texId"}, texId, s);
Do<Op>(athena::io::PropId{"source"}, source, s);
Do<Op>(athena::io::PropId{"uvAnimType"}, uvAnimType, s);
size_t uvParmCount = uvAnimParamsCount();
for (size_t i = 0; i < uvParmCount; ++i)
Do<Op>({}, uvAnimParms[i], s);
Do<Op>({"alpha"}, alpha, s);
Do<Op>(athena::io::PropId{"alpha"}, alpha, s);
}
AT_SPECIALIZE_DNA(HMDLMaterialSet::Material::PASS)

View File

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

View File

@ -4,20 +4,20 @@ namespace DataSpec::DNAMP1 {
template <class Op>
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);
Do<Op>({"boolPOINodes"}, boolPOINodes, boolPOICount, s);
DoSize<Op>(athena::io::PropId{"boolPOICount"}, boolPOICount, s);
Do<Op>(athena::io::PropId{"boolPOINodes"}, boolPOINodes, boolPOICount, s);
DoSize<Op>({"int32POICount"}, int32POICount, s);
Do<Op>({"int32POINodes"}, int32POINodes, int32POICount, s);
DoSize<Op>(athena::io::PropId{"int32POICount"}, int32POICount, s);
Do<Op>(athena::io::PropId{"int32POINodes"}, int32POINodes, int32POICount, s);
DoSize<Op>({"particlePOICount"}, particlePOICount, s);
Do<Op>({"particlePOINodes"}, particlePOINodes, particlePOICount, s);
DoSize<Op>(athena::io::PropId{"particlePOICount"}, particlePOICount, s);
Do<Op>(athena::io::PropId{"particlePOINodes"}, particlePOINodes, particlePOICount, s);
if (version == 2) {
DoSize<Op>({"soundPOICount"}, soundPOICount, s);
Do<Op>({"soundPOINodes"}, soundPOINodes, soundPOICount, s);
DoSize<Op>(athena::io::PropId{"soundPOICount"}, 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>
void FRME::Widget::TXPNInfo::Enumerate(typename Op::StreamT& s) {
Do<Op>({"xDim"}, xDim, s);
Do<Op>({"zDim"}, zDim, s);
Do<Op>({"scaleCenter"}, scaleCenter, s);
Do<Op>({"font"}, font, s);
Do<Op>({"wordWrap"}, wordWrap, s);
Do<Op>({"horizontal"}, horizontal, s);
Do<Op>({"justification"}, justification, s);
Do<Op>({"verticalJustification"}, verticalJustification, s);
Do<Op>({"fillColor"}, fillColor, s);
Do<Op>({"outlineColor"}, outlineColor, s);
Do<Op>({"blockExtent"}, blockExtent, s);
Do<Op>(athena::io::PropId{"xDim"}, xDim, s);
Do<Op>(athena::io::PropId{"zDim"}, zDim, s);
Do<Op>(athena::io::PropId{"scaleCenter"}, scaleCenter, s);
Do<Op>(athena::io::PropId{"font"}, font, s);
Do<Op>(athena::io::PropId{"wordWrap"}, wordWrap, s);
Do<Op>(athena::io::PropId{"horizontal"}, horizontal, s);
Do<Op>(athena::io::PropId{"justification"}, justification, s);
Do<Op>(athena::io::PropId{"verticalJustification"}, verticalJustification, s);
Do<Op>(athena::io::PropId{"fillColor"}, fillColor, s);
Do<Op>(athena::io::PropId{"outlineColor"}, outlineColor, s);
Do<Op>(athena::io::PropId{"blockExtent"}, blockExtent, s);
if (version == 1) {
Do<Op>({"jpnFont"}, jpnFont, s);
Do<Op>({"jpnPointScale[0]"}, jpnPointScale[0], s);
Do<Op>({"jpnPointScale[1]"}, jpnPointScale[1], s);
Do<Op>(athena::io::PropId{"jpnFont"}, jpnFont, s);
Do<Op>(athena::io::PropId{"jpnPointScale[0]"}, jpnPointScale[0], s);
Do<Op>(athena::io::PropId{"jpnPointScale[1]"}, jpnPointScale[1], s);
}
}

View File

@ -45,20 +45,20 @@ struct FRME : BigDNA {
Value<atInt16> unk2;
struct BWIGInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::BWIG"; }
FourCC fourcc() const { return FOURCC('BWIG'); }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::BWIG"; }
FourCC fourcc() const override { return FOURCC('BWIG'); }
};
struct HWIGInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::HWIG"; }
FourCC fourcc() const { return FOURCC('HWIG'); }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::HWIG"; }
FourCC fourcc() const override { return FOURCC('HWIG'); }
};
struct CAMRInfo : IWidgetInfo {
AT_DECL_EXPLICIT_DNA
const char* DNATypeV() const { return "FRME::CAMR"; }
AT_DECL_EXPLICIT_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::CAMR"; }
enum class ProjectionType { Perspective, Orthographic };
Value<ProjectionType> projectionType;
@ -69,7 +69,6 @@ struct FRME : BigDNA {
};
struct PerspectiveProjection : IProjection {
AT_DECL_DNA
AT_DECL_DNAV
PerspectiveProjection() : IProjection(ProjectionType::Perspective) {}
Value<float> fov;
@ -79,7 +78,6 @@ struct FRME : BigDNA {
};
struct OrthographicProjection : IProjection {
AT_DECL_DNA
AT_DECL_DNAV
OrthographicProjection() : IProjection(ProjectionType::Orthographic) {}
Value<float> left;
@ -91,24 +89,24 @@ struct FRME : BigDNA {
};
std::unique_ptr<IProjection> projection;
FourCC fourcc() const { return FOURCC('CAMR'); }
FourCC fourcc() const override { return FOURCC('CAMR'); }
};
struct MODLInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::MODL"; }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::MODL"; }
UniqueID32 model;
enum class BlendMode { Unknown0, Unknown1, Unknown2, Additive };
Value<atUint32> blendMode;
Value<atUint32> lightMask;
FourCC fourcc() const { return FOURCC('MODL'); }
FourCC fourcc() const override { return FOURCC('MODL'); }
};
struct LITEInfo : IWidgetInfo {
AT_DECL_EXPLICIT_DNA
const char* DNATypeV() const { return "FRME::LITE"; }
AT_DECL_EXPLICIT_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::LITE"; }
enum class ELightType : atUint32 {
Spot = 0,
Point = 1,
@ -127,40 +125,40 @@ struct FRME : BigDNA {
Value<atUint32> loadedIdx;
Value<float> cutoff; /* Spot only */
FourCC fourcc() const { return FOURCC('LITE'); }
FourCC fourcc() const override { return FOURCC('LITE'); }
};
struct ENRGInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::ENRG"; }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::ENRG"; }
UniqueID32 texture;
FourCC fourcc() const { return FOURCC('ENRG'); }
FourCC fourcc() const override { return FOURCC('ENRG'); }
};
struct METRInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::METR"; }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::METR"; }
Value<bool> unk1;
Value<bool> noRoundUp;
Value<atUint32> maxCapacity;
Value<atUint32> workerCount;
FourCC fourcc() const { return FOURCC('METR'); }
FourCC fourcc() const override { return FOURCC('METR'); }
};
struct GRUPInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::GRUP"; }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::GRUP"; }
Value<atInt16> defaultWorker;
Value<bool> unk3;
FourCC fourcc() const { return FOURCC('GRUP'); }
FourCC fourcc() const override { return FOURCC('GRUP'); }
};
struct TBGPInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::TBGP"; }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::TBGP"; }
Value<atUint16> elementCount;
Value<atUint16> unk2;
Value<atUint32> unkEnum;
@ -177,32 +175,32 @@ struct FRME : BigDNA {
Value<atUint16> unk10;
Value<atUint16> unk11;
FourCC fourcc() const { return FOURCC('TBGP'); }
FourCC fourcc() const override { return FOURCC('TBGP'); }
};
struct SLGPInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::SLGP"; }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::SLGP"; }
Value<float> min;
Value<float> max;
Value<float> cur;
Value<float> increment;
FourCC fourcc() const { return FOURCC('SLGP'); }
FourCC fourcc() const override { return FOURCC('SLGP'); }
};
struct PANEInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::PANE"; }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::PANE"; }
Value<float> xDim;
Value<float> zDim;
Value<atVec3f> scaleCenter;
FourCC fourcc() const { return FOURCC('PANE'); }
FourCC fourcc() const override { return FOURCC('PANE'); }
};
struct TXPNInfo : IWidgetInfo {
const char* DNATypeV() const { return "FRME::TXPN"; }
const char* DNATypeV() const override { return "FRME::TXPN"; }
enum class Justification : atUint32 {
Left = 0,
Center,
@ -229,7 +227,7 @@ struct FRME : BigDNA {
RightMono
};
AT_DECL_EXPLICIT_DNA
AT_DECL_EXPLICIT_DNAV_NO_TYPE
atUint32 version = 0;
TXPNInfo() {}
@ -249,12 +247,12 @@ struct FRME : BigDNA {
UniqueID32 jpnFont;
Value<atInt32> jpnPointScale[2] = {};
FourCC fourcc() const { return FOURCC('TXPN'); }
FourCC fourcc() const override { return FOURCC('TXPN'); }
};
struct IMGPInfo : IWidgetInfo {
AT_DECL_DNA
const char* DNATypeV() const { return "FRME::IMGP"; }
AT_DECL_DNAV_NO_TYPE
const char* DNATypeV() const override { return "FRME::IMGP"; }
UniqueID32 texture;
Value<atUint32> unk1;
Value<atUint32> unk2;
@ -263,7 +261,7 @@ struct FRME : BigDNA {
Value<atUint32> uvCoordCount;
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(string, pathsOut);
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);
if (active) {
hecl::ProjectPath activePath(layerPath, "!defaultactive");
fclose(hecl::Fopen(activePath.getAbsolutePath().data(), _SYS_STR("wb")));
const hecl::ProjectPath activePath(layerPath, "!defaultactive");
[[maybe_unused]] const auto fp = hecl::FopenUnique(activePath.getAbsolutePath().data(), _SYS_STR("wb"));
}
hecl::ProjectPath yamlFile(layerPath, _SYS_STR("!objects.yaml"));
@ -77,7 +77,7 @@ void SCLY::ScriptLayer::nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
template <>
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");
layerCount = docin.enumerate("layerSizes", layerSizes);
docin.enumerate("layers", layers);
@ -85,7 +85,7 @@ void SCLY::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& docin) {
template <>
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.enumerate("layerSizes", layerSizes);
docout.enumerate("layers", layers);

View File

@ -8,15 +8,14 @@
namespace DataSpec::DNAMP1 {
struct STRG : ISTRG {
AT_DECL_EXPLICIT_DNA_YAML
AT_DECL_DNAV
AT_DECL_EXPLICIT_DNA_YAMLV
void _read(athena::io::IStreamReader& reader);
std::vector<std::pair<FourCC, std::vector<std::u16string>>> langs;
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;
for (const auto& item : langs) {
size_t sz = item.second.size();
@ -25,19 +24,19 @@ struct STRG : ISTRG {
}
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);
if (search != langMap.end())
return hecl::Char16ToUTF8(search->second->at(idx));
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);
if (search != langMap.end())
return search->second->at(idx);
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);
if (search != langMap.end())
#if HECL_UCS2
@ -71,7 +70,7 @@ struct STRG : ISTRG {
return true;
}
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const;
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const override;
};
} // namespace DataSpec::DNAMP1

View File

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

View File

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

View File

@ -5,8 +5,7 @@
namespace DataSpec::DNAMP1 {
struct Actor : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name SO_NAME_SPECPROP();
Value<atVec3f> location SO_LOCATION_SPECPROP();
Value<atVec3f> orientation SO_ORIENTATION_SPECPROP();
@ -32,11 +31,11 @@ struct Actor : IScriptObject {
Value<bool> scaleAdvancementDelta;
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (model.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model);
ent->name = name + "_model";
@ -45,14 +44,15 @@ struct Actor : IScriptObject {
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);
animationParameters.depANCS(pathsOut);
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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct ActorContraption : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -24,11 +23,11 @@ struct ActorContraption : IScriptObject {
DamageInfo damageInfo;
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (particle.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle);
ent->name = name + "_part";
@ -37,12 +36,13 @@ struct ActorContraption : IScriptObject {
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);
animationParameters.depANCS(pathsOut);
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

View File

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

View File

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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct AmbientAI : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -25,20 +24,21 @@ struct AmbientAI : IScriptObject {
Value<atInt32> impactAnim;
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
animationParameters.nameANCS(pakRouter, name + "_animp");
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);
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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct AreaAttributes : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
enum class EWeatherType : atUint32 { None, Snow, Rain };
Value<atUint32> load; /* 0 causes the loader to bail and return null */
@ -20,7 +19,8 @@ struct AreaAttributes : IScriptObject {
UniqueID32 skybox;
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);
}
};

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct AtomicAlpha : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -23,11 +22,11 @@ struct AtomicAlpha : IScriptObject {
Value<bool> invisible;
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (wpsc.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc);
ent->name = name + "_wpsc";
@ -40,13 +39,14 @@ struct AtomicAlpha : IScriptObject {
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(model, pathsOut);
patternedInfo.depIDs(pathsOut);
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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct AtomicBeta : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -30,11 +29,11 @@ struct AtomicBeta : IScriptObject {
Value<atUint32> unknown9;
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (elsc.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(elsc);
ent->name = name + "_elsc";
@ -51,7 +50,8 @@ struct AtomicBeta : IScriptObject {
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(wpsc, pathsOut);
g_curSpec->flattenDependencies(part, pathsOut);
@ -59,6 +59,6 @@ struct AtomicBeta : IScriptObject {
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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct Babygoth : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -42,7 +41,7 @@ struct Babygoth : IScriptObject {
Value<atUint32> flamePlayerHitSfx;
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);
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()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(fireballWeapon);
ent->name = name + "_wpsc1";
@ -103,7 +102,8 @@ struct Babygoth : IScriptObject {
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(fireBreathWeapon, pathsOut);
g_curSpec->flattenDependencies(fireBreathRes, pathsOut);
@ -119,6 +119,6 @@ struct Babygoth : IScriptObject {
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

View File

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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct Beetle : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atUint32> flavor;
Value<atVec3f> location;
@ -25,11 +24,11 @@ struct Beetle : IScriptObject {
Value<float> initialAttackDelay;
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (tailModel.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(tailModel);
ent->name = name + "_tailModel";
@ -38,12 +37,13 @@ struct Beetle : IScriptObject {
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);
patternedInfo.depIDs(pathsOut);
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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct BloodFlower : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -27,11 +26,11 @@ struct BloodFlower : IScriptObject {
UniqueID32 particle5;
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (wpsc1.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1);
ent->name = name + "_wpsc1";
@ -64,7 +63,8 @@ struct BloodFlower : IScriptObject {
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(wpsc2, pathsOut);
g_curSpec->flattenDependencies(particle1, pathsOut);
@ -76,6 +76,6 @@ struct BloodFlower : IScriptObject {
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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct Burrower : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -22,11 +21,11 @@ struct Burrower : IScriptObject {
Value<atUint32> unknown; // always FF
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (wpsc.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc);
ent->name = name + "_wpsc";
@ -51,7 +50,8 @@ struct Burrower : IScriptObject {
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(particle1, pathsOut);
g_curSpec->flattenDependencies(particle2, pathsOut);
@ -61,6 +61,6 @@ struct Burrower : IScriptObject {
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

View File

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

View File

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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct CameraFilterKeyframe : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<bool> active;
Value<atUint32> ftype;
@ -19,14 +18,15 @@ struct CameraFilterKeyframe : IScriptObject {
Value<float> timeOut;
UniqueID32 texture;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (texture.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(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);
}
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct ChozoGhost : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -40,11 +39,11 @@ struct ChozoGhost : IScriptObject {
Value<atUint32> unknown12;
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);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (wpsc1.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1);
ent->name = name + "_wpsc1";
@ -61,7 +60,8 @@ struct ChozoGhost : IScriptObject {
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(wpsc2, pathsOut);
g_curSpec->flattenDependencies(particle, pathsOut);
@ -69,6 +69,6 @@ struct ChozoGhost : IScriptObject {
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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct DamageableTrigger : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> volume;
@ -21,7 +20,7 @@ struct DamageableTrigger : IScriptObject {
Value<bool> active;
VisorParameters visorParameters;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (patternTex1.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(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(patternTex2, 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 loc(location);
return zeus::CAABox(loc - halfExtent, loc + halfExtent);

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct Debris : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -27,7 +26,7 @@ struct Debris : IScriptObject {
Value<bool> b1;
Value<bool> active;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (model.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model);
ent->name = name + "_model";
@ -39,12 +38,13 @@ struct Debris : IScriptObject {
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(particle, pathsOut);
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

View File

@ -6,8 +6,7 @@
namespace DataSpec::DNAMP1 {
struct DebrisExtended : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
AT_DECL_DNA_YAMLV
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
@ -48,7 +47,7 @@ struct DebrisExtended : IScriptObject {
Value<bool> noBounce;
Value<bool> active;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const override {
if (model.isValid()) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model);
ent->name = name + "_model";
@ -68,7 +67,8 @@ struct DebrisExtended : IScriptObject {
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(particle1, pathsOut);
g_curSpec->flattenDependencies(particle2, pathsOut);
@ -76,6 +76,6 @@ struct DebrisExtended : IScriptObject {
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

View File

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

View File

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

View File

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

View File

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

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