瀏覽代碼

Minor cleanup

Ivan Savenko 3 年之前
父節點
當前提交
4b3d93f378

+ 4 - 1
client/battle/BattleAnimationClasses.cpp

@@ -24,7 +24,6 @@
 #include "../CPlayerInterface.h"
 #include "../gui/CCursorHandler.h"
 #include "../gui/CGuiHandler.h"
-#include "../gui/SDL_Extensions.h"
 
 #include "../../CCallback.h"
 #include "../../lib/CStack.h"
@@ -238,6 +237,7 @@ ECreatureAnimType MeleeAttackAnimation::getUpwardsGroup(bool multiAttack) const
 	return findValidGroup({
 		ECreatureAnimType::GROUP_ATTACK_UP,
 		ECreatureAnimType::SPECIAL_UP,
+		ECreatureAnimType::SPECIAL_FRONT, // weird, but required for H3
 		ECreatureAnimType::ATTACK_UP
 	});
 }
@@ -262,6 +262,7 @@ ECreatureAnimType MeleeAttackAnimation::getDownwardsGroup(bool multiAttack) cons
 	return findValidGroup({
 		ECreatureAnimType::GROUP_ATTACK_DOWN,
 		ECreatureAnimType::SPECIAL_DOWN,
+		ECreatureAnimType::SPECIAL_FRONT, // weird, but required for H3
 		ECreatureAnimType::ATTACK_DOWN
 	});
 }
@@ -822,6 +823,7 @@ ECreatureAnimType CastAnimation::getUpwardsGroup() const
 	return findValidGroup({
 		ECreatureAnimType::CAST_UP,
 		ECreatureAnimType::SPECIAL_UP,
+		ECreatureAnimType::SPECIAL_FRONT, // weird, but required for H3
 		ECreatureAnimType::SHOOT_UP,
 		ECreatureAnimType::ATTACK_UP
 	});
@@ -842,6 +844,7 @@ ECreatureAnimType CastAnimation::getDownwardsGroup() const
 	return findValidGroup({
 		ECreatureAnimType::CAST_DOWN,
 		ECreatureAnimType::SPECIAL_DOWN,
+		ECreatureAnimType::SPECIAL_FRONT, // weird, but required for H3
 		ECreatureAnimType::SHOOT_DOWN,
 		ECreatureAnimType::ATTACK_DOWN
 	});

+ 7 - 9
client/battle/BattleConstants.h

@@ -31,15 +31,13 @@ enum class EBattleEffect
 };
 
 enum class EAnimationEvents {
-	OPENING     = 0, // TODO battle opening sound is playing
+	OPENING     = 0, // battle opening sound is playing
 	ACTION      = 1, // there are any ongoing animations
-	BEFORE_MOVE = 2, // TODO effects played before stack can act, e.g. regen or bad morale
-	MOVEMENT    = 3, // stacks are moving or turning around
-	BEFORE_HIT  = 4, // effects played before all attack/defence/hit animations
-	ATTACK      = 5, // attack and defence animations are playing
-	HIT         = 6, // hit & death animations are playing
-	AFTER_HIT   = 7, // after all hit & death animations are over
-	PROJECTILES = 8, // TODO there are any flying projectiles
+	MOVEMENT    = 2, // stacks are moving or turning around
+	BEFORE_HIT  = 3, // effects played before all attack/defence/hit animations
+	ATTACK      = 4, // attack and defence animations are playing
+	HIT         = 5, // hit & death animations are playing
+	AFTER_HIT   = 6, // after all hit & death animations are over
 	COUNT
 };
 
@@ -74,7 +72,7 @@ enum class ECreatureAnimType
 	SHOOT_FRONT     = 15, // Shooters only
 	SHOOT_DOWN      = 16, // Shooters only
 	SPECIAL_UP      = 17, // If empty, fallback to SPECIAL_FRONT
-	SPECIAL_FRONT   = 18, // Used for any special moves - dragon breath, spellcasting, (possibly - Pit Lord/Ogre Mage ability)
+	SPECIAL_FRONT   = 18, // Used for any special moves - dragon breath, spellcasting, Pit Lord/Ogre Mage ability
 	SPECIAL_DOWN    = 19, // If empty, fallback to SPECIAL_FRONT
 	MOVE_START      = 20, // small animation to be played before MOVING
 	MOVE_END        = 21, // small animation to be played after MOVING

+ 2 - 3
client/battle/BattleStacksController.cpp

@@ -673,7 +673,6 @@ void BattleStacksController::endAction(const BattleAction* action)
 	assert(owner.getAnimationCondition(EAnimationEvents::MOVEMENT) == false);
 	assert(owner.getAnimationCondition(EAnimationEvents::ATTACK) == false);
 	assert(owner.getAnimationCondition(EAnimationEvents::HIT) == false);
-	assert(owner.getAnimationCondition(EAnimationEvents::PROJECTILES) == false);
 
 	owner.windowObject->blockUI(activeStack == nullptr);
 	removeExpiredColorFilters();
@@ -684,14 +683,14 @@ void BattleStacksController::startAction(const BattleAction* action)
 	removeExpiredColorFilters();
 }
 
-void BattleStacksController::stackActivated(const CStack *stack) //TODO: check it all before game state is changed due to abilities
+void BattleStacksController::stackActivated(const CStack *stack)
 {
 	stackToActivate = stack;
 	owner.waitForAnimationCondition(EAnimationEvents::ACTION, false);
 	owner.activateStack();
 }
 
-void BattleStacksController::activateStack() //TODO: check it all before game state is changed due to abilities
+void BattleStacksController::activateStack()
 {
 	if ( !currentAnimations.empty())
 		return;

+ 0 - 1
client/widgets/AdventureMapClasses.h

@@ -11,7 +11,6 @@
 
 #include "ObjectLists.h"
 #include "../../lib/FunctionList.h"
-#include "../../lib/int3.h"
 #include "Terrain.h"
 
 VCMI_LIB_NAMESPACE_BEGIN