⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bitmap.hpp

📁 diablo 游戏部分源码
💻 HPP
字号:
#define BLITCLIP()				\
								\
{	if( sx >= width || sy >= height || ( sx + w ) <= 0 || ( sy + h ) <= 0 )	\
		return;						\
									\
	int dcl, dct, dcb, dcr;			\
									\
	if( sx < 0 ){					\
		x -= sx;					\
		w += sx;					\
		sx = 0;						\
	}								\
	if( sy < 0 ){					\
		y -= sy;					\
		h += sy;					\
		sy = 0;						\
	}								\
	if( sx+w > width ){				\
		w = width - sx;				\
	}								\
	if( sy+h > height ){			\
		h = height - sy;			\
	}								\
									\
	if( dest->clip ){				\
		dcl = dest->cl;				\
		dct = dest->ct;				\
		dcr = dest->cr;				\
		dcb = dest->cb;				\
	}								\
	else{							\
		dcl = dct = 0;				\
		dcb = dest->height;			\
		dcr = dest->width;			\
	}								\
	if( x >= dcr || y >= dcb 		\
		|| ( x + w ) <= dcl || ( y + h ) <= dct )	\
		return;										\
													\
	if( x < dcl ){					\
		sx += dcl - x;				\
		w -= dcl - x;				\
		x = dcl;					\
	}								\
	if( y < dct ){					\
		sy += dct - y;				\
		h -= dct - y;				\
		y = dct;					\
	}								\
	if( x + w > dcr )				\
		w = dcr - x;				\
	if( y + h > dcb )				\
		h = dcb - y; }
										


#define BLITMASK( n )				\
									\
void Bitmap##n::BlitMask( Bitmap* dest, int x, int y, int sx, int sy, int w, int h ) \
{																		\
	BLITCLIP() 															\
																		\
	if( dest == this )													\
		return; /*failed */  											\
	else{																\
		BlitMasked##n( (Bitmap##n*)dest, x, y, sx, sy, w, h );			\
	}																	\
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -