[General] Correct assettype enum

This commit is contained in:
momo5502 2016-12-28 21:35:30 +01:00
parent c4690bf49f
commit 03345e8d21
22 changed files with 51 additions and 51 deletions

View File

@ -132,7 +132,7 @@ namespace Components
}
// Fix shader const stuff
if (type == Game::XAssetType::ASSET_TYPE_TECHSET && Zones::Version() >= 359)
if (type == Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET && Zones::Version() >= 359)
{
for (int i = 0; i < 48; ++i)
{

View File

@ -3,7 +3,7 @@ namespace Assets
class IComWorld : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_COM_MAP; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_COMWORLD; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
};

View File

@ -3,7 +3,7 @@ namespace Assets
class IGameWorldMp : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_GAME_MAP_MP; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_GAMEWORLD_MP; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
};

View File

@ -3,7 +3,7 @@ namespace Assets
class IGameWorldSp : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_GAME_MAP_SP; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_GAMEWORLD_SP; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;

View File

@ -3,7 +3,7 @@ namespace Assets
class IGfxLightDef : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_LIGHTDEF; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_LIGHT_DEF; };
virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;

View File

@ -7,7 +7,7 @@ namespace Assets
void IGfxWorld::load(Game::XAssetHeader* header, std::string name, Components::ZoneBuilder::Zone* builder)
{
if (name != "maps/iw4_credits.d3dbsp") return;
Game::GfxWorld* map = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_GFX_MAP, "maps/iw4_credits.d3dbsp").gfxWorld;
Game::GfxWorld* map = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_GFXWORLD, "maps/iw4_credits.d3dbsp").gfxWorld;
if (!map) return;
header->gfxWorld = map;

View File

@ -3,7 +3,7 @@ namespace Assets
class IGfxWorld : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_GFX_MAP; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_GFXWORLD; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;

View File

@ -3,7 +3,7 @@ namespace Assets
class ILocalizeEntry : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_LOCALIZE; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_LOCALIZE_ENTRY; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
};

View File

@ -47,7 +47,7 @@ namespace Assets
material->cameraRegion = reader.readByte();
std::string techset = reader.readString();
material->techniqueSet = Components::AssetHandler::FindAssetForZone(Game::XAssetType::ASSET_TYPE_TECHSET, techset.data(), builder).techniqueSet;
material->techniqueSet = Components::AssetHandler::FindAssetForZone(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, techset.data(), builder).techniqueSet;
if (!material->techniqueSet)
{
@ -303,7 +303,7 @@ namespace Assets
if (asset->techniqueSet)
{
builder->loadAsset(Game::XAssetType::ASSET_TYPE_TECHSET, asset->techniqueSet);
builder->loadAsset(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, asset->techniqueSet);
}
if (asset->textureTable)
@ -347,7 +347,7 @@ namespace Assets
if (asset->techniqueSet)
{
dest->techniqueSet = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_TECHSET, asset->techniqueSet).techniqueSet;
dest->techniqueSet = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, asset->techniqueSet).techniqueSet;
}
if (asset->textureTable)

View File

@ -3,7 +3,7 @@ namespace Assets
class IMaterialTechniqueSet : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_TECHSET; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;

View File

@ -3,7 +3,7 @@ namespace Assets
class ISndCurve : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_SNDCURVE; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_SOUND_CURVE; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
};

View File

@ -3,7 +3,7 @@ namespace Assets
class IXAnimParts : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_XANIM; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_XANIMPARTS; };
virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;

View File

@ -566,7 +566,7 @@ namespace Assets
void IclipMap_t::load(Game::XAssetHeader* /*header*/, std::string name, Components::ZoneBuilder::Zone* /*builder*/)
{
Game::clipMap_t* map = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_COL_MAP_MP, name.data()).clipMap;
Game::clipMap_t* map = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_CLIPMAP_PVS, name.data()).clipMap;
if (map) return;
Components::Logger::Error("Missing clipMap_t %s... you can't make them yet you idiot.", name.data());

View File

@ -3,7 +3,7 @@ namespace Assets
class IclipMap_t : public Components::AssetHandler::IAsset
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_COL_MAP_MP; };
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_CLIPMAP_PVS; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;

View File

@ -17,7 +17,7 @@ namespace Assets
if (alias->volumeFalloffCurve)
{
builder->loadAsset(Game::XAssetType::ASSET_TYPE_SNDCURVE, alias->volumeFalloffCurve);
builder->loadAsset(Game::XAssetType::ASSET_TYPE_SOUND_CURVE, alias->volumeFalloffCurve);
}
}
}
@ -137,7 +137,7 @@ namespace Assets
if (alias->volumeFalloffCurve)
{
destAlias->volumeFalloffCurve = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_SNDCURVE, alias->volumeFalloffCurve).sndCurve;
destAlias->volumeFalloffCurve = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_SOUND_CURVE, alias->volumeFalloffCurve).sndCurve;
}
if (alias->speakerMap)

View File

@ -63,7 +63,7 @@ namespace Components
if (!entry || !entry->value)
{
Localization::LocalizeMutex.unlock();
entry = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_LOCALIZE, key).localize;
entry = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_LOCALIZE_ENTRY, key).localize;
Localization::LocalizeMutex.lock();
}
@ -161,7 +161,7 @@ namespace Components
Localization::Localization()
{
AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_LOCALIZE, [] (Game::XAssetType, std::string filename)
AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_LOCALIZE_ENTRY, [] (Game::XAssetType, std::string filename)
{
Game::XAssetHeader header = { 0 };
std::lock_guard<std::mutex> _(Localization::LocalizeMutex);

View File

@ -85,8 +85,8 @@ namespace Components
};
// Internal doesn't lock the thread, as locking is impossible, due to executing this in the thread that holds the current lock
Game::DB_EnumXAssets_Internal(Game::XAssetType::ASSET_TYPE_COL_MAP_MP, callback, ents, true);
Game::DB_EnumXAssets_Internal(Game::XAssetType::ASSET_TYPE_COL_MAP_SP, callback, ents, true);
Game::DB_EnumXAssets_Internal(Game::XAssetType::ASSET_TYPE_CLIPMAP_PVS, callback, ents, true);
Game::DB_EnumXAssets_Internal(Game::XAssetType::ASSET_TYPE_CLIPMAP, callback, ents, true);
}
void Maps::LoadAssetRestrict(Game::XAssetType type, Game::XAssetHeader asset, std::string name, bool* restrict)
@ -94,7 +94,7 @@ namespace Components
if (std::find(Maps::CurrentDependencies.begin(), Maps::CurrentDependencies.end(), FastFiles::Current()) != Maps::CurrentDependencies.end()
&& (FastFiles::Current() != "mp_shipment_long" || Maps::CurrentMainZone != "mp_shipment")) // Shipment is a special case
{
if (type == Game::XAssetType::ASSET_TYPE_GAME_MAP_MP || type == Game::XAssetType::ASSET_TYPE_COL_MAP_MP || type == Game::XAssetType::ASSET_TYPE_GFX_MAP || type == Game::XAssetType::ASSET_TYPE_MAP_ENTS || type == Game::XAssetType::ASSET_TYPE_COM_MAP || type == Game::XAssetType::ASSET_TYPE_FX_MAP)
if (type == Game::XAssetType::ASSET_TYPE_CLIPMAP_PVS || type == Game::XAssetType::ASSET_TYPE_CLIPMAP || type == Game::XAssetType::ASSET_TYPE_GAMEWORLD_SP || type == Game::XAssetType::ASSET_TYPE_GAMEWORLD_MP || type == Game::XAssetType::ASSET_TYPE_GFXWORLD || type == Game::XAssetType::ASSET_TYPE_MAP_ENTS || type == Game::XAssetType::ASSET_TYPE_COMWORLD || type == Game::XAssetType::ASSET_TYPE_FX_MAP)
{
*restrict = true;
return;
@ -147,7 +147,7 @@ namespace Components
}
// This is broken
if ((type == Game::XAssetType::ASSET_TYPE_MENU || type == Game::XAssetType::ASSET_TYPE_MENUFILE) && Zones::Version() >= 359)
if ((type == Game::XAssetType::ASSET_TYPE_MENU || type == Game::XAssetType::ASSET_TYPE_MENULIST) && Zones::Version() >= 359)
{
*restrict = true;
return;
@ -158,11 +158,11 @@ namespace Components
{
if (!Utils::String::StartsWith(Maps::CurrentMainZone, "mp_") || Maps::IsSPMap)
{
return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_SP].gameWorldSp[0].data;
return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAMEWORLD_SP].gameWorldSp[0].data;
}
else
{
return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_MP].gameWorldMp[0].data;
return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAMEWORLD_MP].gameWorldMp[0].data;
}
}
@ -560,12 +560,12 @@ namespace Components
// Allow loading raw suns
Utils::Hook(0x51B46A, Maps::LoadRawSun, HOOK_CALL).install()->quick();
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_GAME_MAP_SP, 1);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_GAMEWORLD_SP, 1);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_IMAGE, 7168);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_LOADED_SOUND, 2700);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_FX, 1200);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_LOCALIZE, 14000);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_XANIM, 8192);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_LOCALIZE_ENTRY, 14000);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_XANIMPARTS, 8192);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_XMODEL, 5125);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_PHYSPRESET, 128);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_PIXELSHADER, 10000);
@ -574,7 +574,7 @@ namespace Components
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_VERTEXDECL, 196);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_WEAPON, 2400);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_STRINGTABLE, 800);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_IMPACTFX, 8);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_IMPACT_FX, 8);
this->reallocateEntryPool();
@ -595,7 +595,7 @@ namespace Components
}
Game::GfxWorld* world = nullptr;
Game::DB_EnumXAssets(Game::XAssetType::ASSET_TYPE_GFX_MAP, [] (Game::XAssetHeader header, void* world)
Game::DB_EnumXAssets(Game::XAssetType::ASSET_TYPE_GFXWORLD, [] (Game::XAssetHeader header, void* world)
{
*reinterpret_cast<Game::GfxWorld**>(world) = header.gfxWorld;
}, &world, false);

View File

@ -620,7 +620,7 @@ namespace Components
// Intercept asset finding
AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_MENU, Menus::MenuLoad);
AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_MENUFILE, Menus::MenuFileLoad);
AssetHandler::OnFind(Game::XAssetType::ASSET_TYPE_MENULIST, Menus::MenuFileLoad);
// Don't open connect menu
//Utils::Hook::Nop(0x428E48, 5);

View File

@ -700,7 +700,7 @@ namespace Components
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_MAP_ENTS, 10);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_XMODELSURFS, 8192);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_IMAGE, 14336);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_TECHSET, 1536);
Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, 1536);
// hunk size (was 300 MiB)
Utils::Hook::Set<DWORD>(0x64A029, 0x38400000); // 900 MiB

View File

@ -1505,12 +1505,12 @@ namespace Components
__declspec(noinline) bool Zones::CheckGameMapSp(int type)
{
if (type == Game::XAssetType::ASSET_TYPE_GAME_MAP_SP)
if (type == Game::XAssetType::ASSET_TYPE_GAMEWORLD_SP)
{
return true;
}
if (Zones::Version() >= VERSION_ALPHA2 && type == Game::XAssetType::ASSET_TYPE_GAME_MAP_MP)
if (Zones::Version() >= VERSION_ALPHA2 && type == Game::XAssetType::ASSET_TYPE_GAMEWORLD_MP)
{
Maps::HandleAsSPMap();
return true;

View File

@ -419,9 +419,9 @@ namespace Game
if (!_stricmp(DB_GetXAssetTypeName(type), name))
{
// Col map workaround!
if (type == Game::XAssetType::ASSET_TYPE_COL_MAP_SP)
if (type == Game::XAssetType::ASSET_TYPE_CLIPMAP)
{
return Game::XAssetType::ASSET_TYPE_COL_MAP_MP;
return Game::XAssetType::ASSET_TYPE_CLIPMAP_PVS;
}
return type;

View File

@ -15,36 +15,36 @@ namespace Game
{
ASSET_TYPE_PHYSPRESET = 0,
ASSET_TYPE_PHYS_COLLMAP = 1,
ASSET_TYPE_XANIM = 2,
ASSET_TYPE_XANIMPARTS = 2,
ASSET_TYPE_XMODELSURFS = 3,
ASSET_TYPE_XMODEL = 4,
ASSET_TYPE_MATERIAL = 5,
ASSET_TYPE_PIXELSHADER = 6,
ASSET_TYPE_VERTEXSHADER = 7,
ASSET_TYPE_VERTEXDECL = 8,
ASSET_TYPE_TECHSET = 9,
ASSET_TYPE_TECHNIQUE_SET = 9,
ASSET_TYPE_IMAGE = 10,
ASSET_TYPE_SOUND = 11,
ASSET_TYPE_SNDCURVE = 12,
ASSET_TYPE_SOUND_CURVE = 12,
ASSET_TYPE_LOADED_SOUND = 13,
ASSET_TYPE_COL_MAP_SP = 14,
ASSET_TYPE_COL_MAP_MP = 15,
ASSET_TYPE_COM_MAP = 16,
ASSET_TYPE_GAME_MAP_SP = 17,
ASSET_TYPE_GAME_MAP_MP = 18,
ASSET_TYPE_CLIPMAP = 14,
ASSET_TYPE_CLIPMAP_PVS = 15,
ASSET_TYPE_COMWORLD = 16,
ASSET_TYPE_GAMEWORLD_SP = 17,
ASSET_TYPE_GAMEWORLD_MP = 18,
ASSET_TYPE_MAP_ENTS = 19,
ASSET_TYPE_FX_MAP = 20,
ASSET_TYPE_GFX_MAP = 21,
ASSET_TYPE_LIGHTDEF = 22,
ASSET_TYPE_GFXWORLD = 21,
ASSET_TYPE_LIGHT_DEF = 22,
ASSET_TYPE_UI_MAP = 23,
ASSET_TYPE_FONT = 24,
ASSET_TYPE_MENUFILE = 25,
ASSET_TYPE_MENULIST = 25,
ASSET_TYPE_MENU = 26,
ASSET_TYPE_LOCALIZE = 27,
ASSET_TYPE_LOCALIZE_ENTRY = 27,
ASSET_TYPE_WEAPON = 28,
ASSET_TYPE_SNDDRIVERGLOBALS = 29,
ASSET_TYPE_SNDDRIVER_GLOBALS = 29,
ASSET_TYPE_FX = 30,
ASSET_TYPE_IMPACTFX = 31,
ASSET_TYPE_IMPACT_FX = 31,
ASSET_TYPE_AITYPE = 32,
ASSET_TYPE_MPTYPE = 33,
ASSET_TYPE_CHARACTER = 34,