From 26edc563cb0ba1a9fb35507e7f32d2d43a845e68 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 4 Jun 2018 01:11:53 +0200 Subject: Add install script (desktop application --- src/main.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index ef4c20f..0836278 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -200,12 +200,14 @@ static void channelAddStoredMessage(Channel *channel, const odhtdb::Hash &reques int main(int argc, char **argv) { - /* - boost::filesystem::path programPath(argv[0]); - auto parentPath = programPath.parent_path(); - printf("parent path: %s\n", parentPath.string().c_str()); - boost::filesystem::current_path(parentPath); // Ensures loading of resources works no matter which path we run this executable from - */ + if(argc > 1) + { + boost::filesystem::path resourcesPath(argv[1]); + boost::filesystem::current_path(resourcesPath); + printf("Resource path set to: %s\n", resourcesPath.string().c_str()); + } + else + printf("Resource directory not defined, using currently directory"); const sf::Int64 FRAMERATE_FOCUSED = 144; const sf::Int64 FRAMERATE_NOT_FOCUSED = 10; -- cgit v1.2.3