仿游戏 Diablo 的源代码

源代码在线查看: bitmap.hpp

软件大小: 108 K
上传用户: rickie936
关键词: Diablo 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				#define BLITCLIP()				\
												\
				{	if( sx >= width || sy >= height || ( sx + w ) 						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 ) 						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 );			\
					}																	\
				}
				
				
							

相关资源