2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-26 22:42:06 +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
parent b7d629d26b
commit 323a882b1d
3 changed files with 21 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
#include "Game/T6/T6.h"
#include "LoaderTechniqueSetT6.h"
#include "Game/T6/T6.h"
#include "Shader/ShaderCommon.h"
#include <cstring>
@@ -41,7 +42,7 @@ namespace
if (techniqueJs.size() == 0)
{
techniqueSet->techniques[i] = NULL;
techniqueSet->techniques[i] = nullptr;
}
else
{
@@ -52,8 +53,8 @@ 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++)
{
MaterialPass* currPass = &technique->passArray[passIndex];
@@ -69,7 +70,7 @@ namespace
int argCount = currPass->perPrimArgCount + currPass->perObjArgCount + currPass->stableArgCount;
if (argCount == 0)
{
currPass->args = NULL;
currPass->args = nullptr;
}
else
{
@@ -101,7 +102,7 @@ namespace
if (passJs["vertexDecl"].size() == 0)
{
currPass->vertexDecl = NULL;
currPass->vertexDecl = nullptr;
}
else
{
@@ -113,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
{
@@ -127,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);
@@ -143,7 +144,7 @@ namespace
if (passJs["vertexShader"].size() == 0)
{
currPass->vertexShader = NULL;
currPass->vertexShader = nullptr;
}
else
{
@@ -151,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);

View File

@@ -2,9 +2,9 @@
#include "Shader/ShaderCommon.h"
#include <nlohmann/json.hpp>
#include <sstream>
#include <unordered_set>
#include <nlohmann/json.hpp>
using namespace nlohmann;
using namespace T6;
@@ -103,13 +103,13 @@ namespace techset
{
json techniqueJs = 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"] = json::array();
for (auto passIndex = 0u; passIndex < technique->passCount; passIndex++)
@@ -125,7 +125,7 @@ namespace techset
passJs["materialType"] = currPass->materialType;
json vertDeclJs = json::object();
if (currPass->vertexDecl != NULL)
if (currPass->vertexDecl != nullptr)
{
vertDeclJs["streamCount"] = currPass->vertexDecl->streamCount;
vertDeclJs["hasOptionalSource"] = currPass->vertexDecl->hasOptionalSource;
@@ -135,13 +135,13 @@ namespace techset
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] == nullptr);
}
}
passJs["vertexDecl"] = vertDeclJs;
passJs["args"] = json::array();
if (currPass->args != NULL)
if (currPass->args != nullptr)
{
for (int i = 0; i < currPass->perPrimArgCount + currPass->perObjArgCount + currPass->stableArgCount; i++)
{
@@ -169,7 +169,7 @@ namespace techset
}
json pixelJs = json::object();
if (currPass->pixelShader != NULL)
if (currPass->pixelShader != nullptr)
{
pixelJs["name"] = currPass->pixelShader->name;
if (shaderState->ShouldDumpPixelShader(currPass->pixelShader))
@@ -178,7 +178,7 @@ namespace techset
passJs["pixelShader"] = pixelJs;
json vertexJs = json::object();
if (currPass->vertexShader != NULL)
if (currPass->vertexShader != nullptr)
{
vertexJs["name"] = currPass->vertexShader->name;
if (shaderState->ShouldDumpVertexShader(currPass->vertexShader))

View File

@@ -1,4 +1,5 @@
#include "SequenceZoneDefinitionMetaData.h"
#include "Utils/Logging/Log.h"
#include "Utils/StringUtils.h"
#include "Zone/Definition/Parsing/Matcher/ZoneDefinitionMatcherFactory.h"