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

WIP fix, loading is currently not working correctly

This commit is contained in:
LJW-Dev
2025-07-07 23:54:05 +08:00
parent 59c3a8b116
commit 54114a96ae
9 changed files with 3413 additions and 1753 deletions

View File

@@ -1,3 +1,6 @@
#pragma once
#include <string> #include <string>
#define DYN_ENT_COUNT 0 #define DYN_ENT_COUNT 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,7 @@ using namespace T6;
namespace namespace
{ {
class CustomMapLoader final : public AssetCreator<AssetCustomMap> class CustomMapLoader final : public AssetCreator<AssetGfxWorld>
{ {
public: public:
CustomMapLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) CustomMapLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
@@ -32,7 +32,7 @@ namespace
return AssetCreationResult::Failure(); return AssetCreationResult::Failure();
// linker will add all the assets needed // linker will add all the assets needed
CustomMapLinker* linker = new CustomMapLinker(m_memory, m_search_path, m_zone); CustomMapLinker* linker = new CustomMapLinker(m_memory, m_search_path, m_zone, context);
bool result = linker->linkCustomMap(mapInfo); bool result = linker->linkCustomMap(mapInfo);
if (result) if (result)
@@ -50,7 +50,7 @@ namespace
namespace T6 namespace T6
{ {
std::unique_ptr<AssetCreator<AssetCustomMap>> CreateCustomMapLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone) std::unique_ptr<AssetCreator<AssetGfxWorld>> CreateCustomMapLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone)
{ {
return std::make_unique<CustomMapLoader>(memory, searchPath, zone); return std::make_unique<CustomMapLoader>(memory, searchPath, zone);
} }

View File

@@ -9,5 +9,5 @@
namespace T6 namespace T6
{ {
std::unique_ptr<AssetCreator<AssetCustomMap>> CreateCustomMapLoader(MemoryManager& memory, ISearchPath& searchPath); std::unique_ptr<AssetCreator<AssetGfxWorld>> CreateCustomMapLoader(MemoryManager& memory, ISearchPath& searchPath, Zone& zone);
} // namespace T6 } // namespace T6

View File

@@ -1,7 +1,7 @@
#include "ProjectCreator.h" #include "ProjectCreator.h"
class CustomMapLoader #include "OBJ_Loader.h"
{
void parseMesh(objl::Mesh* OBJMesh, worldSurface* meshSurface, customMapInfo* projInfo) void parseMesh(objl::Mesh* OBJMesh, worldSurface* meshSurface, customMapInfo* projInfo)
{ {
int meshVertexCount = OBJMesh->Vertices.size(); int meshVertexCount = OBJMesh->Vertices.size();
@@ -61,7 +61,7 @@ class CustomMapLoader
} }
} }
customMapInfo* createCustomMapInfo(std::string& projectName, ISearchPath& searchPath) customMapInfo* CustomMapInfo::createCustomMapInfo(std::string& projectName, ISearchPath& searchPath)
{ {
std::string objFilePath = searchPath.GetPath() + "custom_map/world.obj"; std::string objFilePath = searchPath.GetPath() + "custom_map/world.obj";
@@ -102,4 +102,4 @@ class CustomMapLoader
return projInfo; return projInfo;
} }
};

View File

@@ -1,13 +1,12 @@
#pragma once
#include "SearchPath/ISearchPath.h" #include "SearchPath/ISearchPath.h"
#include "Utils/MemoryManager.h" #include "Utils/MemoryManager.h"
#include "Game/T6/T6.h" #include "Game/T6/T6.h"
using namespace T6; using namespace T6;
#include "OBJ_Loader.h"
class CustomMapInfo class CustomMapInfo
{ {
public: public:
static void parseMesh(objl::Mesh* OBJMesh, worldSurface* meshSurface, customMapInfo* projInfo);
static customMapInfo* createCustomMapInfo(std::string& projectName, ISearchPath& searchPath); static customMapInfo* createCustomMapInfo(std::string& projectName, ISearchPath& searchPath);
}; };

View File

@@ -1,3 +1,6 @@
#pragma once
#include "Game/T6/T6.h" #include "Game/T6/T6.h"
using namespace T6; using namespace T6;

View File

@@ -389,7 +389,7 @@ namespace T6
collection.AddAssetCreator(std::make_unique<GlobalAssetPoolsLoader<AssetFootstepTable>>(zone)); collection.AddAssetCreator(std::make_unique<GlobalAssetPoolsLoader<AssetFootstepTable>>(zone));
collection.AddAssetCreator(std::make_unique<GlobalAssetPoolsLoader<AssetFootstepFxTable>>(zone)); collection.AddAssetCreator(std::make_unique<GlobalAssetPoolsLoader<AssetFootstepFxTable>>(zone));
collection.AddAssetCreator(std::make_unique<GlobalAssetPoolsLoader<AssetZBarrier>>(zone)); collection.AddAssetCreator(std::make_unique<GlobalAssetPoolsLoader<AssetZBarrier>>(zone));
collection.AddAssetCreator(std::make_unique<GlobalAssetPoolsLoader<AssetCustomMap>>(zone)); //collection.AddAssetCreator(std::make_unique<GlobalAssetPoolsLoader<AssetCustomMap>>(zone));
} }
void ConfigureLoaders(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt) void ConfigureLoaders(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath, IGdtQueryable& gdt)
@@ -451,7 +451,7 @@ namespace T6
collection.AddAssetCreator(CreateRawZBarrierLoader(memory, searchPath, zone)); collection.AddAssetCreator(CreateRawZBarrierLoader(memory, searchPath, zone));
collection.AddAssetCreator(CreateGdtZBarrierLoader(memory, searchPath, gdt, zone)); collection.AddAssetCreator(CreateGdtZBarrierLoader(memory, searchPath, gdt, zone));
collection.AddAssetCreator(CreateCustomMapLoader(memory, searchPath)); collection.AddAssetCreator(CreateCustomMapLoader(memory, searchPath, zone));
} }
} // namespace } // namespace