mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-18 16:32:32 +02:00
rwengine: incorporate review
This commit is contained in:
parent
8012a5065d
commit
14ef8c2539
@ -30,7 +30,7 @@ bool CharacterController::updateActivity() {
|
||||
}
|
||||
|
||||
void CharacterController::setActivity(std::unique_ptr<Activity> activity) {
|
||||
_currentActivity.swap(activity);
|
||||
_currentActivity = std::move(activity);
|
||||
}
|
||||
|
||||
void CharacterController::skipActivity() {
|
||||
|
@ -34,7 +34,7 @@ class Animator {
|
||||
float speed;
|
||||
/// Automatically restart
|
||||
bool repeat;
|
||||
std::map<std::shared_ptr<AnimationBone>, ModelFrame*> boneInstances;
|
||||
std::map<AnimationBone*, ModelFrame*> boneInstances;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -79,7 +79,7 @@ bool LoaderIFP::loadFromMemory(char* data) {
|
||||
CPAN* cpan = read<CPAN>(data, dataI);
|
||||
ANIM* frames = read<ANIM>(data, dataI);
|
||||
|
||||
auto bonedata = std::make_shared<AnimationBone>();
|
||||
auto bonedata = new AnimationBone;
|
||||
bonedata->name = frames->name;
|
||||
bonedata->frames.reserve(frames->frames);
|
||||
|
||||
|
@ -40,7 +40,13 @@ struct AnimationBone {
|
||||
*/
|
||||
struct Animation {
|
||||
std::string name;
|
||||
std::map<std::string, std::shared_ptr<AnimationBone>> bones;
|
||||
std::map<std::string, AnimationBone*> bones;
|
||||
|
||||
~Animation() {
|
||||
for (auto &bone_pair : bones) {
|
||||
delete bone_pair.second;
|
||||
}
|
||||
}
|
||||
|
||||
float duration;
|
||||
};
|
||||
|
@ -18,8 +18,7 @@ BOOST_AUTO_TEST_CASE(test_matrix) {
|
||||
Animator animator(test_model);
|
||||
|
||||
animation->duration = 1.f;
|
||||
animation->bones["player"] = std::shared_ptr<AnimationBone>(
|
||||
new AnimationBone {
|
||||
animation->bones["player"] = new AnimationBone{
|
||||
"player",
|
||||
0,
|
||||
0,
|
||||
@ -29,8 +28,7 @@ BOOST_AUTO_TEST_CASE(test_matrix) {
|
||||
{glm::quat(), glm::vec3(0.f, 0.f, 0.f), glm::vec3(), 0.f, 0},
|
||||
{glm::quat(), glm::vec3(0.f, 1.f, 0.f), glm::vec3(), 1.0f, 1},
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
animator.playAnimation(0, animation, 1.f, false);
|
||||
|
||||
|
@ -22,8 +22,6 @@ BOOST_AUTO_TEST_CASE(test_load_dff) {
|
||||
|
||||
BOOST_REQUIRE(atomic->getGeometry());
|
||||
BOOST_REQUIRE(atomic->getFrame());
|
||||
|
||||
m.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user