Refactor the way resources are loaded (#191)

* WIP

* WIP

* Font works

* WIP: Only Music remains

* Looks like it's working

* Fix oopsie

* Core/ObjectRef: Add cast functions

* Update ChangeLog.md

* Audio/SoundStream: Make sound stream thread-safe
This commit is contained in:
Jérôme Leclercq
2018-10-28 01:53:11 +02:00
committed by GitHub
parent fa7cbc21e5
commit ed46c87781
64 changed files with 1058 additions and 1071 deletions

View File

@@ -28,7 +28,7 @@ namespace Nz
return parser.Check();
}
bool Load(Animation* animation, Stream& stream, const AnimationParams& /*parameters*/)
AnimationRef Load(Stream& stream, const AnimationParams& /*parameters*/)
{
///TODO: Utiliser les paramètres
MD5AnimParser parser(stream);
@@ -36,7 +36,7 @@ namespace Nz
if (!parser.Parse())
{
NazaraError("MD5Anim parser failed");
return false;
return nullptr;
}
const MD5AnimParser::Frame* frames = parser.GetFrames();
@@ -46,6 +46,7 @@ namespace Nz
UInt32 jointCount = parser.GetJointCount();
// À ce stade, nous sommes censés avoir assez d'informations pour créer l'animation
AnimationRef animation = Animation::New();
animation->CreateSkeletal(frameCount, jointCount);
Sequence sequence;
@@ -84,7 +85,7 @@ namespace Nz
}
}
return true;
return animation;
}
}