diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-19 13:32:31 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-23 11:41:03 -0500 |
| commit | 04f5688a37030aa8598ded416f05d0cc979c37d6 (patch) | |
| tree | ce0bec713c49d6dda66a28f1246e1443d271b8f2 /src/arg-handler.cpp | |
| parent | c7c678651a30db30e449e965e6c82ad0dcb871e6 (diff) | |
loading scenes and projects can now be done via args
Diffstat (limited to 'src/arg-handler.cpp')
| -rw-r--r-- | src/arg-handler.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/arg-handler.cpp b/src/arg-handler.cpp index 1b40039..2183347 100644 --- a/src/arg-handler.cpp +++ b/src/arg-handler.cpp @@ -1,6 +1,7 @@ #include "arg-handler.hpp" #include "game-settings.hpp" +#include "level.hpp" #include <cstdio> #include <getopt.h> @@ -10,11 +11,13 @@ void PkeArgs_Parse(int argc, char *argv[]) { static struct option long_options[] = { {"plugin", required_argument, 0, 'p'}, + {"project", required_argument, 0, 'r'}, + {"scene", required_argument, 0, 's'}, {0, 0, 0, 0}, }; int optionIndex = 0; - int c = getopt_long(argc, argv, "p:", long_options, &optionIndex); + int c = getopt_long(argc, argv, "", long_options, &optionIndex); if (c == -1) { break; } @@ -23,7 +26,16 @@ void PkeArgs_Parse(int argc, char *argv[]) { case 0: break; case 'p': - pkeSettings.pluginPath = optarg; + pkeSettings.args.pluginPath = optarg; + break; + case 'r': + pkeSettings.args.projectPath = optarg; + break; + case 's': + pkeSettings.args.sceneName = optarg; + pkeSettings.rt.shouldLoadScene = true; + pkeSettings.rt.sceneName = pkeSettings.args.sceneName; + pkeSettings.rt.nextLevel = PkeLevel_Create("transient"); break; default: fprintf(stderr, "Unused parameter: %c\n", c); |
