mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
Reformat code with clang format
This commit is contained in:
@ -1,8 +1,5 @@
|
||||
#include "ContentWriterIW3.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
#include "Game/IW3/XAssets/clipmap_t/clipmap_t_write_db.h"
|
||||
#include "Game/IW3/XAssets/comworld/comworld_write_db.h"
|
||||
#include "Game/IW3/XAssets/font_s/font_s_write_db.h"
|
||||
@ -28,9 +25,11 @@
|
||||
#include "Game/IW3/XAssets/weapondef/weapondef_write_db.h"
|
||||
#include "Game/IW3/XAssets/xanimparts/xanimparts_write_db.h"
|
||||
#include "Game/IW3/XAssets/xmodel/xmodel_write_db.h"
|
||||
|
||||
#include "Writing/WritingException.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
ContentWriter::ContentWriter()
|
||||
@ -100,15 +99,15 @@ void ContentWriter::WriteScriptStringList(const bool atStreamStart)
|
||||
|
||||
void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
{
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define SKIP_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define SKIP_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
break;
|
||||
|
||||
assert(varXAsset != nullptr);
|
||||
@ -118,40 +117,40 @@ void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
|
||||
switch (varXAsset->type)
|
||||
{
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, snd_alias_list_t, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_CURVE, SndCurve, sndCurve)
|
||||
WRITE_ASSET(ASSET_TYPE_LOADED_SOUND, LoadedSound, loadSnd)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_PVS, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_SP, GameWorldSp, gameWorldSp)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_MP, GameWorldMp, gameWorldMp)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponDef, weapon)
|
||||
SKIP_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, SndDriverGlobals, sndDriverGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, snd_alias_list_t, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_CURVE, SndCurve, sndCurve)
|
||||
WRITE_ASSET(ASSET_TYPE_LOADED_SOUND, LoadedSound, loadSnd)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_PVS, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_SP, GameWorldSp, gameWorldSp)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_MP, GameWorldMp, gameWorldMp)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponDef, weapon)
|
||||
SKIP_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, SndDriverGlobals, sndDriverGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
|
||||
default:
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
}
|
||||
|
||||
#undef WRITE_ASSET
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "Game/IW3/IW3.h"
|
||||
#include "Writing/ContentWriterBase.h"
|
||||
#include "Writing/IContentWritingEntryPoint.h"
|
||||
#include "Game/IW3/IW3.h"
|
||||
|
||||
namespace IW3
|
||||
{
|
||||
@ -23,4 +23,4 @@ namespace IW3
|
||||
|
||||
void WriteContent(Zone* zone, IZoneOutputStream* stream) override;
|
||||
};
|
||||
}
|
||||
} // namespace IW3
|
||||
|
@ -1,10 +1,8 @@
|
||||
#include "ZoneWriterFactoryIW3.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "ContentWriterIW3.h"
|
||||
#include "Game/IW3/IW3.h"
|
||||
#include "Game/IW3/GameIW3.h"
|
||||
#include "Game/IW3/IW3.h"
|
||||
#include "Game/IW3/ZoneConstantsIW3.h"
|
||||
#include "Writing/Processor/OutputProcessorDeflate.h"
|
||||
#include "Writing/Steps/StepAddOutputProcessor.h"
|
||||
@ -14,6 +12,8 @@
|
||||
#include "Writing/Steps/StepWriteZoneHeader.h"
|
||||
#include "Writing/Steps/StepWriteZoneSizes.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
class ZoneWriterFactory::Impl
|
||||
@ -24,7 +24,7 @@ class ZoneWriterFactory::Impl
|
||||
public:
|
||||
explicit Impl(Zone* zone)
|
||||
: m_zone(zone),
|
||||
m_writer(std::make_unique<ZoneWriter>())
|
||||
m_writer(std::make_unique<ZoneWriter>())
|
||||
{
|
||||
}
|
||||
|
||||
@ -58,7 +58,8 @@ public:
|
||||
{
|
||||
SetupBlocks();
|
||||
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(
|
||||
std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto* contentInMemoryPtr = contentInMemory.get();
|
||||
m_writer->AddWritingStep(std::move(contentInMemory));
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Writing/IZoneWriterFactory.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW3
|
||||
{
|
||||
class ZoneWriterFactory final : public IZoneWriterFactory
|
||||
@ -14,4 +14,4 @@ namespace IW3
|
||||
_NODISCARD bool SupportsZone(Zone* zone) const override;
|
||||
_NODISCARD std::unique_ptr<ZoneWriter> CreateWriter(Zone* zone) const override;
|
||||
};
|
||||
}
|
||||
} // namespace IW3
|
||||
|
@ -1,8 +1,5 @@
|
||||
#include "ContentWriterIW4.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
#include "Game/IW4/XAssets/addonmapents/addonmapents_write_db.h"
|
||||
#include "Game/IW4/XAssets/clipmap_t/clipmap_t_write_db.h"
|
||||
#include "Game/IW4/XAssets/comworld/comworld_write_db.h"
|
||||
@ -38,9 +35,11 @@
|
||||
#include "Game/IW4/XAssets/weaponcompletedef/weaponcompletedef_write_db.h"
|
||||
#include "Game/IW4/XAssets/xanimparts/xanimparts_write_db.h"
|
||||
#include "Game/IW4/XAssets/xmodel/xmodel_write_db.h"
|
||||
|
||||
#include "Writing/WritingException.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
ContentWriter::ContentWriter()
|
||||
@ -110,15 +109,15 @@ void ContentWriter::WriteScriptStringList(const bool atStreamStart)
|
||||
|
||||
void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
{
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define SKIP_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define SKIP_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
break;
|
||||
|
||||
assert(varXAsset != nullptr);
|
||||
@ -128,50 +127,50 @@ void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
|
||||
switch (varXAsset->type)
|
||||
{
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSCOLLMAP, PhysCollmap, physCollmap)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_PIXELSHADER, MaterialPixelShader, pixelShader)
|
||||
WRITE_ASSET(ASSET_TYPE_VERTEXSHADER, MaterialVertexShader, vertexShader)
|
||||
WRITE_ASSET(ASSET_TYPE_VERTEXDECL, MaterialVertexDeclaration, vertexDecl)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, snd_alias_list_t, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_CURVE, SndCurve, sndCurve)
|
||||
WRITE_ASSET(ASSET_TYPE_LOADED_SOUND, LoadedSound, loadSnd)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_SP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_MP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_SP, GameWorldSp, gameWorldSp)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_MP, GameWorldMp, gameWorldMp)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_FXWORLD, FxWorld, fxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponCompleteDef, weapon)
|
||||
SKIP_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, SndDriverGlobals, sndDriverGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_LEADERBOARD, LeaderboardDef, leaderboardDef)
|
||||
WRITE_ASSET(ASSET_TYPE_STRUCTURED_DATA_DEF, StructuredDataDefSet, structuredDataDefSet)
|
||||
WRITE_ASSET(ASSET_TYPE_TRACER, TracerDef, tracerDef)
|
||||
WRITE_ASSET(ASSET_TYPE_VEHICLE, VehicleDef, vehDef)
|
||||
WRITE_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, AddonMapEnts, addonMapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSCOLLMAP, PhysCollmap, physCollmap)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_PIXELSHADER, MaterialPixelShader, pixelShader)
|
||||
WRITE_ASSET(ASSET_TYPE_VERTEXSHADER, MaterialVertexShader, vertexShader)
|
||||
WRITE_ASSET(ASSET_TYPE_VERTEXDECL, MaterialVertexDeclaration, vertexDecl)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, snd_alias_list_t, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_CURVE, SndCurve, sndCurve)
|
||||
WRITE_ASSET(ASSET_TYPE_LOADED_SOUND, LoadedSound, loadSnd)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_SP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_MP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_SP, GameWorldSp, gameWorldSp)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_MP, GameWorldMp, gameWorldMp)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_FXWORLD, FxWorld, fxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponCompleteDef, weapon)
|
||||
SKIP_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, SndDriverGlobals, sndDriverGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_LEADERBOARD, LeaderboardDef, leaderboardDef)
|
||||
WRITE_ASSET(ASSET_TYPE_STRUCTURED_DATA_DEF, StructuredDataDefSet, structuredDataDefSet)
|
||||
WRITE_ASSET(ASSET_TYPE_TRACER, TracerDef, tracerDef)
|
||||
WRITE_ASSET(ASSET_TYPE_VEHICLE, VehicleDef, vehDef)
|
||||
WRITE_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, AddonMapEnts, addonMapEnts)
|
||||
|
||||
default:
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
}
|
||||
|
||||
#undef WRITE_ASSET
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Writing/ContentWriterBase.h"
|
||||
#include "Writing/IContentWritingEntryPoint.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
@ -23,4 +23,4 @@ namespace IW4
|
||||
|
||||
void WriteContent(Zone* zone, IZoneOutputStream* stream) override;
|
||||
};
|
||||
}
|
||||
} // namespace IW4
|
||||
|
@ -1,10 +1,8 @@
|
||||
#include "ZoneWriterFactoryIW4.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "ContentWriterIW4.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Game/IW4/GameIW4.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Game/IW4/ZoneConstantsIW4.h"
|
||||
#include "Writing/Processor/OutputProcessorDeflate.h"
|
||||
#include "Writing/Steps/StepAddOutputProcessor.h"
|
||||
@ -16,6 +14,8 @@
|
||||
#include "Writing/Steps/StepWriteZoneHeader.h"
|
||||
#include "Writing/Steps/StepWriteZoneSizes.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
class ZoneWriterFactory::Impl
|
||||
@ -73,7 +73,8 @@ public:
|
||||
|
||||
SetupBlocks();
|
||||
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(
|
||||
std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto* contentInMemoryPtr = contentInMemory.get();
|
||||
m_writer->AddWritingStep(std::move(contentInMemory));
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Writing/IZoneWriterFactory.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
class ZoneWriterFactory final : public IZoneWriterFactory
|
||||
@ -14,4 +14,4 @@ namespace IW4
|
||||
_NODISCARD bool SupportsZone(Zone* zone) const override;
|
||||
_NODISCARD std::unique_ptr<ZoneWriter> CreateWriter(Zone* zone) const override;
|
||||
};
|
||||
}
|
||||
} // namespace IW4
|
||||
|
@ -1,8 +1,5 @@
|
||||
#include "ContentWriterIW5.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
#include "Game/IW5/XAssets/addonmapents/addonmapents_write_db.h"
|
||||
#include "Game/IW5/XAssets/clipmap_t/clipmap_t_write_db.h"
|
||||
#include "Game/IW5/XAssets/comworld/comworld_write_db.h"
|
||||
@ -43,9 +40,11 @@
|
||||
#include "Game/IW5/XAssets/xanimparts/xanimparts_write_db.h"
|
||||
#include "Game/IW5/XAssets/xmodel/xmodel_write_db.h"
|
||||
#include "Game/IW5/XAssets/xmodelsurfs/xmodelsurfs_write_db.h"
|
||||
|
||||
#include "Writing/WritingException.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
ContentWriter::ContentWriter()
|
||||
@ -115,15 +114,15 @@ void ContentWriter::WriteScriptStringList(const bool atStreamStart)
|
||||
|
||||
void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
{
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define SKIP_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define SKIP_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
break;
|
||||
|
||||
assert(varXAsset != nullptr);
|
||||
@ -133,53 +132,53 @@ void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
|
||||
switch (varXAsset->type)
|
||||
{
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSCOLLMAP, PhysCollmap, physCollmap)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL_SURFS, XModelSurfs, modelSurfs)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_PIXELSHADER, MaterialPixelShader, pixelShader)
|
||||
WRITE_ASSET(ASSET_TYPE_VERTEXSHADER, MaterialVertexShader, vertexShader)
|
||||
WRITE_ASSET(ASSET_TYPE_VERTEXDECL, MaterialVertexDeclaration, vertexDecl)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, snd_alias_list_t, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_CURVE, SndCurve, sndCurve)
|
||||
WRITE_ASSET(ASSET_TYPE_LOADED_SOUND, LoadedSound, loadSnd)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GLASSWORLD, GlassWorld, glassWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_PATHDATA, PathData, pathData)
|
||||
WRITE_ASSET(ASSET_TYPE_VEHICLE_TRACK, VehicleTrack, vehicleTrack)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_FXWORLD, FxWorld, fxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_ATTACHMENT, WeaponAttachment, attachment)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponCompleteDef, weapon)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_SURFACE_FX, SurfaceFxTable, surfaceFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_SCRIPTFILE, ScriptFile, scriptfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_LEADERBOARD, LeaderboardDef, leaderboardDef)
|
||||
WRITE_ASSET(ASSET_TYPE_STRUCTURED_DATA_DEF, StructuredDataDefSet, structuredDataDefSet)
|
||||
WRITE_ASSET(ASSET_TYPE_TRACER, TracerDef, tracerDef)
|
||||
WRITE_ASSET(ASSET_TYPE_VEHICLE, VehicleDef, vehDef)
|
||||
WRITE_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, AddonMapEnts, addonMapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSCOLLMAP, PhysCollmap, physCollmap)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL_SURFS, XModelSurfs, modelSurfs)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_PIXELSHADER, MaterialPixelShader, pixelShader)
|
||||
WRITE_ASSET(ASSET_TYPE_VERTEXSHADER, MaterialVertexShader, vertexShader)
|
||||
WRITE_ASSET(ASSET_TYPE_VERTEXDECL, MaterialVertexDeclaration, vertexDecl)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, snd_alias_list_t, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_CURVE, SndCurve, sndCurve)
|
||||
WRITE_ASSET(ASSET_TYPE_LOADED_SOUND, LoadedSound, loadSnd)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GLASSWORLD, GlassWorld, glassWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_PATHDATA, PathData, pathData)
|
||||
WRITE_ASSET(ASSET_TYPE_VEHICLE_TRACK, VehicleTrack, vehicleTrack)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_FXWORLD, FxWorld, fxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_ATTACHMENT, WeaponAttachment, attachment)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponCompleteDef, weapon)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_SURFACE_FX, SurfaceFxTable, surfaceFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_SCRIPTFILE, ScriptFile, scriptfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_LEADERBOARD, LeaderboardDef, leaderboardDef)
|
||||
WRITE_ASSET(ASSET_TYPE_STRUCTURED_DATA_DEF, StructuredDataDefSet, structuredDataDefSet)
|
||||
WRITE_ASSET(ASSET_TYPE_TRACER, TracerDef, tracerDef)
|
||||
WRITE_ASSET(ASSET_TYPE_VEHICLE, VehicleDef, vehDef)
|
||||
WRITE_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, AddonMapEnts, addonMapEnts)
|
||||
|
||||
default:
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
}
|
||||
|
||||
#undef WRITE_ASSET
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "Writing/ContentWriterBase.h"
|
||||
#include "Writing/IContentWritingEntryPoint.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5
|
||||
{
|
||||
@ -23,4 +23,4 @@ namespace IW5
|
||||
|
||||
void WriteContent(Zone* zone, IZoneOutputStream* stream) override;
|
||||
};
|
||||
}
|
||||
} // namespace IW5
|
||||
|
@ -1,10 +1,8 @@
|
||||
#include "ZoneWriterFactoryIW5.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "ContentWriterIW5.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "Game/IW5/GameIW5.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "Game/IW5/ZoneConstantsIW5.h"
|
||||
#include "Writing/Processor/OutputProcessorDeflate.h"
|
||||
#include "Writing/Steps/StepAddOutputProcessor.h"
|
||||
@ -16,6 +14,8 @@
|
||||
#include "Writing/Steps/StepWriteZoneHeader.h"
|
||||
#include "Writing/Steps/StepWriteZoneSizes.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
class ZoneWriterFactory::Impl
|
||||
@ -26,7 +26,7 @@ class ZoneWriterFactory::Impl
|
||||
public:
|
||||
explicit Impl(Zone* zone)
|
||||
: m_zone(zone),
|
||||
m_writer(std::make_unique<ZoneWriter>())
|
||||
m_writer(std::make_unique<ZoneWriter>())
|
||||
{
|
||||
}
|
||||
|
||||
@ -74,7 +74,8 @@ public:
|
||||
|
||||
SetupBlocks();
|
||||
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(
|
||||
std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto* contentInMemoryPtr = contentInMemory.get();
|
||||
m_writer->AddWritingStep(std::move(contentInMemory));
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Writing/IZoneWriterFactory.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace IW5
|
||||
{
|
||||
class ZoneWriterFactory final : public IZoneWriterFactory
|
||||
@ -14,4 +14,4 @@ namespace IW5
|
||||
_NODISCARD bool SupportsZone(Zone* zone) const override;
|
||||
_NODISCARD std::unique_ptr<ZoneWriter> CreateWriter(Zone* zone) const override;
|
||||
};
|
||||
}
|
||||
} // namespace IW5
|
||||
|
@ -1,8 +1,5 @@
|
||||
#include "ContentWriterT5.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
#include "Game/T5/XAssets/clipmap_t/clipmap_t_write_db.h"
|
||||
#include "Game/T5/XAssets/comworld/comworld_write_db.h"
|
||||
#include "Game/T5/XAssets/ddlroot_t/ddlroot_t_write_db.h"
|
||||
@ -35,9 +32,11 @@
|
||||
#include "Game/T5/XAssets/xanimparts/xanimparts_write_db.h"
|
||||
#include "Game/T5/XAssets/xglobals/xglobals_write_db.h"
|
||||
#include "Game/T5/XAssets/xmodel/xmodel_write_db.h"
|
||||
|
||||
#include "Writing/WritingException.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
using namespace T5;
|
||||
|
||||
ContentWriter::ContentWriter()
|
||||
@ -107,15 +106,15 @@ void ContentWriter::WriteScriptStringList(const bool atStreamStart)
|
||||
|
||||
void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
{
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define SKIP_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define SKIP_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
break;
|
||||
|
||||
assert(varXAsset != nullptr);
|
||||
@ -125,46 +124,46 @@ void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
|
||||
switch (varXAsset->type)
|
||||
{
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSCONSTRAINTS, PhysConstraints, physConstraints)
|
||||
WRITE_ASSET(ASSET_TYPE_DESTRUCTIBLEDEF, DestructibleDef, destructibleDef)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, SndBank, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_PATCH, SndPatch, soundPatch)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_PVS, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_SP, GameWorldSp, gameWorldSp)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_MP, GameWorldMp, gameWorldMp)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponVariantDef, weapon)
|
||||
WRITE_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, SndDriverGlobals, sndDriverGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_PACK_INDEX, PackIndex, packIndex)
|
||||
WRITE_ASSET(ASSET_TYPE_XGLOBALS, XGlobals, xGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_DDL, ddlRoot_t, ddlRoot)
|
||||
WRITE_ASSET(ASSET_TYPE_GLASSES, Glasses, glasses)
|
||||
WRITE_ASSET(ASSET_TYPE_EMBLEMSET, EmblemSet, emblemSet)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSCONSTRAINTS, PhysConstraints, physConstraints)
|
||||
WRITE_ASSET(ASSET_TYPE_DESTRUCTIBLEDEF, DestructibleDef, destructibleDef)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, SndBank, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_PATCH, SndPatch, soundPatch)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_PVS, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_SP, GameWorldSp, gameWorldSp)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_MP, GameWorldMp, gameWorldMp)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponVariantDef, weapon)
|
||||
WRITE_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, SndDriverGlobals, sndDriverGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_PACK_INDEX, PackIndex, packIndex)
|
||||
WRITE_ASSET(ASSET_TYPE_XGLOBALS, XGlobals, xGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_DDL, ddlRoot_t, ddlRoot)
|
||||
WRITE_ASSET(ASSET_TYPE_GLASSES, Glasses, glasses)
|
||||
WRITE_ASSET(ASSET_TYPE_EMBLEMSET, EmblemSet, emblemSet)
|
||||
|
||||
default:
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
}
|
||||
|
||||
#undef WRITE_ASSET
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "Game/T5/T5.h"
|
||||
#include "Writing/ContentWriterBase.h"
|
||||
#include "Writing/IContentWritingEntryPoint.h"
|
||||
#include "Game/T5/T5.h"
|
||||
|
||||
namespace T5
|
||||
{
|
||||
@ -23,4 +23,4 @@ namespace T5
|
||||
|
||||
void WriteContent(Zone* zone, IZoneOutputStream* stream) override;
|
||||
};
|
||||
}
|
||||
} // namespace T5
|
||||
|
@ -1,10 +1,8 @@
|
||||
#include "ZoneWriterFactoryT5.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "ContentWriterT5.h"
|
||||
#include "Game/T5/T5.h"
|
||||
#include "Game/T5/GameT5.h"
|
||||
#include "Game/T5/T5.h"
|
||||
#include "Game/T5/ZoneConstantsT5.h"
|
||||
#include "Writing/Processor/OutputProcessorDeflate.h"
|
||||
#include "Writing/Steps/StepAddOutputProcessor.h"
|
||||
@ -14,6 +12,8 @@
|
||||
#include "Writing/Steps/StepWriteZoneHeader.h"
|
||||
#include "Writing/Steps/StepWriteZoneSizes.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace T5;
|
||||
|
||||
class ZoneWriterFactory::Impl
|
||||
@ -24,7 +24,7 @@ class ZoneWriterFactory::Impl
|
||||
public:
|
||||
explicit Impl(Zone* zone)
|
||||
: m_zone(zone),
|
||||
m_writer(std::make_unique<ZoneWriter>())
|
||||
m_writer(std::make_unique<ZoneWriter>())
|
||||
{
|
||||
}
|
||||
|
||||
@ -56,7 +56,8 @@ public:
|
||||
{
|
||||
SetupBlocks();
|
||||
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(
|
||||
std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto* contentInMemoryPtr = contentInMemory.get();
|
||||
m_writer->AddWritingStep(std::move(contentInMemory));
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Writing/IZoneWriterFactory.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T5
|
||||
{
|
||||
class ZoneWriterFactory final : public IZoneWriterFactory
|
||||
@ -14,4 +14,4 @@ namespace T5
|
||||
_NODISCARD bool SupportsZone(Zone* zone) const override;
|
||||
_NODISCARD std::unique_ptr<ZoneWriter> CreateWriter(Zone* zone) const override;
|
||||
};
|
||||
}
|
||||
} // namespace T5
|
||||
|
@ -1,8 +1,5 @@
|
||||
#include "ContentWriterT6.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
#include "Game/T6/XAssets/addonmapents/addonmapents_write_db.h"
|
||||
#include "Game/T6/XAssets/clipmap_t/clipmap_t_write_db.h"
|
||||
#include "Game/T6/XAssets/comworld/comworld_write_db.h"
|
||||
@ -51,9 +48,11 @@
|
||||
#include "Game/T6/XAssets/xglobals/xglobals_write_db.h"
|
||||
#include "Game/T6/XAssets/xmodel/xmodel_write_db.h"
|
||||
#include "Game/T6/XAssets/zbarrierdef/zbarrierdef_write_db.h"
|
||||
|
||||
#include "Writing/WritingException.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
using namespace T6;
|
||||
|
||||
ContentWriter::ContentWriter()
|
||||
@ -126,13 +125,13 @@ void ContentWriter::WriteScriptStringList(const bool atStreamStart)
|
||||
|
||||
void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
{
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
#define WRITE_ASSET(type_index, typeName, headerEntry) \
|
||||
case type_index: \
|
||||
{ \
|
||||
Writer_##typeName writer(varXAsset->header.headerEntry, m_zone, m_stream); \
|
||||
writer.Write(&varXAsset->header.headerEntry); \
|
||||
break; \
|
||||
}
|
||||
|
||||
assert(varXAsset != nullptr);
|
||||
|
||||
@ -141,62 +140,62 @@ void ContentWriter::WriteXAsset(const bool atStreamStart)
|
||||
|
||||
switch (varXAsset->type)
|
||||
{
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSCONSTRAINTS, PhysConstraints, physConstraints)
|
||||
WRITE_ASSET(ASSET_TYPE_DESTRUCTIBLEDEF, DestructibleDef, destructibleDef)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, SndBank, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_PATCH, SndPatch, soundPatch)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_PVS, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_SP, GameWorldSp, gameWorldSp)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_MP, GameWorldMp, gameWorldMp)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_FONTICON, FontIcon, fontIcon)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponVariantDef, weapon)
|
||||
WRITE_ASSET(ASSET_TYPE_ATTACHMENT, WeaponAttachment, attachment)
|
||||
WRITE_ASSET(ASSET_TYPE_ATTACHMENT_UNIQUE, WeaponAttachmentUnique, attachmentUnique)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON_CAMO, WeaponCamo, weaponCamo)
|
||||
WRITE_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, SndDriverGlobals, sndDriverGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_LEADERBOARD, LeaderboardDef, leaderboardDef)
|
||||
WRITE_ASSET(ASSET_TYPE_XGLOBALS, XGlobals, xGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_DDL, ddlRoot_t, ddlRoot)
|
||||
WRITE_ASSET(ASSET_TYPE_GLASSES, Glasses, glasses)
|
||||
WRITE_ASSET(ASSET_TYPE_EMBLEMSET, EmblemSet, emblemSet)
|
||||
WRITE_ASSET(ASSET_TYPE_SCRIPTPARSETREE, ScriptParseTree, scriptParseTree)
|
||||
WRITE_ASSET(ASSET_TYPE_KEYVALUEPAIRS, KeyValuePairs, keyValuePairs)
|
||||
WRITE_ASSET(ASSET_TYPE_VEHICLEDEF, VehicleDef, vehicleDef)
|
||||
WRITE_ASSET(ASSET_TYPE_MEMORYBLOCK, MemoryBlock, memoryBlock);
|
||||
WRITE_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, AddonMapEnts, addonMapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_TRACER, TracerDef, tracerDef)
|
||||
WRITE_ASSET(ASSET_TYPE_SKINNEDVERTS, SkinnedVertsDef, skinnedVertsDef)
|
||||
WRITE_ASSET(ASSET_TYPE_QDB, Qdb, qdb)
|
||||
WRITE_ASSET(ASSET_TYPE_SLUG, Slug, slug)
|
||||
WRITE_ASSET(ASSET_TYPE_FOOTSTEP_TABLE, FootstepTableDef, footstepTableDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FOOTSTEPFX_TABLE, FootstepFXTableDef, footstepFXTableDef)
|
||||
WRITE_ASSET(ASSET_TYPE_ZBARRIER, ZBarrierDef, zbarrierDef)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset)
|
||||
WRITE_ASSET(ASSET_TYPE_PHYSCONSTRAINTS, PhysConstraints, physConstraints)
|
||||
WRITE_ASSET(ASSET_TYPE_DESTRUCTIBLEDEF, DestructibleDef, destructibleDef)
|
||||
WRITE_ASSET(ASSET_TYPE_XANIMPARTS, XAnimParts, parts)
|
||||
WRITE_ASSET(ASSET_TYPE_XMODEL, XModel, model)
|
||||
WRITE_ASSET(ASSET_TYPE_MATERIAL, Material, material)
|
||||
WRITE_ASSET(ASSET_TYPE_TECHNIQUE_SET, MaterialTechniqueSet, techniqueSet)
|
||||
WRITE_ASSET(ASSET_TYPE_IMAGE, GfxImage, image)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND, SndBank, sound)
|
||||
WRITE_ASSET(ASSET_TYPE_SOUND_PATCH, SndPatch, soundPatch)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_CLIPMAP_PVS, clipMap_t, clipMap)
|
||||
WRITE_ASSET(ASSET_TYPE_COMWORLD, ComWorld, comWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_SP, GameWorldSp, gameWorldSp)
|
||||
WRITE_ASSET(ASSET_TYPE_GAMEWORLD_MP, GameWorldMp, gameWorldMp)
|
||||
WRITE_ASSET(ASSET_TYPE_MAP_ENTS, MapEnts, mapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld)
|
||||
WRITE_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FONT, Font_s, font)
|
||||
WRITE_ASSET(ASSET_TYPE_FONTICON, FontIcon, fontIcon)
|
||||
WRITE_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList)
|
||||
WRITE_ASSET(ASSET_TYPE_MENU, menuDef_t, menu)
|
||||
WRITE_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON, WeaponVariantDef, weapon)
|
||||
WRITE_ASSET(ASSET_TYPE_ATTACHMENT, WeaponAttachment, attachment)
|
||||
WRITE_ASSET(ASSET_TYPE_ATTACHMENT_UNIQUE, WeaponAttachmentUnique, attachmentUnique)
|
||||
WRITE_ASSET(ASSET_TYPE_WEAPON_CAMO, WeaponCamo, weaponCamo)
|
||||
WRITE_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, SndDriverGlobals, sndDriverGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_FX, FxEffectDef, fx)
|
||||
WRITE_ASSET(ASSET_TYPE_IMPACT_FX, FxImpactTable, impactFx)
|
||||
WRITE_ASSET(ASSET_TYPE_RAWFILE, RawFile, rawfile)
|
||||
WRITE_ASSET(ASSET_TYPE_STRINGTABLE, StringTable, stringTable)
|
||||
WRITE_ASSET(ASSET_TYPE_LEADERBOARD, LeaderboardDef, leaderboardDef)
|
||||
WRITE_ASSET(ASSET_TYPE_XGLOBALS, XGlobals, xGlobals)
|
||||
WRITE_ASSET(ASSET_TYPE_DDL, ddlRoot_t, ddlRoot)
|
||||
WRITE_ASSET(ASSET_TYPE_GLASSES, Glasses, glasses)
|
||||
WRITE_ASSET(ASSET_TYPE_EMBLEMSET, EmblemSet, emblemSet)
|
||||
WRITE_ASSET(ASSET_TYPE_SCRIPTPARSETREE, ScriptParseTree, scriptParseTree)
|
||||
WRITE_ASSET(ASSET_TYPE_KEYVALUEPAIRS, KeyValuePairs, keyValuePairs)
|
||||
WRITE_ASSET(ASSET_TYPE_VEHICLEDEF, VehicleDef, vehicleDef)
|
||||
WRITE_ASSET(ASSET_TYPE_MEMORYBLOCK, MemoryBlock, memoryBlock);
|
||||
WRITE_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, AddonMapEnts, addonMapEnts)
|
||||
WRITE_ASSET(ASSET_TYPE_TRACER, TracerDef, tracerDef)
|
||||
WRITE_ASSET(ASSET_TYPE_SKINNEDVERTS, SkinnedVertsDef, skinnedVertsDef)
|
||||
WRITE_ASSET(ASSET_TYPE_QDB, Qdb, qdb)
|
||||
WRITE_ASSET(ASSET_TYPE_SLUG, Slug, slug)
|
||||
WRITE_ASSET(ASSET_TYPE_FOOTSTEP_TABLE, FootstepTableDef, footstepTableDef)
|
||||
WRITE_ASSET(ASSET_TYPE_FOOTSTEPFX_TABLE, FootstepFXTableDef, footstepFXTableDef)
|
||||
WRITE_ASSET(ASSET_TYPE_ZBARRIER, ZBarrierDef, zbarrierDef)
|
||||
|
||||
default:
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Unsupported asset type: " << varXAsset->type << ".";
|
||||
throw WritingException(str.str());
|
||||
}
|
||||
}
|
||||
|
||||
#undef WRITE_ASSET
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Writing/ContentWriterBase.h"
|
||||
#include "Writing/IContentWritingEntryPoint.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
namespace T6
|
||||
{
|
||||
@ -23,4 +23,4 @@ namespace T6
|
||||
|
||||
void WriteContent(Zone* zone, IZoneOutputStream* stream) override;
|
||||
};
|
||||
}
|
||||
} // namespace T6
|
||||
|
@ -1,16 +1,11 @@
|
||||
#include "ZoneWriterFactoryT6.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
#include "ContentWriterT6.h"
|
||||
#include "Utils/ICapturedDataProvider.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/T6/GameT6.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Game/T6/ZoneConstantsT6.h"
|
||||
#include "Utils/ICapturedDataProvider.h"
|
||||
#include "Writing/Processor/OutputProcessorXChunks.h"
|
||||
#include "Zone/XChunk/XChunkProcessorDeflate.h"
|
||||
#include "Zone/XChunk/XChunkProcessorSalsa20Encryption.h"
|
||||
#include "Writing/Steps/StepAddOutputProcessor.h"
|
||||
#include "Writing/Steps/StepAlign.h"
|
||||
#include "Writing/Steps/StepRemoveOutputProcessor.h"
|
||||
@ -20,6 +15,11 @@
|
||||
#include "Writing/Steps/StepWriteZoneContentToMemory.h"
|
||||
#include "Writing/Steps/StepWriteZoneHeader.h"
|
||||
#include "Writing/Steps/StepWriteZoneSizes.h"
|
||||
#include "Zone/XChunk/XChunkProcessorDeflate.h"
|
||||
#include "Zone/XChunk/XChunkProcessorSalsa20Encryption.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
using namespace T6;
|
||||
|
||||
@ -56,7 +56,7 @@ public:
|
||||
ZoneHeader header{};
|
||||
header.m_version = ZoneConstants::ZONE_VERSION;
|
||||
|
||||
if(isSecure)
|
||||
if (isSecure)
|
||||
{
|
||||
if (isOfficial)
|
||||
memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_TREYARCH, sizeof(ZoneHeader::m_magic));
|
||||
@ -76,7 +76,8 @@ public:
|
||||
|
||||
void AddXChunkProcessor(const bool isEncrypted, ICapturedDataProvider** dataToSignProviderPtr, OutputProcessorXChunks** xChunkProcessorPtr) const
|
||||
{
|
||||
auto xChunkProcessor = std::make_unique<OutputProcessorXChunks>(ZoneConstants::STREAM_COUNT, ZoneConstants::XCHUNK_SIZE, ZoneConstants::XCHUNK_MAX_WRITE_SIZE, ZoneConstants::VANILLA_BUFFER_SIZE);
|
||||
auto xChunkProcessor = std::make_unique<OutputProcessorXChunks>(
|
||||
ZoneConstants::STREAM_COUNT, ZoneConstants::XCHUNK_SIZE, ZoneConstants::XCHUNK_MAX_WRITE_SIZE, ZoneConstants::VANILLA_BUFFER_SIZE);
|
||||
if (xChunkProcessorPtr)
|
||||
*xChunkProcessorPtr = xChunkProcessor.get();
|
||||
|
||||
@ -86,8 +87,8 @@ public:
|
||||
if (isEncrypted)
|
||||
{
|
||||
// If zone is encrypted, the decryption is applied before the decompression. T6 Zones always use Salsa20.
|
||||
auto chunkProcessorSalsa20 = std::make_unique<XChunkProcessorSalsa20Encryption>(ZoneConstants::STREAM_COUNT, m_zone->m_name, ZoneConstants::SALSA20_KEY_TREYARCH,
|
||||
sizeof(ZoneConstants::SALSA20_KEY_TREYARCH));
|
||||
auto chunkProcessorSalsa20 = std::make_unique<XChunkProcessorSalsa20Encryption>(
|
||||
ZoneConstants::STREAM_COUNT, m_zone->m_name, ZoneConstants::SALSA20_KEY_TREYARCH, sizeof(ZoneConstants::SALSA20_KEY_TREYARCH));
|
||||
|
||||
// If there is encryption, the signed data of the zone is the final hash blocks provided by the Salsa20 IV adaption algorithm
|
||||
if (dataToSignProviderPtr)
|
||||
@ -97,7 +98,6 @@ public:
|
||||
}
|
||||
|
||||
m_writer->AddWritingStep(std::make_unique<StepAddOutputProcessor>(std::move(xChunkProcessor)));
|
||||
|
||||
}
|
||||
|
||||
std::unique_ptr<ZoneWriter> CreateWriter()
|
||||
@ -108,7 +108,8 @@ public:
|
||||
|
||||
SetupBlocks();
|
||||
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto contentInMemory = std::make_unique<StepWriteZoneContentToMemory>(
|
||||
std::make_unique<ContentWriter>(), m_zone, ZoneConstants::OFFSET_BLOCK_BIT_COUNT, ZoneConstants::INSERT_BLOCK);
|
||||
auto* contentInMemoryPtr = contentInMemory.get();
|
||||
m_writer->AddWritingStep(std::move(contentInMemory));
|
||||
|
||||
@ -121,7 +122,7 @@ public:
|
||||
AddXChunkProcessor(isEncrypted, &dataToSignProvider, &xChunksProcessor);
|
||||
|
||||
// Start of the XFile struct
|
||||
//m_writer->AddWritingStep(std::make_unique<StepSkipBytes>(8)); // Skip size and externalSize fields since they are not interesting for us
|
||||
// m_writer->AddWritingStep(std::make_unique<StepSkipBytes>(8)); // Skip size and externalSize fields since they are not interesting for us
|
||||
m_writer->AddWritingStep(std::make_unique<StepWriteZoneSizes>(contentInMemoryPtr));
|
||||
m_writer->AddWritingStep(std::make_unique<StepWriteXBlockSizes>(m_zone));
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Writing/IZoneWriterFactory.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace T6
|
||||
{
|
||||
class ZoneWriterFactory final : public IZoneWriterFactory
|
||||
@ -14,4 +14,4 @@ namespace T6
|
||||
_NODISCARD bool SupportsZone(Zone* zone) const override;
|
||||
_NODISCARD std::unique_ptr<ZoneWriter> CreateWriter(Zone* zone) const override;
|
||||
};
|
||||
}
|
||||
} // namespace T6
|
||||
|
Reference in New Issue
Block a user