コード例 #1
0
ファイル: rawaudio.c プロジェクト: knutj/cinelerra
static int fclip8 (float f) { return fclip(f,0x80); }
コード例 #2
0
ファイル: rawaudio.c プロジェクト: knutj/cinelerra
static int fclip24(float f) { return fclip(f,0x800000); }
コード例 #3
0
ファイル: gp_gpwork.c プロジェクト: devsim/pisces
int 
gp_work ()
#endif
{
	fpoint2d  P1 ;
	fpoint2d  Pa, Pb ;	/* temp points */
	int       nclip ; 
	static fpoint2d l_Plast ;
	static Bool     l_wentout = F ;
	static Bool     l_lastok  = F ;
#ifndef lint
	defrot("gp_work");
#endif
	P1.x = g_x1 ;
	P1.y = g_y1 ;

	/* if drawing or moving, transform and clip values */
	if (Clippable_Command(g_cmd)) {
		if (g_logclp) {		/* clip on logical axis */
			nclip = fclip(&Pa, &Pb, &P1, &P0, g_logbox) ;
			if (nclip < 0) {	/* all out */
				l_wentout = T ;
				l_lastok = l_lastok && (g_cmd != G_MOVE) ;
				goto see_ya ;
				}

			/* else nclip is >= 0, so we may need to catch up */
			if (l_wentout) {	/* we were out; coming in */
				int	l_cmd = g_cmd ;

				if (!l_lastok) l_cmd = G_MOVE ;
				phys_work(&Pb, &l_Plast, l_cmd) ;
				l_lastok = l_wentout = F ;
				}
			
			if (nclip > 0) {	/* going out */
				l_Plast = Pa ;
				l_lastok = g_cmd != G_MOVE ;
				l_wentout = T ;
				}

			phys_work(&Pa, &Pb, g_cmd) ;
			}

		/* don't bother with clipping on the logical axis */
		else {
			phys_work(&P1, &P0, g_cmd) ;
			}

		/* only update these if they have been used */
	    see_ya:
		P0.x = P1.x ;
		P0.y = P1.y ;
		}

	/* do the work for the other types of commands.*/
	else simp_work(&P1, &P0);

	/* NOTE: see_ya: P0 <- P1 was here, but we don't want to update
	 *	P0 if we just did an ATOG, for example.
	 */
	}