mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Integrated CClientState into GameEngine class
This commit is contained in:
@ -124,7 +124,7 @@ void StackActionAnimation::setSound( const AudioPath & sound )
|
||||
bool StackActionAnimation::init()
|
||||
{
|
||||
if (!sound.empty())
|
||||
CCS->soundh->playSound(sound);
|
||||
ENGINE->sound().playSound(sound);
|
||||
|
||||
if (myAnim->framesInGroup(currGroup) > 0)
|
||||
{
|
||||
@ -358,7 +358,7 @@ bool MovementAnimation::init()
|
||||
|
||||
if (moveSoundHandler == -1)
|
||||
{
|
||||
moveSoundHandler = CCS->soundh->playSound(stack->unitType()->sounds.move, -1);
|
||||
moveSoundHandler = ENGINE->sound().playSound(stack->unitType()->sounds.move, -1);
|
||||
}
|
||||
|
||||
Point begPosition = owner.stacksController->getStackPositionAtHex(prevHex, stack);
|
||||
@ -419,7 +419,7 @@ MovementAnimation::~MovementAnimation()
|
||||
assert(stack);
|
||||
|
||||
if(moveSoundHandler != -1)
|
||||
CCS->soundh->stopSound(moveSoundHandler);
|
||||
ENGINE->sound().stopSound(moveSoundHandler);
|
||||
}
|
||||
|
||||
MovementAnimation::MovementAnimation(BattleInterface & owner, const CStack *stack, const BattleHexArray & _destTiles, int _distance)
|
||||
@ -455,7 +455,7 @@ bool MovementEndAnimation::init()
|
||||
logAnim->debug("CMovementEndAnimation::init: stack %s", stack->getName());
|
||||
myAnim->pos.moveTo(owner.stacksController->getStackPositionAtHex(nextHex, stack));
|
||||
|
||||
CCS->soundh->playSound(stack->unitType()->sounds.endMoving);
|
||||
ENGINE->sound().playSound(stack->unitType()->sounds.endMoving);
|
||||
|
||||
if(!myAnim->framesInGroup(ECreatureAnimType::MOVE_END))
|
||||
{
|
||||
@ -475,7 +475,7 @@ MovementEndAnimation::~MovementEndAnimation()
|
||||
if(myAnim->getType() != ECreatureAnimType::DEAD)
|
||||
myAnim->setType(ECreatureAnimType::HOLDING); //resetting to default
|
||||
|
||||
CCS->curh->show();
|
||||
ENGINE->cursor().show();
|
||||
}
|
||||
|
||||
MovementStartAnimation::MovementStartAnimation(BattleInterface & owner, const CStack * _stack)
|
||||
@ -496,7 +496,7 @@ bool MovementStartAnimation::init()
|
||||
}
|
||||
|
||||
logAnim->debug("CMovementStartAnimation::init: stack %s", stack->getName());
|
||||
CCS->soundh->playSound(stack->unitType()->sounds.startMoving);
|
||||
ENGINE->sound().playSound(stack->unitType()->sounds.startMoving);
|
||||
|
||||
if(!myAnim->framesInGroup(ECreatureAnimType::MOVE_START))
|
||||
{
|
||||
@ -816,7 +816,7 @@ void CatapultAnimation::tick(uint32_t msPassed)
|
||||
auto soundFilename = AudioPath::builtin((catapultDamage > 0) ? "WALLHIT" : "WALLMISS");
|
||||
AnimationPath effectFilename = AnimationPath::builtin((catapultDamage > 0) ? "SGEXPL" : "CSGRCK");
|
||||
|
||||
CCS->soundh->playSound( soundFilename );
|
||||
ENGINE->sound().playSound( soundFilename );
|
||||
owner.stacksController->addNewAnim( new EffectAnimation(owner, effectFilename, shotTarget));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user