From 2c6d83b0c7883fd6ac13ab08034268a3827226c2 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 10 Aug 2015 10:49:19 -1000 Subject: [PATCH] Minor fixes and cleanups --- DataSpec/DNACommon/CMDL.hpp | 68 +++++++++++++++---------------- DataSpec/DNAMP1/CMDLMaterials.cpp | 2 +- DataSpec/DNAMP1/DNAMP1.cpp | 4 +- DataSpec/DNAMP2/DNAMP2.cpp | 4 +- DataSpec/DNAMP3/DNAMP3.cpp | 2 +- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/DataSpec/DNACommon/CMDL.hpp b/DataSpec/DNACommon/CMDL.hpp index dec878316..9725d772e 100644 --- a/DataSpec/DNACommon/CMDL.hpp +++ b/DataSpec/DNACommon/CMDL.hpp @@ -70,44 +70,44 @@ void GetVertexAttributes(const MaterialSet& matSet, { const typename MaterialSet::Material::VAFlags& vaFlags = mat.getVAFlags(); attributesOut.emplace_back(); - VertexAttributes& metrics = attributesOut.back(); + VertexAttributes& va = attributesOut.back(); - metrics.pos = vaFlags.position(); - metrics.norm = vaFlags.normal(); - metrics.color0 = vaFlags.color0(); - metrics.color1 = vaFlags.color1(); + va.pos = vaFlags.position(); + va.norm = vaFlags.normal(); + va.color0 = vaFlags.color0(); + va.color1 = vaFlags.color1(); - if ((metrics.uvs[0] = vaFlags.tex0())) - ++metrics.uvCount; - if ((metrics.uvs[1] = vaFlags.tex1())) - ++metrics.uvCount; - if ((metrics.uvs[2] = vaFlags.tex2())) - ++metrics.uvCount; - if ((metrics.uvs[3] = vaFlags.tex3())) - ++metrics.uvCount; - if ((metrics.uvs[4] = vaFlags.tex4())) - ++metrics.uvCount; - if ((metrics.uvs[5] = vaFlags.tex5())) - ++metrics.uvCount; - if ((metrics.uvs[6] = vaFlags.tex6())) - ++metrics.uvCount; + if ((va.uvs[0] = vaFlags.tex0())) + ++va.uvCount; + if ((va.uvs[1] = vaFlags.tex1())) + ++va.uvCount; + if ((va.uvs[2] = vaFlags.tex2())) + ++va.uvCount; + if ((va.uvs[3] = vaFlags.tex3())) + ++va.uvCount; + if ((va.uvs[4] = vaFlags.tex4())) + ++va.uvCount; + if ((va.uvs[5] = vaFlags.tex5())) + ++va.uvCount; + if ((va.uvs[6] = vaFlags.tex6())) + ++va.uvCount; - metrics.pnMtxIdx = vaFlags.pnMatIdx(); + va.pnMtxIdx = vaFlags.pnMatIdx(); - if ((metrics.texMtxIdx[0] = vaFlags.tex0MatIdx())) - ++metrics.texMtxIdxCount; - if ((metrics.texMtxIdx[1] = vaFlags.tex1MatIdx())) - ++metrics.texMtxIdxCount; - if ((metrics.texMtxIdx[2] = vaFlags.tex2MatIdx())) - ++metrics.texMtxIdxCount; - if ((metrics.texMtxIdx[3] = vaFlags.tex3MatIdx())) - ++metrics.texMtxIdxCount; - if ((metrics.texMtxIdx[4] = vaFlags.tex4MatIdx())) - ++metrics.texMtxIdxCount; - if ((metrics.texMtxIdx[5] = vaFlags.tex5MatIdx())) - ++metrics.texMtxIdxCount; - if ((metrics.texMtxIdx[6] = vaFlags.tex6MatIdx())) - ++metrics.texMtxIdxCount; + if ((va.texMtxIdx[0] = vaFlags.tex0MatIdx())) + ++va.texMtxIdxCount; + if ((va.texMtxIdx[1] = vaFlags.tex1MatIdx())) + ++va.texMtxIdxCount; + if ((va.texMtxIdx[2] = vaFlags.tex2MatIdx())) + ++va.texMtxIdxCount; + if ((va.texMtxIdx[3] = vaFlags.tex3MatIdx())) + ++va.texMtxIdxCount; + if ((va.texMtxIdx[4] = vaFlags.tex4MatIdx())) + ++va.texMtxIdxCount; + if ((va.texMtxIdx[5] = vaFlags.tex5MatIdx())) + ++va.texMtxIdxCount; + if ((va.texMtxIdx[6] = vaFlags.tex6MatIdx())) + ++va.texMtxIdxCount; } } diff --git a/DataSpec/DNAMP1/CMDLMaterials.cpp b/DataSpec/DNAMP1/CMDLMaterials.cpp index 823848591..27c63db8e 100644 --- a/DataSpec/DNAMP1/CMDLMaterials.cpp +++ b/DataSpec/DNAMP1/CMDLMaterials.cpp @@ -626,7 +626,7 @@ void _ConstructMaterial(Stream& out, using BlendFactor = MaterialSet::Material::BlendFactor; if (material.blendDestFactor() != BlendFactor::GX_BL_ZERO) { - if (material.blendDestFactor() == BlendFactor::GX_BL_ZERO) + if (material.blendDestFactor() == BlendFactor::GX_BL_ONE) out << "new_material.game_settings.alpha_blend = 'ADD'\n" "new_material.use_transparency = True\n" "new_material.transparency_method = 'RAYTRACE'\n" diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index db4e780cd..a091b7be5 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -36,7 +36,7 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPar mlvlName.read(rs); if (m_levelString.size()) m_levelString += _S(", "); - m_levelString += mlvlName.getSystemString(FourCC(SBIG('ENGL')), 0); + m_levelString += mlvlName.getSystemString(FOURCC('ENGL'), 0); } } } @@ -135,7 +135,7 @@ void PAKBridge::build() STRG areaName; PAKEntryReadStream rs = areaNameEnt->beginReadStream(m_node); areaName.read(rs); - areaDeps.name = areaName.getSystemString(FourCC(SBIG('ENGL')), 0); + areaDeps.name = areaName.getSystemString(FOURCC('ENGL'), 0); } if (areaDeps.name.empty()) { diff --git a/DataSpec/DNAMP2/DNAMP2.cpp b/DataSpec/DNAMP2/DNAMP2.cpp index bd6d4ec15..fbf550206 100644 --- a/DataSpec/DNAMP2/DNAMP2.cpp +++ b/DataSpec/DNAMP2/DNAMP2.cpp @@ -34,7 +34,7 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPar mlvlName.read(rs); if (m_levelString.size()) m_levelString += _S(", "); - m_levelString += mlvlName.getSystemString(FourCC(SBIG('ENGL')), 0); + m_levelString += mlvlName.getSystemString(FOURCC('ENGL'), 0); } } } @@ -133,7 +133,7 @@ void PAKBridge::build() STRG areaName; PAKEntryReadStream rs = areaNameEnt->beginReadStream(m_node); areaName.read(rs); - areaDeps.name = areaName.getSystemString(FourCC(SBIG('ENGL')), 0); + areaDeps.name = areaName.getSystemString(FOURCC('ENGL'), 0); } if (areaDeps.name.empty()) { diff --git a/DataSpec/DNAMP3/DNAMP3.cpp b/DataSpec/DNAMP3/DNAMP3.cpp index 4ec654575..dd5a0955c 100644 --- a/DataSpec/DNAMP3/DNAMP3.cpp +++ b/DataSpec/DNAMP3/DNAMP3.cpp @@ -35,7 +35,7 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPar PAKEntryReadStream rs = nameEnt->beginReadStream(m_node); STRG mlvlName; mlvlName.read(rs); - uniq.insert(mlvlName.getSystemString(FourCC(SBIG('ENGL')), 0)); + uniq.insert(mlvlName.getSystemString(FOURCC('ENGL'), 0)); } } }