コード例 #1
0
ファイル: rect.c プロジェクト: osgcc/descent-mac
void gr_rect(int left,int top,int right,int bot)
{
	int i;

	for ( i=top; i<=bot; i++ )
		gr_scanline( left, right, i );
}
コード例 #2
0
ファイル: rect.cpp プロジェクト: Foran/dxx-rebirth
void gr_rect(int left,int top,int right,int bot)
{
	int i;

#ifdef OGL
	if (TYPE == BM_OGL) {
		ogl_urect(left,top,right,bot);
		return;
	}
#endif
	for ( i=top; i<=bot; i++ )
		gr_scanline( left, right, i );
}
コード例 #3
0
ファイル: rect.c プロジェクト: gameplayer22/d2x-1
void gr_rect(int left,int top,int right,int bot)
{
	int i;

#ifdef OGL
	if (TYPE == BM_OGL) {
		ogl_urect(left,top,right,bot);
		return;
	}
#endif
#ifdef D1XD3D
	if (TYPE == BM_DIRECTX) {
		if (left <= right && top <= bot)
			Win32_Rect (left, top, right, bot, grd_curcanv->cv_bitmap.bm_data, COLOR);
		return;
	}
#endif
	for ( i=top; i<=bot; i++ )
		gr_scanline( left, right, i );
}
コード例 #4
0
ファイル: disc.cpp プロジェクト: dxx-rebirth/dxx-rebirth
int gr_disk(grs_canvas &canvas, const fix xc1, const fix yc1, const fix r1, const uint8_t color)
{
	int p,x, y, xc, yc, r;

	r = f2i(r1);
	xc = f2i(xc1);
	yc = f2i(yc1);
	p=3-(r*2);
	x=0;
	y=r;

	// Big clip
	if (xc + r < 0)
		return 1;
	if (xc - r > canvas.cv_bitmap.bm_w)
		return 1;
	if (yc + r < 0)
		return 1;
	if (yc - r > canvas.cv_bitmap.bm_h)
		return 1;

	while(x<y)
	{
		// Draw the first octant
		gr_scanline(canvas, xc-y, xc+y, yc-x, color);
		gr_scanline(canvas, xc-y, xc+y, yc+x, color);

		if (p<0) 
			p=p+(x<<2)+6;
		else	{
			// Draw the second octant
			gr_scanline(canvas, xc-x, xc+x, yc-y, color);
			gr_scanline(canvas, xc-x, xc+x, yc+y, color);
			p=p+((x-y)<<2)+10;
			y--;
		}
		x++;
	}
	if(x==y)	{
		gr_scanline(canvas, xc-x, xc+x, yc-y, color);
		gr_scanline(canvas, xc-x, xc+x, yc+y, color);
	}
	return 0;
}