mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 23:38:09 -05:00
Reformat code with clang format
This commit is contained in:
@ -1,48 +1,18 @@
|
||||
#include "GameAssetPoolIW3.h"
|
||||
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
using namespace IW3;
|
||||
|
||||
const char* GameAssetPoolIW3::ASSET_TYPE_NAMES[]
|
||||
{
|
||||
"xmodelpieces",
|
||||
"physpreset",
|
||||
"xanim",
|
||||
"xmodel",
|
||||
"material",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"sound",
|
||||
"soundcurve",
|
||||
"loadedsound",
|
||||
"clipmap",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"gameworldsp",
|
||||
"gameworldmp",
|
||||
"mapents",
|
||||
"gfxworld",
|
||||
"lightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"weapon",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"impactfx",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"stringtable"
|
||||
const char* GameAssetPoolIW3::ASSET_TYPE_NAMES[]{
|
||||
"xmodelpieces", "physpreset", "xanim", "xmodel", "material", "techniqueset", "image", "sound", "soundcurve", "loadedsound",
|
||||
"clipmap", "clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents", "gfxworld", "lightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "snddriverglobals", "fx", "impactfx", "aitype", "mptype", "character",
|
||||
"xmodelalias", "rawfile", "stringtable",
|
||||
};
|
||||
|
||||
/*
|
||||
@ -81,21 +51,21 @@ const char* GameAssetPoolIW3::ASSET_TYPE_NAMES[]
|
||||
|
||||
GameAssetPoolIW3::GameAssetPoolIW3(Zone* zone, const int priority)
|
||||
: ZoneAssetPools(zone),
|
||||
m_priority(priority)
|
||||
m_priority(priority)
|
||||
{
|
||||
static_assert(std::extent<decltype(ASSET_TYPE_NAMES)>::value == ASSET_TYPE_COUNT);
|
||||
}
|
||||
|
||||
void GameAssetPoolIW3::InitPoolStatic(const asset_type_t type, const size_t capacity)
|
||||
{
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
@ -137,14 +107,14 @@ void GameAssetPoolIW3::InitPoolStatic(const asset_type_t type, const size_t capa
|
||||
|
||||
void GameAssetPoolIW3::InitPoolDynamic(const asset_type_t type)
|
||||
{
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
@ -184,18 +154,19 @@ void GameAssetPoolIW3::InitPoolDynamic(const asset_type_t type)
|
||||
#undef CASE_INIT_POOL_STATIC
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW3::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
|
||||
XAssetInfoGeneric* GameAssetPoolIW3::AddAssetToPool(
|
||||
asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
|
||||
{
|
||||
XAsset xAsset{};
|
||||
|
||||
xAsset.type = static_cast<XAssetType>(type);
|
||||
xAsset.header.data = asset;
|
||||
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
}
|
||||
|
||||
switch (xAsset.type)
|
||||
@ -239,12 +210,12 @@ XAssetInfoGeneric* GameAssetPoolIW3::AddAssetToPool(asset_type_t type, std::stri
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW3::GetAsset(const asset_type_t type, std::string name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Game/IW3/IW3.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class GameAssetPoolIW3 final : public ZoneAssetPools
|
||||
{
|
||||
@ -14,7 +14,12 @@ class GameAssetPoolIW3 final : public ZoneAssetPools
|
||||
static const char* ASSET_TYPE_NAMES[];
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone) override;
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type,
|
||||
std::string name,
|
||||
void* asset,
|
||||
std::vector<XAssetInfoGeneric*> dependencies,
|
||||
std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone) override;
|
||||
|
||||
public:
|
||||
std::unique_ptr<AssetPool<IW3::PhysPreset>> m_phys_preset;
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
#include "Game/IW3/IW3.h"
|
||||
#include "Zone/ZoneTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "Zone/ZoneTypes.h"
|
||||
#include "Game/IW3/IW3.h"
|
||||
|
||||
namespace IW3
|
||||
{
|
||||
class ZoneConstants final
|
||||
@ -14,7 +14,7 @@ namespace IW3
|
||||
public:
|
||||
static constexpr const char* MAGIC_UNSIGNED = "IWffu100";
|
||||
static constexpr int ZONE_VERSION = 5;
|
||||
|
||||
|
||||
static_assert(std::char_traits<char>::length(MAGIC_UNSIGNED) == sizeof(ZoneHeader::m_magic));
|
||||
|
||||
static constexpr size_t AUTHED_CHUNK_SIZE = 0x2000;
|
||||
@ -23,4 +23,4 @@ namespace IW3
|
||||
static constexpr int OFFSET_BLOCK_BIT_COUNT = 4;
|
||||
static constexpr block_t INSERT_BLOCK = XFILE_BLOCK_VIRTUAL;
|
||||
};
|
||||
}
|
||||
} // namespace IW3
|
||||
|
@ -1,64 +1,24 @@
|
||||
#include "GameAssetPoolIW4.h"
|
||||
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
using namespace IW4;
|
||||
|
||||
const char* GameAssetPoolIW4::ASSET_TYPE_NAMES[]
|
||||
{
|
||||
"physpreset",
|
||||
"physcollmap",
|
||||
"xanim",
|
||||
"xmodelsurfs",
|
||||
"xmodel",
|
||||
"material",
|
||||
"pixelshader",
|
||||
"vertexshader",
|
||||
"vertexdecl",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"sound",
|
||||
"soundcurve",
|
||||
"loadedsound",
|
||||
"clipmap",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"gameworldsp",
|
||||
"gameworldmp",
|
||||
"mapents",
|
||||
"fxworld",
|
||||
"gfxworld",
|
||||
"lightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"weapon",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"impactfx",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"structureddatadef",
|
||||
"tracer",
|
||||
"vehicle",
|
||||
"addonmapents"
|
||||
};
|
||||
const char* GameAssetPoolIW4::ASSET_TYPE_NAMES[]{
|
||||
"physpreset", "physcollmap", "xanim", "xmodelsurfs", "xmodel", "material", "pixelshader", "vertexshader", "vertexdecl", "techniqueset",
|
||||
"image", "sound", "soundcurve", "loadedsound", "clipmap", "clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents",
|
||||
"fxworld", "gfxworld", "lightdef", "uimap", "font", "menulist", "menu", "localize", "weapon", "snddriverglobals",
|
||||
"fx", "impactfx", "aitype", "mptype", "character", "xmodelalias", "rawfile", "stringtable", "leaderboard", "structureddatadef",
|
||||
"tracer", "vehicle", "addonmapents"};
|
||||
|
||||
/*
|
||||
Asset Pool Table
|
||||
Useful for macro generation via regex-replace for example
|
||||
|
||||
|
||||
#assetType, #typeName, #unionEntry, #poolName
|
||||
ASSET_TYPE_PHYSPRESET, PhysPreset, physPreset, m_phys_preset
|
||||
ASSET_TYPE_PHYSCOLLMAP, PhysCollmap, physCollmap, m_phys_collmap
|
||||
@ -108,54 +68,54 @@ GameAssetPoolIW4::GameAssetPoolIW4(Zone* zone, const int priority)
|
||||
|
||||
void GameAssetPoolIW4::InitPoolStatic(const asset_type_t type, const size_t capacity)
|
||||
{
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PHYSPRESET, m_phys_preset, PhysPreset);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PHYSCOLLMAP, m_phys_collmap, PhysCollmap);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XANIMPARTS, m_xanim_parts, XAnimParts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XMODEL, m_xmodel, XModel);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MATERIAL, m_material, Material);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PIXELSHADER, m_material_pixel_shader, MaterialPixelShader);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_VERTEXSHADER, m_material_vertex_shader, MaterialVertexShader);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_VERTEXDECL, m_material_vertex_decl, MaterialVertexDeclaration);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, MaterialTechniqueSet);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_IMAGE, m_image, GfxImage);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SOUND, m_sound, snd_alias_list_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SOUND_CURVE, m_sound_curve, SndCurve);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LOADED_SOUND, m_loaded_sound, LoadedSound);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_CLIPMAP_SP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_CLIPMAP_MP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_COMWORLD, m_com_world, ComWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, GameWorldSp);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, GameWorldMp);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MAP_ENTS, m_map_ents, MapEnts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FXWORLD, m_fx_world, FxWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GFXWORLD, m_gfx_world, GfxWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, GfxLightDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FONT, m_font, Font_s);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MENULIST, m_menu_list, MenuList);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MENU, m_menu_def, menuDef_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, LocalizeEntry);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_WEAPON, m_weapon, WeaponCompleteDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FX, m_fx, FxEffectDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, FxImpactTable);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_RAWFILE, m_raw_file, RawFile);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_STRINGTABLE, m_string_table, StringTable);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LEADERBOARD, m_leaderboard, LeaderboardDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_STRUCTURED_DATA_DEF, m_structed_data_def_set, StructuredDataDefSet);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_TRACER, m_tracer, TracerDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_VEHICLE, m_vehicle, VehicleDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PHYSPRESET, m_phys_preset, PhysPreset);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PHYSCOLLMAP, m_phys_collmap, PhysCollmap);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XANIMPARTS, m_xanim_parts, XAnimParts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XMODEL, m_xmodel, XModel);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MATERIAL, m_material, Material);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PIXELSHADER, m_material_pixel_shader, MaterialPixelShader);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_VERTEXSHADER, m_material_vertex_shader, MaterialVertexShader);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_VERTEXDECL, m_material_vertex_decl, MaterialVertexDeclaration);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, MaterialTechniqueSet);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_IMAGE, m_image, GfxImage);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SOUND, m_sound, snd_alias_list_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SOUND_CURVE, m_sound_curve, SndCurve);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LOADED_SOUND, m_loaded_sound, LoadedSound);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_CLIPMAP_SP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_CLIPMAP_MP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_COMWORLD, m_com_world, ComWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, GameWorldSp);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, GameWorldMp);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MAP_ENTS, m_map_ents, MapEnts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FXWORLD, m_fx_world, FxWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GFXWORLD, m_gfx_world, GfxWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, GfxLightDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FONT, m_font, Font_s);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MENULIST, m_menu_list, MenuList);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MENU, m_menu_def, menuDef_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, LocalizeEntry);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_WEAPON, m_weapon, WeaponCompleteDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FX, m_fx, FxEffectDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, FxImpactTable);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_RAWFILE, m_raw_file, RawFile);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_STRINGTABLE, m_string_table, StringTable);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LEADERBOARD, m_leaderboard, LeaderboardDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_STRUCTURED_DATA_DEF, m_structed_data_def_set, StructuredDataDefSet);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_TRACER, m_tracer, TracerDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_VEHICLE, m_vehicle, VehicleDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
|
||||
default:
|
||||
assert(type >= 0 && type < ASSET_TYPE_COUNT);
|
||||
@ -167,54 +127,54 @@ void GameAssetPoolIW4::InitPoolStatic(const asset_type_t type, const size_t capa
|
||||
|
||||
void GameAssetPoolIW4::InitPoolDynamic(const asset_type_t type)
|
||||
{
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PHYSPRESET, m_phys_preset, PhysPreset);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PHYSCOLLMAP, m_phys_collmap, PhysCollmap);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XANIMPARTS, m_xanim_parts, XAnimParts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XMODEL, m_xmodel, XModel);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MATERIAL, m_material, Material);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PIXELSHADER, m_material_pixel_shader, MaterialPixelShader);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_VERTEXSHADER, m_material_vertex_shader, MaterialVertexShader);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_VERTEXDECL, m_material_vertex_decl, MaterialVertexDeclaration);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, MaterialTechniqueSet);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_IMAGE, m_image, GfxImage);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SOUND, m_sound, snd_alias_list_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SOUND_CURVE, m_sound_curve, SndCurve);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LOADED_SOUND, m_loaded_sound, LoadedSound);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_CLIPMAP_SP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_CLIPMAP_MP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_COMWORLD, m_com_world, ComWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, GameWorldSp);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, GameWorldMp);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MAP_ENTS, m_map_ents, MapEnts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FXWORLD, m_fx_world, FxWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GFXWORLD, m_gfx_world, GfxWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, GfxLightDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FONT, m_font, Font_s);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MENULIST, m_menu_list, MenuList);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MENU, m_menu_def, menuDef_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, LocalizeEntry);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_WEAPON, m_weapon, WeaponCompleteDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FX, m_fx, FxEffectDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, FxImpactTable);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_RAWFILE, m_raw_file, RawFile);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_STRINGTABLE, m_string_table, StringTable);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LEADERBOARD, m_leaderboard, LeaderboardDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_STRUCTURED_DATA_DEF, m_structed_data_def_set, StructuredDataDefSet);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_TRACER, m_tracer, TracerDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_VEHICLE, m_vehicle, VehicleDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PHYSPRESET, m_phys_preset, PhysPreset);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PHYSCOLLMAP, m_phys_collmap, PhysCollmap);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XANIMPARTS, m_xanim_parts, XAnimParts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XMODEL, m_xmodel, XModel);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MATERIAL, m_material, Material);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PIXELSHADER, m_material_pixel_shader, MaterialPixelShader);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_VERTEXSHADER, m_material_vertex_shader, MaterialVertexShader);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_VERTEXDECL, m_material_vertex_decl, MaterialVertexDeclaration);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, MaterialTechniqueSet);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_IMAGE, m_image, GfxImage);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SOUND, m_sound, snd_alias_list_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SOUND_CURVE, m_sound_curve, SndCurve);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LOADED_SOUND, m_loaded_sound, LoadedSound);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_CLIPMAP_SP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_CLIPMAP_MP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_COMWORLD, m_com_world, ComWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, GameWorldSp);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, GameWorldMp);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MAP_ENTS, m_map_ents, MapEnts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FXWORLD, m_fx_world, FxWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GFXWORLD, m_gfx_world, GfxWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, GfxLightDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FONT, m_font, Font_s);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MENULIST, m_menu_list, MenuList);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MENU, m_menu_def, menuDef_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, LocalizeEntry);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_WEAPON, m_weapon, WeaponCompleteDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FX, m_fx, FxEffectDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, FxImpactTable);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_RAWFILE, m_raw_file, RawFile);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_STRINGTABLE, m_string_table, StringTable);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LEADERBOARD, m_leaderboard, LeaderboardDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_STRUCTURED_DATA_DEF, m_structed_data_def_set, StructuredDataDefSet);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_TRACER, m_tracer, TracerDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_VEHICLE, m_vehicle, VehicleDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
|
||||
default:
|
||||
assert(type >= 0 && type < ASSET_TYPE_COUNT);
|
||||
@ -224,58 +184,59 @@ void GameAssetPoolIW4::InitPoolDynamic(const asset_type_t type)
|
||||
#undef CASE_INIT_POOL_STATIC
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW4::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
|
||||
XAssetInfoGeneric* GameAssetPoolIW4::AddAssetToPool(
|
||||
asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
|
||||
{
|
||||
XAsset xAsset{};
|
||||
|
||||
xAsset.type = static_cast<XAssetType>(type);
|
||||
xAsset.header.data = asset;
|
||||
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
}
|
||||
|
||||
switch (xAsset.type)
|
||||
{
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PHYSPRESET, m_phys_preset, physPreset);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PHYSCOLLMAP, m_phys_collmap, physCollmap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XANIMPARTS, m_xanim_parts, parts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XMODEL, m_xmodel, model);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MATERIAL, m_material, material);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PIXELSHADER, m_material_pixel_shader, pixelShader);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_VERTEXSHADER, m_material_vertex_shader, vertexShader);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_VERTEXDECL, m_material_vertex_decl, vertexDecl);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, techniqueSet);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_IMAGE, m_image, image);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SOUND, m_sound, sound);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SOUND_CURVE, m_sound_curve, sndCurve);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LOADED_SOUND, m_loaded_sound, loadSnd);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_CLIPMAP_SP, m_clip_map, clipMap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_CLIPMAP_MP, m_clip_map, clipMap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_COMWORLD, m_com_world, comWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, gameWorldSp);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, gameWorldMp);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MAP_ENTS, m_map_ents, mapEnts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FXWORLD, m_fx_world, fxWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GFXWORLD, m_gfx_world, gfxWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, lightDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FONT, m_font, font);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MENULIST, m_menu_list, menuList);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MENU, m_menu_def, menu);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, localize);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_WEAPON, m_weapon, weapon);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FX, m_fx, fx);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, impactFx);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_RAWFILE, m_raw_file, rawfile);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_STRINGTABLE, m_string_table, stringTable);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LEADERBOARD, m_leaderboard, leaderboardDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_STRUCTURED_DATA_DEF, m_structed_data_def_set, structuredDataDefSet);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_TRACER, m_tracer, tracerDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_VEHICLE, m_vehicle, vehDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, addonMapEnts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PHYSPRESET, m_phys_preset, physPreset);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PHYSCOLLMAP, m_phys_collmap, physCollmap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XANIMPARTS, m_xanim_parts, parts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XMODEL, m_xmodel, model);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MATERIAL, m_material, material);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PIXELSHADER, m_material_pixel_shader, pixelShader);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_VERTEXSHADER, m_material_vertex_shader, vertexShader);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_VERTEXDECL, m_material_vertex_decl, vertexDecl);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, techniqueSet);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_IMAGE, m_image, image);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SOUND, m_sound, sound);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SOUND_CURVE, m_sound_curve, sndCurve);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LOADED_SOUND, m_loaded_sound, loadSnd);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_CLIPMAP_SP, m_clip_map, clipMap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_CLIPMAP_MP, m_clip_map, clipMap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_COMWORLD, m_com_world, comWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, gameWorldSp);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, gameWorldMp);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MAP_ENTS, m_map_ents, mapEnts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FXWORLD, m_fx_world, fxWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GFXWORLD, m_gfx_world, gfxWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, lightDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FONT, m_font, font);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MENULIST, m_menu_list, menuList);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MENU, m_menu_def, menu);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, localize);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_WEAPON, m_weapon, weapon);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FX, m_fx, fx);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, impactFx);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_RAWFILE, m_raw_file, rawfile);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_STRINGTABLE, m_string_table, stringTable);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LEADERBOARD, m_leaderboard, leaderboardDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_STRUCTURED_DATA_DEF, m_structed_data_def_set, structuredDataDefSet);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_TRACER, m_tracer, tracerDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_VEHICLE, m_vehicle, vehDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, addonMapEnts);
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
@ -289,52 +250,52 @@ XAssetInfoGeneric* GameAssetPoolIW4::AddAssetToPool(asset_type_t type, std::stri
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW4::GetAsset(const asset_type_t type, std::string name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
CASE_GET_ASSET(ASSET_TYPE_PHYSPRESET, m_phys_preset);
|
||||
CASE_GET_ASSET(ASSET_TYPE_PHYSCOLLMAP, m_phys_collmap);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XANIMPARTS, m_xanim_parts);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XMODEL, m_xmodel);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MATERIAL, m_material);
|
||||
CASE_GET_ASSET(ASSET_TYPE_PIXELSHADER, m_material_pixel_shader);
|
||||
CASE_GET_ASSET(ASSET_TYPE_VERTEXSHADER, m_material_vertex_shader);
|
||||
CASE_GET_ASSET(ASSET_TYPE_VERTEXDECL, m_material_vertex_decl);
|
||||
CASE_GET_ASSET(ASSET_TYPE_TECHNIQUE_SET, m_technique_set);
|
||||
CASE_GET_ASSET(ASSET_TYPE_IMAGE, m_image);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SOUND, m_sound);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SOUND_CURVE, m_sound_curve);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LOADED_SOUND, m_loaded_sound);
|
||||
CASE_GET_ASSET(ASSET_TYPE_CLIPMAP_SP, m_clip_map);
|
||||
CASE_GET_ASSET(ASSET_TYPE_CLIPMAP_MP, m_clip_map);
|
||||
CASE_GET_ASSET(ASSET_TYPE_COMWORLD, m_com_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MAP_ENTS, m_map_ents);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FXWORLD, m_fx_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GFXWORLD, m_gfx_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FONT, m_font);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MENULIST, m_menu_list);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MENU, m_menu_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, m_localize);
|
||||
CASE_GET_ASSET(ASSET_TYPE_WEAPON, m_weapon);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FX, m_fx);
|
||||
CASE_GET_ASSET(ASSET_TYPE_IMPACT_FX, m_fx_impact_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_RAWFILE, m_raw_file);
|
||||
CASE_GET_ASSET(ASSET_TYPE_STRINGTABLE, m_string_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LEADERBOARD, m_leaderboard);
|
||||
CASE_GET_ASSET(ASSET_TYPE_STRUCTURED_DATA_DEF, m_structed_data_def_set);
|
||||
CASE_GET_ASSET(ASSET_TYPE_TRACER, m_tracer);
|
||||
CASE_GET_ASSET(ASSET_TYPE_VEHICLE, m_vehicle);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents);
|
||||
CASE_GET_ASSET(ASSET_TYPE_PHYSPRESET, m_phys_preset);
|
||||
CASE_GET_ASSET(ASSET_TYPE_PHYSCOLLMAP, m_phys_collmap);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XANIMPARTS, m_xanim_parts);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XMODEL, m_xmodel);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MATERIAL, m_material);
|
||||
CASE_GET_ASSET(ASSET_TYPE_PIXELSHADER, m_material_pixel_shader);
|
||||
CASE_GET_ASSET(ASSET_TYPE_VERTEXSHADER, m_material_vertex_shader);
|
||||
CASE_GET_ASSET(ASSET_TYPE_VERTEXDECL, m_material_vertex_decl);
|
||||
CASE_GET_ASSET(ASSET_TYPE_TECHNIQUE_SET, m_technique_set);
|
||||
CASE_GET_ASSET(ASSET_TYPE_IMAGE, m_image);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SOUND, m_sound);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SOUND_CURVE, m_sound_curve);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LOADED_SOUND, m_loaded_sound);
|
||||
CASE_GET_ASSET(ASSET_TYPE_CLIPMAP_SP, m_clip_map);
|
||||
CASE_GET_ASSET(ASSET_TYPE_CLIPMAP_MP, m_clip_map);
|
||||
CASE_GET_ASSET(ASSET_TYPE_COMWORLD, m_com_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MAP_ENTS, m_map_ents);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FXWORLD, m_fx_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GFXWORLD, m_gfx_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FONT, m_font);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MENULIST, m_menu_list);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MENU, m_menu_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, m_localize);
|
||||
CASE_GET_ASSET(ASSET_TYPE_WEAPON, m_weapon);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FX, m_fx);
|
||||
CASE_GET_ASSET(ASSET_TYPE_IMPACT_FX, m_fx_impact_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_RAWFILE, m_raw_file);
|
||||
CASE_GET_ASSET(ASSET_TYPE_STRINGTABLE, m_string_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LEADERBOARD, m_leaderboard);
|
||||
CASE_GET_ASSET(ASSET_TYPE_STRUCTURED_DATA_DEF, m_structed_data_def_set);
|
||||
CASE_GET_ASSET(ASSET_TYPE_TRACER, m_tracer);
|
||||
CASE_GET_ASSET(ASSET_TYPE_VEHICLE, m_vehicle);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents);
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class GameAssetPoolIW4 final : public ZoneAssetPools
|
||||
{
|
||||
@ -15,7 +15,12 @@ class GameAssetPoolIW4 final : public ZoneAssetPools
|
||||
static const char* ASSET_TYPE_NAMES[];
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone) override;
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type,
|
||||
std::string name,
|
||||
void* asset,
|
||||
std::vector<XAssetInfoGeneric*> dependencies,
|
||||
std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone) override;
|
||||
|
||||
public:
|
||||
std::unique_ptr<AssetPool<IW4::PhysPreset>> m_phys_preset;
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
#include "Game/IW4/IW4.h"
|
||||
#include "Zone/ZoneTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "Zone/ZoneTypes.h"
|
||||
#include "Game/IW4/IW4.h"
|
||||
|
||||
namespace IW4
|
||||
{
|
||||
class ZoneConstants final
|
||||
@ -25,43 +25,19 @@ namespace IW4
|
||||
static_assert(std::char_traits<char>::length(MAGIC_IW4X) == sizeof(ZoneHeader::m_magic) - sizeof(uint32_t));
|
||||
|
||||
static constexpr const char* MAGIC_AUTH_HEADER = "IWffs100";
|
||||
inline static const uint8_t RSA_PUBLIC_KEY_INFINITY_WARD[]
|
||||
{
|
||||
0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01,
|
||||
0x00, 0xA5, 0x86, 0xCC, 0x18, 0xA9, 0x12, 0x17,
|
||||
0x4F, 0x3A, 0xC9, 0x0C, 0xD2, 0x38, 0x5D, 0xDB,
|
||||
0x67, 0x62, 0xA4, 0xE3, 0xD4, 0x42, 0x05, 0x8A,
|
||||
0x57, 0x0C, 0x31, 0x4E, 0x19, 0xE4, 0xBA, 0x89,
|
||||
0x73, 0x13, 0xDB, 0x72, 0x25, 0x63, 0xB1, 0x2F,
|
||||
0xD7, 0xF1, 0x08, 0x48, 0x34, 0x06, 0xD7, 0x84,
|
||||
0x5F, 0xC8, 0xCF, 0x2F, 0xB6, 0xA3, 0x5A, 0x8F,
|
||||
0x7E, 0xAA, 0x9D, 0x51, 0xE7, 0x0F, 0xB9, 0x07,
|
||||
0xB7, 0x30, 0x91, 0x04, 0x39, 0x9C, 0xDC, 0x1C,
|
||||
0xF1, 0x16, 0xCB, 0x96, 0x10, 0xEB, 0x38, 0xB1,
|
||||
0x3B, 0xBA, 0x42, 0xE3, 0xE2, 0x78, 0xBD, 0x77,
|
||||
0x82, 0x1A, 0x2B, 0x54, 0x27, 0x0A, 0xF7, 0x66,
|
||||
0x06, 0xAD, 0x46, 0x39, 0xC0, 0xEB, 0xB5, 0xC2,
|
||||
0x27, 0xDD, 0x2C, 0x08, 0x62, 0x2C, 0x0B, 0xC4,
|
||||
0x00, 0x0D, 0xCB, 0xAD, 0x22, 0x67, 0x01, 0xA6,
|
||||
0x92, 0x9C, 0x00, 0xAF, 0x9D, 0x55, 0xCC, 0x68,
|
||||
0xEC, 0x39, 0x49, 0x85, 0x7E, 0x2C, 0x98, 0xCF,
|
||||
0x4C, 0x12, 0x8D, 0xED, 0xC7, 0x1D, 0x21, 0x54,
|
||||
0x9C, 0x2F, 0xC9, 0x54, 0x36, 0x08, 0xA9, 0x67,
|
||||
0xEE, 0x91, 0xE6, 0xD9, 0xB1, 0xFA, 0xA9, 0x2B,
|
||||
0x88, 0xAD, 0x2A, 0xD0, 0xAA, 0x28, 0xF9, 0x47,
|
||||
0xA6, 0x0F, 0xCF, 0x55, 0x4C, 0x9B, 0x26, 0x41,
|
||||
0x89, 0x76, 0x11, 0xFD, 0x1B, 0x83, 0xE4, 0xE8,
|
||||
0x8E, 0x7E, 0xB4, 0x03, 0xA3, 0x29, 0xDD, 0x4F,
|
||||
0xAC, 0x99, 0xBE, 0x7C, 0xD3, 0xFD, 0x14, 0x28,
|
||||
0x1C, 0x59, 0x69, 0xE0, 0x79, 0x5F, 0x4B, 0xDA,
|
||||
0x6B, 0xAB, 0x48, 0x4E, 0x28, 0x39, 0x84, 0xC6,
|
||||
0x2B, 0xC6, 0x20, 0x05, 0xDB, 0x05, 0x21, 0xC3,
|
||||
0xE1, 0xD4, 0x20, 0x28, 0xDD, 0x3A, 0x4D, 0x51,
|
||||
0xE7, 0x49, 0x8A, 0x49, 0xEF, 0xF5, 0xDA, 0xDA,
|
||||
0x7D, 0x5D, 0xA8, 0x0B, 0xA1, 0x77, 0xCD, 0x62,
|
||||
0x7D, 0x9D, 0x40, 0x26, 0x44, 0x4B, 0x3B, 0x0A,
|
||||
0x89, 0x02, 0x03, 0x01, 0x00, 0x01
|
||||
};
|
||||
inline static const uint8_t RSA_PUBLIC_KEY_INFINITY_WARD[]{
|
||||
0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xA5, 0x86, 0xCC, 0x18, 0xA9, 0x12, 0x17, 0x4F, 0x3A, 0xC9, 0x0C, 0xD2, 0x38, 0x5D,
|
||||
0xDB, 0x67, 0x62, 0xA4, 0xE3, 0xD4, 0x42, 0x05, 0x8A, 0x57, 0x0C, 0x31, 0x4E, 0x19, 0xE4, 0xBA, 0x89, 0x73, 0x13, 0xDB, 0x72, 0x25, 0x63,
|
||||
0xB1, 0x2F, 0xD7, 0xF1, 0x08, 0x48, 0x34, 0x06, 0xD7, 0x84, 0x5F, 0xC8, 0xCF, 0x2F, 0xB6, 0xA3, 0x5A, 0x8F, 0x7E, 0xAA, 0x9D, 0x51, 0xE7,
|
||||
0x0F, 0xB9, 0x07, 0xB7, 0x30, 0x91, 0x04, 0x39, 0x9C, 0xDC, 0x1C, 0xF1, 0x16, 0xCB, 0x96, 0x10, 0xEB, 0x38, 0xB1, 0x3B, 0xBA, 0x42, 0xE3,
|
||||
0xE2, 0x78, 0xBD, 0x77, 0x82, 0x1A, 0x2B, 0x54, 0x27, 0x0A, 0xF7, 0x66, 0x06, 0xAD, 0x46, 0x39, 0xC0, 0xEB, 0xB5, 0xC2, 0x27, 0xDD, 0x2C,
|
||||
0x08, 0x62, 0x2C, 0x0B, 0xC4, 0x00, 0x0D, 0xCB, 0xAD, 0x22, 0x67, 0x01, 0xA6, 0x92, 0x9C, 0x00, 0xAF, 0x9D, 0x55, 0xCC, 0x68, 0xEC, 0x39,
|
||||
0x49, 0x85, 0x7E, 0x2C, 0x98, 0xCF, 0x4C, 0x12, 0x8D, 0xED, 0xC7, 0x1D, 0x21, 0x54, 0x9C, 0x2F, 0xC9, 0x54, 0x36, 0x08, 0xA9, 0x67, 0xEE,
|
||||
0x91, 0xE6, 0xD9, 0xB1, 0xFA, 0xA9, 0x2B, 0x88, 0xAD, 0x2A, 0xD0, 0xAA, 0x28, 0xF9, 0x47, 0xA6, 0x0F, 0xCF, 0x55, 0x4C, 0x9B, 0x26, 0x41,
|
||||
0x89, 0x76, 0x11, 0xFD, 0x1B, 0x83, 0xE4, 0xE8, 0x8E, 0x7E, 0xB4, 0x03, 0xA3, 0x29, 0xDD, 0x4F, 0xAC, 0x99, 0xBE, 0x7C, 0xD3, 0xFD, 0x14,
|
||||
0x28, 0x1C, 0x59, 0x69, 0xE0, 0x79, 0x5F, 0x4B, 0xDA, 0x6B, 0xAB, 0x48, 0x4E, 0x28, 0x39, 0x84, 0xC6, 0x2B, 0xC6, 0x20, 0x05, 0xDB, 0x05,
|
||||
0x21, 0xC3, 0xE1, 0xD4, 0x20, 0x28, 0xDD, 0x3A, 0x4D, 0x51, 0xE7, 0x49, 0x8A, 0x49, 0xEF, 0xF5, 0xDA, 0xDA, 0x7D, 0x5D, 0xA8, 0x0B, 0xA1,
|
||||
0x77, 0xCD, 0x62, 0x7D, 0x9D, 0x40, 0x26, 0x44, 0x4B, 0x3B, 0x0A, 0x89, 0x02, 0x03, 0x01, 0x00, 0x01};
|
||||
|
||||
static constexpr size_t AUTHED_CHUNK_SIZE = 0x2000;
|
||||
static constexpr unsigned AUTHED_CHUNK_COUNT_PER_GROUP = 256;
|
||||
@ -69,4 +45,4 @@ namespace IW4
|
||||
static constexpr int OFFSET_BLOCK_BIT_COUNT = 4;
|
||||
static constexpr block_t INSERT_BLOCK = XFILE_BLOCK_VIRTUAL;
|
||||
};
|
||||
}
|
||||
} // namespace IW4
|
||||
|
@ -1,62 +1,59 @@
|
||||
#include "GameAssetPoolIW5.h"
|
||||
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
const char* GameAssetPoolIW5::ASSET_TYPE_NAMES[]
|
||||
{
|
||||
"physpreset",
|
||||
"physcollmap",
|
||||
"xanim",
|
||||
"xmodelsurfs",
|
||||
"xmodel",
|
||||
"material",
|
||||
"pixelshader",
|
||||
"vertexshader",
|
||||
"vertexdecl",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"sound",
|
||||
"soundcurve",
|
||||
"loadedsound",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"glassworld",
|
||||
"pathdata",
|
||||
"vehicletrack",
|
||||
"mapents",
|
||||
"fxworld",
|
||||
"gfxworld",
|
||||
"lightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"attachment",
|
||||
"weapon",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"impactfx",
|
||||
"surfacefx",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"scriptfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"structureddatadef",
|
||||
"tracer",
|
||||
"vehicle",
|
||||
"addonmapents"
|
||||
};
|
||||
const char* GameAssetPoolIW5::ASSET_TYPE_NAMES[]{"physpreset",
|
||||
"physcollmap",
|
||||
"xanim",
|
||||
"xmodelsurfs",
|
||||
"xmodel",
|
||||
"material",
|
||||
"pixelshader",
|
||||
"vertexshader",
|
||||
"vertexdecl",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"sound",
|
||||
"soundcurve",
|
||||
"loadedsound",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"glassworld",
|
||||
"pathdata",
|
||||
"vehicletrack",
|
||||
"mapents",
|
||||
"fxworld",
|
||||
"gfxworld",
|
||||
"lightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"attachment",
|
||||
"weapon",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"impactfx",
|
||||
"surfacefx",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"scriptfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"structureddatadef",
|
||||
"tracer",
|
||||
"vehicle",
|
||||
"addonmapents"};
|
||||
|
||||
/*
|
||||
Asset Pool Table
|
||||
@ -107,21 +104,21 @@ const char* GameAssetPoolIW5::ASSET_TYPE_NAMES[]
|
||||
|
||||
GameAssetPoolIW5::GameAssetPoolIW5(Zone* zone, const int priority)
|
||||
: ZoneAssetPools(zone),
|
||||
m_priority(priority)
|
||||
m_priority(priority)
|
||||
{
|
||||
assert(std::extent<decltype(ASSET_TYPE_NAMES)>::value == ASSET_TYPE_COUNT);
|
||||
}
|
||||
|
||||
void GameAssetPoolIW5::InitPoolStatic(const asset_type_t type, const size_t capacity)
|
||||
{
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
@ -177,14 +174,14 @@ void GameAssetPoolIW5::InitPoolStatic(const asset_type_t type, const size_t capa
|
||||
|
||||
void GameAssetPoolIW5::InitPoolDynamic(const asset_type_t type)
|
||||
{
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
@ -238,18 +235,19 @@ void GameAssetPoolIW5::InitPoolDynamic(const asset_type_t type)
|
||||
#undef CASE_INIT_POOL_STATIC
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW5::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
|
||||
XAssetInfoGeneric* GameAssetPoolIW5::AddAssetToPool(
|
||||
asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
|
||||
{
|
||||
XAsset xAsset{};
|
||||
|
||||
xAsset.type = static_cast<XAssetType>(type);
|
||||
xAsset.header.data = asset;
|
||||
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
}
|
||||
|
||||
switch (xAsset.type)
|
||||
@ -307,12 +305,12 @@ XAssetInfoGeneric* GameAssetPoolIW5::AddAssetToPool(asset_type_t type, std::stri
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolIW5::GetAsset(const asset_type_t type, std::string name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class GameAssetPoolIW5 final : public ZoneAssetPools
|
||||
{
|
||||
@ -14,7 +14,12 @@ class GameAssetPoolIW5 final : public ZoneAssetPools
|
||||
static const char* ASSET_TYPE_NAMES[];
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone) override;
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type,
|
||||
std::string name,
|
||||
void* asset,
|
||||
std::vector<XAssetInfoGeneric*> dependencies,
|
||||
std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone) override;
|
||||
|
||||
public:
|
||||
std::unique_ptr<AssetPool<IW5::PhysPreset>> m_phys_preset;
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "Zone/ZoneTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "Zone/ZoneTypes.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
|
||||
namespace IW5
|
||||
{
|
||||
class ZoneConstants final
|
||||
@ -22,43 +22,19 @@ namespace IW5
|
||||
static_assert(std::char_traits<char>::length(MAGIC_UNSIGNED) == sizeof(ZoneHeader::m_magic));
|
||||
|
||||
static constexpr const char* MAGIC_AUTH_HEADER = "IWffs100";
|
||||
inline static const uint8_t RSA_PUBLIC_KEY_INFINITY_WARD[]
|
||||
{
|
||||
0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01,
|
||||
0x00, 0xA5, 0x86, 0xCC, 0x18, 0xA9, 0x12, 0x17,
|
||||
0x4F, 0x3A, 0xC9, 0x0C, 0xD2, 0x38, 0x5D, 0xDB,
|
||||
0x67, 0x62, 0xA4, 0xE3, 0xD4, 0x42, 0x05, 0x8A,
|
||||
0x57, 0x0C, 0x31, 0x4E, 0x19, 0xE4, 0xBA, 0x89,
|
||||
0x73, 0x13, 0xDB, 0x72, 0x25, 0x63, 0xB1, 0x2F,
|
||||
0xD7, 0xF1, 0x08, 0x48, 0x34, 0x06, 0xD7, 0x84,
|
||||
0x5F, 0xC8, 0xCF, 0x2F, 0xB6, 0xA3, 0x5A, 0x8F,
|
||||
0x7E, 0xAA, 0x9D, 0x51, 0xE7, 0x0F, 0xB9, 0x07,
|
||||
0xB7, 0x30, 0x91, 0x04, 0x39, 0x9C, 0xDC, 0x1C,
|
||||
0xF1, 0x16, 0xCB, 0x96, 0x10, 0xEB, 0x38, 0xB1,
|
||||
0x3B, 0xBA, 0x42, 0xE3, 0xE2, 0x78, 0xBD, 0x77,
|
||||
0x82, 0x1A, 0x2B, 0x54, 0x27, 0x0A, 0xF7, 0x66,
|
||||
0x06, 0xAD, 0x46, 0x39, 0xC0, 0xEB, 0xB5, 0xC2,
|
||||
0x27, 0xDD, 0x2C, 0x08, 0x62, 0x2C, 0x0B, 0xC4,
|
||||
0x00, 0x0D, 0xCB, 0xAD, 0x22, 0x67, 0x01, 0xA6,
|
||||
0x92, 0x9C, 0x00, 0xAF, 0x9D, 0x55, 0xCC, 0x68,
|
||||
0xEC, 0x39, 0x49, 0x85, 0x7E, 0x2C, 0x98, 0xCF,
|
||||
0x4C, 0x12, 0x8D, 0xED, 0xC7, 0x1D, 0x21, 0x54,
|
||||
0x9C, 0x2F, 0xC9, 0x54, 0x36, 0x08, 0xA9, 0x67,
|
||||
0xEE, 0x91, 0xE6, 0xD9, 0xB1, 0xFA, 0xA9, 0x2B,
|
||||
0x88, 0xAD, 0x2A, 0xD0, 0xAA, 0x28, 0xF9, 0x47,
|
||||
0xA6, 0x0F, 0xCF, 0x55, 0x4C, 0x9B, 0x26, 0x41,
|
||||
0x89, 0x76, 0x11, 0xFD, 0x1B, 0x83, 0xE4, 0xE8,
|
||||
0x8E, 0x7E, 0xB4, 0x03, 0xA3, 0x29, 0xDD, 0x4F,
|
||||
0xAC, 0x99, 0xBE, 0x7C, 0xD3, 0xFD, 0x14, 0x28,
|
||||
0x1C, 0x59, 0x69, 0xE0, 0x79, 0x5F, 0x4B, 0xDA,
|
||||
0x6B, 0xAB, 0x48, 0x4E, 0x28, 0x39, 0x84, 0xC6,
|
||||
0x2B, 0xC6, 0x20, 0x05, 0xDB, 0x05, 0x21, 0xC3,
|
||||
0xE1, 0xD4, 0x20, 0x28, 0xDD, 0x3A, 0x4D, 0x51,
|
||||
0xE7, 0x49, 0x8A, 0x49, 0xEF, 0xF5, 0xDA, 0xDA,
|
||||
0x7D, 0x5D, 0xA8, 0x0B, 0xA1, 0x77, 0xCD, 0x62,
|
||||
0x7D, 0x9D, 0x40, 0x26, 0x44, 0x4B, 0x3B, 0x0A,
|
||||
0x89, 0x02, 0x03, 0x01, 0x00, 0x01
|
||||
};
|
||||
inline static const uint8_t RSA_PUBLIC_KEY_INFINITY_WARD[]{
|
||||
0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xA5, 0x86, 0xCC, 0x18, 0xA9, 0x12, 0x17, 0x4F, 0x3A, 0xC9, 0x0C, 0xD2, 0x38, 0x5D,
|
||||
0xDB, 0x67, 0x62, 0xA4, 0xE3, 0xD4, 0x42, 0x05, 0x8A, 0x57, 0x0C, 0x31, 0x4E, 0x19, 0xE4, 0xBA, 0x89, 0x73, 0x13, 0xDB, 0x72, 0x25, 0x63,
|
||||
0xB1, 0x2F, 0xD7, 0xF1, 0x08, 0x48, 0x34, 0x06, 0xD7, 0x84, 0x5F, 0xC8, 0xCF, 0x2F, 0xB6, 0xA3, 0x5A, 0x8F, 0x7E, 0xAA, 0x9D, 0x51, 0xE7,
|
||||
0x0F, 0xB9, 0x07, 0xB7, 0x30, 0x91, 0x04, 0x39, 0x9C, 0xDC, 0x1C, 0xF1, 0x16, 0xCB, 0x96, 0x10, 0xEB, 0x38, 0xB1, 0x3B, 0xBA, 0x42, 0xE3,
|
||||
0xE2, 0x78, 0xBD, 0x77, 0x82, 0x1A, 0x2B, 0x54, 0x27, 0x0A, 0xF7, 0x66, 0x06, 0xAD, 0x46, 0x39, 0xC0, 0xEB, 0xB5, 0xC2, 0x27, 0xDD, 0x2C,
|
||||
0x08, 0x62, 0x2C, 0x0B, 0xC4, 0x00, 0x0D, 0xCB, 0xAD, 0x22, 0x67, 0x01, 0xA6, 0x92, 0x9C, 0x00, 0xAF, 0x9D, 0x55, 0xCC, 0x68, 0xEC, 0x39,
|
||||
0x49, 0x85, 0x7E, 0x2C, 0x98, 0xCF, 0x4C, 0x12, 0x8D, 0xED, 0xC7, 0x1D, 0x21, 0x54, 0x9C, 0x2F, 0xC9, 0x54, 0x36, 0x08, 0xA9, 0x67, 0xEE,
|
||||
0x91, 0xE6, 0xD9, 0xB1, 0xFA, 0xA9, 0x2B, 0x88, 0xAD, 0x2A, 0xD0, 0xAA, 0x28, 0xF9, 0x47, 0xA6, 0x0F, 0xCF, 0x55, 0x4C, 0x9B, 0x26, 0x41,
|
||||
0x89, 0x76, 0x11, 0xFD, 0x1B, 0x83, 0xE4, 0xE8, 0x8E, 0x7E, 0xB4, 0x03, 0xA3, 0x29, 0xDD, 0x4F, 0xAC, 0x99, 0xBE, 0x7C, 0xD3, 0xFD, 0x14,
|
||||
0x28, 0x1C, 0x59, 0x69, 0xE0, 0x79, 0x5F, 0x4B, 0xDA, 0x6B, 0xAB, 0x48, 0x4E, 0x28, 0x39, 0x84, 0xC6, 0x2B, 0xC6, 0x20, 0x05, 0xDB, 0x05,
|
||||
0x21, 0xC3, 0xE1, 0xD4, 0x20, 0x28, 0xDD, 0x3A, 0x4D, 0x51, 0xE7, 0x49, 0x8A, 0x49, 0xEF, 0xF5, 0xDA, 0xDA, 0x7D, 0x5D, 0xA8, 0x0B, 0xA1,
|
||||
0x77, 0xCD, 0x62, 0x7D, 0x9D, 0x40, 0x26, 0x44, 0x4B, 0x3B, 0x0A, 0x89, 0x02, 0x03, 0x01, 0x00, 0x01};
|
||||
|
||||
static constexpr size_t AUTHED_CHUNK_SIZE = 0x2000;
|
||||
static constexpr unsigned AUTHED_CHUNK_COUNT_PER_GROUP = 256;
|
||||
@ -66,4 +42,4 @@ namespace IW5
|
||||
static constexpr int OFFSET_BLOCK_BIT_COUNT = 4;
|
||||
static constexpr block_t INSERT_BLOCK = XFILE_BLOCK_VIRTUAL;
|
||||
};
|
||||
}
|
||||
} // namespace IW5
|
||||
|
@ -1,77 +1,39 @@
|
||||
#include "GameAssetPoolT5.h"
|
||||
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
using namespace T5;
|
||||
|
||||
const char* GameAssetPoolT5::ASSET_TYPE_NAMES[]
|
||||
{
|
||||
"xmodelpieces",
|
||||
"physpreset",
|
||||
"physconstraints",
|
||||
"destructibledef",
|
||||
"xanim",
|
||||
"xmodel",
|
||||
"material",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"soundbank",
|
||||
"soundpatch",
|
||||
"clipmap",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"gameworldsp",
|
||||
"gameworldmp",
|
||||
"mapents",
|
||||
"gfxworld",
|
||||
"gfxlightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"weapon",
|
||||
"weapondef",
|
||||
"weaponvariant",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"fximpacttable",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"mpbody",
|
||||
"mphead",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"stringtable",
|
||||
"packindex",
|
||||
"xglobals",
|
||||
"ddl",
|
||||
"glasses",
|
||||
"emblemset"
|
||||
};
|
||||
const char* GameAssetPoolT5::ASSET_TYPE_NAMES[]{
|
||||
"xmodelpieces", "physpreset", "physconstraints", "destructibledef", "xanim", "xmodel", "material",
|
||||
"techniqueset", "image", "soundbank", "soundpatch", "clipmap", "clipmap", "comworld",
|
||||
"gameworldsp", "gameworldmp", "mapents", "gfxworld", "gfxlightdef", "uimap", "font",
|
||||
"menulist", "menu", "localize", "weapon", "weapondef", "weaponvariant", "snddriverglobals",
|
||||
"fx", "fximpacttable", "aitype", "mptype", "mpbody", "mphead", "character",
|
||||
"xmodelalias", "rawfile", "stringtable", "packindex", "xglobals", "ddl", "glasses",
|
||||
"emblemset"};
|
||||
|
||||
GameAssetPoolT5::GameAssetPoolT5(Zone* zone, const int priority)
|
||||
: ZoneAssetPools(zone),
|
||||
m_priority(priority)
|
||||
m_priority(priority)
|
||||
{
|
||||
assert(std::extent<decltype(ASSET_TYPE_NAMES)>::value == ASSET_TYPE_COUNT);
|
||||
}
|
||||
|
||||
void GameAssetPoolT5::InitPoolStatic(const asset_type_t type, const size_t capacity)
|
||||
{
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
@ -120,14 +82,14 @@ void GameAssetPoolT5::InitPoolStatic(const asset_type_t type, const size_t capac
|
||||
|
||||
void GameAssetPoolT5::InitPoolDynamic(const asset_type_t type)
|
||||
{
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
@ -174,19 +136,19 @@ void GameAssetPoolT5::InitPoolDynamic(const asset_type_t type)
|
||||
#undef CASE_INIT_POOL_STATIC
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolT5::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone)
|
||||
XAssetInfoGeneric* GameAssetPoolT5::AddAssetToPool(
|
||||
asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
|
||||
{
|
||||
XAsset xAsset{};
|
||||
|
||||
xAsset.type = static_cast<XAssetType>(type);
|
||||
xAsset.header.data = asset;
|
||||
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
}
|
||||
|
||||
switch (xAsset.type)
|
||||
@ -237,12 +199,12 @@ XAssetInfoGeneric* GameAssetPoolT5::AddAssetToPool(asset_type_t type, std::strin
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolT5::GetAsset(const asset_type_t type, std::string name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Game/T5/T5.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class GameAssetPoolT5 final : public ZoneAssetPools
|
||||
{
|
||||
@ -14,7 +14,12 @@ class GameAssetPoolT5 final : public ZoneAssetPools
|
||||
static const char* ASSET_TYPE_NAMES[];
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone) override;
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type,
|
||||
std::string name,
|
||||
void* asset,
|
||||
std::vector<XAssetInfoGeneric*> dependencies,
|
||||
std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone) override;
|
||||
|
||||
public:
|
||||
std::unique_ptr<AssetPool<T5::PhysPreset>> m_phys_preset;
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
#include "Game/T5/T5.h"
|
||||
#include "Zone/ZoneTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "Zone/ZoneTypes.h"
|
||||
#include "Game/T5/T5.h"
|
||||
|
||||
namespace T5
|
||||
{
|
||||
class ZoneConstants final
|
||||
@ -14,7 +14,7 @@ namespace T5
|
||||
public:
|
||||
static constexpr const char* MAGIC_UNSIGNED = "IWffu100";
|
||||
static constexpr int ZONE_VERSION = 473;
|
||||
|
||||
|
||||
static_assert(std::char_traits<char>::length(MAGIC_UNSIGNED) == sizeof(ZoneHeader::m_magic));
|
||||
|
||||
static constexpr size_t AUTHED_CHUNK_SIZE = 0x2000;
|
||||
@ -23,4 +23,4 @@ namespace T5
|
||||
static constexpr int OFFSET_BLOCK_BIT_COUNT = 3;
|
||||
static constexpr block_t INSERT_BLOCK = XFILE_BLOCK_VIRTUAL;
|
||||
};
|
||||
}
|
||||
} // namespace T5
|
||||
|
@ -1,76 +1,73 @@
|
||||
#include "GameAssetPoolT6.h"
|
||||
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
||||
#include "Pool/AssetPoolStatic.h"
|
||||
#include "Pool/AssetPoolDynamic.h"
|
||||
|
||||
using namespace T6;
|
||||
|
||||
const char* GameAssetPoolT6::ASSET_TYPE_NAMES[]
|
||||
{
|
||||
"xmodelpieces",
|
||||
"physpreset",
|
||||
"physconstraints",
|
||||
"destructibledef",
|
||||
"xanim",
|
||||
"xmodel",
|
||||
"material",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"soundbank",
|
||||
"soundpatch",
|
||||
"clipmap",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"gameworldsp",
|
||||
"gameworldmp",
|
||||
"mapents",
|
||||
"gfxworld",
|
||||
"gfxlightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"fonticon",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"weapon",
|
||||
"weapondef",
|
||||
"weaponvariant",
|
||||
"weaponfull",
|
||||
"attachment",
|
||||
"attachmentunique",
|
||||
"camo",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"fximpacttable",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"mpbody",
|
||||
"mphead",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"xglobals",
|
||||
"ddl",
|
||||
"glasses",
|
||||
"emblemset",
|
||||
"script",
|
||||
"keyvaluepairs",
|
||||
"vehicle",
|
||||
"memoryblock",
|
||||
"addonmapents",
|
||||
"tracer",
|
||||
"skinnedverts",
|
||||
"qdb",
|
||||
"slug",
|
||||
"footsteptable",
|
||||
"footstepfxtable",
|
||||
"zbarrier"
|
||||
};
|
||||
const char* GameAssetPoolT6::ASSET_TYPE_NAMES[]{"xmodelpieces",
|
||||
"physpreset",
|
||||
"physconstraints",
|
||||
"destructibledef",
|
||||
"xanim",
|
||||
"xmodel",
|
||||
"material",
|
||||
"techniqueset",
|
||||
"image",
|
||||
"soundbank",
|
||||
"soundpatch",
|
||||
"clipmap",
|
||||
"clipmap",
|
||||
"comworld",
|
||||
"gameworldsp",
|
||||
"gameworldmp",
|
||||
"mapents",
|
||||
"gfxworld",
|
||||
"gfxlightdef",
|
||||
"uimap",
|
||||
"font",
|
||||
"fonticon",
|
||||
"menulist",
|
||||
"menu",
|
||||
"localize",
|
||||
"weapon",
|
||||
"weapondef",
|
||||
"weaponvariant",
|
||||
"weaponfull",
|
||||
"attachment",
|
||||
"attachmentunique",
|
||||
"camo",
|
||||
"snddriverglobals",
|
||||
"fx",
|
||||
"fximpacttable",
|
||||
"aitype",
|
||||
"mptype",
|
||||
"mpbody",
|
||||
"mphead",
|
||||
"character",
|
||||
"xmodelalias",
|
||||
"rawfile",
|
||||
"stringtable",
|
||||
"leaderboard",
|
||||
"xglobals",
|
||||
"ddl",
|
||||
"glasses",
|
||||
"emblemset",
|
||||
"script",
|
||||
"keyvaluepairs",
|
||||
"vehicle",
|
||||
"memoryblock",
|
||||
"addonmapents",
|
||||
"tracer",
|
||||
"skinnedverts",
|
||||
"qdb",
|
||||
"slug",
|
||||
"footsteptable",
|
||||
"footstepfxtable",
|
||||
"zbarrier"};
|
||||
|
||||
GameAssetPoolT6::GameAssetPoolT6(Zone* zone, const int priority)
|
||||
: ZoneAssetPools(zone),
|
||||
@ -81,67 +78,67 @@ GameAssetPoolT6::GameAssetPoolT6(Zone* zone, const int priority)
|
||||
|
||||
void GameAssetPoolT6::InitPoolStatic(const asset_type_t type, const size_t capacity)
|
||||
{
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_STATIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr && capacity > 0) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolStatic<poolType>>(capacity, m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PHYSPRESET, m_phys_preset, PhysPreset);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PHYSCONSTRAINTS, m_phys_constraints, PhysConstraints);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_DESTRUCTIBLEDEF, m_destructible_def, DestructibleDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XANIMPARTS, m_xanim_parts, XAnimParts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XMODEL, m_xmodel, XModel);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MATERIAL, m_material, Material);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, MaterialTechniqueSet);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_IMAGE, m_image, GfxImage);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SOUND, m_sound_bank, SndBank);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SOUND_PATCH, m_sound_patch, SndPatch);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_CLIPMAP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_CLIPMAP_PVS, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_COMWORLD, m_com_world, ComWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, GameWorldSp);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, GameWorldMp);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MAP_ENTS, m_map_ents, MapEnts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GFXWORLD, m_gfx_world, GfxWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, GfxLightDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FONT, m_font, Font_s);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FONTICON, m_font_icon, FontIcon);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MENULIST, m_menu_list, MenuList);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MENU, m_menu_def, menuDef_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, LocalizeEntry);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_WEAPON, m_weapon, WeaponVariantDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ATTACHMENT, m_attachment, WeaponAttachment);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ATTACHMENT_UNIQUE, m_attachment_unique, WeaponAttachmentUnique);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_WEAPON_CAMO, m_camo, WeaponCamo);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SNDDRIVER_GLOBALS, m_snd_driver_globals, SndDriverGlobals);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FX, m_fx, FxEffectDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, FxImpactTable);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_RAWFILE, m_raw_file, RawFile);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_STRINGTABLE, m_string_table, StringTable);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LEADERBOARD, m_leaderboard, LeaderboardDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XGLOBALS, m_xglobals, XGlobals);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_DDL, m_ddl, ddlRoot_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GLASSES, m_glasses, Glasses);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_EMBLEMSET, m_emblem_set, EmblemSet);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SCRIPTPARSETREE, m_script, ScriptParseTree);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_KEYVALUEPAIRS, m_key_value_pairs, KeyValuePairs);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_VEHICLEDEF, m_vehicle, VehicleDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MEMORYBLOCK, m_memory_block, MemoryBlock);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_TRACER, m_tracer, TracerDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SKINNEDVERTS, m_skinned_verts, SkinnedVertsDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_QDB, m_qdb, Qdb);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SLUG, m_slug, Slug);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FOOTSTEP_TABLE, m_footstep_table, FootstepTableDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FOOTSTEPFX_TABLE, m_footstep_fx_table, FootstepFXTableDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ZBARRIER, m_zbarrier, ZBarrierDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PHYSPRESET, m_phys_preset, PhysPreset);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_PHYSCONSTRAINTS, m_phys_constraints, PhysConstraints);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_DESTRUCTIBLEDEF, m_destructible_def, DestructibleDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XANIMPARTS, m_xanim_parts, XAnimParts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XMODEL, m_xmodel, XModel);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MATERIAL, m_material, Material);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, MaterialTechniqueSet);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_IMAGE, m_image, GfxImage);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SOUND, m_sound_bank, SndBank);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SOUND_PATCH, m_sound_patch, SndPatch);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_CLIPMAP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_CLIPMAP_PVS, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_COMWORLD, m_com_world, ComWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, GameWorldSp);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, GameWorldMp);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MAP_ENTS, m_map_ents, MapEnts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GFXWORLD, m_gfx_world, GfxWorld);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, GfxLightDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FONT, m_font, Font_s);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FONTICON, m_font_icon, FontIcon);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MENULIST, m_menu_list, MenuList);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MENU, m_menu_def, menuDef_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, LocalizeEntry);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_WEAPON, m_weapon, WeaponVariantDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ATTACHMENT, m_attachment, WeaponAttachment);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ATTACHMENT_UNIQUE, m_attachment_unique, WeaponAttachmentUnique);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_WEAPON_CAMO, m_camo, WeaponCamo);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SNDDRIVER_GLOBALS, m_snd_driver_globals, SndDriverGlobals);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FX, m_fx, FxEffectDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, FxImpactTable);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_RAWFILE, m_raw_file, RawFile);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_STRINGTABLE, m_string_table, StringTable);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_LEADERBOARD, m_leaderboard, LeaderboardDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_XGLOBALS, m_xglobals, XGlobals);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_DDL, m_ddl, ddlRoot_t);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_GLASSES, m_glasses, Glasses);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_EMBLEMSET, m_emblem_set, EmblemSet);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SCRIPTPARSETREE, m_script, ScriptParseTree);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_KEYVALUEPAIRS, m_key_value_pairs, KeyValuePairs);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_VEHICLEDEF, m_vehicle, VehicleDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_MEMORYBLOCK, m_memory_block, MemoryBlock);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_TRACER, m_tracer, TracerDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SKINNEDVERTS, m_skinned_verts, SkinnedVertsDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_QDB, m_qdb, Qdb);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_SLUG, m_slug, Slug);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FOOTSTEP_TABLE, m_footstep_table, FootstepTableDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_FOOTSTEPFX_TABLE, m_footstep_fx_table, FootstepFXTableDef);
|
||||
CASE_INIT_POOL_STATIC(ASSET_TYPE_ZBARRIER, m_zbarrier, ZBarrierDef);
|
||||
|
||||
default:
|
||||
assert(type >= 0 && type < ASSET_TYPE_COUNT);
|
||||
@ -153,67 +150,67 @@ void GameAssetPoolT6::InitPoolStatic(const asset_type_t type, const size_t capac
|
||||
|
||||
void GameAssetPoolT6::InitPoolDynamic(const asset_type_t type)
|
||||
{
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
#define CASE_INIT_POOL_DYNAMIC(assetType, poolName, poolType) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) == nullptr) \
|
||||
{ \
|
||||
(poolName) = std::make_unique<AssetPoolDynamic<poolType>>(m_priority, (assetType)); \
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PHYSPRESET, m_phys_preset, PhysPreset);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PHYSCONSTRAINTS, m_phys_constraints, PhysConstraints);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_DESTRUCTIBLEDEF, m_destructible_def, DestructibleDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XANIMPARTS, m_xanim_parts, XAnimParts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XMODEL, m_xmodel, XModel);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MATERIAL, m_material, Material);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, MaterialTechniqueSet);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_IMAGE, m_image, GfxImage);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SOUND, m_sound_bank, SndBank);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SOUND_PATCH, m_sound_patch, SndPatch);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_CLIPMAP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_CLIPMAP_PVS, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_COMWORLD, m_com_world, ComWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, GameWorldSp);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, GameWorldMp);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MAP_ENTS, m_map_ents, MapEnts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GFXWORLD, m_gfx_world, GfxWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, GfxLightDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FONT, m_font, Font_s);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FONTICON, m_font_icon, FontIcon);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MENULIST, m_menu_list, MenuList);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MENU, m_menu_def, menuDef_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, LocalizeEntry);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_WEAPON, m_weapon, WeaponVariantDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ATTACHMENT, m_attachment, WeaponAttachment);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ATTACHMENT_UNIQUE, m_attachment_unique, WeaponAttachmentUnique);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_WEAPON_CAMO, m_camo, WeaponCamo);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SNDDRIVER_GLOBALS, m_snd_driver_globals, SndDriverGlobals);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FX, m_fx, FxEffectDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, FxImpactTable);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_RAWFILE, m_raw_file, RawFile);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_STRINGTABLE, m_string_table, StringTable);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LEADERBOARD, m_leaderboard, LeaderboardDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XGLOBALS, m_xglobals, XGlobals);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_DDL, m_ddl, ddlRoot_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GLASSES, m_glasses, Glasses);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_EMBLEMSET, m_emblem_set, EmblemSet);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SCRIPTPARSETREE, m_script, ScriptParseTree);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_KEYVALUEPAIRS, m_key_value_pairs, KeyValuePairs);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_VEHICLEDEF, m_vehicle, VehicleDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MEMORYBLOCK, m_memory_block, MemoryBlock);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_TRACER, m_tracer, TracerDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SKINNEDVERTS, m_skinned_verts, SkinnedVertsDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_QDB, m_qdb, Qdb);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SLUG, m_slug, Slug);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FOOTSTEP_TABLE, m_footstep_table, FootstepTableDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FOOTSTEPFX_TABLE, m_footstep_fx_table, FootstepFXTableDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ZBARRIER, m_zbarrier, ZBarrierDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PHYSPRESET, m_phys_preset, PhysPreset);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_PHYSCONSTRAINTS, m_phys_constraints, PhysConstraints);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_DESTRUCTIBLEDEF, m_destructible_def, DestructibleDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XANIMPARTS, m_xanim_parts, XAnimParts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XMODEL, m_xmodel, XModel);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MATERIAL, m_material, Material);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, MaterialTechniqueSet);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_IMAGE, m_image, GfxImage);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SOUND, m_sound_bank, SndBank);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SOUND_PATCH, m_sound_patch, SndPatch);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_CLIPMAP, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_CLIPMAP_PVS, m_clip_map, clipMap_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_COMWORLD, m_com_world, ComWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, GameWorldSp);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, GameWorldMp);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MAP_ENTS, m_map_ents, MapEnts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GFXWORLD, m_gfx_world, GfxWorld);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, GfxLightDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FONT, m_font, Font_s);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FONTICON, m_font_icon, FontIcon);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MENULIST, m_menu_list, MenuList);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MENU, m_menu_def, menuDef_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, LocalizeEntry);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_WEAPON, m_weapon, WeaponVariantDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ATTACHMENT, m_attachment, WeaponAttachment);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ATTACHMENT_UNIQUE, m_attachment_unique, WeaponAttachmentUnique);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_WEAPON_CAMO, m_camo, WeaponCamo);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SNDDRIVER_GLOBALS, m_snd_driver_globals, SndDriverGlobals);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FX, m_fx, FxEffectDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, FxImpactTable);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_RAWFILE, m_raw_file, RawFile);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_STRINGTABLE, m_string_table, StringTable);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_LEADERBOARD, m_leaderboard, LeaderboardDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_XGLOBALS, m_xglobals, XGlobals);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_DDL, m_ddl, ddlRoot_t);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_GLASSES, m_glasses, Glasses);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_EMBLEMSET, m_emblem_set, EmblemSet);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SCRIPTPARSETREE, m_script, ScriptParseTree);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_KEYVALUEPAIRS, m_key_value_pairs, KeyValuePairs);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_VEHICLEDEF, m_vehicle, VehicleDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_MEMORYBLOCK, m_memory_block, MemoryBlock);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_TRACER, m_tracer, TracerDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SKINNEDVERTS, m_skinned_verts, SkinnedVertsDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_QDB, m_qdb, Qdb);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_SLUG, m_slug, Slug);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FOOTSTEP_TABLE, m_footstep_table, FootstepTableDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_FOOTSTEPFX_TABLE, m_footstep_fx_table, FootstepFXTableDef);
|
||||
CASE_INIT_POOL_DYNAMIC(ASSET_TYPE_ZBARRIER, m_zbarrier, ZBarrierDef);
|
||||
|
||||
default:
|
||||
assert(type >= 0 && type < ASSET_TYPE_COUNT);
|
||||
@ -223,72 +220,72 @@ void GameAssetPoolT6::InitPoolDynamic(const asset_type_t type)
|
||||
#undef CASE_INIT_POOL_STATIC
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolT6::AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone)
|
||||
XAssetInfoGeneric* GameAssetPoolT6::AddAssetToPool(
|
||||
asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone)
|
||||
{
|
||||
XAsset xAsset{};
|
||||
|
||||
xAsset.type = static_cast<XAssetType>(type);
|
||||
xAsset.header.data = asset;
|
||||
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
#define CASE_ADD_TO_POOL(assetType, poolName, headerName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
assert((poolName) != nullptr); \
|
||||
return (poolName)->AddAsset(std::move(name), xAsset.header.headerName, zone, std::move(dependencies), std::move(usedScriptStrings)); \
|
||||
}
|
||||
|
||||
switch (xAsset.type)
|
||||
{
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PHYSPRESET, m_phys_preset, physPreset);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PHYSCONSTRAINTS, m_phys_constraints, physConstraints);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_DESTRUCTIBLEDEF, m_destructible_def, destructibleDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XANIMPARTS, m_xanim_parts, parts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XMODEL, m_xmodel, model);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MATERIAL, m_material, material);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, techniqueSet);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_IMAGE, m_image, image);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SOUND, m_sound_bank, sound);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SOUND_PATCH, m_sound_patch, soundPatch);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_CLIPMAP, m_clip_map, clipMap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_CLIPMAP_PVS, m_clip_map, clipMap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_COMWORLD, m_com_world, comWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, gameWorldSp);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, gameWorldMp);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MAP_ENTS, m_map_ents, mapEnts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GFXWORLD, m_gfx_world, gfxWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, lightDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FONT, m_font, font);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FONTICON, m_font_icon, fontIcon);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MENULIST, m_menu_list, menuList);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MENU, m_menu_def, menu);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, localize);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_WEAPON, m_weapon, weapon);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ATTACHMENT, m_attachment, attachment);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ATTACHMENT_UNIQUE, m_attachment_unique, attachmentUnique);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_WEAPON_CAMO, m_camo, weaponCamo);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SNDDRIVER_GLOBALS, m_snd_driver_globals, sndDriverGlobals);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FX, m_fx, fx);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, impactFx);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_RAWFILE, m_raw_file, rawfile);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_STRINGTABLE, m_string_table, stringTable);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LEADERBOARD, m_leaderboard, leaderboardDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XGLOBALS, m_xglobals, xGlobals);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_DDL, m_ddl, ddlRoot);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GLASSES, m_glasses, glasses);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_EMBLEMSET, m_emblem_set, emblemSet);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SCRIPTPARSETREE, m_script, scriptParseTree);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_KEYVALUEPAIRS, m_key_value_pairs, keyValuePairs);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_VEHICLEDEF, m_vehicle, vehicleDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MEMORYBLOCK, m_memory_block, memoryBlock);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, addonMapEnts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_TRACER, m_tracer, tracerDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SKINNEDVERTS, m_skinned_verts, skinnedVertsDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_QDB, m_qdb, qdb);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SLUG, m_slug, slug);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FOOTSTEP_TABLE, m_footstep_table, footstepTableDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FOOTSTEPFX_TABLE, m_footstep_fx_table, footstepFXTableDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ZBARRIER, m_zbarrier, zbarrierDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PHYSPRESET, m_phys_preset, physPreset);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_PHYSCONSTRAINTS, m_phys_constraints, physConstraints);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_DESTRUCTIBLEDEF, m_destructible_def, destructibleDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XANIMPARTS, m_xanim_parts, parts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XMODEL, m_xmodel, model);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MATERIAL, m_material, material);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_TECHNIQUE_SET, m_technique_set, techniqueSet);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_IMAGE, m_image, image);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SOUND, m_sound_bank, sound);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SOUND_PATCH, m_sound_patch, soundPatch);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_CLIPMAP, m_clip_map, clipMap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_CLIPMAP_PVS, m_clip_map, clipMap);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_COMWORLD, m_com_world, comWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp, gameWorldSp);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp, gameWorldMp);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MAP_ENTS, m_map_ents, mapEnts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GFXWORLD, m_gfx_world, gfxWorld);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def, lightDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FONT, m_font, font);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FONTICON, m_font_icon, fontIcon);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MENULIST, m_menu_list, menuList);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MENU, m_menu_def, menu);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LOCALIZE_ENTRY, m_localize, localize);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_WEAPON, m_weapon, weapon);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ATTACHMENT, m_attachment, attachment);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ATTACHMENT_UNIQUE, m_attachment_unique, attachmentUnique);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_WEAPON_CAMO, m_camo, weaponCamo);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SNDDRIVER_GLOBALS, m_snd_driver_globals, sndDriverGlobals);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FX, m_fx, fx);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_IMPACT_FX, m_fx_impact_table, impactFx);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_RAWFILE, m_raw_file, rawfile);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_STRINGTABLE, m_string_table, stringTable);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_LEADERBOARD, m_leaderboard, leaderboardDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_XGLOBALS, m_xglobals, xGlobals);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_DDL, m_ddl, ddlRoot);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_GLASSES, m_glasses, glasses);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_EMBLEMSET, m_emblem_set, emblemSet);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SCRIPTPARSETREE, m_script, scriptParseTree);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_KEYVALUEPAIRS, m_key_value_pairs, keyValuePairs);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_VEHICLEDEF, m_vehicle, vehicleDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_MEMORYBLOCK, m_memory_block, memoryBlock);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents, addonMapEnts);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_TRACER, m_tracer, tracerDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SKINNEDVERTS, m_skinned_verts, skinnedVertsDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_QDB, m_qdb, qdb);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_SLUG, m_slug, slug);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FOOTSTEP_TABLE, m_footstep_table, footstepTableDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_FOOTSTEPFX_TABLE, m_footstep_fx_table, footstepFXTableDef);
|
||||
CASE_ADD_TO_POOL(ASSET_TYPE_ZBARRIER, m_zbarrier, zbarrierDef);
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
@ -302,65 +299,65 @@ XAssetInfoGeneric* GameAssetPoolT6::AddAssetToPool(asset_type_t type, std::strin
|
||||
|
||||
XAssetInfoGeneric* GameAssetPoolT6::GetAsset(const asset_type_t type, std::string name) const
|
||||
{
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
#define CASE_GET_ASSET(assetType, poolName) \
|
||||
case assetType: \
|
||||
{ \
|
||||
if ((poolName) != nullptr) \
|
||||
return (poolName)->GetAsset(std::move(name)); \
|
||||
break; \
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
CASE_GET_ASSET(ASSET_TYPE_PHYSPRESET, m_phys_preset);
|
||||
CASE_GET_ASSET(ASSET_TYPE_PHYSCONSTRAINTS, m_phys_constraints);
|
||||
CASE_GET_ASSET(ASSET_TYPE_DESTRUCTIBLEDEF, m_destructible_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XANIMPARTS, m_xanim_parts);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XMODEL, m_xmodel);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MATERIAL, m_material);
|
||||
CASE_GET_ASSET(ASSET_TYPE_TECHNIQUE_SET, m_technique_set);
|
||||
CASE_GET_ASSET(ASSET_TYPE_IMAGE, m_image);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SOUND, m_sound_bank);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SOUND_PATCH, m_sound_patch);
|
||||
CASE_GET_ASSET(ASSET_TYPE_CLIPMAP, m_clip_map);
|
||||
CASE_GET_ASSET(ASSET_TYPE_CLIPMAP_PVS, m_clip_map);
|
||||
CASE_GET_ASSET(ASSET_TYPE_COMWORLD, m_com_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MAP_ENTS, m_map_ents);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GFXWORLD, m_gfx_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FONT, m_font);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FONTICON, m_font_icon);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MENULIST, m_menu_list);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MENU, m_menu_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, m_localize);
|
||||
CASE_GET_ASSET(ASSET_TYPE_WEAPON, m_weapon);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ATTACHMENT, m_attachment);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ATTACHMENT_UNIQUE, m_attachment_unique);
|
||||
CASE_GET_ASSET(ASSET_TYPE_WEAPON_CAMO, m_camo);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, m_snd_driver_globals);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FX, m_fx);
|
||||
CASE_GET_ASSET(ASSET_TYPE_IMPACT_FX, m_fx_impact_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_RAWFILE, m_raw_file);
|
||||
CASE_GET_ASSET(ASSET_TYPE_STRINGTABLE, m_string_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LEADERBOARD, m_leaderboard);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XGLOBALS, m_xglobals);
|
||||
CASE_GET_ASSET(ASSET_TYPE_DDL, m_ddl);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GLASSES, m_glasses);
|
||||
CASE_GET_ASSET(ASSET_TYPE_EMBLEMSET, m_emblem_set);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SCRIPTPARSETREE, m_script);
|
||||
CASE_GET_ASSET(ASSET_TYPE_KEYVALUEPAIRS, m_key_value_pairs);
|
||||
CASE_GET_ASSET(ASSET_TYPE_VEHICLEDEF, m_vehicle);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MEMORYBLOCK, m_memory_block);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents);
|
||||
CASE_GET_ASSET(ASSET_TYPE_TRACER, m_tracer);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SKINNEDVERTS, m_skinned_verts);
|
||||
CASE_GET_ASSET(ASSET_TYPE_QDB, m_qdb);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SLUG, m_slug);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FOOTSTEP_TABLE, m_footstep_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FOOTSTEPFX_TABLE, m_footstep_fx_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ZBARRIER, m_zbarrier);
|
||||
CASE_GET_ASSET(ASSET_TYPE_PHYSPRESET, m_phys_preset);
|
||||
CASE_GET_ASSET(ASSET_TYPE_PHYSCONSTRAINTS, m_phys_constraints);
|
||||
CASE_GET_ASSET(ASSET_TYPE_DESTRUCTIBLEDEF, m_destructible_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XANIMPARTS, m_xanim_parts);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XMODEL, m_xmodel);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MATERIAL, m_material);
|
||||
CASE_GET_ASSET(ASSET_TYPE_TECHNIQUE_SET, m_technique_set);
|
||||
CASE_GET_ASSET(ASSET_TYPE_IMAGE, m_image);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SOUND, m_sound_bank);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SOUND_PATCH, m_sound_patch);
|
||||
CASE_GET_ASSET(ASSET_TYPE_CLIPMAP, m_clip_map);
|
||||
CASE_GET_ASSET(ASSET_TYPE_CLIPMAP_PVS, m_clip_map);
|
||||
CASE_GET_ASSET(ASSET_TYPE_COMWORLD, m_com_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GAMEWORLD_SP, m_game_world_sp);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GAMEWORLD_MP, m_game_world_mp);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MAP_ENTS, m_map_ents);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GFXWORLD, m_gfx_world);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LIGHT_DEF, m_gfx_light_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FONT, m_font);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FONTICON, m_font_icon);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MENULIST, m_menu_list);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MENU, m_menu_def);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, m_localize);
|
||||
CASE_GET_ASSET(ASSET_TYPE_WEAPON, m_weapon);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ATTACHMENT, m_attachment);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ATTACHMENT_UNIQUE, m_attachment_unique);
|
||||
CASE_GET_ASSET(ASSET_TYPE_WEAPON_CAMO, m_camo);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SNDDRIVER_GLOBALS, m_snd_driver_globals);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FX, m_fx);
|
||||
CASE_GET_ASSET(ASSET_TYPE_IMPACT_FX, m_fx_impact_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_RAWFILE, m_raw_file);
|
||||
CASE_GET_ASSET(ASSET_TYPE_STRINGTABLE, m_string_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_LEADERBOARD, m_leaderboard);
|
||||
CASE_GET_ASSET(ASSET_TYPE_XGLOBALS, m_xglobals);
|
||||
CASE_GET_ASSET(ASSET_TYPE_DDL, m_ddl);
|
||||
CASE_GET_ASSET(ASSET_TYPE_GLASSES, m_glasses);
|
||||
CASE_GET_ASSET(ASSET_TYPE_EMBLEMSET, m_emblem_set);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SCRIPTPARSETREE, m_script);
|
||||
CASE_GET_ASSET(ASSET_TYPE_KEYVALUEPAIRS, m_key_value_pairs);
|
||||
CASE_GET_ASSET(ASSET_TYPE_VEHICLEDEF, m_vehicle);
|
||||
CASE_GET_ASSET(ASSET_TYPE_MEMORYBLOCK, m_memory_block);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, m_addon_map_ents);
|
||||
CASE_GET_ASSET(ASSET_TYPE_TRACER, m_tracer);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SKINNEDVERTS, m_skinned_verts);
|
||||
CASE_GET_ASSET(ASSET_TYPE_QDB, m_qdb);
|
||||
CASE_GET_ASSET(ASSET_TYPE_SLUG, m_slug);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FOOTSTEP_TABLE, m_footstep_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_FOOTSTEPFX_TABLE, m_footstep_fx_table);
|
||||
CASE_GET_ASSET(ASSET_TYPE_ZBARRIER, m_zbarrier);
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Pool/AssetPool.h"
|
||||
#include "Pool/ZoneAssetPools.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class GameAssetPoolT6 final : public ZoneAssetPools
|
||||
{
|
||||
@ -14,7 +14,12 @@ class GameAssetPoolT6 final : public ZoneAssetPools
|
||||
static const char* ASSET_TYPE_NAMES[];
|
||||
|
||||
protected:
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type, std::string name, void* asset, std::vector<XAssetInfoGeneric*> dependencies, std::vector<scr_string_t> usedScriptStrings, Zone* zone) override;
|
||||
XAssetInfoGeneric* AddAssetToPool(asset_type_t type,
|
||||
std::string name,
|
||||
void* asset,
|
||||
std::vector<XAssetInfoGeneric*> dependencies,
|
||||
std::vector<scr_string_t> usedScriptStrings,
|
||||
Zone* zone) override;
|
||||
|
||||
public:
|
||||
std::unique_ptr<AssetPool<T6::PhysPreset>> m_phys_preset;
|
||||
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
#include "Game/T6/T6.h"
|
||||
#include "Zone/ZoneTypes.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "Zone/ZoneTypes.h"
|
||||
#include "Game/T6/T6.h"
|
||||
|
||||
namespace T6
|
||||
{
|
||||
class ZoneConstants final
|
||||
@ -34,54 +34,21 @@ namespace T6
|
||||
static constexpr size_t FILE_SUFFIX_ZERO_ALIGN = 0x40;
|
||||
|
||||
static constexpr const char* MAGIC_AUTH_HEADER = "PHEEBs71";
|
||||
inline static const uint8_t SALSA20_KEY_TREYARCH[]
|
||||
{
|
||||
0x64, 0x1D, 0x8A, 0x2F,
|
||||
0xE3, 0x1D, 0x3A, 0xA6,
|
||||
0x36, 0x22, 0xBB, 0xC9,
|
||||
0xCE, 0x85, 0x87, 0x22,
|
||||
0x9D, 0x42, 0xB0, 0xF8,
|
||||
0xED, 0x9B, 0x92, 0x41,
|
||||
0x30, 0xBF, 0x88, 0xB6,
|
||||
0x5E, 0xDC, 0x50, 0xBE
|
||||
};
|
||||
inline static const uint8_t SALSA20_KEY_TREYARCH[]{0x64, 0x1D, 0x8A, 0x2F, 0xE3, 0x1D, 0x3A, 0xA6, 0x36, 0x22, 0xBB, 0xC9, 0xCE, 0x85, 0x87, 0x22,
|
||||
0x9D, 0x42, 0xB0, 0xF8, 0xED, 0x9B, 0x92, 0x41, 0x30, 0xBF, 0x88, 0xB6, 0x5E, 0xDC, 0x50, 0xBE};
|
||||
|
||||
inline static const uint8_t RSA_PUBLIC_KEY_TREYARCH[]
|
||||
{
|
||||
0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01,
|
||||
0x00, 0xc7, 0x9d, 0x33, 0xe0, 0x75, 0xaf, 0xef,
|
||||
0x08, 0x08, 0x2b, 0x89, 0xd9, 0x3b, 0xf3, 0xd5,
|
||||
0x9a, 0x65, 0xa6, 0xde, 0x3b, 0x1e, 0x20, 0xde,
|
||||
0x59, 0x19, 0x43, 0x88, 0x1a, 0x8b, 0x39, 0x13,
|
||||
0x60, 0x12, 0xd3, 0xb2, 0x77, 0x6d, 0xe1, 0x99,
|
||||
0x75, 0x24, 0xb4, 0x0d, 0x8c, 0xb7, 0x84, 0xf2,
|
||||
0x48, 0x8f, 0xd5, 0x4c, 0xb7, 0x64, 0x44, 0xa3,
|
||||
0xa8, 0x4a, 0xac, 0x2d, 0x54, 0x15, 0x2b, 0x1f,
|
||||
0xb3, 0xf4, 0x4c, 0x16, 0xa0, 0x92, 0x8e, 0xd2,
|
||||
0xfa, 0xcc, 0x11, 0x6a, 0x74, 0x6a, 0x70, 0xb8,
|
||||
0xd3, 0x34, 0x6b, 0x39, 0xc6, 0x2a, 0x69, 0xde,
|
||||
0x31, 0x34, 0xdf, 0xe7, 0x8b, 0x7e, 0x17, 0xa3,
|
||||
0x17, 0xd9, 0x5e, 0x88, 0x39, 0x21, 0xf8, 0x7d,
|
||||
0x3c, 0x29, 0x21, 0x6c, 0x0e, 0xf1, 0xb4, 0x09,
|
||||
0x54, 0xe8, 0x20, 0x34, 0x90, 0x2e, 0xb4, 0x1a,
|
||||
0x95, 0x95, 0x90, 0xe5, 0xfb, 0xce, 0xfe, 0x8a,
|
||||
0xbf, 0xea, 0xaf, 0x09, 0x0c, 0x0b, 0x87, 0x22,
|
||||
0xe1, 0xfe, 0x82, 0x6e, 0x91, 0xe8, 0xd1, 0xb6,
|
||||
0x35, 0x03, 0x4f, 0xdb, 0xc1, 0x31, 0xe2, 0xba,
|
||||
0xa0, 0x13, 0xf6, 0xdb, 0x07, 0x9b, 0xcb, 0x99,
|
||||
0xce, 0x9f, 0x49, 0xc4, 0x51, 0x8e, 0xf1, 0x04,
|
||||
0x9b, 0x30, 0xc3, 0x02, 0xff, 0x7b, 0x94, 0xca,
|
||||
0x12, 0x69, 0x1e, 0xdb, 0x2d, 0x3e, 0xbd, 0x48,
|
||||
0x16, 0xe1, 0x72, 0x37, 0xb8, 0x5f, 0x61, 0xfa,
|
||||
0x24, 0x16, 0x3a, 0xde, 0xbf, 0x6a, 0x71, 0x62,
|
||||
0x32, 0xf3, 0xaa, 0x7f, 0x28, 0x3a, 0x0c, 0x27,
|
||||
0xeb, 0xa9, 0x0a, 0x4c, 0x79, 0x88, 0x84, 0xb3,
|
||||
0xe2, 0x52, 0xb9, 0x68, 0x1e, 0x82, 0xcf, 0x67,
|
||||
0x43, 0xf3, 0x68, 0xf7, 0x26, 0x19, 0xaa, 0xdd,
|
||||
0x3f, 0x1e, 0xc6, 0x46, 0x11, 0x9f, 0x24, 0x23,
|
||||
0xa7, 0xb0, 0x1b, 0x79, 0xa7, 0x0c, 0x5a, 0xfe,
|
||||
0x96, 0xf7, 0xe7, 0x88, 0x09, 0xa6, 0x69, 0xe3,
|
||||
0x8b, 0x02, 0x03, 0x01, 0x00, 0x01
|
||||
};
|
||||
inline static const uint8_t RSA_PUBLIC_KEY_TREYARCH[]{
|
||||
0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc7, 0x9d, 0x33, 0xe0, 0x75, 0xaf, 0xef, 0x08, 0x08, 0x2b, 0x89, 0xd9, 0x3b, 0xf3,
|
||||
0xd5, 0x9a, 0x65, 0xa6, 0xde, 0x3b, 0x1e, 0x20, 0xde, 0x59, 0x19, 0x43, 0x88, 0x1a, 0x8b, 0x39, 0x13, 0x60, 0x12, 0xd3, 0xb2, 0x77, 0x6d,
|
||||
0xe1, 0x99, 0x75, 0x24, 0xb4, 0x0d, 0x8c, 0xb7, 0x84, 0xf2, 0x48, 0x8f, 0xd5, 0x4c, 0xb7, 0x64, 0x44, 0xa3, 0xa8, 0x4a, 0xac, 0x2d, 0x54,
|
||||
0x15, 0x2b, 0x1f, 0xb3, 0xf4, 0x4c, 0x16, 0xa0, 0x92, 0x8e, 0xd2, 0xfa, 0xcc, 0x11, 0x6a, 0x74, 0x6a, 0x70, 0xb8, 0xd3, 0x34, 0x6b, 0x39,
|
||||
0xc6, 0x2a, 0x69, 0xde, 0x31, 0x34, 0xdf, 0xe7, 0x8b, 0x7e, 0x17, 0xa3, 0x17, 0xd9, 0x5e, 0x88, 0x39, 0x21, 0xf8, 0x7d, 0x3c, 0x29, 0x21,
|
||||
0x6c, 0x0e, 0xf1, 0xb4, 0x09, 0x54, 0xe8, 0x20, 0x34, 0x90, 0x2e, 0xb4, 0x1a, 0x95, 0x95, 0x90, 0xe5, 0xfb, 0xce, 0xfe, 0x8a, 0xbf, 0xea,
|
||||
0xaf, 0x09, 0x0c, 0x0b, 0x87, 0x22, 0xe1, 0xfe, 0x82, 0x6e, 0x91, 0xe8, 0xd1, 0xb6, 0x35, 0x03, 0x4f, 0xdb, 0xc1, 0x31, 0xe2, 0xba, 0xa0,
|
||||
0x13, 0xf6, 0xdb, 0x07, 0x9b, 0xcb, 0x99, 0xce, 0x9f, 0x49, 0xc4, 0x51, 0x8e, 0xf1, 0x04, 0x9b, 0x30, 0xc3, 0x02, 0xff, 0x7b, 0x94, 0xca,
|
||||
0x12, 0x69, 0x1e, 0xdb, 0x2d, 0x3e, 0xbd, 0x48, 0x16, 0xe1, 0x72, 0x37, 0xb8, 0x5f, 0x61, 0xfa, 0x24, 0x16, 0x3a, 0xde, 0xbf, 0x6a, 0x71,
|
||||
0x62, 0x32, 0xf3, 0xaa, 0x7f, 0x28, 0x3a, 0x0c, 0x27, 0xeb, 0xa9, 0x0a, 0x4c, 0x79, 0x88, 0x84, 0xb3, 0xe2, 0x52, 0xb9, 0x68, 0x1e, 0x82,
|
||||
0xcf, 0x67, 0x43, 0xf3, 0x68, 0xf7, 0x26, 0x19, 0xaa, 0xdd, 0x3f, 0x1e, 0xc6, 0x46, 0x11, 0x9f, 0x24, 0x23, 0xa7, 0xb0, 0x1b, 0x79, 0xa7,
|
||||
0x0c, 0x5a, 0xfe, 0x96, 0xf7, 0xe7, 0x88, 0x09, 0xa6, 0x69, 0xe3, 0x8b, 0x02, 0x03, 0x01, 0x00, 0x01};
|
||||
};
|
||||
}
|
||||
} // namespace T6
|
||||
|
Reference in New Issue
Block a user