|
@@ -1097,12 +1097,12 @@ void CBattleInterface::stackMoved(int number, int destHex, bool endMoving, int d
|
|
|
if(startMoving) //animation of starting move; some units don't have this animation (ie. halberdier)
|
|
if(startMoving) //animation of starting move; some units don't have this animation (ie. halberdier)
|
|
|
{
|
|
{
|
|
|
if (movedStack->creature->sounds.startMoving)
|
|
if (movedStack->creature->sounds.startMoving)
|
|
|
- CGI->audioh->playSound(movedStack->creature->sounds.startMoving);
|
|
|
|
|
|
|
+ CGI->soundh->playSound(movedStack->creature->sounds.startMoving);
|
|
|
handleStartMoving(number);
|
|
handleStartMoving(number);
|
|
|
}
|
|
}
|
|
|
if(moveStarted)
|
|
if(moveStarted)
|
|
|
{
|
|
{
|
|
|
- moveSh = CGI->audioh->playSound(movedStack->creature->sounds.move, -1);
|
|
|
|
|
|
|
+ moveSh = CGI->soundh->playSound(movedStack->creature->sounds.move, -1);
|
|
|
CGI->curh->hide();
|
|
CGI->curh->hide();
|
|
|
creAnims[number]->setType(0);
|
|
creAnims[number]->setType(0);
|
|
|
moveStarted = false;
|
|
moveStarted = false;
|
|
@@ -1198,7 +1198,7 @@ void CBattleInterface::stackMoved(int number, int destHex, bool endMoving, int d
|
|
|
if(creAnims[number]->framesInGroup(21)!=0) // some units don't have this animation (ie. halberdier)
|
|
if(creAnims[number]->framesInGroup(21)!=0) // some units don't have this animation (ie. halberdier)
|
|
|
{
|
|
{
|
|
|
if (movedStack->creature->sounds.endMoving) {
|
|
if (movedStack->creature->sounds.endMoving) {
|
|
|
- CGI->audioh->playSound(movedStack->creature->sounds.endMoving);
|
|
|
|
|
|
|
+ CGI->soundh->playSound(movedStack->creature->sounds.endMoving);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
creAnims[number]->setType(21);
|
|
creAnims[number]->setType(21);
|
|
@@ -1213,7 +1213,7 @@ void CBattleInterface::stackMoved(int number, int destHex, bool endMoving, int d
|
|
|
}
|
|
}
|
|
|
creAnims[number]->setType(2); //resetting to default
|
|
creAnims[number]->setType(2); //resetting to default
|
|
|
CGI->curh->show();
|
|
CGI->curh->show();
|
|
|
- CGI->audioh->stopSound(moveSh);
|
|
|
|
|
|
|
+ CGI->soundh->stopSound(moveSh);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
CStack curs = *LOCPLINT->cb->battleGetStackByID(number);
|
|
CStack curs = *LOCPLINT->cb->battleGetStackByID(number);
|
|
@@ -1287,13 +1287,13 @@ void CBattleInterface::stacksAreAttacked(std::vector<CBattleInterface::SStackAtt
|
|
|
|
|
|
|
|
if(attackedInfos[g].killed)
|
|
if(attackedInfos[g].killed)
|
|
|
{
|
|
{
|
|
|
- CGI->audioh->playSound(attacked.creature->sounds.killed);
|
|
|
|
|
|
|
+ CGI->soundh->playSound(attacked.creature->sounds.killed);
|
|
|
creAnims[attackedInfos[g].ID]->setType(5); //death
|
|
creAnims[attackedInfos[g].ID]->setType(5); //death
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
// TODO: this block doesn't seems correct if the unit is defending.
|
|
// TODO: this block doesn't seems correct if the unit is defending.
|
|
|
- CGI->audioh->playSound(attacked.creature->sounds.wince);
|
|
|
|
|
|
|
+ CGI->soundh->playSound(attacked.creature->sounds.wince);
|
|
|
creAnims[attackedInfos[g].ID]->setType(3); //getting hit
|
|
creAnims[attackedInfos[g].ID]->setType(3); //getting hit
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1786,7 +1786,7 @@ void CBattleInterface::battleFinished(const BattleResult& br)
|
|
|
CGI->curh->changeGraphic(0,0);
|
|
CGI->curh->changeGraphic(0,0);
|
|
|
|
|
|
|
|
SDL_Rect temp_rect = genRect(561, 470, (screen->w - 800)/2 + 165, (screen->h - 600)/2 + 19);
|
|
SDL_Rect temp_rect = genRect(561, 470, (screen->w - 800)/2 + 165, (screen->h - 600)/2 + 19);
|
|
|
- CGI->audioh->stopMusic();
|
|
|
|
|
|
|
+ CGI->musich->stopMusic();
|
|
|
resWindow = new CBattleReslutWindow(br, temp_rect, this);
|
|
resWindow = new CBattleReslutWindow(br, temp_rect, this);
|
|
|
LOCPLINT->pushInt(resWindow);
|
|
LOCPLINT->pushInt(resWindow);
|
|
|
}
|
|
}
|
|
@@ -1801,7 +1801,7 @@ void CBattleInterface::spellCast(SpellCast * sc)
|
|
|
std::vector< std::string > anims; //for magic arrow and ice bolt
|
|
std::vector< std::string > anims; //for magic arrow and ice bolt
|
|
|
|
|
|
|
|
if (spell.soundID != soundBase::invalid)
|
|
if (spell.soundID != soundBase::invalid)
|
|
|
- CGI->audioh->playSound(spell.soundID);
|
|
|
|
|
|
|
+ CGI->soundh->playSound(spell.soundID);
|
|
|
|
|
|
|
|
switch(sc->id)
|
|
switch(sc->id)
|
|
|
{
|
|
{
|
|
@@ -2052,14 +2052,14 @@ void CBattleInterface::attackingShowHelper()
|
|
|
// that is fixed. Once done, we can get rid of
|
|
// that is fixed. Once done, we can get rid of
|
|
|
// attackingInfo->sh
|
|
// attackingInfo->sh
|
|
|
if (attackingInfo->sh == -1)
|
|
if (attackingInfo->sh == -1)
|
|
|
- attackingInfo->sh = CGI->audioh->playSound(aStack.creature->sounds.shoot);
|
|
|
|
|
|
|
+ attackingInfo->sh = CGI->soundh->playSound(aStack.creature->sounds.shoot);
|
|
|
creAnims[attackingInfo->ID]->setType(attackingInfo->shootingGroup);
|
|
creAnims[attackingInfo->ID]->setType(attackingInfo->shootingGroup);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
// TODO: see comment above
|
|
// TODO: see comment above
|
|
|
if (attackingInfo->sh == -1)
|
|
if (attackingInfo->sh == -1)
|
|
|
- attackingInfo->sh = CGI->audioh->playSound(aStack.creature->sounds.attack);
|
|
|
|
|
|
|
+ attackingInfo->sh = CGI->soundh->playSound(aStack.creature->sounds.attack);
|
|
|
if(aStack.creature->isDoubleWide())
|
|
if(aStack.creature->isDoubleWide())
|
|
|
{
|
|
{
|
|
|
switch(BattleInfo::mutualPosition(aStack.position+attackingInfo->posShiftDueToDist, attackingInfo->dest)) //attack direction
|
|
switch(BattleInfo::mutualPosition(aStack.position+attackingInfo->posShiftDueToDist, attackingInfo->dest)) //attack direction
|
|
@@ -2792,36 +2792,36 @@ CBattleReslutWindow::CBattleReslutWindow(const BattleResult &br, const SDL_Rect
|
|
|
case 0: //normal victory
|
|
case 0: //normal victory
|
|
|
if((br.winner == 0 && weAreAttacker) || (br.winner == 1 && !weAreAttacker)) //we've won
|
|
if((br.winner == 0 && weAreAttacker) || (br.winner == 1 && !weAreAttacker)) //we've won
|
|
|
{
|
|
{
|
|
|
- CGI->audioh->playMusic(musicBase::winBattle);
|
|
|
|
|
|
|
+ CGI->musich->playMusic(musicBase::winBattle);
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[304], 235, 235, GEOR13, zwykly, background);
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[304], 235, 235, GEOR13, zwykly, background);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- CGI->audioh->playMusic(musicBase::loseCombat);
|
|
|
|
|
|
|
+ CGI->musich->playMusic(musicBase::loseCombat);
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[311], 235, 235, GEOR13, zwykly, background);
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[311], 235, 235, GEOR13, zwykly, background);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 1: //flee
|
|
case 1: //flee
|
|
|
if((br.winner == 0 && weAreAttacker) || (br.winner == 1 && !weAreAttacker)) //we've won
|
|
if((br.winner == 0 && weAreAttacker) || (br.winner == 1 && !weAreAttacker)) //we've won
|
|
|
{
|
|
{
|
|
|
- CGI->audioh->playMusic(musicBase::winBattle);
|
|
|
|
|
|
|
+ CGI->musich->playMusic(musicBase::winBattle);
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[303], 235, 235, GEOR13, zwykly, background);
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[303], 235, 235, GEOR13, zwykly, background);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- CGI->audioh->playMusic(musicBase::retreatBattle);
|
|
|
|
|
|
|
+ CGI->musich->playMusic(musicBase::retreatBattle);
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[310], 235, 235, GEOR13, zwykly, background);
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[310], 235, 235, GEOR13, zwykly, background);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case 2: //surrender
|
|
case 2: //surrender
|
|
|
if((br.winner == 0 && weAreAttacker) || (br.winner == 1 && !weAreAttacker)) //we've won
|
|
if((br.winner == 0 && weAreAttacker) || (br.winner == 1 && !weAreAttacker)) //we've won
|
|
|
{
|
|
{
|
|
|
- CGI->audioh->playMusic(musicBase::winBattle);
|
|
|
|
|
|
|
+ CGI->musich->playMusic(musicBase::winBattle);
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[302], 235, 235, GEOR13, zwykly, background);
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[302], 235, 235, GEOR13, zwykly, background);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- CGI->audioh->playMusic(musicBase::surrenderBattle);
|
|
|
|
|
|
|
+ CGI->musich->playMusic(musicBase::surrenderBattle);
|
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[309], 235, 235, GEOR13, zwykly, background);
|
|
CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[309], 235, 235, GEOR13, zwykly, background);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|