示例#1
0
文件: id_vw.c 项目: Billy2600/refkeen
void VW_ClipDrawMPic(id0_unsigned_t x, id0_int_t y, id0_unsigned_t chunknum)
{
	id0_int_t	picnum = chunknum - STARTPICM;
	memptr source;
	id0_unsigned_t dest,width,ofs,plane;
	id0_int_t		height;

	source = grsegs[chunknum];
	width = picmtable[picnum].width;
	height = picmtable[picnum].height;
	plane = width*height;

	ofs = 0;
	if (y<0)
	{
		ofs= -y*width;
		height+=y;
		y=0;
	}
	else if (y+height>216)
	{
		height-=(y-216);
	}
	dest = ylookup[y]+x+bufferofs;
	if (height<1)
		return;

	VW_MaskBlock(source,ofs,dest,width,height,plane);
}
示例#2
0
文件: id_vw.c 项目: Billy2600/refkeen
void VW_DrawSprite(id0_int_t x, id0_int_t y, id0_unsigned_t chunknum)
{
	spritetabletype id0_far *spr;
	spritetype id0_seg	*block;
	id0_unsigned_t	dest,shift;

	spr = &spritetable[chunknum-STARTSPRITES];
	block = (spritetype id0_seg *)grsegs[chunknum];

	y+=spr->orgy>>G_P_SHIFT;
	x+=spr->orgx>>G_P_SHIFT;

#if GRMODE == EGAGR
	shift = (x&7)/2;
#endif
#if GRMODE == CGAGR
	shift = 0;
#endif

	dest = bufferofs + ylookup[y];
	if (x>=0)
		dest += x/SCREENXDIV;
	else
		dest += (x+1)/SCREENXDIV;

	VW_MaskBlock (block,block->sourceoffset[shift],dest,
		block->width[shift],spr->height,block->planesize[shift]);
}
示例#3
0
文件: id_vw.c 项目: BSzili/refkeen
void VW_DrawSprite(id0_int_t x, id0_int_t y, id0_unsigned_t chunknum)
{
	spritetabletype id0_far *spr;
	void/*spritetype*/ id0_seg	*block;
	id0_unsigned_t	dest,shift;

	spr = &spritetable[chunknum-STARTSPRITES];
	block = /*(spritetype id0_seg *)*/grsegs[chunknum];

	y+=spr->orgy>>G_P_SHIFT;
	x+=spr->orgx>>G_P_SHIFT;

	if (GRMODE == EGAGR)
		shift = (x&7)/2;
	else if (GRMODE == CGAGR)
		shift = 0;

	dest = bufferofs + ylookup[y];
	if (x>=0)
		dest += x/SCREENXDIV;
	else
		dest += (x+1)/SCREENXDIV;

	VW_MaskBlock (block,VW_GetSpriteShiftSourceOffset(block,shift),dest,
		VW_GetSpriteShiftWidth(block,shift),spr->height,VW_GetSpriteShiftPlaneSize(block,shift));
	//VW_MaskBlock (block,block->sourceoffset[shift],dest,
	//	block->width[shift],spr->height,block->planesize[shift]);
}
示例#4
0
文件: id_vw.c 项目: BSzili/refkeen
void VWB_DrawSprite(id0_int_t x, id0_int_t y, id0_int_t chunknum)
{
	spritetabletype id0_far *spr;
	void/*spritetype*/ id0_seg	*block;
	id0_unsigned_t	dest,shift,width,height;

	x+=pansx;
	y+=pansy;

	spr = &spritetable[chunknum-STARTSPRITES];
	block = /*(spritetype id0_seg *)*/grsegs[chunknum];

	y+=spr->orgy>>G_P_SHIFT;
	x+=spr->orgx>>G_P_SHIFT;


	if (GRMODE == EGAGR)
		shift = (x&7)/2;
	else if (GRMODE == CGAGR)
		shift = 0;

	dest = bufferofs + ylookup[y];
	if (x>=0)
		dest += x/SCREENXDIV;
	else
		dest += (x+1)/SCREENXDIV;

	width = VW_GetSpriteShiftWidth(block,shift)/*block->width[shift]*/;
	height = spr->height;

	if (VW_MarkUpdateBlock (x&SCREENXMASK,y,(x&SCREENXMASK)+width*SCREENXDIV-1
		,y+height-1))
		VW_MaskBlock (block,VW_GetSpriteShiftSourceOffset(block,shift)/*block->sourceoffset[shift]*/,dest,
			width,height,VW_GetSpriteShiftPlaneSize(block,shift)/*block->planesize[shift]*/);
}
示例#5
0
文件: id_vw.c 项目: Billy2600/refkeen
void VW_DrawMPic(id0_unsigned_t x, id0_unsigned_t y, id0_unsigned_t chunknum)
{
	id0_int_t	picnum = chunknum - STARTPICM;
	memptr source;
	id0_unsigned_t dest,width,height;

	source = grsegs[chunknum];
	dest = ylookup[y]+x+bufferofs;
	width = picmtable[picnum].width;
	height = picmtable[picnum].height;

	VW_MaskBlock(source,0,dest,width,height,width*height);
}
示例#6
0
文件: id_vw.c 项目: Billy2600/refkeen
void VWB_DrawMPic(id0_int_t x, id0_int_t y, id0_int_t chunknum)
{
// mostly copied from drawmpic
	id0_int_t	picnum = chunknum - STARTPICM;
	memptr source;
	id0_unsigned_t dest,width,height;

	x+=pansx;
	y+=pansy;
	x/=SCREENXDIV;

	source = grsegs[chunknum];
	dest = ylookup[y]+x+bufferofs;
	width = picmtable[picnum].width;
	height = picmtable[picnum].height;

	if (VW_MarkUpdateBlock (x*SCREENXDIV,y,(x+width)*SCREENXDIV-1,y+height-1))
		VW_MaskBlock(source,0,dest,width,height,width*height);
}
示例#7
0
文件: id_vw.c 项目: Billy2600/refkeen
void VWB_DrawSprite(id0_int_t x, id0_int_t y, id0_int_t chunknum)
{
	spritetabletype id0_far *spr;
	spritetype id0_seg	*block;
	id0_unsigned_t	dest,shift,width,height;

	x+=pansx;
	y+=pansy;

	spr = &spritetable[chunknum-STARTSPRITES];
	block = (spritetype id0_seg *)grsegs[chunknum];

	y+=spr->orgy>>G_P_SHIFT;
	x+=spr->orgx>>G_P_SHIFT;


#if GRMODE == EGAGR
	shift = (x&7)/2;
#endif
#if GRMODE == CGAGR
	shift = 0;
#endif

	dest = bufferofs + ylookup[y];
	if (x>=0)
		dest += x/SCREENXDIV;
	else
		dest += (x+1)/SCREENXDIV;

	width = block->width[shift];
	height = spr->height;

	if (VW_MarkUpdateBlock (x&SCREENXMASK,y,(x&SCREENXMASK)+width*SCREENXDIV-1
		,y+height-1))
		VW_MaskBlock (block,block->sourceoffset[shift],dest,
			width,height,block->planesize[shift]);
}