From 076a2a5218d3f386b47c639b503ccbcd1c39b759 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 1 Jun 2012 04:11:31 +0000 Subject: [PATCH] - bugfix to check main game data folder for videos --- source/glest_game/global/core_data.cpp | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/source/glest_game/global/core_data.cpp b/source/glest_game/global/core_data.cpp index b978f9f7..8521c972 100644 --- a/source/glest_game/global/core_data.cpp +++ b/source/glest_game/global/core_data.cpp @@ -423,6 +423,22 @@ void CoreData::load() { break; } } + + if(introVideoFilename == "") { + introVideoPath = data_path + "data/core/menu/videos/intro.*"; + introVideos.clear(); + findAll(introVideoPath, introVideos, false, false); + for(int i = 0; i < introVideos.size(); ++i) { + string video = data_path + "data/core/menu/videos/" + introVideos[i]; + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Checking if intro video [%s] exists\n",video.c_str()); + + if(fileExists(video)) { + introVideoFilename = video; + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FOUND intro video [%s] will use this file\n",video.c_str()); + break; + } + } + } } mainMenuVideoFilename = config.getString("MainMenuVideoURL",""); @@ -441,6 +457,22 @@ void CoreData::load() { break; } } + + if(mainMenuVideoFilename == "") { + mainVideoPath = data_path + "data/core/menu/videos/main.*"; + mainVideos.clear(); + findAll(mainVideoPath, mainVideos, false, false); + for(int i = 0; i < mainVideos.size(); ++i) { + string video = data_path + "data/core/menu/videos/" + mainVideos[i]; + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Checking if intro video [%s] exists\n",video.c_str()); + + if(fileExists(video)) { + mainMenuVideoFilename = video; + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FOUND intro video [%s] will use this file\n",video.c_str()); + break; + } + } + } } } }