2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-12-07 11:47:48 +00:00

fix: compilation on linux

This commit is contained in:
Jan Laupetin
2025-11-06 23:23:27 +01:00
parent 30e63186f3
commit e9ebc70658
6 changed files with 10 additions and 8 deletions

View File

@@ -3,6 +3,7 @@
#include "BSP.h" #include "BSP.h"
#include <cstdint> #include <cstdint>
#include <memory>
namespace BSP namespace BSP
{ {

View File

@@ -7,6 +7,7 @@
#include "MapEntsLinker.h" #include "MapEntsLinker.h"
#include "SkinnedVertsLinker.h" #include "SkinnedVertsLinker.h"
#include <cstring>
#include <format> #include <format>
using namespace T6; using namespace T6;

View File

@@ -4,6 +4,7 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <cstring>
using namespace T6; using namespace T6;

View File

@@ -5,6 +5,7 @@
#include "Utils/Pack.h" #include "Utils/Pack.h"
#include <cassert> #include <cassert>
#include <cstring>
#include <format> #include <format>
using namespace T6; using namespace T6;
@@ -232,7 +233,7 @@ namespace BSP
// visdata is written to by the game // visdata is written to by the game
// all visdata is aligned by 128 // all visdata is aligned by 128
const auto alignedModelCount = utils::Align(modelCount, 128uz); const auto alignedModelCount = utils::Align(modelCount, 128u);
gfxWorld.dpvs.smodelVisDataCount = static_cast<unsigned int>(alignedModelCount); gfxWorld.dpvs.smodelVisDataCount = static_cast<unsigned int>(alignedModelCount);
gfxWorld.dpvs.smodelVisData[0] = m_memory.Alloc<char>(alignedModelCount); gfxWorld.dpvs.smodelVisData[0] = m_memory.Alloc<char>(alignedModelCount);
gfxWorld.dpvs.smodelVisData[1] = m_memory.Alloc<char>(alignedModelCount); gfxWorld.dpvs.smodelVisData[1] = m_memory.Alloc<char>(alignedModelCount);

View File

@@ -61,8 +61,6 @@ namespace
} }
} }
} }
std::string loadMapEnts() {}
} // namespace } // namespace
namespace BSP namespace BSP

View File

@@ -33,7 +33,7 @@ namespace
const auto js = nlohmann::json::parse(*file.m_stream.get()); const auto js = nlohmann::json::parse(*file.m_stream.get());
std::string techSetName = js["name"]; std::string techSetName = js["name"];
techniqueSet->name = _strdup(techSetName.c_str()); techniqueSet->name = m_memory.Dup(techSetName.c_str());
techniqueSet->worldVertFormat = (unsigned char)js["worldVertFormat"]; techniqueSet->worldVertFormat = (unsigned char)js["worldVertFormat"];
for (int i = 0; i < 36; i++) for (int i = 0; i < 36; i++)
@@ -50,7 +50,7 @@ namespace
techniqueSet->techniques[i] = technique; techniqueSet->techniques[i] = technique;
std::string techName = techniqueJs["name"]; std::string techName = techniqueJs["name"];
technique->name = _strdup(techName.c_str()); technique->name = m_memory.Dup(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);
@@ -127,7 +127,7 @@ namespace
currPass->pixelShader = new MaterialPixelShader; currPass->pixelShader = new MaterialPixelShader;
std::string pixelName = passJs["pixelShader"]["name"]; std::string pixelName = passJs["pixelShader"]["name"];
currPass->pixelShader->name = _strdup(pixelName.c_str()); currPass->pixelShader->name = m_memory.Dup(pixelName.c_str());
currPass->pixelShader->prog.ps = nullptr; currPass->pixelShader->prog.ps = nullptr;
const auto psFileName = shader::GetFileNameForPixelShaderAssetName(pixelName); const auto psFileName = shader::GetFileNameForPixelShaderAssetName(pixelName);
@@ -151,7 +151,7 @@ namespace
currPass->vertexShader = new MaterialVertexShader; currPass->vertexShader = new MaterialVertexShader;
std::string vertexName = passJs["vertexShader"]["name"]; std::string vertexName = passJs["vertexShader"]["name"];
currPass->vertexShader->name = _strdup(vertexName.c_str()); currPass->vertexShader->name = m_memory.Dup(vertexName.c_str());
currPass->vertexShader->prog.vs = nullptr; currPass->vertexShader->prog.vs = nullptr;
const auto vsFileName = shader::GetFileNameForVertexShaderAssetName(vertexName); const auto vsFileName = shader::GetFileNameForVertexShaderAssetName(vertexName);