Skip to content

Commit

Permalink
Rename Player struct variables: _pSFrames
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Jul 27, 2024
1 parent 5ae0e5e commit f19b649
Show file tree
Hide file tree
Showing 5 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 @@ -503,7 +503,7 @@ void LoadPlayer(LoadHelper &file, Player &player)
file.Skip<uint32_t>(8); // Skip pointers _pLAnim
file.Skip<uint32_t>(8); // Skip pointers _pFAnim
file.Skip<uint32_t>(8); // Skip pointers _pTAnim
player._pSFrames = file.NextLENarrow<int32_t, int8_t>();
player.numSpellFrames = file.NextLENarrow<int32_t, int8_t>();
file.Skip<uint32_t>(); // skip _pSWidth
player._pSFNum = file.NextLENarrow<int32_t, int8_t>();
file.Skip<uint32_t>(8); // Skip pointers _pHAnim
Expand Down Expand Up @@ -1327,7 +1327,7 @@ void SavePlayer(SaveHelper &file, const Player &player)
file.Skip<uint32_t>(8); // Skip pointers _pLAnim
file.Skip<uint32_t>(8); // Skip pointers _pFAnim
file.Skip<uint32_t>(8); // Skip pointers _pTAnim
file.WriteLE<int32_t>(player._pSFrames);
file.WriteLE<int32_t>(player.numSpellFrames);
file.Skip<uint32_t>(); // Skip _pSWidth
file.WriteLE<int32_t>(player._pSFNum);
file.Skip<uint32_t>(8); // Skip pointers _pHAnim
Expand Down
4 changes: 2 additions & 2 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,7 @@ void Player::getAnimationFramesAndTicksPerFrame(player_graphic graphics, int8_t
case player_graphic::Lightning:
case player_graphic::Fire:
case player_graphic::Magic:
numberOfFrames = _pSFrames;
numberOfFrames = numSpellFrames;
break;
case player_graphic::Death:
numberOfFrames = _pDFrames;
Expand Down Expand Up @@ -2249,7 +2249,7 @@ void SetPlrAnims(Player &player)
}

player._pDFrames = plrAtkAnimData.deathFrames;
player._pSFrames = plrAtkAnimData.castingFrames;
player.numSpellFrames = plrAtkAnimData.castingFrames;
player._pSFNum = plrAtkAnimData.castingActionFrame;
int armorGraphicIndex = player._pgfxnum & ~0xFU;
if (IsAnyOf(pc, HeroClass::Warrior, HeroClass::Barbarian)) {
Expand Down
2 changes: 1 addition & 1 deletion Source/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ struct Player {
int8_t _pWFrames;
int8_t _pAFrames;
int8_t _pAFNum;
int8_t _pSFrames;
int8_t numSpellFrames; // _pSFrames
int8_t _pSFNum;
int8_t _pHFrames;
int8_t _pDFrames;
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/memory_map/player.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ R 32 _pAFNum
M 8 32 _pLAnim
M 8 32 _pFAnim
M 8 32 _pTAnim
R 32 _pSFrames
R 32 numSpellFrames
R 32 _pSWidth
R 32 _pSFNum
R 32 _pHFrames
Expand Down
2 changes: 1 addition & 1 deletion test/writehero_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ void AssertPlayer(Player &player)
ASSERT_EQ(player._pWFrames, 8);
ASSERT_EQ(player._pAFrames, 0);
ASSERT_EQ(player._pAFNum, 0);
ASSERT_EQ(player._pSFrames, 16);
ASSERT_EQ(player.numSpellFrames, 16);
ASSERT_EQ(player._pSFNum, 12);
ASSERT_EQ(player._pHFrames, 0);
ASSERT_EQ(player._pDFrames, 20);
Expand Down

0 comments on commit f19b649

Please sign in to comment.