diff --git a/src/ZoneCode.lua b/src/ZoneCode.lua index df6a9450..b9cb3d80 100644 --- a/src/ZoneCode.lua +++ b/src/ZoneCode.lua @@ -23,7 +23,7 @@ ZoneCode.Assets = { -- "FxWorld", -- "GfxWorld", "GfxLightDef", - -- "Font_s", + "Font_s", "MenuList", "menuDef_t", "LocalizeEntry", @@ -37,7 +37,7 @@ ZoneCode.Assets = { "StructuredDataDefSet", "TracerDef", -- "VehicleDef", - -- "AddonMapEnts" + "AddonMapEnts" }, T6 = { diff --git a/src/ZoneCode/Game/IW4/IW4_Commands.txt b/src/ZoneCode/Game/IW4/IW4_Commands.txt index efffe067..6121ec1c 100644 --- a/src/ZoneCode/Game/IW4/IW4_Commands.txt +++ b/src/ZoneCode/Game/IW4/IW4_Commands.txt @@ -23,7 +23,7 @@ asset MapEnts ASSET_TYPE_MAP_ENTS; // asset FxWorld ASSET_TYPE_FXWORLD; // asset GfxWorld ASSET_TYPE_GFXWORLD; asset GfxLightDef ASSET_TYPE_LIGHT_DEF; -// asset Font_s ASSET_TYPE_FONT; +asset Font_s ASSET_TYPE_FONT; asset MenuList ASSET_TYPE_MENULIST; asset menuDef_t ASSET_TYPE_MENU; asset LocalizeEntry ASSET_TYPE_LOCALIZE_ENTRY; @@ -37,7 +37,7 @@ asset LeaderboardDef ASSET_TYPE_LEADERBOARD; asset StructuredDataDefSet ASSET_TYPE_STRUCTURED_DATA_DEF; asset TracerDef ASSET_TYPE_TRACER; // asset VehicleDef ASSET_TYPE_VEHICLE; -// asset AddonMapEnts ASSET_TYPE_ADDON_MAP_ENTS; +asset AddonMapEnts ASSET_TYPE_ADDON_MAP_ENTS; // Setup blocks block temp XFILE_BLOCK_TEMP default; @@ -738,6 +738,15 @@ use GfxLightDef; set string name; set name name; +// ========================================= +// Font_s +// ========================================= +use Font_s; +set string fontName; +set name fontName; +set reusable glyphs; +set count glyphs glyphCount; + // ========================================= // RawFile // ========================================= @@ -806,4 +815,12 @@ use TracerDef; set string name; set name name; +// ========================================= +// AddonMapEnts +// ========================================= +use AddonMapEnts; +set string name; +set name name; +set count entityString numEntityChars; + // EOF \ No newline at end of file diff --git a/src/ZoneCommon/Game/IW4/GameAssetPoolIW4.cpp b/src/ZoneCommon/Game/IW4/GameAssetPoolIW4.cpp index 6b1a0e75..09e67e76 100644 --- a/src/ZoneCommon/Game/IW4/GameAssetPoolIW4.cpp +++ b/src/ZoneCommon/Game/IW4/GameAssetPoolIW4.cpp @@ -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); diff --git a/src/ZoneCommon/Game/IW4/GameAssetPoolIW4.h b/src/ZoneCommon/Game/IW4/GameAssetPoolIW4.h index 8193013f..c8ce1a92 100644 --- a/src/ZoneCommon/Game/IW4/GameAssetPoolIW4.h +++ b/src/ZoneCommon/Game/IW4/GameAssetPoolIW4.h @@ -36,7 +36,7 @@ public: // std::unique_ptr> m_fx_world; // std::unique_ptr> m_gfx_world; std::unique_ptr> m_gfx_light_def; - // std::unique_ptr> m_font; + std::unique_ptr> m_font; std::unique_ptr> m_menu_list; std::unique_ptr> m_menu_def; std::unique_ptr> m_localize; @@ -50,7 +50,7 @@ public: std::unique_ptr> m_structed_data_def_set; std::unique_ptr> m_tracer; // std::unique_ptr> m_vehicle; - // std::unique_ptr> m_addon_map_ents; + std::unique_ptr> m_addon_map_ents; explicit GameAssetPoolIW4(int priority); ~GameAssetPoolIW4() override = default; diff --git a/src/ZoneCommon/Game/IW4/IW4_Assets.h b/src/ZoneCommon/Game/IW4/IW4_Assets.h index de989057..11c717b0 100644 --- a/src/ZoneCommon/Game/IW4/IW4_Assets.h +++ b/src/ZoneCommon/Game/IW4/IW4_Assets.h @@ -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 diff --git a/src/ZoneLoading/Game/IW4/ContentLoaderIW4.cpp b/src/ZoneLoading/Game/IW4/ContentLoaderIW4.cpp index 6822e15f..e39a9ded 100644 --- a/src/ZoneLoading/Game/IW4/ContentLoaderIW4.cpp +++ b/src/ZoneLoading/Game/IW4/ContentLoaderIW4.cpp @@ -4,10 +4,10 @@ #include -//#include "Game/IW4/XAssets/addonmapents/addonmapents_load_db.h" +#include "Game/IW4/XAssets/addonmapents/addonmapents_load_db.h" #include "Game/IW4/XAssets/clipmap_t/clipmap_t_load_db.h" //#include "Game/IW4/XAssets/comworld/comworld_load_db.h" -//#include "Game/IW4/XAssets/font_s/font_s_load_db.h" +#include "Game/IW4/XAssets/font_s/font_s_load_db.h" #include "Game/IW4/XAssets/fxeffectdef/fxeffectdef_load_db.h" #include "Game/IW4/XAssets/fximpacttable/fximpacttable_load_db.h" //#include "Game/IW4/XAssets/fxworld/fxworld_load_db.h" @@ -125,7 +125,7 @@ void ContentLoaderIW4::LoadXAsset(const bool atStreamStart) // LOAD_ASSET(ASSET_TYPE_FXWORLD, FxWorld, fxWorld); // LOAD_ASSET(ASSET_TYPE_GFXWORLD, GfxWorld, gfxWorld); LOAD_ASSET(ASSET_TYPE_LIGHT_DEF, GfxLightDef, lightDef); - // LOAD_ASSET(ASSET_TYPE_FONT, Font_s, font); + LOAD_ASSET(ASSET_TYPE_FONT, Font_s, font); LOAD_ASSET(ASSET_TYPE_MENULIST, MenuList, menuList); LOAD_ASSET(ASSET_TYPE_MENU, menuDef_t, menu); LOAD_ASSET(ASSET_TYPE_LOCALIZE_ENTRY, LocalizeEntry, localize); @@ -139,7 +139,7 @@ void ContentLoaderIW4::LoadXAsset(const bool atStreamStart) LOAD_ASSET(ASSET_TYPE_STRUCTURED_DATA_DEF, StructuredDataDefSet, structuredDataDefSet); LOAD_ASSET(ASSET_TYPE_TRACER, TracerDef, tracerDef); // LOAD_ASSET(ASSET_TYPE_VEHICLE, VehicleDef, vehDef); - // LOAD_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, AddonMapEnts, addonMapEnts); + LOAD_ASSET(ASSET_TYPE_ADDON_MAP_ENTS, AddonMapEnts, addonMapEnts); default: {