2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-23 21:22:07 +00:00

all known bugs fixed and loaded maps work correctly now.

This commit is contained in:
LJW-Dev
2025-08-28 23:34:06 +08:00
parent 9941d02bcc
commit a825bf965b
16 changed files with 40189 additions and 356 deletions

View File

@@ -22,21 +22,32 @@ namespace
AssetCreationResult CreateAsset(const std::string& assetName, AssetCreationContext& context) override
{
auto mapFile = m_search_path.Open("custom_map/map.obj");
if (!mapFile.IsOpen())
auto mapGfxFile = m_search_path.Open("custom_map/map_gfx.fbx");
if (!mapGfxFile.IsOpen())
return AssetCreationResult::NoAction();
printf("Loading map data...\n");
// create map info from the obj file
customMapInfo* mapInfo = CustomMapInfo::createCustomMapInfo(m_zone.m_name, m_search_path);
if (mapInfo == NULL)
return AssetCreationResult::Failure();
printf("Creating map from data...\n");
// linker will add all the assets needed
CustomMapLinker* linker = new CustomMapLinker(m_memory, m_search_path, m_zone, context);
bool result = linker->linkCustomMap(mapInfo);
//auto gfxWorldAsset = context.LoadDependency<AssetFootstepTable>("default_1st_person");
//return AssetCreationResult::Success(gfxWorldAsset);
if (result)
return AssetCreationResult::NoAction();
{
auto gfxWorldAsset = context.LoadDependency<AssetGfxWorld>(mapInfo->bspName);
_ASSERT(gfxWorldAsset != NULL);
return AssetCreationResult::Success(gfxWorldAsset);
}
else
return AssetCreationResult::Failure();
}