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

📄 sprite.h

📁 仿游戏 Diablo 的源代码
💻 H
字号:



typedef __int64 QWORD;

// 透明色, 放入mm7
extern DWORD dwColorKey;
extern QWORD qwColorKey;
// 
extern DWORD dwAlphaMask1, dwAlphaMask2, dwAlphaMask4;
extern QWORD qwAlphaMask1, qwAlphaMask2, qwAlphaMask4;

#define SPRITE_CLIP									\
	int w = src->width;								\
	int h = src->height;							\
	int sx, sy;										\
	if( x >= dest->cr || y >= dest->cb )			\
		return;										\
													\
	if( x < dest->cl ){								\
		sx = dest->cl - x; x = dest->cl; w -= sx;	\
		if( w <= 0 ) return;						\
	}												\
	else sx = 0;									\
	if( y < dest->ct ){								\
		sy = dest->ct - y; y = dest->ct; h -= sy;	\
		if( h <= 0 ) return;						\
	}												\
	else sy = 0;									\
	if( x + w > dest->cr )							\
		w = dest->cr - x;							\
	if( y + h > dest->cb )							\
		h = dest->cb - y;


⌨️ 快捷键说明

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