From 2c2ce3a6b3414e4c5cfd50e2b055b812ed01473c Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 26 Sep 2012 06:52:39 +0000 Subject: [PATCH] - add faction path when using xml tags for battlend end videos: --- source/glest_game/main/battle_end.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/glest_game/main/battle_end.cpp b/source/glest_game/main/battle_end.cpp index 0c86fed3d..b10d6ac79 100644 --- a/source/glest_game/main/battle_end.cpp +++ b/source/glest_game/main/battle_end.cpp @@ -147,6 +147,18 @@ std::pair BattleEnd::getBattleEndVideo(bool won) { } } + string techTreePath = ""; + string factionPath = ""; + std::vector factionPartsList; + Tokenize(factionDefinitionXML,factionPartsList,"factions/"); + if(factionPartsList.size() > 1) { + techTreePath = factionPartsList[0]; + + string factionPath = techTreePath + "factions/" + currentFactionName_factionPreview; + endPathWithSlash(factionPath); + factionVideoUrl = factionPath + factionVideoUrl; + } + if(won == true) { factionVideoUrlFallback = Game::findFactionLogoFile(gameSettings, NULL,"battle_end_win_video.*"); } @@ -155,6 +167,7 @@ std::pair BattleEnd::getBattleEndVideo(bool won) { } if(SystemFlags::VERBOSE_MODE_ENABLED) printf("#3 factionVideoUrl [%s] factionVideoUrlFallback [%s]\n",factionVideoUrl.c_str(),factionVideoUrlFallback.c_str()); + printf("#3 factionVideoUrl [%s] factionVideoUrlFallback [%s]\n",factionVideoUrl.c_str(),factionVideoUrlFallback.c_str()); if(factionVideoUrl == "") { factionVideoUrl = factionVideoUrlFallback; @@ -245,6 +258,7 @@ void BattleEnd::initBackgroundMusic() { if(music != "" && fileExists(music) == true) { battleEndMusic.open(music); + battleEndMusic.setNext(&battleEndMusic); SoundRenderer &soundRenderer= SoundRenderer::getInstance(); soundRenderer.playMusic(&battleEndMusic);