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:
helixhorned 2012-07-22 11:10:08 +00:00
parent f39c4306ec
commit d20bb4e3a1

View file

@ -164,8 +164,12 @@ void GAME_clearbackground(int32_t c, int32_t r)
daydim = r<<3;
xsiz = tilesizx[BGTILE];
tx2 = xdim/xsiz;
ysiz = tilesizy[BGTILE];
if (xsiz <= 0 || ysiz <= 0)
return;
tx2 = xdim/xsiz;
// ty2 = ydim/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);
xsiz = tilesizy[BORDTILE];
if (xsiz <= 0)
return;
tx2 = xdim/xsiz;
ysiz = tilesizx[BORDTILE];