Upgrade Utility

This commit is contained in:
Jérôme Leclercq
2021-05-24 19:10:53 +02:00
parent b936946154
commit cce32a64d4
120 changed files with 2328 additions and 2971 deletions

View File

@@ -12,7 +12,7 @@ namespace Nz
{
namespace
{
bool IsSupported(const std::string& extension)
bool IsSupported(const std::string_view& extension)
{
return (extension == "md5anim");
}
@@ -27,7 +27,7 @@ namespace Nz
return parser.Check();
}
AnimationRef Load(Stream& stream, const AnimationParams& /*parameters*/)
std::shared_ptr<Animation> Load(Stream& stream, const AnimationParams& /*parameters*/)
{
///TODO: Utiliser les paramètres
MD5AnimParser parser(stream);
@@ -45,7 +45,7 @@ namespace Nz
std::size_t jointCount = parser.GetJointCount();
// À ce stade, nous sommes censés avoir assez d'informations pour créer l'animation
AnimationRef animation = Animation::New();
std::shared_ptr<Animation> animation = std::make_shared<Animation>();
animation->CreateSkeletal(frameCount, jointCount);
Sequence sequence;
@@ -90,14 +90,14 @@ namespace Nz
namespace Loaders
{
void RegisterMD5Anim()
AnimationLoader::Entry GetAnimationLoader_MD5Anim()
{
AnimationLoader::RegisterLoader(IsSupported, Check, Load);
}
AnimationLoader::Entry loader;
loader.extensionSupport = IsSupported;
loader.streamChecker = Check;
loader.streamLoader = Load;
void UnregisterMD5Anim()
{
AnimationLoader::UnregisterLoader(IsSupported, Check, Load);
return loader;
}
}
}