2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-07-03 06:18:11 +00:00

feat: add addon map ents dumper to T6 (#842)

* feat: add addon map ents dumper to T6

* Remove NOMINMAX

* docs: add addonmapents to t6 supported assets

---------

Co-authored-by: hindercanrun <109132519+meowica@users.noreply.github.com>
This commit is contained in:
Ash
2026-06-29 05:01:25 +08:00
committed by GitHub
parent 4017f084a8
commit 46e34b0036
6 changed files with 248 additions and 215 deletions
+9 -8
View File
@@ -1,7 +1,8 @@
# Supported Asset Types # Supported Asset Types
All asset types are supported to be loaded from other fastfiles in memory. All asset types are supported to be loaded from other fastfiles in memory.
The following section specify which assets are supported to be dumped to disk (using `Unlinker`) and loaded from disk (using `Linker`): The following section specify which assets are supported to be dumped to disk (using `Unlinker`) and loaded from disk (
using `Linker`):
- ❌ = Currently unsupported - ❌ = Currently unsupported
- ✅ = Supported - ✅ = Supported
@@ -10,7 +11,7 @@ The following section specify which assets are supported to be dumped to disk (u
## IW3 (Call of Duty 4: Modern Warfare) ## IW3 (Call of Duty 4: Modern Warfare)
| Asset Type | Dumping Support | Loading Support | Notes | | Asset Type | Dumping Support | Loading Support | Notes |
| -------------------- | --------------- | --------------- | ---------------------------------------------------------------------------- | |----------------------|-----------------|-----------------|------------------------------------------------------------------------------|
| PhysPreset | ✅ | ✅ | | | PhysPreset | ✅ | ✅ | |
| XAnimParts | ✅ | ✅ | | | XAnimParts | ✅ | ✅ | |
| XModel | ✅ | ✅ | Model data can be exported to `XMODEL_EXPORT/XMODEL_BIN`, `OBJ`, `GLB/GLTF`. | | XModel | ✅ | ✅ | Model data can be exported to `XMODEL_EXPORT/XMODEL_BIN`, `OBJ`, `GLB/GLTF`. |
@@ -40,7 +41,7 @@ The following section specify which assets are supported to be dumped to disk (u
## IW4 (Call of Duty: Modern Warfare 2) ## IW4 (Call of Duty: Modern Warfare 2)
| Asset Type | Dumping Support | Loading Support | Notes | | Asset Type | Dumping Support | Loading Support | Notes |
| ------------------------- | --------------- | --------------- | ---------------------------------------------------------------------------- | |---------------------------|-----------------|-----------------|------------------------------------------------------------------------------|
| PhysPreset | ✅ | ✅ | | | PhysPreset | ✅ | ✅ | |
| PhysCollmap | ❌ | ❌ | | | PhysCollmap | ❌ | ❌ | |
| XAnimParts | ✅ | ✅ | | | XAnimParts | ✅ | ✅ | |
@@ -80,7 +81,7 @@ The following section specify which assets are supported to be dumped to disk (u
## IW5 (Call of Duty: Modern Warfare 3) ## IW5 (Call of Duty: Modern Warfare 3)
| Asset Type | Dumping Support | Loading Support | Notes | | Asset Type | Dumping Support | Loading Support | Notes |
| ------------------------- | --------------- | --------------- | ------------------------------------------------------------------------------------------------------------- | |---------------------------|-----------------|-----------------|---------------------------------------------------------------------------------------------------------------|
| PhysPreset | ✅ | ✅ | | | PhysPreset | ✅ | ✅ | |
| PhysCollmap | ❌ | ❌ | | | PhysCollmap | ❌ | ❌ | |
| XAnimParts | ✅ | ✅ | | | XAnimParts | ✅ | ✅ | |
@@ -125,7 +126,7 @@ The following section specify which assets are supported to be dumped to disk (u
## T4 (Call of Duty: World at War) ## T4 (Call of Duty: World at War)
| Asset Type | Dumping Support | Loading Support | Notes | | Asset Type | Dumping Support | Loading Support | Notes |
| -------------------- | --------------- | --------------- | ---------------------------------------------------- | |----------------------|-----------------|-----------------|------------------------------------------------------------------------------|
| PhysPreset | ❌ | ❌ | | | PhysPreset | ❌ | ❌ | |
| PhysConstraints | ❌ | ❌ | | | PhysConstraints | ❌ | ❌ | |
| DestructibleDef | ❌ | ❌ | | | DestructibleDef | ❌ | ❌ | |
@@ -158,7 +159,7 @@ The following section specify which assets are supported to be dumped to disk (u
## T5 (Call of Duty: Black Ops) ## T5 (Call of Duty: Black Ops)
| Asset Type | Dumping Support | Loading Support | Notes | | Asset Type | Dumping Support | Loading Support | Notes |
| -------------------- | --------------- | --------------- | ---------------------------------------------------------------------------- | |----------------------|-----------------|-----------------|------------------------------------------------------------------------------|
| PhysPreset | ✅ | ✅ | | | PhysPreset | ✅ | ✅ | |
| PhysConstraints | ❌ | ❌ | | | PhysConstraints | ❌ | ❌ | |
| DestructibleDef | ❌ | ❌ | | | DestructibleDef | ❌ | ❌ | |
@@ -195,7 +196,7 @@ The following section specify which assets are supported to be dumped to disk (u
## T6 (Call of Duty: Black Ops II) ## T6 (Call of Duty: Black Ops II)
| Asset Type | Dumping Support | Loading Support | Notes | | Asset Type | Dumping Support | Loading Support | Notes |
| ---------------------- | --------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | |------------------------|-----------------|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| PhysPreset | ✅ | ✅ | | | PhysPreset | ✅ | ✅ | |
| PhysConstraints | ✅ | ✅ | | | PhysConstraints | ✅ | ✅ | |
| DestructibleDef | ❌ | ❌ | | | DestructibleDef | ❌ | ❌ | |
@@ -236,7 +237,7 @@ The following section specify which assets are supported to be dumped to disk (u
| KeyValuePairs | ✅ | ✅ | Is dumped/loaded as part of the `.zone` file. | | KeyValuePairs | ✅ | ✅ | Is dumped/loaded as part of the `.zone` file. |
| VehicleDef | ✅ | ✅ | | | VehicleDef | ✅ | ✅ | |
| MemoryBlock | ❌ | ❌ | | | MemoryBlock | ❌ | ❌ | |
| AddonMapEnts | | ❌ | | | AddonMapEnts | ⁉️ | ❌ | MapEnts String can be exported. Binary data currently not. |
| TracerDef | ✅ | ✅ | | | TracerDef | ✅ | ✅ | |
| SkinnedVertsDef | ❌ | ❌ | | | SkinnedVertsDef | ❌ | ❌ | |
| Qdb | ⁉️ | ⁉️ | Dumping/Loading is implemented as rawfiles. Their use is currently unknown. | | Qdb | ⁉️ | ⁉️ | Dumping/Loading is implemented as rawfiles. Their use is currently unknown. |
@@ -1,4 +1,3 @@
#define NOMINMAX
#include "AddonMapEntsDumperIW4.h" #include "AddonMapEntsDumperIW4.h"
#include <algorithm> #include <algorithm>
@@ -1,4 +1,3 @@
#define NOMINMAX
#include "AddonMapEntsDumperIW5.h" #include "AddonMapEntsDumperIW5.h"
#include <algorithm> #include <algorithm>
@@ -0,0 +1,20 @@
#include "AddonMapEntsDumperT6.h"
#include <algorithm>
using namespace T6;
namespace addon_map_ents
{
void DumperT6::DumpAsset(AssetDumpingContext& context, const XAssetInfo<AssetAddonMapEnts::Type>& asset)
{
const auto* addonMapEnts = asset.Asset();
const auto assetFile = context.OpenAssetFile(asset.m_name);
if (!assetFile)
return;
auto& stream = *assetFile;
stream.write(addonMapEnts->entityString, std::max(addonMapEnts->numEntityChars - 1, 0));
}
} // namespace addon_map_ents
@@ -0,0 +1,13 @@
#pragma once
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace addon_map_ents
{
class DumperT6 final : public AbstractAssetDumper<T6::AssetAddonMapEnts>
{
protected:
void DumpAsset(AssetDumpingContext& context, const XAssetInfo<T6::AssetAddonMapEnts::Type>& asset) override;
};
} // namespace addon_map_ents
+2 -1
View File
@@ -9,6 +9,7 @@
#include "Leaderboard/LeaderboardJsonDumperT6.h" #include "Leaderboard/LeaderboardJsonDumperT6.h"
#include "LightDef/LightDefDumperT6.h" #include "LightDef/LightDefDumperT6.h"
#include "Localize/LocalizeDumperT6.h" #include "Localize/LocalizeDumperT6.h"
#include "Maps/AddonMapEntsDumperT6.h"
#include "Maps/MapEntsDumperT6.h" #include "Maps/MapEntsDumperT6.h"
#include "PhysConstraints/PhysConstraintsInfoStringDumperT6.h" #include "PhysConstraints/PhysConstraintsInfoStringDumperT6.h"
#include "PhysPreset/PhysPresetInfoStringDumperT6.h" #include "PhysPreset/PhysPresetInfoStringDumperT6.h"
@@ -77,7 +78,7 @@ void ObjWriter::RegisterAssetDumpers(AssetDumpingContext& context)
// REGISTER_DUMPER(AssetDumperKeyValuePairs, m_key_value_pairs) // REGISTER_DUMPER(AssetDumperKeyValuePairs, m_key_value_pairs)
RegisterAssetDumper(std::make_unique<vehicle::DumperT6>()); RegisterAssetDumper(std::make_unique<vehicle::DumperT6>());
// REGISTER_DUMPER(AssetDumperMemoryBlock, m_memory_block) // REGISTER_DUMPER(AssetDumperMemoryBlock, m_memory_block)
// REGISTER_DUMPER(AssetDumperAddonMapEnts, m_addon_map_ents) RegisterAssetDumper(std::make_unique<addon_map_ents::DumperT6>());
RegisterAssetDumper(std::make_unique<tracer::DumperT6>()); RegisterAssetDumper(std::make_unique<tracer::DumperT6>());
// REGISTER_DUMPER(AssetDumperSkinnedVertsDef, m_skinned_verts) // REGISTER_DUMPER(AssetDumperSkinnedVertsDef, m_skinned_verts)
RegisterAssetDumper(std::make_unique<qdb::DumperT6>()); RegisterAssetDumper(std::make_unique<qdb::DumperT6>());