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

📄 cdatapacket.cpp

📁 <B>DirectX9.0 3D游戏编程</B>
💻 CPP
字号:
/*******************************************************************
 *         Advanced 3D Game Programming using DirectX 9.0
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * copyright (c) 2003 by Peter A Walsh and Adrian Perez
 * See license.txt for modification and distribution information
 ******************************************************************/
// cDataPacket.cpp: implementation of the cDataPacket class.
//
//////////////////////////////////////////////////////////////////////

#include "cDataPacket.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

cDataPacket::cDataPacket()
{
  d_timesSent = 1;
}

cDataPacket::~cDataPacket()
{

}


void cDataPacket::Init( DWORD time, DWORD id, unsigned short len, char *pData )
{
  d_firstTime = time;
  d_lastTime = time;
  d_id = id;
  d_length = len;
  memcpy( d_data, pData, len );
}


cDataPacket &cDataPacket::operator=( const cDataPacket &otherPacket )
{
  d_timesSent = otherPacket.d_timesSent;
  d_firstTime = otherPacket.d_firstTime;
  d_lastTime = otherPacket.d_lastTime;
  d_id = otherPacket.d_id;
  d_length = otherPacket.d_length;
  memcpy( d_data, otherPacket.d_data, d_length );

  return *this;
}

⌨️ 快捷键说明

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