From 406a2bd26030b20bdb88694e6c532b99959f8783 Mon Sep 17 00:00:00 2001 From: obligaron Date: Wed, 28 Apr 2021 05:19:18 +0200 Subject: [PATCH] Use AnimationInfo directly in tests --- test/animationinfo_test.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/animationinfo_test.cpp b/test/animationinfo_test.cpp index 1f37f58eb..3641265eb 100644 --- a/test/animationinfo_test.cpp +++ b/test/animationinfo_test.cpp @@ -62,20 +62,20 @@ void RunAnimationTest(int numFrames, int delay, AnimationDistributionParams para if (gameTickData != nullptr) { currentGameTick += 1; if (gameTickData->_FramesToSkip != 0) - pPlayer->AnimInfo.CurrentFrame += gameTickData->_FramesToSkip; - pPlayer->AnimInfo.ProcessAnimation(); - EXPECT_EQ(pPlayer->AnimInfo.CurrentFrame, gameTickData->_ExpectedAnimationFrame); - EXPECT_EQ(pPlayer->AnimInfo.DelayCounter, gameTickData->_ExpectedAnimationCnt); + animInfo.CurrentFrame += gameTickData->_FramesToSkip; + animInfo.ProcessAnimation(); + EXPECT_EQ(animInfo.CurrentFrame, gameTickData->_ExpectedAnimationFrame); + EXPECT_EQ(animInfo.DelayCounter, gameTickData->_ExpectedAnimationCnt); } auto renderingData = dynamic_cast(x); if (renderingData != nullptr) { gfProgressToNextGameTick = renderingData->_fProgressToNextGameTick; - EXPECT_EQ(pPlayer->AnimInfo.GetFrameToUseForRendering(), renderingData->_ExpectedRenderingFrame) + EXPECT_EQ(animInfo.GetFrameToUseForRendering(), renderingData->_ExpectedRenderingFrame) << std::fixed << std::setprecision(2) << "ProgressToNextGameTick: " << renderingData->_fProgressToNextGameTick - << " CurrentFrame: " << pPlayer->AnimInfo.CurrentFrame - << " DelayCounter: " << pPlayer->AnimInfo.DelayCounter + << " CurrentFrame: " << animInfo.CurrentFrame + << " DelayCounter: " << animInfo.DelayCounter << " GameTick: " << currentGameTick; } } @@ -125,7 +125,7 @@ TEST(AnimationInfo, AttackSwordWarrior) // ProcessAnimationPending should be con new RenderingData(0.6f, 8), new RenderingData(0.8f, 8), - // After this GameTick, the Animation Distribution Logic is disabled + // After this GameTick, the Animation Distribution Logic is disabled new GameTickData(9, 0), new RenderingData(0.1f, 9), new GameTickData(10, 0), @@ -177,7 +177,7 @@ TEST(AnimationInfo, AttackSwordWarriorWithFastestAttack) // Skipped frames and P new RenderingData(0.6f, 8), new RenderingData(0.8f, 8), - // After this GameTick, the Animation Distribution Logic is disabled + // After this GameTick, the Animation Distribution Logic is disabled new GameTickData(9, 0), new RenderingData(0.1f, 9), new GameTickData(10, 0), @@ -371,7 +371,7 @@ TEST(AnimationInfo, Stand) // Distribution Logic shouldn't change anything here new GameTickData(10, 3), new RenderingData(0.6f, 10), - // Animation starts again + // Animation starts again new GameTickData(1, 0), new RenderingData(0.1f, 1), new GameTickData(1, 1),