mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Add loading of iw4 font and addonmapents assets
This commit is contained in:
parent
fb93d7cb2f
commit
c515747bc0
@ -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 = {
|
||||
|
@ -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
|
@ -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
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
//#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:
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user