undo the ugly clear color hack thing

This commit is contained in:
IoIxD 2025-12-05 18:53:15 -07:00
commit c1c969859c

View file

@ -718,31 +718,6 @@ static void MwLLPolygonImpl(MwLL handle, MwPoint* points, int points_count, MwLL
glColor3f(color->common.red / 255.0, color->common.green / 255.0, color->common.blue / 255.0);
/* If we have a polygon that's covering the whole screen, we want to do glClear
*/
if(x == 0 && y == 0) {
/*
We determine this by checking if all of the points are at the edge of the screen (and if there's more then 6 points).
Not a pretty solution, but unless the user does something weird like draw a triangle over itself twice, I'm pretty sure this is effective.
*/
if(points_count >= 6) {
MwBool doClear = MwTRUE;
for(n = 0; n < points_count; n++) {
if((points[n].x >= (handle->wayland.ww) - 1 || points[n].x <= 1) && (points[n].y >= (handle->wayland.wh) - 1 || points[n].y <= 1)) {
} else {
doClear = MwFALSE;
break;
}
}
if(doClear) {
glEnd();
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(color->common.red / 255.0, color->common.green / 255.0, color->common.blue / 255.0, 1);
glBegin(GL_TRIANGLE_FAN);
}
}
}
glVertex2f(x, y);
if(points_count > 3) {
glVertex2f(maxX, maxY);