mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Formatting cleanup
This commit is contained in:
		| @@ -57,6 +57,7 @@ | |||||||
| #include "../lib/CPlayerState.h" | #include "../lib/CPlayerState.h" | ||||||
| #include "../lib/GameConstants.h" | #include "../lib/GameConstants.h" | ||||||
| #include "gui/CGuiHandler.h" | #include "gui/CGuiHandler.h" | ||||||
|  | #include "gui/CAnimation.h" | ||||||
| #include "windows/InfoWindows.h" | #include "windows/InfoWindows.h" | ||||||
| #include "../lib/UnlockGuard.h" | #include "../lib/UnlockGuard.h" | ||||||
| #include "../lib/CPathfinder.h" | #include "../lib/CPathfinder.h" | ||||||
|   | |||||||
| @@ -17,12 +17,13 @@ | |||||||
| #include "CBattleSiegeController.h" | #include "CBattleSiegeController.h" | ||||||
| #include "CBattleInterfaceClasses.h" | #include "CBattleInterfaceClasses.h" | ||||||
|  |  | ||||||
|  | #include "../CGameInfo.h" | ||||||
|  | #include "../CPlayerInterface.h" | ||||||
| #include "../gui/CCursorHandler.h" | #include "../gui/CCursorHandler.h" | ||||||
| #include "../gui/CGuiHandler.h" | #include "../gui/CGuiHandler.h" | ||||||
| #include "../gui/CIntObject.h" | #include "../gui/CIntObject.h" | ||||||
| #include "../windows/CCreatureWindow.h" | #include "../windows/CCreatureWindow.h" | ||||||
| #include "../CGameInfo.h" |  | ||||||
| #include "../CPlayerInterface.h" |  | ||||||
| #include "../../CCallback.h" | #include "../../CCallback.h" | ||||||
| #include "../../lib/CStack.h" | #include "../../lib/CStack.h" | ||||||
| #include "../../lib/battle/BattleAction.h" | #include "../../lib/battle/BattleAction.h" | ||||||
| @@ -45,7 +46,7 @@ CBattleActionsController::CBattleActionsController(CBattleInterface * owner): | |||||||
| 	creatureCasting(false), | 	creatureCasting(false), | ||||||
| 	spellDestSelectMode(false), | 	spellDestSelectMode(false), | ||||||
| 	spellToCast(nullptr), | 	spellToCast(nullptr), | ||||||
| 	sp(nullptr) | 	currentSpell(nullptr) | ||||||
| { | { | ||||||
| 	currentAction = PossiblePlayerBattleAction::INVALID; | 	currentAction = PossiblePlayerBattleAction::INVALID; | ||||||
| 	selectedAction = PossiblePlayerBattleAction::INVALID; | 	selectedAction = PossiblePlayerBattleAction::INVALID; | ||||||
| @@ -57,7 +58,7 @@ void CBattleActionsController::endCastingSpell() | |||||||
| 	{ | 	{ | ||||||
| 		spellToCast.reset(); | 		spellToCast.reset(); | ||||||
|  |  | ||||||
| 		sp = nullptr; | 		currentSpell = nullptr; | ||||||
| 		spellDestSelectMode = false; | 		spellDestSelectMode = false; | ||||||
| 		CCS->curh->changeGraphic(ECursor::COMBAT, ECursor::COMBAT_POINTER); | 		CCS->curh->changeGraphic(ECursor::COMBAT, ECursor::COMBAT_POINTER); | ||||||
|  |  | ||||||
| @@ -212,8 +213,8 @@ void CBattleActionsController::castThisSpell(SpellID spellID) | |||||||
| 	//choosing possible targets | 	//choosing possible targets | ||||||
| 	const CGHeroInstance *castingHero = (owner->attackingHeroInstance->tempOwner == owner->curInt->playerID) ? owner->attackingHeroInstance : owner->defendingHeroInstance; | 	const CGHeroInstance *castingHero = (owner->attackingHeroInstance->tempOwner == owner->curInt->playerID) ? owner->attackingHeroInstance : owner->defendingHeroInstance; | ||||||
| 	assert(castingHero); // code below assumes non-null hero | 	assert(castingHero); // code below assumes non-null hero | ||||||
| 	sp = spellID.toSpell(); | 	currentSpell = spellID.toSpell(); | ||||||
| 	PossiblePlayerBattleAction spellSelMode = owner->curInt->cb->getCasterAction(sp, castingHero, spells::Mode::HERO); | 	PossiblePlayerBattleAction spellSelMode = owner->curInt->cb->getCasterAction(currentSpell, castingHero, spells::Mode::HERO); | ||||||
|  |  | ||||||
| 	if (spellSelMode == PossiblePlayerBattleAction::NO_LOCATION) //user does not have to select location | 	if (spellSelMode == PossiblePlayerBattleAction::NO_LOCATION) //user does not have to select location | ||||||
| 	{ | 	{ | ||||||
| @@ -498,9 +499,9 @@ void CBattleActionsController::handleHex(BattleHex myNumber, int eventType) | |||||||
| 			} | 			} | ||||||
| 				break; | 				break; | ||||||
| 			case PossiblePlayerBattleAction::AIMED_SPELL_CREATURE: | 			case PossiblePlayerBattleAction::AIMED_SPELL_CREATURE: | ||||||
| 				sp = CGI->spellh->objects[creatureCasting ? owner->stacksController->activeStackSpellToCast() : spellToCast->actionSubtype]; //necessary if creature has random Genie spell at same time | 				currentSpell = CGI->spellh->objects[creatureCasting ? owner->stacksController->activeStackSpellToCast() : spellToCast->actionSubtype]; //necessary if creature has random Genie spell at same time | ||||||
| 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[27]) % sp->name % shere->getName()); //Cast %s on %s | 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[27]) % currentSpell->name % shere->getName()); //Cast %s on %s | ||||||
| 				switch (sp->id) | 				switch (currentSpell->id) | ||||||
| 				{ | 				{ | ||||||
| 					case SpellID::SACRIFICE: | 					case SpellID::SACRIFICE: | ||||||
| 					case SpellID::TELEPORT: | 					case SpellID::TELEPORT: | ||||||
| @@ -511,12 +512,12 @@ void CBattleActionsController::handleHex(BattleHex myNumber, int eventType) | |||||||
| 				isCastingPossible = true; | 				isCastingPossible = true; | ||||||
| 				break; | 				break; | ||||||
| 			case PossiblePlayerBattleAction::ANY_LOCATION: | 			case PossiblePlayerBattleAction::ANY_LOCATION: | ||||||
| 				sp = CGI->spellh->objects[creatureCasting ? owner->stacksController->activeStackSpellToCast() : spellToCast->actionSubtype]; //necessary if creature has random Genie spell at same time | 				currentSpell = CGI->spellh->objects[creatureCasting ? owner->stacksController->activeStackSpellToCast() : spellToCast->actionSubtype]; //necessary if creature has random Genie spell at same time | ||||||
| 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[26]) % sp->name); //Cast %s | 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[26]) % currentSpell->name); //Cast %s | ||||||
| 				isCastingPossible = true; | 				isCastingPossible = true; | ||||||
| 				break; | 				break; | ||||||
| 			case PossiblePlayerBattleAction::RANDOM_GENIE_SPELL: //we assume that teleport / sacrifice will never be available as random spell | 			case PossiblePlayerBattleAction::RANDOM_GENIE_SPELL: //we assume that teleport / sacrifice will never be available as random spell | ||||||
| 				sp = nullptr; | 				currentSpell = nullptr; | ||||||
| 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[301]) % shere->getName()); //Cast a spell on % | 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[301]) % shere->getName()); //Cast a spell on % | ||||||
| 				creatureCasting = true; | 				creatureCasting = true; | ||||||
| 				isCastingPossible = true; | 				isCastingPossible = true; | ||||||
| @@ -537,7 +538,7 @@ void CBattleActionsController::handleHex(BattleHex myNumber, int eventType) | |||||||
| 				isCastingPossible = true; | 				isCastingPossible = true; | ||||||
| 				break; | 				break; | ||||||
| 			case PossiblePlayerBattleAction::FREE_LOCATION: | 			case PossiblePlayerBattleAction::FREE_LOCATION: | ||||||
| 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[26]) % sp->name); //Cast %s | 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[26]) % currentSpell->name); //Cast %s | ||||||
| 				isCastingPossible = true; | 				isCastingPossible = true; | ||||||
| 				break; | 				break; | ||||||
| 			case PossiblePlayerBattleAction::HEAL: | 			case PossiblePlayerBattleAction::HEAL: | ||||||
| @@ -583,7 +584,7 @@ void CBattleActionsController::handleHex(BattleHex myNumber, int eventType) | |||||||
| 				break; | 				break; | ||||||
| 			case PossiblePlayerBattleAction::FREE_LOCATION: | 			case PossiblePlayerBattleAction::FREE_LOCATION: | ||||||
| 				cursorFrame = ECursor::COMBAT_BLOCKED; | 				cursorFrame = ECursor::COMBAT_BLOCKED; | ||||||
| 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[181]) % sp->name); //No room to place %s here | 				consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[181]) % currentSpell->name); //No room to place %s here | ||||||
| 				break; | 				break; | ||||||
| 			default: | 			default: | ||||||
| 				if (myNumber == -1) | 				if (myNumber == -1) | ||||||
| @@ -604,8 +605,8 @@ void CBattleActionsController::handleHex(BattleHex myNumber, int eventType) | |||||||
| 			default: | 			default: | ||||||
| 				cursorType = ECursor::SPELLBOOK; | 				cursorType = ECursor::SPELLBOOK; | ||||||
| 				cursorFrame = 0; | 				cursorFrame = 0; | ||||||
| 				if (consoleMsg.empty() && sp) | 				if (consoleMsg.empty() && currentSpell) | ||||||
| 					consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[26]) % sp->name); //Cast %s | 					consoleMsg = boost::str(boost::format(CGI->generaltexth->allTexts[26]) % currentSpell->name); //Cast %s | ||||||
| 				break; | 				break; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| @@ -615,7 +616,7 @@ void CBattleActionsController::handleHex(BattleHex myNumber, int eventType) | |||||||
| 			{ | 			{ | ||||||
|  |  | ||||||
| 				possibleActions.clear(); | 				possibleActions.clear(); | ||||||
| 				switch (sp->id.toEnum()) | 				switch (currentSpell->id.toEnum()) | ||||||
| 				{ | 				{ | ||||||
| 					case SpellID::TELEPORT: //don't cast spell yet, only select target | 					case SpellID::TELEPORT: //don't cast spell yet, only select target | ||||||
| 						spellToCast->aimToUnit(shere); | 						spellToCast->aimToUnit(shere); | ||||||
| @@ -631,7 +632,7 @@ void CBattleActionsController::handleHex(BattleHex myNumber, int eventType) | |||||||
| 			{ | 			{ | ||||||
| 				if (creatureCasting) | 				if (creatureCasting) | ||||||
| 				{ | 				{ | ||||||
| 					if (sp) | 					if (currentSpell) | ||||||
| 					{ | 					{ | ||||||
| 						owner->giveCommand(EActionType::MONSTER_SPELL, myNumber, owner->stacksController->activeStackSpellToCast()); | 						owner->giveCommand(EActionType::MONSTER_SPELL, myNumber, owner->stacksController->activeStackSpellToCast()); | ||||||
| 					} | 					} | ||||||
| @@ -642,8 +643,8 @@ void CBattleActionsController::handleHex(BattleHex myNumber, int eventType) | |||||||
| 				} | 				} | ||||||
| 				else | 				else | ||||||
| 				{ | 				{ | ||||||
| 					assert(sp); | 					assert(currentSpell); | ||||||
| 					switch (sp->id.toEnum()) | 					switch (currentSpell->id.toEnum()) | ||||||
| 					{ | 					{ | ||||||
| 					case SpellID::SACRIFICE: | 					case SpellID::SACRIFICE: | ||||||
| 						spellToCast->aimToUnit(shere);//victim | 						spellToCast->aimToUnit(shere);//victim | ||||||
| @@ -701,11 +702,11 @@ bool CBattleActionsController::isCastingPossibleHere(const CStack *sactive, cons | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  |  | ||||||
| 	sp = nullptr; | 	currentSpell = nullptr; | ||||||
| 	if (spellID >= 0) | 	if (spellID >= 0) | ||||||
| 		sp = CGI->spellh->objects[spellID]; | 		currentSpell = CGI->spellh->objects[spellID]; | ||||||
|  |  | ||||||
| 	if (sp) | 	if (currentSpell) | ||||||
| 	{ | 	{ | ||||||
| 		const spells::Caster *caster = creatureCasting ? static_cast<const spells::Caster *>(sactive) : static_cast<const spells::Caster *>(owner->curInt->cb->battleGetMyHero()); | 		const spells::Caster *caster = creatureCasting ? static_cast<const spells::Caster *>(sactive) : static_cast<const spells::Caster *>(owner->curInt->cb->battleGetMyHero()); | ||||||
| 		if (caster == nullptr) | 		if (caster == nullptr) | ||||||
| @@ -719,9 +720,9 @@ bool CBattleActionsController::isCastingPossibleHere(const CStack *sactive, cons | |||||||
| 			spells::Target target; | 			spells::Target target; | ||||||
| 			target.emplace_back(myNumber); | 			target.emplace_back(myNumber); | ||||||
|  |  | ||||||
| 			spells::BattleCast cast(owner->curInt->cb.get(), caster, mode, sp); | 			spells::BattleCast cast(owner->curInt->cb.get(), caster, mode, currentSpell); | ||||||
|  |  | ||||||
| 			auto m = sp->battleMechanics(&cast); | 			auto m = currentSpell->battleMechanics(&cast); | ||||||
| 			spells::detail::ProblemImpl problem; //todo: display problem in status bar | 			spells::detail::ProblemImpl problem; //todo: display problem in status bar | ||||||
|  |  | ||||||
| 			isCastingPossible = m->canBeCastAt(target, problem); | 			isCastingPossible = m->canBeCastAt(target, problem); | ||||||
|   | |||||||
| @@ -34,7 +34,7 @@ class CBattleActionsController | |||||||
| 	bool creatureCasting; //if true, stack currently aims to cats a spell | 	bool creatureCasting; //if true, stack currently aims to cats a spell | ||||||
| 	bool spellDestSelectMode; //if true, player is choosing destination for his spell - only for GUI / console | 	bool spellDestSelectMode; //if true, player is choosing destination for his spell - only for GUI / console | ||||||
| 	std::shared_ptr<BattleAction> spellToCast; //spell for which player is choosing destination | 	std::shared_ptr<BattleAction> spellToCast; //spell for which player is choosing destination | ||||||
| 	const CSpell *sp; //spell pointer for convenience | 	const CSpell *currentSpell; //spell pointer for convenience | ||||||
|  |  | ||||||
| 	bool isCastingPossibleHere (const CStack *sactive, const CStack *shere, BattleHex myNumber); | 	bool isCastingPossibleHere (const CStack *sactive, const CStack *shere, BattleHex myNumber); | ||||||
| 	bool canStackMoveHere (const CStack *sactive, BattleHex MyNumber); //TODO: move to BattleState / callback | 	bool canStackMoveHere (const CStack *sactive, BattleHex MyNumber); //TODO: move to BattleState / callback | ||||||
|   | |||||||
| @@ -179,18 +179,23 @@ const CCreature * CAttackAnimation::getCreature() | |||||||
|  |  | ||||||
| CAttackAnimation::CAttackAnimation(CBattleInterface *_owner, const CStack *attacker, BattleHex _dest, const CStack *defender) | CAttackAnimation::CAttackAnimation(CBattleInterface *_owner, const CStack *attacker, BattleHex _dest, const CStack *defender) | ||||||
| 	: CBattleStackAnimation(_owner, attacker), | 	: CBattleStackAnimation(_owner, attacker), | ||||||
| 		shooting(false), group(CCreatureAnim::SHOOT_FRONT), | 	  shooting(false), | ||||||
| 		soundPlayed(false), | 	  group(CCreatureAnim::SHOOT_FRONT), | ||||||
| 		dest(_dest), attackedStack(defender), attackingStack(attacker) | 	  soundPlayed(false), | ||||||
|  | 	  dest(_dest), | ||||||
|  | 	  attackedStack(defender), | ||||||
|  | 	  attackingStack(attacker) | ||||||
| { | { | ||||||
| 	assert(attackingStack && "attackingStack is nullptr in CBattleAttack::CBattleAttack !\n"); | 	assert(attackingStack && "attackingStack is nullptr in CBattleAttack::CBattleAttack !\n"); | ||||||
| 	attackingStackPosBeforeReturn = attackingStack->getPosition(); | 	attackingStackPosBeforeReturn = attackingStack->getPosition(); | ||||||
| } | } | ||||||
|  |  | ||||||
| CDefenceAnimation::CDefenceAnimation(StackAttackedInfo _attackedInfo, CBattleInterface * _owner) | CDefenceAnimation::CDefenceAnimation(StackAttackedInfo _attackedInfo, CBattleInterface * _owner) | ||||||
| : CBattleStackAnimation(_owner, _attackedInfo.defender), | 	: CBattleStackAnimation(_owner, _attackedInfo.defender), | ||||||
| attacker(_attackedInfo.attacker), rangedAttack(_attackedInfo.indirectAttack), | 	  attacker(_attackedInfo.attacker), | ||||||
| killed(_attackedInfo.killed), timeToWait(0) | 	  rangedAttack(_attackedInfo.indirectAttack), | ||||||
|  | 	  killed(_attackedInfo.killed), | ||||||
|  | 	  timeToWait(0) | ||||||
| { | { | ||||||
| 	logAnim->debug("Created defence anim for %s", _attackedInfo.defender->getName()); | 	logAnim->debug("Created defence anim for %s", _attackedInfo.defender->getName()); | ||||||
| } | } | ||||||
| @@ -323,7 +328,9 @@ CDefenceAnimation::~CDefenceAnimation() | |||||||
| } | } | ||||||
|  |  | ||||||
| CDummyAnimation::CDummyAnimation(CBattleInterface * _owner, int howManyFrames) | CDummyAnimation::CDummyAnimation(CBattleInterface * _owner, int howManyFrames) | ||||||
| : CBattleAnimation(_owner), counter(0), howMany(howManyFrames) | 	: CBattleAnimation(_owner), | ||||||
|  | 	  counter(0), | ||||||
|  | 	  howMany(howManyFrames) | ||||||
| { | { | ||||||
| 	logAnim->debug("Created dummy animation for %d frames", howManyFrames); | 	logAnim->debug("Created dummy animation for %d frames", howManyFrames); | ||||||
| } | } | ||||||
| @@ -432,7 +439,7 @@ bool CMeleeAttackAnimation::init() | |||||||
| } | } | ||||||
|  |  | ||||||
| CMeleeAttackAnimation::CMeleeAttackAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked) | CMeleeAttackAnimation::CMeleeAttackAnimation(CBattleInterface * _owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked) | ||||||
| : CAttackAnimation(_owner, attacker, _dest, _attacked) | 	: CAttackAnimation(_owner, attacker, _dest, _attacked) | ||||||
| { | { | ||||||
| 	logAnim->debug("Created melee attack anim for %s", attacker->getName()); | 	logAnim->debug("Created melee attack anim for %s", attacker->getName()); | ||||||
| } | } | ||||||
| @@ -599,7 +606,7 @@ CMovementEndAnimation::~CMovementEndAnimation() | |||||||
| } | } | ||||||
|  |  | ||||||
| CMovementStartAnimation::CMovementStartAnimation(CBattleInterface * _owner, const CStack * _stack) | CMovementStartAnimation::CMovementStartAnimation(CBattleInterface * _owner, const CStack * _stack) | ||||||
| : CBattleStackAnimation(_owner, _stack) | 	: CBattleStackAnimation(_owner, _stack) | ||||||
| { | { | ||||||
| 	logAnim->debug("Created movement start anim for %s", stack->getName()); | 	logAnim->debug("Created movement start anim for %s", stack->getName()); | ||||||
| } | } | ||||||
| @@ -624,7 +631,9 @@ bool CMovementStartAnimation::init() | |||||||
| } | } | ||||||
|  |  | ||||||
| CReverseAnimation::CReverseAnimation(CBattleInterface * _owner, const CStack * stack, BattleHex dest, bool _priority) | CReverseAnimation::CReverseAnimation(CBattleInterface * _owner, const CStack * stack, BattleHex dest, bool _priority) | ||||||
| : CBattleStackAnimation(_owner, stack), hex(dest), priority(_priority) | 	: CBattleStackAnimation(_owner, stack), | ||||||
|  | 	  hex(dest), | ||||||
|  | 	  priority(_priority) | ||||||
| { | { | ||||||
| 	logAnim->debug("Created reverse anim for %s", stack->getName()); | 	logAnim->debug("Created reverse anim for %s", stack->getName()); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -9,20 +9,23 @@ | |||||||
|  */ |  */ | ||||||
| #include "StdInc.h" | #include "StdInc.h" | ||||||
| #include "CBattleControlPanel.h" | #include "CBattleControlPanel.h" | ||||||
|  |  | ||||||
| #include "CBattleInterface.h" | #include "CBattleInterface.h" | ||||||
| #include "CBattleInterfaceClasses.h" | #include "CBattleInterfaceClasses.h" | ||||||
| #include "CBattleStacksController.h" | #include "CBattleStacksController.h" | ||||||
| #include "CBattleActionsController.h" | #include "CBattleActionsController.h" | ||||||
| #include "../widgets/Buttons.h" |  | ||||||
| #include "../widgets/Images.h" |  | ||||||
| #include "../CGameInfo.h" | #include "../CGameInfo.h" | ||||||
| #include "../../lib/CGeneralTextHandler.h" |  | ||||||
| #include "../../lib/mapObjects/CGHeroInstance.h" |  | ||||||
| #include "../CPlayerInterface.h" | #include "../CPlayerInterface.h" | ||||||
| #include "../../CCallback.h" |  | ||||||
| #include "../gui/CCursorHandler.h" | #include "../gui/CCursorHandler.h" | ||||||
| #include "../gui/CGuiHandler.h" | #include "../gui/CGuiHandler.h" | ||||||
| #include "../windows/CSpellWindow.h" | #include "../windows/CSpellWindow.h" | ||||||
|  | #include "../widgets/Buttons.h" | ||||||
|  | #include "../widgets/Images.h" | ||||||
|  |  | ||||||
|  | #include "../../CCallback.h" | ||||||
|  | #include "../../lib/CGeneralTextHandler.h" | ||||||
|  | #include "../../lib/mapObjects/CGHeroInstance.h" | ||||||
| #include "../../lib/CStack.h" | #include "../../lib/CStack.h" | ||||||
| #include "../../lib/CConfigHandler.h" | #include "../../lib/CConfigHandler.h" | ||||||
|  |  | ||||||
|   | |||||||
| @@ -15,11 +15,13 @@ | |||||||
| #include "CBattleInterface.h" | #include "CBattleInterface.h" | ||||||
| #include "CBattleInterfaceClasses.h" | #include "CBattleInterfaceClasses.h" | ||||||
| #include "CBattleStacksController.h" | #include "CBattleStacksController.h" | ||||||
| #include "../gui/CAnimation.h" |  | ||||||
| #include "../gui/CCanvas.h" |  | ||||||
| #include "../CMusicHandler.h" | #include "../CMusicHandler.h" | ||||||
| #include "../CGameInfo.h" | #include "../CGameInfo.h" | ||||||
| #include "../CPlayerInterface.h" | #include "../CPlayerInterface.h" | ||||||
|  | #include "../gui/CAnimation.h" | ||||||
|  | #include "../gui/CCanvas.h" | ||||||
|  |  | ||||||
| #include "../../CCallback.h" | #include "../../CCallback.h" | ||||||
| #include "../../lib/battle/BattleAction.h" | #include "../../lib/battle/BattleAction.h" | ||||||
| #include "../../lib/NetPacks.h" | #include "../../lib/NetPacks.h" | ||||||
|   | |||||||
| @@ -9,19 +9,22 @@ | |||||||
|  */ |  */ | ||||||
| #include "StdInc.h" | #include "StdInc.h" | ||||||
| #include "CBattleFieldController.h" | #include "CBattleFieldController.h" | ||||||
|  |  | ||||||
| #include "CBattleInterface.h" | #include "CBattleInterface.h" | ||||||
| #include "CBattleActionsController.h" | #include "CBattleActionsController.h" | ||||||
| #include "CBattleInterfaceClasses.h" | #include "CBattleInterfaceClasses.h" | ||||||
| #include "CBattleSiegeController.h" | #include "CBattleSiegeController.h" | ||||||
| #include "CBattleStacksController.h" | #include "CBattleStacksController.h" | ||||||
| #include "CBattleObstacleController.h" | #include "CBattleObstacleController.h" | ||||||
|  |  | ||||||
| #include "../CGameInfo.h" | #include "../CGameInfo.h" | ||||||
| #include "../../CCallback.h" | #include "../CPlayerInterface.h" | ||||||
| #include "../gui/CAnimation.h" | #include "../gui/CAnimation.h" | ||||||
| #include "../gui/CCanvas.h" | #include "../gui/CCanvas.h" | ||||||
| #include "../gui/CGuiHandler.h" | #include "../gui/CGuiHandler.h" | ||||||
| #include "../CPlayerInterface.h" |  | ||||||
| #include "../gui/CCursorHandler.h" | #include "../gui/CCursorHandler.h" | ||||||
|  |  | ||||||
|  | #include "../../CCallback.h" | ||||||
| #include "../../lib/BattleFieldHandler.h" | #include "../../lib/BattleFieldHandler.h" | ||||||
| #include "../../lib/CConfigHandler.h" | #include "../../lib/CConfigHandler.h" | ||||||
| #include "../../lib/CStack.h" | #include "../../lib/CStack.h" | ||||||
|   | |||||||
| @@ -9,16 +9,19 @@ | |||||||
|  */ |  */ | ||||||
| #include "StdInc.h" | #include "StdInc.h" | ||||||
| #include "CBattleObstacleController.h" | #include "CBattleObstacleController.h" | ||||||
|  |  | ||||||
| #include "CBattleInterface.h" | #include "CBattleInterface.h" | ||||||
| #include "CBattleFieldController.h" | #include "CBattleFieldController.h" | ||||||
| #include "CBattleAnimations.h" | #include "CBattleAnimations.h" | ||||||
| #include "CBattleStacksController.h" | #include "CBattleStacksController.h" | ||||||
|  |  | ||||||
| #include "../CPlayerInterface.h" | #include "../CPlayerInterface.h" | ||||||
|  | #include "../gui/CAnimation.h" | ||||||
|  | #include "../gui/CCanvas.h" | ||||||
|  |  | ||||||
| #include "../../CCallback.h" | #include "../../CCallback.h" | ||||||
| #include "../../lib/battle/CObstacleInstance.h" | #include "../../lib/battle/CObstacleInstance.h" | ||||||
| #include "../../lib/ObstacleHandler.h" | #include "../../lib/ObstacleHandler.h" | ||||||
| #include "../gui/CAnimation.h" |  | ||||||
| #include "../gui/CCanvas.h" |  | ||||||
|  |  | ||||||
| CBattleObstacleController::CBattleObstacleController(CBattleInterface * owner): | CBattleObstacleController::CBattleObstacleController(CBattleInterface * owner): | ||||||
| 	owner(owner) | 	owner(owner) | ||||||
|   | |||||||
| @@ -9,17 +9,20 @@ | |||||||
|  */ |  */ | ||||||
| #include "StdInc.h" | #include "StdInc.h" | ||||||
| #include "CBattleProjectileController.h" | #include "CBattleProjectileController.h" | ||||||
| #include "../gui/Geometries.h" |  | ||||||
| #include "../../lib/CStack.h" |  | ||||||
| #include "../../lib/mapObjects/CGTownInstance.h" |  | ||||||
| #include "../CGameInfo.h" |  | ||||||
| #include "../gui/CAnimation.h" |  | ||||||
| #include "../gui/CCanvas.h" |  | ||||||
| #include "CBattleInterface.h" | #include "CBattleInterface.h" | ||||||
| #include "CBattleSiegeController.h" | #include "CBattleSiegeController.h" | ||||||
| #include "CBattleStacksController.h" | #include "CBattleStacksController.h" | ||||||
| #include "CCreatureAnimation.h" | #include "CCreatureAnimation.h" | ||||||
|  |  | ||||||
|  | #include "../gui/Geometries.h" | ||||||
|  | #include "../gui/CAnimation.h" | ||||||
|  | #include "../gui/CCanvas.h" | ||||||
|  | #include "../CGameInfo.h" | ||||||
|  |  | ||||||
|  | #include "../../lib/CStack.h" | ||||||
|  | #include "../../lib/mapObjects/CGTownInstance.h" | ||||||
|  |  | ||||||
| static double calculateCatapultParabolaY(const Point & from, const Point & dest, int x) | static double calculateCatapultParabolaY(const Point & from, const Point & dest, int x) | ||||||
| { | { | ||||||
| 	double facA = 0.005; // seems to be constant | 	double facA = 0.005; // seems to be constant | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ | |||||||
|  */ |  */ | ||||||
| #include "StdInc.h" | #include "StdInc.h" | ||||||
| #include "CBattleStacksController.h" | #include "CBattleStacksController.h" | ||||||
|  |  | ||||||
| #include "CBattleSiegeController.h" | #include "CBattleSiegeController.h" | ||||||
| #include "CBattleInterfaceClasses.h" | #include "CBattleInterfaceClasses.h" | ||||||
| #include "CBattleInterface.h" | #include "CBattleInterface.h" | ||||||
| @@ -17,18 +18,21 @@ | |||||||
| #include "CBattleEffectsController.h" | #include "CBattleEffectsController.h" | ||||||
| #include "CBattleProjectileController.h" | #include "CBattleProjectileController.h" | ||||||
| #include "CBattleControlPanel.h" | #include "CBattleControlPanel.h" | ||||||
|  |  | ||||||
|  | #include "CCreatureAnimation.h" | ||||||
|  |  | ||||||
|  | #include "../CPlayerInterface.h" | ||||||
|  | #include "../CMusicHandler.h" | ||||||
|  | #include "../CGameInfo.h" | ||||||
| #include "../gui/CAnimation.h" | #include "../gui/CAnimation.h" | ||||||
| #include "../gui/CGuiHandler.h" | #include "../gui/CGuiHandler.h" | ||||||
| #include "../gui/CCanvas.h" | #include "../gui/CCanvas.h" | ||||||
| #include "../../lib/battle/BattleHex.h" |  | ||||||
| #include "../CPlayerInterface.h" |  | ||||||
| #include "CCreatureAnimation.h" |  | ||||||
| #include "../../lib/CGameState.h" |  | ||||||
| #include "../../CCallback.h" | #include "../../CCallback.h" | ||||||
|  | #include "../../lib/battle/BattleHex.h" | ||||||
|  | #include "../../lib/CGameState.h" | ||||||
| #include "../../lib/CStack.h" | #include "../../lib/CStack.h" | ||||||
| #include "../../lib/CondSh.h" | #include "../../lib/CondSh.h" | ||||||
| #include "../CMusicHandler.h" |  | ||||||
| #include "../CGameInfo.h" |  | ||||||
|  |  | ||||||
| static void onAnimationFinished(const CStack *stack, std::weak_ptr<CCreatureAnimation> anim) | static void onAnimationFinished(const CStack *stack, std::weak_ptr<CCreatureAnimation> anim) | ||||||
| { | { | ||||||
|   | |||||||
| @@ -70,7 +70,6 @@ void CCanvas::drawText(const Point & position, const EFonts & font, const SDL_Co | |||||||
| 	case ETextAlignment::CENTER:       return graphics->fonts[font]->renderTextLinesCenter(surface, text, colorDest, position); | 	case ETextAlignment::CENTER:       return graphics->fonts[font]->renderTextLinesCenter(surface, text, colorDest, position); | ||||||
| 	case ETextAlignment::BOTTOMRIGHT:  return graphics->fonts[font]->renderTextLinesRight (surface, text, colorDest, position); | 	case ETextAlignment::BOTTOMRIGHT:  return graphics->fonts[font]->renderTextLinesRight (surface, text, colorDest, position); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| SDL_Surface * CCanvas::getSurface() | SDL_Surface * CCanvas::getSurface() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user