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

📄 e_motion.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_Motion.h
 *  Author:     	Robin.xjliu  (eMail: xjliu@sunplus.com)
 *  Tel:        	00885-028-87848688-5884
 *  Date:       	2005-11-11
 *  Description:	motion type define(platform no relative)
 *  Reference:
 *  Version history:
 *-----------------------------------------------------------------------------
 *	Version   YYYY-MM-DD-INDEX   Modified By         Description
 *	1.0.0     2005-11-11           xjliu               Create
 *
 *****************************************************************************/
#ifndef _E_MOTION_H
#define _E_MOTION_H

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

/**
 * PRI level define for Action
 */
#define		SP_PRIO_0			0
#define		SP_PRIO_1			1
#define		SP_PRIO_2			2
#define		SP_PRIO_3			3
#define		SP_PRIO_4			4
#define		SP_PRIO_5			5
#define		SP_PRIO_6			6
#define		SP_PRIO_7			7
#define		SP_PRIO_8			8
#define		SP_PRIO_9			9
#define		SP_PRIO_10			10
#define		SP_PRIO_11			11
#define		SP_PRIO_12			12
#define		SP_PRIO_13			13
#define		SP_PRIO_14			14
#define		SP_PRIO_15			15

typedef void (* ACTPROC)(void *pMotion);

typedef union
{
	struct 
	{
		U16 ACT_FrameNum	: 6;
		U16 ACT_Delay		: 4;
		U16 ACT_NextActionID: 6;
	} B;
	U16 W;
}ACTION_INFO;

typedef struct 
{
	const ACTION_INFO	nActInfo;
	const ACTPROC		pActionProc;
	const FRAME			*pFrameTbl;
}ACTION;

typedef union
{
	struct 
	{
		U16 MTN_FrameID		: 6;
		U16 MTN_DelayCnt	: 4;
		U16 MTN_ActionID	: 6;
	} B;
	U16 W;
}MOTION_INFO;

typedef struct 
{
	LISTHEAD		MtnList;
	MOTION_INFO		nMtnInfo;
	SPRITE			*pSprite;
	const ACTION	*pActionTbl;
	ACTPROC			pActionProc;
}MOTION;

#define List2Motion(ptr)	list_entry(ptr,MOTION,MtnList)	//((MOTION*)(ptr))

#define MOTION_NUM_MAX	SPRITE_NUM_MAX

void E_InitMotion(void);
MOTION* E_AllocMotion(const ACTION *pActionTbl, U16 nActionID, S16 x, S16 y, U16 nPri);
void E_FreeMotion(MOTION *pMotion);
void E_MotionProc(void);
void E_ChangeAction(MOTION *pMotion, U16 nActionID);

#endif	//_E_MOTION_H


⌨️ 快捷键说明

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