Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
aae112d
Added the ability to dump and load technique sets.
LJW-Dev Jul 7, 2025
c045d54
Initial commit of BSP compilation
LJW-Dev Jul 7, 2025
59c3a8b
merge extended techset functioanality
LJW-Dev Jul 7, 2025
54114a9
WIP fix, loading is currently not working correctly
LJW-Dev Jul 7, 2025
0a520b4
Fix: technqiues weren't opened with the proper file path.
LJW-Dev Jul 7, 2025
69a5651
Merge branch 't6-extend-techsets' into bsp-compilation
LJW-Dev Jul 7, 2025
ca4db1e
fix: more incorrect paths
LJW-Dev Jul 7, 2025
9941d02
Merge branch 't6-extend-techsets' into bsp-compilation
LJW-Dev Jul 7, 2025
a825bf9
all known bugs fixed and loaded maps work correctly now.
LJW-Dev Aug 28, 2025
f129874
V1 release of custom map code
LJW-Dev Oct 6, 2025
abf15e8
Failed test to make shadows work
LJW-Dev Oct 8, 2025
dd460a6
Second failed attempt at making shadows work
LJW-Dev Oct 8, 2025
b167044
remove GSC-Tool use
LJW-Dev Oct 8, 2025
94ccd96
Remove GSC-Tool 2
LJW-Dev Oct 8, 2025
0662f2a
Another refactor to clean up comments and code
LJW-Dev Oct 8, 2025
7dced5f
Update T6 json material loading to include JSON being passed directy …
LJW-Dev Oct 8, 2025
d302073
Another refactor to remove leacy code that isn't used anymore
LJW-Dev Oct 8, 2025
ce2aec3
Merge fixup
LJW-Dev Oct 8, 2025
249e642
Updated custom map objloading code to match new structure.
LJW-Dev Oct 8, 2025
8737fdf
Updated Json Material loader to support passing JSON instead of a str…
LJW-Dev Oct 8, 2025
3a5d9e7
Merge branch 'main' into bsp-compilation
LJW-Dev Oct 11, 2025
2906a9c
FIxed techset dumping and loading to be the same, as well as added a …
LJW-Dev Oct 11, 2025
1591850
Added a default entity string if the entity file isn't given
LJW-Dev Oct 11, 2025
e19a3a1
WIP: Updating code to follow laupentin's code review.
LJW-Dev Oct 20, 2025
7d09877
WIP:
LJW-Dev Oct 21, 2025
b4073d7
WIP:
LJW-Dev Oct 21, 2025
e537795
WIP:
LJW-Dev Oct 22, 2025
a81944a
WIP: Prepared project for updating CustomMapLinker.h
LJW-Dev Oct 22, 2025
948ba5b
WIP: Converted custom map linker into different asset files
LJW-Dev Oct 23, 2025
173565c
WIP: Finished updating BSP linker to use seperate files for each asset.
LJW-Dev Oct 24, 2025
9d4c32b
Refactor to improve C++ and safe code use
LJW-Dev Oct 26, 2025
fc88b9a
Refactored clipmap generation, further refactored other files to bett…
LJW-Dev Oct 27, 2025
9268342
Refactored GFX world loading
LJW-Dev Oct 27, 2025
0e19f36
Refactored to make x64 builds succeed
LJW-Dev Oct 27, 2025
0fa473e
Formatted all BSP loading files using clang.
LJW-Dev Oct 27, 2025
b054cfc
Updated missing image and colour only image asset names to use materi…
LJW-Dev Oct 31, 2025
208d305
CLANG formatted ObjLoaderT6
LJW-Dev Oct 31, 2025
eef269f
Added map type metadata parsing to zone file
LJW-Dev Nov 1, 2025
3d2e890
Added the zone definition to the parameters of ConfigureCreatorCollec…
LJW-Dev Nov 1, 2025
81e0331
Updated BSP linker to load assets on the FinalizeZone step.
LJW-Dev Nov 1, 2025
56186d1
The FinalizeZone step can now fail and the zone link will not ouput a…
LJW-Dev Nov 1, 2025
3948fea
Assets with a name starting with ',' will now be always loaded as a d…
LJW-Dev Nov 1, 2025
b7d629d
The linker should continue with building the fastfile if the asset li…
LJW-Dev Nov 1, 2025
323a882
Refactored files to use CLANG formatting and linux compatabillty.
LJW-Dev Nov 1, 2025
8bcefd9
Added ufbx to submodules.
LJW-Dev Nov 1, 2025
2199544
Added premake files for ufbx
LJW-Dev Nov 1, 2025
a8a8085
Updated ufbx premake lua to properly add it to the project
LJW-Dev Nov 1, 2025
fc0500e
Added ufbx as an ObjLoading include
LJW-Dev Nov 1, 2025
f7a36f9
WIP: Updated premake scripts, removed non-submodule ufbx code, ported…
LJW-Dev Nov 1, 2025
8007bb5
Fixed missing parameter in the ufbx premake script causing the build …
LJW-Dev Nov 4, 2025
b7162d6
Undo changes to JsonMaterialLoader as they are no longer needed.
LJW-Dev Nov 4, 2025
e88f064
Merge branch 'main' into bsp-compilation
LJW-Dev Nov 4, 2025
e4f6e19
Moved coordinate conversion to BSP creator instead of the BSP linker,…
LJW-Dev Nov 4, 2025
6cd89a3
Extended BSP creation to support X, Y and Z splitting and simplified …
LJW-Dev Nov 4, 2025
0f70c29
Fixed a crash related to AABB Tree children counts exceeding the maxi…
LJW-Dev Nov 4, 2025
c9aa8e3
Moved the re-ordering of indices to the BSP creator instead of the BS…
LJW-Dev Nov 4, 2025
dac9438
wip: map file format now uses gltf instead of fbx
LJW-Dev Jan 28, 2026
984f461
Vertex position is now transformed by node transform.
LJW-Dev Feb 4, 2026
f600b35
Added tangent and binormal calculation, corrected scale, rotate and t…
LJW-Dev Feb 7, 2026
869724b
Extended and fixed various GFXWorld linking code
LJW-Dev Feb 7, 2026
55c515c
Minor clipmap improvements
LJW-Dev Feb 7, 2026
07392a8
Minor improvements to GFX linker
LJW-Dev Feb 8, 2026
382e199
Bux fixes for the clipmap linker
LJW-Dev Feb 8, 2026
a9e5e6a
Clipmap linking improvements and bug fix
LJW-Dev Feb 8, 2026
3d7adbc
Materials now have their own vector and are acessed via indexes
LJW-Dev Feb 10, 2026
b7943db
WIP unique tree for each material type
LJW-Dev Feb 11, 2026
98a873a
Fixed various warning messages
LJW-Dev Feb 11, 2026
3387792
Minor fixes
LJW-Dev Feb 12, 2026
cb9976c
Fixed incorrect order of operations during vertex matrix creation
LJW-Dev Feb 12, 2026
2904a40
Clipmap linker refactor, and AABB trees are seperated by material now.
LJW-Dev Feb 16, 2026
5e5d5ad
feat: WIP add lights to the scene
LJW-Dev Feb 23, 2026
0398a65
GLTF loader now has support for the punctual lights extension
LJW-Dev Mar 5, 2026
1cb764f
Spot lights now are fully implemented, with omni and directional not …
LJW-Dev Mar 7, 2026
75e35cf
Extended GLTF classes to support: material colours, and images buffer…
LJW-Dev Mar 16, 2026
cab2bcc
BSP creator now reads colour data from materials and applies them to …
LJW-Dev Mar 16, 2026
e0afd24
Refactored light direction calculation.
LJW-Dev Mar 16, 2026
fc5dd21
BSP creator now loads seperate graphics and collision data.
LJW-Dev Mar 17, 2026
658ba2e
feat: add gltf extras to node schema
LJW-Dev Mar 17, 2026
44186a3
feat: spawn points are now defined in the GLTF file using custom prop…
LJW-Dev Mar 18, 2026
c7835de
fix to bsp materials so they require a name
LJW-Dev Mar 18, 2026
2782d0f
feat: load xmodels from GLTF and link them, xmodel collision not work…
LJW-Dev Mar 20, 2026
f32ff26
fixed error handling for xmodels and materials, and updated xmodel li…
LJW-Dev Mar 20, 2026
57ded3d
feat: surface type and flags can now be set through the GLTF file
LJW-Dev Mar 21, 2026
1870190
feat: moved surface type to material extras, and surface flags to the…
LJW-Dev Mar 22, 2026
86fe4c6
fix: gfx linker was not drawing the last surface in the surface array
LJW-Dev Mar 22, 2026
dd0706a
feat: clipmap linker now has support for maps smaller than the minimu…
LJW-Dev Mar 22, 2026
9d95d82
fix: clipmap AABB generation skipped first object
LJW-Dev Mar 22, 2026
5f98ea4
feat: Added console print when no spawns were found
LJW-Dev Mar 22, 2026
b9c1094
feat: gfxworld now uses surface flags for surfaces
LJW-Dev Mar 22, 2026
c6bb376
feat: xmodles have toggleable shadows
LJW-Dev Mar 22, 2026
45d3ea1
feat: pathnodes are added through the GLTF file
LJW-Dev Mar 22, 2026
6ec63b0
chore: replace "new" keyword with correct memory allocation
LJW-Dev Mar 22, 2026
73412f9
feat: set basic lightmap for xmodels
LJW-Dev Mar 22, 2026
1eddd22
chorse: groundwork for implementing zombies maps
LJW-Dev Mar 23, 2026
d024223
Addition of zombie spawns, player spawns and zones for zombies. Clipm…
LJW-Dev Mar 27, 2026
30b14b6
Zombies GLTF
LJW-Dev Mar 29, 2026
1660e92
chore: various minor additions
LJW-Dev Mar 29, 2026
8cd7ef3
Minor additions to BSP Creator
LJW-Dev Mar 30, 2026
e97917b
rename castSunShadow flag back to onlyCastShadow
LJW-Dev Apr 8, 2026
4eb56f6
chore: Remove unused dependency ufbx
LJW-Dev Apr 10, 2026
6591a62
fix: incorrect flag name
LJW-Dev Apr 10, 2026
a8d7c42
refactor: better implementation of static and script surfaces
LJW-Dev Apr 13, 2026
e96f048
chore: removed unused code comments
LJW-Dev Apr 13, 2026
3f87af7
feat: zone volumes now use brushes instead of terrain to define their…
LJW-Dev Apr 13, 2026
1d0d351
feat: trigger_use and trigger_multiple can now be loaded through GLTF
LJW-Dev Apr 14, 2026
501ac56
feat: fully customisable entities through gltf
LJW-Dev Apr 15, 2026
bd0f645
fix: uppercase flag name
LJW-Dev Apr 17, 2026
63af3c8
refactor: minor improvements to bsp creation
LJW-Dev Apr 17, 2026
0a873b3
feat: heirarchical transforms are now implemented
LJW-Dev Apr 18, 2026
a4bc88e
fix: slight update to lightgrid after new info found
LJW-Dev Apr 19, 2026
87d9c8b
chore: cleanup and minor addition
LJW-Dev Apr 19, 2026
d758211
feat: script_brushmodel now works correctly
LJW-Dev Apr 19, 2026
4ee10a9
feat: minor bug fixes
LJW-Dev Apr 19, 2026
398b430
fix: always make an a material a textured one
LJW-Dev Apr 19, 2026
18aaa33
feat: Loading sun data through GLTF
LJW-Dev Apr 22, 2026
2cf5208
feat: proper imlementation of spot lights
LJW-Dev Apr 22, 2026
9e6c76f
feat: Minor fixups and improvements
LJW-Dev Apr 23, 2026
6e04b4b
feat: removed ents file, worldspawn and intermission are added throug…
LJW-Dev Apr 23, 2026
935db3f
feat: removed outdoor imagem dependency
LJW-Dev Apr 23, 2026
83dae99
feat: proper implementation of GFX models and refactor of node ignore…
LJW-Dev Apr 23, 2026
682af9e
feat: use xmodels to calculate skinnedverts
LJW-Dev Apr 23, 2026
29f6ae2
refactor: remove extra classes from BSP.h and move vars to their resp…
LJW-Dev Apr 23, 2026
0f5426e
refactor: simplified brushmodels - gfx uses tris, col uses brushes only
LJW-Dev Apr 25, 2026
cf54f23
feat: fixed models flickering and not being drawn due to skinned verts
LJW-Dev Apr 27, 2026
8251096
chore: updated default images to look nicer ingame
LJW-Dev Apr 27, 2026
d27379a
fix: better ignore/allow for meshes and classes when loading gltf
LJW-Dev Apr 29, 2026
f9d8b21
feat: better filtering for xmodels
LJW-Dev Apr 30, 2026
36b6769
chore: refactored node filtering
LJW-Dev Apr 30, 2026
e4fb8b4
chore: added many bound checks to prevent integer overflows and game …
LJW-Dev Apr 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 63 additions & 3 deletions src/Common/Game/T6/T6_Assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -1246,13 +1246,13 @@ namespace T6

struct GfxWorldVertexData0
{
byte128* data;
byte128* data; // GfxPackedWorldVertex
void /*ID3D11Buffer*/* vb;
};

struct GfxWorldVertexData1
{
byte128* data;
byte128* data; // GfxPackedWorldVertex
void /*ID3D11Buffer*/* vb;
};

Expand All @@ -1278,6 +1278,16 @@ namespace T6
typedef tdef_align32(4) char aligned_byte_pointer;
typedef tdef_align32(4) GfxCompressedLightGridCoeffs GfxCompressedLightGridCoeffs_align4;

struct GfxLightGridRow
{
uint16_t colStart;
uint16_t colCount;
uint16_t zStart;
uint16_t zCount;
unsigned int firstEntry;
char lookupTable[1]; // The lookup table has a variable length
};

struct GfxLightGrid
{
unsigned int sunPrimaryLightIndex;
Expand All @@ -1288,7 +1298,7 @@ namespace T6
unsigned int colAxis;
uint16_t* rowDataStart;
unsigned int rawRowDataSize;
aligned_byte_pointer* rawRowData;
aligned_byte_pointer* rawRowData; // GfxLightGridRow
unsigned int entryCount;
GfxLightGridEntry* entries;
unsigned int colorCount;
Expand Down Expand Up @@ -3898,6 +3908,17 @@ namespace T6
int baseIndex;
};

enum GfxSurfaceFlags
{
GFX_SURFACE_CASTS_SUN_SHADOW = 0x1,
GFX_SURFACE_HAS_PRIMARY_LIGHT_CONFLICT = 0x2,
GFX_SURFACE_IS_SKY = 0x4,
GFX_SURFACE_NO_DRAW = 0x8,
GFX_SURFACE_CASTS_SHADOW = 0x10,
GFX_SURFACE_QUANTIZED = 0x20,
GFX_SURFACE_NO_COLOR = 0x40
};

struct type_align32(16) GfxSurface
{
srfTriangles_t tris;
Expand Down Expand Up @@ -3930,6 +3951,12 @@ namespace T6
uint16_t numLmapVertexColors;
};

enum StaticModelFlag
{
STATIC_MODEL_FLAG_NO_SHADOW = 0x1,
STATIC_MODEL_FLAG_LIGHTMAP_VC = 0x2,
};

struct GfxStaticModelDrawInst
{
float cullDist;
Expand Down Expand Up @@ -5728,6 +5755,11 @@ namespace T6
unsigned int packed;
};

union PackedLmapCoords
{
unsigned int packed;
};

struct type_align(16) GfxPackedVertex
{
vec3_t xyz;
Expand All @@ -5738,6 +5770,17 @@ namespace T6
PackedUnitVec tangent;
};

struct GfxPackedWorldVertex
{
vec3_t xyz;
float binormalSign;
GfxColor color;
PackedTexCoords texCoord;
PackedUnitVec normal;
PackedUnitVec tangent;
PackedLmapCoords lmapCoord;
};

struct XRigidVertList
{
uint16_t boneOffset;
Expand Down Expand Up @@ -7053,6 +7096,23 @@ namespace T6
char* stringValue;
};

enum GfxLightType
{
GFX_LIGHT_TYPE_NONE = 0x0,
GFX_LIGHT_TYPE_DIR = 0x1,
GFX_LIGHT_TYPE_SPOT = 0x2,
GFX_LIGHT_TYPE_SPOT_SQUARE = 0x3,
GFX_LIGHT_TYPE_SPOT_ROUND = 0x4,
GFX_LIGHT_TYPE_OMNI = 0x5,
GFX_LIGHT_TYPE_COUNT = 0x6,
GFX_LIGHT_TYPE_DIR_SHADOWMAP = 0x6,
GFX_LIGHT_TYPE_SPOT_SHADOWMAP = 0x7,
GFX_LIGHT_TYPE_SPOT_SQUARE_SHADOWMAP = 0x8,
GFX_LIGHT_TYPE_SPOT_ROUND_SHADOWMAP = 0x9,
GFX_LIGHT_TYPE_OMNI_SHADOWMAP = 0xA,
GFX_LIGHT_TYPE_COUNT_WITH_SHADOWMAP_VERSIONS = 0xB,
};

#ifndef __zonecodegenerator
} // namespace T6
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/Linker/Linker.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "Linker.h"

#include "LinkerArgs.h"
#include "LinkerPaths.h"
#include "ObjContainer/SoundBank/SoundBankWriter.h"
Expand Down Expand Up @@ -330,7 +329,7 @@ class LinkerImpl final : public Linker

PathGameContext gameContext(paths, projectName, zoneDefinition->m_game);

if (!zoneDefinition->m_assets.empty())
if (!zoneDefinition->m_assets.empty() || zoneDefinition->m_map_type != ZoneDefinitionMapType::NONE)
{
if (!BuildFastFile(paths, projectName, targetName, *zoneDefinition))
return false;
Expand Down
5 changes: 3 additions & 2 deletions src/Linker/ZoneCreation/ZoneCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace zone_creator
OutputPathFilesystem cacheDir(context.m_cache_dir);
objCompiler->ConfigureCreatorCollection(
creatorCollection, *zone, zoneDefinitionContext, *context.m_asset_search_path, lookup, creationContext, outDir, cacheDir);
objLoader->ConfigureCreatorCollection(creatorCollection, *zone, *context.m_asset_search_path, lookup);
objLoader->ConfigureCreatorCollection(creatorCollection, *zone, *context.m_asset_search_path, lookup, *context.m_definition);

for (const auto& assetEntry : context.m_definition->m_assets)
{
Expand All @@ -84,7 +84,8 @@ namespace zone_creator
++zoneDefinitionContext.m_asset_index_in_definition;
}

creatorCollection.FinalizeZone(creationContext);
if (!creatorCollection.FinalizeZone(creationContext))
return nullptr;

return zone;
}
Expand Down
96 changes: 91 additions & 5 deletions src/ObjCommon/XModel/Gltf/JsonGltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,74 @@ namespace gltf

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonAsset, version, generator);

class JsonPunctualSpotLightProperties
{
public:
std::optional<float> innerConeAngle;
std::optional<float> outerConeAngle;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPunctualSpotLightProperties, innerConeAngle, outerConeAngle);

enum class JsonPunctualLightType
{
DIRECTIONAL,
POINT,
SPOT
};

NLOHMANN_JSON_SERIALIZE_ENUM(JsonPunctualLightType,
{
{JsonPunctualLightType::DIRECTIONAL, "directional"},
{JsonPunctualLightType::POINT, "point" },
{JsonPunctualLightType::SPOT, "spot" },
});

class JsonPunctualLight
{
public:
std::optional<std::array<float, 3>> color;
std::optional<float> intensity;
std::optional<std::string> name;
std::optional<float> range;
std::optional<JsonPunctualSpotLightProperties> spot;
JsonPunctualLightType type;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPunctualLight, color, intensity, name, range, spot, type);

class JsonPunctualLightsExt
{
public:
std::optional<std::vector<JsonPunctualLight>> lights;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPunctualLightsExt, lights);

class JsonExtension
{
public:
std::optional<JsonPunctualLightsExt> KHR_lights_punctual;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonExtension, KHR_lights_punctual);

class JsonPunctualLightIndex
{
public:
int light;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPunctualLightIndex, light);

class JsonNodeExtension
{
public:
std::optional<JsonPunctualLightIndex> KHR_lights_punctual;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonNodeExtension, KHR_lights_punctual);

class JsonNode
{
public:
Expand All @@ -29,9 +97,12 @@ namespace gltf
std::optional<std::vector<unsigned>> children;
std::optional<unsigned> skin;
std::optional<unsigned> mesh;

std::optional<JsonNodeExtension> extensions;
std::optional<nlohmann::json> extras;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonNode, name, translation, rotation, scale, matrix, children, skin, mesh);
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonNode, name, translation, rotation, scale, matrix, children, skin, mesh, extensions, extras);

class JsonBuffer
{
Expand Down Expand Up @@ -207,10 +278,11 @@ namespace gltf
{
public:
std::optional<JsonTextureInfo> baseColorTexture;
std::optional<std::array<float, 4>> baseColorFactor;
std::optional<float> metallicFactor;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPbrMetallicRoughness, baseColorTexture, metallicFactor);
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonPbrMetallicRoughness, baseColorTexture, baseColorFactor, metallicFactor);

class JsonNormalTextureInfo
{
Expand All @@ -220,16 +292,26 @@ namespace gltf

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonNormalTextureInfo, index);

class JsonMaterialExtras
{
public:
std::optional<std::string> type;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonMaterialExtras, type);

class JsonMaterial
{
public:
std::optional<std::string> name;
std::optional<JsonPbrMetallicRoughness> pbrMetallicRoughness;
std::optional<JsonNormalTextureInfo> normalTexture;
std::optional<bool> doubleSided;

std::optional<JsonMaterialExtras> extras;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonMaterial, name, pbrMetallicRoughness, normalTexture, doubleSided);
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonMaterial, name, pbrMetallicRoughness, normalTexture, doubleSided, extras);

enum class JsonMeshPrimitivesMode
{
Expand Down Expand Up @@ -318,9 +400,12 @@ namespace gltf
{
public:
std::optional<std::string> uri;

std::optional<unsigned int> bufferView;
std::optional<std::string> mimeType;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(JsonImage, uri);
NLOHMANN_DEFINE_TYPE_EXTENSION(JsonImage, uri, bufferView, mimeType);

class JsonRoot
{
Expand All @@ -338,8 +423,9 @@ namespace gltf
std::optional<unsigned> scene;
std::optional<std::vector<JsonScene>> scenes;
std::optional<std::vector<JsonTexture>> textures;
std::optional<JsonExtension> extensions;
};

NLOHMANN_DEFINE_TYPE_EXTENSION(
JsonRoot, accessors, animations, asset, buffers, bufferViews, images, materials, meshes, nodes, skins, scene, scenes, textures);
JsonRoot, accessors, animations, asset, buffers, bufferViews, images, materials, meshes, nodes, skins, scene, scenes, textures, extensions);
} // namespace gltf
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ namespace
return AssetCreationResult::NoAction();
}

void FinalizeZone(AssetCreationContext& context) override
bool FinalizeZone(AssetCreationContext& context) override
{
m_kvp_creator.Finalize(m_zone_definition);
const auto commonKvps = m_kvp_creator.GetFinalKeyValuePairs();
if (commonKvps.empty())
return;
return true;

auto* gameKvps = m_memory.Alloc<KeyValuePairs>();
gameKvps->name = m_memory.Dup(m_zone.m_name.c_str());
Expand All @@ -61,6 +61,8 @@ namespace
}

context.AddAsset(AssetRegistration<AssetKeyValuePairs>(m_zone.m_name, gameKvps));

return true;
}

private:
Expand Down
2 changes: 1 addition & 1 deletion src/ObjLoading.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ function ObjLoading:project()
eigen:include(includes)
json:include(includes)
libtomcrypt:include(includes)
end
end
3 changes: 3 additions & 0 deletions src/ObjLoading/Asset/AssetCreationContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ XAssetInfoGeneric* AssetCreationContext::LoadDependencyGeneric(const asset_type_
return LoadDefaultAssetDependency(assetType, std::format(",{}", assetName));
}

if (assetName.starts_with(','))
return LoadDefaultAssetDependency(assetType, assetName);

if (m_ignored_asset_lookup->IsAssetIgnored(assetType, assetName))
return LoadDefaultAssetDependency(assetType, std::format(",{}", assetName));

Expand Down
9 changes: 7 additions & 2 deletions src/ObjLoading/Asset/AssetCreatorCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,15 @@ AssetCreationResult AssetCreatorCollection::CreateDefaultAsset(const asset_type_
return AssetCreationResult::NoAction();
}

void AssetCreatorCollection::FinalizeZone(AssetCreationContext& context) const
bool AssetCreatorCollection::FinalizeZone(AssetCreationContext& context) const
{
for (const auto& creator : m_asset_creators)
creator->FinalizeZone(context);
{
if (!creator->FinalizeZone(context))
return false;
}
for (const auto& postProcessor : m_asset_post_processors)
postProcessor->FinalizeZone(context);

return true;
}
2 changes: 1 addition & 1 deletion src/ObjLoading/Asset/AssetCreatorCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AssetCreatorCollection

AssetCreationResult CreateAsset(asset_type_t assetType, const std::string& assetName, AssetCreationContext& context) const;
AssetCreationResult CreateDefaultAsset(asset_type_t assetType, const std::string& assetName, AssetCreationContext& context) const;
void FinalizeZone(AssetCreationContext& context) const;
bool FinalizeZone(AssetCreationContext& context) const;

private:
std::vector<std::vector<IAssetCreator*>> m_asset_creators_by_type;
Expand Down
5 changes: 4 additions & 1 deletion src/ObjLoading/Asset/IAssetCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ class IAssetCreator
[[nodiscard]] virtual std::optional<asset_type_t> GetHandlingAssetType() const = 0;
virtual AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) = 0;

virtual void FinalizeZone(AssetCreationContext& context) {}
virtual bool FinalizeZone(AssetCreationContext& context)
{
return true;
};
};

template<typename AssetType> class AssetCreator : public IAssetCreator
Expand Down
Loading