Skip to content

Commit b52ace3

Browse files
committed
Merge branch 'main' of github.com:pfedick/DeckerGame
2 parents 081dcea + 0c8b38f commit b52ace3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <ppltk.h>
77
#include "audio.h"
88
#include <math.h>
9+
#include <unistd.h>
910
#include "objects.h"
1011

1112
#define DEBUGTIME
@@ -126,6 +127,7 @@ void start(int argc, char** argv)
126127
throw std::exception();
127128
}
128129

130+
129131
if (ppl7::HaveArgv(argc, argv, "-h") || ppl7::HaveArgv(argc, argv, "--help")) {
130132
help();
131133
return;
@@ -172,6 +174,11 @@ int WinMain()
172174

173175
int main(int argc, char** argv)
174176
{
177+
ppl7::String path=ppl7::File::getPath(ppl7::String(argv[0]));
178+
ppl7::String testfile=path+"/res/george_adventure.tex";
179+
if (ppl7::File::isFile(testfile)) {
180+
chdir((const char*)path);
181+
}
175182

176183
start(argc, argv);
177184
return 0;

0 commit comments

Comments
 (0)