Some cleanup
This commit is contained in:
1 parent
4e40a1825a
commit
c1be26023b
20 files changed
+451
-1330
No files matched your search
@@ -348,13 +348,13 @@ int main()
|
||||
FRG::AnimationState::ACTION_IDLE, 0, 100);
|
||||
FRG::CharacterObservation attackTarget{
|
||||
point(0.f, 0.f, 1.f), 100.f};
|
||||
drawAnimation.update(100, {{"player1", &attackTarget}, nullptr});
|
||||
drawAnimation.update(100, {&attackTarget, nullptr});
|
||||
if (drawAnimation.currentState != FRG::AnimationState::STAND_TO_ACTION ||
|
||||
std::abs(drawAnimation.animationFrame - 8.333333f) > 0.001f ||
|
||||
drawAnimation.showWeapon) {
|
||||
return fail("Weapon draw animation did not advance at 2x speed");
|
||||
}
|
||||
drawAnimation.update(200, {{"player1", &attackTarget}, nullptr});
|
||||
drawAnimation.update(200, {&attackTarget, nullptr});
|
||||
if (!drawAnimation.showWeapon) {
|
||||
return fail("Weapon draw animation did not use its frame visibility threshold");
|
||||
}
|
||||
@@ -365,13 +365,13 @@ int main()
|
||||
sheathAnimation.currentState = FRG::AnimationState::ACTION_IDLE;
|
||||
sheathAnimation.setAnimationMetadata(
|
||||
FRG::AnimationState::ACTION_TO_STAND, 0, 100);
|
||||
sheathAnimation.update(100, {{"player1", nullptr}, nullptr});
|
||||
sheathAnimation.update(100, {nullptr, nullptr});
|
||||
if (sheathAnimation.currentState != FRG::AnimationState::ACTION_TO_STAND ||
|
||||
std::abs(sheathAnimation.animationFrame - 8.333333f) > 0.001f ||
|
||||
!sheathAnimation.showWeapon) {
|
||||
return fail("Weapon sheath animation did not advance at 2x speed");
|
||||
}
|
||||
sheathAnimation.update(300, {{"player1", nullptr}, nullptr});
|
||||
sheathAnimation.update(300, {nullptr, nullptr});
|
||||
if (sheathAnimation.showWeapon) {
|
||||
return fail("Weapon sheath animation did not hide at its frame visibility threshold");
|
||||
}
|
||||
@@ -382,7 +382,7 @@ int main()
|
||||
ordinaryAnimation.currentState = FRG::AnimationState::STAND;
|
||||
ordinaryAnimation.setAnimationMetadata(
|
||||
FRG::AnimationState::STAND, 0, 100);
|
||||
ordinaryAnimation.update(100, {{"player1", nullptr}, nullptr});
|
||||
ordinaryAnimation.update(100, {nullptr, nullptr});
|
||||
if (std::abs(ordinaryAnimation.animationFrame - 4.1666665f) > 0.001f) {
|
||||
return fail("Ordinary animation playback rate changed unexpectedly");
|
||||
}
|
||||
@@ -396,7 +396,7 @@ int main()
|
||||
FRG::AnimationState::ACTION_IDLE, 0, 30);
|
||||
for (int i = 0; i < 4; ++i)
|
||||
completedDrawAnimation.update(
|
||||
100, {{"player1", &attackTarget}, nullptr});
|
||||
100, {&attackTarget, nullptr});
|
||||
if (completedDrawAnimation.currentState !=
|
||||
FRG::AnimationState::ACTION_IDLE) {
|
||||
return fail("Accelerated weapon draw animation did not complete");
|
||||
@@ -410,7 +410,7 @@ int main()
|
||||
FRG::AnimationState::ACTION_TO_STAND, 0, 30);
|
||||
for (int i = 0; i < 4; ++i)
|
||||
completedSheathAnimation.update(
|
||||
100, {{"player1", nullptr}, nullptr});
|
||||
100, {nullptr, nullptr});
|
||||
if (completedSheathAnimation.currentState != FRG::AnimationState::STAND) {
|
||||
return fail("Accelerated weapon sheath animation did not complete");
|
||||
}
|
||||
@@ -425,9 +425,7 @@ int main()
|
||||
guardedMover.save(guardedJson);
|
||||
FRG::CharacterState restoredGuardedMover;
|
||||
restoredGuardedMover.load(guardedJson);
|
||||
if (restoredGuardedMover.movementBlockedTicks !=
|
||||
guardedMover.movementBlockedTicks ||
|
||||
restoredGuardedMover.navigationRetryTicks !=
|
||||
if (restoredGuardedMover.navigationRetryTicks !=
|
||||
guardedMover.navigationRetryTicks ||
|
||||
restoredGuardedMover.velocity.x.raw_value() != 12345 ||
|
||||
restoredGuardedMover.velocity.y.raw_value() != -6789 ||
|
||||
|
||||
Reference in new issue
Block a user