applying the otclient code style
changing the variables names
This commit is contained in:
parent
2927ed29d8
commit
a4400a4ff1
|
@ -271,9 +271,8 @@ void ThingType::unserialize(uint16 clientId, ThingCategory category, const FileS
|
|||
bool hasFrameGroups = (category == ThingCategoryCreature && g_game.getFeature(Otc::GameIdleAnimations));
|
||||
uint8 groupCount = hasFrameGroups ? fin->getU8() : 1;
|
||||
|
||||
|
||||
m_animationPhases = 0;
|
||||
int lastTotalSprites = 0;
|
||||
int realTotalSprites = 0;
|
||||
|
||||
for(int i = 0; i < groupCount; ++i) {
|
||||
uint8 frameGroupType = FrameGroupDefault;
|
||||
|
@ -297,25 +296,25 @@ void ThingType::unserialize(uint16 clientId, ThingCategory category, const FileS
|
|||
m_numPatternZ = fin->getU8();
|
||||
else
|
||||
m_numPatternZ = 1;
|
||||
int n_phases = fin->getU8();
|
||||
|
||||
int groupAnimationsPhases = fin->getU8();
|
||||
m_animationPhases += groupAnimationsPhases;
|
||||
|
||||
m_animationPhases += n_phases;
|
||||
|
||||
if(n_phases > 1 && g_game.getFeature(Otc::GameEnhancedAnimations)) {
|
||||
if(groupAnimationsPhases > 1 && g_game.getFeature(Otc::GameEnhancedAnimations)) {
|
||||
m_animator = AnimatorPtr(new Animator);
|
||||
m_animator->unserialize(n_phases, fin);
|
||||
m_animator->unserialize(groupAnimationsPhases, fin);
|
||||
}
|
||||
|
||||
int totalSprites = m_size.area() * m_layers * m_numPatternX * m_numPatternY * m_numPatternZ * n_phases;
|
||||
int totalSprites = m_size.area() * m_layers * m_numPatternX * m_numPatternY * m_numPatternZ * groupAnimationsPhases;
|
||||
|
||||
if((lastTotalSprites+totalSprites) > 4096)
|
||||
if((realTotalSprites+totalSprites) > 4096)
|
||||
stdext::throw_exception("a thing type has more than 4096 sprites");
|
||||
|
||||
m_spritesIndex.resize((lastTotalSprites+totalSprites));
|
||||
for(int i = lastTotalSprites; i < (lastTotalSprites+totalSprites); i++)
|
||||
m_spritesIndex.resize((realTotalSprites+totalSprites));
|
||||
for(int i = lastTotalSprites; i < (realTotalSprites+totalSprites); i++)
|
||||
m_spritesIndex[i] = g_game.getFeature(Otc::GameSpritesU32) ? fin->getU32() : fin->getU16();
|
||||
|
||||
lastTotalSprites += totalSprites;
|
||||
realTotalSprites += totalSprites;
|
||||
}
|
||||
|
||||
m_textures.resize(m_animationPhases);
|
||||
|
|
Loading…
Reference in New Issue