From: Hector Martin Date: Sat, 18 Dec 2010 20:22:20 +0000 (+0100) Subject: Totally ignore trivially offscreen objects X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=c50fd120494c5dd1fe0924c6df6a0f452892f8ed;p=openlase.git Totally ignore trivially offscreen objects --- diff --git a/libol/libol.c b/libol/libol.c index 7144f91..dec5a2d 100644 --- a/libol/libol.c +++ b/libol/libol.c @@ -571,7 +571,24 @@ void olEnd(void) } } - wframe.objcnt++; + int nl=0,nr=0,nu=0,nd=0; + for (i=0; ipointcnt; i++) { + if (!dstate.curobj->points[i].color) + continue; + if (dstate.curobj->points[i].x > -1) + nl = 1; + if (dstate.curobj->points[i].x < 1) + nr = 1; + if (dstate.curobj->points[i].y > -1) + nd = 1; + if (dstate.curobj->points[i].y < 1) + nu = 1; + + if (nl && nr && nu && nd) + break; + } + if (nl && nr && nu && nd) + wframe.objcnt++; dstate.curobj = NULL; }