Skip to content

Commit

Permalink
Rename Player struct variables: _pWFrames
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Jul 27, 2024
1 parent 5ae0e5e commit a2c0c19
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Source/loadsave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ void LoadPlayer(LoadHelper &file, Player &player)
player._pNFrames = file.NextLENarrow<int32_t, int8_t>();
file.Skip<uint32_t>(); // skip _pNWidth
file.Skip<uint32_t>(8); // Skip pointers _pWAnim
player._pWFrames = file.NextLENarrow<int32_t, int8_t>();
player.numWalkFrames = file.NextLENarrow<int32_t, int8_t>();
file.Skip<uint32_t>(); // skip _pWWidth
file.Skip<uint32_t>(8); // Skip pointers _pAAnim
player._pAFrames = file.NextLENarrow<int32_t, int8_t>();
Expand Down Expand Up @@ -1318,7 +1318,7 @@ void SavePlayer(SaveHelper &file, const Player &player)
file.WriteLE<int32_t>(player._pNFrames);
file.Skip<uint32_t>(); // Skip _pNWidth
file.Skip<uint32_t>(8); // Skip pointers _pWAnim
file.WriteLE<int32_t>(player._pWFrames);
file.WriteLE<int32_t>(player.numWalkFrames);
file.Skip<uint32_t>(); // Skip _pWWidth
file.Skip<uint32_t>(8); // Skip pointers _pAAnim
file.WriteLE<int32_t>(player._pAFrames);
Expand Down
6 changes: 3 additions & 3 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ void Player::getAnimationFramesAndTicksPerFrame(player_graphic graphics, int8_t
ticksPerFrame = 4;
break;
case player_graphic::Walk:
numberOfFrames = _pWFrames;
numberOfFrames = numWalkFrames;
break;
case player_graphic::Attack:
numberOfFrames = _pAFrames;
Expand Down Expand Up @@ -2202,10 +2202,10 @@ void SetPlrAnims(Player &player)

if (leveltype == DTYPE_TOWN) {
player._pNFrames = plrAtkAnimData.townIdleFrames;
player._pWFrames = plrAtkAnimData.townWalkingFrames;
player.numWalkFrames = plrAtkAnimData.townWalkingFrames;
} else {
player._pNFrames = plrAtkAnimData.idleFrames;
player._pWFrames = plrAtkAnimData.walkingFrames;
player.numWalkFrames = plrAtkAnimData.walkingFrames;
player._pHFrames = plrAtkAnimData.recoveryFrames;
player._pBFrames = plrAtkAnimData.blockingFrames;
switch (gn) {
Expand Down
2 changes: 1 addition & 1 deletion Source/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ struct Player {
*/
std::array<PlayerAnimationData, enum_size<player_graphic>::value> AnimationData;
int8_t _pNFrames;
int8_t _pWFrames;
int8_t numWalkFrames; // _pWFrames
int8_t _pAFrames;
int8_t _pAFNum;
int8_t _pSFrames;
Expand Down
2 changes: 1 addition & 1 deletion test/writehero_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void AssertPlayer(Player &player)
ASSERT_EQ(CountBool(player._pLvlVisited, NUMLEVELS), 0);
ASSERT_EQ(CountBool(player._pSLvlVisited, NUMLEVELS), 0);
ASSERT_EQ(player._pNFrames, 20);
ASSERT_EQ(player._pWFrames, 8);
ASSERT_EQ(player.numWalkFrames, 8);
ASSERT_EQ(player._pAFrames, 0);
ASSERT_EQ(player._pAFNum, 0);
ASSERT_EQ(player._pSFrames, 16);
Expand Down

0 comments on commit a2c0c19

Please sign in to comment.