aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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;