aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-06-04 01:11:53 +0200
committerdec05eba <dec05eba@protonmail.com>2018-06-04 01:11:57 +0200
commit26edc563cb0ba1a9fb35507e7f32d2d43a845e68 (patch)
tree1ada04d030f3970edfa904f1faf6058dd4b2371b /src
parente540c0e0e74ca276c383053064785763c63a047a (diff)
Add install script (desktop application
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp16
1 files changed, 9 insertions, 7 deletions
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 <string>
#include <SFML/Graphics.hpp>
#include <cstring>
-#include <boost/filesystem/path.hpp>
+#include <boost/filesystem.hpp>
#include <odhtdb/Database.hpp>
#include <odhtdb/Signature.hpp>
#include <odhtdb/bin2hex.hpp>
@@ -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;