Use rom name for window title

This commit is contained in:
neauoire 2021-10-28 09:27:39 -07:00
parent 33e77e261c
commit a635fea52f
1 changed files with 3 additions and 3 deletions

View File

@ -243,7 +243,7 @@ quit(void)
} }
static int static int
init(void) init(char *filepath)
{ {
SDL_AudioSpec as; SDL_AudioSpec as;
SDL_zero(as); SDL_zero(as);
@ -262,7 +262,7 @@ init(void)
if(!audio_id) if(!audio_id)
error("sdl_audio", SDL_GetError()); error("sdl_audio", SDL_GetError());
} }
gWindow = SDL_CreateWindow("Uxn", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (WIDTH + PAD * 2) * zoom, (HEIGHT + PAD * 2) * zoom, SDL_WINDOW_SHOWN); gWindow = SDL_CreateWindow(filepath, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (WIDTH + PAD * 2) * zoom, (HEIGHT + PAD * 2) * zoom, SDL_WINDOW_SHOWN);
if(gWindow == NULL) if(gWindow == NULL)
return error("sdl_window", SDL_GetError()); return error("sdl_window", SDL_GetError());
gRenderer = SDL_CreateRenderer(gWindow, -1, 0); gRenderer = SDL_CreateRenderer(gWindow, -1, 0);
@ -603,7 +603,7 @@ main(int argc, char **argv)
} else if(!loaded++) { } else if(!loaded++) {
if(!load(&u, argv[i])) if(!load(&u, argv[i]))
return error("Load", "Failed to open rom."); return error("Load", "Failed to open rom.");
if(!init()) if(!init(argv[i]))
return error("Init", "Failed to initialize emulator."); return error("Init", "Failed to initialize emulator.");
if(!set_size(WIDTH, HEIGHT, 0)) if(!set_size(WIDTH, HEIGHT, 0))
return error("Window", "Failed to set window size."); return error("Window", "Failed to set window size.");