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

📄 e_collision.h

📁 凌阳32位单片机开发的小游戏
💻 H
字号:
/******************************************************************************
 *
 *     The information contained herein is the exclusive property of
 *   Sunplus Technology Co. And shall not be distributed, reproduced,
 *   or disclosed in whole in part without prior written permission.
 *
 *         (C) COPYRIGHT 2005   SUNPLUS TECHNOLOGY CO.
 *                        ALL RIGHTS RESERVED
 *
 * The entire notice above must be reproduced on all authorized copies.
 *
 *****************************************************************************/

/******************************************************************************
 *  Filename:   	E_Collision.h
 *  Author:     	Robin.xjliu  (eMail: xjliu@sunplus.com)
 *  Tel:        	00885-028-87848688-5884
 *  Date:       	2005-11-28
 *  Description:	basic collision function define
 *  Reference:
 *  Version history:
 *-----------------------------------------------------------------------------
 *	Version   YYYY-MM-DD-INDEX   Modified By         Description
 *	1.0.0     2005-11-28           xjliu               Create
 *
 *****************************************************************************/
#ifndef _E_COLLISION_H
#define _E_COLLISION_H

#include "../SysLib_Basic/Include/Sys_Global.h"
#include "../SysLib_Basic/Include/PPU_Sprite.h"
#include "E_Motion.h"

#define CHECK_OVERLAP(Px1,Py1,Px2,Py2,Qx1,Qy1,Qx2,Qy2)			\
    (((Px1)<(Qx1) && (Py1)<(Qy1) && (Px2)>(Qx1) && (Py2)>(Qy1))		\
     || ((Px1)<(Qx1) && (Py1)>(Qy1) && (Px2)>(Qx1) && (Py1)<(Qy2))	\
     || ((Px1)>(Qx1) && (Py1)<(Qy1) && (Px1)<(Qx2) && (Py2)>(Qy1))	\
     || ((Px1)>(Qx1) && (Py1)>(Qy1) && (Px1)<(Qx2) && (Py1)<(Qy2)))

//bool E_DetectCollision(const SPRITE * spa, const SPRITE * spb);
bool E_DetectBlock2Sp(SPRITE * spa, SPRITE * spb, S16 iLeft, S16 iTop, S16 iRight, S16 iBottom);
//bool E_DetectBlock2Sp(SPRITE * spa, SPRITE * spb, FRAME_BLOCK * pblock);
//bool E_DetectCollision(MOTION *pMotion1, MOTION *pMotion2);
//bool E_PreDetect(MOTION *pMotion1, MOTION *pMotion2, U8 nRange);

#endif	//_E_COLLISION_H

⌨️ 快捷键说明

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