quadrilateralcowboy/sys/osx/d3go/d3go.c
2020-06-12 14:06:25 -07:00

21 lines
422 B
C

#include <stdlib.h>
#include <stdint.h>
#include <mach-o/dyld.h>
int main(int argn, const char** argv)
{
char full[16384];
char path[16384];
uint32_t size = sizeof(path);
int i;
_NSGetExecutablePath(path, &size);
for (i=strlen(path)-1; i>=0; i--)
if (path[i] == '/') {
path[i] = 0;
break;
}
if (!i) strcpy(path, ".");
sprintf(full, "\"%s/doom3\" +set r_fullscreen 0", path);
system(full);
return 0;
}