Allow loading assets from disk even if they're already in memory
This commit is contained in:
parent
14dc718ef2
commit
27e9a22e43
@ -84,13 +84,14 @@ namespace Assets
|
||||
|
||||
void IXModel::load(Game::XAssetHeader* header, const std::string& name, Components::ZoneBuilder::Zone* builder)
|
||||
{
|
||||
if (!builder->isPrimaryAsset())
|
||||
Components::FileSystem::File modelFile(Utils::String::VA("xmodel/%s.iw4xModel", name.data()));
|
||||
|
||||
if (!builder->isPrimaryAsset() && (Components::ZoneBuilder::MatchTechsetsDvar.get<bool>() || !modelFile.exists()))
|
||||
{
|
||||
header->model = Components::AssetHandler::FindOriginalAsset(this->getType(), name.data()).model;
|
||||
if (header->model) return;
|
||||
}
|
||||
|
||||
Components::FileSystem::File modelFile(Utils::String::VA("xmodel/%s.iw4xModel", name.data()));
|
||||
|
||||
if (modelFile.exists())
|
||||
{
|
||||
|
@ -10,6 +10,9 @@ namespace Components
|
||||
bool ZoneBuilder::Terminate;
|
||||
std::thread ZoneBuilder::CommandThread;
|
||||
|
||||
Dvar::Var ZoneBuilder::MatchTechsetsDvar;
|
||||
Dvar::Var ZoneBuilder::PreferDiskAssetsDvar;
|
||||
|
||||
ZoneBuilder::Zone::Zone(const std::string& name) : indexStart(0), externalSize(0),
|
||||
|
||||
// Reserve 100MB by default.
|
||||
|
@ -130,6 +130,7 @@ namespace Components
|
||||
static std::vector<std::pair<Game::XAssetType, std::string>> EndAssetTrace();
|
||||
|
||||
static Game::XAssetHeader GetEmptyAssetIfCommon(Game::XAssetType type, const std::string& name, Zone* builder);
|
||||
static Dvar::Var PreferDiskAssetsDvar;
|
||||
|
||||
private:
|
||||
static int StoreTexture(Game::GfxImageLoadDef **loadDef, Game::GfxImage *image);
|
||||
|
Loading…
Reference in New Issue
Block a user