2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 08:42:35 +00:00

Refactored files to use CLANG formatting and linux compatabillty.

This commit is contained in:
LJW-Dev
2025-11-01 17:50:01 +08:00
committed by Jan Laupetin
parent 7fa635b3ce
commit f29c0ce7b7
3 changed files with 17 additions and 16 deletions
@@ -42,7 +42,7 @@ namespace
if (techniqueJs.size() == 0) if (techniqueJs.size() == 0)
{ {
techniqueSet->techniques[i] = NULL; techniqueSet->techniques[i] = nullptr;
} }
else else
{ {
@@ -53,7 +53,7 @@ namespace
technique->name = _strdup(techName.c_str()); technique->name = _strdup(techName.c_str());
technique->flags = techniqueJs["flags"]; technique->flags = techniqueJs["flags"];
technique->passCount = techniqueJs["passCount"]; technique->passCount = techniqueJs["passCount"];
_ASSERT(technique->passCount == 1); assert(technique->passCount == 1);
for (auto passIndex = 0u; passIndex < technique->passCount; passIndex++) for (auto passIndex = 0u; passIndex < technique->passCount; passIndex++)
{ {
@@ -70,7 +70,7 @@ namespace
int argCount = currPass->perPrimArgCount + currPass->perObjArgCount + currPass->stableArgCount; int argCount = currPass->perPrimArgCount + currPass->perObjArgCount + currPass->stableArgCount;
if (argCount == 0) if (argCount == 0)
{ {
currPass->args = NULL; currPass->args = nullptr;
} }
else else
{ {
@@ -102,7 +102,7 @@ namespace
if (passJs["vertexDecl"].size() == 0) if (passJs["vertexDecl"].size() == 0)
{ {
currPass->vertexDecl = NULL; currPass->vertexDecl = nullptr;
} }
else else
{ {
@@ -114,13 +114,13 @@ namespace
{ {
currPass->vertexDecl->routing.data[i].source = (unsigned char)passJs["vertexDecl"]["routing"][i]["source"]; 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.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) if (passJs["pixelShader"].size() == 0)
{ {
currPass->pixelShader = NULL; currPass->pixelShader = nullptr;
} }
else else
{ {
@@ -128,7 +128,7 @@ namespace
std::string pixelName = passJs["pixelShader"]["name"]; std::string pixelName = passJs["pixelShader"]["name"];
currPass->pixelShader->name = _strdup(pixelName.c_str()); 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 psFileName = shader::GetFileNameForPixelShaderAssetName(pixelName);
const auto psFile = m_search_path.Open(psFileName); const auto psFile = m_search_path.Open(psFileName);
@@ -144,7 +144,7 @@ namespace
if (passJs["vertexShader"].size() == 0) if (passJs["vertexShader"].size() == 0)
{ {
currPass->vertexShader = NULL; currPass->vertexShader = nullptr;
} }
else else
{ {
@@ -152,7 +152,7 @@ namespace
std::string vertexName = passJs["vertexShader"]["name"]; std::string vertexName = passJs["vertexShader"]["name"];
currPass->vertexShader->name = _strdup(vertexName.c_str()); 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 vsFileName = shader::GetFileNameForVertexShaderAssetName(vertexName);
const auto vsFile = m_search_path.Open(vsFileName); const auto vsFile = m_search_path.Open(vsFileName);
@@ -24,13 +24,13 @@ void AssetDumperTechniqueSet::DumpAsset(AssetDumpingContext& context, const XAss
{ {
nlohmann::json techniqueJs = nlohmann::json::object(); nlohmann::json techniqueJs = nlohmann::json::object();
if (technique != NULL) if (technique != nullptr)
{ {
techniqueJs["name"] = technique->name; techniqueJs["name"] = technique->name;
techniqueJs["flags"] = technique->flags; techniqueJs["flags"] = technique->flags;
techniqueJs["passCount"] = technique->passCount; techniqueJs["passCount"] = technique->passCount;
_ASSERT(technique->passCount == 1); assert(technique->passCount == 1);
techniqueJs["passArray"] = nlohmann::json::array(); techniqueJs["passArray"] = nlohmann::json::array();
for (auto passIndex = 0u; passIndex < technique->passCount; passIndex++) for (auto passIndex = 0u; passIndex < technique->passCount; passIndex++)
@@ -46,7 +46,7 @@ void AssetDumperTechniqueSet::DumpAsset(AssetDumpingContext& context, const XAss
passJs["materialType"] = currPass->materialType; passJs["materialType"] = currPass->materialType;
nlohmann::json vertDeclJs = nlohmann::json::object(); nlohmann::json vertDeclJs = nlohmann::json::object();
if (currPass->vertexDecl != NULL) if (currPass->vertexDecl != nullptr)
{ {
vertDeclJs["streamCount"] = currPass->vertexDecl->streamCount; vertDeclJs["streamCount"] = currPass->vertexDecl->streamCount;
vertDeclJs["hasOptionalSource"] = currPass->vertexDecl->hasOptionalSource; 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]["source"] = currPass->vertexDecl->routing.data[i].source;
vertDeclJs["routing"][i]["dest"] = currPass->vertexDecl->routing.data[i].dest; 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["vertexDecl"] = vertDeclJs;
passJs["args"] = nlohmann::json::array(); 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++) 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(); nlohmann::json pixelJs = nlohmann::json::object();
if (currPass->pixelShader != NULL) if (currPass->pixelShader != nullptr)
{ {
pixelJs["name"] = currPass->pixelShader->name; pixelJs["name"] = currPass->pixelShader->name;
} }
passJs["pixelShader"] = pixelJs; passJs["pixelShader"] = pixelJs;
nlohmann::json vertexJs = nlohmann::json::object(); nlohmann::json vertexJs = nlohmann::json::object();
if (currPass->vertexShader != NULL) if (currPass->vertexShader != nullptr)
{ {
vertexJs["name"] = currPass->vertexShader->name; vertexJs["name"] = currPass->vertexShader->name;
} }
@@ -1,4 +1,5 @@
#include "SequenceZoneDefinitionMetaData.h" #include "SequenceZoneDefinitionMetaData.h"
#include "Utils/Logging/Log.h" #include "Utils/Logging/Log.h"
#include "Utils/StringUtils.h" #include "Utils/StringUtils.h"
#include "Zone/Definition/Parsing/Matcher/ZoneDefinitionMatcherFactory.h" #include "Zone/Definition/Parsing/Matcher/ZoneDefinitionMatcherFactory.h"