brought back functionality from previous builds but now cross-platform

This commit is contained in:
2025-07-07 15:34:34 +03:00
parent 99eafb9443
commit 83bc9b7f16
61 changed files with 1210 additions and 581 deletions

View File

@@ -6,6 +6,9 @@
#ifdef __APPLE__
#include <mach-o/dyld.h>
#endif
#ifdef __WIN32__
#include "windows.h"
#endif
#if defined(__APPLE__) && defined(__MACH__)
#include "TargetConditionals.h"
@@ -19,7 +22,9 @@
// Other platforms
#endif
#ifndef MAX_PATH
#define MAX_PATH 4096
#endif
static char szLauncherPath[MAX_PATH];
static char szEnginePath[MAX_PATH];
@@ -72,6 +77,11 @@ int main( int argc, char **argv ) {
pEngineMain(argc, argv);
dlclose(pEngineLib);
#else
#ifdef __WIN32__
GetModuleFileNameA(NULL, szLauncherPath, MAX_PATH);
dirname(szLauncherPath);
SetCurrentDirectoryA(szLauncherPath);
#endif
FunnyMain(argc, argv);
#endif
};