Compare commits

...
1 Commits
Author SHA1 Message Date
dkeruza cafd6276c3 Workaround 6 2025-02-27 16:26:25 -05:00
+15 -4
View File
@@ -233,7 +233,7 @@ void testModePath(char *name)
* Makes sure the environment variables are set correctly * Makes sure the environment variables are set correctly
* to run the game. * to run the game.
*/ */
void setEnvironmentVariables(int isFlatpak) void setEnvironmentVariables(int isFlatpak, int zink)
{ {
// Ensure the library path is set correctly // Ensure the library path is set correctly
char libraryPath[128] = {0}; char libraryPath[128] = {0};
@@ -254,6 +254,9 @@ void setEnvironmentVariables(int isFlatpak)
setenv(LD_PRELOAD, PRELOAD_FILE_NAME, 1); setenv(LD_PRELOAD, PRELOAD_FILE_NAME, 1);
else else
setenv(LD_PRELOAD, PRELOAD_FILE_FLATPAK, 1); setenv(LD_PRELOAD, PRELOAD_FILE_FLATPAK, 1);
if(zink)
setenv("MESA_LOADER_DRIVER_OVERRIDE", "zink", 1);
} }
/** /**
@@ -400,13 +403,11 @@ int main(int argc, char *argv[])
} }
} }
// Ensure environment variables are set correctly
setEnvironmentVariables(isFlatpak);
// Build up the command to start the game // Build up the command to start the game
int testMode = 0; int testMode = 0;
int gdb = 0; int gdb = 0;
int zink = 0;
int forceGame = 0; int forceGame = 0;
int segaboot = 0; int segaboot = 0;
char extConfigPath[PATH_MAX] = {0}; char extConfigPath[PATH_MAX] = {0};
@@ -431,6 +432,13 @@ int main(int argc, char *argv[])
gdb = 1; gdb = 1;
continue; continue;
} }
if (strcmp(argv[i], "--zink") == 0)
{
zink = 1;
continue;
}
if (strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "--config") == 0) if (strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "--config") == 0)
{ {
if (i+1 >= argc) if (i+1 >= argc)
@@ -446,6 +454,9 @@ int main(int argc, char *argv[])
forceGame = 1; forceGame = 1;
} }
// Ensure environment variables are set correctly
setEnvironmentVariables(isFlatpak, zink);
char command[128] = {0}; char command[128] = {0};
strcpy(command, "./"); strcpy(command, "./");
if (forceGame) if (forceGame)