#pragma once #include "Deer/Components.h" #include "Deer/Asset.h" namespace Deer{ template void save(Archive& archive, MeshRenderComponent const& meshRender) { std::string meshLocation = AssetManager::getAssetLocation(meshRender.meshAssetID).generic_string(); archive(cereal::make_nvp("mesh", meshLocation)); std::string shaderLocation = AssetManager::getAssetLocation(meshRender.shaderAssetID).generic_string(); archive(cereal::make_nvp("shader", shaderLocation)); } template void load(Archive& archive, MeshRenderComponent& meshRender) { std::string meshLocation; archive(cereal::make_nvp("mesh", meshLocation)); std::string shaderLocation; archive(cereal::make_nvp("shader", shaderLocation)); meshRender.meshAssetID = AssetManager::loadAsset(std::filesystem::path(meshLocation)); meshRender.shaderAssetID = AssetManager::loadAsset(std::filesystem::path(shaderLocation)); } }