Decent asset loading
This commit is contained in:
@@ -72,5 +72,15 @@ void FontLoader::import(FontImportArgs args, PFontAsset asset)
|
||||
}
|
||||
FT_Done_Face(face);
|
||||
FT_Done_FreeType(ft);
|
||||
|
||||
auto stream = AssetRegistry::createWriteStream((std::filesystem::path(asset->getFolderPath()) / asset->getName()).replace_extension("asset").string(), std::ios::binary);
|
||||
|
||||
ArchiveBuffer archive;
|
||||
Serialization::save(archive, FontAsset::IDENTIFIER);
|
||||
Serialization::save(archive, asset->getName());
|
||||
Serialization::save(archive, asset->getFolderPath());
|
||||
asset->save(archive);
|
||||
archive.writeToStream(stream);
|
||||
|
||||
asset->setStatus(Asset::Status::Ready);
|
||||
}
|
||||
Reference in New Issue
Block a user