mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 06:32:37 +00:00
Prevent integer div-by-0 (SIGFPE) when drawing console background with void tiles.
The tiles used are BIGHOLE (1141) and VIEWBORDER (3250). Ideally we'd draw the console background using something specially-coded instead of rotatesprite if it's fully black anyway. git-svn-id: https://svn.eduke32.com/eduke32@2846 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
f39c4306ec
commit
d20bb4e3a1
1 changed files with 8 additions and 1 deletions
|
@ -164,8 +164,12 @@ void GAME_clearbackground(int32_t c, int32_t r)
|
||||||
daydim = r<<3;
|
daydim = r<<3;
|
||||||
|
|
||||||
xsiz = tilesizx[BGTILE];
|
xsiz = tilesizx[BGTILE];
|
||||||
tx2 = xdim/xsiz;
|
|
||||||
ysiz = tilesizy[BGTILE];
|
ysiz = tilesizy[BGTILE];
|
||||||
|
|
||||||
|
if (xsiz <= 0 || ysiz <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
tx2 = xdim/xsiz;
|
||||||
// ty2 = ydim/ysiz;
|
// ty2 = ydim/ysiz;
|
||||||
ty2 = daydim/ysiz;
|
ty2 = daydim/ysiz;
|
||||||
|
|
||||||
|
@ -176,6 +180,9 @@ void GAME_clearbackground(int32_t c, int32_t r)
|
||||||
rotatesprite(x*xsiz<<16,y*ysiz<<16,65536L,0,BGTILE,SHADE,PALETTE,bits,0,0,xdim,daydim);
|
rotatesprite(x*xsiz<<16,y*ysiz<<16,65536L,0,BGTILE,SHADE,PALETTE,bits,0,0,xdim,daydim);
|
||||||
|
|
||||||
xsiz = tilesizy[BORDTILE];
|
xsiz = tilesizy[BORDTILE];
|
||||||
|
if (xsiz <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
tx2 = xdim/xsiz;
|
tx2 = xdim/xsiz;
|
||||||
ysiz = tilesizx[BORDTILE];
|
ysiz = tilesizx[BORDTILE];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue