code: drawterm

Download patch

ref: 0757b2cd45e39cf86c9fa468864d993e6ac8211f
parent: 734ac7f2633100b3cd83b6a2482fb0f63582b4a3
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Nov 17 15:10:21 EST 2016

libmemdraw: cleanup fillpoly(), remove unused fillcolor hack

--- a/libmemdraw/fillpoly.c
+++ b/libmemdraw/fillpoly.c
@@ -27,18 +27,6 @@
 static	void	yscan(Memimage *dst, Seg **seg, Seg *segtab, int nseg, int wind, Memimage *src, Point sp, int, int);
 
 static void
-fillcolor(Memimage *dst, int left, int right, int y, Memimage *src, Point p)
-{
-	int srcval;
-
-	USED(src);
-	srcval = p.x;
-	p.x = left;
-	p.y = y;
-	memset(byteaddr(dst, p), srcval, right-left);
-}
-
-static void
 fillline(Memimage *dst, int left, int right, int y, Memimage *src, Point p, int op)
 {
 	Rectangle r;
@@ -165,26 +153,9 @@
 	Seg **ep, **next, **p, **q, *s;
 	long n, i, iy, cnt, ix, ix2, minx, maxx;
 	Point pt;
-	void	(*fill)(Memimage*, int, int, int, Memimage*, Point, int);
 
-	fill = fillline;
-/*
- * This can only work on 8-bit destinations, since fillcolor is
- * just using memset on sp.x.
- *
- * I'd rather not even enable it then, since then if the general
- * code is too slow, someone will come up with a better improvement
- * than this sleazy hack.	-rsc
- *
-	if(clipped && (src->flags&Frepl) && src->depth==8 && Dx(src->r)==1 && Dy(src->r)==1) {
-		fill = fillcolor;
-		sp.x = membyteval(src);
-	}
- *
- */
 	USED(clipped);
 
-
 	for(i=0, s=segtab, p=seg; i<nseg; i++, s++) {
 		*p = s;
 		if(s->p0.y == s->p1.y)
@@ -300,7 +271,7 @@
 				ix = (x + x2) >> (fixshift+1);
 				ix2 = ix+1;
 			}
-			(*fill)(dst, ix, ix2, iy, src, sp, op);
+			fillline(dst, ix, ix2, iy, src, sp, op);
 		}
 		y += (1<<fixshift);
 		iy++;