check SDL_GetCurrentDisplayMode return code, keep zoom at 1 if it failed

This commit is contained in:
Sigrid Solveig Haflínudóttir 2021-10-24 21:31:25 +02:00
parent 5582816943
commit 297046ec14
No known key found for this signature in database
GPG Key ID: FC8DDA5A6A7456C4
1 changed files with 2 additions and 2 deletions

View File

@ -588,8 +588,8 @@ main(int argc, char **argv)
/* unused */ uxn_port(&u, 0xf, nil_talk); /* unused */ uxn_port(&u, 0xf, nil_talk);
/* set default zoom */ /* set default zoom */
SDL_GetCurrentDisplayMode(0, &DM); if(SDL_GetCurrentDisplayMode(0, &DM) == 0)
set_zoom(DM.w / 1280); set_zoom(DM.w / 1280);
for(i = 1; i < argc; ++i) { for(i = 1; i < argc; ++i) {
/* get default zoom from flags */ /* get default zoom from flags */
if(strcmp(argv[i], "-s") == 0) { if(strcmp(argv[i], "-s") == 0) {