mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-06-27 03:18:17 +00:00
feat: initial T4 support (#807)
* feat: initial T4 support * chore: adjust t4 symbols a bit for accuracy * chore: add PackIndex asset to T4 * chore: remove unused AssetXModelPieces * chore: add default and global asset pools loader for T4 * chore: use separate defines for T4 in ImageDumper * chore: remove unnecessary namespaces in gfximage_actions * chore: small things * chore: fix T4 PhysPreset type * chore: use proper XQuat2 type for T4 xanims * chore: fix errors on T4 types * chore: use iw3 like struct for XModelStreamInfo * docs: add basic docs for T4 * chore: add basic ObjCompiler setup for T4 * chore: adjust loaded sound definition * chore: make sure t4 material has the correct alignment * chore: make sure t4 uses similar names for assets as other games * fix: asset references should not be reusable * chore: add content writer for t4 * feat: add t4 localize loader * chore: reorder game ids to be alphabetically ordered --------- Co-authored-by: Jan Laupetin <jan@laupetin.net>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#include "ObjCompilerT4.h"
|
||||
|
||||
#include "Game/T4/T4.h"
|
||||
#include "Image/ImageIwdPostProcessor.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace T4;
|
||||
|
||||
namespace
|
||||
{
|
||||
void ConfigureCompilers(AssetCreatorCollection& collection, Zone& zone, ISearchPath& searchPath) {}
|
||||
|
||||
void ConfigurePostProcessors(AssetCreatorCollection& collection,
|
||||
Zone& zone,
|
||||
const ZoneDefinitionContext& zoneDefinition,
|
||||
ISearchPath& searchPath,
|
||||
ZoneAssetCreationStateContainer& zoneStates,
|
||||
IOutputPath& outDir)
|
||||
{
|
||||
auto& memory = zone.Memory();
|
||||
|
||||
if (image::IwdPostProcessor<AssetImage>::AppliesToZoneDefinition(zoneDefinition))
|
||||
collection.AddAssetPostProcessor(std::make_unique<image::IwdPostProcessor<AssetImage>>(zoneDefinition, searchPath, zoneStates, outDir));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void ObjCompiler::ConfigureCreatorCollection(AssetCreatorCollection& collection,
|
||||
Zone& zone,
|
||||
const ZoneDefinitionContext& zoneDefinition,
|
||||
ISearchPath& searchPath,
|
||||
IGdtQueryable& gdt,
|
||||
ZoneAssetCreationStateContainer& zoneStates,
|
||||
IOutputPath& outDir,
|
||||
IOutputPath& cacheDir) const
|
||||
{
|
||||
ConfigureCompilers(collection, zone, searchPath);
|
||||
ConfigurePostProcessors(collection, zone, zoneDefinition, searchPath, zoneStates, outDir);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "IObjCompiler.h"
|
||||
|
||||
namespace T4
|
||||
{
|
||||
class ObjCompiler final : public IObjCompiler
|
||||
{
|
||||
public:
|
||||
void ConfigureCreatorCollection(AssetCreatorCollection& collection,
|
||||
Zone& zone,
|
||||
const ZoneDefinitionContext& zoneDefinition,
|
||||
ISearchPath& searchPath,
|
||||
IGdtQueryable& gdt,
|
||||
ZoneAssetCreationStateContainer& zoneStates,
|
||||
IOutputPath& outDir,
|
||||
IOutputPath& cacheDir) const override;
|
||||
};
|
||||
} // namespace T4
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Game/IW3/ObjCompilerIW3.h"
|
||||
#include "Game/IW4/ObjCompilerIW4.h"
|
||||
#include "Game/IW5/ObjCompilerIW5.h"
|
||||
#include "Game/T4/ObjCompilerT4.h"
|
||||
#include "Game/T5/ObjCompilerT5.h"
|
||||
#include "Game/T6/ObjCompilerT6.h"
|
||||
|
||||
@@ -10,10 +11,11 @@
|
||||
|
||||
const IObjCompiler* IObjCompiler::GetObjCompilerForGame(GameId game)
|
||||
{
|
||||
static const IObjCompiler* objCompilers[static_cast<unsigned>(GameId::COUNT)]{
|
||||
static const IObjCompiler* objCompilers[]{
|
||||
new IW3::ObjCompiler(),
|
||||
new IW4::ObjCompiler(),
|
||||
new IW5::ObjCompiler(),
|
||||
new T4::ObjCompiler(),
|
||||
new T5::ObjCompiler(),
|
||||
new T6::ObjCompiler(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user