2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-27 15:02:06 +00:00

chore: misc code improvements

This commit is contained in:
Jan Laupetin
2025-11-10 22:12:17 +01:00
parent 27c3c7dccb
commit 12647a505c
11 changed files with 28 additions and 11 deletions

View File

@@ -295,7 +295,7 @@ namespace BSP
BSPUtil::updateAABBWithPoint(vert, childMins, childMaxs);
}
CollisionAabbTree childAABBTree;
CollisionAabbTree childAABBTree{};
childAABBTree.materialIndex = 0; // always use the first material
childAABBTree.childCount = 0;
childAABBTree.u.partitionIndex = partitionIndex;
@@ -311,9 +311,15 @@ namespace BSP
outParentStartIndex = parentAABBArrayIndex;
}
constexpr vec3_t normalX = {1.0f, 0.0f, 0.0f};
constexpr vec3_t normalY = {0.0f, 1.0f, 0.0f};
constexpr vec3_t normalZ = {0.0f, 0.0f, 1.0f};
constexpr vec3_t normalX = {
{.x = 1.0f, .y = 0.0f, .z = 0.0f}
};
constexpr vec3_t normalY = {
{.x = 0.0f, .y = 1.0f, .z = 0.0f}
};
constexpr vec3_t normalZ = {
{.x = 0.0f, .y = 0.0f, .z = 1.0f}
};
// returns the index of the node/leaf parsed by the function
// Nodes are indexed by their index in the node array

View File

@@ -15,6 +15,7 @@ namespace BSP
{
// all lights that aren't the sunlight or default light need their own GfxLightDef asset
ComWorld* comWorld = m_memory.Alloc<ComWorld>();
comWorld->name = m_memory.Dup(bsp.bspName.c_str());
comWorld->isInUse = 1;
comWorld->primaryLightCount = BSPGameConstants::BSP_DEFAULT_LIGHT_COUNT;
@@ -25,6 +26,7 @@ namespace BSP
ComPrimaryLight* sunLight = &comWorld->primaryLights[1];
const vec4_t sunLightColor = BSPEditableConstants::SUNLIGHT_COLOR;
const vec3_t sunLightDirection = BSPEditableConstants::SUNLIGHT_DIRECTION;
sunLight->type = GFX_LIGHT_TYPE_DIR;
sunLight->diffuseColor.r = sunLightColor.r;
sunLight->diffuseColor.g = sunLightColor.g;

View File

@@ -11,6 +11,7 @@ namespace BSP
{
public:
ComWorldLinker(MemoryManager& memory, ISearchPath& searchPath, AssetCreationContext& context);
[[nodiscard]] T6::ComWorld* linkComWorld(const BSPData& bsp) const;
private:

View File

@@ -11,6 +11,7 @@ namespace BSP
{
public:
GameWorldMpLinker(MemoryManager& memory, ISearchPath& searchPath, AssetCreationContext& context);
[[nodiscard]] T6::GameWorldMp* linkGameWorldMp(const BSPData& bsp) const;
private:

View File

@@ -11,6 +11,7 @@ namespace BSP
{
public:
GfxWorldLinker(MemoryManager& memory, ISearchPath& searchPath, AssetCreationContext& context);
[[nodiscard]] T6::GfxWorld* linkGfxWorld(const BSPData& bsp) const;
private:

View File

@@ -11,6 +11,7 @@ namespace BSP
{
public:
MapEntsLinker(MemoryManager& memory, ISearchPath& searchPath, AssetCreationContext& context);
[[nodiscard]] T6::MapEnts* linkMapEnts(const BSPData& bsp) const;
private:

View File

@@ -11,6 +11,7 @@ namespace BSP
{
public:
SkinnedVertsLinker(MemoryManager& memory, ISearchPath& searchPath, AssetCreationContext& context);
[[nodiscard]] T6::SkinnedVertsDef* linkSkinnedVerts(const BSPData& bsp) const;
private: