sprite.h

来自「仿游戏 Diablo 的源代码」· C头文件 代码 · 共 36 行

H
36
字号



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 + =
减小字号Ctrl + -
显示快捷键?