MCPcopy Create free account
hub / github.com/Illation/ETEngine / AddPackageToWriter

Function AddPackageToWriter

Engine/source/EtCooker/mainCooker.cpp:135–150  ·  view source on GitHub ↗

-------------------- AddPackageToWriter Gets all assets in a package of that database and adds them to the package writer

Source from the content-addressed store, hash-verified

133// Gets all assets in a package of that database and adds them to the package writer
134//
135void AddPackageToWriter(core::HashString const packageId, std::string const& dbBase, PackageWriter &writer, core::AssetDatabase& db)
136{
137 // Loop over files - add them to the writer
138 core::AssetDatabase::T_AssetList assets = db.GetAssetsInPackage(packageId);
139 for (core::I_Asset const* const asset : assets)
140 {
141 std::string const filePath = dbBase + asset->GetPath();
142 std::string const assetName = asset->GetName();
143 core::HashString const id = asset->GetId();
144
145 LOG(assetName + std::string(" [") + std::to_string(id.Get()) + std::string("] @: ") + core::FileUtil::GetAbsolutePath(filePath));
146
147 core::File* assetFile = new core::File(filePath + assetName, nullptr);
148 writer.AddFile(assetFile, dbBase, core::E_CompressionType::Store);
149 }
150}
151
152//---------------------
153// CookCompiledPackage

Callers 2

CookCompiledPackageFunction · 0.85
CookFilePackagesFunction · 0.85

Calls 6

GetAssetsInPackageMethod · 0.80
GetPathMethod · 0.80
GetNameMethod · 0.80
AddFileMethod · 0.80
GetIdMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected