mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 23:38:09 -05:00
Add loading of iw4 font and addonmapents assets
This commit is contained in:
@ -124,7 +124,7 @@ GameAssetPoolIW4::GameAssetPoolIW4(const int priority)
|
||||
// m_fx_world = nullptr;
|
||||
// m_gfx_world = nullptr;
|
||||
m_gfx_light_def = nullptr;
|
||||
// m_font = nullptr;
|
||||
m_font = nullptr;
|
||||
m_menu_list = nullptr;
|
||||
m_menu_def = nullptr;
|
||||
m_localize = nullptr;
|
||||
@ -138,7 +138,7 @@ GameAssetPoolIW4::GameAssetPoolIW4(const int priority)
|
||||
m_structed_data_def_set = nullptr;
|
||||
m_tracer = nullptr;
|
||||
// m_vehicle = nullptr;
|
||||
// m_addon_map_ents = nullptr;
|
||||
m_addon_map_ents = nullptr;
|
||||
}
|
||||
|
||||
void GameAssetPoolIW4::InitPoolStatic(const asset_type_t type, const size_t capacity)
|
||||
@ -177,7 +177,7 @@ void GameAssetPoolIW4::InitPoolStatic(const asset_type_t type, const size_t capa
|
||||
// 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_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);
|
||||
@ -191,7 +191,7 @@ void GameAssetPoolIW4::InitPoolStatic(const asset_type_t type, const size_t capa
|
||||
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_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
|
||||
default:
|
||||
assert(type >= 0 && type < ASSET_TYPE_COUNT);
|
||||
@ -237,7 +237,7 @@ void GameAssetPoolIW4::InitPoolDynamic(const asset_type_t type)
|
||||
// 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_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);
|
||||
@ -251,7 +251,7 @@ void GameAssetPoolIW4::InitPoolDynamic(const asset_type_t type)
|
||||
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_ADDON_MAP_ENTS, m_addon_map_ents, AddonMapEnts);
|
||||
|
||||
default:
|
||||
assert(type >= 0 && type < ASSET_TYPE_COUNT);
|
||||
@ -306,7 +306,7 @@ XAssetInfoGeneric* GameAssetPoolIW4::AddAsset(asset_type_t type, std::string nam
|
||||
// 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_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);
|
||||
@ -320,7 +320,7 @@ XAssetInfoGeneric* GameAssetPoolIW4::AddAsset(asset_type_t type, std::string nam
|
||||
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_ADDON_MAP_ENTS, m_addon_map_ents, addonMapEnts);
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
@ -366,7 +366,7 @@ XAssetInfoGeneric* GameAssetPoolIW4::GetAsset(const asset_type_t type, std::stri
|
||||
// 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_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);
|
||||
@ -380,7 +380,7 @@ XAssetInfoGeneric* GameAssetPoolIW4::GetAsset(const asset_type_t type, std::stri
|
||||
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_ADDON_MAP_ENTS, m_addon_map_ents);
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
// std::unique_ptr<AssetPool<IW4::FxWorld>> m_fx_world;
|
||||
// std::unique_ptr<AssetPool<IW4::GfxWorld>> m_gfx_world;
|
||||
std::unique_ptr<AssetPool<IW4::GfxLightDef>> m_gfx_light_def;
|
||||
// std::unique_ptr<AssetPool<IW4::Font_s>> m_font;
|
||||
std::unique_ptr<AssetPool<IW4::Font_s>> m_font;
|
||||
std::unique_ptr<AssetPool<IW4::MenuList>> m_menu_list;
|
||||
std::unique_ptr<AssetPool<IW4::menuDef_t>> m_menu_def;
|
||||
std::unique_ptr<AssetPool<IW4::LocalizeEntry>> m_localize;
|
||||
@ -50,7 +50,7 @@ public:
|
||||
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;
|
||||
// std::unique_ptr<AssetPool<IW4::AddonMapEnts>> m_addon_map_ents;
|
||||
std::unique_ptr<AssetPool<IW4::AddonMapEnts>> m_addon_map_ents;
|
||||
|
||||
explicit GameAssetPoolIW4(int priority);
|
||||
~GameAssetPoolIW4() override = default;
|
||||
|
@ -95,7 +95,7 @@ namespace IW4
|
||||
// struct FxWorld;
|
||||
// struct GfxWorld;
|
||||
struct GfxLightDef;
|
||||
// struct Font_s;
|
||||
struct Font_s;
|
||||
struct MenuList;
|
||||
struct menuDef_t;
|
||||
struct LocalizeEntry;
|
||||
@ -109,7 +109,7 @@ namespace IW4
|
||||
struct StructuredDataDefSet;
|
||||
struct TracerDef;
|
||||
// struct VehicleDef;
|
||||
// struct AddonMapEnts;
|
||||
struct AddonMapEnts;
|
||||
|
||||
union XAssetHeader
|
||||
{
|
||||
@ -135,7 +135,7 @@ namespace IW4
|
||||
// FxWorld* fxWorld;
|
||||
// GfxWorld* gfxWorld;
|
||||
GfxLightDef* lightDef;
|
||||
// Font_s* font;
|
||||
Font_s* font;
|
||||
MenuList* menuList;
|
||||
menuDef_t* menu;
|
||||
LocalizeEntry* localize;
|
||||
@ -149,7 +149,7 @@ namespace IW4
|
||||
StructuredDataDefSet* structuredDataDefSet;
|
||||
TracerDef* tracerDef;
|
||||
// VehicleDef* vehDef;
|
||||
// AddonMapEnts* addonMapEnts;
|
||||
AddonMapEnts* addonMapEnts;
|
||||
void* data;
|
||||
};
|
||||
|
||||
@ -1626,6 +1626,30 @@ namespace IW4
|
||||
int lmapLookupStart;
|
||||
};
|
||||
|
||||
struct Glyph
|
||||
{
|
||||
unsigned __int16 letter;
|
||||
char x0;
|
||||
char y0;
|
||||
char dx;
|
||||
char pixelWidth;
|
||||
char pixelHeight;
|
||||
float s0;
|
||||
float t0;
|
||||
float s1;
|
||||
float t1;
|
||||
};
|
||||
|
||||
struct Font_s
|
||||
{
|
||||
const char* fontName;
|
||||
int pixelHeight;
|
||||
int glyphCount;
|
||||
Material* material;
|
||||
Material* glowMaterial;
|
||||
Glyph* glyphs;
|
||||
};
|
||||
|
||||
struct FxImpactEntry
|
||||
{
|
||||
FxEffectDef* nonflesh[31];
|
||||
@ -1838,6 +1862,14 @@ namespace IW4
|
||||
char stageCount;
|
||||
};
|
||||
|
||||
struct AddonMapEnts
|
||||
{
|
||||
const char* name;
|
||||
char* entityString;
|
||||
int numEntityChars;
|
||||
MapTriggers trigger;
|
||||
};
|
||||
|
||||
typedef unsigned short LeafBrush;
|
||||
|
||||
struct cStaticModel_s
|
||||
|
Reference in New Issue
Block a user