From f29c0ce7b70d349b2bfbb0d83d48f39b8542c863 Mon Sep 17 00:00:00 2001 From: LJW-Dev Date: Sat, 1 Nov 2025 17:50:01 +0800 Subject: [PATCH] Refactored files to use CLANG formatting and linux compatabillty. --- .../T6/TechniqueSet/LoaderTechniqueSetT6.cpp | 18 +++++++++--------- .../T6/Techset/AssetDumperTechniqueSet.cpp | 14 +++++++------- .../SequenceZoneDefinitionMetaData.cpp | 1 + 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp b/src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp index e093907d..cd7f02e8 100644 --- a/src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp +++ b/src/ObjLoading/Game/T6/TechniqueSet/LoaderTechniqueSetT6.cpp @@ -42,7 +42,7 @@ namespace if (techniqueJs.size() == 0) { - techniqueSet->techniques[i] = NULL; + techniqueSet->techniques[i] = nullptr; } else { @@ -53,7 +53,7 @@ namespace technique->name = _strdup(techName.c_str()); technique->flags = techniqueJs["flags"]; technique->passCount = techniqueJs["passCount"]; - _ASSERT(technique->passCount == 1); + assert(technique->passCount == 1); for (auto passIndex = 0u; passIndex < technique->passCount; passIndex++) { @@ -70,7 +70,7 @@ namespace int argCount = currPass->perPrimArgCount + currPass->perObjArgCount + currPass->stableArgCount; if (argCount == 0) { - currPass->args = NULL; + currPass->args = nullptr; } else { @@ -102,7 +102,7 @@ namespace if (passJs["vertexDecl"].size() == 0) { - currPass->vertexDecl = NULL; + currPass->vertexDecl = nullptr; } else { @@ -114,13 +114,13 @@ namespace { currPass->vertexDecl->routing.data[i].source = (unsigned char)passJs["vertexDecl"]["routing"][i]["source"]; currPass->vertexDecl->routing.data[i].dest = (unsigned char)passJs["vertexDecl"]["routing"][i]["dest"]; - currPass->vertexDecl->routing.decl[i] = NULL; + currPass->vertexDecl->routing.decl[i] = nullptr; } } if (passJs["pixelShader"].size() == 0) { - currPass->pixelShader = NULL; + currPass->pixelShader = nullptr; } else { @@ -128,7 +128,7 @@ namespace std::string pixelName = passJs["pixelShader"]["name"]; currPass->pixelShader->name = _strdup(pixelName.c_str()); - currPass->pixelShader->prog.ps = NULL; + currPass->pixelShader->prog.ps = nullptr; const auto psFileName = shader::GetFileNameForPixelShaderAssetName(pixelName); const auto psFile = m_search_path.Open(psFileName); @@ -144,7 +144,7 @@ namespace if (passJs["vertexShader"].size() == 0) { - currPass->vertexShader = NULL; + currPass->vertexShader = nullptr; } else { @@ -152,7 +152,7 @@ namespace std::string vertexName = passJs["vertexShader"]["name"]; currPass->vertexShader->name = _strdup(vertexName.c_str()); - currPass->vertexShader->prog.vs = NULL; + currPass->vertexShader->prog.vs = nullptr; const auto vsFileName = shader::GetFileNameForVertexShaderAssetName(vertexName); const auto vsFile = m_search_path.Open(vsFileName); diff --git a/src/ObjWriting/Game/T6/Techset/AssetDumperTechniqueSet.cpp b/src/ObjWriting/Game/T6/Techset/AssetDumperTechniqueSet.cpp index a1bdaf04..1ad0ed67 100644 --- a/src/ObjWriting/Game/T6/Techset/AssetDumperTechniqueSet.cpp +++ b/src/ObjWriting/Game/T6/Techset/AssetDumperTechniqueSet.cpp @@ -24,13 +24,13 @@ void AssetDumperTechniqueSet::DumpAsset(AssetDumpingContext& context, const XAss { nlohmann::json techniqueJs = nlohmann::json::object(); - if (technique != NULL) + if (technique != nullptr) { techniqueJs["name"] = technique->name; techniqueJs["flags"] = technique->flags; techniqueJs["passCount"] = technique->passCount; - _ASSERT(technique->passCount == 1); + assert(technique->passCount == 1); techniqueJs["passArray"] = nlohmann::json::array(); for (auto passIndex = 0u; passIndex < technique->passCount; passIndex++) @@ -46,7 +46,7 @@ void AssetDumperTechniqueSet::DumpAsset(AssetDumpingContext& context, const XAss passJs["materialType"] = currPass->materialType; nlohmann::json vertDeclJs = nlohmann::json::object(); - if (currPass->vertexDecl != NULL) + if (currPass->vertexDecl != nullptr) { vertDeclJs["streamCount"] = currPass->vertexDecl->streamCount; vertDeclJs["hasOptionalSource"] = currPass->vertexDecl->hasOptionalSource; @@ -56,13 +56,13 @@ void AssetDumperTechniqueSet::DumpAsset(AssetDumpingContext& context, const XAss vertDeclJs["routing"][i]["source"] = currPass->vertexDecl->routing.data[i].source; vertDeclJs["routing"][i]["dest"] = currPass->vertexDecl->routing.data[i].dest; - _ASSERT(currPass->vertexDecl->routing.decl[i] == NULL); + assert(currPass->vertexDecl->routing.decl[i] == NULL); } } passJs["vertexDecl"] = vertDeclJs; passJs["args"] = nlohmann::json::array(); - if (currPass->args != NULL) + if (currPass->args != nullptr) { for (int i = 0; i < currPass->perPrimArgCount + currPass->perObjArgCount + currPass->stableArgCount; i++) { @@ -90,14 +90,14 @@ void AssetDumperTechniqueSet::DumpAsset(AssetDumpingContext& context, const XAss } nlohmann::json pixelJs = nlohmann::json::object(); - if (currPass->pixelShader != NULL) + if (currPass->pixelShader != nullptr) { pixelJs["name"] = currPass->pixelShader->name; } passJs["pixelShader"] = pixelJs; nlohmann::json vertexJs = nlohmann::json::object(); - if (currPass->vertexShader != NULL) + if (currPass->vertexShader != nullptr) { vertexJs["name"] = currPass->vertexShader->name; } diff --git a/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionMetaData.cpp b/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionMetaData.cpp index 7be50024..7beca995 100644 --- a/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionMetaData.cpp +++ b/src/ZoneCommon/Zone/Definition/Parsing/Sequence/SequenceZoneDefinitionMetaData.cpp @@ -1,4 +1,5 @@ #include "SequenceZoneDefinitionMetaData.h" + #include "Utils/Logging/Log.h" #include "Utils/StringUtils.h" #include "Zone/Definition/Parsing/Matcher/ZoneDefinitionMatcherFactory.h"