Add LeaderboardDef asset loading for IW4

This commit is contained in:
Jan
2020-09-09 12:03:14 +02:00
parent b4756c3688
commit 3bf47f058d
6 changed files with 67 additions and 13 deletions

View File

@ -134,7 +134,7 @@ GameAssetPoolIW4::GameAssetPoolIW4(const int priority)
m_fx_impact_table = nullptr;
m_raw_file = nullptr;
m_string_table = nullptr;
// m_leaderboard = nullptr;
m_leaderboard = nullptr;
// m_structed_data_def_set = nullptr;
// m_tracer = nullptr;
// m_vehicle = nullptr;
@ -187,7 +187,7 @@ void GameAssetPoolIW4::InitPoolStatic(const asset_type_t type, const size_t capa
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_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);
@ -247,7 +247,7 @@ void GameAssetPoolIW4::InitPoolDynamic(const asset_type_t type)
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_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);
@ -316,7 +316,7 @@ XAssetInfoGeneric* GameAssetPoolIW4::AddAsset(asset_type_t type, std::string nam
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_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);
@ -376,7 +376,7 @@ XAssetInfoGeneric* GameAssetPoolIW4::GetAsset(const asset_type_t type, std::stri
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_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);

View File

@ -46,7 +46,7 @@ public:
std::unique_ptr<AssetPool<IW4::FxImpactTable>> m_fx_impact_table;
std::unique_ptr<AssetPool<IW4::RawFile>> m_raw_file;
std::unique_ptr<AssetPool<IW4::StringTable>> m_string_table;
// std::unique_ptr<AssetPool<IW4::LeaderboardDef>> m_leaderboard;
std::unique_ptr<AssetPool<IW4::LeaderboardDef>> m_leaderboard;
// std::unique_ptr<AssetPool<IW4::StructuredDataDefSet>> m_structed_data_def_set;
// std::unique_ptr<AssetPool<IW4::TracerDef>> m_tracer;
// std::unique_ptr<AssetPool<IW4::VehicleDef>> m_vehicle;

View File

@ -105,8 +105,7 @@ namespace IW4
struct FxImpactTable;
struct RawFile;
struct StringTable;
// struct LeaderboardDef;
struct LeaderboardDef;
// struct StructuredDataDefSet;
// struct TracerDef;
// struct VehicleDef;
@ -146,7 +145,7 @@ namespace IW4
FxImpactTable* impactFx;
RawFile* rawfile;
StringTable* stringTable;
// LeaderboardDef* leaderboardDef;
LeaderboardDef* leaderboardDef;
// StructuredDataDefSet* structuredDataDefSet;
// TracerDef* tracerDef;
// VehicleDef* vehDef;
@ -1639,6 +1638,48 @@ namespace IW4
FxImpactEntry* table;
};
enum LbColType
{
LBCOL_TYPE_NUMBER = 0x0,
LBCOL_TYPE_TIME = 0x1,
LBCOL_TYPE_LEVELXP = 0x2,
LBCOL_TYPE_PRESTIGE = 0x3,
LBCOL_TYPE_BIGNUMBER = 0x4,
LBCOL_TYPE_PERCENT = 0x5,
LBCOL_TYPE_COUNT = 0x6,
};
enum LbAggType
{
LBAGG_TYPE_MIN = 0x0,
LBAGG_TYPE_MAX = 0x1,
LBAGG_TYPE_SUM = 0x2,
LBAGG_TYPE_LAST = 0x3,
LBAGG_TYPE_COUNT = 0x4,
};
struct LbColumnDef
{
const char* name;
int id;
int propertyId;
bool hidden;
const char* statName;
LbColType type;
int precision;
LbAggType agg;
};
struct LeaderboardDef
{
const char* name;
int id;
int columnCount;
int xpColId;
int prestigeColId;
LbColumnDef* columns;
};
#ifndef __zonecodegenerator
}
#endif