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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user