New game interface

This commit is contained in:
Dynamitos
2023-02-01 22:13:04 +01:00
parent 0dce84459e
commit 9e1e4076f0
91 changed files with 268 additions and 21014 deletions
+6 -6
View File
@@ -18,22 +18,22 @@ FontLoader::~FontLoader()
{
}
void FontLoader::importAsset(const std::filesystem::path& filePath, const std::string& importPath)
void FontLoader::importAsset(FontImportArgs args)
{
std::filesystem::path assetPath = filePath.filename();
std::filesystem::path assetPath = args.filePath.filename();
assetPath.replace_extension("asset");
PFontAsset asset = new FontAsset(assetPath.generic_string());
std::error_code code;
std::filesystem::copy_file(filePath, asset->getFullPath(), code);
std::filesystem::copy_file(args.filePath, asset->getFullPath(), code);
asset->setStatus(Asset::Status::Loading);
AssetRegistry::get().registerFont(asset, importPath);
import(filePath, asset);
AssetRegistry::get().registerFont(asset, args.importPath);
import(args, asset);
}
// in case of the space character there is no bitmap
// so we create a single pixel empty texture
uint8 transparentPixel = 0;
void FontLoader::import(std::filesystem::path path, PFontAsset asset)
void FontLoader::import(FontImportArgs args, PFontAsset asset)
{
FT_Library ft;
FT_Error error = FT_Init_FreeType(&ft);