2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 13:44:56 +00:00

Huge shader refactor

This commit is contained in:
Jack Andersen
2018-10-06 16:59:17 -10:00
parent 0a0a581f2d
commit c307e354ca
184 changed files with 8777 additions and 14295 deletions

View File

@@ -156,7 +156,7 @@ void MaterialSet::ConstructMaterial(Stream& out,
for (const Material::SectionFactory& factory : material.sections)
{
factory.section->constructNode(out, pakRouter, entry, prevSection, i++, texMapIdx, texMtxIdx, kColorIdx);
Material::SectionPASS* pass = dynamic_cast<Material::SectionPASS*>(factory.section.get());
Material::SectionPASS* pass = Material::SectionPASS::castTo(factory.section.get());
if (!pass || (pass && Material::SectionPASS::Subtype(pass->subtype.toUint32()) != Material::SectionPASS::Subtype::RFLV))
prevSection = factory.section.get();
}

View File

@@ -74,6 +74,8 @@ struct MaterialSet : BigDNA
struct SectionPASS : ISection
{
SectionPASS() : ISection(ISection::Type::PASS) {}
static SectionPASS* castTo(ISection* sec)
{ return sec->m_type == Type::PASS ? static_cast<SectionPASS*>(sec) : nullptr; }
AT_DECL_DNA
AT_DECL_DNAV
Value<atUint32> size;
@@ -126,6 +128,8 @@ struct MaterialSet : BigDNA
struct SectionCLR : ISection
{
SectionCLR() : ISection(ISection::Type::CLR) {}
static SectionCLR* castTo(ISection* sec)
{ return sec->m_type == Type::CLR ? static_cast<SectionCLR*>(sec) : nullptr; }
AT_DECL_DNA
AT_DECL_DNAV
enum class Subtype : atUint32
@@ -148,6 +152,8 @@ struct MaterialSet : BigDNA
struct SectionINT : ISection
{
SectionINT() : ISection(ISection::Type::INT) {}
static SectionINT* castTo(ISection* sec)
{ return sec->m_type == Type::INT ? static_cast<SectionINT*>(sec) : nullptr; }
AT_DECL_DNA
AT_DECL_DNAV
enum class Subtype : atUint32