Skip to content

Commit

Permalink
Catch invalid resolution in CONFIG.ROT (#80)
Browse files Browse the repository at this point in the history
* Catch invalid resolution in CONFIG.ROT

* rt_cfg.c: logic error

* rt_cfg.c: logic error part 2
  • Loading branch information
erysdren authored Aug 6, 2024
1 parent e193170 commit 42ab8dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rott/rt_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,14 @@ boolean ParseConfigFile (void)
ReadInt("ScreenWidth", &iGLOBAL_SCREENWIDTH);
ReadInt("ScreenHeight", &iGLOBAL_SCREENHEIGHT);

if ((iGLOBAL_SCREENWIDTH != 320 || iGLOBAL_SCREENHEIGHT != 200) &&
(iGLOBAL_SCREENWIDTH != 640 || iGLOBAL_SCREENHEIGHT != 480))
{
printf("WARNING: Invalid screen resolution %dx%d. Reverting to 640x480.\n", iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT);
iGLOBAL_SCREENWIDTH = 640;
iGLOBAL_SCREENHEIGHT = 480;
}

// Read in ViewSize

ReadInt("ViewSize",&viewsize);
Expand Down

0 comments on commit 42ab8dd

Please sign in to comment.