Skip to content

Commit

Permalink
avoid the window exceeding screen height and crashing in 640x400x8
Browse files Browse the repository at this point in the history
Fixes #26. Thanks BSzili.
  • Loading branch information
jonof committed Jan 9, 2021
1 parent 6967640 commit 0b672ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/border.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ VOID BorderSetView(PLAYERp UNUSED(pp), int *Xdim, int *Ydim, int *ScreenSize)
x2 = MSW(DIV2(xd + sc));
y = MSW(DIV2(yd - scale(sc, yd, xd)));
y2 = MSW_ROUND(DIV2(yd + scale(sc, yd, xd)) + 32768);
if (y2 > ydim)
y2 = ydim;

// global windowx1, windowx2, windowy1, windowy2 coords set here
setview(x, y, x2-1, y2-1);
Expand Down

0 comments on commit 0b672ee

Please sign in to comment.