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

📄 animation.h

📁 一个3D的保龄球的源代码
💻 H
字号:
#ifndef CANIMATION_H
#define CANIMATION_H

#include "..\system\gfx.h"
#include "..\system\bufreader.h"

typedef struct _AniModule
{
  /** The modules's left-top corner's coordinate relatives to image' left-top corner. */
  int x, y;
  /** The module's width and height. */
  unsigned char w, h;
}AniModule;

class CEngine;

class CAnimation
{
	unsigned int nModules;
	unsigned int nFrames;
	unsigned int nActions;
	AniModule *pModule;
	short**  pFrameData;
	char** pActionData;
	CEngine * m_pEngine;
	char * m_frameSize;
	char * m_actionSize;

public:
	short ImageID;
	GFXBMP *m_pImage;

	CAnimation(CEngine *pEngine);
	CAnimation()	{};
	void SetEngine(CEngine *pEngine)	{m_pEngine = pEngine;};
	bool loadAnimation(CBufReader &);
	void drawFrame(unsigned short FrameIndex, int fx , int fy );
	void drawModule(unsigned char moduleId ,int mx,int my, int bReverse = false);
	void drawAction(int acid, int frmid, int x,int y);
	int GetModuleWidth(unsigned char moduleId) const	{ return pModule[moduleId].w;	};
	int GetModuleHeight(int i) const	{	return pModule[i].h;	};
	int GetModuleCount() const	{	return nModules;	}
	char GetActionSize(int i) const	{	return m_actionSize[i];	}
};

#endif

⌨️ 快捷键说明

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