|
From: Lasse Kärkkäi. <tr...@us...> - 2009-07-06 01:29:33
|
Module: performous
Branch: master
Commit: fb6b2710fc53bc8dc02a42b4685f487fcff812ac
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jul 6 03:17:35 2009 +0300
Init libda and read config only after commandline argument handling.
---
game/main.cc | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 04b0b4c..fcf3ea2 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -173,13 +173,7 @@ int main(int argc, char** argv) {
std::signal(SIGINT, quit);
std::signal(SIGTERM, quit);
std::ios::sync_with_stdio(false); // We do not use C stdio
- da::initialize libda;
- try {
- readConfig();
- } catch (std::exception& e) {
- std::cerr << e.what() << std::endl;
- return EXIT_FAILURE;
- }
+ // Parse commandline options
std::vector<std::string> mics;
std::vector<std::string> pdevs;
std::vector<std::string> songdirs;
@@ -264,6 +258,15 @@ int main(int argc, char** argv) {
std::cout << PACKAGE << ' ' << VERSION << std::endl;
return 0;
}
+ // Initialize audio
+ da::initialize libda;
+ // Read config files
+ try {
+ readConfig();
+ } catch (std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ return EXIT_FAILURE;
+ }
// Override XML config for options that were specified from commandline or performous.conf
if (vm.count("width")) config["graphic/window_width"].i() = vm["width"].as<int>();
if (vm.count("height")) config["graphic/window_height"].i() = vm["height"].as<int>();
|