Support loading BytePusher files from the command line
This commit is contained in:
committed by
Sam Lantinga
parent
2f9f939446
commit
d40b887775
@@ -136,8 +136,6 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) {
|
|||||||
int zoom = 2;
|
int zoom = 2;
|
||||||
int i;
|
int i;
|
||||||
Uint8 r, g, b;
|
Uint8 r, g, b;
|
||||||
(void)argc;
|
|
||||||
(void)argv;
|
|
||||||
|
|
||||||
if (!SDL_SetAppMetadata("SDL 3 BytePusher", "1.0", "com.example.SDL3BytePusher")) {
|
if (!SDL_SetAppMetadata("SDL 3 BytePusher", "1.0", "com.example.SDL3BytePusher")) {
|
||||||
return SDL_APP_FAILURE;
|
return SDL_APP_FAILURE;
|
||||||
@@ -222,6 +220,10 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) {
|
|||||||
vm->last_tick = SDL_GetTicksNS();
|
vm->last_tick = SDL_GetTicksNS();
|
||||||
vm->tick_acc = NS_PER_SECOND;
|
vm->tick_acc = NS_PER_SECOND;
|
||||||
|
|
||||||
|
if (argc > 1) {
|
||||||
|
load_file(vm, argv[1]);
|
||||||
|
}
|
||||||
|
|
||||||
return SDL_APP_CONTINUE;
|
return SDL_APP_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user