1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

- music player uses URI's instead of enum from music base

- #1045 and #1046 should be fixed
- moved pregame backgrounds to config/mainmenu
- animation can be overriden with .json multiple times
This commit is contained in:
Ivan Savenko
2012-08-06 07:34:37 +00:00
parent 385be09248
commit 708ad6ac7f
24 changed files with 212 additions and 256 deletions

View File

@ -371,8 +371,14 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe
CCS->musich->stopMusic();
int channel = CCS->soundh->playSoundFromSet(CCS->soundh->battleIntroSounds);
CCS->soundh->setCallback(channel, boost::bind(&CMusicHandler::playMusicFromSet, CCS->musich, CCS->musich->battleMusics, -1));
memset(stackCountOutsideHexes, 1, GameConstants::BFIELD_SIZE * sizeof(bool)); //initialize array with trues
auto onIntroPlayed = []()
{
if (LOCPLINT->battleInt)
CCS->musich->playMusicFromSet("battle", true);
};
CCS->soundh->setCallback(channel, onIntroPlayed);
memset(stackCountOutsideHexes, 1, GameConstants::BFIELD_SIZE * sizeof(bool)); //initialize array with trues
currentAction = INVALID;
selectedAction = INVALID;
@ -446,7 +452,7 @@ CBattleInterface::~CBattleInterface()
if(adventureInt && adventureInt->selection)
{
int terrain = LOCPLINT->cb->getTile(adventureInt->selection->visitablePos())->tertype;
CCS->musich->playMusic(CCS->musich->terrainMusics[terrain], -1);
CCS->musich->playMusicFromSet("terrain", terrain, true);
}
}