-------------------- AddPackageToWriter Gets all assets in a package of that database and adds them to the package writer
| 133 | // Gets all assets in a package of that database and adds them to the package writer |
| 134 | // |
| 135 | void 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 |