mirror of
https://github.com/XProger/OpenLara.git
synced 2025-01-17 21:09:00 +01:00
#15 add cache directory for linux build
This commit is contained in:
parent
7ea7f783e9
commit
8a765fe7e0
BIN
bin/OpenLara
BIN
bin/OpenLara
Binary file not shown.
@ -1,5 +1,8 @@
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.h>
|
||||
#include <pthread.h>
|
||||
#include <pulse/pulseaudio.h>
|
||||
#include <pulse/simple.h>
|
||||
@ -129,6 +132,16 @@ char Stream::contentDir[255];
|
||||
int main() {
|
||||
Stream::contentDir[0] = Stream::cacheDir[0] = 0;
|
||||
|
||||
const char *home;
|
||||
if (!(home = getenv("HOME")))
|
||||
home = getpwuid(getuid())->pw_dir;
|
||||
strcat(Stream::cacheDir, home);
|
||||
strcat(Stream::cacheDir, "/.OpenLara/");
|
||||
|
||||
struct stat st = {0};
|
||||
if (stat(Stream::cacheDir, &st) == -1 && mkdir(Stream::cacheDir, 0777) == -1)
|
||||
Stream::cacheDir[0] = 0;
|
||||
|
||||
static int XGLAttr[] = {
|
||||
GLX_RGBA,
|
||||
GLX_DOUBLEBUFFER,
|
||||
|
Loading…
x
Reference in New Issue
Block a user