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

📄 3dmount.cpp

📁 网络游戏魔域源代码 测试可以完整变异
💻 CPP
字号:
// 3DMount.cpp: implementation of the C3DMount class.
//
//////////////////////////////////////////////////////////////////////

#include "3DMount.h"
#include "GameDataSet.h"
#include "3DRoleData.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

C3DMount::C3DMount()
{

}

C3DMount::~C3DMount()
{

}

//--------------------------------------------------------------------
C3DMount*	C3DMount::CreateNew(OBJID idType)
{
	if(idType == ID_NONE)
		return NULL;

	C3DMount* pData = new C3DMount;
	if(!pData)
		return NULL;

	if(!pData->Create(idType))
	{
		SAFE_DELETE(pData);
		return NULL;
	}

	return pData;
}

//--------------------------------------------------------------------
BOOL	C3DMount::Create(OBJID idType)
{
	if(idType == ID_NONE)
		return false;
	const char szIniFile[] = "ini/Mount.ini";
	
	char szTitle[256] = "";
	sprintf(szTitle, "Mount%u", idType);
	
	RolePartInfo* pPartInfo = g_obj3DRoleData.GetRoleRartInfo(ROLEPARTINFO_MOUNT, szTitle);
	if(!pPartInfo)
		::ErrorOut("%s not found in %s!", szTitle, szIniFile);
	
	m_infoPart.idMesh = pPartInfo->idMesh;
	m_infoPart.idTexture = pPartInfo->idTexture;
	m_infoPart.p3DMesh = g_objGameDataSet.Get3DObj(pPartInfo->idMesh);
	m_infoPart.idTexture2 = pPartInfo->idTexture2;
	m_infoPart.fCurrentX = 0.0f;
	m_infoPart.fCurrentY = 0.0f;
	m_infoPart.fSpeedX = pPartInfo->fMoveRateX;
	m_infoPart.fSpeedY = pPartInfo->fMoveRateY;
	// set default motion
	this->SetDefaultMotion();
	m_idType = idType;
	return true;
}

//--------------------------------------------------------------------

⌨️ 快捷键说明

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