hackathon-dev #1
@ -57,25 +57,25 @@ static BOOL line_clip(PINT32 output, INT32 x1, INT32 y1, INT32 x2, INT32 y2, INT
 | 
			
		||||
	}
 | 
			
		||||
	if (outcode1 & 0x8)
 | 
			
		||||
	{
 | 
			
		||||
	  x1 += (x2 - x1) * (ymin - y1) / (y2 - y1);
 | 
			
		||||
	  x1 += (x2 - x1) * ((ymin - y1) / (y2 - y1));
 | 
			
		||||
	  y1 = ymin;
 | 
			
		||||
	  Log(LDEBUG, "clipped against top to point (%d, %d)", x1 >> 16, y1 >> 16);
 | 
			
		||||
	}
 | 
			
		||||
	else if (outcode1 & 0x4)
 | 
			
		||||
	{
 | 
			
		||||
	  x1 += (x2 - x1) * (ymax - y1) / (y2 - y1);
 | 
			
		||||
	  x1 += (x2 - x1) * ((ymax - y1) / (y2 - y1));
 | 
			
		||||
	  y1 = ymax;
 | 
			
		||||
	  Log(LDEBUG, "clipped against bottom to point (%d, %d)", x1 >> 16, y1 >> 16);
 | 
			
		||||
	}
 | 
			
		||||
	else if (outcode1 & 0x2)
 | 
			
		||||
	{
 | 
			
		||||
	  y1 += (y2 - y1) * (xmax - x1) / (x2 - x1);
 | 
			
		||||
	  y1 += (y2 - y1) * ((xmax - x1) / (x2 - x1));
 | 
			
		||||
	  x1 = xmax;
 | 
			
		||||
	  Log(LDEBUG, "clipped against right to point (%d, %d)", x1 >> 16, y1 >> 16);
 | 
			
		||||
	}
 | 
			
		||||
	else if (outcode1 & 0x1)
 | 
			
		||||
	{
 | 
			
		||||
	  y1 += (y2 - y1) * (xmin - x1) / (x2 - x1);
 | 
			
		||||
	  y1 += (y2 - y1) * ((xmin - x1) / (x2 - x1));
 | 
			
		||||
	  x1 = xmin;
 | 
			
		||||
	  Log(LDEBUG, "clipped against left to point (%d, %d)", x1 >> 16, y1 >> 16);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user