mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 00:11:57 +08:00
Append the --gui flag if compiled with -DFORCE_GUI.
This commit is contained in:
parent
8adeb2b5d0
commit
00744c259c
@ -23,9 +23,9 @@ int main(int argc, char **argv, char **env)
|
|||||||
|
|
||||||
char exe_path[MAX_PATH] = {0};
|
char exe_path[MAX_PATH] = {0};
|
||||||
char script_path[MAX_PATH];
|
char script_path[MAX_PATH];
|
||||||
char gui_flag[7] = {" --gui"};
|
char gui_flag[6] = {"--gui"};
|
||||||
#ifdef FORCE_GUI
|
#ifdef FORCE_GUI
|
||||||
char** command_line = (char**)malloc(sizeof(char*) * ((++ argc) + 1+6));
|
char** command_line = (char**)malloc(sizeof(char*) * ((++ argc) + 2));
|
||||||
#else
|
#else
|
||||||
char** command_line = (char**)malloc(sizeof(char*) * ((++ argc) + 1));
|
char** command_line = (char**)malloc(sizeof(char*) * ((++ argc) + 1));
|
||||||
#endif
|
#endif
|
||||||
@ -72,12 +72,11 @@ int main(int argc, char **argv, char **env)
|
|||||||
_makepath(script_path, drive, dir, "slic3r", "pl");
|
_makepath(script_path, drive, dir, "slic3r", "pl");
|
||||||
command_line[0] = exe_path;
|
command_line[0] = exe_path;
|
||||||
command_line[1] = script_path;
|
command_line[1] = script_path;
|
||||||
#ifdef FORCE_GUI
|
|
||||||
command_line[2] = gui_flag;
|
|
||||||
memcpy(command_line + 3, argv + 1, sizeof(char*) * (argc - 2));
|
|
||||||
command_line[argc+6] = NULL;
|
|
||||||
#else
|
|
||||||
memcpy(command_line + 2, argv + 1, sizeof(char*) * (argc - 2));
|
memcpy(command_line + 2, argv + 1, sizeof(char*) * (argc - 2));
|
||||||
|
#ifdef FORCE_GUI
|
||||||
|
command_line[argc] = gui_flag;
|
||||||
|
command_line[argc+1] = NULL;
|
||||||
|
#else
|
||||||
command_line[argc] = NULL;
|
command_line[argc] = NULL;
|
||||||
#endif
|
#endif
|
||||||
// Unset the PERL5LIB and PERLLIB environment variables.
|
// Unset the PERL5LIB and PERLLIB environment variables.
|
||||||
@ -89,7 +88,11 @@ int main(int argc, char **argv, char **env)
|
|||||||
printf(" %d: %s\r\n", i, command_line[i]);
|
printf(" %d: %s\r\n", i, command_line[i]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#ifdef FORCE_GUI
|
||||||
|
RunPerl(argc+1, command_line, NULL);
|
||||||
|
#else
|
||||||
RunPerl(argc, command_line, NULL);
|
RunPerl(argc, command_line, NULL);
|
||||||
|
#endif
|
||||||
free(command_line);
|
free(command_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user